@cimulate/copilot-widget 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  `);return u===-1?"":o.stack.slice(u+1)})();try{if(!r.stack)r.stack=a;else if(a){const u=a.indexOf(`
8
8
  `),c=u===-1?-1:a.indexOf(`
9
9
  `,u+1),d=c===-1?"":a.slice(c+1);String(r.stack).endsWith(d)||(r.stack+=`
10
- `+a)}}catch(u){}}throw r}})}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=so(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&gl.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean),legacyInterceptorReqResOrdering:En.transitional(En.boolean),advertiseZstdAcceptEncoding:En.transitional(En.boolean),validateStatusUndefinedResolves:En.transitional(En.boolean)},!1),o!=null&&($.isFunction(o)?n.paramsSerializer={serialize:o}:gl.assertOptions(o,{encode:En.function,serialize:En.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gl.assertOptions(n,{baseUrl:En.spelling("baseURL"),withXsrfToken:En.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=a&&$.merge(a.common,a[n.method]);a&&$.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete a[_]}),n.headers=gn.concat(u,a);const c=[];let d=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;d=d&&w.synchronous;const C=n.transitional||yf;C&&C.legacyInterceptorReqResOrdering?c.unshift(w.fulfilled,w.rejected):c.push(w.fulfilled,w.rejected)});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let p,m=0,T;if(!d){const _=[$g.bind(this),void 0];for(_.unshift(...c),_.push(...f),T=_.length,p=Promise.resolve(n);m<T;)p=p.then(_[m++],_[m++]);return p}T=c.length;let y=n;for(;m<T;){const _=c[m++],w=c[m++];try{y=_(y)}catch(C){w.call(this,C);break}}try{p=$g.call(this,y)}catch(_){return Promise.reject(_)}for(m=0,T=f.length;m<T;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=so(this.defaults,t);const n=Rg(t.baseURL,t.url,t.allowAbsoluteUrls,t);return xg(n,t.params,t.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(t){ao.prototype[t]=function(n,r){return this.request(so(r||{},{method:t,url:n,data:r&&$.hasOwnProp(r,"data")?r.data:void 0}))}}),$.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,u,c){return this.request(so(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:u}))}}ao.prototype[t]=n(),t!=="query"&&(ao.prototype[t+"Form"]=n(!0))});let yC=class Zw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const u=new Promise(c=>{r.subscribe(c),a=c}).then(o);return u.cancel=function(){r.unsubscribe(a)},u},t(function(a,u,c){r.reason||(r.reason=new ya(a,u,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Zw(function(o){t=o}),cancel:t}}};function bC(e){return function(n){return e.apply(null,n)}}function TC(e){return $.isObject(e)&&e.isAxiosError===!0}const Af={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Af).forEach(([e,t])=>{Af[t]=e});function qg(e){const t=new ao(e),n=sg(ao.prototype.request,t);return $.extend(n,ao.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return qg(so(e,o))},n}const Lt=qg(Ea);Lt.Axios=ao,Lt.CanceledError=ya,Lt.CancelToken=yC,Lt.isCancel=kg,Lt.VERSION=Sf,Lt.toFormData=dl,Lt.AxiosError=xe,Lt.Cancel=Lt.CanceledError,Lt.all=function(t){return Promise.all(t)},Lt.spread=bC,Lt.isAxiosError=TC,Lt.mergeConfig=so,Lt.AxiosHeaders=gn,Lt.formToJSON=e=>Cg($.isHTMLForm(e)?new FormData(e):e),Lt.getAdapter=jg.getAdapter,Lt.HttpStatusCode=Af,Lt.default=Lt;const{Axios:cU,AxiosError:dU,CanceledError:fU,isCancel:hU,CancelToken:pU,VERSION:mU,all:gU,Cancel:EU,isAxiosError:yU,spread:bU,toFormData:TU,AxiosHeaders:_U,HttpStatusCode:SU,formToJSON:xU,getAdapter:wU,mergeConfig:AU,create:vU}=Lt;class _C{constructor(t,n,r,o=!1,a,u){we(this,"CIMULATE_API_HEADER","x-cimulate-api-key");we(this,"CIMULATE_SEARCH_API_HOST","search.cimulate");we(this,"CIMULATE_SEARCH_API_PATH","api/v1");we(this,"baseApiUrl");we(this,"headers",{});we(this,"fetchConfig",()=>Je(this,null,function*(){try{const t=yield Lt.get(`${this.apiUrl}/configs/copilot`,{headers:this.headers}),{customer_config:n}=t.data,r=atob(n);return JSON.parse(r)}catch(t){throw console.error("Error fetching customer config:",t),t}}));we(this,"_mapCopilotUrlToSearchUrl",(t="",n=!1)=>{if(t.endsWith("io")){const o=new URL(t);return o.hostname=o.hostname.replace(/^copilot\./,"api."),o.origin}return n?`https://staging.${this.CIMULATE_SEARCH_API_HOST}.ai`:`https://prod.${this.CIMULATE_SEARCH_API_HOST}.ai`});if(n&&r||!n&&!r)throw new Error("Provide exactly one authentication method: either 'apiKey' or 'apiToken', but not both.");n?this.headers[this.CIMULATE_API_HEADER]=n:r&&(this.headers.Authorization=`Bearer ${r}`),a&&(this.headers["x-cimulate-customer-id"]=a),u&&(this.headers["Tenant-ID"]=u),this.baseApiUrl=this._mapCopilotUrlToSearchUrl(t,o)}get apiUrl(){return`${this.baseApiUrl}/${this.CIMULATE_SEARCH_API_PATH}`}}class SC{constructor(t,n,r,o=!1,a,u){we(this,"apiService");we(this,"config",null);we(this,"getConfig",()=>Je(this,null,function*(){if(this.config)return this.config;try{const t=yield this.apiService.fetchConfig();return this.config=t,this.config}catch(t){throw console.error("Failed to fetch customer config:",t),t}}));we(this,"getPid",t=>this.getProductFieldValue(t,"pidCol"));we(this,"getName",t=>this.getProductFieldValue(t,"nameCol"));we(this,"getDescription",t=>this.getProductFieldValue(t,"description"));we(this,"getBrand",t=>this.getProductFieldValue(t,"productBrandCol"));we(this,"getPrice",t=>this.getProductFieldValue(t,"priceCol"));we(this,"getRelativePdp",t=>this.getProductFieldValue(t,"relativePdpCol"));we(this,"getPdp",t=>this.getProductFieldValue(t,"pdpCol"));we(this,"getImage",t=>this.getProductFieldValue(t,"imageCol"));we(this,"getProductHiddenFields",()=>{const t=this.getProductField("productHiddenFields");return Array.isArray(t)?t:[]});we(this,"getProductField",t=>this.config?this.config[t]:"");we(this,"getProductFieldValue",(t,n)=>{const r=this.getProductField(n);return r&&t[r]||""});this.apiService=new _C(t,n,r,o,a,u)}getPriceDisplay(t){const n=this.getPrice(t);return n?typeof n=="string"?n.includes("$")?n:`$${n}`:typeof n=="number"?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n):n:""}}const Xo=(e,t,n,...r)=>{if(!e)return;const o=["background: linear-gradient(90deg,rgba(253, 99, 99, 1) 0%, rgba(245, 139, 35, 1) 65%)","font-weight: bold","color: transparent","background-clip: text","text-fill-color: transparent"].join(";");console[t]("%c[cimulate-widget]",o,n,...r)};class xC{constructor(t=!1){we(this,"isDevelopment");we(this,"_log",(t,n,...r)=>{Xo(this.isDevelopment,t,n,...r)});this.isDevelopment=t}log(t,...n){this._log("log",t,...n)}warn(t,...n){this._log("warn",t,...n)}error(t,...n){this._log("error",t,...n)}info(t,...n){this._log("info",t,...n)}debug(t,...n){this._log("debug",t,...n)}}const wC={copilot:"Your Search Assistant",messaging:"Commerce Client"},Yg=B.createContext(null),AC=({mode:e,logoUrl:t,headerText:n,headerConfig:r,globalClassName:o="",entryMessage:a,openLinksInNewTab:u=!1,disclaimerText:c,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:p,searchPlaceholder:m,searchButtonLabel:T,searchConfig:y,suggestionButtonConfig:_,messageAlignment:w="start",autoScroll:C=!0,componentConfig:A,conversationHistory:P,resetConversationMessage:v="",apiKey:H,apiToken:Y,baseUrl:D,customerId:q,tenantId:re,theme:me,isDevelopment:V,__features:oe,routingAttributes:ce,enableDownloadTranscript:de=!0,enableEscalationToAgent:ne=!0,children:Te})=>{const Pe=e==="messaging",se=B.useMemo(()=>{const Se=ce==null?void 0:ce.isCartMgmtSupported;return Se===!0||Se==="true"},[ce]),K=B.useMemo(()=>Pe?{config:null}:new SC(D,H,Y,V,q,re),[Pe,D,H,Y,V,q,re]),ie=B.useMemo(()=>new xC(V),[V]);B.useEffect(()=>{Pe||!K||K.config||K.getConfig()},[K,Pe]);const k=B.useMemo(()=>kA(me),[me]),L=B.useMemo(()=>{const Se=(y==null?void 0:y.placeholder)||m,je=(y==null?void 0:y.buttonLabel)||T;let Ee="icon";return y!=null&&y.buttonType?Ee=y.buttonType:T&&(Ee="text"),pe(F({},y||{}),{placeholder:Se,buttonLabel:je,buttonType:Ee})},[y,m,T]),ee=B.useMemo(()=>pe(F({},r||{}),{logoUrl:t||(r==null?void 0:r.logoUrl),headerText:(r==null?void 0:r.headerText)||n||wC[e!=null?e:"copilot"]}),[r,t,n,e]),I=B.useMemo(()=>({configModule:K,mode:e!=null?e:"copilot",headerConfig:ee,entryMessage:a,globalClassName:o,openLinksInNewTab:u,disclaimerText:c,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:p,themeVariables:k,logger:ie,searchConfig:L,suggestionButtonConfig:_,messageAlignment:w,autoScroll:C,enableMinimize:!!(A!=null&&A.enableMinimize),enableDownloadTranscript:de,enableEscalationToAgent:ne,resetConversationMessage:v,conversationHistory:{sinceHours:typeof(P==null?void 0:P.sinceHours)=="number"?P.sinceHours:1,limit:P==null?void 0:P.limit},features:oe,isCartMgmtSupported:se}),[K,e,ee,a,o,f,p,c,d,u,L,_,w,C,A,de,ne,v,ie,k,P,oe,se]);return x.jsx(Yg.Provider,{value:I,children:Te})},rt=()=>{const e=B.useContext(Yg);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e};class vC{constructor(){we(this,"initialState",{connected:!1,mode:"embedded",entryType:"search",status:{type:"dialog",isOpen:!1,isMinimized:!1},dialog:{position:"bottom-left",isFullHeight:!1,width:""},modal:{isFullscreen:!1}});we(this,"connectedProxy");we(this,"modeProxy");we(this,"entryTypeProxy");we(this,"statusProxy");we(this,"dialogProxy");we(this,"modalProxy",{isFullscreen:!1});we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on UIState`);return PC(n,r),Reflect.set(t,n,r)});this.connectedProxy=new Proxy({connected:this.initialState.connected},{get:this._fullGet,set:this._fullSet}),this.modeProxy=new Proxy({mode:this.initialState.mode},{get:this._fullGet,set:this._fullSet}),this.entryTypeProxy=new Proxy({entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.statusProxy=new Proxy({type:this.initialState.status.type,isOpen:this.initialState.status.isOpen,isMinimized:this.initialState.status.isMinimized},{get:this._fullGet,set:this._fullSet}),this.dialogProxy=new Proxy({position:this.initialState.dialog.position,isFullHeight:this.initialState.dialog.isFullHeight,width:this.initialState.dialog.width},{get:this._fullGet,set:this._fullSet}),this.modalProxy=new Proxy({isFullscreen:this.initialState.modal.isFullscreen},{get:this._fullGet,set:this._fullSet})}get connected(){return this.connectedProxy.connected}get mode(){return this.modeProxy.mode}get isOpen(){return!!this.statusProxy.isOpen}get isMinimized(){return!!this.statusProxy.isMinimized}get type(){return this.statusProxy.type}get entryType(){return this.entryTypeProxy.entryType}get position(){return this.dialogProxy.position}get state(){return{connected:this.connected,mode:this.mode,entryType:this.entryType,status:{type:this.type,isOpen:this.isOpen,isMinimized:this.isMinimized},dialog:{position:this.position,isFullHeight:this.dialogProxy.isFullHeight,width:this.dialogProxy.width},modal:{isFullscreen:this.modalProxy.isFullscreen}}}}const et=new vC,uo=()=>et.connected,ba=()=>et.isOpen,CC=e=>{window.addEventListener(uf,e)},kC=e=>{window.removeEventListener(uf,e)},PC=(e,t)=>{const n=new CustomEvent(uf,{detail:{property:e,value:t}});window.dispatchEvent(n)},NC=e=>{et.connectedProxy.connected=e},Ta=e=>{if(!["ask_cim","search","browse","pdp"].includes(e))throw new Error(`Invalid entryType: "${e}". Must be 'ask_cim', 'search', 'browse', or 'pdp'.`);et.entryTypeProxy.entryType=e},ui=e=>{const t=et.statusProxy.isOpen,n=typeof e=="boolean"?e:!t;et.statusProxy.isOpen=n,n&&(et.statusProxy.isMinimized=!1)},El=e=>{const t=et.statusProxy.isMinimized,n=typeof e=="boolean"?e:!t;et.statusProxy.isMinimized=n,n&&(et.statusProxy.isOpen=!1)},vf=e=>{et.modalProxy.isFullscreen=e},yl=e=>{if(!["chat","dialog","modal"].includes(e))throw new Error(`Invalid type: ${e}. Must be 'chat', 'dialog', or 'modal'.`);et.statusProxy.type=e,e==="dialog"||e==="chat"?et.modeProxy.mode="embedded":et.modeProxy.mode="standalone"},Cf=e=>{const t=["top","top-left","top-right","bottom","bottom-left","bottom-right","left","right","center"];if(!t.includes(e))throw new Error(`Invalid position: ${e}. Must be one of ${t.join(", ")}.`);et.dialogProxy.position=e},OC=e=>{const t=et.dialogProxy.isFullHeight,n=typeof e=="boolean"?e:!t;et.dialogProxy.isFullHeight=n},IC=({onCopilotEvent:e,children:t,dispatch:n})=>{const{logger:r}=rt(),o=B.useCallback(v=>{n({type:mt.SET_COPILOT,payload:v})},[n]),a=B.useCallback(v=>{NC(v),n({type:mt.SET_CONNECTED,payload:v})},[n]),u=B.useCallback(()=>{n({type:mt.RESET_COPILOT,payload:{}})},[n]),c=B.useCallback(()=>{n({type:mt.RESET_STATE,payload:{}})},[n]),d=B.useCallback(v=>{r==null||r.log(`${v.name} event received`,v),n({type:mt.ADD_MESSAGE,payload:v}),v.bypassHandlers||e==null||e(v)},[e,r,n]),f=B.useCallback(v=>{n({type:mt.ADD_LOADING_MESSAGE,payload:v})},[n]),p=B.useCallback(v=>{n({type:mt.REMOVE_LOADING_MESSAGE,payload:v})},[n]),m=B.useCallback(v=>{d(v),f(v.id)},[d,f]),T=B.useCallback(v=>{n({type:mt.SET_ACTIVE_CONVERSATION_ID,payload:v})},[n]),y=B.useCallback(v=>{n({type:mt.ADD_CONVERSATION_ID,payload:v})},[n]),_=B.useCallback(v=>{n({type:mt.SET_CONVERSATION_IDS,payload:v})},[n]),w=B.useCallback(v=>{n({type:mt.SET_IMAGE_FILE,payload:v})},[n]),C=B.useCallback(v=>{n({type:mt.SET_ASK_CIM_PROMPTS,payload:v})},[n]),A=B.useCallback(v=>{n({type:mt.SET_CONVERSATION_HISTORY_LOADED,payload:v})},[n]),P=B.useMemo(()=>({setCopilot:o,setConnected:a,resetCopilot:u,resetCopilotState:c,addCopilotEvent:d,addLoadingMessage:f,removeLoadingMessage:p,handleCopilotRequestAck:m,setActiveConversationId:T,addConversationId:y,setConversationIds:_,setImageFile:w,setAskCimPrompts:C,setConversationHistoryLoaded:A}),[o,a,u,c,d,f,p,m,T,y,_,w,C,A]);return x.jsx(og.Provider,{value:P,children:t})};xA();const RC=(e,t)=>{const{type:n,payload:r}=t;if(n===mt.ADD_MESSAGE){const o=r;if(e.messages.push(o),o.eventSourceId){const a=e.groupedMessages.findIndex(u=>u.eventSourceId===o.eventSourceId);if(a!==-1){let u=e.groupedMessages[a].messages;u||(u=[]);const c=u.findIndex(d=>d.id===o.id);if(c!==-1){u[c]=o;return}u.push(o);return}else{e.groupedMessages.push({type:"group",eventSourceId:o.eventSourceId,messages:[o],createdAt:new Date(o.createdAt)});return}}e.groupedMessages.push({type:"individual",message:o,createdAt:new Date(o.createdAt)});return}switch(n){case mt.RESET_STATE:e.messages=ro.messages,e.groupedMessages=ro.groupedMessages,e.loadingMessages=ro.loadingMessages,e.imageFile=ro.imageFile,e.askCimPrompts=ro.askCimPrompts,e.conversationHistoryLoaded=ro.conversationHistoryLoaded;break;case mt.RESET_COPILOT:e.copilot=null;break;case mt.SET_COPILOT:e.copilot=r;break;case mt.SET_CONNECTED:e.connected=r;break;case mt.ADD_LOADING_MESSAGE:e.loadingMessages.add(r);break;case mt.REMOVE_LOADING_MESSAGE:e.loadingMessages.delete(r);break;case mt.SET_ACTIVE_CONVERSATION_ID:e.activeConversationId=r;break;case mt.ADD_CONVERSATION_ID:{const o=r;e.conversationIds.includes(o)||e.conversationIds.push(o)}break;case mt.SET_CONVERSATION_IDS:e.conversationIds=r;break;case mt.SET_IMAGE_FILE:e.imageFile=r;break;case mt.SET_ASK_CIM_PROMPTS:e.askCimPrompts.requestId=(r==null?void 0:r.requestId)||null,e.askCimPrompts.message=(r==null?void 0:r.message)||null;break;case mt.SET_CONVERSATION_HISTORY_LOADED:e.conversationHistoryLoaded=r;break}},LC=({onCopilotEvent:e,children:t})=>{const[n,r]=ng(RC,ro);return x.jsx(ig.Provider,{value:n,children:x.jsx(IC,{onCopilotEvent:e,dispatch:r,children:t})})};function DC(){var e=B.useRef(!0);return e.current?(e.current=!1,!0):e.current}function MC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function FC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var kf=typeof window!="undefined",_a=function(e){B.useEffect(e,[])},BC=function(e){var t=B.useRef(e);t.current=e,_a(function(){return function(){return t.current()}})},UC=function(e){var t=B.useRef(0),n=B.useState(e),r=n[0],o=n[1],a=B.useCallback(function(u){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){o(u)})},[]);return BC(function(){cancelAnimationFrame(t.current)}),[r,a]},HC=function(e,t){return e===t};function zC(e,t){t===void 0&&(t=HC);var n=B.useRef(),r=B.useRef(e),o=DC();return!o&&!t(r.current,e)&&(n.current=r.current,r.current=e),n.current}var jC=function(e){var t={},n=t.initialWidth,r=n===void 0?1/0:n,o=t.initialHeight,a=o===void 0?1/0:o,u=t.onChange,c=UC({width:kf?window.innerWidth:r,height:kf?window.innerHeight:a}),d=c[0],f=c[1];return B.useEffect(function(){if(kf){var p=function(){var m=window.innerWidth,T=window.innerHeight;f({width:m,height:T}),u&&u(m,T)};return MC(window,"resize",p),function(){FC(window,"resize",p)}}},[]),d};class $C{constructor(){we(this,"items",[]);we(this,"add",t=>{const n=this.first();n&&n.context===t.context&&this.remove(),this.items.push(t)});we(this,"remove",()=>this.items.shift());we(this,"first",()=>this.items.length>0?this.items[0]:null);we(this,"clear",()=>{this.items.length=0});we(this,"processQueue",t=>{new Array(yn.size).fill(1).forEach(()=>{const r=yn.first();r&&(t(r),yn.remove())})})}get size(){return this.items.length}}const yn=new $C,Wg=e=>{window.addEventListener(af,e)},Gg=e=>{window.removeEventListener(af,e)},VC=(e,t,n)=>{const r=new CustomEvent(af,{detail:{event:e,property:t,value:n}});window.dispatchEvent(r)},Xg=e=>{window.addEventListener(sf,e)},Kg=e=>{window.removeEventListener(sf,e)},qC=(e,t,n)=>{const r=new CustomEvent(sf,{detail:{event:e,property:t,value:n}});window.dispatchEvent(r)},Qg=e=>{window.addEventListener(of,e)},Jg=e=>{window.removeEventListener(of,e)},Zg=(e,t,n)=>{const r=new CustomEvent(of,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)},YC=e=>{window.addEventListener(cf,e)},WC=e=>{window.removeEventListener(cf,e)},bl=(e,t,n)=>{const r=new CustomEvent(cf,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)};class GC{constructor(){we(this,"initialParams",{categoryId:"",categoryName:"",page:null,pageSize:null,includeFacets:!0,facetFilters:{},rangeFilters:[],catalogSegment:null,pricebooks:null});we(this,"categoryIdProxy");we(this,"facetFiltersProxy");we(this,"rangeFiltersProxy");we(this,"catalogSegmentProxy");we(this,"pricebooksProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{const o=vA[n];return qC(o,n,r),Reflect.set(t,n,r)});we(this,"updateFacetFiltersProxy",t=>new Proxy({facetFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updateRangeFiltersProxy",t=>new Proxy({rangeFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updatePricebooksProxy",t=>new Proxy({pricebooks:t},{get:this._fullGet,set:this._fullSet}));this.categoryIdProxy=new Proxy({categoryId:this.initialParams.categoryId,categoryName:this.initialParams.categoryName},{get:this._fullGet,set:this._fullSet}),this.facetFiltersProxy=this.updateFacetFiltersProxy(this.initialParams.facetFilters||{}),this.rangeFiltersProxy=this.updateRangeFiltersProxy(this.initialParams.rangeFilters||[]),this.catalogSegmentProxy=new Proxy({catalogSegment:this.initialParams.catalogSegment},{get:this._fullGet,set:this._fullSet}),this.pricebooksProxy=this.updatePricebooksProxy(this.initialParams.pricebooks||null)}get categoryId(){return this.categoryIdProxy.categoryId||""}get facetFilters(){return this.facetFiltersProxy.facetFilters||{}}get rangeFilters(){return this.rangeFiltersProxy.rangeFilters||[]}get catalogSegment(){return this.catalogSegmentProxy.catalogSegment||null}get pricebooks(){return this.pricebooksProxy.pricebooks||null}get state(){return{categoryId:this.categoryId,categoryName:this.categoryIdProxy.categoryName,facetFilters:this.facetFilters,rangeFilters:this.rangeFilters,catalogSegment:this.catalogSegment,pricebooks:this.pricebooks,page:this.initialParams.page,pageSize:this.initialParams.pageSize,includeFacets:this.initialParams.includeFacets}}}const ct=new GC,e1=(e,t)=>{const n=t.updateFacetFiltersProxy(e);t.facetFiltersProxy.facetFilters=n.facetFilters},t1=(e,t,n)=>{var u,c;const r=F({},((u=n.facetFiltersProxy)==null?void 0:u.facetFilters)||{});if(!!((c=r[e])!=null&&c.includes(t))){const d=r[e].filter(f=>f!==t);d.length>0?r[e]=d:delete r[e]}else r[e]=r[e]?[...r[e],t]:[t];const a=n.updateFacetFiltersProxy(r);n.facetFiltersProxy.facetFilters=a.facetFilters},n1=(e,t)=>{const n=t.updateRangeFiltersProxy(e);t.rangeFiltersProxy.rangeFilters=n.rangeFilters},r1=({field:e,value:t},n)=>{const[r,o]=Array.isArray(t)?t:[];if(typeof r=="undefined"||typeof o=="undefined")throw new Error("Range values must be an array with two numbers for min and max");const a=[...n.rangeFiltersProxy.rangeFilters||[]],u=a.findIndex(d=>d.field===e);if(u!==-1){a[u]={field:e,min:r,max:o},n.rangeFiltersProxy.rangeFilters=a;return}a.push({field:e,min:r,max:o});const c=n.updateRangeFiltersProxy(a);n.rangeFiltersProxy.rangeFilters=c.rangeFilters},i1=(e,t)=>{t.catalogSegmentProxy.catalogSegment=e},o1=(e,t)=>{const n=t.updatePricebooksProxy(e);t.pricebooksProxy.pricebooks=n.pricebooks},XC=e=>{if(!uo()||!ba()){uo()&&yn.clear(),yn.add({context:"browse",payload:pe(F({},ct.state),{categoryId:e})});return}ct.categoryIdProxy.categoryId=e},s1=e=>{e1(e,ct)},KC=(e,t)=>{t1(e,t,ct)},a1=e=>{n1(e,ct)},QC=({field:e,value:t})=>{r1({field:e,value:t},ct)},JC=e=>{i1(e,ct)},u1=e=>{o1(e,ct)},l1=e=>{if(!e||!("categoryId"in e))throw new Error("Browse context must include a categoryId");const t=uo(),n=ba();if(!t||!n){t&&yn.clear(),yn.add({context:"browse",payload:F({},e)});return}"facetFilters"in e&&s1(e.facetFilters||{}),"rangeFilters"in e&&a1(e.rangeFilters||[]),"catalogSegment"in e&&(ct.catalogSegmentProxy.catalogSegment=e.catalogSegment||null),"pricebooks"in e&&u1(e.pricebooks||[]),"categoryName"in e&&(ct.categoryIdProxy.categoryName=e.categoryName||""),ct.categoryIdProxy.categoryId=e.categoryId},ZC=Object.freeze(Object.defineProperty({__proto__:null,setBrowseContext:l1,updateBrowseCategoryId:XC,updateCatalogSegment:JC,updateFacetFilter:KC,updateFacetFilters:s1,updatePricebooks:u1,updateRangeFilter:QC,updateRangeFilters:a1},Symbol.toStringTag,{value:"Module"}));class ek{constructor(){we(this,"initialParams",{productId:"",productName:"",pdpLink:""});we(this,"proxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>(Zg(n,r),Reflect.set(t,n,r)));we(this,"updateProxy",t=>{t.productId&&(this.proxy=new Proxy({productId:t.productId,productName:t.productName||"",pdpLink:t.pdpLink||""},{get:this._fullGet,set:this._fullSet}))});this.proxy=new Proxy({productId:this.initialParams.productId,productName:this.initialParams.productName,pdpLink:this.initialParams.pdpLink},{get:this._fullGet,set:this._fullSet})}get productId(){return this.proxy.productId}get pdpLink(){return this.proxy.pdpLink}get state(){return{productId:this.productId,productName:this.proxy.productName,pdpLink:this.pdpLink}}}const _r=new ek,c1=e=>{if(!e||!e.productId)throw new Error("PDP context must include a productId");const t=uo(),n=ba();if(!t||!n){t&&yn.clear(),yn.add({context:"pdp",payload:F({},e)});return}_r.updateProxy(e),Zg("pdp-context",e)},tk=e=>{_r.proxy.productId=e,uo()||yn.add({context:"pdp",payload:F({},_r.state)})},nk=e=>{_r.proxy.pdpLink=e},gt={SET_PROMPTS_EXTENSION_INITIALIZED:"SET_PROMPTS_EXTENSION_INITIALIZED",SET_PROMPTS_EXTENSION_OPEN:"SET_PROMPTS_EXTENSION_OPEN",SET_PROMPTS_EXTENSION_INLINE:"SET_PROMPTS_EXTENSION_INLINE",SET_PROMPTS_EXTENSION_ELEMENT_ID:"SET_PROMPTS_EXTENSION_ELEMENT_ID",SET_PROMPTS_EXTENSION_ENTRY_TYPE:"SET_PROMPTS_EXTENSION_ENTRY_TYPE",SET_PROMPTS_EXTENSION_PARAMS:"SET_PROMPTS_EXTENSION_PARAMS",RESET_PROMPTS_EXTENSION_PARAMS:"RESET_PROMPTS_EXTENSION_PARAMS",SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",SET_PROMPTS_EXTENSION_USER_PROMPT:"SET_PROMPTS_EXTENSION_USER_PROMPT",SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_LOADING:"SET_PROMPTS_EXTENSION_RESPONSE_LOADING"},d1={isInitialized:!1,isOpen:!1,isInline:!1,elementId:null,placeholder:null,askElseButtonLabel:null,entryType:null,params:null,activePromptsId:null,userPrompt:null,promptsMessage:null,isResponseLoading:!1,responseMessage:null,promptsDisplay:"both",disableAskElseButton:!1};class rk{constructor(){we(this,"initialState",d1);we(this,"promptsStateProxy");we(this,"promptsParamsProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return Sa(n,r),Reflect.set(t,n,r)});we(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));we(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));we(this,"updatePromptsParamsProxy",t=>new Proxy(F({},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 Ht=new rk,ik=e=>{window.addEventListener(lf,e)},ok=e=>{window.removeEventListener(lf,e)},Sa=(e,t)=>{const n=new CustomEvent(lf,{detail:{property:e,value:t}});window.dispatchEvent(n)},f1=e=>{const t=Ht.isOpen,n=typeof e=="boolean"?e:!t;Ht.promptsStateProxy.isOpen=n},h1=e=>{const t=Ht.isInline,n=typeof e=="boolean"?e:!t;Ht.promptsStateProxy.isInline=n},sk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="ask_cim"},ak=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="search"},uk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="browse"},lk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="pdp"},ck=({elementId:e,entryType:t,params:n,isInline:r})=>{Ht.promptsStateProxy.elementId=e,t&&(Ht.promptsStateProxy.entryType=t),typeof r=="boolean"&&h1(r),n&&Ht.updatePromptsParamsProxy(n),Ht.isOpen||f1(!0)},dk=Object.freeze(Object.defineProperty({__proto__:null,getConversationMessages:({payload:e,callback:t})=>{bl("getConversationMessages",{payload:e,callback:t},Ci.GET_CONVERSATION_MESSAGES)},getSessionInformation:e=>{bl("getSessionInformation",{callback:e},Ci.GET_SESSION_INFORMATION)},loadConversation:e=>{bl("loadConversation",e,Ci.LOAD_CONVERSATION)},resetConversation:()=>{bl("resetConversation",!0,Ci.RESET_CONVERSATION)}},Symbol.toStringTag,{value:"Module"}));class fk{constructor(){we(this,"initialParams",{query:"",page:null,pageSize:null,includeFacets:!0,facetFilters:{},rangeFilters:[],catalogSegment:null,pricebooks:null});we(this,"queryProxy");we(this,"facetFiltersProxy");we(this,"rangeFiltersProxy");we(this,"catalogSegmentProxy");we(this,"pricebooksProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{const o=CA[n];return VC(o,n,r),Reflect.set(t,n,r)});we(this,"updateFacetFiltersProxy",t=>new Proxy({facetFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updateRangeFiltersProxy",t=>new Proxy({rangeFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updatePricebooksProxy",t=>new Proxy({pricebooks:t},{get:this._fullGet,set:this._fullSet}));this.queryProxy=new Proxy({query:this.initialParams.query},{get:this._fullGet,set:this._fullSet}),this.facetFiltersProxy=this.updateFacetFiltersProxy(this.initialParams.facetFilters||{}),this.rangeFiltersProxy=this.updateRangeFiltersProxy(this.initialParams.rangeFilters||[]),this.catalogSegmentProxy=new Proxy({catalogSegment:this.initialParams.catalogSegment},{get:this._fullGet,set:this._fullSet}),this.pricebooksProxy=this.updatePricebooksProxy(this.initialParams.pricebooks||null)}get query(){return this.queryProxy.query||""}get facetFilters(){return this.facetFiltersProxy.facetFilters||{}}get rangeFilters(){return this.rangeFiltersProxy.rangeFilters||[]}get catalogSegment(){return this.catalogSegmentProxy.catalogSegment||null}get pricebooks(){return this.pricebooksProxy.pricebooks||null}get state(){return{query:this.query,facetFilters:this.facetFilters,rangeFilters:this.rangeFilters,catalogSegment:this.catalogSegment,pricebooks:this.pricebooks,page:this.initialParams.page,pageSize:this.initialParams.pageSize,includeFacets:this.initialParams.includeFacets}}}const Tt=new fk,hk=e=>{const t=ba(),n=uo();if(!n||!t){n&&yn.clear(),yn.add({context:"search",payload:pe(F({},Tt.state),{query:e})});return}Tt.queryProxy.query=e},p1=e=>{e1(e,Tt)},pk=(e,t)=>{t1(e,t,Tt)},m1=e=>{n1(e,Tt)},mk=({field:e,value:t})=>{r1({field:e,value:t},Tt)},gk=e=>{i1(e,Tt)},g1=e=>{o1(e,Tt)},E1=e=>{if(!e||!e.query)throw new Error("Search context must include a query");const t=ba(),n=uo();if(!n||!t){n&&yn.clear(),yn.add({context:"search",payload:F({},e)});return}"facetFilters"in e&&p1(e.facetFilters||{}),"rangeFilters"in e&&m1(e.rangeFilters||[]),"catalogSegment"in e&&(Tt.catalogSegmentProxy.catalogSegment=e.catalogSegment||null),"pricebooks"in e&&g1(e.pricebooks||[]),Tt.queryProxy.query=e.query},Ek=Object.freeze(Object.defineProperty({__proto__:null,setSearchContext:E1,updateCatalogSegment:gk,updateFacetFilter:pk,updateFacetFilters:p1,updatePricebooks:g1,updateRangeFilter:mk,updateRangeFilters:m1,updateSearchQuery:hk},Symbol.toStringTag,{value:"Module"})),yk={categoryId:ct.categoryId,categoryName:ct.categoryIdProxy.categoryName||"",facetFilters:ct.facetFilters,rangeFilters:ct.rangeFilters,catalogSegment:ct.catalogSegment,pricebooks:ct.pricebooks},y1=B.createContext(yk),bk=({children:e})=>{const[t,n]=B.useState(ct.categoryId),[r,o]=B.useState(ct.categoryIdProxy.categoryName||""),[a,u]=B.useState(ct.facetFilters||{}),[c,d]=B.useState(ct.rangeFilters||[]),[f,p]=B.useState(ct.catalogSegment||null),[m,T]=B.useState(ct.pricebooks||null);B.useEffect(()=>{const _=({detail:w})=>{(w==null?void 0:w.property)==="categoryId"&&n(w.value),(w==null?void 0:w.property)==="categoryName"&&o(w.value),(w==null?void 0:w.property)==="facetFilters"&&u(w.value),(w==null?void 0:w.property)==="rangeFilters"&&d(w.value),(w==null?void 0:w.property)==="catalogSegment"&&p(w.value),(w==null?void 0:w.property)==="pricebooks"&&T(w.value)};return Xg(_),()=>{Kg(_)}},[]);const y=B.useMemo(()=>({categoryId:t,categoryName:r,facetFilters:a,rangeFilters:c,catalogSegment:f,pricebooks:m}),[t,r,a,c,f,m]);return x.jsx(y1.Provider,{value:y,children:e})},Tk=()=>{const e=B.useContext(y1);if(!e)throw new Error("useBrowse must be used within a BrowseProvider");return e},_k={searchQuery:Tt.query,facetFilters:Tt.facetFilters,rangeFilters:Tt.rangeFilters,catalogSegment:Tt.catalogSegment,pricebooks:Tt.pricebooks},b1=B.createContext(_k),Sk=({children:e})=>{const[t,n]=B.useState(Tt.query),[r,o]=B.useState(Tt.facetFilters),[a,u]=B.useState(Tt.rangeFilters),[c,d]=B.useState(Tt.catalogSegment),[f,p]=B.useState(Tt.pricebooks);B.useEffect(()=>{const T=({detail:y})=>{(y==null?void 0:y.property)==="query"&&n(y.value),(y==null?void 0:y.property)==="facetFilters"&&o(y.value),(y==null?void 0:y.property)==="rangeFilters"&&u(y.value),(y==null?void 0:y.property)==="catalogSegment"&&d(y.value),(y==null?void 0:y.property)==="pricebooks"&&p(y.value)};return Wg(T),()=>{Gg(T)}},[]);const m=B.useMemo(()=>({searchQuery:t,facetFilters:r,rangeFilters:a,catalogSegment:c,pricebooks:f}),[t,r,a,c,f]);return x.jsx(b1.Provider,{value:m,children:e})},xk=()=>{const e=B.useContext(b1);if(!e)throw new Error("useSearch must be used within a SearchProvider");return e},wk={productId:_r.productId,pdpLink:_r.pdpLink},T1=B.createContext(wk),Ak=({children:e})=>{const[t,n]=B.useState(_r.productId),[r,o]=B.useState(_r.pdpLink);B.useEffect(()=>{const u=({detail:c})=>{if((c==null?void 0:c.property)==="pdp-context"){const d=c.value;n(d.productId),o(d.pdpLink);return}(c==null?void 0:c.property)==="productId"&&n(c.value),(c==null?void 0:c.property)==="pdpLink"&&o(c.value)};return Qg(u),()=>{Jg(u)}},[]);const a=B.useMemo(()=>({productId:t,pdpLink:r}),[t,r]);return x.jsx(T1.Provider,{value:a,children:e})},vk=()=>{const e=B.useContext(T1);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},_1=B.createContext({mode:et.modeProxy.mode,entryType:et.entryType,status:et.statusProxy,dialogPosition:et.dialogProxy.position,isDialogFullHeight:et.dialogProxy.isFullHeight,dialogWidth:et.dialogProxy.width,isModalFullscreen:et.modalProxy.isFullscreen,previousComponentType:et.statusProxy.type}),Ck=({entryType:e,componentConfig:t,componentType:n,children:r})=>{const[o,a]=B.useState(e!=null?e:et.entryTypeProxy.entryType),[u,c]=B.useState(et.modeProxy.mode),[d,f]=B.useState({type:n||et.statusProxy.type,isOpen:et.statusProxy.isOpen,isMinimized:et.statusProxy.isMinimized}),[p,m]=B.useState(et.dialogProxy.position),[T,y]=B.useState(et.dialogProxy.isFullHeight),[_,w]=B.useState(et.dialogProxy.width),[C,A]=B.useState(et.modalProxy.isFullscreen),P=zC(d.type);B.useEffect(()=>{const H=Y=>{const{property:D,value:q}=Y.detail||{};if(!(!D||q===void 0)){if(D==="mode"){c(q);return}if(D==="entryType"){a(q);return}if(D==="isMinimized"){f(re=>pe(F({},re),{isMinimized:q}));return}if(D==="isOpen"){f(re=>pe(F({},re),{isOpen:q}));return}if(D==="type"){f(re=>pe(F({},re),{type:q}));return}if(D==="position"){m(q);return}if(D==="isFullHeight"){y(q);return}if(D==="width"){w(q);return}if(D==="isFullscreen"){A(q);return}}};return CC(H),()=>{kC(H)}},[]),_a(()=>{e&&Ta(e)}),_a(()=>{const H=n||(t==null?void 0:t.type);H&&yl(H),t&&"isOpen"in t&&ui(!!t.isOpen),t&&"isMinimized"in t&&El(!!t.isMinimized)}),_a(()=>{if(!(t!=null&&t.options))return;const{dialogPosition:H}=t.options;H&&Cf(H),"dialogFullHeight"in t.options&&OC(!!t.options.dialogFullHeight),"dialogWidth"in t.options&&t.options.dialogWidth&&w(t.options.dialogWidth),"isModalFullscreen"in t.options&&vf(!!t.options.isModalFullscreen)});const v=B.useMemo(()=>({mode:u,entryType:o,status:d,previousComponentType:P||"dialog",dialogPosition:p,isDialogFullHeight:T,dialogWidth:_,isModalFullscreen:C}),[u,o,d,P,p,T,_,C]);return x.jsx(_1.Provider,{value:v,children:r})},sr=()=>{const e=B.useContext(_1);if(!e)throw new Error("useUIState must be used within a UIStateProvider");return e},S1=B.createContext(null),x1=B.createContext(null),Pf=()=>{const e=B.useContext(x1);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},li=()=>{const e=B.useContext(S1);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},Ko=()=>{const e=B.useContext(og);if(!e)throw new Error("useCopilotDispatch must be used within a CopilotProvider");return e},ar=()=>{const e=B.useContext(ig);if(!e)throw new Error("useCopilotState must be used within a CopilotProvider");return e},kk=({copilot:e})=>{const{logger:t,conversationHistory:n}=rt(),{isInline:r}=li(),{addCopilotEvent:o,setConversationHistoryLoaded:a}=Ko(),{activeConversationId:u}=ar(),c=B.useCallback(f=>{e&&e.requestSessionInformation(p=>{t==null||t.log("Retrieved session information: ",p),f==null||f(p)})},[e,t]),d=B.useCallback((f,p)=>{e&&f.conversationId&&e.getConversationEvents(f,m=>{t==null||t.log("Retrieved conversation messages: ",m),p==null||p(m)})},[e,t]);return B.useEffect(()=>{if(r||!u)return;if(n.sinceHours===0||(n==null?void 0:n.limit)===0){a(!0);return}const f=3600*1e3*n.sinceHours,p=new Date(Date.now()-f).toISOString(),m={conversationId:u,since:p,excludeEvents:["done","error","connection_error","refined_browse","refined_search","conversation_reset"]};typeof n.limit=="number"&&(m.limit=n.limit),d(m,T=>{const y=[];[...T.reverse()||[]].forEach(w=>{var A;const C=T.find(P=>P.id===w.eventSourceId);(A=C==null?void 0:C.name)!=null&&A.endsWith("_suggestions")||(w.bypassHandlers=!0,y.unshift(w))}),y.forEach(w=>{o(w)}),a(!0)})},[t,r,u,d,o,a,n]),{getSessionInformation:c,getConversationMessages:d}},w1=B.createContext({copilot:null,messages:[],groupedMessages:[],isLoading:!1,isResponseLoading:()=>!1,handleAskCim:()=>{},handleSearch:()=>{},handleBrowse:()=>{},handlePdp:()=>{},handleSuggestion:()=>{},handleUserInput:()=>{},handleCancel:()=>{},resetConversation:()=>{},getSessionInformation:()=>{},getConversationMessages:()=>{}}),Pk=({apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:f})=>{const{logger:p,clientContext:m,baseCatalogParams:T}=rt(),cn=xk(),{searchQuery:y}=cn,_=mn(cn,["searchQuery"]),Hn=Tk(),{categoryId:w}=Hn,C=mn(Hn,["categoryId"]),{productId:A,pdpLink:P}=vk(),{setCopilot:v,setConnected:H,resetCopilot:Y,resetCopilotState:D,addCopilotEvent:q,removeLoadingMessage:re,handleCopilotRequestAck:me,setActiveConversationId:V,setConversationIds:oe,setAskCimPrompts:ce}=Ko(),{connected:de,copilot:ne,messages:Te,groupedMessages:Pe,loadingMessages:se,askCimPrompts:K}=ar(),{status:ie,entryType:k}=sr(),{isInline:L}=li(),{getConversationMessages:ee,getSessionInformation:I}=kk({copilot:ne}),Se=B.useMemo(()=>se.size>0,[se]),je=B.useCallback(Ae=>se.has(Ae),[se]),Ee=B.useCallback(({query:Ae,facetFilters:Oe,rangeFilters:Me,catalogSegment:ot,pricebooks:pt,userPrompt:J,imageFile:ge})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const Ce={searchParams:{query:Ae}};J&&(Ce.userPrompt=J),ge&&(Ce.attachments={image:ge}),Oe&&Object.keys(Oe).length>0&&(Ce.searchParams.facetFilters=Oe),Me&&Me.length>0&&(Ce.searchParams.rangeFilters=Me),ot&&(Ce.searchParams.catalogSegment=ot),pt&&(Ce.searchParams.pricebooks=pt),m&&(Ce.clientContext=m),Ta("search"),ne.search(Ce,qe=>{const Re=F({},qe);me(Re)})},[p,me,ne,m]),Fe=B.useCallback(({categoryId:Ae,categoryName:Oe,facetFilters:Me,rangeFilters:ot,catalogSegment:pt,pricebooks:J,userPrompt:ge,imageFile:Ce})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}const qe=Me&&Object.keys(Me).length>0;if(Ae===""&&!qe){p==null||p.error("Browse event must include facetFilters when categoryId is empty");return}const Re={browseParams:{categoryId:Ae||""}};ge&&(Re.userPrompt=ge),Ce&&(Re.attachments={image:Ce}),qe&&(Re.browseParams.facetFilters=Me),ot&&ot.length>0&&(Re.browseParams.rangeFilters=ot),pt&&(Re.browseParams.catalogSegment=pt),Array.isArray(J)&&J.length>0&&(Re.browseParams.pricebooks=J),(m||Oe)&&(Re.clientContext={},m&&(Re.clientContext=F({},m)),Oe&&(Re.clientContext.cimLabel=Oe)),Ta("browse"),ne.browse(Re,dt=>{var Qr;const Gt=F({},dt),$t=((Qr=Gt.request)==null?void 0:Qr.clientContext)||{},dn=($t==null?void 0:$t.cimLabel)||Oe;dn&&Gt.request&&(Gt.request.label=dn),me(Gt)})},[p,me,ne,m]),$e=B.useCallback(({productId:Ae,productName:Oe,pdpLink:Me,userPrompt:ot,imageFile:pt})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const J={productId:Ae};ot&&(J.userPrompt=ot),Me&&(J.pdpLink=Me),pt&&(J.attachments={image:pt}),(m||Oe)&&(J.clientContext={},m&&(J.clientContext=F({},m)),Oe&&(J.clientContext.cimLabel=Oe)),T&&(J.baseCatalogParams=T),Ta("pdp"),ne.productView(J,ge=>{var dt;const Ce=F({},ge),qe=((dt=Ce.request)==null?void 0:dt.clientContext)||{},Re=(qe==null?void 0:qe.cimLabel)||Oe;Re&&Ce.request&&(Ce.request.label=Re),me(Ce)})},[p,ne,me,m,T]),Ge=B.useCallback(({userPrompt:Ae,imageFile:Oe})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const Me={userPrompt:Ae};Oe&&(Me.attachments={image:Oe}),m&&(Me.clientContext=m),T&&(Me.baseCatalogParams=T),ne.askCim(Me,ot=>{const pt=F({},ot);me(pt)})},[p,ne,me,m,T]),_t=B.useCallback(Ae=>{q(Ae),c==null||c(Ae)},[q,c]),Nn=B.useCallback(Ae=>{q(Ae),d==null||d(Ae)},[q,d]),ln=B.useCallback(Ae=>{u==null||u(Ae),H(!0)},[u,H]);B.useEffect(()=>{!ne||!de||!ie.isOpen||yn.size>0&&yn.processQueue(Ae=>{if(Ae.context==="search"){const Oe=F({},Ae.payload);E1(Oe)}if(Ae.context==="browse"){const Oe=F({},Ae.payload);l1(Oe)}if(Ae.context==="pdp"){const Oe=F({},Ae.payload);c1(Oe)}})},[ie.isOpen,ne,de]);const Cr=B.useCallback(Ae=>{const Oe=Me=>{const ot=pe(F({},Me),{id:Me.inquiryLinkId||Me.id});q(ot)};Ae.on("connect_ack",ln),Ae.on("partial_inquiry",Oe),Ae.on("display_products",q),Ae.on("progress",q),Ae.on("refined_search",_t),Ae.on("refined_browse",Nn),Ae.on("done",Me=>{re(Me.eventSourceId)}),Ae.on("error",Me=>{q(Me),re(Me.eventSourceId)}),Ae.onDisconnect(Me=>{const ot=["io server disconnect","transport error","server shutting down"];if(p==null||p.log("Connection disconnected with reason: ",Me),!ot.includes(Me)){H(!1);return}p==null||p.log("De-registering event listeners");const pt=new Date().toISOString();q({name:"error",message:"Connection was lost. Please try again.",createdAt:pt,id:`error-${pt}`,sessionId:"session"}),Ae.off()})},[p,H,re,_t,Nn,q,ln]);B.useEffect(()=>{if(!ne)return;const Ae=Oe=>{if(!L){if(!Oe.message&&Oe.eventSourceId&&Oe.eventSourceId===K.requestId){ce({requestId:Oe.eventSourceId,message:Oe});return}q(Oe)}};return ne.on("follow_up",Ae),()=>{ne.off("follow_up",Ae)}},[ne,Te,K.requestId,L,q,ce]),B.useEffect(()=>{if(!ne)return;const Ae=Oe=>{if(L)return;const Me=pe(F({},Oe),{id:Oe.inquiryLinkId||Oe.id});q(Me)};return ne.on("inquiry",Ae),()=>{ne.off("inquiry",Ae)}},[ne,L,q]),_a(()=>{let Ae;n?Ae=n:Ae=a?"https://staging.copilot.search.cimulate.ai":"https://prod.copilot.search.cimulate.ai";const Oe={baseUrl:Ae};e?Oe.apiKey=e:t&&(Oe.apiToken=t),r&&(Oe.customerId=r),o&&(Oe.tenantId=o);const Me=new fA(Oe);return v(Me),Cr(Me),Me.connect(),Me.requestSessionInformation(ot=>{p==null||p.log("Session Information: ",ot);const{activeConversationId:pt,conversationIds:J}=ot.data||{};pt&&V(pt),J!=null&&J.length&&oe(J)}),()=>{Me.disconnect(),Me.off(),Y()}});const fr=B.useCallback(Ae=>{if(!ne)return;const Oe={eventId:Ae,reason:"User cancelled the request"};ne.cancelRequest(Oe,Me=>{q(Me),re(Ae)})},[q,re,ne]),nn=B.useCallback(()=>{ne&&ne.conversationReset({},Ae=>{D(),q(Ae),ne.requestSessionInformation(Oe=>{p==null||p.log("Session Information: ",Oe);const{activeConversationId:Me,conversationIds:ot}=Oe.data||{};Me&&V(Me),ot!=null&&ot.length&&oe(ot)})})},[ne,p,q,D,V,oe]),Ve=B.useCallback((Ae,Oe)=>{if(!Ae)return;const Me={userPrompt:Ae};switch(Oe&&(Me.imageFile=Oe),k){case"ask_cim":Ge(Me);return;case"search":y?Ee(F(F({query:y},_),Me)):Ge(Me);return;case"browse":Fe(F(F({categoryId:w},C),Me));return;case"pdp":A?$e(F({productId:A,pdpLink:P||""},Me)):Ge(Me);return}},[k,y,_,Ee,Ge,w,C,Fe,$e,A,P]),Pt=B.useCallback((Ae,Oe)=>{var ge,Ce,qe;const ot=Ae.params.userPrompt||"";if(!ot)return;const pt=Te.find(Re=>Re.id===Oe);if(!pt)return;const J=pt.name.replace("_suggestions","");if(J==="ask_cim"){Ge({userPrompt:ot});return}if(J==="copilot_search"){const Re=((ge=pt.request)==null?void 0:ge.searchParams)||{},Gt=Re.query===y;Ee(pe(F({query:Re.query||y},Gt?_:{}),{userPrompt:ot}));return}if(J==="copilot_browse"){const Re=pt.request,dt=Re.browseParams||{},$t=dt.categoryId===w,dn=((Ce=Re.clientContext)==null?void 0:Ce.cimLabel)||"";Fe(pe(F({categoryId:dt.categoryId||w||""},$t?C:{}),{categoryName:dn,userPrompt:ot}));return}if(J==="product_view"){const Re=pt.request||{},dt=Re.productId,Gt=dt===A,$t=((qe=Re.clientContext)==null?void 0:qe.cimLabel)||"";let dn="";Gt?dn=P||"":dn=Re.pdpLink||"",$e({productId:dt||A,pdpLink:dn,productName:$t,userPrompt:ot})}},[Te,y,_,Ee,Ge,w,C,Fe,$e,A,P]),On=B.useMemo(()=>({copilot:ne,messages:Te,groupedMessages:Pe,isLoading:Se,isResponseLoading:je,handleAskCim:Ge,handleSearch:Ee,handleBrowse:Fe,handlePdp:$e,handleUserInput:Ve,handleSuggestion:Pt,handleCancel:fr,resetConversation:nn,getSessionInformation:I,getConversationMessages:ee}),[ne,Te,Pe,Se,je,Ge,Ee,Fe,$e,Ve,Pt,fr,nn,I,ee]);return x.jsx(w1.Provider,{value:On,children:f})},A1=()=>{const{copilot:e}=ar(),{addCopilotEvent:t}=Ko();return{getCopilotSuggestions:B.useCallback((r,o,a)=>{if(!e||!o||!r)return;const u=c=>{t(c),a(c)};switch(o){case"ask_cim":e.askCimSuggestions(r,u);break;case"search":e.searchSuggestions({searchParams:r},u);break;case"browse":e.browseSuggestions({browseParams:r},u);break;case"pdp":e.productViewSuggestions({productId:r.productId},u);break}},[e,t])}},Ur=()=>{const e=B.useContext(w1);if(!e)throw new Error("useCopilot must be used within a CopilotProvider");return e},Nk=()=>{const{copilot:e,activeConversationId:t,askCimPrompts:n,conversationHistoryLoaded:r}=ar(),{entryType:o}=sr(),{resetCopilotState:a,addCopilotEvent:u,setAskCimPrompts:c}=Ko(),{handleSearch:d,handleBrowse:f,handlePdp:p,resetConversation:m,getSessionInformation:T,getConversationMessages:y}=Ur(),{getCopilotSuggestions:_}=A1();B.useEffect(()=>{!e||!o||!t||!r||n.requestId||o==="ask_cim"&&_({},o,P=>{c({requestId:P.id,message:null})})},[e,t,n.requestId,o,r,_,c]);const w=B.useCallback(({query:P})=>{if(!e||!P)return;const{facetFilters:v}=Tt.facetFiltersProxy,{rangeFilters:H}=Tt.rangeFiltersProxy,{catalogSegment:Y}=Tt.catalogSegmentProxy,{pricebooks:D}=Tt.pricebooksProxy,q={query:P};q.facetFilters=v||{},q.rangeFilters=H||[],q.catalogSegment=Y||"",q.pricebooks=D||[],d(F({},q))},[e,d]),C=B.useCallback(({categoryId:P})=>{if(!e)return;const v=ct.categoryIdProxy.categoryName,{facetFilters:H}=ct.facetFiltersProxy,{rangeFilters:Y}=ct.rangeFiltersProxy,{catalogSegment:D}=ct.catalogSegmentProxy,{pricebooks:q}=ct.pricebooksProxy,re={categoryId:P};re.categoryName=v||"",re.facetFilters=H||{},re.rangeFilters=Y||[],re.catalogSegment=D||"",re.pricebooks=q||[],f(F({},re))},[e,f]),A=B.useCallback(({productId:P})=>{if(!e||!P)return;const v={productId:P,pdpLink:_r.pdpLink,productName:_r.proxy.productName||""};p(v)},[e,p]);return B.useEffect(()=>{const P=({detail:v})=>{(v==null?void 0:v.property)==="query"&&w({query:v.value})};return Wg(P),()=>{Gg(P)}},[w]),B.useEffect(()=>{const P=({detail:v})=>{if((v==null?void 0:v.property)==="pdp-context"){const H=v.value;A({productId:H.productId});return}(v==null?void 0:v.property)==="productId"&&A({productId:v.value})};return Qg(P),()=>{Jg(P)}},[A]),B.useEffect(()=>{const P=({detail:v})=>{(v==null?void 0:v.property)==="categoryId"&&C({categoryId:v.value})};return Xg(P),()=>{Kg(P)}},[C]),B.useEffect(()=>{const P=({detail:v})=>{if((v==null?void 0:v.event)==Ci.RESET_CONVERSATION&&m(),(v==null?void 0:v.event)==Ci.GET_SESSION_INFORMATION){const H=v.value.callback;T(H)}if((v==null?void 0:v.event)==Ci.GET_CONVERSATION_MESSAGES){const{payload:H,callback:Y}=v.value;if(!H.conversationId||typeof Y!="function")return;y(H,Y)}if((v==null?void 0:v.event)==Ci.LOAD_CONVERSATION){const H=v.value;if(!H.conversationId)return;y(H,D=>{a(),D.forEach(q=>{u(q)})})}};return YC(P),()=>{WC(P)}},[m,T,y,a,u]),null},Ok=({apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:f})=>x.jsxs(Pk,{apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:[x.jsx(Nk,{}),f]}),Ik=({children:e,dispatch:t})=>{const n=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_INITIALIZED,payload:_})},[t]),r=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_OPEN,payload:_})},[t]),o=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_INLINE,payload:_})},[t]),a=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ELEMENT_ID,payload:_})},[t]),u=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ENTRY_TYPE,payload:_})},[t]),c=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID,payload:_})},[t]),d=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_USER_PROMPT,payload:_})},[t]),f=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_PARAMS,payload:_})},[t]),p=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE,payload:_})},[t]),m=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE,payload:_})},[t]),T=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING,payload:_})},[t]),y=B.useMemo(()=>({setIsInitialized:n,setIsOpen:r,setIsInline:o,setElementId:a,setEntryType:u,setActivePromptsId:c,setUserPrompt:d,setParams:f,setPromptsMessage:p,setResponseMessage:m,setIsResponseLoading:T}),[n,r,o,a,u,c,d,f,p,m,T]);return x.jsx(x1.Provider,{value:y,children:e})},Rk=(e,t)=>{const{type:n,payload:r}=t;switch(n){case gt.SET_PROMPTS_EXTENSION_INITIALIZED:e.isInitialized=r;break;case gt.SET_PROMPTS_EXTENSION_OPEN:e.isOpen=r;break;case gt.SET_PROMPTS_EXTENSION_INLINE:e.isInline=r;break;case gt.SET_PROMPTS_EXTENSION_ELEMENT_ID:e.elementId=r;break;case gt.SET_PROMPTS_EXTENSION_ENTRY_TYPE:e.entryType=r;break;case gt.SET_PROMPTS_EXTENSION_PARAMS:e.params=r;break;case gt.RESET_PROMPTS_EXTENSION_PARAMS:e.params=null;break;case gt.SET_PROMPTS_EXTENSION_USER_PROMPT:e.userPrompt=r;break;case gt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=r;break;case gt.RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=null;break;case gt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=r;break;case gt.RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=null;break;case gt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=r;break;case gt.RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=null;break;case gt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING:e.isResponseLoading=r;break}},Lk=({promptsConfig:e,children:t})=>{const[n,r]=ng(Rk,F(F({},d1),e||{}));return x.jsx(S1.Provider,{value:n,children:x.jsx(Ik,{dispatch:r,children:t})})},v1=({mode:e,apiKey:t,apiToken:n,baseUrl:r,customerId:o,tenantId:a,logoUrl:u,headerText:c,headerConfig:d,theme:f,openLinksInNewTab:p,globalClassName:m,isDevelopment:T=!1,componentType:y,componentConfig:_,entryType:w,entryMessage:C,disclaimerText:A,disclaimerMarkdown:P,clientContext:v,baseCatalogParams:H,searchPlaceholder:Y,searchButtonLabel:D,searchConfig:q,suggestionButtonConfig:re,messageAlignment:me,autoScroll:V,promptsConfig:oe,resetConversationMessage:ce,conversationHistory:de,onConnect:ne,onCopilotEvent:Te,onRefinedSearch:Pe,onRefinedBrowse:se,__features:K,children:ie})=>x.jsx(AC,{mode:e,baseUrl:r,apiKey:t,apiToken:n,customerId:o,tenantId:a,logoUrl:u,headerText:c,headerConfig:d,entryMessage:C,theme:f,globalClassName:m,openLinksInNewTab:p,searchPlaceholder:Y,searchButtonLabel:D,searchConfig:q,suggestionButtonConfig:re,messageAlignment:me,autoScroll:V,componentConfig:_,clientContext:v,baseCatalogParams:H,disclaimerMarkdown:P,disclaimerText:A,resetConversationMessage:ce,conversationHistory:de,isDevelopment:T,__features:K,children:x.jsx(Ck,{entryType:w,componentConfig:_,componentType:y,children:x.jsx(LC,{onCopilotEvent:Te,children:x.jsx(Ak,{children:x.jsx(bk,{children:x.jsx(Sk,{children:x.jsx(Lk,{promptsConfig:oe,children:x.jsx(Ok,{apiKey:t,apiToken:n,baseUrl:r,customerId:o,tenantId:a,isDevelopment:T,entryType:w,onConnect:ne,onRefinedSearch:Pe,onRefinedBrowse:se,onCopilotEvent:Te,children:ie})})})})})})})});var Nf={exports:{}},Dn={},Of={exports:{}},If={};var C1;function Dk(){return C1||(C1=1,(function(e){function t(K,ie){var k=K.length;K.push(ie);e:for(;0<k;){var L=k-1>>>1,ee=K[L];if(0<o(ee,ie))K[L]=ie,K[k]=ee,k=L;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var ie=K[0],k=K.pop();if(k!==ie){K[0]=k;e:for(var L=0,ee=K.length,I=ee>>>1;L<I;){var Se=2*(L+1)-1,je=K[Se],Ee=Se+1,Fe=K[Ee];if(0>o(je,k))Ee<ee&&0>o(Fe,je)?(K[L]=Fe,K[Ee]=k,L=Ee):(K[L]=je,K[Se]=k,L=Se);else if(Ee<ee&&0>o(Fe,k))K[L]=Fe,K[Ee]=k,L=Ee;else break e}}return ie}function o(K,ie){var k=K.sortIndex-ie.sortIndex;return k!==0?k:K.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var d=[],f=[],p=1,m=null,T=3,y=!1,_=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(K){for(var ie=n(f);ie!==null;){if(ie.callback===null)r(f);else if(ie.startTime<=K)r(f),ie.sortIndex=ie.expirationTime,t(d,ie);else break;ie=n(f)}}function H(K){if(w=!1,v(K),!_)if(n(d)!==null)_=!0,Pe(Y);else{var ie=n(f);ie!==null&&se(H,ie.startTime-K)}}function Y(K,ie){_=!1,w&&(w=!1,A(re),re=-1),y=!0;var k=T;try{for(v(ie),m=n(d);m!==null&&(!(m.expirationTime>ie)||K&&!oe());){var L=m.callback;if(typeof L=="function"){m.callback=null,T=m.priorityLevel;var ee=L(m.expirationTime<=ie);ie=e.unstable_now(),typeof ee=="function"?m.callback=ee:m===n(d)&&r(d),v(ie)}else r(d);m=n(d)}if(m!==null)var I=!0;else{var Se=n(f);Se!==null&&se(H,Se.startTime-ie),I=!1}return I}finally{m=null,T=k,y=!1}}var D=!1,q=null,re=-1,me=5,V=-1;function oe(){return!(e.unstable_now()-V<me)}function ce(){if(q!==null){var K=e.unstable_now();V=K;var ie=!0;try{ie=q(!0,K)}finally{ie?de():(D=!1,q=null)}}else D=!1}var de;if(typeof P=="function")de=function(){P(ce)};else if(typeof MessageChannel!="undefined"){var ne=new MessageChannel,Te=ne.port2;ne.port1.onmessage=ce,de=function(){Te.postMessage(null)}}else de=function(){C(ce,0)};function Pe(K){q=K,D||(D=!0,de())}function se(K,ie){re=C(function(){K(e.unstable_now())},ie)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){_||y||(_=!0,Pe(Y))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):me=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return T},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(K){switch(T){case 1:case 2:case 3:var ie=3;break;default:ie=T}var k=T;T=ie;try{return K()}finally{T=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,ie){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var k=T;T=K;try{return ie()}finally{T=k}},e.unstable_scheduleCallback=function(K,ie,k){var L=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?L+k:L):k=L,K){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=k+ee,K={id:p++,callback:ie,priorityLevel:K,startTime:k,expirationTime:ee,sortIndex:-1},k>L?(K.sortIndex=k,t(f,K),n(d)===null&&K===n(f)&&(w?(A(re),re=-1):w=!0,se(H,k-L))):(K.sortIndex=ee,t(d,K),_||y||(_=!0,Pe(Y))),K},e.unstable_shouldYield=oe,e.unstable_wrapCallback=function(K){var ie=T;return function(){var k=T;T=ie;try{return K.apply(this,arguments)}finally{T=k}}}})(If)),If}var k1;function Mk(){return k1||(k1=1,Of.exports=Dk()),Of.exports}var P1;function Fk(){if(P1)return Dn;P1=1;var e=Cn(),t=Mk();function n(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,l=1;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(i,s){u(i,s),u(i+"Capture",s)}function u(i,s){for(o[i]=s,i=0;i<s.length;i++)r.add(s[i])}var c=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function T(i){return d.call(m,i)?!0:d.call(p,i)?!1:f.test(i)?m[i]=!0:(p[i]=!0,!1)}function y(i,s,l,h){if(l!==null&&l.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function _(i,s,l,h){if(s===null||typeof s=="undefined"||y(i,s,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(i,s,l,h,E,b,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=E,this.mustUseProperty=l,this.propertyName=i,this.type=s,this.sanitizeURL=b,this.removeEmptyString=S}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new w(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new w(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function P(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function v(i,s,l,h){var E=C.hasOwnProperty(s)?C[s]:null;(E!==null?E.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(_(s,l,E,h)&&(l=null),h||E===null?T(s)&&(l===null?i.removeAttribute(s):i.setAttribute(s,""+l)):E.mustUseProperty?i[E.propertyName]=l===null?E.type===3?!1:"":l:(s=E.attributeName,h=E.attributeNamespace,l===null?i.removeAttribute(s):(E=E.type,l=E===3||E===4&&l===!0?"":""+l,h?i.setAttributeNS(h,s,l):i.setAttribute(s,l))))}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for("react.element"),D=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),oe=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),K=Symbol.iterator;function ie(i){return i===null||typeof i!="object"?null:(i=K&&i[K]||i["@@iterator"],typeof i=="function"?i:null)}var k=Object.assign,L;function ee(i){if(L===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);L=s&&s[1]||""}return`
10
+ `+a)}}catch(u){}}throw r}})}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=so(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&gl.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean),legacyInterceptorReqResOrdering:En.transitional(En.boolean),advertiseZstdAcceptEncoding:En.transitional(En.boolean),validateStatusUndefinedResolves:En.transitional(En.boolean)},!1),o!=null&&($.isFunction(o)?n.paramsSerializer={serialize:o}:gl.assertOptions(o,{encode:En.function,serialize:En.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gl.assertOptions(n,{baseUrl:En.spelling("baseURL"),withXsrfToken:En.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=a&&$.merge(a.common,a[n.method]);a&&$.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete a[_]}),n.headers=gn.concat(u,a);const c=[];let d=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;d=d&&w.synchronous;const C=n.transitional||yf;C&&C.legacyInterceptorReqResOrdering?c.unshift(w.fulfilled,w.rejected):c.push(w.fulfilled,w.rejected)});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let p,m=0,T;if(!d){const _=[$g.bind(this),void 0];for(_.unshift(...c),_.push(...f),T=_.length,p=Promise.resolve(n);m<T;)p=p.then(_[m++],_[m++]);return p}T=c.length;let y=n;for(;m<T;){const _=c[m++],w=c[m++];try{y=_(y)}catch(C){w.call(this,C);break}}try{p=$g.call(this,y)}catch(_){return Promise.reject(_)}for(m=0,T=f.length;m<T;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=so(this.defaults,t);const n=Rg(t.baseURL,t.url,t.allowAbsoluteUrls,t);return xg(n,t.params,t.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(t){ao.prototype[t]=function(n,r){return this.request(so(r||{},{method:t,url:n,data:r&&$.hasOwnProp(r,"data")?r.data:void 0}))}}),$.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,u,c){return this.request(so(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:u}))}}ao.prototype[t]=n(),t!=="query"&&(ao.prototype[t+"Form"]=n(!0))});let yC=class Zw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const u=new Promise(c=>{r.subscribe(c),a=c}).then(o);return u.cancel=function(){r.unsubscribe(a)},u},t(function(a,u,c){r.reason||(r.reason=new ya(a,u,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Zw(function(o){t=o}),cancel:t}}};function bC(e){return function(n){return e.apply(null,n)}}function TC(e){return $.isObject(e)&&e.isAxiosError===!0}const Af={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Af).forEach(([e,t])=>{Af[t]=e});function qg(e){const t=new ao(e),n=sg(ao.prototype.request,t);return $.extend(n,ao.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return qg(so(e,o))},n}const Lt=qg(Ea);Lt.Axios=ao,Lt.CanceledError=ya,Lt.CancelToken=yC,Lt.isCancel=kg,Lt.VERSION=Sf,Lt.toFormData=dl,Lt.AxiosError=xe,Lt.Cancel=Lt.CanceledError,Lt.all=function(t){return Promise.all(t)},Lt.spread=bC,Lt.isAxiosError=TC,Lt.mergeConfig=so,Lt.AxiosHeaders=gn,Lt.formToJSON=e=>Cg($.isHTMLForm(e)?new FormData(e):e),Lt.getAdapter=jg.getAdapter,Lt.HttpStatusCode=Af,Lt.default=Lt;const{Axios:cU,AxiosError:dU,CanceledError:fU,isCancel:hU,CancelToken:pU,VERSION:mU,all:gU,Cancel:EU,isAxiosError:yU,spread:bU,toFormData:TU,AxiosHeaders:_U,HttpStatusCode:SU,formToJSON:xU,getAdapter:wU,mergeConfig:AU,create:vU}=Lt;class _C{constructor(t,n,r,o=!1,a,u){we(this,"CIMULATE_API_HEADER","x-cimulate-api-key");we(this,"CIMULATE_SEARCH_API_HOST","search.cimulate");we(this,"CIMULATE_SEARCH_API_PATH","api/v1");we(this,"baseApiUrl");we(this,"headers",{});we(this,"fetchConfig",()=>Je(this,null,function*(){try{const t=yield Lt.get(`${this.apiUrl}/configs/copilot`,{headers:this.headers}),{customer_config:n}=t.data,r=atob(n);return JSON.parse(r)}catch(t){throw console.error("Error fetching customer config:",t),t}}));we(this,"_mapCopilotUrlToSearchUrl",(t="",n=!1)=>{if(t.endsWith("io")){const o=new URL(t);return o.hostname=o.hostname.replace(/^copilot\./,"api."),o.origin}return n?`https://staging.${this.CIMULATE_SEARCH_API_HOST}.ai`:`https://prod.${this.CIMULATE_SEARCH_API_HOST}.ai`});if(n&&r||!n&&!r)throw new Error("Provide exactly one authentication method: either 'apiKey' or 'apiToken', but not both.");n?this.headers[this.CIMULATE_API_HEADER]=n:r&&(this.headers.Authorization=`Bearer ${r}`),a&&(this.headers["x-cimulate-customer-id"]=a),u&&(this.headers["Tenant-ID"]=u),this.baseApiUrl=this._mapCopilotUrlToSearchUrl(t,o)}get apiUrl(){return`${this.baseApiUrl}/${this.CIMULATE_SEARCH_API_PATH}`}}class SC{constructor(t,n,r,o=!1,a,u){we(this,"apiService");we(this,"config",null);we(this,"getConfig",()=>Je(this,null,function*(){if(this.config)return this.config;try{const t=yield this.apiService.fetchConfig();return this.config=t,this.config}catch(t){throw console.error("Failed to fetch customer config:",t),t}}));we(this,"getPid",t=>this.getProductFieldValue(t,"pidCol"));we(this,"getName",t=>this.getProductFieldValue(t,"nameCol"));we(this,"getDescription",t=>this.getProductFieldValue(t,"description"));we(this,"getBrand",t=>this.getProductFieldValue(t,"productBrandCol"));we(this,"getPrice",t=>this.getProductFieldValue(t,"priceCol"));we(this,"getRelativePdp",t=>this.getProductFieldValue(t,"relativePdpCol"));we(this,"getPdp",t=>this.getProductFieldValue(t,"pdpCol"));we(this,"getImage",t=>this.getProductFieldValue(t,"imageCol"));we(this,"getProductHiddenFields",()=>{const t=this.getProductField("productHiddenFields");return Array.isArray(t)?t:[]});we(this,"getProductField",t=>this.config?this.config[t]:"");we(this,"getProductFieldValue",(t,n)=>{const r=this.getProductField(n);return r&&t[r]||""});this.apiService=new _C(t,n,r,o,a,u)}getPriceDisplay(t){const n=this.getPrice(t);return n?typeof n=="string"?n.includes("$")?n:`$${n}`:typeof n=="number"?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n):n:""}}const Xo=(e,t,n,...r)=>{if(!e)return;const o=["background: linear-gradient(90deg,rgba(253, 99, 99, 1) 0%, rgba(245, 139, 35, 1) 65%)","font-weight: bold","color: transparent","background-clip: text","text-fill-color: transparent"].join(";");console[t]("%c[cimulate-widget]",o,n,...r)};class xC{constructor(t=!1){we(this,"isDevelopment");we(this,"_log",(t,n,...r)=>{Xo(this.isDevelopment,t,n,...r)});this.isDevelopment=t}log(t,...n){this._log("log",t,...n)}warn(t,...n){this._log("warn",t,...n)}error(t,...n){this._log("error",t,...n)}info(t,...n){this._log("info",t,...n)}debug(t,...n){this._log("debug",t,...n)}}const wC={copilot:"Your Search Assistant",messaging:"Commerce Client"},Yg=B.createContext(null),AC=({mode:e,logoUrl:t,headerText:n,headerConfig:r,globalClassName:o="",entryMessage:a,openLinksInNewTab:u=!1,disclaimerText:c,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:p,searchPlaceholder:m,searchButtonLabel:T,searchConfig:y,suggestionButtonConfig:_,messageAlignment:w="start",autoScroll:C=!0,componentConfig:A,conversationHistory:P,resetConversationMessage:v="",apiKey:H,apiToken:Y,baseUrl:D,customerId:q,tenantId:re,theme:me,isDevelopment:V,__features:oe,routingAttributes:ce,enableDownloadTranscript:de=!0,enableEscalationToAgent:ne=!1,children:Te})=>{const Pe=e==="messaging",se=B.useMemo(()=>{const Se=ce==null?void 0:ce.isCartMgmtSupported;return Se===!0||Se==="true"},[ce]),K=B.useMemo(()=>Pe?{config:null}:new SC(D,H,Y,V,q,re),[Pe,D,H,Y,V,q,re]),ie=B.useMemo(()=>new xC(V),[V]);B.useEffect(()=>{Pe||!K||K.config||K.getConfig()},[K,Pe]);const k=B.useMemo(()=>kA(me),[me]),L=B.useMemo(()=>{const Se=(y==null?void 0:y.placeholder)||m,je=(y==null?void 0:y.buttonLabel)||T;let Ee="icon";return y!=null&&y.buttonType?Ee=y.buttonType:T&&(Ee="text"),pe(F({},y||{}),{placeholder:Se,buttonLabel:je,buttonType:Ee})},[y,m,T]),ee=B.useMemo(()=>pe(F({},r||{}),{logoUrl:t||(r==null?void 0:r.logoUrl),headerText:(r==null?void 0:r.headerText)||n||wC[e!=null?e:"copilot"]}),[r,t,n,e]),I=B.useMemo(()=>({configModule:K,mode:e!=null?e:"copilot",headerConfig:ee,entryMessage:a,globalClassName:o,openLinksInNewTab:u,disclaimerText:c,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:p,themeVariables:k,logger:ie,searchConfig:L,suggestionButtonConfig:_,messageAlignment:w,autoScroll:C,enableMinimize:!!(A!=null&&A.enableMinimize),enableDownloadTranscript:de,enableEscalationToAgent:ne,resetConversationMessage:v,conversationHistory:{sinceHours:typeof(P==null?void 0:P.sinceHours)=="number"?P.sinceHours:1,limit:P==null?void 0:P.limit},features:oe,isCartMgmtSupported:se}),[K,e,ee,a,o,f,p,c,d,u,L,_,w,C,A,de,ne,v,ie,k,P,oe,se]);return x.jsx(Yg.Provider,{value:I,children:Te})},rt=()=>{const e=B.useContext(Yg);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e};class vC{constructor(){we(this,"initialState",{connected:!1,mode:"embedded",entryType:"search",status:{type:"dialog",isOpen:!1,isMinimized:!1},dialog:{position:"bottom-left",isFullHeight:!1,width:""},modal:{isFullscreen:!1}});we(this,"connectedProxy");we(this,"modeProxy");we(this,"entryTypeProxy");we(this,"statusProxy");we(this,"dialogProxy");we(this,"modalProxy",{isFullscreen:!1});we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on UIState`);return PC(n,r),Reflect.set(t,n,r)});this.connectedProxy=new Proxy({connected:this.initialState.connected},{get:this._fullGet,set:this._fullSet}),this.modeProxy=new Proxy({mode:this.initialState.mode},{get:this._fullGet,set:this._fullSet}),this.entryTypeProxy=new Proxy({entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.statusProxy=new Proxy({type:this.initialState.status.type,isOpen:this.initialState.status.isOpen,isMinimized:this.initialState.status.isMinimized},{get:this._fullGet,set:this._fullSet}),this.dialogProxy=new Proxy({position:this.initialState.dialog.position,isFullHeight:this.initialState.dialog.isFullHeight,width:this.initialState.dialog.width},{get:this._fullGet,set:this._fullSet}),this.modalProxy=new Proxy({isFullscreen:this.initialState.modal.isFullscreen},{get:this._fullGet,set:this._fullSet})}get connected(){return this.connectedProxy.connected}get mode(){return this.modeProxy.mode}get isOpen(){return!!this.statusProxy.isOpen}get isMinimized(){return!!this.statusProxy.isMinimized}get type(){return this.statusProxy.type}get entryType(){return this.entryTypeProxy.entryType}get position(){return this.dialogProxy.position}get state(){return{connected:this.connected,mode:this.mode,entryType:this.entryType,status:{type:this.type,isOpen:this.isOpen,isMinimized:this.isMinimized},dialog:{position:this.position,isFullHeight:this.dialogProxy.isFullHeight,width:this.dialogProxy.width},modal:{isFullscreen:this.modalProxy.isFullscreen}}}}const et=new vC,uo=()=>et.connected,ba=()=>et.isOpen,CC=e=>{window.addEventListener(uf,e)},kC=e=>{window.removeEventListener(uf,e)},PC=(e,t)=>{const n=new CustomEvent(uf,{detail:{property:e,value:t}});window.dispatchEvent(n)},NC=e=>{et.connectedProxy.connected=e},Ta=e=>{if(!["ask_cim","search","browse","pdp"].includes(e))throw new Error(`Invalid entryType: "${e}". Must be 'ask_cim', 'search', 'browse', or 'pdp'.`);et.entryTypeProxy.entryType=e},ui=e=>{const t=et.statusProxy.isOpen,n=typeof e=="boolean"?e:!t;et.statusProxy.isOpen=n,n&&(et.statusProxy.isMinimized=!1)},El=e=>{const t=et.statusProxy.isMinimized,n=typeof e=="boolean"?e:!t;et.statusProxy.isMinimized=n,n&&(et.statusProxy.isOpen=!1)},vf=e=>{et.modalProxy.isFullscreen=e},yl=e=>{if(!["chat","dialog","modal"].includes(e))throw new Error(`Invalid type: ${e}. Must be 'chat', 'dialog', or 'modal'.`);et.statusProxy.type=e,e==="dialog"||e==="chat"?et.modeProxy.mode="embedded":et.modeProxy.mode="standalone"},Cf=e=>{const t=["top","top-left","top-right","bottom","bottom-left","bottom-right","left","right","center"];if(!t.includes(e))throw new Error(`Invalid position: ${e}. Must be one of ${t.join(", ")}.`);et.dialogProxy.position=e},OC=e=>{const t=et.dialogProxy.isFullHeight,n=typeof e=="boolean"?e:!t;et.dialogProxy.isFullHeight=n},IC=({onCopilotEvent:e,children:t,dispatch:n})=>{const{logger:r}=rt(),o=B.useCallback(v=>{n({type:mt.SET_COPILOT,payload:v})},[n]),a=B.useCallback(v=>{NC(v),n({type:mt.SET_CONNECTED,payload:v})},[n]),u=B.useCallback(()=>{n({type:mt.RESET_COPILOT,payload:{}})},[n]),c=B.useCallback(()=>{n({type:mt.RESET_STATE,payload:{}})},[n]),d=B.useCallback(v=>{r==null||r.log(`${v.name} event received`,v),n({type:mt.ADD_MESSAGE,payload:v}),v.bypassHandlers||e==null||e(v)},[e,r,n]),f=B.useCallback(v=>{n({type:mt.ADD_LOADING_MESSAGE,payload:v})},[n]),p=B.useCallback(v=>{n({type:mt.REMOVE_LOADING_MESSAGE,payload:v})},[n]),m=B.useCallback(v=>{d(v),f(v.id)},[d,f]),T=B.useCallback(v=>{n({type:mt.SET_ACTIVE_CONVERSATION_ID,payload:v})},[n]),y=B.useCallback(v=>{n({type:mt.ADD_CONVERSATION_ID,payload:v})},[n]),_=B.useCallback(v=>{n({type:mt.SET_CONVERSATION_IDS,payload:v})},[n]),w=B.useCallback(v=>{n({type:mt.SET_IMAGE_FILE,payload:v})},[n]),C=B.useCallback(v=>{n({type:mt.SET_ASK_CIM_PROMPTS,payload:v})},[n]),A=B.useCallback(v=>{n({type:mt.SET_CONVERSATION_HISTORY_LOADED,payload:v})},[n]),P=B.useMemo(()=>({setCopilot:o,setConnected:a,resetCopilot:u,resetCopilotState:c,addCopilotEvent:d,addLoadingMessage:f,removeLoadingMessage:p,handleCopilotRequestAck:m,setActiveConversationId:T,addConversationId:y,setConversationIds:_,setImageFile:w,setAskCimPrompts:C,setConversationHistoryLoaded:A}),[o,a,u,c,d,f,p,m,T,y,_,w,C,A]);return x.jsx(og.Provider,{value:P,children:t})};xA();const RC=(e,t)=>{const{type:n,payload:r}=t;if(n===mt.ADD_MESSAGE){const o=r;if(e.messages.push(o),o.eventSourceId){const a=e.groupedMessages.findIndex(u=>u.eventSourceId===o.eventSourceId);if(a!==-1){let u=e.groupedMessages[a].messages;u||(u=[]);const c=u.findIndex(d=>d.id===o.id);if(c!==-1){u[c]=o;return}u.push(o);return}else{e.groupedMessages.push({type:"group",eventSourceId:o.eventSourceId,messages:[o],createdAt:new Date(o.createdAt)});return}}e.groupedMessages.push({type:"individual",message:o,createdAt:new Date(o.createdAt)});return}switch(n){case mt.RESET_STATE:e.messages=ro.messages,e.groupedMessages=ro.groupedMessages,e.loadingMessages=ro.loadingMessages,e.imageFile=ro.imageFile,e.askCimPrompts=ro.askCimPrompts,e.conversationHistoryLoaded=ro.conversationHistoryLoaded;break;case mt.RESET_COPILOT:e.copilot=null;break;case mt.SET_COPILOT:e.copilot=r;break;case mt.SET_CONNECTED:e.connected=r;break;case mt.ADD_LOADING_MESSAGE:e.loadingMessages.add(r);break;case mt.REMOVE_LOADING_MESSAGE:e.loadingMessages.delete(r);break;case mt.SET_ACTIVE_CONVERSATION_ID:e.activeConversationId=r;break;case mt.ADD_CONVERSATION_ID:{const o=r;e.conversationIds.includes(o)||e.conversationIds.push(o)}break;case mt.SET_CONVERSATION_IDS:e.conversationIds=r;break;case mt.SET_IMAGE_FILE:e.imageFile=r;break;case mt.SET_ASK_CIM_PROMPTS:e.askCimPrompts.requestId=(r==null?void 0:r.requestId)||null,e.askCimPrompts.message=(r==null?void 0:r.message)||null;break;case mt.SET_CONVERSATION_HISTORY_LOADED:e.conversationHistoryLoaded=r;break}},LC=({onCopilotEvent:e,children:t})=>{const[n,r]=ng(RC,ro);return x.jsx(ig.Provider,{value:n,children:x.jsx(IC,{onCopilotEvent:e,dispatch:r,children:t})})};function DC(){var e=B.useRef(!0);return e.current?(e.current=!1,!0):e.current}function MC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function FC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var kf=typeof window!="undefined",_a=function(e){B.useEffect(e,[])},BC=function(e){var t=B.useRef(e);t.current=e,_a(function(){return function(){return t.current()}})},UC=function(e){var t=B.useRef(0),n=B.useState(e),r=n[0],o=n[1],a=B.useCallback(function(u){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){o(u)})},[]);return BC(function(){cancelAnimationFrame(t.current)}),[r,a]},HC=function(e,t){return e===t};function zC(e,t){t===void 0&&(t=HC);var n=B.useRef(),r=B.useRef(e),o=DC();return!o&&!t(r.current,e)&&(n.current=r.current,r.current=e),n.current}var jC=function(e){var t={},n=t.initialWidth,r=n===void 0?1/0:n,o=t.initialHeight,a=o===void 0?1/0:o,u=t.onChange,c=UC({width:kf?window.innerWidth:r,height:kf?window.innerHeight:a}),d=c[0],f=c[1];return B.useEffect(function(){if(kf){var p=function(){var m=window.innerWidth,T=window.innerHeight;f({width:m,height:T}),u&&u(m,T)};return MC(window,"resize",p),function(){FC(window,"resize",p)}}},[]),d};class $C{constructor(){we(this,"items",[]);we(this,"add",t=>{const n=this.first();n&&n.context===t.context&&this.remove(),this.items.push(t)});we(this,"remove",()=>this.items.shift());we(this,"first",()=>this.items.length>0?this.items[0]:null);we(this,"clear",()=>{this.items.length=0});we(this,"processQueue",t=>{new Array(yn.size).fill(1).forEach(()=>{const r=yn.first();r&&(t(r),yn.remove())})})}get size(){return this.items.length}}const yn=new $C,Wg=e=>{window.addEventListener(af,e)},Gg=e=>{window.removeEventListener(af,e)},VC=(e,t,n)=>{const r=new CustomEvent(af,{detail:{event:e,property:t,value:n}});window.dispatchEvent(r)},Xg=e=>{window.addEventListener(sf,e)},Kg=e=>{window.removeEventListener(sf,e)},qC=(e,t,n)=>{const r=new CustomEvent(sf,{detail:{event:e,property:t,value:n}});window.dispatchEvent(r)},Qg=e=>{window.addEventListener(of,e)},Jg=e=>{window.removeEventListener(of,e)},Zg=(e,t,n)=>{const r=new CustomEvent(of,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)},YC=e=>{window.addEventListener(cf,e)},WC=e=>{window.removeEventListener(cf,e)},bl=(e,t,n)=>{const r=new CustomEvent(cf,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)};class GC{constructor(){we(this,"initialParams",{categoryId:"",categoryName:"",page:null,pageSize:null,includeFacets:!0,facetFilters:{},rangeFilters:[],catalogSegment:null,pricebooks:null});we(this,"categoryIdProxy");we(this,"facetFiltersProxy");we(this,"rangeFiltersProxy");we(this,"catalogSegmentProxy");we(this,"pricebooksProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{const o=vA[n];return qC(o,n,r),Reflect.set(t,n,r)});we(this,"updateFacetFiltersProxy",t=>new Proxy({facetFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updateRangeFiltersProxy",t=>new Proxy({rangeFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updatePricebooksProxy",t=>new Proxy({pricebooks:t},{get:this._fullGet,set:this._fullSet}));this.categoryIdProxy=new Proxy({categoryId:this.initialParams.categoryId,categoryName:this.initialParams.categoryName},{get:this._fullGet,set:this._fullSet}),this.facetFiltersProxy=this.updateFacetFiltersProxy(this.initialParams.facetFilters||{}),this.rangeFiltersProxy=this.updateRangeFiltersProxy(this.initialParams.rangeFilters||[]),this.catalogSegmentProxy=new Proxy({catalogSegment:this.initialParams.catalogSegment},{get:this._fullGet,set:this._fullSet}),this.pricebooksProxy=this.updatePricebooksProxy(this.initialParams.pricebooks||null)}get categoryId(){return this.categoryIdProxy.categoryId||""}get facetFilters(){return this.facetFiltersProxy.facetFilters||{}}get rangeFilters(){return this.rangeFiltersProxy.rangeFilters||[]}get catalogSegment(){return this.catalogSegmentProxy.catalogSegment||null}get pricebooks(){return this.pricebooksProxy.pricebooks||null}get state(){return{categoryId:this.categoryId,categoryName:this.categoryIdProxy.categoryName,facetFilters:this.facetFilters,rangeFilters:this.rangeFilters,catalogSegment:this.catalogSegment,pricebooks:this.pricebooks,page:this.initialParams.page,pageSize:this.initialParams.pageSize,includeFacets:this.initialParams.includeFacets}}}const ct=new GC,e1=(e,t)=>{const n=t.updateFacetFiltersProxy(e);t.facetFiltersProxy.facetFilters=n.facetFilters},t1=(e,t,n)=>{var u,c;const r=F({},((u=n.facetFiltersProxy)==null?void 0:u.facetFilters)||{});if(!!((c=r[e])!=null&&c.includes(t))){const d=r[e].filter(f=>f!==t);d.length>0?r[e]=d:delete r[e]}else r[e]=r[e]?[...r[e],t]:[t];const a=n.updateFacetFiltersProxy(r);n.facetFiltersProxy.facetFilters=a.facetFilters},n1=(e,t)=>{const n=t.updateRangeFiltersProxy(e);t.rangeFiltersProxy.rangeFilters=n.rangeFilters},r1=({field:e,value:t},n)=>{const[r,o]=Array.isArray(t)?t:[];if(typeof r=="undefined"||typeof o=="undefined")throw new Error("Range values must be an array with two numbers for min and max");const a=[...n.rangeFiltersProxy.rangeFilters||[]],u=a.findIndex(d=>d.field===e);if(u!==-1){a[u]={field:e,min:r,max:o},n.rangeFiltersProxy.rangeFilters=a;return}a.push({field:e,min:r,max:o});const c=n.updateRangeFiltersProxy(a);n.rangeFiltersProxy.rangeFilters=c.rangeFilters},i1=(e,t)=>{t.catalogSegmentProxy.catalogSegment=e},o1=(e,t)=>{const n=t.updatePricebooksProxy(e);t.pricebooksProxy.pricebooks=n.pricebooks},XC=e=>{if(!uo()||!ba()){uo()&&yn.clear(),yn.add({context:"browse",payload:pe(F({},ct.state),{categoryId:e})});return}ct.categoryIdProxy.categoryId=e},s1=e=>{e1(e,ct)},KC=(e,t)=>{t1(e,t,ct)},a1=e=>{n1(e,ct)},QC=({field:e,value:t})=>{r1({field:e,value:t},ct)},JC=e=>{i1(e,ct)},u1=e=>{o1(e,ct)},l1=e=>{if(!e||!("categoryId"in e))throw new Error("Browse context must include a categoryId");const t=uo(),n=ba();if(!t||!n){t&&yn.clear(),yn.add({context:"browse",payload:F({},e)});return}"facetFilters"in e&&s1(e.facetFilters||{}),"rangeFilters"in e&&a1(e.rangeFilters||[]),"catalogSegment"in e&&(ct.catalogSegmentProxy.catalogSegment=e.catalogSegment||null),"pricebooks"in e&&u1(e.pricebooks||[]),"categoryName"in e&&(ct.categoryIdProxy.categoryName=e.categoryName||""),ct.categoryIdProxy.categoryId=e.categoryId},ZC=Object.freeze(Object.defineProperty({__proto__:null,setBrowseContext:l1,updateBrowseCategoryId:XC,updateCatalogSegment:JC,updateFacetFilter:KC,updateFacetFilters:s1,updatePricebooks:u1,updateRangeFilter:QC,updateRangeFilters:a1},Symbol.toStringTag,{value:"Module"}));class ek{constructor(){we(this,"initialParams",{productId:"",productName:"",pdpLink:""});we(this,"proxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>(Zg(n,r),Reflect.set(t,n,r)));we(this,"updateProxy",t=>{t.productId&&(this.proxy=new Proxy({productId:t.productId,productName:t.productName||"",pdpLink:t.pdpLink||""},{get:this._fullGet,set:this._fullSet}))});this.proxy=new Proxy({productId:this.initialParams.productId,productName:this.initialParams.productName,pdpLink:this.initialParams.pdpLink},{get:this._fullGet,set:this._fullSet})}get productId(){return this.proxy.productId}get pdpLink(){return this.proxy.pdpLink}get state(){return{productId:this.productId,productName:this.proxy.productName,pdpLink:this.pdpLink}}}const _r=new ek,c1=e=>{if(!e||!e.productId)throw new Error("PDP context must include a productId");const t=uo(),n=ba();if(!t||!n){t&&yn.clear(),yn.add({context:"pdp",payload:F({},e)});return}_r.updateProxy(e),Zg("pdp-context",e)},tk=e=>{_r.proxy.productId=e,uo()||yn.add({context:"pdp",payload:F({},_r.state)})},nk=e=>{_r.proxy.pdpLink=e},gt={SET_PROMPTS_EXTENSION_INITIALIZED:"SET_PROMPTS_EXTENSION_INITIALIZED",SET_PROMPTS_EXTENSION_OPEN:"SET_PROMPTS_EXTENSION_OPEN",SET_PROMPTS_EXTENSION_INLINE:"SET_PROMPTS_EXTENSION_INLINE",SET_PROMPTS_EXTENSION_ELEMENT_ID:"SET_PROMPTS_EXTENSION_ELEMENT_ID",SET_PROMPTS_EXTENSION_ENTRY_TYPE:"SET_PROMPTS_EXTENSION_ENTRY_TYPE",SET_PROMPTS_EXTENSION_PARAMS:"SET_PROMPTS_EXTENSION_PARAMS",RESET_PROMPTS_EXTENSION_PARAMS:"RESET_PROMPTS_EXTENSION_PARAMS",SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",SET_PROMPTS_EXTENSION_USER_PROMPT:"SET_PROMPTS_EXTENSION_USER_PROMPT",SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_LOADING:"SET_PROMPTS_EXTENSION_RESPONSE_LOADING"},d1={isInitialized:!1,isOpen:!1,isInline:!1,elementId:null,placeholder:null,askElseButtonLabel:null,entryType:null,params:null,activePromptsId:null,userPrompt:null,promptsMessage:null,isResponseLoading:!1,responseMessage:null,promptsDisplay:"both",disableAskElseButton:!1};class rk{constructor(){we(this,"initialState",d1);we(this,"promptsStateProxy");we(this,"promptsParamsProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return Sa(n,r),Reflect.set(t,n,r)});we(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));we(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));we(this,"updatePromptsParamsProxy",t=>new Proxy(F({},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 Ht=new rk,ik=e=>{window.addEventListener(lf,e)},ok=e=>{window.removeEventListener(lf,e)},Sa=(e,t)=>{const n=new CustomEvent(lf,{detail:{property:e,value:t}});window.dispatchEvent(n)},f1=e=>{const t=Ht.isOpen,n=typeof e=="boolean"?e:!t;Ht.promptsStateProxy.isOpen=n},h1=e=>{const t=Ht.isInline,n=typeof e=="boolean"?e:!t;Ht.promptsStateProxy.isInline=n},sk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="ask_cim"},ak=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="search"},uk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="browse"},lk=e=>{Ht.promptsParamsProxy=Ht.updatePromptsParamsProxy(e),Sa("params",e),Ht.promptsStateProxy.entryType="pdp"},ck=({elementId:e,entryType:t,params:n,isInline:r})=>{Ht.promptsStateProxy.elementId=e,t&&(Ht.promptsStateProxy.entryType=t),typeof r=="boolean"&&h1(r),n&&Ht.updatePromptsParamsProxy(n),Ht.isOpen||f1(!0)},dk=Object.freeze(Object.defineProperty({__proto__:null,getConversationMessages:({payload:e,callback:t})=>{bl("getConversationMessages",{payload:e,callback:t},Ci.GET_CONVERSATION_MESSAGES)},getSessionInformation:e=>{bl("getSessionInformation",{callback:e},Ci.GET_SESSION_INFORMATION)},loadConversation:e=>{bl("loadConversation",e,Ci.LOAD_CONVERSATION)},resetConversation:()=>{bl("resetConversation",!0,Ci.RESET_CONVERSATION)}},Symbol.toStringTag,{value:"Module"}));class fk{constructor(){we(this,"initialParams",{query:"",page:null,pageSize:null,includeFacets:!0,facetFilters:{},rangeFilters:[],catalogSegment:null,pricebooks:null});we(this,"queryProxy");we(this,"facetFiltersProxy");we(this,"rangeFiltersProxy");we(this,"catalogSegmentProxy");we(this,"pricebooksProxy");we(this,"_fullGet",(t,n)=>Reflect.get(t,n));we(this,"_fullSet",(t,n,r)=>{const o=CA[n];return VC(o,n,r),Reflect.set(t,n,r)});we(this,"updateFacetFiltersProxy",t=>new Proxy({facetFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updateRangeFiltersProxy",t=>new Proxy({rangeFilters:t},{get:this._fullGet,set:this._fullSet}));we(this,"updatePricebooksProxy",t=>new Proxy({pricebooks:t},{get:this._fullGet,set:this._fullSet}));this.queryProxy=new Proxy({query:this.initialParams.query},{get:this._fullGet,set:this._fullSet}),this.facetFiltersProxy=this.updateFacetFiltersProxy(this.initialParams.facetFilters||{}),this.rangeFiltersProxy=this.updateRangeFiltersProxy(this.initialParams.rangeFilters||[]),this.catalogSegmentProxy=new Proxy({catalogSegment:this.initialParams.catalogSegment},{get:this._fullGet,set:this._fullSet}),this.pricebooksProxy=this.updatePricebooksProxy(this.initialParams.pricebooks||null)}get query(){return this.queryProxy.query||""}get facetFilters(){return this.facetFiltersProxy.facetFilters||{}}get rangeFilters(){return this.rangeFiltersProxy.rangeFilters||[]}get catalogSegment(){return this.catalogSegmentProxy.catalogSegment||null}get pricebooks(){return this.pricebooksProxy.pricebooks||null}get state(){return{query:this.query,facetFilters:this.facetFilters,rangeFilters:this.rangeFilters,catalogSegment:this.catalogSegment,pricebooks:this.pricebooks,page:this.initialParams.page,pageSize:this.initialParams.pageSize,includeFacets:this.initialParams.includeFacets}}}const Tt=new fk,hk=e=>{const t=ba(),n=uo();if(!n||!t){n&&yn.clear(),yn.add({context:"search",payload:pe(F({},Tt.state),{query:e})});return}Tt.queryProxy.query=e},p1=e=>{e1(e,Tt)},pk=(e,t)=>{t1(e,t,Tt)},m1=e=>{n1(e,Tt)},mk=({field:e,value:t})=>{r1({field:e,value:t},Tt)},gk=e=>{i1(e,Tt)},g1=e=>{o1(e,Tt)},E1=e=>{if(!e||!e.query)throw new Error("Search context must include a query");const t=ba(),n=uo();if(!n||!t){n&&yn.clear(),yn.add({context:"search",payload:F({},e)});return}"facetFilters"in e&&p1(e.facetFilters||{}),"rangeFilters"in e&&m1(e.rangeFilters||[]),"catalogSegment"in e&&(Tt.catalogSegmentProxy.catalogSegment=e.catalogSegment||null),"pricebooks"in e&&g1(e.pricebooks||[]),Tt.queryProxy.query=e.query},Ek=Object.freeze(Object.defineProperty({__proto__:null,setSearchContext:E1,updateCatalogSegment:gk,updateFacetFilter:pk,updateFacetFilters:p1,updatePricebooks:g1,updateRangeFilter:mk,updateRangeFilters:m1,updateSearchQuery:hk},Symbol.toStringTag,{value:"Module"})),yk={categoryId:ct.categoryId,categoryName:ct.categoryIdProxy.categoryName||"",facetFilters:ct.facetFilters,rangeFilters:ct.rangeFilters,catalogSegment:ct.catalogSegment,pricebooks:ct.pricebooks},y1=B.createContext(yk),bk=({children:e})=>{const[t,n]=B.useState(ct.categoryId),[r,o]=B.useState(ct.categoryIdProxy.categoryName||""),[a,u]=B.useState(ct.facetFilters||{}),[c,d]=B.useState(ct.rangeFilters||[]),[f,p]=B.useState(ct.catalogSegment||null),[m,T]=B.useState(ct.pricebooks||null);B.useEffect(()=>{const _=({detail:w})=>{(w==null?void 0:w.property)==="categoryId"&&n(w.value),(w==null?void 0:w.property)==="categoryName"&&o(w.value),(w==null?void 0:w.property)==="facetFilters"&&u(w.value),(w==null?void 0:w.property)==="rangeFilters"&&d(w.value),(w==null?void 0:w.property)==="catalogSegment"&&p(w.value),(w==null?void 0:w.property)==="pricebooks"&&T(w.value)};return Xg(_),()=>{Kg(_)}},[]);const y=B.useMemo(()=>({categoryId:t,categoryName:r,facetFilters:a,rangeFilters:c,catalogSegment:f,pricebooks:m}),[t,r,a,c,f,m]);return x.jsx(y1.Provider,{value:y,children:e})},Tk=()=>{const e=B.useContext(y1);if(!e)throw new Error("useBrowse must be used within a BrowseProvider");return e},_k={searchQuery:Tt.query,facetFilters:Tt.facetFilters,rangeFilters:Tt.rangeFilters,catalogSegment:Tt.catalogSegment,pricebooks:Tt.pricebooks},b1=B.createContext(_k),Sk=({children:e})=>{const[t,n]=B.useState(Tt.query),[r,o]=B.useState(Tt.facetFilters),[a,u]=B.useState(Tt.rangeFilters),[c,d]=B.useState(Tt.catalogSegment),[f,p]=B.useState(Tt.pricebooks);B.useEffect(()=>{const T=({detail:y})=>{(y==null?void 0:y.property)==="query"&&n(y.value),(y==null?void 0:y.property)==="facetFilters"&&o(y.value),(y==null?void 0:y.property)==="rangeFilters"&&u(y.value),(y==null?void 0:y.property)==="catalogSegment"&&d(y.value),(y==null?void 0:y.property)==="pricebooks"&&p(y.value)};return Wg(T),()=>{Gg(T)}},[]);const m=B.useMemo(()=>({searchQuery:t,facetFilters:r,rangeFilters:a,catalogSegment:c,pricebooks:f}),[t,r,a,c,f]);return x.jsx(b1.Provider,{value:m,children:e})},xk=()=>{const e=B.useContext(b1);if(!e)throw new Error("useSearch must be used within a SearchProvider");return e},wk={productId:_r.productId,pdpLink:_r.pdpLink},T1=B.createContext(wk),Ak=({children:e})=>{const[t,n]=B.useState(_r.productId),[r,o]=B.useState(_r.pdpLink);B.useEffect(()=>{const u=({detail:c})=>{if((c==null?void 0:c.property)==="pdp-context"){const d=c.value;n(d.productId),o(d.pdpLink);return}(c==null?void 0:c.property)==="productId"&&n(c.value),(c==null?void 0:c.property)==="pdpLink"&&o(c.value)};return Qg(u),()=>{Jg(u)}},[]);const a=B.useMemo(()=>({productId:t,pdpLink:r}),[t,r]);return x.jsx(T1.Provider,{value:a,children:e})},vk=()=>{const e=B.useContext(T1);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},_1=B.createContext({mode:et.modeProxy.mode,entryType:et.entryType,status:et.statusProxy,dialogPosition:et.dialogProxy.position,isDialogFullHeight:et.dialogProxy.isFullHeight,dialogWidth:et.dialogProxy.width,isModalFullscreen:et.modalProxy.isFullscreen,previousComponentType:et.statusProxy.type}),Ck=({entryType:e,componentConfig:t,componentType:n,children:r})=>{const[o,a]=B.useState(e!=null?e:et.entryTypeProxy.entryType),[u,c]=B.useState(et.modeProxy.mode),[d,f]=B.useState({type:n||et.statusProxy.type,isOpen:et.statusProxy.isOpen,isMinimized:et.statusProxy.isMinimized}),[p,m]=B.useState(et.dialogProxy.position),[T,y]=B.useState(et.dialogProxy.isFullHeight),[_,w]=B.useState(et.dialogProxy.width),[C,A]=B.useState(et.modalProxy.isFullscreen),P=zC(d.type);B.useEffect(()=>{const H=Y=>{const{property:D,value:q}=Y.detail||{};if(!(!D||q===void 0)){if(D==="mode"){c(q);return}if(D==="entryType"){a(q);return}if(D==="isMinimized"){f(re=>pe(F({},re),{isMinimized:q}));return}if(D==="isOpen"){f(re=>pe(F({},re),{isOpen:q}));return}if(D==="type"){f(re=>pe(F({},re),{type:q}));return}if(D==="position"){m(q);return}if(D==="isFullHeight"){y(q);return}if(D==="width"){w(q);return}if(D==="isFullscreen"){A(q);return}}};return CC(H),()=>{kC(H)}},[]),_a(()=>{e&&Ta(e)}),_a(()=>{const H=n||(t==null?void 0:t.type);H&&yl(H),t&&"isOpen"in t&&ui(!!t.isOpen),t&&"isMinimized"in t&&El(!!t.isMinimized)}),_a(()=>{if(!(t!=null&&t.options))return;const{dialogPosition:H}=t.options;H&&Cf(H),"dialogFullHeight"in t.options&&OC(!!t.options.dialogFullHeight),"dialogWidth"in t.options&&t.options.dialogWidth&&w(t.options.dialogWidth),"isModalFullscreen"in t.options&&vf(!!t.options.isModalFullscreen)});const v=B.useMemo(()=>({mode:u,entryType:o,status:d,previousComponentType:P||"dialog",dialogPosition:p,isDialogFullHeight:T,dialogWidth:_,isModalFullscreen:C}),[u,o,d,P,p,T,_,C]);return x.jsx(_1.Provider,{value:v,children:r})},sr=()=>{const e=B.useContext(_1);if(!e)throw new Error("useUIState must be used within a UIStateProvider");return e},S1=B.createContext(null),x1=B.createContext(null),Pf=()=>{const e=B.useContext(x1);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},li=()=>{const e=B.useContext(S1);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},Ko=()=>{const e=B.useContext(og);if(!e)throw new Error("useCopilotDispatch must be used within a CopilotProvider");return e},ar=()=>{const e=B.useContext(ig);if(!e)throw new Error("useCopilotState must be used within a CopilotProvider");return e},kk=({copilot:e})=>{const{logger:t,conversationHistory:n}=rt(),{isInline:r}=li(),{addCopilotEvent:o,setConversationHistoryLoaded:a}=Ko(),{activeConversationId:u}=ar(),c=B.useCallback(f=>{e&&e.requestSessionInformation(p=>{t==null||t.log("Retrieved session information: ",p),f==null||f(p)})},[e,t]),d=B.useCallback((f,p)=>{e&&f.conversationId&&e.getConversationEvents(f,m=>{t==null||t.log("Retrieved conversation messages: ",m),p==null||p(m)})},[e,t]);return B.useEffect(()=>{if(r||!u)return;if(n.sinceHours===0||(n==null?void 0:n.limit)===0){a(!0);return}const f=3600*1e3*n.sinceHours,p=new Date(Date.now()-f).toISOString(),m={conversationId:u,since:p,excludeEvents:["done","error","connection_error","refined_browse","refined_search","conversation_reset"]};typeof n.limit=="number"&&(m.limit=n.limit),d(m,T=>{const y=[];[...T.reverse()||[]].forEach(w=>{var A;const C=T.find(P=>P.id===w.eventSourceId);(A=C==null?void 0:C.name)!=null&&A.endsWith("_suggestions")||(w.bypassHandlers=!0,y.unshift(w))}),y.forEach(w=>{o(w)}),a(!0)})},[t,r,u,d,o,a,n]),{getSessionInformation:c,getConversationMessages:d}},w1=B.createContext({copilot:null,messages:[],groupedMessages:[],isLoading:!1,isResponseLoading:()=>!1,handleAskCim:()=>{},handleSearch:()=>{},handleBrowse:()=>{},handlePdp:()=>{},handleSuggestion:()=>{},handleUserInput:()=>{},handleCancel:()=>{},resetConversation:()=>{},getSessionInformation:()=>{},getConversationMessages:()=>{}}),Pk=({apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:f})=>{const{logger:p,clientContext:m,baseCatalogParams:T}=rt(),cn=xk(),{searchQuery:y}=cn,_=mn(cn,["searchQuery"]),Hn=Tk(),{categoryId:w}=Hn,C=mn(Hn,["categoryId"]),{productId:A,pdpLink:P}=vk(),{setCopilot:v,setConnected:H,resetCopilot:Y,resetCopilotState:D,addCopilotEvent:q,removeLoadingMessage:re,handleCopilotRequestAck:me,setActiveConversationId:V,setConversationIds:oe,setAskCimPrompts:ce}=Ko(),{connected:de,copilot:ne,messages:Te,groupedMessages:Pe,loadingMessages:se,askCimPrompts:K}=ar(),{status:ie,entryType:k}=sr(),{isInline:L}=li(),{getConversationMessages:ee,getSessionInformation:I}=kk({copilot:ne}),Se=B.useMemo(()=>se.size>0,[se]),je=B.useCallback(Ae=>se.has(Ae),[se]),Ee=B.useCallback(({query:Ae,facetFilters:Oe,rangeFilters:Me,catalogSegment:ot,pricebooks:pt,userPrompt:J,imageFile:ge})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const Ce={searchParams:{query:Ae}};J&&(Ce.userPrompt=J),ge&&(Ce.attachments={image:ge}),Oe&&Object.keys(Oe).length>0&&(Ce.searchParams.facetFilters=Oe),Me&&Me.length>0&&(Ce.searchParams.rangeFilters=Me),ot&&(Ce.searchParams.catalogSegment=ot),pt&&(Ce.searchParams.pricebooks=pt),m&&(Ce.clientContext=m),Ta("search"),ne.search(Ce,qe=>{const Re=F({},qe);me(Re)})},[p,me,ne,m]),Fe=B.useCallback(({categoryId:Ae,categoryName:Oe,facetFilters:Me,rangeFilters:ot,catalogSegment:pt,pricebooks:J,userPrompt:ge,imageFile:Ce})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}const qe=Me&&Object.keys(Me).length>0;if(Ae===""&&!qe){p==null||p.error("Browse event must include facetFilters when categoryId is empty");return}const Re={browseParams:{categoryId:Ae||""}};ge&&(Re.userPrompt=ge),Ce&&(Re.attachments={image:Ce}),qe&&(Re.browseParams.facetFilters=Me),ot&&ot.length>0&&(Re.browseParams.rangeFilters=ot),pt&&(Re.browseParams.catalogSegment=pt),Array.isArray(J)&&J.length>0&&(Re.browseParams.pricebooks=J),(m||Oe)&&(Re.clientContext={},m&&(Re.clientContext=F({},m)),Oe&&(Re.clientContext.cimLabel=Oe)),Ta("browse"),ne.browse(Re,dt=>{var Qr;const Gt=F({},dt),$t=((Qr=Gt.request)==null?void 0:Qr.clientContext)||{},dn=($t==null?void 0:$t.cimLabel)||Oe;dn&&Gt.request&&(Gt.request.label=dn),me(Gt)})},[p,me,ne,m]),$e=B.useCallback(({productId:Ae,productName:Oe,pdpLink:Me,userPrompt:ot,imageFile:pt})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const J={productId:Ae};ot&&(J.userPrompt=ot),Me&&(J.pdpLink=Me),pt&&(J.attachments={image:pt}),(m||Oe)&&(J.clientContext={},m&&(J.clientContext=F({},m)),Oe&&(J.clientContext.cimLabel=Oe)),T&&(J.baseCatalogParams=T),Ta("pdp"),ne.productView(J,ge=>{var dt;const Ce=F({},ge),qe=((dt=Ce.request)==null?void 0:dt.clientContext)||{},Re=(qe==null?void 0:qe.cimLabel)||Oe;Re&&Ce.request&&(Ce.request.label=Re),me(Ce)})},[p,ne,me,m,T]),Ge=B.useCallback(({userPrompt:Ae,imageFile:Oe})=>{if(!ne){p==null||p.error("Copilot is not initialized");return}if(!Ae)return;const Me={userPrompt:Ae};Oe&&(Me.attachments={image:Oe}),m&&(Me.clientContext=m),T&&(Me.baseCatalogParams=T),ne.askCim(Me,ot=>{const pt=F({},ot);me(pt)})},[p,ne,me,m,T]),_t=B.useCallback(Ae=>{q(Ae),c==null||c(Ae)},[q,c]),Nn=B.useCallback(Ae=>{q(Ae),d==null||d(Ae)},[q,d]),ln=B.useCallback(Ae=>{u==null||u(Ae),H(!0)},[u,H]);B.useEffect(()=>{!ne||!de||!ie.isOpen||yn.size>0&&yn.processQueue(Ae=>{if(Ae.context==="search"){const Oe=F({},Ae.payload);E1(Oe)}if(Ae.context==="browse"){const Oe=F({},Ae.payload);l1(Oe)}if(Ae.context==="pdp"){const Oe=F({},Ae.payload);c1(Oe)}})},[ie.isOpen,ne,de]);const Cr=B.useCallback(Ae=>{const Oe=Me=>{const ot=pe(F({},Me),{id:Me.inquiryLinkId||Me.id});q(ot)};Ae.on("connect_ack",ln),Ae.on("partial_inquiry",Oe),Ae.on("display_products",q),Ae.on("progress",q),Ae.on("refined_search",_t),Ae.on("refined_browse",Nn),Ae.on("done",Me=>{re(Me.eventSourceId)}),Ae.on("error",Me=>{q(Me),re(Me.eventSourceId)}),Ae.onDisconnect(Me=>{const ot=["io server disconnect","transport error","server shutting down"];if(p==null||p.log("Connection disconnected with reason: ",Me),!ot.includes(Me)){H(!1);return}p==null||p.log("De-registering event listeners");const pt=new Date().toISOString();q({name:"error",message:"Connection was lost. Please try again.",createdAt:pt,id:`error-${pt}`,sessionId:"session"}),Ae.off()})},[p,H,re,_t,Nn,q,ln]);B.useEffect(()=>{if(!ne)return;const Ae=Oe=>{if(!L){if(!Oe.message&&Oe.eventSourceId&&Oe.eventSourceId===K.requestId){ce({requestId:Oe.eventSourceId,message:Oe});return}q(Oe)}};return ne.on("follow_up",Ae),()=>{ne.off("follow_up",Ae)}},[ne,Te,K.requestId,L,q,ce]),B.useEffect(()=>{if(!ne)return;const Ae=Oe=>{if(L)return;const Me=pe(F({},Oe),{id:Oe.inquiryLinkId||Oe.id});q(Me)};return ne.on("inquiry",Ae),()=>{ne.off("inquiry",Ae)}},[ne,L,q]),_a(()=>{let Ae;n?Ae=n:Ae=a?"https://staging.copilot.search.cimulate.ai":"https://prod.copilot.search.cimulate.ai";const Oe={baseUrl:Ae};e?Oe.apiKey=e:t&&(Oe.apiToken=t),r&&(Oe.customerId=r),o&&(Oe.tenantId=o);const Me=new fA(Oe);return v(Me),Cr(Me),Me.connect(),Me.requestSessionInformation(ot=>{p==null||p.log("Session Information: ",ot);const{activeConversationId:pt,conversationIds:J}=ot.data||{};pt&&V(pt),J!=null&&J.length&&oe(J)}),()=>{Me.disconnect(),Me.off(),Y()}});const fr=B.useCallback(Ae=>{if(!ne)return;const Oe={eventId:Ae,reason:"User cancelled the request"};ne.cancelRequest(Oe,Me=>{q(Me),re(Ae)})},[q,re,ne]),nn=B.useCallback(()=>{ne&&ne.conversationReset({},Ae=>{D(),q(Ae),ne.requestSessionInformation(Oe=>{p==null||p.log("Session Information: ",Oe);const{activeConversationId:Me,conversationIds:ot}=Oe.data||{};Me&&V(Me),ot!=null&&ot.length&&oe(ot)})})},[ne,p,q,D,V,oe]),Ve=B.useCallback((Ae,Oe)=>{if(!Ae)return;const Me={userPrompt:Ae};switch(Oe&&(Me.imageFile=Oe),k){case"ask_cim":Ge(Me);return;case"search":y?Ee(F(F({query:y},_),Me)):Ge(Me);return;case"browse":Fe(F(F({categoryId:w},C),Me));return;case"pdp":A?$e(F({productId:A,pdpLink:P||""},Me)):Ge(Me);return}},[k,y,_,Ee,Ge,w,C,Fe,$e,A,P]),Pt=B.useCallback((Ae,Oe)=>{var ge,Ce,qe;const ot=Ae.params.userPrompt||"";if(!ot)return;const pt=Te.find(Re=>Re.id===Oe);if(!pt)return;const J=pt.name.replace("_suggestions","");if(J==="ask_cim"){Ge({userPrompt:ot});return}if(J==="copilot_search"){const Re=((ge=pt.request)==null?void 0:ge.searchParams)||{},Gt=Re.query===y;Ee(pe(F({query:Re.query||y},Gt?_:{}),{userPrompt:ot}));return}if(J==="copilot_browse"){const Re=pt.request,dt=Re.browseParams||{},$t=dt.categoryId===w,dn=((Ce=Re.clientContext)==null?void 0:Ce.cimLabel)||"";Fe(pe(F({categoryId:dt.categoryId||w||""},$t?C:{}),{categoryName:dn,userPrompt:ot}));return}if(J==="product_view"){const Re=pt.request||{},dt=Re.productId,Gt=dt===A,$t=((qe=Re.clientContext)==null?void 0:qe.cimLabel)||"";let dn="";Gt?dn=P||"":dn=Re.pdpLink||"",$e({productId:dt||A,pdpLink:dn,productName:$t,userPrompt:ot})}},[Te,y,_,Ee,Ge,w,C,Fe,$e,A,P]),On=B.useMemo(()=>({copilot:ne,messages:Te,groupedMessages:Pe,isLoading:Se,isResponseLoading:je,handleAskCim:Ge,handleSearch:Ee,handleBrowse:Fe,handlePdp:$e,handleUserInput:Ve,handleSuggestion:Pt,handleCancel:fr,resetConversation:nn,getSessionInformation:I,getConversationMessages:ee}),[ne,Te,Pe,Se,je,Ge,Ee,Fe,$e,Ve,Pt,fr,nn,I,ee]);return x.jsx(w1.Provider,{value:On,children:f})},A1=()=>{const{copilot:e}=ar(),{addCopilotEvent:t}=Ko();return{getCopilotSuggestions:B.useCallback((r,o,a)=>{if(!e||!o||!r)return;const u=c=>{t(c),a(c)};switch(o){case"ask_cim":e.askCimSuggestions(r,u);break;case"search":e.searchSuggestions({searchParams:r},u);break;case"browse":e.browseSuggestions({browseParams:r},u);break;case"pdp":e.productViewSuggestions({productId:r.productId},u);break}},[e,t])}},Ur=()=>{const e=B.useContext(w1);if(!e)throw new Error("useCopilot must be used within a CopilotProvider");return e},Nk=()=>{const{copilot:e,activeConversationId:t,askCimPrompts:n,conversationHistoryLoaded:r}=ar(),{entryType:o}=sr(),{resetCopilotState:a,addCopilotEvent:u,setAskCimPrompts:c}=Ko(),{handleSearch:d,handleBrowse:f,handlePdp:p,resetConversation:m,getSessionInformation:T,getConversationMessages:y}=Ur(),{getCopilotSuggestions:_}=A1();B.useEffect(()=>{!e||!o||!t||!r||n.requestId||o==="ask_cim"&&_({},o,P=>{c({requestId:P.id,message:null})})},[e,t,n.requestId,o,r,_,c]);const w=B.useCallback(({query:P})=>{if(!e||!P)return;const{facetFilters:v}=Tt.facetFiltersProxy,{rangeFilters:H}=Tt.rangeFiltersProxy,{catalogSegment:Y}=Tt.catalogSegmentProxy,{pricebooks:D}=Tt.pricebooksProxy,q={query:P};q.facetFilters=v||{},q.rangeFilters=H||[],q.catalogSegment=Y||"",q.pricebooks=D||[],d(F({},q))},[e,d]),C=B.useCallback(({categoryId:P})=>{if(!e)return;const v=ct.categoryIdProxy.categoryName,{facetFilters:H}=ct.facetFiltersProxy,{rangeFilters:Y}=ct.rangeFiltersProxy,{catalogSegment:D}=ct.catalogSegmentProxy,{pricebooks:q}=ct.pricebooksProxy,re={categoryId:P};re.categoryName=v||"",re.facetFilters=H||{},re.rangeFilters=Y||[],re.catalogSegment=D||"",re.pricebooks=q||[],f(F({},re))},[e,f]),A=B.useCallback(({productId:P})=>{if(!e||!P)return;const v={productId:P,pdpLink:_r.pdpLink,productName:_r.proxy.productName||""};p(v)},[e,p]);return B.useEffect(()=>{const P=({detail:v})=>{(v==null?void 0:v.property)==="query"&&w({query:v.value})};return Wg(P),()=>{Gg(P)}},[w]),B.useEffect(()=>{const P=({detail:v})=>{if((v==null?void 0:v.property)==="pdp-context"){const H=v.value;A({productId:H.productId});return}(v==null?void 0:v.property)==="productId"&&A({productId:v.value})};return Qg(P),()=>{Jg(P)}},[A]),B.useEffect(()=>{const P=({detail:v})=>{(v==null?void 0:v.property)==="categoryId"&&C({categoryId:v.value})};return Xg(P),()=>{Kg(P)}},[C]),B.useEffect(()=>{const P=({detail:v})=>{if((v==null?void 0:v.event)==Ci.RESET_CONVERSATION&&m(),(v==null?void 0:v.event)==Ci.GET_SESSION_INFORMATION){const H=v.value.callback;T(H)}if((v==null?void 0:v.event)==Ci.GET_CONVERSATION_MESSAGES){const{payload:H,callback:Y}=v.value;if(!H.conversationId||typeof Y!="function")return;y(H,Y)}if((v==null?void 0:v.event)==Ci.LOAD_CONVERSATION){const H=v.value;if(!H.conversationId)return;y(H,D=>{a(),D.forEach(q=>{u(q)})})}};return YC(P),()=>{WC(P)}},[m,T,y,a,u]),null},Ok=({apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:f})=>x.jsxs(Pk,{apiKey:e,apiToken:t,baseUrl:n,customerId:r,tenantId:o,isDevelopment:a,onConnect:u,onRefinedSearch:c,onRefinedBrowse:d,children:[x.jsx(Nk,{}),f]}),Ik=({children:e,dispatch:t})=>{const n=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_INITIALIZED,payload:_})},[t]),r=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_OPEN,payload:_})},[t]),o=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_INLINE,payload:_})},[t]),a=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ELEMENT_ID,payload:_})},[t]),u=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ENTRY_TYPE,payload:_})},[t]),c=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID,payload:_})},[t]),d=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_USER_PROMPT,payload:_})},[t]),f=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_PARAMS,payload:_})},[t]),p=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE,payload:_})},[t]),m=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE,payload:_})},[t]),T=B.useCallback(_=>{t({type:gt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING,payload:_})},[t]),y=B.useMemo(()=>({setIsInitialized:n,setIsOpen:r,setIsInline:o,setElementId:a,setEntryType:u,setActivePromptsId:c,setUserPrompt:d,setParams:f,setPromptsMessage:p,setResponseMessage:m,setIsResponseLoading:T}),[n,r,o,a,u,c,d,f,p,m,T]);return x.jsx(x1.Provider,{value:y,children:e})},Rk=(e,t)=>{const{type:n,payload:r}=t;switch(n){case gt.SET_PROMPTS_EXTENSION_INITIALIZED:e.isInitialized=r;break;case gt.SET_PROMPTS_EXTENSION_OPEN:e.isOpen=r;break;case gt.SET_PROMPTS_EXTENSION_INLINE:e.isInline=r;break;case gt.SET_PROMPTS_EXTENSION_ELEMENT_ID:e.elementId=r;break;case gt.SET_PROMPTS_EXTENSION_ENTRY_TYPE:e.entryType=r;break;case gt.SET_PROMPTS_EXTENSION_PARAMS:e.params=r;break;case gt.RESET_PROMPTS_EXTENSION_PARAMS:e.params=null;break;case gt.SET_PROMPTS_EXTENSION_USER_PROMPT:e.userPrompt=r;break;case gt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=r;break;case gt.RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=null;break;case gt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=r;break;case gt.RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=null;break;case gt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=r;break;case gt.RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=null;break;case gt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING:e.isResponseLoading=r;break}},Lk=({promptsConfig:e,children:t})=>{const[n,r]=ng(Rk,F(F({},d1),e||{}));return x.jsx(S1.Provider,{value:n,children:x.jsx(Ik,{dispatch:r,children:t})})},v1=({mode:e,apiKey:t,apiToken:n,baseUrl:r,customerId:o,tenantId:a,logoUrl:u,headerText:c,headerConfig:d,theme:f,openLinksInNewTab:p,globalClassName:m,isDevelopment:T=!1,componentType:y,componentConfig:_,entryType:w,entryMessage:C,disclaimerText:A,disclaimerMarkdown:P,clientContext:v,baseCatalogParams:H,searchPlaceholder:Y,searchButtonLabel:D,searchConfig:q,suggestionButtonConfig:re,messageAlignment:me,autoScroll:V,promptsConfig:oe,resetConversationMessage:ce,conversationHistory:de,onConnect:ne,onCopilotEvent:Te,onRefinedSearch:Pe,onRefinedBrowse:se,__features:K,children:ie})=>x.jsx(AC,{mode:e,baseUrl:r,apiKey:t,apiToken:n,customerId:o,tenantId:a,logoUrl:u,headerText:c,headerConfig:d,entryMessage:C,theme:f,globalClassName:m,openLinksInNewTab:p,searchPlaceholder:Y,searchButtonLabel:D,searchConfig:q,suggestionButtonConfig:re,messageAlignment:me,autoScroll:V,componentConfig:_,clientContext:v,baseCatalogParams:H,disclaimerMarkdown:P,disclaimerText:A,resetConversationMessage:ce,conversationHistory:de,isDevelopment:T,__features:K,children:x.jsx(Ck,{entryType:w,componentConfig:_,componentType:y,children:x.jsx(LC,{onCopilotEvent:Te,children:x.jsx(Ak,{children:x.jsx(bk,{children:x.jsx(Sk,{children:x.jsx(Lk,{promptsConfig:oe,children:x.jsx(Ok,{apiKey:t,apiToken:n,baseUrl:r,customerId:o,tenantId:a,isDevelopment:T,entryType:w,onConnect:ne,onRefinedSearch:Pe,onRefinedBrowse:se,onCopilotEvent:Te,children:ie})})})})})})})});var Nf={exports:{}},Dn={},Of={exports:{}},If={};var C1;function Dk(){return C1||(C1=1,(function(e){function t(K,ie){var k=K.length;K.push(ie);e:for(;0<k;){var L=k-1>>>1,ee=K[L];if(0<o(ee,ie))K[L]=ie,K[k]=ee,k=L;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var ie=K[0],k=K.pop();if(k!==ie){K[0]=k;e:for(var L=0,ee=K.length,I=ee>>>1;L<I;){var Se=2*(L+1)-1,je=K[Se],Ee=Se+1,Fe=K[Ee];if(0>o(je,k))Ee<ee&&0>o(Fe,je)?(K[L]=Fe,K[Ee]=k,L=Ee):(K[L]=je,K[Se]=k,L=Se);else if(Ee<ee&&0>o(Fe,k))K[L]=Fe,K[Ee]=k,L=Ee;else break e}}return ie}function o(K,ie){var k=K.sortIndex-ie.sortIndex;return k!==0?k:K.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var d=[],f=[],p=1,m=null,T=3,y=!1,_=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(K){for(var ie=n(f);ie!==null;){if(ie.callback===null)r(f);else if(ie.startTime<=K)r(f),ie.sortIndex=ie.expirationTime,t(d,ie);else break;ie=n(f)}}function H(K){if(w=!1,v(K),!_)if(n(d)!==null)_=!0,Pe(Y);else{var ie=n(f);ie!==null&&se(H,ie.startTime-K)}}function Y(K,ie){_=!1,w&&(w=!1,A(re),re=-1),y=!0;var k=T;try{for(v(ie),m=n(d);m!==null&&(!(m.expirationTime>ie)||K&&!oe());){var L=m.callback;if(typeof L=="function"){m.callback=null,T=m.priorityLevel;var ee=L(m.expirationTime<=ie);ie=e.unstable_now(),typeof ee=="function"?m.callback=ee:m===n(d)&&r(d),v(ie)}else r(d);m=n(d)}if(m!==null)var I=!0;else{var Se=n(f);Se!==null&&se(H,Se.startTime-ie),I=!1}return I}finally{m=null,T=k,y=!1}}var D=!1,q=null,re=-1,me=5,V=-1;function oe(){return!(e.unstable_now()-V<me)}function ce(){if(q!==null){var K=e.unstable_now();V=K;var ie=!0;try{ie=q(!0,K)}finally{ie?de():(D=!1,q=null)}}else D=!1}var de;if(typeof P=="function")de=function(){P(ce)};else if(typeof MessageChannel!="undefined"){var ne=new MessageChannel,Te=ne.port2;ne.port1.onmessage=ce,de=function(){Te.postMessage(null)}}else de=function(){C(ce,0)};function Pe(K){q=K,D||(D=!0,de())}function se(K,ie){re=C(function(){K(e.unstable_now())},ie)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){_||y||(_=!0,Pe(Y))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):me=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return T},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(K){switch(T){case 1:case 2:case 3:var ie=3;break;default:ie=T}var k=T;T=ie;try{return K()}finally{T=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,ie){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var k=T;T=K;try{return ie()}finally{T=k}},e.unstable_scheduleCallback=function(K,ie,k){var L=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?L+k:L):k=L,K){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=k+ee,K={id:p++,callback:ie,priorityLevel:K,startTime:k,expirationTime:ee,sortIndex:-1},k>L?(K.sortIndex=k,t(f,K),n(d)===null&&K===n(f)&&(w?(A(re),re=-1):w=!0,se(H,k-L))):(K.sortIndex=ee,t(d,K),_||y||(_=!0,Pe(Y))),K},e.unstable_shouldYield=oe,e.unstable_wrapCallback=function(K){var ie=T;return function(){var k=T;T=ie;try{return K.apply(this,arguments)}finally{T=k}}}})(If)),If}var k1;function Mk(){return k1||(k1=1,Of.exports=Dk()),Of.exports}var P1;function Fk(){if(P1)return Dn;P1=1;var e=Cn(),t=Mk();function n(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,l=1;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(i,s){u(i,s),u(i+"Capture",s)}function u(i,s){for(o[i]=s,i=0;i<s.length;i++)r.add(s[i])}var c=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function T(i){return d.call(m,i)?!0:d.call(p,i)?!1:f.test(i)?m[i]=!0:(p[i]=!0,!1)}function y(i,s,l,h){if(l!==null&&l.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function _(i,s,l,h){if(s===null||typeof s=="undefined"||y(i,s,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(i,s,l,h,E,b,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=h,this.attributeNamespace=E,this.mustUseProperty=l,this.propertyName=i,this.type=s,this.sanitizeURL=b,this.removeEmptyString=S}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];C[s]=new w(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new w(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function P(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(A,P);C[s]=new w(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function v(i,s,l,h){var E=C.hasOwnProperty(s)?C[s]:null;(E!==null?E.type!==0:h||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(_(s,l,E,h)&&(l=null),h||E===null?T(s)&&(l===null?i.removeAttribute(s):i.setAttribute(s,""+l)):E.mustUseProperty?i[E.propertyName]=l===null?E.type===3?!1:"":l:(s=E.attributeName,h=E.attributeNamespace,l===null?i.removeAttribute(s):(E=E.type,l=E===3||E===4&&l===!0?"":""+l,h?i.setAttributeNS(h,s,l):i.setAttribute(s,l))))}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for("react.element"),D=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),oe=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),K=Symbol.iterator;function ie(i){return i===null||typeof i!="object"?null:(i=K&&i[K]||i["@@iterator"],typeof i=="function"?i:null)}var k=Object.assign,L;function ee(i){if(L===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);L=s&&s[1]||""}return`
11
11
  `+L+i}var I=!1;function Se(i,s){if(!i||I)return"";I=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(Z){var h=Z}Reflect.construct(i,[],s)}else{try{s.call()}catch(Z){h=Z}i.call(s.prototype)}else{try{throw Error()}catch(Z){h=Z}i()}}catch(Z){if(Z&&h&&typeof Z.stack=="string"){for(var E=Z.stack.split(`
12
12
  `),b=h.stack.split(`
13
13
  `),S=E.length-1,R=b.length-1;1<=S&&0<=R&&E[S]!==b[R];)R--;for(;1<=S&&0<=R;S--,R--)if(E[S]!==b[R]){if(S!==1||R!==1)do if(S--,R--,0>R||E[S]!==b[R]){var U=`
@@ -28,7 +28,7 @@ Error generating stack: `+b.message+`
28
28
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
29
29
  `}),n}function JE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ZE(e,t){const n=CI(e,t),r=n.one(e,void 0),o=EI(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
30
30
  `},o),a}function II(e,t){return e&&"run"in e?function(n,r){return Je(this,null,function*(){const o=ZE(n,F({file:r},t));yield e.run(o,r)})}:function(n,r){return ZE(n,F({file:r},e||t))}}function ey(e){if(e)throw e}var rh,ty;function RI(){if(ty)return rh;ty=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var T;for(T in f);return typeof T=="undefined"||e.call(f,T)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return rh=function d(){var f,p,m,T,y,_,w=arguments[0],C=1,A=arguments.length,P=!1;for(typeof w=="boolean"&&(P=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<A;++C)if(f=arguments[C],f!=null)for(p in f)m=c(w,p),T=c(f,p),w!==T&&(P&&T&&(a(T)||(y=o(T)))?(y?(y=!1,_=m&&o(m)?m:[]):_=m&&a(m)?m:{},u(w,{name:p,newValue:d(P,_,T)})):typeof T!="undefined"&&u(w,{name:p,newValue:T}));return w},rh}var LI=RI();const ih=ze(LI);function oh(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 DI(){const e=[],t={run:n,use:r};return t;function n(...o){let a=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...o);function c(d,...f){const p=e[++a];let m=-1;if(d){u(d);return}for(;++m<o.length;)(f[m]===null||f[m]===void 0)&&(f[m]=o[m]);o=f,p?MI(p,c)(...f):u(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function MI(e,t){let n;return r;function r(...u){const c=e.length>u.length;let d;c&&u.push(o);try{d=e.apply(this,u)}catch(f){const p=f;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,o):d instanceof Error?o(d):a(d))}function o(u,...c){n||(n=!0,t(u,...c))}function a(u){o(null,u)}}const zr={basename:FI,dirname:BI,extname:UI,join:HI,sep:"/"};function FI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');La(e);let n=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else u<0&&(a=!0,u=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function BI(e){if(La(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 UI(e){La(e);let t=e.length,n=-1,r=0,o=-1,a=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?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function HI(...e){let t=-1,n;for(;++t<e.length;)La(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zI(n)}function zI(e){La(e);const t=e.codePointAt(0)===47;let n=jI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function jI(e,t){let n="",r=0,o=-1,a=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(!(o===u-1||a===1))if(o!==u-1&&a===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("/")),o=u,a=0;continue}}else if(n.length>0){n="",r=0,o=u,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),r=u-o-1;o=u,a=0}else c===46&&a>-1?a++:a=-1}return n}function La(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $I={cwd:VI};function VI(){return"/"}function sh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qI(e){if(typeof e=="string")e=new URL(e);else if(!sh(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 YI(e)}function YI(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const ah=["history","path","basename","stem","extname","dirname"];class ny{constructor(t){let n;t?sh(t)?n={path:t}:typeof t=="string"||WI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$I.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ah.length;){const a=ah[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)ah.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zr.basename(this.path):void 0}set basename(t){lh(t,"basename"),uh(t,"basename"),this.path=zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zr.dirname(this.path):void 0}set dirname(t){ry(this.basename,"dirname"),this.path=zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zr.extname(this.path):void 0}set extname(t){if(uh(t,"extname"),ry(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=zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sh(t)&&(t=qI(t)),lh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zr.basename(this.path,this.extname):void 0}set stem(t){lh(t,"stem"),uh(t,"stem"),this.path=zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new bn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function uh(e,t){if(e&&e.includes(zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zr.sep+"`")}function lh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ry(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function WI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const GI=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),XI={}.hasOwnProperty;class ch extends GI{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=DI()}copy(){const t=new ch;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ih(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hh("data",this.frozen),this.namespace[t]=n,this):XI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hh("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ml(t),r=this.parser||this.Parser;return dh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),dh("process",this.parser||this.Parser),fh("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,u){const c=Ml(t),d=r.parse(c);r.run(d,c,function(p,m,T){if(p||!m||!T)return f(p);const y=m,_=r.stringify(y,T);JI(_)?T.value=_:T.result=_,f(p,T)});function f(p,m){p||!m?u(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),dh("processSync",this.parser||this.Parser),fh("processSync",this.compiler||this.Compiler),this.process(t,o),oy("processSync","process",n),r;function o(a,u){n=!0,ey(a),r=u}}run(t,n,r){iy(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(u,c){const d=Ml(n);o.run(t,d,f);function f(p,m,T){const y=m||t;p?c(p):u?u(y):r(void 0,y,T)}}}runSync(t,n){let r=!1,o;return this.run(t,n,a),oy("runSync","run",r),o;function a(u,c){ey(u),o=c,r=!0}}stringify(t,n){this.freeze();const r=Ml(n),o=this.compiler||this.Compiler;return fh("stringify",o),iy(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(hh("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 a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,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&&(o.settings=ih(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,T=-1;for(;++m<r.length;)if(r[m][0]===f){T=m;break}if(T===-1)r.push([f,...p]);else if(p.length>0){let[y,..._]=p;const w=r[T][1];oh(w)&&oh(y)&&(y=ih(!0,w,y)),r[T]=[f,y,..._]}}}}const KI=new ch().freeze();function dh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hh(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 iy(e){if(!oh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ml(e){return QI(e)?e:new ny(e)}function QI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function JI(e){return typeof e=="string"||ZI(e)}function ZI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sy=[],ay={allowDangerousHtml:!0},t3=/^(https?|ircs?|mailto|xmpp)$/i,n3=[{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 uy(e){const t=r3(e),n=i3(e);return o3(t.runSync(t.parse(n),n),e)}function r3(e){const t=e.rehypePlugins||sy,n=e.remarkPlugins||sy,r=e.remarkRehypeOptions?F(F({},e.remarkRehypeOptions),ay):ay;return KI().use(BO).use(n).use(II,r).use(t)}function i3(e){const t=e.children||"",n=new ny;return typeof t=="string"&&(n.value=t),n}function o3(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||s3;for(const p of n3)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+e3+p.id,void 0);return Dl(e,f),NP(e,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function f(p,m,T){if(p.type==="raw"&&T&&typeof m=="number")return u?T.children.splice(m,1):T.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let y;for(y in $f)if(Object.hasOwn($f,y)&&Object.hasOwn(p.properties,y)){const _=p.properties[y],w=$f[y];(w===null||w.includes(p.tagName))&&(p.properties[y]=d(String(_||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(p,m,T)),y&&T&&typeof m=="number")return c&&p.children?T.children.splice(m,1,...p.children):T.children.splice(m,1),m}}}function s3(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||t3.test(e.slice(0,t))?e:""}const ly=/[#.]/g;function a3(e,t){const n=e||"",r={};let o=0,a,u;for(;o<n.length;){ly.lastIndex=o;const c=ly.exec(n),d=n.slice(o,c?c.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:u=d,o+=d.length),c&&(a=c[0],o++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function cy(e,t,n){const r=n?d3(n):void 0;function o(a,u,...c){let d;if(a==null){d={type:"root",children:[]};const f=u;c.unshift(f)}else{d=a3(a,t);const f=d.tagName.toLowerCase(),p=r?r.get(f):void 0;if(d.tagName=p||f,u3(u))c.unshift(u);else for(const[m,T]of Object.entries(u))l3(e,d.properties,m,T)}for(const f of c)ph(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function u3(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 o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const a=o;for(const u of a)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function l3(e,t,n,r){const o=Ff(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?o.spaceSeparated?a=eE(r):o.commaSeparated?a=z1(r):o.commaOrSpaceSeparated?a=eE(z1(r).join(" ")):a=dy(o,o.property,r):Array.isArray(r)?a=[...r]:a=o.property==="style"?c3(r):String(r);if(Array.isArray(a)){const u=[];for(const c of a)u.push(dy(o,o.property,c));a=u}o.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[o.property]=a}}function ph(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)ph(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ph(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function dy(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||wa(n)===wa(t)))return!0}return n}function c3(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function d3(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const f3=["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"],h3=cy(xl,"div"),p3=cy(ts,"g",f3);function m3(e){const t=String(e),n=[];return{toOffset:o,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let u=0;for(;;){let c=n[u];if(c===void 0){const d=fy(t,n[u-1]);c=d===-1?t.length+1:d+1,n[u]=c}if(c>a)return{line:u+1,column:a-(u>0?n[u-1]:0)+1,offset:a};u++}}}function o(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const c=n[n.length-1],d=fy(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const u=(a.line>1?n[a.line-2]:0)+a.column-1;if(u<n[a.line-1])return u}}}function fy(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
31
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ho={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/"},hy={}.hasOwnProperty,g3=Object.prototype;function E3(e,t){const n=t||{};return mh({file:n.file||void 0,location:!1,schema:n.space==="svg"?ts:xl,verbose:n.verbose||!1},e)}function mh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Fl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:py(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const a=String(e.file),u=m3(a),c=u.toPoint(0),d=u.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Fl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Fl(e,r,n),n}default:return n=y3(e,t),n}}function py(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=mh(e,t[n]);r.push(o)}return r}function y3(e,t){const n=e.schema;e.schema=t.namespaceURI===ho.svg?ts:xl;let r=-1;const o={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;hy.call(g3,d)||(o[d]=c.value)}const u=(e.schema.space==="svg"?p3:h3)(t.tagName,o,py(e,t.childNodes));if(Fl(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&ss(d.startTag),p=d&&d.endTag&&ss(d.endTag),m=mh(e,c.content);f&&p&&e.file&&(m.position={start:f.end,end:p.start}),u.content=m}return e.schema=n,u}function Fl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=b3(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function b3(e,t,n){const r=ss(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!n.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)hy.call(n.attrs,u)&&(a[Ff(e.schema,u).property]=ss(n.attrs[u]));n.startTag;const c=ss(n.startTag),d=n.endTag?ss(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function ss(e){const t=my({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=my({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function my(e){return e.line&&e.column?e:void 0}class Da{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Da.prototype.property={},Da.prototype.normal={},Da.prototype.space=null;function gy(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Da(n,r,t)}function gh(e){return e.toLowerCase()}class lr{constructor(t,n){this.property=t,this.attribute=n}}lr.prototype.space=null,lr.prototype.boolean=!1,lr.prototype.booleanish=!1,lr.prototype.overloadedBoolean=!1,lr.prototype.number=!1,lr.prototype.commaSeparated=!1,lr.prototype.spaceSeparated=!1,lr.prototype.commaOrSpaceSeparated=!1,lr.prototype.mustUseProperty=!1,lr.prototype.defined=!1;let T3=0;const Xe=po(),jt=po(),Ey=po(),be=po(),yt=po(),as=po(),Kn=po();function po(){return ia(2,++T3)}const Eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:jt,commaOrSpaceSeparated:Kn,commaSeparated:as,number:be,overloadedBoolean:Ey,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),yh=Object.keys(Eh);class bh extends lr{constructor(t,n,r,o){let a=-1;if(super(t,n),yy(this,"space",o),typeof r=="number")for(;++a<yh.length;){const u=yh[a];yy(this,yh[a],(r&Eh[u])===Eh[u])}}}bh.prototype.defined=!0;function yy(e,t,n){n&&(e[t]=n)}const _3={}.hasOwnProperty;function us(e){const t={},n={};let r;for(r in e.properties)if(_3.call(e.properties,r)){const o=e.properties[r],a=new bh(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[gh(r)]=r,n[gh(a.attribute)]=r}return new Da(t,n,e.space)}const by=us({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Ty=us({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function _y(e,t){return t in e?e[t]:t}function Sy(e,t){return _y(e,t.toLowerCase())}const xy=us({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Sy,properties:{xmlns:null,xmlnsXLink:null}}),wy=us({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:yt,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:be,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:yt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:jt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),S3=us({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Sy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:as,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:yt,autoFocus:Xe,autoPlay:Xe,blocking:yt,capture:null,charSet:null,checked:Xe,cite:null,className:yt,cols:be,colSpan:null,content:null,contentEditable:jt,controls:Xe,controlsList:yt,coords:be|as,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:Ey,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:yt,height:be,hidden:Xe,high:be,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:yt,itemRef:yt,itemScope:Xe,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:be,pattern:null,ping:yt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:yt,required:Xe,reversed:Xe,rows:be,rowSpan:be,sandbox:yt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:jt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:be,security:null,unselectable:null}}),x3=us({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:_y,properties:{about:Kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:as,g2:as,glyphName:as,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),w3=/^data[-\w.:]+$/i,Ay=/-[a-z]/g,A3=/[A-Z]/g;function v3(e,t){const n=gh(t);let r=t,o=lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&w3.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ay,k3);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ay.test(a)){let u=a.replace(A3,C3);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=bh}return new o(r,t)}function C3(e){return"-"+e.toLowerCase()}function k3(e){return e.charAt(1).toUpperCase()}const P3=gy([Ty,by,xy,wy,S3],"html"),vy=gy([Ty,by,xy,wy,x3],"svg"),Cy={}.hasOwnProperty;function ky(e,t){const n=t||{};function r(o,...a){let u=r.invalid;const c=r.handlers;if(o&&Cy.call(o,e)){const d=String(o[e]);u=Cy.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,o,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const N3={},O3={}.hasOwnProperty,Py=ky("type",{handlers:{root:R3,element:B3,text:M3,comment:F3,doctype:D3}});function I3(e,t){const r=(t||N3).space;return Py(e,r==="svg"?vy:P3)}function R3(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Th(e.children,n,t),ls(e,n),n}function L3(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Th(e.children,n,t),ls(e,n),n}function D3(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ls(e,t),t}function M3(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ls(e,t),t}function F3(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ls(e,t),t}function B3(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=vy);const o=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&O3.call(e.properties,a)){const d=U3(r,a,e.properties[a]);d&&o.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:ho[u],childNodes:[],parentNode:null};return c.childNodes=Th(e.children,c,r),ls(e,c),e.tagName==="template"&&e.content&&(c.content=L3(e.content,r)),c}function U3(e,t,n){const r=v3(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?j1(n):tE(n));const o={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=o.name.indexOf(":");a<0?o.prefix="":(o.name=o.name.slice(a+1),o.prefix=r.attribute.slice(0,a)),o.namespace=ho[r.space]}return o}function Th(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const a=Py(e[r],n);a.parentNode=t,o.push(a)}return o}function ls(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 H3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],z3=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]),At="�";var N;(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"})(N||(N={}));const Bn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ny(e){return e>=55296&&e<=57343}function j3(e){return e>=56320&&e<=57343}function $3(e,t){return(e-55296)*1024+9216+t}function Oy(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Iy(e){return e>=64976&&e<=65007||z3.has(e)}var te;(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"})(te||(te={}));const V3=65536;class q3{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=V3,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:o,offset:a}=this,u=o+n,c=a+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(j3(n))return this.pos++,this._addGap(),$3(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(te.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,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.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,N.EOF;let t=this.html.charCodeAt(this.pos);return t===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):t===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ny(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===N.LINE_FEED||t===N.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Oy(t)?this._err(te.controlCharacterInInputStream):Iy(t)&&this._err(te.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Qe;(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"})(Qe||(Qe={}));function Ry(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 Y3=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))),W3=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 G3(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=W3.get(e))!==null&&t!==void 0?t:e}var Jt;(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"})(Jt||(Jt={}));const X3=32;var Ni;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ni||(Ni={}));function _h(e){return e>=Jt.ZERO&&e<=Jt.NINE}function K3(e){return e>=Jt.UPPER_A&&e<=Jt.UPPER_F||e>=Jt.LOWER_A&&e<=Jt.LOWER_F}function Q3(e){return e>=Jt.UPPER_A&&e<=Jt.UPPER_Z||e>=Jt.LOWER_A&&e<=Jt.LOWER_Z||_h(e)}function J3(e){return e===Jt.EQUALS||Q3(e)}var Zt;(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"})(Zt||(Zt={}));var di;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(di||(di={}));class Z3{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Zt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=di.Strict}startEntity(t){this.decodeMode=t,this.state=Zt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Zt.EntityStart:return t.charCodeAt(n)===Jt.NUM?(this.state=Zt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Zt.NamedEntity,this.stateNamedEntity(t,n));case Zt.NumericStart:return this.stateNumericStart(t,n);case Zt.NumericDecimal:return this.stateNumericDecimal(t,n);case Zt.NumericHex:return this.stateNumericHex(t,n);case Zt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|X3)===Jt.LOWER_X?(this.state=Zt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Zt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,o){if(n!==r){const a=r-n;this.result=this.result*Math.pow(o,a)+Number.parseInt(t.substr(n,a),o),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(_h(o)||K3(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(_h(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,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===Jt.SEMI)this.consumed+=1;else if(this.decodeMode===di.Strict)return 0;return this.emitCodePoint(G3(this.result),this.consumed),this.errors&&(t!==Jt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],a=(o&Ni.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=eR(r,o,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===di.Attribute&&(a===0||J3(u))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],a=(o&Ni.VALUE_LENGTH)>>14,a!==0){if(u===Jt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==di.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,o=(r[n]&Ni.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Ni.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case Zt.NamedEntity:return this.result!==0&&(this.decodeMode!==di.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Zt.NumericDecimal:return this.emitNumericEntity(0,2);case Zt.NumericHex:return this.emitNumericEntity(0,3);case Zt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zt.EntityStart:return 0}}}function eR(e,t,n,r){const o=(t&Ni.BRANCH_LENGTH)>>7,a=t&Ni.JUMP_TABLE;if(o===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=o?-1:e[n+d]-1}let u=n,c=u+o-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+o]}return-1}var ue;(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/"})(ue||(ue={}));var mo;(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"})(mo||(mo={}));var cr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(cr||(cr={}));var X;(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"})(X||(X={}));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 tR=new Map([[X.A,g.A],[X.ADDRESS,g.ADDRESS],[X.ANNOTATION_XML,g.ANNOTATION_XML],[X.APPLET,g.APPLET],[X.AREA,g.AREA],[X.ARTICLE,g.ARTICLE],[X.ASIDE,g.ASIDE],[X.B,g.B],[X.BASE,g.BASE],[X.BASEFONT,g.BASEFONT],[X.BGSOUND,g.BGSOUND],[X.BIG,g.BIG],[X.BLOCKQUOTE,g.BLOCKQUOTE],[X.BODY,g.BODY],[X.BR,g.BR],[X.BUTTON,g.BUTTON],[X.CAPTION,g.CAPTION],[X.CENTER,g.CENTER],[X.CODE,g.CODE],[X.COL,g.COL],[X.COLGROUP,g.COLGROUP],[X.DD,g.DD],[X.DESC,g.DESC],[X.DETAILS,g.DETAILS],[X.DIALOG,g.DIALOG],[X.DIR,g.DIR],[X.DIV,g.DIV],[X.DL,g.DL],[X.DT,g.DT],[X.EM,g.EM],[X.EMBED,g.EMBED],[X.FIELDSET,g.FIELDSET],[X.FIGCAPTION,g.FIGCAPTION],[X.FIGURE,g.FIGURE],[X.FONT,g.FONT],[X.FOOTER,g.FOOTER],[X.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[X.FORM,g.FORM],[X.FRAME,g.FRAME],[X.FRAMESET,g.FRAMESET],[X.H1,g.H1],[X.H2,g.H2],[X.H3,g.H3],[X.H4,g.H4],[X.H5,g.H5],[X.H6,g.H6],[X.HEAD,g.HEAD],[X.HEADER,g.HEADER],[X.HGROUP,g.HGROUP],[X.HR,g.HR],[X.HTML,g.HTML],[X.I,g.I],[X.IMG,g.IMG],[X.IMAGE,g.IMAGE],[X.INPUT,g.INPUT],[X.IFRAME,g.IFRAME],[X.KEYGEN,g.KEYGEN],[X.LABEL,g.LABEL],[X.LI,g.LI],[X.LINK,g.LINK],[X.LISTING,g.LISTING],[X.MAIN,g.MAIN],[X.MALIGNMARK,g.MALIGNMARK],[X.MARQUEE,g.MARQUEE],[X.MATH,g.MATH],[X.MENU,g.MENU],[X.META,g.META],[X.MGLYPH,g.MGLYPH],[X.MI,g.MI],[X.MO,g.MO],[X.MN,g.MN],[X.MS,g.MS],[X.MTEXT,g.MTEXT],[X.NAV,g.NAV],[X.NOBR,g.NOBR],[X.NOFRAMES,g.NOFRAMES],[X.NOEMBED,g.NOEMBED],[X.NOSCRIPT,g.NOSCRIPT],[X.OBJECT,g.OBJECT],[X.OL,g.OL],[X.OPTGROUP,g.OPTGROUP],[X.OPTION,g.OPTION],[X.P,g.P],[X.PARAM,g.PARAM],[X.PLAINTEXT,g.PLAINTEXT],[X.PRE,g.PRE],[X.RB,g.RB],[X.RP,g.RP],[X.RT,g.RT],[X.RTC,g.RTC],[X.RUBY,g.RUBY],[X.S,g.S],[X.SCRIPT,g.SCRIPT],[X.SEARCH,g.SEARCH],[X.SECTION,g.SECTION],[X.SELECT,g.SELECT],[X.SOURCE,g.SOURCE],[X.SMALL,g.SMALL],[X.SPAN,g.SPAN],[X.STRIKE,g.STRIKE],[X.STRONG,g.STRONG],[X.STYLE,g.STYLE],[X.SUB,g.SUB],[X.SUMMARY,g.SUMMARY],[X.SUP,g.SUP],[X.TABLE,g.TABLE],[X.TBODY,g.TBODY],[X.TEMPLATE,g.TEMPLATE],[X.TEXTAREA,g.TEXTAREA],[X.TFOOT,g.TFOOT],[X.TD,g.TD],[X.TH,g.TH],[X.THEAD,g.THEAD],[X.TITLE,g.TITLE],[X.TR,g.TR],[X.TRACK,g.TRACK],[X.TT,g.TT],[X.U,g.U],[X.UL,g.UL],[X.SVG,g.SVG],[X.VAR,g.VAR],[X.WBR,g.WBR],[X.XMP,g.XMP]]);function cs(e){var t;return(t=tR.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const fe=g,nR={[ue.HTML]:new Set([fe.ADDRESS,fe.APPLET,fe.AREA,fe.ARTICLE,fe.ASIDE,fe.BASE,fe.BASEFONT,fe.BGSOUND,fe.BLOCKQUOTE,fe.BODY,fe.BR,fe.BUTTON,fe.CAPTION,fe.CENTER,fe.COL,fe.COLGROUP,fe.DD,fe.DETAILS,fe.DIR,fe.DIV,fe.DL,fe.DT,fe.EMBED,fe.FIELDSET,fe.FIGCAPTION,fe.FIGURE,fe.FOOTER,fe.FORM,fe.FRAME,fe.FRAMESET,fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6,fe.HEAD,fe.HEADER,fe.HGROUP,fe.HR,fe.HTML,fe.IFRAME,fe.IMG,fe.INPUT,fe.LI,fe.LINK,fe.LISTING,fe.MAIN,fe.MARQUEE,fe.MENU,fe.META,fe.NAV,fe.NOEMBED,fe.NOFRAMES,fe.NOSCRIPT,fe.OBJECT,fe.OL,fe.P,fe.PARAM,fe.PLAINTEXT,fe.PRE,fe.SCRIPT,fe.SECTION,fe.SELECT,fe.SOURCE,fe.STYLE,fe.SUMMARY,fe.TABLE,fe.TBODY,fe.TD,fe.TEMPLATE,fe.TEXTAREA,fe.TFOOT,fe.TH,fe.THEAD,fe.TITLE,fe.TR,fe.TRACK,fe.UL,fe.WBR,fe.XMP]),[ue.MATHML]:new Set([fe.MI,fe.MO,fe.MN,fe.MS,fe.MTEXT,fe.ANNOTATION_XML]),[ue.SVG]:new Set([fe.TITLE,fe.FOREIGN_OBJECT,fe.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Sh=new Set([fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6]);X.STYLE,X.SCRIPT,X.XMP,X.IFRAME,X.NOEMBED,X.NOFRAMES,X.PLAINTEXT;var O;(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"})(O||(O={}));const Dt={DATA:O.DATA,RCDATA:O.RCDATA,RAWTEXT:O.RAWTEXT,SCRIPT_DATA:O.SCRIPT_DATA,PLAINTEXT:O.PLAINTEXT,CDATA_SECTION:O.CDATA_SECTION};function rR(e){return e>=N.DIGIT_0&&e<=N.DIGIT_9}function Ma(e){return e>=N.LATIN_CAPITAL_A&&e<=N.LATIN_CAPITAL_Z}function iR(e){return e>=N.LATIN_SMALL_A&&e<=N.LATIN_SMALL_Z}function Oi(e){return iR(e)||Ma(e)}function Ly(e){return Oi(e)||rR(e)}function Bl(e){return e+32}function Dy(e){return e===N.SPACE||e===N.LINE_FEED||e===N.TABULATION||e===N.FORM_FEED}function My(e){return Dy(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN}function oR(e){return e===N.NULL?te.nullCharacterReference:e>1114111?te.characterReferenceOutsideUnicodeRange:Ny(e)?te.surrogateCharacterReference:Iy(e)?te.noncharacterCharacterReference:Oy(e)||e===N.CARRIAGE_RETURN?te.controlCharacterReference:null}class sR{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=O.DATA,this.returnState=O.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new q3(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Z3(Y3,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=oR(r);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.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:Qe.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Qe.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Qe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Qe.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(Ry(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(te.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=cs(t.tagName),t.type===Qe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(te.endTagWithAttributes),t.selfClosing&&this._err(te.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 Qe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Qe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Qe.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:Qe.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=Dy(t)?Qe.WHITESPACE_CHARACTER:t===N.NULL?Qe.NULL_CHARACTER:Qe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Qe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=O.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?di.Attribute:di.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===O.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===O.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===O.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case O.DATA:{this._stateData(t);break}case O.RCDATA:{this._stateRcdata(t);break}case O.RAWTEXT:{this._stateRawtext(t);break}case O.SCRIPT_DATA:{this._stateScriptData(t);break}case O.PLAINTEXT:{this._statePlaintext(t);break}case O.TAG_OPEN:{this._stateTagOpen(t);break}case O.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case O.TAG_NAME:{this._stateTagName(t);break}case O.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case O.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case O.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case O.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case O.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case O.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case O.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case O.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case O.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case O.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case O.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case O.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case O.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case O.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case O.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case O.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case O.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case O.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case O.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case O.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case O.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case O.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case O.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case O.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case O.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case O.BOGUS_COMMENT:{this._stateBogusComment(t);break}case O.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case O.COMMENT_START:{this._stateCommentStart(t);break}case O.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case O.COMMENT:{this._stateComment(t);break}case O.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case O.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case O.COMMENT_END:{this._stateCommentEnd(t);break}case O.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case O.DOCTYPE:{this._stateDoctype(t);break}case O.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case O.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case O.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case O.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case O.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case O.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case O.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case O.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case O.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case O.CDATA_SECTION:{this._stateCdataSection(t);break}case O.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case O.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case O.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case O.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(t);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=O.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Oi(t))this._createStartTagToken(),this.state=O.TAG_NAME,this._stateTagName(t);else switch(t){case N.EXCLAMATION_MARK:{this.state=O.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=O.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t);break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=O.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Oi(t))this._createEndTagToken(),this.state=O.TAG_NAME,this._stateTagName(t);else switch(t){case N.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=O.DATA;break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=O.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateRcdataLessThanSign(t){t===N.SOLIDUS?this.state=O.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=O.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Oi(t)?(this.state=O.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=O.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=O.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=O.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=O.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===N.SOLIDUS?this.state=O.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Oi(t)?(this.state=O.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case N.SOLIDUS:{this.state=O.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=O.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=O.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Oi(t)?(this.state=O.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===N.HYPHEN_MINUS?(this.state=O.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===N.HYPHEN_MINUS?(this.state=O.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=O.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===N.SOLIDUS?this.state=O.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Oi(t)?(this._emitChars("<"),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Oi(t)?(this.state=O.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&My(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=O.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===N.SOLIDUS?(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&My(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=O.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=O.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=O.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=O.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=O.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=O.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=At;break}default:this.currentAttr.name+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateAfterAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=O.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=O.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=O.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=O.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=O.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=O.DATA,this.emitCurrentTagToken();break}default:this.state=O.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case N.APOSTROPHE:{this.state=O.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=O.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=O.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=O.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=O.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=At;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Bn.DASH_DASH,!0)?(this._createCommentToken(Bn.DASH_DASH.length+1),this.state=O.COMMENT_START):this._consumeSequenceIfMatch(Bn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bn.DOCTYPE.length+1),this.state=O.DOCTYPE):this._consumeSequenceIfMatch(Bn.CDATA_START,!0)?this.inForeignNode?this.state=O.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(Bn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=O.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=O.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=O.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=O.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=O.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=At;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case N.EXCLAMATION_MARK:{n.data+="!",this.state=O.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=O.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===N.HYPHEN_MINUS?this.state=O.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=O.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===N.HYPHEN_MINUS?this.state=O.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=O.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==N.GREATER_THAN_SIGN&&t!==N.EOF&&this._err(te.nestedComment),this.state=O.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=O.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=O.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=O.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{n.data+="--!",this.state=O.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=O.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=O.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case N.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=O.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ma(t))this._createDoctypeToken(String.fromCharCode(Bl(t))),this.state=O.DOCTYPE_NAME;else switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(At),this.state=O.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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=O.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.name+=At;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bn.PUBLIC,!1)?this.state=O.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bn.SYSTEM,!1)?this.state=O.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.NULL:{this._err(te.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case N.RIGHT_SQUARE_BRACKET:{this.state=O.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===N.RIGHT_SQUARE_BRACKET?this.state=O.CDATA_SECTION_END:(this._emitChars("]"),this.state=O.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=O.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(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ly(this.preprocessor.peek(1))?O.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ly(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===N.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Fy=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),By=new Set([...Fy,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),Ul=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),aR=new Set([...Ul,g.OL,g.UL]),uR=new Set([...Ul,g.BUTTON]),Uy=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Hy=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),lR=new Set([g.TR,g.TEMPLATE,g.HTML]),cR=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),dR=new Set([g.TABLE,g.TEMPLATE,g.HTML]),fR=new Set([g.TD,g.TH]);class hR{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)===ue.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 o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===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])!==ue.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(Sh,ue.HTML)}popUntilTableCellPopped(){this.popUntilPopped(fR,ue.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(dR,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(cR,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(lR,ue.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 o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case ue.SVG:{if(Hy.has(o))return!1;break}case ue.MATHML:{if(Uy.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ul)}hasInListItemScope(t){return this.hasInDynamicScope(t,aR)}hasInButtonScope(t){return this.hasInDynamicScope(t,uR)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ue.HTML:{if(Sh.has(n))return!0;if(Ul.has(n))return!1;break}case ue.SVG:{if(Hy.has(n))return!1;break}case ue.MATHML:{if(Uy.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.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])===ue.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])===ue.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&&Fy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&By.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&By.has(this.currentTagId);)this.pop()}}const xh=3;var jr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(jr||(jr={}));const zy={type:jr.Marker};class pR{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,a=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===jr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const p=this.treeAdapter.getAttrList(f);p.length===o&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<xh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<xh)return;const o=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>o.get(d.name)===d.value)&&(a+=1,a>=xh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(zy)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:jr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:jr.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(zy);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===jr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===jr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===jr.Element&&n.element===t)}}const Ii={createDocument(){return{nodeName:"#document",mode:cr.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 o=e.childNodes.find(a=>a.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ii.appendChild(e,a)}},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(Ii.isTextNode(n)){n.value+=t;return}}Ii.appendChild(e,Ii.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ii.isTextNode(r)?r.value+=t:Ii.insertBefore(e,Ii.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=F(F({},e.sourceCodeLocation),t)}},jy="html",mR="about:legacy-compat",gR="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",$y=["+//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//"],ER=[...$y,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],yR=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Vy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],bR=[...Vy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function qy(e,t){return t.some(n=>e.startsWith(n))}function TR(e){return e.name===jy&&e.publicId===null&&(e.systemId===null||e.systemId===mR)}function _R(e){if(e.name!==jy)return cr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===gR)return cr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),yR.has(n))return cr.QUIRKS;let r=t===null?ER:$y;if(qy(n,r))return cr.QUIRKS;if(r=t===null?Vy:bR,qy(n,r))return cr.LIMITED_QUIRKS}return cr.NO_QUIRKS}const Yy={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},SR="definitionurl",xR="definitionURL",wR=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])),AR=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),vR=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])),CR=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 kR(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===mo.COLOR||r===mo.SIZE||r===mo.FACE)||CR.has(t)}function Wy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===SR){e.attrs[t].name=xR;break}}function Gy(e){for(let t=0;t<e.attrs.length;t++){const n=wR.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function wh(e){for(let t=0;t<e.attrs.length;t++){const n=AR.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 PR(e){const t=vR.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=cs(e.tagName))}function NR(e,t){return t===ue.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function OR(e,t,n){if(t===ue.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===mo.ENCODING){const o=n[r].value.toLowerCase();return o===Yy.TEXT_HTML||o===Yy.APPLICATION_XML}}return t===ue.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function IR(e,t,n,r){return(!r||r===ue.HTML)&&OR(e,t,n)||(!r||r===ue.MATHML)&&NR(e,t)}const RR="hidden",LR=8,DR=3;var M;(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"})(M||(M={}));const MR={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Xy=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Ky={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ii,onParseError:null};class Qy{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=M.INITIAL,this.originalInsertionMode=M.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=F(F({},Ky),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 sR(this.options,this),this.activeFormattingElements=new pR(this.treeAdapter),this.fragmentContextID=r?cs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new hR(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=F(F({},Ky),n);t!=null||(t=r.treeAdapter.createElement(X.TEMPLATE,ue.HTML,[]));const o=r.treeAdapter.createElement("documentmock",ue.HTML,[]),a=new this(r,o,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(M.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var o;if(!this.onParseError)return;const a=(o=t.location)!==null&&o!==void 0?o:MR,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var o,a;(a=(o=this.treeAdapter).onItemPush)===null||a===void 0||a.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=M.TEXT}switchToPlaintextParsing(){this.insertionMode=M.TEXT,this.originalInsertionMode=M.IN_BODY,this.tokenizer.state=Dt.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)===X.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Dt.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Dt.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Dt.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Dt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,o),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&&pe(F({},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,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ue.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(X.HTML,ue.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 o=this.treeAdapter.getChildNodes(n),a=r?o.lastIndexOf(r):o.length,u=o[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:p})}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,o=this.treeAdapter.getTagName(t),a=n.type===Qe.END_TAG&&o===n.tagName?{endTag:F({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}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)===X.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(t){switch(t.type){case Qe.CHARACTER:{this.onCharacter(t);break}case Qe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Qe.COMMENT:{this.onComment(t);break}case Qe.DOCTYPE:{this.onDoctype(t);break}case Qe.START_TAG:{this._processStartTag(t);break}case Qe.END_TAG:{this.onEndTag(t);break}case Qe.EOF:{this.onEof(t);break}case Qe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return IR(t,o,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===jr.Marker||this.openElements.contains(o.element)),r=n===-1?t-1:n-1;for(let o=r;o>=0;o--){const a=this.activeFormattingElements.entries[o];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=M.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=M.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=M.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=M.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=M.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=M.IN_TABLE;return}case g.BODY:{this.insertionMode=M.IN_BODY;return}case g.FRAMESET:{this.insertionMode=M.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?M.AFTER_HEAD:M.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=M.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=M.IN_HEAD;return}break}}this.insertionMode=M.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=M.IN_SELECT_IN_TABLE;return}}this.insertionMode=M.IN_SELECT}_isElementCausesFosterParenting(t){return Xy.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)===ue.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 nR[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){f6(this,t);return}switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:{Zy(this,t);break}case M.TEXT:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_TABLE_TEXT:{ab(this,t);break}case M.IN_COLUMN_GROUP:{jl(this,t);break}case M.AFTER_BODY:{ql(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){d6(this,t);return}switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.TEXT:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_COLUMN_GROUP:{jl(this,t);break}case M.AFTER_BODY:{ql(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){vh(this,t);return}switch(this.insertionMode){case M.INITIAL:case M.BEFORE_HTML:case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_TEMPLATE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{vh(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.AFTER_BODY:{$R(this,t);break}case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{VR(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case M.INITIAL:{qR(this,t);break}case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:{this._err(t,te.misplacedDoctype);break}case M.IN_TABLE_TEXT:{qa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?h6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{YR(this,t);break}case M.BEFORE_HEAD:{GR(this,t);break}case M.IN_HEAD:{xr(this,t);break}case M.IN_HEAD_NO_SCRIPT:{QR(this,t);break}case M.AFTER_HEAD:{ZR(this,t);break}case M.IN_BODY:{_n(this,t);break}case M.IN_TABLE:{ds(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_CAPTION:{XL(this,t);break}case M.IN_COLUMN_GROUP:{Ph(this,t);break}case M.IN_TABLE_BODY:{$l(this,t);break}case M.IN_ROW:{Vl(this,t);break}case M.IN_CELL:{JL(this,t);break}case M.IN_SELECT:{cb(this,t);break}case M.IN_SELECT_IN_TABLE:{e6(this,t);break}case M.IN_TEMPLATE:{n6(this,t);break}case M.AFTER_BODY:{i6(this,t);break}case M.IN_FRAMESET:{o6(this,t);break}case M.AFTER_FRAMESET:{a6(this,t);break}case M.AFTER_AFTER_BODY:{l6(this,t);break}case M.AFTER_AFTER_FRAMESET:{c6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?p6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{WR(this,t);break}case M.BEFORE_HEAD:{XR(this,t);break}case M.IN_HEAD:{KR(this,t);break}case M.IN_HEAD_NO_SCRIPT:{JR(this,t);break}case M.AFTER_HEAD:{eL(this,t);break}case M.IN_BODY:{zl(this,t);break}case M.TEXT:{UL(this,t);break}case M.IN_TABLE:{$a(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_CAPTION:{KL(this,t);break}case M.IN_COLUMN_GROUP:{QL(this,t);break}case M.IN_TABLE_BODY:{Nh(this,t);break}case M.IN_ROW:{lb(this,t);break}case M.IN_CELL:{ZL(this,t);break}case M.IN_SELECT:{db(this,t);break}case M.IN_SELECT_IN_TABLE:{t6(this,t);break}case M.IN_TEMPLATE:{r6(this,t);break}case M.AFTER_BODY:{hb(this,t);break}case M.IN_FRAMESET:{s6(this,t);break}case M.AFTER_FRAMESET:{u6(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onEof(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{ob(this,t);break}case M.TEXT:{HL(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_TEMPLATE:{fb(this,t);break}case M.AFTER_BODY:case M.IN_FRAMESET:case M.AFTER_FRAMESET:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===N.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 M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.TEXT:case M.IN_COLUMN_GROUP:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{this._insertCharacters(t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:case M.AFTER_BODY:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Jy(this,t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_TABLE_TEXT:{sb(this,t);break}}}}function FR(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):ib(e,t),n}function BR(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function UR(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let a=0,u=o;u!==n;a++,u=o){o=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&a>=DR;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=HR(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function HR(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 zR(e,t,n){const r=e.treeAdapter.getTagName(t),o=cs(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);o===g.TEMPLATE&&a===ue.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function jR(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,a=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,o.tagID)}function Ah(e,t){for(let n=0;n<LR;n++){const r=FR(e,t);if(!r)break;const o=BR(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const a=UR(e,o,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&zR(e,u,a),jR(e,o,r)}}function vh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function $R(e,t){e._appendCommentNode(t,e.openElements.items[0])}function VR(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],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function qR(e,t){e._setDocumentType(t);const n=t.forceQuirks?cr.QUIRKS:_R(t);TR(t)||e._err(t,te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=M.BEFORE_HTML}function Fa(e,t){e._err(t,te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,cr.QUIRKS),e.insertionMode=M.BEFORE_HTML,e._processToken(t)}function YR(e,t){t.tagID===g.HTML?(e._insertElement(t,ue.HTML),e.insertionMode=M.BEFORE_HEAD):Ba(e,t)}function WR(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Ba(e,t)}function Ba(e,t){e._insertFakeRootElement(),e.insertionMode=M.BEFORE_HEAD,e._processToken(t)}function GR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.HEAD:{e._insertElement(t,ue.HTML),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD;break}default:Ua(e,t)}}function XR(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Ua(e,t):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ua(e,t){e._insertFakeElement(X.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD,e._processToken(t)}function xr(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Dt.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Dt.RAWTEXT):(e._insertElement(t,ue.HTML),e.insertionMode=M.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Dt.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Dt.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=M.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(M.IN_TEMPLATE);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:Ha(e,t)}}function KR(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=M.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ha(e,t);break}case g.TEMPLATE:{go(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function go(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ha(e,t){e.openElements.pop(),e.insertionMode=M.AFTER_HEAD,e._processToken(t)}function QR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{xr(e,t);break}case g.NOSCRIPT:{e._err(t,te.nestedNoscriptInHead);break}default:za(e,t)}}function JR(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=M.IN_HEAD;break}case g.BR:{za(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function za(e,t){const n=t.type===Qe.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=M.IN_HEAD,e._processToken(t)}function ZR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BODY:{e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=M.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,ue.HTML),e.insertionMode=M.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,te.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),xr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:ja(e,t)}}function eL(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{ja(e,t);break}case g.TEMPLATE:{go(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function ja(e,t){e._insertFakeElement(X.BODY,g.BODY),e.insertionMode=M.IN_BODY,Hl(e,t)}function Hl(e,t){switch(t.type){case Qe.CHARACTER:{Zy(e,t);break}case Qe.WHITESPACE_CHARACTER:{Jy(e,t);break}case Qe.COMMENT:{vh(e,t);break}case Qe.START_TAG:{_n(e,t);break}case Qe.END_TAG:{zl(e,t);break}case Qe.EOF:{ob(e,t);break}}}function Jy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Zy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function tL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function nL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function rL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_FRAMESET)}function iL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function oL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Sh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ue.HTML)}function sL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function aL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),n||(e.formElement=e.openElements.current))}function uL(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(n===g.LI&&o===g.LI||(n===g.DD||n===g.DT)&&(o===g.DD||o===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==g.ADDRESS&&o!==g.DIV&&o!==g.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function lL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.tokenizer.state=Dt.PLAINTEXT}function cL(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1}function dL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(X.A);n&&(Ah(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function hL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(Ah(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function mL(e,t){e.treeAdapter.getDocumentMode(e.document)!==cr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=M.IN_TABLE}function eb(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function tb(e){const t=Ry(e,mo.TYPE);return t!=null&&t.toLowerCase()===RR}function gL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),tb(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function EL(e,t){e._appendElement(t,ue.HTML),t.ackSelfClosing=!0}function yL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function bL(e,t){t.tagName=X.IMG,t.tagID=g.IMG,eb(e,t)}function TL(e,t){e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Dt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=M.TEXT}function _L(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Dt.RAWTEXT)}function SL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Dt.RAWTEXT)}function nb(e,t){e._switchToTextParsing(t,Dt.RAWTEXT)}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===M.IN_TABLE||e.insertionMode===M.IN_CAPTION||e.insertionMode===M.IN_TABLE_BODY||e.insertionMode===M.IN_ROW||e.insertionMode===M.IN_CELL?M.IN_SELECT_IN_TABLE:M.IN_SELECT}function wL(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function AL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ue.HTML)}function vL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,ue.HTML)}function CL(e,t){e._reconstructActiveFormattingElements(),Wy(t),wh(t),t.selfClosing?e._appendElement(t,ue.MATHML):e._insertElement(t,ue.MATHML),t.ackSelfClosing=!0}function kL(e,t){e._reconstructActiveFormattingElements(),Gy(t),wh(t),t.selfClosing?e._appendElement(t,ue.SVG):e._insertElement(t,ue.SVG),t.ackSelfClosing=!0}function rb(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function _n(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:{fL(e,t);break}case g.A:{dL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{oL(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:{iL(e,t);break}case g.LI:case g.DD:case g.DT:{uL(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{eb(e,t);break}case g.HR:{yL(e,t);break}case g.RB:case g.RTC:{AL(e,t);break}case g.RT:case g.RP:{vL(e,t);break}case g.PRE:case g.LISTING:{sL(e,t);break}case g.XMP:{_L(e,t);break}case g.SVG:{kL(e,t);break}case g.HTML:{tL(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:{xr(e,t);break}case g.BODY:{nL(e,t);break}case g.FORM:{aL(e,t);break}case g.NOBR:{hL(e,t);break}case g.MATH:{CL(e,t);break}case g.TABLE:{mL(e,t);break}case g.INPUT:{gL(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{EL(e,t);break}case g.IMAGE:{bL(e,t);break}case g.BUTTON:{cL(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{pL(e,t);break}case g.IFRAME:{SL(e,t);break}case g.SELECT:{xL(e,t);break}case g.OPTION:case g.OPTGROUP:{wL(e,t);break}case g.NOEMBED:case g.NOFRAMES:{nb(e,t);break}case g.FRAMESET:{rL(e,t);break}case g.TEXTAREA:{TL(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?nb(e,t):rb(e,t);break}case g.PLAINTEXT:{lL(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:rb(e,t)}}function PL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function NL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,hb(e,t))}function OL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function IL(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 RL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(X.P,g.P),e._closePElement()}function LL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function DL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function ML(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function FL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function BL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(X.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function ib(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const a=e.openElements.items[o],u=e.openElements.tagIDs[o];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(a,u))break}}function zl(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:{RL(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:{OL(e,t);break}case g.LI:{LL(e);break}case g.DD:case g.DT:{DL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{ML(e);break}case g.BR:{BL(e);break}case g.BODY:{PL(e,t);break}case g.HTML:{NL(e,t);break}case g.FORM:{IL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{FL(e,t);break}case g.TEMPLATE:{go(e,t);break}default:ib(e,t)}}function ob(e,t){e.tmplInsertionModeStack.length>0?fb(e,t):Ch(e,t)}function UL(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 HL(e,t){e._err(t,te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function kh(e,t){if(e.openElements.currentTagId!==void 0&&Xy.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=M.IN_TABLE_TEXT,t.type){case Qe.CHARACTER:{ab(e,t);break}case Qe.WHITESPACE_CHARACTER:{sb(e,t);break}}else Va(e,t)}function zL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_CAPTION}function jL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_COLUMN_GROUP}function $L(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.COLGROUP,g.COLGROUP),e.insertionMode=M.IN_COLUMN_GROUP,Ph(e,t)}function VL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_TABLE_BODY}function qL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.TBODY,g.TBODY),e.insertionMode=M.IN_TABLE_BODY,$l(e,t)}function YL(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function WL(e,t){tb(t)?e._appendElement(t,ue.HTML):Va(e,t),t.ackSelfClosing=!0}function GL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ue.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ds(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{qL(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{xr(e,t);break}case g.COL:{$L(e,t);break}case g.FORM:{GL(e,t);break}case g.TABLE:{YL(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{VL(e,t);break}case g.INPUT:{WL(e,t);break}case g.CAPTION:{zL(e,t);break}case g.COLGROUP:{jL(e,t);break}default:Va(e,t)}}function $a(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{go(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:Va(e,t)}}function Va(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Hl(e,t),e.fosterParentingEnabled=n}function sb(e,t){e.pendingCharacterTokens.push(t)}function ab(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function qa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Va(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const ub=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function XL(e,t){const n=t.tagID;ub.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=M.IN_TABLE,ds(e,t)):_n(e,t)}function KL(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=M.IN_TABLE,n===g.TABLE&&$a(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:zl(e,t)}}function Ph(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.COL:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{xr(e,t);break}default:jl(e,t)}}function QL(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE);break}case g.TEMPLATE:{go(e,t);break}case g.COL:break;default:jl(e,t)}}function jl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE,e._processToken(t))}function $l(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(X.TR,g.TR),e.insertionMode=M.IN_ROW,Vl(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=M.IN_TABLE,ds(e,t));break}default:ds(e,t)}}function Nh(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=M.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE,$a(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:$a(e,t)}}function Vl(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.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=M.IN_TABLE_BODY,$l(e,t));break}default:ds(e,t)}}function lb(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY,Nh(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=M.IN_TABLE_BODY,Nh(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:$a(e,t)}}function JL(e,t){const n=t.tagID;ub.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Vl(e,t)):_n(e,t)}function ZL(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=M.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),lb(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:zl(e,t)}}function cb(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,ue.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ue.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ue.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:{xr(e,t);break}}}function db(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:{go(e,t);break}}}function e6(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)):cb(e,t)}function t6(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)):db(e,t)}function n6(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:{xr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=M.IN_TABLE,e.insertionMode=M.IN_TABLE,ds(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=M.IN_COLUMN_GROUP,e.insertionMode=M.IN_COLUMN_GROUP,Ph(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=M.IN_TABLE_BODY,e.insertionMode=M.IN_TABLE_BODY,$l(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=M.IN_ROW,e.insertionMode=M.IN_ROW,Vl(e,t);break}default:e.tmplInsertionModeStack[0]=M.IN_BODY,e.insertionMode=M.IN_BODY,_n(e,t)}}function r6(e,t){t.tagID===g.TEMPLATE&&go(e,t)}function fb(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 i6(e,t){t.tagID===g.HTML?_n(e,t):ql(e,t)}function hb(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=M.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 ql(e,t)}function ql(e,t){e.insertionMode=M.IN_BODY,Hl(e,t)}function o6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.FRAMESET:{e._insertElement(t,ue.HTML);break}case g.FRAME:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{xr(e,t);break}}}function s6(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=M.AFTER_FRAMESET))}function a6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.NOFRAMES:{xr(e,t);break}}}function u6(e,t){t.tagID===g.HTML&&(e.insertionMode=M.AFTER_AFTER_FRAMESET)}function l6(e,t){t.tagID===g.HTML?_n(e,t):Yl(e,t)}function Yl(e,t){e.insertionMode=M.IN_BODY,Hl(e,t)}function c6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.NOFRAMES:{xr(e,t);break}}}function d6(e,t){t.chars=At,e._insertCharacters(t)}function f6(e,t){e._insertCharacters(t),e.framesetOk=!1}function pb(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ue.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function h6(e,t){if(kR(t))pb(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ue.MATHML?Wy(t):r===ue.SVG&&(PR(t),Gy(t)),wh(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function p6(e,t){if(t.tagID===g.P||t.tagID===g.BR){pb(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)===ue.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}X.AREA,X.BASE,X.BASEFONT,X.BGSOUND,X.BR,X.COL,X.EMBED,X.FRAME,X.HR,X.IMG,X.INPUT,X.KEYGEN,X.LINK,X.META,X.PARAM,X.SOURCE,X.TRACK,X.WBR;const m6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,g6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),mb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function gb(e,t){const n=v6(e),r=ky("type",{handlers:{root:E6,element:y6,text:b6,comment:yb,doctype:T6,raw:S6},unknown:x6}),o={parser:n?new Qy(mb):Qy.getFragmentParser(void 0,mb),handle(c){r(c,o)},stitches:!1,options:t||{}};r(e,o),fs(o,Hr());const a=n?o.parser.document:o.parser.getFragment(),u=E3(a,{file:o.options.file});return o.stitches&&Dl(u,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=p.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Eb(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function E6(e,t){Eb(e.children,t)}function y6(e,t){w6(e,t),Eb(e.children,t),A6(e,t)}function b6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Qe.CHARACTER,chars:e.value,location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function T6(e,t){const n={type:Qe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _6(e,t){t.stitches=!0;const n=C6(e);if("children"in e&&"children"in n){const r=gb({type:"root",children:e.children},t.options);n.children=r.children}yb({type:"comment",value:{stitch:n}},t)}function yb(e,t){const n=e.value,r={type:Qe.COMMENT,data:n,location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function S6(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,bb(t,Hr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(m6,"&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 x6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))_6(n,t);else{let r="";throw g6.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 fs(e,t){bb(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=Dt.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 bb(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 w6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Dt.PLAINTEXT)return;fs(t,Hr(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:ho.html;o===ho.html&&n==="svg"&&(o=ho.svg);const a=I3(pe(F({},e),{children:[]}),{space:o===ho.svg?"svg":"html"}),u={type:Qe.START_TAG,tagName:n,tagID:cs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Ya(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function A6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&H3.includes(n)||t.parser.tokenizer.state===Dt.PLAINTEXT)return;fs(t,wl(e));const r={type:Qe.END_TAG,tagName:n,tagID:cs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ya(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Dt.RCDATA||t.parser.tokenizer.state===Dt.RAWTEXT||t.parser.tokenizer.state===Dt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Dt.DATA)}function v6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ya(e){const t=Hr(e)||{line:void 0,column:void 0,offset:void 0},n=wl(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 C6(e){return"children"in e?fo(pe(F({},e),{children:[]})):fo(e)}function Tb(e){return function(t,n){return gb(t,pe(F({},e),{file:n}))}}const Eo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],_b={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Eo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Eo],h2:[["className","sr-only"]],img:[...Eo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Eo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Eo],table:[...Eo],ul:[...Eo,["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"]},Ri={}.hasOwnProperty;function k6(e,t){let n={type:"root",children:[]};const r={schema:t?F(F({},_b),t):_b,stack:[]},o=Sb(r,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function Sb(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return P6(e,n);case"doctype":return N6(e,n);case"element":return O6(e,n);case"root":return I6(e,n);case"text":return R6(e,n)}}}function P6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Wa(a,t),a}}function N6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Wa(n,t),n}}function O6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=xb(e,t.children),o=L6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Ri.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:o,children:r};return Wa(u,t),u}function I6(e,t){const r={type:"root",children:xb(e,t.children)};return Wa(r,t),r}function R6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Wa(r,t),r}function xb(e,t){const n=[];if(Array.isArray(t)){const r=t;let o=-1;for(;++o<r.length;){const a=Sb(e,r[o]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function L6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,o=e.schema.required,a=r&&Ri.call(r,n)?r[n]:void 0,u=r&&Ri.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Ri.call(c,f)){const p=c[f];let m=wb(e,vb(a,f),f,p);m==null&&(m=wb(e,vb(u,f),f,p)),m!=null&&(d[f]=m)}if(o&&Ri.call(o,n)){const p=o[n];for(f in p)Ri.call(p,f)&&!Ri.call(d,f)&&(d[f]=p[f])}return d}function wb(e,t,n,r){return t?Array.isArray(r)?D6(e,t,n,r):Ab(e,t,n,r):void 0}function D6(e,t,n,r){let o=-1;const a=[];for(;++o<r.length;){const u=Ab(e,t,n,r[o]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Ab(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&M6(e,n,r)){if(typeof t=="object"&&t.length>1){let o=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){o=!0;break}}else if(u===r){o=!0;break}}if(!o)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function M6(e,t,n){const r=e.schema.protocols&&Ri.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const o=String(n),a=o.indexOf(":"),u=o.indexOf("?"),c=o.indexOf("#"),d=o.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const p=r[f];if(a===p.length&&o.slice(0,p.length)===p)return!0}return!1}function Wa(e,t){const n=aE(t);t.data&&(e.data=fo(t.data)),n&&(e.position=n)}function vb(e,t){let n,r=-1;if(e)for(;++r<e.length;){const o=e[r],a=typeof o=="string"?o:o[0];if(a===t)return o;a==="data*"&&(n=o)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function F6(e){return function(t){return k6(t,e)}}const Cb=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:o})=>{const a=n?t?"_blank":"_self":void 0;return x.jsx("a",pe(F(F({className:W(e,`${z}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:o}))},B6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=rt();return!e&&!t?null:x.jsx("div",{className:W(n,`${z}-disclaimer`),children:t?x.jsx(uy,{rehypePlugins:[Tb,F6],components:{ul:({children:r})=>x.jsx("ul",{className:W(n,`${z}-ul`),children:r}),ol:({children:r})=>x.jsx("ol",{className:W(n,`${z}-ol`),children:r}),li:({children:r})=>x.jsx("li",{className:W(n,`${z}-li`),children:r}),a:({href:r,title:o,children:a})=>x.jsx(Cb,{globalClassName:n,openLinksInNewTab:!0,href:r,title:o,children:a}),img:({src:r,alt:o})=>x.jsx("img",{className:W(n,`${z}-disclaimer-image`),src:r,alt:o}),p:({children:r})=>x.jsx("p",{className:W(n,`${z}-disclaimer-text`),children:r}),span:({children:r})=>x.jsx("span",{className:W(n,`${z}-disclaimer-text-span`),children:r})},children:t}):x.jsx("p",{className:W(n,`${z}-disclaimer-text`),children:e})})},Oh=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{connected:o,imageFile:a}=ar(),{setImageFile:u}=Ko(),{logger:c,globalClassName:d,searchConfig:f,features:p}=rt(),m=B.useRef(null),T=B.useRef(null),y=!!(p!=null&&p.enableImageUpload),_=(a==null?void 0:a.name)||"",w=!!o||!1,C=w?"connected":"disconnected",A=t||!w,P=()=>a?new Promise((D,q)=>{const re=new FileReader;re.readAsDataURL(a),re.onload=()=>D(re.result),re.onerror=me=>q(me)}):Promise.resolve(""),v=D=>Je(null,null,function*(){var me;if(A)return;const q=10*1024*1024,re=(me=D.target.files)==null?void 0:me[0];if(re){if(re.size>q){alert("File size exceeds the 10MB limit. Please choose a smaller file."),u(null);return}u(re)}}),H=()=>{u(null),T.current&&(T.current.value="")},Y=D=>Je(null,null,function*(){var me;D.preventDefault();const q=(((me=m.current)==null?void 0:me.value)||"").trim();let re="";try{re=yield P()}catch(V){c==null||c.error("Error converting file to base64:",V),alert("There was an error processing the file. Please try again.");return}q&&(H(),m.current.value="",r(q,re))});return x.jsxs("div",{className:W(d,e,`cim-${n}-component`,a&&"with-attachments",`${z}-search-bar-wrapper`),children:[a&&x.jsxs("div",{className:W(d,`cim-${n}-component`,`${z}-image-file-preview`),children:[x.jsx("img",{className:W(d,`cim-${n}-component`,`${z}-image-preview`),src:URL.createObjectURL(a),alt:`${_} preview`,loading:"lazy"}),x.jsx("span",{className:W(d,`cim-${n}-component`,`${z}-image-file-name`),title:_,children:_}),x.jsx(H1,{className:W(`cim-${n}-component`,"clear-attachment"),label:"Remove image",onClick:H})]}),x.jsxs("form",{className:W(d,e,`cim-${n}-component`,`${z}-search-bar`),name:`${z}-search-form`,onSubmit:Y,children:[x.jsx("span",{role:"status",className:W(`${z}-connection-status-icon`,C)}),y&&x.jsxs("div",{role:"button",className:W(d,e,`cim-${n}-component`,A&&"disabled",`${z}-image-upload-button`),"aria-disabled":A,tabIndex:0,children:[x.jsx("label",{className:W(d,e,`cim-${n}-component`,A&&"disabled",`${z}-image-upload-label`),htmlFor:"image-input","aria-label":"Upload an image",children:x.jsx(eP,{})}),x.jsx("input",{className:W(d,e,`cim-${n}-component`,`${z}-file-input`),type:"file",ref:T,id:"image-input",accept:".png,.jpg,.jpeg,.avif,.svg,.gif,.tiff,.tif,.webp",name:`${z}-file-input`,disabled:A,onInput:v})]}),x.jsx("input",{className:W(d,e,`cim-${n}-component`,`${z}-search-input`),type:"text",ref:m,placeholder:f==null?void 0:f.placeholder,name:`${z}-user-input`}),x.jsx(sP,{isLoading:A}),x.jsx(rP,{className:e,globalClassName:d,searchConfig:f,componentType:n,isLoading:A})]}),x.jsx(B6,{})]})};function U6(e){return wt({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 H6(e){return wt({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 kb=B.createContext({isOpen:!1}),Ih=B.createContext(null),Pb=B.createContext(null),hs=()=>{var n,r;const e=B.useContext(Ih),t=B.useContext(Pb);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Nb=({onClearChat:e,componentType:t})=>{const n=hs(),r=()=>{e(),n()};return x.jsxs("button",{className:W(`${z}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[x.jsx(H6,{}),"Clear chat"]})};function z6(e){return e==null?[]:Array.isArray(e)?e:[e]}var j6=(e,...t)=>e.concat(t),$6=(e,...t)=>e.filter(n=>!t.includes(n)),V6=e=>Array.from(new Set(e));function Ob(e,t,n={}){const{step:r=1,loop:o=!0}=n,a=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:a<0?o?c:0:a>=u?o?0:t>u?u:t:a}function q6(e,t,n={}){const{step:r=1,loop:o=!0}=n;return Ob(e,t,{step:-r,loop:o})}var Y6=e=>Array.isArray(e),Ib=e=>e!=null&&typeof e=="object",W6=e=>Ib(e)&&!Y6(e),Wl=e=>typeof e=="string",ps=e=>typeof e=="function",G6=e=>e==null,X6=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K6=e=>Object.prototype.toString.call(e),Rb=Function.prototype.toString,Q6=Rb.call(Object),J6=e=>{if(!Ib(e)||K6(e)!="[object Object]"||t4(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=X6(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Rb.call(n)==Q6},Z6=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,e4=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,t4=e=>Z6(e)||e4(e),n4=e=>e(),r4=()=>{},Rh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function i4(e,t=0){let n=0,r=null;return((...o)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...o),n=a):r||(r=setTimeout(()=>{e(...o),n=Date.now(),r=null},t-u))})}var{min:o4,max:s4}=Math,a4=e=>Number.isNaN(e),u4=e=>a4(e)?0:e,Lb=(e,t,n)=>o4(s4(u4(e),t),n);function Lh(e){if(!J6(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Lh(o))}return n}function Dh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function l4(e,t){if(e==null)throw new Error(t())}function c4(e,t,n){let r=[];for(const o of t)e[o]==null&&r.push(o);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var d4=Object.defineProperty,f4=(e,t,n)=>t in e?d4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mh=(e,t,n)=>f4(e,typeof t!="symbol"?t+"":t,n),Db=()=>{},Gl=e=>typeof e=="object"&&e!==null,ms=e=>e?"":void 0,Mb=e=>e?"true":void 0,h4=1,p4=9,m4=11,en=e=>Gl(e)&&e.nodeType===h4&&typeof e.nodeName=="string",Xl=e=>Gl(e)&&e.nodeType===p4,g4=e=>Gl(e)&&e===e.window,Fb=e=>en(e)?e.localName||"":"#document";function E4(e){return["html","body","#document"].includes(Fb(e))}var y4=e=>Gl(e)&&e.nodeType!==void 0,yo=e=>y4(e)&&e.nodeType===m4&&"host"in e,b4=e=>en(e)&&e.localName==="input",T4=e=>en(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ga(e){if(!e)return!1;const t=e.getRootNode();return ys(t)===e}var _4=/(textarea|select)/;function S4(e){if(e==null||!en(e))return!1;try{return b4(e)&&e.selectionStart!=null||_4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function gs(e,t){var r;if(!e||!t||!en(e)||!en(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&yo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function $r(e){var t;return Xl(e)?e:g4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function x4(e){return $r(e).documentElement}function Es(e){var t,n,r;return yo(e)?Es(e.host):Xl(e)?(t=e.defaultView)!=null?t:window:en(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function ys(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 w4(e){if(Fb(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yo(e)&&e.host||x4(e);return yo(t)?t.host:t}function Fh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Xl(t)||yo(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var Bh=new WeakMap;function bs(e){return Bh.has(e)||Bh.set(e,Es(e).getComputedStyle(e)),Bh.get(e)}var Uh=new Set(["menu","listbox","dialog","grid","tree","region"]),A4=e=>Uh.has(e),Bb=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Ub(e,t){const n=new Set,r=Fh(e),o=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Bb(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const p=r.getElementById(f);if(p){const m=p.getAttribute("role"),T=p.getAttribute("aria-modal")==="true";if(m&&A4(m)&&!T&&(p===t||p.contains(t)||o(p)))return!0}}}return!1};return o(e)}function Hb(e,t){const n=Fh(e),r=new Set,o=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Bb(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const p=n.getElementById(f);if(p){const m=p.getAttribute("role"),T=p.getAttribute("aria-modal")==="true";m&&Uh.has(m)&&!T&&(t(p),o(p))}}}};o(e)}function v4(e){const t=new Set;return Hb(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function C4(e){const t=e.getAttribute("role");return!!(t&&Uh.has(t))}function k4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function P4(e){var t;return k4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function N4(e){if(!e.id)return!1;const t=Fh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&C4(e))}var Hh=()=>typeof document!="undefined";function O4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var zh=e=>Hh()&&e.test(O4()),I4=e=>Hh()&&e.test(navigator.vendor),zb=()=>Hh()&&!!navigator.maxTouchPoints,R4=()=>zh(/^iPhone/i),L4=()=>zh(/^iPad/i)||jh()&&navigator.maxTouchPoints>1,Kl=()=>R4()||L4(),D4=()=>jh()||Kl(),jh=()=>zh(/^Mac/i),M4=()=>D4()&&I4(/apple/i);function F4(e){var t,n,r,o;return(o=(t=e.composedPath)==null?void 0:t.call(e))!=null?o:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function wr(e){var n;const t=F4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var jb=e=>e.button===0,B4=e=>e.button===2||jh()&&e.ctrlKey&&e.button===0,U4=e=>"touches"in e&&e.touches.length>0,H4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},$b={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function z4(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=(u=H4[o])!=null?u:o,n==="rtl"&&r==="horizontal"&&o in $b&&(o=$b[o]),o}function Vb(e,t="client"){const n=U4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var tn=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o==null||o.addEventListener(t,n,r),()=>{o==null||o.removeEventListener(t,n,r)}},qb=e=>en(e)&&e.tagName==="IFRAME",j4=/^(audio|video|details)$/;function Yb(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var $4=e=>!Number.isNaN(Yb(e)),V4=e=>Yb(e)<0;function q4(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 Wb(e,t,n){const r=[...e],o=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<o.length;){const d=o[c++];if(!d||a.has(d))continue;a.add(d);const f=q4(d,t);if(f){const p=Array.from(f.querySelectorAll(Ql)).filter(n),m=u.get(d);if(m!==void 0){const T=m+1;r.splice(T,0,...p),p.forEach((y,_)=>{u.set(y,T+_)});for(let y=T+p.length;y<r.length;y++)u.set(r[y],y)}else{const T=r.length;r.push(...p),p.forEach((y,_)=>{u.set(y,T+_)})}o.push(...p)}}return r}var Ql="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",Gb=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,o=Array.from(e.querySelectorAll(Ql));(n==!0||n=="if-empty"&&o.length===0)&&en(e)&&Vr(e)&&o.unshift(e);const u=[];for(const c of o)if(Vr(c)){if(qb(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...Gb(d,{getShadowRoot:r}));continue}u.push(c)}return r?Wb(u,r,Vr):u};function Vr(e){return!en(e)||e.closest("[inert]")?!1:e.matches(Ql)&&T4(e)}function Ts(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,o=Array.from(e.querySelectorAll(Ql));n&&bo(e)&&o.unshift(e);const a=[];for(const u of o)if(bo(u)){if(qb(u)&&u.contentDocument){const c=u.contentDocument.body;a.push(...Ts(c,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=Wb(a,r,bo);return!u.length&&n?o:u}return!a.length&&n?o:a}function bo(e){return en(e)&&e.tabIndex>0?!0:Vr(e)&&!V4(e)}function Y4(e,t={}){const n=Ts(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function W4(e,t={}){const{current:n,getShadowRoot:r}=t,o=Ts(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:ys(a);if(!u)return null;const c=o.indexOf(u);return o[c+1]||null}function Xa(e){return e.tabIndex<0&&(j4.test(e.localName)||S4(e))&&!$4(e)?0:e.tabIndex}function Xb(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=Ts(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var G4=class e2{constructor(){Mh(this,"id",null),Mh(this,"fn_cleanup"),Mh(this,"cleanup",()=>{this.cancel()})}static create(){return new e2}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 Yt(e){const t=G4.create();return t.request(e),t.cleanup}function Kb(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function $h(e){const t=w4(e);return E4(t)?$r(t).body:en(t)&&Q4(t)?t:$h(t)}var X4=/auto|scroll|overlay|hidden|clip/,K4=new Set(["inline","contents"]);function Q4(e){const t=Es(e),{overflow:n,overflowX:r,overflowY:o,display:a}=t.getComputedStyle(e);return X4.test(n+o+r)&&!K4.has(a)}var _s="default",Vh="",Jl=new WeakMap;function J4(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,o=r.documentElement;return Kl()?(_s==="default"&&(Vh=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),_s="disabled"):t&&(Jl.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Z4({target:t,doc:r})}function Z4(e={}){const{target:t,doc:n}=e,o=(n!=null?n:document).documentElement;if(Kl()){if(_s!=="disabled")return;_s="restoring",setTimeout(()=>{Kb(()=>{_s==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Vh||""),Vh="",_s="default")})},300)}else if(t&&Jl.has(t)){const a=Jl.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Jl.delete(t)}}function eD(e={}){const u=e,{defer:t,target:n}=u,r=mn(u,["defer","target"]),o=t?Yt:c=>c(),a=[];return a.push(o(()=>{const c=typeof n=="function"?n():n;a.push(J4(pe(F({},r),{target:c})))})),()=>{a.forEach(c=>c==null?void 0:c())}}function tD(e,t){const{onPointerMove:n,onPointerUp:r}=t,o=c=>{const d=Vb(c),f=Math.sqrt(ia(d.x,2)+ia(d.y,2)),p=c.pointerType==="touch"?10:5;if(!(f<p)){if(c.pointerType==="mouse"&&c.button===0){a(c);return}n({point:d,event:c})}},a=c=>{const d=Vb(c);r({point:d,event:c})},u=[tn(e,"pointermove",o,!1),tn(e,"pointerup",a,!1),tn(e,"pointercancel",a,!1),tn(e,"contextmenu",a,!1),eD({doc:e})];return()=>{u.forEach(c=>c())}}function nD(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:o,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let p=null;const[m,T]=Y4(e,{includeContainer:!0,getShadowRoot:a}),y=W4(c,{current:n,getShadowRoot:a}),_=!m&&!T;f.shiftKey&&Ga(y)?(o==null||o(),p=T):f.shiftKey&&(Ga(m)||_)?p=n:!f.shiftKey&&Ga(n)?(o==null||o(),p=m):!f.shiftKey&&(Ga(T)||_)&&(p=y),p&&(f.preventDefault(),typeof r=="function"?r(p):p.focus())}return tn(u,"keydown",d,!0)}function rD(e,t){const c=t,{defer:n,triggerElement:r}=c,o=mn(c,["defer","triggerElement"]),a=n?Yt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(nD(d,F({triggerElement:f},o)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function iD(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Zl(e,t){if(!e)return Db;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function oD(e,t,n){if(!e)return Db;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 sD(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 aD(e,t){const{timeout:n,rootNode:r}=t,o=Es(r),a=$r(r),u=new o.AbortController;return sD(new Promise(c=>{const d=e();if(d){c(d);return}const f=new o.MutationObserver(()=>{const p=e();p&&p.isConnected&&(f.disconnect(),c(p))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var uD=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),lD=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Qb=e=>{const t={};let n;for(;n=lD.exec(e);)t[n[1]]=n[2];return t},cD=(e,t)=>{if(Wl(e)){if(Wl(t))return`${e};${t}`;e=Qb(e)}else Wl(t)&&(t=Qb(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Wt(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=Rh(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=uD(t[o],n[o]);continue}if(o==="style"){t[o]=cD(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function $U(e){return e}var Ss=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Ss||{}),qh="__init__";function dD(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>$r(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},o=()=>ys(t()),a=u=>t().getElementById(u);return pe(F({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:o,isActiveElement:Ga,getById:a})}function fD(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var xs=()=>e=>Array.from(new Set(e)),Jb=typeof globalThis.document!="undefined"?B.useLayoutEffect:B.useEffect;function ec(e){var m,T;const t=(m=e().value)!=null?m:e().defaultValue,n=(T=e().isEqual)!=null?T:Object.is,[r]=B.useState(t),[o,a]=B.useState(r),u=e().value!==void 0,c=B.useRef(o);c.current=u?e().value:o;const d=B.useRef(c.current);Jb(()=>{d.current=c.current},[o,e().value]);const f=y=>{var C,A;const _=d.current,w=ps(y)?y(_):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:w,prev:_}),u||a(w),n(w,_)||(A=(C=e()).onChange)==null||A.call(C,w,_)};function p(){return u?e().value:o}return{initial:r,ref:c,get:p,set(y){(e().sync?Qo.flushSync:n4)(()=>f(y))},invoke(y,_){var w,C;(C=(w=e()).onChange)==null||C.call(w,y,_)},hash(y){var _,w,C;return(C=(w=(_=e()).hash)==null?void 0:w.call(_,y))!=null?C:String(y)}}}ec.cleanup=e=>{B.useEffect(()=>e,[])},ec.ref=e=>{const t=B.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function hD(e){const t=B.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var pD=(e,t)=>{const n=B.useRef(!1),r=B.useRef(!1);B.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(o=>typeof o=="function"?o():o)]),B.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function tc(e,t={}){var oe,ce,de,ne,Te,Pe;const n=B.useMemo(()=>{const{id:se,ids:K,getRootNode:ie}=t;return dD({id:se,ids:K,getRootNode:ie})},[t]),r=(...se)=>{e.debug&&console.log(...se)},o=(ce=(oe=e.props)==null?void 0:oe.call(e,{props:Lh(t),scope:n}))!=null?ce:t,a=mD(o),u=(de=e.context)==null?void 0:de.call(e,{prop:a,bindable:ec,scope:n,flush:eT,getContext(){return d},getComputed(){return Y},getRefs(){return w},getEvent(){return y()}}),c=Zb(u),d={get(se){var K;return(K=c.current)==null?void 0:K[se].ref.current},set(se,K){var ie;(ie=c.current)==null||ie[se].set(K)},initial(se){var K;return(K=c.current)==null?void 0:K[se].initial},hash(se){var ie,k;const K=(ie=c.current)==null?void 0:ie[se].get();return(k=c.current)==null?void 0:k[se].hash(K)}},f=B.useRef(new Map),p=B.useRef(null),m=B.useRef(null),T=B.useRef({type:""}),y=()=>pe(F({},T.current),{current(){return T.current},previous(){return m.current}}),_=()=>pe(F({},D),{matches(...se){return se.includes(D.ref.current)},hasTag(se){var K,ie;return!!((ie=(K=e.states[D.ref.current])==null?void 0:K.tags)!=null&&ie.includes(se))}}),w=hD((Te=(ne=e.refs)==null?void 0:ne.call(e,{prop:a,context:d}))!=null?Te:{}),C=()=>({state:_(),context:d,event:y(),prop:a,send:V,action:A,guard:P,track:pD,refs:w,computed:Y,flush:eT,scope:n,choose:H}),A=se=>{const K=ps(se)?se(C()):se;if(!K)return;const ie=K.map(k=>{var ee,I;const L=(I=(ee=e.implementations)==null?void 0:ee.actions)==null?void 0:I[k];return L||Dh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),L});for(const k of ie)k==null||k(C())},P=se=>{var K,ie;return ps(se)?se(C()):(ie=(K=e.implementations)==null?void 0:K.guards)==null?void 0:ie[se](C())},v=se=>{const K=ps(se)?se(C()):se;if(!K)return;const ie=K.map(L=>{var I,Se;const ee=(Se=(I=e.implementations)==null?void 0:I.effects)==null?void 0:Se[L];return ee||Dh(`[zag-js] No implementation found for effect "${JSON.stringify(L)}"`),ee}),k=[];for(const L of ie){const ee=L==null?void 0:L(C());ee&&k.push(ee)}return()=>k.forEach(L=>L==null?void 0:L())},H=se=>z6(se).find(K=>{let ie=!K.guard;return Wl(K.guard)?ie=!!P(K.guard):ps(K.guard)&&(ie=K.guard(C())),ie}),Y=se=>{l4(e.computed,()=>"[zag-js] No computed object found on machine");const K=e.computed[se];return K({context:d,event:y(),prop:a,refs:w,scope:n,computed:Y})},D=ec(()=>({defaultValue:e.initialState({prop:a}),onChange(se,K){var k,L,ee,I;if(K){const Se=f.current.get(K);Se==null||Se(),f.current.delete(K)}K&&A((k=e.states[K])==null?void 0:k.exit),A((L=p.current)==null?void 0:L.actions);const ie=v((ee=e.states[se])==null?void 0:ee.effects);if(ie&&f.current.set(se,ie),K===qh){A(e.entry);const Se=v(e.effects);Se&&f.current.set(qh,Se)}A((I=e.states[se])==null?void 0:I.entry)}})),q=B.useRef(void 0),re=B.useRef(Ss.NotStarted);Jb(()=>{queueMicrotask(()=>{var L;const ie=re.current===Ss.Started;re.current=Ss.Started,r(ie?"rehydrating...":"initializing...");const k=(L=q.current)!=null?L:D.initial;D.invoke(k,ie?D.get():qh)});const se=f.current,K=D.ref.current;return()=>{r("unmounting..."),q.current=K,re.current=Ss.Stopped,se.forEach(ie=>ie==null?void 0:ie()),f.current=new Map,p.current=null,queueMicrotask(()=>{A(e.exit)})}},[]);const me=()=>"ref"in D?D.ref.current:D.get(),V=se=>{queueMicrotask(()=>{var I,Se,je,Ee,Fe;if(re.current!==Ss.Started)return;m.current=T.current,T.current=se;let K=me();const ie=(je=(I=e.states[K].on)==null?void 0:I[se.type])!=null?je:(Se=e.on)==null?void 0:Se[se.type],k=H(ie);if(!k)return;p.current=k;const L=(Ee=k.target)!=null?Ee:K;r("transition",se.type,k.target||K,`(${k.actions})`);const ee=L!==K;ee?Qo.flushSync(()=>D.set(L)):k.reenter&&!ee?D.invoke(K,K):A((Fe=k.actions)!=null?Fe:[])})};return(Pe=e.watch)==null||Pe.call(e,C()),{state:_(),send:V,context:d,prop:a,scope:n,refs:w,computed:Y,event:y(),getStatus:()=>re.current}}function Zb(e){const t=B.useRef(e);return t.current=e,t}function mD(e){const t=Zb(e);return function(r){return t.current[r]}}function eT(e){queueMicrotask(()=>{Qo.flushSync(()=>e())})}var Yh=fD(e=>e);function nc(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const o=r(t);typeof o=="function"&&n.push(o)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function gD(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Wh=e=>{const t=B.memo(B.forwardRef((n,r)=>{const f=n,{asChild:o,children:a}=f,u=mn(f,["asChild","children"]);if(!o)return B.createElement(e,pe(F({},u),{ref:r}),a);if(!B.isValidElement(a))return null;const c=B.Children.only(a),d=gD(c);return B.cloneElement(c,pe(F({},Wt(u,c.props)),{ref:r?nc(r,d):d}))}));return t.displayName=e.displayName||e.name,t},Sn=(()=>{const e=new Map;return new Proxy(Wh,{apply(t,n,r){return Wh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Wh(r)),e.get(r)}})})();function ED(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function To(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:a,defaultValue:u}=e,c=B.createContext(u);c.displayName=t;function d(){var p;const f=B.useContext(c);if(!f&&n){const m=new Error(a!=null?a:ED(r,o));throw m.name="ContextError",(p=Error.captureStackTrace)==null||p.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[yD,Gh]=To({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[tT,Ka]=To({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),nT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:nc(r.ref,t)}))});nT.displayName="PopoverContent";const rT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(n.getPositionerProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:t}))});rT.displayName="PopoverPositioner";const Qa=()=>(e,t)=>t.reduce((n,r)=>{const[o,a]=n,u=r;return a[u]!==void 0&&(o[u]=a[u]),delete a[u],[o,a]},[{},F({},e)]),iT=e=>Qa()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function bD(e,t){const{state:n,send:r,context:o}=e,a=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var TD={props({props:e}){return pe(F({},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 o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!o&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Yt(()=>{var c,d;const u=rc(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})=>{Yt(()=>{e.set("prevAnimationName",rc(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const a=d=>{var p,m,T;((T=(m=(p=d.composedPath)==null?void 0:p.call(d))==null?void 0:m[0])!=null?T:d.target)===o&&e.set("prevAnimationName",rc(t.get("styles")))},u=d=>{const f=rc(t.get("styles"));wr(d)===o&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",u),o.addEventListener("animationend",u);const c=Zl(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",u),o.removeEventListener("animationend",u),Kb(()=>c())}}}}};function rc(e){return(e==null?void 0:e.animationName)||"none"}xs()(["onExitComplete","present","immediate"]);function _D(e,t={}){const{sync:n=!1}=t,r=SD(e);return B.useCallback((...o)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...o)}):(a=r.current)==null?void 0:a.call(r,...o)},[n,r])}function SD(e){const t=B.useRef(e);return t.current=e,t}const Xh=(e={})=>{const T=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:o=!1}=T,a=mn(T,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=B.useRef(!1),c=pe(F({},a),{present:r,onExitComplete:_D(e.onExitComplete)}),d=tc(TD,c),f=bD(d);f.present&&(u.current=!0);const p=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&o?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:p}};var _o=(e,t=[])=>({parts:(...n)=>{if(xD(t))return _o(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>_o(e,[...t,...n]),omit:(...n)=>_o(e,t.filter(r=>!n.includes(r))),rename:n=>_o(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${ws(e)}"][data-part="${ws(r)}"]`,`& [data-scope="${ws(e)}"][data-part="${ws(r)}"]`].join(", "),attrs:{"data-scope":ws(e),"data-part":ws(r)}}}),{})}),ws=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),xD=e=>e.length===0;const wD=["top","right","bottom","left"],Li=Math.min,Qn=Math.max,ic=Math.round,oc=Math.floor,qr=e=>({x:e,y:e}),AD={left:"right",right:"left",bottom:"top",top:"bottom"},vD={start:"end",end:"start"};function Kh(e,t,n){return Qn(e,Li(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function hi(e){return e.split("-")[0]}function As(e){return e.split("-")[1]}function Qh(e){return e==="x"?"y":"x"}function Jh(e){return e==="y"?"height":"width"}const CD=new Set(["top","bottom"]);function Yr(e){return CD.has(hi(e))?"y":"x"}function Zh(e){return Qh(Yr(e))}function kD(e,t,n){n===void 0&&(n=!1);const r=As(e),o=Zh(e),a=Jh(o);let u=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=sc(u)),[u,sc(u)]}function PD(e){const t=sc(e);return[ep(e),t,ep(t)]}function ep(e){return e.replace(/start|end/g,t=>vD[t])}const oT=["left","right"],sT=["right","left"],ND=["top","bottom"],OD=["bottom","top"];function ID(e,t,n){switch(e){case"top":case"bottom":return n?t?sT:oT:t?oT:sT;case"left":case"right":return t?ND:OD;default:return[]}}function RD(e,t,n,r){const o=As(e);let a=ID(hi(e),n==="start",r);return o&&(a=a.map(u=>u+"-"+o),t&&(a=a.concat(a.map(ep)))),a}function sc(e){return e.replace(/left|right|bottom|top/g,t=>AD[t])}function LD(e){return F({top:0,right:0,bottom:0,left:0},e)}function aT(e){return typeof e!="number"?LD(e):{top:e,right:e,bottom:e,left:e}}function ac(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function uT(e,t,n){let{reference:r,floating:o}=e;const a=Yr(t),u=Zh(t),c=Jh(u),d=hi(t),f=a==="y",p=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,T=r[c]/2-o[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-o.width,y:m};break;default:y={x:r.x,y:r.y}}switch(As(t)){case"start":y[u]-=T*(n&&f?-1:1);break;case"end":y[u]+=T*(n&&f?-1:1);break}return y}const DD=(e,t,n)=>Je(null,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:u}=n,c=a.filter(Boolean),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:m}=uT(f,r,d),T=r,y={},_=0;for(let w=0;w<c.length;w++){const{name:C,fn:A}=c[w],{x:P,y:v,data:H,reset:Y}=yield A({x:p,y:m,initialPlacement:r,placement:T,strategy:o,middlewareData:y,rects:f,platform:u,elements:{reference:e,floating:t}});p=P!=null?P:p,m=v!=null?v:m,y=pe(F({},y),{[C]:F(F({},y[C]),H)}),Y&&_<=50&&(_++,typeof Y=="object"&&(Y.placement&&(T=Y.placement),Y.rects&&(f=Y.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:o}):Y.rects),{x:p,y:m}=uT(f,T,d)),w=-1)}return{x:p,y:m,placement:T,strategy:o,middlewareData:y}});function Ja(e,t){return Je(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:T=!1,padding:y=0}=fi(t,e),_=aT(y),C=c[T?m==="floating"?"reference":"floating":m],A=ac(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(C))==null||n?C:C.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),P=m==="floating"?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,v=yield a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating),H=(yield a.isElement==null?void 0:a.isElement(v))?(yield a.getScale==null?void 0:a.getScale(v))||{x:1,y:1}:{x:1,y:1},Y=ac(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:P,offsetParent:v,strategy:d}):P);return{top:(A.top-Y.top+_.top)/H.y,bottom:(Y.bottom-A.bottom+_.bottom)/H.y,left:(A.left-Y.left+_.left)/H.x,right:(Y.right-A.right+_.right)/H.x}})}const MD=e=>({name:"arrow",options:e,fn(n){return Je(this,null,function*(){const{x:r,y:o,placement:a,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:p,padding:m=0}=fi(e,n)||{};if(p==null)return{};const T=aT(m),y={x:r,y:o},_=Zh(a),w=Jh(_),C=yield c.getDimensions(p),A=_==="y",P=A?"top":"left",v=A?"bottom":"right",H=A?"clientHeight":"clientWidth",Y=u.reference[w]+u.reference[_]-y[_]-u.floating[w],D=y[_]-u.reference[_],q=yield c.getOffsetParent==null?void 0:c.getOffsetParent(p);let re=q?q[H]:0;(!re||!(yield c.isElement==null?void 0:c.isElement(q)))&&(re=d.floating[H]||u.floating[w]);const me=Y/2-D/2,V=re/2-C[w]/2-1,oe=Li(T[P],V),ce=Li(T[v],V),de=oe,ne=re-C[w]-ce,Te=re/2-C[w]/2+me,Pe=Kh(de,Te,ne),se=!f.arrow&&As(a)!=null&&Te!==Pe&&u.reference[w]/2-(Te<de?oe:ce)-C[w]/2<0,K=se?Te<de?Te-de:Te-ne:0;return{[_]:y[_]+K,data:F({[_]:Pe,centerOffset:Te-Pe-K},se&&{alignmentOffset:K}),reset:se}})}}),FD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Je(this,null,function*(){var r,o;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:p}=n,Te=fi(e,n),{mainAxis:m=!0,crossAxis:T=!0,fallbackPlacements:y,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0}=Te,A=mn(Te,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const P=hi(a),v=Yr(d),H=hi(d)===d,Y=yield f.isRTL==null?void 0:f.isRTL(p.floating),D=y||(H||!C?[sc(d)]:PD(d)),q=w!=="none";!y&&q&&D.push(...RD(d,C,w,Y));const re=[d,...D],me=yield Ja(n,A),V=[];let oe=((o=u.flip)==null?void 0:o.overflows)||[];if(m&&V.push(me[P]),T){const Pe=kD(a,c,Y);V.push(me[Pe[0]],me[Pe[1]])}if(oe=[...oe,{placement:a,overflows:V}],!V.every(Pe=>Pe<=0)){var ce,de;const Pe=(((ce=u.flip)==null?void 0:ce.index)||0)+1,se=re[Pe];if(se&&(!(T==="alignment"?v!==Yr(se):!1)||oe.every(k=>Yr(k.placement)===v?k.overflows[0]>0:!0)))return{data:{index:Pe,overflows:oe},reset:{placement:se}};let K=(de=oe.filter(ie=>ie.overflows[0]<=0).sort((ie,k)=>ie.overflows[1]-k.overflows[1])[0])==null?void 0:de.placement;if(!K)switch(_){case"bestFit":{var ne;const ie=(ne=oe.filter(k=>{if(q){const L=Yr(k.placement);return L===v||L==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(L=>L>0).reduce((L,ee)=>L+ee,0)]).sort((k,L)=>k[1]-L[1])[0])==null?void 0:ne[0];ie&&(K=ie);break}case"initialPlacement":K=d;break}if(a!==K)return{reset:{placement:K}}}return{}})}}};function lT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cT(e){return wD.some(t=>e[t]>=0)}const BD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Je(this,null,function*(){const{rects:r}=n,u=fi(e,n),{strategy:o="referenceHidden"}=u,a=mn(u,["strategy"]);switch(o){case"referenceHidden":{const c=yield Ja(n,pe(F({},a),{elementContext:"reference"})),d=lT(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:cT(d)}}}case"escaped":{const c=yield Ja(n,pe(F({},a),{altBoundary:!0})),d=lT(c,r.floating);return{data:{escapedOffsets:d,escaped:cT(d)}}}default:return{}}})}}},dT=new Set(["left","top"]);function UD(e,t){return Je(this,null,function*(){const{placement:n,platform:r,elements:o}=e,a=yield r.isRTL==null?void 0:r.isRTL(o.floating),u=hi(n),c=As(n),d=Yr(n)==="y",f=dT.has(u)?-1:1,p=a&&d?-1:1,m=fi(t,e);let{mainAxis:T,crossAxis:y,alignmentAxis:_}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof _=="number"&&(y=c==="end"?_*-1:_),d?{x:y*p,y:T*f}:{x:T*f,y:y*p}})}const HD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Je(this,null,function*(){var r,o;const{x:a,y:u,placement:c,middlewareData:d}=n,f=yield UD(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(o=d.arrow)!=null&&o.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:pe(F({},f),{placement:c})}})}}},zD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Je(this,null,function*(){const{x:r,y:o,placement:a}=n,A=fi(e,n),{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:P=>{let{x:v,y:H}=P;return{x:v,y:H}}}}=A,f=mn(A,["mainAxis","crossAxis","limiter"]),p={x:r,y:o},m=yield Ja(n,f),T=Yr(hi(a)),y=Qh(T);let _=p[y],w=p[T];if(u){const P=y==="y"?"top":"left",v=y==="y"?"bottom":"right",H=_+m[P],Y=_-m[v];_=Kh(H,_,Y)}if(c){const P=T==="y"?"top":"left",v=T==="y"?"bottom":"right",H=w+m[P],Y=w-m[v];w=Kh(H,w,Y)}const C=d.fn(pe(F({},n),{[y]:_,[T]:w}));return pe(F({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[y]:u,[T]:c}}})})}}},jD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:u}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=fi(e,t),p={x:n,y:r},m=Yr(o),T=Qh(m);let y=p[T],_=p[m];const w=fi(c,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:F({mainAxis:0,crossAxis:0},w);if(d){const v=T==="y"?"height":"width",H=a.reference[T]-a.floating[v]+C.mainAxis,Y=a.reference[T]+a.reference[v]-C.mainAxis;y<H?y=H:y>Y&&(y=Y)}if(f){var A,P;const v=T==="y"?"width":"height",H=dT.has(hi(o)),Y=a.reference[m]-a.floating[v]+(H&&((A=u.offset)==null?void 0:A[m])||0)+(H?0:C.crossAxis),D=a.reference[m]+a.reference[v]+(H?0:((P=u.offset)==null?void 0:P[m])||0)-(H?C.crossAxis:0);_<Y?_=Y:_>D&&(_=D)}return{[T]:y,[m]:_}}}},$D=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Je(this,null,function*(){var r,o;const{placement:a,rects:u,platform:c,elements:d}=n,oe=fi(e,n),{apply:f=()=>{}}=oe,p=mn(oe,["apply"]),m=yield Ja(n,p),T=hi(a),y=As(a),_=Yr(a)==="y",{width:w,height:C}=u.floating;let A,P;T==="top"||T==="bottom"?(A=T,P=y===((yield c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(P=T,A=y==="end"?"top":"bottom");const v=C-m.top-m.bottom,H=w-m.left-m.right,Y=Li(C-m[A],v),D=Li(w-m[P],H),q=!n.middlewareData.shift;let re=Y,me=D;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&(me=H),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(re=v),q&&!y){const ce=Qn(m.left,0),de=Qn(m.right,0),ne=Qn(m.top,0),Te=Qn(m.bottom,0);_?me=w-2*(ce!==0||de!==0?ce+de:Qn(m.left,m.right)):re=C-2*(ne!==0||Te!==0?ne+Te:Qn(m.top,m.bottom))}yield f(pe(F({},n),{availableWidth:me,availableHeight:re}));const V=yield c.getDimensions(d.floating);return w!==V.width||C!==V.height?{reset:{rects:!0}}:{}})}}};function uc(){return typeof window!="undefined"}function vs(e){return fT(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wr(e){var t;return(t=(fT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fT(e){return uc()?e instanceof Node||e instanceof Jn(e).Node:!1}function Ar(e){return uc()?e instanceof Element||e instanceof Jn(e).Element:!1}function Gr(e){return uc()?e instanceof HTMLElement||e instanceof Jn(e).HTMLElement:!1}function hT(e){return!uc()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}const VD=new Set(["inline","contents"]);function Za(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!VD.has(o)}const qD=new Set(["table","td","th"]);function YD(e){return qD.has(vs(e))}const WD=[":popover-open",":modal"];function lc(e){return WD.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const GD=["transform","translate","scale","rotate","perspective"],XD=["transform","translate","scale","rotate","perspective","filter"],KD=["paint","layout","strict","content"];function tp(e){const t=np(),n=Ar(e)?vr(e):e;return GD.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||XD.some(r=>(n.willChange||"").includes(r))||KD.some(r=>(n.contain||"").includes(r))}function QD(e){let t=Di(e);for(;Gr(t)&&!Cs(t);){if(tp(t))return t;if(lc(t))return null;t=Di(t)}return null}function np(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const JD=new Set(["html","body","#document"]);function Cs(e){return JD.has(vs(e))}function vr(e){return Jn(e).getComputedStyle(e)}function cc(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Di(e){if(vs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hT(e)&&e.host||Wr(e);return hT(t)?t.host:t}function pT(e){const t=Di(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&Za(t)?t:pT(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pT(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),u=Jn(o);if(a){const c=rp(u);return t.concat(u,u.visualViewport||[],Za(o)?o:[],c&&n?eu(c):[])}return t.concat(o,eu(o,[],n))}function rp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mT(e){const t=vr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Gr(e),a=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=ic(n)!==a||ic(r)!==u;return c&&(n=a,r=u),{width:n,height:r,$:c}}function ip(e){return Ar(e)?e:e.contextElement}function ks(e){const t=ip(e);if(!Gr(t))return qr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=mT(t);let u=(a?ic(n.width):n.width)/r,c=(a?ic(n.height):n.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const ZD=qr(0);function gT(e){const t=Jn(e);return!np()||!t.visualViewport?ZD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function e5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function So(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=ip(e);let u=qr(1);t&&(r?Ar(r)&&(u=ks(r)):u=ks(e));const c=e5(a,n,r)?gT(a):qr(0);let d=(o.left+c.x)/u.x,f=(o.top+c.y)/u.y,p=o.width/u.x,m=o.height/u.y;if(a){const T=Jn(a),y=r&&Ar(r)?Jn(r):r;let _=T,w=rp(_);for(;w&&r&&y!==_;){const C=ks(w),A=w.getBoundingClientRect(),P=vr(w),v=A.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,H=A.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,m*=C.y,d+=v,f+=H,_=Jn(w),w=rp(_)}}return ac({width:p,height:m,x:d,y:f})}function dc(e,t){const n=cc(e).scrollLeft;return t?t.left+n:So(Wr(e)).left+n}function ET(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function t5(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",u=Wr(r),c=t?lc(t.floating):!1;if(r===u||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=qr(1);const p=qr(0),m=Gr(r);if((m||!m&&!a)&&((vs(r)!=="body"||Za(u))&&(d=cc(r)),Gr(r))){const y=So(r);f=ks(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const T=u&&!m&&!a?ET(u,d):qr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+T.x,y:n.y*f.y-d.scrollTop*f.y+p.y+T.y}}function n5(e){return Array.from(e.getClientRects())}function r5(e){const t=Wr(e),n=cc(e),r=e.ownerDocument.body,o=Qn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Qn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+dc(e);const c=-n.scrollTop;return vr(r).direction==="rtl"&&(u+=Qn(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:u,y:c}}const yT=25;function i5(e,t){const n=Jn(e),r=Wr(e),o=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,c=0,d=0;if(o){a=o.width,u=o.height;const p=np();(!p||p&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const f=dc(r);if(f<=0){const p=r.ownerDocument,m=p.body,T=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,_=Math.abs(r.clientWidth-m.clientWidth-y);_<=yT&&(a-=_)}else f<=yT&&(a+=f);return{width:a,height:u,x:c,y:d}}const o5=new Set(["absolute","fixed"]);function s5(e,t){const n=So(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Gr(e)?ks(e):qr(1),u=e.clientWidth*a.x,c=e.clientHeight*a.y,d=o*a.x,f=r*a.y;return{width:u,height:c,x:d,y:f}}function bT(e,t,n){let r;if(t==="viewport")r=i5(e,n);else if(t==="document")r=r5(Wr(e));else if(Ar(t))r=s5(t,n);else{const o=gT(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ac(r)}function TT(e,t){const n=Di(e);return n===t||!Ar(n)||Cs(n)?!1:vr(n).position==="fixed"||TT(n,t)}function a5(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(c=>Ar(c)&&vs(c)!=="body"),o=null;const a=vr(e).position==="fixed";let u=a?Di(e):e;for(;Ar(u)&&!Cs(u);){const c=vr(u),d=tp(u);!d&&c.position==="fixed"&&(o=null),(a?!d&&!o:!d&&c.position==="static"&&!!o&&o5.has(o.position)||Za(u)&&!d&&TT(e,u))?r=r.filter(p=>p!==u):o=c,u=Di(u)}return t.set(e,r),r}function u5(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const u=[...n==="clippingAncestors"?lc(t)?[]:a5(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,p)=>{const m=bT(t,p,o);return f.top=Qn(m.top,f.top),f.right=Li(m.right,f.right),f.bottom=Li(m.bottom,f.bottom),f.left=Qn(m.left,f.left),f},bT(t,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function l5(e){const{width:t,height:n}=mT(e);return{width:t,height:n}}function c5(e,t,n){const r=Gr(t),o=Wr(t),a=n==="fixed",u=So(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=qr(0);function f(){d.x=dc(o)}if(r||!r&&!a)if((vs(t)!=="body"||Za(o))&&(c=cc(t)),r){const y=So(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else o&&f();a&&!r&&o&&f();const p=o&&!r&&!a?ET(o,c):qr(0),m=u.left+c.scrollLeft-d.x-p.x,T=u.top+c.scrollTop-d.y-p.y;return{x:m,y:T,width:u.width,height:u.height}}function op(e){return vr(e).position==="static"}function _T(e,t){if(!Gr(e)||vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wr(e)===n&&(n=n.ownerDocument.body),n}function ST(e,t){const n=Jn(e);if(lc(e))return n;if(!Gr(e)){let o=Di(e);for(;o&&!Cs(o);){if(Ar(o)&&!op(o))return o;o=Di(o)}return n}let r=_T(e,t);for(;r&&YD(r)&&op(r);)r=_T(r,t);return r&&Cs(r)&&op(r)&&!tp(r)?n:r||QD(e)||n}const d5=function(e){return Je(this,null,function*(){const t=this.getOffsetParent||ST,n=this.getDimensions,r=yield n(e.floating);return{reference:c5(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function f5(e){return vr(e).direction==="rtl"}const h5={convertOffsetParentRelativeRectToViewportRelativeRect:t5,getDocumentElement:Wr,getClippingRect:u5,getOffsetParent:ST,getElementRects:d5,getClientRects:n5,getDimensions:l5,getScale:ks,isElement:Ar,isRTL:f5};function xT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function p5(e,t){let n=null,r;const o=Wr(e);function a(){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),a();const f=e.getBoundingClientRect(),{left:p,top:m,width:T,height:y}=f;if(c||t(),!T||!y)return;const _=oc(m),w=oc(o.clientWidth-(p+T)),C=oc(o.clientHeight-(m+y)),A=oc(p),v={rootMargin:-_+"px "+-w+"px "+-C+"px "+-A+"px",threshold:Qn(0,Li(1,d))||1};let H=!0;function Y(D){const q=D[0].intersectionRatio;if(q!==d){if(!H)return u();q?u(!1,q):r=setTimeout(()=>{u(!1,1e-7)},1e3)}q===1&&!xT(f,e.getBoundingClientRect())&&u(),H=!1}try{n=new IntersectionObserver(Y,pe(F({},v),{root:o.ownerDocument}))}catch(D){n=new IntersectionObserver(Y,v)}n.observe(e)}return u(!0),a}function m5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=ip(e),p=o||a?[...f?eu(f):[],...eu(t)]:[];p.forEach(A=>{o&&A.addEventListener("scroll",n,{passive:!0}),a&&A.addEventListener("resize",n)});const m=f&&c?p5(f,n):null;let T=-1,y=null;u&&(y=new ResizeObserver(A=>{let[P]=A;P&&P.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var v;(v=y)==null||v.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let _,w=d?So(e):null;d&&C();function C(){const A=So(e);w&&!xT(w,A)&&n(),w=A,_=requestAnimationFrame(C)}return n(),()=>{var A;p.forEach(P=>{o&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),m==null||m(),(A=y)==null||A.disconnect(),y=null,d&&cancelAnimationFrame(_)}}const g5=HD,E5=zD,y5=FD,b5=$D,T5=BD,_5=MD,S5=jD,x5=(e,t,n)=>{const r=new Map,o=F({platform:h5},n),a=pe(F({},o.platform),{_c:r});return DD(e,t,pe(F({},o),{platform:a}))};function wT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return pe(F({},o),{toJSON:()=>o})}function w5(e){if(!e)return wT();const{x:t,y:n,width:r,height:o}=e;return wT(t,n,r,o)}function A5(e,t){return{contextElement:en(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?w5(r):n.getBoundingClientRect()}}}var tu=e=>({variable:e,reference:`var(${e})`}),pi={arrowSize:tu("--arrow-size"),arrowSizeHalf:tu("--arrow-size-half"),arrowBg:tu("--arrow-background"),transformOrigin:tu("--transform-origin"),arrowOffset:tu("--arrow-offset")},v5=e=>e==="top"||e==="bottom"?"y":"x";function C5(e,t){return{name:"transformOrigin",fn(n){var me,V,oe,ce,de;const{elements:r,middlewareData:o,placement:a,rects:u,y:c}=n,d=a.split("-")[0],f=v5(d),p=((me=o.arrow)==null?void 0:me.x)||0,m=((V=o.arrow)==null?void 0:V.y)||0,T=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,_=p+T/2,w=m+y/2,C=Math.abs(((oe=o.shift)==null?void 0:oe.y)||0),A=u.reference.height/2,P=y/2,v=(de=(ce=e.offset)==null?void 0:ce.mainAxis)!=null?de:e.gutter,H=typeof v=="number"?v+P:v!=null?v:P,Y=C>H,D={top:`${_}px calc(100% + ${H}px)`,bottom:`${_}px ${-H}px`,left:`calc(100% + ${H}px) ${w}px`,right:`${-H}px ${w}px`}[d],q=`${_}px ${u.reference.y+A-c}px`,re=!!e.overlap&&f==="y"&&Y;return r.floating.style.setProperty(pi.transformOrigin.variable,re?q:D),{data:{transformOrigin:re?q:D}}}}}var k5={name:"rects",fn({rects:e}){return{data:e}}},P5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[a]:`calc(100% + ${pi.arrowOffset.reference})`}),{}}}};function N5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var O5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function AT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function sp(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function I5(e,t,n){const r=e||t.createElement("div");return _5({element:r,padding:n.arrowPadding})}function R5(e,t){var n;if(!G6((n=t.offset)!=null?n:t.gutter))return g5(({placement:r})=>{var p,m,T,y;const o=((e==null?void 0:e.clientHeight)||0)/2,a=(m=(p=t.offset)==null?void 0:p.mainAxis)!=null?m:t.gutter,u=typeof a=="number"?a+o:a!=null?a:o,{hasAlign:c}=N5(r),d=c?void 0:t.shift,f=(y=(T=t.offset)==null?void 0:T.crossAxis)!=null?y:d;return Lh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function L5(e){if(!e.flip)return;const t=sp(e.boundary);return y5(pe(F({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function D5(e){if(!e.slide&&!e.overlap)return;const t=sp(e.boundary);return E5(pe(F({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:S5()}))}function M5(e){return b5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const a=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);o=Math.floor(o),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${c}px`),a.style.setProperty("--available-width",`${o}px`),a.style.setProperty("--available-height",`${r}px`)}})}function F5(e){var t;if(e.hideWhenDetached)return T5({strategy:"referenceHidden",boundary:(t=sp(e.boundary))!=null?t:"clippingAncestors"})}function B5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function U5(e,t,n={}){const r=A5(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},O5,n),a=t.querySelector("[data-part=arrow]"),u=[R5(a,o),L5(o),D5(o),I5(a,t.ownerDocument,o),P5(a),C5({gutter:o.gutter,offset:o.offset,overlap:o.overlap},a),M5(o),F5(o),k5],{placement:c,strategy:d,onComplete:f,onPositioned:p}=o,m=()=>Je(null,null,function*(){var H;if(!r||!t)return;const w=yield x5(r,t,{placement:c,middleware:u,strategy:d});f==null||f(w),p==null||p({placed:!0});const C=Es(t),A=AT(C,w.x),P=AT(C,w.y);t.style.setProperty("--x",`${A}px`),t.style.setProperty("--y",`${P}px`),o.hideWhenDetached&&(((H=w.middlewareData.hide)==null?void 0:H.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const v=t.firstElementChild;if(v){const Y=bs(v);t.style.setProperty("--z-index",Y.zIndex)}}),T=()=>Je(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),p==null||p({placed:!0})):yield m()}),y=B5(o.listeners),_=o.listeners?m5(r,t,T,y):r4;return T(),()=>{_==null||_(),p==null||p({placed:!1})}}function vT(e,t,n={}){const c=n,{defer:r}=c,o=mn(c,["defer"]),a=r?Yt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(U5(d,f,o))})),()=>{u.forEach(d=>d==null?void 0:d())}}var H5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function z5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:pi.arrowSize.reference,height:pi.arrowSize.reference,[pi.arrowSizeHalf.variable]:`calc(${pi.arrowSize.reference} / 2)`,[pi.arrowOffset.variable]:`calc(${pi.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?H5[t.split("-")[0]]:void 0,background:pi.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,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 Ps=new WeakMap,fc=new WeakMap,hc={},ap=0,CT=e=>e&&(e.host||CT(e.parentNode)),j5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=CT(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),$5=new Set(["script","output","status","next-route-announcer"]),V5=e=>$5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),q5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:o,followControlledElements:a=!0}=t,u=j5(n,Array.isArray(e)?e:[e]);hc[r]||(hc[r]=new WeakMap);const c=hc[r],d=[],f=new Set,p=new Set(u),m=y=>{!y||f.has(y)||(f.add(y),m(y.parentNode))};u.forEach(y=>{m(y),a&&en(y)&&Hb(y,_=>{m(_)})});const T=y=>{!y||p.has(y)||Array.prototype.forEach.call(y.children,_=>{if(f.has(_))T(_);else try{if(V5(_))return;const C=_.getAttribute(o)==="true",A=(Ps.get(_)||0)+1,P=(c.get(_)||0)+1;Ps.set(_,A),c.set(_,P),d.push(_),A===1&&C&&fc.set(_,!0),P===1&&_.setAttribute(r,""),C||_.setAttribute(o,"true")}catch(w){console.error("[zag-js > ariaHidden] cannot operate on ",_,w)}})};return T(n),f.clear(),ap++,()=>{d.forEach(y=>{const _=Ps.get(y)-1,w=c.get(y)-1;Ps.set(y,_),c.set(y,w),_||(fc.has(y)||y.removeAttribute(o),fc.delete(y)),w||y.removeAttribute(r)}),ap--,ap||(Ps=new WeakMap,Ps=new WeakMap,fc=new WeakMap,hc={})}},Y5=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,W5=(e,t=Y5(e),n="data-aria-hidden",r=!0)=>{if(t)return q5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},G5=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function kT(e,t={}){const{defer:n=!0}=t,r=n?G5:a=>a(),o=[];return o.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&o.push(W5(u))})),()=>{o.forEach(a=>a==null?void 0:a())}}function X5(e){const t={each(n){var r;for(let o=0;o<((r=e.frames)==null?void 0:r.length);o+=1){const a=e.frames[o];a&&n(a)}},addEventListener(n,r,o){return t.each(a=>{try{a.document.addEventListener(n,r,o)}catch(u){}}),()=>{try{t.removeEventListener(n,r,o)}catch(a){}}},removeEventListener(n,r,o){t.each(a=>{try{a.document.removeEventListener(n,r,o)}catch(u){}})}};return t}function K5(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t==null||t.addEventListener(n,r,o)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,o)}catch(a){}}},removeEventListener:(n,r,o)=>{try{t==null||t.removeEventListener(n,r,o)}catch(a){}}}}var PT="pointerdown.outside",NT="focus.outside";function Q5(e){for(const t of e)if(en(t)&&Vr(t))return!0;return!1}var OT=e=>"clientY"in e;function J5(e,t){if(!OT(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 Z5(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function IT(e,t){if(!t||!OT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,a=o&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},c={x:e.clientX,y:e.clientY};return Z5(u,c)?r||a:!1}function eM(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:a,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=$r(e),f=Es(e),p=X5(f),m=K5(f);function T(v,H){if(!en(H)||!H.isConnected||gs(e,H)||J5(e,v)||c&&Ub(e,H))return!1;const Y=d.querySelector(`[aria-controls="${e.id}"]`);if(Y){const q=$h(Y);if(IT(v,q))return!1}const D=$h(e);return IT(v,D)?!1:!(n!=null&&n(H))}const y=new Set,_=yo(e==null?void 0:e.getRootNode());function w(v){function H(Y){var me,V;const D=u&&!zb()?Yt:oe=>oe(),q=Y!=null?Y:v,re=(V=(me=q==null?void 0:q.composedPath)==null?void 0:me.call(q))!=null?V:[q==null?void 0:q.target];D(()=>{const oe=_?re[0]:wr(v);if(!(!e||!T(v,oe))){if(o||a){const ce=Rh(o,a);e.addEventListener(PT,ce,{once:!0})}RT(e,PT,{bubbles:!1,cancelable:!0,detail:{originalEvent:q,contextmenu:B4(q),focusable:Q5(re),target:oe}})}})}v.pointerType==="touch"?(y.forEach(Y=>Y()),y.add(tn(d,"click",H,{once:!0})),y.add(m.addEventListener("click",H,{once:!0})),y.add(p.addEventListener("click",H,{once:!0}))):H()}const C=new Set,A=setTimeout(()=>{C.add(tn(d,"pointerdown",w,!0)),C.add(m.addEventListener("pointerdown",w,!0)),C.add(p.addEventListener("pointerdown",w,!0))},0);function P(v){(u?Yt:Y=>Y())(()=>{var q,re;const Y=(re=(q=v==null?void 0:v.composedPath)==null?void 0:q.call(v))!=null?re:[v==null?void 0:v.target],D=_?Y[0]:wr(v);if(!(!e||!T(v,D))){if(r||a){const me=Rh(r,a);e.addEventListener(NT,me,{once:!0})}RT(e,NT,{bubbles:!1,cancelable:!0,detail:{originalEvent:v,contextmenu:!1,focusable:Vr(D),target:D}})}})}return zb()||(C.add(tn(d,"focusin",P,!0)),C.add(m.addEventListener("focusin",P,!0)),C.add(p.addEventListener("focusin",P,!0))),()=>{clearTimeout(A),y.forEach(v=>v()),C.forEach(v=>v())}}function tM(e,t){const{defer:n}=t,r=n?Yt:a=>a(),o=[];return o.push(r(()=>{const a=typeof e=="function"?e():e;o.push(eM(a,t))})),()=>{o.forEach(a=>a==null?void 0:a())}}function RT(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function nM(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return tn($r(e),"keydown",n,{capture:!0})}var LT="layer:request-dismiss",dr={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=>gs(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>gs(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=>dr.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];iM(e,LT,o=>{var a;(a=r.requestDismiss)==null||a.call(r,o),o.defaultPrevented||r==null||r.dismiss()}),rM(e,LT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function rM(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function iM(e,t,n){e.addEventListener(t,n,{once:!0})}var DT;function MT(){dr.layers.forEach(({node:e})=>{e.style.pointerEvents=dr.isBelowPointerBlockingLayer(e)?"none":"auto"})}function oM(e){e.style.pointerEvents=""}function sM(e,t){const n=$r(e),r=[];return dr.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(DT=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(o=>{const[a,u]=aD(()=>{const c=o();return en(c)?c:null},{timeout:1e3});a.then(c=>r.push(Zl(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{dr.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=DT,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function aM(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Dh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:a,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:o};dr.add(f),MT();function p(w){var A,P;const C=wr(w.detail.originalEvent);dr.isBelowPointerBlockingLayer(e)||dr.isInBranch(C)||((A=t.onPointerDownOutside)==null||A.call(t,w),(P=t.onInteractOutside)==null||P.call(t,w),!w.defaultPrevented&&(c&&console.log("onPointerDownOutside:",w.detail.originalEvent),r==null||r()))}function m(w){var A,P;const C=wr(w.detail.originalEvent);dr.isInBranch(C)||((A=t.onFocusOutside)==null||A.call(t,w),(P=t.onInteractOutside)==null||P.call(t,w),!w.defaultPrevented&&(c&&console.log("onFocusOutside:",w.detail.originalEvent),r==null||r()))}function T(w){var C;dr.isTopMost(e)&&((C=t.onEscapeKeyDown)==null||C.call(t,w),!w.defaultPrevented&&r&&(w.preventDefault(),r()))}function y(w){var v;if(!e)return!1;const C=typeof u=="function"?u():u,A=Array.isArray(C)?C:[C],P=(v=t.persistentElements)==null?void 0:v.map(H=>H()).filter(en);return P&&A.push(...P),A.some(H=>gs(H,w))||dr.isInNestedLayer(e,w)}const _=[a?sM(e,t.persistentElements):void 0,nM(e,T),tM(e,{exclude:y,onFocusOutside:m,onPointerDownOutside:p,defer:t.defer})];return()=>{dr.remove(e),MT(),oM(e),_.forEach(w=>w==null?void 0:w())}}function FT(e,t){const{defer:n}=t,r=n?Yt:a=>a(),o=[];return o.push(r(()=>{const a=ps(e)?e():e;o.push(aM(a,t))})),()=>{o.forEach(a=>a==null?void 0:a())}}var uM=Object.defineProperty,lM=(e,t,n)=>t in e?uM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vt=(e,t,n)=>lM(e,typeof t!="symbol"?t+"":t,n),BT={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()}},cM=[],dM=class{constructor(e,t){vt(this,"trapStack"),vt(this,"config"),vt(this,"doc"),vt(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),vt(this,"portalContainers",new Set),vt(this,"listenerCleanups",[]),vt(this,"handleFocus",r=>{const o=wr(r),a=this.findContainerIndex(o,r)>=0;if(a||Xl(o))a&&(this.state.mostRecentlyFocusedNode=o);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(Xa(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const p=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);p>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?p+1<f.length&&(u=f[p+1],c=!1):p-1>=0&&(u=f[p-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>Xa(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}),vt(this,"handlePointerDown",r=>{const o=wr(r);if(!(this.findContainerIndex(o,r)>=0)){if(ru(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ru(this.config.allowOutsideClick,r)||r.preventDefault()}}),vt(this,"handleClick",r=>{const o=wr(r);this.findContainerIndex(o,r)>=0||ru(this.config.clickOutsideDeactivates,r)||ru(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),vt(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const o=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:o});if(!a)return;nu(r)&&r.preventDefault(),this.tryFocus(a)}}),vt(this,"handleEscapeKey",r=>{fM(r)&&ru(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),vt(this,"_mutationObserver"),vt(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(o=>{o.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),o.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 P4(f)?!0:f.id&&!this.state.containers.some(p=>p.contains(f))?N4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),vt(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(o=>{var a;(a=this._mutationObserver)==null||a.observe(o,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(o=>{this.observePortalContainer(o)}))}),vt(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Vr(r)){const o=ys(this.doc);if(o&&this.findContainerIndex(o)>=0)r=o;else{const a=this.state.tabbableGroups[0];r=a&&a.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}),vt(this,"tryFocus",r=>{if(r!==!1&&r!==ys(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,hM(r)&&r.select()}}),vt(this,"deactivate",r=>{if(!this.state.active)return this;const o=F({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(),BT.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(o,"onDeactivate"),u=this.getOption(o,"onPostDeactivate"),c=this.getOption(o,"checkCanReturnFocus"),d=this.getOption(o,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{UT(()=>{if(d){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(p)}u==null||u()})};if(d&&c){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(p).then(f,f),this}return f(),this}),vt(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,o==null||o(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),vt(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,o==null||o(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),vt(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),vt(this,"getReturnFocusNode",r=>{const o=this.getNodeForOption("setReturnFocus",{params:[r]});return o||(o===!1?!1:r)}),vt(this,"getOption",(r,o,a)=>r&&r[o]!==void 0?r[o]:this.config[a||o]),vt(this,"getNodeForOption",(r,{hasFallback:o=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),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&&!o)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),vt(this,"findNextNavNode",r=>{const{event:o,isBackward:a=!1}=r,u=r.target||wr(o);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,o),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let p=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Vr(u)&&!bo(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(p=d),p>=0){const m=p===0?this.state.tabbableGroups.length-1:p-1,T=this.state.tabbableGroups[m];c=Xa(u)>=0?T.lastTabbableNode:T.lastDomTabbableNode}else nu(o)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let p=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Vr(u)&&!bo(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(p=d),p>=0){const m=p===this.state.tabbableGroups.length-1?0:p+1,T=this.state.tabbableGroups[m];c=Xa(u)>=0?T.firstTabbableNode:T.firstDomTabbableNode}else nu(o)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||cM;const n=F({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return nu(r)&&!r.shiftKey},isKeyBackward(r){return nu(r)&&r.shiftKey}},t);this.doc=n.document||$r(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=>{v4(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:o})=>r.contains(e)||(n==null?void 0:n.includes(r))||o.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?Ub(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Ts(e,{getShadowRoot:this.config.getShadowRoot}),n=Gb(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],o=t[t.length-1],a=r,u=o;let c=!1;for(let f=0;f<t.length;f++)if(Xa(t[f])>0){c=!0;break}function d(f,p=!0){const m=t.indexOf(f);if(m>=0)return t[m+(p?1:-1)];const T=n.indexOf(f);if(!(T<0)){if(p){for(let y=T+1;y<n.length;y++)if(bo(n[y]))return n[y]}else for(let y=T-1;y>=0;y--)if(bo(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,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 BT.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?UT(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(tn(this.doc,"focusin",this.handleFocus,!0),tn(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),tn(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),tn(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),tn(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),tn(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=ys(this.doc),t==null||t();const o=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(o,o),this):(o(),this)}},nu=e=>e.key==="Tab",ru=(e,...t)=>typeof e=="function"?e(...t):e,fM=e=>!e.isComposing&&e.key==="Escape",UT=e=>setTimeout(e,0),hM=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function HT(e,t={}){let n;const r=Yt(()=>{const o=typeof e=="function"?e():e;if(o){n=new dM(o,pe(F({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o},t),{document:$r(o)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var up="data-scroll-lock";function pM(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function zT(e){const t=bs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function jT(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:o}=t;if(o.hasAttribute(up))return;const u=zT(r)||zT(o),c=n.innerWidth-r.clientWidth;o.setAttribute(up,"");const d=()=>oD(r,"--scrollbar-width",`${c}px`),f=pM(r),p=()=>{const _={overflow:"hidden"};return!u&&c>0&&(_[f]=`${c}px`),Zl(o,_)},m=()=>{var Y,D;const{scrollX:_,scrollY:w,visualViewport:C}=n,A=(Y=C==null?void 0:C.offsetLeft)!=null?Y:0,P=(D=C==null?void 0:C.offsetTop)!=null?D:0,v={position:"fixed",overflow:"hidden",top:`${-(w-Math.floor(P))}px`,left:`${-(_-Math.floor(A))}px`,right:"0"};!u&&c>0&&(v[f]=`${c}px`);const H=Zl(o,v);return()=>{H==null||H(),n.scrollTo({left:_,top:w,behavior:"instant"})}},T=[d(),Kl()?m():p()];return()=>{T.forEach(_=>_==null?void 0:_()),o.removeAttribute(up)}}var mM=_o("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Xr=mM.build(),$T=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},VT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},lp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},qT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},gM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},cp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},dp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},EM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},YT=e=>e.getById($T(e)),Ns=e=>e.getById(VT(e)),Os=e=>e.getById(lp(e)),WT=e=>e.getById(qT(e)),yM=e=>e.getById(cp(e)),bM=e=>e.getById(dp(e));function TM(e,t){const{state:n,context:r,send:o,computed:a,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),p=a("currentPortalled"),m=r.get("renderedElements"),T=z5(pe(F({},u("positioning")),{placement:f}));return{portalled:p,open:d,setOpen(y){n.matches("open")!==y&&o({type:y?"OPEN":"CLOSE"})},reposition(y={}){o({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(pe(F({id:gM(c)},Xr.arrow.attrs),{dir:u("dir"),style:T.arrow}))},getArrowTipProps(){return t.element(pe(F({},Xr.arrowTip.attrs),{dir:u("dir"),style:T.arrowTip}))},getAnchorProps(){return t.element(pe(F({},Xr.anchor.attrs),{dir:u("dir"),id:$T(c)}))},getTriggerProps(){return t.button(pe(F({},Xr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:VT(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":lp(c),onPointerDown(y){jb(y)&&M4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||o({type:"TOGGLE"})},onBlur(y){o({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(pe(F({},Xr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(pe(F({id:qT(c)},Xr.positioner.attrs),{dir:u("dir"),style:T.floating}))},getContentProps(){return t.element(pe(F({},Xr.content.attrs),{dir:u("dir"),id:lp(c),tabIndex:-1,role:"dialog","aria-modal":Mb(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":ms(d),"aria-labelledby":m.title?cp(c):void 0,"aria-describedby":m.description?dp(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(pe(F({},Xr.title.attrs),{id:cp(c),dir:u("dir")}))},getDescriptionProps(){return t.element(pe(F({},Xr.description.attrs),{id:dp(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(pe(F({},Xr.closeTrigger.attrs),{dir:u("dir"),id:EM(c),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),o({type:"CLOSE"}))}}))}}}var _M={props({props:e}){return pe(F({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:F({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 a;e.set("currentPlacement",t("positioning").placement);const r=(a=YT(n))!=null?a:Ns(n);return vT(r,()=>WT(n),pe(F({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>Os(n);let o=!0;return FT(r,{type:"popover",pointerBlocking:t("modal"),exclude:Ns(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(o=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:o})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:rD(()=>Os(t),{triggerElement:Ns(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?kT(()=>[Os(t),Ns(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return jT(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?HT(()=>Os(t),{initialFocus:()=>Xb({root:Os(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const o=(u=YT(n))!=null?u:Ns(n);vT(o,()=>WT(n),pe(F(F({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){Yt(()=>{Object.assign(e.get("renderedElements"),{title:!!yM(t),description:!!bM(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||Yt(()=>{const n=Xb({root:Os(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,o;const n=(o=e.restoreFocus)!=null?o:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||Yt(()=>{const a=Ns(t);a==null||a.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})}}}};xs()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[qU,pc]=To({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[YU,fp]=To({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),SM=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,dir:r,getRootNode:n},e),a=tc(_M,o);return TM(a,Yh)},xM=e=>{const[t,u]=iT(e),c=u,{children:n}=c,r=mn(c,["children"]),o=SM(r),a=Xh(Wt({present:o.open},t));return x.jsx(yD,{value:o,children:x.jsx(tT,{value:a,children:n})})},GT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(pe(F({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return x.jsx(Sn.button,pe(F({},o),{ref:t}))});GT.displayName="PopoverTrigger";function wM(e){return wt({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 AM(e){return wt({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 vM(e){return wt({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 CM(e){return wt({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 kM(e){return wt({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 PM(e){return wt({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 hp(e){return wt({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 XT(e){return wt({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 NM=({className:e,componentType:t,children:n})=>{const[r,o]=B.useState(!1),{globalClassName:a}=rt(),u=f=>{o(f.open)},c=B.useCallback(()=>{o(!1)},[]),d=B.useMemo(()=>({closeMenu:c}),[c]);return x.jsxs(xM,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[x.jsx(GT,{"aria-label":`Overflow menu for ${t}`,className:W(`${z}-overflow-menu-button-trigger`,`${z}-icon-button`,a,e,`cim-${t}-component`),children:x.jsx(XT,{})}),x.jsx(rT,{children:x.jsx(nT,{className:W(`${z}-overflow-menu-list`,a,`cim-${t}-component`),children:x.jsx(Pb.Provider,{value:d,children:n})})})]})};function KT(e){return wt({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 QT(e){return wt({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[OM,xo]=To({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),JT=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getControlProps(),e);return x.jsx(Sn.div,pe(F(F({},r),e),{ref:t}))});JT.displayName="CarouselControl";const ZT=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["readOnly","index"]),o=xo(),a=Wt(o.getIndicatorProps(n),r);return x.jsx(Sn.button,pe(F({},a),{ref:t}))});ZT.displayName="CarouselIndicator";const e_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getIndicatorGroupProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});e_.displayName="CarouselIndicatorGroup";const t_=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["index","snapAlign"]),o=xo(),a=Wt(o.getItemProps(n),r);return x.jsx(Sn.div,pe(F({},a),{ref:t}))});t_.displayName="CarouselItem";const n_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getItemGroupProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});n_.displayName="CarouselItemGroup";const r_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getNextTriggerProps(),e);return x.jsx(Sn.button,pe(F({},r),{ref:t}))});r_.displayName="CarouselNextTrigger";const i_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getPrevTriggerProps(),e);return x.jsx(Sn.button,pe(F({},r),{ref:t}))});i_.displayName="CarouselPrevTrigger";function IM(e){const t=bs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),o=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(T,y){let _=parseFloat(T);return/%/.test(T)&&(_/=100,_*=y),Number.isNaN(_)?0:_}let d=c(r,n.width),f=c(o,n.height),p=c(a,n.width),m=c(u,n.height);return{x:{before:d,after:p},y:{before:f,after:m}}}function RM(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 o_(e){let t=[];for(const n of e.children)t=t.concat(n,o_(n));return t}function s_(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},o=t?o_(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",c=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const p of o){const m=p.getBoundingClientRect();if(!RM(n,m,u))continue;const T=bs(p);let[y,_]=T.getPropertyValue("scroll-snap-align").split(" ");typeof _=="undefined"&&(_=y);const w=a==="x"?_:y,C=m[c]-n[c]+e[f];switch(w){case"none":break;case"start":r[a].start.push({node:p,position:C});break;case"center":r[a].center.push({node:p,position:C+m[d]/2});break;case"end":r[a].end.push({node:p,position:C+m[d]});break}}}return r}function a_(e){const t=e.getBoundingClientRect(),n=IM(e),r=s_(e),o={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:u_([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(l_(0,o.x))),y:u_([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(l_(0,o.y)))}}function LM(e,t,n){const r=s_(e),o=[...r[t].start,...r[t].center,...r[t].end];for(const a of o)if(n(a.node))return a.position}var u_=e=>[...new Set(e)],l_=(e,t)=>n=>Math.max(e,Math.min(t,n)),DM=_o("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),mi=DM.build(),MM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},FM=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`carousel:${e.id}:item:${t}`},mc=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},BM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},UM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},HM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},c_=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?o:`carousel:${e.id}:indicator:${t}`},Un=e=>e.getById(mc(e)),d_=e=>iD(Un(e),"[data-part=item]"),zM=(e,t)=>e.getById(c_(e,t)),f_=e=>{const t=Un(e);if(!t)return;const n=Ts(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function jM(e,t){const{state:n,context:r,computed:o,send:a,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),p=o("canScrollNext"),m=o("canScrollPrev"),T=o("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),_=r.get("page"),w=c("slidesPerPage"),C=c("padding"),A=c("translations");return{isPlaying:d,isDragging:f,page:_,pageSnapPoints:y,canScrollNext:p,canScrollPrev:m,getProgress(){return _/y.length},scrollToIndex(P,v){a({type:"INDEX.SET",index:P,instant:v})},scrollTo(P,v){a({type:"PAGE.SET",index:P,instant:v})},scrollNext(P){a({type:"PAGE.NEXT",instant:P})},scrollPrev(P){a({type:"PAGE.PREV",instant:P})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(P){return Array.from(r.get("slidesInView")).includes(P)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(pe(F({},mi.root.attrs),{id:MM(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":w,"--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(pe(F({},mi.itemGroup.attrs),{id:mc(u),"data-orientation":c("orientation"),"data-dragging":ms(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(P){gs(P.currentTarget,wr(P))&&a({type:"VIEWPORT.FOCUS"})},onBlur(P){gs(P.currentTarget,P.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(P){if(P.defaultPrevented||!c("allowMouseDrag")||!jb(P))return;const v=wr(P);Vr(v)&&v!==P.currentTarget||(P.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:i4(P=>{const v=c("orientation")==="horizontal"?"deltaX":"deltaY";P[v]<0&&!o("canScrollPrev")||P[v]>0&&!o("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[T?"x":"y",c("snapType")].join(" "),gridAutoFlow:T?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[T?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[T?"scrollPaddingInline":"scrollPaddingBlock"]:C,[T?"paddingInline":"paddingBlock"]:C,[T?"overflowX":"overflowY"]:"auto"}}))},getItemProps(P){const v=r.get("slidesInView").includes(P.index);return t.element(pe(F({},mi.item.attrs),{id:FM(u,P.index),dir:c("dir"),role:"group","data-index":P.index,"data-inview":ms(v),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":A.item(P.index,c("slideCount")),"aria-hidden":Mb(!v),style:{scrollSnapAlign:(()=>{var re;const H=(re=P.snapAlign)!=null?re:"start",Y=c("slidesPerMove"),D=Y==="auto"?Math.floor(c("slidesPerPage")):Y;return(P.index+D)%D===0?H:void 0})()}}))},getControlProps(){return t.element(pe(F({},mi.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(pe(F({},mi.prevTrigger.attrs),{id:UM(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":A.prevTrigger,"data-orientation":c("orientation"),"aria-controls":mc(u),onClick(P){P.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(pe(F({},mi.nextTrigger.attrs),{dir:c("dir"),id:BM(u),type:"button","aria-label":A.nextTrigger,"data-orientation":c("orientation"),"aria-controls":mc(u),disabled:!p,onClick(P){P.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(pe(F({},mi.indicatorGroup.attrs),{dir:c("dir"),id:HM(u),"data-orientation":c("orientation"),onKeyDown(P){if(P.defaultPrevented)return;const v="indicator",H={ArrowDown(q){T||(a({type:"PAGE.NEXT",src:v}),q.preventDefault())},ArrowUp(q){T||(a({type:"PAGE.PREV",src:v}),q.preventDefault())},ArrowRight(q){T&&(a({type:"PAGE.NEXT",src:v}),q.preventDefault())},ArrowLeft(q){T&&(a({type:"PAGE.PREV",src:v}),q.preventDefault())},Home(q){a({type:"PAGE.SET",index:0,src:v}),q.preventDefault()},End(q){a({type:"PAGE.SET",index:y.length-1,src:v}),q.preventDefault()}},Y=z4(P,{dir:c("dir"),orientation:c("orientation")}),D=H[Y];D==null||D(P)}}))},getIndicatorProps(P){return t.button(pe(F({},mi.indicator.attrs),{dir:c("dir"),id:c_(u,P.index),type:"button","data-orientation":c("orientation"),"data-index":P.index,"data-readonly":ms(P.readOnly),"data-current":ms(P.index===_),"aria-label":A.indicator(P.index),onClick(v){v.defaultPrevented||P.readOnly||a({type:"PAGE.SET",index:P.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(pe(F({},mi.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":ms(d),"aria-label":d?A.autoplayStop:A.autoplayStart,onClick(P){P.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var $M={props({props:e}){return c4(e,["slideCount"],"carousel"),pe(F({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:F({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 a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:VM(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 W6(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:o}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{o({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{o({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(Un(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=Un(e);if(!n)return;const r=e.getWin(),o=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),f_(e)});return f_(e),o.observe(n,{childList:!0,subtree:!0}),()=>o.disconnect()},trackSlideResize({scope:e,send:t}){if(!Un(e))return;const r=e.getWin(),o=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};Yt(()=>{o(),Yt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(o);return d_(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=Un(e),o=e.getWin(),a=new o.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var T;const p=f.target,m=Number((T=p.dataset.index)!=null?T:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?j6(d,m):$6(d,m)},n.get("slidesInView"));n.set("slidesInView",V6(c))},{root:r,threshold:t("inViewThreshold")});return d_(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=Un(n);return r?tn(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 tn(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return tD(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 tn(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.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:o}){var f;const a=t.instant?"instant":"smooth",u=Lb((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=Un(n);if(!c)return;const d=r("isHorizontal")?"left":"top";o(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=Un(t);if(!r)return;const o=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-o)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),o=Ob(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),o=q6(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const o=Un(r);if(!o)return;const a=LM(o,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-a)<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=Lb(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=Un(n);if(!r)return;const o=a_(r);e.set("pageSnapPoints",t("isHorizontal")?o.x:o.y)},disableScrollSnap({scope:e}){const t=Un(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=Un(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=Un(e);if(!r)return;const o=r.scrollLeft,a=r.scrollTop,u=a_(r),c=u.x.reduce((f,p)=>Math.abs(p-o)<Math.abs(f-o)?p:f,u.x[0]),d=u.y.reduce((f,p)=>Math.abs(p-a)<Math.abs(f-a)?p:f,u.y[0]);Yt(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const p=r.dataset.scrollSnapType;p&&(r.style.setProperty("scroll-snap-type",p),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=zM(n,e.get("page"));r&&Yt(()=>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 VM(e,t,n){if(e==null||n<=0)return[];const r=[],o=t==="auto"?Math.floor(n):t;if(o<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=o)r.push(a);return r}xs()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),xs()(["index","readOnly"]),xs()(["index","snapAlign"]);const qM=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,dir:r,getRootNode:n},e),a=tc($M,o);return jM(a,Yh)},h_=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),o=qM(n),a=Wt(o.getRootProps(),r);return x.jsx(OM,{value:o,children:x.jsx(Sn.div,pe(F({},a),{ref:t}))})});h_.displayName="CarouselRoot";const YM=180,WM=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},GM=({globalClassName:e,className:t,itemMinWidth:n=YM,spacing:r="0.5rem",loop:o=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:c=!0,onPageChange:d,ariaLabel:f="Product carousel",children:p})=>{const m=Array.from(p),T=m.length,y=B.useRef(null),[_,w]=B.useState(0),{width:C}=jC();B.useLayoutEffect(()=>{y.current&&w(y.current.getBoundingClientRect().width)},[C,T]);const A=WM(r),P=n+A,v=_>0?(_+A)/P:1,H=Math.max(1,Math.floor(v));if(T===0)return null;const Y=T>H,D=Math.ceil(T/H),q=Y?Math.max(1,v):H;return x.jsxs(h_,{ref:y,className:W(e,t,`${z}-carousel`),slidesPerPage:q,slidesPerMove:H,spacing:r,loop:o,allowMouseDrag:a,slideCount:T,onPageChange:d,"aria-label":f,children:[x.jsx(n_,{className:W(e,`${z}-carousel__item-group`,{"carousel-row-container":!Y}),children:m.map((re,me)=>x.jsx(t_,{index:me,className:W(e,`${z}-carousel__item`),children:re},me))}),c&&Y&&x.jsxs(JT,{className:W(e,`${z}-carousel__control`),children:[x.jsx(i_,{className:W(e,`${z}-carousel__prev-trigger`),"aria-label":"Previous slide",children:x.jsx(vM,{size:"16px"})}),x.jsx(r_,{className:W(e,`${z}-carousel__next-trigger`),"aria-label":"Next slide",children:x.jsx(CM,{size:"16px"})})]}),u&&Y&&x.jsx(e_,{className:W(e,`${z}-carousel__indicator-group`),children:Array.from({length:D},(re,me)=>x.jsx(ZT,{index:me,className:W(e,`${z}-carousel__indicator`),"aria-label":`Go to slide group ${me+1}`},me))})]})},[XM,KM]=To({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),QM=e=>Qa()(e,["lazyMount","unmountOnExit"]),[JM,iu]=To({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),p_=B.forwardRef((e,t)=>{const n=iu(),r=KM(),o=Xh(pe(F({},r),{present:n.open})),a=Wt(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:x.jsx(Sn.div,pe(F({},a),{ref:nc(o.ref,t)}))});p_.displayName="DialogBackdrop";const pp=B.forwardRef((e,t)=>{const n=iu(),r=Ka(),o=Wt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:nc(r.ref,t)}))});pp.displayName="DialogContent";const mp=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getDescriptionProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});mp.displayName="DialogDescription";const gp=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getPositionerProps(),e);return Ka().unmounted?null:x.jsx(Sn.div,pe(F({},r),{ref:t}))});gp.displayName="DialogPositioner";var ZM=_o("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),wo=ZM.build(),m_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},g_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Ep=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},E_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},yp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},bp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},y_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},gc=e=>e.getById(Ep(e)),e8=e=>e.getById(m_(e)),t8=e=>e.getById(g_(e)),n8=e=>e.getById(E_(e)),r8=e=>e.getById(yp(e)),i8=e=>e.getById(bp(e)),o8=e=>e.getById(y_(e));function s8(e,t){const{state:n,send:r,context:o,prop:a,scope:u}=e,c=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(pe(F({},wo.trigger.attrs),{dir:a("dir"),id:E_(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Ep(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(pe(F({},wo.backdrop.attrs),{dir:a("dir"),hidden:!d,id:g_(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(pe(F({},wo.positioner.attrs),{dir:a("dir"),id:m_(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=o.get("rendered");return t.element(pe(F({},wo.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:Ep(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:yp(u),"aria-describedby":f.description?bp(u):void 0}))},getTitleProps(){return t.element(pe(F({},wo.title.attrs),{dir:a("dir"),id:yp(u)}))},getDescriptionProps(){return t.element(pe(F({},wo.description.attrs),{dir:a("dir"),id:bp(u)}))},getCloseTriggerProps(){return t.button(pe(F({},wo.closeTrigger.attrs),{dir:a("dir"),id:y_(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var a8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>o8(t):void 0,o=typeof e.modal=="boolean"?e.modal:!0;return F({role:"dialog",modal:o,trapFocus:o,preventScroll:o,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 FT(()=>gc(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[n8(e)],onInteractOutside(o){var a;(a=n("onInteractOutside"))==null||a(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(o){var a;(a=n("onEscapeKeyDown"))==null||a(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return jT(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?HT(()=>gc(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,a;return(a=(o=t("finalFocusEl"))==null?void 0:o())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?kT(()=>[gc(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){Yt(()=>{e.set("rendered",{title:!!r8(t),description:!!i8(t)})})},syncZIndex({scope:e}){Yt(()=>{const t=gc(e);if(!t)return;const n=bs(t);[e8(e),t8(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex),o==null||o.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})}}}};xs()(["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 u8=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,getRootNode:n,dir:r},e),a=tc(a8,o);return s8(a,Yh)},b_=e=>{const[t,c]=iT(e),d=c,{children:n}=d,r=mn(d,["children"]),[o]=QM(t),a=u8(r),u=Xh(Wt({present:a.open},t));return x.jsx(JM,{value:a,children:x.jsx(XM,{value:o,children:x.jsx(tT,{value:u,children:n})})})},T_=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getTitleProps(),e);return x.jsx(Sn.h2,pe(F({},r),{ref:t}))});T_.displayName="DialogTitle";const l8=({children:e})=>{const[t,n]=B.useState(!1),r=B.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),o=B.useMemo(()=>({isOpen:t}),[t]);return x.jsx(Ih.Provider,{value:r,children:x.jsx(kb.Provider,{value:o,children:e})})},__=()=>B.useContext(kb),S_=()=>{const e=B.useContext(Ih);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},c8=`${z}-overflow-menu-button-trigger`,d8=({componentType:e,children:t})=>{const{isOpen:n}=__(),{closeMenu:r}=S_(),{globalClassName:o}=rt(),a=B.useRef(null);return B.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${c8}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?x.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:W(`${z}-overflow-panel`,o,`cim-${e}-component`),children:t}):null},f8=({componentType:e,className:t})=>{const{toggleMenu:n}=S_(),{isOpen:r}=__(),{globalClassName:o}=rt();return x.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:W(`${z}-overflow-menu-button-trigger`,`${z}-icon-button`,o,t,`cim-${e}-component`),onClick:n,children:x.jsx(XT,{})})},Tp=()=>{const{status:e,entryType:t}=sr(),{messages:n}=ar(),r=t==="ask_cim",o=!!(n&&n.length>0),a=!!e.isOpen;return r&&a||!r&&a&&o},h8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{previousComponentType:r}=sr(),o=hs(),a=()=>{yl(r||"dialog"),o()};return t?x.jsx(ci,{className:W(n,`${z}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:x.jsx(KT,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[x.jsx(KT,{}),"Show ",r||"dialog"]})},p8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{isModalFullscreen:r}=sr(),o=hs(),a=()=>{vf(!r),o()},u=r?Jk:Zk,c="Toggle Fullscreen";return t?x.jsx(ci,{ariaLabel:c,title:c,className:W(n,`${z}-modal-fullscreen-button`,`cim-${e}-component`),icon:x.jsx(u,{}),onClick:a}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[x.jsx(u,{}),c]})},m8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{dialogPosition:r}=sr(),o=hs(),a=r==="bottom-left",u=()=>{Cf(a?"bottom-right":"bottom-left"),o()},c=a?AM:wM,d=a?"Move right":"Move left";return t?x.jsx(ci,{className:W(n,`${z}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:x.jsx(c,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[x.jsx(c,{}),d]})},x_=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:o,globalClassName:a,mode:u,enableDownloadTranscript:c}=rt(),{mode:d}=sr(),f=u==="messaging"&&c&&!!r,p=d==="standalone",m=e==="modal",T=m?h8:w_,y=m?p8:m8,_=B.useMemo(()=>o?tP(o):{},[o]);return x.jsx(l8,{children:x.jsxs("div",{className:W(a,`${z}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[x.jsxs("div",{className:W(a,`${z}-${e}-header`,{standalone:p,embedded:!p}),style:_,children:[(o==null?void 0:o.logoUrl)&&x.jsx("img",{alt:"",role:"img",className:W(a,`${z}-${e}-logo`,{standalone:p,embedded:!p}),src:o.logoUrl}),x.jsx(T_,{className:W(a,`${z}-${e}-title`,{standalone:p,embedded:!p}),children:o==null?void 0:o.headerText}),x.jsxs("div",{className:W(a,`${z}-${e}-controls`),children:[x.jsx(T,{componentType:e,isIcon:!0}),x.jsx(f8,{componentType:e}),x.jsx(H1,{className:W(a,`cim-${e}-component`),onClick:n})]})]}),x.jsxs(d8,{componentType:e,children:[x.jsx(y,{componentType:e}),x.jsx(b8,{componentType:e}),x.jsx(Nb,{componentType:e,onClearChat:t}),f&&x.jsx(g8,{componentType:e,onDownloadTranscript:r})]})]})})},g8=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=rt(),r=hs(),[o,a]=B.useState(!1),u=()=>Je(null,null,function*(){if(!o){a(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{a(!1)}}});return x.jsxs("button",{className:W(`${z}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:o,children:[x.jsx(U6,{}),"Download transcript"]})},E8={sparkle:hp,plus:kM,"paper-plane":PM},_p=({icon:e,className:t})=>{const n=E8[e];return n?x.jsx(n,{className:t,"aria-hidden":"true"}):null},y8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:o,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=rt(),c=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=o?"standalone":"embedded",p=_=>()=>{a(_)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},T=_=>x.jsxs(x.Fragment,{children:[c&&x.jsx(_p,{icon:c,className:`${z}-suggestion-button-icon`}),x.jsx("span",{children:_})]});return x.jsx("div",{className:W(t,`${z}-suggestion-container ${f}`,e),children:n.map(_=>o?x.jsx(Sl,{disabled:r,className:W(t,`${z}-suggestion-button standalone`,m),onClick:p(_),children:T(_)},_):x.jsx("button",{disabled:r,className:W(t,`${z}-suggestion-button embedded`,m),onClick:p(_),children:T(_)},_))})},b8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=rt();if(!r)return null;const o=()=>{ui(!1),El(!0)};return t?x.jsx(ci,{className:W(n,`${z}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:o,icon:x.jsx(B1,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-minimize-button`,`cim-${e}-component`),onClick:o,children:[x.jsx(B1,{}),"Minimize"]})},w_=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),r=hs(),o=()=>{yl("modal"),r()};return t?x.jsx(ci,{className:W(n,`${z}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:o,icon:x.jsx(QT,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-modal-button`,`cim-${e}-component`),onClick:o,children:[x.jsx(QT,{}),"Show modal"]})},T8=({isWidgetStandalone:e})=>{var _,w;const{globalClassName:t,entryMessage:n,resetConversationMessage:r,suggestionButtonConfig:o}=rt(),{askCimPrompts:a,messages:u}=ar(),{isLoading:c,handleSuggestion:d}=Ur(),f=o==null?void 0:o.icon,p=(_=o==null?void 0:o.iconPosition)!=null?_:"left",m=B.useMemo(()=>{const C=typeof n=="string"?n:"Hi! I'm your Cimulate Co-Pilot. Ask me anything — I can help you find products, compare items, discover trends, and more!";return u.some(P=>P.name==="conversation_reset")&&r||C},[u,n,r]),T=((w=a.message)==null?void 0:w.suggestions)||[],y=(C,A)=>()=>{d(C,A)};return x.jsxs("div",{className:W(t,`${z}-ask-cim-entry-message`,`${z}-message-group`,e?"standalone":"embedded"),children:[x.jsx("p",{className:W(t,`${z}-ask-cim-entry-text`),children:m}),!!(T!=null&&T.length)&&x.jsx("div",{className:W(t,`${z}-ask-cim-suggestions-container`,`${z}-suggestion-container`,e?"standalone":"embedded"),children:T.map(C=>{var A;return x.jsxs(Sl,{disabled:c,className:W(t,`${z}-ask-cim-suggestion-button`,`${z}-suggestion-button`,e?"standalone":"embedded",{"has-icon":!!f,"icon-right":!!f&&p==="right"}),onClick:y(C,((A=a.message)==null?void 0:A.eventSourceId)||""),children:[f&&x.jsx(_p,{icon:f,className:`${z}-suggestion-button-icon`}),x.jsx("span",{children:C.displayText})]},C.displayText)})})]})},_8=({isWidgetStandalone:e,product:t})=>{const{configModule:n,globalClassName:r,openLinksInNewTab:o}=rt();if(!n)return null;const a=n.getName(t),u=n.getBrand(t),c=n.getPriceDisplay(t),d=n.getRelativePdp(t),f=n.getPdp(t),p=n.getImage(t),m=d&&typeof d=="string"?new URL(d,window.location.origin).href:f;return x.jsxs("div",{className:W(r,`${z}-product-tile`,{embedded:!e,standalone:e}),children:[m?x.jsx("a",{href:`${m}`,target:o?"_blank":"_self",rel:"noopener noreferrer","aria-label":`Go to product page for ${a}`,children:x.jsx("img",{className:W(r,`${z}-product-tile-image`,{embedded:!e,standalone:e}),src:`${p}`,alt:`${a}`,loading:"lazy"})}):x.jsx("img",{className:W(r,`${z}-product-tile-image`,{embedded:!e,standalone:e}),src:`${p}`,alt:`${a}`,loading:"lazy"}),x.jsxs("div",{className:W(r,`${z}-product-tile-details`,{embedded:!e,standalone:e}),children:[x.jsxs("div",{className:W(r,`${z}-product-tile-content`),children:[u&&x.jsx("p",{className:`${z}-product-tile-brand`,children:u}),m?x.jsxs("a",{"aria-label":`Go to product page for ${a}`,className:W(r,`${z}-product-tile-pdp`),href:`${m}`,target:o?"_blank":"_self",rel:"noopener noreferrer",children:[a," ",x.jsx("span",{className:W(r,`${z}-product-tile-pdp-arrow`),children:"→"})]}):x.jsx("p",{className:W(r,`${z}-product-tile-name`),title:a,children:a})]}),x.jsx("div",{className:W(r,`${z}-product-tile-footer`),children:x.jsx("p",{className:W(r,`${z}-product-tile-price`),children:c})})]})]})},S8=({isWidgetStandalone:e,message:t})=>{const{configModule:n,globalClassName:r}=rt(),o=t;return n?x.jsxs("div",{className:W(r,`${z}-display-products`),children:[x.jsx("p",{children:o.message}),o.products&&o.products.length>0&&x.jsx(GM,{globalClassName:r,spacing:"0.5rem",ariaLabel:"Recommended products",children:o.products.map(a=>{const u=n.getPid(a);return x.jsx(_8,{isWidgetStandalone:e,product:a},`${u}`)})})]}):null},x8=({globalClassName:e,message:t,isWidgetStandalone:n})=>x.jsx("div",{className:W(e,`${z}-error-message`,{standalone:n,embedded:!n}),children:x.jsxs("p",{className:W(e,`${z}-error-message-text`,{standalone:n,embedded:!n}),children:[x.jsx(Xk,{})," ",t.message||"An error occurred while processing your request."]})}),w8=({globalClassName:e,entryType:t,message:n,isWidgetStandalone:r,handleSuggestionClick:o})=>{var _;const{isLoading:a}=Ur(),{messages:u}=ar(),c=u.find(w=>w.id===n.eventSourceId),d=!!c,f=((_=c==null?void 0:c.name)==null?void 0:_.replace("_suggestions",""))||"",p=d?AA(f):null,T=a||!d||!(d&&(p===t||t==="ask_cim")),y=w=>{const C=n.suggestions.find(A=>A.displayText===w);C&&o(C,n.eventSourceId||n.id)};return x.jsxs("div",{className:W(e,`${z}-follow-up`),children:[x.jsx("p",{className:W(e,`${z}-text`),children:n.message}),x.jsx(y8,{suggestions:n.suggestions.map(w=>w.displayText),disabled:T,isWidgetStandalone:r,onSuggestionClick:y,globalClassName:e})]})};function A_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function A8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function v8(e,t,n){const o=Rl((n||{}).ignore||[]),a=C8(t);let u=-1;for(;++u<a.length;)QE(e,"text",c);function c(f,p){let m=-1,T;for(;++m<p.length;){const y=p[m],_=T?T.children:void 0;if(o(y,_?_.indexOf(y):void 0,T))return;T=y}if(T)return d(f,p)}function d(f,p){const m=p[p.length-1],T=a[u][0],y=a[u][1];let _=0;const C=m.children.indexOf(f);let A=!1,P=[];T.lastIndex=0;let v=T.exec(f.value);for(;v;){const H=v.index,Y={index:v.index,input:v.input,stack:[...p,f]};let D=y(...v,Y);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?T.lastIndex=H+1:(_!==H&&P.push({type:"text",value:f.value.slice(_,H)}),Array.isArray(D)?P.push(...D):D&&P.push(D),_=H+v[0].length,A=!0),!T.global)break;v=T.exec(f.value)}return A?(_<f.value.length&&P.push({type:"text",value:f.value.slice(_)}),m.children.splice(C,1,...P)):P=[f],C+P.length}}function C8(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 o=n[r];t.push([k8(o[0]),P8(o[1])])}return t}function k8(e){return typeof e=="string"?new RegExp(A8(e),"g"):e}function P8(e){return typeof e=="function"?e:function(){return e}}const Sp="phrasing",xp=["autolink","link","image","label"];function N8(){return{transforms:[F8],enter:{literalAutolink:I8,literalAutolinkEmail:wp,literalAutolinkHttp:wp,literalAutolinkWww:wp},exit:{literalAutolink:M8,literalAutolinkEmail:D8,literalAutolinkHttp:R8,literalAutolinkWww:L8}}}function O8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:xp},{character:":",before:"[ps]",after:"\\/",inConstruct:Sp,notInConstruct:xp}]}}function I8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wp(e){this.config.enter.autolinkProtocol.call(this,e)}function R8(e){this.config.exit.autolinkProtocol.call(this,e)}function L8(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 D8(e){this.config.exit.autolinkEmail.call(this,e)}function M8(e){this.exit(e)}function F8(e){v8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,B8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),U8]],{ignore:["link","linkReference"]})}function B8(e,t,n,r,o){let a="";if(!v_(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!H8(n)))return!1;const u=z8(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function U8(e,t,n,r){return!v_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function H8(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 z8(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 o=A_(e,"(");let a=A_(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function v_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||co(n)||vl(n))&&(!t||n!==47)}C_.peek=K8;function j8(){this.buffer()}function $8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V8(){this.buffer()}function q8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Y8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W8(e){this.exit(e)}function G8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function X8(e){this.exit(e)}function K8(){return"["}function C_(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),u(),a+=o.move("]"),a}function Q8(){return{enter:{gfmFootnoteCallString:j8,gfmFootnoteCall:$8,gfmFootnoteDefinitionLabelString:V8,gfmFootnoteDefinition:q8},exit:{gfmFootnoteCallString:Y8,gfmFootnoteCall:W8,gfmFootnoteDefinitionLabelString:G8,gfmFootnoteDefinition:X8}}}function J8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:C_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,u){const c=a.createTracker(u);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
31
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ho={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/"},hy={}.hasOwnProperty,g3=Object.prototype;function E3(e,t){const n=t||{};return mh({file:n.file||void 0,location:!1,schema:n.space==="svg"?ts:xl,verbose:n.verbose||!1},e)}function mh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Fl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:py(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const a=String(e.file),u=m3(a),c=u.toPoint(0),d=u.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Fl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Fl(e,r,n),n}default:return n=y3(e,t),n}}function py(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=mh(e,t[n]);r.push(o)}return r}function y3(e,t){const n=e.schema;e.schema=t.namespaceURI===ho.svg?ts:xl;let r=-1;const o={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;hy.call(g3,d)||(o[d]=c.value)}const u=(e.schema.space==="svg"?p3:h3)(t.tagName,o,py(e,t.childNodes));if(Fl(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&ss(d.startTag),p=d&&d.endTag&&ss(d.endTag),m=mh(e,c.content);f&&p&&e.file&&(m.position={start:f.end,end:p.start}),u.content=m}return e.schema=n,u}function Fl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=b3(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function b3(e,t,n){const r=ss(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!n.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)hy.call(n.attrs,u)&&(a[Ff(e.schema,u).property]=ss(n.attrs[u]));n.startTag;const c=ss(n.startTag),d=n.endTag?ss(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function ss(e){const t=my({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=my({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function my(e){return e.line&&e.column?e:void 0}class Da{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Da.prototype.property={},Da.prototype.normal={},Da.prototype.space=null;function gy(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Da(n,r,t)}function gh(e){return e.toLowerCase()}class lr{constructor(t,n){this.property=t,this.attribute=n}}lr.prototype.space=null,lr.prototype.boolean=!1,lr.prototype.booleanish=!1,lr.prototype.overloadedBoolean=!1,lr.prototype.number=!1,lr.prototype.commaSeparated=!1,lr.prototype.spaceSeparated=!1,lr.prototype.commaOrSpaceSeparated=!1,lr.prototype.mustUseProperty=!1,lr.prototype.defined=!1;let T3=0;const Xe=po(),jt=po(),Ey=po(),be=po(),yt=po(),as=po(),Kn=po();function po(){return ia(2,++T3)}const Eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:jt,commaOrSpaceSeparated:Kn,commaSeparated:as,number:be,overloadedBoolean:Ey,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),yh=Object.keys(Eh);class bh extends lr{constructor(t,n,r,o){let a=-1;if(super(t,n),yy(this,"space",o),typeof r=="number")for(;++a<yh.length;){const u=yh[a];yy(this,yh[a],(r&Eh[u])===Eh[u])}}}bh.prototype.defined=!0;function yy(e,t,n){n&&(e[t]=n)}const _3={}.hasOwnProperty;function us(e){const t={},n={};let r;for(r in e.properties)if(_3.call(e.properties,r)){const o=e.properties[r],a=new bh(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[gh(r)]=r,n[gh(a.attribute)]=r}return new Da(t,n,e.space)}const by=us({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Ty=us({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function _y(e,t){return t in e?e[t]:t}function Sy(e,t){return _y(e,t.toLowerCase())}const xy=us({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Sy,properties:{xmlns:null,xmlnsXLink:null}}),wy=us({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:yt,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:be,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:yt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:jt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),S3=us({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Sy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:as,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:yt,autoFocus:Xe,autoPlay:Xe,blocking:yt,capture:null,charSet:null,checked:Xe,cite:null,className:yt,cols:be,colSpan:null,content:null,contentEditable:jt,controls:Xe,controlsList:yt,coords:be|as,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:Ey,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:yt,height:be,hidden:Xe,high:be,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:yt,itemRef:yt,itemScope:Xe,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:be,pattern:null,ping:yt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:yt,required:Xe,reversed:Xe,rows:be,rowSpan:be,sandbox:yt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:jt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:be,security:null,unselectable:null}}),x3=us({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:_y,properties:{about:Kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:as,g2:as,glyphName:as,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),w3=/^data[-\w.:]+$/i,Ay=/-[a-z]/g,A3=/[A-Z]/g;function v3(e,t){const n=gh(t);let r=t,o=lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&w3.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ay,k3);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ay.test(a)){let u=a.replace(A3,C3);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=bh}return new o(r,t)}function C3(e){return"-"+e.toLowerCase()}function k3(e){return e.charAt(1).toUpperCase()}const P3=gy([Ty,by,xy,wy,S3],"html"),vy=gy([Ty,by,xy,wy,x3],"svg"),Cy={}.hasOwnProperty;function ky(e,t){const n=t||{};function r(o,...a){let u=r.invalid;const c=r.handlers;if(o&&Cy.call(o,e)){const d=String(o[e]);u=Cy.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,o,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const N3={},O3={}.hasOwnProperty,Py=ky("type",{handlers:{root:R3,element:B3,text:M3,comment:F3,doctype:D3}});function I3(e,t){const r=(t||N3).space;return Py(e,r==="svg"?vy:P3)}function R3(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Th(e.children,n,t),ls(e,n),n}function L3(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Th(e.children,n,t),ls(e,n),n}function D3(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ls(e,t),t}function M3(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ls(e,t),t}function F3(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ls(e,t),t}function B3(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=vy);const o=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&O3.call(e.properties,a)){const d=U3(r,a,e.properties[a]);d&&o.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:ho[u],childNodes:[],parentNode:null};return c.childNodes=Th(e.children,c,r),ls(e,c),e.tagName==="template"&&e.content&&(c.content=L3(e.content,r)),c}function U3(e,t,n){const r=v3(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?j1(n):tE(n));const o={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=o.name.indexOf(":");a<0?o.prefix="":(o.name=o.name.slice(a+1),o.prefix=r.attribute.slice(0,a)),o.namespace=ho[r.space]}return o}function Th(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const a=Py(e[r],n);a.parentNode=t,o.push(a)}return o}function ls(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 H3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],z3=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]),At="�";var N;(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"})(N||(N={}));const Bn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ny(e){return e>=55296&&e<=57343}function j3(e){return e>=56320&&e<=57343}function $3(e,t){return(e-55296)*1024+9216+t}function Oy(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Iy(e){return e>=64976&&e<=65007||z3.has(e)}var te;(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"})(te||(te={}));const V3=65536;class q3{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=V3,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:o,offset:a}=this,u=o+n,c=a+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(j3(n))return this.pos++,this._addGap(),$3(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(te.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,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.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,N.EOF;let t=this.html.charCodeAt(this.pos);return t===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):t===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ny(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===N.LINE_FEED||t===N.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Oy(t)?this._err(te.controlCharacterInInputStream):Iy(t)&&this._err(te.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Qe;(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"})(Qe||(Qe={}));function Ry(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 Y3=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))),W3=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 G3(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=W3.get(e))!==null&&t!==void 0?t:e}var Jt;(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"})(Jt||(Jt={}));const X3=32;var Ni;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ni||(Ni={}));function _h(e){return e>=Jt.ZERO&&e<=Jt.NINE}function K3(e){return e>=Jt.UPPER_A&&e<=Jt.UPPER_F||e>=Jt.LOWER_A&&e<=Jt.LOWER_F}function Q3(e){return e>=Jt.UPPER_A&&e<=Jt.UPPER_Z||e>=Jt.LOWER_A&&e<=Jt.LOWER_Z||_h(e)}function J3(e){return e===Jt.EQUALS||Q3(e)}var Zt;(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"})(Zt||(Zt={}));var di;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(di||(di={}));class Z3{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Zt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=di.Strict}startEntity(t){this.decodeMode=t,this.state=Zt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Zt.EntityStart:return t.charCodeAt(n)===Jt.NUM?(this.state=Zt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Zt.NamedEntity,this.stateNamedEntity(t,n));case Zt.NumericStart:return this.stateNumericStart(t,n);case Zt.NumericDecimal:return this.stateNumericDecimal(t,n);case Zt.NumericHex:return this.stateNumericHex(t,n);case Zt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|X3)===Jt.LOWER_X?(this.state=Zt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Zt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,o){if(n!==r){const a=r-n;this.result=this.result*Math.pow(o,a)+Number.parseInt(t.substr(n,a),o),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(_h(o)||K3(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(_h(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,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===Jt.SEMI)this.consumed+=1;else if(this.decodeMode===di.Strict)return 0;return this.emitCodePoint(G3(this.result),this.consumed),this.errors&&(t!==Jt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],a=(o&Ni.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=eR(r,o,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===di.Attribute&&(a===0||J3(u))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],a=(o&Ni.VALUE_LENGTH)>>14,a!==0){if(u===Jt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==di.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,o=(r[n]&Ni.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Ni.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case Zt.NamedEntity:return this.result!==0&&(this.decodeMode!==di.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Zt.NumericDecimal:return this.emitNumericEntity(0,2);case Zt.NumericHex:return this.emitNumericEntity(0,3);case Zt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zt.EntityStart:return 0}}}function eR(e,t,n,r){const o=(t&Ni.BRANCH_LENGTH)>>7,a=t&Ni.JUMP_TABLE;if(o===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=o?-1:e[n+d]-1}let u=n,c=u+o-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+o]}return-1}var ue;(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/"})(ue||(ue={}));var mo;(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"})(mo||(mo={}));var cr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(cr||(cr={}));var X;(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"})(X||(X={}));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 tR=new Map([[X.A,g.A],[X.ADDRESS,g.ADDRESS],[X.ANNOTATION_XML,g.ANNOTATION_XML],[X.APPLET,g.APPLET],[X.AREA,g.AREA],[X.ARTICLE,g.ARTICLE],[X.ASIDE,g.ASIDE],[X.B,g.B],[X.BASE,g.BASE],[X.BASEFONT,g.BASEFONT],[X.BGSOUND,g.BGSOUND],[X.BIG,g.BIG],[X.BLOCKQUOTE,g.BLOCKQUOTE],[X.BODY,g.BODY],[X.BR,g.BR],[X.BUTTON,g.BUTTON],[X.CAPTION,g.CAPTION],[X.CENTER,g.CENTER],[X.CODE,g.CODE],[X.COL,g.COL],[X.COLGROUP,g.COLGROUP],[X.DD,g.DD],[X.DESC,g.DESC],[X.DETAILS,g.DETAILS],[X.DIALOG,g.DIALOG],[X.DIR,g.DIR],[X.DIV,g.DIV],[X.DL,g.DL],[X.DT,g.DT],[X.EM,g.EM],[X.EMBED,g.EMBED],[X.FIELDSET,g.FIELDSET],[X.FIGCAPTION,g.FIGCAPTION],[X.FIGURE,g.FIGURE],[X.FONT,g.FONT],[X.FOOTER,g.FOOTER],[X.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[X.FORM,g.FORM],[X.FRAME,g.FRAME],[X.FRAMESET,g.FRAMESET],[X.H1,g.H1],[X.H2,g.H2],[X.H3,g.H3],[X.H4,g.H4],[X.H5,g.H5],[X.H6,g.H6],[X.HEAD,g.HEAD],[X.HEADER,g.HEADER],[X.HGROUP,g.HGROUP],[X.HR,g.HR],[X.HTML,g.HTML],[X.I,g.I],[X.IMG,g.IMG],[X.IMAGE,g.IMAGE],[X.INPUT,g.INPUT],[X.IFRAME,g.IFRAME],[X.KEYGEN,g.KEYGEN],[X.LABEL,g.LABEL],[X.LI,g.LI],[X.LINK,g.LINK],[X.LISTING,g.LISTING],[X.MAIN,g.MAIN],[X.MALIGNMARK,g.MALIGNMARK],[X.MARQUEE,g.MARQUEE],[X.MATH,g.MATH],[X.MENU,g.MENU],[X.META,g.META],[X.MGLYPH,g.MGLYPH],[X.MI,g.MI],[X.MO,g.MO],[X.MN,g.MN],[X.MS,g.MS],[X.MTEXT,g.MTEXT],[X.NAV,g.NAV],[X.NOBR,g.NOBR],[X.NOFRAMES,g.NOFRAMES],[X.NOEMBED,g.NOEMBED],[X.NOSCRIPT,g.NOSCRIPT],[X.OBJECT,g.OBJECT],[X.OL,g.OL],[X.OPTGROUP,g.OPTGROUP],[X.OPTION,g.OPTION],[X.P,g.P],[X.PARAM,g.PARAM],[X.PLAINTEXT,g.PLAINTEXT],[X.PRE,g.PRE],[X.RB,g.RB],[X.RP,g.RP],[X.RT,g.RT],[X.RTC,g.RTC],[X.RUBY,g.RUBY],[X.S,g.S],[X.SCRIPT,g.SCRIPT],[X.SEARCH,g.SEARCH],[X.SECTION,g.SECTION],[X.SELECT,g.SELECT],[X.SOURCE,g.SOURCE],[X.SMALL,g.SMALL],[X.SPAN,g.SPAN],[X.STRIKE,g.STRIKE],[X.STRONG,g.STRONG],[X.STYLE,g.STYLE],[X.SUB,g.SUB],[X.SUMMARY,g.SUMMARY],[X.SUP,g.SUP],[X.TABLE,g.TABLE],[X.TBODY,g.TBODY],[X.TEMPLATE,g.TEMPLATE],[X.TEXTAREA,g.TEXTAREA],[X.TFOOT,g.TFOOT],[X.TD,g.TD],[X.TH,g.TH],[X.THEAD,g.THEAD],[X.TITLE,g.TITLE],[X.TR,g.TR],[X.TRACK,g.TRACK],[X.TT,g.TT],[X.U,g.U],[X.UL,g.UL],[X.SVG,g.SVG],[X.VAR,g.VAR],[X.WBR,g.WBR],[X.XMP,g.XMP]]);function cs(e){var t;return(t=tR.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const fe=g,nR={[ue.HTML]:new Set([fe.ADDRESS,fe.APPLET,fe.AREA,fe.ARTICLE,fe.ASIDE,fe.BASE,fe.BASEFONT,fe.BGSOUND,fe.BLOCKQUOTE,fe.BODY,fe.BR,fe.BUTTON,fe.CAPTION,fe.CENTER,fe.COL,fe.COLGROUP,fe.DD,fe.DETAILS,fe.DIR,fe.DIV,fe.DL,fe.DT,fe.EMBED,fe.FIELDSET,fe.FIGCAPTION,fe.FIGURE,fe.FOOTER,fe.FORM,fe.FRAME,fe.FRAMESET,fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6,fe.HEAD,fe.HEADER,fe.HGROUP,fe.HR,fe.HTML,fe.IFRAME,fe.IMG,fe.INPUT,fe.LI,fe.LINK,fe.LISTING,fe.MAIN,fe.MARQUEE,fe.MENU,fe.META,fe.NAV,fe.NOEMBED,fe.NOFRAMES,fe.NOSCRIPT,fe.OBJECT,fe.OL,fe.P,fe.PARAM,fe.PLAINTEXT,fe.PRE,fe.SCRIPT,fe.SECTION,fe.SELECT,fe.SOURCE,fe.STYLE,fe.SUMMARY,fe.TABLE,fe.TBODY,fe.TD,fe.TEMPLATE,fe.TEXTAREA,fe.TFOOT,fe.TH,fe.THEAD,fe.TITLE,fe.TR,fe.TRACK,fe.UL,fe.WBR,fe.XMP]),[ue.MATHML]:new Set([fe.MI,fe.MO,fe.MN,fe.MS,fe.MTEXT,fe.ANNOTATION_XML]),[ue.SVG]:new Set([fe.TITLE,fe.FOREIGN_OBJECT,fe.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Sh=new Set([fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6]);X.STYLE,X.SCRIPT,X.XMP,X.IFRAME,X.NOEMBED,X.NOFRAMES,X.PLAINTEXT;var O;(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"})(O||(O={}));const Dt={DATA:O.DATA,RCDATA:O.RCDATA,RAWTEXT:O.RAWTEXT,SCRIPT_DATA:O.SCRIPT_DATA,PLAINTEXT:O.PLAINTEXT,CDATA_SECTION:O.CDATA_SECTION};function rR(e){return e>=N.DIGIT_0&&e<=N.DIGIT_9}function Ma(e){return e>=N.LATIN_CAPITAL_A&&e<=N.LATIN_CAPITAL_Z}function iR(e){return e>=N.LATIN_SMALL_A&&e<=N.LATIN_SMALL_Z}function Oi(e){return iR(e)||Ma(e)}function Ly(e){return Oi(e)||rR(e)}function Bl(e){return e+32}function Dy(e){return e===N.SPACE||e===N.LINE_FEED||e===N.TABULATION||e===N.FORM_FEED}function My(e){return Dy(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN}function oR(e){return e===N.NULL?te.nullCharacterReference:e>1114111?te.characterReferenceOutsideUnicodeRange:Ny(e)?te.surrogateCharacterReference:Iy(e)?te.noncharacterCharacterReference:Oy(e)||e===N.CARRIAGE_RETURN?te.controlCharacterReference:null}class sR{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=O.DATA,this.returnState=O.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new q3(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Z3(Y3,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=oR(r);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.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:Qe.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Qe.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Qe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Qe.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(Ry(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(te.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=cs(t.tagName),t.type===Qe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(te.endTagWithAttributes),t.selfClosing&&this._err(te.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 Qe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Qe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Qe.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:Qe.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=Dy(t)?Qe.WHITESPACE_CHARACTER:t===N.NULL?Qe.NULL_CHARACTER:Qe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Qe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=O.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?di.Attribute:di.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===O.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===O.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===O.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case O.DATA:{this._stateData(t);break}case O.RCDATA:{this._stateRcdata(t);break}case O.RAWTEXT:{this._stateRawtext(t);break}case O.SCRIPT_DATA:{this._stateScriptData(t);break}case O.PLAINTEXT:{this._statePlaintext(t);break}case O.TAG_OPEN:{this._stateTagOpen(t);break}case O.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case O.TAG_NAME:{this._stateTagName(t);break}case O.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case O.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case O.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case O.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case O.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case O.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case O.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case O.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case O.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case O.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case O.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case O.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case O.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case O.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case O.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case O.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case O.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case O.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case O.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case O.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case O.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case O.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case O.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case O.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case O.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case O.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case O.BOGUS_COMMENT:{this._stateBogusComment(t);break}case O.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case O.COMMENT_START:{this._stateCommentStart(t);break}case O.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case O.COMMENT:{this._stateComment(t);break}case O.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case O.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case O.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case O.COMMENT_END:{this._stateCommentEnd(t);break}case O.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case O.DOCTYPE:{this._stateDoctype(t);break}case O.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case O.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case O.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case O.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case O.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case O.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case O.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case O.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case O.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case O.CDATA_SECTION:{this._stateCdataSection(t);break}case O.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case O.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case O.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case O.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(t);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=O.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Oi(t))this._createStartTagToken(),this.state=O.TAG_NAME,this._stateTagName(t);else switch(t){case N.EXCLAMATION_MARK:{this.state=O.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=O.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t);break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=O.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Oi(t))this._createEndTagToken(),this.state=O.TAG_NAME,this._stateTagName(t);else switch(t){case N.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=O.DATA;break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=O.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateRcdataLessThanSign(t){t===N.SOLIDUS?this.state=O.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=O.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Oi(t)?(this.state=O.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=O.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=O.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=O.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=O.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===N.SOLIDUS?this.state=O.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Oi(t)?(this.state=O.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case N.SOLIDUS:{this.state=O.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=O.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=O.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Oi(t)?(this.state=O.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===N.HYPHEN_MINUS?(this.state=O.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===N.HYPHEN_MINUS?(this.state=O.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=O.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=O.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===N.SOLIDUS?this.state=O.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Oi(t)?(this._emitChars("<"),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Oi(t)?(this.state=O.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&My(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=O.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=O.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===N.SOLIDUS?(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&My(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=O.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=O.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=O.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=O.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=O.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=O.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=O.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=At;break}default:this.currentAttr.name+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateAfterAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=O.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=O.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=O.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=O.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=O.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=O.DATA,this.emitCurrentTagToken();break}default:this.state=O.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case N.APOSTROPHE:{this.state=O.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=O.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=At;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=O.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=O.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=O.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=O.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=O.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=At;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Bn.DASH_DASH,!0)?(this._createCommentToken(Bn.DASH_DASH.length+1),this.state=O.COMMENT_START):this._consumeSequenceIfMatch(Bn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bn.DOCTYPE.length+1),this.state=O.DOCTYPE):this._consumeSequenceIfMatch(Bn.CDATA_START,!0)?this.inForeignNode?this.state=O.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(Bn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=O.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=O.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=O.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=O.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=O.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=O.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=At;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case N.EXCLAMATION_MARK:{n.data+="!",this.state=O.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=O.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===N.HYPHEN_MINUS?this.state=O.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=O.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===N.HYPHEN_MINUS?this.state=O.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=O.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==N.GREATER_THAN_SIGN&&t!==N.EOF&&this._err(te.nestedComment),this.state=O.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=O.COMMENT_END;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=O.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=O.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=O.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{n.data+="--!",this.state=O.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=O.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=O.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=O.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case N.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=O.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ma(t))this._createDoctypeToken(String.fromCharCode(Bl(t))),this.state=O.DOCTYPE_NAME;else switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(At),this.state=O.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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=O.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.name+=At;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ma(t)?Bl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bn.PUBLIC,!1)?this.state=O.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bn.SYSTEM,!1)?this.state=O.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=O.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=O.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=O.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=O.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=O.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=At;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=O.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=O.DATA;break}case N.NULL:{this._err(te.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case N.RIGHT_SQUARE_BRACKET:{this.state=O.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===N.RIGHT_SQUARE_BRACKET?this.state=O.CDATA_SECTION_END:(this._emitChars("]"),this.state=O.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case N.GREATER_THAN_SIGN:{this.state=O.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=O.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(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ly(this.preprocessor.peek(1))?O.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ly(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===N.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Fy=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),By=new Set([...Fy,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),Ul=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),aR=new Set([...Ul,g.OL,g.UL]),uR=new Set([...Ul,g.BUTTON]),Uy=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Hy=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),lR=new Set([g.TR,g.TEMPLATE,g.HTML]),cR=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),dR=new Set([g.TABLE,g.TEMPLATE,g.HTML]),fR=new Set([g.TD,g.TH]);class hR{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)===ue.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 o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===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])!==ue.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(Sh,ue.HTML)}popUntilTableCellPopped(){this.popUntilPopped(fR,ue.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(dR,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(cR,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(lR,ue.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 o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case ue.SVG:{if(Hy.has(o))return!1;break}case ue.MATHML:{if(Uy.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ul)}hasInListItemScope(t){return this.hasInDynamicScope(t,aR)}hasInButtonScope(t){return this.hasInDynamicScope(t,uR)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ue.HTML:{if(Sh.has(n))return!0;if(Ul.has(n))return!1;break}case ue.SVG:{if(Hy.has(n))return!1;break}case ue.MATHML:{if(Uy.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.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])===ue.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])===ue.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&&Fy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&By.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&By.has(this.currentTagId);)this.pop()}}const xh=3;var jr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(jr||(jr={}));const zy={type:jr.Marker};class pR{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,a=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===jr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const p=this.treeAdapter.getAttrList(f);p.length===o&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<xh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<xh)return;const o=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>o.get(d.name)===d.value)&&(a+=1,a>=xh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(zy)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:jr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:jr.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(zy);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===jr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===jr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===jr.Element&&n.element===t)}}const Ii={createDocument(){return{nodeName:"#document",mode:cr.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 o=e.childNodes.find(a=>a.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ii.appendChild(e,a)}},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(Ii.isTextNode(n)){n.value+=t;return}}Ii.appendChild(e,Ii.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ii.isTextNode(r)?r.value+=t:Ii.insertBefore(e,Ii.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=F(F({},e.sourceCodeLocation),t)}},jy="html",mR="about:legacy-compat",gR="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",$y=["+//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//"],ER=[...$y,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],yR=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Vy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],bR=[...Vy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function qy(e,t){return t.some(n=>e.startsWith(n))}function TR(e){return e.name===jy&&e.publicId===null&&(e.systemId===null||e.systemId===mR)}function _R(e){if(e.name!==jy)return cr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===gR)return cr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),yR.has(n))return cr.QUIRKS;let r=t===null?ER:$y;if(qy(n,r))return cr.QUIRKS;if(r=t===null?Vy:bR,qy(n,r))return cr.LIMITED_QUIRKS}return cr.NO_QUIRKS}const Yy={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},SR="definitionurl",xR="definitionURL",wR=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])),AR=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),vR=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])),CR=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 kR(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===mo.COLOR||r===mo.SIZE||r===mo.FACE)||CR.has(t)}function Wy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===SR){e.attrs[t].name=xR;break}}function Gy(e){for(let t=0;t<e.attrs.length;t++){const n=wR.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function wh(e){for(let t=0;t<e.attrs.length;t++){const n=AR.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 PR(e){const t=vR.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=cs(e.tagName))}function NR(e,t){return t===ue.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function OR(e,t,n){if(t===ue.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===mo.ENCODING){const o=n[r].value.toLowerCase();return o===Yy.TEXT_HTML||o===Yy.APPLICATION_XML}}return t===ue.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function IR(e,t,n,r){return(!r||r===ue.HTML)&&OR(e,t,n)||(!r||r===ue.MATHML)&&NR(e,t)}const RR="hidden",LR=8,DR=3;var M;(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"})(M||(M={}));const MR={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Xy=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Ky={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ii,onParseError:null};class Qy{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=M.INITIAL,this.originalInsertionMode=M.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=F(F({},Ky),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 sR(this.options,this),this.activeFormattingElements=new pR(this.treeAdapter),this.fragmentContextID=r?cs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new hR(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=F(F({},Ky),n);t!=null||(t=r.treeAdapter.createElement(X.TEMPLATE,ue.HTML,[]));const o=r.treeAdapter.createElement("documentmock",ue.HTML,[]),a=new this(r,o,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(M.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var o;if(!this.onParseError)return;const a=(o=t.location)!==null&&o!==void 0?o:MR,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var o,a;(a=(o=this.treeAdapter).onItemPush)===null||a===void 0||a.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=M.TEXT}switchToPlaintextParsing(){this.insertionMode=M.TEXT,this.originalInsertionMode=M.IN_BODY,this.tokenizer.state=Dt.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)===X.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Dt.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Dt.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Dt.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Dt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,o),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&&pe(F({},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,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ue.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(X.HTML,ue.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 o=this.treeAdapter.getChildNodes(n),a=r?o.lastIndexOf(r):o.length,u=o[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:p})}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,o=this.treeAdapter.getTagName(t),a=n.type===Qe.END_TAG&&o===n.tagName?{endTag:F({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}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)===X.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(t){switch(t.type){case Qe.CHARACTER:{this.onCharacter(t);break}case Qe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Qe.COMMENT:{this.onComment(t);break}case Qe.DOCTYPE:{this.onDoctype(t);break}case Qe.START_TAG:{this._processStartTag(t);break}case Qe.END_TAG:{this.onEndTag(t);break}case Qe.EOF:{this.onEof(t);break}case Qe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return IR(t,o,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===jr.Marker||this.openElements.contains(o.element)),r=n===-1?t-1:n-1;for(let o=r;o>=0;o--){const a=this.activeFormattingElements.entries[o];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=M.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=M.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=M.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=M.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=M.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=M.IN_TABLE;return}case g.BODY:{this.insertionMode=M.IN_BODY;return}case g.FRAMESET:{this.insertionMode=M.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?M.AFTER_HEAD:M.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=M.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=M.IN_HEAD;return}break}}this.insertionMode=M.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=M.IN_SELECT_IN_TABLE;return}}this.insertionMode=M.IN_SELECT}_isElementCausesFosterParenting(t){return Xy.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)===ue.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 nR[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){f6(this,t);return}switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:{Zy(this,t);break}case M.TEXT:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_TABLE_TEXT:{ab(this,t);break}case M.IN_COLUMN_GROUP:{jl(this,t);break}case M.AFTER_BODY:{ql(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){d6(this,t);return}switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.TEXT:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_COLUMN_GROUP:{jl(this,t);break}case M.AFTER_BODY:{ql(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){vh(this,t);return}switch(this.insertionMode){case M.INITIAL:case M.BEFORE_HTML:case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_TEMPLATE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{vh(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.AFTER_BODY:{$R(this,t);break}case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{VR(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case M.INITIAL:{qR(this,t);break}case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:{this._err(t,te.misplacedDoctype);break}case M.IN_TABLE_TEXT:{qa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?h6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{YR(this,t);break}case M.BEFORE_HEAD:{GR(this,t);break}case M.IN_HEAD:{xr(this,t);break}case M.IN_HEAD_NO_SCRIPT:{QR(this,t);break}case M.AFTER_HEAD:{ZR(this,t);break}case M.IN_BODY:{_n(this,t);break}case M.IN_TABLE:{ds(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_CAPTION:{XL(this,t);break}case M.IN_COLUMN_GROUP:{Ph(this,t);break}case M.IN_TABLE_BODY:{$l(this,t);break}case M.IN_ROW:{Vl(this,t);break}case M.IN_CELL:{JL(this,t);break}case M.IN_SELECT:{cb(this,t);break}case M.IN_SELECT_IN_TABLE:{e6(this,t);break}case M.IN_TEMPLATE:{n6(this,t);break}case M.AFTER_BODY:{i6(this,t);break}case M.IN_FRAMESET:{o6(this,t);break}case M.AFTER_FRAMESET:{a6(this,t);break}case M.AFTER_AFTER_BODY:{l6(this,t);break}case M.AFTER_AFTER_FRAMESET:{c6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?p6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{WR(this,t);break}case M.BEFORE_HEAD:{XR(this,t);break}case M.IN_HEAD:{KR(this,t);break}case M.IN_HEAD_NO_SCRIPT:{JR(this,t);break}case M.AFTER_HEAD:{eL(this,t);break}case M.IN_BODY:{zl(this,t);break}case M.TEXT:{UL(this,t);break}case M.IN_TABLE:{$a(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_CAPTION:{KL(this,t);break}case M.IN_COLUMN_GROUP:{QL(this,t);break}case M.IN_TABLE_BODY:{Nh(this,t);break}case M.IN_ROW:{lb(this,t);break}case M.IN_CELL:{ZL(this,t);break}case M.IN_SELECT:{db(this,t);break}case M.IN_SELECT_IN_TABLE:{t6(this,t);break}case M.IN_TEMPLATE:{r6(this,t);break}case M.AFTER_BODY:{hb(this,t);break}case M.IN_FRAMESET:{s6(this,t);break}case M.AFTER_FRAMESET:{u6(this,t);break}case M.AFTER_AFTER_BODY:{Yl(this,t);break}}}onEof(t){switch(this.insertionMode){case M.INITIAL:{Fa(this,t);break}case M.BEFORE_HTML:{Ba(this,t);break}case M.BEFORE_HEAD:{Ua(this,t);break}case M.IN_HEAD:{Ha(this,t);break}case M.IN_HEAD_NO_SCRIPT:{za(this,t);break}case M.AFTER_HEAD:{ja(this,t);break}case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{ob(this,t);break}case M.TEXT:{HL(this,t);break}case M.IN_TABLE_TEXT:{qa(this,t);break}case M.IN_TEMPLATE:{fb(this,t);break}case M.AFTER_BODY:case M.IN_FRAMESET:case M.AFTER_FRAMESET:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===N.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 M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.TEXT:case M.IN_COLUMN_GROUP:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{this._insertCharacters(t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:case M.AFTER_BODY:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Jy(this,t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{kh(this,t);break}case M.IN_TABLE_TEXT:{sb(this,t);break}}}}function FR(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):ib(e,t),n}function BR(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function UR(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let a=0,u=o;u!==n;a++,u=o){o=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&a>=DR;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=HR(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function HR(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 zR(e,t,n){const r=e.treeAdapter.getTagName(t),o=cs(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);o===g.TEMPLATE&&a===ue.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function jR(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,a=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,o.tagID)}function Ah(e,t){for(let n=0;n<LR;n++){const r=FR(e,t);if(!r)break;const o=BR(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const a=UR(e,o,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&zR(e,u,a),jR(e,o,r)}}function vh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function $R(e,t){e._appendCommentNode(t,e.openElements.items[0])}function VR(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],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function qR(e,t){e._setDocumentType(t);const n=t.forceQuirks?cr.QUIRKS:_R(t);TR(t)||e._err(t,te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=M.BEFORE_HTML}function Fa(e,t){e._err(t,te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,cr.QUIRKS),e.insertionMode=M.BEFORE_HTML,e._processToken(t)}function YR(e,t){t.tagID===g.HTML?(e._insertElement(t,ue.HTML),e.insertionMode=M.BEFORE_HEAD):Ba(e,t)}function WR(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Ba(e,t)}function Ba(e,t){e._insertFakeRootElement(),e.insertionMode=M.BEFORE_HEAD,e._processToken(t)}function GR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.HEAD:{e._insertElement(t,ue.HTML),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD;break}default:Ua(e,t)}}function XR(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Ua(e,t):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ua(e,t){e._insertFakeElement(X.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD,e._processToken(t)}function xr(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Dt.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Dt.RAWTEXT):(e._insertElement(t,ue.HTML),e.insertionMode=M.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Dt.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Dt.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=M.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(M.IN_TEMPLATE);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:Ha(e,t)}}function KR(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=M.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ha(e,t);break}case g.TEMPLATE:{go(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function go(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ha(e,t){e.openElements.pop(),e.insertionMode=M.AFTER_HEAD,e._processToken(t)}function QR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{xr(e,t);break}case g.NOSCRIPT:{e._err(t,te.nestedNoscriptInHead);break}default:za(e,t)}}function JR(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=M.IN_HEAD;break}case g.BR:{za(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function za(e,t){const n=t.type===Qe.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=M.IN_HEAD,e._processToken(t)}function ZR(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.BODY:{e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=M.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,ue.HTML),e.insertionMode=M.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,te.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),xr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:ja(e,t)}}function eL(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{ja(e,t);break}case g.TEMPLATE:{go(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function ja(e,t){e._insertFakeElement(X.BODY,g.BODY),e.insertionMode=M.IN_BODY,Hl(e,t)}function Hl(e,t){switch(t.type){case Qe.CHARACTER:{Zy(e,t);break}case Qe.WHITESPACE_CHARACTER:{Jy(e,t);break}case Qe.COMMENT:{vh(e,t);break}case Qe.START_TAG:{_n(e,t);break}case Qe.END_TAG:{zl(e,t);break}case Qe.EOF:{ob(e,t);break}}}function Jy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Zy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function tL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function nL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function rL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_FRAMESET)}function iL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function oL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Sh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ue.HTML)}function sL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function aL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),n||(e.formElement=e.openElements.current))}function uL(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(n===g.LI&&o===g.LI||(n===g.DD||n===g.DT)&&(o===g.DD||o===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==g.ADDRESS&&o!==g.DIV&&o!==g.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function lL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.tokenizer.state=Dt.PLAINTEXT}function cL(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1}function dL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(X.A);n&&(Ah(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function hL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(Ah(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function mL(e,t){e.treeAdapter.getDocumentMode(e.document)!==cr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=M.IN_TABLE}function eb(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function tb(e){const t=Ry(e,mo.TYPE);return t!=null&&t.toLowerCase()===RR}function gL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),tb(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function EL(e,t){e._appendElement(t,ue.HTML),t.ackSelfClosing=!0}function yL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function bL(e,t){t.tagName=X.IMG,t.tagID=g.IMG,eb(e,t)}function TL(e,t){e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Dt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=M.TEXT}function _L(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Dt.RAWTEXT)}function SL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Dt.RAWTEXT)}function nb(e,t){e._switchToTextParsing(t,Dt.RAWTEXT)}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===M.IN_TABLE||e.insertionMode===M.IN_CAPTION||e.insertionMode===M.IN_TABLE_BODY||e.insertionMode===M.IN_ROW||e.insertionMode===M.IN_CELL?M.IN_SELECT_IN_TABLE:M.IN_SELECT}function wL(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function AL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ue.HTML)}function vL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,ue.HTML)}function CL(e,t){e._reconstructActiveFormattingElements(),Wy(t),wh(t),t.selfClosing?e._appendElement(t,ue.MATHML):e._insertElement(t,ue.MATHML),t.ackSelfClosing=!0}function kL(e,t){e._reconstructActiveFormattingElements(),Gy(t),wh(t),t.selfClosing?e._appendElement(t,ue.SVG):e._insertElement(t,ue.SVG),t.ackSelfClosing=!0}function rb(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function _n(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:{fL(e,t);break}case g.A:{dL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{oL(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:{iL(e,t);break}case g.LI:case g.DD:case g.DT:{uL(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{eb(e,t);break}case g.HR:{yL(e,t);break}case g.RB:case g.RTC:{AL(e,t);break}case g.RT:case g.RP:{vL(e,t);break}case g.PRE:case g.LISTING:{sL(e,t);break}case g.XMP:{_L(e,t);break}case g.SVG:{kL(e,t);break}case g.HTML:{tL(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:{xr(e,t);break}case g.BODY:{nL(e,t);break}case g.FORM:{aL(e,t);break}case g.NOBR:{hL(e,t);break}case g.MATH:{CL(e,t);break}case g.TABLE:{mL(e,t);break}case g.INPUT:{gL(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{EL(e,t);break}case g.IMAGE:{bL(e,t);break}case g.BUTTON:{cL(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{pL(e,t);break}case g.IFRAME:{SL(e,t);break}case g.SELECT:{xL(e,t);break}case g.OPTION:case g.OPTGROUP:{wL(e,t);break}case g.NOEMBED:case g.NOFRAMES:{nb(e,t);break}case g.FRAMESET:{rL(e,t);break}case g.TEXTAREA:{TL(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?nb(e,t):rb(e,t);break}case g.PLAINTEXT:{lL(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:rb(e,t)}}function PL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function NL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,hb(e,t))}function OL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function IL(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 RL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(X.P,g.P),e._closePElement()}function LL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function DL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function ML(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function FL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function BL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(X.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function ib(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const a=e.openElements.items[o],u=e.openElements.tagIDs[o];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(a,u))break}}function zl(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:{RL(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:{OL(e,t);break}case g.LI:{LL(e);break}case g.DD:case g.DT:{DL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{ML(e);break}case g.BR:{BL(e);break}case g.BODY:{PL(e,t);break}case g.HTML:{NL(e,t);break}case g.FORM:{IL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{FL(e,t);break}case g.TEMPLATE:{go(e,t);break}default:ib(e,t)}}function ob(e,t){e.tmplInsertionModeStack.length>0?fb(e,t):Ch(e,t)}function UL(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 HL(e,t){e._err(t,te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function kh(e,t){if(e.openElements.currentTagId!==void 0&&Xy.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=M.IN_TABLE_TEXT,t.type){case Qe.CHARACTER:{ab(e,t);break}case Qe.WHITESPACE_CHARACTER:{sb(e,t);break}}else Va(e,t)}function zL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_CAPTION}function jL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_COLUMN_GROUP}function $L(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.COLGROUP,g.COLGROUP),e.insertionMode=M.IN_COLUMN_GROUP,Ph(e,t)}function VL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_TABLE_BODY}function qL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.TBODY,g.TBODY),e.insertionMode=M.IN_TABLE_BODY,$l(e,t)}function YL(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function WL(e,t){tb(t)?e._appendElement(t,ue.HTML):Va(e,t),t.ackSelfClosing=!0}function GL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ue.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ds(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{qL(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{xr(e,t);break}case g.COL:{$L(e,t);break}case g.FORM:{GL(e,t);break}case g.TABLE:{YL(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{VL(e,t);break}case g.INPUT:{WL(e,t);break}case g.CAPTION:{zL(e,t);break}case g.COLGROUP:{jL(e,t);break}default:Va(e,t)}}function $a(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{go(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:Va(e,t)}}function Va(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Hl(e,t),e.fosterParentingEnabled=n}function sb(e,t){e.pendingCharacterTokens.push(t)}function ab(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function qa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Va(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const ub=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function XL(e,t){const n=t.tagID;ub.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=M.IN_TABLE,ds(e,t)):_n(e,t)}function KL(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=M.IN_TABLE,n===g.TABLE&&$a(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:zl(e,t)}}function Ph(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.COL:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{xr(e,t);break}default:jl(e,t)}}function QL(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE);break}case g.TEMPLATE:{go(e,t);break}case g.COL:break;default:jl(e,t)}}function jl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE,e._processToken(t))}function $l(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(X.TR,g.TR),e.insertionMode=M.IN_ROW,Vl(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=M.IN_TABLE,ds(e,t));break}default:ds(e,t)}}function Nh(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=M.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE,$a(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:$a(e,t)}}function Vl(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ue.HTML),e.insertionMode=M.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=M.IN_TABLE_BODY,$l(e,t));break}default:ds(e,t)}}function lb(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY,Nh(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=M.IN_TABLE_BODY,Nh(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:$a(e,t)}}function JL(e,t){const n=t.tagID;ub.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Vl(e,t)):_n(e,t)}function ZL(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=M.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),lb(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:zl(e,t)}}function cb(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,ue.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ue.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ue.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:{xr(e,t);break}}}function db(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:{go(e,t);break}}}function e6(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)):cb(e,t)}function t6(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)):db(e,t)}function n6(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:{xr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=M.IN_TABLE,e.insertionMode=M.IN_TABLE,ds(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=M.IN_COLUMN_GROUP,e.insertionMode=M.IN_COLUMN_GROUP,Ph(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=M.IN_TABLE_BODY,e.insertionMode=M.IN_TABLE_BODY,$l(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=M.IN_ROW,e.insertionMode=M.IN_ROW,Vl(e,t);break}default:e.tmplInsertionModeStack[0]=M.IN_BODY,e.insertionMode=M.IN_BODY,_n(e,t)}}function r6(e,t){t.tagID===g.TEMPLATE&&go(e,t)}function fb(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 i6(e,t){t.tagID===g.HTML?_n(e,t):ql(e,t)}function hb(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=M.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 ql(e,t)}function ql(e,t){e.insertionMode=M.IN_BODY,Hl(e,t)}function o6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.FRAMESET:{e._insertElement(t,ue.HTML);break}case g.FRAME:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{xr(e,t);break}}}function s6(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=M.AFTER_FRAMESET))}function a6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.NOFRAMES:{xr(e,t);break}}}function u6(e,t){t.tagID===g.HTML&&(e.insertionMode=M.AFTER_AFTER_FRAMESET)}function l6(e,t){t.tagID===g.HTML?_n(e,t):Yl(e,t)}function Yl(e,t){e.insertionMode=M.IN_BODY,Hl(e,t)}function c6(e,t){switch(t.tagID){case g.HTML:{_n(e,t);break}case g.NOFRAMES:{xr(e,t);break}}}function d6(e,t){t.chars=At,e._insertCharacters(t)}function f6(e,t){e._insertCharacters(t),e.framesetOk=!1}function pb(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ue.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function h6(e,t){if(kR(t))pb(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ue.MATHML?Wy(t):r===ue.SVG&&(PR(t),Gy(t)),wh(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function p6(e,t){if(t.tagID===g.P||t.tagID===g.BR){pb(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)===ue.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}X.AREA,X.BASE,X.BASEFONT,X.BGSOUND,X.BR,X.COL,X.EMBED,X.FRAME,X.HR,X.IMG,X.INPUT,X.KEYGEN,X.LINK,X.META,X.PARAM,X.SOURCE,X.TRACK,X.WBR;const m6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,g6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),mb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function gb(e,t){const n=v6(e),r=ky("type",{handlers:{root:E6,element:y6,text:b6,comment:yb,doctype:T6,raw:S6},unknown:x6}),o={parser:n?new Qy(mb):Qy.getFragmentParser(void 0,mb),handle(c){r(c,o)},stitches:!1,options:t||{}};r(e,o),fs(o,Hr());const a=n?o.parser.document:o.parser.getFragment(),u=E3(a,{file:o.options.file});return o.stitches&&Dl(u,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=p.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Eb(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function E6(e,t){Eb(e.children,t)}function y6(e,t){w6(e,t),Eb(e.children,t),A6(e,t)}function b6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Qe.CHARACTER,chars:e.value,location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function T6(e,t){const n={type:Qe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _6(e,t){t.stitches=!0;const n=C6(e);if("children"in e&&"children"in n){const r=gb({type:"root",children:e.children},t.options);n.children=r.children}yb({type:"comment",value:{stitch:n}},t)}function yb(e,t){const n=e.value,r={type:Qe.COMMENT,data:n,location:Ya(e)};fs(t,Hr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function S6(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,bb(t,Hr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(m6,"&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 x6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))_6(n,t);else{let r="";throw g6.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 fs(e,t){bb(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=Dt.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 bb(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 w6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Dt.PLAINTEXT)return;fs(t,Hr(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:ho.html;o===ho.html&&n==="svg"&&(o=ho.svg);const a=I3(pe(F({},e),{children:[]}),{space:o===ho.svg?"svg":"html"}),u={type:Qe.START_TAG,tagName:n,tagID:cs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Ya(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function A6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&H3.includes(n)||t.parser.tokenizer.state===Dt.PLAINTEXT)return;fs(t,wl(e));const r={type:Qe.END_TAG,tagName:n,tagID:cs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ya(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Dt.RCDATA||t.parser.tokenizer.state===Dt.RAWTEXT||t.parser.tokenizer.state===Dt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Dt.DATA)}function v6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ya(e){const t=Hr(e)||{line:void 0,column:void 0,offset:void 0},n=wl(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 C6(e){return"children"in e?fo(pe(F({},e),{children:[]})):fo(e)}function Tb(e){return function(t,n){return gb(t,pe(F({},e),{file:n}))}}const Eo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],_b={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Eo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Eo],h2:[["className","sr-only"]],img:[...Eo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Eo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Eo],table:[...Eo],ul:[...Eo,["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"]},Ri={}.hasOwnProperty;function k6(e,t){let n={type:"root",children:[]};const r={schema:t?F(F({},_b),t):_b,stack:[]},o=Sb(r,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function Sb(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return P6(e,n);case"doctype":return N6(e,n);case"element":return O6(e,n);case"root":return I6(e,n);case"text":return R6(e,n)}}}function P6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Wa(a,t),a}}function N6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Wa(n,t),n}}function O6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=xb(e,t.children),o=L6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Ri.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:o,children:r};return Wa(u,t),u}function I6(e,t){const r={type:"root",children:xb(e,t.children)};return Wa(r,t),r}function R6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Wa(r,t),r}function xb(e,t){const n=[];if(Array.isArray(t)){const r=t;let o=-1;for(;++o<r.length;){const a=Sb(e,r[o]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function L6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,o=e.schema.required,a=r&&Ri.call(r,n)?r[n]:void 0,u=r&&Ri.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Ri.call(c,f)){const p=c[f];let m=wb(e,vb(a,f),f,p);m==null&&(m=wb(e,vb(u,f),f,p)),m!=null&&(d[f]=m)}if(o&&Ri.call(o,n)){const p=o[n];for(f in p)Ri.call(p,f)&&!Ri.call(d,f)&&(d[f]=p[f])}return d}function wb(e,t,n,r){return t?Array.isArray(r)?D6(e,t,n,r):Ab(e,t,n,r):void 0}function D6(e,t,n,r){let o=-1;const a=[];for(;++o<r.length;){const u=Ab(e,t,n,r[o]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Ab(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&M6(e,n,r)){if(typeof t=="object"&&t.length>1){let o=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){o=!0;break}}else if(u===r){o=!0;break}}if(!o)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function M6(e,t,n){const r=e.schema.protocols&&Ri.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const o=String(n),a=o.indexOf(":"),u=o.indexOf("?"),c=o.indexOf("#"),d=o.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const p=r[f];if(a===p.length&&o.slice(0,p.length)===p)return!0}return!1}function Wa(e,t){const n=aE(t);t.data&&(e.data=fo(t.data)),n&&(e.position=n)}function vb(e,t){let n,r=-1;if(e)for(;++r<e.length;){const o=e[r],a=typeof o=="string"?o:o[0];if(a===t)return o;a==="data*"&&(n=o)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function F6(e){return function(t){return k6(t,e)}}const Cb=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:o})=>{const a=n?t?"_blank":"_self":void 0;return x.jsx("a",pe(F(F({className:W(e,`${z}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:o}))},B6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=rt();return!e&&!t?null:x.jsx("div",{className:W(n,`${z}-disclaimer`),children:t?x.jsx(uy,{rehypePlugins:[Tb,F6],components:{ul:({children:r})=>x.jsx("ul",{className:W(n,`${z}-ul`),children:r}),ol:({children:r})=>x.jsx("ol",{className:W(n,`${z}-ol`),children:r}),li:({children:r})=>x.jsx("li",{className:W(n,`${z}-li`),children:r}),a:({href:r,title:o,children:a})=>x.jsx(Cb,{globalClassName:n,openLinksInNewTab:!0,href:r,title:o,children:a}),img:({src:r,alt:o})=>x.jsx("img",{className:W(n,`${z}-disclaimer-image`),src:r,alt:o}),p:({children:r})=>x.jsx("p",{className:W(n,`${z}-disclaimer-text`),children:r}),span:({children:r})=>x.jsx("span",{className:W(n,`${z}-disclaimer-text-span`),children:r})},children:t}):x.jsx("p",{className:W(n,`${z}-disclaimer-text`),children:e})})},Oh=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{connected:o,imageFile:a}=ar(),{setImageFile:u}=Ko(),{logger:c,globalClassName:d,searchConfig:f,features:p}=rt(),m=B.useRef(null),T=B.useRef(null),y=!!(p!=null&&p.enableImageUpload),_=(a==null?void 0:a.name)||"",w=!!o||!1,C=w?"connected":"disconnected",A=t||!w,P=()=>a?new Promise((D,q)=>{const re=new FileReader;re.readAsDataURL(a),re.onload=()=>D(re.result),re.onerror=me=>q(me)}):Promise.resolve(""),v=D=>Je(null,null,function*(){var me;if(A)return;const q=10*1024*1024,re=(me=D.target.files)==null?void 0:me[0];if(re){if(re.size>q){alert("File size exceeds the 10MB limit. Please choose a smaller file."),u(null);return}u(re)}}),H=()=>{u(null),T.current&&(T.current.value="")},Y=D=>Je(null,null,function*(){var me;D.preventDefault();const q=(((me=m.current)==null?void 0:me.value)||"").trim();let re="";try{re=yield P()}catch(V){c==null||c.error("Error converting file to base64:",V),alert("There was an error processing the file. Please try again.");return}q&&(H(),m.current.value="",r(q,re))});return x.jsxs("div",{className:W(d,e,`cim-${n}-component`,a&&"with-attachments",`${z}-search-bar-wrapper`),children:[a&&x.jsxs("div",{className:W(d,`cim-${n}-component`,`${z}-image-file-preview`),children:[x.jsx("img",{className:W(d,`cim-${n}-component`,`${z}-image-preview`),src:URL.createObjectURL(a),alt:`${_} preview`,loading:"lazy"}),x.jsx("span",{className:W(d,`cim-${n}-component`,`${z}-image-file-name`),title:_,children:_}),x.jsx(H1,{className:W(`cim-${n}-component`,"clear-attachment"),label:"Remove image",onClick:H})]}),x.jsxs("form",{className:W(d,e,`cim-${n}-component`,`${z}-search-bar`),name:`${z}-search-form`,onSubmit:Y,children:[x.jsx("span",{role:"status",className:W(`${z}-connection-status-icon`,C)}),y&&x.jsxs("div",{role:"button",className:W(d,e,`cim-${n}-component`,A&&"disabled",`${z}-image-upload-button`),"aria-disabled":A,tabIndex:0,children:[x.jsx("label",{className:W(d,e,`cim-${n}-component`,A&&"disabled",`${z}-image-upload-label`),htmlFor:"image-input","aria-label":"Upload an image",children:x.jsx(eP,{})}),x.jsx("input",{className:W(d,e,`cim-${n}-component`,`${z}-file-input`),type:"file",ref:T,id:"image-input",accept:".png,.jpg,.jpeg,.avif,.svg,.gif,.tiff,.tif,.webp",name:`${z}-file-input`,disabled:A,onInput:v})]}),x.jsx("input",{className:W(d,e,`cim-${n}-component`,`${z}-search-input`),type:"text",ref:m,placeholder:f==null?void 0:f.placeholder,name:`${z}-user-input`}),x.jsx(sP,{isLoading:A}),x.jsx(rP,{className:e,globalClassName:d,searchConfig:f,componentType:n,isLoading:A})]}),x.jsx(B6,{})]})};function U6(e){return wt({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 H6(e){return wt({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 kb=B.createContext({isOpen:!1}),Ih=B.createContext(null),Pb=B.createContext(null),hs=()=>{var n,r;const e=B.useContext(Ih),t=B.useContext(Pb);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Nb=({onClearChat:e,componentType:t})=>{const n=hs(),r=()=>{e(),n()};return x.jsxs("button",{className:W(`${z}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[x.jsx(H6,{}),"Clear chat"]})};function z6(e){return e==null?[]:Array.isArray(e)?e:[e]}var j6=(e,...t)=>e.concat(t),$6=(e,...t)=>e.filter(n=>!t.includes(n)),V6=e=>Array.from(new Set(e));function Ob(e,t,n={}){const{step:r=1,loop:o=!0}=n,a=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:a<0?o?c:0:a>=u?o?0:t>u?u:t:a}function q6(e,t,n={}){const{step:r=1,loop:o=!0}=n;return Ob(e,t,{step:-r,loop:o})}var Y6=e=>Array.isArray(e),Ib=e=>e!=null&&typeof e=="object",W6=e=>Ib(e)&&!Y6(e),Wl=e=>typeof e=="string",ps=e=>typeof e=="function",G6=e=>e==null,X6=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K6=e=>Object.prototype.toString.call(e),Rb=Function.prototype.toString,Q6=Rb.call(Object),J6=e=>{if(!Ib(e)||K6(e)!="[object Object]"||t4(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=X6(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Rb.call(n)==Q6},Z6=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,e4=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,t4=e=>Z6(e)||e4(e),n4=e=>e(),r4=()=>{},Rh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function i4(e,t=0){let n=0,r=null;return((...o)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...o),n=a):r||(r=setTimeout(()=>{e(...o),n=Date.now(),r=null},t-u))})}var{min:o4,max:s4}=Math,a4=e=>Number.isNaN(e),u4=e=>a4(e)?0:e,Lb=(e,t,n)=>o4(s4(u4(e),t),n);function Lh(e){if(!J6(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Lh(o))}return n}function Dh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function l4(e,t){if(e==null)throw new Error(t())}function c4(e,t,n){let r=[];for(const o of t)e[o]==null&&r.push(o);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var d4=Object.defineProperty,f4=(e,t,n)=>t in e?d4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mh=(e,t,n)=>f4(e,typeof t!="symbol"?t+"":t,n),Db=()=>{},Gl=e=>typeof e=="object"&&e!==null,ms=e=>e?"":void 0,Mb=e=>e?"true":void 0,h4=1,p4=9,m4=11,en=e=>Gl(e)&&e.nodeType===h4&&typeof e.nodeName=="string",Xl=e=>Gl(e)&&e.nodeType===p4,g4=e=>Gl(e)&&e===e.window,Fb=e=>en(e)?e.localName||"":"#document";function E4(e){return["html","body","#document"].includes(Fb(e))}var y4=e=>Gl(e)&&e.nodeType!==void 0,yo=e=>y4(e)&&e.nodeType===m4&&"host"in e,b4=e=>en(e)&&e.localName==="input",T4=e=>en(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ga(e){if(!e)return!1;const t=e.getRootNode();return ys(t)===e}var _4=/(textarea|select)/;function S4(e){if(e==null||!en(e))return!1;try{return b4(e)&&e.selectionStart!=null||_4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function gs(e,t){var r;if(!e||!t||!en(e)||!en(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&yo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function $r(e){var t;return Xl(e)?e:g4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function x4(e){return $r(e).documentElement}function Es(e){var t,n,r;return yo(e)?Es(e.host):Xl(e)?(t=e.defaultView)!=null?t:window:en(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function ys(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 w4(e){if(Fb(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yo(e)&&e.host||x4(e);return yo(t)?t.host:t}function Fh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Xl(t)||yo(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var Bh=new WeakMap;function bs(e){return Bh.has(e)||Bh.set(e,Es(e).getComputedStyle(e)),Bh.get(e)}var Uh=new Set(["menu","listbox","dialog","grid","tree","region"]),A4=e=>Uh.has(e),Bb=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Ub(e,t){const n=new Set,r=Fh(e),o=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Bb(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const p=r.getElementById(f);if(p){const m=p.getAttribute("role"),T=p.getAttribute("aria-modal")==="true";if(m&&A4(m)&&!T&&(p===t||p.contains(t)||o(p)))return!0}}}return!1};return o(e)}function Hb(e,t){const n=Fh(e),r=new Set,o=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Bb(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const p=n.getElementById(f);if(p){const m=p.getAttribute("role"),T=p.getAttribute("aria-modal")==="true";m&&Uh.has(m)&&!T&&(t(p),o(p))}}}};o(e)}function v4(e){const t=new Set;return Hb(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function C4(e){const t=e.getAttribute("role");return!!(t&&Uh.has(t))}function k4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function P4(e){var t;return k4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function N4(e){if(!e.id)return!1;const t=Fh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&C4(e))}var Hh=()=>typeof document!="undefined";function O4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var zh=e=>Hh()&&e.test(O4()),I4=e=>Hh()&&e.test(navigator.vendor),zb=()=>Hh()&&!!navigator.maxTouchPoints,R4=()=>zh(/^iPhone/i),L4=()=>zh(/^iPad/i)||jh()&&navigator.maxTouchPoints>1,Kl=()=>R4()||L4(),D4=()=>jh()||Kl(),jh=()=>zh(/^Mac/i),M4=()=>D4()&&I4(/apple/i);function F4(e){var t,n,r,o;return(o=(t=e.composedPath)==null?void 0:t.call(e))!=null?o:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function wr(e){var n;const t=F4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var jb=e=>e.button===0,B4=e=>e.button===2||jh()&&e.ctrlKey&&e.button===0,U4=e=>"touches"in e&&e.touches.length>0,H4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},$b={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function z4(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=(u=H4[o])!=null?u:o,n==="rtl"&&r==="horizontal"&&o in $b&&(o=$b[o]),o}function Vb(e,t="client"){const n=U4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var tn=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o==null||o.addEventListener(t,n,r),()=>{o==null||o.removeEventListener(t,n,r)}},qb=e=>en(e)&&e.tagName==="IFRAME",j4=/^(audio|video|details)$/;function Yb(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var $4=e=>!Number.isNaN(Yb(e)),V4=e=>Yb(e)<0;function q4(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 Wb(e,t,n){const r=[...e],o=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<o.length;){const d=o[c++];if(!d||a.has(d))continue;a.add(d);const f=q4(d,t);if(f){const p=Array.from(f.querySelectorAll(Ql)).filter(n),m=u.get(d);if(m!==void 0){const T=m+1;r.splice(T,0,...p),p.forEach((y,_)=>{u.set(y,T+_)});for(let y=T+p.length;y<r.length;y++)u.set(r[y],y)}else{const T=r.length;r.push(...p),p.forEach((y,_)=>{u.set(y,T+_)})}o.push(...p)}}return r}var Ql="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",Gb=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,o=Array.from(e.querySelectorAll(Ql));(n==!0||n=="if-empty"&&o.length===0)&&en(e)&&Vr(e)&&o.unshift(e);const u=[];for(const c of o)if(Vr(c)){if(qb(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...Gb(d,{getShadowRoot:r}));continue}u.push(c)}return r?Wb(u,r,Vr):u};function Vr(e){return!en(e)||e.closest("[inert]")?!1:e.matches(Ql)&&T4(e)}function Ts(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,o=Array.from(e.querySelectorAll(Ql));n&&bo(e)&&o.unshift(e);const a=[];for(const u of o)if(bo(u)){if(qb(u)&&u.contentDocument){const c=u.contentDocument.body;a.push(...Ts(c,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=Wb(a,r,bo);return!u.length&&n?o:u}return!a.length&&n?o:a}function bo(e){return en(e)&&e.tabIndex>0?!0:Vr(e)&&!V4(e)}function Y4(e,t={}){const n=Ts(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function W4(e,t={}){const{current:n,getShadowRoot:r}=t,o=Ts(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:ys(a);if(!u)return null;const c=o.indexOf(u);return o[c+1]||null}function Xa(e){return e.tabIndex<0&&(j4.test(e.localName)||S4(e))&&!$4(e)?0:e.tabIndex}function Xb(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=Ts(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var G4=class e2{constructor(){Mh(this,"id",null),Mh(this,"fn_cleanup"),Mh(this,"cleanup",()=>{this.cancel()})}static create(){return new e2}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 Yt(e){const t=G4.create();return t.request(e),t.cleanup}function Kb(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function $h(e){const t=w4(e);return E4(t)?$r(t).body:en(t)&&Q4(t)?t:$h(t)}var X4=/auto|scroll|overlay|hidden|clip/,K4=new Set(["inline","contents"]);function Q4(e){const t=Es(e),{overflow:n,overflowX:r,overflowY:o,display:a}=t.getComputedStyle(e);return X4.test(n+o+r)&&!K4.has(a)}var _s="default",Vh="",Jl=new WeakMap;function J4(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,o=r.documentElement;return Kl()?(_s==="default"&&(Vh=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),_s="disabled"):t&&(Jl.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Z4({target:t,doc:r})}function Z4(e={}){const{target:t,doc:n}=e,o=(n!=null?n:document).documentElement;if(Kl()){if(_s!=="disabled")return;_s="restoring",setTimeout(()=>{Kb(()=>{_s==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Vh||""),Vh="",_s="default")})},300)}else if(t&&Jl.has(t)){const a=Jl.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Jl.delete(t)}}function eD(e={}){const u=e,{defer:t,target:n}=u,r=mn(u,["defer","target"]),o=t?Yt:c=>c(),a=[];return a.push(o(()=>{const c=typeof n=="function"?n():n;a.push(J4(pe(F({},r),{target:c})))})),()=>{a.forEach(c=>c==null?void 0:c())}}function tD(e,t){const{onPointerMove:n,onPointerUp:r}=t,o=c=>{const d=Vb(c),f=Math.sqrt(ia(d.x,2)+ia(d.y,2)),p=c.pointerType==="touch"?10:5;if(!(f<p)){if(c.pointerType==="mouse"&&c.button===0){a(c);return}n({point:d,event:c})}},a=c=>{const d=Vb(c);r({point:d,event:c})},u=[tn(e,"pointermove",o,!1),tn(e,"pointerup",a,!1),tn(e,"pointercancel",a,!1),tn(e,"contextmenu",a,!1),eD({doc:e})];return()=>{u.forEach(c=>c())}}function nD(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:o,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let p=null;const[m,T]=Y4(e,{includeContainer:!0,getShadowRoot:a}),y=W4(c,{current:n,getShadowRoot:a}),_=!m&&!T;f.shiftKey&&Ga(y)?(o==null||o(),p=T):f.shiftKey&&(Ga(m)||_)?p=n:!f.shiftKey&&Ga(n)?(o==null||o(),p=m):!f.shiftKey&&(Ga(T)||_)&&(p=y),p&&(f.preventDefault(),typeof r=="function"?r(p):p.focus())}return tn(u,"keydown",d,!0)}function rD(e,t){const c=t,{defer:n,triggerElement:r}=c,o=mn(c,["defer","triggerElement"]),a=n?Yt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(nD(d,F({triggerElement:f},o)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function iD(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Zl(e,t){if(!e)return Db;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function oD(e,t,n){if(!e)return Db;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 sD(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 aD(e,t){const{timeout:n,rootNode:r}=t,o=Es(r),a=$r(r),u=new o.AbortController;return sD(new Promise(c=>{const d=e();if(d){c(d);return}const f=new o.MutationObserver(()=>{const p=e();p&&p.isConnected&&(f.disconnect(),c(p))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var uD=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),lD=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Qb=e=>{const t={};let n;for(;n=lD.exec(e);)t[n[1]]=n[2];return t},cD=(e,t)=>{if(Wl(e)){if(Wl(t))return`${e};${t}`;e=Qb(e)}else Wl(t)&&(t=Qb(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Wt(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=Rh(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=uD(t[o],n[o]);continue}if(o==="style"){t[o]=cD(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function $U(e){return e}var Ss=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Ss||{}),qh="__init__";function dD(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>$r(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},o=()=>ys(t()),a=u=>t().getElementById(u);return pe(F({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:o,isActiveElement:Ga,getById:a})}function fD(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var xs=()=>e=>Array.from(new Set(e)),Jb=typeof globalThis.document!="undefined"?B.useLayoutEffect:B.useEffect;function ec(e){var m,T;const t=(m=e().value)!=null?m:e().defaultValue,n=(T=e().isEqual)!=null?T:Object.is,[r]=B.useState(t),[o,a]=B.useState(r),u=e().value!==void 0,c=B.useRef(o);c.current=u?e().value:o;const d=B.useRef(c.current);Jb(()=>{d.current=c.current},[o,e().value]);const f=y=>{var C,A;const _=d.current,w=ps(y)?y(_):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:w,prev:_}),u||a(w),n(w,_)||(A=(C=e()).onChange)==null||A.call(C,w,_)};function p(){return u?e().value:o}return{initial:r,ref:c,get:p,set(y){(e().sync?Qo.flushSync:n4)(()=>f(y))},invoke(y,_){var w,C;(C=(w=e()).onChange)==null||C.call(w,y,_)},hash(y){var _,w,C;return(C=(w=(_=e()).hash)==null?void 0:w.call(_,y))!=null?C:String(y)}}}ec.cleanup=e=>{B.useEffect(()=>e,[])},ec.ref=e=>{const t=B.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function hD(e){const t=B.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var pD=(e,t)=>{const n=B.useRef(!1),r=B.useRef(!1);B.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(o=>typeof o=="function"?o():o)]),B.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function tc(e,t={}){var oe,ce,de,ne,Te,Pe;const n=B.useMemo(()=>{const{id:se,ids:K,getRootNode:ie}=t;return dD({id:se,ids:K,getRootNode:ie})},[t]),r=(...se)=>{e.debug&&console.log(...se)},o=(ce=(oe=e.props)==null?void 0:oe.call(e,{props:Lh(t),scope:n}))!=null?ce:t,a=mD(o),u=(de=e.context)==null?void 0:de.call(e,{prop:a,bindable:ec,scope:n,flush:eT,getContext(){return d},getComputed(){return Y},getRefs(){return w},getEvent(){return y()}}),c=Zb(u),d={get(se){var K;return(K=c.current)==null?void 0:K[se].ref.current},set(se,K){var ie;(ie=c.current)==null||ie[se].set(K)},initial(se){var K;return(K=c.current)==null?void 0:K[se].initial},hash(se){var ie,k;const K=(ie=c.current)==null?void 0:ie[se].get();return(k=c.current)==null?void 0:k[se].hash(K)}},f=B.useRef(new Map),p=B.useRef(null),m=B.useRef(null),T=B.useRef({type:""}),y=()=>pe(F({},T.current),{current(){return T.current},previous(){return m.current}}),_=()=>pe(F({},D),{matches(...se){return se.includes(D.ref.current)},hasTag(se){var K,ie;return!!((ie=(K=e.states[D.ref.current])==null?void 0:K.tags)!=null&&ie.includes(se))}}),w=hD((Te=(ne=e.refs)==null?void 0:ne.call(e,{prop:a,context:d}))!=null?Te:{}),C=()=>({state:_(),context:d,event:y(),prop:a,send:V,action:A,guard:P,track:pD,refs:w,computed:Y,flush:eT,scope:n,choose:H}),A=se=>{const K=ps(se)?se(C()):se;if(!K)return;const ie=K.map(k=>{var ee,I;const L=(I=(ee=e.implementations)==null?void 0:ee.actions)==null?void 0:I[k];return L||Dh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),L});for(const k of ie)k==null||k(C())},P=se=>{var K,ie;return ps(se)?se(C()):(ie=(K=e.implementations)==null?void 0:K.guards)==null?void 0:ie[se](C())},v=se=>{const K=ps(se)?se(C()):se;if(!K)return;const ie=K.map(L=>{var I,Se;const ee=(Se=(I=e.implementations)==null?void 0:I.effects)==null?void 0:Se[L];return ee||Dh(`[zag-js] No implementation found for effect "${JSON.stringify(L)}"`),ee}),k=[];for(const L of ie){const ee=L==null?void 0:L(C());ee&&k.push(ee)}return()=>k.forEach(L=>L==null?void 0:L())},H=se=>z6(se).find(K=>{let ie=!K.guard;return Wl(K.guard)?ie=!!P(K.guard):ps(K.guard)&&(ie=K.guard(C())),ie}),Y=se=>{l4(e.computed,()=>"[zag-js] No computed object found on machine");const K=e.computed[se];return K({context:d,event:y(),prop:a,refs:w,scope:n,computed:Y})},D=ec(()=>({defaultValue:e.initialState({prop:a}),onChange(se,K){var k,L,ee,I;if(K){const Se=f.current.get(K);Se==null||Se(),f.current.delete(K)}K&&A((k=e.states[K])==null?void 0:k.exit),A((L=p.current)==null?void 0:L.actions);const ie=v((ee=e.states[se])==null?void 0:ee.effects);if(ie&&f.current.set(se,ie),K===qh){A(e.entry);const Se=v(e.effects);Se&&f.current.set(qh,Se)}A((I=e.states[se])==null?void 0:I.entry)}})),q=B.useRef(void 0),re=B.useRef(Ss.NotStarted);Jb(()=>{queueMicrotask(()=>{var L;const ie=re.current===Ss.Started;re.current=Ss.Started,r(ie?"rehydrating...":"initializing...");const k=(L=q.current)!=null?L:D.initial;D.invoke(k,ie?D.get():qh)});const se=f.current,K=D.ref.current;return()=>{r("unmounting..."),q.current=K,re.current=Ss.Stopped,se.forEach(ie=>ie==null?void 0:ie()),f.current=new Map,p.current=null,queueMicrotask(()=>{A(e.exit)})}},[]);const me=()=>"ref"in D?D.ref.current:D.get(),V=se=>{queueMicrotask(()=>{var I,Se,je,Ee,Fe;if(re.current!==Ss.Started)return;m.current=T.current,T.current=se;let K=me();const ie=(je=(I=e.states[K].on)==null?void 0:I[se.type])!=null?je:(Se=e.on)==null?void 0:Se[se.type],k=H(ie);if(!k)return;p.current=k;const L=(Ee=k.target)!=null?Ee:K;r("transition",se.type,k.target||K,`(${k.actions})`);const ee=L!==K;ee?Qo.flushSync(()=>D.set(L)):k.reenter&&!ee?D.invoke(K,K):A((Fe=k.actions)!=null?Fe:[])})};return(Pe=e.watch)==null||Pe.call(e,C()),{state:_(),send:V,context:d,prop:a,scope:n,refs:w,computed:Y,event:y(),getStatus:()=>re.current}}function Zb(e){const t=B.useRef(e);return t.current=e,t}function mD(e){const t=Zb(e);return function(r){return t.current[r]}}function eT(e){queueMicrotask(()=>{Qo.flushSync(()=>e())})}var Yh=fD(e=>e);function nc(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const o=r(t);typeof o=="function"&&n.push(o)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function gD(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Wh=e=>{const t=B.memo(B.forwardRef((n,r)=>{const f=n,{asChild:o,children:a}=f,u=mn(f,["asChild","children"]);if(!o)return B.createElement(e,pe(F({},u),{ref:r}),a);if(!B.isValidElement(a))return null;const c=B.Children.only(a),d=gD(c);return B.cloneElement(c,pe(F({},Wt(u,c.props)),{ref:r?nc(r,d):d}))}));return t.displayName=e.displayName||e.name,t},Sn=(()=>{const e=new Map;return new Proxy(Wh,{apply(t,n,r){return Wh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Wh(r)),e.get(r)}})})();function ED(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function To(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:a,defaultValue:u}=e,c=B.createContext(u);c.displayName=t;function d(){var p;const f=B.useContext(c);if(!f&&n){const m=new Error(a!=null?a:ED(r,o));throw m.name="ContextError",(p=Error.captureStackTrace)==null||p.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[yD,Gh]=To({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[tT,Ka]=To({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),nT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:nc(r.ref,t)}))});nT.displayName="PopoverContent";const rT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(n.getPositionerProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:t}))});rT.displayName="PopoverPositioner";const Qa=()=>(e,t)=>t.reduce((n,r)=>{const[o,a]=n,u=r;return a[u]!==void 0&&(o[u]=a[u]),delete a[u],[o,a]},[{},F({},e)]),iT=e=>Qa()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function bD(e,t){const{state:n,send:r,context:o}=e,a=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var TD={props({props:e}){return pe(F({},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 o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!o&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Yt(()=>{var c,d;const u=rc(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})=>{Yt(()=>{e.set("prevAnimationName",rc(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const a=d=>{var p,m,T;((T=(m=(p=d.composedPath)==null?void 0:p.call(d))==null?void 0:m[0])!=null?T:d.target)===o&&e.set("prevAnimationName",rc(t.get("styles")))},u=d=>{const f=rc(t.get("styles"));wr(d)===o&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",u),o.addEventListener("animationend",u);const c=Zl(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",u),o.removeEventListener("animationend",u),Kb(()=>c())}}}}};function rc(e){return(e==null?void 0:e.animationName)||"none"}xs()(["onExitComplete","present","immediate"]);function _D(e,t={}){const{sync:n=!1}=t,r=SD(e);return B.useCallback((...o)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...o)}):(a=r.current)==null?void 0:a.call(r,...o)},[n,r])}function SD(e){const t=B.useRef(e);return t.current=e,t}const Xh=(e={})=>{const T=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:o=!1}=T,a=mn(T,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=B.useRef(!1),c=pe(F({},a),{present:r,onExitComplete:_D(e.onExitComplete)}),d=tc(TD,c),f=bD(d);f.present&&(u.current=!0);const p=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&o?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:p}};var _o=(e,t=[])=>({parts:(...n)=>{if(xD(t))return _o(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>_o(e,[...t,...n]),omit:(...n)=>_o(e,t.filter(r=>!n.includes(r))),rename:n=>_o(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${ws(e)}"][data-part="${ws(r)}"]`,`& [data-scope="${ws(e)}"][data-part="${ws(r)}"]`].join(", "),attrs:{"data-scope":ws(e),"data-part":ws(r)}}}),{})}),ws=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),xD=e=>e.length===0;const wD=["top","right","bottom","left"],Li=Math.min,Qn=Math.max,ic=Math.round,oc=Math.floor,qr=e=>({x:e,y:e}),AD={left:"right",right:"left",bottom:"top",top:"bottom"},vD={start:"end",end:"start"};function Kh(e,t,n){return Qn(e,Li(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function hi(e){return e.split("-")[0]}function As(e){return e.split("-")[1]}function Qh(e){return e==="x"?"y":"x"}function Jh(e){return e==="y"?"height":"width"}const CD=new Set(["top","bottom"]);function Yr(e){return CD.has(hi(e))?"y":"x"}function Zh(e){return Qh(Yr(e))}function kD(e,t,n){n===void 0&&(n=!1);const r=As(e),o=Zh(e),a=Jh(o);let u=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=sc(u)),[u,sc(u)]}function PD(e){const t=sc(e);return[ep(e),t,ep(t)]}function ep(e){return e.replace(/start|end/g,t=>vD[t])}const oT=["left","right"],sT=["right","left"],ND=["top","bottom"],OD=["bottom","top"];function ID(e,t,n){switch(e){case"top":case"bottom":return n?t?sT:oT:t?oT:sT;case"left":case"right":return t?ND:OD;default:return[]}}function RD(e,t,n,r){const o=As(e);let a=ID(hi(e),n==="start",r);return o&&(a=a.map(u=>u+"-"+o),t&&(a=a.concat(a.map(ep)))),a}function sc(e){return e.replace(/left|right|bottom|top/g,t=>AD[t])}function LD(e){return F({top:0,right:0,bottom:0,left:0},e)}function aT(e){return typeof e!="number"?LD(e):{top:e,right:e,bottom:e,left:e}}function ac(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function uT(e,t,n){let{reference:r,floating:o}=e;const a=Yr(t),u=Zh(t),c=Jh(u),d=hi(t),f=a==="y",p=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,T=r[c]/2-o[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-o.width,y:m};break;default:y={x:r.x,y:r.y}}switch(As(t)){case"start":y[u]-=T*(n&&f?-1:1);break;case"end":y[u]+=T*(n&&f?-1:1);break}return y}const DD=(e,t,n)=>Je(null,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:u}=n,c=a.filter(Boolean),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:m}=uT(f,r,d),T=r,y={},_=0;for(let w=0;w<c.length;w++){const{name:C,fn:A}=c[w],{x:P,y:v,data:H,reset:Y}=yield A({x:p,y:m,initialPlacement:r,placement:T,strategy:o,middlewareData:y,rects:f,platform:u,elements:{reference:e,floating:t}});p=P!=null?P:p,m=v!=null?v:m,y=pe(F({},y),{[C]:F(F({},y[C]),H)}),Y&&_<=50&&(_++,typeof Y=="object"&&(Y.placement&&(T=Y.placement),Y.rects&&(f=Y.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:o}):Y.rects),{x:p,y:m}=uT(f,T,d)),w=-1)}return{x:p,y:m,placement:T,strategy:o,middlewareData:y}});function Ja(e,t){return Je(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:T=!1,padding:y=0}=fi(t,e),_=aT(y),C=c[T?m==="floating"?"reference":"floating":m],A=ac(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(C))==null||n?C:C.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),P=m==="floating"?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,v=yield a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating),H=(yield a.isElement==null?void 0:a.isElement(v))?(yield a.getScale==null?void 0:a.getScale(v))||{x:1,y:1}:{x:1,y:1},Y=ac(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:P,offsetParent:v,strategy:d}):P);return{top:(A.top-Y.top+_.top)/H.y,bottom:(Y.bottom-A.bottom+_.bottom)/H.y,left:(A.left-Y.left+_.left)/H.x,right:(Y.right-A.right+_.right)/H.x}})}const MD=e=>({name:"arrow",options:e,fn(n){return Je(this,null,function*(){const{x:r,y:o,placement:a,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:p,padding:m=0}=fi(e,n)||{};if(p==null)return{};const T=aT(m),y={x:r,y:o},_=Zh(a),w=Jh(_),C=yield c.getDimensions(p),A=_==="y",P=A?"top":"left",v=A?"bottom":"right",H=A?"clientHeight":"clientWidth",Y=u.reference[w]+u.reference[_]-y[_]-u.floating[w],D=y[_]-u.reference[_],q=yield c.getOffsetParent==null?void 0:c.getOffsetParent(p);let re=q?q[H]:0;(!re||!(yield c.isElement==null?void 0:c.isElement(q)))&&(re=d.floating[H]||u.floating[w]);const me=Y/2-D/2,V=re/2-C[w]/2-1,oe=Li(T[P],V),ce=Li(T[v],V),de=oe,ne=re-C[w]-ce,Te=re/2-C[w]/2+me,Pe=Kh(de,Te,ne),se=!f.arrow&&As(a)!=null&&Te!==Pe&&u.reference[w]/2-(Te<de?oe:ce)-C[w]/2<0,K=se?Te<de?Te-de:Te-ne:0;return{[_]:y[_]+K,data:F({[_]:Pe,centerOffset:Te-Pe-K},se&&{alignmentOffset:K}),reset:se}})}}),FD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Je(this,null,function*(){var r,o;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:p}=n,Te=fi(e,n),{mainAxis:m=!0,crossAxis:T=!0,fallbackPlacements:y,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0}=Te,A=mn(Te,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const P=hi(a),v=Yr(d),H=hi(d)===d,Y=yield f.isRTL==null?void 0:f.isRTL(p.floating),D=y||(H||!C?[sc(d)]:PD(d)),q=w!=="none";!y&&q&&D.push(...RD(d,C,w,Y));const re=[d,...D],me=yield Ja(n,A),V=[];let oe=((o=u.flip)==null?void 0:o.overflows)||[];if(m&&V.push(me[P]),T){const Pe=kD(a,c,Y);V.push(me[Pe[0]],me[Pe[1]])}if(oe=[...oe,{placement:a,overflows:V}],!V.every(Pe=>Pe<=0)){var ce,de;const Pe=(((ce=u.flip)==null?void 0:ce.index)||0)+1,se=re[Pe];if(se&&(!(T==="alignment"?v!==Yr(se):!1)||oe.every(k=>Yr(k.placement)===v?k.overflows[0]>0:!0)))return{data:{index:Pe,overflows:oe},reset:{placement:se}};let K=(de=oe.filter(ie=>ie.overflows[0]<=0).sort((ie,k)=>ie.overflows[1]-k.overflows[1])[0])==null?void 0:de.placement;if(!K)switch(_){case"bestFit":{var ne;const ie=(ne=oe.filter(k=>{if(q){const L=Yr(k.placement);return L===v||L==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(L=>L>0).reduce((L,ee)=>L+ee,0)]).sort((k,L)=>k[1]-L[1])[0])==null?void 0:ne[0];ie&&(K=ie);break}case"initialPlacement":K=d;break}if(a!==K)return{reset:{placement:K}}}return{}})}}};function lT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cT(e){return wD.some(t=>e[t]>=0)}const BD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Je(this,null,function*(){const{rects:r}=n,u=fi(e,n),{strategy:o="referenceHidden"}=u,a=mn(u,["strategy"]);switch(o){case"referenceHidden":{const c=yield Ja(n,pe(F({},a),{elementContext:"reference"})),d=lT(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:cT(d)}}}case"escaped":{const c=yield Ja(n,pe(F({},a),{altBoundary:!0})),d=lT(c,r.floating);return{data:{escapedOffsets:d,escaped:cT(d)}}}default:return{}}})}}},dT=new Set(["left","top"]);function UD(e,t){return Je(this,null,function*(){const{placement:n,platform:r,elements:o}=e,a=yield r.isRTL==null?void 0:r.isRTL(o.floating),u=hi(n),c=As(n),d=Yr(n)==="y",f=dT.has(u)?-1:1,p=a&&d?-1:1,m=fi(t,e);let{mainAxis:T,crossAxis:y,alignmentAxis:_}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof _=="number"&&(y=c==="end"?_*-1:_),d?{x:y*p,y:T*f}:{x:T*f,y:y*p}})}const HD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Je(this,null,function*(){var r,o;const{x:a,y:u,placement:c,middlewareData:d}=n,f=yield UD(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(o=d.arrow)!=null&&o.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:pe(F({},f),{placement:c})}})}}},zD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Je(this,null,function*(){const{x:r,y:o,placement:a}=n,A=fi(e,n),{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:P=>{let{x:v,y:H}=P;return{x:v,y:H}}}}=A,f=mn(A,["mainAxis","crossAxis","limiter"]),p={x:r,y:o},m=yield Ja(n,f),T=Yr(hi(a)),y=Qh(T);let _=p[y],w=p[T];if(u){const P=y==="y"?"top":"left",v=y==="y"?"bottom":"right",H=_+m[P],Y=_-m[v];_=Kh(H,_,Y)}if(c){const P=T==="y"?"top":"left",v=T==="y"?"bottom":"right",H=w+m[P],Y=w-m[v];w=Kh(H,w,Y)}const C=d.fn(pe(F({},n),{[y]:_,[T]:w}));return pe(F({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[y]:u,[T]:c}}})})}}},jD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:u}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=fi(e,t),p={x:n,y:r},m=Yr(o),T=Qh(m);let y=p[T],_=p[m];const w=fi(c,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:F({mainAxis:0,crossAxis:0},w);if(d){const v=T==="y"?"height":"width",H=a.reference[T]-a.floating[v]+C.mainAxis,Y=a.reference[T]+a.reference[v]-C.mainAxis;y<H?y=H:y>Y&&(y=Y)}if(f){var A,P;const v=T==="y"?"width":"height",H=dT.has(hi(o)),Y=a.reference[m]-a.floating[v]+(H&&((A=u.offset)==null?void 0:A[m])||0)+(H?0:C.crossAxis),D=a.reference[m]+a.reference[v]+(H?0:((P=u.offset)==null?void 0:P[m])||0)-(H?C.crossAxis:0);_<Y?_=Y:_>D&&(_=D)}return{[T]:y,[m]:_}}}},$D=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Je(this,null,function*(){var r,o;const{placement:a,rects:u,platform:c,elements:d}=n,oe=fi(e,n),{apply:f=()=>{}}=oe,p=mn(oe,["apply"]),m=yield Ja(n,p),T=hi(a),y=As(a),_=Yr(a)==="y",{width:w,height:C}=u.floating;let A,P;T==="top"||T==="bottom"?(A=T,P=y===((yield c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(P=T,A=y==="end"?"top":"bottom");const v=C-m.top-m.bottom,H=w-m.left-m.right,Y=Li(C-m[A],v),D=Li(w-m[P],H),q=!n.middlewareData.shift;let re=Y,me=D;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&(me=H),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(re=v),q&&!y){const ce=Qn(m.left,0),de=Qn(m.right,0),ne=Qn(m.top,0),Te=Qn(m.bottom,0);_?me=w-2*(ce!==0||de!==0?ce+de:Qn(m.left,m.right)):re=C-2*(ne!==0||Te!==0?ne+Te:Qn(m.top,m.bottom))}yield f(pe(F({},n),{availableWidth:me,availableHeight:re}));const V=yield c.getDimensions(d.floating);return w!==V.width||C!==V.height?{reset:{rects:!0}}:{}})}}};function uc(){return typeof window!="undefined"}function vs(e){return fT(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wr(e){var t;return(t=(fT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fT(e){return uc()?e instanceof Node||e instanceof Jn(e).Node:!1}function Ar(e){return uc()?e instanceof Element||e instanceof Jn(e).Element:!1}function Gr(e){return uc()?e instanceof HTMLElement||e instanceof Jn(e).HTMLElement:!1}function hT(e){return!uc()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}const VD=new Set(["inline","contents"]);function Za(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!VD.has(o)}const qD=new Set(["table","td","th"]);function YD(e){return qD.has(vs(e))}const WD=[":popover-open",":modal"];function lc(e){return WD.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const GD=["transform","translate","scale","rotate","perspective"],XD=["transform","translate","scale","rotate","perspective","filter"],KD=["paint","layout","strict","content"];function tp(e){const t=np(),n=Ar(e)?vr(e):e;return GD.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||XD.some(r=>(n.willChange||"").includes(r))||KD.some(r=>(n.contain||"").includes(r))}function QD(e){let t=Di(e);for(;Gr(t)&&!Cs(t);){if(tp(t))return t;if(lc(t))return null;t=Di(t)}return null}function np(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const JD=new Set(["html","body","#document"]);function Cs(e){return JD.has(vs(e))}function vr(e){return Jn(e).getComputedStyle(e)}function cc(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Di(e){if(vs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hT(e)&&e.host||Wr(e);return hT(t)?t.host:t}function pT(e){const t=Di(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&Za(t)?t:pT(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pT(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),u=Jn(o);if(a){const c=rp(u);return t.concat(u,u.visualViewport||[],Za(o)?o:[],c&&n?eu(c):[])}return t.concat(o,eu(o,[],n))}function rp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mT(e){const t=vr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Gr(e),a=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=ic(n)!==a||ic(r)!==u;return c&&(n=a,r=u),{width:n,height:r,$:c}}function ip(e){return Ar(e)?e:e.contextElement}function ks(e){const t=ip(e);if(!Gr(t))return qr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=mT(t);let u=(a?ic(n.width):n.width)/r,c=(a?ic(n.height):n.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const ZD=qr(0);function gT(e){const t=Jn(e);return!np()||!t.visualViewport?ZD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function e5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function So(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=ip(e);let u=qr(1);t&&(r?Ar(r)&&(u=ks(r)):u=ks(e));const c=e5(a,n,r)?gT(a):qr(0);let d=(o.left+c.x)/u.x,f=(o.top+c.y)/u.y,p=o.width/u.x,m=o.height/u.y;if(a){const T=Jn(a),y=r&&Ar(r)?Jn(r):r;let _=T,w=rp(_);for(;w&&r&&y!==_;){const C=ks(w),A=w.getBoundingClientRect(),P=vr(w),v=A.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,H=A.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,m*=C.y,d+=v,f+=H,_=Jn(w),w=rp(_)}}return ac({width:p,height:m,x:d,y:f})}function dc(e,t){const n=cc(e).scrollLeft;return t?t.left+n:So(Wr(e)).left+n}function ET(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function t5(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",u=Wr(r),c=t?lc(t.floating):!1;if(r===u||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=qr(1);const p=qr(0),m=Gr(r);if((m||!m&&!a)&&((vs(r)!=="body"||Za(u))&&(d=cc(r)),Gr(r))){const y=So(r);f=ks(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const T=u&&!m&&!a?ET(u,d):qr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+T.x,y:n.y*f.y-d.scrollTop*f.y+p.y+T.y}}function n5(e){return Array.from(e.getClientRects())}function r5(e){const t=Wr(e),n=cc(e),r=e.ownerDocument.body,o=Qn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Qn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+dc(e);const c=-n.scrollTop;return vr(r).direction==="rtl"&&(u+=Qn(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:u,y:c}}const yT=25;function i5(e,t){const n=Jn(e),r=Wr(e),o=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,c=0,d=0;if(o){a=o.width,u=o.height;const p=np();(!p||p&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const f=dc(r);if(f<=0){const p=r.ownerDocument,m=p.body,T=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,_=Math.abs(r.clientWidth-m.clientWidth-y);_<=yT&&(a-=_)}else f<=yT&&(a+=f);return{width:a,height:u,x:c,y:d}}const o5=new Set(["absolute","fixed"]);function s5(e,t){const n=So(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Gr(e)?ks(e):qr(1),u=e.clientWidth*a.x,c=e.clientHeight*a.y,d=o*a.x,f=r*a.y;return{width:u,height:c,x:d,y:f}}function bT(e,t,n){let r;if(t==="viewport")r=i5(e,n);else if(t==="document")r=r5(Wr(e));else if(Ar(t))r=s5(t,n);else{const o=gT(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ac(r)}function TT(e,t){const n=Di(e);return n===t||!Ar(n)||Cs(n)?!1:vr(n).position==="fixed"||TT(n,t)}function a5(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(c=>Ar(c)&&vs(c)!=="body"),o=null;const a=vr(e).position==="fixed";let u=a?Di(e):e;for(;Ar(u)&&!Cs(u);){const c=vr(u),d=tp(u);!d&&c.position==="fixed"&&(o=null),(a?!d&&!o:!d&&c.position==="static"&&!!o&&o5.has(o.position)||Za(u)&&!d&&TT(e,u))?r=r.filter(p=>p!==u):o=c,u=Di(u)}return t.set(e,r),r}function u5(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const u=[...n==="clippingAncestors"?lc(t)?[]:a5(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,p)=>{const m=bT(t,p,o);return f.top=Qn(m.top,f.top),f.right=Li(m.right,f.right),f.bottom=Li(m.bottom,f.bottom),f.left=Qn(m.left,f.left),f},bT(t,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function l5(e){const{width:t,height:n}=mT(e);return{width:t,height:n}}function c5(e,t,n){const r=Gr(t),o=Wr(t),a=n==="fixed",u=So(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=qr(0);function f(){d.x=dc(o)}if(r||!r&&!a)if((vs(t)!=="body"||Za(o))&&(c=cc(t)),r){const y=So(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else o&&f();a&&!r&&o&&f();const p=o&&!r&&!a?ET(o,c):qr(0),m=u.left+c.scrollLeft-d.x-p.x,T=u.top+c.scrollTop-d.y-p.y;return{x:m,y:T,width:u.width,height:u.height}}function op(e){return vr(e).position==="static"}function _T(e,t){if(!Gr(e)||vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wr(e)===n&&(n=n.ownerDocument.body),n}function ST(e,t){const n=Jn(e);if(lc(e))return n;if(!Gr(e)){let o=Di(e);for(;o&&!Cs(o);){if(Ar(o)&&!op(o))return o;o=Di(o)}return n}let r=_T(e,t);for(;r&&YD(r)&&op(r);)r=_T(r,t);return r&&Cs(r)&&op(r)&&!tp(r)?n:r||QD(e)||n}const d5=function(e){return Je(this,null,function*(){const t=this.getOffsetParent||ST,n=this.getDimensions,r=yield n(e.floating);return{reference:c5(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function f5(e){return vr(e).direction==="rtl"}const h5={convertOffsetParentRelativeRectToViewportRelativeRect:t5,getDocumentElement:Wr,getClippingRect:u5,getOffsetParent:ST,getElementRects:d5,getClientRects:n5,getDimensions:l5,getScale:ks,isElement:Ar,isRTL:f5};function xT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function p5(e,t){let n=null,r;const o=Wr(e);function a(){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),a();const f=e.getBoundingClientRect(),{left:p,top:m,width:T,height:y}=f;if(c||t(),!T||!y)return;const _=oc(m),w=oc(o.clientWidth-(p+T)),C=oc(o.clientHeight-(m+y)),A=oc(p),v={rootMargin:-_+"px "+-w+"px "+-C+"px "+-A+"px",threshold:Qn(0,Li(1,d))||1};let H=!0;function Y(D){const q=D[0].intersectionRatio;if(q!==d){if(!H)return u();q?u(!1,q):r=setTimeout(()=>{u(!1,1e-7)},1e3)}q===1&&!xT(f,e.getBoundingClientRect())&&u(),H=!1}try{n=new IntersectionObserver(Y,pe(F({},v),{root:o.ownerDocument}))}catch(D){n=new IntersectionObserver(Y,v)}n.observe(e)}return u(!0),a}function m5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=ip(e),p=o||a?[...f?eu(f):[],...eu(t)]:[];p.forEach(A=>{o&&A.addEventListener("scroll",n,{passive:!0}),a&&A.addEventListener("resize",n)});const m=f&&c?p5(f,n):null;let T=-1,y=null;u&&(y=new ResizeObserver(A=>{let[P]=A;P&&P.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var v;(v=y)==null||v.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let _,w=d?So(e):null;d&&C();function C(){const A=So(e);w&&!xT(w,A)&&n(),w=A,_=requestAnimationFrame(C)}return n(),()=>{var A;p.forEach(P=>{o&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),m==null||m(),(A=y)==null||A.disconnect(),y=null,d&&cancelAnimationFrame(_)}}const g5=HD,E5=zD,y5=FD,b5=$D,T5=BD,_5=MD,S5=jD,x5=(e,t,n)=>{const r=new Map,o=F({platform:h5},n),a=pe(F({},o.platform),{_c:r});return DD(e,t,pe(F({},o),{platform:a}))};function wT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return pe(F({},o),{toJSON:()=>o})}function w5(e){if(!e)return wT();const{x:t,y:n,width:r,height:o}=e;return wT(t,n,r,o)}function A5(e,t){return{contextElement:en(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?w5(r):n.getBoundingClientRect()}}}var tu=e=>({variable:e,reference:`var(${e})`}),pi={arrowSize:tu("--arrow-size"),arrowSizeHalf:tu("--arrow-size-half"),arrowBg:tu("--arrow-background"),transformOrigin:tu("--transform-origin"),arrowOffset:tu("--arrow-offset")},v5=e=>e==="top"||e==="bottom"?"y":"x";function C5(e,t){return{name:"transformOrigin",fn(n){var me,V,oe,ce,de;const{elements:r,middlewareData:o,placement:a,rects:u,y:c}=n,d=a.split("-")[0],f=v5(d),p=((me=o.arrow)==null?void 0:me.x)||0,m=((V=o.arrow)==null?void 0:V.y)||0,T=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,_=p+T/2,w=m+y/2,C=Math.abs(((oe=o.shift)==null?void 0:oe.y)||0),A=u.reference.height/2,P=y/2,v=(de=(ce=e.offset)==null?void 0:ce.mainAxis)!=null?de:e.gutter,H=typeof v=="number"?v+P:v!=null?v:P,Y=C>H,D={top:`${_}px calc(100% + ${H}px)`,bottom:`${_}px ${-H}px`,left:`calc(100% + ${H}px) ${w}px`,right:`${-H}px ${w}px`}[d],q=`${_}px ${u.reference.y+A-c}px`,re=!!e.overlap&&f==="y"&&Y;return r.floating.style.setProperty(pi.transformOrigin.variable,re?q:D),{data:{transformOrigin:re?q:D}}}}}var k5={name:"rects",fn({rects:e}){return{data:e}}},P5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[a]:`calc(100% + ${pi.arrowOffset.reference})`}),{}}}};function N5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var O5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function AT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function sp(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function I5(e,t,n){const r=e||t.createElement("div");return _5({element:r,padding:n.arrowPadding})}function R5(e,t){var n;if(!G6((n=t.offset)!=null?n:t.gutter))return g5(({placement:r})=>{var p,m,T,y;const o=((e==null?void 0:e.clientHeight)||0)/2,a=(m=(p=t.offset)==null?void 0:p.mainAxis)!=null?m:t.gutter,u=typeof a=="number"?a+o:a!=null?a:o,{hasAlign:c}=N5(r),d=c?void 0:t.shift,f=(y=(T=t.offset)==null?void 0:T.crossAxis)!=null?y:d;return Lh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function L5(e){if(!e.flip)return;const t=sp(e.boundary);return y5(pe(F({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function D5(e){if(!e.slide&&!e.overlap)return;const t=sp(e.boundary);return E5(pe(F({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:S5()}))}function M5(e){return b5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const a=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);o=Math.floor(o),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${c}px`),a.style.setProperty("--available-width",`${o}px`),a.style.setProperty("--available-height",`${r}px`)}})}function F5(e){var t;if(e.hideWhenDetached)return T5({strategy:"referenceHidden",boundary:(t=sp(e.boundary))!=null?t:"clippingAncestors"})}function B5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function U5(e,t,n={}){const r=A5(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},O5,n),a=t.querySelector("[data-part=arrow]"),u=[R5(a,o),L5(o),D5(o),I5(a,t.ownerDocument,o),P5(a),C5({gutter:o.gutter,offset:o.offset,overlap:o.overlap},a),M5(o),F5(o),k5],{placement:c,strategy:d,onComplete:f,onPositioned:p}=o,m=()=>Je(null,null,function*(){var H;if(!r||!t)return;const w=yield x5(r,t,{placement:c,middleware:u,strategy:d});f==null||f(w),p==null||p({placed:!0});const C=Es(t),A=AT(C,w.x),P=AT(C,w.y);t.style.setProperty("--x",`${A}px`),t.style.setProperty("--y",`${P}px`),o.hideWhenDetached&&(((H=w.middlewareData.hide)==null?void 0:H.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const v=t.firstElementChild;if(v){const Y=bs(v);t.style.setProperty("--z-index",Y.zIndex)}}),T=()=>Je(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),p==null||p({placed:!0})):yield m()}),y=B5(o.listeners),_=o.listeners?m5(r,t,T,y):r4;return T(),()=>{_==null||_(),p==null||p({placed:!1})}}function vT(e,t,n={}){const c=n,{defer:r}=c,o=mn(c,["defer"]),a=r?Yt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(U5(d,f,o))})),()=>{u.forEach(d=>d==null?void 0:d())}}var H5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function z5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:pi.arrowSize.reference,height:pi.arrowSize.reference,[pi.arrowSizeHalf.variable]:`calc(${pi.arrowSize.reference} / 2)`,[pi.arrowOffset.variable]:`calc(${pi.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?H5[t.split("-")[0]]:void 0,background:pi.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,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 Ps=new WeakMap,fc=new WeakMap,hc={},ap=0,CT=e=>e&&(e.host||CT(e.parentNode)),j5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=CT(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),$5=new Set(["script","output","status","next-route-announcer"]),V5=e=>$5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),q5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:o,followControlledElements:a=!0}=t,u=j5(n,Array.isArray(e)?e:[e]);hc[r]||(hc[r]=new WeakMap);const c=hc[r],d=[],f=new Set,p=new Set(u),m=y=>{!y||f.has(y)||(f.add(y),m(y.parentNode))};u.forEach(y=>{m(y),a&&en(y)&&Hb(y,_=>{m(_)})});const T=y=>{!y||p.has(y)||Array.prototype.forEach.call(y.children,_=>{if(f.has(_))T(_);else try{if(V5(_))return;const C=_.getAttribute(o)==="true",A=(Ps.get(_)||0)+1,P=(c.get(_)||0)+1;Ps.set(_,A),c.set(_,P),d.push(_),A===1&&C&&fc.set(_,!0),P===1&&_.setAttribute(r,""),C||_.setAttribute(o,"true")}catch(w){console.error("[zag-js > ariaHidden] cannot operate on ",_,w)}})};return T(n),f.clear(),ap++,()=>{d.forEach(y=>{const _=Ps.get(y)-1,w=c.get(y)-1;Ps.set(y,_),c.set(y,w),_||(fc.has(y)||y.removeAttribute(o),fc.delete(y)),w||y.removeAttribute(r)}),ap--,ap||(Ps=new WeakMap,Ps=new WeakMap,fc=new WeakMap,hc={})}},Y5=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,W5=(e,t=Y5(e),n="data-aria-hidden",r=!0)=>{if(t)return q5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},G5=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function kT(e,t={}){const{defer:n=!0}=t,r=n?G5:a=>a(),o=[];return o.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&o.push(W5(u))})),()=>{o.forEach(a=>a==null?void 0:a())}}function X5(e){const t={each(n){var r;for(let o=0;o<((r=e.frames)==null?void 0:r.length);o+=1){const a=e.frames[o];a&&n(a)}},addEventListener(n,r,o){return t.each(a=>{try{a.document.addEventListener(n,r,o)}catch(u){}}),()=>{try{t.removeEventListener(n,r,o)}catch(a){}}},removeEventListener(n,r,o){t.each(a=>{try{a.document.removeEventListener(n,r,o)}catch(u){}})}};return t}function K5(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t==null||t.addEventListener(n,r,o)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,o)}catch(a){}}},removeEventListener:(n,r,o)=>{try{t==null||t.removeEventListener(n,r,o)}catch(a){}}}}var PT="pointerdown.outside",NT="focus.outside";function Q5(e){for(const t of e)if(en(t)&&Vr(t))return!0;return!1}var OT=e=>"clientY"in e;function J5(e,t){if(!OT(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 Z5(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function IT(e,t){if(!t||!OT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,a=o&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},c={x:e.clientX,y:e.clientY};return Z5(u,c)?r||a:!1}function eM(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:a,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=$r(e),f=Es(e),p=X5(f),m=K5(f);function T(v,H){if(!en(H)||!H.isConnected||gs(e,H)||J5(e,v)||c&&Ub(e,H))return!1;const Y=d.querySelector(`[aria-controls="${e.id}"]`);if(Y){const q=$h(Y);if(IT(v,q))return!1}const D=$h(e);return IT(v,D)?!1:!(n!=null&&n(H))}const y=new Set,_=yo(e==null?void 0:e.getRootNode());function w(v){function H(Y){var me,V;const D=u&&!zb()?Yt:oe=>oe(),q=Y!=null?Y:v,re=(V=(me=q==null?void 0:q.composedPath)==null?void 0:me.call(q))!=null?V:[q==null?void 0:q.target];D(()=>{const oe=_?re[0]:wr(v);if(!(!e||!T(v,oe))){if(o||a){const ce=Rh(o,a);e.addEventListener(PT,ce,{once:!0})}RT(e,PT,{bubbles:!1,cancelable:!0,detail:{originalEvent:q,contextmenu:B4(q),focusable:Q5(re),target:oe}})}})}v.pointerType==="touch"?(y.forEach(Y=>Y()),y.add(tn(d,"click",H,{once:!0})),y.add(m.addEventListener("click",H,{once:!0})),y.add(p.addEventListener("click",H,{once:!0}))):H()}const C=new Set,A=setTimeout(()=>{C.add(tn(d,"pointerdown",w,!0)),C.add(m.addEventListener("pointerdown",w,!0)),C.add(p.addEventListener("pointerdown",w,!0))},0);function P(v){(u?Yt:Y=>Y())(()=>{var q,re;const Y=(re=(q=v==null?void 0:v.composedPath)==null?void 0:q.call(v))!=null?re:[v==null?void 0:v.target],D=_?Y[0]:wr(v);if(!(!e||!T(v,D))){if(r||a){const me=Rh(r,a);e.addEventListener(NT,me,{once:!0})}RT(e,NT,{bubbles:!1,cancelable:!0,detail:{originalEvent:v,contextmenu:!1,focusable:Vr(D),target:D}})}})}return zb()||(C.add(tn(d,"focusin",P,!0)),C.add(m.addEventListener("focusin",P,!0)),C.add(p.addEventListener("focusin",P,!0))),()=>{clearTimeout(A),y.forEach(v=>v()),C.forEach(v=>v())}}function tM(e,t){const{defer:n}=t,r=n?Yt:a=>a(),o=[];return o.push(r(()=>{const a=typeof e=="function"?e():e;o.push(eM(a,t))})),()=>{o.forEach(a=>a==null?void 0:a())}}function RT(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function nM(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return tn($r(e),"keydown",n,{capture:!0})}var LT="layer:request-dismiss",dr={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=>gs(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>gs(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=>dr.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];iM(e,LT,o=>{var a;(a=r.requestDismiss)==null||a.call(r,o),o.defaultPrevented||r==null||r.dismiss()}),rM(e,LT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function rM(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function iM(e,t,n){e.addEventListener(t,n,{once:!0})}var DT;function MT(){dr.layers.forEach(({node:e})=>{e.style.pointerEvents=dr.isBelowPointerBlockingLayer(e)?"none":"auto"})}function oM(e){e.style.pointerEvents=""}function sM(e,t){const n=$r(e),r=[];return dr.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(DT=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(o=>{const[a,u]=aD(()=>{const c=o();return en(c)?c:null},{timeout:1e3});a.then(c=>r.push(Zl(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{dr.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=DT,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function aM(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Dh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:a,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:o};dr.add(f),MT();function p(w){var A,P;const C=wr(w.detail.originalEvent);dr.isBelowPointerBlockingLayer(e)||dr.isInBranch(C)||((A=t.onPointerDownOutside)==null||A.call(t,w),(P=t.onInteractOutside)==null||P.call(t,w),!w.defaultPrevented&&(c&&console.log("onPointerDownOutside:",w.detail.originalEvent),r==null||r()))}function m(w){var A,P;const C=wr(w.detail.originalEvent);dr.isInBranch(C)||((A=t.onFocusOutside)==null||A.call(t,w),(P=t.onInteractOutside)==null||P.call(t,w),!w.defaultPrevented&&(c&&console.log("onFocusOutside:",w.detail.originalEvent),r==null||r()))}function T(w){var C;dr.isTopMost(e)&&((C=t.onEscapeKeyDown)==null||C.call(t,w),!w.defaultPrevented&&r&&(w.preventDefault(),r()))}function y(w){var v;if(!e)return!1;const C=typeof u=="function"?u():u,A=Array.isArray(C)?C:[C],P=(v=t.persistentElements)==null?void 0:v.map(H=>H()).filter(en);return P&&A.push(...P),A.some(H=>gs(H,w))||dr.isInNestedLayer(e,w)}const _=[a?sM(e,t.persistentElements):void 0,nM(e,T),tM(e,{exclude:y,onFocusOutside:m,onPointerDownOutside:p,defer:t.defer})];return()=>{dr.remove(e),MT(),oM(e),_.forEach(w=>w==null?void 0:w())}}function FT(e,t){const{defer:n}=t,r=n?Yt:a=>a(),o=[];return o.push(r(()=>{const a=ps(e)?e():e;o.push(aM(a,t))})),()=>{o.forEach(a=>a==null?void 0:a())}}var uM=Object.defineProperty,lM=(e,t,n)=>t in e?uM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vt=(e,t,n)=>lM(e,typeof t!="symbol"?t+"":t,n),BT={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()}},cM=[],dM=class{constructor(e,t){vt(this,"trapStack"),vt(this,"config"),vt(this,"doc"),vt(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),vt(this,"portalContainers",new Set),vt(this,"listenerCleanups",[]),vt(this,"handleFocus",r=>{const o=wr(r),a=this.findContainerIndex(o,r)>=0;if(a||Xl(o))a&&(this.state.mostRecentlyFocusedNode=o);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(Xa(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const p=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);p>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?p+1<f.length&&(u=f[p+1],c=!1):p-1>=0&&(u=f[p-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>Xa(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}),vt(this,"handlePointerDown",r=>{const o=wr(r);if(!(this.findContainerIndex(o,r)>=0)){if(ru(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ru(this.config.allowOutsideClick,r)||r.preventDefault()}}),vt(this,"handleClick",r=>{const o=wr(r);this.findContainerIndex(o,r)>=0||ru(this.config.clickOutsideDeactivates,r)||ru(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),vt(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const o=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:o});if(!a)return;nu(r)&&r.preventDefault(),this.tryFocus(a)}}),vt(this,"handleEscapeKey",r=>{fM(r)&&ru(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),vt(this,"_mutationObserver"),vt(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(o=>{o.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),o.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 P4(f)?!0:f.id&&!this.state.containers.some(p=>p.contains(f))?N4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),vt(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(o=>{var a;(a=this._mutationObserver)==null||a.observe(o,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(o=>{this.observePortalContainer(o)}))}),vt(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Vr(r)){const o=ys(this.doc);if(o&&this.findContainerIndex(o)>=0)r=o;else{const a=this.state.tabbableGroups[0];r=a&&a.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}),vt(this,"tryFocus",r=>{if(r!==!1&&r!==ys(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,hM(r)&&r.select()}}),vt(this,"deactivate",r=>{if(!this.state.active)return this;const o=F({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(),BT.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(o,"onDeactivate"),u=this.getOption(o,"onPostDeactivate"),c=this.getOption(o,"checkCanReturnFocus"),d=this.getOption(o,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{UT(()=>{if(d){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(p)}u==null||u()})};if(d&&c){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(p).then(f,f),this}return f(),this}),vt(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,o==null||o(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),vt(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,o==null||o(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),vt(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),vt(this,"getReturnFocusNode",r=>{const o=this.getNodeForOption("setReturnFocus",{params:[r]});return o||(o===!1?!1:r)}),vt(this,"getOption",(r,o,a)=>r&&r[o]!==void 0?r[o]:this.config[a||o]),vt(this,"getNodeForOption",(r,{hasFallback:o=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),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&&!o)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),vt(this,"findNextNavNode",r=>{const{event:o,isBackward:a=!1}=r,u=r.target||wr(o);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,o),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let p=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Vr(u)&&!bo(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(p=d),p>=0){const m=p===0?this.state.tabbableGroups.length-1:p-1,T=this.state.tabbableGroups[m];c=Xa(u)>=0?T.lastTabbableNode:T.lastDomTabbableNode}else nu(o)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let p=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Vr(u)&&!bo(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(p=d),p>=0){const m=p===this.state.tabbableGroups.length-1?0:p+1,T=this.state.tabbableGroups[m];c=Xa(u)>=0?T.firstTabbableNode:T.firstDomTabbableNode}else nu(o)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||cM;const n=F({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return nu(r)&&!r.shiftKey},isKeyBackward(r){return nu(r)&&r.shiftKey}},t);this.doc=n.document||$r(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=>{v4(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:o})=>r.contains(e)||(n==null?void 0:n.includes(r))||o.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?Ub(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Ts(e,{getShadowRoot:this.config.getShadowRoot}),n=Gb(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],o=t[t.length-1],a=r,u=o;let c=!1;for(let f=0;f<t.length;f++)if(Xa(t[f])>0){c=!0;break}function d(f,p=!0){const m=t.indexOf(f);if(m>=0)return t[m+(p?1:-1)];const T=n.indexOf(f);if(!(T<0)){if(p){for(let y=T+1;y<n.length;y++)if(bo(n[y]))return n[y]}else for(let y=T-1;y>=0;y--)if(bo(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,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 BT.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?UT(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(tn(this.doc,"focusin",this.handleFocus,!0),tn(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),tn(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),tn(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),tn(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),tn(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=ys(this.doc),t==null||t();const o=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(o,o),this):(o(),this)}},nu=e=>e.key==="Tab",ru=(e,...t)=>typeof e=="function"?e(...t):e,fM=e=>!e.isComposing&&e.key==="Escape",UT=e=>setTimeout(e,0),hM=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function HT(e,t={}){let n;const r=Yt(()=>{const o=typeof e=="function"?e():e;if(o){n=new dM(o,pe(F({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o},t),{document:$r(o)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var up="data-scroll-lock";function pM(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function zT(e){const t=bs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function jT(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:o}=t;if(o.hasAttribute(up))return;const u=zT(r)||zT(o),c=n.innerWidth-r.clientWidth;o.setAttribute(up,"");const d=()=>oD(r,"--scrollbar-width",`${c}px`),f=pM(r),p=()=>{const _={overflow:"hidden"};return!u&&c>0&&(_[f]=`${c}px`),Zl(o,_)},m=()=>{var Y,D;const{scrollX:_,scrollY:w,visualViewport:C}=n,A=(Y=C==null?void 0:C.offsetLeft)!=null?Y:0,P=(D=C==null?void 0:C.offsetTop)!=null?D:0,v={position:"fixed",overflow:"hidden",top:`${-(w-Math.floor(P))}px`,left:`${-(_-Math.floor(A))}px`,right:"0"};!u&&c>0&&(v[f]=`${c}px`);const H=Zl(o,v);return()=>{H==null||H(),n.scrollTo({left:_,top:w,behavior:"instant"})}},T=[d(),Kl()?m():p()];return()=>{T.forEach(_=>_==null?void 0:_()),o.removeAttribute(up)}}var mM=_o("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Xr=mM.build(),$T=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},VT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},lp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},qT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},gM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},cp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},dp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},EM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},YT=e=>e.getById($T(e)),Ns=e=>e.getById(VT(e)),Os=e=>e.getById(lp(e)),WT=e=>e.getById(qT(e)),yM=e=>e.getById(cp(e)),bM=e=>e.getById(dp(e));function TM(e,t){const{state:n,context:r,send:o,computed:a,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),p=a("currentPortalled"),m=r.get("renderedElements"),T=z5(pe(F({},u("positioning")),{placement:f}));return{portalled:p,open:d,setOpen(y){n.matches("open")!==y&&o({type:y?"OPEN":"CLOSE"})},reposition(y={}){o({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(pe(F({id:gM(c)},Xr.arrow.attrs),{dir:u("dir"),style:T.arrow}))},getArrowTipProps(){return t.element(pe(F({},Xr.arrowTip.attrs),{dir:u("dir"),style:T.arrowTip}))},getAnchorProps(){return t.element(pe(F({},Xr.anchor.attrs),{dir:u("dir"),id:$T(c)}))},getTriggerProps(){return t.button(pe(F({},Xr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:VT(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":lp(c),onPointerDown(y){jb(y)&&M4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||o({type:"TOGGLE"})},onBlur(y){o({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(pe(F({},Xr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(pe(F({id:qT(c)},Xr.positioner.attrs),{dir:u("dir"),style:T.floating}))},getContentProps(){return t.element(pe(F({},Xr.content.attrs),{dir:u("dir"),id:lp(c),tabIndex:-1,role:"dialog","aria-modal":Mb(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":ms(d),"aria-labelledby":m.title?cp(c):void 0,"aria-describedby":m.description?dp(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(pe(F({},Xr.title.attrs),{id:cp(c),dir:u("dir")}))},getDescriptionProps(){return t.element(pe(F({},Xr.description.attrs),{id:dp(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(pe(F({},Xr.closeTrigger.attrs),{dir:u("dir"),id:EM(c),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),o({type:"CLOSE"}))}}))}}}var _M={props({props:e}){return pe(F({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:F({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 a;e.set("currentPlacement",t("positioning").placement);const r=(a=YT(n))!=null?a:Ns(n);return vT(r,()=>WT(n),pe(F({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>Os(n);let o=!0;return FT(r,{type:"popover",pointerBlocking:t("modal"),exclude:Ns(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(o=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:o})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:rD(()=>Os(t),{triggerElement:Ns(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?kT(()=>[Os(t),Ns(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return jT(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?HT(()=>Os(t),{initialFocus:()=>Xb({root:Os(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const o=(u=YT(n))!=null?u:Ns(n);vT(o,()=>WT(n),pe(F(F({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){Yt(()=>{Object.assign(e.get("renderedElements"),{title:!!yM(t),description:!!bM(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||Yt(()=>{const n=Xb({root:Os(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,o;const n=(o=e.restoreFocus)!=null?o:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||Yt(()=>{const a=Ns(t);a==null||a.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})}}}};xs()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[qU,pc]=To({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[YU,fp]=To({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),SM=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,dir:r,getRootNode:n},e),a=tc(_M,o);return TM(a,Yh)},xM=e=>{const[t,u]=iT(e),c=u,{children:n}=c,r=mn(c,["children"]),o=SM(r),a=Xh(Wt({present:o.open},t));return x.jsx(yD,{value:o,children:x.jsx(tT,{value:a,children:n})})},GT=B.forwardRef((e,t)=>{const n=Gh(),r=Ka(),o=Wt(pe(F({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return x.jsx(Sn.button,pe(F({},o),{ref:t}))});GT.displayName="PopoverTrigger";function wM(e){return wt({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 AM(e){return wt({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 vM(e){return wt({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 CM(e){return wt({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 kM(e){return wt({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 PM(e){return wt({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 hp(e){return wt({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 XT(e){return wt({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 NM=({className:e,componentType:t,children:n})=>{const[r,o]=B.useState(!1),{globalClassName:a}=rt(),u=f=>{o(f.open)},c=B.useCallback(()=>{o(!1)},[]),d=B.useMemo(()=>({closeMenu:c}),[c]);return x.jsxs(xM,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[x.jsx(GT,{"aria-label":`Overflow menu for ${t}`,className:W(`${z}-overflow-menu-button-trigger`,`${z}-icon-button`,a,e,`cim-${t}-component`),children:x.jsx(XT,{})}),x.jsx(rT,{children:x.jsx(nT,{className:W(`${z}-overflow-menu-list`,a,`cim-${t}-component`),children:x.jsx(Pb.Provider,{value:d,children:n})})})]})};function KT(e){return wt({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 QT(e){return wt({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[OM,xo]=To({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),JT=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getControlProps(),e);return x.jsx(Sn.div,pe(F(F({},r),e),{ref:t}))});JT.displayName="CarouselControl";const ZT=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["readOnly","index"]),o=xo(),a=Wt(o.getIndicatorProps(n),r);return x.jsx(Sn.button,pe(F({},a),{ref:t}))});ZT.displayName="CarouselIndicator";const e_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getIndicatorGroupProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});e_.displayName="CarouselIndicatorGroup";const t_=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["index","snapAlign"]),o=xo(),a=Wt(o.getItemProps(n),r);return x.jsx(Sn.div,pe(F({},a),{ref:t}))});t_.displayName="CarouselItem";const n_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getItemGroupProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});n_.displayName="CarouselItemGroup";const r_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getNextTriggerProps(),e);return x.jsx(Sn.button,pe(F({},r),{ref:t}))});r_.displayName="CarouselNextTrigger";const i_=B.forwardRef((e,t)=>{const n=xo(),r=Wt(n.getPrevTriggerProps(),e);return x.jsx(Sn.button,pe(F({},r),{ref:t}))});i_.displayName="CarouselPrevTrigger";function IM(e){const t=bs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),o=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(T,y){let _=parseFloat(T);return/%/.test(T)&&(_/=100,_*=y),Number.isNaN(_)?0:_}let d=c(r,n.width),f=c(o,n.height),p=c(a,n.width),m=c(u,n.height);return{x:{before:d,after:p},y:{before:f,after:m}}}function RM(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 o_(e){let t=[];for(const n of e.children)t=t.concat(n,o_(n));return t}function s_(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},o=t?o_(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",c=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const p of o){const m=p.getBoundingClientRect();if(!RM(n,m,u))continue;const T=bs(p);let[y,_]=T.getPropertyValue("scroll-snap-align").split(" ");typeof _=="undefined"&&(_=y);const w=a==="x"?_:y,C=m[c]-n[c]+e[f];switch(w){case"none":break;case"start":r[a].start.push({node:p,position:C});break;case"center":r[a].center.push({node:p,position:C+m[d]/2});break;case"end":r[a].end.push({node:p,position:C+m[d]});break}}}return r}function a_(e){const t=e.getBoundingClientRect(),n=IM(e),r=s_(e),o={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:u_([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(l_(0,o.x))),y:u_([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(l_(0,o.y)))}}function LM(e,t,n){const r=s_(e),o=[...r[t].start,...r[t].center,...r[t].end];for(const a of o)if(n(a.node))return a.position}var u_=e=>[...new Set(e)],l_=(e,t)=>n=>Math.max(e,Math.min(t,n)),DM=_o("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),mi=DM.build(),MM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},FM=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`carousel:${e.id}:item:${t}`},mc=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},BM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},UM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},HM=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},c_=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?o:`carousel:${e.id}:indicator:${t}`},Un=e=>e.getById(mc(e)),d_=e=>iD(Un(e),"[data-part=item]"),zM=(e,t)=>e.getById(c_(e,t)),f_=e=>{const t=Un(e);if(!t)return;const n=Ts(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function jM(e,t){const{state:n,context:r,computed:o,send:a,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),p=o("canScrollNext"),m=o("canScrollPrev"),T=o("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),_=r.get("page"),w=c("slidesPerPage"),C=c("padding"),A=c("translations");return{isPlaying:d,isDragging:f,page:_,pageSnapPoints:y,canScrollNext:p,canScrollPrev:m,getProgress(){return _/y.length},scrollToIndex(P,v){a({type:"INDEX.SET",index:P,instant:v})},scrollTo(P,v){a({type:"PAGE.SET",index:P,instant:v})},scrollNext(P){a({type:"PAGE.NEXT",instant:P})},scrollPrev(P){a({type:"PAGE.PREV",instant:P})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(P){return Array.from(r.get("slidesInView")).includes(P)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(pe(F({},mi.root.attrs),{id:MM(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":w,"--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(pe(F({},mi.itemGroup.attrs),{id:mc(u),"data-orientation":c("orientation"),"data-dragging":ms(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(P){gs(P.currentTarget,wr(P))&&a({type:"VIEWPORT.FOCUS"})},onBlur(P){gs(P.currentTarget,P.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(P){if(P.defaultPrevented||!c("allowMouseDrag")||!jb(P))return;const v=wr(P);Vr(v)&&v!==P.currentTarget||(P.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:i4(P=>{const v=c("orientation")==="horizontal"?"deltaX":"deltaY";P[v]<0&&!o("canScrollPrev")||P[v]>0&&!o("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[T?"x":"y",c("snapType")].join(" "),gridAutoFlow:T?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[T?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[T?"scrollPaddingInline":"scrollPaddingBlock"]:C,[T?"paddingInline":"paddingBlock"]:C,[T?"overflowX":"overflowY"]:"auto"}}))},getItemProps(P){const v=r.get("slidesInView").includes(P.index);return t.element(pe(F({},mi.item.attrs),{id:FM(u,P.index),dir:c("dir"),role:"group","data-index":P.index,"data-inview":ms(v),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":A.item(P.index,c("slideCount")),"aria-hidden":Mb(!v),style:{scrollSnapAlign:(()=>{var re;const H=(re=P.snapAlign)!=null?re:"start",Y=c("slidesPerMove"),D=Y==="auto"?Math.floor(c("slidesPerPage")):Y;return(P.index+D)%D===0?H:void 0})()}}))},getControlProps(){return t.element(pe(F({},mi.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(pe(F({},mi.prevTrigger.attrs),{id:UM(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":A.prevTrigger,"data-orientation":c("orientation"),"aria-controls":mc(u),onClick(P){P.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(pe(F({},mi.nextTrigger.attrs),{dir:c("dir"),id:BM(u),type:"button","aria-label":A.nextTrigger,"data-orientation":c("orientation"),"aria-controls":mc(u),disabled:!p,onClick(P){P.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(pe(F({},mi.indicatorGroup.attrs),{dir:c("dir"),id:HM(u),"data-orientation":c("orientation"),onKeyDown(P){if(P.defaultPrevented)return;const v="indicator",H={ArrowDown(q){T||(a({type:"PAGE.NEXT",src:v}),q.preventDefault())},ArrowUp(q){T||(a({type:"PAGE.PREV",src:v}),q.preventDefault())},ArrowRight(q){T&&(a({type:"PAGE.NEXT",src:v}),q.preventDefault())},ArrowLeft(q){T&&(a({type:"PAGE.PREV",src:v}),q.preventDefault())},Home(q){a({type:"PAGE.SET",index:0,src:v}),q.preventDefault()},End(q){a({type:"PAGE.SET",index:y.length-1,src:v}),q.preventDefault()}},Y=z4(P,{dir:c("dir"),orientation:c("orientation")}),D=H[Y];D==null||D(P)}}))},getIndicatorProps(P){return t.button(pe(F({},mi.indicator.attrs),{dir:c("dir"),id:c_(u,P.index),type:"button","data-orientation":c("orientation"),"data-index":P.index,"data-readonly":ms(P.readOnly),"data-current":ms(P.index===_),"aria-label":A.indicator(P.index),onClick(v){v.defaultPrevented||P.readOnly||a({type:"PAGE.SET",index:P.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(pe(F({},mi.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":ms(d),"aria-label":d?A.autoplayStop:A.autoplayStart,onClick(P){P.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var $M={props({props:e}){return c4(e,["slideCount"],"carousel"),pe(F({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:F({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 a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:VM(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 W6(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:o}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{o({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{o({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(Un(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=Un(e);if(!n)return;const r=e.getWin(),o=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),f_(e)});return f_(e),o.observe(n,{childList:!0,subtree:!0}),()=>o.disconnect()},trackSlideResize({scope:e,send:t}){if(!Un(e))return;const r=e.getWin(),o=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};Yt(()=>{o(),Yt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(o);return d_(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=Un(e),o=e.getWin(),a=new o.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var T;const p=f.target,m=Number((T=p.dataset.index)!=null?T:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?j6(d,m):$6(d,m)},n.get("slidesInView"));n.set("slidesInView",V6(c))},{root:r,threshold:t("inViewThreshold")});return d_(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=Un(n);return r?tn(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 tn(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return tD(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 tn(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.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:o}){var f;const a=t.instant?"instant":"smooth",u=Lb((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=Un(n);if(!c)return;const d=r("isHorizontal")?"left":"top";o(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=Un(t);if(!r)return;const o=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-o)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),o=Ob(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),o=q6(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const o=Un(r);if(!o)return;const a=LM(o,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-a)<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=Lb(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=Un(n);if(!r)return;const o=a_(r);e.set("pageSnapPoints",t("isHorizontal")?o.x:o.y)},disableScrollSnap({scope:e}){const t=Un(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=Un(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=Un(e);if(!r)return;const o=r.scrollLeft,a=r.scrollTop,u=a_(r),c=u.x.reduce((f,p)=>Math.abs(p-o)<Math.abs(f-o)?p:f,u.x[0]),d=u.y.reduce((f,p)=>Math.abs(p-a)<Math.abs(f-a)?p:f,u.y[0]);Yt(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const p=r.dataset.scrollSnapType;p&&(r.style.setProperty("scroll-snap-type",p),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=zM(n,e.get("page"));r&&Yt(()=>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 VM(e,t,n){if(e==null||n<=0)return[];const r=[],o=t==="auto"?Math.floor(n):t;if(o<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=o)r.push(a);return r}xs()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),xs()(["index","readOnly"]),xs()(["index","snapAlign"]);const qM=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,dir:r,getRootNode:n},e),a=tc($M,o);return jM(a,Yh)},h_=B.forwardRef((e,t)=>{const[n,r]=Qa()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),o=qM(n),a=Wt(o.getRootProps(),r);return x.jsx(OM,{value:o,children:x.jsx(Sn.div,pe(F({},a),{ref:t}))})});h_.displayName="CarouselRoot";const YM=180,WM=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},GM=({globalClassName:e,className:t,itemMinWidth:n=YM,spacing:r="0.5rem",loop:o=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:c=!0,onPageChange:d,ariaLabel:f="Product carousel",children:p})=>{const m=Array.from(p).map((re,me)=>({node:re,key:B.isValidElement(re)&&re.key!=null?re.key:`carousel-item-${me}`})),T=m.length,y=B.useRef(null),[_,w]=B.useState(0),{width:C}=jC();B.useLayoutEffect(()=>{y.current&&w(y.current.getBoundingClientRect().width)},[C,T]);const A=WM(r),P=n+A,v=_>0?(_+A)/P:1,H=Math.max(1,Math.floor(v));if(T===0)return null;const Y=T>H,D=Math.ceil(T/H),q=Y?Math.max(1,v):H;return x.jsxs(h_,{ref:y,className:W(e,t,`${z}-carousel`),slidesPerPage:q,slidesPerMove:H,spacing:r,loop:o,allowMouseDrag:a,slideCount:T,onPageChange:d,"aria-label":f,children:[x.jsx(n_,{className:W(e,`${z}-carousel__item-group`,{"carousel-row-container":!Y}),children:m.map(({node:re,key:me},V)=>x.jsx(t_,{index:V,className:W(e,`${z}-carousel__item`),children:re},me))}),c&&Y&&x.jsxs(JT,{className:W(e,`${z}-carousel__control`),children:[x.jsx(i_,{className:W(e,`${z}-carousel__prev-trigger`),"aria-label":"Previous slide",children:x.jsx(vM,{size:"16px"})}),x.jsx(r_,{className:W(e,`${z}-carousel__next-trigger`),"aria-label":"Next slide",children:x.jsx(CM,{size:"16px"})})]}),u&&Y&&x.jsx(e_,{className:W(e,`${z}-carousel__indicator-group`),children:Array.from({length:D},(re,me)=>x.jsx(ZT,{index:me,className:W(e,`${z}-carousel__indicator`),"aria-label":`Go to slide group ${me+1}`},me))})]})},[XM,KM]=To({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),QM=e=>Qa()(e,["lazyMount","unmountOnExit"]),[JM,iu]=To({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),p_=B.forwardRef((e,t)=>{const n=iu(),r=KM(),o=Xh(pe(F({},r),{present:n.open})),a=Wt(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:x.jsx(Sn.div,pe(F({},a),{ref:nc(o.ref,t)}))});p_.displayName="DialogBackdrop";const pp=B.forwardRef((e,t)=>{const n=iu(),r=Ka(),o=Wt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:x.jsx(Sn.div,pe(F({},o),{ref:nc(r.ref,t)}))});pp.displayName="DialogContent";const mp=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getDescriptionProps(),e);return x.jsx(Sn.div,pe(F({},r),{ref:t}))});mp.displayName="DialogDescription";const gp=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getPositionerProps(),e);return Ka().unmounted?null:x.jsx(Sn.div,pe(F({},r),{ref:t}))});gp.displayName="DialogPositioner";var ZM=_o("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),wo=ZM.build(),m_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},g_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Ep=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},E_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},yp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},bp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},y_=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},gc=e=>e.getById(Ep(e)),e8=e=>e.getById(m_(e)),t8=e=>e.getById(g_(e)),n8=e=>e.getById(E_(e)),r8=e=>e.getById(yp(e)),i8=e=>e.getById(bp(e)),o8=e=>e.getById(y_(e));function s8(e,t){const{state:n,send:r,context:o,prop:a,scope:u}=e,c=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(pe(F({},wo.trigger.attrs),{dir:a("dir"),id:E_(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Ep(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(pe(F({},wo.backdrop.attrs),{dir:a("dir"),hidden:!d,id:g_(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(pe(F({},wo.positioner.attrs),{dir:a("dir"),id:m_(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=o.get("rendered");return t.element(pe(F({},wo.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:Ep(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:yp(u),"aria-describedby":f.description?bp(u):void 0}))},getTitleProps(){return t.element(pe(F({},wo.title.attrs),{dir:a("dir"),id:yp(u)}))},getDescriptionProps(){return t.element(pe(F({},wo.description.attrs),{dir:a("dir"),id:bp(u)}))},getCloseTriggerProps(){return t.button(pe(F({},wo.closeTrigger.attrs),{dir:a("dir"),id:y_(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var a8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>o8(t):void 0,o=typeof e.modal=="boolean"?e.modal:!0;return F({role:"dialog",modal:o,trapFocus:o,preventScroll:o,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 FT(()=>gc(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[n8(e)],onInteractOutside(o){var a;(a=n("onInteractOutside"))==null||a(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(o){var a;(a=n("onEscapeKeyDown"))==null||a(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return jT(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?HT(()=>gc(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,a;return(a=(o=t("finalFocusEl"))==null?void 0:o())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?kT(()=>[gc(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){Yt(()=>{e.set("rendered",{title:!!r8(t),description:!!i8(t)})})},syncZIndex({scope:e}){Yt(()=>{const t=gc(e);if(!t)return;const n=bs(t);[e8(e),t8(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex),o==null||o.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})}}}};xs()(["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 u8=e=>{const t=B.useId(),{getRootNode:n}=pc(),{dir:r}=fp(),o=F({id:t,getRootNode:n,dir:r},e),a=tc(a8,o);return s8(a,Yh)},b_=e=>{const[t,c]=iT(e),d=c,{children:n}=d,r=mn(d,["children"]),[o]=QM(t),a=u8(r),u=Xh(Wt({present:a.open},t));return x.jsx(JM,{value:a,children:x.jsx(XM,{value:o,children:x.jsx(tT,{value:u,children:n})})})},T_=B.forwardRef((e,t)=>{const n=iu(),r=Wt(n.getTitleProps(),e);return x.jsx(Sn.h2,pe(F({},r),{ref:t}))});T_.displayName="DialogTitle";const l8=({children:e})=>{const[t,n]=B.useState(!1),r=B.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),o=B.useMemo(()=>({isOpen:t}),[t]);return x.jsx(Ih.Provider,{value:r,children:x.jsx(kb.Provider,{value:o,children:e})})},__=()=>B.useContext(kb),S_=()=>{const e=B.useContext(Ih);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},c8=`${z}-overflow-menu-button-trigger`,d8=({componentType:e,children:t})=>{const{isOpen:n}=__(),{closeMenu:r}=S_(),{globalClassName:o}=rt(),a=B.useRef(null);return B.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${c8}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?x.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:W(`${z}-overflow-panel`,o,`cim-${e}-component`),children:t}):null},f8=({componentType:e,className:t})=>{const{toggleMenu:n}=S_(),{isOpen:r}=__(),{globalClassName:o}=rt();return x.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:W(`${z}-overflow-menu-button-trigger`,`${z}-icon-button`,o,t,`cim-${e}-component`),onClick:n,children:x.jsx(XT,{})})},Tp=()=>{const{status:e,entryType:t}=sr(),{messages:n}=ar(),r=t==="ask_cim",o=!!(n&&n.length>0),a=!!e.isOpen;return r&&a||!r&&a&&o},h8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{previousComponentType:r}=sr(),o=hs(),a=()=>{yl(r||"dialog"),o()};return t?x.jsx(ci,{className:W(n,`${z}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:x.jsx(KT,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[x.jsx(KT,{}),"Show ",r||"dialog"]})},p8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{isModalFullscreen:r}=sr(),o=hs(),a=()=>{vf(!r),o()},u=r?Jk:Zk,c="Toggle Fullscreen";return t?x.jsx(ci,{ariaLabel:c,title:c,className:W(n,`${z}-modal-fullscreen-button`,`cim-${e}-component`),icon:x.jsx(u,{}),onClick:a}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[x.jsx(u,{}),c]})},m8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),{dialogPosition:r}=sr(),o=hs(),a=r==="bottom-left",u=()=>{Cf(a?"bottom-right":"bottom-left"),o()},c=a?AM:wM,d=a?"Move right":"Move left";return t?x.jsx(ci,{className:W(n,`${z}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:x.jsx(c,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[x.jsx(c,{}),d]})},x_=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:o,globalClassName:a,mode:u,enableDownloadTranscript:c}=rt(),{mode:d}=sr(),f=u==="messaging"&&c&&!!r,p=d==="standalone",m=e==="modal",T=m?h8:w_,y=m?p8:m8,_=B.useMemo(()=>o?tP(o):{},[o]);return x.jsx(l8,{children:x.jsxs("div",{className:W(a,`${z}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[x.jsxs("div",{className:W(a,`${z}-${e}-header`,{standalone:p,embedded:!p}),style:_,children:[(o==null?void 0:o.logoUrl)&&x.jsx("img",{alt:"",role:"img",className:W(a,`${z}-${e}-logo`,{standalone:p,embedded:!p}),src:o.logoUrl}),x.jsx(T_,{className:W(a,`${z}-${e}-title`,{standalone:p,embedded:!p}),children:o==null?void 0:o.headerText}),x.jsxs("div",{className:W(a,`${z}-${e}-controls`),children:[x.jsx(T,{componentType:e,isIcon:!0}),x.jsx(f8,{componentType:e}),x.jsx(H1,{className:W(a,`cim-${e}-component`),onClick:n})]})]}),x.jsxs(d8,{componentType:e,children:[x.jsx(y,{componentType:e}),x.jsx(b8,{componentType:e}),x.jsx(Nb,{componentType:e,onClearChat:t}),f&&x.jsx(g8,{componentType:e,onDownloadTranscript:r})]})]})})},g8=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=rt(),r=hs(),[o,a]=B.useState(!1),u=()=>Je(null,null,function*(){if(!o){a(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{a(!1)}}});return x.jsxs("button",{className:W(`${z}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:o,children:[x.jsx(U6,{}),"Download transcript"]})},E8={sparkle:hp,plus:kM,"paper-plane":PM},_p=({icon:e,className:t})=>{const n=E8[e];return n?x.jsx(n,{className:t,"aria-hidden":"true"}):null},y8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:o,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=rt(),c=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=o?"standalone":"embedded",p=_=>()=>{a(_)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},T=_=>x.jsxs(x.Fragment,{children:[c&&x.jsx(_p,{icon:c,className:`${z}-suggestion-button-icon`}),x.jsx("span",{children:_})]});return x.jsx("div",{className:W(t,`${z}-suggestion-container ${f}`,e),children:n.map(_=>o?x.jsx(Sl,{disabled:r,className:W(t,`${z}-suggestion-button standalone`,m),onClick:p(_),children:T(_)},_):x.jsx("button",{disabled:r,className:W(t,`${z}-suggestion-button embedded`,m),onClick:p(_),children:T(_)},_))})},b8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=rt();if(!r)return null;const o=()=>{ui(!1),El(!0)};return t?x.jsx(ci,{className:W(n,`${z}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:o,icon:x.jsx(B1,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-minimize-button`,`cim-${e}-component`),onClick:o,children:[x.jsx(B1,{}),"Minimize"]})},w_=({componentType:e,isIcon:t})=>{const{globalClassName:n}=rt(),r=hs(),o=()=>{yl("modal"),r()};return t?x.jsx(ci,{className:W(n,`${z}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:o,icon:x.jsx(QT,{})}):x.jsxs("button",{className:W(n,`${z}-overflow-menu-button`,`${z}-toggle-modal-button`,`cim-${e}-component`),onClick:o,children:[x.jsx(QT,{}),"Show modal"]})},T8=({isWidgetStandalone:e})=>{var _,w;const{globalClassName:t,entryMessage:n,resetConversationMessage:r,suggestionButtonConfig:o}=rt(),{askCimPrompts:a,messages:u}=ar(),{isLoading:c,handleSuggestion:d}=Ur(),f=o==null?void 0:o.icon,p=(_=o==null?void 0:o.iconPosition)!=null?_:"left",m=B.useMemo(()=>{const C=typeof n=="string"?n:"Hi! I'm your Cimulate Co-Pilot. Ask me anything — I can help you find products, compare items, discover trends, and more!";return u.some(P=>P.name==="conversation_reset")&&r||C},[u,n,r]),T=((w=a.message)==null?void 0:w.suggestions)||[],y=(C,A)=>()=>{d(C,A)};return x.jsxs("div",{className:W(t,`${z}-ask-cim-entry-message`,`${z}-message-group`,e?"standalone":"embedded"),children:[x.jsx("p",{className:W(t,`${z}-ask-cim-entry-text`),children:m}),!!(T!=null&&T.length)&&x.jsx("div",{className:W(t,`${z}-ask-cim-suggestions-container`,`${z}-suggestion-container`,e?"standalone":"embedded"),children:T.map(C=>{var A;return x.jsxs(Sl,{disabled:c,className:W(t,`${z}-ask-cim-suggestion-button`,`${z}-suggestion-button`,e?"standalone":"embedded",{"has-icon":!!f,"icon-right":!!f&&p==="right"}),onClick:y(C,((A=a.message)==null?void 0:A.eventSourceId)||""),children:[f&&x.jsx(_p,{icon:f,className:`${z}-suggestion-button-icon`}),x.jsx("span",{children:C.displayText})]},C.displayText)})})]})},_8=({isWidgetStandalone:e,product:t})=>{const{configModule:n,globalClassName:r,openLinksInNewTab:o}=rt();if(!n)return null;const a=n.getName(t),u=n.getBrand(t),c=n.getPriceDisplay(t),d=n.getRelativePdp(t),f=n.getPdp(t),p=n.getImage(t),m=d&&typeof d=="string"?new URL(d,window.location.origin).href:f;return x.jsxs("div",{className:W(r,`${z}-product-tile`,{embedded:!e,standalone:e}),children:[m?x.jsx("a",{href:`${m}`,target:o?"_blank":"_self",rel:"noopener noreferrer","aria-label":`Go to product page for ${a}`,children:x.jsx("img",{className:W(r,`${z}-product-tile-image`,{embedded:!e,standalone:e}),src:`${p}`,alt:`${a}`,loading:"lazy"})}):x.jsx("img",{className:W(r,`${z}-product-tile-image`,{embedded:!e,standalone:e}),src:`${p}`,alt:`${a}`,loading:"lazy"}),x.jsxs("div",{className:W(r,`${z}-product-tile-details`,{embedded:!e,standalone:e}),children:[x.jsxs("div",{className:W(r,`${z}-product-tile-content`),children:[u&&x.jsx("p",{className:`${z}-product-tile-brand`,children:u}),m?x.jsxs("a",{"aria-label":`Go to product page for ${a}`,className:W(r,`${z}-product-tile-pdp`),href:`${m}`,target:o?"_blank":"_self",rel:"noopener noreferrer",children:[a," ",x.jsx("span",{className:W(r,`${z}-product-tile-pdp-arrow`),children:"→"})]}):x.jsx("p",{className:W(r,`${z}-product-tile-name`),title:a,children:a})]}),x.jsx("div",{className:W(r,`${z}-product-tile-footer`),children:x.jsx("p",{className:W(r,`${z}-product-tile-price`),children:c})})]})]})},S8=({isWidgetStandalone:e,message:t})=>{const{configModule:n,globalClassName:r}=rt(),o=t;return n?x.jsxs("div",{className:W(r,`${z}-display-products`),children:[x.jsx("p",{children:o.message}),o.products&&o.products.length>0&&x.jsx(GM,{globalClassName:r,spacing:"0.5rem",ariaLabel:"Recommended products",children:o.products.map(a=>{const u=n.getPid(a);return x.jsx(_8,{isWidgetStandalone:e,product:a},`${u}`)})})]}):null},x8=({globalClassName:e,message:t,isWidgetStandalone:n})=>x.jsx("div",{className:W(e,`${z}-error-message`,{standalone:n,embedded:!n}),children:x.jsxs("p",{className:W(e,`${z}-error-message-text`,{standalone:n,embedded:!n}),children:[x.jsx(Xk,{})," ",t.message||"An error occurred while processing your request."]})}),w8=({globalClassName:e,entryType:t,message:n,isWidgetStandalone:r,handleSuggestionClick:o})=>{var _;const{isLoading:a}=Ur(),{messages:u}=ar(),c=u.find(w=>w.id===n.eventSourceId),d=!!c,f=((_=c==null?void 0:c.name)==null?void 0:_.replace("_suggestions",""))||"",p=d?AA(f):null,T=a||!d||!(d&&(p===t||t==="ask_cim")),y=w=>{const C=n.suggestions.find(A=>A.displayText===w);C&&o(C,n.eventSourceId||n.id)};return x.jsxs("div",{className:W(e,`${z}-follow-up`),children:[x.jsx("p",{className:W(e,`${z}-text`),children:n.message}),x.jsx(y8,{suggestions:n.suggestions.map(w=>w.displayText),disabled:T,isWidgetStandalone:r,onSuggestionClick:y,globalClassName:e})]})};function A_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function A8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function v8(e,t,n){const o=Rl((n||{}).ignore||[]),a=C8(t);let u=-1;for(;++u<a.length;)QE(e,"text",c);function c(f,p){let m=-1,T;for(;++m<p.length;){const y=p[m],_=T?T.children:void 0;if(o(y,_?_.indexOf(y):void 0,T))return;T=y}if(T)return d(f,p)}function d(f,p){const m=p[p.length-1],T=a[u][0],y=a[u][1];let _=0;const C=m.children.indexOf(f);let A=!1,P=[];T.lastIndex=0;let v=T.exec(f.value);for(;v;){const H=v.index,Y={index:v.index,input:v.input,stack:[...p,f]};let D=y(...v,Y);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?T.lastIndex=H+1:(_!==H&&P.push({type:"text",value:f.value.slice(_,H)}),Array.isArray(D)?P.push(...D):D&&P.push(D),_=H+v[0].length,A=!0),!T.global)break;v=T.exec(f.value)}return A?(_<f.value.length&&P.push({type:"text",value:f.value.slice(_)}),m.children.splice(C,1,...P)):P=[f],C+P.length}}function C8(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 o=n[r];t.push([k8(o[0]),P8(o[1])])}return t}function k8(e){return typeof e=="string"?new RegExp(A8(e),"g"):e}function P8(e){return typeof e=="function"?e:function(){return e}}const Sp="phrasing",xp=["autolink","link","image","label"];function N8(){return{transforms:[F8],enter:{literalAutolink:I8,literalAutolinkEmail:wp,literalAutolinkHttp:wp,literalAutolinkWww:wp},exit:{literalAutolink:M8,literalAutolinkEmail:D8,literalAutolinkHttp:R8,literalAutolinkWww:L8}}}function O8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:xp},{character:":",before:"[ps]",after:"\\/",inConstruct:Sp,notInConstruct:xp}]}}function I8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wp(e){this.config.enter.autolinkProtocol.call(this,e)}function R8(e){this.config.exit.autolinkProtocol.call(this,e)}function L8(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 D8(e){this.config.exit.autolinkEmail.call(this,e)}function M8(e){this.exit(e)}function F8(e){v8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,B8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),U8]],{ignore:["link","linkReference"]})}function B8(e,t,n,r,o){let a="";if(!v_(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!H8(n)))return!1;const u=z8(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function U8(e,t,n,r){return!v_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function H8(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 z8(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 o=A_(e,"(");let a=A_(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function v_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||co(n)||vl(n))&&(!t||n!==47)}C_.peek=K8;function j8(){this.buffer()}function $8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V8(){this.buffer()}function q8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Y8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W8(e){this.exit(e)}function G8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function X8(e){this.exit(e)}function K8(){return"["}function C_(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),u(),a+=o.move("]"),a}function Q8(){return{enter:{gfmFootnoteCallString:j8,gfmFootnoteCall:$8,gfmFootnoteDefinitionLabelString:V8,gfmFootnoteDefinition:q8},exit:{gfmFootnoteCallString:Y8,gfmFootnoteCall:W8,gfmFootnoteDefinitionLabelString:G8,gfmFootnoteDefinition:X8}}}function J8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:C_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,u){const c=a.createTracker(u);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
32
32
  `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?k_:Z8))),f(),d}}function Z8(e,t,n){return t===0?e:k_(e,t,n)}function k_(e,t,n){return(n?"":" ")+e}const eF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];P_.peek=oF;function tF(){return{canContainEols:["delete"],enter:{strikethrough:rF},exit:{strikethrough:iF}}}function nF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eF}],handlers:{delete:P_}}}function rF(e){this.enter({type:"delete",children:[]},e)}function iF(e){this.exit(e)}function P_(e,t,n,r){const o=n.createTracker(r),a=n.enter("strikethrough");let u=o.move("~~");return u+=n.containerPhrasing(e,pe(F({},o.current()),{before:u,after:"~"})),u+=o.move("~~"),a(),u}function oF(){return"~"}function sF(e){return e.length}function aF(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||sF,a=[],u=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const w=[],C=[];let A=-1;for(e[p].length>f&&(f=e[p].length);++A<e[p].length;){const P=uF(e[p][A]);if(n.alignDelimiters!==!1){const v=o(P);C[A]=v,(d[A]===void 0||v>d[A])&&(d[A]=v)}w.push(P)}u[p]=w,c[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)a[m]=N_(r[m]);else{const w=N_(r);for(;++m<f;)a[m]=w}m=-1;const T=[],y=[];for(;++m<f;){const w=a[m];let C="",A="";w===99?(C=":",A=":"):w===108?C=":":w===114&&(A=":");let P=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-A.length);const v=C+"-".repeat(P)+A;n.alignDelimiters!==!1&&(P=C.length+P+A.length,P>d[m]&&(d[m]=P),y[m]=P),T[m]=v}u.splice(1,0,T),c.splice(1,0,y),p=-1;const _=[];for(;++p<u.length;){const w=u[p],C=c[p];m=-1;const A=[];for(;++m<f;){const P=w[m]||"";let v="",H="";if(n.alignDelimiters!==!1){const Y=d[m]-(C[m]||0),D=a[m];D===114?v=" ".repeat(Y):D===99?Y%2?(v=" ".repeat(Y/2+.5),H=" ".repeat(Y/2-.5)):(v=" ".repeat(Y/2),H=v):H=" ".repeat(Y)}n.delimiterStart!==!1&&!m&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&P==="")&&(n.delimiterStart!==!1||m)&&A.push(" "),n.alignDelimiters!==!1&&A.push(v),A.push(P),n.alignDelimiters!==!1&&A.push(H),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&A.push("|")}_.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return _.join(`
33
33
  `)}function uF(e){return e==null?"":String(e)}function N_(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 lF(e,t,n,r){const o=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const u=n.indentLines(n.containerFlow(e,a.current()),cF);return o(),u}function cF(e,t,n){return">"+(n?"":" ")+e}function dF(e,t){return O_(e,t.inConstruct,!0)&&!O_(e,t.notInConstruct,!1)}function O_(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 I_(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
34
34
  `&&dF(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\