@reventlessdev/reventless-host-shell 3.0.0-alpha.91 → 3.0.0-alpha.93

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.
@@ -1,11 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B6SuPgTZ.js","assets/GraphMode.res-KmA2lHEG.js","assets/GraphView.res-B4rjM4pu.js","assets/StateMachineDiagram.res-LhoVIZCt.js","assets/MapMode.res-Dt2re0Fu.js","assets/Geocoder.res-BghBa-Tc.js"])))=>i.map(i=>d[i]);
2
- import"./virtualExposes-DN39MDG_.js";import{d as e}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import{_ as t}from"./preload-helper-BhLMWRjL.js";import{_ as n}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import{_ as r,a as i,b as o}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import{a as s,b as a,c as l,d as c,e as u,f as d,g as f,h,i as p,j as g,k as m,l as v,m as y,n as _,o as b,p as x,q as S}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import{a as w,b as E}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";import{c as k,_ as A}from"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";function N(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function T(e){return void 0===e?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==e&&void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function R(e){return null==e?void 0:T(e)}function D(e){if(null===e||void 0===e.BS_PRIVATE_NESTED_SOME_NONE)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;return 0===t?void 0:{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();let I="JsExn";function F(e){return function(e){return null!=e&&"string"==typeof e.RE_EXN_ID}(e)?e:{RE_EXN_ID:"JsExn",_1:e}}let O=["map","graph"];function P(e,t){if(void 0!==e&&t(D(e)))return e}function M(e,t){if(void 0!==e)return t(D(e))}function L(e,t,n){return void 0!==e?n(D(e)):t}function z(e,t){if(void 0!==e)return T(t(D(e)))}function j(e,t){if(void 0!==e)return t(D(e))}function U(e,t){return void 0!==e?D(e):t}function B(e,t){return void 0!==e?e:t}function $(e){return void 0!==e}function q(e){return void 0===e}function G(e){switch(e){case"":case"/":return 0;default:let t=e.slice(1),n="/"===t[t.length-1|0]?t.slice(0,-1):t,r=n.split("?",2),i=(2!==r.length?n:r[0]).split("/").filter(e=>0!==e.length),o=i.length-1|0,s=0;for(;;){let e=s,t=o;if(t<0)return e;s={hd:i[t],tl:e},o=t-1|0}}}function V(e,t){let n=globalThis.window;return void 0!==e?G(e):void 0!==n?G(D(n).location.pathname):0}function K(){let e=globalThis.window;if(void 0===e)return"";let t=D(e).location.hash;switch(t){case"":case"#":return"";default:return t.slice(1)}}function W(e){switch(e){case"":case"?":return"";default:let t=e.split("?",2);return 2!==t.length?"":t[1]}}function H(e,t){let n=globalThis.window;return void 0!==e?W(e):void 0!==n?W(D(n).location.search):""}function J(e){let t=globalThis.history,n=globalThis.window;if(void 0!==t&&void 0!==n)return D(t).pushState(null,"",e),void D(n).dispatchEvent(function(e){if("function"==typeof Event)return new Event(e);let t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}("popstate"))}function X(e,t){return{path:V(e),hash:K(),search:H(e)}}function Q(e,t){let n=s(()=>X(void 0)),r=n[1],i=n[0];return a(()=>{let e=function(e){let t=globalThis.window;if(void 0===t)return()=>{};let n=()=>e(X(void 0));return D(t).addEventListener("popstate",n),n}(e=>r(t=>e)),t=X(void 0);return function(e,t){if(e.hash!==t.hash||e.search!==t.search)return!0;{let n=e.path,r=t.path;for(;;){let e=r,t=n;if(0===t)return 0!==e;if(0===e)return!0;if(t.hd!==e.hd)return!0;r=e.tl,n=t.tl}}}(t,i)&&r(e=>t),()=>function(e){let t=globalThis.window;void 0===t||D(t).removeEventListener("popstate",e)}(e)},[]),i}let Y=X,Z=l({prefix:"",path:""});function ee(e,t){return""===e||t.startsWith(e)?t:e+t}let te=Z.Provider;let ne=function(e){return c(te,{value:e.value,children:e.children})},re="popstate";function ie(){let e=globalThis.window;return void 0!==e?D(e).location.pathname:""}function oe(e){let t=globalThis.window;if(void 0===t)return()=>{};let n=D(t);return n.addEventListener(re,e),()=>{n.removeEventListener(re,e)}}function se(e,t){return u(oe,ie,()=>U(e,""))}function ae(){let e=d(Z).prefix;return t=>J(ee(e,t))}function le(){let e=d(Z).path,t=se(void 0);return""===e?t:e}function ce(e,t){return e.catch(e=>t(F(e)))}function ue(e,t){return e===t?0:e<t?-1:1}function de(e,t){return e<t?-1:e===t?0:1}function fe(e,t){if(0===t)throw{RE_EXN_ID:"Division_by_zero",Error:new Error};return e%t}function he(e,t){if(e<=0)return[];let n=new Array(e);return n.fill(t),n}function pe(e,t){if(e<=0)return[];let n=new Array(e);for(let r=0;r<e;++r)n[r]=t(r);return n}function ge(e,t,n){return e.reduce(n,t)}function me(e,t){let n=e.length,r=new Array(n),i=0;for(let o=0;o<n;++o){let n=t(e[o]);void 0!==n&&(r[i]=D(n),i=i+1|0)}return r.length=i,r}function ve(e,t){let n=e.length,r=new Array(n),i=0;for(let o=0;o<n;++o){let n=t(e[o],o);void 0!==n&&(r[i]=D(n),i=i+1|0)}return r.length=i,r}function ye(e,t){let n=0;for(;;){let r=n;if(r===e.length)return;let i=t(e[r]);if(void 0!==i)return i;n=r+1|0}}function _e(e,t){let n=parseInt(e);return Number.isNaN(n)||n>2147483647||n<-2147483648?void 0:0|n}function be(e,t){if(0===e)return t;let n={hd:e.hd,tl:0};return(function(e,t){for(;;){let n=t,r=e;if(0===r)return n;let i={hd:r.hd,tl:0};n.tl=i,t=i,e=r.tl}}(e.tl,n)).tl=t,n}function xe(e){let t=e.length-1|0,n=0;for(;;){let r=n,i=t;if(i<0)return r;n={hd:e[i],tl:r},t=i-1|0}}function Se(e){let t=function(e){let t=e,n=0;for(;;){if(0===t)return n;n=n+1|0,t=t.tl}}(e),n=new Array(t);return function(e,t,n){for(;;){let r=n,i=t;if(0===r)return;e[i]=r.hd,n=r.tl,t=i+1|0}}(n,0,e),n}function we(e){return function(e,t){for(;;){let n=t,r=e;if(0===r)return n;t={hd:r.hd,tl:n},e=r.tl}}(e,0)}function Ee(e,t,n){for(;;){let r=e;if(0===r)return t;t=n(t,r.hd),e=r.tl}}let ke=function(e,t,n){let r=t;for(let i=0,o=e.length;i<o;++i)r=n(r,e[i]);return r};function Ce(e){return void 0!==e?e.h:0}function Ae(e,t,n,r){let i=Ce(e),o=Ce(r);return{k:t,v:n,h:i>=o?i+1|0:o+1|0,l:e,r:r}}function Ne(e,t,n,r){let i=void 0!==e?e.h:0,o=void 0!==r?r.h:0;if(i>(o+2|0)){let i=e.l,o=e.r;return Ce(i)>=Ce(o)?Ae(i,e.k,e.v,Ae(o,t,n,r)):Ae(Ae(i,e.k,e.v,o.l),o.k,o.v,Ae(o.r,t,n,r))}if(o<=(i+2|0))return{k:t,v:n,h:i>=o?i+1|0:o+1|0,l:e,r:r};let s=r.l,a=r.r;return Ce(a)>=Ce(s)?Ae(Ae(e,t,n,s),r.k,r.v,a):Ae(Ae(e,t,n,s.l),s.k,s.v,Ae(s.r,r.k,r.v,a))}function Te(e,t,n){if(void 0===e)return function(e,t){return{k:e,v:t,h:1,l:void 0,r:void 0}}(t,n);let r=e.k;if(t===r)return function(e,t){return e.v===t?e:{k:e.k,v:t,h:e.h,l:e.l,r:e.r}}(e,n);let i=e.v;return t<r?Ne(Te(e.l,t,n),r,i,e.r):Ne(e.l,r,i,Te(e.r,t,n))}let Re=function(e,t){for(;;){let n=e;if(void 0===n)return;let r=n.k;if(t===r)return T(n.v);e=t<r?n.l:n.r}};function De(e){let t=e=>{switch(e){case"":case"/":return 0;default:let t=xe(e.split("/"));return 0!==t&&""===t.hd?t.tl:t}},n=e.indexOf("?");return-1===n?t(e):0===n?0:t(e.slice(0,n))}let Ie={parsers:0,children:void 0,capture:void 0,wildcard:!1};function Fe(e,t){return{TAG:"Match",_0:e,_1:t}}function Oe(e){return"object"!=typeof e?"End"===e?0:{hd:"Wildcard",tl:0}:"Match"===e.TAG?{hd:{TAG:"Match",_0:e._0},tl:Oe(e._1)}:{hd:"Capture",tl:Oe(e._1)}}function Pe(e,t,n){let r=e,i=t,o=0,s=n;for(;;){let e=s,t=o,n=i,a=r;if("object"!=typeof a)return"End"===a?0!==e?""===e.hd&&0===e.tl?{TAG:"MatchWithTrailingSlash",_0:n}:"NoMatch":{TAG:"FullMatch",_0:n}:{TAG:"FullMatch",_0:n({prefix:we(t),matched:e})};if("Match"===a.TAG){if(0===e)return"NoMatch";let n=e.hd;if(a._0!==n)return"NoMatch";s=e.tl,o={hd:n,tl:t},r=a._1;continue}if(0===e)return"NoMatch";let l=e.hd,c=a._0.from_(l);if(void 0===c)return"NoMatch";s=e.tl,o={hd:l,tl:t},i=n(D(c)),r=a._1}}function Me(e){return Ee(we(e),Ie,(e,t)=>function(e,t,n){let r=(e,n)=>{if(0===e)return{parsers:{hd:t,tl:n.parsers},children:n.children,capture:n.capture,wildcard:n.wildcard};let i=n.capture,o=n.children,s=e.tl,a=e.hd;if("object"!=typeof a){if("Capture"!==a)return{parsers:{hd:t,tl:n.parsers},children:n.children,capture:n.capture,wildcard:!0};let e=r(s,void 0!==i?i:Ie);return{parsers:n.parsers,children:n.children,capture:e,wildcard:n.wildcard}}{let e=a._0,t=Re(o,e),i=r(s,void 0!==t?t:Ie);return{parsers:n.parsers,children:Te(o,e,i),capture:n.capture,wildcard:n.wildcard}}};return r(e,n)}(Oe(t._0),t,e))}function Le(e,t){let n=De(t),r=function(e,t){let n=e,r=t;for(;;){let e=r,t=n,i=t.parsers,o=0;if(0!==i)o=1;else{if(0===e)return 0;o=1}if(1===o){let o=t.capture,s=0;if(0===e)return i;if(""===e.hd){if(0===e.tl)return i;s=2}else s=2;if(2===s){if(t.wildcard)return i;let s=e.tl,a=Re(t.children,e.hd);if(void 0!==a){r=s,n=a;continue}if(void 0===o)return 0;r=s,n=o;continue}}}}(e,n),i=r;for(;;){let e=i;if(0===e)return"NoMatch";let t=e.hd,r=t._2,o=Pe(t._0,t._1,n);if("object"==typeof o)return"FullMatch"===o.TAG?{TAG:"FullMatch",_0:r(o._0)}:{TAG:"MatchWithTrailingSlash",_0:r(o._0)};i=e.tl}}function ze(e){return e("End")}let je={prefix:function(e){return Se({hd:"",tl:e.prefix}).join("/")},wildcard_match:function(e){return Se({hd:"",tl:e.matched}).join("/")},of_parts:function(e){return{prefix:0,matched:De(e)}}},Ue=function(e){return function(e,t){let n=(e,t)=>{for(;;){let r=t,i=e;if("object"!=typeof r)return"End"===r?i(0):e=>i(be(e.matched,0));if("Match"===r.TAG){let n=r._0;t=r._1,e=e=>i({hd:n,tl:e});continue}let o=r._1,s=r._0.to_;return e=>n(t=>i({hd:s(e),tl:t}),o)}};return n(t=>e("/"+Se(t).join("/")),t)}(e=>e,e)},Be=function(e,t){return{TAG:"Route",_0:e,_1:t,_2:e=>e}};let $e=l({});function qe(e,t){return Object.assign(Object.assign({},e),t)}function Ge(){return d($e)}let Ve=$e.Provider;let Ke=function(e){return c(Ve,{value:e.registry,children:e.children})},We={contents:{}};function He(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;let t=function(e){let t=function(e){return e.startsWith("/")?e.slice(1):e}(e);return z(ge(Object.entries(We.contents),void 0,(e,n)=>{let r=n[0];if(!t.startsWith(r+"/"))return e;let i=n[1];return void 0!==e&&e[0].length>=r.length?e:[r,i]}),e=>e[1])}(e);if(void 0===t)return e;let n=e.startsWith("/")?e:"/"+e;return(t.endsWith("/")?t.slice(0,t.length-1|0):t)+n}let Je={bool:function(e){if("boolean"==typeof e)return e},$$null:function(e){if(null===e)return null},string:function(e){if("string"==typeof e)return e},float:function(e){if("number"==typeof e)return e},object:function(e){if("object"==typeof e&&null!==e&&!Array.isArray(e))return e},array:function(e){if(Array.isArray(e))return e}};function Xe(e,t){if(t in e)return T(e[t])}function Qe(e){let t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i<n;++i){let n=t[i];r[i]=[n,e[n]]}return r}function Ye(e){let t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function Ze(e){let t={},n=e.length;for(let r=0;r<n;++r){let n=e[r];t[n[0]]=n[1]}return t}let et=/[^aeiou]y$/i;function tt(e){return e.endsWith("ies")?e.slice(0,e.length-3|0)+"y":e.endsWith("ses")||e.endsWith("xes")||e.endsWith("zes")||e.endsWith("ches")||e.endsWith("shes")?e.slice(0,e.length-2|0):e.endsWith("s")?e.slice(0,e.length-1|0):e}function nt(e){return function(e){return et.test(e)?e.slice(0,e.length-1|0)+"ies":e.endsWith("s")||e.endsWith("x")||e.endsWith("z")||e.endsWith("ch")||e.endsWith("sh")?e+"es":e+"s"}(tt(e))}let rt=Ze([["id","ID"],["ids","IDs"],["url","URL"],["uri","URI"],["api","API"],["arn","ARN"],["aws","AWS"],["iam","IAM"],["sqs","SQS"],["sns","SNS"],["uuid","UUID"],["ip","IP"],["dns","DNS"],["http","HTTP"],["https","HTTPS"],["json","JSON"],["xml","XML"],["sql","SQL"],["ui","UI"],["ux","UX"]]);function it(e){return e===e.toUpperCase()&&e!==e.toLowerCase()}function ot(e){return e===e.toLowerCase()&&e!==e.toUpperCase()}function st(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return!0;default:return!1}}function at(e){let t=e.toLowerCase(),n=Xe(rt,t);return void 0!==n?n:0===e.length?"":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function lt(e){let t=function(e){let t=e.length,n=[],r={contents:""},i=()=>{if(r.contents.length>0)return n.push(r.contents),void(r.contents="")};for(let o=0;o<t;++o){let n=e.charAt(o);if("_"===n||"-"===n||" "===n)i();else if(it(n)){let s=o>0&&ot(e.charAt(o-1|0)),a=(o+1|0)<t&&ot(e.charAt(o+1|0)),l=o>0&&it(e.charAt(o-1|0));(s||l&&a)&&i(),r.contents=r.contents+n}else if(st(n)){let t=!1;if(o>0){let n=e.charAt(o-1|0);t=it(n)||ot(n)}t&&i(),r.contents=r.contents+n}else r.contents=r.contents+n}return i(),n}(e);return 0!==t.length?t.map(at).join(" "):e}let ct=tt;function ut(e){let t=typeof e;return"string"===t?{TAG:"JSONString",_0:e}:"number"===t?{TAG:"JSONNumber",_0:e}:"boolean"===t?!0===e?"JSONTrue":"JSONFalse":null===e?"JSONNull":Array.isArray(e)?{TAG:"JSONArray",_0:e}:{TAG:"JSONObject",_0:e}}function dt(e){if("string"==typeof e)return e}function ft(e){if("number"==typeof e)return e}function ht(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return e}function pt(e){if(Array.isArray(e))return e}function gt(e){if("boolean"==typeof e)return e}let mt=function(e,t){for(var n in e)t(n)};function vt(e,t){if(e===t)return!0;let n=typeof e;if("string"===n||"number"===n||"bigint"===n||"boolean"===n||"undefined"===n||null===e)return!1;let r=typeof t;if("function"===n||"function"===r)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if("number"===r||"bigint"===r||"undefined"===r||null===t)return!1;if(e.TAG!==t.TAG)return!1;let i=0|e.length;if(i!==(0|t.length))return!1;if(!Array.isArray(e)){if(e instanceof Date&&t instanceof Date)return!(e>t||e<t);{let n={contents:!0},r=e=>{Object.prototype.hasOwnProperty.call(t,e)||(n.contents=!1)},i=r=>{Object.prototype.hasOwnProperty.call(e,r)&&vt(t[r],e[r])||(n.contents=!1)};return mt(e,r),n.contents&&mt(t,i),n.contents}}{let n=0;for(;;){let r=n;if(r===i)return!0;if(!vt(e[r],t[r]))return!1;n=r+1|0}}}function yt(e,t){return"number"!=typeof e&&"bigint"!=typeof e||"number"!=typeof t&&"bigint"!=typeof t?!vt(e,t):e!==t}let _t={background:"--rv-color-background",surface:"--rv-color-surface",surfaceSubtle:"--rv-color-surface-subtle",surfaceElevated:"--rv-color-surface-elevated",brand:"--rv-color-brand",brandSubtle:"--rv-color-brand-subtle",success:"--rv-color-success",warning:"--rv-color-warning",error:"--rv-color-error",info:"--rv-color-info",textPrimary:"--rv-color-text-primary",textSecondary:"--rv-color-text-secondary",textDisabled:"--rv-color-text-disabled",textOnBrand:"--rv-color-text-on-brand",border:"--rv-color-border",borderSubtle:"--rv-color-border-subtle"},bt={xs:"--rv-spacing-xs",sm:"--rv-spacing-sm",md:"--rv-spacing-md",lg:"--rv-spacing-lg",xl:"--rv-spacing-xl",xxl:"--rv-spacing-xxl"},xt={fontFamily:"--rv-font-family",fontFamilyMono:"--rv-font-family-mono",sizeXs:"--rv-font-size-xs",sizeSm:"--rv-font-size-sm",sizeMd:"--rv-font-size-md",sizeLg:"--rv-font-size-lg",sizeXl:"--rv-font-size-xl",sizeXxl:"--rv-font-size-xxl",weightNormal:"--rv-font-weight-normal",weightMedium:"--rv-font-weight-medium",weightBold:"--rv-font-weight-bold",lineHeightTight:"--rv-line-height-tight",lineHeightNormal:"--rv-line-height-normal",lineHeightRelaxed:"--rv-line-height-relaxed"},St={sm:"--rv-radius-sm",md:"--rv-radius-md",lg:"--rv-radius-lg",full:"--rv-radius-full"},wt="--rv-shadow-sm",Et="--rv-shadow-md",kt="--rv-shadow-lg";function Ct(e){switch(e){case"Wide":return 0;case"Compact":return 1;case"Narrow":return 2;case"Tight":return 3}}let At={compact:"(max-width: 1024px)",narrow:"(max-width: 720px)",tight:"(max-width: 520px)",bandRank:Ct,atLeastAsNarrow:function(e,t){return Ct(e)>=Ct(t)},bandName:function(e){switch(e){case"Wide":return"wide";case"Compact":return"compact";case"Narrow":return"narrow";case"Tight":return"tight"}},bandOfName:function(e){switch(e){case"compact":return"Compact";case"narrow":return"Narrow";case"tight":return"Tight";case"wide":return"Wide";default:return}}},Nt="x-reventless-union",Tt="x-reventless-union-member";function Rt(e){let t,n=Xe(e,Nt);if(void 0!==n){let e=dt(n);t=void 0!==e?e:j(j(ht(n),e=>Xe(e,"name")),dt)}else t=void 0;return j(t,e=>""===e?void 0:e)}function Dt(e){return j(j(Xe(e,Tt),dt),e=>""===e?void 0:e)}function It(e){return j(ht(e),e=>j(j(Xe(e,"properties"),ht),t=>z(j(j(j(Xe(t,"TAG"),ht),e=>Xe(e,"const")),dt),n=>({tag:n,memberType:Dt(e),properties:Ze(Qe(t).filter(e=>"TAG"!==e[0]))}))))}function Ft(e){return j(ht(e),e=>ge(["oneOf","anyOf"],void 0,(t,n)=>void 0!==t?t:j(j(Xe(e,n),pt),t=>{let n=t.filter(e=>!vt(j(j(ht(e),e=>Xe(e,"type")),dt),"null")),r=n.length;if(1===r)return Ft(n[0]);if(0===r)return;let i=me(n,It);return i.length===n.length?{name:Rt(e),arms:i}:void 0})))}function Ot(e,t){let n=t.memberType;return void 0!==n?n:z(e.name,e=>e+t.tag)}function Pt(e,t){let n=e.arms.find(n=>n.tag===t||vt(Ot(e,n),t));if(void 0!==n)return n;let r=e.arms.filter(e=>t.endsWith(e.tag));return 1!==r.length?void 0:r[0]}function Mt(e){return Ze([["type","object"],["properties",e.properties]])}function Lt(e){let t=ht(e);if(void 0===t)return e;let n=Xe(t,"type"),r=Xe(t,"properties");return void 0!==n||void 0!==r||$(Ft(e))?e:U(z(ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(Xe(t,n),pt),e=>e.find(e=>yt(j(j(ht(e),e=>Xe(e,"type")),dt),"null")))),Lt),e)}function zt(e){return j(ht(Lt(e)),e=>{if("array"===j(Xe(e,"type"),dt))return z(Xe(e,"items"),Lt)})}let jt={initial:"initial",inherit_:"inherit_",unset:"unset",toString:function(e){return"inherit_"===e?"inherit":"unset"===e?"unset":"initial"}};function Ut(e){return t="--",e.startsWith(t)?e:"--"+e;var t}function Bt(e){if("var"===e.NAME)return"var("+Ut(e.VAL)+")";let t=e.VAL;return"var("+Ut(t[0])+","+t[1]+")"}let $t={s:function(e){return{NAME:"s",VAL:e}},ms:function(e){return{NAME:"ms",VAL:e}},toString:function(e){return"ms"===e.NAME?e.VAL.toString()+"ms":e.VAL.toString()+"s"}};function qt(e){return e.VAL.toString()+"%"}function Gt(e){if("object"!=typeof e)return"0";let t=e.NAME;return"inch"===t?e.VAL.toString()+"in":"vmax"===t?e.VAL.toString()+"vmax":"vmin"===t?e.VAL.toString()+"vmin":"percent"===t?e.VAL.toString()+"%":"ch"===t?e.VAL.toString()+"ch":"cm"===t?e.VAL.toString()+"cm":"em"===t?e.VAL.toString()+"em":"ex"===t?e.VAL.toString()+"ex":"mm"===t?e.VAL.toString()+"mm":"pc"===t?e.VAL.toString()+"pc":"pt"===t?e.VAL.toString()+"pt":"px"===t?e.VAL.toString()+"px":"vh"===t?e.VAL.toString()+"vh":"vw"===t?e.VAL.toString()+"vw":"rem"===t?e.VAL.toString()+"rem":e.VAL.toString()+"px"}let Vt={ch:function(e){return{NAME:"ch",VAL:e}},em:function(e){return{NAME:"em",VAL:e}},ex:function(e){return{NAME:"ex",VAL:e}},rem:function(e){return{NAME:"rem",VAL:e}},vh:function(e){return{NAME:"vh",VAL:e}},vw:function(e){return{NAME:"vw",VAL:e}},vmin:function(e){return{NAME:"vmin",VAL:e}},vmax:function(e){return{NAME:"vmax",VAL:e}},px:function(e){return{NAME:"px",VAL:e}},pxFloat:function(e){return{NAME:"pxFloat",VAL:e}},cm:function(e){return{NAME:"cm",VAL:e}},mm:function(e){return{NAME:"mm",VAL:e}},inch:function(e){return{NAME:"inch",VAL:e}},pc:function(e){return{NAME:"pc",VAL:e}},pt:function(e){return{NAME:"pt",VAL:e}},zero:"zero",toString:Gt};let Kt={min:function(e,t){return{NAME:"min",VAL:[e,t]}},max:function(e,t){return{NAME:"max",VAL:[e,t]}},toString:function e(t){if("object"!=typeof t)return Gt(t);let n=t.NAME;if("subtract"===n){let n=t.VAL;return"calc("+e(n[0])+" - "+e(n[1])+")"}if("percent"===n)return qt(t);if("add"===n){let n=t.VAL;return"calc("+e(n[0])+" + "+e(n[1])+")"}if("div"===n){let n=t.VAL;return"calc("+e(n[0])+" / "+n[1].toString()+")"}if("max"===n){let n=t.VAL;return"max("+e(n[0])+", "+e(n[1])+")"}if("min"===n){let n=t.VAL;return"min("+e(n[0])+", "+e(n[1])+")"}if("mul"!==n)return Gt(t);let r=t.VAL;return"calc("+e(r[0])+" * "+r[1].toString()+")"}};let Wt={absolute:"absolute",relative:"relative",$$static:"static",fixed:"fixed",sticky:"sticky",toString:function(e){return"fixed"===e?"fixed":"static"===e?"static":"sticky"===e?"sticky":"relative"===e?"relative":"absolute"}};let Ht={hidden:"hidden",visible:"visible",scroll:"scroll",auto:"auto",clip:"clip",toString:function(e){return"clip"===e?"clip":"scroll"===e?"scroll":"hidden"===e?"hidden":"visible"===e?"visible":"auto"}};let Jt={auto:"auto",toString:function(e){return"auto"}};let Xt={toString:function(e){return"none"===e?"none":"circle"===e?"circle":"lowerGreek"===e?"lower-greek":"square"===e?"square":"lowerAlpha"===e?"lower-alpha":"upperAlpha"===e?"upper-alpha":"decimal"===e?"decimal":"lowerRoman"===e?"lower-roman":"lowerLatin"===e?"lower-latin":"upperRoman"===e?"upper-roman":"upperLatin"===e?"upper-latin":"disc"}};let Qt={toString:function(e){return"object"==typeof e?e.VAL.toString():"infinite"}};let Yt={auto:"auto",$$default:"default",none:"none",contextMenu:"contextMenu",help:"help",pointer:"pointer",progress:"progress",wait:"wait",cell:"cell",crosshair:"crosshair",text:"text",verticalText:"verticalText",alias:"alias",copy:"copy",move:"move",noDrop:"noDrop",notAllowed:"notAllowed",grab:"grab",grabbing:"grabbing",allScroll:"allScroll",colResize:"colResize",rowResize:"rowResize",nResize:"nResize",eResize:"eResize",sResize:"sResize",wResize:"wResize",neResize:"neResize",nwResize:"nwResize",seResize:"seResize",swResize:"swResize",ewResize:"ewResize",nsResize:"nsResize",neswResize:"neswResize",nwseResize:"nwseResize",zoomIn:"zoomIn",zoomOut:"zoomOut",toString:function(e){return"cell"===e?"cell":"copy"===e?"copy":"swResize"===e?"sw-resize":"grab"===e?"grab":"help"===e?"help":"move"===e?"move":"none"===e?"none":"text"===e?"text":"rowResize"===e?"row-resize":"wait"===e?"wait":"pointer"===e?"pointer":"seResize"===e?"se-resize":"zoomOut"===e?"zoom-out":"sResize"===e?"s-resize":"zoomIn"===e?"zoom-in":"grabbing"===e?"grabbing":"nsResize"===e?"ns-resize":"nwseResize"===e?"nwse-resize":"progress"===e?"progress":"crosshair"===e?"crosshair":"wResize"===e?"w-resize":"noDrop"===e?"no-drop":"allScroll"===e?"all-scroll":"verticalText"===e?"vertical-text":"nResize"===e?"n-resize":"default"===e?"default":"neswResize"===e?"nesw-resize":"alias"===e?"alias":"ewResize"===e?"ew-resize":"eResize"===e?"e-resize":"nwResize"===e?"nw-resize":"contextMenu"===e?"context-menu":"colResize"===e?"col-resize":"notAllowed"===e?"not-allowed":"neResize"===e?"ne-resize":"auto"}};function Zt(e){let t=e.NAME;return"var"===t||"varDefault"===t?Bt(e):function(e){let t=e.NAME;return"turn"===t?e.VAL.toString()+"turn":"deg"===t?e.VAL.toString()+"deg":"rad"===t?e.VAL.toString()+"rad":e.VAL.toString()+"grad"}(e)}function en(e){let t=e.NAME;return"percent"===t?qt(e):"num"===t?e.VAL.toString():Bt(e)}function tn(e){return"percent"===e.NAME?qt(e):Bt(e)}function nn(e){if("object"!=typeof e)return"transparent"===e?"transparent":"currentColor";let t=e.NAME;if("rgba"===t){let t=e.VAL;return"rgba("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+", "+en(t[3])+")"}if("hex"===t)return"#"+e.VAL;if("hsl"===t){let t=e.VAL;return"hsl("+Zt(t[0])+", "+tn(t[1])+", "+tn(t[2])+")"}if("rgb"===t){let t=e.VAL;return"rgb("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+")"}let n=e.VAL;return"hsla("+Zt(n[0])+", "+tn(n[1])+", "+tn(n[2])+", "+en(n[3])+")"}let rn={toString:function(e){return"hidden"===e?"hidden":"ridge"===e?"ridge":"solid"===e?"solid":"outset"===e?"outset":"groove"===e?"groove":"dashed"===e?"dashed":"dotted"===e?"dotted":"double"===e?"double":"inset"===e?"inset":"none"}};let on={toString:function(e){return"object"==typeof e?e.VAL.toString():"normal"}};let sn={toString:function(e){return"inline"===e?"inline":"block"===e?"block":"run-in"}};let an={toString:function(e){return"grid"===e?"grid":"table"===e?"table":"flex"}};let ln={toString:function(e){return"list-item"}};let cn={toString:function(e){return"tableRow"===e?"table-row":"tableRowGroup"===e?"table-row-group":"tableColumn"===e?"table-column":"tableHeaderGroup"===e?"table-header-group":"tableCell"===e?"table-cell":"tableColumnGroup"===e?"table-column-group":"tableCaption"===e?"table-caption":"table-footer-group"}};let un={toString:function(e){return"contents"===e?"contents":"none"}};let dn={toString:function(e){return"inlineBlock"===e?"inline-block":"inlineFlex"===e?"inline-flex":"inlineGrid"===e?"inline-grid":"inline-table"}};let fn={toString:function(e){return"left"===e?"left":"right"===e?"right":"selfEnd"===e?"self-end":"start"===e?"start":"center"===e?"center":"flexStart"===e?"flex-start":"flexEnd"===e?"flex-end":"selfStart"===e?"self-start":"end"}};let hn={toString:function(e){return"firstBaseline"===e?"first baseline":"baseline"===e?"baseline":"last baseline"}};let pn={toString:function(e){return"normal"}};let gn={toString:function(e){return"spaceAround"===e?"space-around":"stretch"===e?"stretch":"spaceBetween"===e?"space-between":"space-evenly"}};let mn={toString:function(e){return"right"===e?"right":"justify"===e?"justify":"start"===e?"start":"center"===e?"center":"left"}};let vn={toString:function(e){return"normal"===e?"normal":"stretch"}};let yn={toString:function(e){return"stretch"===e?"stretch":"normal"===e?"normal":"auto"}};let _n={toString:function(e){return"wrapReverse"===e?"wrap-reverse":"nowrap"===e?"nowrap":"wrap"}};let bn={toString:function(e){return"row"===e?"row":"columnReverse"===e?"column-reverse":"rowReverse"===e?"row-reverse":"column"}};let xn={toString:function(e){return"none"===e?"none":"text"===e?"text":"all"===e?"all":"contain"===e?"contain":"auto"}};let Sn={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}};let wn={toString:function(e){return"none"}};let En={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}},kn={$$var:function(e){return{NAME:"var",VAL:e}},varDefault:function(e,t){return{NAME:"varDefault",VAL:[e,t]}},toString:Bt},Cn={linear:"linear",ease:"ease",easeIn:"easeIn",easeOut:"easeOut",easeInOut:"easeInOut",stepStart:"stepStart",stepEnd:"stepEnd",steps:function(e,t){return{NAME:"steps",VAL:[e,t]}},cubicBezier:function(e,t,n,r){return{NAME:"cubicBezier",VAL:[e,t,n,r]}},jumpStart:"jumpStart",jumpEnd:"jumpEnd",jumpNone:"jumpNone",jumpBoth:"jumpBoth",toString:function(e){if("object"!=typeof e)return"easeInOut"===e?"ease-in-out":"linear"===e?"linear":"jumpBoth"===e?"jump-both":"stepStart"===e?"step-start":"jumpNone"===e?"jump-none":"stepEnd"===e?"step-end":"easeIn"===e?"ease-in":"jumpEnd"===e?"jump-end":"jumpStart"===e?"jump-start":"easeOut"===e?"ease-out":"ease";if("steps"===e.NAME){let t=e.VAL,n=t[0];return"start"===t[1]?"steps("+n.toString()+", start)":"steps("+n.toString()+", end)"}let t=e.VAL;return"cubic-bezier("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+", "+t[3].toString()+")"}},An={rgb:function(e,t,n){return{NAME:"rgb",VAL:[e,t,n]}},rgba:function(e,t,n,r){return{NAME:"rgba",VAL:[e,t,n,r]}},hsl:function(e,t,n){return{NAME:"hsl",VAL:[e,t,n]}},hsla:function(e,t,n,r){return{NAME:"hsla",VAL:[e,t,n,r]}},hex:function(e){return{NAME:"hex",VAL:e}},transparent:"transparent",currentColor:"currentColor",toString:function(e){if("object"!=typeof e)return nn(e);if("lightDark"!==e.NAME)return nn(e);let t=e.VAL;return"light-dark("+nn(t[0])+", "+nn(t[1])+")"}},Nn=wn,Tn=wn,Rn=wn,Dn=wn,In=An.transparent;function Fn(e,t){switch(t.TAG){case"D":let n=t._1,r=t._0;e[r]="content"===r&&""===n?'""':n;break;case"S":e[t._0]=On(t._1);break;case"PseudoClass":e[":"+t._0]=On(t._1);break;case"PseudoClassParam":e[":"+t._0+"("+t._1+")"]=On(t._2)}return e}function On(e){return ke(e,{},Fn)}function Pn(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):"auto";let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):Kt.toString(e)}function Mn(e){if("object"!=typeof e)return An.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):An.toString(e)}function Ln(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Jt.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):Kt.toString(e)}let zn=Vt.px;function jn(e){return"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):rn.toString(e)}var Un=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(bU){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Bn="-ms-",$n="-moz-",qn="-webkit-",Gn="comm",Vn="rule",Kn="decl",Wn="@keyframes",Hn=Math.abs,Jn=String.fromCharCode,Xn=Object.assign;function Qn(e){return e.trim()}function Yn(e,t,n){return e.replace(t,n)}function Zn(e,t){return e.indexOf(t)}function er(e,t){return 0|e.charCodeAt(t)}function tr(e,t,n){return e.slice(t,n)}function nr(e){return e.length}function rr(e){return e.length}function ir(e,t){return t.push(e),e}var or=1,sr=1,ar=0,lr=0,cr=0,ur="";function dr(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:or,column:sr,length:s,return:""}}function fr(e,t){return Xn(dr("",null,null,"",null,null,0),e,{length:-e.length},t)}function hr(){return cr=lr>0?er(ur,--lr):0,sr--,10===cr&&(sr=1,or--),cr}function pr(){return cr=lr<ar?er(ur,lr++):0,sr++,10===cr&&(sr=1,or++),cr}function gr(){return er(ur,lr)}function mr(){return lr}function vr(e,t){return tr(ur,e,t)}function yr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _r(e){return or=sr=1,ar=nr(ur=e),lr=0,[]}function br(e){return ur="",e}function xr(e){return Qn(vr(lr-1,Er(91===e?e+2:40===e?e+1:e)))}function Sr(e){for(;(cr=gr())&&cr<33;)pr();return yr(e)>2||yr(cr)>3?"":" "}function wr(e,t){for(;--t&&pr()&&!(cr<48||cr>102||cr>57&&cr<65||cr>70&&cr<97););return vr(e,mr()+(t<6&&32==gr()&&32==pr()))}function Er(e){for(;pr();)switch(cr){case e:return lr;case 34:case 39:34!==e&&39!==e&&Er(cr);break;case 40:41===e&&Er(e);break;case 92:pr()}return lr}function kr(e,t){for(;pr()&&e+cr!==57&&(e+cr!==84||47!==gr()););return"/*"+vr(t,lr-1)+"*"+Jn(47===e?e:pr())}function Cr(e){for(;!yr(gr());)pr();return vr(e,lr)}function Ar(e){return br(Nr("",null,null,null,[""],e=_r(e),0,[0],e))}function Nr(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,g=1,m=1,v=1,y=0,_="",b=i,x=o,S=r,w=_;m;)switch(p=y,y=pr()){case 40:if(108!=p&&58==er(w,d-1)){-1!=Zn(w+=Yn(xr(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:w+=xr(y);break;case 9:case 10:case 13:case 32:w+=Sr(p);break;case 92:w+=wr(mr()-1,7);continue;case 47:switch(gr()){case 42:case 47:ir(Rr(kr(pr(),mr()),t,n),l);break;default:w+="/"}break;case 123*g:a[c++]=nr(w)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(w=Yn(w,/\f/g,"")),h>0&&nr(w)-d&&ir(h>32?Dr(w+";",r,n,d-1):Dr(Yn(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(ir(S=Tr(w,t,n,c,u,i,a,_,b=[],x=[],d),o),123===y)if(0===u)Nr(w,t,S,S,b,o,d,a,x);else switch(99===f&&110===er(w,3)?100:f){case 100:case 108:case 109:case 115:Nr(e,S,S,r&&ir(Tr(e,S,S,0,0,i,a,_,i,b=[],d),x),i,x,d,a,r?b:x);break;default:Nr(w,S,S,S,[""],x,0,a,x)}}c=u=h=0,g=v=1,_=w="",d=s;break;case 58:d=1+nr(w),h=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==hr())continue;switch(w+=Jn(y),y*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(nr(w)-1)*v,v=1;break;case 64:45===gr()&&(w+=xr(pr())),f=gr(),u=d=nr(_=w+=Cr(mr())),y++;break;case 45:45===p&&2==nr(w)&&(g=0)}}return o}function Tr(e,t,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=0===i?o:[""],h=rr(f),p=0,g=0,m=0;p<r;++p)for(var v=0,y=tr(e,d+1,d=Hn(g=s[p])),_=e;v<h;++v)(_=Qn(g>0?f[v]+" "+y:Yn(y,/&\f/g,f[v])))&&(l[m++]=_);return dr(e,t,n,0===i?Vn:a,l,c,u)}function Rr(e,t,n){return dr(e,t,n,Gn,Jn(cr),tr(e,2,-2),0)}function Dr(e,t,n,r){return dr(e,t,n,Kn,tr(e,0,r),tr(e,r+1,-1),r)}function Ir(e,t){for(var n="",r=rr(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Fr(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Kn:return e.return=e.return||e.value;case Gn:return"";case Wn:return e.return=e.value+"{"+Ir(e.children,r)+"}";case Vn:e.value=e.props.join(",")}return nr(n=Ir(e.children,r))?e.return=e.value+"{"+n+"}":""}function Or(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Pr=function(e,t,n){for(var r=0,i=0;r=i,i=gr(),38===r&&12===i&&(t[n]=1),!yr(i);)pr();return vr(e,lr)},Mr=function(e,t){return br(function(e,t){var n=-1,r=44;do{switch(yr(r)){case 0:38===r&&12===gr()&&(t[n]=1),e[n]+=Pr(lr-1,t,n);break;case 2:e[n]+=xr(r);break;case 4:if(44===r){e[++n]=58===gr()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Jn(r)}}while(r=pr());return e}(_r(e),t))},Lr=new WeakMap,zr=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Lr.get(n))&&!r){Lr.set(e,!0);for(var i=[],o=Mr(t,i),s=n.props,a=0,l=0;a<o.length;a++)for(var c=0;c<s.length;c++,l++)e.props[l]=i[a]?o[a].replace(/&\f/g,s[c]):s[c]+" "+o[a]}}},jr=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ur(e,t){switch(function(e,t){return 45^er(e,0)?(((t<<2^er(e,0))<<2^er(e,1))<<2^er(e,2))<<2^er(e,3):0}(e,t)){case 5103:return qn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return qn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return qn+e+$n+e+Bn+e+e;case 6828:case 4268:return qn+e+Bn+e+e;case 6165:return qn+e+Bn+"flex-"+e+e;case 5187:return qn+e+Yn(e,/(\w+).+(:[^]+)/,qn+"box-$1$2"+Bn+"flex-$1$2")+e;case 5443:return qn+e+Bn+"flex-item-"+Yn(e,/flex-|-self/,"")+e;case 4675:return qn+e+Bn+"flex-line-pack"+Yn(e,/align-content|flex-|-self/,"")+e;case 5548:return qn+e+Bn+Yn(e,"shrink","negative")+e;case 5292:return qn+e+Bn+Yn(e,"basis","preferred-size")+e;case 6060:return qn+"box-"+Yn(e,"-grow","")+qn+e+Bn+Yn(e,"grow","positive")+e;case 4554:return qn+Yn(e,/([^-])(transform)/g,"$1"+qn+"$2")+e;case 6187:return Yn(Yn(Yn(e,/(zoom-|grab)/,qn+"$1"),/(image-set)/,qn+"$1"),e,"")+e;case 5495:case 3959:return Yn(e,/(image-set\([^]*)/,qn+"$1$`$1");case 4968:return Yn(Yn(e,/(.+:)(flex-)?(.*)/,qn+"box-pack:$3"+Bn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qn+e+e;case 4095:case 3583:case 4068:case 2532:return Yn(e,/(.+)-inline(.+)/,qn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(nr(e)-1-t>6)switch(er(e,t+1)){case 109:if(45!==er(e,t+4))break;case 102:return Yn(e,/(.+:)(.+)-([^]+)/,"$1"+qn+"$2-$3$1"+$n+(108==er(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Zn(e,"stretch")?Ur(Yn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==er(e,t+1))break;case 6444:switch(er(e,nr(e)-3-(~Zn(e,"!important")&&10))){case 107:return Yn(e,":",":"+qn)+e;case 101:return Yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+qn+(45===er(e,14)?"inline-":"")+"box$3$1"+qn+"$2$3$1"+Bn+"$2box$3")+e}break;case 5936:switch(er(e,t+11)){case 114:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return qn+e+Bn+e+e}return e}var Br=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Kn:e.return=Ur(e.value,e.length);break;case Wn:return Ir([fr(e,{value:Yn(e.value,"@","@"+qn)})],r);case Vn:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ir([fr(e,{props:[Yn(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ir([fr(e,{props:[Yn(t,/:(plac\w+)/,":"+qn+"input-$1")]}),fr(e,{props:[Yn(t,/:(plac\w+)/,":-moz-$1")]}),fr(e,{props:[Yn(t,/:(plac\w+)/,Bn+"input-$1")]})],r)}return""})}}],$r=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,o=e.stylisPlugins||Br,s={},a=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;a.push(e)});var l,c,u=[Fr,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=rr(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}([zr,jr].concat(o,u));i=function(e,t,n,r){l=n,Ir(Ar(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Un({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return f.sheet.hydrate(a),f};var qr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Gr=/[A-Z]|^ms/g,Vr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Kr=function(e){return 45===e.charCodeAt(1)},Wr=function(e){return null!=e&&"boolean"!=typeof e},Hr=Or(function(e){return Kr(e)?e:e.replace(Gr,"-$&").toLowerCase()}),Jr=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Vr,function(e,t,n){return Qr={name:t,styles:n,next:Qr},t})}return 1===qr[e]||Kr(e)||"number"!=typeof t||0===t?t:t+"px"};function Xr(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return Qr={name:i.name,styles:i.styles,next:Qr},i.name;var o=n;if(void 0!==o.styles){var s=o.next;if(void 0!==s)for(;void 0!==s;)Qr={name:s.name,styles:s.styles,next:Qr},s=s.next;return o.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Xr(e,t,n[i])+";";else for(var o in n){var s=n[o];if("object"!=typeof s){var a=s;null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":Wr(a)&&(r+=Hr(o)+":"+Jr(o,a)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=Xr(e,t,s);switch(o){case"animation":case"animationName":r+=Hr(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<s.length;c++)Wr(s[c])&&(r+=Hr(o)+":"+Jr(o,s[c])+";")}return r}(e,t,n)}var a=n;if(null==t)return a;var l=t[a];return void 0!==l?l:a}var Qr,Yr=/label:\s*([^\s;{]+)\s*(;|$)/g;function Zr(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";Qr=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Xr(n,t,o)):i+=o[0];for(var s=1;s<e.length;s++){if(i+=Xr(n,t,e[s]),r)i+=o[s]}Yr.lastIndex=0;for(var a,l="";null!==(a=Yr.exec(i));)l+="-"+a[1];var c=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:Qr}}function ei(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}function ti(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function ni(e,t,n){var r=[],i=ei(e,r,n);return r.length<2?n:i+t(r)}var ri=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(null!=i){var o=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))o=e(i);else for(var s in o="",i)i[s]&&s&&(o&&(o+=" "),o+=s);break;default:o=i}o&&(n&&(n+=" "),n+=o)}}return n},ii=function(e){var t=$r(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Zr(n,t.registered,void 0);return function(e,t){!function(e,t){var n=e.key+"-"+t.name;void 0===e.registered[n]&&(e.registered[n]=t.styles)}(e,t);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+n:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,i),t.key+"-"+i.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return ni(t.registered,n,ri(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Zr(n,t.registered);ti(t,i)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Zr(n,t.registered),o="animation-"+i.name;return ti(t,{name:i.name,styles:"@keyframes "+o+"{"+i.styles+"}"}),o},hydrate:function(e){e.forEach(function(e){t.inserted[e]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:ei.bind(null,t.registered),merge:ni.bind(null,t.registered,n)}}({key:"css"}),oi=ii.cx,si=ii.injectGlobal,ai=ii.keyframes,li=ii.css;let ci=function(e){let t=e=>ke(e,{},(e,t)=>(e[t[0].toString()+"%"]=On(t[1]),e));return{insertRule:t=>e.injectRaw(t),renderRule:(t,n)=>e.renderRaw(t,n),global:(t,n)=>e.injectRules(t,On(n)),renderGlobal:(t,n,r)=>e.renderRules(t,n,On(r)),style:t=>e.make(On(t)),merge:t=>e.mergeStyles(t),merge2:(t,n)=>e.mergeStyles([t,n]),merge3:(t,n,r)=>e.mergeStyles([t,n,r]),merge4:(t,n,r,i)=>e.mergeStyles([t,n,r,i]),keyframes:n=>e.makeKeyframes(t(n)),renderKeyframes:(n,r)=>e.renderKeyframes(n,t(r))}}({injectRaw:e=>{si(e)},renderRaw:function(e,t){si(t)},injectRules:function(e,t){si(Ze([[e,t]]))},renderRules:function(e,t,n){si(Ze([[t,n]]))},make:e=>li(e),mergeStyles:e=>oi(e),makeKeyframes:function(e){return ai(e)},renderKeyframes:function(e,t){return ai(t)}}),ui=function(e,t){return{TAG:"D",_0:e,_1:t}},di=function(e){return{TAG:"D",_0:"alignItems",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?hn.toString(e):"normal"===e||"stretch"===e?vn.toString(e):fn.toString(e)}},fi=function(e){return{TAG:"D",_0:"alignSelf",_1:"object"==typeof e?kn.toString(e):"selfStart"===e||"flexEnd"===e||"flexStart"===e||"center"===e||"start"===e||"selfEnd"===e||"right"===e||"left"===e||"end_"===e?fn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?hn.toString(e):yn.toString(e)}},hi=function(e){return{TAG:"D",_0:"bottom",_1:Pn(e)}},pi=function(e){return{TAG:"D",_0:"cursor",_1:Yt.toString(e)}},gi=function(e){return{TAG:"D",_0:"display",_1:"object"==typeof e?kn.toString(e):"table"===e||"grid"===e||"flex"===e?an.toString(e):"contents"===e||"none"===e?un.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"inlineGrid"===e||"inlineFlex"===e||"inlineBlock"===e||"inlineTable"===e?dn.toString(e):"block"===e||"inline"===e||"runIn"===e?sn.toString(e):"listItem"===e?ln.toString(e):cn.toString(e)}},mi=function(e){return{TAG:"D",_0:"flexDirection",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):bn.toString(e)}},vi=function(e){return{TAG:"D",_0:"flexGrow",_1:e.toString()}},yi=function(e){return{TAG:"D",_0:"flexShrink",_1:e.toString()}},_i=function(e){return{TAG:"D",_0:"flexWrap",_1:"object"==typeof e?kn.toString(e):"nowrap"===e||"wrapReverse"===e||"wrap"===e?_n.toString(e):jt.toString(e)}},bi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"height",_1:t}},xi=function(e){return{TAG:"D",_0:"justifyContent",_1:"object"==typeof e?kn.toString(e):"spaceBetween"===e||"stretch"===e||"spaceAround"===e||"spaceEvenly"===e?gn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"normal"===e?pn.toString(e):fn.toString(e)}},Si=function(e){return{TAG:"D",_0:"left",_1:Pn(e)}},wi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):"abs"===n?on.toString(e):Kt.toString(e)}else t="zero"===e?Kt.toString(e):"normal"===e?on.toString(e):jt.toString(e);return{TAG:"D",_0:"lineHeight",_1:t}},Ei=function(e){return{TAG:"D",_0:"listStyleType",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):Xt.toString(e)}},ki=function(e){return{TAG:"D",_0:"margin",_1:Ln(e)}},Ci=function(e,t){return{TAG:"D",_0:"margin",_1:Ln(e)+" "+Ln(t)}},Ai=function(e){return{TAG:"D",_0:"marginLeft",_1:Ln(e)}},Ni=function(e){return{TAG:"D",_0:"marginRight",_1:Ln(e)}},Ti=function(e){return{TAG:"D",_0:"marginTop",_1:Ln(e)}},Ri=function(e){return{TAG:"D",_0:"marginBottom",_1:Ln(e)}},Di=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Rn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"maxHeight",_1:t}},Ii=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Nn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"maxWidth",_1:t}},Fi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Dn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"minHeight",_1:t}},Oi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Tn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"minWidth",_1:t}},Pi=function(e){return{TAG:"D",_0:"opacity",_1:e.toString()}},Mi=function(e){return{TAG:"D",_0:"overflow",_1:Ht.toString(e)}},Li=function(e){return{TAG:"D",_0:"overflowY",_1:Ht.toString(e)}},zi=function(e){return{TAG:"D",_0:"padding",_1:Kt.toString(e)}},ji=function(e,t){return{TAG:"D",_0:"padding",_1:Kt.toString(e)+" "+Kt.toString(t)}},Ui=function(e){return{TAG:"D",_0:"position",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):Wt.toString(e)}},Bi=function(e){return{TAG:"D",_0:"right",_1:Pn(e)}},$i=function(e){return{TAG:"D",_0:"textAlign",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):mn.toString(e)}},qi=function(e){return{TAG:"D",_0:"top",_1:Pn(e)}},Gi=function(e){return{TAG:"D",_0:"userSelect",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):xn.toString(e)}},Vi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"width",_1:t}},Ki=function(e){return{TAG:"D",_0:"zIndex",_1:e.toString()}},Wi=function(e,t){return{TAG:"S",_0:e,_1:t}},Hi=function(e,t){return{TAG:"S",_0:"@media "+e,_1:t}},Ji=function(e){return{TAG:"PseudoClass",_0:"disabled",_1:e}},Xi=function(e){return{TAG:"PseudoClass",_0:"focus",_1:e}},Qi=function(e){return{TAG:"PseudoClass",_0:"focus-within",_1:e}},Yi=function(e){return{TAG:"PseudoClass",_0:"hover",_1:e}},Zi=function(e){return{TAG:"PseudoClass",_0:"last-child",_1:e}},eo=function(e){return{TAG:"S",_0:"::placeholder",_1:e}},to=zn,no=function(e,t,n){return{TAG:"D",_0:"border",_1:Vt.toString(e)+" "+jn(t)+" "+Mn(n)}},ro=function(e){return{TAG:"D",_0:"animationName",_1:e}},io=function(e){return{TAG:"D",_0:"animationDuration",_1:$t.toString(e)}},oo=function(e){return{TAG:"D",_0:"animationIterationCount",_1:Qt.toString(e)}},so=function(e){return{TAG:"D",_0:"animationTimingFunction",_1:Cn.toString(e)}},ao=In,lo=ci.global,co=ci.style,uo=ci.merge,fo=ci.keyframes;function ho(e){return"var("+e+")"}let po=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",ho(bt.md)),vi(1),ui("min-height","200px"),$i("center"),ui("padding",ho(bt.xxl))]),go=co([ui("font-size","40px"),ui("color",ho(_t.textDisabled)),ui("line-height","1")]),mo=co([ui("color",ho(_t.textPrimary)),ui("font-size",ho(xt.sizeLg)),ui("font-weight",ho(xt.weightMedium)),ki(to(0))]),vo=co([ui("color",ho(_t.textSecondary)),ui("font-size",ho(xt.sizeMd)),ui("max-width","360px"),ki(to(0))]),yo=co([ui("background",ho(_t.brand)),ui("color",ho(_t.textOnBrand)),ui("border","none"),ui("border-radius",ho(St.md)),ui("padding","var("+bt.sm+") var("+bt.lg+")"),ui("font-size",ho(xt.sizeMd)),ui("cursor","pointer"),Ti(to(8))]);let _o=function(e){let t=e.title,n=void 0!==t?t:"Nothing here yet";return r("div",{children:[i("div",{children:"( )",className:go}),i("h3",{children:n,className:mo}),L(e.description,null,e=>i("p",{children:e,className:vo})),L(e.action,null,e=>{let t=e[1];return i("button",{children:e[0],className:yo,onClick:e=>t()})})],className:po})};function bo(e){return"var("+e+")"}let xo=co([Vi({NAME:"percent",VAL:100}),ui("border-collapse","collapse"),ui("font-size",bo(xt.sizeMd))]),So=co([ui("background",bo(_t.surfaceSubtle)),ui("border-bottom","2px solid var("+_t.border+")")]),wo=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",bo(_t.textSecondary)),ui("font-weight",bo(xt.weightMedium)),ui("font-size",bo(xt.sizeSm)),ui("text-align","left"),ui("white-space","nowrap"),ui("user-select","none")]),Eo=co([ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("font-size",bo(xt.sizeMd))]),ko=co([pi("pointer"),Yi([ui("color",bo(_t.textPrimary))])]),Co=co([ui("color",bo(_t.textPrimary))]),Ao=co([Ai(to(4)),ui("font-size",bo(xt.sizeXs)),ui("color",bo(_t.brand))]),No=co([ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Yi([ui("background",bo(_t.surfaceSubtle))])]),To=co([ui("min-height","44px")]),Ro=co([pi("pointer")]),Do=co([ui("background",bo(_t.surfaceSubtle)),ui("box-shadow","inset 3px 0 0 0 var("+_t.brand+")")]),Io=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",bo(_t.textPrimary)),ui("vertical-align","middle")]),Fo=co([ui("padding","var("+bt.sm+") var("+bt.md+")")]),Oo=co([$i("center"),ui("padding",bo(bt.xxl))]);function Po(e){let t=e.onSort,n=e.sortState,o="Comfortable"===e.density?wo+" "+Eo:wo;return i("thead",{children:i("tr",{children:e.columns.map(e=>{let s=L(n,!1,t=>t.key===e.key),a=L(n,"Asc",e=>e.direction),l=e.sortable?o+" "+ko+(s?" "+Co:""):o;return r("th",{children:[e.label,s?i("span",{children:"Asc"===a?"^":"v",className:Ao}):null],className:l,style:L(e.width,{},e=>({width:e})),onClick:n=>{if(e.sortable)return M(t,t=>{let n=s&&"Asc"===a?"Desc":"Asc";t(e.key,n)})}},e.key)})}),className:So})}let Mo=function(e){let t=e.activeKey,n=e.density,o=e.onRowClick,s=e.keyFn,a=e.data,l=e.columns,c=void 0!==n?n:"Compact",u="Comfortable"===c?Io+" "+Fo:Io,d="Comfortable"===c?No+" "+To:No;return r("table",{children:[i(Po,{columns:l,sortState:e.sortState,onSort:e.onSort,density:c}),i("tbody",{children:0===a.length?i("tr",{children:i("td",{children:U(e.emptyView,i(_o,{title:"No data"})),className:u+" "+Oo,colSpan:l.length})}):a.map(e=>{let n=s(e),r=L(o,d,e=>d+" "+Ro),a=vt(t,n)?r+" "+Do:r;return i("tr",{children:l.map(t=>i("td",{children:t.render(e),className:u},t.key)),className:a,onClick:t=>M(o,t=>t(e))},n)})})],className:xo})};function Lo(e){return e?{TAG:"Partial",_0:"FromStart"}:"Complete"}function zo(e,t){return e.toString()+" "+t+(1===e?"":"s")}function jo(e,t,n,r){let i=void 0!==r?r:"item",o=U(n,t),s=o===t?zo(o,i):o.toString()+" of "+zo(t,i);if(void 0===e)return"Showing the "+s+" loaded";if("object"!=typeof e)return"Showing all "+s;switch(e._0){case"FromStart":return"Showing the first "+s+" — more available";case"Between":return"Showing "+s+" — more before and after";case"ToEnd":return"Showing the last "+s+" — more before"}}function Uo(e,t){return t?e+"+":e}function Bo(e){switch(e){case"Small":return 20;case"Medium":return 28;case"Large":return 44}}let $o=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74","#5e7c9c"];function qo(e){let t={contents:5381};return e.split("").forEach(e=>{let n=U(e.codePointAt(0),0);t.contents=(33*t.contents|0)+n&2147483647}),fe(t.contents,$o.length)}function Go(e){let t=me(e.split(/[\s_.@-]+/),e=>e).filter(e=>""!==e),n=e=>e.slice(0,1).toUpperCase(),r=t[0],i=t[1];return void 0!==r?void 0!==i?n(r)+n(i):n(r):"?"}function Vo(e){return"var("+e+")"}let Ko=co([gi("inlineFlex"),di("center"),xi("center"),ui("border-radius",Vo(St.full)),ui("color","#ffffff"),ui("font-family",Vo(xt.fontFamily)),ui("font-weight",Vo(xt.weightMedium)),ui("flex-shrink","0"),ui("user-select","none"),ui("vertical-align","middle"),ui("overflow","hidden")]),Wo=co([ui("width","100%"),ui("height","100%"),ui("object-fit","cover")]);let Ho=function(e){let t=e.size,n=e.src,r=e.name,o=void 0!==t?t:"Medium",a=s(()=>!1),l=a[1],c=Bo(o),u=c.toString()+"px",d=void 0!==n&&(""!==n&&!a[0]),f={background:d?"transparent":$o[qo(r)],fontSize:((c/2|0)-1|0).toString()+"px",height:u,width:u};return i("span",{children:d?i("img",{className:Wo,alt:r,src:U(n,""),onError:e=>l(e=>!0)}):Go(r),"aria-label":r,className:Ko,role:"img",style:f,title:r})};function Jo(e){return"var("+e+")"}let Xo=co([gi("flex"),_i("wrap"),ui("gap",Jo(bt.xs)),di("center")]),Qo=co([gi("inlineFlex"),di("center"),ui("padding","2px 8px"),ui("border-radius",Jo(St.full)),ui("background",Jo(_t.surfaceElevated)),ui("color",Jo(_t.textSecondary)),ui("font-size",Jo(xt.sizeXs)),ui("font-weight",Jo(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap")]),Yo=co([ui("color",Jo(_t.textDisabled)),ui("font-size",Jo(xt.sizeSm))]);let Zo=function(e){let t=e.items;return 0===t.length?i("span",{children:"—",className:Yo}):i("div",{children:t.map((e,t)=>i("span",{children:e,className:Qo},t.toString()+":"+e)),className:Xo})};function es(e){return"var("+e+")"}let ts=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("background","transparent"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",es(St.sm)),ui("padding","1px 6px"),ui("color",es(_t.textSecondary)),ui("font-size",es(xt.sizeXs)),ui("line-height","1"),pi("pointer"),Yi([ui("background",es(_t.surfaceElevated)),ui("color",es(_t.textPrimary))])]),ns=co([ui("color",es(_t.success)),ui("border-color",es(_t.success))]);let rs=function(e){let t=e.label,n=e.value,r=void 0!==t?t:"Copy",o=s(()=>!1),a=o[1],l=o[0];return i("button",{children:l?"Copied":r,"aria-label":"Copy to clipboard",className:l?ts+" "+ns:ts,type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),ce(navigator.clipboard.writeText(n).then(()=>(a(e=>!0),setTimeout(()=>a(e=>!1),1500),Promise.resolve())),e=>Promise.resolve())}})};function is(e){return"var("+e+")"}let os=co([gi("inlineFlex"),di("center"),ui("gap",is(bt.xs)),ui("min-width","0")]),ss=co([ui("color",is(_t.brand)),ui("text-decoration","none"),ui("max-width","260px"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),Yi([ui("text-decoration","underline")])]),as=co([ui("color",is(_t.textPrimary)),ui("font-family","var(--rv-font-mono, ui-monospace, monospace)"),ui("font-size",is(xt.sizeSm)),ui("max-width","200px"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]);function ls(e,t){return e.length>t?e.slice(0,6)+"…"+e.slice(e.length-4|0,e.length):e}let cs=function(e){let t=e.copyable,n=e.rawValue,o=e.label,s=e.href,a=void 0!==t&&t,l=ae();return r("span",{children:[void 0!==s?i("a",{children:o,className:ss,title:o,href:s,onClick:e=>{if(!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button)&&void 0!==s)return e.preventDefault(),e.stopPropagation(),l(s)}}):i("span",{children:ls(o,18),className:as,title:n}),a?i(rs,{value:n}):null],className:os})};function us(e){return"var("+e+")"}let ds=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("padding","2px 8px"),ui("border-radius",us(St.full)),ui("background",us(_t.surfaceElevated)),ui("color",us(_t.textSecondary)),ui("font-size",us(xt.sizeXs)),ui("font-weight",us(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap"),ui("border","none")]),fs=co([pi("pointer"),Yi([ui("background",us(_t.surface)),ui("color",us(_t.textPrimary))])]),hs=co([ui("font-weight",us(xt.weightBold)),ui("color",us(_t.textPrimary))]);let ps=function(e){let t=e.onClick,n=L(t,ds,e=>ds+" "+fs),s=r(o,{children:[i("span",{children:e.count.toString(),className:hs})," "+e.label,L(t,null,e=>i("span",{children:" ▸","aria-hidden":!0}))]});return void 0!==t?i("button",{children:s,className:n,type:"button",onClick:e=>t()}):i("span",{children:s,className:n})};function gs(e){let t=e.toString();return t.length<2?"0"+t:t}function ms(e){let t=new Date(e),n=t.getTime();if(Number.isNaN(n))return e;let r=0|t.getFullYear(),i=1+(0|t.getMonth())|0,o=0|t.getDate(),s=0|t.getHours(),a=0|t.getMinutes(),l=0|t.getSeconds();return r.toString()+"-"+gs(i)+"-"+gs(o)+" "+gs(s)+":"+gs(a)+":"+gs(l)}let vs=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/;function ys(e){if(vs.test(e))return ms(e)}function _s(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}function bs(e,t){return L(e,!1,_s)?void 0:ys(t)}function xs(e){return"var("+e+")"}let Ss=function(e){let t=e.dot,n=e.variant,o=void 0!==t&&t,s=function(e){if("object"==typeof e)return[e.bg,e.fg];switch(e){case"Success":return[_t.success,_t.background];case"Warning":return[_t.warning,_t.background];case"Error":return[_t.error,_t.background];case"Info":return[_t.info,_t.background];case"Neutral":return[_t.surfaceElevated,_t.textSecondary]}}(void 0!==n?n:"Neutral");return r("span",{children:[o?i("span",{style:{background:"currentColor",display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",flexShrink:"0"}}):null,e.label],className:(a=s[0],l=s[1],co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("padding","2px 8px"),ui("border-radius",xs(St.full)),ui("font-size",xs(xt.sizeXs)),ui("font-weight",xs(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap"),ui("background",a.startsWith("--rv-")?"var("+a+")":a),ui("color",l.startsWith("--rv-")?"var("+l+")":l)]))});var a,l};function ws(e){return z(e.plugin,t=>t+"."+e.store)}let Es={isId:!1,isCompositeId:!1,isSubId:!1,isCompositeSubId:!1,index:void 0,hidden:!1,summary:!1,groupBy:!1,drillTarget:void 0,collapsed:!1,scan:!1,scanSort:!1,semantic:void 0,semanticFromType:!1,storeTarget:void 0,channel:void 0,setter:void 0,retired:void 0};function ks(e,t){let n=z(Xe(e,t),ut);return"JSONTrue"===n&&"object"!=typeof n}function Cs(e,t){return j(Xe(e,t),dt)}function As(e){return j(j(Xe(e,"x-reventless-semantic-target"),ht),e=>z(j(Xe(e,"store"),dt),t=>({plugin:j(Xe(e,"plugin"),dt),store:t})))}function Ns(e){return j(j(Xe(e,"x-reventless-setter"),ht),e=>z(j(Xe(e,"command"),dt),t=>({command:t,field:j(Xe(e,"field"),dt)})))}function Ts(e){return z(j(Xe(e,"x-reventless-retired"),ht),e=>{let t=j(Xe(e,"values"),pt);return{label:P(j(Xe(e,"label"),dt),e=>""!==e.trim()),showWhenFalse:ks(e,"showWhenFalse"),values:void 0!==t?me(t,e=>P(dt(e),e=>""!==e.trim())):z(P(j(Xe(e,"value"),dt),e=>""!==e.trim()),e=>[e]),namedWhenRetired:ks(e,"namedWhenRetired")}})}function Rs(e){let t=z(Xe(e,"x-reventless-index"),ut);if(void 0!==t)return"object"!=typeof t?"JSONTrue"===t?"":void 0:"JSONString"===t.TAG?t._0:void 0}function Ds(e){let t=ht(e);if(void 0===t)return;let n=ht(Lt(e));if(void 0===n)return t;if(n===t)return t;let r=Ze(Qe(n));return Qe(t).forEach(e=>{r[e[0]]=e[1]}),r}function Is(e){let t=Ds(e);return void 0!==t?{isId:ks(t,"x-reventless-id"),isCompositeId:ks(t,"x-reventless-compositeId"),isSubId:ks(t,"x-reventless-subId"),isCompositeSubId:ks(t,"x-reventless-compositeSubId"),index:Rs(t),hidden:ks(t,"x-reventless-hidden")||ks(t,"x-reventless-ui-hidden"),summary:ks(t,"x-reventless-summary"),groupBy:ks(t,"x-reventless-group-by"),drillTarget:z(Cs(t,"x-reventless-drillTarget"),e=>({slice:e,keyPath:Cs(t,"x-reventless-drillTargetKey")})),collapsed:ks(t,"x-reventless-collapsed"),scan:ks(t,"x-reventless-scan"),scanSort:ks(t,"x-reventless-scanSort"),semantic:Cs(t,"x-reventless-semantic"),semanticFromType:vt(Cs(t,"x-reventless-semantic-source"),"type"),storeTarget:As(t),channel:Cs(t,"x-reventless-channel"),setter:Ns(t),retired:Ts(t)}:Es}function Fs(e,t){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{if(t(Is(e[1])))return e[0]})),[])}function Os(e){return Fs(e,e=>e.summary)}function Ps(e){return Fs(e,e=>e.isId)[0]}function Ms(e){return j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{let t=e[0];return z(Is(e[1]).retired,e=>[t,e])})[0])}function Ls(e){return z(Ms(e),e=>e[0])}function zs(e){return Fs(e,e=>e.isCompositeId)}function js(e){return Fs(e,e=>!!e.isSubId||e.isCompositeSubId)[0]}function Us(e){return U(function(e){return j(j(ht(e),e=>Xe(e,"x-reventless-live")),e=>{let t=ut(e);if("object"!=typeof t)switch(t){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}(e),!0)}function Bs(e){return j(j(ht(e),e=>Xe(e,"x-reventless-viewmode")),dt)}function $s(e){return j(z(j(j(ht(Lt(e)),e=>Xe(e,"enum")),pt),e=>me(e,dt)),e=>{if(0!==e.length)return e})}function qs(e,t){return U(j(j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),$s),[])}function Gs(e,t){return z(Ms(e),e=>{let n=e[1],r=e[0];return{field:r,label:U(B(P(t,e=>""!==e.trim()),n.label),lt(r)),showWhenFalse:n.showWhenFalse,values:n.values,namedWhenRetired:n.namedWhenRetired}})}function Vs(e,t){return j(t,t=>{let n=e.values,r=ut(t);if(void 0!==n)return"object"!=typeof r||"JSONString"!==r.TAG?void 0:n.includes(r._0);if("object"!=typeof r)switch(r){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}function Ks(e,t){let n=e.values,r=Vs(e,t);return void 0!==n?void 0!==r&&r?z(j(t,dt),e=>i(Ss,{variant:"Warning",label:e,dot:!1})):void 0:void 0!==r?r?i(Ss,{variant:"Warning",label:e.label,dot:!1}):e.showWhenFalse?i(Ss,{variant:"Neutral",label:"Not "+e.label,dot:!1}):void 0:void 0}let Ws="archived";let Hs={param:Ws,on:"1",label:function(e){return void 0!==e.values?"Show retired":"Show "+e.label.toLowerCase()},offered:function(e,t){return!!e&&$(t)},showing:function(e,t){return!!e&&vt(t,"1")},toggleParams:function(e){return[[Ws,e?"":"1"],["after",""],["before",""]]}};function Js(e){return"var("+e+")"}let Xs=co([gi("inlineFlex"),di("center"),ui("vertical-align","middle")]),Qs=co([gi("inlineFlex"),ui("border-radius",Js(St.full)),ui("box-shadow","0 0 0 2px var("+_t.surface+")")]),Ys=co([gi("inlineFlex"),di("center"),xi("center"),ui("border-radius",Js(St.full)),ui("background",Js(_t.surfaceElevated)),ui("color",Js(_t.textSecondary)),ui("font-family",Js(xt.fontFamily)),ui("font-weight",Js(xt.weightMedium)),ui("flex-shrink","0"),ui("user-select","none")]);let Zs=function(e){let t=e.max,n=e.size,o=e.members,s=void 0!==n?n:"Medium",a=void 0!==t?t:4,l=function(e,t){return e>t?e-t|0:0}(o.length,a),c=l>0?o.slice(0,a):o,u=l>0?o.slice(a):[],d=Bo(s),f=(0|-d)/3|0,h=e=>({marginLeft:0===e?"0":f.toString()+"px",zIndex:((c.length+1|0)-e|0).toString()});return r("span",{children:[c.map((e,t)=>i("span",{children:i(Ho,{name:e.name,src:e.imageUrl,size:s}),className:Qs,style:h(t)},t.toString())),l>0?i("span",{children:"+"+l.toString(),className:Qs+" "+Ys,style:{fontSize:((d/2|0)-2|0).toString()+"px",height:d.toString()+"px",marginLeft:f.toString()+"px",width:d.toString()+"px",zIndex:(c.length+2|0).toString()},title:u.map(e=>e.name).join(", ")}):null],className:Xs})},ea=l(void 0),ta=ea.Provider;let na=function(e){return c(ta,{value:e.fill,children:e.children})};function ra(e){let t=parseFloat(e);return Number.isNaN(t)?void 0:t}function ia(e){switch(e){case"Email":return"email";case"Phone":return"phone";case"Url":return"url";case"DateTime":return"date-time";case"Currency":return"currency";case"Percent":return"percent";case"Bytes":return"bytes";case"Duration":return"duration";case"Color":return"color";case"Image":return"image";case"Status":return"status";case"GeoLat":return"geo-lat";case"GeoLng":return"geo-lng";case"GeoPoint":return"geo-point";case"Label":return"label";case"UserRef":return"user-ref";case"File":return"file";case"Markdown":return"markdown";case"ChannelText":return"channel-text";case"Rating":return"rating";case"Progress":return"progress";case"FileUrl":return"file-url";case"Country":return"country";case"Address":return"address";case"Qr":return"qr";case"Barcode":return"barcode";case"Signature":return"signature";case"ParentRef":return"parent-ref";case"Money":return"money";case"DateRange":return"date-range";case"Geolocation":return"geolocation"}}let oa=["Email","Phone","Url","DateTime","Currency","Percent","Bytes","Duration","Color","Image","Status","GeoLat","GeoLng","GeoPoint","Label","UserRef","File","Markdown","ChannelText","Rating","Progress","FileUrl","Country","Address","Qr","Barcode","Signature","ParentRef","Money","DateRange","Geolocation"],sa="storageRef";function aa(e){return e===sa||"uploadableImage"===e||"uploadableFile"===e}function la(e){switch(e){case"address":return"Address";case"barcode":return"Barcode";case"bytes":return"Bytes";case"channel-text":return"ChannelText";case"color":return"Color";case"country":return"Country";case"currency":return"Currency";case"date-time":return"DateTime";case"date-range":case"dateRange":return"DateRange";case"duration":return"Duration";case"email":return"Email";case"file-url":return"FileUrl";case"geo-lat":return"GeoLat";case"geo-lng":return"GeoLng";case"geo-point":case"geoPoint":return"GeoPoint";case"geolocation":return"Geolocation";case"label":return"Label";case"markdown":return"Markdown";case"money":return"Money";case"parent-ref":return"ParentRef";case"percent":return"Percent";case"phone":return"Phone";case"progress":return"Progress";case"qr":return"Qr";case"rating":return"Rating";case"signature":return"Signature";case"status":return"Status";case"file":case"fileRef":case"uploadableFile":return"File";case"image":case"imageRef":case"uploadableImage":return"Image";case"url":return"Url";case"user-ref":return"UserRef";default:return}}function ca(e){switch(e){case"Image":return["Illustrable"];case"Status":return["Stageable"];case"ParentRef":return["Hierarchical"];case"Money":return["Measure"];case"DateRange":return["Schedulable"];case"GeoPoint":case"Geolocation":return["Mappable"];default:return[]}}function ua(e,t){return j(j(Xe(e,t),dt),e=>""===e?void 0:e)}function da(e,t,n){return j(j(j(j(Xe(e,t),ht),e=>Xe(e,n)),dt),e=>""===e?void 0:e)}function fa(e,t){return"Pair"===e.TAG?ua(t,e.startField):da(t,e._0,"start")}function ha(e,t){if("Pair"!==e.TAG)return da(t,e._0,"end");let n=e.endField;return void 0!==n?ua(t,n):void 0}function pa(e){return"Pair"!==e.TAG||void 0!==e.endField}function ga(e,t){let n=Xe(e,t);if(void 0===n)return;let r=ft(n);return void 0!==r?r:j(dt(n),ra)}function ma(e,t,n){return j(j(j(Xe(e,t),ht),e=>Xe(e,n)),ft)}function va(e){return j(ht(e),e=>{let t=j(j(B(Xe(e,"__typename"),Xe(e,"TAG")),dt),e=>""===e?void 0:e);return z(t,t=>[t,Ze(Qe(e).filter(e=>{let t=e[0];return"__typename"!==t&&"TAG"!==t}))])})}function ya(e){return j(va(e),e=>{let t=e[1],n=e[0];if(!n.endsWith("Located"))return n.endsWith("Pending")?{TAG:"Pending",requestedFor:ua(t,"requestedFor")}:n.endsWith("Unresolvable")?{TAG:"Unresolvable",reason:ua(t,"reason")}:void 0;let r=ma(t,"point","lat"),i=ma(t,"point","lng");return{TAG:"Located",point:void 0!==r&&void 0!==i?[r,i]:void 0}})}function _a(e){switch(e.TAG){case"Located":let t=e.point;return void 0!==t?t:void 0;case"Pending":case"Unresolvable":return}}function ba(e){switch(e.TAG){case"Pending":case"Located":return;case"Unresolvable":let t=e.reason;return void 0!==t?t:void 0}}function xa(e,t){switch(e.TAG){case"Paired":let n=ga(t,e.latField),r=ga(t,e.lngField);return void 0!==n&&void 0!==r?[n,r]:void 0;case"Pointed":let i=e._0,o=ma(t,i,"lat"),s=ma(t,i,"lng");return void 0!==o&&void 0!==s?[o,s]:void 0;case"Geolocated":return j(function(e,t){return j(Xe(e,t),ya)}(t,e._0),_a)}}function Sa(e){return U(z(j(j(ht(Lt(e)),e=>Xe(e,"properties")),ht),Qe),[]).map(e=>[e[0],Lt(e[1])])}function wa(e,t){return j(j(ht(Lt(e)),e=>Xe(e,t)),dt)}function Ea(e){let t=wa(e,"type");if(void 0===t)return!1;switch(t){case"integer":case"number":return!0;default:return!1}}function ka(e){return vt(wa(e,"type"),"string")}function Ca(e){let t=wa(e,"format");if(void 0===t)return!1;switch(t){case"date":case"date-time":return!0;default:return!1}}let Aa=["user","username","owner","assignee","assignedto","author","creator","createdby","updatedby","reporter","approver","reviewer","actor","member"];function Na(e){return Aa.includes(e.toLowerCase())}function Ta(e,t){return t.some(t=>e.endsWith(t))}function Ra(e){return L($s(e),0,e=>e.length)}function Da(e,t){return j(j(ht(Lt(e)),e=>Xe(e,t)),ft)}let Ia=[["street","streetaddress","line1","addressline1","address1","housenumber"],["city","town","locality"],["postalcode","zip","zipcode","postcode"],["state","region","province","county"],["country","countrycode"]];let Fa=["parent","parentid","manager","managerid","reportsto","reportstoid","supervisor","supervisorid"];function Oa(e,t){let n=e.toLowerCase(),r=function(e,t){if(!Ea(t))return;let n=Da(t,"maximum");return["rating","stars","starrating"].includes(e)?void 0!==n&&n>10?void 0:["Rating","name:rating"]:"score"===e&&void 0!==n&&n<=10?["Rating","name:score-scale"]:void 0}(n,t);return void 0!==r?r:["status","state","stage"].includes(n)&&Ra(t)>0?Ra(t)<=8?["Status","name:status-enum"]:void 0:vt(wa(t,"type"),"string")&&["imageurl","image","photo","photourl","avatar","avatarurl","thumbnail"].includes(n)?["Image","name:image"]:Ea(t)&&Ta(n,["price","amount","total"])?["Currency","name:currency"]:vt(wa(t,"type"),"string")&&["email"].includes(n)?["Email","name:email"]:vt(wa(t,"type"),"string")&&["phone","phonenumber"].includes(n)?["Phone","name:phone"]:vt(wa(t,"type"),"string")&&["website","url","homepage"].includes(n)?["Url","name:url"]:vt(wa(t,"type"),"string")&&(["file","attachment","upload"].includes(n)||Ta(n,["storageref","fileref","attachmentref"]))?["File","name:file"]:Ea(t)&&["progress","percentcomplete","percentdone","completion"].includes(n)?["Progress","name:progress"]:vt(wa(t,"type"),"string")&&["country","countrycode","countryname"].includes(n)?["Country","name:country"]:vt(wa(t,"type"),"string")&&["address","streetaddress","billingaddress","shippingaddress"].includes(n)?["Address","name:address"]:vt(wa(t,"type"),"string")&&function(e){return!!Fa.includes(e)||!!e.startsWith("parent")&&e.endsWith("id")}(n)?["ParentRef","name:parent-ref"]:vt(wa(t,"type"),"string")&&["name","title","label","displayname"].includes(n)?["Label","name:label"]:vt(wa(t,"type"),"string")&&Aa.includes(n)?["UserRef","name:user"]:void 0}function Pa(e){return["lat","latitude"].includes(e)}function Ma(e){return["lng","lon","long","longitude"].includes(e)}let La={contents:[]};function za(e,t,n){let r=e+"."+t+"."+n;if(La.contents.some(e=>e===r))return;La.contents.push(r);let i=oa.map(ia).join(", ");console.error('[AutoUI] Unknown semantic "'+n+'" ('+e+') on field "'+t+'" — ignored. Valid ids: '+i+".")}function ja(e,t){let n=Lt(t),r=Is(n),i=r.semanticFromType?"Type":"Annotation",o=L(r.semantic,!1,aa),s=j(r.semantic,t=>{if(t===sa)return;let n=la(t);return void 0!==n?{semantic:n,provenance:i}:void za("x-reventless-semantic",e,t)});if(void 0!==s)return s;let a,l=e.toLowerCase(),c=vt(wa(n,"type"),"object")&&function(e){let t=Sa(e),n=(e,n)=>t.some(t=>t[0].toLowerCase()===e&&n(t[1]));return!!n("amount",Ea)&&n("currency",ka)}(n)?["Money","shape:money"]:vt(wa(n,"type"),"object")&&function(e){let t=Sa(e),n=e=>t.some(t=>{let n=t[1];return!(t[0].toLowerCase()!==e||!vt(wa(n,"type"),"string"))&&Ca(n)});return!!n("start")&&n("end")}(n)?["DateRange","shape:date-range"]:vt(wa(n,"type"),"object")&&function(e){let t=Sa(e);return Ia.filter(e=>t.some(t=>e.includes(t[0].toLowerCase()))).length>=2}(n)?["Address","shape:address"]:vt(wa(n,"type"),"object")&&function(e){let t=Sa(e),n=t.some(e=>!!Pa(e[0].toLowerCase())&&Ea(e[1])),r=t.some(e=>!!Ma(e[0].toLowerCase())&&Ea(e[1]));return!!n&&r}(n)?["GeoPoint","shape:geo-point"]:Pa(l)&&Ea(n)?["GeoLat","name:geo-pair"]:Ma(l)&&Ea(n)?["GeoLng","name:geo-pair"]:void 0;if(void 0!==c)a=c;else if(vt(wa(n,"type"),"string")&&function(e){return Ta(e,["fileurl","documenturl","downloadurl","attachmenturl","pdfurl"])}(l))a=["FileUrl","name:file-url"];else{let t=function(e){let t=wa(e,"format");if(void 0!==t)switch(t){case"date":case"date-time":return["DateTime","format:date-time"];case"email":return["Email","format:email"];case"uri":case"url":return["Url","format:uri"];default:return}}(n);a=void 0!==t?t:Oa(e,n)}return B(z(a,e=>({semantic:e[0],provenance:{TAG:"Heuristic",_0:e[1]}})),o?{semantic:"File",provenance:i}:void 0)}function Ua(e,t){let n=ja(e,t);return void 0!==n?n:j(zt(t),t=>ja(ct(e),t))}function Ba(e,t,n){let r=Sa(e),i={};r.forEach(e=>{let n=e[0],r=j(j(t,e=>Xe(e,n)),e=>{let t=la(e);return void 0!==t?{semantic:t,provenance:"Hint"}:void za("uiHints.fields",n,e)});return void 0!==r?void(i[n]=r):M(ja(n,e[1]),e=>{i[n]=e})});let o,s=e=>r.map(e=>e[0]).find(t=>L(Xe(i,t),!1,t=>t.semantic===e)),a=e=>r.map(e=>e[0]).find(t=>L(Xe(i,t),!1,t=>ca(t.semantic).includes(e))),l=j(P(n,e=>"id"!==e.field),e=>z(r.find(t=>t[0]===e.field&&vt(wa(t[1],"type"),"string")),e=>e[0])),c=L(n,!1,e=>vt(e.source,"annotation")),u=c?l:void 0,d=r.map(e=>e[0]).find(e=>L(Xe(i,e),!1,e=>"Label"===e.semantic&&"Hint"===e.provenance));if(void 0!==d)o=d;else{let e=0;if(void 0!==l&&c?o=l:e=1,1===e){let e=s("Label");o=void 0!==e?e:l}}if(void 0!==o&&void 0!==l&&o===l){let e={semantic:"Label",provenance:c?"Annotation":{TAG:"Heuristic",_0:"declared:labelField"}},t=Xe(i,o);if(void 0!==t){let n=0,r=t.provenance;"object"!=typeof r&&"Hint"===r||(n=1),1===n&&"Label"===t.semantic&&(i[o]=e)}else i[o]=e}let f=a("Mappable"),h=s("GeoLat"),p=s("GeoLng"),g=void 0!==h&&void 0!==p?{TAG:"Paired",latField:h,lngField:p}:void 0,m=s("Geolocation"),v=void 0!==m?{TAG:"Geolocated",_0:m}:void 0!==f?{TAG:"Pointed",_0:f}:g,y=a("Schedulable"),_=me(r,e=>{let t=e[0];if(L(Xe(i,t),!1,e=>"DateTime"===e.semantic)||Ca(e[1]))return t}),b=_.find(e=>e.toLowerCase().startsWith("start")),x=_.find(e=>e.toLowerCase().startsWith("end")),S=void 0!==b?void 0!==x?{TAG:"Pair",startField:b,endField:x}:{TAG:"Pair",startField:b}:z(_.find(e=>{let t=e.toLowerCase();return!function(e){return["createdat","updatedat","deletedat"].includes(e)}(t)&&(!!Ta(t,["at","date"])||"date"===t)}),e=>({TAG:"Pair",startField:e}));return{semantics:i,geo:v,dateSpan:void 0!==y?{TAG:"Ranged",_0:y}:S,statusField:a("Stageable"),labelField:o,projectedLabelField:u,imageField:a("Illustrable"),parentField:a("Hierarchical")}}let $a=l([]),qa=l(e=>{}),Ga=$a.Provider,Va=qa.Provider;let Ka=function(e){let t=e.initial,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=f(e=>i(t=>e),[]);return c(Va,{value:o,children:c(Ga,{value:r[0],children:e.children})})};function Wa(){return d($a)}function Ha(e,t){let n=function(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}(t),r=nt(n),i=e.find(e=>e.name===r);return void 0!==i?i:e.find(e=>e.name===n)}function Ja(e,t){return e.find(e=>e.name===t)}function Xa(e,t){return ze(n=>Fe(e,Fe(encodeURIComponent(t),n)))}function Qa(e,t){return Fe(e,Fe(encodeURIComponent(t),"Wildcard"))}function Ya(e,t,n,r){let i=[n].concat(r).map(e=>encodeURIComponent(e));return Ue(Qa(e,t))(je.of_parts(i.join("/")))}var Za=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Za||{});const el=[1,0],tl=[2,3],nl=[3,2],rl={L:[0,1],M:el,Q:tl,H:nl},il=/^\d*$/,ol=/^[A-Z0-9 $%*+./:-]*$/,sl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",al=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],ll=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];let cl=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<1||e>40)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=4*e+17;const i=Array.from({length:this.size}).fill(!1);for(let s=0;s<this.size;s++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();const o=this.addEccAndInterleave(n);if(this.drawCodewords(o),-1===r){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2==0,Za.Timing),this.setFunctionModule(n,6,n%2==0,Za.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0===n&&0===r||0===n&&r===t-1||n===t-1&&0===r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.ecc[1]<<3|e;let n=t;for(let i=0;i<10;i++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);for(let i=0;i<=5;i++)this.setFunctionModule(8,i,dl(r,i));this.setFunctionModule(8,7,dl(r,6)),this.setFunctionModule(8,8,dl(r,7)),this.setFunctionModule(7,8,dl(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,dl(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,dl(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,dl(r,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;for(let n=0;n<18;n++){const e=dl(t,n),r=this.size-11+n%3,i=Math.floor(n/3);this.setFunctionModule(r,i,e),this.setFunctionModule(i,r,e)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;o>=0&&o<this.size&&s>=0&&s<this.size&&this.setFunctionModule(o,s,2!==i&&4!==i,Za.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!==Math.max(Math.abs(r),Math.abs(n)),Za.Alignment)}setFunctionModule(e,t,n,r=Za.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){const t=this.version,n=this.ecc;if(e.length!==kl(t,n))throw new RangeError("Invalid argument");const r=ll[n[0]][t],i=al[n[0]][t],o=Math.floor(El(t)/8),s=r-o%r,a=Math.floor(o/r),l=[],c=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let r=0;r<e-1;r++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=Al(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=Al(n,2)}return t}(i);for(let d=0,f=0;d<r;d++){const t=e.slice(f,f+a-i+(d<s?0:1));f+=t.length;const n=Cl(t,c);d<s&&t.push(0),l.push(t.concat(n))}const u=[];for(let d=0;d<l[0].length;d++)l.forEach((e,t)=>{(d!==a-i||t>=s)&&u.push(e[d])});return u}drawCodewords(e){if(e.length!==Math.floor(El(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const o=n-i,s=!(n+1&2)?this.size-1-r:r;!this.types[s][o]&&t<8*e.length&&(this.modules[s][o]=dl(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let t=!1,n=0;const i=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[r][o]===t?(n++,5===n?e+=3:n>5&&e++):(this.finderPenaltyAddHistory(n,i),t||(e+=40*this.finderPenaltyCountPatterns(i)),t=this.modules[r][o],n=1);e+=40*this.finderPenaltyTerminateAndCount(t,n,i)}for(let r=0;r<this.size;r++){let t=!1,n=0;const i=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][r]===t?(n++,5===n?e+=3:n>5&&e++):(this.finderPenaltyAddHistory(n,i),t||(e+=40*this.finderPenaltyCountPatterns(i)),t=this.modules[o][r],n=1);e+=40*this.finderPenaltyTerminateAndCount(t,n,i)}for(let r=0;r<this.size-1;r++)for(let t=0;t<this.size-1;t++){const n=this.modules[r][t];n===this.modules[r][t+1]&&n===this.modules[r+1][t]&&n===this.modules[r+1][t+1]&&(e+=3)}let t=0;for(const r of this.modules)t=r.reduce((e,t)=>e+(t?1:0),t);const n=this.size*this.size;return e+=10*(Math.ceil(Math.abs(20*t-10*n)/n)-1),e}getAlignmentPatternPositions(){if(1===this.version)return[];{const e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){const t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function ul(e,t,n){if(t<0||t>31||e>>>t!==0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function dl(e,t){return!!(e>>>t&1)}class fl{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const hl=[1,10,12,14],pl=[2,9,11,13],gl=[4,8,16,16];function ml(e,t){return e[Math.floor((t+7)/17)+1]}function vl(e){const t=[];for(const n of e)ul(n,8,t);return new fl(gl,e.length,t)}function yl(e){if(!bl(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let n=0;n<e.length;){const r=Math.min(e.length-n,3);ul(Number.parseInt(e.substring(n,n+r),10),3*r+1,t),n+=r}return new fl(hl,e.length,t)}function _l(e){if(!xl(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let n;for(n=0;n+2<=e.length;n+=2){let r=45*sl.indexOf(e.charAt(n));r+=sl.indexOf(e.charAt(n+1)),ul(r,11,t)}return n<e.length&&ul(sl.indexOf(e.charAt(n)),6,t),new fl(pl,e.length,t)}function bl(e){return il.test(e)}function xl(e){return ol.test(e)}function Sl(e,t){let n=0;for(const r of e){const e=ml(r.mode,t);if(r.numChars>=1<<e)return Number.POSITIVE_INFINITY;n+=4+e+r.bitData.length}return n}function wl(e){e=encodeURI(e);const t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}function El(e){if(e<1||e>40)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function kl(e,t){return Math.floor(El(e)/8)-al[t[0]][e]*ll[t[0]][e]}function Cl(e,t){const n=t.map(e=>0);for(const r of e){const e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=Al(t,e))}return n}function Al(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return n}function Nl(e,t){const{ecc:n="L",boostEcc:r=!1,minVersion:i=1,maxVersion:o=40,maskPattern:s=-1,border:a=1}=t||{},l="string"==typeof e?function(e){return""===e?[]:bl(e)?[yl(e)]:xl(e)?[_l(e)]:[vl(wl(e))]}(e):Array.isArray(e)?[vl(e)]:void 0;if(!l)throw new Error("uqr only supports encoding string and binary data, but got: "+typeof e);const c=function(e,t,n=1,r=40,i=-1,o=!0){if(!(1<=n&&n<=r&&r<=40)||i<-1||i>7)throw new RangeError("Invalid value");let s,a;for(s=n;;s++){const n=8*kl(s,t),i=Sl(e,s);if(i<=n){a=i;break}if(s>=r)throw new RangeError("Data too long")}for(const d of[el,tl,nl])o&&a<=8*kl(s,d)&&(t=d);const l=[];for(const d of e){ul(d.mode[0],4,l),ul(d.numChars,ml(d.mode,s),l);for(const e of d.getData())l.push(e)}const c=8*kl(s,t);ul(0,Math.min(4,c-l.length),l),ul(0,(8-l.length%8)%8,l);for(let d=236;l.length<c;d^=253)ul(d,8,l);const u=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>u[t>>>3]|=e<<7-(7&t)),new cl(s,t,u,i)}(l,rl[n],i,o,s,r),u=function(e,t=1){if(!t)return e;const{size:n}=e,r=n+2*t;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let o=0;o<t;o++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));const i=Za.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let o=0;o<t;o++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}({version:c.version,maskPattern:c.mask,size:c.size,data:c.modules,types:c.types},a);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}let Tl=co([gi("inlineBlock"),ui("background","#ffffff"),ui("padding","6px"),ui("border-radius",function(e){return"var("+e+")"}(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("line-height","0")]),Rl=co([ui("color","#000000"),ui("display","block")]);let Dl=function(e){let t=e.size,n=e.value,r=void 0!==t?t:128,o=function(e){if(""!==e.trim())try{return Nl(e,{ecc:"M",border:4})}catch(t){return}}(n);if(void 0===o)return null;let s=o.size.toString();return i("span",{children:i("svg",{children:i("path",{d:(a=o.data,a.map((e,t)=>e.map((e,n)=>e?"M"+n.toString()+" "+t.toString()+"h1v1h-1z":"").join("")).join("")),fill:"currentColor"}),"aria-label":U(e.title,"QR code for "+n),className:Rl,role:"img",height:r.toString(),width:r.toString(),shapeRendering:"crispEdges",viewBox:"0 0 "+s+" "+s,xmlns:"http://www.w3.org/2000/svg"}),className:Tl});var a},Il=["11011001100","11001101100","11001100110","10010011000","10010001100","10001001100","10011001000","10011000100","10001100100","11001001000","11001000100","11000100100","10110011100","10011011100","10011001110","10111001100","10011101100","10011100110","11001110010","11001011100","11001001110","11011100100","11001110100","11101101110","11101001100","11100101100","11100100110","11101100100","11100110100","11100110010","11011011000","11011000110","11000110110","10100011000","10001011000","10001000110","10110001000","10001101000","10001100010","11010001000","11000101000","11000100010","10110111000","10110001110","10001101110","10111011000","10111000110","10001110110","11101110110","11010001110","11000101110","11011101000","11011100010","11011101110","11101011000","11101000110","11100010110","11101101000","11101100010","11100011010","11101111010","11001000010","11110001010","10100110000","10100001100","10010110000","10010000110","10000101100","10000100110","10110010000","10110000100","10011010000","10011000010","10000110100","10000110010","11000010010","11001010000","11110111010","11000010100","10001111010","10100111100","10010111100","10010011110","10111100100","10011110100","10011110010","11110100100","11110010100","11110010010","11011011110","11011110110","11110110110","10101111000","10100011110","10001011110","10111101000","10111100010","11110101000","11110100010","10111011110","10111101110","11101011110","11110101110","11010000100","11010010000","11010011100","1100011101011"];function Fl(e){return e>="0"&&e<="9"}function Ol(e){let t={};return function(e){let t=[],n=0,r=e.length;for(;n<r;)if(Fl(U(e[n],""))){let i=n;for(;n<r&&Fl(U(e[n],""));)n=n+1|0;t.push([i,n-i|0])}else n=n+1|0;return t}(e).forEach(n=>{let r=n[1],i=n[0],o=r%2,s=r-o|0;s<=0||(((o+(0===i&&0===o?0:1)|0)+(s/2|0)|0)+((i+r|0)===e.length?0:1)|0)<r&&(t[(i+o|0).toString()]=s)}),t}function Pl(e){return z(function(e){let t=e.length,n=0===t||e.split("").some(e=>{let t=U(e.codePointAt(0),0);return t<32||t>126});if(n)return;let r=Ol(e),i=[],o=$(r[0]);i.push(o?105:104);let s=o?"C":"B",a=0;for(;a<t;){let t=r[a.toString()];if(void 0!==t){"C"!==s&&(i.push(99),s="C");for(let n=0,r=t/2|0;n<r;++n){let t=e.substring(a+(n<<1)|0,2+(a+(n<<1)|0)|0);i.push(U(_e(t),0))}a=a+t|0}else"C"===s&&(i.push(100),s="B"),i.push(U(e.codePointAt(a),32)-32|0),a=a+1|0}return i}(e),e=>{let t={contents:e[0]};return e.forEach((e,n)=>{n>0&&(t.contents=t.contents+(e*n|0)|0)}),e.concat([t.contents%103,106]).map(e=>Il[e]).join("")})}function Ml(e,t,n){let r=n.toString(),i=[],o=0,s=e.length;for(;o<s;)if(vt(e[o],"1")){let n=o;for(;o<s&&vt(e[o],"1");)o=o+1|0;let a=(o-n|0).toString();i.push("M"+(n+t|0).toString()+" 0h"+a+"v"+r+"h-"+a+"z")}else o=o+1|0;return i.join("")}let Ll=co([gi("inlineBlock"),Ii({NAME:"percent",VAL:100}),ui("overflow-x","auto"),ui("background","#ffffff"),ui("padding","6px"),ui("border-radius",function(e){return"var("+e+")"}(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("line-height","0")]),zl=co([ui("color","#000000"),ui("display","block")]);let jl=function(e){let t=e.moduleWidth,n=e.height,r=e.value,o=void 0!==n?n:64,s=void 0!==t?t:2,a=Pl(r);if(void 0===a)return null;let l=a.length+20|0;return i("span",{children:i("svg",{children:i("path",{d:Ml(a,10,40),fill:"currentColor"}),"aria-label":U(e.title,"Barcode for "+r),className:zl,role:"img",height:o.toString(),width:(l*s|0).toString(),preserveAspectRatio:"none",shapeRendering:"crispEdges",viewBox:"0 0 "+l.toString()+" "+40..toString(),xmlns:"http://www.w3.org/2000/svg"}),className:Ll})};function Ul(e){return"var("+e+")"}let Bl=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.82)"),gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",Ul(bt.md)),ui("padding",Ul(bt.lg)),ui("z-index","1100")]),$l=co([ui("max-width","min(92vw, 1400px)"),ui("max-height","78vh"),ui("object-fit","contain"),ui("border-radius",Ul(St.sm)),ui("box-shadow",Ul(kt))]),ql=co([gi("flex"),di("center"),ui("gap",Ul(bt.md)),ui("max-width","100%")]),Gl=co([gi("flex"),di("center"),ui("gap",Ul(bt.md)),ui("max-width","92vw"),ui("color","#f5f5f5"),ui("font-size",Ul(xt.sizeSm))]),Vl=co([ui("font-size",Ul(xt.sizeMd)),ui("font-weight",Ul(xt.weightMedium)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),Kl=co([ui("color","#c8c8c8")]),Wl=co([ui("font-family",Ul(xt.fontFamilyMono)),ui("color","#c8c8c8")]),Hl=co([gi("inlineFlex"),di("center"),xi("center"),ui("background","rgba(255,255,255,0.12)"),ui("border","1px solid rgba(255,255,255,0.25)"),ui("border-radius",Ul(St.md)),ui("color","#f5f5f5"),ui("padding","4px var("+bt.sm+")"),ui("font-size",Ul(xt.sizeSm)),pi("pointer"),Yi([ui("background","rgba(255,255,255,0.22)")])]),Jl=uo([Hl,co([ui("width","40px"),ui("height","40px"),ui("border-radius","50%"),ui("font-size",Ul(xt.sizeLg)),yi(0)])]),Xl=uo([Hl,co([Ui("absolute"),qi(to(16)),Bi(to(16)),ui("width","32px")])]);function Ql(e,t,n){return 0===t?0:fe(fe(e+n|0,t)+t|0,t)}let Yl=function(e){let t=e.onClose,n=e.onIndexChange,o=e.index,s=e.slides,l=s.length,c=l>1;a(()=>{let e=e=>{switch(e.key){case"ArrowLeft":return c?n(Ql(o,l,-1)):void 0;case"ArrowRight":return c?n(Ql(o,l,1)):void 0;case"Escape":return t();default:return}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o,l]);let u=s[Ql(o,l,0)];if(void 0===u)return null;let d=u.title,f=u.caption;return r("div",{children:[i("button",{children:"✕",className:Xl,title:"Close",type:"button",onClick:e=>t()}),r("div",{children:[c?i("button",{children:"‹",className:Jl,title:"Previous",type:"button",onClick:e=>n(Ql(o,l,-1))}):null,i("img",{className:$l,alt:U(u.title,""),src:u.src}),c?i("button",{children:"›",className:Jl,title:"Next",type:"button",onClick:e=>n(Ql(o,l,1))}):null],className:ql,onClick:e=>{e.stopPropagation()}}),r("div",{children:[void 0!==d?i("span",{children:d,className:Vl,title:d}):null,void 0!==f?i("span",{children:f,className:Kl}):null,c?i("span",{children:(Ql(o,l,0)+1|0).toString()+" / "+l.toString(),className:Wl}):null,U(e.action,null)],className:Gl,onClick:e=>{e.stopPropagation()}})],"aria-modal":!0,className:Bl,role:"dialog",onClick:e=>t()})};function Zl(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function ec(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function tc(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+t,1).getTime()}function nc(e){let t=0|new Date(e).getDay(),n=0===t?6:t-1|0;return ec(Zl(e),0|-n)}function rc(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1).getTime()}function ic(e,t){return Zl(e)===Zl(t)}function oc(e,t){let n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function sc(e,t,n){let r=Zl(n);return e<r+864e5&&t>=r}function ac(e){let t=e.toString();return t.length<2?"0"+t:t}function lc(e){let t=new Date(e);return ac(0|t.getHours())+":"+ac(0|t.getMinutes())}function cc(e){return e===Zl(e)}let uc=["January","February","March","April","May","June","July","August","September","October","November","December"];function dc(e){let t=new Date(e),n=0|t.getMonth();return U(uc[n],"")+" "+t.getFullYear().toString()}let fc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function hc(e){return 0|new Date(e).getDate()}function pc(e){let t=0|new Date(e).getDay();return U(fc[0===t?6:t-1|0],"")+" "+(0|new Date(e).getDate()).toString()}function gc(e){let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}let mc=864e5;function vc(e){return"var("+e+")"}function yc(e){return co([ui("width","100%"),ui("height",e),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",vc(St.md)),ui("background",vc(_t.surfaceSubtle)),Mi("hidden")])}let _c=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",vc(bt.sm)),ui("height","100%"),ui("padding",vc(bt.lg)),ui("color",vc(_t.textSecondary)),ui("font-size",vc(xt.sizeSm)),ui("text-align","center")]),bc=co([ui("color",vc(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]);function xc(e){return U(U(e.split("?")[0],e).split("#")[0],e).toLowerCase().endsWith(".pdf")}let Sc=function(e){let t=e.height,n=e.title,o=e.src,s=void 0!==n?n:"Document",a=void 0!==t?t:"70vh";return i("object",{children:r("div",{children:["This browser can't display the document inline.",i("a",{children:"Open "+s,className:bc,href:o,rel:"noopener noreferrer",target:"_blank"})],className:_c}),"aria-label":s,className:yc(a),data:o,type:"application/pdf"})};function wc(e){return"Small"===e?"13px":"18px"}function Ec(e,t){let n=t<=0?1:t;return(e<0?0:e>n?n:e)/n}function kc(e){return"var("+e+")"}let Cc=co([ui("color",kc(_t.borderSubtle))]);let Ac=co([gi("inlineFlex"),ui("gap","2px"),di("center")]);function Nc(e,t){return co([ui("background","none"),ui("border","none"),ui("padding","0 1px"),ui("font-size",wc(t)),ui("line-height","1"),pi("pointer"),ui("color",kc(e?_t.warning:_t.borderSubtle)),ui("transition","color 120ms, transform 120ms"),Yi([ui("transform","scale(1.15)")]),Wi("&:focus-visible",[ui("outline","2px solid var("+_t.brand+")"),ui("outline-offset","1px"),ui("border-radius","2px")])])}let Tc=co([ui("color",kc(_t.textSecondary)),ui("font-size",kc(xt.sizeSm))]),Rc=co([gi("inlineFlex"),di("center"),ui("gap","6px")]),Dc=co([ui("border","1px solid var("+_t.error+")"),ui("border-radius",kc(St.sm)),ui("padding","2px 4px")]);let Ic=function(e){let t=e.hasError,n=e.onBlur,o=e.onChange,s=e.showValue,a=e.size,l=e.max,c=e.value,u=void 0!==l?l:5,d=void 0!==a?a:"Small",f=void 0!==s&&s,h=void 0!==t&&t,p=u<=0?5:u,g=function(e){return he(e<=0?0:e,"★").join("")}(p),m=U(e.label,(Math.round(10*c)/10).toString()+" of "+p.toString());return r("span",void 0!==o?{children:[pe(p,e=>e+1|0).map(e=>{let t=e<=c;return i("button",{children:"★","aria-label":e.toString()+" of "+p.toString(),"aria-pressed":t?"true":"false",className:Nc(t,d),title:e.toString()+" of "+p.toString(),type:"button",onBlur:e=>M(n,e=>e()),onClick:t=>{t.stopPropagation(),o(e===c?0:e)}},e.toString())}),f?i("span",{children:c<=0?"—":c.toString(),className:Tc}):null],"aria-label":m,className:h?Ac+" "+Dc:Ac,role:"group"}:{children:[r("span",{children:[i("span",{children:g,className:Cc}),i("span",{children:g,className:(y=Ec(c,p),co([Ui("absolute"),ui("top","0"),ui("left","0"),ui("width",(100*y).toString()+"%"),Mi("hidden"),ui("white-space","nowrap"),ui("color",kc(_t.warning)),ui("pointer-events","none")]))})],"aria-label":m,className:(v=d,co([gi("inlineFlex"),Ui("relative"),ui("font-size",wc(v)),ui("line-height","1"),ui("letter-spacing","1px"),ui("white-space","nowrap"),ui("vertical-align","-1px")])),role:"img",title:m}),f?i("span",{children:(Math.round(10*c)/10).toString()+" / "+p.toString(),className:Tc}):null],className:Rc});var v,y};function Fc(e){return"var("+e+")"}let Oc=co([gi("flex"),mi("column"),ui("gap","4px")]),Pc=co([gi("flex"),xi("spaceBetween"),ui("font-size",Fc(xt.sizeSm))]),Mc=co([ui("color",Fc(_t.textSecondary))]),Lc=co([ui("color",Fc(_t.textPrimary)),ui("font-weight",Fc(xt.weightMedium))]),zc=co([ui("background",Fc(_t.surfaceSubtle)),ui("border-radius",Fc(St.full)),ui("height","8px"),Mi("hidden")]);function jc(e,t){return co([ui("background",void 0!==t?t:"var("+_t.brand+")"),ui("border-radius",Fc(St.full)),ui("height","100%"),ui("width",e.toString()+"%"),ui("transition","width 0.3s ease")])}let Uc=function(e){let t=e.showValue,n=e.label,o=e.value,s=void 0===t||t,a=o>100?100:o,l=a<0?0:a;return r("div",{children:[$(n)||s?r("div",{children:[L(n,null,e=>i("span",{children:e,className:Mc})),s?i("span",{children:Math.round(l).toString()+"%",className:Lc}):null],className:Pc}):null,i("div",{children:i("div",{className:jc(l,e.color)}),className:zc})],className:Oc})},Bc={};function $c(e){Bc[e.id]=e}function qc(e){return Xe(Bc,e)}let Gc={};let Vc={contents:[]};let Kc="#111111";function Wc(e){return"var("+e+")"}let Hc=co([gi("flex"),mi("column"),ui("gap",Wc(bt.xs))]);let Jc=co([ui("fill","#9ca3af"),ui("font-size","13px"),ui("pointer-events","none"),ui("user-select","none")]),Xc=co([ui("stroke","#e5e7eb"),ui("stroke-width","1")]),Qc=co([gi("flex"),di("center"),ui("gap",Wc(bt.sm)),ui("font-size",Wc(xt.sizeXs)),ui("color",Wc(_t.textSecondary))]),Yc=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Wc(St.sm)),ui("color",Wc(_t.textSecondary)),ui("font-size",Wc(xt.sizeXs)),ui("padding","2px 8px"),pi("pointer"),Yi([ui("border-color",Wc(_t.brand)),ui("color",Wc(_t.brand))])]),Zc=co([ui("background","#ffffff"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",Wc(St.md)),ui("padding","4px"),ui("display","inline-block"),ui("line-height","0")]),eu=co([ui("display","block"),ui("max-width","100%"),ui("height","auto")]);function tu(e){return(Math.round(10*e)/10).toString()}function nu(e){return e.map(e=>tu(e.x)+","+tu(e.y)).join(" ")}function ru(e){return e.trim().startsWith("<svg")}function iu(e){return"data:image/svg+xml;utf8,"+encodeURIComponent(e)}let ou=function(e){let t=e.hasError,n=e.height,o=e.width,a=e.onBlur,l=e.onChange,c=e.value,u=void 0!==o?o:480,d=void 0!==n?n:160,f=void 0!==t&&t,p=h(null),g=s(()=>[]),m=g[1],v=g[0],y=s(()=>!1),_=y[1],b=h(!1),x=e=>z(R(p.current),t=>{let n=t.getBoundingClientRect(),r=0===n.width?1:u/n.width,i=0===n.height?1:d/n.height;return{x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i}}),S=e=>l(function(e,t,n){let r=e.filter(e=>0!==e.length);if(0===r.length)return"";let i=r.map(e=>'<polyline points="'+nu(1===e.length?e.concat(e):e)+'"/>').join("");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+tu(t)+" "+tu(n)+'" width="'+tu(t)+'" height="'+tu(n)+'"><g fill="none" stroke="'+Kc+'" stroke-width="'+2..toString()+'" stroke-linecap="round" stroke-linejoin="round">'+i+"</g></svg>"}(e,u,d)),w=e=>{e.preventDefault();let t=x(e);if(void 0!==t)return b.current=!0,M(R(p.current),t=>{t.setPointerCapture(e.pointerId)}),m(e=>e.concat([[t]]))},E=e=>{if(!b.current)return;let t=x(e);return void 0!==t?m(e=>{let n=e[e.length-1|0];if(void 0===n)return e;let r=n[n.length-1|0];return void 0===r||function(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r>=2.25}(t,r)?e.slice(0,e.length-1|0).concat([n.concat([t])]):e}):void 0},k=e=>{if(b.current)return b.current=!1,S(v),M(a,e=>e())},C=()=>{m(e=>[]),_(e=>!0),l("")},A=0!==v.length;return!c.trim().startsWith("<svg")||A||y[0]?r("div",{children:[r("svg",{children:[i("line",{className:Xc,x1:tu(.06*u),x2:tu(.94*u),y1:tu(.78*d),y2:tu(.78*d)}),A?null:i("text",{children:"Sign here",className:Jc,textAnchor:"middle",x:tu(u/2),y:tu(.7*d)}),i("g",{children:v.map((e,t)=>i("polyline",{points:nu(1===e.length?e.concat(e):e)},t.toString())),fill:"none",stroke:Kc,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2..toString()})],ref:T(p),"aria-label":"Signature pad",className:(N=f,co([ui("background","#ffffff"),ui("border",N?"1px solid var("+_t.error+")":"1px dashed var("+_t.border+")"),ui("border-radius",Wc(St.md)),ui("touch-action","none"),ui("max-width","100%"),ui("width","100%"),ui("height","auto"),pi("crosshair"),ui("display","block")])),role:"img",onPointerDown:w,onPointerMove:E,onPointerUp:k,onPointerCancel:k,viewBox:"0 0 "+tu(u)+" "+tu(d),xmlns:"http://www.w3.org/2000/svg"}),r("div",{children:[A?i("button",{children:"Clear",className:Yc,type:"button",onClick:e=>C()}):null,i("span",{children:"Draw your signature above"})],className:Qc})],className:Hc}):r("div",{children:[i("span",{children:i("img",{className:eu,alt:"Signature",src:iu(c)}),className:Zc}),i("div",{children:i("button",{children:"Sign again",className:Yc,type:"button",onClick:e=>C()}),className:Qc})],className:Hc});var N};function su(e,t,n){let r={};return r[t]=n,Object.assign({},e,r)}function au(e){return"var("+e+")"}let lu=co([gi("flex"),mi("column"),ui("gap",au(bt.sm))]),cu=co([gi("flex"),ui("gap","4px")]),uu=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",au(St.sm)),ui("color",au(_t.textSecondary)),ui("font-size",au(xt.sizeXs)),ui("padding","2px 8px"),pi("pointer")]),du=co([ui("background",au(_t.brandSubtle)),ui("border-color",au(_t.brand)),ui("color",au(_t.textPrimary))]),fu=co([Vi({NAME:"percent",VAL:100}),ui("min-height","220px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",au(St.sm)),ui("background","#ffffff")]),hu=co([ui("margin","0"),ui("font-family",au(xt.fontFamilyMono)),ui("font-size",au(xt.sizeXs)),ui("line-height",au(xt.lineHeightRelaxed)),ui("color",au(_t.textPrimary)),ui("white-space","pre-wrap"),ui("word-break","break-word")]);function pu(e){let t,n=e.textAlternative,o=s(()=>!1),a=o[1],l=o[0],c=(e,t,n)=>i("button",{children:e,className:t?uu+" "+du:uu,type:"button",onClick:n}),u=0;return l&&void 0!==n?t=i("pre",{children:n,className:hu}):u=1,1===u&&(t=i("iframe",{className:fu,title:"Email preview",sandbox:"",srcDoc:e.html})),r("div",{children:[void 0!==n?r("div",{children:[c("HTML",!l,e=>a(e=>!1)),c("Plain text",l,e=>a(e=>!0))],className:cu}):null,t],className:lu})}function gu(e,t){return i(pu,{html:e.body,textAlternative:e.textAlternative})}const mu={};function vu(e,t){"string"!=typeof t&&(t=vu.defaultChars);const n=function(e){let t=mu[e];if(t)return t;t=mu[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);t.push(e)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,i=e.length;r<i;r+=3){const o=parseInt(e.slice(r+1,r+3),16);if(o<128)t+=n[o];else{if(192==(224&o)&&r+3<i){const n=parseInt(e.slice(r+4,r+6),16);if(128==(192&n)){const e=o<<6&1984|63&n;t+=e<128?"��":String.fromCharCode(e),r+=3;continue}}if(224==(240&o)&&r+6<i){const n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if(128==(192&n)&&128==(192&i)){const e=o<<12&61440|n<<6&4032|63&i;t+=e<2048||e>=55296&&e<=57343?"���":String.fromCharCode(e),r+=6;continue}}if(240==(248&o)&&r+9<i){const n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),s=parseInt(e.slice(r+10,r+12),16);if(128==(192&n)&&128==(192&i)&&128==(192&s)){let e=o<<18&1835008|n<<12&258048|i<<6&4032|63&s;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue}}t+="�"}}return t})}vu.defaultChars=";/?:@&=+$,#",vu.componentChars="";const yu={};function _u(e,t,n){"string"!=typeof t&&(n=t,t=_u.defaultChars),void 0===n&&(n=!0);const r=function(e){let t=yu[e];if(t)return t;t=yu[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);/^[0-9a-z]$/i.test(e)?t.push(e):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}(t);let i="";for(let o=0,s=e.length;o<s;o++){const t=e.charCodeAt(o);if(n&&37===t&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))i+=e.slice(o,o+3),o+=2;else if(t<128)i+=r[t];else if(t>=55296&&t<=57343){if(t>=55296&&t<=56319&&o+1<s){const t=e.charCodeAt(o+1);if(t>=56320&&t<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD"}else i+=encodeURIComponent(e[o])}return i}function bu(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function xu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}_u.defaultChars=";/?:@&=+$,-_.!~*'()#",_u.componentChars="-_.!~*'()";const Su=/^([a-z0-9.+-]+:)/i,wu=/:[0-9]*$/,Eu=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ku=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Cu=["'"].concat(ku),Au=["%","/","?",";","#"].concat(Cu),Nu=["/","?","#"],Tu=/^[+a-z0-9A-Z_-]{0,63}$/,Ru=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Du={javascript:!0,"javascript:":!0},Iu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Fu(e,t){if(e&&e instanceof xu)return e;const n=new xu;return n.parse(e,t),n}xu.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){const e=Eu.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let s=Su.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===o.substr(0,2),!i||s&&Du[s]||(o=o.substr(2),this.slashes=!0)),!Du[s]&&(i||s&&!Iu[s])){let e,t,n=-1;for(let a=0;a<Nu.length;a++)r=o.indexOf(Nu[a]),-1!==r&&(-1===n||r<n)&&(n=r);t=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n),-1!==t&&(e=o.slice(0,t),o=o.slice(t+1),this.auth=e),n=-1;for(let a=0;a<Au.length;a++)r=o.indexOf(Au[a]),-1!==r&&(-1===n||r<n)&&(n=r);-1===n&&(n=o.length),":"===o[n-1]&&n--;const i=o.slice(0,n);o=o.slice(n),this.parseHost(i),this.hostname=this.hostname||"";const s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){const e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n&&!n.match(Tu)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(Tu)){const r=e.slice(0,t),i=e.slice(t+1),s=n.match(Ru);s&&(r.push(s[1]),i.unshift(s[2])),i.length&&(o=i.join(".")+o),this.hostname=r.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");-1!==a&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Iu[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},xu.prototype.parseHost=function(e){let t=wu.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Ou=Object.freeze(Object.defineProperty({__proto__:null,decode:vu,encode:_u,format:bu,parse:Fu},Symbol.toStringTag,{value:"Module"})),Pu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mu=/[\0-\x1F\x7F-\x9F]/,Lu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,zu=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ju=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Uu=Object.freeze(Object.defineProperty({__proto__:null,Any:Pu,Cc:Mu,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:Lu,S:zu,Z:ju},Symbol.toStringTag,{value:"Module"})),Bu=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))),$u=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var qu;const Gu=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]]),Vu=null!==(qu=String.fromCodePoint)&&void 0!==qu?qu:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var Ku;!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"}(Ku||(Ku={}));var Wu,Hu,Ju;function Xu(e){return e>=Ku.ZERO&&e<=Ku.NINE}function Qu(e){return e>=Ku.UPPER_A&&e<=Ku.UPPER_F||e>=Ku.LOWER_A&&e<=Ku.LOWER_F}function Yu(e){return e===Ku.EQUALS||function(e){return e>=Ku.UPPER_A&&e<=Ku.UPPER_Z||e>=Ku.LOWER_A&&e<=Ku.LOWER_Z||Xu(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(Wu||(Wu={})),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"}(Hu||(Hu={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(Ju||(Ju={}));class Zu{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Hu.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ju.Strict}startEntity(e){this.decodeMode=e,this.state=Hu.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Hu.EntityStart:return e.charCodeAt(t)===Ku.NUM?(this.state=Hu.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Hu.NamedEntity,this.stateNamedEntity(e,t));case Hu.NumericStart:return this.stateNumericStart(e,t);case Hu.NumericDecimal:return this.stateNumericDecimal(e,t);case Hu.NumericHex:return this.stateNumericHex(e,t);case Hu.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===Ku.LOWER_X?(this.state=Hu.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Hu.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Xu(r)&&!Qu(r))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3);t+=1}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Xu(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ku.SEMI)this.consumed+=1;else if(this.decodeMode===Ju.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=Gu.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==Ku.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&Wu.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=td(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===Ju.Attribute&&(0===i||Yu(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Wu.VALUE_LENGTH)>>14,0!==i){if(o===Ku.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ju.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&Wu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~Wu.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Hu.NamedEntity:return 0===this.result||this.decodeMode===Ju.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Hu.NumericDecimal:return this.emitNumericEntity(0,2);case Hu.NumericHex:return this.emitNumericEntity(0,3);case Hu.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Hu.EntityStart:return 0}}}function ed(e){let t="";const n=new Zu(e,e=>t+=Vu(e));return function(e,r){let i=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);const s=n.write(e,o+1);if(s<0){i=o+n.end();break}i=o+s,o=0===s?i+1:i}const s=t+e.slice(i);return t="",s}}function td(e,t,n,r){const i=(t&Wu.BRANCH_LENGTH)>>7,o=t&Wu.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){const t=r-o;return t<0||t>=i?-1:e[n+t]-1}let s=n,a=s+i-1;for(;s<=a;){const t=s+a>>>1,n=e[t];if(n<r)s=t+1;else{if(!(n>r))return e[t+i];a=t-1}}return-1}const nd=ed(Bu);function rd(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}ed($u);const id=Object.prototype.hasOwnProperty;function od(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function sd(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function ad(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function ld(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const cd=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,ud=new RegExp(cd.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),dd=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function fd(e,t){if(35===t.charCodeAt(0)&&dd.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return ad(n)?ld(n):e}const n=function(e,t=Ju.Legacy){return nd(e,t)}(e);return n!==e?n:e}function hd(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(ud,function(e,t,n){return t||fd(e,n)})}const pd=/[&<>"]/,gd=/[&<>"]/g,md={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function vd(e){return md[e]}function yd(e){return pd.test(e)?e.replace(gd,vd):e}const _d=/[.?*+^$[\]\\(){}|-]/g;function bd(e){switch(e){case 9:case 32:return!0}return!1}function xd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Sd(e){return Lu.test(e)||zu.test(e)}function wd(e){return Sd(ld(e))}function Ed(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function kd(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Cd(e){return 32===e||9===e||10===e||13===e}function Ad(e){let t=0;for(;t<e.length&&Cd(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Cd(e.charCodeAt(n));n--);return e.slice(t,n+1)}const Nd={mdurl:Ou,ucmicro:Uu},Td=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:sd,asciiTrim:Ad,assign:od,escapeHtml:yd,escapeRE:function(e){return e.replace(_d,"\\$&")},fromCodePoint:ld,has:function(e,t){return id.call(e,t)},isMdAsciiPunct:Ed,isPunctChar:Sd,isPunctCharCode:wd,isSpace:bd,isString:rd,isValidEntityCode:ad,isWhiteSpace:xd,lib:Nd,normalizeReference:kd,unescapeAll:hd,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(cd,"$1")}},Symbol.toStringTag,{value:"Module"}));const Rd=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:function(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n;){if(r=e.charCodeAt(i),10===r)return o;if(60===r)return o;if(62===r)return o.pos=i+1,o.str=hd(e.slice(t+1,i)),o.ok=!0,o;92===r&&i+1<n?i+=2:i++}return o}let s=0;for(;i<n&&(r=e.charCodeAt(i),32!==r)&&!(r<32||127===r);)if(92===r&&i+1<n){if(32===e.charCodeAt(i+1))break;i+=2}else{if(40===r&&(s++,s>32))return o;if(41===r){if(0===s)break;s--}i++}return t===i||0!==s||(o.str=hd(e.slice(t,i)),o.pos=i,o.ok=!0),o},parseLinkLabel:function(e,t,n){let r,i,o,s;const a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),93===o&&(r--,0===r)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),91===o)if(s===e.pos-1)r++;else if(n)return e.pos=l,-1}let c=-1;return i&&(c=e.pos),e.pos=l,c},parseLinkTitle:function(e,t,n,r){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let r=e.charCodeAt(o);if(34!==r&&39!==r&&40!==r)return s;t++,o++,40===r&&(r=41),s.marker=r}for(;o<n;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=hd(e.slice(t,o)),s.ok=!0,s;if(40===i&&41===s.marker)return s;92===i&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=hd(e.slice(t,o)),s}},Symbol.toStringTag,{value:"Module"})),Dd={};function Id(){this.rules=od({},Dd)}function Fd(){this.__rules__=[],this.__cache__=null}function Od(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function Pd(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Dd.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+yd(o.content)+"</code>"},Dd.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+yd(e[t].content)+"</code></pre>\n"},Dd.fence=function(e,t,n,r,i){const o=e[t],s=o.info?hd(o.info).trim():"";let a,l="",c="";if(s){const e=s.split(/(\s+)/g);l=e[0],c=e.slice(2).join("")}if(a=n.highlight&&n.highlight(o.content,l,c)||yd(o.content),0===a.indexOf("<pre"))return a+"\n";if(s){const e=o.attrIndex("class"),t=o.attrs?o.attrs.slice():[];e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l);const r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${a}</code></pre>\n`}return`<pre><code${i.renderAttrs(o)}>${a}</code></pre>\n`},Dd.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},Dd.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},Dd.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},Dd.text=function(e,t){return yd(e[t].content)},Dd.html_block=function(e,t){return e[t].content},Dd.html_inline=function(e,t){return e[t].content},Id.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+yd(e.attrs[t][0])+'="'+yd(e.attrs[t][1])+'"';return r},Id.prototype.renderToken=function(e,t,n){const r=e[t];let i="";if(r.hidden)return"";r.block&&-1!==r.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===r.nesting?"</":"<")+r.tag,i+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(i+=" /");let o=!1;if(r.block&&(o=!0,1===r.nesting&&t+1<e.length)){const n=e[t+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===r.tag)&&(o=!1)}return i+=o?">\n":">",i},Id.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const s=e[o].type;void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r},Id.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":case"html_inline":case"html_block":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"softbreak":case"hardbreak":r+="\n"}return r},Id.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const s=e[o].type;"inline"===s?r+=this.renderInline(e[o].children,t,n):void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r},Fd.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Fd.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Fd.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Fd.prototype.before=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Fd.prototype.after=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Fd.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Fd.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Fd.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Fd.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Fd.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},Od.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},Od.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Od.prototype.attrSet=function(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Od.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},Od.prototype.attrJoin=function(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},Pd.prototype.Token=Od;const Md=/\r\n?|\n/g,Ld=/\0/g;function zd(e){return/^<a[>\s]/i.test(e)}function jd(e){return/^<\/a\s*>/i.test(e)}const Ud=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Bd=/\((c|tm|r)\)/i,$d=/\((c|tm|r)\)/gi,qd={c:"©",r:"®",tm:"™"};function Gd(e,t){return qd[t.toLowerCase()]}function Vd(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||(r.content=r.content.replace($d,Gd)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}function Kd(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||Ud.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}const Wd=/['"]/,Hd=/['"]/g;function Jd(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Xd(e,t){let n;const r=[],i={};for(let o=0;o<e.length;o++){const s=e[o],a=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,"text"!==s.type)continue;const l=s.content;let c=0;const u=l.length;e:for(;c<u;){Hd.lastIndex=c;const s=Hd.exec(l);if(!s)break;let d=!0,f=!0;c=s.index+1;const h="'"===s[0];let p=32;if(s.index-1>=0)p=l.charCodeAt(s.index-1);else for(n=o-1;n>=0&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n--)if(e[n].content){p=e[n].content.charCodeAt(e[n].content.length-1);break}let g=32;if(c<u)g=l.charCodeAt(c);else for(n=o+1;n<e.length&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n++)if(e[n].content){g=e[n].content.charCodeAt(0);break}const m=Ed(p)||wd(p),v=Ed(g)||wd(g),y=xd(p),_=xd(g);if(_?d=!1:v&&(y||m||(d=!1)),y?f=!1:m&&(_||v||(f=!1)),34===g&&'"'===s[0]&&p>=48&&p<=57&&(f=d=!1),d&&f&&(d=m,f=v),d||f){if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<a)break;if(e.single===h&&r[n].level===a){let a,l;e=r[n],h?(a=t.md.options.quotes[2],l=t.md.options.quotes[3]):(a=t.md.options.quotes[0],l=t.md.options.quotes[1]),Jd(i,o,s.index,l),Jd(i,e.token,e.pos,a),r.length=n;continue e}}d?r.push({token:o,pos:s.index,single:h,level:a}):f&&h&&Jd(i,o,s.index,"’")}else h&&Jd(i,o,s.index,"’")}}Object.keys(i).forEach(function(t){e[t].content=function(e,t){let n="",r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){const o=t[i];n+=e.slice(r,o.pos)+o.ch,r=o.pos+1}return n+e.slice(r)}(e[t].content,i[t])})}const Qd=[["normalize",function(e){let t;t=e.src.replace(Md,"\n"),t=t.replace(Ld,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const r=t[n];"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}],["linkify",function(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if("inline"!==t[n].type||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let o=r.length-1;o>=0;o--){const s=r[o];if("link_close"!==s.type){if("html_inline"===s.type&&(zd(s.content)&&i>0&&i--,jd(s.content)&&i++),!(i>0)&&"text"===s.type&&e.md.linkify.test(s.content)){const i=s.content;let a=e.md.linkify.match(i);const l=[];let c=s.level,u=0;a.length>0&&0===a[0].index&&o>0&&"text_special"===r[o-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){const n=a[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let o=a[t].text;o=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(o)?e.md.normalizeLinkText(o):e.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const s=a[t].index;if(s>u){const t=new e.Token("text","",0);t.content=i.slice(u,s),t.level=c,l.push(t)}const d=new e.Token("link_open","a",1);d.attrs=[["href",r]],d.level=c++,d.markup="linkify",d.info="auto",l.push(d);const f=new e.Token("text","",0);f.content=o,f.level=c,l.push(f);const h=new e.Token("link_close","a",-1);h.level=--c,h.markup="linkify",h.info="auto",l.push(h),u=a[t].lastIndex}if(u<i.length){const t=new e.Token("text","",0);t.content=i.slice(u),t.level=c,l.push(t)}t[n].children=r=sd(r,o,l)}}else for(o--;r[o].level!==s.level&&"link_open"!==r[o].type;)o--}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Bd.test(e.tokens[t].content)&&Vd(e.tokens[t].children),Ud.test(e.tokens[t].content)&&Kd(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&Wd.test(e.tokens[t].content)&&Xd(e.tokens[t].children,e)}],["text_join",function(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o<i;o++){if("inline"!==r[o].type)continue;const e=r[o].children,i=e.length;for(t=0;t<i;t++)"text_special"===e[t].type&&(e[t].type="text");for(t=n=0;t<i;t++)"text"===e[t].type&&t+1<i&&"text"===e[t+1].type?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}}]];function Yd(){this.ruler=new Fd;for(let e=0;e<Qd.length;e++)this.ruler.push(Qd[e][0],Qd[e][1])}function Zd(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,a=0,l=0,c=i.length,u=!1;s<c;s++){const e=i.charCodeAt(s);if(!u){if(bd(e)){a++,9===e?l+=4-l%4:l++;continue}u=!0}10!==e&&s!==c-1||(10!==e&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),u=!1,a=0,l=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Yd.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},Yd.prototype.State=Pd,Zd.prototype.push=function(e,t,n){const r=new Od(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Zd.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Zd.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Zd.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!bd(this.src.charCodeAt(e)))break}return e},Zd.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!bd(this.src.charCodeAt(--e)))return e+1;return e},Zd.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Zd.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},Zd.prototype.getLines=function(e,t,n,r){if(e>=t)return"";const i=new Array(t-e);for(let o=0,s=e;s<t;s++,o++){let e=0;const a=this.bMarks[s];let l,c=a;for(l=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];c<l&&e<n;){const t=this.src.charCodeAt(c);if(bd(t))9===t?e+=4-(e+this.bsCount[s])%4:e++;else{if(!(c-a<this.tShift[s]))break;e++}c++}i[o]=e>n?new Array(e-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return i.join("")},Zd.prototype.Token=Od;function ef(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function tf(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)124===i&&(o?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),o=92===i,r++,i=e.charCodeAt(r);return t.push(a+e.substring(s)),t}function nf(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(42!==i&&45!==i&&43!==i)return-1;if(r<n){if(!bd(e.src.charCodeAt(r)))return-1}return r}function rf(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),!(o>=48&&o<=57)){if(41===o||46===o)break;return-1}if(i-n>=10)return-1}return i<r&&(o=e.src.charCodeAt(i),!bd(o))?-1:i}const of="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",sf="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",af=new RegExp("^(?:"+of+"|"+sf+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),lf=new RegExp("^(?:"+of+"|"+sf+")"),cf=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(lf.source+"\\s*$"),/^$/,!1]];const uf=[["table",function(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent)return!1;if(e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(124!==s&&45!==s&&58!==s)return!1;if(o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a&&!bd(a))return!1;if(45===s&&bd(a))return!1;for(;o<e.eMarks[i];){const t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!bd(t))return!1;o++}let l=ef(e,t+1),c=l.split("|");const u=[];for(let v=0;v<c.length;v++){const e=c[v].trim();if(!e){if(0===v||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(e))return!1;58===e.charCodeAt(e.length-1)?u.push(58===e.charCodeAt(0)?"center":"right"):58===e.charCodeAt(0)?u.push("left"):u.push("")}if(l=ef(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=tf(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const d=c.length;if(0===d||d!==u.length)return!1;if(r)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=[t,0];e.push("table_open","table",1).map=p,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let v=0;v<c.length;v++){const t=e.push("th_open","th",1);u[v]&&(t.attrs=[["style","text-align:"+u[v]]]);const n=e.push("inline","",0);n.content=c[v].trim(),n.children=[],e.push("th_close","th",-1)}let g;e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,o=h.length;t<o;t++)if(h[t](e,i,n,!0)){r=!0;break}if(r)break;if(l=ef(e,i).trim(),!l)break;if(e.sCount[i]-e.blkIndent>=4)break;if(c=tf(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),m+=d-c.length,m>65536)break;if(i===t+2){e.push("tbody_open","tbody",1).map=g=[t+2,0]}e.push("tr_open","tr",1).map=[i,i+1];for(let t=0;t<d;t++){const n=e.push("td_open","td",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);const r=e.push("inline","",0);r.content=c[t]?c[t].trim():"",r.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=i),e.push("table_close","table",-1),p[1]=i,e.parentType=f,e.line=i,!0},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;r++,i=r}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}],["fence",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(i+3>o)return!1;const s=e.src.charCodeAt(i);if(126!==s&&96!==s)return!1;let a=i;i=e.skipChars(i,s);let l=i-a;if(l<3)return!1;const c=e.src.slice(a,i),u=e.src.slice(i,o);if(96===s&&u.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;(d++,!(d>=n))&&(i=a=e.bMarks[d]+e.tShift[d],o=e.eMarks[d],!(i<o&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[d]-e.blkIndent>=4||(i=e.skipChars(i,s),i-a<l||(i=e.skipSpaces(i),i<o)))){f=!0;break}l=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,l,!0),h.markup=c,h.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(i))return!1;if(r)return!0;const a=[],l=[],c=[],u=[],d=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h,p=!1;for(h=t;h<n;h++){const t=e.sCount[h]<e.blkIndent;if(i=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],i>=o)break;if(62===e.src.charCodeAt(i++)&&!t){let t,n,r=e.sCount[h]+1;32===e.src.charCodeAt(i)?(i++,r++,n=!1,t=!0):9===e.src.charCodeAt(i)?(t=!0,(e.bsCount[h]+r)%4==3?(i++,r++,n=!1):n=!0):t=!1;let s=r;for(a.push(e.bMarks[h]),e.bMarks[h]=i;i<o;){const t=e.src.charCodeAt(i);if(!bd(t))break;9===t?s+=4-(s+e.bsCount[h]+(n?1:0))%4:s++,i++}p=i>=o,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(t?1:0),c.push(e.sCount[h]),e.sCount[h]=s-r,u.push(e.tShift[h]),e.tShift[h]=i-e.bMarks[h];continue}if(p)break;let r=!1;for(let i=0,o=d.length;i<o;i++)if(d[i](e,h,n,!0)){r=!0;break}if(r){e.lineMax=h,0!==e.blkIndent&&(a.push(e.bMarks[h]),l.push(e.bsCount[h]),u.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}a.push(e.bMarks[h]),l.push(e.bsCount[h]),u.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]=-1}const g=e.blkIndent;e.blkIndent=0;const m=e.push("blockquote_open","blockquote",1);m.markup=">";const v=[t,0];m.map=v,e.md.block.tokenize(e,t,h),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=s,e.parentType=f,v[1]=e.line;for(let y=0;y<u.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=u[y],e.sCount[y+t]=c[y],e.bsCount[y+t]=l[y];return e.blkIndent=g,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(42!==s&&45!==s&&95!==s)return!1;let a=1;for(;o<i;){const t=e.src.charCodeAt(o++);if(t!==s&&!bd(t))return!1;t===s&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let i,o,s,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u,d,f,h=!1;if(r&&"paragraph"===e.parentType&&e.sCount[l]>=e.blkIndent&&(h=!0),(f=rf(e,l))>=0){if(u=!0,s=e.bMarks[l]+e.tShift[l],d=Number(e.src.slice(s,f-1)),h&&1!==d)return!1}else{if(!((f=nf(e,l))>=0))return!1;u=!1}if(h&&e.skipSpaces(f)>=e.eMarks[l])return!1;if(r)return!0;const p=e.src.charCodeAt(f-1),g=e.tokens.length;u?(a=e.push("ordered_list_open","ol",1),1!==d&&(a.attrs=[["start",d]])):a=e.push("bullet_list_open","ul",1);const m=[l,0];a.map=m,a.markup=String.fromCharCode(p);let v=!1;const y=e.md.block.ruler.getRules("list"),_=e.parentType;for(e.parentType="list";l<n;){o=f,i=e.eMarks[l];const t=e.sCount[l]+f-(e.bMarks[l]+e.tShift[l]);let r=t;for(;o<i;){const t=e.src.charCodeAt(o);if(9===t)r+=4-(r+e.bsCount[l])%4;else{if(32!==t)break;r++}o++}const d=o;let h;h=d>=i?1:r-t,h>4&&(h=1);const g=t+h;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const m=[l,0];a.map=m,u&&(a.info=e.src.slice(s,f-1));const _=e.tight,b=e.tShift[l],x=e.sCount[l],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=g,e.tight=!0,e.tShift[l]=d-e.bMarks[l],e.sCount[l]=r,d>=i&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),e.tight&&!v||(c=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[l]=b,e.sCount[l]=x,e.tight=_,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=e.line,m[1]=l,l>=n)break;if(e.sCount[l]<e.blkIndent)break;if(e.sCount[l]-e.blkIndent>=4)break;let w=!1;for(let i=0,o=y.length;i<o;i++)if(y[i](e,l,n,!0)){w=!0;break}if(w)break;if(u){if(f=rf(e,l),f<0)break;s=e.bMarks[l]+e.tShift[l]}else if(f=nf(e,l),f<0)break;if(p!==e.src.charCodeAt(f-1))break}return a=u?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),m[1]=l,e.line=l,e.parentType=_,c&&function(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}(e,g),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(i))return!1;function a(t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){const r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let o=!1;for(let s=0,a=r.length;s<a;s++)if(r[s](e,t,n,!0)){o=!0;break}if(e.parentType=i,o)return null}const i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(i,o+1)}let l=e.src.slice(i,o+1);o=l.length;let c=-1;for(i=1;i<o;i++){const e=l.charCodeAt(i);if(91===e)return!1;if(93===e){c=i;break}if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(92===e&&(i++,i<o&&10===l.charCodeAt(i))){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(i=c+2;i<o;i++){const e=l.charCodeAt(i);if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(!bd(e))break}const u=e.md.helpers.parseLinkDestination(l,i,o);if(!u.ok)return!1;const d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;const f=i,h=s,p=i;for(;i<o;i++){const e=l.charCodeAt(i);if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(!bd(e))break}let g,m=e.md.helpers.parseLinkTitle(l,i,o);for(;m.can_continue;){const t=a(s);if(null===t)break;l+=t,i=o,o=l.length,s++,m=e.md.helpers.parseLinkTitle(l,i,o,m)}for(i<o&&p!==i&&m.ok?(g=m.str,i=m.pos):(g="",i=f,s=h);i<o;){if(!bd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i)&&g)for(g="",i=f,s=h;i<o;){if(!bd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i))return!1;const v=kd(l.slice(1,c));return!!v&&(r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[v]&&(e.env.references[v]={title:g,href:d}),e.line=s),!0)}],["html_block",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(i))return!1;let s=e.src.slice(i,o),a=0;for(;a<cf.length&&!cf[a][0].test(s);a++);if(a===cf.length)return!1;if(r)return cf[a][2];let l=t+1;const c=cf[a][1].test("");if(!cf[a][1].test(s))for(;l<n&&(!(e.sCount[l]<e.blkIndent)||!c&&e.isEmpty(l));l++)if(i=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],s=e.src.slice(i,o),cf[a][1].test(s)){0!==s.length&&l++;break}e.line=l;const u=e.push("html_block","",0);return u.map=[t,l],u.content=e.getLines(t,l,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(35!==s||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);35===s&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!bd(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const l=e.skipCharsBack(o,35,i);l>i&&bd(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=Ad(e.src.slice(i,o)),u.map=[t,e.line],u.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o,s=0,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const n=e.eMarks[a];if(t<n&&(o=e.src.charCodeAt(t),(45===o||61===o)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){s=61===o?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}if(!s)return e.parentType=i,!1;const l=Ad(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const c=e.push("heading_open","h"+String(s),1);c.markup=String.fromCharCode(o),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=l,u.map=[t,e.line-1],u.children=[],e.push("heading_close","h"+String(s),-1).markup=String.fromCharCode(o),e.parentType=i,!0}],["paragraph",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]<0)continue;let t=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,o,n,!0)){t=!0;break}if(t)break}const s=Ad(e.getLines(t,o,e.blkIndent,!1));e.line=o,e.push("paragraph_open","p",1).map=[t,e.line];const a=e.push("inline","",0);return a.content=s,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}]];function df(){this.ruler=new Fd;for(let e=0;e<uf.length;e++)this.ruler.push(uf[e][0],uf[e][1],{alt:(uf[e][2]||[]).slice()})}function ff(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}function hf(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}df.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting;let s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n))&&!(e.sCount[s]<e.blkIndent);){if(e.level>=o){e.line=n;break}const t=e.line;let l=!1;for(let o=0;o<i;o++)if(l=r[o](e,s,n,!1),l){if(t>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}},df.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},df.prototype.State=Zd,ff.prototype.pushPending=function(){const e=new Od("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},ff.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Od(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},ff.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let i;if(0===e)i=32;else if(1===e)i=this.src.charCodeAt(0),55296==(63488&i)&&(i=65533);else if(i=this.src.charCodeAt(e-1),56320==(64512&i)){const t=this.src.charCodeAt(e-2);i=55296==(64512&t)?65536+(t-55296<<10)+(i-56320):65533}else 55296==(64512&i)&&(i=65533);let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-e;let a=o<n?this.src.charCodeAt(o):32;if(55296==(64512&a)){const e=this.src.charCodeAt(o+1);a=56320==(64512&e)?65536+(a-55296<<10)+(e-56320):65533}else 56320==(64512&a)&&(a=65533);const l=Ed(i)||wd(i),c=Ed(a)||wd(a),u=xd(i),d=xd(a),f=!d&&(!c||u||l),h=!u&&(!l||d||c);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||c),length:s}},ff.prototype.Token=Od;const pf=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const gf=[];for(let Gxe=0;Gxe<256;Gxe++)gf.push(0);function mf(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const i=t[o];if(126!==i.marker)continue;if(-1===i.end)continue;const s=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&r.push(s.token-1)}for(;r.length;){const t=r.pop();let i=t+1;for(;i<e.tokens.length&&"s_close"===e.tokens[i].type;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){gf[e.charCodeAt(0)]=1});const vf={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(126!==r)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=s,o--);for(let l=0;l<o;l+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;mf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&mf(e,t[r].delimiters)}};function yf(e,t){for(let n=t.length-1;n>=0;n--){const r=t[n];if(95!==r.marker&&42!==r.marker)continue;if(-1===r.end)continue;const i=t[r.end],o=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1,s=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?s+s:s,a.content="";const l=e.tokens[i.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?s+s:s,l.content="",o&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}const _f={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(95!==r&&42!==r)return!1;const i=e.scanDelims(e.pos,42===r);for(let o=0;o<i.length;o++){e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;yf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&yf(e,t[r].delimiters)}};const bf=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,xf=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const Sf=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,wf=/^&([a-z][a-z0-9]{1,31});/i;function Ef(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const n=e[s];if(o.push(0),e[r].marker===n.marker&&i===n.token-1||(r=s),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[n.marker][(n.open?3:0)+n.length%3];let l=r-o[r]-1,c=l;for(;l>a;l-=o[l]+1){const t=e[l];if(t.marker===n.marker&&(t.open&&t.end<0)){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3==0&&n.length%3==0||(r=!0)),!r){const r=l>0&&!e[l-1].open?o[l-1]+1:0;o[s]=s-l+r,o[l]=r,n.open=!1,t.end=s,t.close=!1,c=-1,i=-2;break}}}-1!==c&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const kf=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!hf(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["linkify",function(e,t){if(!e.md.options.linkify)return!1;if(e.linkLevel>0)return!1;const n=e.pos;if(n+3>e.posMax)return!1;if(58!==e.src.charCodeAt(n))return!1;if(47!==e.src.charCodeAt(n+1))return!1;if(47!==e.src.charCodeAt(n+2))return!1;const r=e.pending.match(pf);if(!r)return!1;const i=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-i.length));if(!o)return!1;let s=o.url;if(s.length<=i.length)return!1;let a=s.length;for(;a>0&&42===s.charCodeAt(a-1);)a--;a!==s.length&&(s=s.slice(0,a));const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const t=e.push("link_open","a",1);t.attrs=[["href",l]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return e.pos+=s.length-i.length,!0}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&32===e.pending.charCodeAt(r))if(r>=1&&32===e.pending.charCodeAt(r-1)){let t=r-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&bd(e.src.charCodeAt(n));)n++;return e.pos=n,!0}],["escape",function(e,t){let n=e.pos;const r=e.posMax;if(92!==e.src.charCodeAt(n))return!1;if(n++,n>=r)return!1;let i=e.src.charCodeAt(n);if(10===i){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),bd(i));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const t=e.push("text_special","",0);i<256&&0!==gf[i]?t.content=o:t.content=s,t.markup=s,t.info="escape"}return e.pos=n+1,!0}],["backticks",function(e,t){let n=e.pos;if(96!==e.src.charCodeAt(n))return!1;const r=n;n++;const i=e.posMax;for(;n<i&&96===e.src.charCodeAt(n);)n++;const o=e.src.slice(r,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=r)return t||(e.pending+=o),e.pos+=s,!0;let a,l=n;for(;-1!==(a=e.src.indexOf("`",l));){for(l=a+1;l<i&&96===e.src.charCodeAt(l);)l++;const r=l-a;if(r===s){if(!t){const t=e.push("code_inline","code",0);t.markup=o,t.content=e.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[r]=a}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}],["strikethrough",vf.tokenize],["emphasis",_f.tokenize],["link",function(e,t){let n,r,i,o,s="",a="",l=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&40===e.src.charCodeAt(p)){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),bd(n)||10===n);p++);if(p>=d)return!1;if(l=p,i=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?p=i.pos:s="",l=p;p<d&&(n=e.src.charCodeAt(p),bd(n)||10===n);p++);if(i=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<d&&l!==p&&i.ok)for(a=i.str,p=i.pos;p<d&&(n=e.src.charCodeAt(p),bd(n)||10===n);p++);}(p>=d||41!==e.src.charCodeAt(p))&&(c=!0),p++}if(c){if(void 0===e.env.references)return!1;if(p<d&&91===e.src.charCodeAt(p)?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(l,p++):p=h+1):p=h+1,r||(r=e.src.slice(f,h)),o=e.env.references[kd(r)],!o)return e.pos=u,!1;s=o.href,a=o.title}if(!t){e.pos=f,e.posMax=h;const t=[["href",s]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}],["image",function(e,t){let n,r,i,o,s,a,l,c,u="";const d=e.pos,f=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&40===e.src.charCodeAt(o)){for(o++;o<f&&(n=e.src.charCodeAt(o),bd(n)||10===n);o++);if(o>=f)return!1;for(c=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?o=a.pos:u=""),c=o;o<f&&(n=e.src.charCodeAt(o),bd(n)||10===n);o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<f&&(n=e.src.charCodeAt(o),bd(n)||10===n);o++);else l="";if(o>=f||41!==e.src.charCodeAt(o))return e.pos=d,!1;o++}else{if(void 0===e.env.references)return!1;if(o<f&&91===e.src.charCodeAt(o)?(c=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(c,o++):o=p+1):o=p+1,i||(i=e.src.slice(h,p)),s=e.env.references[kd(i)],!s)return e.pos=d,!1;u=s.href,l=s.title}if(!t){r=e.src.slice(h,p);const t=[];e.md.inline.parse(r,e.md,e.env,t);const n=e.push("image","img",0),i=[["src",u],["alt",""]];n.attrs=i,n.children=t,n.content=r,l&&i.push(["title",l])}return e.pos=o,e.posMax=f,!0}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break}const o=e.src.slice(r+1,n);if(xf.test(o)){const n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}if(bf.test(o)){const n=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(60!==e.src.charCodeAt(r)||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(33!==i&&63!==i&&47!==i&&!function(e){const t=32|e;return t>=97&&t<=122}(i))return!1;const o=e.src.slice(r).match(af);if(!o)return!1;if(!t){const t=e.push("html_inline","",0);t.content=o[0],function(e){return/^<a[>\s]/i.test(e)}(t.content)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}],["entity",function(e,t){const n=e.pos,r=e.posMax;if(38!==e.src.charCodeAt(n))return!1;if(n+1>=r)return!1;if(35===e.src.charCodeAt(n+1)){const r=e.src.slice(n).match(Sf);if(r){if(!t){const t="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push("text_special","",0);n.content=ad(t)?ld(t):ld(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(wf);if(r){const n=function(e){return nd(e,Ju.Strict)}(r[0]);if(n!==r[0]){if(!t){const t=e.push("text_special","",0);t.content=n,t.markup=r[0],t.info="entity"}return e.pos+=r[0].length,!0}}}return!1}]],Cf=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ef(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Ef(t[r].delimiters)}],["strikethrough",vf.postProcess],["emphasis",_f.postProcess],["fragments_join",function(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<o&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}]];function Af(){this.ruler=new Fd;for(let e=0;e<kf.length;e++)this.ruler.push(kf[e][0],kf[e][1]);this.ruler2=new Fd;for(let e=0;e<Cf.length;e++)this.ruler2.push(Cf[e][0],Cf[e][1])}function Nf(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Tf(e){return Object.prototype.toString.call(e)}function Rf(e){return"[object Function]"===Tf(e)}function Df(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}Af.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(void 0!==o[t])return void(e.pos=o[t]);let s=!1;if(e.level<i){for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos},Af.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let s=!1;if(e.level<i)for(let r=0;r<n;r++)if(s=t[r](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(s){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Af.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)},Af.prototype.State=ff;const If={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const Ff={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Of="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Pf(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=Pu.source,t.src_Cc=Mu.source,t.src_Z=ju.source,t.src_P=Lu.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){const n=e.__schemas__[t];if(null===n)return;const r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===Tf(n))return!function(e){return"[object RegExp]"===Tf(e)}(n.validate)?Rf(n.validate)?r.validate=n.validate:o(t,n):r.validate=function(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(Rf(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Tf(e)}(n)?o(t,n):i.push(t)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const s=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Df).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function Mf(e,t,n,r){const i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Lf(e,t){if(!(this instanceof Lf))return new Lf(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||If.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=Nf({},If,t),this.__schemas__=Nf({},Ff,e),this.__compiled__={},this.__tlds__=Of,this.__tlds_replaced__=!1,this.re={},Pf(this)}Lf.prototype.add=function(e,t){return this.__schemas__[e]=t,Pf(this),this},Lf.prototype.set=function(e){return this.__opts__=Nf(this.__opts__,e),this},Lf.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e))for(n=this.re.schema_search,n.lastIndex=0;null!==(t=n.exec(e));)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&null!==e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))||!!(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==e.match(this.re.email_fuzzy))},Lf.prototype.pretest=function(e){return this.re.pretest.test(e)},Lf.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Lf.prototype.match=function(e){const t=[],n=[],r=[],i=[];let o,s,a;function l(e,t){return e?t?e.index!==t.index?e.index<t.index?e:t:e.lastIndex>=t.lastIndex?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(o=a.exec(e));)s=this.testSchemaAt(e,o[2],a.lastIndex),s&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(e));)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(e));)i.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const c=[0,0,0];let u=0;for(;;){const o=[n[c[0]],i[c[1]],r[c[2]]],s=l(l(o[0],o[1]),o[2]);if(!s)break;if(s===o[0]?c[0]++:s===o[1]?c[1]++:c[2]++,s.index<u)continue;const a=new Mf(e,s.schema,s.index,s.lastIndex);this.__compiled__[a.schema].normalize(a,this),t.push(a),u=s.lastIndex}return t.length?t:null},Lf.prototype.matchAtStart=function(e){if(!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new Mf(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Lf.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Pf(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Pf(this),this)},Lf.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Lf.prototype.onCompile=function(){};const zf=2147483647,jf=36,Uf=/^xn--/,Bf=/[^\0-\x7F]/,$f=/[\x2E\u3002\uFF0E\uFF61]/g,qf={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Gf=Math.floor,Vf=String.fromCharCode;function Kf(e){throw new RangeError(qf[e])}function Wf(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const i=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace($f,".")).split("."),t).join(".");return r+i}function Hf(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t}const Jf=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:jf},Xf=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},Qf=function(e,t,n){let r=0;for(e=n?Gf(e/700):e>>1,e+=Gf(e/t);e>455;r+=jf)e=Gf(e/35);return Gf(r+36*e/(e+38))},Yf=function(e){const t=[],n=e.length;let r=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Kf("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const s=r;for(let t=1,i=jf;;i+=jf){a>=n&&Kf("invalid-input");const s=Jf(e.charCodeAt(a++));s>=jf&&Kf("invalid-input"),s>Gf((zf-r)/t)&&Kf("overflow"),r+=s*t;const l=i<=o?1:i>=o+26?26:i-o;if(s<l)break;const c=jf-l;t>Gf(zf/c)&&Kf("overflow"),t*=c}const l=t.length+1;o=Qf(r-s,l,0==s),Gf(r/l)>zf-i&&Kf("overflow"),i+=Gf(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Zf=function(e){const t=[],n=(e=Hf(e)).length;let r=128,i=0,o=72;for(const l of e)l<128&&t.push(Vf(l));const s=t.length;let a=s;for(s&&t.push("-");a<n;){let n=zf;for(const t of e)t>=r&&t<n&&(n=t);const l=a+1;n-r>Gf((zf-i)/l)&&Kf("overflow"),i+=(n-r)*l,r=n;for(const c of e)if(c<r&&++i>zf&&Kf("overflow"),c===r){let e=i;for(let n=jf;;n+=jf){const r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;const i=e-r,s=jf-r;t.push(Vf(Xf(r+i%s,0))),e=Gf(i/s)}t.push(Vf(Xf(e,0))),o=Qf(i,l,a===s),i=0,++a}++i,++r}return t.join("")},eh=function(e){return Wf(e,function(e){return Bf.test(e)?"xn--"+Zf(e):e})},th=function(e){return Wf(e,function(e){return Uf.test(e)?Yf(e.slice(4).toLowerCase()):e})},nh={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},rh=/^(vbscript|javascript|file|data):/,ih=/^data:image\/(gif|png|jpeg|webp);/;function oh(e){const t=e.trim().toLowerCase();return!rh.test(t)||ih.test(t)}const sh=["http:","https:","mailto:"];function ah(e){const t=Fu(e,!0);if(t.hostname&&(!t.protocol||sh.indexOf(t.protocol)>=0))try{t.hostname=eh(t.hostname)}catch(ky){}return _u(bu(t))}function lh(e){const t=Fu(e,!0);if(t.hostname&&(!t.protocol||sh.indexOf(t.protocol)>=0))try{t.hostname=th(t.hostname)}catch(ky){}return vu(bu(t),vu.defaultChars+"%")}function ch(e,t){if(!(this instanceof ch))return new ch(e,t);t||rd(e)||(t=e||{},e="default"),this.inline=new Af,this.block=new df,this.core=new Yd,this.renderer=new Id,this.linkify=new Lf,this.validateLink=oh,this.normalizeLink=ah,this.normalizeLinkText=lh,this.utils=Td,this.helpers=od({},Rd),this.options={},this.configure(e),t&&this.set(t)}function uh(e){return"var("+e+")"}ch.prototype.set=function(e){return od(this.options,e),this},ch.prototype.configure=function(e){const t=this;if(rd(e)){const t=e;if(!(e=nh[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},ch.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},ch.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},ch.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},ch.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},ch.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},ch.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},ch.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let dh=co([ui("color",uh(_t.textPrimary)),ui("font-size",uh(xt.sizeSm)),ui("line-height",uh(xt.lineHeightRelaxed)),ui("word-break","break-word"),Wi("& > :first-child",[ui("margin-top","0")]),Wi("& > :last-child",[ui("margin-bottom","0")]),Wi("& h1, & h2, & h3, & h4, & h5, & h6",[ui("margin","var("+bt.md+") 0 var("+bt.sm+")"),ui("line-height",uh(xt.lineHeightTight)),ui("font-weight",uh(xt.weightBold))]),Wi("& h1",[ui("font-size",uh(xt.sizeXl))]),Wi("& h2",[ui("font-size",uh(xt.sizeLg))]),Wi("& h3, & h4, & h5, & h6",[ui("font-size",uh(xt.sizeMd))]),Wi("& p",[ui("margin","var("+bt.sm+") 0")]),Wi("& a",[ui("color",uh(_t.brand)),ui("text-decoration","none")]),Wi("& a:hover",[ui("text-decoration","underline")]),Wi("& ul, & ol",[ui("margin","var("+bt.sm+") 0"),ui("padding-left","1.5em")]),Wi("& li",[ui("margin","var("+bt.xs+") 0")]),Wi("& code",[ui("font-family",uh(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("background",uh(_t.surfaceSubtle)),ui("padding","1px 4px"),ui("border-radius",uh(St.sm))]),Wi("& pre",[ui("background",uh(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",uh(St.md)),ui("padding",uh(bt.md)),ui("overflow","auto"),ui("margin","var("+bt.sm+") 0")]),Wi("& pre code",[ui("background","none"),ui("padding","0")]),Wi("& blockquote",[ui("margin","var("+bt.sm+") 0"),ui("padding-left",uh(bt.md)),ui("border-left","3px solid var("+_t.border+")"),ui("color",uh(_t.textSecondary))]),Wi("& table",[ui("border-collapse","collapse"),ui("margin","var("+bt.sm+") 0")]),Wi("& th, & td",[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("text-align","left")]),Wi("& th",[ui("background",uh(_t.surfaceSubtle)),ui("font-weight",uh(xt.weightMedium))]),Wi("& img",[ui("max-width","100%"),ui("border-radius",uh(St.sm))]),Wi("& hr",[ui("border","none"),ui("border-top","1px solid var("+_t.borderSubtle+")"),ui("margin","var("+bt.md+") 0")])]),fh=new ch({html:!1,linkify:!0});let hh=function(e){let t=e.source,n=p(()=>fh.render(t),[t]),r=h(null);return a(()=>{M(R(r.current),e=>{Array.from(e.querySelectorAll("a")).forEach(e=>{e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")})})},[n]),i("div",{ref:T(r),className:dh,dangerouslySetInnerHTML:{__html:n}})};function ph(e,t){return i(hh,{source:e.body})}function gh(e){return Array.from(e).length}function mh(e,t){let n=Array.from(e),r=t<0?0:t;return n.length<=r?[e,""]:[n.slice(0,r).join(""),n.slice(r).join("")]}function vh(e,t){return j(t,t=>{let n=mh(e,t)[1];return""===n?void 0:n})}function yh(e){return"var("+e+")"}let _h=co([gi("flex"),mi("column"),ui("gap","4px")]),bh=co([ui("background",yh(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",yh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-family","inherit"),ui("font-size",yh(xt.sizeMd)),ui("line-height",yh(xt.lineHeightNormal)),ui("color",yh(_t.textPrimary)),ui("outline","none"),ui("resize","vertical"),Vi({NAME:"percent",VAL:100}),ui("box-sizing","border-box"),ui("transition","border-color 120ms"),Xi([ui("border-color",yh(_t.brand))])]),xh=co([ui("border-color",yh(_t.error)),Xi([ui("border-color",yh(_t.error))])]),Sh=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",yh(bt.sm)),ui("font-size",yh(xt.sizeXs)),ui("color",yh(_t.textSecondary))]),wh=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("color",yh(_t.textSecondary))]),Eh=co([ui("font-variant-numeric","tabular-nums")]),kh=co([ui("color",yh(_t.error)),ui("font-weight",yh(xt.weightMedium))]),Ch=co([ui("background",yh(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-left","3px solid var("+_t.error+")"),ui("border-radius",yh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",yh(xt.sizeXs)),ui("line-height",yh(xt.lineHeightNormal)),ui("white-space","pre-wrap"),ui("word-break","break-word"),ui("max-height","8em"),ui("overflow","auto")]),Ah=co([ui("color",yh(_t.textSecondary)),ui("font-size",yh(xt.sizeXs)),Ri(to(2))]),Nh=co([ui("color",yh(_t.textPrimary))]),Th=co([ui("color",yh(_t.error)),ui("font-weight",yh(xt.weightMedium))]),Rh=co([ui("color",yh(_t.textDisabled)),ui("text-decoration","line-through")]);function Dh(e){return e.toString()+" character"+(1===e?"":"s")}function Ih(e,t){return void 0!==t?e>t?(e-t|0).toString()+" over the "+t.toString()+"-character limit":e.toString()+" / "+t.toString():e.toString()+" characters"}let Fh=function(e){let t,n=e.note,o=e.hasError,s=e.rows,a=e.channelLabel,l=e.maxLength,c=e.onBlur,u=e.onChange,d=e.value,f=void 0!==c?c:()=>{},h=void 0!==s?s:6,p=void 0!==o&&o,g=Array.from(d).length,m=vh(d,l),v=$(m),y=p||v?bh+" "+xh:bh;if(void 0!==m&&void 0!==l){let e=mh(d,l);t=r("div",{children:[i("div",{children:"Sent as:",className:Ah}),r("div",{children:[i("span",{children:e[0],className:Nh}),i("span",{children:"✂",className:Th}),i("span",{children:m,className:Rh})],className:Ch})]})}else t=null;return r("div",{children:[i("textarea",{className:y,name:e.name,placeholder:e.placeholder,rows:h,value:d,onBlur:e=>f(),onChange:e=>u(e.target.value)}),r("div",{children:[r("span",{children:[void 0!==a?a:null,void 0!==n?$(a)?" · "+n:n:null],className:wh}),i("span",{children:Ih(g,l),className:v?Eh+" "+kh:Eh})],className:Sh}),t],className:_h})};function Oh(e){return"var("+e+")"}$c({id:"email",label:"Email",constraints:{subjectMaxLength:78,note:"Subject lines are elided in inbox lists past ~78 characters"},preview:gu}),$c({id:"markdown",label:"Markdown",constraints:{},preview:ph});let Ph=co([gi("flex"),mi("column"),ui("gap",Oh(bt.sm)),ui("background",Oh(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Oh(St.md)),ui("padding",Oh(bt.md))]),Mh=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",Oh(bt.sm))]),Lh=co([ui("font-size",Oh(xt.sizeSm)),ui("font-weight",Oh(xt.weightMedium)),ui("color",Oh(_t.textPrimary))]),zh=co([ui("font-size",Oh(xt.sizeXs)),ui("color",Oh(_t.textSecondary))]),jh=co([ui("font-size",Oh(xt.sizeXs)),ui("color",Oh(_t.textSecondary)),ui("font-variant-numeric","tabular-nums"),ui("white-space","nowrap")]),Uh=co([ui("color",Oh(_t.error)),ui("font-weight",Oh(xt.weightMedium))]),Bh=co([gi("flex"),di("baseline"),xi("spaceBetween"),ui("gap",Oh(bt.sm)),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("padding-bottom",Oh(bt.xs))]),$h=co([ui("font-size",Oh(xt.sizeMd)),ui("font-weight",Oh(xt.weightMedium)),ui("color",Oh(_t.textPrimary)),ui("word-break","break-word")]),qh=co([ui("color",Oh(_t.textDisabled)),ui("text-decoration","line-through")]),Gh=co([ui("color",Oh(_t.error)),ui("font-weight",Oh(xt.weightMedium))]),Vh=co([ui("margin","0"),ui("font-family","inherit"),ui("font-size",Oh(xt.sizeSm)),ui("line-height",Oh(xt.lineHeightRelaxed)),ui("color",Oh(_t.textPrimary)),ui("white-space","pre-wrap"),ui("word-break","break-word")]),Kh=co([ui("max-width","100%"),ui("border-radius",Oh(St.sm)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("object-fit","cover")]),Wh=co([ui("font-size",Oh(xt.sizeXs)),ui("color",Oh(_t.error)),ui("background",Oh(_t.surfaceSubtle)),ui("border-left","3px solid var("+_t.error+")"),ui("border-radius",Oh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")")]);function Hh(e,t){let n=mh(e,t),s=n[1];return""===s?e:r(o,{children:[n[0],i("span",{children:"✂",className:Gh}),i("span",{children:s,className:qh})]})}let Jh=function(e){let t=e.showHeader,n=e.message,o=e.channelId,s=void 0===t||t,l=qc(o);a(()=>{q(l)&&function(e,t){if(Vc.contents.some(t=>t===e))return;Vc.contents.push(e);let n=Ye(Bc).map(e=>e.id).join(", ");console.error('[AutoUI] Unknown channel "'+e+'" ('+t+") — falling back to a plain-text preview. Registered channels: "+(""===n?"(none — has the channel adapter's init() run?)":n))}(o,"ChannelPreview")},[o]);let c,u=L(l,o,e=>e.label),d=L(l,Gc,e=>e.constraints),f=gh(n.body),h=vh(n.body,d.maxLength),p=n.subject;if(void 0!==p){let e=d.subjectMaxLength,t=gh(p),n=L(e,!1,e=>t>e);c=r("div",{children:[i("span",{children:void 0!==e?Hh(p,e):p,className:$h}),void 0!==e?i("span",{children:t.toString()+" / "+e.toString(),className:n?jh+" "+Uh:jh}):null],className:Bh})}else c=null;let g,m=j(l,e=>e.preview);if(void 0!==m)g=m(n,d);else{let e=d.maxLength;g=i("pre",{children:void 0!==e?Hh(n.body,e):n.body,className:Vh})}let v,y=n.imageUrl;if(void 0!==y){let e=d.mediaAspect;v=i("img",{className:Kh,style:void 0!==e?su({},"aspectRatio",e):{},alt:"Message media",src:He(y)})}else v=null;let _=d.note;return r("div",{children:[s?r("div",{children:[i("span",{children:u,className:Lh}),i("span",{children:Ih(f,d.maxLength),className:$(h)?jh+" "+Uh:jh})],className:Mh}):null,c,g,void 0!==h?i("div",{children:Dh(gh(h))+" past the limit — "+u+" will cut the tail.",className:Wh}):null,v,void 0!==_?i("span",{children:_,className:zh}):null],className:Ph})};function Xh(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Qh(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Yh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Zh=Yh&&"documentMode"in document?document.documentMode:null,ep=Yh&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),tp=Yh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),np=!(!Yh||!("InputEvent"in window)||Zh)&&"getTargetRanges"in new window.InputEvent("input"),rp=Yh&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ip=Yh&&/Android/.test(navigator.userAgent),op=Yh&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!ip,sp=Yh&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ap=Yh&&ip&&sp,lp=Yh&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ep&&!sp,cp=0,up=1,dp=2,fp=1,hp=2,pp=3,gp=4,mp=5,vp=6,yp=op||rp||lp?" ":"​",_p="\n\n",bp=tp?" ":yp,xp={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Sp={directionless:1,unmergeable:2},wp={center:2,end:6,justify:4,left:1,right:3,start:5},Ep={[hp]:"center",[vp]:"end",[gp]:"justify",[fp]:"left",[pp]:"right",[mp]:"start"},kp={normal:0,segmented:2,token:1},Cp={[cp]:"normal",[dp]:"segmented",[up]:"token"},Ap="$config";function Np(){return oS()._blockCursorElement}function Tp(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let Rp,Dp=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return null!==t&&t.parentElement!==this.element&&Xh(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Xh(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Xh(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&0===n?"before":"after";const r=Ip(e,this.element);if(null===r)return"after";const i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return"after";if(t===e)return n<=i?"before":"after";const o=Ip(e,t);if(null===o)return"after";const s=Array.prototype.indexOf.call(e.childNodes,o);return s>=0&&s<=i?"before":"after"}getInsertionAnchor(){return this.before}};function Ip(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class Fp extends Dp{withBefore(e){return new Fp(this.element,e,this.after)}withAfter(e){return new Fp(this.element,this.before,e)}withElement(e){return this.element===e?this:new Fp(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Tp(t);)e=t,t=t.nextSibling;const n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===Np()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(lp||rp||op);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=Gx().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(i,r),e){const e=Gx().createElement("img");e.setAttribute("data-lexical-managed-linebreak","true"),e.style.setProperty("display","inline","important"),e.style.setProperty("border","0px","important"),e.style.setProperty("margin","0px","important"),e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let n=0;for(let r=this.element.firstChild;null!==r&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){const t=this.getFirstChildOffset(),n=Np(),i=this.element.childNodes,o=Math.min(r,i.length);let s=0;for(let e=t;e<o;e++)i[e]!==n&&s++;return[e,Math.min(s,e.getChildrenSize())]}const i=Op(t,n);i.push(r);const o=Op(t,this.element);let s=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const e=i[a],t=o[a];if(void 0===e||e<t)break;if(e>t){s+=1;break}}return[e.getParentOrThrow(),s]}}function Op(e,t){const n=[];let r=t;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return r!==e&&Xh(225),n.reverse()}try{Rp="0.48.0+prod.esm"}catch(Xh){}const Pp=Rp??'"<unknown>+source"';let Mp=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const Lp=null;function zp(e,t=1e3){return e instanceof jp?e.clone():e.size<t?new Map(e):(new jp).init(new Map(e),void 0,e.size)}let jp=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,(new e).init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return void 0!==this.get(e)}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return void 0!==t?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===Lp?void 0:t}shouldCompact(){return void 0!==this._nursery&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const e=new Map(this._old);for(const[t,n]of this._nursery)n!==Lp?e.set(t,n):e.delete(t);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const n=this.getWithTombstone(e);if(n===t)return this;const r=this.getNursery();return n!==Lp&&void 0!==n||(this._size++,n===Lp&&r.delete(e)),r.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,Lp),this._size--),t}getOrInsert(e,t){const n=this.get(e);return void 0!==n?n:(this.set(e,t),t)}getOrInsertComputed(e,t){const n=this.get(e);if(void 0!==n)return n;const r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(t)for(const n of t){const t=n[0],r=e?e.get(t):void 0;r!==Lp&&(void 0!==r&&(n[1]=r),yield n)}if(e)for(const n of e)n[1]===Lp||t&&t.has(n[0])||(yield n)}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[n,r]of this.entries())e(r,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Up(e,t,n,r,i,o){if(Q_(e)){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&((Q_(s)||AS(s)&&null!==s.__slots)&&Up(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}for(const s of AS(e)&&null!==e.__slots?e.__slots.values():[]){const e=r.get(s);void 0!==e&&NS(e)&&e.__slotHost===t&&((Q_(e)||AS(e)&&null!==e.__slots)&&Up(e,s,n,r,i,o),n.has(s)||o.delete(s),i.push(s))}}let Bp=!1,$p=0;function qp(e){$p=e.timeStamp}function Gp(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Yb(e,n)}function Vp(e,t,n){const r=zx(Tx(n)),i=r&&Kx(r,n._rootElement);let o=null,s=null;null!==i&&i.anchorNode===e&&(o=i.anchorOffset,s=i.focusOffset);const a=e.nodeValue;null!==a&&dx(t,a,o,s,!1)}function Kp(e,t,n){if(Iy(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Ub(t)&&n.isAttached()}function Wp(e,t,n){for(let r=e;r&&!mS(r);r=Ex(r)){const e=Yb(r,t);if(void 0!==e){const t=Jb(e,n);if(t)return eb(t)||!Qx(r)?void 0:[r,t]}}}function Hp(e,t,n){Bp=!0;const r=performance.now()-$p>100;try{H_(e,()=>{const i=i_()||function(e){return e.read("latest",()=>{const e=i_();return null!==e?e.clone():null})}(e),o=new Map,s=e._editorState,a=e._blockCursorElement;let l=!1,c="";for(let n=0;n<t.length;n++){const u=t[n],d=u.type,f=u.target,h=Wp(f,e,s);if(!h)continue;const[p,g]=h;if("characterData"===d)r&&xy(g)&&Ub(f)&&Kp(i,f,g)&&Vp(f,g,e);else if("childList"===d){l=!0;const t=u.addedNodes;for(let i=0;i<t.length;i++){const n=t[i],r=Xb(n),o=n.parentNode;if(!(null==o||n===a||null!==r||Gp(n,o,e)||e._slotsUsed&&Qx(n)&&n.hasAttribute("data-lexical-slot")||mS(n))){if(tp){const e=(Qx(n)?n.innerText:null)||n.nodeValue;e&&(c+=e)}o.removeChild(n)}}const n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];(Gp(r,f,e)||a===r)&&(f.appendChild(r),t++)}r!==t&&o.set(p,g)}}}if(o.size>0)for(const[t,n]of o)n.reconcileObservedMutation(t,e);const u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){const n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],o=n.parentNode;null==o||"BR"!==n.nodeName||Gp(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(l&&rx(i),tp&&xx(e)&&i.insertRawText(c))})}finally{Bp=!1}}function Jp(e){const t=e._observer;null!==t&&Hp(e,t.takeRecords(),t)}function Xp(e){!function(e){0===$p&&Tx(e).addEventListener("textInput",qp,!0)}(e),e._observer=new MutationObserver((t,n)=>{Hp(e,t,n)})}const Qp="latest";let Yp=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||lg).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Zp(e,t){return new Yp(e,t)}function eg(e,t,n=Qp){const r=(n===Qp?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function tg(e,t,n){let r;if(R_(),"function"==typeof n){const i=e.getLatest(),o=eg(i,t);if(r=n(o),t.isEqual(o,r))return i}else r=n;const i=e.getWritable();return og(i).updateFromKnown(t,r),i}function ng(e){const t=new Map,n=new Set;for(const{ownNodeConfig:r}of xS("function"==typeof e?e:e.replace))if(r&&r.stateConfigs)for(const e of r.stateConfigs){let r;"stateConfig"in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}const rg=new Set(["__proto__","constructor","prototype"]);let ig=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:o}=this.sharedNodeState,s=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(const i in t){const t=e.get(i);t&&n.has(t)||r++}return r}(o,n,r);this.size=s}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[n,r]of this.knownState)n.isEqual(r,n.defaultValue)?delete e[n.key]:e[n.key]=n.unparse(r);for(const n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return ag(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(const[i,o]of Object.entries(n)){if(rg.has(i))continue;const n=e.get(i);n?t.has(n)||t.set(n,n.parse(o)):(r=r||{},r[i]=o)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=ag(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(rg.has(e))return;const n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const n of t.keys())t.set(n,n.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[n,r]of Object.entries(e))this.updateFromUnknown(n,r)}};function og(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new ig(t,sg(t));return t.__state=n,n}function sg(e){return e.__state?e.__state.sharedNodeState:Rb(oS(),e.getType()).sharedNodeState}function ag(e){if(e)for(const t in e)return e}function lg(e){return e}function cg(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ug(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r)for(const[o,s]of Object.entries(r))if(!e.has(o)&&(e.add(o),s!==(i?i[o]:void 0)))return!0;return!1}function dg(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function fg(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(null===n||n===o)&&(null===r||r===s)&&(null===i||i===a)&&(null===e.__state||l===c||function(e,t){if(e===t)return!0;const n=new Set;return!(e&&cg(n,e,t)||t&&cg(n,t,e)||e&&ug(n,e,t)||t&&ug(n,t,e))}(l,c))}function hg(e,t){const n=e.mergeWithSibling(t),r=F_()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function pg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&xy(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(fg(t,r)){r=hg(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&xy(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(fg(r,n)){r=hg(r,n);break}break}n.remove()}}else r.remove()}function gg(e){return mg(e.anchor),mg(e.focus),e}function mg(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),xy(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!Q_(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const vg=Symbol.for("@lexical/CachedTextSize");function yg(e,t){return Pg.read(()=>{let n=0,r=e;for(let e=0;e<t&&null!==r;e++){const i=Og.get(r);if(void 0===i&&Xh(345,r),Q_(i)){const o=Mg.get(r);if(void 0!==o&&Q_(o)&&o.__parent!==i.__parent)n+=i.getTextContentSize();else{const e=Lg.get(r),t=e&&e.__lexicalTextContent;"string"!=typeof t&&Xh(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{const e=i[vg];void 0===e&&Xh(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:Sg})}function _g(e){Q_(e)||void 0===e[vg]&&(e[vg]=xy(e)?e.__text.length:e.getTextContentSize())}const bg=4;let xg,Sg,wg,Eg="",kg=null,Cg=null,Ag=null;function Ng(){return{firstTextKey:Ag,format:kg,style:Cg}}function Tg(e){null!==e.firstTextKey&&(kg=e.format,Cg=e.style,Ag=e.firstTextKey)}function Rg(e){if(null!==Ag)return;const t=e.__lexicalFirstTextKey;if(void 0===t&&Xh(348),null===t)return;const n=Mg.get(t);xy(n)&&(kg=n.getFormat(),Cg=n.getStyle(),Ag=t)}let Dg,Ig,Fg,Og,Pg,Mg,Lg,zg,jg,Ug,Bg=!1,$g=!1;function qg(e,t){const n=Og.get(e),r=Mg.has(e);if(null!==t){const n=fm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(Sg._keyToDOMMap.delete(e),Q_(n)){const e=ES(n,Og);Gg(e,0,e.length-1,null)}if(void 0!==n){for(const e of Zg(n).values()){const t=tm(e);qg(e,null),null!==t&&t.remove()}_x(jg,wg,Dg,n,"destroyed")}}}function Gg(e,t,n,r){for(let i=t;i<=n;++i){const t=e[i];void 0!==t&&qg(t,r)}}function Vg(e,t){e.setProperty("text-align",t)}const Kg="40px";function Wg(e,t){const n=xg.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * var(--lexical-indent-base-value, ${Kg}))`)}function Hg(e,t){const n=e.style;0===t?Vg(n,""):1===t?Vg(n,"left"):2===t?Vg(n,"center"):3===t?Vg(n,"right"):4===t?Vg(n,"justify"):5===t?Vg(n,"start"):6===t&&Vg(n,"end")}function Jg(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(nb(e))return null;const n=e.getParent();return null===n||Ix(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function Xg(e){const t=Gx().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function Qg(e,t,n){t||"false"===e.contentEditable?function(e,t=oS()){const n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,Sg):n.removeAttribute("contenteditable")}function Yg(e,t,n){const r=Eg,i=Ng();Eg="";let o="";const s=eb(e);for(const[a,l]of n){const n=Xg(a);Qg(t,s,n),t.appendChild(n),Eg="";const r=Ng();rm(l,aS(e,n,Sg)),Tg(r),em(e,a,t,n),o+=Eg}return Tg(i),Eg=r,o}function Zg(e){return AS(e)&&null!==e.__slots?e.__slots:CS}function em(e,t,n,r){const i=Ug.$getSlotTargetElement(e,t,n,Sg);null!==i&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function tm(e){const t=Lg.get(e);return void 0!==t?t.parentElement:null}function nm(e,t,n){const r=Zg(e),i=Zg(t);for(const[u,d]of r)if(!i.has(u)){const e=tm(d);qg(d,null),null!==e&&e.remove()}const o=Eg,s=Ng();let a="",l=null;const c=eb(t);for(const[u,d]of i){const e=r.get(u);let i=void 0!==e?tm(e):null;Eg="";const o=Ng();if(null===i){i=Xg(u);let e=null;for(const t of n.children)if(!t.hasAttribute("data-lexical-slot")){e=t;break}n.insertBefore(i,e),rm(d,aS(t,i,Sg))}else e===d?lm(d,i):(void 0!==e&&qg(e,i),rm(d,aS(t,i,Sg)));if(Tg(o),Qg(n,c,i),em(t,u,n,i),a+=Eg,i.parentElement===n){const e=null===l?n.firstChild:l.nextSibling;e!==i&&n.insertBefore(i,e),l=i}}return Tg(s),Eg=o,a}function rm(e,t){const n=Mg.get(e);if(void 0===n&&Xh(60),null!==t){const r=Og.get(e);if(void 0!==r){const i=Lg.get(e);if(void 0!==i){const o=NS(r)?r.__slotHost:null,s=NS(n)?n.__slotHost:null,a=r.__parent!==n.__parent||o!==s,l=null!==s&&i.parentElement!==t.element;if(a||l)return t.insertChild(i),lm(e,t.element)}}}const r=Ug.$createDOM(n,Sg);if(function(e,t,n){const r=n._keyToDOMMap;Qb(t,n,e),r.set(e,t)}(e,r,Sg),xy(n)?r.setAttribute("data-lexical-text","true"):eb(n)&&(r.setAttribute("data-lexical-decorator","true"),function(e,t){e.__lexicalUnmanaged=!0,t&&void 0!==t.captureSelection&&(e.__lexicalCapturedSelection=t.captureSelection)}(r,{captureSelection:!0})),Q_(n)){const e=n.__indent,t=n.__size;Jg(r,n),0!==e&&Wg(r,e);const i=Zg(n),o=i.size>0?Yg(n,r,i):"";if(0===t)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,Eg+=o,i.size>0&&(r.__lexicalSlotTextLength=o.length);else{const e=Eg,s=t-1;if(im(ES(n,Mg),n,0,s,aS(n,r,Sg)),""!==o){const t=r.__lexicalTextContent||"";r.__lexicalTextContent=o+t,Eg=e+o+t}i.size>0&&(r.__lexicalSlotTextLength=o.length)}const s=n.__format;0!==s&&Hg(r,s),n.isInline()||om(null,n,r)}else{const t=n.getTextContent();if(eb(n)){const t=n.decorate(Sg,xg);null!==t&&cm(e,t),r.contentEditable="false";const i=Zg(n);i.size>0&&Yg(n,r,i)}Eg+=t}return null!==t&&t.insertChild(r),Ug.$decorateDOM(n,null,r,Sg),_g(n),_x(jg,wg,Dg,n,"created"),r}function im(e,t,n,r,i){const o=Eg,s=Ng();Eg="",kg=null,Cg=null,Ag=null;let a=n;for(;a<=r;++a){const t=Ng();rm(e[a],i);const n=Mg.get(e[a]);null!==n&&xy(n)?null===kg&&(kg=n.getFormat(),Cg=n.getStyle(),Ag=n.__key):Q_(n)&&a<r&&!n.isInline()&&(Eg+=_p),Tg(t)}const l=Sg._keyToDOMMap.get(t.__key);void 0===l&&Xh(349,t.__key),l.__lexicalTextContent=Eg,l.__lexicalFirstTextKey=Ag,Eg=o+Eg,Tg(s)}function om(e,t,n){const r=aS(t,n,Sg),i=r.element.__lexicalLastChildKind??null,o=function(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return db(e)?"line-break":eb(e)&&e.isInline()?"decorator":null}return Zg(e).size>0?null:"empty"}return null}(t,Mg);i!==o&&r.setManagedLineBreak(o)}function sm(e,t,n){var r;kg=null,Cg=null,Ag=null,function(e,t,n){const r=Eg,i=e.__size,o=t.__size;Eg="";const s=n.element,a=Sg._keyToDOMMap.get(t.__key);void 0===a&&Xh(351,t.__key);const l=o-i;if(!Bg&&Math.abs(l)<=1&&i>=bg&&e.__first===t.__first&&(0!==l||!Sg._cloneNotNeeded.has(e.__key))){const i=a.__lexicalTextContent,c=zg.get(e.__key);if(!Bg&&"string"==typeof i&&void 0!==c){const o=function(e,t){const n=t.size;if(0===n||n>=e.__size)return null;let r=e.__last,i=null,o=0;for(;null!==r&&o<n;){if(!t.has(r))return null;i=r;const e=Mg.get(r);if(void 0===e)return null;r=e.__prev,o++}return o!==n||null!==r&&t.has(r)?null:i}(t,c);if(null!==o){const u=c.size;if(0===l){const e=yg(o,u);let n=o,l=0;for(;null!==n&&l<u;){const e=Mg.get(n);if(void 0===e)break;const t=Ng();lm(n,s),xy(e)&&null===kg&&(kg=e.getFormat(),Cg=e.getStyle(),Ag=e.__key),Tg(t),n=e.__next,l++}let d="";for(n=o,l=0;null!==n&&l<u;){const e=Mg.get(n);if(void 0===e)break;let t;if(Q_(e)){const r=Sg._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;"string"!=typeof i&&Xh(352,e.getType()),t=i}else t=e.getTextContent();d+=t,l<u-1&&Q_(e)&&!e.isInline()&&(d+=_p),n=e.__next,l++}const f=a.__lexicalSlotTextLength||0,h=f>0?i.slice(f):i,p=h.slice(0,h.length-e)+d;return a.__lexicalTextContent=p,Eg=r+p,void am(t,a,c)}if(function(e,t,n,r,i,o,s,a){if(1!==a&&-1!==a)return!1;if(s!==(1===a?2:1))return!1;const l=s-a;let c=e.__last;for(let E=0;E<l-1;E++){if(null===c)return!1;const e=Og.get(c);if(void 0===e)return!1;c=e.__prev}if(null===c)return!1;const u=Mg.get(o),d=Og.get(c);if(void 0===u||void 0===d)return!1;if(u.__prev!==d.__prev)return!1;const f=[];let h=o;for(let E=0;E<s;E++){if(null===h)return!1;f.push(h);const e=Mg.get(h);h=e?e.__next:null}const p=[];h=c;for(let E=0;E<l;E++){if(null===h)return!1;p.push(h);const e=Og.get(h);h=e?e.__next:null}const g=new Set(p),m=new Set(f),v=[];let y=0,_=0;for(;y<l&&_<s;)if(f[_]===p[y])v.push({key:f[_],kind:"reconcile"}),y++,_++;else if(m.has(p[y])){if(g.has(f[_]))return!1;v.push({key:f[_],kind:"create",nextIndex:_}),_++}else v.push({key:p[y],kind:"destroy"}),y++;for(;y<l;)v.push({key:p[y++],kind:"destroy"});for(;_<s;)v.push({key:f[_],kind:"create",nextIndex:_}),_++;const b=yg(c,l);for(const E of v){const e=Ng();if("reconcile"===E.kind)lm(E.key,n.element);else if("destroy"===E.kind)qg(E.key,n.element);else{let e=null;for(let t=E.nextIndex+1;t<s;t++){const n=Sg._keyToDOMMap.get(f[t]);if(void 0!==n){e=n;break}}rm(E.key,n.withBefore(e??n.before))}if("destroy"!==E.kind){const e=Mg.get(E.key);e&&xy(e)&&null===kg&&(kg=e.getFormat(),Cg=e.getStyle(),Ag=e.__key)}Tg(e)}let x="";for(let E=0;E<s;E++){const e=Mg.get(f[E]);if(void 0===e)return!1;let t;if(Q_(e)){const n=Sg._keyToDOMMap.get(f[E]),r=n&&n.__lexicalTextContent;"string"!=typeof r&&Xh(350,e.getType()),t=r}else t=e.getTextContent();x+=t,E<s-1&&Q_(e)&&!e.isInline()&&(x+=_p)}const S=r.__lexicalSlotTextLength||0,w=S>0?i.slice(S):i;return r.__lexicalTextContent=w.slice(0,w.length-b)+x,!0}(e,0,n,a,i,o,u,l)){const e=a.__lexicalTextContent;return"string"!=typeof e&&Xh(353),Eg=r+e,void am(t,a,c)}}}if(0===l){let t=e.__first,n=0;for(;null!==t;){const e=Mg.get(t);if(void 0===e)break;const r=Bg||Fg.has(t)||Ig.has(t),i=Ng();if(r)lm(t,s);else{let n,r;if(Q_(e)){r=Lg.get(t);const i=r&&r.__lexicalTextContent;"string"!=typeof i&&Xh(354,e.getType()),n=i}else n=e.getTextContent();Eg+=n,void 0!==r&&Rg(r)}xy(e)?null===kg&&(kg=e.getFormat(),Cg=e.getStyle(),Ag=e.__key):Q_(e)&&n<o-1&&!e.isInline()&&(Eg+=_p),Tg(i),t=e.__next,n++}return a.__lexicalTextContent=Eg,a.__lexicalFirstTextKey=Ag,void(Eg=r+Eg)}}if(1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)lm(r,s);else{const e=fm(r),t=rm(i,null);try{e.parentNode===s?s.replaceChild(t,e):n.insertChild(t)}catch(n){if("object"==typeof n&&null!=n){const o=`${n.toString()} Parent: ${s.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(o)}throw n}qg(r,null)}const o=Mg.get(i);xy(o)&&null===kg&&(kg=o.getFormat(),Cg=o.getStyle(),Ag=o.__key)}else{const r=ES(e,Og),a=ES(t,Mg);if(r.length!==i&&Xh(227),a.length!==o&&Xh(228),0===i)0!==o&&im(a,t,0,o-1,n);else if(0===o){if(0!==i){const e=null==n.after&&null==n.before&&0===Zg(t).size&&null==n.element.__lexicalLineBreak;Gg(r,0,i-1,e?null:s),e&&(s.textContent="")}}else!function(e,t,n,r,i,o){const s=r-1,a=i-1;let l,c,u=o.getFirstChild(),d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f],i=Ng();if(e===r)u=um(lm(r,o.element)),d++,f++;else{if(void 0===c&&(c=dm(n,f)),void 0===l)l=dm(t,d);else if(!l.has(e)){d++,Tg(i);continue}if(!c.has(e)){u=um(fm(e)),qg(e,o.element),d++,l.delete(e),Tg(i);continue}if(l.has(r)){const e=wx(Sg,r);e!==u&&o.withBefore(u??o.before).insertChild(e),u=um(lm(r,o.element)),d++,f++}else rm(r,o.withBefore(u??o.before)),f++}const s=Mg.get(r);null!==s&&xy(s)?null===kg&&(kg=s.getFormat(),Cg=s.getStyle(),Ag=s.__key):Q_(s)&&f<=a&&!s.isInline()&&(Eg+=_p),Tg(i)}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1],r=void 0===t?null:Sg.getElementByKey(t);im(n,e,f,a,o.withBefore(r??o.before))}else p&&!h&&Gg(t,d,s,o.element)}(t,r,a,i,o,n)}a.__lexicalTextContent=Eg,a.__lexicalFirstTextKey=Ag,Eg=r+Eg}(e,t,aS(t,n,Sg)),Ix(t)||(r=t,null==kg||kg===r.__textFormat||$g||r.setTextFormat(kg),function(e){null==Cg||Cg===e.__textStyle||$g||e.setTextStyle(Cg)}(t))}function am(e,t,n){const r=t.__lexicalFirstTextKey;if(null!=r){const t=e.__key;let i=r;for(;null!==i;){const e=Mg.get(i);if(void 0===e){i=null;break}if(e.__parent===t)break;i=e.__parent}if(null!==i&&!n.has(i)){const e=Mg.get(r);if(xy(e))return kg=e.getFormat(),void(Cg=e.getStyle())}}t.__lexicalFirstTextKey=Ag}function lm(e,t){const n=Og.get(e);let r=Mg.get(e);void 0!==n&&void 0!==r||Xh(61);const i=Bg||Fg.has(e)||Ig.has(e),o=wx(Sg,e);if(n===r&&!i){let e;if(Q_(n)){const t=o.__lexicalTextContent;"string"!=typeof t&&Xh(355,n.getType()),e=t,Rg(o)}else e=n.getTextContent();return Eg+=e,o}if(n!==r&&i&&_x(jg,wg,Dg,r,"updated"),Ug.$updateDOM(r,n,o,Sg)){const n=rm(e,null);return null===t&&Xh(62),t.replaceChild(n,o),qg(e,null),n}if(Q_(n)){Q_(r)||Xh(334,e);const t=r.__indent;(Bg||t!==n.__indent)&&Wg(o,t);const s=r.__format;(Bg||s!==n.__format)&&Hg(o,s);const a=i&&(Zg(r).size>0||Zg(n).size>0)?nm(n,r,o):"";if(i){const e=Eg;if(sm(n,r,o),nb(r)||r.isInline()||om(0,r,o),""!==a){const t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,Eg=e+a+t,o.__lexicalSlotTextLength=a.length}else(Zg(r).size>0||Zg(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const e=o.__lexicalTextContent;"string"!=typeof e&&Xh(356,n.getType()),Eg+=e,Rg(o)}if((Bg||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Jg(o,r),nb(r)&&!Bg))for(const e of r.getChildren())Q_(e)&&Jg(wx(Sg,e.getKey()),e)}else{const t=r.getTextContent();if(eb(r)){const t=r.decorate(Sg,xg);null!==t&&cm(e,t),i&&(Zg(r).size>0||Zg(n).size>0)&&nm(n,r,o)}Eg+=t}if(!$g&&nb(r)){const e=r.getLatest();if(e.__cachedText!==Eg){const t=e.getWritable();t.__cachedText=Eg,r=t}}return Ug.$decorateDOM(r,n,o,Sg),_g(r),o}function cm(e,t){let n=Sg._pendingDecorators;const r=Sg._decorators;if(null===n){if(r[e]===t)return;n=ex(Sg)}n[e]=t}function um(e){let t=e.nextSibling;return null!==t&&t===Sg._blockCursorElement&&(t=t.nextSibling),t}function dm(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function fm(e){const t=Lg.get(e);return void 0===t&&Xh(75,e),t}function hm(e){return{type:e}}const pm=hm("SELECTION_CHANGE_COMMAND"),gm=hm("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),mm=hm("CLICK_COMMAND"),vm=hm("BEFORE_INPUT_COMMAND"),ym=hm("INPUT_COMMAND"),_m=hm("COMPOSITION_START_COMMAND"),bm=hm("COMPOSITION_END_COMMAND"),xm=hm("DELETE_CHARACTER_COMMAND"),Sm=hm("INSERT_LINE_BREAK_COMMAND"),wm=hm("INSERT_PARAGRAPH_COMMAND"),Em=hm("CONTROLLED_TEXT_INSERTION_COMMAND"),km=hm("PASTE_COMMAND"),Cm=hm("REMOVE_TEXT_COMMAND"),Am=hm("DELETE_WORD_COMMAND"),Nm=hm("DELETE_LINE_COMMAND"),Tm=hm("FORMAT_TEXT_COMMAND"),Rm=hm("SET_TEXT_FORMAT_COMMAND"),Dm=hm("UNDO_COMMAND"),Im=hm("REDO_COMMAND"),Fm=hm("KEYDOWN_COMMAND"),Om=hm("KEY_ARROW_RIGHT_COMMAND"),Pm=hm("MOVE_TO_END"),Mm=hm("KEY_ARROW_LEFT_COMMAND"),Lm=hm("MOVE_TO_START"),zm=hm("KEY_ARROW_UP_COMMAND"),jm=hm("KEY_ARROW_DOWN_COMMAND"),Um=hm("KEY_ENTER_COMMAND"),Bm=hm("KEY_SPACE_COMMAND"),$m=hm("KEY_BACKSPACE_COMMAND"),qm=hm("KEY_ESCAPE_COMMAND"),Gm=hm("KEY_DELETE_COMMAND"),Vm=hm("KEY_TAB_COMMAND"),Km=hm("INSERT_TAB_COMMAND"),Wm=hm("INDENT_CONTENT_COMMAND"),Hm=hm("OUTDENT_CONTENT_COMMAND"),Jm=hm("DROP_COMMAND"),Xm=hm("FORMAT_ELEMENT_COMMAND"),Qm=hm("DRAGSTART_COMMAND"),Ym=hm("DRAGOVER_COMMAND"),Zm=hm("DRAGEND_COMMAND"),ev=hm("COPY_COMMAND"),tv=hm("CUT_COMMAND"),nv=hm("SELECT_ALL_COMMAND"),rv=hm("CLEAR_EDITOR_COMMAND"),iv=hm("CLEAR_HISTORY_COMMAND"),ov=hm("CAN_REDO_COMMAND"),sv=hm("CAN_UNDO_COMMAND"),av=hm("FOCUS_COMMAND"),lv=hm("BLUR_COMMAND"),cv=hm("KEY_MODIFIER_COMMAND");function uv(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}const dv=Object.freeze({}),fv=[["keydown",function(e,t){const n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&wv(n),t.isComposing()||Sx(t,Fm,e)}],["pointerdown",function(e,t){const n=Jx(e),r=e.pointerType;Yx(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&H_(t,()=>{vS(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){Sx(t,_m,e)}],["compositionend",function(e,t){const n=t._inputState;tp?n.compositionPhase="ending-firefox":rp||!op&&!lp?Sx(t,bm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const n=t._inputState;wv(n),H_(t,()=>{kv(e,t)||t.dispatchCommand(ym,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){H_(t,()=>{const n=i_(),r=zx(Tx(t)),i=o_();if(r)if(Iy(n)){const e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!nb(t)&&1===nx().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=Kx(r,t._rootElement).anchorNode;(Qx(n)||Ub(n))&&rx(r_(i,r,t,e))}Sx(t,mm,e)})}],["cut",dv],["copy",dv],["dragstart",dv],["dragover",dv],["dragend",dv],["paste",dv],["focus",dv],["blur",dv],["drop",dv]];np&&fv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType;"deleteCompositionText"===n||tp&&xx(t)||"insertCompositionText"!==n&&H_(t,()=>{kv(e,t)||Sx(t,vm,e)},{event:e})}(e,t)]);const hv=new WeakMap,pv=new WeakMap,gv=function(e){const t=new Map;return{dispose(){for(const e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);void 0===i&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));const o=()=>{const e=t.get(n);e&&e.holders.delete(o)&&0===e.holders.size&&(t.delete(n),e.dispose())};return i.holders.add(o),o}}}(e=>(e.addEventListener("selectionchange",Pv),()=>e.removeEventListener("selectionchange",Pv)));function mv(e,t,n,r,i,o){const s=e.anchor,a=e.focus,l=s.getNode(),c=F_();let u;if(void 0!==o)u=o;else{const e=zx(Tx(c));u=null!==e?Kx(e,c._rootElement):null}const d=null!==u?u.anchorNode:null,f=s.key,h=c.getElementByKey(f),p=n.length;return f!==a.key||!xy(l)||(!i&&(!np||c._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&p<2||sx(n))&&s.offset!==a.offset&&!l.isComposing()||jb(l)||l.isDirty()&&p>1||(i||!np)&&null!==h&&!l.isComposing()&&d!==lS(l,h,c)||null!==u&&null!==t&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=zb(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(xy(t)||Q_(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,l)}function vv(e,t){return Ub(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function yv(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=Kx(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,vv(r,i)&&vv(o,s)&&!a.postDeleteSelectionToRestore)||H_(t,()=>{if(!n)return void rx(null);if(!Ob(t,r,o))return;let l=i_();if(a.postDeleteSelectionToRestore&&Iy(l)&&l.isCollapsed()){const e=l.anchor,t=a.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),rx(l))}if(a.postDeleteSelectionToRestore=null,Iy(l)){const n=l.anchor,c=n.getNode();if(l.isCollapsed()){"Range"===e.type&&r===o&&(l.dirty=!0);const i=Tx(t).event,s=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:h,timeStamp:p}=a.collapsedSelectionFormat,g=nx(),m=!1===t.isComposing()&&""===g.getTextContent();if(s<p+200&&n.offset===f&&n.key===h)_v(l,u,d);else if("text"===n.type)xy(c)||Xh(141),bv(l,c);else if("element"===n.type&&!m){Q_(c)||Xh(259);const e=n.getNode();e.isEmpty()?function(e,t){_v(e,t.getTextFormat(),t.getTextStyle())}(l,e):_v(l,l.format,"")}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),o=r.length,a=l.isBackward(),c=a?s:i,u=a?i:s,d=a?t:e,f=a?e:t;let h=2047,p=!1;for(let n=0;n<o;n++){const e=r[n],t=e.getTextContentSize();if(xy(e)&&0!==t&&!(0===n&&e.__key===d&&c===t||n===o-1&&e.__key===f&&0===u)&&(p=!0,h&=e.getFormat(),0===h))break}l.format=p?h:0}}Sx(t,pm,void 0)})}function _v(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function bv(e,t){_v(e,t.getFormat(),t.getStyle())}function xv(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function Sv(e){const{lastKeyCode:t}=F_()._inputState;if(null==e||e.length<=1||null==t)return;const n=1===t.length?t:"Enter"===t?"\n":"Tab"===t?"\t":null;if(!n)return;const r=i_();if(!Iy(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!xy(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const e=i.getNextSibling();if("\n"===n){if(db(e))e.selectEnd();else if(!e){const e=wS(i,Zy),t=e&&e.getNextSibling();Q_(t)&&t.selectStart()}}else"\t"===n?ky(e)&&e.selectEnd():xy(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}function wv(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Ev(e){wv(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>wv(e),0)}function kv(e,t){const n=Jx(e);if(Qx(n)&&vS(n,t))return!0;const r=t.getRootElement();if(null===r)return!1;const i=Hx(r.ownerDocument);return null!==i&&r.contains(i)&&vS(i,t)}function Cv(e){const t=e.inputType,n=xv(e),r=F_(),i=r._inputState,o=i_();if("insertText"===t&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(wv(i),e.preventDefault(),Iy(o)&&!o.isCollapsed()){const e=o.isBackward()?o.anchor:o.focus;o.anchor.set(e.key,e.offset,e.type),o.focus.set(e.key,e.offset,e.type)}return!0}if("deleteContentBackward"===t){if(null===o){const e=o_();if(!Iy(e))return!0;rx(e.clone())}if(Iy(o)){const t=o.anchor.key===o.focus.key;if(function(e,t){return"MediaLast"===e.lastKeyCode&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(Wb(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{H_(r,()=>{Wb(null)})},30),Iy(o)){const e=o.anchor.getNode();e.markDirty(),xy(e)||Xh(142),bv(o,e)}}else{if(Wb(null),rp&&null!==n&&!n.collapsed&&(o.applyDOMRange(n),!o.isCollapsed()))return e.preventDefault(),o.removeText(),!0;e.preventDefault();const s=o.anchor.getNode(),a=s.getTextContent(),l=s.canInsertTextAfter(),c=0===o.anchor.offset&&o.focus.offset===a.length;let u=ap&&t&&!c&&l;if(u&&o.isCollapsed()&&(u=!eb(function(e,t){const n=e.offset;if("element"===e.type)return bx(e.getNode(),t,n);{const r=e.getNode();if(0===n||!t){const e=r.getPreviousSibling();return null===e?bx(r.getParentOrThrow(),t,r.getIndexWithinParent()+0):e}}return null}(o.anchor,!0))),!u){Sx(r,xm,!0);const e=i_();ap&&Iy(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Iy(o))return!0;const s=e.data;null!==i.unprocessedBeforeInputData&&ux(!1,r,i.unprocessedBeforeInputData),o.dirty&&null===i.unprocessedBeforeInputData||!o.isCollapsed()||nb(o.anchor.getNode())||null===n||o.applyDOMRange(n),i.unprocessedBeforeInputData=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"===t||"insertTranspose"===t){if("\n"===s)e.preventDefault(),Sx(r,Sm,!1);else if(s===_p)e.preventDefault(),Sx(r,wm,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&mv(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Sx(r,Em,s),Sv(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Sx(r,Em,e),Sv((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const n=r._compositionKey;Wb(null),t||Sx(r,Em,e),Rv(n);break}case"insertLineBreak":Wb(null),Sx(r,Sm,!1);break;case"insertParagraph":Wb(null),i.isInsertLineBreak&&!rp?(i.isInsertLineBreak=!1,Sx(r,Sm,!1)):Sx(r,wm,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Sx(r,km,e);break;case"deleteByComposition":(function(e,t){return e!==t||Q_(e)||Q_(t)||!zb(e)||!zb(t)})(c,u)&&Sx(r,Cm,e);break;case"deleteByDrag":Cx(Yv),Sx(r,Cm,e);break;case"deleteByCut":Sx(r,Cm,e);break;case"deleteContent":Sx(r,xm,!1);break;case"deleteWordBackward":Sx(r,Am,!0);break;case"deleteWordForward":Sx(r,Am,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Sx(r,Nm,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Sx(r,Nm,!1);break;case"formatStrikeThrough":Sx(r,Tm,"strikethrough");break;case"formatBold":Sx(r,Tm,"bold");break;case"formatItalic":Sx(r,Tm,"italic");break;case"formatUnderline":Sx(r,Tm,"underline");break;case"historyUndo":Sx(r,Dm,void 0);break;case"historyRedo":Sx(r,Im,void 0)}return!0}function Av(e){const t=F_(),n=t._inputState,r=i_(),i=e.data,o=xv(e);let s=!1;if(null!=i&&Iy(r)){const a=zx(Tx(t)),l=null!==a?Kx(a,t._rootElement):null,c="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&!t.isComposing();c&&(n.hadOrphanedCompositionEvents=!0);const u=r.anchor.getNode(),d="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&t.isComposing()&&xy(u)&&jb(u);if(!c&&!d&&mv(r,o,i,e.timeStamp,!1,l)){if(s=!0,"ending-firefox"===n.compositionPhase){const e=Dv(t,i);if(n.compositionPhase="idle",e)return Cx(ey),ix(),!0}const o=r.anchor.getNode();if(null===a||null===l)return!0;const c=r.isBackward(),u=c?r.anchor.offset:r.focus.offset,d=c?r.focus.offset:r.anchor.offset;np&&!r.isCollapsed()&&xy(o)&&null!==l.anchorNode&&o.getTextContent().slice(0,u)+i+o.getTextContent().slice(u+d)===cx(l.anchorNode)||Sx(t,Em,i);const f=i.length;tp&&f>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),ap&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Wb(null))}}return s||(ux(!1,t,null!==i?i:void 0),"ending-firefox"===n.compositionPhase&&(Dv(t,i||void 0),Cx(ey),n.compositionPhase="idle")),ix(),!0}function Nv(e){const t=F_(),n=t._inputState,r=i_();if(Iy(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(Wb(i.key),Cx(Zv),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===i.type||!r.isCollapsed()||!ap&&(o.getFormat()!==r.format||xy(o)&&o.getStyle()!==r.style)||xy(o)&&(jb(o)||0===i.offset&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){Sx(t,Em,bp);const e=i_();Iy(e)&&Wb(e.anchor.key)}}return!0}function Tv(e){const t=F_();return t._inputState.compositionPhase="idle",Dv(t,e.data),Cx(ey),!0}function Rv(e){if(null===e)return;const t=Jb(e);if(!xy(t)||"text"===t.getType()||jb(t)||!t.isAttached())return;const n=i_(),r=Iy(n)&&n.anchor.key===e?n.anchor.offset:null,i=by(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),null!==r){const e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function Dv(e,t){const n=e._compositionKey;if(Wb(null),null!==n&&null!=t){if(""===t){const t=Jb(n),r=e.getElementByKey(n),i=null!==r&&xy(t)?lS(t,r,e):null;if(null!==i&&null!==i.nodeValue&&xy(t)){const n=zx(Tx(e)),r=n&&Kx(n,e._rootElement);let o=null,s=null;null!==r&&r.anchorNode===i&&(o=r.anchorOffset,s=r.focusOffset),dx(t,i.nodeValue,o,s,!0)}return Rv(n),!1}if("\n"===t[t.length-1]){const t=i_();if(Iy(t)||Oy(t)){if(Iy(t)){const e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return Sx(e,Um,null),Rv(n),!1}}const r=Jb(n);if(null!==r&&xy(r)&&jb(r)){r.markDirty();const e=i_(),i=r.getTextContentSize(),o=Iy(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(o,o).insertText(t),!0}}return ux(!0,e,t),Rv(n),!1}function Iv(e){const t=F_(),n=t._inputState;if(null==e.key)return!0;if("ending-safari"===n.compositionPhase){const r=vx(e);if(r&&H_(t,()=>{Dv(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if(function(e){return px(e,"ArrowRight",{shiftKey:"any"})}(e))Sx(t,Om,e);else if(function(e){return px(e,"ArrowRight",{...gx,shiftKey:"any"})}(e))Sx(t,Pm,e);else if(function(e){return px(e,"ArrowLeft",{shiftKey:"any"})}(e))Sx(t,Mm,e);else if(function(e){return px(e,"ArrowLeft",{...gx,shiftKey:"any"})}(e))Sx(t,Lm,e);else if(function(e){return px(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))Sx(t,zm,e);else if(function(e){return px(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))Sx(t,jm,e);else if(function(e){return px(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,Sx(t,Um,e);else if(function(e){return" "===e.key}(e))Sx(t,Bm,e);else if(function(e){return ep&&px(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,Sx(t,Sm,!0);else if(function(e){return px(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,Sx(t,Um,e);else if(function(e){return px(e,"Backspace",{shiftKey:"any"})||ep&&px(e,"h",{ctrlKey:!0})}(e))vx(e)?Sx(t,$m,e)&&Ev(n):(e.preventDefault(),Sx(t,xm,!0));else if(function(e){return"Escape"===e.key}(e))Sx(t,qm,e);else if(function(e){return px(e,"Delete",{})||ep&&px(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),Sx(t,xm,!1)):Sx(t,Gm,e);else if(function(e){return px(e,"Backspace",mx)}(e))e.preventDefault(),Sx(t,Am,!0);else if(function(e){return px(e,"Delete",mx)}(e))e.preventDefault(),Sx(t,Am,!1);else if(function(e){return ep&&px(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),Sx(t,Nm,!0);else if(function(e){return ep&&(px(e,"Delete",{metaKey:!0})||px(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),Sx(t,Nm,!1);else if(function(e){return px(e,"b",gx)}(e))e.preventDefault(),Sx(t,Tm,"bold");else if(function(e){return px(e,"u",gx)}(e))e.preventDefault(),Sx(t,Tm,"underline");else if(function(e){return px(e,"i",gx)}(e))e.preventDefault(),Sx(t,Tm,"italic");else if(function(e){return px(e,"Tab",{shiftKey:"any"})}(e))Sx(t,Vm,e);else if(function(e){return px(e,"z",gx)}(e))e.preventDefault(),Sx(t,Dm,void 0);else if(function(e){return ep?px(e,"z",{metaKey:!0,shiftKey:!0}):px(e,"y",{ctrlKey:!0})||px(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),Sx(t,Im,void 0);else{const r=t._editorState._selection;!function(e){return px(e,"a",gx)}(e)?null===r||Iy(r)||(function(e){return px(e,"c",gx)}(e)?(e.preventDefault(),Sx(t,ev,e)):function(e){return px(e,"x",gx)}(e)&&(e.preventDefault(),Sx(t,tv,e))):(e.preventDefault(),Sx(t,nv,e)&&Ev(n))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(cv,e),!0}function Fv(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const Ov=new Map;function Pv(e){const t=function(e){const t=Nx(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=kx(e.target);let r=null,i=null;const o=null!==n?pv.get(n):void 0;if(null!==n){if(void 0!==o){const e=o.editors;let n=o.hasShadowEditor;if(void 0===n){n=!1;for(const t of e)if(null!==t._rootElement&&jx(t._rootElement.getRootNode())){n=!0;break}o.hasShadowEditor=n}if(n){let n=null,o=null;for(const s of e){const e=s._rootElement;if(null===e)continue;const a=Kx(t,e).anchorNode;if(null!==a&&Mb(a)===s){if(jx(e.getRootNode())){r=s,i=a;break}null===n&&(n=s,o=a)}}null===r&&null!==n&&(r=n,i=o)}else{const e=t.anchorNode;null===e||Qx(e)&&null!==e.shadowRoot||(r=Mb(e),null!==r&&(i=e))}}if(null===r){const e=Hx(n);r=null!==e?Mb(e):null}}if(null===r)return;if(r._inputState.isSelectionChangeFromMouseDown){if(void 0!==o)for(const e of o.editors)e._inputState.isSelectionChangeFromMouseDown=!1;H_(r,()=>{const n=o_(),o=i??Kx(t,r._rootElement).anchorNode;(Qx(o)||Ub(o))&&rx(r_(n,t,r,e))})}const s=ax(r),a=s[s.length-1],l=a._key,c=Ov.get(l),u=c||a;u!==r&&yv(t,u,!1),yv(t,r,!0),r!==a?Ov.set(l,r):c&&Ov.delete(l)}function Mv(e){e._lexicalHandled=!0}function Lv(e){return!0===e._lexicalHandled}function zv(e){const t=hv.get(e);if(void 0===t)return;const n=pv.get(t);if(void 0===n)return;hv.delete(e);const r=Lb(e);Pb(r)?(function(e){if(null!==e._parentEditor){const t=ax(e),n=t[t.length-1]._key;Ov.get(n)===e&&Ov.delete(n)}else Ov.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Xh(198);const i=Fv(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function jv(e,t,n){R_();const r=e.__key,i=e.getParent();if(null===i)return void(null!==TS(e)&&Xh(367,r,String(TS(e))));const o=function(e){const t=i_();if(!Iy(t)||!Q_(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Ax(i,e)&&n.set(e.__key,0,"element"),Ax(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Iy(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(l_(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(l_(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Oy(o)&&t&&e.isSelected()&&e.selectPrevious();if(Iy(o)&&t&&!s){const t=e.getIndexWithinParent();Vb(e),s_(o,i,t,-1)}else Vb(e);n||Ix(i)||i.canBeEmpty()||!i.isEmpty()||jv(i,t),t&&o&&nb(i)&&i.isEmpty()&&i.selectEnd()}const Uv=Symbol.for("ephemeral");function Bv(e){return e[Uv]||!1}const $v={configurable:!0,enumerable:!1,value:void 0,writable:!0};class qv{__type;__key;__parent;__prev;__next;__state;[vg];static getType(){const{ownNodeType:e}=bS(this);return void 0===e&&Xh(64,this.name),e}static clone(e){Xh(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||kS(this.constructor);return Object.assign(t,{extends:n}),"string"==typeof e&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",$v),Object.defineProperty(this,vg,$v),Gb(this,e)}getType(){return this.__type}isInline(){Xh(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Jb(e);if(null===t)break;e=null!==t.__parent?t.__parent:TS(t)}return!1}isSelected(e){const t=e||i_();if(null==t)return!1;const n=t.getNodes().some(e=>e.__key===this.__key);if(xy(this))return n;if(Iy(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(eb(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Jb(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Xh(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Ix(t)||null!==TS(e))return Q_(e)||e===this&&eb(e)||Xh(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Xh(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Jb(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Jb(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=Q_(this)?this:this.getParent(),n=Q_(e)?e:e.getParent(),r=t&&n?Sw(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=Sw(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===_w(t):("same"!==t.type&&"ancestor"!==t.type&&Xh(279),!1)))}isParentOf(e){return Ax(e,this)}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const o=i.__key;if(r.has(o)||(r.add(o),n.push(i)),i===e)break;const s=Q_(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==s){i=s;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&Xh(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=F_()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(Bv(this))return this;const e=Jb(this.__key);return null===e&&Xh(113),e}getWritable(){if(Bv(this))return this;R_();const e=I_(),t=F_(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,s=i_();if(null!==s&&s.setCachedNodes(null),o.has(r))return Kb(i),i;const a=fS(i);return o.add(r),Kb(a),n.set(r,a),a}getTextContent(){return US(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Xh(70)}updateDOM(e,t,n){Xh(71)}getDOMSlot(e){return new Dp(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){Xh(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const o of sg(n).flatKeys)o in t&&(void 0!==i&&i!==r||(i={...r}),i[o]=t[o]);return(n.__state||i)&&og(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){jv(this,!0,e)}replace(e,t){R_();let n=i_();null!==n&&(n=n.clone()),Px(this,e);const r=this.getLatest(),i=this.__key,o=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size,c=s.getParent(),u=null!==c?s.getIndexWithinParent():-1;Vb(s),null!==c&&Iy(n)&&s_(n,c,u,-1);const d=r.getPreviousSibling(),f=r.getNextSibling(),h=r.__prev,p=r.__next,g=r.__parent;jv(r,!1,!0),null===d?a.__first=o:d.getWritable().__next=o,s.__prev=h,null===f?a.__last=o:f.getWritable().__prev=o,s.__next=p,s.__parent=g,a.__size=l;let m=0;t&&(Q_(this)&&Q_(s)||Xh(139),m=s.getChildrenSize(),s.splice(m,0,this.getChildren()));const v=FS(this);if(v.length>0){AS(this)&&AS(s)||Xh(368,this.__key,s.__key);for(const e of v){const t=OS(this,e);null!==t&&(GS(this,e),qS(s,e,t))}}if(Iy(n)){rx(n);const e=n.anchor,r=n.focus;e.key===i&&(t&&"element"===e.type?e.set(s.__key,m+e.offset,"element"):Ty(e,s)),r.key===i&&(t&&"element"===r.type?r.set(s.__key,m+r.offset,"element"):Ty(r,s))}return Hb()===i&&Wb(o),s}insertAfter(e,t=!0){R_(),Px(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.getParent(),o=i_();let s=!1,a=!1;if(null!==i){const n=e.getIndexWithinParent();if(Iy(o)){const e=i.__key,t=o.anchor,r=o.focus;s="element"===t.type&&t.key===e&&t.offset===n+1,a="element"===r.type&&r.key===e&&r.offset===n+1}Vb(r),t&&Iy(o)&&s_(o,i,n,-1)}else Vb(r);const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Iy(o)){const e=this.getIndexWithinParent();s_(o,c,e+1);const t=c.__key;s&&o.anchor.set(t,e+2,"element"),a&&o.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){R_(),Px(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.__key,o=i_(),s=r.getParent(),a=null!==s?r.getIndexWithinParent():-1;Vb(r),null!==s&&t&&Iy(o)&&s_(o,s,a,-1);const l=this.getPreviousSibling(),c=this.getParentOrThrow().getWritable(),u=n.__prev,d=this.getIndexWithinParent();return null===l?c.__first=i:l.getWritable().__next=i,c.__size++,n.__prev=i,r.__prev=u,r.__next=n.__key,r.__parent=n.__parent,t&&Iy(o)&&s_(o,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return vb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){R_();const n=RS(this);if(null!==n)return n.selectPrevious(e,t);const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(null===r)return i.select(0,0);if(Q_(r))return r.select();if(!xy(r)){const e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){R_();const n=RS(this);if(null!==n)return n.selectNext(e,t);const r=this.getNextSibling(),i=this.getParentOrThrow();if(null===r)return i.select();if(Q_(r))return r.select(0,0);if(!xy(r)){const e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function Gv(e){return e instanceof qv}const Vv="historic",Kv="history-push",Wv="history-merge",Hv="paste",Jv="collaboration",Xv="skip-scroll-into-view",Qv="skip-dom-selection",Yv="skip-selection-focus",Zv="composition-start",ey="composition-end";function ty(e){const t={};if(!e)return t;let n="",r="",i=null,o=!1,s=!1,a=!1,l=0;const c=e.length;let u=-1;for(let h=0;h<c;h++){const c=e[h];if(o)"*"===c&&"/"===e[h+1]&&(o=!1,h++);else if(s)-1===u&&(u=h),s=!1;else if(null===i)if("/"!==c||"*"!==e[h+1])if('"'!==c&&"'"!==c)if("("!==c)if(")"!==c)if(a||":"!==c||0!==l){if(";"===c&&0===l){-1!==u&&(a?r+=e.slice(u,h):n+=e.slice(u,h),u=-1);const i=n.trim(),o=r.trim();""!==i&&""!==o&&(t[i]=o),n="",r="",a=!1;continue}-1===u&&(u=h)}else-1!==u&&(n+=e.slice(u,h),u=-1),a=!0;else-1===u&&(u=h),l=Math.max(0,l-1);else-1===u&&(u=h),l++;else-1===u&&(u=h),i=c;else-1!==u&&(a?r+=e.slice(u,h):n+=e.slice(u,h),u=-1),o=!0,h++;else-1===u&&(u=h),"\\"===c?s=!0:c===i&&(i=null)}-1!==u&&(a?r+=e.slice(u,c):n+=e.slice(u,c));const d=n.trim(),f=r.trim();return""!==d&&""!==f&&(t[d]=f),t}function ny(e,t,n){const r=n.trimEnd(),i=r.length-10;i>=0&&"!important"===r.slice(i).toLowerCase()?e.setProperty(t,r.slice(0,i).trim(),"important"):e.setProperty(t,n,"")}function ry(e,t,n=""){if(t===n)return;const r=ty(n),i=ty(t);for(const o in i)delete r[o],ny(e,o,i[o]);for(const o in r)e.removeProperty(o)}function iy(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function oy(e,t){return 1&t?"strong":2&t?"em":"span"}function sy(e,t,n,r,i){const o=r.classList;let s=yx(i,"base");void 0!==s&&o.add(...s),s=yx(i,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;void 0!==s&&(8&n&&4&n?(a=!0,l||o.add(...s)):l&&o.remove(...s));for(const c in xp){const e=xp[c];if(s=yx(i,c),void 0!==s)if(n&e){if(a&&("underline"===c||"strikethrough"===c)){t&e&&o.remove(...s);continue}(0===(t&e)||l&&"underline"===c||"strikethrough"===c)&&o.add(...s)}else t&e&&o.remove(...s)}}function ay(e,t,n){const r=n.isComposing(),i=e+(r?yp:""),o=oS(),s=sS(o).$getDOMSlot(n,t,o),a=s.getFirstChild();if(null===a||a.nodeType!==Node.TEXT_NODE)return void s.insertChild(Gx().createTextNode(i));const l=a,c=l.nodeValue;if(c!==i)if(r||tp){const[e,t,n]=function(e,t){const n=e.length,r=t.length;let i=0,o=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;o+i<n&&o+i<r&&e[n-o-1]===t[r-o-1];)o++;return[i,n-i-o,t.slice(i,r-o)]}(c,i);0!==t&&l.deleteData(e,t),l.insertData(e,n)}else l.nodeValue=i}function ly(e,t,n,r,i,o){ay(i,e,t);const s=o.theme.text;void 0!==s&&sy(0,0,r,e,s)}function cy(e,t){const n=Gx().createElement(t);return n.appendChild(e),n}function uy(e){return null!=e&&!0===e.__isInlineFormattable}class dy extends qv{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(e){return new dy(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Cp[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Hb()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=xp[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return $b(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=iy(0,n),i=oy(0,n),o=null===r?i:r,s=Gx().createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=Gx().createElement(i),s.appendChild(a)),ly(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&ry(s.style,l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=iy(0,i),a=iy(0,o),l=oy(0,i),c=oy(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&Xh(48);const i=Gx().createElement(c);return ly(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&Xh(49)),ay(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&sy(0,i,o,u,d);const f=e.__style,h=this.__style;return f!==h&&ry(t.style,h,f),!1}static importDOM(){return{"#text":()=>({conversion:my,priority:0}),b:()=>({conversion:hy,priority:0}),code:()=>({conversion:_y,priority:0}),em:()=>({conversion:_y,priority:0}),i:()=>({conversion:_y,priority:0}),mark:()=>({conversion:_y,priority:0}),s:()=>({conversion:_y,priority:0}),span:()=>({conversion:fy,priority:0}),strong:()=>({conversion:_y,priority:0}),sub:()=>({conversion:_y,priority:0}),sup:()=>({conversion:_y,priority:0}),u:()=>({conversion:_y,priority:0})}}static importJSON(e){return by().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Qx(t)||Xh(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=cy(t,"b")),this.hasFormat("italic")&&(t=cy(t,"i")),this.hasFormat("strikethrough")&&(t=cy(t,"s")),this.hasFormat("underline")&&(t=cy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?xp[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Sp[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=$b(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=kp[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){R_();let n=e,r=t;const i=i_(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const e=o.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Iy(i))return e_(s,n,s,r,"text","text");{const e=Hb();e!==i.anchor.key&&e!==i.focus.key||Wb(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=i_();if(r&&Iy(l)){const t=e+s;l.setTextNodeRange(i,t,i,t)}const c=o.slice(0,a)+n+o.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){R_();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Hb(),o=n.length;e.sort((e,t)=>e-t),e.push(o);const s=[],a=e.length;for(let w=0,E=0;w<o&&E<=a;E++){const t=e[E];t>w&&(s.push(n.slice(w,t)),w=t)}const l=s.length;if(1===l)return[t];const c=s[0],u=t.getParent();let d;const f=t.getFormat(),h=t.getStyle(),p=t.__detail;let g=!1,m=null,v=null;const y=i_();if(Iy(y)){const[e,t]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===e.type&&e.key===r&&(m=e),"text"===t.type&&t.key===r&&(v=t)}t.isSegmented()?(d=by(c),d.__format=f,d.__style=h,d.__detail=p,d.__state=dg(t,d),g=!0):d=t.setTextContent(c);const _=[d];for(let w=1;w<l;w++){const e=by(s[w]);e.__format=f,e.__style=h,e.__detail=p,e.__state=dg(t,e);const n=e.__key;i===r&&Wb(n),_.push(e)}const b=m?m.offset:null,x=v?v.offset:null;let S=0;for(const w of _){if(!m&&!v)break;const e=S+w.getTextContentSize();if(null!==m&&null!==b&&b<=e&&b>=S&&(m.set(w.getKey(),b-S,"text"),b<e&&(m=null)),null!==v&&null!==x&&x<=e&&x>=S){v.set(w.getKey(),x-S,"text");break}S=e}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Kb(t),null!==n&&Kb(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,_),this.remove()):e.splice(t,1,_),Iy(y)&&s_(y,u,t,l-1)}return _}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Xh(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;Hb()===r&&Wb(n);const s=i_();if(Iy(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&c_(i,t,n,e,o),null!==a&&a.key===r&&c_(a,t,n,e,o)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function fy(e){return{forChild:Sy(e.style),node:null}}function hy(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Sy(t.style,n?void 0:"bold"),node:null}}const py=new WeakMap;function gy(e){if(!Qx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function my(e){const t=e;null===e.parentElement&&Xh(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=py.get(n))&&!gy(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let o=0;o<r.length;o++)py.set(r[o],i);return i}(t))return{node:p_(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=vy(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=vy(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:by(n)}}function vy(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,Qx(n)){const e=n.style.display;if(""===e&&!tS(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(Ub(n))return n;if("BR"===n.nodeName)return null}}const yy={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function _y(e){const t=yy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Sy(e.style,t),node:null}}function by(e=""){return Ox(new dy(e))}function xy(e){return e instanceof dy}function Sy(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>xy(e)||uy(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),o&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class wy extends dy{static getType(){return"tab"}static clone(e){return new wy(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=yx(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Ey().updateFromJSON(e)}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||Xh(286),this}setDetail(e){return 2!==e&&Xh(127),this}setMode(e){return"normal"!==e&&Xh(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ey(){return Ox(new wy)}function ky(e){return e instanceof wy}class Cy{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:yw(Iw(ww(this,"next")),Iw(ww(e,"next")))<0}getNode(){const e=Jb(this.key);return null===e&&Xh(20),e}set(e,t,n,r){const i=this._selection,o=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,T_()||(Hb()===o&&Wb(e),null!==i&&(i.setCachedNodes(null),Iy(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function Ay(e,t,n){return new Cy(e,t,n)}function Ny(e,t){let n=t.__key,r=e.offset,i="element";if(xy(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Q_(t)){const e=t.getNextSibling();if(xy(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Ty(e,t){if(Q_(t)){const n=t.getLastDescendant();Q_(n)||xy(n)?Ny(e,n):Ny(e,t)}else Ny(e,t)}class Ry{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Oy(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Ry(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes().filter(e=>null===TS(e)),n=t.length;if(0===n)return;const r=t[n-1];let i;if(xy(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let o=0;o<n;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const r of t){const e=Jb(r);null!==e&&n.push(e)}return T_()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){const e=this.getNodes().filter(e=>null===TS(e));if((i_()||o_())===this&&e[0]){const t=sw(e[0],"next");kw(mw(t,t))}for(const t of e)t.remove();Dy()}}function Dy(){const e=nx();if(e.isEmpty()){const t=vb();e.append(t),t.select()}}function Iy(e){return e instanceof Fy}class Fy{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Iy(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=function(e){const t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);const i=new Set,o=new Set;for(const s of e)if(nw(s)){const{origin:e}=s;0===t.length?i.add(e):(o.add(e),t.push(e))}else{const{origin:e}=s;Q_(e)&&o.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),tw(e.focus)&&Q_(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let s=uw(e.focus.origin,"previous");nw(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(t[t.length-1]);s=dw(s))i.delete(s.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!Q_(e)||o.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=Iw(e.anchor),r=Iw(e.anchor.getFlipped()),i=e=>ew(e)?e.origin:e.getNodeAtCaret(),o=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(o)}return t}(Pw(Aw(this),"next"));return T_()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text"),this}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,a]=zy(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Q_(d)&&!d.isInline()){c||(l+="\n");let e="";for(const t of FS(d)){const n=OS(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(l+=e,c=!1):c=!d.isEmpty()}else if(c=!1,xy(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<a?e.slice(s,a):e.slice(a,s)):e=o?e.slice(s):e.slice(a):d===n&&(e=o?e.slice(0,a):e.slice(0,s)),l+=e}else!eb(d)&&!db(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=F_(),n=t.getEditorState()._selection,r=Yy(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,o,s]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),s&&(this.dirty=!0),gg(this)}clone(){const e=this.anchor,t=this.focus;return new Fy(Ay(e.key,e.offset,e.type),Ay(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=$b(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=xp[e];return 0!==(this.format&t)}insertRawText(e){this.insertNodes(p_(e))}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let o=t,s=n;!this.isCollapsed()&&n.isBefore(t)&&(o=n,s=t),"element"===o.type&&function(e,t,n,r){const i=e.getNode(),o=i.getChildAtIndex(e.offset),s=by();if(s.setFormat(n),s.setStyle(r),yb(o))o.splice(0,0,[s]);else if(null!==o){const e=Ix(i)?vb().append(s):s;o.insertBefore(e)}else if(Ix(i)){const e=i.getLastChild();Q_(e)&&!e.isInline()&&e.isEmpty()?e.append(s):i.append(vb().append(s))}else i.append(s);e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(o,s,r,i),"element"===s.type&&Ew(s,Iw(ww(s,"next")));const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];xy(d)||Xh(26);const f=d.getTextContent().length,h=d.getParentOrThrow();let p=c[u-1];if(1===u&&"element"===s.type&&(l=f,s.set(o.key,l,"text")),this.isCollapsed()&&a===f&&(jb(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&null===d.getNextSibling())){const t=d.getNextSibling();let n;if(xy(t)&&t.canInsertTextBefore()&&!jb(t)?n=t:(n=by(),n.setFormat(r),n.setStyle(i),h.canInsertTextAfter()?d.insertAfter(n):h.insertAfter(n)),n.select(0,0),d=n,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(jb(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&null===d.getPreviousSibling())){const t=d.getPreviousSibling();let n;if(!xy(t)||jb(t)?(n=by(),n.setFormat(r),h.canInsertTextBefore()?d.insertBefore(n):h.insertBefore(n)):n=t,n.select(),d=n,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==f)if(null!==Hb())d=d.setMode("normal").setFormat(r).setStyle(i);else{const e=by(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||Q_(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Hy(this.anchor,this.focus),void this.insertText(e)}if(1===u){if(zb(d)){const t=by(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(ky(d)){const t=by(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=by(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}d.setFormat(r),d.setStyle(i)}const o=l-a;d=d.spliceText(a,o,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{const t=new Set([...d.getParentKeys(),...p.getParentKeys()]),n=Q_(d)?d:d.getParentOrThrow();let r=Q_(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===s.type&&(0!==l||""===p.getTextContent())||"element"===s.type&&p.getIndexWithinParent()<l)if(xy(p)&&!zb(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=by(p.getTextContent());p.replace(e),p=e}nb(s.getNode())||"text"!==s.type||(xy(p)||Xh(395),p=p.spliceText(0,l,"")),t.add(p.__key)}else{const e=p.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?p.remove():e.remove()}else t.add(p.__key);const o=r.getChildren(),h=new Set(c),g=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=o.length-1;e>=0;e--){const t=o[e];if(t.is(d)||Q_(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(i)?g||m.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(zb(d))if(a===f)d.select();else{const t=by(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){const e=i_()===this;Cw(this,Dw(Aw(this))),e&&i_()!==this&&rx(this)}formatText(e,t=null){My(this,e,t)}insertNodes(e){if(0===e.length)return;this.isCollapsed()||this.removeText();const t=this.anchor.getNode();if("element"===this.anchor.type&&Q_(t)&&null!==TS(t)){let n=t.isShadowRoot()?t.getFirstChild()??t.append(vb()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&null!==n&&!Q_(n)){const e=vb();n.insertBefore(e),n=e}if(null!==n){n.selectStart();const t=i_();return Iy(t)||Xh(369),t.insertNodes(e)}}if("element"===this.anchor.type&&Ix(t)){const n=__(e),r=n.getLastDescendant();return t.splice(this.anchor.offset,0,n.getChildren()),void(null!==r&&r.selectEnd())}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=wS(n,iS);const i=e[e.length-1];if(Q_(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=m_(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(Q_(e)||eb(e))&&!e.isInline())){Q_(r)||Xh(211,n.constructor.name,n.getType());const t=m_(this);return r.splice(t,0,e),void i.selectEnd()}if(Q_(r)&&null!==TS(r)){const t=m_(this),n=g_(e);r.splice(t,0,n);const i=n[n.length-1];return void(void 0!==i?i.selectEnd():r.select(t,t))}if(null===r){const t=__(e),n=t.getLastDescendant();let r=ww(this.anchor,"next");for(const e of t.getChildren())r=Uw(e,r);return void(null!==n&&n.selectEnd())}if(Q_(r)&&!r.isParentRequired()&&!Ix(r.getParentOrThrow())){const t=m_(this),n=g_(e);r.splice(t,0,n);const i=n[n.length-1];return void(void 0!==i?i.selectEnd():r.select(t,t))}const o=__(e),s=o.getLastDescendant(),a=o.getChildren(),l=Q_(r)&&r.isEmpty()?null:this.insertParagraph();l&&!r.isAttached()&&(n=this.anchor.getNode(),r=wS(n,iS));const c=a[a.length-1];let u=a[0];var d;Q_(d=u)&&iS(d)&&!d.isEmpty()&&Q_(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(Q_(r)||Xh(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(null===r&&Xh(212,n.constructor.name,n.getType()),function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const i=[t];for(;r!==n;)r.getNextSibling()||Xh(140),r=r.getNextSibling(),i.push(r);let o=e;for(const s of i)o=o.insertAfter(s)}(r,u));const f=wS(s,iS);l&&Q_(f)&&(l.canMergeWhenEmpty()||iS(c))&&(f.append(...l.getChildren()),l.remove()),Q_(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=Q_(r)?r.getLastChild():null;db(h)&&f!==r&&h.remove()}insertParagraph(){const e=this.anchor.getNode();if("element"===this.anchor.type&&Ix(e)){const t=vb();return e.splice(this.anchor.offset,0,[t]),t.select(),t}const t=m_(this),n=wS(this.anchor.getNode(),iS);if(null!==n&&null!==TS(n))return null;Q_(n)||Xh(213);const r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],o=n.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=ub();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=[...this.getNodes()],t=e.length;let n=e[0],r=e[t-1];const[i,o]=zy(this),s=this.isBackward(),[a,l]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=s?[o,i]:[i,o];if(0===t)return[];if(1===t){if(xy(n)&&!this.isCollapsed()){const e=n.splitText(c,u),t=0===c?e[0]:e[1];return t?(a.set(t.getKey(),0,"text"),l.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(xy(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),xy(r)){const t=r.getTextContent().length;0===u?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,l.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(b_(this,e,t,n))return;const r="move"===e,i=F_(),o=zx(Tx(i));if(!o)return;const s=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();null===a||null===s||!Q_(l)||l.isInline()||l.canBeEmpty()||Lx(s,i,a);const c=wx(i,this.focus.key);let u=c;if("text"===this.focus.type&&(u=xy(l)?lS(l,c,i):null),this.dirty){const e=wx(i,this.anchor.key);let t=e;if("text"===this.anchor.type){const n=this.anchor.getNode();t=xy(n)?lS(n,e,i):null}t&&u&&u_(o,t,this.anchor.offset,u,this.focus.offset)}if("character"===n&&xy(l)&&l.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===l.getTextContentSize())){const e=sw(l,t?"previous":"next").getNodeAtCaret();if(xy(e)){if(!r){const n=e.getTextContentSize();return t?this.focus.set(e.__key,n-1,"text"):this.focus.set(e.__key,1,"text"),void(this.dirty=!0)}{const n=i.getElementByKey(e.getKey()),r=n?lS(e,n,i):null;if(r){const e=t?r.length:0;u_(o,r,e,r,e)}}}}if(By(o,e,t?"backward":"forward",n),o.rangeCount>0){const e=Vx(o,i._rootElement),n=e||o.getRangeAt(0),s=this.anchor.getNode(),a=nb(s)?s:Rx(s);this.applyDOMRange(n),this.dirty=!0,r||($y(this,t,a),(e?"backward"!==o.direction:o.anchorNode===n.startContainer&&o.anchorOffset===n.startOffset)||Uy(this))}"lineboundary"===n&&b_(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Q_(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Q_(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=pw(ww(t,e?"previous":"next"));if(r.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(const t of r.iterNodeCarets("shadowRoot"))if(nw(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(Q_(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=Iw(t);Cw(this,mw(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(tw(t)){if(Q_(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(eb(t.origin)){if(t.origin.isIsolated());else if(FS(t.origin).length>0){if(Q_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=n_();e.add(t.origin.getKey()),rx(e)}}else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Q_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=n_();e.add(t.origin.getKey()),rx(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;if(FS(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Cw(this,mw(!t.origin.isEmpty()&&n.isEmpty()?Nw(sw(n,t.direction)):r.anchor,t)),this.removeText())}for(let n=t.getNode();null!==n;){if(null!==TS(n))return;if(Q_(n)&&n.isShadowRoot())break;n=n.getParent()}}const i=this.focus;if(qy(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&jy(this,t.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){const t=i.offset,o=r.getTextContentSize();if(r.is(n)||e&&t!==o||!e&&0!==t)return void Vy(r,e,t)}else if(null!==n&&n.isSegmented()){const i=t.offset,o=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==o)return void Vy(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,a=s?e:o,l=s?o:e,c=l-1;a!==c&&function(e){return!(sx(e)||Gy(e))}(i.getTextContent().slice(a,l))&&(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&nb(e.getParent())&&null===e.getPreviousSibling()&&jy(this,e),Dy()}}deleteLine(e){const t=Jy(this.anchor);if(null!==t&&eb(RS(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&qy(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):wS(this.anchor.getNode(),iS)!==wS(this.focus.getNode(),iS)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;qy(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){const e=this._cachedIsBackward;if(null!==e)return e;const t=this.focus.isBefore(this.anchor);return T_()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function Oy(e){return e instanceof Ry}function Py(e,t){if(Oy(e)){for(const n of e.getNodes())uy(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Wb(null);const n=[];for(const v of e.getNodes())xy(v)?n.push(v):Q_(v)?v.setTextFormat(t(v.getTextFormat())):uy(v)&&v.setFormat(t(v.getFormat()));const r=n.length;if(0===r)return e.setFormat(t(e.format)),void Wb(null);const i=e.anchor,o=e.focus,s=e.isBackward(),a=s?o:i,l=s?i:o;let c=0,u=n[0],d="element"===a.type?0:a.offset;if("text"===a.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const f=r-1;let h=n[f];const p="text"===l.type?l.offset:h.getTextContentSize();if(u.is(h)){if(d===p)return;const n=t(u.getFormat());if(jb(u)||0===d&&p===u.getTextContentSize())u.setFormat(n);else{const e=u.splitText(d,p),t=0===d?e[0]:e[1];t.setFormat(n),"text"===a.type&&a.set(t.__key,0,"text"),"text"===l.type&&l.set(t.__key,p-d,"text")}return void(e.format=n)}0===d||jb(u)||([,u]=u.splitText(d),d=0);const g=t(u.getFormat());u.setFormat(g);const m=t(h.getFormat());p>0&&(p===h.getTextContentSize()||jb(h)||([h]=h.splitText(p)),h.setFormat(m));for(let v=c+1;v<f;v++){const e=n[v];e.setFormat(t(e.getFormat()))}"text"===a.type&&a.set(u.__key,d,"text"),"text"===l.type&&l.set(h.__key,p,"text"),e.format=g|m}function My(e,t,n=null){const r=null===n&&Iy(e)?$b(e.format,t,null):n;Py(e,e=>$b(e,t,r))}function Ly(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zy(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Ly(n),Ly(r)]}function jy(e,t){for(let n=t;n;n=n.getParent()){if(Q_(n)){if(n.collapseAtStart(e))return!0;if(Ix(n))break}if(n.getPreviousSibling())break}return!1}function Uy(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,o,!0)}function By(e,t,n,r){e.modify(t,n,r)}function $y(e,t,n){const r=e.getNodes(),i=r.filter(e=>Ax(e,n));if(0===i.length||i.length===r.length)return!1;const o=t?i[0]:i[i.length-1],s=Q_(o)?o:o.getParentOrThrow();return t?s.selectStart():s.selectEnd(),!0}function qy(e,t,n){if(b_(e,"extend",t,n))return;const r=F_(),i=zx(Tx(r));if(!i||"function"!=typeof i.modify)return;const o=r._blockCursorElement,s=r._rootElement,a=e.anchor,l=e.focus.getNode();null===s||null===o||!Q_(l)||l.isInline()||l.canBeEmpty()||Lx(o,r,s);const c=e=>{const t=e.getNode(),n=r.getElementByKey(e.key);return null!==n&&"text"===e.type&&xy(t)?lS(t,n,r):n},u=a.getNode(),d=c(a);if(null===d)return;const f=a.offset,h=e.isCollapsed(),p=e.focus,g=h?d:c(p);if(null===g)return;const m=p.offset;if(u_(i,g,m,g,m),By(i,"move",t?"backward":"forward",n),0===i.rangeCount)return;const v=Vx(i,s)||i.getRangeAt(0),y=v.startContainer,_=v.startOffset;if(h&&"character"===n&&"text"===a.type&&xy(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){const n=sw(u,t?"previous":"next").getNodeAtCaret();if(xy(n)){const r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,"text"),void(e.dirty=!0)}}if(h&&"character"===n&&"text"===a.type){const n=t?0:u.getTextContentSize(),r=y===d?_:f!==n?n:-1;if(r>=0)return void(r!==f&&(e.focus.set(a.key,r,"text"),e.dirty=!0))}const[b,x,S,w]=t?[y,_,d,f]:[d,f,y,_],E=nb(u)?u:Rx(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:w,startContainer:b,startOffset:x}),e.dirty=!0,!$y(e,t,E)&&t&&Uy(e),"lineboundary"===n&&b_(e,"extend",t,n,"decorators")}const Gy=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(Xh){}return()=>!1})();function Vy(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let c=0;c<o;c++){const e=c===o-1;if(a=s,s+=i[c].length,t&&s===n||s>n||e){i.splice(c,1),e&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Ky(e,t,n,r){let i,o=t,s=!1;if(Qx(e)){let a=!1;const l=e.childNodes,c=l.length,u=r._blockCursorElement;o===c&&c>0&&(a=!0,o=c-1),void 0!==Yb(e,r)||vS(e,r)||(s=!0);let d=l[o],f=!1;if(d===u)d=l[o+1],f=!0;else if(null!==u){const n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&o--}if(i=ox(d),xy(i))o=lw(i,a?"next":"previous");else{let l=ox(e);if(null===l)return null;if(Q_(l)){const s=r.getElementByKey(l.getKey());null===s&&Xh(214);const c=aS(l,s,r);[l,o]=c.resolveChildIndex(l,s,e,t),Q_(l)||Xh(215),a&&o>=l.getChildrenSize()&&(o=Math.max(0,l.getChildrenSize()-1));let u=l.getChildAtIndex(o);if(Q_(u)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){const e=a?u.getLastDescendant():u.getFirstDescendant();null===e?l=u:(u=e,l=Q_(u)?u:u.getParentOrThrow()),o=0}xy(u)?(i=u,l=null,o=lw(u,a?"next":"previous")):u!==l&&a&&!f&&(Q_(l)||Xh(216),o=Math.min(l.getChildrenSize(),o+1))}else{const n=RS(l),i=null!==n?n:l,s=i.getIndexWithinParent(),a=r.getElementByKey(l.getKey());let c="after";if(null!==a&&ox(e)===l){const n=aS(l,a,r);n.element!==a?c=n.resolveLeafPosition(a,e,t):0===t&&eb(l)&&(c="before")}o="before"===c?s:s+1,l=i.getParentOrThrow()}if(Q_(l))return[Ay(l.__key,o,"element"),s]}}else i=ox(e);return xy(i)?[Ay(i.__key,lw(i,o,"clamp"),"text"),s]:null}function Wy(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(t){if((n||!t)&&null===r&&Q_(o)&&o.isInline()){const t=o.getPreviousSibling();xy(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else Q_(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):xy(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(t&&Q_(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&Q_(o)&&o.isInline()&&!o.canInsertTextAfter()&&o.getTextContentSize()>1){const t=o.getNextSibling();xy(t)&&e.set(t.__key,0,"text")}}}function Hy(e,t,n){if("text"===e.type&&"text"===t.type){const n=e.isBefore(t),r=e.is(t);Wy(e,n,r),Wy(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Jy(e){const t=Jb(e.key);return null===t?null:DS(t)}function Xy(e,t,n){const r=Jy(e),i=Jy(t);if(r===i||null!==r&&null!==i&&r.is(i))return!1;const o=n(r,i);if(null!==r)return Q_(r)?t.set(r.getKey(),o?r.getChildrenSize():0,"element"):t.set(r.getKey(),o?r.getTextContentSize():0,"text"),!0;const s=RS(i);if(null===s)return!1;const a=s.getParent();if(null===a)return!1;const l=s.getIndexWithinParent();return t.set(a.getKey(),o?l+1:l,"element"),!0}function Qy(e){const t=Xy(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(null!==n&&null!==r){const e=RS(n),t=RS(r);if(null!==e&&e.is(t)){for(const t of IS(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return null===e||null===t||e.isBefore(t)}if(null!==n){const e=RS(n),r=Jb(t.key);return null===e||null===r||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}const i=RS(r),o=Jb(e.key);return null!==i&&null!==o&&!i.is(o)&&!i.isParentOf(o)&&o.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function Yy(e,t,n,r,i,o){if(null===e||null===n||!Ob(i,e,n))return null;const s=Ky(e,t,Iy(o)?o.anchor:null,i);if(null===s)return null;const a=Ky(n,r,Iy(o)?o.focus:null,i);if(null===a)return null;const[l,c]=s,[u,d]=a;if("element"===l.type&&"element"===u.type){const t=ox(e),r=ox(n);if(eb(t)&&eb(r))return null}const f=i._slotsUsed&&Xy(l,u,()=>0!==(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return Hy(l,u),[l,u,c||d||f]}function Zy(e){return Q_(e)&&!e.isInline()}function e_(e,t,n,r,i,o){const s=I_(),a=new Fy(Ay(e,t,i),Ay(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function t_(){const e=Ay("root",0,"element"),t=Ay("root",0,"element");return new Fy(e,t,0,"")}function n_(){return new Ry(new Set)}function r_(e,t,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,a="selectionchange"===s,l=!Bp&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,f;if(Iy(e)&&!l)return e.clone();{if(null===t)return null;const r=Kx(t,n._rootElement);if(c=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(a||void 0===s)&&Iy(e)&&!Ob(n,c,u))return e.clone()}const h=Yy(c,d,u,f,n,e);if(null===h)return null;const[p,g,m]=h;let v=0,y="";if(Iy(e)){const t=e.anchor;if(p.key===t.key)v=e.format,y=e.style;else{const e=p.getNode();xy(e)?(v=e.getFormat(),y=e.getStyle()):Q_(e)&&(v=e.getTextFormat(),y=e.getTextStyle())}}const _=new Fy(p,g,v,y);return m&&(_.dirty=!0),_}function i_(){return I_()._selection}function o_(){return F_()._editorState._selection}function s_(e,t,n,r=1){const i=e.anchor,o=e.focus,s=i.getNode(),a=o.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),o.set(l,n,"element"),a_(e)}}else{const s=e.isBackward(),a=s?o:i,c=a.getNode(),u=s?i:o,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}a_(e)}function a_(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!Q_(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(xy(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}return}if(Q_(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(xy(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(Q_(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(xy(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function l_(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,xy(r)?(s=r.getTextContentSize(),a="text"):Q_(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,xy(i)?a="text":Q_(i)&&(a="element")),null!==o&&null!==a?e.set(o,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function c_(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function u_(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function d_(e,t,n){const r=wx(e,t.getKey());if(Q_(t)){const i=aS(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function f_(e,t,n,r,i,o){const s=o.getRootNode(),a=Bb(s)||jx(s)?Hx(s):null;if(i.has(Jv)&&a!==o||null!==a&&Fb(a,a))return;const l=Kx(r,o);let c;if(!Iy(t))return void(null!==e&&Ob(n,l.anchorNode,l.focusNode)&&r.removeAllRanges());const u=t.anchor,d=t.focus,f=u.getNode(),h=d.getNode(),[p,g]=d_(n,f,u.offset),[m,v]=d_(n,h,d.offset),y=t.format,_=t.style,b=t.isCollapsed();let x=p,S=m,w=!1;if("text"===u.type?(x=xy(f)?lS(f,p,n):null,w=f.getFormat()!==y||f.getStyle()!==_):Iy(e)&&"text"===e.anchor.type&&(w=!0),"text"===d.type&&(S=xy(h)?lS(h,m,n):null),null!==x&&null!==S){if(b&&(null===e||w||Iy(e)&&(e.format!==y||e.style!==_))&&function(e,t,n,r,i,o){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:o}}(n,y,_,g,u.key,performance.now()),("Range"!==r.type||!b)&&l.anchorOffset===g&&l.focusOffset===v&&l.anchorNode===x&&l.focusNode===S){if(null===a||!o.contains(a)){const e=null!==a?Mb(a):null;null!==e&&e!==n||i.has(Yv)||o.focus({preventScroll:!0})}if("element"!==u.type)return}if(u_(r,x,g,S,v),tp&&t.isCollapsed()&&null!==o&&!i.has(Yv)){const e=Wx(o);if(null===e||!o.contains(e)){const e=Hx(o.ownerDocument),t=null!==e?Mb(e):null;null!==t&&t!==n||o.focus({preventScroll:!0})}}if(!i.has(Xv)&&t.isCollapsed()&&null!==o&&o===Wx(o)){const e=Iy(t)&&"element"===t.anchor.type?x.childNodes[g]||null:(void 0===c&&(c=function(e,t){const n=Vx(e,t);if(null!==n){const e=function(e){const t=e.startContainer.ownerDocument;if(null===t)return null;const n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(e){return null}}(n);if(null!==e)return e}return e.rangeCount>0?e.getRangeAt(0):null}(r,o)),c);if(null!==e){let t;if(Ub(e)){const n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=kx(n),i=Nx(r);if(null===r||null===i)return;const o=n.getBoundingClientRect();if(t.bottom<o.top)return;let{top:s,bottom:a}=t,l=0,c=0,u=n;for(;null!==u;){const t=u===r.body;if(t){const t=i.visualViewport;if(t){const e=t.offsetTop;l=e,c=e+t.height}else l=0,c=Tx(e).innerHeight;const n=i.getComputedStyle(r.documentElement),o=parseFloat(n.scrollPaddingTop),s=parseFloat(n.scrollPaddingBottom);isFinite(o)&&(l+=o),isFinite(s)&&(c-=s)}else{const e=u===n?o:u.getBoundingClientRect();l=e.top,c=e.bottom}let d=0;if(s<l?d=-(l-s):a>c&&(d=a-c),0!==d)if(t)i.scrollBy(0,d);else{const e=u.scrollTop;u.scrollTop+=d;const t=u.scrollTop-e;s-=t,a-=t}if(t)break;u=Ex(u)}}(n,t,o)}}!function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0}(n)}}function h_(e,t){for(const n of e.split(/(\r?\n|\t)/))"\n"===n||"\r\n"===n?t.linebreak():"\t"===n?t.tab():""!==n&&t.text(n)}function p_(e){const t=[];return h_(e,{linebreak:()=>t.push(ub()),tab:()=>t.push(Ey()),text:e=>t.push(by(e))}),t}function g_(e){const t=[];for(const n of e)db(n)||(!Q_(n)&&!eb(n)||n.isInline()?t.push(n):Q_(n)&&t.push(...g_(n.getChildren())));return t}function m_(e){let t=e;e.isCollapsed()||t.removeText();const n=i_();Iy(n)&&(t=n),Iy(t)||Xh(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!iS(i)&&null===TS(i);){const e=i;if([i,o]=v_(i,o),e.is(i))break}return o}function v_(e,t){const n=e.getParent();if(!n){const e=vb();return nx().append(e),e.select(),[nx(),0]}if(xy(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Q_(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Fy(Ay(e.__key,t,"element"),Ay(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function y_(e){return db(e)||function(e){return Q_(e)&&e.isInline()||eb(e)&&e.isInline()}(e)||xy(e)||e.isParentRequired()}function __(e){const t=vb();let n=null;for(let r=0;r<e.length;r++){const i=e[r];if(y_(i)){if(null===n){n=i.createParentElementNode(),t.append(n);const o=e[r+1];if(db(i)&&(void 0===o||!y_(o)))continue}n.append(i)}else t.append(i),n=null}return t}function b_(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){const[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}const o=ww(e.focus,n?"previous":"next"),s="lineboundary"===r,a="move"===t;let l=o,c="decorators-and-blocks"===i;if(!Fw(l)){for(const e of l){c=!1;const{origin:t}=e;if(!eb(t)||t.isIsolated()||(l=e,!s||!t.isInline()))break}if(c)for(const e of pw(o).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(nw(e))e.origin.isInline()||(l=e);else{if(Q_(e.origin))continue;eb(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===o)return!1;if(a&&!s&&eb(l.origin)&&l.origin.isKeyboardSelectable()){const e=n_();return e.add(l.origin.getKey()),rx(e),!0}return l=Iw(l),a&&Ew(e.anchor,l),Ew(e.focus,l),c||!s}let x_=null,S_=null,w_=!1,E_=!1,k_=!1;const C_=new Set;let A_=0;const N_={characterData:!0,childList:!0,subtree:!0};function T_(){return w_||null!==x_&&x_._readOnly}function R_(){w_&&Xh(13)}function D_(){A_>99&&Xh(14)}function I_(){return null===x_&&Xh(195,O_()),x_}function F_(){return null===S_&&Xh(337,O_()),S_}function O_(){let e=0;const t=new Set,n=Cb.version;if("undefined"!=typeof window)for(const i of $x(document)){const r=Lb(i);if(Pb(r))e++;else if(r){let e=String(r.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function P_(){return S_}function M_(e,t,n){const r=t.__type,i=Rb(e,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let a=0;a<s&&(o[a](t),t.isAttached());a++);}function L_(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function z_(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const i of r)n.add(i)}function j_(e){return U_(e,F_()._nodes)}function U_(e,t){const n=e.type,r=t.get(n);void 0===r&&Xh(17,n);const i=r.klass;e.type!==i.getType()&&Xh(18,i.name);const o=i.importJSON(e),s=e.children;if(Q_(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const e=U_(s[l],t);o.append(e)}const a=e.$slots;if(a){AS(o)||Xh(379,i.name);for(const e in a)qS(o,e,U_(a[e],t))}return o}function B_(e,t,n){const r=x_,i=w_,o=S_;x_=t,w_=!0,S_=e;try{return n()}finally{x_=r,w_=i,S_=o}}function $_(e,t){const n=k_;k_=!0;try{!function(e,t){const n=e._pendingEditorState,r=e._rootElement,i=e._headless||null===r;if(null===n)return void(!e._updating&&e._deferred.length>0&&V_(e,e._deferred));const o=e._editorState,s=o._selection,a=n._selection,l=0!==e._dirtyType,c=x_,u=w_,d=S_,f=e._updating,h=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==h){S_=e,x_=n,w_=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;h.disconnect(),p=function(e,t,n,r,i,o){Eg="",kg=null,Cg=null,Ag=null,Bg=2===r,Sg=n,xg=n._config,Ug=n._config.dom||Sb,wg=n._nodes,Dg=Sg._listeners.mutation,Ig=i,Fg=o,Og=e._nodeMap,Pg=e,Mg=t._nodeMap,$g=t._readOnly,Lg=zp(n._keyToDOMMap),zg=function(){const e=new Map,t=t=>{for(const n of t){const t=Mg.get(n);if(void 0===t)continue;const r=t.__parent;if(null===r)continue;let i=e.get(r);void 0===i&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Ig.keys()),t(Fg),e}();const s=new Map;return jg=s,lm("root",null),Sg=void 0,wg=void 0,Ig=void 0,Fg=void 0,Og=void 0,Pg=void 0,Mg=void 0,xg=void 0,Lg=void 0,zg=void 0,jg=void 0,Ug=Sb,s}(o,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),E_)throw t;return bb(e,null,r,n),Xp(e),e._dirtyType=2,E_=!0,$_(e,o),void(E_=!1)}finally{h.observe(r,N_),e._updating=f,x_=c,w_=u,S_=d}}n._readOnly||(n._readOnly=!0);const g=e._dirtyLeaves,m=e._dirtyElements,v=e._normalizedNodes,y=e._updateTags;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=ex(e)),delete r[o])}(e,n);const _=i?null:zx(Tx(e));if(e._editable&&null!==_&&(l||null===a||a.dirty||!a.is(s))&&null!==r&&!y.has(Qv)){S_=e,x_=n;try{if(null!==h&&h.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&Lx(t,e,r),f_(s,a,e,_,y,r)}!function(e,t,n){let r=e._blockCursorElement;if(Iy(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(Wx(t))){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())Mx(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(null!==t&&Mx(t)){const n=t.getPreviousSibling();(null===n||Mx(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=aS(o,e.getElementByKey(o.__key),e).element;return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=Gx().createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Gw(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Lx(r,e,t)}(e,r,a)}finally{null!==h&&h.observe(r,N_),S_=d,x_=c}}null!==p&&function(e,t,n,r,i){const o=Array.from(e._listeners.mutation),s=o.length;for(let a=0;a<s;a++){const[e,s]=o[a];for(const o of s){const s=t.get(o);void 0!==s&&e(s,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,p,y,g,o),Iy(a)||null===a||null!==s&&s.is(a)||e.dispatchCommand(pm,void 0);const b=e._pendingDecorators;null!==b&&(e._decorators=b,e._pendingDecorators=null,q_("decorator",e,!0,b)),function(e,t,n){const r=tx(t),i=tx(n);r!==i&&q_("textcontent",e,!0,i)}(e,t||o,n),q_("update",e,!0,{dirtyElements:m,dirtyLeaves:g,editorState:n,mutatedNodes:p,normalizedNodes:v,prevEditorState:t||o,tags:y}),f||V_(e,e._deferred),function(e){const t=e._updates;if(0===t.length)return void(e._cascadeCount=0);if(function(e){C_.has(e)||(C_.add(e),setTimeout(()=>{C_.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));const n=t.shift();if(n){const[t,r]=n;W_(e,t,r)}}(e)}(e,t)}finally{k_=n}}function q_(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=t._listeners[e],i=Array.from(n);for(const[e,t]of i){t&&t();const i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function G_(e,t,n,r){const i=ax(e);let o;if(!k_)for(let s=0;s<i.length;s++)i[s]._updating||(i[s]._cascadeCount=0);for(let s=4;s>=0;s--)for(let e=0;e<i.length;e++){const a=i[e];if(e>0&&a._updating){o=a;break}const l=a._commands.get(t);if(void 0!==l){const e=l[s];if(e.size>0){let t=!1;if(H_(a,()=>{for(const i of e)if(i(n,r))return void(t=!0)}),t)return t}}}return o&&o.update(()=>{G_(o,t,n,r)}),!1}function V_(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function K_(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t,o=e._pendingEditorState;let s;void 0!==i&&(s=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(null===o&&Xh(191),o._flushSync=!0),s&&e._deferred.push(s),z_(e,i.tag)),null==o?W_(e,n,i):n()}}return r}function W_(e,t,n){const r=e._updateTags;let i,o=!1,s=!1;void 0!==n&&(i=n.onUpdate,z_(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let l=e._pendingEditorState,c=!1;(null===l||l._readOnly)&&(l=e._pendingEditorState=rb(l||a),c=!0),l._flushSync=s;const u=x_,d=w_,f=S_,h=e._updating;x_=l,w_=!1,e._updating=!0,S_=e;const p=e._headless||null===e.getRootElement();Nb(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=zx(Tx(e));return Iy(n)||null==n?r_(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),o=K_(e,o),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Iy(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),0!==e._dirtyType&&(o?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const i of n){const e=r.get(i);xy(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&pg(e)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=Hb(),s=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);xy(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&pg(r),void 0!==r&&L_(r,o)&&M_(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){A_++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,c.delete("root")&&c.set("root",!0);for(const e of c){const n=e[0],a=e[1];if(r.set(n,a),!a)continue;const l=i.get(n);void 0!==l&&L_(l,o)&&M_(t,l,s)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,A_++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),K_(e),function(e,t,n,r){const i=e._nodeMap,o=t._nodeMap,s=[];for(const[c]of r){const e=o.get(c);void 0!==e&&(e.isAttached()||(Q_(e)&&Up(e,c,i,o,s,r),i.has(c)||r.delete(c),s.push(c)))}for(const c of n){const e=o.get(c);void 0===e||e.isAttached()||(AS(e)&&null!==e.__slots&&Up(e,c,i,o,s,n),i.has(c)||n.delete(c),s.push(c))}for(const c of s)o.delete(c);const a=F_(),l=a._compositionKey;null===l||o.has(l)||(a._compositionKey=null)}(a,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);const i=l._selection;if(Iy(i)){e._slotsUsed&&Qy(i);const t=l._nodeMap,n=i.anchor.key,r=i.focus.key;void 0!==t.get(n)&&void 0!==t.get(r)||Xh(19)}else Oy(i)&&0===i._nodes.size&&(l._selection=null)}catch(Xh){return Xh instanceof Error&&e._onError(Xh),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void $_(e)}finally{x_=u,w_=d,S_=f,e._updating=h,A_=0}const g=0!==e._dirtyType||e._deferred.length>0||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(l,e);g?l._flushSync?(l._flushSync=!1,$_(e)):c&&Ib(()=>{$_(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function H_(e,t,n){S_===e&&void 0===n?t():W_(e,t,n)}function J_(e){if(Ix(e)){let t=null;for(const n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class X_ extends qv{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:J_,extends:qv})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&Xh(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ep[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()&&0===FS(this).length}isDirty(){const e=F_()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];for(const n of FS(this)){const t=OS(this,n);Q_(t)&&e.push(...t.getAllTextNodes())}let t=this.getFirstChild();for(;null!==t;){if(xy(t)&&e.push(t),Q_(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Q_(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Q_(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Q_(e)&&e.getLastDescendant()||e||null}const r=t[e];return Q_(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Jb(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Xh(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Jb(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Xh(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=US(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),Q_(i)&&r!==n-1&&!i.isInline()&&(e+=_p)}return e}getTextContentSize(){let e=function(e){let t=0;for(const n of FS(e)){const r=OS(e,n);null!==r&&(t+=r.getTextContentSize())}return t}(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),Q_(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){const t=wp[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=xp[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return $b(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){R_();const n=i_();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(xy(e)||Q_(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(xy(e)||Q_(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Iy(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):e_(s,r,s,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e&&wp[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Bv(this)&&Xh(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Xh(226,String(e),String(t),String(r));for(const f of n);const o=i.__key,s=[],a=[],l=this.getChildAtIndex(e+t);let c=null,u=r-t+n.length;if(0!==e)if(e===r)c=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(c=t.getPreviousSibling())}if(t>0){let e=null===c?this.getFirstChild():c.getNextSibling();for(let n=0;n<t;n++){null===e&&Xh(100);const t=e.getNextSibling(),n=e.__key;Vb(e.getWritable()),a.push(n),e=t}}let d=c;for(const f of n){null!==d&&f.is(d)&&(c=d=d.getPreviousSibling());const e=f.getWritable();e.__parent===o&&u--,Vb(e);const t=f.__key;if(null===d)i.__first=t,e.__prev=null;else{const n=d.getWritable();n.__next=t,e.__prev=n.__key}f.__key===o&&Xh(76),e.__parent=o,s.push(t),d=f}if(e+t===r)null!==d&&(d.getWritable().__next=null,i.__last=d.__key);else if(null!==l){const e=l.getWritable();if(null!==d){const t=d.getWritable();e.__prev=d.__key,t.__next=l.__key}else e.__prev=null}if(i.__size=u,a.length){const e=i_();if(Iy(e)){const t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;Y_(r,t,n)&&l_(r,r.getNode(),this,c,l),Y_(i,t,n)&&l_(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||Ix(this)||this.remove()}}return i}getDOMSlot(e){return new Fp(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Qx(t)){const e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px",t.setAttribute("data-lexical-indent",String(e)));const n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||Ix(this)||this.getChildren().some(xy)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=aS(this,e,t);let r=n.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const e=t.getElementByKey(i.getKey());null!==e&&(null==r?(n.insertChild(e),r=e):r!==e&&n.replaceChild(e,r),r=r.nextSibling)}}}function Q_(e){return e instanceof X_}function Y_(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class Z_ extends qv{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&Xh(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function eb(e){return e instanceof Z_}class tb extends X_{__cachedText;static getType(){return"root"}static clone(){return new tb}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Xh(51)}getTextContent(){const e=this.__cachedText;return null===e||!T_()&&0!==F_()._dirtyType?super.getTextContent():e}remove(){Xh(52)}replace(e){Xh(53)}insertBefore(e){Xh(54)}insertAfter(e){Xh(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const r of n)Q_(r)||eb(r)||Xh(282);return super.splice(e,t,n)}static importJSON(e){return nx().updateFromJSON(e)}collapseAtStart(){return!0}}function nb(e){return e instanceof tb}function rb(e){return new sb(zp(e._nodeMap),null,e._slotsUsed)}function ib(){return new sb(new Map([["root",new tb]]),null,!1)}function ob(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Xh(130,n.name),Q_(e)){const r=t.children;Array.isArray(r)||Xh(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=ob(i[e]);r.push(t)}}const r=FS(e);if(r.length>0){const i={};for(const t of r){const r=OS(e,t);null===r&&Xh(366,n.name,t),i[t]=ob(r)}t.$slots=i}return t}class sb{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return B_(t&&t.editor||null,this,e)}clone(e){const t=new sb(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return B_(null,this,()=>({root:ob(nx())}))}}class ab extends X_{static getType(){return"artificial"}createDOM(e){return Gx().createElement("div")}}class lb extends qv{static getType(){return"linebreak"}static clone(e){return new lb(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return Gx().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>fb(e)||hb(e)?null:{conversion:cb,priority:0}}}static importJSON(e){return ub().updateFromJSON(e)}}function cb(e){return{node:ub()}}function ub(){return Ox(new lb)}function db(e){return e instanceof lb}function fb(e){const t=e.parentElement;if(null!==t&&rS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&pb(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&pb(n))return!0}}return!1}function hb(e){const t=e.parentElement;if(null!==t&&rS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&pb(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&pb(r))return!0}return!1}function pb(e){return Ub(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class gb extends X_{static getType(){return"paragraph"}static clone(e){return new gb(e.__key)}createDOM(e){const t=Gx().createElement("p"),n=yx(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:mb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Qx(t)){this.isEmpty()&&t.append(Gx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return vb().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){const t=this.getChildren().find(xy);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const n=vb();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||xy(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function mb(e){const t=vb();if(gS(t,e),hS(e,t),""===t.getFormatType()){const n=e.getAttribute("align");n&&n&&n in wp&&t.setFormat(n)}return pS(t,e),{node:t}}function vb(){return Ox(new gb)}function yb(e){return e instanceof gb}function _b(e){console.warn(e)}function bb(e,t,n,r,i){const o=e._keyToDOMMap;o.clear(),e._editorState=ib(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,null!==e._inputState.handledSelectionCommandTimeoutId&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};const s=e._observer;null!==s&&(s.disconnect(),e._observer=null),null!==t&&(t.textContent="",function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),null!==n&&(n.textContent="",o.set("root",n),Qb(n,e,"root"))}function xb(e){const t=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of xS(e)){const e=r.transform;if(!n.has(e)){n.add(e);const i=r.transform();i&&t.add(i)}if(i){const e=i.$transform;e&&t.add(e)}}return t}const Sb={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{const n=Db(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>Q_(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>Q_(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function wb(e){const t=e||{},n=P_(),r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=ib(),a=t.namespace||(null!==i?i._config.namespace:lx()),l=t.editorState,c=[tb,dy,lb,wy,gb,ab,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let n=c[e],r=null,i=null;if(n&&"object"==typeof n){const e=n;n=e.replace,r=e.with,i=e.withKlass||null}if("function"!=typeof n||!n.prototype||!(n===qv||n.prototype instanceof qv)){let r="<unknown>";try{r=JSON.parse(Pp)}catch(Xh){}Xh(365,String(e-c.length+(t.nodes?t.nodes.length:0)),"function"==typeof n?`${n.name}${"function"==typeof n.getType?` (type ${String(n.getType())})`:""}`:String(n),String(r))}bS(n);const o=n.getType(),s=xb(n);p.set(o,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:ng(c[e]),transforms:s})}}const g=new Cb(s,i,p,{disableEvents:o,dom:{...Sb,...e&&e.dom},namespace:a,theme:r},u||console.error,d||_b,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)}),t&&i(t),n}(p,f?f.import:void 0),h,e);return void 0!==l&&(g._pendingEditorState=l,g._dirtyType=2),function(e){e.registerCommand(vm,Cv,0),e.registerCommand(ym,Av,0),e.registerCommand(_m,Nv,0),e.registerCommand(bm,Tv,0),e.registerCommand(Fm,Iv,0)}(g),g}function Eb(e,t){const n=e.get(t);e.delete(t),n&&n()}function kb(e,t,n){return e.set(t,n),Eb.bind(null,e,t)}class Cb{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,o,s,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new jp,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=lx(),this._onError=i,this._onWarn=o,this._htmlConversions=s,this._editable=a,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return kb(this._listeners.update,e)}registerEditableListener(e){return kb(this._listeners.editable,e)}registerDecoratorListener(e){return kb(this._listeners.decorator,e)}registerTextContentListener(e){return kb(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return Ww(kb(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){const r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){void 0===n&&Xh(35);const r=this._commands;r.has(e)||r.set(e,[new Mp,new Mp,new Mp,new Mp,new Mp]);const i=r.get(e);void 0===i&&Xh(36,String(e));const o=function(e){return 7&e}(n),s=i[o];return o!==n?s.addFront(t):s.addBack(t),()=>{s.delete(t),i.every(e=>0===e.size)&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let o=i.get(t);void 0===o&&(o=new Set,i.set(t,o)),o.add(r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{o.delete(r),0===o.size&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Xh(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=dS(n).get(t.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){const n=dS(e.getEditorState()),r=[];for(const i of t){const e=n.get(i);e&&r.push(e)}0!==r.length&&e.update(()=>{for(const e of r)for(const t of e.keys()){const e=Jb(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:Wv}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Sx(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=yx(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,bb(this,t,e,r,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||zv(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Nx(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,Xp(this),this._updateTags.add(Wv),$_(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;hv.set(e,n);let r=pv.get(n);void 0===r&&(r={editors:new Set,hasShadowEditor:void 0},pv.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;const i=Fv(e);i.push(gv.register(n));for(let o=0;o<fv.length;o++){const[n,r]=fv[o],s="function"==typeof r?e=>{Lv(e)||(Mv(e),(t.isEditable()||"click"===n)&&r(e,t))}:e=>{if(Lv(e))return;Mv(e);const r=t.isEditable();switch(n){case"cut":return r&&Sx(t,tv,e);case"copy":return Sx(t,ev,e);case"paste":return r&&Sx(t,km,e);case"dragstart":return r&&Sx(t,Qm,e);case"dragover":return r&&Sx(t,Ym,e);case"dragend":return r&&Sx(t,Zm,e);case"focus":return r&&Sx(t,av,e);case"blur":return r&&Sx(t,lv,e);case"drop":return r&&Sx(t,Jm,e)}};i.push(uv(e,n,s))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Wv),$_(this);q_("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Xh(38);let n=e;n._readOnly&&(n=rb(e),n._selection=e._selection?e._selection.clone():null),Jp(this);const r=this._pendingEditorState,i=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=i&&this._updateTags.add(i),$_(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,H_(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(const[e,t]of n._nodeMap.entries())Q_(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){const r=ib(),i=x_,o=w_,s=S_,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,x_=r,w_=!1,S_=t,Nb(null);try{const i=t._nodes;U_(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,x_=i,w_=o,S_=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(...e){const[t,n]=1===e.length?["force-commit",e[0]]:e;return"force-commit"===t&&$_(this),("pending"===t?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):W_(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),H_(this,()=>{const r=i_(),i=nx();null!==r?r.dirty||rx(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),Cx("focus"),function(e){R_(),F_()._deferred.push(e)}(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=zx(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,q_("editable",this,!0,e),this._slotsUsed&&this.update(()=>{F_()._dirtyType=2}))}toJSON(){return{editorState:this._editorState.toJSON()}}}Cb.version=Pp;let Ab=null;function Nb(e){Ab=e}let Tb=1;function Rb(e,t){const n=Db(e,t);return void 0===n&&Xh(30,t),n}function Db(e,t){return e._nodes.get(t)}const Ib="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Fb(e,t){const n=void 0!==t?t:(()=>{const t=e.getRootNode();return Bb(t)||jx(t)?Hx(t):null})();if(!Qx(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;const r=Zb(n),i=n.nodeName;return Gv(r)&&("INPUT"===i||"TEXTAREA"===i||"true"===n.contentEditable&&null==Lb(n))}function Ob(e,t,n){const r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch(e){return!1}return Mb(t)===e&&e.read("latest",()=>!Fb(t))}function Pb(e){return e instanceof Cb}function Mb(e){let t=e;for(;null!=t;){const e=Lb(t);if(Pb(e))return e;t=Ex(t)}return null}function Lb(e){return e?e.__lexicalEditor:null}function zb(e){return ky(e)||e.isToken()}function jb(e){return zb(e)||e.isSegmented()}function Ub(e){return Yx(e)&&3===e.nodeType}function Bb(e){return Yx(e)&&9===e.nodeType}function $b(e,t,n){const r=xp[t];if(null!==n&&(e&r)===(n&r))return e;let i=e^r;return"subscript"===t?i&=-65:"superscript"===t?i&=-33:"lowercase"===t?(i&=-513,i&=-1025):"uppercase"===t?(i&=-257,i&=-1025):"capitalize"===t&&(i&=-257,i&=-513),i}function qb(e){return xy(e)||db(e)||eb(e)}function Gb(e,t){const n=function(){const e=Ab;return Ab=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);R_(),D_();const r=F_(),i=I_(),o=""+Tb++;i._nodeMap.set(o,e),Q_(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),0===r._dirtyType&&(r._dirtyType=1),e.__key=o}function Vb(e){null!==TS(e)&&Xh(380,e.__key,String(TS(e)));const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling(),s=null!==o?o.__key:null,a=null!==i?i.__key:null,l=null!==i?i.getWritable():null,c=null!==o?o.getWritable():null;null===i&&(r.__first=s),null===o&&(r.__last=a),null!==l&&(l.__next=s),null!==c&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Kb(e){D_(),Bv(e)&&Xh(323,e.__key,e.__type);const t=e.getLatest(),n=null!==t.__parent?t.__parent:NS(t)?t.__slotHost:null,r=I_(),i=F_(),o=r._nodeMap,s=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=null!==e.__parent?e.__parent:NS(e)?e.__slotHost:null}}(n,o,s);const a=t.__key;0===i._dirtyType&&(i._dirtyType=1),Q_(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function Wb(e){R_();const t=F_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Jb(n);null!==e&&e.getWritable()}if(null!==e){const t=Jb(e);null!==t&&t.getWritable()}}}function Hb(){return T_()?null:F_()._compositionKey}function Jb(e,t){const n=(t||I_())._nodeMap.get(e);return void 0===n?null:n}function Xb(e,t){const n=Yb(e,F_());return void 0!==n?Jb(n,t):null}function Qb(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Yb(e,t){return e[`__lexicalKey_${t._key}`]}function Zb(e,t){let n=e;for(;null!=n;){const e=Xb(n,t);if(null!==e)return e;n=Ex(n)}return null}function ex(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function tx(e){return e.read(()=>nx().getTextContent())}function nx(){return I_()._nodeMap.get("root")}function rx(e){R_();const t=I_();null!==e&&(e.dirty=!0,e.setCachedNodes(null),Iy(e)&&F_()._slotsUsed&&Qy(e)),t._selection=e}function ix(){R_(),Jp(F_())}function ox(e){const t=function(e,t){let n=e;for(;null!=n;){const e=Yb(n,t);if(void 0!==e)return e;n=Ex(n)}return null}(e,F_());return null===t?null:Jb(t)}function sx(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ax(e){const t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function lx(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function cx(e){return Ub(e)?e.nodeValue:null}function ux(e,t,n){const r=zx(Tx(t));if(null===r)return;const i=Kx(r,t._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:a}=i;if(null!==o){let t=cx(o);const r=Zb(o);if(null!==t&&xy(r)){if((t===yp||t===bp)&&n){const e=n.length;t=n,s=e,a=e}null!==t&&dx(r,t,s,a,e)}}}function dx(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();if(o.isToken()&&s)return;let a=t;if((s||i)&&(t.endsWith(yp)&&(a=t.slice(0,-yp.length)),i)){const e=bp;let t;for(;-1!==(t=a.indexOf(e));)a=a.slice(0,t)+a.slice(t+e.length),null!==n&&n>t&&(n=Math.max(t,n-e.length)),null!==r&&r>t&&(r=Math.max(t,r-e.length))}const l=o.getTextContent();if(i||a!==l){const t=i_();if(""===a){if(Wb(null),op||rp||lp)o.remove();else{const e=F_();fx(o,"",t),setTimeout(()=>{e.update(()=>{o.isAttached()&&""===o.getTextContent()&&o.remove()})},20)}return}const i=o.getParent(),l=o_(),c=o.getTextContentSize(),u=Hb(),d=o.getKey();if(o.isToken()&&!s||null!==u&&d===u&&!s||Iy(l)&&(null!==i&&!i.canInsertTextBefore()&&0===l.anchor.offset||l.anchor.key===e.__key&&0===l.anchor.offset&&!o.canInsertTextBefore()&&!s||l.focus.key===e.__key&&l.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();if(!Iy(t)||null===n||null===r)return void fx(o,a,t);if(t.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=by(o.getTextContent());o.replace(e),o=e}fx(o,a,t)}}}function fx(e,t,n){if(e.setTextContent(t),Iy(n)){const t=e.getKey();let r=!1;for(const i of["anchor","focus"]){const o=n[i];"text"===o.type&&o.key===t&&(o.offset=lw(e,o.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function hx(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function px(e,t,n){if(!function(e,t){return hx(e,t,"altKey")&&hx(e,t,"ctrlKey")&&hx(e,t,"shiftKey")&&hx(e,t,"metaKey")}(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1)return!1;if(1===e.key.length&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;const r="Key"+t.toUpperCase();return e.code===r}const gx={ctrlKey:!ep,metaKey:ep},mx={altKey:ep,ctrlKey:!ep};function vx(e){return"Backspace"===e.key}function yx(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=Gw(i);return n[t]=e,e}return i}function _x(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&Xh(33,o);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(s,d?"updated":i)}function bx(e,t,n){const r=e.getParent();let i=n,o=e;return null!==r&&(0===n&&(i=o.getIndexWithinParent(),o=r)),o.getChildAtIndex(i-1)}function xx(e){const t=Tx(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Sx(e,t,n){return G_(e,t,n,e)}function wx(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Xh(75,t),n}function Ex(e){const t=e.assignedSlot||e.parentElement;if(null!==t)return t;const n=e.parentNode;return jx(n)?n.host:null}function kx(e){return Bb(e)?e:Qx(e)?e.ownerDocument:null}function Cx(e){R_(),F_()._updateTags.add(e)}function Ax(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Nx(e){const t=kx(e);return t?t.defaultView:null}function Tx(e){const t=e._window;return null===t&&Xh(78),t}function Rx(e){let t=e.getLatest();for(;null!==t;){if(null!==TS(t)&&Q_(t))return t;const e=t.getParentOrThrow();if(Ix(e))return e;t=e}return t}function Dx(e){return Q_(e)&&e.isShadowRoot()}function Ix(e){return nb(e)||Dx(e)}function Fx(e,t=!1){const n=e.constructor.clone(e);return Gb(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Ox(e){const t=F_(),n=e.getType(),r=Db(t,n);void 0===r&&Xh(200,e.constructor.name,n);const{replace:i,replaceWithKlass:o}=r;if(null!==i){const t=i(e),r=t.constructor;return null!==o?t instanceof o||Xh(201,o.name,o.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||Xh(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Xh(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Px(e,t){!nb(e.getParent())||Q_(t)||eb(t)||Xh(99)}function Mx(e){if(!e||e.isInline())return!1;if(eb(e))return!0;if(Q_(e)){if(e.isShadowRoot()){const t=e.getParent();return!(Q_(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Lx(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function zx(e){return Yh?(e||window).getSelection():null}function jx(e){return Zx(e)&&"host"in e}const Ux=[];function Bx(e){const t=e.getRootNode();if(t===e||!jx(t))return Ux;const n=[t];let r=t.host;for(;;){const e=r.getRootNode();if(e===r||!jx(e))break;n.push(e),r=e.host}return n}function*$x(e){const t=[e];let n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const e=(Bb(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function qx(e){return null!==e?e.ownerDocument:document}function Gx(){const e=P_();return qx(null!==e?e._rootElement:null)}function Vx(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;const n=Bx(t);if(0===n.length)return null;const r=e.getComposedRanges;try{const t=r.call(e,{shadowRoots:n})[0];if(void 0!==t)return t}catch(e){}try{const t=r.apply(e,n)[0];if(void 0!==t)return t}catch(e){}return null}function Kx(e,t){const n=Vx(e,t);return null===n?e:function(e,t){const{startContainer:n,startOffset:r,endContainer:i,endOffset:o}=e;return"backward"===t?{anchorNode:i,anchorOffset:o,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:o}}(n,function(e){return e.direction}(e))}function Wx(e){const t=e.getRootNode();return Bb(t)||jx(t)?t.activeElement:null}function Hx(e){let t=e.activeElement;for(;null!==t&&null!==t.shadowRoot;){const e=t.shadowRoot.activeElement;if(null===e)break;t=e}return t}function Jx(e){const t=e.target;if(null!==t&&Qx(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){const t=e.composedPath();if(t.length>0)return t[0]}return t}function Xx(e){return Qx(e)&&"A"===e.tagName}function Qx(e){return Yx(e)&&1===e.nodeType}function Yx(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Zx(e){return Yx(e)&&11===e.nodeType}const eS=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function tS(e){return!(!Qx(e)||!e.style.display.startsWith("inline"))||eS.test(e.nodeName)}const nS=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function rS(e){return(!Qx(e)||!e.style.display.startsWith("inline"))&&nS.test(e.nodeName)}function iS(e){if(eb(e)&&!e.isInline())return!0;if(!Q_(e)||Ix(e))return!1;const t=e.getFirstChild(),n=null===t||db(t)||xy(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function oS(){return F_()}function sS(e=oS()){return e._config.dom||Sb}function aS(e,t,n=oS()){const r=sS(n).$getDOMSlot(e,t,n);return Q_(e)&&(function(e){return e instanceof Fp}(r)||Xh(344,e.getKey(),e.getType())),r}function lS(e,t,n=oS()){return function(e){let t=e;for(;null!=t;){if(Ub(t))return t;t=t.firstChild}return null}(aS(e,t,n).element)}const cS=new WeakMap,uS=new Map;function dS(e){if(!e._readOnly&&e.isEmpty())return uS;e._readOnly||Xh(192);let t=cS.get(e);return t||(t=function(e){const t=new Map;for(const[n,r]of e._nodeMap){const e=r.__type;let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),cS.set(e,t)),t}function fS(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function hS(e,t){const n=e.getAttribute("data-lexical-indent");if(null!==n){const e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}const r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function pS(e,t){const n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function gS(e,t){const n=t.style.textAlign;return n&&n in wp?e.setFormat(n):e}function mS(e){return!0===e.__lexicalUnmanaged}function vS(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;if(Qx(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(void 0!==Yb(n,t))return!1;n=Ex(n)}return!1}function yS(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==qv[t]}const _S=new WeakMap;function bS(e){const t=_S.get(e);if(t)return t;const n=null!=e.prototype&&Ap in e.prototype?e.prototype[Ap]():void 0,r=function(e){if(!(e===qv||e.prototype instanceof qv)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(Xh){}try{Cb.version&&(n=JSON.parse(Cb.version))}catch(Xh){}Xh(290,e.name,t,n)}return e===Z_||e===X_||e===qv}(e),i=!r&&yS(e,"getType")?e.getType():void 0;let o,s=i;if(n)if(i)o=n[i];else{for(const[e,t]of Object.entries(n))s=e,o=t;if(!o)for(const e of Object.getOwnPropertySymbols(n)){const t=n[e];if(t){o=t;break}}}if(!r&&s&&(yS(e,"getType")||(e.getType=()=>s),yS(e,"clone")||(e.clone=t=>(Nb(t),new e)),yS(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(t=>(new e).updateFromJSON(t))),!yS(e,"importDOM")&&o)){const{importDOM:t}=o;t&&(e.importDOM=()=>t)}const a={klass:e,ownNodeConfig:o,ownNodeType:s};return _S.set(e,a),a}function*xS(e){for(let t=e;t&&(t===qv||Gv(t.prototype));){const e=bS(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||kS(t)}}function SS(e){const t=oS();return R_(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}const wS=(e,t)=>{let n=e;for(;null!=n&&!nb(n);){if(t(n))return n;n=n.getParent()}return null};function ES(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=null===t?Jb(r):t.get(r);null==e&&Xh(174),n.push(r),r=e.__next}return n}function kS(e){const t=Object.getPrototypeOf(e);if("function"==typeof t&&t!==Function.prototype)return t;const n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}const CS=new Map;function AS(e){return Q_(e)||eb(e)}function NS(e){return Q_(e)||eb(e)}function TS(e){const t=e.getLatest();return NS(t)?t.__slotHost:null}function RS(e){const t=TS(e);if(null===t)return null;const n=Jb(t);return Q_(n)||eb(n)||Xh(370),n}function DS(e){let t=e.getLatest();for(;null!==t;){if(null!==TS(t))return t;t=t.getParent()}return null}function IS(e){const t=e.getLatest();return AS(t)&&null!==t.__slots?t.__slots:CS}function FS(e){return Array.from(IS(e).keys())}function OS(e,t){const n=IS(e).get(t);return void 0===n?null:Jb(n)}const PS=["__proto__","constructor","prototype"],MS=Symbol("slotMapOwner");function LS(e){let t=e.__slots;return null!==t&&t[MS]===e||(t=new Map(t),t[MS]=e,e.__slots=t),t}const zS=new WeakMap,jS=[];function US(e){let t="";for(const n of FS(e)){const r=OS(e,n);null!==r&&(t+=r.getTextContent())}return t}function BS(e,t,n){const r=n.get(e),i=n.get(t);return void 0!==r?void 0!==i?r-i:-1:void 0!==i?1:e<t?-1:e>t?1:0}function $S(e){const t=e.__slots;if(null===t||t.size<2)return;const n=function(e){let t=zS.get(e);if(void 0===t){const n=function(e){for(const{ownNodeConfig:t}of xS(e)){const e=t&&t.slots;if(e)return e}return jS}(e),r=new Map;for(const t of n)PS.includes(t)&&Xh(371,e.name,t),r.has(t)&&Xh(372,e.name,t),r.set(t,r.size);t=r,zS.set(e,t)}return t}(e.constructor);let r=null,i=!0;for(const s of t.keys()){if(null!==r&&BS(r,s,n)>0){i=!1;break}r=s}if(i)return;const o=Array.from(t).sort(([e],[t])=>BS(e,t,n));t.clear();for(const[s,a]of o)t.set(s,a)}function qS(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||Xh(373,t);const r=e.getLatest();if(null!==r.__slots&&r.__slots.get(t)===n.getLatest().__key)return r;(!Q_(n)&&!eb(n)||n.isInline())&&Xh(374,n.__key);const i=e.getWritable(),o=LS(i),s=o.get(t);void 0!==s&&VS(s);const a=n.getWritable(),l=RS(a);if(null!==l){const e=function(e){const t=RS(e);if(null===t)return null;const n=e.getLatest().__key;for(const[r,i]of IS(t))if(i===n)return r;return null}(a);null!==e&&LS(l.getWritable()).delete(e),a.__slotHost=null}return Vb(a),a.__slotHost=i.__key,o.set(t,a.__key),$S(i),function(){const e=oS();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function GS(e,t){const n=e.getWritable();if(null===n.__slots)return n;const r=n.__slots.get(t);return void 0!==r&&(VS(r),LS(n).delete(t)),n}function VS(e){const t=Jb(e);if(null===t)return;const n=t.getWritable();NS(n)||Xh(377,e),n.__slotHost=null,n.remove()}const KS={next:"previous",previous:"next"};class WS{origin;constructor(e){this.origin=e}[Symbol.iterator](){return vw({hasNext:tw,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return sw(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return sw(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const o=this.getParentAtCaret(),s=new Map;for(let a=i.getAdjacentCaret();null!==a&&s.size<e;a=a.getAdjacentCaret()){const e=a.origin.getWritable();s.set(e.getKey(),e)}for(const a of r){if(s.size>0){const e=i.getNodeAtCaret();if(e)if(s.delete(e.getKey()),s.delete(a.getKey()),e.is(a)||i.origin.is(a));else{const t=a.getParent();t&&t.is(o)&&a.remove(),e.replace(a)}else null===e&&Xh(263,Array.from(s).join(" "))}else i.insert(a);i=sw(a,this.direction)}for(const a of s.values())a.remove();return this}}class HS extends WS{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:uw(e,this.direction)}getParentCaret(e="root"){return sw(QS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=XS(this.direction);return sw(this.getNodeAtCaret(),e)||uw(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof HS&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const JS={root:nb,shadowRoot:Ix};function XS(e){return KS[e]}function QS(e,t="root"){return null===e||JS[t](e)?null:null===TS(e)?e:null}class YS extends WS{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:sw(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Q_(this.origin)?uw(this.origin,this.direction):null}getParentCaret(e="root"){return sw(QS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=XS(this.direction);return sw(this.getNodeAtCaret(),e)||uw(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof YS&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof YS||e instanceof ZS)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ZS extends WS{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:aw(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return sw(QS(this.getParentAtCaret(),e),this.direction)}getFlipped(){return aw(this.origin,XS(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ZS&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof YS||e instanceof ZS)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return sw(this.origin,this.direction)}}function ew(e){return e instanceof ZS}function tw(e){return e instanceof YS}function nw(e){return e instanceof HS}const rw={next:class extends ZS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ZS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},iw={next:class extends YS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends YS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ow={next:class extends HS{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends HS{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function sw(e,t){return e?new iw[t](e):null}function aw(e,t,n){return e?new rw[t](e,lw(e,n)):null}function lw(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&Qh(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function cw(e,t){return new hw(e,t)}function uw(e,t){return Q_(e)?new ow[t](e):null}function dw(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class fw{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new fw(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return ew(t)?function(e,t){const{direction:n,origin:r}=e;return cw(e,lw(r,"focus"===t?XS(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){const{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[cw(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=ew(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=ew(n),i=t=>t.isSameNodeCaret(n)?null:dw(t)||t.getParentCaret(e);return vw({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class hw{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return aw(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function pw(e){return mw(e,sw(nx(),e.direction))}function gw(e){return mw(e,e)}function mw(e,t){return e.direction!==t.direction&&Xh(265),new fw(e,t,e.direction)}function vw(e){const{initial:t,hasNext:n,step:r,map:i}=e;let o=t;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const e={done:!1,value:i(o)};return o=r(o),e}}}function yw(e,t){const n=Sw(e.origin,t.origin);switch(null===n&&Xh(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const n="text"===e.type,r="text"===t.type;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return _w(n)}}function _w(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let o=t,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return null===o?1:-1}function bw(e,t){return t.is(e)}function xw(e){return Q_(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Sw(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,i]=xw(e);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=xw(t);r;i=r,r=r.getParent()){const o=n.get(r);if(void 0!==o)return null===o?(bw(e,r)||Xh(276),{commonAncestor:r,type:"ancestor"}):null===i?(bw(t,r)||Xh(277),{commonAncestor:r,type:"descendant"}):((Q_(o)||bw(e,o))&&(Q_(i)||bw(t,i))&&r.is(o.getParent())&&r.is(i.getParent())||Xh(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function ww(e,t){const{type:n,key:r,offset:i}=e,o=function(e){const t=Jb(e);return null===t&&Xh(63,e),t}(e.key);return"text"===n?(xy(o)||Xh(266,o.getType(),r),aw(o,t,i)):(Q_(o)||Xh(267,o.getType(),r),Mw(o,e.offset,t))}function Ew(e,t){const{origin:n,direction:r}=t,i="next"===r;ew(t)?e.set(n.getKey(),t.offset,"text"):tw(t)?xy(n)?e.set(n.getKey(),lw(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(nw(t)&&Q_(n)||Xh(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function kw(e){const t=i_(),n=Iy(t)?t:t_();return Cw(n,e),rx(n),n}function Cw(e,t){Ew(e.anchor,t.anchor),Ew(e.focus,t.focus)}function Aw(e){const{anchor:t,focus:n}=e,r=ww(t,"next"),i=ww(n,"next"),o=yw(r,i)<=0?"next":"previous";return mw(Ow(r,o),Ow(i,o))}function Nw(e){const{direction:t,origin:n}=e,r=sw(n,XS(t)).getNodeAtCaret();return r?sw(r,t):uw(n.getParentOrThrow(),t)}function Tw(e,t="root"){const n=[e];for(let r=nw(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Nw(r));return n}function Rw(e){return!!e&&e.origin.isAttached()}function Dw(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const o=Pw(e,r),s=Tw(o.anchor,n),a=Tw(o.focus.getFlipped(),n),l=new Set,c=[];for(const p of o.iterNodeCarets(n))if(nw(p))l.add(p.origin.getKey());else if(tw(p)){const{origin:e}=p;Q_(e)&&!l.has(e.getKey())||c.push(e)}for(const p of c)p.remove();for(const p of o.getTextSlices()){if(!p)continue;const{origin:e}=p.caret,t=e.getTextContentSize(),n=Nw(sw(e,r)),o=e.getMode();if(Math.abs(p.distance)===t&&"removeEmptySlices"===i||"token"===o&&0!==p.distance)n.remove();else if(0!==p.distance){i="removeEmptySlices";let e=p.removeTextSlice();const t=p.caret.origin;if("segmented"===o){const t=e.origin,i=by(t.getTextContent()).setStyle(t.getStyle()).setFormat(t.getFormat());n.replaceOrInsert(i),e=aw(i,r,e.offset)}t.is(s[0].origin)&&(s[0]=e),t.is(a[0].origin)&&(a[0]=e.getFlipped())}}let u,d;for(const p of s)if(Rw(p)){u=Iw(p);break}for(const p of a)if(Rw(p)){d=Iw(p);break}const f=function(e,t,n){if(!e||!t)return null;const r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;const o=r.getParents().reverse();o.push(r);const s=i.getParents().reverse();s.push(i);const a=Math.min(o.length,s.length);let l;for(l=0;l<a&&o[l]===s[l];l++);const c=(e,t)=>{let n;for(let r=l;r<e.length;r++){const i=e[r];if(Ix(i))return;!n&&t(i)&&(n=i)}return n},u=c(o,iS),d=u&&c(s,e=>n.has(e.getKey())&&iS(e));return d&&FS(d).length>0?null:u&&d?[u,d]:null}(u,d,l);if(f){const[e,t]=f;uw(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){const e=n;n=n.getParent(),e.remove(!0)}}else if(d){const e=function(e){if(nw(e)){const t=e.origin;if(iS(t))return t}else{const t=e.getParentAtCaret();if(t&&iS(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(Dx);if(e&&t&&!nb(t)&&e.isEmpty()&&l.has(e.getKey())&&0===FS(e).length&&(!n||l.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!nb(n)&&n.isEmpty();){const e=n.getParent();if(e&&nb(e)&&e.getChildrenSize()<=1)break;const t=n;n=e,t.remove(!0)}}}const h=[u,d,...s,...a].find(Rw);if(h)return gw(Ow(Iw(h),e.direction));Xh(269,JSON.stringify(s.map(e=>e.origin.__key)))}function Iw(e){const t=function(e){let t=e;for(;nw(t);){const e=dw(t);if(!nw(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(xy(t.origin))return ew(t)?t:aw(t.origin,n,n);const r=t.getAdjacentCaret();return tw(r)&&xy(r.origin)?aw(r.origin,n,XS(n)):t}function Fw(e){return ew(e)&&e.offset!==lw(e.origin,e.direction)}function Ow(e,t){return e.direction===t?e:e.getFlipped()}function Pw(e,t){return e.direction===t?e:mw(Ow(e.focus,t),Ow(e.anchor,t))}function Mw(e,t,n){let r=uw(e,"next");for(let i=0;i<t;i++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return Ow(r,n)}function Lw(e){const{origin:t,offset:n,direction:r}=e;if(n===lw(t,r))return e.getSiblingCaret();if(n===lw(t,XS(r)))return Nw(e.getSiblingCaret());const[i]=t.splitText(n);return xy(i)||Xh(281),Ow(sw(i,"next"),r)}function zw(e,t){return!0}function jw(e,{$copyElementNode:t=Fx,$splitTextPointCaretNext:n=Lw,rootMode:r="shadowRoot",$shouldSplit:i=zw,removeEmptyDestination:o=!1}={}){if(ew(e))return n(e);const s=e.getParentCaret(r);if(s){const{origin:n}=s;if(nw(e)){const e=Nw(s);if(o&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,"first"))return e}const r=function(e){const t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!o&&n.canBeEmpty()&&i(n,"last"))&&s.insert(t(n).splice(0,0,r))}return s}function Uw(e,t,n){let r=Ow(t,"next");ew(r)&&(0===r.offset?r=sw(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=sw(r.origin,"next"))),r.origin.is(e)&&(tw(r)||Xh(342,e.getKey(),e.getType()),r=Nw(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=r;i;i=jw(i,n))r=i;return ew(r)&&Xh(283),r.insert(e.isInline()?vb().append(e):e),Ow(sw(e.getLatest(),"next"),t.direction)}function Bw(e){return e}function $w(e){return e}function qw(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function Gw(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function Vw(e,...t){const n=Gw(...t);n.length>0&&e.classList.add(...n)}function Kw(e,...t){const n=Gw(...t);n.length>0&&e.classList.remove(...n)}function Ww(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Hw(e){const t=oS().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function Jw(e){return Hw(nb(e)?e:e.getParentOrThrow())}function Xw(e){const t=Jw(e);return null!==t&&"rtl"===t.direction}function Qw(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!jb(t)&&null!==r){const[i,o]=r,s=e.isBackward(),a=i.getNode(),l=o.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[r,i]=zy(e),o=a.is(l),c=t.is(s?l:a),u=t.is(s?a:l);let d,f=0;o?(f=r>i?i:r,d=r>i?r:i):c?(f=s?i:r,d=void 0):u&&(f=0,d=s?r:i);const h=t.__text.slice(f,d);h!==t.__text&&("clone"===n&&(t=function(e){return(t=fS(e))[Uv]=!0,t;var t}(t)),t.__text=h)}}return t}function Yw(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Zw(e,t,n=Yw){if(!e)return;const r=e.getStartEndPoints();let i=!1,o=null;const s=new Map;if(r){const[t,n]=r,a=wS(t.getNode(),iS);o=wS(n.getNode(),iS);const l=e.isBackward()?"previous":"next";i=Q_(o)&&!o.is(a)&&function(e,t,n){const r=e.getNode();return(!Q_(r)||!r.isEmpty())&&function(e,t,n){let r=ww(e,n);if(Fw(r))return!1;for(;r;r=r.getParentCaret()){const e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}(e,t,n)}(n,o,XS(l)),Q_(a)&&s.set(a.getKey(),a),Q_(o)&&!i&&s.set(o.getKey(),o)}for(const a of e.getNodes())if(Q_(a)&&iS(a)){if(i&&a.is(o))continue;s.set(a.getKey(),a)}else if(!r){const e=wS(a,iS);Q_(e)&&s.set(e.getKey(),e)}for(const a of s.values()){const e=t();n(a,e),a.replace(e,!0)}}function eE(e){const t=tE(e);return null!==t&&"vertical-rl"===t.writingMode}function tE(e){const t=e.anchor.getNode();return Q_(t)?Hw(t):Jw(t)}function nE(e,t){let n=eE(e)?!t:t;rE(e)&&(n=!n);const r=ww(e.focus,n?"previous":"next");if(Fw(r))return!1;if(ew(r)&&!ky(r.origin)&&r.origin.isUnmergeable()){const e=r.getNodeAtCaret();if(xy(e)&&!ky(e))return!0}for(const i of pw(r)){if(nw(i))return!i.origin.isInline();if(!Q_(i.origin)){if(eb(i.origin))return!0;break}}return!1}function rE(e){const t=tE(e);return null!==t&&"rtl"===t.direction}function iE(e,t,n){const r=rE(e);let i;i=eE(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}function oE(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function sE(e){const t=wS(e,e=>Q_(e)&&!e.isInline());return Q_(t)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t}function aE(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function lE(e){let t=null;if(aE(e,DragEvent)?t=e.dataTransfer:aE(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function cE(e){const t=i_();if(!Iy(t))return!1;const n=new Set,r=t.getNodes();for(let i=0;i<r.length;i++){const t=r[i],o=t.getKey();if(n.has(o))continue;const s=wS(t,e=>Q_(e)&&!e.isInline());if(null===s)continue;const a=s.getKey();s.canIndent()&&!n.has(a)&&(n.add(a),e(s))}return n.size>0}const uE=Symbol.for("preact-signals");function dE(){if(vE>1)return void vE--;let e,t=!1;for(function(){let e=gE;for(gE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==hE;){let n=hE;for(hE=void 0,yE++;void 0!==n;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&SE(n))try{n.c()}catch(Yh){t||(e=Yh,t=!0)}n=r}}if(yE=0,vE--,t)throw e}let fE,hE;function pE(e){const t=fE;fE=void 0;try{return e()}finally{fE=t}}let gE,mE,vE=0,yE=0,_E=0;function bE(e){if(void 0===fE)return;let t=e.n;return void 0===t||t.t!==fE?(t={i:0,S:e,p:fE.s,n:void 0,t:fE,e:void 0,x:void 0,r:t},void 0!==fE.s&&(fE.s.n=t),fE.s=t,e.n=t,32&fE.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=fE.s,t.n=void 0,fE.s.n=t,fE.s=t),t):void 0}function xE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function SE(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function wE(e){for(let t=e.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function EE(e){let t,n=e.s;for(;void 0!==n;){const e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function kE(e,t){xE.call(this,void 0),this.x=e,this.s=void 0,this.g=_E-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function CE(e){const t=e.m;if(e.m=void 0,"function"==typeof t){vE++;const n=fE;fE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,AE(e),t}finally{fE=n,dE()}}}function AE(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,CE(e)}function NE(e){if(fE!==this)throw new Error("Out-of-order effect");EE(this),fE=e,this.f&=-2,8&this.f&&AE(this),dE()}function TE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function RE(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}function DE(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}xE.prototype.brand=uE,xE.prototype.h=function(){return!0},xE.prototype.S=function(e){const t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:pE(()=>{var e;null==(e=this.W)||e.call(this)}))},xE.prototype.U=function(e){if(void 0!==this.t){const t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&pE(()=>{var e;null==(e=this.Z)||e.call(this)}))}},xE.prototype.subscribe=function(e){return function(e,t){const n=new TE(e,t);try{n.c()}catch(e){throw n.d(),e}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}(()=>{const t=this.value,n=fE;fE=void 0;try{e(t)}finally{fE=n}},{name:"sub"})},xE.prototype.valueOf=function(){return this.value},xE.prototype.toString=function(){return this.value+""},xE.prototype.toJSON=function(){return this.value},xE.prototype.peek=function(){const e=fE;fE=void 0;try{return this.value}finally{fE=e}},Object.defineProperty(xE.prototype,"value",{get(){const e=bE(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(yE>100)throw new Error("Cycle detected");!function(e){0!==vE&&0===yE&&0!==e.l&&(e.l=0,gE={S:e,v:e.v,i:e.i,o:gE})}(this),this.v=e,this.i++,_E++,vE++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{dE()}}}}),kE.prototype=new xE,kE.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===_E)return!0;if(this.g=_E,this.f|=1,this.i>0&&!SE(this))return this.f&=-2,!0;const e=fE;try{wE(this),fE=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return fE=e,EE(this),this.f&=-2,!0},kE.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}xE.prototype.S.call(this,e)},kE.prototype.U=function(e){if(void 0!==this.t&&(xE.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},kE.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(kE.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=bE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),TE.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.m=e)}finally{e()}},TE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,CE(this),wE(this),vE++;const e=fE;return fE=this,NE.bind(this,e)},TE.prototype.N=function(){2&this.f||(this.f|=2,this.u=hE,hE=this)},TE.prototype.d=function(){this.f|=8,1&this.f||AE(this)},TE.prototype.dispose=function(){this.d()};try{mE="0.48.0+prod.esm"}catch(Xh){}const IE=mE??'"<unknown>+source"',FE=new Set(["__proto__","constructor","prototype"]);function OE(e,t){if(e&&t&&!Array.isArray(t)&&"object"==typeof e&&"object"==typeof t){const n=e,r=t;for(const e in r)!FE.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=OE(n[e],r[e]));return e}return t}function PE(e){return 0===e.id}function ME(e){return 2===e.id}const LE=new Set;let zE=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):qw;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;ME(t)||DE(306,String(t.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n);let o;this.state=i,this.extension.init&&(o=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,o,r)}build(e){const t=this.state;let n;4!==t.id&&DE(307,String(t.id),String(5)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));const r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;const n=this.state;5!==n.id&&DE(308,String(n.id),String(5));const r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{const e=this.state;7!==e.id&&DE(309,String(n.id),String(7)),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){const t=this.state;let n;return 6!==t.id&&DE(310,String(t.id),String(6)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return void 0===this._signal&&DE(311),this._signal}getInitResult(){void 0===this.extension.init&&DE(312,this.extension.name);const e=this.state;return function(e){return e.id>=4}(e)||DE(313,String(e.id),String(4)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return function(e){return e.id>=3}(e)||DE(314,String(e.id),String(3)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&DE(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&DE(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return function(e){return e.id>=7}(e)||DE(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||LE}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(e){return e.id>=5})(e)||DE(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const jE={tag:Wv};function UE(){const e=nx();e.isEmpty()&&e.append(vb())}const BE=Bw({config:$w({setOptions:jE,updateOptions:jE}),init:({$initialEditorState:e=UE})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:r}=i;if(function(e){return e instanceof sb}(r))e.setEditorState(r,n);else if("function"==typeof r)e.update(()=>{r(e)},t);else if(r&&("string"==typeof r||"object"==typeof r)){const t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[tb,dy,lb,wy,gb]}),$E=Symbol.for("@lexical/extension/LexicalBuilder");function qE(){}function GE(e){throw e}function VE(e){return Array.isArray(e)?e:[e]}const KE=IE;class WE{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=KE,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[VE(BE)];for(const n of e)t.push(VE(n));return new WE(t)}static maybeFromEditor(e){const t=e[$E];return t&&(t.PACKAGE_VERSION!==KE&&DE(292,t.PACKAGE_VERSION,KE),t instanceof WE||DE(293)),t}static fromEditor(e){const t=WE.maybeFromEditor(e);return void 0===t&&DE(294),t}constructEditor(){const{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(wb({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[$E]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=qE;function t(){try{e()}finally{e=qE}}const n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Ww(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&DE(295,e.name),t}addEdge(e,t,n){const r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));const i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&DE(296);const t=VE(e),[n]=t;"string"!=typeof n.name&&DE(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&DE(298,n.name),!r){r=new zE(this,n),this.extensionNameMap.set(n.name,r);const e=this.conflicts.get(n.name);"string"==typeof e&&DE(299,n.name,e);for(const t of n.conflictsWith||[])this.extensionNameMap.has(t)&&DE(299,n.name,t),this.conflicts.set(t,n.name);for(const t of n.dependencies||[]){const e=VE(t);this.addEdge(n.name,e[0].name,e.slice(1)),this.addExtension(e)}for(const[t,r]of n.peerDependencies||[])this.addEdge(n.name,t,r?[r]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(n,r)=>{let i=n.state;if(ME(i))return;const o=n.extension.name;var s;PE(i)||DE(300,o,r||"[unknown]"),PE(s=i)||DE(304,String(s.id),String(0)),i=Object.assign(s,{id:1}),n.state=i;const a=this.outgoingConfigEdges.get(o);if(a)for(const e of a.keys()){const n=this.extensionNameMap.get(e);n&&t(n,o)}i=function(e){return function(e){return 1===e.id}(e)||DE(305,String(e.id),String(1)),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(const n of this.extensionNameMap.values())PE(n.state)&&t(n);for(const n of e)for(const[e,t]of this.outgoingConfigEdges.get(n.extension.name)||[])if(t.length>0){const n=this.extensionNameMap.get(e);if(n)for(const e of t)n.configs.add(e)}for(const[n,...r]of this.roots)if(r.length>0){const e=this.extensionNameMap.get(n.name);void 0===e&&DE(301,n.name);for(const t of r)e.configs.add(t)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(const o of t){const t=o.register(e,i);t&&r.push(t)}for(const o of t){const t=o.afterRegistration(e);t&&r.push(t)}return Ww(...r)}buildCreateEditorArgs(){const e={},t=new Set,n=new Map,r=new Map,i={},o={},s=this.sortedExtensionReps();for(const c of s){const{extension:s}=c;if(void 0!==s.onError&&(e.onError=s.onError),void 0!==s.onWarn&&(e.onWarn=s.onWarn),void 0!==s.disableEvents&&(e.disableEvents=s.disableEvents),void 0!==s.parentEditor&&(e.parentEditor=s.parentEditor),void 0!==s.editable&&(e.editable=s.editable),void 0!==s.namespace&&(e.namespace=s.namespace),void 0!==s.$initialEditorState&&(e.$initialEditorState=s.$initialEditorState),s.nodes)for(const e of RE(s)){if("function"!=typeof e){const t=n.get(e.replace);t&&DE(302,s.name,e.replace.name,t.extension.name),n.set(e.replace,c)}t.add(e)}if(s.html){if(s.html.export)for(const[e,t]of s.html.export.entries())r.set(e,t);s.html.import&&Object.assign(i,s.html.import)}s.theme&&OE(o,s.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(i).length>0,l=r.size>0;(a||l)&&(e.html={},a&&(e.html.import=i),l&&(e.html.export=r));for(const c of s)c.init(e);return e.onError||(e.onError=GE),e}}function HE(e,t){const n=WE.maybeFromEditor(e);if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}class JE extends Z_{static getType(){return"horizontalrule"}static clone(e){return new JE(e.__key)}static importJSON(e){return QE().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:XE,priority:0})}}exportDOM(){return{element:Gx().createElement("hr")}}createDOM(e){const t=Gx().createElement("hr");return Vw(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function XE(){return{node:QE()}}function QE(){return SS(JE)}function YE(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let ZE;function ek(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function tk(e){return ZE&&ZE.editor===e?ZE:void 0}function nk(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;return[n,r(ek(e,n))]}return t}function rk(e){return Object.create(e||null)}function ik(e,t){return[e,t]}function ok(e,t,n,r){return Object.assign(Zp(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}const sk="@lexical/html/DOM",ak=Symbol.for("@lexical/html/DOMExportContext"),lk=Symbol.for("@lexical/html/DOMImportContext");function ck(e,t,n){return ok(ak,e,t,n)}const uk=ck("isExport",Boolean);function dk(e=oS()){const t=function(e){const t=HE(e,sk);return t?t.output.runtime:void 0}(e);return t?t.getSessionConfig():sS(e)}const fk=function(e,t=()=>{}){return(n,r=oS())=>i=>{const o=tk(r),s=o&&o[e],a=function(e,t){let n=t;for(const r of e){const[e,i]=nk(n,r),o=e.key;if(n===t&&ek(n,e)===i)continue;const s=n===t||void 0===n?rk(t):n;s[o]=i,n=s}return n}(n,s||t(r));return a&&a!==s?function(e,t,n,r=oS()){const i=ZE,o=tk(r);try{return ZE={...o,editor:r,[e]:t},n()}finally{ZE=i}}(e,a,i,r):i()}}(ak,function(e){const t=HE(e,sk);return t?t.output.defaults:void 0}),hk=Symbol.for("@lexical/html/SelectorImpl");function pk(e,t){const n={kind:"element",predicate:(r=t,0===r.length?Qx:1===r.length?r[0]:(e,t)=>{for(const n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;const i=n=>pk(e,[...t,n]);return{[hk]:n,attr:(e,t,n)=>i(vk(e,t,n)),classAll:(...e)=>i(mk(e)),classAny:(...e)=>i(function(e){const t=gk(e);return 0===t.length?()=>!1:e=>{if(!Qx(e))return!1;const n=e.classList;for(const r of t)if(n.contains(r))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if("string"==typeof t)return n=>Qx(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Qx(t))return!1;const o=t.style.getPropertyValue(e);if(!o)return!1;const s=o.match(i);return null!==s&&(void 0!==r&&(n[r]=s),!0)}}YE(362,JSON.stringify(e))}(e,t,n))}}function gk(e){const t=[];for(const n of e)n&&t.push(n);return t}function mk(e){const t=gk(e);return 0===t.length?()=>!0:e=>{if(!Qx(e))return!1;const n=e.classList;for(const r of t)if(!n.contains(r))return!1;return!0}}function vk(e,t,n){if(!0===t)return t=>Qx(t)&&t.hasAttribute(e);if("string"==typeof t)return n=>Qx(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Qx(t))return!1;const o=t.getAttribute(e);if(null==o)return!1;const s=o.match(i);return null!==s&&(void 0!==r&&(n[r]=s),!0)}}YE(361,JSON.stringify(e))}const yk={kind:"text",predicate:Ub,tags:new Set},_k={[hk]:yk},bk={kind:"comment",predicate:e=>8===e.nodeType,tags:new Set},xk={[hk]:bk},Sk={any:()=>pk(new Set,[]),comment:()=>xk,tag(...e){e.length>0||YE(363);const t=new Set;for(const n of e)t.add(n.toUpperCase());return pk(t,[])},text:()=>_k};function wk(e,t){return Qx(e)&&e.nodeName===t.toUpperCase()}const Ek=/[A-Za-z0-9_-]/;let kk=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){const e=this.pos;for(;!this.eof()&&Ek.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){const e=this.consume();this.assert('"'===e||"'"===e,"expected quote");const t=this.pos;for(;!this.eof()&&this.peek()!==e;)"\\"===this.peek()?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");const n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(e,t){e||YE(364,String(this.pos+1),t,this.source)}};function Ck(e){const t=new Set,n=[],r=[];if(e.skipWhitespace(),"*"===e.peek())e.consume();else if(Ek.test(e.peek())){const n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){const t=e.peek();if("."===t){e.consume();const t=e.readIdent();e.assert(""!==t,'expected class name after "."'),r.push(t)}else if("#"===t){e.consume();const t=e.readIdent();e.assert(""!==t,'expected id after "#"'),n.push(vk("id",t))}else{if("["!==t)break;{e.consume(),e.skipWhitespace();const t=e.readIdent();e.assert(""!==t,'expected attribute name after "["'),e.skipWhitespace();let r=!0;if("="===e.peek()){e.consume(),e.skipWhitespace();const t=e.peek();'"'===t||"'"===t?r=e.readQuoted():(r=e.readIdent(),e.assert(""!==r,"expected attribute value")),e.skipWhitespace()}e.assert("]"===e.peek(),'expected "]"'),e.consume(),n.push(vk(t,r))}}}return r.length>0&&n.push(mk(r)),{predicates:n,tags:t}}function Ak(e){return e}function Nk(e,t,n){return ok(lk,e,t,n)}const Tk=Nk("textFormat",()=>0),Rk=Nk("textStyle",()=>({}));function Dk(e){if(!Qx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Ik(e){if(Ub(e))return!0;if(!Qx(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!rS(e)&&tS(e)}const Fk=Nk("whitespaceConfig",()=>({isInline:Ik,preservesWhitespace:Dk}));function Ok(e){return Zy(e)||eb(e)&&!e.isInline()}function Pk(e,t){if(!Qx(t))return e;const n=t.style.textAlign;if(!zk(n))return e;for(const r of e)Zy(r)&&""===r.getFormatType()&&r.setFormat(n);return e}const Mk=Sk,Lk=new Set(["center","end","justify","left","right","start"]);function zk(e){return Lk.has(e)}const jk={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Uk={CODE:16,MARK:128},Bk=new Set(["font-weight","font-style","text-decoration","vertical-align"]);Mk.tag("b","strong","em","i","code","mark","s","sub","sup","u","span");function $k(e,t,n){let r=e;for(;;){let e=null;for(;null===(e=t?r.nextSibling:r.previousSibling);){const e=r.parentNode;if(null===e)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;null!==(i=t?r.firstChild:r.lastChild);)r=i;if(Ub(r))return r;if("BR"===r.nodeName)return null}}function qk(e,t){return 0!==t&&xy(e)?e.setFormat(t):e}function Gk(e,t){if(xy(e)){const n=function(e){let t="";for(const n in e)Bk.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);""!==n&&e.setStyle(n)}return e}Mk.text(),Mk.tag("script","style"),Mk.tag("br"),Mk.tag("p"),Mk.tag("hr");function Vk(e,t){const n=[];let r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function Kk(e){const t=[],n=new Map,r=[],i=[],o=[],s=new Set;e.forEach((e,a)=>{const l=function(e){const t=e[hk];return void 0===t&&YE(360),t}(e.match),c=e.name||function(e,t){if("text"===e.kind)return`#text@${t}`;if("comment"===e.kind)return`#comment@${t}`;if(0===e.tags.size)return`*@${t}`;return`${Array.from(e.tags).join(",").toLowerCase()}@${t}`}(l,a);if(e.name&&s.add(e.name),t.push({$import:e.$import,name:c,predicate:l.predicate}),"text"===l.kind)i.push(a);else if("comment"===l.kind)o.push(a);else if(0===l.tags.size)r.push(a);else for(const t of l.tags){let e=n.get(t);e||(e=[],n.set(t,e)),e.push(a)}});const a=new Map;if(0===r.length)for(const[l,c]of n)a.set(l,c);else for(const[l,c]of n)a.set(l,Vk(c,r));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:r}}function Wk(e){return"object"==typeof e&&null!==e&&"__type"in e&&"CompiledOverlayRules"===e.__type}function Hk(e){const t=function(e){const t=[];for(const n of e)if(Wk(n))for(const e of n.rules)t.push(e);else t.push(n);return t}(e);return{__type:"CompiledOverlayRules",dispatch:Kk(t),rules:t}}Mk.any(),Sk.any();const Jk={any:Sk.any,comment:Sk.comment,css:function(e){const t=new kk(e,0),n=[];for(;;){const e=Ck(t);if(n.push(e),t.skipWhitespace(),t.eof())break;t.assert(","===t.peek(),'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(1===n.length)return pk(n[0].tags,n[0].predicates);const r=new Set;for(const i of n)for(const e of i.tags)r.add(e);return pk(r,[(e,t)=>{for(const r of n){const n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(const o of r.predicates)if(!o(e,t)){i=!1;break}if(i)return!0}return!1}])},tag:Sk.tag,text:Sk.text},Xk=new Set(["STYLE","SCRIPT"]);function Qk(e,t){!function(e){if(!Bb(e))return;const t=e;if(null===t.querySelector("style"))return;const n=new Map;function r(e){let t=n.get(e);if(void 0===t){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(const n of Array.from(t.styleSheets)){let i;try{i=n.cssRules}catch(e){continue}for(const n of Array.from(i)){if(!aE(n,CSSStyleRule))continue;let i;try{i=t.querySelectorAll(n.selectorText)}catch(e){continue}for(const e of Array.from(i)){if(!Qx(e))continue;const t=r(e);for(let r=0;r<n.style.length;r++){const i=n.style[r];t.has(i)||e.style.setProperty(i,n.style.getPropertyValue(i),n.style.getPropertyPriority(i))}}}}}catch(e){}}(t);const n=Bb(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const o of n)if(!Xk.has(o.nodeName)){const t=eC(o,e,i,!1);if(null!==t)for(const e of t)r.push(e)}return function(e){for(const t of e)t.getParent()&&t.getNextSibling()instanceof ab&&t.insertAfter(ub());for(const t of e){const e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Yk(e,t=null){return("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)&&YE(338),function(e){null!==I_()&&null===S_&&(S_=e),S_!==e&&Qh(378)}(e),function(e,t=null,n=oS()){return fk([ik(uk,!0)],n)(()=>{const r=nx(),i=dk(n),o=Iy(t)?DS(t.anchor.getNode()):null,s=e.append.bind(e);for(const e of(Q_(o)?o:r).getChildren())Zk(n,e,s,t,i);return e})}(Gx().createElement("div"),t,e).innerHTML}function Zk(e,t,n,r=null,i=sS(e)){let o=i.$shouldInclude(t,r,e);const s=i.$shouldExclude(t,r,e);let a=t;null!==r&&xy(t)&&(a=Qw(r,t,"clone"));const l=i.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;const h=Gx().createDocumentFragment(),p=f?f():Q_(a)?a.getChildren():[],g=o&&Oy(r)&&Q_(t)?null:r,m=h.append.bind(h);for(const v of p){const n=Zk(e,v,m,g,i);!o&&n&&i.$extractWithChild(t,v,r,"html",e)&&(o=!0)}if(o&&!s){if((Qx(c)||Zx(c))&&(d?d(h):c.append(h)),n(c),u){const e=u.call(a,c);e&&(Zx(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(h);return o}function eC(e,t,n,r,i=new Map,o){const s=[];if(Xk.has(e.nodeName))return s;let a=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const o of r){const t=o(e);null!==t&&(null===i||(i.priority||0)<=(t.priority||0))&&(i=t)}return null!==i?i.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(a=Array.isArray(t)?t[t.length-1]:t,null!==a){for(const[,e]of i)if(a=e(a,o),!a)break;a&&s.push(...Array.isArray(t)?t:[a])}null!=c.forChild&&i.set(e.nodeName,c.forChild)}const d=e.childNodes;let f=[];const h=(null==a||!Ix(a))&&(null!=a&&Zy(a)||r);for(let p=0;p<d.length;p++)f.push(...eC(d[p],t,n,h,new Map(i),a));if(null!=u&&(f=u(f)),rS(e)&&(f=function(e,t,n){const r=e.style.textAlign,i=[];let o=[];for(let s=0;s<t.length;s++){const e=t[s];if(Zy(e))r&&!e.getFormat()&&e.setFormat(r),i.push(e);else if(o.push(e),s===t.length-1||s<t.length-1&&Zy(t[s+1])){const e=n();e.setFormat(r),e.append(...o),i.push(e),o=[]}}return i}(e,f,h?()=>{const e=new ab;return n.push(e),e}:vb)),null==a)if(f.length>0)for(const p of f)s.push(p);else rS(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(tS(e.nextSibling)&&tS(e.previousSibling))}(e)&&s.push(ub());else Q_(a)&&a.append(...f);return s}function tC(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function nC(e){const t=e.getParent();EC(t)||tC(40);let n=t,r=t;for(;null!==r;)r=r.getParent(),EC(r)&&(n=r);return n}function rC(e){let t=[];const n=e.getChildren().filter(yC);for(let r=0;r<n.length;r++){const e=n[r],i=e.getFirstChild();EC(i)?t=t.concat(rC(i)):t.push(e)}return t}function iC(e){return yC(e)&&EC(e.getFirstChild())}function oC(e,t){return yC(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function sC(e){const t=i_();if(null!==t){let n=t.getNodes();if(Iy(t)){const[r]=t.getStartEndPoints(),i=r.getNode(),o=i.getParent();if(Ix(i)){const e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=vb();i.append(e),n=e.select().getNodes()}}else if(oC(i,n)){const t=wC(e);if(Ix(o)){i.replace(t);const e=vC();Q_(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(yC(i)){const e=i.getParentOrThrow();aC(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(Q_(i)&&i.isEmpty()&&!yC(i)&&!r.has(i.getKey())){lC(i,e);continue}let o=qb(i)?i.getParent():yC(i)&&i.isEmpty()?i:null;for(;null!=o;){const t=o.getKey();if(EC(o)){if(!r.has(t)){const n=wC(e);aC(n,o.getChildren()),o.replace(n),r.add(t)}break}{const n=o.getParent();if(Ix(n)&&!r.has(t)){r.add(t),lC(o,e);break}o=n}}}}}function aC(e,t){e.splice(e.getChildrenSize(),0,t)}function lC(e,t){if(EC(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=vC();let o;if(aC(i,e.getChildren()),EC(n)&&t===n.getListType())n.append(i),EC(r)&&t===r.getListType()&&(aC(n,r.getChildren()),r.remove()),o=n;else if(EC(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=wC(t);n.append(i),e.replace(n),o=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=i_();return Iy(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),e.remove(),o}function cC(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&iC(n)&&iC(r)&&(cC(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function uC(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())yC(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),EC(r.getFirstChild())||n++)}function dC(e){const t=new Set;if(iC(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(iC(r)&&iC(i)){const n=i.getFirstChild();if(EC(n)){n.append(e);const i=r.getFirstChild();EC(i)&&(aC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(iC(r)){const t=r.getFirstChild();if(EC(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(iC(i)){const t=i.getFirstChild();EC(t)&&t.append(e)}else if(EC(n)){const t=Fx(e),o=Fx(n);t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function fC(e){if(iC(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(EC(n?n.getParent():void 0)&&yC(n)&&EC(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=Fx(e),i=Fx(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));const o=Fx(e),s=Fx(t);o.append(s),aC(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(o),n.replace(e)}}}let hC=class extends X_{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(EC(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();EC(n)||tC(340);const r=[e];for(const t of["previous","next"]){r.reverse();for(const{origin:n}of sw(e,t)){if(!yC(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Ix(t)||(Uw(n,Nw(sw(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:X_,importDOM:{li:()=>({conversion:pC,priority:0})}})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=Gx().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t){const n=t.getParent();!EC(n)||"check"!==n.getListType()||EC(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this),t.value=this.__value,function(e,t,n){const r=t.list;if(!r)return;const i=r.listitem,o=r.nested&&r.nested.listitem,s=n.getParent(),a=EC(s)&&"check"===s.getListType(),l=n.getChecked(),c=n.getChildren().some(e=>EC(e)),u=[];void 0!==r.listitemChecked&&u.push(r.listitemChecked),void 0!==r.listitemUnchecked&&u.push(r.listitemUnchecked),void 0!==o&&u.push(...Gw(o)),u.length>0&&Kw(e,...u);const d=[];if(void 0!==i&&d.push(...Gw(i)),a){const e=l?r.listitemChecked:r.listitemUnchecked;void 0!==e&&d.push(e)}void 0!==o&&c&&d.push(...Gw(o)),d.length>0&&Vw(e,...d)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&ry(t.style,i,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const o=ty(r);for(const s in o)e.style.setProperty(`--listitem-marker-${s}`,o[s]);if(""!==i)for(const s in ty(i))s in o||e.style.removeProperty(`--listitem-marker-${s}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),iC(this)?{after(e){if(Qx(e)){const t=e.previousElementSibling;if(Qx(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(Q_(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(yC(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!EC(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=Fx(n);let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}const r=this.__key;let i=0;if(t&&(Q_(e)||tC(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&Q_(e)){const t=i_();if(Iy(t))for(const n of t.getStartEndPoints())n.key===r&&"element"===n.type&&n.set(e.getKey(),i+n.offset,"element")}return this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(EC(n)||tC(39),yC(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=Fx(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&iC(t)&&iC(n)&&(cC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=Fx(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(iC(this))return!1;const t=this.getParentOrThrow();if(yC(t.getParentOrThrow()))return fC(this),!0;const n=vb().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){const e=Fx(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),0===t.getChildrenSize()&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return EC(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;yC(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&tC(117),(e=Math.floor(e))>=0||tC(199);let t=this.getIndent();for(;t!==e;)t<e?(dC(this),t++):(fC(this),t--);return this}canInsertAfter(e){return yC(e)}canReplaceWith(e){return yC(e)}canMergeWith(e){return yC(e)||yb(e)}extractWithChild(e,t){if(!Iy(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return wC("bullet")}canMergeWhenEmpty(){return!0}};function pC(e){if(e.classList.contains("task-list-item"))for(const r of e.children)if("INPUT"===r.tagName)return gC(r);if(e.classList.contains("joplin-checkbox"))for(const r of e.children)if(r.classList.contains("checkbox-wrapper")&&r.children.length>0&&"INPUT"===r.children[0].tagName)return gC(r.children[0]);const t=e.getAttribute("aria-checked"),n=vC("true"===t||"false"!==t&&void 0);return gS(n,e),{after:mC.bind(null,n),node:pS(n,e)}}function gC(e){if("checkbox"!==e.getAttribute("type"))return{node:null};const t=vC(e.hasAttribute("checked"));return{after:mC.bind(null,t),node:t}}function mC(e,t){const n=t[0];return 1===t.length&&yb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function vC(e){return Ox(new hC(void 0,e))}function yC(e){return e instanceof hC}let _C=class extends X_{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();EC(t)&&e.getListType()===t.getListType()&&cC(e,t)}(e),uC(e)},extends:X_,importDOM:{ol:()=>({conversion:xC,priority:0}),ul:()=>({conversion:xC,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=SC[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=Gx().createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,bC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(bC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Qx(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let i=0;i<n.length;i++){const e=n[i];yC(e)||(r===n&&(r=[...n]),r[i]=this.createListItemNode().append(!Q_(e)||EC(e)||e.isInline()?e:by(e.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return yC(e)}createListItemNode(){return vC()}};function bC(e,t,n){const r=[],i=[],o=t.list;if(void 0!==o){const e=o[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(yC(n)){const e=n.getParent();if(EC(e)){t++,n=e.getParent();continue}tC(40)}return t}return t}(n)-1,s=t%e.length,a=e[s],l=o[n.__tag];let c;const u=o.nested,d=o.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==a){r.push(...Gw(a));for(let t=0;t<e.length;t++)t!==s&&i.push(n.__tag+t)}if(void 0!==c){const e=Gw(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&Kw(e,...i),r.length>0&&Vw(e,...r)}function xC(e){let t;if(function(e){return Qx(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const n=e.start;t=wC("number",n)}else t=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(Qx(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?wC("check"):wC("bullet");return pS(t,e),{after:e=>function(e,t){const n=t.createListItemNode.bind(t),r=[];for(let i=0;i<e.length;i++){const t=e[i];if(yC(t)){r.push(t);const e=t.getChildren();e.length>1&&e.forEach(e=>{EC(e)&&r.push(n().append(e))})}else r.push(n().append(t))}return r}(e,t),node:t}}const SC={ol:"number",ul:"bullet"};function wC(e="number",t=1){return Ox(new _C(e,t))}function EC(e){return e instanceof _C}function kC(e){const t=[];for(const n of e)if(yC(n)){t.push(n);const e=n.getChildren();if(e.length>1)for(const n of e)EC(n)&&t.push(vC().append(n))}else t.push(vC().append(n));return t}Jk.tag("ol","ul");function CC(e,t){if(1!==t.length)return t;const n=t[0];return yb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function AC(e){const t=e=>Ok(e)&&!EC(e);if(!e.some(t))return e;const n=[];let r=[];const i=()=>{r.length>0&&(n.push(r),r=[])};for(const s of e)t(s)?(i(),n.push(Q_(s)?s.getChildren():[s])):r.push(s);i();const o=[];for(const s of n)o.length>0&&o.push(ub()),o.push(...s);return o}Jk.tag("li");Jk.tag("li").classAll("task-list-item"),Jk.tag("li").classAll("joplin-checkbox");const NC=hm("UPDATE_LIST_START_COMMAND"),TC=hm("INSERT_UNORDERED_LIST_COMMAND"),RC=hm("INSERT_ORDERED_LIST_COMMAND"),DC=hm("REMOVE_LIST_COMMAND");function IC(e,t){return Ww(e.registerCommand(RC,()=>(sC("number"),!0),1),e.registerCommand(NC,e=>{const{listNodeKey:t,newStart:n}=e,r=Jb(t);return!!EC(r)&&("number"===r.getListType()&&(r.setStart(n),uC(r)),!0)},1),e.registerCommand(TC,()=>(sC("bullet"),!0),1),e.registerCommand(DC,()=>(function(){const e=i_();if(Iy(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(oC(r,n))t.add(nC(r));else for(let e=0;e<n.length;e++){const r=n[e];if(qb(r)){const e=oE(r,hC);null!=e&&t.add(nC(e))}}for(const i of t){let t=i;const n=rC(i);for(const r of n){const n=vb().setTextStyle(e.style).setTextFormat(e.format);aC(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&Ew(e.anchor,Iw(uw(n,"next"))),r.__key===e.focus.key&&Ew(e.focus,Iw(uw(n,"next"))),r.remove()}i.remove()}}}(),!0),1),e.registerCommand(wm,()=>function(e=!1){const t=i_();if(!Iy(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(yC(n)&&0===n.getChildrenSize())r=n;else if(xy(n)){const e=n.getParent();yC(e)&&e.getChildren().every(e=>xy(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;const i=nC(r),o=r.getParent();EC(o)||tC(40);const s=o.getParent();let a;if(Ix(s))a=vb(),i.insertAfter(a);else{if(!yC(s))return!1;a=Fx(s),s.insertAfter(a)}a.setTextStyle(t.style).setTextFormat(t.format).select();const l=r.getNextSiblings();if(l.length>0){const t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(o,r):1,n=Fx(o).setStart(t);if(yC(a)){const e=Fx(a);e.append(n),a.insertAfter(e)}else a.insertAfter(n);n.append(...l)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!yC(e)&&!EC(e))break;t=e}t.remove()}(r),!0}(!1),1),e.registerCommand($m,e=>{if(function(){const e=i_();if(!Iy(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode(),n=wS(t,yC);if(!yC(n))return!1;const r=n.getFirstDescendant();if(null===r)return!1;if(!n.is(t)&&!r.is(t))return!1;const i=n.getParent();if(!EC(i)||!n.is(i.getFirstChild()))return!1;const o=i.getPreviousSibling();if(!eb(o)||o.isIsolated()||!o.isKeyboardSelectable()&&o.isInline())return!1;const s=vb().append(...n.getChildren());return i.insertBefore(s),n.remove(),i.isEmpty()&&i.remove(),s.selectStart(),!0}())return e.preventDefault(),!0;const t=i_();if(!Iy(t)||!t.isCollapsed())return!1;const{anchor:n}=t;if(0!==n.offset)return!1;let r=n.getNode();for(;!yC(r);){if(null!==r.getPreviousSibling())return!1;const e=r.getParent();if(null===e)return!1;r=e}return!(!yC(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(hC,e=>{const t=e.getFirstChild();if(t){if(xy(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=i_();Iy(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(dy,e=>{const t=e.getParent();if(yC(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function FC(e,t,n){let r=n(),i=0,o=r,s=0,a=null;return(l,c,u,d,f,h)=>{const p=n();if(h.has(Zv)&&(o=r,s=i,a=l),h.has(Vv))return i=0,r=p,2;h.has(ey)&&a&&(r=o,i=s,l=a);const g=h.has(Hv)||h.has("cut")?0:function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const o=t._selection,s=e._selection;if(i)return 1;if(!(Iy(o)&&Iy(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const o of t){const e=r.get(o);void 0!==e&&i.push(e)}for(const[o,s]of n){if(!s)continue;const e=r.get(o);void 0===e||nb(e)||i.push(e)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(o.anchor.key),i=n.get(s.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&xy(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!xy(c)||!xy(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const f=o.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return 0;const p=f.offset,g=h.offset,m=d.length-u.length;return 1===m&&g===p-1?2:-1===m&&g===p+1?3:-1===m&&g===p?4:0}(l,c,d,f,e.isComposing()),m=(()=>{const n=null===u||u.editor===e,o=h.has(Kv);if(!o&&n&&h.has(Wv))return 0;if(1===g)return 2;if(null===l)return 1;const s=c._selection;if(!(d.size>0||f.size>0))return null!==s?0:2;return!1===o&&0!==g&&g===i&&p<r+t&&n||1===d.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),o=t._selection,s=n._selection;return!(Iy(o)&&Iy(s)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!xy(r)||!xy(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],l,c)?0:1})();return r=p,i=g,m}}function OC(e,t){e.undoStack=[],e.redoStack=[],e.current=null}function PC(e){return function(e,t){let n=e;for(let r=sw(e,t);r&&(YC(r.origin)||ky(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}(e,"previous")}function MC(e,t){for(const n of e.childNodes){if(Qx(n)&&n.tagName===t)return!0;if(MC(n,t))return!0}return!1}const LC="data-language",zC="data-highlight-language",jC="data-theme";class UC extends X_{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new UC(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=Gx().createElement("code");Vw(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(LC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(zC,n));const r=this.getTheme();r&&t.setAttribute(jC,r);const i=this.getStyle();return i&&ry(t.style,i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(LC,r):i&&t.removeAttribute(LC);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&t.setAttribute(zC,r):t.removeAttribute(zC):o&&r&&t.setAttribute(zC,r);const s=this.__theme,a=e.__theme;s?s!==a&&t.setAttribute(jC,s):a&&t.removeAttribute(jC);const l=this.__style,c=e.__style;return l!==c&&ry(t.style,l,c),!1}exportDOM(e){const t=Gx().createElement("pre");Vw(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(LC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(zC,n));const r=this.getTheme();r&&t.setAttribute(jC,r);const i=this.getStyle();return i&&ry(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||MC(e,"BR"))?{conversion:qC,priority:1}:null,div:()=>({conversion:GC,priority:1}),pre:()=>({conversion:qC,priority:0}),table:e=>HC(e)?{conversion:VC,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&HC(n)?{conversion:KC,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&HC(t)?{conversion:KC,priority:3}:null}}}static importJSON(e){return BC().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!HE(oS(),"@lexical/code")){const t=function(e){const{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){const e=t.getNode();if($C(e)){const n=e.getChildrenSize();if(n>=2&&t.offset===n){const t=e.getLastChild();if(db(t)&&db(t.getPreviousSibling())){const t=vb();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}(e);if(t)return t}const{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(xy(i)){let e=PC(i);const t=[];for(;;)if(ky(e))t.push(Ey()),e=e.getNextSibling();else{if(!YC(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(QC(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const r=i.splitText(n.offset)[0],o=0===n.offset?0:1,s=r.getIndexWithinParent()+o,a=i.getParentOrThrow(),l=[ub(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===n.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if($C(i)){const{offset:t}=e.anchor;i.splice(t,0,[ub()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=vb();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function BC(e,t){return SS(UC).setLanguage(e).setTheme(t)}function $C(e){return e instanceof UC}function qC(e){return{node:BC(e.getAttribute(LC))}}function GC(e){const t=e,n=WC(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(WC(t))return!0;t=t.parentElement}return!1}(t)?{node:n?BC():null}:{node:null}}function VC(){return{node:BC()}}function KC(){return{node:null}}function WC(e){return null!==e.style.fontFamily.match("monospace")}function HC(e){return e.classList.contains("js-file-line-container")}class JC extends dy{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new JC(e.__text,e.__highlightType||void 0,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return Vw(t,XC(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=XC(n.theme,e.__highlightType),o=XC(n.theme,this.__highlightType);return i!==o&&(i&&Kw(t,i),o&&Vw(t,o)),r}static importJSON(e){return QC().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return BC()}}function XC(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function QC(e="",t){return Ox(new JC(e,t))}function YC(e){return e instanceof JC}const ZC="data-language";function eA(e){return null!==e.style.fontFamily.match("monospace")}function tA(e){let t=e.parentElement;for(;null!==t;){if(eA(t))return!0;t=t.parentElement}return!1}Jk.tag("tr","td"),Jk.tag("pre"),Jk.tag("code");Jk.tag("div"),Jk.tag("div","br");Jk.tag("div");Jk.tag("table").classAll("js-file-line-container"),Jk.tag("td").classAll("js-file-line");const nA=new Set(["http:","https:","mailto:","sms:","tel:"]);let rA=class e extends X_{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){const t=Gx().createElement("a");return this.updateLinkDOM(null,t,e),Vw(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Xx(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:iA,priority:1})}}static importJSON(e){return oA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){const t=e;e=fA(e);try{const t=new URL(fA(e));if(!nA.has(t.protocol))return"about:blank"}catch(e){const n=t.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(null!=n&&!nA.has(`${n[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Fx(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Iy(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}};function iA(e){let t=null;if(Xx(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=oA(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function oA(e="",t){return Ox(new rA(e,t))}function sA(e){return e instanceof rA}let aA=class e extends rA{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return"autolink"}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Gx().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return lA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=lA(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function lA(e="",t){return Ox(new aA(e,t))}function cA(e){return e instanceof aA}function uA(e,t){if("element"===e.type){const n=e.getNode();return Q_(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}const dA=/^\+?[0-9\s()-]{5,}$/;function fA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:dA.test(e)?`tel:${e}`:`https://${e}`}function hA(e,t,n=null){const r=qx(n),i=n?Bx(n):[],o=null!==n&&i.length>0;if(o&&"function"==typeof r.caretPositionFromPoint){const o=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(null!==o&&function(e,t){for(let n=e;null!==n;){if(n===t)return!0;n=Ex(n)}return!1}(o.offsetNode,n))return{node:o.offsetNode,offset:o.offset}}if(o){const i=n.getRootNode();if(jx(i)){const o=i.elementFromPoint(e,t);if(null!==o&&n.contains(o)){const n=function(e,t,n,r){const i=r.createRange(),o=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,s=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,a=r.createTreeWalker(n,NodeFilter.SHOW_TEXT);let l=null,c=1/0,u=1/0;for(let p=a.nextNode();p;p=a.nextNode()){i.selectNodeContents(p);for(const e of i.getClientRects()){const t=o(e),n=s(e);(t<c||t===c&&n<u)&&(c=t,u=n,l=p)}}if(null===l)return null;let d=0,f=1/0,h=1/0;for(let p=0;p<=l.length;p++){i.setStart(l,p),i.collapse(!0);const t=i.getBoundingClientRect(),n=o(t),r=Math.abs(e-t.left);(n<f||n===f&&r<h)&&(f=n,h=r,d=p)}return{node:l,offset:d}}(e,t,o,r);if(null!==n)return n}}}if("function"==typeof r.caretRangeFromPoint){const n=r.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("function"==typeof r.caretPositionFromPoint){const n=r.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}function pA(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}Jk.tag("a");const gA={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};const mA=(e,t)=>{if(!Iy(t))return t.insertRawText(e),!0;const n=e=>{const t=i_();Iy(t)&&e(t)};return h_(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([Ey()])),text:e=>n(t=>t.insertText(e))}),!0},vA={"application/x-lexical-editor":[(e,t,n)=>{try{const n=oS(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return AA(n,function(e){const t=[];for(const n of e)t.push(j_(n));return t}(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{const n=oS(),r=(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(e),"text/html");return AA(n,Qk(n,r),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[mA],"text/uri-list":[mA]};function yA(e,t,n,r){if(!e)return!1;const i=o=>!!e[o]&&e[o](t,n,i.bind(null,o-1),r);return i(e.length-1)}function _A(e,t,n){const r=t.getData("text/plain");for(const i of function(e){return Object.keys(e.$importMimeType).filter(t=>void 0!==e.$importMimeType[t]).sort((t,n)=>{const r=e.priority[t],i=e.priority[n];return void 0===r&&void 0===i?t<n?-1:t>n?1:0:void 0===r?1:void 0===i?-1:r-i})}(e)){const o=t.getData(i);if(o&&("text/html"!==i||o!==r)&&yA(e.$importMimeType[i],o,n,t))return!0}return!1}const bA={$importMimeType:vA,$insertDataTransfer:(e,t)=>_A({$importMimeType:vA,priority:gA},e,t),priority:gA},xA=Bw({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>_A(t,e,n),priority:t.priority}),config:$w({$importMimeType:vA,priority:gA}),mergeConfig(e,t){const n=qw(e,t);if(t.$importMimeType){const r={...e.$importMimeType};for(const[e,n]of Object.entries(t.$importMimeType))if(n){const t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"});function SA(e,t=i_()){return null==t&&pA(166),Iy(t)&&t.isCollapsed()||0===t.getNodes().length?"":Yk(e,t)}function wA(e,t=i_()){return null==t&&pA(166),Iy(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=nx(),i=Iy(t)?t.anchor.getNode():Oy(t)?t.getNodes()[0]??null:null,o=null!==i?DS(i):null,s=(Q_(o)?o:r).getChildren();for(let a=0;a<s.length;a++)NA(e,t,s[a],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}function EA(e,t,n){(function(){const e=function(e){return HE(oS(),e)}(xA.name);return e?e.output:bA})().$insertDataTransfer(e,t)}const kA="application/x-lexical-drag";function CA(e,t){return function(e,t,n){const r=e.dataTransfer;if(null===r)return!1;const i=function(e){const t=e.getData(kA);if(!t)return null;let n;try{n=JSON.parse(t)}catch(e){return null}return null!==(r=n)&&"object"==typeof r&&"editorKey"in r&&"string"==typeof r.editorKey?n:null;var r}(r);if(null===i)return!1;const o=function(e,t){const n=hA(e.clientX,e.clientY,t.getRootElement());if(null===n)return null;const r=Zb(n.node);if(null===r)return null;if(xy(r))return aw(r,"next",n.offset);if(Q_(r))return Mw(r,n.offset,"next");const i=r.getParent();return null===i?null:Mw(i,r.getIndexWithinParent()+1,"next")}(e,t);if(null===o)return!1;const s=jw(o);if(null===s)return!1;const a=i.editorKey===t.getKey(),l=i_();if(a){if(!Iy(l)||l.isCollapsed())return!1;if(function(e,t){const{anchor:n,focus:r}=Pw(Aw(t),"next");return yw(n,e)<0&&yw(e,r)<0}(o,l))return e.preventDefault(),!0;l.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(n(r,kw(gw(s)),t),!a){const e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(const n of $x(t)){const t=Lb(n);if(Pb(t)&&t.getKey()===e&&Qx(n))return n}return null}(i.editorKey,n):null;null!==r&&r.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}(e,t,EA)}function AA(e,t,n){e.dispatchCommand(gm,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Iy(e)&&e.isCollapsed()){let t=null;const n=ww(e.anchor,"previous");if(n)if(ew(n))t=n.origin;else{const e=mw(n,uw(nx(),"next").getFlipped());for(const n of e){if(xy(n.origin)){t=n.origin;break}if(Q_(n.origin)&&!n.origin.isInline())break}}if(t&&xy(t)){const n=t.getFormat(),r=t.getStyle();e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}}}(n))}function NA(e,t,n,r=[]){let i=null===t||n.isSelected(t);const o=Q_(n)&&n.excludeFromCopy("html");let s=n;null!==t&&xy(s)&&(s=Qw(t,s,"clone"));const a=Q_(s)?s.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&pA(58,n.name),Q_(e)){const e=t.children;Array.isArray(e)||pA(59,n.name)}return t}(s);xy(s)&&0===s.getTextContentSize()&&(i=!1);const c=i&&Oy(t)&&Q_(n)?null:t;for(let u=0;u<a.length;u++){const r=a[u],o=NA(e,c,r,l.children);!i&&Q_(n)&&o&&n.extractWithChild(r,t,"clone")&&(i=!0)}if(i&&!o){const t=FS(s);if(t.length>0){const n={};for(const r of t){const t=OS(s,r);null===t&&pA(366,s.constructor.name,r);const i=[];NA(e,null,t,i),1===i.length&&i[0].type===t.getType()||pA(385,r,s.constructor.name,String(i.length),String(i.length>0?i[0].type:"none")),n[r]=i[0]}l.$slots=n}}if(i&&!o)r.push(l);else if(Array.isArray(l.children))for(let u=0;u<l.children.length;u++){const e=l.children[u];r.push(e)}return i}let TA=null;async function RA(e,t,n){if(null!==TA)return!1;if(null!==t)return new Promise((r,i)=>{e.update(()=>{r(DA(e,t,n))})});const r=e.getRootElement(),i=e._window||window,o=i.document,s=zx(i);if(null===r||null===s)return!1;const a=o.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(o.createTextNode("#")),r.append(a);const l=o.createRange();return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((t,r)=>{const s=e.registerCommand(ev,r=>(aE(r,ClipboardEvent)&&(s(),null!==TA&&(i.clearTimeout(TA),TA=null),t(DA(e,r,n))),!0),4);TA=i.setTimeout(()=>{s(),TA=null,t(!1)},50),o.execCommand("copy"),a.remove()})}function DA(e,t,n){if(void 0===n){const t=zx(e._window),r=i_();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=Kx(t,e.getRootElement()),o=i.anchorNode,s=i.focusNode;if(null!==o&&null!==s&&!Ob(e,o,s))return!1;n=FA(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(OA(r,n),!0)}const IA=[["text/html",SA],["application/x-lexical-editor",wA]];function FA(e=i_()){return function(e,t){const n={"text/plain":""};for(const[r,i]of Object.entries(e))if(i){const e=MA(i,t);null!==e&&(n[r]=e)}return n}(function(e=oS()){const t=HE(e,LA.name);return t?t.output:PA}(),e)}function OA(e,t){for(const[n]of IA)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}const PA={"application/x-lexical-editor":[(e,t)=>e?wA(oS(),e):t()],"text/html":[(e,t)=>e?SA(oS(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function MA(e,t){const n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}const LA=Bw({build:(e,t,n)=>t.$exportMimeType,config:$w({$exportMimeType:PA}),mergeConfig(e,t){const n=qw(e,t);if(t.$exportMimeType){const r={...e.$exportMimeType};for(const[e,n]of Object.entries(t.$exportMimeType))if(n){const t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"});Jk.tag("h1","h2","h3","h4","h5","h6"),Jk.tag("blockquote");Jk.tag("blockquote"),Jk.tag("p"),Jk.tag("span");const zA=hm("DRAG_DROP_PASTE_FILE"),jA=Zp("shadowRoot",{parse:Boolean});class UA extends X_{static getType(){return"quote"}static clone(e){return new UA(e.__key)}$config(){return this.config("quote",{extends:X_,stateConfigs:[{flat:!0,stateConfig:jA}]})}isShadowRoot(){return eg(this,jA)}setIsShadowRoot(e){return tg(this,jA,e)}createDOM(e){const t=Gx().createElement("blockquote");return Vw(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:KA,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Qx(t)){this.isEmpty()&&t.append(Gx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return BA().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){const n=vb(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(const e of this.getChildren())this.insertBefore(e);return this.remove(),!0}const e=vb();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function BA(e){const t=Ox(new UA);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function $A(e){return e instanceof UA}let qA=class e extends X_{__tag;static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){const t=this.getWritable();return t.__tag=e,t}createDOM(e){const t=this.__tag,n=Gx().createElement(t),r=e.theme.heading;if(void 0!==r){Vw(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:VA,priority:0}),h2:e=>({conversion:VA,priority:0}),h3:e=>({conversion:VA,priority:0}),h4:e=>({conversion:VA,priority:0}),h5:e=>({conversion:VA,priority:0}),h6:e=>({conversion:VA,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&GA(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>GA(e)?{conversion:e=>({node:WA("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Qx(t)){this.isEmpty()&&t.append(Gx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return WA(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?vb():WA(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=vb();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){const e=vb();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function GA(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function VA(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=WA(t),hS(e,n),gS(n,e),pS(n,e)),{node:n}}function KA(e){const t=BA();return gS(t,e),hS(e,t),pS(t,e),{node:t}}function WA(e="h1"){return Ox(new qA(e))}function HA(e){return eb(Zb(e))}function JA(e,t,n,r){let i=!1,o=null;if(e.isCollapsed()&&"text"===e.anchor.type){const t=e.anchor.getNode();if(xy(t)){o=t;const r=e.anchor.offset,s=r===t.getTextContentSize()&&null===t.getNextSibling(),a=0===r&&null===t.getPreviousSibling();i="end"===n&&s||"start"===n&&a||"both"===n&&(s||a)}}let s=!1;for(const[a,l]of Object.entries(r)){if(null==l||!l[t])continue;const n=a;if(l.onlyAtBoundary){if(!(i&&o&&xy(o)&&o.hasFormat(n)))continue;s=!0}e.hasFormat(n)&&e.toggleFormat(n)}s&&e.setStyle("")}const XA={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function QA(e,t){return function(e,t){if(!e.isCollapsed())return!1;const n=ww(e.focus,t),r=wS(n.origin,Dx);if(!r)return!1;const i=e.focus.getNode();if(!r.is(i)&&!Ax(i,r))return!1;const o=mw(n,sw(r,t));if(o.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;const s=mw(o.anchor.getSiblingCaret(),o.focus);let a=s.anchor.origin;for(const c of s){if(!tw(c)||!c.origin.is(a.getParent()))return!1;a=c.origin}let l=r;for(const c of pw(sw(r,t))){if(!c.origin.is(l.getParent())){if(Mx(c.origin)){const e=sw(l,t);return kw(mw(e,e)),!0}break}if(!Dx(c.origin))break;l=c.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||"element"!==e.anchor.type)return!1;const n=ww(e.anchor,t).getNodeAtCaret();return!(!Dx(n)||n.isInline()||(kw(gw(Iw(uw(n,t)))),0))}(e,t)}function YA(e){return eb(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ZA(e){const t=n_();t.add(e),rx(t)}function eN(e,t){if(!e.isCollapsed())return!1;const n=e.focus,r=n.getNode(),i=t?"previous":"next",o=ww(n,i);if("element"===n.type&&Q_(r)&&(nb(r)||Dx(r))){const e=o.getNodeAtCaret();return!(null===e||!YA(e)||(ZA(e.__key),0))}const s=wS(Q_(r)?r:r.getParentOrThrow(),e=>Q_(e)&&!e.isInline()&&Ix(e.getParent()));if(null===s)return!1;const a=sw(s,i).getNodeAtCaret();if(null===a||!YA(a))return!1;if(0===s.getTextContentSize())return ZA(a.__key),!0;const l=oS().getRootElement();if(null===l)return!1;const c=zx(l.ownerDocument.defaultView);if(null===c||0===c.rangeCount)return!1;const u=c.anchorNode,d=c.anchorOffset,f=c.focusNode,h=c.focusOffset;c.modify("move",t?"backward":"forward","line");const p=c.anchorNode,g=c.anchorOffset;if(null===p)return tN(c,u,d,f,h),!1;const m=Zb(p);return tN(c,u,d,f,h),null!==m&&((p===u&&g===d||!m.is(s)&&!Ax(m,s))&&(ZA(a.__key),!0))}function tN(e,t,n,r,i){null!==t&&null!==r&&e.setBaseAndExtent(t,n,r,i)}function nN(e,t){if(!e.isCollapsed())return!1;const n=e.focus.getNode(),r=wS(Q_(n)?n:n.getParentOrThrow(),e=>Q_(e)&&!e.isInline());if(null===r)return!1;const i=oS(),o=i.getRootElement();if(null===o)return!1;const s=o.ownerDocument.defaultView;if(null===s)return!1;let a=!1;for(const m of r.getChildren())if(Q_(m)&&m.isInline()){const e=i.getElementByKey(m.getKey());if(null!==e){const t=s.getComputedStyle(e).display;if("inline-grid"===t||"inline-flex"===t){a=!0;break}}}if(!a)return!1;const l=sw(r,t?"previous":"next").getNodeAtCaret();if(null===l||!Q_(l)){if(t){const e=r.getFirstDescendant();xy(e)?e.select(0,0):r.select(0,0)}else{const e=r.getLastDescendant();if(xy(e)){const t=e.getTextContentSize();e.select(t,t)}else{const e=r.getChildrenSize();r.select(e,e)}}return!0}const c=i.getElementByKey(l.getKey());if(null===c)return!1;const u=zx(s);if(null===u||0===u.rangeCount)return!1;const d=u.getRangeAt(0).cloneRange();d.collapse(!0);const f=d.getBoundingClientRect(),h=c.getBoundingClientRect(),p=h.top+h.height/2;if(f.height>0){const t=hA(f.left,p,o);if(null!==t&&c.contains(t.node)){const n=o.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}const g=t?l.getLastDescendant():l.getFirstDescendant();if(xy(g)){const e=t?g.getTextContentSize():0;g.select(e,e)}else{const e=l.getChildrenSize();l.select(t?e:0,t?e:0)}return!0}function rN(e,t){const n=sw(e,t),r=n.getAdjacentCaret();null!==r&&Q_(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?kw(gw(n)):"next"===t?e.selectNext(0,0):e.selectPrevious()}function iN(e,t,n){n.preventDefault(),n.stopPropagation();const r=e.getNodes();if(0===r.length)return!0;const i=r.map(e=>sw(e,"next")).sort(yw),o=(t?i[0]:i[i.length-1]).origin,s=wS(o,e=>e!==o&&Q_(e)&&!e.isInline())??nx(),a=t?0:s.getChildrenSize();return s.select(a,a),!0}function oN(e,t=function(e,t){return new xE(e,t)}(XA)){return Ww(e.registerCommand(mm,()=>{const e=i_();return Oy(e)?(e.clear(),!0):(Iy(e)&&JA(e,"click","both",t.peek()),!1)},0),e.registerCommand(xm,e=>{const t=i_();return Iy(t)?(t.deleteCharacter(e),!0):!!Oy(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(Am,e=>{const t=i_();return!!Iy(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(Nm,e=>{const t=i_();return!!Iy(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Em,e=>{const t=i_();if("string"==typeof e)null!==t&&t.insertText(e);else{if(null===t)return!1;const n=e.dataTransfer;if(null!=n)EA(n,t);else if(Iy(t)){const n=e.data;return n&&t.insertText(n),!0}}return!0},0),e.registerCommand(Cm,()=>{const e=i_();return!!Iy(e)&&(e.removeText(),!0)},0),e.registerCommand(Tm,e=>{const t=i_();return!(!Iy(t)&&!Oy(t)||(My(t,e),0))},0),e.registerCommand(Rm,e=>{const t=i_();return!(!Iy(t)&&!Oy(t)||(function(e,t){const n=[];for(const[r,i]of Object.entries(t))"boolean"==typeof i&&n.push([r,i]);0!==n.length&&Py(e,e=>{for(const[t,r]of n)e=$b(e,t,r?xp[t]:0);return e})}(t,e),0))},0),e.registerCommand(Xm,e=>{const t=i_();if(!Iy(t)&&!Oy(t))return!1;const n=t.getNodes();for(const r of n){const t=wS(r,e=>Q_(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},0),e.registerCommand(Sm,e=>{const t=i_();return!!Iy(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(wm,()=>{const e=i_();return!!Iy(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(Km,()=>{const e=Ey(),t=i_();return Iy(t)&&(e.setFormat(t.format),e.setStyle(t.style)),function(e){let t=i_()||o_();null===t&&(t=nx().selectEnd()),t.insertNodes(e)}([e]),!0},0),e.registerCommand(Wm,()=>cE(e=>{const t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Hm,()=>cE(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(zm,e=>{const t=i_();if(Oy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),rN(n[0],"previous"),!0}else if(Iy(t)){if(!e.shiftKey&&QA(t,"previous"))return e.preventDefault(),!0;if(!e.shiftKey&&eN(t,!0))return e.preventDefault(),!0;if(!e.shiftKey&&nN(t,!0))return e.preventDefault(),!0}return!1},0),e.registerCommand(jm,e=>{const t=i_();if(Oy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),rN(n[0],"next"),!0}else if(Iy(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===nx().getChildrenSize()}(t))return e.preventDefault(),!0;if(!e.shiftKey&&QA(t,"next"))return e.preventDefault(),!0;if(!e.shiftKey&&eN(t,!1))return e.preventDefault(),!0;if(!e.shiftKey&&nN(t,!1))return e.preventDefault(),!0}return!1},0),e.registerCommand(Mm,e=>{const n=i_();if(Oy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),rN(t[0],Xw(t[0])?"next":"previous"),!0}if(!Iy(n))return!1;if(!e.shiftKey&&QA(n,Xw(n.anchor.getNode())?"next":"previous"))return e.preventDefault(),!0;if(e.shiftKey||JA(n,"arrow","start",t.peek()),nE(n,!0)){const t=e.shiftKey;return e.preventDefault(),iE(n,t,!0),!0}return!1},0),e.registerCommand(Om,e=>{const n=i_();if(Oy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),rN(t[0],Xw(t[0])?"previous":"next"),!0}if(!Iy(n))return!1;if(!e.shiftKey&&QA(n,Xw(n.anchor.getNode())?"previous":"next"))return e.preventDefault(),!0;if(e.shiftKey||JA(n,"arrow","end",t.peek()),nE(n,!1)){const t=e.shiftKey;return e.preventDefault(),iE(n,t,!1),!0}return!1},0),e.registerCommand($m,t=>{const n=i_();if(!Oy(n)&&HA(t.target))return!1;if(Iy(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(nb(n))return!1;const r=sE(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Hm,void 0);if(rp&&np)return!1}else if(!Oy(n))return!1;return t.preventDefault(),e.dispatchCommand(xm,!0)},0),e.registerCommand(Gm,t=>{const n=i_();return!(!Oy(n)&&HA(t.target))&&!(!Iy(n)&&!Oy(n))&&(t.preventDefault(),e.dispatchCommand(xm,!1))},0),e.registerCommand(Um,n=>{let r=i_();if(Oy(r)){const e=r.getNodes();1===e.length&&eb(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Iy(r))return!1;if(JA(r,"enter","both",t.peek()),null!==n){if((rp||op||lp)&&np)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(Sm,!1)}return e.dispatchCommand(wm,void 0)},0),e.registerCommand(qm,()=>!!Iy(i_())&&(e.blur(),!0),0),e.registerCommand(Jm,t=>{const[,n]=lE(t);if(n.length>0){const r=hA(t.clientX,t.clientY,e.getRootElement());if(null!==r){const{offset:t,node:i}=r,o=Zb(i);if(null!==o){const e=t_();if(xy(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{const t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}rx(gg(e))}e.dispatchCommand(zA,n)}return t.preventDefault(),!0}return CA(t,e)},0),e.registerCommand(Qm,t=>{const[n]=lE(t),r=i_();return!(n&&!Iy(r)||(Iy(r)&&!r.isCollapsed()&&null!==t.dataTransfer&&(OA(t.dataTransfer,FA(r)),function(e,t){const n={editorKey:t.getKey()};e.setData(kA,JSON.stringify(n))}(t.dataTransfer,e)),0))},0),e.registerCommand(Ym,t=>{const[n]=lE(t),r=i_();if(n&&!Iy(r))return!1;const i=hA(t.clientX,t.clientY,e.getRootElement());if(null!==i){eb(Zb(i.node))&&t.preventDefault()}return!0},0),e.registerCommand(nv,()=>{const e=i_();return function(e){const t=nx();if(Iy(e)){const t=e.anchor,n=e.focus,r=t.getNode();if(nb(r))return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),gg(e),e;const i=r.getTopLevelElementOrThrow(),o=i.getParent();if(null===o)return Q_(i)&&(t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),gg(e)),e;const s=o;return t.set(s.getKey(),0,"element"),n.set(s.getKey(),s.getChildrenSize(),"element"),gg(e),e}{const e=t.select(0,t.getChildrenSize());rx(gg(e))}}(Iy(e)&&null!==DS(e.anchor.getNode())?e:null),!0},0),e.registerCommand(ev,t=>(RA(e,aE(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(tv,t=>(async function(e,t){await RA(t,aE(e,ClipboardEvent)?e:null),t.update(()=>{const e=i_();Iy(e)?e.removeText():Oy(e)&&e.getNodes().forEach(e=>e.remove())},{tag:"cut"})}(t,e),!0),0),e.registerCommand(km,t=>{const[,n,r]=lE(t);return n.length>0&&!r?(e.dispatchCommand(zA,n),!0):(!Yx(t.target)||!Fb(t.target))&&(null!==i_()&&(function(e,t){e.preventDefault(),t.update(()=>{const t=i_(),n=aE(e,InputEvent)||aE(e,KeyboardEvent)?null:e.clipboardData;null!=n&&null!==t&&EA(n,t)},{tag:Hv})}(t,e),!0))},0),e.registerCommand(Bm,()=>{const e=i_();return Iy(e)&&JA(e,"space","both",t.peek()),!1},0),e.registerCommand(Vm,()=>{const e=i_();return Iy(e)&&JA(e,"tab","both",t.peek()),!1},0),e.registerCommand(Pm,e=>{const t=i_();if(Oy(t))return iN(t,!1,e);if(!Iy(t))return!1;const{anchor:n}=t;if("element"!==n.type||0!==n.offset)return!1;const r=n.getNode();if(!Q_(r))return!1;const i=r.getFirstChild();if(!eb(i)||!i.isInline())return!1;const o=r.getKey(),s=r.selectEnd();return e.shiftKey&&s.anchor.set(o,0,"element"),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Lm,e=>{const t=i_();if(Oy(t))return iN(t,!0,e);if(!Iy(t))return!1;const{anchor:n,focus:r}=t,i=wS(r.getNode(),e=>Q_(e)&&!e.isInline());if(null===i)return!1;const o=i.getFirstChild();if(!eb(o)||!o.isInline())return!1;if(wS(n.getNode(),e=>Q_(e)&&!e.isInline())!==i)return!1;const s=i.getKey();return("element"!==r.type||r.key!==s||0!==r.offset)&&(t.focus.set(s,0,"element"),e.shiftKey||t.anchor.set(s,0,"element"),e.preventDefault(),e.stopPropagation(),!0)},0))}function sN(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function aN(e){const t=sN(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const lN=/[!-/:-@[-`{-~\s]/,cN=/\s/,uN=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,dN=/^\s{0,3}$/;function fN(e){if(!yb(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&xy(t)&&dN.test(t.getTextContent())}function hN(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}const pN=/^(\s*)(\d{1,})\.\s/,gN=/^(\s*)[-*+]\s/,mN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,vN=/^(#{1,6})\s/,yN=/^>\s/,_N=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,bN=/^[ \t]*`{3,}$/,xN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,SN=/^(?:\|)(.+)(?:\|)\s?$/;function wN(e){if("|"!==e[0])return!1;const{length:t}=e;let n=1,r=0;for(;n<t;){let t=n;for(" "===e[t]&&t++,":"===e[t]&&t++;"-"===e[t];)t++;if(":"===e[t]&&t++," "===e[t]&&t++,"|"!==e[t])break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}const EN=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,kN=/^<\/[a-z_][\w-]*\s*>/i,CN=e=>new RegExp(`(?:${e.source})$`,e.flags),AN=Zp("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),NN=Zp("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),TN=Zp("mdHardLineBreak",{parse:e=>"string"==typeof e&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function RN(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function DN(e){const t=ub(),n=function(e){const t=e.getChildren(),n=t.length-1,r=t[n];if(!xy(r))return null;const i=r.getTextContent(),o=RN(i);if(null!==o){const[e,t]=o;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(db(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(""),i):null}(e);return null!==n&&tg(t,TN,n),t}const IN=e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},FN=e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),a=vC("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==AN.parse(l)?void 0:l;if(EC(s)&&s.getListType()===e){c&&tg(s,AN,c);const n=s.getFirstChild();null!==n?n.insertBefore(a):s.append(a),"number"===e&&s.setStart(Number(r[2])),t.remove()}else if(EC(o)&&o.getListType()===e)c&&tg(o,AN,c),o.append(a),t.remove();else{const n=wC(e,"number"===e?Number(r[2]):void 0);c&&tg(n,AN,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},ON=(e,t,n,r)=>{const i=[],o=e.getChildren();let s=0;for(const a of o)if(yC(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if(EC(e)){const o=ON(e,t,n+1,r);o&&i.push(o);continue}}if(r&&!a.getChildren().some(e=>e.isSelected(r)))continue;const o=" ".repeat(4*n),l=e.getListType(),c=eg(e,AN),u="number"===l?`${e.getStart()+s}. `:"check"===l?`${c} [${a.getChecked()?"x":" "}] `:c+" ";let d=t(a);"number"!==l&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(o+u+d),s++}return i.join("\n")},PN={dependencies:[qA],export:(e,t)=>{if(!function(e){return e instanceof qA}(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:vN,replace:IN(e=>WA("h"+e[1].length)),triggerOnEnter:!0,type:"element"},MN={dependencies:[UA],export:(e,t)=>{if(!$A(e))return null;const n=t(e).split("\n"),r=[];for(const i of n)r.push("> "+i);return r.join("\n")},regExp:yN,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if($A(n))return n.splice(n.getChildrenSize(),0,[DN(n),...t]),void e.remove()}const i=BA();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:"element"},LN={dependencies:[UC],export:e=>{if(!$C(e))return null;const t=e.getTextContent();let n=eg(e,NN);if(t.indexOf(n)>-1){const e=t.match(/`{3,}/g);if(e){const t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n"+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{const i=r[1],o=i.trim().length,s=e[n],a=r.index+i.length,l=s.slice(a),c=new RegExp(`\`{${o},}$`);if(c.test(l)){const e=l.match(c),i=l.slice(0,l.lastIndexOf(e[0])),o=[...r];return o[2]="",LN.replace(t,null,o,e,[i],!0),[!0,n]}const u=new RegExp(`^[ \\t]*\`{${o},}$`);for(let h=n+1;h<e.length;h++){const i=e[h];if(u.test(i)){const o=i.match(u),a=e.slice(n+1,h),l=s.slice(r[0].length);return l.length>0&&a.unshift(l),LN.replace(t,null,r,o,a,!0),[!0,h]}}const d=e.slice(n+1),f=s.slice(r[0].length);return f.length>0&&d.unshift(f),LN.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:bN},regExpStart:_N,replace:(e,t,n,r,i,o)=>{let s,a;const l=n[1]?n[1].trim():"```",c=n[2]||void 0;if(!t&&i){if(1===i.length)r?(s=BC(c),a=i[0]):(s=BC(c),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=BC(c),i.length>0&&(0===i[0].trim().length?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}tg(s,NN,l);const t=by(a);s.append(t),e.append(s)}else t&&IN(e=>BC(e?e[2]:void 0))(e,t,n,o)},type:"multiline-element"},zN={dependencies:[_C,hC],export:(e,t,n)=>EC(e)?ON(e,t,0,n):null,regExp:gN,replace:FN("bullet"),triggerOnEnter:!0,type:"element"},jN={dependencies:[_C,hC],export:(e,t,n)=>EC(e)?ON(e,t,0,n):null,regExp:pN,replace:FN("number"),triggerOnEnter:!0,type:"element"},UN={dependencies:[rA],export:(e,t,n)=>{if(!sA(e)||cA(e))return null;const r=t(e);let i=e.getTitle();return null!=i&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(wS(e,sA))return;const[,n,r,i]=t,o=oA(null!=r?hN(r):void 0,{title:null!=i?hN(i):void 0}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=by(l);return u.setFormat(e.getFormat()),o.append(u),e.replace(o),c&&o.insertBefore(by(c)),u},trigger:")",type:"text-match"},BN=[...[PN,MN,zN,jN],...[LN],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[UN]];function $N(e,t,n,r,i){for(const o of t){if(!o.export)continue;const t=o.export(e,e=>qN(e,n,r,void 0,void 0,i));if(null!=t)return t}return Q_(e)?qN(e,n,r,void 0,void 0,i):eb(e)?e.getTextContent():null}function qN(e,t,n,r,i,o=!1){const s=[],a=e.getChildren();r||(r=[]),i||(i=[]);e:for(const l of a){for(const e of n){if(!e.export)continue;const a=e.export(l,e=>qN(e,t,n,r,[...i,...r],o),(e,n)=>VN(e,n,t,r,i,o));if(null!=a){s.push(a);continue e}}db(l)?s.push(GN(l)):xy(l)?s.push(VN(l,l.getTextContent(),t,r,i,o)):Q_(l)?s.push(qN(l,t,n,r,i,o)):eb(l)&&s.push(l.getTextContent())}return s.join("")}function GN(e){return eg(e,TN)+"\n"}function VN(e,t,n,r,i,o=!1){const s=e.hasFormat("code");let a,l,c,u,d=t;if(s||(d=o?d.replace(/([*_`~])/g,"\\$1"):d.replace(/([*_`~\\])/g,"\\$1")),s){const{fence:e,padded:n}=function(e){const t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:0===e.length||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);a="",c="",l=e+n+e,u=!1}else{const e=d.match(/^(\s*)(.*?)(\s*)$/s)||["","",d,""];a=e[1],l=e[2],c=e[3],u=""===l}let f="",h="",p="";const g=KN(e,!0),m=KN(e,!1),v=new Set;for(const y of n){const t=y.format[0],n=y.tag;"code"!==t&&HN(e,t)&&!v.has(t)&&(v.add(t),HN(g,t)&&r.find(e=>e.tag===n)||(r.push({format:t,tag:n}),f+=n))}for(let y=0;y<r.length;y++){const t=WN(e,r[y].format),n=WN(m,r[y].format);if(t&&n)continue;const o=[...r];for(;o.length>y;){const e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&"string"==typeof e.tag&&(t?n||(p+=e.tag):h+=e.tag),r.pop())}break}return u&&!e.hasFormat("code")?h+d:h+a+f+l+p+c}function KN(e,t){const n=t?e.getPreviousSibling():e.getNextSibling();return xy(n)?n:null}function WN(e,t){return xy(e)&&e.hasFormat(t)}function HN(e,t){return!(!WN(e,t)||"code"!==t&&e&&/^\s*$/.test(e.getTextContent()))}function JN(e,t,n,r,i){if(!XN(t,n,r,i))return!1;if("*"===e)return!0;if("_"===e){if(!XN(t,n,r,!i))return!0;const e=i?t[n-1]:t[n+r];return void 0!==e&&uN.test(e)}return!0}function XN(e,t,n,r){const i=e[t-1],o=e[t+n],[s,a]=r?[o,i]:[i,o];return void 0!==s&&!cN.test(s)&&(!uN.test(s)||void 0===a||cN.test(a)||uN.test(a))}function QN(e){return xy(e)&&!e.hasFormat("code")}function YN(e,t,n){let r=function(e,t){const n=e.getTextContent(),r=t.transformersByTag["`"],i=[];let o=null;if(r){const e=function(e){const t=t=>{let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2==1},n=[];let r=0;for(;r<e.length;)if("`"===e[r]){let t=1;for(;r+t<e.length&&"`"===e[r+t];)t++;n.push({index:r,length:t}),r+=t}else r++;const i=[];let o=0;for(;o<n.length;){const r=n[o];if(t(r.index)){o++;continue}let s=-1;for(let e=o+1;e<n.length;e++)if(n[e].length===r.length){s=e;break}if(-1===s){o++;continue}const a=n[s];let l=e.slice(r.index+r.length,a.index);l.length>=2&&l.startsWith(" ")&&l.endsWith(" ")&&/[^ ]/.test(l)&&(l=l.slice(1,-1)),i.push({content:l,endIndex:a.index+a.length,startIndex:r.index}),o=s+1}return i}(n);for(const t of e)o||(o={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"}),i.push({end:t.endIndex,start:t.startIndex})}const s=function(e,t,n=[]){const r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>"`"!==e[0]).map(e=>e[0])),o=t=>{let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2==1},s=e=>n.some(t=>e>=t.start&&e<t.end);let a=0;for(;a<e.length;){const t=e[a];if(!i.has(t)||o(a)||s(a)){a++;continue}let n=1;for(;a+n<e.length&&e[a+n]===t;)n++;const l=JN(t,e,a,n,!0),c=JN(t,e,a,n,!1);(l||c)&&r.push({active:!0,canClose:c,canOpen:l,char:t,index:a,length:n}),a+=n}return r}(n,t,i),a=s.length>0?function(e,t,n){const r={};let i=0,o=null;for(;i<t.length;){const s=t[i];if(!s.active||!s.canClose||0===s.length){i++;continue}const a=`${s.char}${s.canOpen}${s.length%3}`,l=r[a]??-1;let c=!1;for(let r=i-1;r>l;r--){const a=t[r];if(!a.active||!a.canOpen||0===a.length||a.char!==s.char)continue;if((a.canClose||s.canOpen)&&(a.length+s.length)%3==0&&a.length%3!=0&&s.length%3!=0)continue;const l=Math.min(a.length,s.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===a.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0];if(!u)continue;c=!0;const d=u.length,f={content:e.slice(a.index+a.length,s.index),endIndex:s.index+d,startIndex:a.index+(a.length-d),tag:u};(!o||f.startIndex<o.startIndex||f.startIndex===o.startIndex&&f.endIndex>o.endIndex)&&(o=f);for(let e=r+1;e<i;e++)t[e].active=!1;a.length-=d,s.length-=d,a.active=a.length>0,s.length>0?s.index+=d:(s.active=!1,i++);break}c||(r[a]=i-1,s.canOpen||(s.active=!1),i++)}return o}(n,s,t):null;let l=null,c=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(l=a,c=t.transformersByTag[a.tag]):(l=o,c=r):o?(l=o,c=r):a&&(l=a,c=t.transformersByTag[a.tag]),!l||!c)return null;const u=[n.slice(l.startIndex,l.endIndex),l.tag,l.content];return u.index=l.startIndex,u.input=n,{endIndex:l.endIndex,isCodeSpan:c===r,match:u,startIndex:l.startIndex,transformer:c}}(e,t),i=function(e,t){const n=e;let r,i,o,s;for(const a of t){if(!a.replace||!a.importRegExp)continue;const e=n.getTextContent().match(a.importRegExp);if(!e)continue;const t=e.index||0,l=a.getEndIndex?a.getEndIndex(n,e):t+e[0].length;!1!==l&&(void 0===r||void 0===i||t<r&&(l>i||l<=r))&&(r=t,i=l,o=a,s=e)}return void 0===r||void 0===i||void 0===o||void 0===s?null:{endIndex:i,match:s,startIndex:r,transformer:o}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const i=function(e,t,n,r,i){const o=e.getTextContent();let s,a,l;if(i[0]===o?s=e:0===t?[s,a]=e.splitText(n):[l,s,a]=e.splitText(t,n),s.setTextContent(i[2]),r)for(const c of r.format)s.hasFormat(c)||s.toggleFormat(c);return{nodeAfter:a,nodeBefore:l,transformedNode:s}}(e,r.startIndex,r.endIndex,r.transformer,r.match);QN(i.nodeAfter)&&YN(i.nodeAfter,t,n),QN(i.nodeBefore)&&YN(i.nodeBefore,t,n),QN(i.transformedNode)&&YN(i.transformedNode,t,n)}else if(i){const r=function(e,t,n,r,i){let o,s,a;return 0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n),r.replace?{nodeAfter:s,nodeBefore:a,transformedNode:r.replace(o,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;QN(r.nodeAfter)&&YN(r.nodeAfter,t,n),QN(r.nodeBefore)&&YN(r.nodeBefore,t,n),QN(r.transformedNode)&&YN(r.transformedNode,t,n)}const o=hN(e.getTextContent());e.setTextContent(o)}function ZN(e,t,n,r){for(const i of n){const{handleImportAfterStartMatch:n,regExpEnd:o,regExpStart:s,replace:a}=i,l=e[t].match(s);if(!l)continue;if(n){const o=n({lines:e,rootNode:r,startLineIndex:t,startMatch:l,transformer:i});if(null===o)continue;if(o)return o}const c="object"==typeof o&&"regExp"in o?o.regExp:o,u=o&&"object"==typeof o&&"optional"in o?o.optional:!o;let d=t;const f=e.length;for(;d<f;){const n=c?e[d].match(c):null;if(!n&&(!u||u&&d<f-1)){d++;continue}if(n&&t===d&&n.index===l.index){d++;continue}const i=[];if(n&&t===d)i.push(e[t].slice(l[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){const t=e[r].slice(l[0].length);i.push(t)}else if(r===d&&n){const t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==a(r,null,l,n,i,!0))return[!0,d];break}}return[!1,t]}function eT(e,t,n,r,i,o){const s=by(e),a=vb();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const t=e.match(l);if(t&&(s.setTextContent(e.slice(t[0].length)),!1!==c(a,[s],t,!0)))break}if(YN(s,r,i),null!==a.getParent()&&e.length>0){const e=a.getPreviousSibling();if(!o&&(yb(e)||$A(e)||EC(e))){let t=e;if(EC(e)){const n=e.getLastDescendant();t=null==n?null:wS(n,yC)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[DN(t),...a.getChildren()]),a.remove())}}}function tT(e){const t=new Set,n=e.getTextContent();let r=n.indexOf("\t");for(;-1!==r;)t.add(r),t.add(r+1),r=n.indexOf("\t",r+1);e.splitText(...t).forEach(e=>{"\t"===e.getTextContent()&&e.replace(Ey())})}function nT(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function rT(e,t,n,r,i){if(!Ix(e.getParent())||e.getFirstChild()!==t)return!1;const o=t.getTextContent();if(!i&&" "!==o[n-1])return!1;for(const{regExp:s,replace:a}of r){const r=o.match(s),l=i||r&&r[0].endsWith(" ")?n:n-1;if(r&&r[0].length===l){const i=t.getNextSiblings(),[o,s]=t.splitText(n);if(!1!==a(e,s?[s,...i]:i,r,!1))return o.remove(),!0}}return!1}function iT(e,t,n,r,i){if(!Ix(e.getParent())||e.getFirstChild()!==t)return!1;const o=t.getTextContent();if(!i&&" "!==o[n-1])return!1;for(const{regExpStart:s,replace:a,regExpEnd:l}of r){if(l&&!("optional"in l)||l&&"optional"in l&&!l.optional)continue;const r=o.match(s);if(r){const o=i||r[0].endsWith(" ")?n:n-1;if(r[0].length!==o)continue;const s=t.getNextSiblings(),[l,c]=t.splitText(n);if(!1!==a(e,c?[c,...s]:s,r,null,null,!1))return l.remove(),!0}}return!1}function oT(e,t){let n=0;const r=e.getTextContent();for(let i=0;i<t;i++)"`"===r[i]&&n++;return n%2!=0}function sT(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(aT(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function aT(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function lT(e,t=BN,n,r=!1,i=!1){const o=r?e:function(e,t=!1){const n=e.split("\n");let r=0;const i=[];for(let o=0;o<n.length;o++){const e=n[o],s=e.trimEnd(),a=i[i.length-1],l=o<n.length-1?RN(e):null,c=void 0!==a&&null!==RN(a);if(xN.test(s))i.push(s);else if(0===r){{const e=s.match(_N);if(e){r=e[1].trim().length,i.push(s);continue}}""===s||""===a||!a||vN.test(a)||vN.test(s)||yN.test(s)||pN.test(s)||gN.test(s)||mN.test(s)||SN.test(s)||wN(s)||c||!t||EN.test(s)||kN.test(s)||CN(kN).test(a)||CN(EN).test(a)||bN.test(a)?i.push(!t&&""!==s||null!==l?e:s):i[i.length-1]=a+" "+(null===l?s:e).trimStart()}else{if(bN.test(s)&&s.trim().length>=r){r=0,i.push(s);continue}i.push(e)}}return i.join("\n")}(e,i),s=nx();s.clear(),function(e,t,n,r=!1){const i=aN(n),o=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),1===e.length?n[e]="`"===e?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${o}])(${o})((\\\\${o})?.*?[^${o}\\s](\\\\${o})?)(${o})(?![\\\\${o}])`):n[e]=new RegExp(`(^|[^\\\\])(${o})((\\\\${o})?.*?[^\\s](\\\\${o})?)(${o})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp(`(${r.join("|")})`,"g"),transformersByTag:t}}(i.textFormat),s=e.split("\n"),a=s.length;for(let c=0;c<a;c++){const e=s[c],[n,a]=ZN(s,c,i.multilineElement,t);n?c=a:eT(e,t,i.element,o,i.textMatch,r)}const l=t.getChildren();for(const c of l)if(!r&&fN(c)&&t.getChildrenSize()>1)c.remove();else if(Q_(c))for(const e of c.getAllTextNodes())tT(e)}(o,s,t,r),null!==i_()&&s.selectStart()}function cT(e=BN,t,n=!1){const r=function(e,t=!1){const n=aN(e),r=[...n.multilineElement,...n.element],i=!t,o=n.textFormat.filter(e=>1===e.format.length).sort((e,t)=>Number(e.format.includes("code"))-Number(t.format.includes("code")));return e=>{const s=[],a=(e||nx()).getChildren();for(let l=0;l<a.length;l++){const e=a[l],c=$N(e,r,o,n.textMatch,t);null!=c&&s.push(i&&l>0&&!fN(e)&&!fN(a[l-1])?"\n".concat(c):c)}return s.join("\n")}}(e,n);return r(t)}let uT=[qA,UA,_C,hC,rA,UC];function dT(e){return"var("+e+")"}let fT=co([gi("flex"),_i("wrap"),di("center"),ui("gap","2px"),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),hT=co([ui("background","none"),ui("border","1px solid transparent"),ui("border-radius",dT(St.sm)),ui("color",dT(_t.textSecondary)),ui("font-family","inherit"),ui("font-size",dT(xt.sizeSm)),ui("line-height","1"),ui("min-width","26px"),ui("padding","5px 6px"),pi("pointer"),Yi([ui("background",dT(_t.surfaceSubtle))])]),pT=co([ui("background",dT(_t.surfaceSubtle)),ui("border-color",dT(_t.border)),ui("color",dT(_t.textPrimary))]),gT=co([Pi(.4),pi("notAllowed")]),mT=co([ui("width","1px"),ui("align-self","stretch"),ui("background",dT(_t.borderSubtle)),ui("margin","2px 4px")]),vT=co([gi("flex"),di("center"),ui("gap",dT(bt.xs)),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),yT=co([vi(1),ui("background",dT(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",dT(St.sm)),ui("color",dT(_t.textPrimary)),ui("font-family","inherit"),ui("font-size",dT(xt.sizeSm)),ui("padding","3px 6px"),ui("outline","none"),Xi([ui("border-color",dT(_t.brand))])]);let _T={bold:!1,italic:!1,code:!1},bT=function(e){let t=e.disabled,n=e.formats,a=e.editor,l=void 0!==t&&t,c=s(()=>{}),u=c[1],d=c[0],f=(e,t)=>{a.dispatchCommand(e,t)},h=e=>{a.update(()=>{let t=i_();null!=t&&Iy(t)&&Zw(t,e)})},p=(e,t,n,r)=>{let o=void 0!==n&&n;return i("button",{children:e,"aria-label":t,"aria-pressed":o?"true":"false",className:l?hT+" "+gT:o?hT+" "+pT:hT,title:t,disabled:l,type:"button",onClick:e=>r(),onMouseDown:e=>{e.preventDefault()}})},g=e=>{let t=e.trim();a.update(()=>{!function(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,o=void 0===t.rel?"noreferrer":t.rel,s=i_();if(null===s||!Iy(s)&&!Oy(s))return;if(Oy(s)){const e=s.getNodes();if(0===e.length)return;return void e.forEach(e=>{if(null===n){const t=wS(e,e=>!cA(e)&&sA(e));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=wS(e,e=>!cA(e)&&sA(e));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==o&&t.setRel(o);else{const t=oA(n,{rel:o,target:r});e.insertBefore(t),t.append(e)}}})}if(s.isCollapsed()&&null===n)for(const u of s.getNodes()){const e=wS(u,e=>!cA(e)&&sA(e));return void(null!==e&&(e.getParentOrThrow().splice(e.getIndexWithinParent(),0,e.getChildren()),e.remove()))}const a=s.extract();if(null===n){const e=new Set;return void a.forEach(t=>{const n=wS(t,e=>!cA(e)&&sA(e));if(null!==n){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||Q_(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),o=r.filter(i);if(o.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();const s=r.findIndex(i),a=r.findLastIndex(i),l=0===s,c=a===r.length-1;if(l)o.forEach(t=>e.insertBefore(t));else if(c)for(let u=o.length-1;u>=0;u--)e.insertAfter(o[u]);else{for(let n=o.length-1;n>=0;n--)e.insertAfter(o[n]);const t=r.slice(a+1);if(t.length>0){const n=Fx(e);o[o.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}}(n,a),e.add(t)}})}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==o&&e.setRel(o),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=wS(e,sA);if(null!==t)return c(t)}!function(e){const t=i_();if(!Iy(t))return e();const n=gg(t),r=n.isBackward(),i=uA(n.anchor,r?-1:0),o=uA(n.focus,r?0:-1);if(e(),i||o){const e=i_();if(Iy(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(o){const e=o.getParent();e&&t.focus.set(e.getKey(),o.getIndexWithinParent()+(r?0:1),"element")}rx(gg(t))}}}(()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const s=wS(t,sA);if(s){c(s);continue}if(Q_(t)){if(!t.isInline())continue;if(sA(t)){if(!(cA(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();sA(a)&&a.is(e)?a.append(t):(e=oA(n,{rel:o,target:r,title:i}),t.insertAfter(e),e.append(t))}})}(""===t?null:t)}),u(e=>{})};return r(o,{children:[r("div",{children:[p("B","Bold",n.bold,()=>f(Tm,"bold")),p("I","Italic",n.italic,()=>f(Tm,"italic")),p("</>","Inline code",n.code,()=>f(Tm,"code")),i("span",{className:mT}),p("H1","Heading 1",void 0,()=>h(()=>WA("h1"))),p("H2","Heading 2",void 0,()=>h(()=>WA("h2"))),p("¶","Paragraph",void 0,()=>h(()=>vb())),i("span",{className:mT}),p("•","Bulleted list",void 0,()=>f(TC,void 0)),p("1.","Numbered list",void 0,()=>f(RC,void 0)),p("“","Quote",void 0,()=>h(()=>BA())),p("🔗","Link",void 0,()=>u(e=>$(e)?void 0:"")),i("span",{className:mT}),p("↩","Undo",void 0,()=>f(Dm,void 0)),p("↪","Redo",void 0,()=>f(Im,void 0))],"aria-label":"Formatting",className:fT,role:"toolbar"}),void 0!==d?r("div",{children:[i("input",{"aria-label":"Link URL",className:yT,autoFocus:!0,placeholder:"https://…",type:"url",value:d,onKeyDown:e=>{switch(e.key){case"Enter":return e.preventDefault(),g(d);case"Escape":return u(e=>{});default:return}},onChange:e=>{let t=e.target.value;u(e=>t)}}),p("Apply","Apply link",void 0,()=>g(d)),p("Remove","Remove link",void 0,()=>g(""))],className:vT}):null]})};let xT={contents:void 0};function ST(e){let t=function(){let e=xT.contents;if(void 0!==e)return D(e);let t=wb({namespace:"reventless-rich-text-probe",nodes:uT,onError:e=>{}});return xT.contents=T(t),t}(),n={contents:""};return t.update(()=>{lT(e,BN)},{discrete:!0}),t.read(()=>{n.contents=cT(BN)}),n.contents}function wT(e){return"var("+e+")"}let ET=co([gi("flex"),mi("column"),ui("background",wT(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",wT(St.sm)),ui("box-sizing","border-box"),ui("transition","border-color 120ms"),Vi({NAME:"percent",VAL:100}),Mi("hidden"),Qi([ui("border-color",wT(_t.brand))])]),kT=co([ui("border-color",wT(_t.error)),Qi([ui("border-color",wT(_t.error))])]),CT=co([gi("flex"),di("center"),ui("gap","2px"),ui("justify-content","flex-end"),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]);let AT=co([ui("background",wT(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("color",wT(_t.textSecondary)),ui("font-size",wT(xt.sizeXs)),ui("line-height",wT(xt.lineHeightNormal)),ui("padding","var("+bt.xs+") var("+bt.sm+")")]),NT=co([Ui("relative"),gi("flex"),mi("column")]),TT=co([Ui("absolute"),ui("top","var("+bt.sm+")"),ui("left","var("+bt.sm+")"),ui("color",wT(_t.textDisabled)),ui("font-size",wT(xt.sizeSm)),ui("pointer-events","none"),ui("user-select","none")]);function RT(e){return co([ui("color",wT(_t.textPrimary)),ui("font-size",wT(xt.sizeSm)),ui("line-height",wT(xt.lineHeightRelaxed)),ui("min-height",e),ui("outline","none"),ui("padding",wT(bt.sm)),ui("word-break","break-word"),ui("overflow-y","auto"),ui("tab-size","4")])}let DT=co([ui("margin","0 0 var("+bt.sm+")")]),IT=co([ui("font-size",wT(xt.sizeXl)),ui("font-weight",wT(xt.weightBold)),ui("line-height",wT(xt.lineHeightTight)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),FT=co([ui("font-size",wT(xt.sizeLg)),ui("font-weight",wT(xt.weightBold)),ui("line-height",wT(xt.lineHeightTight)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),OT=co([ui("font-size",wT(xt.sizeMd)),ui("font-weight",wT(xt.weightBold)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),PT=co([ui("border-left","3px solid var("+_t.border+")"),ui("color",wT(_t.textSecondary)),ui("margin","var("+bt.xs+") 0"),ui("padding-left",wT(bt.md))]),MT=co([ui("margin","var("+bt.xs+") 0"),ui("padding-left","1.5em")]),LT=co([ui("margin","2px 0")]),zT=co([ui("color",wT(_t.brand)),ui("text-decoration","underline")]),jT=co([ui("font-weight",wT(xt.weightBold))]),UT=co([ui("font-style","italic")]),BT=co([ui("text-decoration","line-through")]),$T=co([ui("background",wT(_t.surfaceSubtle)),ui("border-radius",wT(St.sm)),ui("font-family",wT(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("padding","1px 4px")]),qT=co([ui("background",wT(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",wT(St.md)),ui("display","block"),ui("font-family",wT(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("margin","var("+bt.xs+") 0"),ui("padding",wT(bt.sm)),ui("white-space","pre-wrap")]);function GT(e){return co([ui("background","transparent"),ui("border","none"),ui("color",wT(_t.textPrimary)),ui("font-family",wT(xt.fontFamilyMono)),ui("font-size",wT(xt.sizeSm)),ui("line-height",wT(xt.lineHeightNormal)),ui("min-height",e),ui("outline","none"),ui("padding",wT(bt.sm)),ui("resize","vertical"),ui("box-sizing","border-box"),Vi({NAME:"percent",VAL:100})])}let VT=Object.fromEntries([["paragraph",DT],["quote",PT],["link",zT],["code",qT],["heading",Object.fromEntries([["h1",IT],["h2",FT],["h3",OT]])],["list",Object.fromEntries([["ul",MT],["ol",MT],["listitem",LT]])],["text",Object.fromEntries([["bold",jT],["italic",UT],["strikethrough",BT],["code",$T]])]]);let KT=function(e){let t=e.readOnly,n=e.hasError,o=e.minHeight,l=e.placeholder,c=e.onBlur,u=e.onChange,d=e.value,f=void 0!==c?c:()=>{},g=void 0!==l?l:"Write markdown…",m=void 0!==o?o:"180px",v=void 0!==n&&n,y=void 0!==t&&t,_=s(()=>"Rich"),b=_[1],x=_[0],S=s(()=>_T),w=S[1],E=s(()=>""===d.trim()),k=E[1],C=s(()=>!1),A=C[1],N=h(null),R=h(d),D=h(d),I=h(!1),F=h(u);F.current=u;let O=p(()=>wb({namespace:"reventless-rich-text",nodes:uT,onError:e=>{console.error("[RichTextEditor] Lexical error — the document may be incomplete:",e)},theme:VT}),[]),P=e=>{D.current=e,R.current=e,I.current=!0,A(t=>function(e){return""!==e.trim()&&e.trimEnd()!==ST(e).trimEnd()}(e)),O.update(()=>{lT(e,BN)})},M=()=>{let e=(()=>{let e={contents:""};return O.read(()=>{e.contents=cT(BN)}),e.contents})();return k(t=>""===e.trim()),w(e=>{let t={contents:_T};return O.read(()=>{let e=i_();null!=e&&Iy(e)&&(t.contents={bold:e.hasFormat("bold"),italic:e.hasFormat("italic"),code:e.hasFormat("code")})}),t.contents}),I.current?(I.current=!1,void(R.current=e)):e!==R.current?(R.current=e,F.current(e)):void 0},L="Rich"===x;a(()=>{if(!L)return;O.setRootElement(N.current);let e=Ww(oN(O),IC(O),function(e,t,n,r=Date.now,i,o=null){const s=FC(e,n,r);return Ww(e.registerCommand(Dm,()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,o=r.pop();null!==i&&(n.push(i),e.dispatchCommand(ov,!0)),0===r.length&&e.dispatchCommand(sv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Vv})}}(e,t),!0),0),e.registerCommand(Im,()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(sv,!0));const o=n.pop();0===n.length&&e.dispatchCommand(ov,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Vv})}}(e,t),!0),0),e.registerCommand(rv,()=>(OC(t),!1),0),e.registerCommand(iv,()=>(OC(t),e.dispatchCommand(ov,!1),e.dispatchCommand(sv,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:a,tags:l})=>{const c=t.current,u=t.redoStack,d=t.undoStack,f=null===c?null:c.editorState;if(null!==c&&n===f)return;const h=s(r,n,c,i,a,l);if(1===h){if(0!==u.length&&(t.redoStack=[],e.dispatchCommand(ov,!1)),null!==c){d.push({...c});const t="number"==typeof o||null===o?o:o.peek();null!==t&&d.length>t&&d.splice(0,d.length-t),e.dispatchCommand(sv,!0)}}else if(2===h)return;t.current={editor:e,editorState:n}}))}(O,{current:null,redoStack:[],undoStack:[]},300),function(e,t=BN){const n=aN(t),r=n.element.filter(e=>e.triggerOnEnter),i=sN(n.textFormat,({tag:e})=>e[e.length-1]),o=sN(n.textMatch,({trigger:e})=>e),s=new Set([" "]);for(const l of n.textFormat)s.add(l.tag.slice(-1));for(const l of n.textMatch)void 0!==l.trigger&&s.add(l.trigger);for(const l of t){const t=l.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=l.dependencies;for(const n of t)e.hasNode(n)||nT(173,n.getType())}}const a=(e,t,r)=>!!(rT(e,t,r,n.element)||iT(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const o of i){if(!o.replace||!o.regExp)continue;const t=r.match(o.regExp);if(null===t)continue;const n=t.index||0,i=n+t[0].length;let s;return 0===n?[s]=e.splitText(i):[,s]=e.splitText(n,i),s.selectNext(0,0),o.replace(s,t),!0}return!1}(t,r,o)||function(e,t,n){const r=e.getTextContent(),i=t-1,o=r[i],s=n[o];if(!s)return!1;for(const a of s){const{tag:t}=a,n=t.length,s=i-n+1;if(n>1&&!aT(r,s,t,0,n))continue;if(" "===r[s-1])continue;const l=r[i+1];if(!1===a.intraword&&l&&!lN.test(l))continue;const c=e;let u=c,d=sT(r,s,t),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!db(f);)if(xy(f)){if(f.hasFormat("code"))continue;const e=f.getTextContent();u=f,d=sT(e,e.length,t)}if(d<0)continue;if(u===c&&d+n===s)continue;const h=u.getTextContent();if(d>0&&h[d-1]===o)continue;const p=h[d-1];if(!1===a.intraword&&p&&!lN.test(p))continue;if(!a.format.includes("code")&&oT(u,d))continue;const g=c.getTextContent(),m=g.slice(0,s)+g.slice(i+1);c.setTextContent(m);const v=u===c?m:h;u.setTextContent(v.slice(0,d)+v.slice(d+n));const y=i_(),_=t_();rx(_);const b=i-n*(u===c?2:1)+1;_.anchor.set(u.__key,d,"text"),_.focus.set(c.__key,b,"text");for(const e of a.format)_.formatText(e,xp[e]);_.anchor.set(_.focus.key,_.focus.offset,_.focus.type);for(const e of a.format)_.hasFormat(e)&&_.toggleFormat(e);return Iy(y)&&(_.format=y.format),!0}return!1}(t,r,i));return Ww(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Jv)||t.has(Vv))return;if(e.isComposing())return;const o=t.has(ey),l=r.read(i_),c=i.read(i_);if(!Iy(c)||!Iy(l)||!l.isCollapsed()||l.is(c)&&!o)return;const u=l.anchor.key,d=l.anchor.offset,f=r._nodeMap.get(u);if(xy(f)&&n.has(u)&&(o||1===d||!(d>c.anchor.offset+1))){if(o){const e=r.read(()=>f.getTextContent())[d-1];if(!s.has(e))return}e.update(()=>{if(!QN(f))return;const e=f.getParent();null===e||$C(e)||a(e,f,l.anchor.offset)&&Cx(Kv)})}}),e.registerCommand(Um,e=>{if(null!==e&&e.shiftKey)return!1;const t=i_();if(!Iy(t)||!t.isCollapsed())return!1;const i=t.anchor.offset,o=t.anchor.getNode();if(!xy(o)||!QN(o))return!1;const s=o.getParent();return null!==s&&!$C(s)&&!(i!==o.getTextContent().length||!iT(s,o,i,n.multilineElement,!0)&&!rT(s,o,i,r,!0)||(null!==e&&e.preventDefault(),0))},1))}(O,BN),O.registerUpdateListener(e=>M()));return P(d),()=>{e(),O.setRootElement(null)}},[L]),a(()=>{L&&d!==R.current&&d!==D.current&&P(d)},[d]),a(()=>{O.setEditable(!y)},[y]);let z,j=(e,t)=>{return i("button",{children:t,"aria-pressed":x===e?"true":"false",className:(n=x===e,co([ui("background",n?wT(_t.surfaceSubtle):"transparent"),ui("border","1px solid "+(n?wT(_t.border):"transparent")),ui("border-radius",wT(St.sm)),ui("color",wT(n?_t.textPrimary:_t.textSecondary)),ui("font-family","inherit"),ui("font-size",wT(xt.sizeXs)),ui("padding","2px var("+bt.sm+")"),pi("pointer")])),type:"button",onClick:t=>{if(b(t=>e),"Source"===e)return A(e=>!1)}});var n};return z="Rich"===x?r("div",{children:[i("div",{ref:T(N),"aria-label":"Rich text editor","aria-multiline":!0,className:RT(m),contentEditable:!y,role:"textbox",spellCheck:!0,onBlur:e=>f(),suppressContentEditableWarning:!0}),E[0]&&!y?i("div",{children:g,className:TT}):null],className:NT}):i("textarea",{"aria-label":"Markdown source",className:GT(m),spellCheck:!1,placeholder:g,readOnly:y,value:d,onBlur:e=>f(),onChange:e=>{let t=e.target.value;R.current=t,D.current=t,u(t)}}),r("div",{children:[r("div",{children:[j("Rich","Rich text"),j("Source","Markdown")],className:CT}),!y&&L?i(bT,{editor:O,formats:S[0]}):null,C[0]&&L?i("div",{children:"Editing as rich text will reformat this document — switch to Markdown to keep it as written.",className:AT}):null,z],className:v?ET+" "+kT:ET})};function WT(e){return"var("+e+")"}let HT=co([gi("inlineFlex"),di("center"),xi("center"),ui("background",WT(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("color",WT(_t.textDisabled))]),JT=uo([HT,co([ui("width","24px"),ui("height","24px"),ui("border-radius",WT(St.sm)),ui("font-size",WT(xt.sizeSm)),ui("vertical-align","middle")])]),XT=uo([HT,co([ui("border-radius",WT(St.md)),ui("font-size",WT(xt.sizeSm))])]),QT=uo([XT,co([mi("column"),ui("gap",WT(bt.xs)),ui("aspect-ratio","4 / 3")])]),YT=uo([XT,co([mi("row"),ui("gap",WT(bt.sm)),ui("padding","var("+bt.sm+") var("+bt.md+")")])]),ZT=co([ui("width","240px"),ui("max-width","100%")]),eR=co([ui("width","100%")]),tR=co([ui("width","100%"),ui("height","100%"),ui("aspect-ratio","auto")]),nR=co([ui("font-size","20px"),ui("line-height","1")]),rR=co([ui("position","absolute"),ui("width","1px"),ui("height","1px"),ui("padding","0"),ui("margin","-1px"),Mi("hidden"),ui("clip","rect(0, 0, 0, 0)"),ui("white-space","nowrap"),ui("border","0")]);function iR(e){return"Media"===e?"⬚":"▤"}function oR(e){switch(e){case"Thumb":case"Detail":return ZT;case"Tile":return eR;case"Fill":return tR}}let sR=function(e){let t,n=e.size,o=e.kind,s=void 0!==o?o:"Media",a=void 0!==n?n:"Detail",l=U(e.label,"Media"===s?"No image":"No file");return t="Media"===s?QT:YT,"Media"===s?"Thumb"===a?i("span",{children:iR(s),"aria-label":l,className:JT,role:"img",title:l}):r("span",{children:[i("span",{children:iR(s),"aria-hidden":!0,className:nR}),l],"aria-label":l,className:uo([t,oR(a)]),role:"img"}):r("span","Thumb"===a?{children:[i("span",{children:iR(s),"aria-hidden":!0}),i("span",{children:l,className:rR})],className:JT,title:l}:{children:[i("span",{children:iR(s),"aria-hidden":!0,className:nR}),l],className:uo([t,oR(a)])})};function aR(e){return"var("+e+")"}let lR=co([ui("color",aR(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]),cR=co([gi("inlineBlock"),ui("width","12px"),ui("height","12px"),ui("border-radius","3px"),ui("border","1px solid var("+_t.border+")"),ui("vertical-align","-1px")]),uR=co([gi("inlineFlex"),di("center"),ui("gap","6px")]),dR=co([ui("height","24px"),ui("width","24px"),ui("object-fit","cover"),ui("border-radius",aR(St.sm)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("vertical-align","middle")]),fR=co([ui("max-height","160px"),ui("max-width","240px"),ui("object-fit","cover"),ui("border-radius",aR(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),pi("zoomIn")]),hR=co([ui("color",aR(_t.error)),ui("font-size",aR(xt.sizeXs)),ui("font-weight",aR(xt.weightMedium)),ui("white-space","nowrap"),Ai(to(6))]),pR=co([gi("inlineBlock"),ui("background",aR(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius","3px"),ui("color",aR(_t.textSecondary)),ui("font-size",aR(xt.sizeXs)),ui("font-weight",aR(xt.weightMedium)),ui("letter-spacing","0.03em"),ui("padding","1px 4px"),ui("line-height","1.2")]),gR=co([ui("color",aR(_t.textSecondary))]),mR=co([ui("color",aR(_t.warning)),ui("font-weight",aR(xt.weightMedium))]),vR=co([ui("color",aR(_t.textSecondary)),ui("font-weight",aR(xt.weightNormal))]),yR=co([gi("inlineBlock"),ui("background",aR(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius","3px"),ui("color",aR(_t.textSecondary)),ui("font-size",aR(xt.sizeXs)),ui("padding","1px 4px"),ui("line-height","1.2")]),_R=co([gi("inlineBlock"),ui("background",aR(_t.surfaceSubtle)),ui("border-radius",aR(St.full)),ui("width","64px"),ui("height","6px"),Mi("hidden")]);function bR(e){return co([ui("background",aR(_t.brand)),ui("border-radius",aR(St.full)),ui("height","100%"),ui("width",e.toString()+"%")])}let xR=co([ui("color",aR(_t.textSecondary)),ui("font-size",aR(xt.sizeXs)),ui("font-variant-numeric","tabular-nums")]),SR=co([ui("width","220px"),ui("max-width","100%")]),wR=co([gi("flex"),mi("column"),ui("gap","1px"),ui("line-height","1.35")]),ER=co([ui("background","none"),ui("border","none"),ui("padding","0"),pi("zoomIn")]),kR=co([gi("inlineFlex"),ui("background","none"),ui("border","none"),ui("padding","0"),ui("line-height","0"),ui("max-width","100%"),pi("pointer"),Yi([ui("opacity","0.75")])]),CR=co([gi("flex"),mi("column"),ui("gap",aR(bt.xs)),ui("width","100%")]),AR=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",aR(_t.textSecondary)),ui("font-size",aR(xt.sizeXs)),ui("text-decoration","underline"),pi("pointer"),Yi([ui("color",aR(_t.brand))])]),NR=co([gi("flex"),mi("column"),di("flexStart"),ui("gap","6px")]),TR=co([ui("color",aR(_t.textSecondary)),ui("font-family",aR(xt.fontFamilyMono)),ui("font-size",aR(xt.sizeXs))]),RR=co([gi("inlineBlock"),ui("background","#ffffff"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",aR(St.md)),ui("padding","4px"),ui("line-height","0")]),DR=co([ui("display","block"),ui("max-width","260px"),ui("height","auto")]),IR=co([gi("flex"),di("center"),ui("gap",aR(bt.xs))]);function FR(e){return co([ui("background",aR(_t.surface)),ui("border","1px solid var("+(e?_t.error:_t.border)+")"),ui("border-radius",aR(St.sm)),ui("color",aR(_t.textPrimary)),ui("font-family","inherit"),ui("font-size",aR(xt.sizeSm)),ui("padding","6px 8px")])}let OR=co([ui("flex","1 1 auto"),ui("min-width","0")]),PR=co([ui("flex","0 0 auto")]),MR=co([gi("inlineFlex"),di("center"),ui("gap","6px")]);function LR(e){return co([ui("color",aR(e?_t.error:_t.textSecondary)),ui("font-size",aR(xt.sizeXs)),ui("font-variant-numeric","tabular-nums")])}let zR=co([gi("flex"),mi("column"),ui("gap","4px")]),jR=co([gi("flex"),di("center"),ui("gap",aR(bt.xs))]);function UR(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function BR(e){let t=e<0,n=(t?-e:e).toFixed(2).split("."),r=U(n[0],"0"),i=U(n[1],"00"),o=e=>{let t=e.length;return t<=3?e:o(e.slice(0,t-3|0))+","+e.slice(t-3|0)};return(t?"-":"")+o(r)+"."+i}function $R(e){if(function(e){return/^[A-Z]{3}$/.test(e)}(e))try{return T(new Intl.NumberFormat("en-US",{style:"currency",currency:e}))}catch(t){return}}function qR(e){let t=$R(e);return void 0!==t?D(t).resolvedOptions().maximumFractionDigits:2}function GR(e,t){let n=e*Math.pow(10,qR(t));return n<0?-Math.round(-n):Math.round(n)}function VR(e,t){let n=$R(t);return void 0!==n?D(n).format(e/Math.pow(10,qR(t))):BR(e)+" "+t}function KR(e){return j(ht(e),e=>{let t=j(Xe(e,"amount"),ft),n=j(Xe(e,"currency"),dt);if(void 0!==t&&void 0!==n)return[t,n]})}function WR(e){let t=e.toFixed(2).replace(/\.?0+$/,"");return(""===t||"-"===t?"0":t)+"%"}function HR(e){let t=["B","KB","MB","GB","TB","PB"],n=((e,n)=>{for(;;){if(!(e>=1024&&n<(t.length-1|0)))return[e,n];n=n+1|0,e=e/1024}})(e<0?0:e,0),r=n[1],i=n[0];return(0===r?Math.round(i).toString():(Math.round(10*i)/10).toString())+" "+t[r]}function JR(e){let t=e<0?0:0|Math.floor(e),n=t/86400|0,r=t%86400/3600|0,i=t%3600/60|0,o=t%60;return n>0?n.toString()+"d "+r.toString()+"h":r>0?r.toString()+"h "+i.toString()+"m":i>0?i.toString()+"m "+o.toString()+"s":o.toString()+"s"}function XR(e){return j(ht(e),e=>{let t=t=>j(j(Xe(e,t),dt),e=>""===e?void 0:e),n=t("start"),r=t("end");if(void 0!==n&&void 0!==r)return[n,r]})}function QR(e,t){let n=gc(e),r=gc(t);return void 0!==n&&void 0!==r?r<n?"Ends before it starts":void 0:"Not a date-time"}function YR(e,t){let n=gc(e),r=gc(t);if(void 0!==n&&void 0!==r&&r>=n)return JR((r-n)/1e3)}function ZR(e){let t,n=function(e,t){return ge(t,e,(e,t)=>U(e.split(t)[0],e))}(e,["?","#"]),r=n.split("/").filter(e=>""!==e),i=U(r[r.length-1|0],"");try{t=decodeURIComponent(i)}catch(o){t=i}return""===t?"file":t}function eD(e){return/^[A-Za-z]{2}$/.test(e)}function tD(e){if(eD(e))return e.toUpperCase().split("").map(e=>U(e.codePointAt(0),65)+127397|0).map(e=>String.fromCodePoint(e)).join("")}let nD={contents:void 0};function rD(e){if(!eD(e))return e;let t=function(){let e,t=nD.contents;if(void 0!==t)return D(t);try{e=T(new Intl.DisplayNames(["en"],{type:"region"}))}catch(n){e=void 0}return nD.contents=T(e),e}();if(void 0===t)return e;try{let n=D(t).of(e.toUpperCase());return""===n?e:n}catch(n){return e}}let iD=["street","streetaddress","line1","addressline1","address1"],oD=["line2","addressline2","address2","apartment","unit","suite"],sD=["postalcode","zip","zipcode","postcode"],aD=["city","town","locality"],lD=["state","region","province","county"],cD=["country","countrycode"];function uD(e){let t=ut(e);if("object"==typeof t)switch(t.TAG){case"JSONString":let e=t._0.split("\n").map(e=>e.trim()).filter(e=>""!==e);return 0===e.length?void 0:e;case"JSONObject":let n=Qe(t._0),r=e=>j(n.find(t=>e.includes(t[0].toLowerCase())),e=>function(e){let t=ut(e);if("object"==typeof t)switch(t.TAG){case"JSONString":let e=t._0;return""===e?void 0:e;case"JSONNumber":return t._0.toString();default:return}}(e[1])),i=r(sD),o=r(aD),s=void 0!==i?void 0!==o?i+" "+o:i:void 0!==o?o:void 0,a=me([r(iD),r(oD),s,r(lD),r(cD)],e=>e).map(e=>e.trim()).filter(e=>""!==e);return 0===a.length?void 0:a;default:return}}function dD(e){let t=tD(e);return void 0!==t?t+" "+rD(e):e}function fD(e){let t=e.toFixed(5).replace(/\.?0+$/,"");return""===t||"-"===t?"0":t}function hD(e){return L(z(Da(e,"maximum"),e=>0|e),5,e=>e<=0?5:e)}function pD(e,t){let n=Da(e,"maximum");return void 0!==n&&n>0&&n<=1?t/n*100:t}let gD={};function mD(e,t){gD[ia(e)]=t}function vD(e,t){return j(ja(e,t),e=>Xe(gD,ia(e.semantic)))}function yD(e,t,n){return j(vD(e,t),r=>r.cell(e,t,n))}function _D(e,t,n){return j(vD(e,t),r=>r.detail(e,t,n))}function bD(e,t){return j(Ua(e,t),e=>Xe(gD,ia(e.semantic)))}function xD(e){e.stopPropagation()}function SD(e,t,n){return i("a",n?{children:t,className:lR,href:e,rel:"noopener noreferrer",target:"_blank",onClick:xD}:{children:t,className:lR,href:e,onClick:xD})}function wD(e){return j(dt(e),e=>""===e?void 0:e)}function ED(e){let t=(t,n,r)=>z(wD(r),e);return{cell:t,detail:t}}function kD(e){let t=(t,n,r)=>z(ft(r),t=>e(t));return{cell:t,detail:t}}function CD(e){let t=e.size,n=e.kind,r=function(e){return j(d(ea),t=>t(e))}(e.field);if(void 0===r)return i(sR,{kind:n,size:t});let o=function(e){return"Media"===e?["Add an image","Add image"]:["Add a file","Add file"]}(n);return i("button",{children:i(sR,{kind:n,size:t,label:o[1]}),className:kR,title:o[0],type:"button",onClick:e=>{e.stopPropagation(),r()}})}function AD(e){let t=e.alt,n=e.src,a=s(()=>!1);if(void 0===n)return i(CD,{field:e.field,kind:"Media",size:"Detail"});let l=a[1];return r(o,{children:[i("button",{children:i("img",{className:fR,alt:t,src:n}),className:ER,title:"Click to enlarge",onClick:e=>{e.stopPropagation(),l(e=>!0)}}),a[0]?i(Yl,{slides:[{key:n,src:n,title:t}],index:0,onIndexChange:e=>{},onClose:()=>l(e=>!1)}):null]})}function ND(e){let t=ut(e);if("object"!=typeof t)return"JSONNull"===t?T(void 0):void 0;if("JSONString"!==t.TAG)return;let n=t._0;return T(""===n?void 0:n)}function TD(e,t,n){return j(wD(n),e=>{return function(e){return!!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)||/^[0-9A-Za-z_-]{16,}$/.test(e)}(e)?void 0:r("span",{children:[i(Ho,{name:t=e,size:"Small"}),t],className:uR});var t})}function RD(e,t){let n=He(e),o=function(e){let t=e.split("."),n=t.length;if(0===n||1===n)return;let r=U(t[n-1|0],"");return/^[A-Za-z0-9]{1,5}$/.test(r)?r.toUpperCase():void 0}(t);return r("span",{children:[void 0!==o?i("span",{children:o,className:pR}):null,i("a",{children:t,className:lR,download:"",href:n,rel:"noopener noreferrer",target:"_blank",onClick:xD})],className:uR})}function DD(e){let t=e.name,n=e.href,o=s(()=>!1),a=o[1],l=o[0];return r("span",{children:[r("span",{children:[RD(n,t),xc(n)?i("button",{children:l?"Hide preview":"Preview","aria-expanded":l,className:AR,type:"button",onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null],className:uR}),l?i(Sc,{src:He(n),title:t,height:"60vh"}):null],className:CR})}function ID(e,t,n){return z(KR(n),e=>{return t=e[0],n=e[1],i("span",{children:VR(t,n),className:xR});var t,n})}function FD(e){return 0===e.length||e.includes("EUR")?"EUR":U(e[0],"EUR")}function OD(e,t){return function(e,t){return GR(e,t)/Math.pow(10,qR(t))}(e,t).toFixed(qR(t))}function PD(e){let t=e.hasError,n=e.onBlur,o=e.onChange,a=e.value,l=U(j(Sa(e.propSchema).find(e=>"currency"===e[0].toLowerCase()),e=>$s(e[1])),[]);let c;if(""===a)c=void 0;else try{c=KR(JSON.parse(a))}catch(v){c=void 0}let u=s(()=>{if(void 0===c)return["",FD(l)];let e=c[1];return[OD(c[0]/Math.pow(10,qR(e)),e),e]}),d=u[0],f=d[1],h=d[0],p=u[1],g=(e,t)=>{p(n=>[e,t]);let n=ra(e);o(void 0!==n&&""!==t&&Number.isFinite(n)?JSON.stringify(Ze([["amount",GR(n,t)],["currency",t]])):"")},m=e=>{let t=ra(h);g(void 0!==t&&""!==e?OD(t,e):h,e)};return r("span",{children:[i("input",{"aria-label":"Amount",className:FR(t)+" "+OR,inputMode:"decimal",placeholder:OD(0,f),type:"text",value:h,onBlur:e=>(()=>{let e=ra(h);if(void 0!==e){let t=OD(e,f);t!==h&&p(e=>[t,f])}n()})(),onChange:e=>{let t=e.target.value.replaceAll(",",".");if(function(e,t){let n=qR(t),r=0===n?"^-?[0-9]*$":"^-?[0-9]*([.][0-9]{0,"+n.toString()+"})?$";return new RegExp(r).test(e)}(t,f))return g(t,f)}}),0===l.length?i("input",{"aria-label":"Currency",className:FR(t)+" "+PR,placeholder:"EUR",value:f,onBlur:e=>n(),onChange:e=>m(e.target.value)}):i("select",{children:l.map(e=>i("option",{children:e,value:e},e)),"aria-label":"Currency",className:FR(t)+" "+PR,value:f,onBlur:e=>n(),onChange:e=>m(e.target.value)})],className:IR})}function MD(e,t,n){return z(XR(n),e=>function(e,t){let n=QR(e,t),o=YR(e,t),s=void 0!==n?n:void 0!==o?o:"";return r("span",{children:[U(ys(e),e)+" → "+U(ys(t),t),""===s?null:i("span",{children:s,className:LR($(n))})],className:MR})}(e[0],e[1]))}function LD(e){if(""===e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t.toISOString()}function zD(e){let t=ms(e);return t===e?"":t.slice(0,10)+"T"+t.slice(11,16)}function jD(e){let t,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value;if(""===a)t=void 0;else try{t=XR(JSON.parse(a))}catch(g){t=void 0}let l,c=void 0!==t?[zD(t[0]),zD(t[1])]:["",""],u=c[1],d=c[0],f=(e,t)=>{let n=LD(e),r=LD(t);s(void 0!==n&&void 0!==r?JSON.stringify(Ze([["start",n],["end",r]])):"")},h=LD(d),p=LD(u);if(void 0!==h&&void 0!==p){let e=QR(h,p);l=void 0!==e?[e,!0]:[U(YR(h,p),""),!1]}else l=["start and end",!1];return r("span",{children:[r("span",{children:[i("input",{"aria-label":"Start",className:FR(n),type:"datetime-local",value:d,onBlur:e=>o(),onChange:e=>f(e.target.value,u)}),i("span",{children:"→","aria-hidden":!0}),i("input",{"aria-label":"End",className:FR(n),type:"datetime-local",value:u,onBlur:e=>o(),onChange:e=>f(d,e.target.value)})],className:jR}),i("span",{children:l[0],className:LR(l[1])})],className:zR})}function UD(e){let t=tD(e);return void 0!==t?r("span",{children:[i("span",{children:t,"aria-hidden":!0}),rD(e)],className:uR}):e}function BD(e,t,n){return z(wD(n),UD)}function $D(e,t,n){return z(function(e){return j(ht(e),e=>{let t=t=>j(Qe(e).find(e=>t(e[0].toLowerCase())),e=>ft(e[1])),n=t(Pa),r=t(Ma);if(void 0!==n&&void 0!==r)return[n,r]})}(n),e=>fD(e[0])+", "+fD(e[1]))}mD("Email",ED(e=>SD("mailto:"+e,e,!1))),mD("Phone",ED(e=>SD("tel:"+e,e,!1))),mD("Url",{cell:(e,t,n)=>z(wD(n),e=>SD(e,UR(e,40),!0)),detail:(e,t,n)=>z(wD(n),e=>SD(e,e,!0))}),mD("Currency",kD(BR)),mD("Percent",kD(WR)),mD("Bytes",kD(HR)),mD("Duration",kD(JR)),mD("Color",ED(e=>r("span",{children:[i("span",{className:cR,style:{background:e}}),e],className:uR}))),mD("Image",{cell:(e,t,n)=>z(ND(n),t=>void 0!==t?i("img",{className:dR,alt:e,src:He(t),onClick:xD}):i(CD,{field:e,kind:"Media",size:"Thumb"})),detail:(e,t,n)=>z(ND(n),t=>i(AD,{src:z(t,He),alt:e,field:e}))}),mD("UserRef",{cell:TD,detail:TD}),mD("Markdown",{cell:(e,t,n)=>z(wD(n),e=>UR(function(e){return e.replace(/```[^\n]*\n?/g,"").replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/^>\s?/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/\s+/g," ").trim()}(e),80)),detail:(e,t,n)=>z(wD(n),e=>i(hh,{source:e})),input:(e,t,n,r,o,s,a)=>i(KT,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&function(e){return""===e.trim()}(n))return"Required"}}),mD("Rating",{cell:(e,t,n)=>z(ft(n),e=>i(Ic,{value:e,max:hD(t)})),detail:(e,t,n)=>z(ft(n),e=>i(Ic,{value:e,max:hD(t),size:"Medium",showValue:!0})),input:(e,t,n,r,o,s,a)=>i(Ic,{value:U(ra(n),0),max:hD(t),size:"Medium",showValue:!0,onChange:e=>r(e<=0?"":e.toString()),onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i=ra(n);if(void 0===i)return"Invalid rating";let o=hD(t);return i<0||i>o?"Must be between 0 and "+o.toString():void 0}}),mD("Progress",{cell:(e,t,n)=>z(ft(n),e=>{let n=function(e){return e<0?0:e>100?100:e}(pD(t,e));return r("span",{children:[i("span",{children:i("span",{className:bR(n)}),className:_R}),i("span",{children:Math.round(n).toString()+"%",className:xR})],className:uR})}),detail:(e,t,n)=>z(ft(n),e=>i("div",{children:i(Uc,{value:pD(t,e)}),className:SR}))}),mD("FileUrl",{cell:(e,t,n)=>z(wD(n),e=>RD(e,UR(ZR(e),40))),detail:(e,t,n)=>z(wD(n),e=>i(DD,{href:e,name:ZR(e)}))}),mD("File",{cell:(e,t,n)=>z(ND(n),t=>void 0!==t?RD(t,UR(ZR(t),40)):i(CD,{field:e,kind:"Document",size:"Thumb"})),detail:(e,t,n)=>z(ND(n),t=>void 0!==t?i(DD,{href:t,name:ZR(t)}):i(CD,{field:e,kind:"Document",size:"Detail"}))}),mD("Money",{cell:ID,detail:ID,input:(e,t,n,r,o,s,a)=>i(PD,{propSchema:t,value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i;try{i=JSON.parse(n)}catch(s){i=null}let o=KR(i);return void 0!==o?function(e,t){if(!Number.isFinite(e))return"Invalid amount";if(e===Math.trunc(e))return;let n=qR(t);return 0===n?t+" has no decimal places":t+" has "+n.toString()+" decimal places"}(o[0],o[1]):"Invalid amount"}}),mD("DateRange",{cell:MD,detail:MD,input:(e,t,n,r,o,s,a)=>i(jD,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i;try{i=JSON.parse(n)}catch(s){i=null}let o=XR(i);return void 0!==o?QR(o[0],o[1]):"Invalid range"}}),mD("Country",{cell:BD,detail:BD}),mD("Address",{cell:(e,t,n)=>z(function(e){return z(uD(e),e=>e.map(e=>eD(e)?rD(e):e).join(", "))}(n),e=>UR(e,60)),detail:(e,t,n)=>z(uD(n),e=>i("span",{children:e.map((e,t)=>i("span",{children:dD(e)},t.toString())),className:wR}))});let qD={cell:$D,detail:$D};mD("GeoPoint",qD);let GD="Located — this query selected only which arm the value is in, not the coordinates";function VD(e){let t=j(Is(e).channel,e=>function(e){return L(Xe(Bc,e),Gc,e=>e.constraints)}(e).maxLength),n=function(e){return z(j(j(ht(e),e=>Xe(e,"maxLength")),ft),e=>0|e)}(e);return void 0!==t?void 0!==n?t<n?t:n:t:n}function KD(e){return"var("+e+")"}mD("Geolocation",{cell:function(e,t,n){return z(ya(n),e=>{switch(e.TAG){case"Pending":return i("span",{children:"Locating…",className:gR});case"Located":let t=_a(e);return void 0!==t?fD(t[0])+", "+fD(t[1]):i("span",{children:"Located",className:yR,title:GD});case"Unresolvable":return i("span",{children:"Not located",className:mR,title:U(ba(e),"No reason given")})}})},detail:function(e,t,n){return z(ya(n),e=>{switch(e.TAG){case"Pending":let t=function(e){switch(e.TAG){case"Pending":let t=e.requestedFor;return void 0!==t?t:void 0;case"Located":case"Unresolvable":return}}(e);return r("span",{children:["Locating…",void 0!==t?i("span",{children:" "+t,className:vR}):null],className:gR});case"Located":let n=_a(e);return void 0!==n?fD(n[0])+", "+fD(n[1]):i("span",{children:"Located",className:yR,title:GD});case"Unresolvable":let o=ba(e);return r("span",{children:["Not located",void 0!==o?i("span",{children:" "+o,className:vR}):null],className:mR})}})}}),mD("ChannelText",{cell:(e,t,n)=>z(wD(n),e=>{let n=j(VD(t),t=>{if(gh(e)>t)return gh(e)-t|0});return r("span",{children:[UR(e,80),void 0!==n?i("span",{children:n.toString()+" over",className:hR}):null]})}),detail:(e,t,n)=>{let r=wD(n),o=Is(t).channel;if(void 0!==r&&void 0!==o)return i(Jh,{channelId:o,message:{body:r}})},input:(e,t,n,r,o,s,a)=>{let l=j(Is(t).channel,qc);return i(Fh,{value:n,onChange:r,onBlur:o,maxLength:VD(t),channelLabel:z(l,e=>e.label),hasError:a,note:j(l,e=>e.constraints.note),name:e})},validateInput:(e,t,n,r)=>r&&""===n?"Required":j(VD(t),e=>{let t=gh(n);if(t>e)return Dh(t-e|0)+" over the "+e.toString()+"-character limit"})}),mD("Qr",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(wD(n),e=>r("span",{children:[i(Dl,{value:e}),i("span",{children:e,className:TR})],className:NR}))}),mD("Barcode",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(wD(n),e=>r("span",{children:[i(jl,{value:e}),i("span",{children:e,className:TR})],className:NR}))}),mD("Signature",{cell:(e,t,n)=>j(wD(n),e=>{if(ru(e))return i("span",{children:"✓ Signed",className:xR})}),detail:(e,t,n)=>j(wD(n),e=>{if(ru(e))return i("span",{children:i("img",{className:DR,alt:"Signature",src:iu(e)}),className:RR})}),input:(e,t,n,r,o,s,a)=>i(ou,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&""===n)return"Required"}});let WD=co([gi("inlineFlex"),di("center"),_i("wrap"),ui("gap","4px"),ui("font-size",KD(xt.sizeSm)),ui("min-width","0")]),HD=co([ui("color",KD(_t.textDisabled)),ui("font-size",KD(xt.sizeXs))]),JD=co([ui("color",KD(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]),XD=co([ui("color",KD(_t.textPrimary))]);let QD=function(e){let t=e.segments,n=ae();return i("span",{children:t.map((e,o)=>{let s=o===(t.length-1|0),a=e.href;return r(g,{children:[void 0!==a?i("a",{children:e.label,className:JD,href:a,onClick:e=>{if(!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button))return e.preventDefault(),e.stopPropagation(),n(a)}}):i("span",{children:e.label,className:XD}),s?null:i("span",{children:" › ",className:HD})]},o.toString()+":"+e.label)}),className:WD})};function YD(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function ZD(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function eI(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function tI(e){let t=e.toLowerCase(),n=e.length,r=r=>{let i=r.length;if(n>i&&t.endsWith(r))return e.slice(0,n-i|0)},i=r("ids");return void 0!==i?i:r("id")}function nI(e,t,n){let r=Lt(t);if("compositeId"===e)return"KCompositeId";let i=Ft(r);if(void 0!==i)return{TAG:"KUnion",_0:i};let o=$s(r);if(void 0!==o)return{TAG:"KEnum",_0:o};let s=YD(r),a=0;if(void 0!==s)switch(s){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(r);if(void 0===t)return"KArrayOfStrings";if(eI(t)||vt(YD(t),"object"))return{TAG:"KArrayOfObjects",_0:t};let n=tI(e);return void 0!==n?{TAG:"KArrayOfEntityIds",_0:n}:"KArrayOfStrings";case"boolean":return"KBoolean";case"integer":case"number":return"KNumber";case"object":return eI(r)?{TAG:"KNestedObject",_0:r}:"KString";default:a=1}else a=1;if(1===a){let t=ZD(r),i=0;if(void 0!==t)switch(t){case"date":case"date-time":return"KDate";default:i=2}else i=2;if(2===i){if(n.isId)return"KString";let t=tI(e);return void 0!==t?{TAG:"KEntityId",_0:t}:"KString"}}}function rI(e,t,n){let r=Ha(t,e);return void 0!==n&&void 0!==r&&n.pluginId===r.pluginId&&n.viewName===r.name}function iI(e,t,n){if("compositeId"===e||n.isId)return 0;if("id"===e)return 1;if(n.summary)return 2;if("object"!=typeof t)switch(t){case"KBoolean":return 7;case"KCompositeId":return 0;case"KDate":return 4;case"KNumber":return 8;case"KString":return 5;case"KArrayOfStrings":return 11}else switch(t.TAG){case"KEnum":return 6;case"KEntityId":return 9;case"KArrayOfEntityIds":return 10;case"KArrayOfObjects":return 12;case"KNestedObject":return 13;case"KUnion":return 14}}function oI(e,t){if("object"!=typeof e)switch(e){case"KBoolean":return"80px";case"KCompositeId":return"260px";case"KNumber":return"100px";case"KString":return"id"===t?"220px":void 0;case"KDate":case"KArrayOfStrings":return"180px"}else switch(e.TAG){case"KEnum":return"140px";case"KEntityId":return"220px";case"KArrayOfEntityIds":return"260px";default:return"240px"}}function sI(e,t){let n=Is(t),r=nI(e,t,n),i=U(j(j(ht(t),e=>Xe(e,"title")),dt),lt(e));return{key:e,label:i,kind:r,ann:n,propSchema:t,priority:iI(e,r,n),width:oI(r,e)}}function aI(e,t,n,r,i,o){let s,a=void 0!==t?t:"List",l=void 0!==n?n:[],c=U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[]),u=Os(e),d="List"===a&&0!==u.length,f=P(B(i,Ba(e,void 0,void 0).labelField),e=>"id"!==e),h=me(c,e=>{let t,n=e[0],i=sI(n,e[1]),s=i.kind;if("object"!=typeof s)t=!1;else switch(s.TAG){case"KEntityId":case"KArrayOfEntityIds":t=rI(s._0,l,r);break;default:t=!1}let a=vt(n,o);if(function(e,t,n,r){return!t.hidden&&!function(e){switch(e){case"sortKey":case"subId":return!0;default:return!1}}(e)&&(function(e,t){return"id"===e||"compositeId"===e||t.isId}(e,t)?vt(r,e):!n||t.summary)}(n,i.ann,d,f)&&!t&&!a)return i});if(0===h.length){let t=e=>c.find(t=>t[0]===e);s=L(B(B(j(Ps(e),t),t("compositeId")),t("id")),[],e=>[sI(e[0],e[1])])}else s=h;return s.toSorted((e,t)=>e.priority-t.priority|0)}function lI(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function cI(e){return i(Ss,{variant:"Neutral",label:e,dot:!1})}function uI(e,t,n,r,i){let o=Ha(n,e);return void 0===o||void 0!==i&&(i.pluginId===o.pluginId&&i.viewName===o.name)?[void 0,t]:[Ya(o.pluginId,o.name,t,[]),t]}function dI(e,t,n,r){let i=Ha(n,e);return void 0!==i?t?nt(i.name):tt(i.name):r}function fI(e,t,n){let r=e.kind;if("object"!=typeof r)return e.label;switch(r.TAG){case"KEntityId":let i=r._0;return rI(i,t,n)?e.label:dI(i,!1,t,e.label);case"KArrayOfEntityIds":let o=r._0;return rI(o,t,n)?e.label:dI(o,!0,t,e.label);default:return e.label}}function hI(e,t,n){if(void 0===n)return[t,!1];let r=n.lookupLabel(e,t);return void 0!==r?[r,!1]:[t,n.isMissing(e,t)]}function pI(e,t,n,o,s,a,l,c,u){let d=void 0!==u&&u,f=rI(t,o,l),h=U(c,Na(t)),p=e=>{let n,s,c=uI(t,e,o,0,l),u=c[1],d=f?[u,!1]:hI(t,u,a),p=d[0];if(void 0!==a){let e=a.retiredBadge;n=void 0===e||f?void 0:e(t,u)}else n=void 0;if(void 0!==a){let e=a.linkable;s=!(void 0!==e&&!f)||e(t,u)}else s=!0;let g=s?i(cs,{href:c[0],label:p,rawValue:u}):i("span",{children:p,title:p+" is not available to open"}),m=void 0!==n?r("span",{children:[g,n],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):g,v=h&&p!==u?r("span",{children:[i(Ho,{name:p,size:"Small"}),m],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):m;return d[1]?i("span",{children:v,style:{fontStyle:"italic",opacity:"0.55"},title:"Referenced "+t+" not found (id: "+u+")"}):v},g=ut(n);if("object"!=typeof g)return JSON.stringify(n);switch(g.TAG){case"JSONString":return p(g._0);case"JSONArray":let e=g._0,s=me(e,dt),c=s.length===e.length?(e=>{let n=me(e,e=>{let n=uI(t,e,o,0,l)[1],r=hI(t,n,a)[0];if(r!==n)return{name:r}});if(d&&h&&!f&&e.length>=2&&n.length===e.length)return i(Zs,{members:n,size:"Small"})})(s):void 0;return void 0!==c?c:i("span",{children:e.map((t,n)=>{let i=ut(t);return"object"!=typeof i||"JSONString"!==i.TAG?null:r("span",{children:[p(i._0),n<(e.length-1|0)?", ":null]},n.toString())})});default:return JSON.stringify(n)}}function gI(e,t,n){let r=ut(n);if("object"!=typeof r)switch(r){case"JSONFalse":return i(Ss,{variant:"Neutral",label:"No",dot:!1});case"JSONTrue":return i(Ss,{variant:"Success",label:"Yes",dot:!1});case"JSONNull":return"—"}else switch(r.TAG){case"JSONString":let i=r._0,o=bs(e,i);if(void 0===t)return void 0!==o?o:i;switch(t){case"date":case"date-time":return ms(i);default:return void 0!==o?o:i}case"JSONNumber":return r._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(n)}}function mI(e,t,n,o,s,a){let l=ht(t);if(void 0===l)return;let c=Xe(l,"name");if(void 0!==c&&"JSONNull"!==ut(c))return gI("name",void 0,c);let u=aI(e,"Drill",n,a,void 0,void 0),d=me(u,e=>{let t,n=e.kind;if("object"!=typeof n)t="KArrayOfStrings"!==n;else switch(n.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":case"KUnion":t=!1;break;default:t=!0}let r=Xe(l,e.key);if(!t)return;if(void 0===r)return;let i=ut(r);return"object"!=typeof i&&"JSONNull"===i?void 0:[e,r]});if(0===d.length)return;let f=d.slice(0,2),h=u.length-f.length|0,p=f.map((e,t)=>{let i,o=e[1],l=e[0],c=l.kind;if("object"!=typeof c)i=gI(l.key,"KDate"===c?ZD(l.propSchema):void 0,o);else switch(c.TAG){case"KEnum":let e=ut(o);i="object"!=typeof e||"JSONString"!==e.TAG?gI(l.key,void 0,o):cI(e._0);break;case"KEntityId":i=pI(l.key,c._0,o,n,0,s,a,void 0,void 0);break;default:i=gI(l.key,void 0,o)}return r("span",{children:[t>0?" · ":null,i]},t.toString())}),g=h>0?i("span",{children:"+"+h.toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null;return r("span",{children:[p,g],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}})}function vI(e,t,n,o,s,a,l,c,u){let d=void 0!==s?s:Es,f=P(o,e=>"JSONNull"!==ut(e));if(void 0===f)return U(function(e,t){return yD(e,t,null)}(e,n),"—");let h=yD(e,n,f);if(void 0!==h)return h;if("object"!=typeof t)switch(t){case"KCompositeId":return function(e){let t=ut(e);if("object"!=typeof t)return JSON.stringify(e);if("JSONString"!==t.TAG)return JSON.stringify(e);let n=t._0.split("/").map(e=>({label:e,href:void 0}));return i(QD,{segments:n})}(f);case"KDate":return gI(e,ZD(n),f);case"KBoolean":case"KNumber":return gI(e,void 0,f);case"KString":let t=ut(f);if("object"!=typeof t)return gI(e,void 0,f);if("JSONString"!==t.TAG)return gI(e,void 0,f);let r=t._0;return r.length>60?i("span",{children:lI(r,60),title:r}):gI(e,void 0,f);case"KArrayOfStrings":let o=U(z(pt(f),e=>me(e,dt)),[]);return i(Zo,{items:o})}else switch(t.TAG){case"KEnum":let n=ut(f);return"object"!=typeof n||"JSONString"!==n.TAG?gI(e,void 0,f):cI(n._0);case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":let o=t._0,s=U(pt(f),[]),h=s.length;if(d.collapsed){let e=s[0];return void 0!==e?yI(o,e,a,l,c,u):i(ps,{count:h,label:"items"})}let p=j(s[0],e=>mI(o,e,a,0,c,u));return void 0!==p?r("span",{children:[p,h>1?i("span",{children:"+"+(h-1|0).toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}}):i(ps,{count:h,label:"items"});case"KNestedObject":let g=t._0;if(d.collapsed)return yI(g,f,a,l,c,u);let m=mI(g,f,a,0,c,u);if(void 0!==m)return m;let v=U(z(ht(f),e=>Object.keys(e).length),0);return i(ps,{count:v,label:"fields"});case"KUnion":return function(e,t,n,i,o,s){let a=va(t);if(void 0===a)return JSON.stringify(t);let l=a[1],c=a[0],u=Pt(e,c),d=L(u,c,e=>e.tag),f=U(j(u,e=>mI(Mt(e),l,n,0,o,s)),null);return r("span",{children:[cI(d),f],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}})}(t._0,f,a,0,c,u)}let p=L(ja(e,n),!1,e=>"UserRef"===e.semantic);return pI(0,t._0,f,a,0,c,u,!!p||void 0,!0)}function yI(e,t,n,o,s,a){let l=U(ht(t),{}),c=aI(e,"Drill",n,a,void 0,void 0).filter(e=>{let t=e.kind;if("object"!=typeof t)return!0;switch(t.TAG){case"KArrayOfObjects":case"KNestedObject":return!1;default:return!0}});return i("div",{children:c.map(e=>r("div",{children:[i("span",{children:fI(e,n,a),style:{fontSize:"0.85em",minWidth:"80px",opacity:"0.55"}}),i("span",{children:vI(e.key,e.kind,e.propSchema,Xe(l,e.key),e.ann,n,o,s,a)})],style:{display:"flex",alignItems:"baseline",gap:"6px"}},e.key)),style:{display:"flex",maxHeight:"120px",overflow:"auto",flexDirection:"column",gap:"2px"}})}function _I(e){if("object"!=typeof e)return"KArrayOfStrings"!==e;switch(e.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":case"KUnion":return!1;default:return!0}}function bI(e,t,n,o,s,a,l,c,u,d){let f=void 0!==s&&s,h=B(P(d,t=>e.some(e=>e.key===t)),z(e[0],e=>e.key));return e.map(e=>{let s=fI(e,t,l),d=L(ja(e.key,e.propSchema),!1,e=>"Image"===e.semantic||"File"===e.semantic);return{key:e.key,label:s,render:s=>{let f=vI(e.key,e.kind,e.propSchema,o(s,e.key),e.ann,t,n,a,l),p=void 0!==c&&d?i(na,{fill:e=>c(s,e),children:f}):f;if(void 0===u)return p;if($(u.values)&&e.key===u.field){let e=Ks(u,o(s,u.field));return void 0!==e?e:p}if(void 0!==u.values)return p;if(!vt(h,e.key))return p;let g=Ks(u,o(s,u.field));return void 0!==g?r("span",{children:[p,g],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):p},sortable:f&&_I(e.kind),width:e.width}})}function xI(e){return(t,n)=>e(t,n).then(e=>e.data)}let SI=l(void 0),wI=l(void 0),EI={contents:void 0},kI=SI.Provider,CI=wI.Provider;let AI=function(e){let t=e.executeResult,n=e.execute,r=p(()=>void 0!==n?n:void 0!==t?xI(t):void console.error('AutoGraphQL.Provider: neither `execute` nor `executeResult` was supplied — every query below this provider will report "Not connected".'),[n,t]);return c(kI,{value:r,children:c(CI,{value:t,children:e.children})})};function NI(){return d(SI)}function TI(){return d(wI)}let RI={hasNextPage:!1,hasPreviousPage:!1,startCursor:void 0,endCursor:void 0};function DI(e,t){let n=ht(e),r=j(j(j(n,e=>Xe(e,"data")),ht),e=>Xe(e,t));return void 0!==r?r:j(n,e=>Xe(e,t))}function II(e,t){let n=DI(e,t),r=j(n,pt);return void 0!==r?r:me(U(j(j(j(n,ht),e=>Xe(e,"edges")),pt),[]),e=>j(ht(e),e=>Xe(e,"node")))}function FI(e,t){return me(II(e,t),ht)}function OI(e,t){let n=(e,t)=>U(j(Xe(e,t),gt),!1),r=(e,t)=>j(Xe(e,t),dt);return L(j(j(j(DI(e,t),ht),e=>Xe(e,"pageInfo")),ht),RI,e=>({hasNextPage:n(e,"hasNextPage"),hasPreviousPage:n(e,"hasPreviousPage"),startCursor:r(e,"startCursor"),endCursor:r(e,"endCursor")}))}let PI=[];let MI={};function LI(e,t,n,r){return j(Ha(n,t),t=>j(Xe(e,t.queryField),e=>Xe(e.labels,r)))}function zI(e,t,n,r){return j(Ha(n,t),t=>j(t.namedRetirement,n=>j(j(Xe(e,t.queryField),e=>Xe(e.states,r)),e=>{let t=n.values;return Ks(n,void 0===t||e)})))}function jI(e,t,n,r,i){if(i)return!0;let o=Ha(n,t);if(void 0===o)return!0;let s=Xe(e,o.queryField);return void 0===s||q(Xe(s.states,r))}function UI(e,t,n,r){let i=Ha(n,t);if(void 0===i)return!1;let o=Xe(e,i.queryField);return!(void 0===o||!o.loaded||!L(o.asked,!0,e=>$(Xe(e,r))))&&q(Xe(o.labels,r))}function BI(e,t,n,r){let i={},o=(e,t,s)=>{t.forEach(t=>{let a=t.kind;if("object"!=typeof a)return;switch(a.TAG){case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":return s>0?o(((e,t)=>e.map(e=>me(U(j(Xe(e,t),pt),[]),ht)).flat())(e,t.key),aI(a._0,"Drill",n,r,void 0,void 0),s-1|0):void 0;case"KNestedObject":return s>0?o(((e,t)=>me(e,e=>j(Xe(e,t),ht)))(e,t.key),aI(a._0,"Drill",n,r,void 0,void 0),s-1|0):void 0;default:return}let l=a._0;if(rI(l,n,r))return;let c=Ha(n,l);void 0===c||e.forEach(e=>M(Xe(e,t.key),e=>{(function(e){let t=ut(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,dt).filter(e=>""!==e);default:return[]}})(e).forEach(e=>{let t=c.queryField,n=U(Xe(i,t),[]);n.some(t=>t===e)||n.push(e),i[t]=n})}))})};return o(e,t,3),i}function $I(e){try{let t=atob(e),n=t.indexOf(":");return n>0&&n<(t.length-1|0)?t.slice(n+1|0):void 0}catch(t){return}}function qI(e,t,n){let r={};return FI(e,t).forEach(e=>{let t=j(Xe(e,"id"),dt),i=U(j(Xe(e,n),dt),"");if(void 0===t)return;let o=$I(t),s="id"===n?void 0!==o?o:t:""===i?t:i;r[t]=s,void 0===o||(r[o]=s)}),r}function GI(e,t,n){let r=t.queryField,i=t.labelField,o="id"===i?"id":"id "+i,s="query($ids: [ID!]!) { "+r+"Refs(ids: $ids) { id label retired retiredState } }",a="query($ids: [ID!]) { "+r+"(first: "+n.length.toString()+", filter: {ids: $ids}) { edges { node { "+o+" } } } }",l={};return l.ids=n.map(e=>e),e(s,l).then(t=>function(e,t){return $(j(j(ht(U(j(ht(e),e=>Xe(e,"data")),e)),e=>Xe(e,t+"Refs")),pt))}(t,r)?Promise.resolve(function(e,t){let n={},r={};return U(j(j(ht(U(j(ht(e),e=>Xe(e,"data")),e)),e=>Xe(e,t+"Refs")),pt),[]).forEach(e=>{let t=ht(e);if(void 0===t)return;let i=j(Xe(t,"id"),dt);if(void 0===i)return;let o=U(j(Xe(t,"label"),dt),i),s=U(j(Xe(t,"retired"),gt),!1),a=U(j(Xe(t,"retiredState"),dt),""),l=e=>{n[e]=o,s&&(r[e]=a)};l(i),M($I(i),l)}),[n,r]}(t,r)):e(a,l).then(e=>[qI(e,r,i),{}]))}let VI=l(void 0);let KI=VI.Provider;let WI={provider:KI,make:function(e){let t=NI(),n=s(()=>MI),r=n[1],i=n[0],o=h({}),a=(e,t)=>r(n=>{let r=Ze(Qe(n)),i=Ze(L(Xe(o.current,e),[],e=>e.ids).map(e=>[e,!0])),s={...t(Xe(n,e))};return s.asked=i,r[e]=s,r}),l=(e,t)=>{let n=Ze(Qe(e));return Qe(t).forEach(e=>{n[e[0]]=e[1]}),n},u=h(e=>{}),d=(e,n,r)=>{let i=e.queryField;if(void 0===t)return;let s=(e,t)=>{((e,t,n,r)=>{a(e,e=>{let i=r?void 0:e;return{loaded:!0,labels:l(L(i,{},e=>e.labels),t),states:l(L(i,{},e=>e.states),n)}})})(i,e,t,r);let n=Xe(o.current,i);if(void 0!==n)return o.current[i]={entity:n.entity,ids:n.ids,refetching:!1,stale:!1},n.stale?u.current(i):void 0};ce(GI(t,e,n).then(e=>s(e[0],e[1])),e=>(console.warn("[AutoUI] RefLabel batch "+i+" failed; cells fall back to raw ids",e),s({},{}),Promise.resolve()))},g=e=>{let t=Xe(o.current,e);if(void 0!==t&&0!==t.ids.length)return t.refetching?void(o.current[e]={entity:t.entity,ids:t.ids,refetching:t.refetching,stale:!0}):(o.current[e]={entity:t.entity,ids:t.ids,refetching:!0,stale:!1},a(e,e=>{if(void 0===e)return{loaded:!1,labels:{},states:{}};let t={...e};return t.loaded=!1,t}),d(t.entity,t.ids,!0))};u.current=g;let m=f((e,t)=>{Qe(e).forEach(e=>{let n=e[0],r=Xe(o.current,n),i=L(r,[],e=>e.ids),s=e[1].filter(e=>!i.includes(e));if(0===s.length)return;let l=t.find(e=>e.queryField===n);return void 0!==l?(o.current[n]={entity:l,ids:i.concat(s),refetching:L(r,!1,e=>e.refetching),stale:L(r,!1,e=>e.stale)},a(n,e=>{if(void 0===e)return{loaded:!1,labels:{},states:{}};let t={...e};return t.loaded=!1,t}),d(l,s,!1)):void 0})},[t]),v=f(g,[t]),y=p(()=>({entries:i,request:m,invalidate:v}),[i,m,v]);return c(KI,{value:y,children:e.children})}},HI={context:VI,use:function(){return d(VI)},useInvalidate:function(){let e=d(VI);return void 0!==e?e.invalidate:e=>{}},Provider:WI};function JI(e,t,n,r,i){let o=void 0===i||i,l=NI(),c=d(VI),u=s(()=>MI),f=u[1],h=o?BI(e,t,n,r):{},p=function(e){return Qe(e).toSorted((e,t)=>ue(e[0],t[0])).map(e=>e[0]+":"+e[1].toSorted(ue).join(",")).join("|")}(h);return a(()=>{let e={contents:!1};return""!==p&&(void 0!==c?c.request(h,n):void 0!==l&&Qe(h).forEach(t=>{let r=t[1];if(0===r.length)return;let i=t[0],o=n.find(e=>e.queryField===i);void 0===o||ce(GI(l,o,r).then(t=>{if(e.contents)return;let n=t[1],r=t[0];f(e=>{let t=Ze(Qe(e));return t[i]={loaded:!0,labels:r,states:n},t})}),t=>(e.contents||(console.warn("[AutoUI] RefLabel batch "+i+" failed; cells fall back to raw ids",t),f(e=>{let t=Ze(Qe(e));return t[i]={loaded:!0,labels:{},states:{}},t})),Promise.resolve()))})),()=>{e.contents=!0}},[p,l]),void 0!==c?c.entries:u[0]}let XI={registry:[]},QI="table",YI={contents:[]};function ZI(e){YI.contents.some(t=>t.id===e.id)?YI.contents=YI.contents.map(t=>t.id===e.id?e:t):YI.contents=YI.contents.concat([e])}function eF(e){return YI.contents.find(t=>t.id===e)}function tF(){return YI.contents}function nF(e,t){let n=void 0!==t?t:XI,r=Ba(e,void 0,void 0),i=YI.contents.filter(t=>{let i=t.arity;return("object"!=typeof i||"Multi"===i.TAG)&&t.isCapable(e,r,n)});return i.filter(e=>e.id===QI).concat(i.filter(e=>e.id!==QI))}function rF(e){return function(e){let t=me(e,e=>{if("object"==typeof e)return e._0});if(0===t.length)return 0===e.length||e.some(e=>void 0===e)?void 0:"Complete";let n=t.some(e=>"FromStart"!==e),r=t.some(e=>"ToEnd"!==e);return{TAG:"Partial",_0:n?r?"Between":"ToEnd":"FromStart"}}(e.map(e=>e.window))}function iF(e,t,n){let r=void 0!==n?n:"item";return jo(rF(e),function(e){return ge(e,0,(e,t)=>e+t.rows.length|0)}(e),t,r)}function oF(e){try{return R(localStorage.getItem(e))}catch(t){return}}function sF(e,t,n){return"autoui.viewmode."+U(e,"default")+"."+t+L(n,"",e=>"."+e)}function aF(e){return z(oF(e),e=>{let t=function(e){try{return ht(JSON.parse(e))}catch(t){return}}(e);if(void 0===t)return{mode:e};let n=j(Xe(t,"mode"),dt);return void 0!==n?{mode:n,band:j(j(Xe(t,"band"),dt),At.bandOfName)}:{mode:e}})}function lF(e,t,n){let r={};r.mode=t,r.band=At.bandName(n),function(e,t){try{return localStorage.setItem(e,t)}catch(n){return}}(e,JSON.stringify(r))}function cF(e){return"var("+e+")"}let uF=co([gi("inlineFlex"),di("center"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",cF(St.md)),ui("overflow","hidden")]),dF=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("background","none"),ui("border","none"),ui("padding","2px var("+bt.sm+")"),ui("color",cF(_t.textSecondary)),ui("font-size",cF(xt.sizeSm)),pi("pointer"),Yi([ui("background",cF(_t.surfaceSubtle)),ui("color",cF(_t.textPrimary))])]),fF=uo([dF,co([ui("background",cF(_t.surfaceSubtle)),ui("color",cF(_t.textPrimary)),ui("font-weight",cF(xt.weightMedium))])]),hF=co([Hi(At.compact,[ui("display","none")])]);let pF={Style:{group:uF,btn:dF,btnActive:fF,btnLabel:hF},make:function(e){let t=e.onSelect,n=e.activeId;return i("div",{children:e.modes.map(e=>r("button",{children:[e.icon,i("span",{children:e.label,className:hF})],"aria-label":e.label,"aria-pressed":e.id===n?"true":"false",className:e.id===n?fF:dF,title:e.label,onClick:n=>t(e.id)},e.id)),"aria-label":"View mode",className:uF,role:"group"})}};function gF(e){let t=e.source,n=Wa(),r=Ge(),o=aI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=t.rows.map((e,t)=>{let n=U(ht(e),{});return{rowKey:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}}),a=JI(s.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),l=t.refLabels,c=void 0!==l?l:{lookupLabel:(e,t)=>LI(a,e,n,t),isMissing:(e,t)=>UI(a,e,n,t),retiredBadge:(e,t)=>zI(a,e,n,t),linkable:(e,t)=>jI(a,e,n,t,!1)},u=o.map(e=>({key:e.key,label:fI(e,n,t.ownEntity),render:i=>vI(e.key,e.kind,e.propSchema,Xe(i.dict,e.key),e.ann,n,r,c,t.ownEntity),sortable:!1,width:e.width}));return i(Mo,{columns:u,data:s,keyFn:e=>e.rowKey,onRowClick:e=>t.onOpenRow(e.rowKey,e.json)})}let mF=i("span",{children:"▦","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});ZI({id:QI,label:"Table",icon:mF,arity:"Single",isCapable:(e,t,n)=>!0,render:e=>{let t=e[0];return void 0!==t?i(gF,{source:t}):null},capability:"always — the universal default"});let vF=["resources","events"],yF=["split","full"],_F=["funnel","scatter"],bF={};function xF(e,t){return j(e.views,e=>Xe(e,t))}function SF(e,t){return j(e.fields,e=>Xe(e,t))}function wF(e,t){console.error("[AutoUI] ui-hints "+e+": "+t)}function EF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.string(r);return void 0!==i?i:void wF(n+"."+t,"expected a string — dropped")}function kF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.bool(r);return void 0!==i?i:void wF(n+"."+t,"expected a boolean — dropped")}function CF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.float(r);return void 0!==i?i===Math.trunc(i)?0|i:void wF(n+"."+t,"expected a whole number — dropped"):void wF(n+"."+t,"expected a number — dropped")}function AF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.array(r);return void 0!==i?me(i,Je.string):void wF(n+"."+t,"expected an array of strings — dropped")}function NF(e,t,n,r){let i=e[t];if(void 0===i)return;let o=Je.object(i);if(void 0!==o){let e={};return Object.entries(o).forEach(i=>{let o=i[0];M(r(i[1],n+"."+t+'["'+o+'"]'),t=>{e[o]=t})}),e}wF(n+"."+t,"expected an object — dropped")}function TF(e,t){let n=Je.object(e);if(void 0!==n){let e={};return Object.entries(n).forEach(n=>{let r=n[0],i=Je.string(n[1]);return void 0!==i?void(e[r]=i):wF(t+"."+r,"expected a string — dropped")}),e}wF(t,"expected an object of string values — dropped")}function RF(e,t){let n=Je.object(e);return void 0!==n?{label:EF(n,"label",t),scopedLabel:EF(n,"scopedLabel",t),group:EF(n,"group",t),order:CF(n,"order",t),hidden:kF(n,"hidden",t)}:void wF(t,"expected an object — dropped")}function DF(e,t){let n=Je.object(e);if(void 0!==n){let e,r=n.nav,i=n.rowActions;if(void 0!==i){let n=Je.array(i);void 0!==n?e=ve(n,(e,n)=>function(e,t){let n=Je.object(e);if(void 0!==n){let e=EF(n,"pluginId",t),r=EF(n,"slice",t),i=EF(n,"command",t),o=EF(n,"field",t);return void 0!==e&&void 0!==r&&void 0!==i&&void 0!==o?{label:EF(n,"label",t),pluginId:e,slice:r,command:i,field:o,whenState:AF(n,"whenState",t),whenRetired:kF(n,"whenRetired",t),then:EF(n,"then",t)}:void wF(t,"a row action needs pluginId, slice, command and field — dropped")}wF(t,"expected an object — dropped")}(e,t+".rowActions["+n.toString()+"]")):(wF(t+".rowActions","expected an array of row actions — dropped"),e=void 0)}else e=void 0;let o=n.transitions;return{mode:EF(n,"mode",t),layout:EF(n,"layout",t),canvas:EF(n,"canvas",t),role:EF(n,"role",t),resourceRef:EF(n,"resourceRef",t),accent:EF(n,"accent",t),audit:kF(n,"audit",t),presence:kF(n,"presence",t),related:AF(n,"related",t),nav:void 0!==r?RF(r,t+".nav"):void 0,rowActions:e,suppressRowActions:AF(n,"suppressRowActions",t),retiredLabel:EF(n,"retiredLabel",t),suppress:AF(n,"suppress",t),transitions:void 0!==o?TF(o,t+".transitions"):void 0}}wF(t,"expected an object — dropped")}function IF(e,t){let n=void 0!==e?e:"ui-hints",r=Je.object(t);if(void 0!==r){let e,t=r.dashboard;if(void 0!==t){let r=Je.array(t);void 0!==r?e=ve(r,(e,t)=>function(e,t){let n=Je.object(e);if(void 0!==n){let e=EF(n,"view",t);return void 0!==e?{view:e,label:EF(n,"label",t),field:EF(n,"field",t),aggregate:EF(n,"aggregate",t),viz:EF(n,"viz",t),xField:EF(n,"xField",t)}:void wF(t,"metric without a `view` — dropped")}wF(t,"expected an object — dropped")}(e,n+".dashboard["+t.toString()+"]")):(wF(n+".dashboard","expected an array of metrics — dropped"),e=void 0)}else e=void 0;return{views:NF(r,"views",n,DF),fields:NF(r,"fields",n,TF),dashboard:e}}return wF(n,"expected an object — no hints applied"),bF}function FF(e){let t=Je.object(e);if(void 0!==t){let e={};return Object.entries(t).forEach(t=>{let n=t[0];e[n]=IF('ui-hints["'+n+'"]',t[1])}),e}return wF("ui-hints.json","top-level value is not a {pluginId: hints} object — ignored"),{}}function OF(e){return U(z(j(j(ht(Lt(e)),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function PF(e,t){let n=t.split("."),r=U(n[0],t),i=e.readModels.find(e=>e.name===r),o=void 0!==i?i.schema:z(e.stateViewSlices.find(e=>e.name===r),e=>e.schema);return void 0!==o?ge(n.slice(1),{TAG:"Ok",_0:{schema:o}},(e,n)=>{if("Ok"!==e.TAG)return e;let r=e._0.schema,i=function(e,t){return j(j(z(j(j(j(ht(Lt(e)),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),Lt),ht),e=>Xe(e,"items"))}(r,n);return void 0!==i?{TAG:"Ok",_0:{schema:i}}:OF(r).includes(n)?L(j(j(j(ht(Lt(r)),e=>Xe(e,"properties")),ht),e=>Xe(e,n)),{TAG:"Error",_0:'unresolvable path segment "'+n+'" in "'+t+'"'},e=>({TAG:"Ok",_0:{schema:e}})):{TAG:"Error",_0:'unknown field "'+n+'" in path "'+t+'"'}}):{TAG:"Error",_0:'unknown view "'+r+'" — known views: '+e.readModels.map(e=>e.name).concat(e.stateViewSlices.map(e=>e.name)).join(", ")}}function MF(e,t){let n=e.readModels.find(e=>e.name===t);return void 0!==n?n.lifecycleField:j(e.stateViewSlices.find(e=>e.name===t),e=>e.lifecycleField)}function LF(e,t){if(void 0!==eF(e))return;let n=tF().map(e=>e.id).join(", ");return t+': unknown view-mode id "'+e+'" — registered modes: '+n}function zF(e,t,n,r){let i=void 0!==n?n:[],o=void 0!==r?r:{},s=0===i.length?[t]:i,a=[],l=e=>{a.push("[AutoUI] uiHints ("+t.id+"): "+e)};return M(e.views,e=>{Qe(e).forEach(e=>{let n=e[1],r=e[0],i=PF(t,r);"Ok"!==i.TAG&&l('views["'+r+'"]: '+i._0),M(n.role,e=>{if(!vF.includes(e))return l('views["'+r+'"].role: unknown role "'+e+'" — expected '+vF.join(" or "));if("events"!==e)return;let t=n.resourceRef;return void 0!==t?"Ok"!==i.TAG||OF(i._0.schema).includes(t)?void 0:l('views["'+r+'"].resourceRef: unknown field "'+t+'"'):l('views["'+r+'"]: role "events" requires a resourceRef field')}),M(n.resourceRef,e=>{if(yt(n.role,"events"))return l('views["'+r+'"].resourceRef: only meaningful with role "events"')}),M(n.transitions,e=>{let n,o=function(e){return e.aggregates.flatMap(e=>e.commands).concat(e.stateChangeSlices.flatMap(e=>e.commands).concat(e.readModels.flatMap(e=>e.commands))).map(e=>e.name)}(t),s=MF(t,r);n="Ok"===i.TAG&&void 0!==s?qs(i._0.schema,s):[],0===n.length&&l('views["'+r+'"].transitions: the view declares no status enum, so no transition can apply'),Qe(e).forEach(e=>{let t=e[1],i=e[0];if(o.includes(t)||l('views["'+r+'"].transitions["'+i+'"]: unknown command "'+t+'" — known commands: '+o.join(", ")),0!==n.length&&!n.includes(i))return l('views["'+r+'"].transitions: unknown target state "'+i+'" — known states: '+n.join(", "))})}),M(n.nav,e=>{r.includes(".")&&l('views["'+r+'"].nav: a nested path has no menu entry of its own — nav belongs on the top-level view'),[["label",e.label],["scopedLabel",e.scopedLabel],["group",e.group]].forEach(e=>{let t=e[0];M(e[1],e=>{if(""===e.trim())return l('views["'+r+'"].nav.'+t+": blank — an empty "+t+" renders nothing, so it is ignored")})}),M(e.scopedLabel,e=>{if(!r.includes(".")&&q(function(e,t){let n=e.readModels.find(e=>e.name===t);return void 0!==n?n.ownerField:j(e.stateViewSlices.find(e=>e.name===t),e=>e.ownerField)}(t,r)))return l('views["'+r+'"].nav.scopedLabel: the view declares no @owner field, so no caller is narrowed to their own rows and this label never renders')})}),M(n.rowActions,e=>{r.includes(".")&&0!==e.length&&l('views["'+r+'"].rowActions: a nested path names a collection drilled into inside a detail, not a view whose rows an action can be declared about — they belong on the top-level view'),e.forEach((e,n)=>{let o='views["'+r+'"].rowActions['+n.toString()+"]",a=s.find(t=>t.id===e.pluginId);if(void 0!==a){let t=function(e,t){let n=e.aggregates.find(e=>e.name===t);if(void 0!==n)return{TAG:"Ok",_0:n.commands};let r=e.stateChangeSlices.find(e=>e.name===t);return void 0!==r?{TAG:"Ok",_0:r.commands}:{TAG:"Error",_0:e.aggregates.map(e=>e.name).concat(e.stateChangeSlices.map(e=>e.name))}}(a,e.slice);if("Ok"===t.TAG){let n=t._0,r=n.find(t=>t.name===e.command);if(void 0!==r){let t=OF(r.schema);t.includes(e.field)||l(o+': unknown field "'+e.field+'" on command "'+e.command+'" — known fields: '+t.join(", "))}else l(o+': unknown command "'+e.command+'" in "'+e.slice+'" — known commands: '+n.map(e=>e.name).join(", "))}else l(o+': unknown slice "'+e.slice+'" in plugin "'+e.pluginId+'" — known aggregates and slices: '+t._0.join(", "))}else l(o+': unknown plugin "'+e.pluginId+'" — known plugins: '+s.map(e=>e.id).join(", "));M(e.whenState,e=>{let n,s=MF(t,r);return n="Ok"===i.TAG&&void 0!==s?qs(i._0.schema,s):[],0===n.length?l(o+".whenState: the view declares no lifecycle enum, so no row carries a state this could match"):0===e.length?l(o+".whenState: empty — it matches no row, so the action never appears"):void e.forEach(e=>{if(!n.includes(e))return l(o+'.whenState: unknown state "'+e+'" — known states: '+n.join(", "))})}),M(e.whenRetired,e=>{if(e&&"Ok"===i.TAG&&q(Ms(i._0.schema)))return l(o+".whenRetired: the view declares no @retired field, so no row of it is ever withheld from this action")}),M(e.then,e=>{if(""===e.trim())return l(o+".then: blank — an empty route navigates nowhere, so it is ignored")})})}),M(n.suppressRowActions,e=>{r.includes(".")&&0!==e.length&&l('views["'+r+'"].suppressRowActions: a nested path names a collection drilled into inside a detail, not a view whose rows an action can be offered on — they belong on the top-level view');let t=U(n.rowActions,[]).map(e=>e.pluginId+"."+e.slice+"."+e.command),i=U(Xe(o,r),[]),s=t.concat(i);e.forEach((e,t)=>{let n='views["'+r+'"].suppressRowActions['+t.toString()+"]";return""===e.trim()?l(n+": blank — an empty pointer names no action, so it is ignored"):s.some(t=>t===e)?void 0:l(n+': "'+e+'" matches no declared or inferred action on this view — '+(0!==s.length?"it offers "+s.join(", "):"it offers none"))})}),M(n.retiredLabel,e=>{if(""===e.trim())return l('views["'+r+'"].retiredLabel: blank — an empty label renders an empty badge, so it is ignored');if("Ok"!==i.TAG)return;let t=Ms(i._0.schema);return void 0!==t?void 0!==t[1].values?l('views["'+r+'"].retiredLabel: "'+t[0]+'" retires the row by its lifecycle state, so each row badges by the state it is in — rename the states themselves to change the word'):void 0:l('views["'+r+'"].retiredLabel: the view declares no @retired field, so there is no retirement state to label')}),M(n.mode,e=>M(LF(e,'views["'+r+'"].mode'),l)),M(n.layout,e=>{if(!yF.includes(e))return l('views["'+r+'"].layout: unknown layout "'+e+'" — expected '+yF.join(" or "))}),M(n.suppress,e=>{e.forEach(e=>{if(M(LF(e,'views["'+r+'"].suppress'),l),e===QI)return l('views["'+r+'"].suppress: the "table" mode is the universal fallback and cannot be suppressed')})})})}),M(e.fields,e=>{Qe(e).forEach(e=>{let n=e[0],r=PF(t,n);if("Ok"!==r.TAG)return l('fields["'+n+'"]: '+r._0);let i=OF(r._0.schema);Qe(e[1]).forEach(e=>{let t=e[1],r=e[0];if(i.includes(r)||l('fields["'+n+'"]: unknown field "'+r+'"'),q(la(t)))return l('fields["'+n+'"].'+r+': unknown semantic "'+t+'"')})})}),M(e.dashboard,e=>{e.forEach(e=>{let n=U(e.aggregate,"count");["count","sum","avg"].includes(n)?"count"!==n&&q(e.field)&&l('dashboard metric on "'+e.view+'": aggregate "'+n+'" requires a field'):l('dashboard metric on "'+e.view+'": unknown aggregate "'+n+'" — expected count, sum, or avg');let r=PF(t,e.view);if("Ok"!==r.TAG)return l("dashboard metric: "+r._0);let i=r._0.schema;M(e.field,t=>{if(!OF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown field "'+t+'"')}),M(e.xField,t=>{if(!OF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown xField "'+t+'"')}),M(e.viz,n=>{if(!_F.includes(n))return l('dashboard metric on "'+e.view+'": unknown viz "'+n+'" — expected '+_F.join(", "));if("funnel"===n&&0===function(e,t,n){let r=B(MF(e,t),Ba(n,void 0,void 0).statusField);return void 0!==r?qs(n,r):[]}(t,e.view,i).length)return l('dashboard metric on "'+e.view+'": viz "funnel" needs a status enum to order the stages, and this view declares none');if("scatter"!==n)return;let r=e.field,o=e.xField;if(void 0!==r&&void 0!==o){let t=OF(i),n=function(e){return Sa(e).filter(e=>Ea(e[1])).map(e=>e[0])}(i);return void[["field",r],["xField",o]].forEach(r=>{let i=r[1];if(t.includes(i)&&!n.includes(i))return l('dashboard metric on "'+e.view+'": viz "scatter" '+r[0]+' "'+i+'" is not a numeric field')})}l('dashboard metric on "'+e.view+'": viz "scatter" needs both a field (the y measure) and an xField (the x measure)')})})}),a.forEach(e=>{console.error(e)}),a}function jF(e,t,n){let r=nF(e,void 0!==n?n:XI),i=j(t,e=>e.suppress);return void 0!==i?r.filter(e=>e.id===QI||!i.includes(e.id)):r}function UF(e,t,n,r,i){let o=e=>j(e,e=>i.find(t=>t.id===e)),s=vt(r,"Tight"),a=z(e,e=>e.mode),l=o(j(e,e=>{if((e=>{if(!s)return!0;let t=e.band;return void 0!==t&&At.atLeastAsNarrow(t,"Tight")})(e))return e.mode}));if(void 0!==l)return l;let c=o(j(t,e=>e.mode));if(void 0!==c)return c;let u=o(n);if(void 0!==u)return u;let d=s?o("cards"):void 0;if(void 0!==d)return d;let f=o(a);return void 0!==f?f:i[0]}function BF(e){switch(e){case"full":return"Full";case"split":return"Split";default:return}}function $F(e){return"hide"===e.toLowerCase()?"Hide":"Lock"}function qF(e,t){return void 0===t||0===t.length||t.some(t=>e.includes(t))}function GF(e){return j(e,e=>e[0])}function VF(e,t){let n=t=>t.filter(t=>qF(e,t.requiredAccess));return t.map(t=>{let r={...t};return r.internalQueryables=z(t.internalQueryables,t=>t.filter(t=>qF(e,t.requiredAccess))),r.stateChangeSlices=t.stateChangeSlices.map(e=>{let t={...e};return t.commands=n(e.commands),t}),r.stateViewSlices=t.stateViewSlices.filter(t=>qF(e,t.requiredAccess)),r.aggregates=t.aggregates.map(e=>{let t={...e};return t.commands=n(e.commands),t}),r.readModels=t.readModels.filter(t=>qF(e,t.requiredAccess)).map(e=>{let t={...e};return t.commands=n(e.commands),t}),r})}function KF(e,t){let n={},r=(t,r)=>{let i=!qF(e,r),o=GF(r);i&&void 0!==o&&(n[t]=o)};return t.forEach(e=>{e.readModels.forEach(e=>r(e.name,e.requiredAccess)),e.stateViewSlices.forEach(e=>r(e.name,e.requiredAccess))}),n}function WF(e,t){let n={},r=(t,r)=>{if(0!==r.length&&r.every(t=>!qF(e,t.requiredAccess)))return M(j(r[0],e=>GF(e.requiredAccess)),e=>{n[t]=e})};return t.forEach(e=>{e.aggregates.forEach(e=>r(e.name,e.commands)),e.stateChangeSlices.forEach(e=>r(e.name,e.commands))}),n}let HF=[ui(_t.background,"#0d1117"),ui(_t.surface,"#161b22"),ui(_t.surfaceSubtle,"#1c2128"),ui(_t.surfaceElevated,"#21262d"),ui(_t.brand,"#2f81f7"),ui(_t.brandSubtle,"#1f4b8e"),ui(_t.success,"#3fb950"),ui(_t.warning,"#d29922"),ui(_t.error,"#f85149"),ui(_t.info,"#58a6ff"),ui(_t.textPrimary,"#e6edf3"),ui(_t.textSecondary,"#8b949e"),ui(_t.textDisabled,"#484f58"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#30363d"),ui(_t.borderSubtle,"#21262d"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.4)"),ui(Et,"0 4px 12px rgba(0,0,0,0.5)"),ui(kt,"0 8px 24px rgba(0,0,0,0.6)")],JF=[ui(_t.background,"#ffffff"),ui(_t.surface,"#f6f8fa"),ui(_t.surfaceSubtle,"#eaeef2"),ui(_t.surfaceElevated,"#ffffff"),ui(_t.brand,"#0969da"),ui(_t.brandSubtle,"#ddf4ff"),ui(_t.success,"#1a7f37"),ui(_t.warning,"#9a6700"),ui(_t.error,"#cf222e"),ui(_t.info,"#0550ae"),ui(_t.textPrimary,"#1f2328"),ui(_t.textSecondary,"#636c76"),ui(_t.textDisabled,"#bec1c5"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#d0d7de"),ui(_t.borderSubtle,"#eaeef2"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.08)"),ui(Et,"0 4px 12px rgba(0,0,0,0.12)"),ui(kt,"0 8px 24px rgba(0,0,0,0.16)")],XF=[ui(_t.background,"#f5f5f5"),ui(_t.surface,"#ffffff"),ui(_t.surfaceSubtle,"#eeeeee"),ui(_t.surfaceElevated,"#ffffff"),ui(_t.brand,"#424242"),ui(_t.brandSubtle,"#e0e0e0"),ui(_t.success,"#388e3c"),ui(_t.warning,"#f57c00"),ui(_t.error,"#d32f2f"),ui(_t.info,"#1976d2"),ui(_t.textPrimary,"#212121"),ui(_t.textSecondary,"#757575"),ui(_t.textDisabled,"#bdbdbd"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#bdbdbd"),ui(_t.borderSubtle,"#e0e0e0"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.12)"),ui(Et,"0 4px 12px rgba(0,0,0,0.14)"),ui(kt,"0 8px 24px rgba(0,0,0,0.18)")],QF=[ui(_t.background,"#000000"),ui(_t.surface,"#0a0a0a"),ui(_t.surfaceSubtle,"#111111"),ui(_t.surfaceElevated,"#1a1a1a"),ui(_t.brand,"#ffdd00"),ui(_t.brandSubtle,"#332b00"),ui(_t.success,"#00ff00"),ui(_t.warning,"#ffaa00"),ui(_t.error,"#ff4444"),ui(_t.info,"#44aaff"),ui(_t.textPrimary,"#ffffff"),ui(_t.textSecondary,"#cccccc"),ui(_t.textDisabled,"#555555"),ui(_t.textOnBrand,"#000000"),ui(_t.border,"#ffffff"),ui(_t.borderSubtle,"#888888"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(255,255,255,0.1)"),ui(Et,"0 4px 12px rgba(255,255,255,0.15)"),ui(kt,"0 8px 24px rgba(255,255,255,0.2)")];function YF(e,t){let n=void 0!==t?[ui(_t.brand,t.primaryColor)]:[];return co(e.concat(n))}let ZF=function(e){let t,n=e.theme;switch(n.preset){case"Dark":t=YF(HF,n.brand);break;case"Light":t=YF(JF,n.brand);break;case"Neutral":t=YF(XF,n.brand);break;case"HighContrast":t=YF(QF,n.brand)}return i("div",{children:e.children,className:t})};let eO=l({preset:"Light",setPreset:function(e){}}),tO=eO.Provider;function nO(){return d(eO)}let rO="reventless-ui:theme",iO=["Light","Dark","Neutral","HighContrast"];function oO(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"HighContrast"}}let sO=function(e){let t=e.initialPreset,n=void 0!==t?t:"Light",r=s(()=>function(e){let t=localStorage.getItem(rO);return null==t?e:function(e){switch(e){case"Dark":return"Dark";case"HighContrast":return"HighContrast";case"Neutral":return"Neutral";default:return"Light"}}(t)}(n)),o=r[1],a=r[0],l=f(e=>{localStorage.setItem(rO,oO(e)),o(t=>e)},[]),c=p(()=>({preset:a,setPreset:l}),[a,l]);return i(tO,{value:c,children:i(ZF,{theme:{preset:a,brand:e.brand},children:e.children})})};function aO(e){return!!e.startsWith("/")&&!e.startsWith("//")}function lO(e,t){return"header-"+function(e){return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}(JSON.stringify(Object.fromEntries([["host",e],["Authorization",t]])))}function cO(e,t){if(e.state===t)return;let n=e.state;e.state=t;let r=0;switch(t){case"Closed":case"Connecting":r=1;break;case"Open":let t=e.disconnectedSince;if(void 0!==t){let n=Date.now()-t;e.disconnectedSince=void 0,M(e.onReconnect,e=>e(n))}}1===r&&"Open"===n&&(e.disconnectedSince=Date.now()),M(e.onStateChange,e=>e(t))}function uO(e,t){let n=e.ws,r=e.getToken();if(void 0===n)return;if(void 0===r)return;let i=Object.fromEntries([["host",e.host],["Authorization",r]]),o=JSON.stringify(Object.fromEntries([["type","subscribe"],["id",t.id],["channel",t.channel],["authorization",i]]));try{return void D(n).send(o)}catch(s){return}}function dO(e){let t=j(e.errors,Je.array);return void 0!==t&&0!==t.length?t.map(e=>{let t=Je.object(e);if(void 0===t)return JSON.stringify(e);let n=e=>j(t[e],Je.string),r=n("errorType"),i=n("message");return void 0!==r?void 0!==i?r+": "+i:r:void 0!==i?i:JSON.stringify(e)}).join("; "):JSON.stringify(e)}function fO(e,t){let n;try{n=JSON.parse(t)}catch(o){n=void 0}let r=j(n,Je.object);if(void 0===r)return;let i=j(r.type,Je.string);if(void 0!==i)switch(i){case"connection_ack":return cO(e,"Open"),e.reconnectAttempts=0,function(e){e.subscriptions.forEach(t=>uO(e,t))}(e);case"connection_error":return void console.error("Events connection refused: "+dO(r));case"data":let t=j(r.id,Je.string),n=U(r.event,null),i=e=>{let t=Je.string(e);if(void 0===t)return e;try{return JSON.parse(t)}catch(o){return e}},s=Je.array(n),a=void 0!==s?s.map(i):[i(n)],l=j(t,t=>e.subscriptions.get(t));return void 0!==l?void a.forEach(e=>l.onMessage(e)):void 0;case"subscribe_error":let c=j(r.id,Je.string),u=U(z(j(c,t=>e.subscriptions.get(t)),e=>e.channel),"<unknown channel>");return void console.error("Events subscribe refused for "+u+": "+dO(r));default:return}}function hO(e){if(e.disposed)return;let t=["aws-appsync-event-ws"],n=e.getToken(),r=void 0!==n?t.concat([lO(e.host,n)]):t,i=new WebSocket(e.url,r);e.ws=T(i),cO(e,"Connecting"),i.onopen=()=>{try{return void i.send('{"type":"connection_init"}')}catch(e){return}},i.onmessage=t=>fO(e,t.data),i.onclose=t=>{if(e.ws=void 0,function(e){return 4401===e||4403===e}(t.code))return cO(e,"Unauthorized"),M(e.onAuthFailure,e=>{try{return e()}catch(t){return}});if(cO(e,"Closed"),e.disposed)return;let n=e.reconnectAttempts+1|0;e.reconnectAttempts=n,e.reconnectTimer=setTimeout(()=>hO(e),function(e){switch(e){case 1:return 1e3;case 2:return 2e3;case 3:return 4e3;case 4:return 8e3;case 5:return 16e3;default:return 3e4}}(n))},i.onerror=e=>{}}function pO(e,t,n,r,i,o){let s={ws:void 0,state:"Closed",url:e,host:t,getToken:n,subscriptions:new Map,reconnectAttempts:0,reconnectTimer:void 0,disposed:!1,onStateChange:r,disconnectedSince:void 0,onReconnect:i,onAuthFailure:o};return hO(s),s}function gO(e,t,n){let r=crypto.randomUUID(),i={id:r,channel:t,onMessage:n};return e.subscriptions.set(r,i),"Open"===e.state&&uO(e,i),()=>{if(e.subscriptions.has(r))return e.subscriptions.delete(r),function(e,t){let n=e.ws;if(void 0===n)return;let r=JSON.stringify(Object.fromEntries([["type","unsubscribe"],["id",t]]));try{return void D(n).send(r)}catch(i){return}}(e,r)}}function mO(e){e.disposed=!0;let t=e.reconnectTimer;void 0!==t&&clearTimeout(t),e.reconnectTimer=void 0;let n=e.ws;if(void 0!==n)try{D(n).close()}catch(r){}e.ws=void 0,e.subscriptions.clear()}function vO(){return L(R(globalThis.document),!1,e=>e.hidden)}let yO=["Platform_"];function _O(e,t){let n=t.toLowerCase();return e.some(e=>n.startsWith(e.toLowerCase()))?"Platform":"Domain"}let bO=l(void 0);function xO(){return d(bO)}function SO(){return{client:void 0,registry:new Map,refcount:0,idleTimer:void 0,reconnectListeners:[],torndown:!1}}let wO=bO.Provider;let EO=function(e){let t=e.getToken,n=e.platformReadModelPrefixes,r=e.onAuthFailure,i=e.clientEventsNamespace,o=e.liveReconnectRefetch,l=e.liveUpdates,u=e.platformEventsEndpoint,d=e.domainEventsEndpoint,f=void 0===o||o,g=void 0!==n?n:yO,m=h(t);a(()=>{m.current=t},[t]);let v=()=>m.current(),y=h(SO()),_=h(SO()),b=h(vO()),x=s(()=>"Closed"),S=x[1],w=x[0],E=s(()=>"Closed"),k=E[1],C=E[0],A=e=>"Domain"===e?y:_,N=e=>"Domain"===e?d:u,T=e=>{let t=A(e).current;f&&t.reconnectListeners.slice().forEach(e=>{try{return e()}catch(t){return}})},O=e=>{let t=A(e).current,n=t.client;if(void 0!==n)return n;let i=N(e);if(void 0===i)return;let o=function(e){let t;t=e.startsWith("https://")?"wss://"+e.slice(8):e.startsWith("http://")?"ws://"+e.slice(7):aO(e)?("https:"===location.protocol?"wss":"ws")+"://"+location.host+e:e;let n=t.replace("appsync-api.","appsync-realtime-api.");return n.endsWith("/realtime")?n:n+"/realtime"}(i),s=function(e){let t=e.startsWith("https://")?e.slice(8):e.startsWith("http://")?e.slice(7):aO(e)?location.host:e,n=t.indexOf("/");return-1!==n?t.slice(0,n):t}(i),a=pO(o,s,v,t=>"Domain"===e?S(e=>t):k(e=>t),t=>{if(t>=2e3)return T(e)},r);return t.client=a,a},P=(e,t,n)=>{if(!q(n.underlyingUnsub))return;let r=O(e);if(void 0===r)return;let i=gO(r,t,e=>{n.callbacks.forEach(t=>t(e))});n.underlyingUnsub=i},M=(e,t,n)=>{let r=A(e).current;if(!l||q(N(e)))return()=>{};(e=>{let t=A(e).current,n=t.idleTimer;if(void 0!==n)clearTimeout(n),t.idleTimer=void 0})(e),r.refcount=r.refcount+1|0;let i,o=r.registry.get(t);if(void 0!==o){let e=o.drainTimer;void 0!==e&&(clearTimeout(e),o.drainTimer=void 0),i=o}else{let e={refcount:0,callbacks:[],underlyingUnsub:void 0,drainTimer:void 0};r.registry.set(t,e),i=e}return i.callbacks.push(n),i.refcount=i.refcount+1|0,1!==i.refcount||b.current||P(e,t,i),()=>{if(i.callbacks=i.callbacks.filter(e=>e!==n),i.refcount=i.refcount-1|0,r.torndown?(i.underlyingUnsub=void 0,r.registry.delete(t)):0===i.refcount&&(i.drainTimer=setTimeout(()=>{let e=i.underlyingUnsub;void 0!==e&&e(),i.underlyingUnsub=void 0,i.drainTimer=void 0,r.registry.delete(t)},5e3)),r.refcount=r.refcount-1|0,0===r.refcount&&!r.torndown){let t=A(e).current,n=t.idleTimer;return void 0!==n&&clearTimeout(n),void(t.idleTimer=setTimeout(()=>{let e=t.client;void 0!==e&&(mO(e),t.client=void 0),t.idleTimer=void 0},3e4))}}},L=e=>!!l&&$(N(_O(g,e)));a(()=>function(e){let t=R(globalThis.document);if(void 0===t)return()=>{};let n=D(t);return n.addEventListener("visibilitychange",e),()=>{n.removeEventListener("visibilitychange",e)}}(()=>{let e=vO();if(e!==b.current)return b.current=e,e?void["Domain","Platform"].forEach(e=>{A(e).current.registry.forEach(e=>{let t=e.underlyingUnsub;if(void 0!==t)return t(),void(e.underlyingUnsub=void 0)})}):void["Domain","Platform"].forEach(e=>{let t=A(e).current,n={contents:!1};if(t.registry.forEach((t,r)=>{if(t.refcount>0&&q(t.underlyingUnsub))return P(e,r,t),$(t.underlyingUnsub)?void(n.contents=!0):void 0}),n.contents)return T(e)})}),[]),a(()=>()=>{["Domain","Platform"].forEach(e=>{let t=A(e).current,n=t.idleTimer;void 0!==n&&clearTimeout(n),t.idleTimer=void 0,t.registry.forEach(e=>{let t=e.drainTimer;if(void 0!==t)return clearTimeout(t),void(e.drainTimer=void 0)});let r=t.client;void 0!==r&&mO(r),t.client=void 0,t.torndown=!0})},[]);let z=e=>"Domain"===e?w:C,j=(e,t)=>{let n=A(e).current;return n.reconnectListeners.push(t),()=>{n.reconnectListeners=n.reconnectListeners.filter(e=>e!==t)}},B=()=>!(!l||!$(i))&&$(d),G=async(e,t,n)=>{let r=N(e);return void 0!==r?await async function(e,t,n,r){let i=JSON.stringify(Object.fromEntries([["channel",n],["events",r.map(e=>JSON.stringify(e))]])),o=Object.fromEntries([["Content-Type","application/json"]]);void 0!==t&&(o.Authorization=t);try{let t=await fetch(e,{method:"POST",headers:o,body:i});return t.ok?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:"publish failed with status "+t.status.toString()}}catch(s){let e=F(s);return e.RE_EXN_ID===I?{TAG:"Error",_0:U(e._1.message,"publish failed")}:{TAG:"Error",_0:"publish failed"}}}(r,m.current(),t,n):{TAG:"Error",_0:"no events endpoint configured"}},V=p(()=>({subscribe:M,isLive:L,apiForReadModel:e=>_O(g,e),statusFor:z,registerReconnect:j,publish:G,clientChannelsAvailable:B,clientNamespace:()=>i,liveUpdatesEnabled:()=>l}),[l,d,u,w,C,i,g]);return c(wO,{value:V,children:e.children})};function kO(e,t){if(0===e.length)return"Unknown";let n=t.filter(t=>e.includes(t));return 0!==n.length?{TAG:"Elevated",_0:n}:"Scoped"}function CO(e,t){let n=ht(e);if(void 0===n)return e;let r=j(Xe(n,"properties"),ht);if(void 0===r)return e;let i=j(Xe(r,t),ht);if(void 0===i)return e;let o=Ze(Qe(i));o["x-reventless-ui-hidden"]=!0;let s=Ze(Qe(r));s[t]=o;let a=Ze(Qe(n));return a.properties=s,a}function AO(e,t,n){if("object"!=typeof e){if("Unknown"===e)return n;if(""===t)return n;let r=e=>e.map(e=>{if(void 0===e.ownerField)return e;let n={...e};return n.ownerValue=t,n}),i=(e,t)=>void 0!==t?CO(e,t):e;return n.map(e=>{let t={...e};return t.internalQueryables=z(e.internalQueryables,e=>e.map(e=>{let t={...e};return t.schema=i(e.schema,e.ownerField),t})),t.stateChangeSlices=e.stateChangeSlices.map(e=>{let t={...e};return t.commands=r(e.commands),t}),t.stateViewSlices=e.stateViewSlices.map(e=>{let t={...e};return t.schema=i(e.schema,e.ownerField),t}),t.aggregates=e.aggregates.map(e=>{let t={...e};return t.commands=r(e.commands),t}),t.readModels=e.readModels.map(e=>{let t={...e};return t.commands=r(e.commands),t.schema=i(e.schema,e.ownerField),t}),t})}{let t=e._0,r=(e,n)=>void 0!==n?function(e,t,n){let r=ht(e);if(void 0===r)return e;let i={};i.field=t,i.as=n.map(e=>e);let o=Ze(Qe(r));return o["x-reventless-owner-unscoped"]=i,o}(e,n,t):e;return n.map(e=>{let t={...e};return t.stateViewSlices=e.stateViewSlices.map(e=>{let t={...e};return t.schema=r(e.schema,e.ownerField),t}),t.readModels=e.readModels.map(e=>{let t={...e};return t.schema=r(e.schema,e.ownerField),t}),t})}}function NO(e,t){let n=dt(t);return function(e){let t=Ms(e);return void 0!==t&&void 0===t[1].values?CO(e,t[0]):e}(function(e,t){return M(j(j(ht(t),e=>Xe(e,"properties")),ht),t=>{Ye(t).forEach(t=>M(j(j(ht(t),e=>Xe(e,"x-reventless-semantic-target")),ht),t=>{let n=Xe(t,"store"),r=Xe(t,"plugin");void 0===n||void 0!==r||(t.plugin=e)}))}),t}(e,void 0!==n?JSON.parse(n):t))}function TO(e){switch(e){case"boolean":return"Boolean";case"integer":return"Int";case"number":return"Float";default:return"String"}}function RO(e){let t=e.toLowerCase();return t.length>=2&&t.endsWith("id")}function DO(e){if(vt(j(Xe(e,"type"),dt),"object"))return j(Xe(e,"x-reventless-graphql-input"),dt)}function IO(e){return j(Xe(e,"x-reventless-graphql-type"),dt)}function FO(e){return z(j(j(ht(e),e=>Xe(e,"required")),pt),e=>me(e,dt))}function OO(e,t,n){let r=FO(t),i=U(z(j(j(ht(t),e=>Xe(e,"properties")),ht),e=>Object.keys(e).filter(e=>"TAG"!==e).map(t=>{let n,i=j(Xe(e,t),ht),o=j(i,IO);if(void 0!==o)n=o;else{let e=L(i,"String",e=>function(e,t){let n=U(j(Xe(t,"type"),dt),"string");if("array"===n){let n=j(Xe(t,"items"),ht),r=j(n,DO),i=void 0!==r?r:U(z(j(j(n,e=>Xe(e,"type")),dt),t=>"string"===t&&(function(e){let t=e.toLowerCase();return t.length>3&&t.endsWith("ids")}(e)||RO(e))?"ID":TO(t)),"String");return"["+i+"!]"}let r=DO(t);return void 0!==r?r:RO(e)&&"string"===n?"ID":TO(n)}(t,e));n=void 0!==r?r.includes(t)?e+"!":e:e+"!"}return[t,n]})),[]),o=(void 0!==n?[]:[["id","ID!"]]).concat(i),s="__typename ... on CommandAccepted { msgId entityId eventCount } ... on CommandRejected { msgId errorCode errorDetail } ... on CommandPending { msgId }";if(0===o.length)return"mutation { "+e+" { "+s+" } }";let a=o.map(e=>"$"+e[0]+": "+e[1]).join(", "),l=o.map(e=>{let t=e[0];return t+": $"+t}).join(", ");return"mutation "+e+"("+a+") { "+e+"("+l+") { "+s+" } }"}function PO(e){let t=e.split(".");return U(t[t.length-1|0],e)}function MO(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function LO(e){return me(U(pt(e),[]),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{fieldName:t("fieldName"),entity:t("entity"),plugin:j(Xe(e,"plugin"),dt)}}))}function zO(e){return yt(j(Xe(e,"apiExposed"),gt),!1)}function jO(e,t,n){return me(U(pt(n),[]),n=>z(j(ht(n),e=>{if(t(e))return e}),t=>{let n=e=>U(j(Xe(t,e),dt),""),r=n("name"),i="Instance"===n("level")?"Instance":"Collection",o=U(z(Xe(t,"schema"),t=>NO(e,t)),null),s=n("mutationField"),a=j(Xe(t,"aggregateIdField"),dt),l=U(z(Xe(t,"references"),LO),[]),c=z(j(Xe(t,"allowedStates"),pt),e=>me(e,dt)),u=j(Xe(t,"targetState"),dt),d=j(z(j(Xe(t,"requiredAccess"),pt),e=>me(e,dt)),e=>0===e.length?void 0:e);return{name:r,label:MO(PO(r)),schema:o,mutationDocument:""===s?"":OO(s,o,a),requiredRole:void 0,level:i,aggregateIdField:a,refFields:[],references:l,allowedStates:c,targetState:u,requiredAccess:d,ownerField:j(Xe(t,"ownerField"),dt)}}))}function UO(e,t){return jO(e,e=>!zO(e),t)}function BO(e){return me(U(pt(e),[]),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),pt),[]),n=(e,t)=>me(U(j(Xe(e,t),pt),[]),dt),r=(t=>U(j(Xe(e,t),dt),""))("pluginId"),i=e=>j(z(j(Xe(e,"requiredAccess"),pt),e=>me(e,dt)),e=>0===e.length?void 0:e),o=me(t("readModels"),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{name:t("name"),schema:U(z(Xe(e,"schema"),e=>NO(r,e)),null),queryDocument:"",queryField:t("queryField"),sortIndex:0,commands:[],linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Xe(e,"labelFieldSource"),dt),searchableFields:n(e,"searchableFields"),lifecycleField:j(Xe(e,"lifecycleField"),dt),requiredAccess:i(e),ownerField:j(Xe(e,"ownerField"),dt)}})),s=me(t("aggregates"),e=>z(ht(e),e=>({name:(t=>U(j(Xe(e,t),dt),""))("name"),schema:null,commands:jO(r,zO,U(Xe(e,"commands"),[])),systemCommands:UO(r,U(Xe(e,"commands"),[])),linkedViews:n(e,"linkedViews")}))),a=e=>me(t(e),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{name:t("name"),schema:U(z(Xe(e,"schema"),e=>NO(r,e)),null),queryField:t("queryField"),sortIndex:0,linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Xe(e,"labelFieldSource"),dt),searchableFields:n(e,"searchableFields"),lifecycleField:j(Xe(e,"lifecycleField"),dt),requiredAccess:i(e),ownerField:j(Xe(e,"ownerField"),dt)}})),l=a("stateViewSlices"),c=a("internalQueryables"),u=me(t("stateChangeSlices"),e=>z(ht(e),e=>({name:(t=>U(j(Xe(e,t),dt),""))("name"),commands:jO(r,zO,U(Xe(e,"commands"),[])),systemCommands:UO(r,U(Xe(e,"commands"),[])),linkedViews:n(e,"linkedViews"),consistencyRead:j(Xe(e,"consistencyRead"),dt)}))),d=z(j(Xe(e,"derivedPages"),pt),e=>me(e,dt));return{id:r,name:r,readModels:o,aggregates:s,stateViewSlices:l,stateChangeSlices:u,internalQueryables:c,derivedPages:d}}))}function $O(e){if(e.startsWith("https://"))return"wss://"+e.slice(8);if(e.startsWith("http://"))return"ws://"+e.slice(7);if(!e.startsWith("/"))return e;return("https:"===location.protocol?"wss":"ws")+"://"+location.host+e}function qO(e){return"fleet"===e.toLowerCase()?"Fleet":"Single"}function GO(e){switch(e.toLowerCase()){case"cognito":return"Cognito";case"inmemory":case"local":return"Local";default:return"Anonymous"}}function VO(e){let t=Je.object(e);if(void 0===t)return{TAG:"Error",_0:"config.json: top-level value is not an object"};let n=e=>j(t[e],Je.string),r=n("apiEndpoint");if(void 0===r)return{TAG:"Error",_0:"config.json: missing required field `apiEndpoint`"};let i=U(n("platformApiEndpoint"),r),o=e=>j(t[e],Je.bool);return{TAG:"Ok",_0:{apiEndpoint:r,platformApiEndpoint:i,platformApiSubscriptionEndpoint:U(n("platformApiSubscriptionEndpoint"),$O(i)),domainApiEventsEndpoint:n("domainApiEventsEndpoint"),platformApiEventsEndpoint:n("platformApiEventsEndpoint"),clientEventsNamespace:n("clientEventsNamespace"),liveUpdates:U(o("liveUpdates"),!0),liveReconnectRefetch:U(o("liveReconnectRefetch"),!0),platformReadModelPrefixes:U(z(j(t.platformReadModelPrefixes,Je.array),e=>me(e,Je.string)),yO),region:n("region"),authMode:U(z(n("authMode"),GO),"Anonymous"),identityProviderId:B(n("identityProviderId"),n("cognitoUserPoolId")),identityProviderClientId:B(n("identityProviderClientId"),n("cognitoClientId")),autoRedirectFirstPage:U(o("autoRedirectFirstPage"),!1),home:n("home"),mode:U(z(n("mode"),qO),"Single"),environment:n("environment"),platformName:n("platformName"),accessTiers:me(U(j(t.accessTiers,Je.array),[]),Je.string),viewModes:me(U(j(t.viewModes,Je.array),[]),Je.string),mapStyle:n("mapStyle"),graphLayout:n("graphLayout"),assetOrigins:(e=>U(z(j(t[e],Je.object),e=>Object.fromEntries(me(Object.entries(e),e=>{let t=e[0];return z(Je.string(e[1]),e=>[t,e])}))),{}))("assetOrigins"),uiHintsUrl:U(n("uiHintsUrl"),"/ui-hints.json"),manifestUrl:n("manifestUrl"),journeyManifestUrls:L(j(t.journeyManifestUrls,Je.object),{},e=>{let t={};return((e,t)=>{for(var n in e)t(e[n],n)})(e,(e,n)=>M(Je.string(e),e=>{t[n]=e})),t}),hostShellUrl:n("hostShellUrl"),deniedSurfaces:U(z(n("deniedSurfaces"),$F),"Lock"),appName:n("appName"),logoUrl:n("logoUrl"),theme:j(n("theme"),e=>{let t=function(e){switch(e){case"Dark":return"Dark";case"HighContrast":return"HighContrast";case"Light":return"Light";case"Neutral":return"Neutral";default:return}}(e);return void 0!==t?t:void console.warn('[Shell] config.json: unknown theme "'+e+'" — expected '+iO.join(", ")+". Opening on the default instead.")}),elevatedGroups:me(U(j(t.elevatedGroups,Je.array),[]),Je.string)}}}function KO(e){return ce(fetch(e).then(t=>t.ok?ce(t.json().then(t=>{let n=function(e){if(void 0!==Je.array(e))return{TAG:"Ok",_0:BO(e)};let t=P(j(j(j(Je.object(e),e=>e.data),Je.object),e=>e.Platform_ComponentDefinitions),e=>$(Je.array(e)));return void 0!==t?{TAG:"Ok",_0:BO(t)}:{TAG:"Error",_0:"expected a JSON array of component-definition entries (or a `{data:{Platform_ComponentDefinitions:[…]}}` envelope)"}}(t);return"Ok"===n.TAG?n:{TAG:"Error",_0:e+": "+n._0}}),t=>Promise.resolve({TAG:"Error",_0:e+": not valid JSON — "+String(t)})):Promise.resolve({TAG:"Error",_0:e+": fetch failed with status "+t.status.toString()})),t=>Promise.resolve({TAG:"Error",_0:e+": fetch threw — "+String(t)}))}function WO(e){let t=Je.string(e);return void 0!==t?t:z(Je.float(e),e=>e.toString())}function HO(e){return z(Je.object(e),e=>({message:U(j(e.message,Je.string),""),path:me(U(j(e.path,Je.array),[]),WO),code:j(j(j(e.extensions,Je.object),e=>e.code),Je.string),errorType:j(e.errorType,Je.string)}))}function JO(e){let t=Je.object(e);return{data:U(j(t,e=>e.data),null),errors:me(U(j(j(t,e=>e.errors),Je.array),[]),HO)}}function XO(e,t){let n=j(Je.object(e.data),e=>e[t]);return void 0!==n&&"JSONNull"!==ut(n)?void 0:function(e,t){return e.errors.find(e=>vt(e.path[0],t))}(e,t)}function QO(e){return e.errors.some(e=>vt(e.code,"UNAUTHORIZED"))}let YO=xI;class ZO extends Error{}function eP(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(n){return atob(t)}}ZO.prototype.name="InvalidTokenError";let tP=function(e){return e&&e.name?String(e.name):"UnknownError"},nP=function(e){return e&&e.message?String(e.message):""};function rP(e){return{name:tP(e),message:nP(e)}}function iP(e){switch(e.name){case"PasswordResetRequiredException":return"Password reset required — contact your administrator";case"LimitExceededException":case"TooManyRequestsException":return"Too many attempts — please wait a moment and try again";case"UserNotConfirmedException":return"Account not confirmed — check your email";case"NotAuthorizedException":case"UserNotFoundException":return"Incorrect username or password";default:return"Sign-in failed. Please try again."}}var oP,sP;!function(e){e.HTTP="http",e.HTTPS="https"}(oP||(oP={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(sP||(sP={}));const aP="__smithy_context";class lP{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new lP({...e,headers:{...e.headers}});return t.query&&(t.query=function(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}(t.query)),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return lP.clone(this)}}class cP{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const uP={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},dP=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!lP.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),uP)}}),fP={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},hP={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},pP=e=>e[aP]||(e[aP]={}),gP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const mP=(e,t)=>(n,r)=>async i=>{const o=((e,t)=>{if(!t||0===t.length)return e;const n=[];for(const r of t)for(const t of e)t.schemeId.split("#")[1]===r&&n.push(t);for(const r of e)n.find(({schemeId:e})=>e===r.schemeId)||n.push(r);return n})(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),s=function(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}(e.httpAuthSchemes),a=pP(r),l=[];for(const n of o){const i=s.get(n.schemeId);if(!i){l.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}const o=i.identityProvider(await t.identityProviderConfigProvider(e));if(!o){l.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:c={},signingProperties:u={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},c),n.signingProperties=Object.assign(n.signingProperties||{},u),a.selectedHttpAuthScheme={httpAuthOption:n,identity:await o(n.identityProperties),signer:i.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(l.join("\n"));return n(i)},vP={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},yP=e=>e=>{throw e},_P=(e,t)=>{},bP={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},xP=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!lP.isInstance(n.request))return e(n);const r=pP(t).selectedHttpAuthScheme;if(!r)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:s}=r,a=await e({...n,request:await s.sign(n.request,o,i)}).catch((s.errorHandler||yP)(i));return(s.successHandler||_P)(a.response,i),a},bP)}}),SP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},wP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EP=Object.entries(wP).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),kP=wP.split(""),CP=e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let i=0;i<e.length;i+=4){let t=0,n=0;for(let r=i,a=i+3;r<=a;r++)if("="!==e[r]){if(!(e[r]in EP))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);t|=EP[e[r]]<<6*(a-r),n+=6}else t>>=6;const o=i/4*3;t>>=n%8;const s=Math.floor(n/8);for(let e=0;e<s;e++){const n=8*(s-e-1);r.setUint8(o+e,(t&255<<n)>>n)}}return new Uint8Array(n)},AP=e=>(new TextEncoder).encode(e),NP=e=>"string"==typeof e?AP(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),TP=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function RP(e){let t;t="string"==typeof e?AP(e):e;const n="object"==typeof t&&"number"==typeof t.length,r="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let o=0;o<t.length;o+=3){let e=0,n=0;for(let i=o,s=Math.min(o+3,t.length);i<s;i++)e|=t[i]<<8*(s-i-1),n+=8;const r=Math.ceil(n/6);e<<=6*r-n;for(let t=1;t<=r;t++){const n=6*(r-t);i+=kP[(e&63<<n)>>n]}i+="==".slice(0,4-r)}return i}class DP extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return"base64"===t?DP.mutate(CP(e)):DP.mutate(AP(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,DP.prototype),e}transformToString(e="utf-8"){return"base64"===e?RP(this):TP(this)}}const IP=e=>encodeURIComponent(e).replace(/[!'()*]/g,FP),FP=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function OP(e,t){return new Request(e,t)}function PP(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)},e)})}const MP={supported:void 0};class LP{config;configProvider;static create(e){return"function"==typeof e?.handle?e:new LP(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===MP.supported&&(MP.supported=Boolean("undefined"!=typeof Request&&"keepalive"in OP("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const r=n??this.config.requestTimeout,i=!0===this.config.keepAlive,o=this.config.credentials;if(t?.aborted){const e=zP(t);return Promise.reject(e)}let s=e.path;const a=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=IP(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${IP(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${IP(r)}`),t.push(e)}}return t.join("&")}(e.query||{});a&&(s+=`?${a}`),e.fragment&&(s+=`#${e.fragment}`);let l="";if(null!=e.username||null!=e.password){l=`${e.username??""}:${e.password??""}@`}const{port:c,method:u}=e,d=`${e.protocol}//${l}${e.hostname}${c?`:${c}`:""}${s}`,f="GET"===u||"HEAD"===u?void 0:e.body,h={body:f,headers:new Headers(e.headers),method:u,credentials:o};this.config?.cache&&(h.cache=this.config.cache),f&&(h.duplex="half"),"undefined"!=typeof AbortController&&(h.signal=t),MP.supported&&(h.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(h,this.config.requestInit(e));let p=()=>{};const g=OP(d,h),m=[fetch(g).then(e=>{const t=e.headers,n={};for(const r of t.entries())n[r[0]]=r[1];return null!=e.body?{response:new cP({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new cP({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),PP(r)];return t&&m.push(new Promise((e,n)=>{const r=()=>{const e=zP(t);n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),p=()=>e.removeEventListener("abort",r)}else t.onabort=r})),Promise.race(m).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function zP(e){const t=e&&"object"==typeof e&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){const e=new Error("Request aborted");return e.name="AbortError",e.cause=t,e}const e=new Error(String(t));return e.name="AbortError",e}const n=new Error("Request aborted");return n.name="AbortError",n}const jP=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(2!==r.readyState)return n(new Error("Reader aborted too early"));const e=r.result??"",i=e.indexOf(","),o=i>-1?i+1:e.length;t(e.substring(o))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}(e),n=CP(t);return new Uint8Array(n)}(e):async function(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:e,value:o}=await n.read();o&&(t.push(o),i+=o.length),r=e}const o=new Uint8Array(i);let s=0;for(const a of t)o.set(a,s),s+=a.length;return o}(e);const UP={},BP={};for(let Gxe=0;Gxe<256;Gxe++){let e=Gxe.toString(16).toLowerCase();1===e.length&&(e=`0${e}`),UP[Gxe]=e,BP[e]=Gxe}function $P(e){let t="";for(let n=0;n<e.byteLength;n++)t+=UP[e[n]];return t}const qP=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return DP.mutate(e);if(!e)return DP.mutate(new Uint8Array);const n=t.streamCollector(e);return DP.mutate(await n)},GP=e=>"function"==typeof e?e():e,VP=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),KP=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1];const WP=e=>{if("string"==typeof e)return WP(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:o}=e;let s;return o&&(s=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(o)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:s}},HP=e=>(t,n)=>async r=>{const{operationSchema:i}=pP(n),[,o,s,a,l,c]=i??[],u=n.endpointV2?async()=>(e=>{if("object"==typeof e){if("url"in e){const t=WP(e.url);if(e.headers){t.headers={};for(const n in e.headers)t.headers[n.toLowerCase()]=e.headers[n].join(", ")}return t}return e}return WP(e)})(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(VP(o,s,a,l,c),r.input,{...e,...n,endpoint:u});return t({...r,request:d})},JP={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},XP={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function QP(e){return{applyToStack:t=>{t.add(HP(e),XP),t.add((e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:o}=pP(n),[,s,a,l,c,u]=o??[];try{return{response:i,output:await e.protocol.deserializeResponse(VP(s,a,l,c,u),{...e,...n},i)}}catch(One){if(Object.defineProperty(One,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in One)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{One.message+="\n "+t}catch(bU){n.logger&&"NoOpLogger"!==n.logger?.constructor?.name?n.logger?.warn?.(t):console.warn(t)}void 0!==One.$responseBodyText&&One.$response&&(One.$response.body=One.$responseBodyText);try{if(cP.isInstance(i)){const{headers:t={}}=i,n=Object.entries(t);One.$metadata={httpStatusCode:i.statusCode,requestId:KP(/^x-[\w-]+-request-?id$/,n),extendedRequestId:KP(/^x-[\w-]+-id-2$/,n),cfId:KP(/^x-[\w-]+-cf-id$/,n)}}}catch(bU){}}throw One}})(e),JP),e.protocol.setSerdeContext(e)}}}const YP=[];function ZP(e){if("object"==typeof e)return e;if(YP[e|=0])return YP[e];const t={};let n=0;for(const r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])1==(e>>n++&1)&&(t[r]=1);return YP[e]=t}const eM=Symbol.for("@smithy/nor-struct-it"),tM=Symbol.for("@smithy/ns"),nM=[],rM={};class iM{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=iM.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let r=e,i=e;for(this._isMemberSchema=!1;sM(r);)n.push(r[1]),r=r[0],i=GP(r),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let e=n.length-1;e>=0;--e){const t=n[e];Object.assign(this.memberTraits,ZP(t))}}else this.memberTraits=0;if(i instanceof iM){const e=this.memberTraits;return Object.assign(this,i),this.memberTraits=Object.assign({},e,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,void(this.memberName=t??i.memberName)}if(this.schema=GP(i),aM(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===this.symbol}return t}static of(e){const t="function"==typeof e||"object"==typeof e&&null!==e;if("number"==typeof e){if(nM[e])return nM[e]}else if("string"==typeof e){if(rM[e])return rM[e]}else if(t&&e[tM])return e[tM];const n=GP(e);if(n instanceof iM)return n;if(sM(n)){const[t,r]=n;if(t instanceof iM)return Object.assign(t.getMergedTraits(),ZP(r)),t;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const r=new iM(n);return t?e[tM]=r:"string"==typeof n?rM[n]=r:"number"==typeof n?nM[n]=r:r}getSchema(){const e=this.schema;return Array.isArray(e)&&0===e[0]?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return"number"==typeof e?e>=64&&e<128:1===e[0]}isMapSchema(){const e=this.getSchema();return"number"==typeof e?e>=128&&e<=255:2===e[0]}isStructSchema(){const e=this.getSchema();if("object"!=typeof e)return!1;const t=e[0];return 3===t||-3===t||4===t}isUnionSchema(){const e=this.getSchema();return"object"==typeof e&&4===e[0]}isBlobSchema(){const e=this.getSchema();return 21===e||42===e}isTimestampSchema(){const e=this.getSchema();return"number"==typeof e&&e>=4&&e<=7}isUnitSchema(){return"unit"===this.getSchema()}isDocumentSchema(){return 15===this.getSchema()}isStringSchema(){return 0===this.getSchema()}isBooleanSchema(){return 2===this.getSchema()}isNumericSchema(){return 1===this.getSchema()}isBigIntegerSchema(){return 17===this.getSchema()}isBigDecimalSchema(){return 19===this.getSchema()}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||42===this.getSchema()}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return ZP(this.memberTraits)}getOwnTraits(){return ZP(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema();return oM([e?15:n[4]??0,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,r]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i="number"==typeof e?63&e:e&&"object"==typeof e&&(n||r)?e[3+e[0]]:t?15:void 0;if(null!=i)return oM([i,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),r=t[5][n];return oM(sM(r)?r:[r,0],e)}if(this.isDocumentSchema())return oM([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch(t){}return e}getEventStreamMember(){if(this.isStructSchema())for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e;return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),t=e[4].length;let n=e[eM];if(n&&t===n.length)yield*n;else{n=Array(t);for(let r=0;r<t;++r){const t=e[4][r],i=oM([e[5][r],0],t);yield n[r]=[t,i]}e[eM]=n}}}function oM(e,t){if(e instanceof iM)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new iM(e,t)}const sM=e=>Array.isArray(e)&&2===e.length,aM=e=>Array.isArray(e)&&e.length>=5;class lM{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return lM.registries.has(e)||lM.registries.set(e,new lM(e)),lM.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[r,i]of e.schemas)t.has(r)||t.set(r,i);for(const[r,i]of e.exceptions)n.has(r)||n.set(r,i)}register(e,t){const n=this.normalizeShapeId(e);for(const r of[this,lM.for(n.split("#")[0])])r.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){const n=e,r=n[1];for(const i of[this,lM.for(r)])i.schemas.set(r+"#"+n[2],n),i.exceptions.set(n,t)}getErrorCtor(e){const t=e;if(this.exceptions.has(t))return this.exceptions.get(t);return lM.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,r=t+"#"+n;if(r.startsWith("smithy.ts.sdk.synthetic.")&&r.endsWith("ServiceException"))return e}}find(e){for(const t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const cM=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&bM.warn(_M(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},uM=Math.ceil(2**127*(2-2**-23)),dM=e=>{const t=cM(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>uM)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},fM=e=>pM(e,16),hM=e=>pM(e,8),pM=(e,t)=>{const n=(e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}})(e);if(void 0!==n&&gM(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},gM=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},mM=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,vM=e=>{const t=e.match(mM);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},yM=e=>fM("string"==typeof e?vM(e):e),_M=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),bM={warn:console.warn},xM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SM=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const wM=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),EM=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),kM=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),CM=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),AM=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=EM.exec(e);if(t){const[e,n,r,i,o,s,a,l]=t;return TM(yM(jM(i)),IM(r),MM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l})}if(t=kM.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return DM(TM(RM(i),IM(r),MM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l}))}if(t=CM.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return TM(yM(jM(l)),IM(n),MM(r.trimLeft(),"day",1,31),{hours:i,minutes:o,seconds:s,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},NM=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(e=>cM("string"==typeof e?vM(e):e))(e);else{if("object"!=typeof e||1!==e.tag)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=e.value}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},TM=(e,t,n,r)=>{const i=t-1;return OM(e,i,n),new Date(Date.UTC(e,i,n,MM(r.hours,"hour",0,23),MM(r.minutes,"minute",0,59),MM(r.seconds,"seconds",0,60),LM(r.fractionalMilliseconds)))},RM=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+yM(jM(e));return n<t?n+100:n},DM=e=>e.getTime()-(new Date).getTime()>15768e8?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,IM=e=>{const t=SM.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},FM=[31,28,31,30,31,30,31,31,30,31,30,31],OM=(e,t,n)=>{let r=FM[t];if(1===t&&PM(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${SM[t]} in ${e}: ${n}`)},PM=e=>e%4==0&&(e%100!=0||e%400==0),MM=(e,t,n,r)=>{const i=(e=>hM("string"==typeof e?vM(e):e))(jM(e));if(i<n||i>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},LM=e=>null==e?0:1e3*(e=>dM("string"==typeof e?vM(e):e))("0."+e),zM=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},jM=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},UM="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),BM=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),$M=()=>{if(UM)return UM();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,BM[e[0]]+BM[e[1]]+BM[e[2]]+BM[e[3]]+"-"+BM[e[4]]+BM[e[5]]+"-"+BM[e[6]]+BM[e[7]]+"-"+BM[e[8]]+BM[e[9]]+"-"+BM[e[10]]+BM[e[11]]+BM[e[12]]+BM[e[13]]+BM[e[14]]+BM[e[15]]},qM=function(e){return Object.assign(new String(e),{deserializeJSON:()=>JSON.parse(String(e)),toString:()=>String(e),toJSON:()=>String(e)})};qM.from=e=>e&&"object"==typeof e&&(e instanceof qM||"deserializeJSON"in e)?e:"string"==typeof e||Object.getPrototypeOf(e)===String.prototype?qM(String(e)):qM(JSON.stringify(e)),qM.fromObject=qM.from;const GM=/^-?\d*(\.\d+)?$/;class VM{string;type;constructor(e,t){if(this.string=e,this.type=t,!GM.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||"object"!=typeof e)return!1;const t=e;return VM.prototype.isPrototypeOf(e)||"bigDecimal"===t.type&&GM.test(t.string)}}class KM{serdeContext;setSerdeContext(e){this.serdeContext=e}}class WM extends KM{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=lM.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return lP}getResponseType(){return cP}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,r]of t.url.searchParams.entries())e.query[n]=r;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const r=iM.of(t.input),i=ZP(t.traits??{});if(i.endpoint){let t=i.endpoint?.[0];if("string"==typeof t){for(const[e,i]of r.structIterator()){if(!i.getMergedTraits().hostLabel)continue;const r=n[e];if("string"!=typeof r)throw new Error(`@smithy/core/schema - ${e} in input must be a string as hostLabel.`);t=t.replace(`{${e}}`,r)}e.hostname=t+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await t(async()=>{const{EventStreamSerde:e}=await import("./index-B6SuPgTZ.js");return{EventStreamSerde:e}},__vite__mapDeps([0]));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,r,i){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class HM extends WM{async serializeRequest(e,t,n){const r=this.serializer,i={},o={},s=await n.endpoint(),a=iM.of(e?.input),l=a.getSchema();let c;const u=t&&"object"==typeof t?t:{},d=new lP({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:o,body:void 0});if(s&&(this.updateServiceEndpoint(d,s),this.setHostPrefix(d,e,u)),u){const e=a.getEventStreamMember();if(e){if(u[e]){const t={};for(const[n,i]of a.structIterator())n!==e&&u[n]&&(r.write(i,u[n]),t[n]=r.flush());c=await this.serializeEventStream({eventStream:u[e],requestSchema:a,initialRequest:t})}}else r.write(l,u),c=r.flush()}return d.headers=Object.assign(d.headers,o),d.query=i,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const r=this.deserializer,i=iM.of(e.output),o={};if(n.statusCode>=300){const i=await qP(n.body,t);throw i.byteLength>0&&Object.assign(o,await r.read(15,i)),await this.handleError(e,t,n,o,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const a in n.headers){const e=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=e}const s=i.getEventStreamMember();if(s)o[s]=await this.deserializeEventStream({response:n,responseSchema:i,initialResponseContainer:o});else{const e=await qP(n.body,t);e.byteLength>0&&Object.assign(o,await r.read(i,e))}return o.$metadata=this.deserializeMetadata(n),o}}function JM(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(5===e.getSchema()||6===e.getSchema()||7===e.getSchema()))return e.getSchema();const{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?"string"==typeof r||Boolean(i)?6:Boolean(o)||Boolean(n)?5:void 0:void 0)??t.timestampFormat.default}class XM{authSchemes=new Map;constructor(e){for(const t in e){const n=e[t];void 0!==n&&this.authSchemes.set(t,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class QM{async sign(e,t,n){return e}}const YM=(ZM=3e5,function(e){return eL(e)&&e.expiration.getTime()-Date.now()<ZM});var ZM;const eL=e=>void 0!==e.expiration;class tL{nodes;root;conditions;results;constructor(e,t,n,r){this.nodes=e,this.root=t,this.conditions=n,this.results=r}static from(e,t,n,r){return new tL(e,t,n,r)}}class nL extends Error{constructor(e){super(e),this.name="EndpointError"}}function rL(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${rL(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(rL).join(", ")})`:JSON.stringify(e,null,2)}const iL={};const oL=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new nL(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new nL(`Invalid array index: '${i}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n})(t).reduce((n,r)=>{if("object"!=typeof n)throw new nL(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);if(Array.isArray(n)){const e=parseInt(r);return n[e<0?n.length+e:e]}return n[r]},e),sL=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),aL=(e,t=!1)=>{if(!t)return sL.test(e);const n=e.split(".");for(const r of n)if(!aL(r))return!1;return!0};const lL=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),cL=e=>lL.test(e)||e.startsWith("[")&&e.endsWith("]"),uL={[oP.HTTP]:80,[oP.HTTPS]:443};const dL={booleanEquals:(e,t)=>e===t,coalesce:function(...e){for(const t of e)if(null!=t)return t},getAttr:oL,isSet:e=>null!=e,isValidHostLabel:aL,ite:function(e,t,n){return e?t:n},not:e=>!e,parseURL:e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:i="",query:o={}}=e,s=new URL(`${r}//${t}${n?`:${n}`:""}${i}`);return s.search=Object.entries(o).map(([e,t])=>`${e}=${t}`).join("&"),s}return new URL(e)}catch(One){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:o,protocol:s,search:a}=t;if(a)return null;const l=s.slice(0,-1);if(!Object.values(oP).includes(l))return null;const c=cL(i);return{scheme:l,authority:`${r}${n.includes(`${r}:${uL[l]}`)||"string"==typeof e&&e.includes(`${r}:${uL[l]}`)?`:${uL[l]}`:""}`,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:c}},split:function(e,t,n){if(1===n)return[e];if(""===e)return[""];const r=e.split(t);return 0===n?r:r.slice(0,n-1).concat(r.slice(1).join(t))},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>null==e||t>=n||e.length<n||/[^\u0000-\u007f]/.test(e)?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},fL=(e,t)=>{const n=[],{referenceRecord:r,endpointParams:i}=t;let o=0;for(;o<e.length;){const t=e.indexOf("{",o);if(-1===t){n.push(e.slice(o));break}n.push(e.slice(o,t));const s=e.indexOf("}",t);if(-1===s){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[s+1]&&(n.push(e.slice(t+1,s)),o=s+2);const a=e.substring(t+1,s);if(a.includes("#")){const[e,t]=a.split("#");n.push(oL(r[e]??i[e],t))}else n.push(r[a]??i[a]);o=s+1}return n.join("")},hL=(e,t,n)=>{if("string"==typeof e)return fL(e,n);if(e.fn)return gL.callFunction(e,n);if(e.ref)return(({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e])(e,n);throw new nL(`'${t}': ${String(e)} is not a string, function or reference.`)},pL=({fn:e,argv:t},n)=>{const r=Array(t.length);for(let s=0;s<r.length;++s){const e=t[s];r[s]="boolean"==typeof e||"number"==typeof e?e:gL.evaluateExpression(e,"arg",n)}const i=e.indexOf(".");if(-1!==i){const t=iL[e.slice(0,i)],n=t?.[e.slice(i+1)];if("function"==typeof n)return n(...r)}const o=dL[e];if("function"==typeof o)return o(...r);throw new Error(`function ${e} not loaded in endpointFunctions.`)},gL={evaluateExpression:hL,callFunction:pL},mL=(e,t)=>{const{assign:n}=e;if(n&&n in t.referenceRecord)throw new nL(`'${n}' is already defined in Reference Record.`);const r=pL(e,t);t.logger?.debug?.(`endpoints evaluateCondition: ${rL(e)} = ${rL(r)}`);const i=""===r||!!r;return null!=n?{result:i,toAssign:{name:n,value:r}}:{result:i}},vL=(e,t)=>Object.entries(e??{}).reduce((e,[n,r])=>(e[n]=r.map(e=>{const r=hL(e,"Header value entry",t);if("string"!=typeof r)throw new nL(`Header '${n}' value '${r}' is not a string`);return r}),e),{}),yL=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=bL.getEndpointProperty(r,t),e),{}),_L=(e,t)=>{if(Array.isArray(e))return e.map(e=>_L(e,t));switch(typeof e){case"string":return fL(e,t);case"object":if(null===e)throw new nL(`Unexpected endpoint property: ${e}`);return bL.getEndpointProperties(e,t);case"boolean":return e;default:throw new nL("Unexpected endpoint property type: "+typeof e)}},bL={getEndpointProperty:_L,getEndpointProperties:yL},xL=(e,t)=>{const n=hL(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(One){throw console.error(`Failed to construct URL with ${n}`,One),One}throw new nL("Endpoint URL must be a string, got "+typeof n)},SL=1e8,wL=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!wL(t))return!1;return!0}return!!aL(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!cL(e)))};let EL={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};const kL={isVirtualHostableS3Bucket:wL,parseArn:e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,i,o,s,...a]=t;if("arn"!==n||""===r||""===i||""===a.join(":"))return null;return{partition:r,service:i,region:o,accountId:s,resourceId:a.map(e=>e.split("/")).flat()}},partition:e=>{const{partitions:t}=EL;for(const r of t){const{regions:t,outputs:n}=r;for(const[r,i]of Object.entries(t))if(r===e)return{...n,...i}}for(const r of t){const{regionRegex:t,outputs:n}=r;if(new RegExp(t).test(e))return{...n}}const n=t.find(e=>"aws"===e.id);if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}}};function CL(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}var AL;iL.aws=kL,function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(AL||(AL={}));const NL=AL.STANDARD,TL=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],RL=["TimeoutError","RequestTimeout","RequestTimeoutException"],DL=[500,502,503,504],IL=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],FL=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],OL=e=>429===e.$metadata?.httpStatusCode||TL.includes(e.name)||1==e.$retryable?.throttling,PL=(e,t=0)=>(e=>void 0!==e?.$retryable)(e)||(e=>e.$metadata?.clockSkewCorrected)(e)||RL.includes(e.name)||IL.includes(e?.code||"")||FL.includes(e?.code||"")||DL.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||function(e){return"ERR_HTTP2_STREAM_ERROR"===e.code&&e.message.includes("NGHTTP2_REFUSED_STREAM")}(e)||void 0!==e.cause&&t<=10&&PL(e.cause,t+1);class ML{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if("THROTTLING"===n?.errorType||OL(n?.error??e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.availableTokens){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(e=>ML.setTimeoutFn(e,t))}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}var LL={};class zL{static v2026="undefined"!=typeof process&&"true"===LL?.SMITHY_NEW_RETRIES_2026;static delay(){return zL.v2026?50:100}static throttlingDelay(){return zL.v2026?1e3:500}static cost(){return zL.v2026?14:5}static throttlingCost(){return zL.v2026?5:10}static modifiedCostType(){return zL.v2026?"THROTTLING":"TRANSIENT"}}class jL{x=zL.delay();computeNextBackoffDelay(e){const t=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(t)}setDelayBase(e){this.x=e}}class UL{delay;count;cost;longPoll;constructor(e,t,n,r){this.delay=e,this.count=t,this.cost=n,this.longPoll=r}getRetryCount(){return this.count}getRetryDelay(){return Math.min(2e4,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class BL{mode=AL.STANDARD;capacity=500;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(e){"number"==typeof e?this.maxAttemptsProvider=async()=>e:"function"==typeof e?this.maxAttemptsProvider=e:e&&"object"==typeof e&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>3,this.baseDelay??=zL.delay(),this.retryBackoffStrategy??=new jL}async acquireInitialRetryToken(e){return new UL(zL.delay(),0,void 0,zL.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),r=this.shouldRetry(e,t,n);if(r||e.isLongPoll?.()){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?zL.throttlingDelay():this.baseDelay);const i=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let o=i;if(t.retryAfterHint instanceof Date&&(o=Math.max(i,Math.min(t.retryAfterHint.getTime()-Date.now(),i+5e3))),r){const t=this.getCapacityCost(n);return this.capacity-=t,new UL(o,e.getRetryCount()+1,t,e.isLongPoll?.()??!1)}throw Object.assign(new Error("No retry token available"),{$backoff:zL.v2026?o:0})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(One){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===zL.modifiedCostType()?zL.throttlingCost():zL.cost()}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}async maxAttempts(){return this.maxAttemptsProvider()}}class $L{mode=AL.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new ML,this.standardRetryStrategy=new BL(t?{maxAttempts:"number"==typeof e?e:3,...t}:e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const qL=/\d{12}\.ddb/;const GL="user-agent",VL="x-amz-user-agent",KL=/[^!$%&'*+\-.^_`|~\w]/g,WL=/[^!$%&'*+\-.^_`|~\w#]/g;const HL=e=>(t,n)=>async r=>{const{request:i}=r;if(!lP.isInstance(i))return t(r);const{headers:o}=i,s=n?.userAgent?.map(JL)||[],a=(await e.defaultUserAgentProvider()).map(JL);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&CL(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();if("string"==typeof n.mode)switch(n.mode){case AL.ADAPTIVE:CL(e,"RETRY_MODE_ADAPTIVE","F");break;case AL.STANDARD:CL(e,"RETRY_MODE_STANDARD","E")}}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(qL)&&CL(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":CL(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":CL(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":CL(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&CL(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))CL(e,n,r)}}(n,e,r);const l=n;a.push(`m/${function(e){let t="";for(const n in e){const r=e[n];if(!(t.length+r.length+1<=1024))break;t.length?t+=","+r:t+=r}return t}(Object.assign({},n.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const c=e?.customUserAgent?.map(JL)||[],u=await e.userAgentAppId();u&&a.push(JL(["app",`${u}`]));const d=[].concat([...a,...s,...c]).join(" "),f=[...a.filter(e=>e.startsWith("aws-sdk-")),...c].join(" ");return"browser"!==e.runtime?(f&&(o[VL]=o[VL]?`${o[GL]} ${f}`:f),o[GL]=d):o[VL]=d,t({...r,request:i})},JL=e=>{const t=e[0].split("/").map(e=>e.replace(KL,"-")).join("/"),n=e[1]?.replace(WL,"-"),r=t.indexOf("/"),i=t.substring(0,r);let o=t.substring(r+1);return"api"===i&&(o=o.toLowerCase()),[i,o,n].filter(e=>e&&e.length>0).reduce((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}},"")},XL={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},QL=new Set,YL=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),ZL=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const e=(e=>YL(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e)("function"==typeof t?await t():t);return((e,t=aL)=>{if(QL.has(e)||t(e))QL.add(e);else{if("*"!==e)throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.')}})(e),e},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!YL(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})},ez="content-length";const tz={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},nz=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(lP.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(ez))try{const t=n(e);r.headers={...r.headers,[ez]:String(t)}}catch(One){}}return e({...t,request:r})}),tz)}}),rz=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,iz=/(\d+\.){3}\d+/,oz=/\.\./,sz=e=>rz.test(e)&&!iz.test(e)&&!oz.test(e),az=e=>{const[t,n,r,,,i]=e.split(":"),o="arn"===t&&e.split(":").length>=6,s=Boolean(o&&n&&r&&i);if(o&&!s)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return s},lz=(e,t,n,r=!1)=>{const i=async()=>{let i;if(r){const r=n.clientContextParams,o=r?.[e];i=o??n[e]??n[t]}else i=n[e]??n[t];return"function"==typeof i?i():i};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{if(!1===n.isCustomEndpoint)return;const e=await i();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?":"+r:""}${i}`}}return e}:i},cz=async e=>{},uz=e=>{if("object"==typeof e){if("url"in e){const t=WP(e.url);if(e.headers){t.headers={};for(const[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(", ")}return t}return e}return WP(e)},dz=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[o,s]of Object.entries(i))switch(s.type){case"staticContextParams":r[o]=s.value;break;case"contextParams":r[o]=e[s.name];break;case"clientContextParams":case"builtInParams":r[o]=await lz(s.name,o,n,"builtInParams"!==s.type)();break;case"operationContextParams":r[o]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(i).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),az(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!sz(t)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},fz=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&function(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}(r,"ENDPOINT_OVERRIDE","N");const o=await(async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await cz(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(uz(e)),n.isCustomEndpoint=!0)}const i=await dz(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");const o=n.endpointProvider(i,r);if(n.isCustomEndpoint&&n.endpoint){const e=await n.endpoint();if(e?.headers){o.headers??={};for(const[t,n]of Object.entries(e.headers))o.headers[t]=Array.isArray(n)?n:[n]}}return o})(i.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=o,r.authSchemes=o.properties?.authSchemes;const s=r.authSchemes?.[0];if(s){r.signing_region=s.signingRegion,r.signing_service=s.signingName;const e=pP(r),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:s.signingRegion,signingRegion:s.signingRegion,signing_service:s.signingName,signingName:s.signingName,signingRegionSet:s.signingRegionSet},s.properties))}return n({...i})},hz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},pz=(e,t)=>({applyToStack:n=>{n.addRelativeTo(fz({config:e,instructions:t}),hz)}}),gz=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),mz=e=>{const{retryStrategy:t,retryMode:n}=e,r=gP(e.maxAttempts??3);let i=t?Promise.resolve(t):void 0;return Object.assign(e,{maxAttempts:r,retryStrategy:()=>i??=(async()=>await gP(n)()===AL.ADAPTIVE?new $L(r):new BL(r))()})},vz=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},yz=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,_z=()=>{let e=[],t=[],n=!1;const r=new Set,i=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(a.identifyOnResolve()),n),o=e=>{const t=[];return e.before.forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))}),t.push(e),e.after.reverse().forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))}),t},s=(n=!1)=>{const r=[],i=[],s={};e.forEach(e=>{const t={...e,before:[],after:[]};for(const n of vz(t.name,t.aliases))s[n]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const n of vz(t.name,t.aliases))s[n]=t;i.push(t)}),i.forEach(e=>{if(e.toMiddleware){const t=s[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${yz(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}});const a=(e=>e.sort((e,t)=>bz[t.step]-bz[e.step]||xz[t.priority||"normal"]-xz[e.priority||"normal"]))(r).map(o).reduce((e,t)=>(e.push(...t),e),[]);return a},a={add:(t,n={})=>{const{name:i,override:o,aliases:s}=n,a={step:"initialize",priority:"normal",middleware:t,...n},l=vz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${yz(i,s)}'`);for(const t of l){const n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(-1===n)continue;const r=e[n];if(r.step!==a.step||a.priority!==r.priority)throw new Error(`"${yz(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${yz(i,s)}" middleware with ${a.priority} priority in ${a.step} step.`);e.splice(n,1)}}for(const e of l)r.add(e)}e.push(a)},addRelativeTo:(e,n)=>{const{name:i,override:o,aliases:s}=n,a={middleware:e,...n},l=vz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${yz(i,s)}'`);for(const e of l){const n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==a.toMiddleware||r.relation!==a.relation)throw new Error(`"${yz(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${yz(i,s)}" middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of l)r.add(e)}t.push(a)},clone:()=>i(_z()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const o=e=>{const t=vz(e.name,e.aliases);if(t.includes(n)){i=!0;for(const e of t)r.delete(e);return!1}return!0};return e=e.filter(o),t=t.filter(o),i})(n):(n=>{let i=!1;const o=e=>{if(e.middleware===n){i=!0;for(const t of vz(e.name,e.aliases))r.delete(t);return!1}return!0};return e=e.filter(o),t=t.filter(o),i})(n),removeByTag:n=>{let i=!1;const o=e=>{const{tags:t,name:o,aliases:s}=e;if(t&&t.includes(n)){const e=vz(o,s);for(const t of e)r.delete(t);return i=!0,!1}return!0};return e=e.filter(o),t=t.filter(o),i},concat:e=>{const t=i(_z());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:i,identify:()=>s(!0).map(e=>{const t=e.step??e.relation+" "+e.toMiddleware;return yz(e.name,e.aliases)+" - "+t}),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of s().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(a.identify()),e}};return a},bz={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},xz={high:3,normal:2,low:1};class Sz{config;middlewareStack=_z();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&"function"==typeof t&&(e.protocol=new t(n))}send(e,t,n){const r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n;let o;if(void 0===r&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const t=this.handlers;t.has(e.constructor)?o=t.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then(e=>e.output);o(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{})}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const wz="***SensitiveInformation***";function Ez(e,t){if(null==t)return t;const n=iM.of(e);if(n.getMergedTraits().sensitive)return wz;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return wz}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return wz}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=Ez(i,e[t]));return r}return t}let kz=class{middlewareStack=_z();schema;static classBuilder(){return new Cz}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:i,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:a,smithyContext:l,additionalContext:c,CommandCtor:u}){for(const m of r.bind(this)(u,e,t,n))this.middlewareStack.use(m);const d=e.concat(this.middlewareStack),{logger:f}=t,h={logger:f,clientName:i,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:a,[aP]:{commandInstance:this,...l},...c},{requestHandler:p}=t;let g=n??{};return l.eventStream&&(g={isEventStream:!0,...g}),d.resolve(e=>p.handle(e.request,g),h)}};class Cz{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends kz{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){const o=e._operationSchema,s=o?.[4]??o?.input,a=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?Ez.bind(null,s):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?Ez.bind(null,a):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Az extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return Az.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&("client"===t.$fault||"server"===t.$fault)}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Az?Az.isInstance(e):!!Az.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const Nz=(e,t={})=>{Object.entries(t).filter(([,e])=>void 0!==e).forEach(([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},Tz=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Rz=Object.values(sP),Dz=e=>Object.assign((e=>{const t=[];for(const n in sP){const r=sP[n];void 0!==e[r]&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}for(const[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};const r=n.algorithmId(),i=n.checksumConstructor();Rz.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms:()=>t}})(e),(e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy:()=>e.retryStrategy}))(e)),Iz=e=>Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{const n=e.algorithmId();Rz.includes(n)&&(t[n]=e.checksumConstructor())}),t})(e),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(e));class Fz{trace(){}debug(){}info(){}warn(){}error(){}}const Oz=e=>e?.body instanceof ReadableStream;const Pz=e=>new Promise(t=>setTimeout(t,e)),Mz=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,Lz=(e,t)=>{const n={error:e,errorType:zz(e)},r=function(e,t){if(cP.isInstance(e))for(const n of Object.keys(e.headers)){const r=n.toLowerCase();if("retry-after"===r){const r=e.headers[n];let i=NaN;if(r.endsWith("GMT"))try{i=(AM(r).getTime()-Date.now())/1e3}catch(bU){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(bU)}else r.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?i=Number(r.match(/ GMT, ([\d.]+)$/)?.[1]):r.match(/^((\d+)|(\d+\.\d+))$/)?i=Number(r):Date.parse(r)>=Date.now()&&(i=(Date.parse(r)-Date.now())/1e3);if(isNaN(i))return;return new Date(Date.now()+1e3*i)}if("x-amz-retry-after"===r){const r=e.headers[n],i=Number(r);return isNaN(i)?void t?.trace?.(`Failed to parse x-amz-retry-after=${r}`):new Date(Date.now()+i)}}}(e.$response,t);return r&&(n.retryAfterHint=r),n},zz=e=>OL(e)?"THROTTLING":PL(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!PL(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",jz={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Uz=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const o=await e.maxAttempts();if(!Mz(i))return i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r);{let a=await i.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,c=0,u=0;const{request:d}=r,f=lP.isInstance(d);for(f&&(d.headers["amz-sdk-invocation-id"]=$M());;)try{f&&(d.headers["amz-sdk-request"]=`attempt=${c+1}; max=${o}`);const{response:e,output:n}=await t(r);return i.recordSuccess(a),n.$metadata.attempts=c+1,n.$metadata.totalRetryDelay=u,{response:e,output:n}}catch(bU){const r=Lz(bU,e.logger);if(l=gz(bU),f&&Oz(d))throw(n.logger instanceof Fz?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,r)}catch(s){throw"number"==typeof s.$backoff&&await Pz(s.$backoff),l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=u,l}c=a.getRetryCount();const o=a.getRetryDelay();u+=o,await Pz(o)}}})(e),jz)}}),Bz=e=>cP.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,$z=e=>new Date(Date.now()+e),qz=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs($z(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},Gz=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class Vz{async sign(e,t,n){if(!lP.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=Gz("context",e.context),n=Gz("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=Gz("signer",n.signer),o=await i(r),s=e?.signingRegion,a=e?.signingRegionSet,l=e?.signingName;return{config:n,signer:o,signingRegion:s,signingRegionSet:a,signingName:l}})(n),{config:i,signer:o}=r;let{signingRegion:s,signingName:a}=r;const l=n.context;if(l?.authSchemes?.length){const[e,t]=l.authSchemes;"sigv4a"===e?.name&&"sigv4"===t?.name&&(s=t?.signingRegion??s,a=t?.signingName??a)}return await o.sign(e,{signingDate:$z(i.systemClockOffset),signingRegion:s,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??Bz(t.$response);if(n){const r=Gz("config",e.config),i=r.systemClockOffset;r.systemClockOffset=qz(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=Bz(e);if(n){const e=Gz("config",t.config);e.systemClockOffset=qz(n,e.systemClockOffset)}}}const Kz=(e,t,n)=>{let r,i,o,s=!1;return async t=>(o&&!t?.forceRefresh||(r=await(async()=>{i||(i=e());try{r=await i,o=!0,s=!1}finally{i=void 0}return r})()),r)},Wz="X-Amz-Date",Hz="X-Amz-Signature",Jz="X-Amz-Security-Token",Xz="authorization",Qz=Wz.toLowerCase(),Yz=[Xz,Qz,"date"],Zz=Hz.toLowerCase(),ej="x-amz-content-sha256",tj=Jz.toLowerCase(),nj={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},rj=/^proxy-/,ij=/^sec-/,oj="AWS4-HMAC-SHA256",sj="AWS4-HMAC-SHA256-PAYLOAD",aj="aws4_request",lj={},cj=[],uj=(e,t,n)=>`${e}/${t}/${n}/${aj}`,dj=(e,t,n)=>{const r=new e(t);return r.update(NP(n)),r.digest()},fj=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(null==e[i])continue;const o=i.toLowerCase();(o in nj||t?.has(o)||rj.test(o)||ij.test(o))&&(!n||n&&!n.has(o))||(r[o]=e[i].trim().replace(/\s+/g," "))}return r},hj=async({headers:e,body:t},n)=>{for(const i of Object.keys(e))if(i.toLowerCase()===ej)return e[i];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(r=t,"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(r))){const e=new n;return e.update(NP(t)),$P(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class pj{format(e){const t=[];for(const i of Object.keys(e)){const n=AP(i);t.push(Uint8Array.from([n.byteLength]),n,this.formatHeaderValue(e[i]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const i of t)n.set(i,r),r+=i.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":const s=AP(e.value),a=new DataView(new ArrayBuffer(3+s.byteLength));a.setUint8(0,7),a.setUint16(1,s.byteLength,!1);const l=new Uint8Array(a.buffer);return l.set(s,3),l;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(vj.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!mj.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const u=new Uint8Array(17);return u[0]=9,u.set(function(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in BP))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=BP[r]}return t}(e.value.replace(/\-/g,"")),1),u}}}var gj;!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(gj||(gj={}));const mj=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class vj{bytes;constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&yj(t),new vj(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&yj(e),parseInt($P(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function yj(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const _j=e=>{e=lP.clone(e);for(const t of Object.keys(e.headers))Yz.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},bj=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class xj{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){this.service=r,this.sha256=i,this.uriEscapePath=o,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=gP(n),this.credentialProvider=gP(t)}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===Zz)continue;const i=IP(r);t.push(i);const o=e[r];"string"==typeof o?n[i]=`${i}=${IP(o)}`:Array.isArray(o)&&(n[i]=o.slice(0).reduce((e,t)=>e.concat([`${i}=${IP(t)}`]),[]).sort().join("&"))}return t.sort().map(e=>n[e]).filter(e=>e).join("&")})(e)}\n${r.map(e=>`${e}:${t[e]}`).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n,r){const i=new this.sha256;i.update(NP(n));return`${r}\n${e}\n${t}\n${$P(await i.digest())}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const r of e.split("/"))0!==r?.length&&"."!==r&&(".."===r?t.pop():t.push(r));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return IP(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(e){const t=(e=>bj(e).toISOString().replace(/\.\d{3}Z$/,"Z"))(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class Sj extends xj{headerFormatter=new pj;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:s,hoistableHeaders:a,signingRegion:l,signingService:c}=t,u=await this.credentialProvider();this.validateResolvedCredentials(u);const d=l??await this.regionProvider(),{longDate:f,shortDate:h}=this.formatDate(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const p=uj(h,d,c??this.service),g=((e,t={})=>{const{headers:n,query:r={}}=lP.clone(e);for(const i of Object.keys(n)){const e=i.toLowerCase();("x-amz-"===e.slice(0,6)&&!t.unhoistableHeaders?.has(e)||t.hoistableHeaders?.has(e))&&(r[i]=n[i],delete n[i])}return{...e,headers:n,query:r}})(_j(e),{unhoistableHeaders:o,hoistableHeaders:a});u.sessionToken&&(g.query[Jz]=u.sessionToken),g.query["X-Amz-Algorithm"]=oj,g.query["X-Amz-Credential"]=`${u.accessKeyId}/${p}`,g.query[Wz]=f,g.query["X-Amz-Expires"]=r.toString(10);const m=fj(g,i,s);return g.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(m),g.query[Hz]=await this.getSignature(f,p,this.getSigningKey(u,d,h,c),this.createCanonicalRequest(g,m,await hj(e,this.sha256))),g}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:i,signingService:o,eventStreamCredentials:s}){const a=i??await this.regionProvider(),{shortDate:l,longDate:c}=this.formatDate(n),u=uj(l,a,o??this.service),d=await hj({headers:{},body:t},this.sha256),f=new this.sha256;f.update(e);const h=$P(await f.digest()),p=[sj,c,u,r,h,d].join("\n");return this.signString(p,{signingDate:n,signingRegion:a,signingService:o,eventStreamCredentials:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r,eventStreamCredentials:i}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature,eventStreamCredentials:i}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r,eventStreamCredentials:i}={}){const o=i??await this.credentialProvider();this.validateResolvedCredentials(o);const s=n??await this.regionProvider(),{shortDate:a}=this.formatDate(t),l=new this.sha256(await this.getSigningKey(o,s,a,r));return l.update(NP(e)),$P(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:o}={}){const s=await this.credentialProvider();this.validateResolvedCredentials(s);const a=i??await this.regionProvider(),l=_j(e),{longDate:c,shortDate:u}=this.formatDate(t),d=uj(u,a,o??this.service);l.headers[Qz]=c,s.sessionToken&&(l.headers[tj]=s.sessionToken);const f=await hj(l,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(ej,l.headers)&&this.applyChecksum&&(l.headers[ej]=f);const h=fj(l,r,n),p=await this.getSignature(c,d,this.getSigningKey(s,a,u,o),this.createCanonicalRequest(l,h,f));return l.headers[Xz]=`${oj} Credential=${s.accessKeyId}/${d}, SignedHeaders=${this.getCanonicalHeaderList(h)}, Signature=${p}`,l}async getSignature(e,t,n,r){const i=await this.createStringToSign(e,t,r,oj),o=new this.sha256(await n);return o.update(NP(i)),$P(await o.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const o=`${n}:${r}:${i}:${$P(await dj(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(o in lj)return lj[o];for(cj.push(o);cj.length>50;)delete lj[cj.shift()];let s=`AWS4${t.secretAccessKey}`;for(const a of[n,r,i,aj])s=await dj(e,s,a);return lj[o]=s})(this.sha256,e,n,t,r||this.service)}}const wj=e=>{let t,n=e.credentials,r=!!e.credentials;Object.defineProperty(e,"credentials",{set(i){i&&i!==n&&i!==t&&(r=!0),n=i;const o=function(e,{credentials:t,credentialDefaultProvider:n}){let r;r=t?t?.memoized?t:((e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let i,o,s,a=!1;const l=async e=>{o||(o=r(e));try{i=await o,s=!0,a=!1}finally{o=void 0}return i};return void 0===t?async e=>(s&&!e?.forceRefresh||(i=await l(e)),i):async e=>(s&&!e?.forceRefresh||(i=await l(e)),a?i:n(i)?t(i)?(await l(e),i):i:(a=!0,i))})(t,YM,eL):n?SP(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),s=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,o);if(r&&!s.attributed){const e="object"==typeof n&&null!==n;t=async t=>{const n=await s(t);return!e||n.$source&&0!==Object.keys(n.$source).length?n:function(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}(n,"CREDENTIALS_CODE","e")},t.memoized=s.memoized,t.configBound=s.configBound,t.attributed=!0}else t=s},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:i=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:s}=e;let a;a=e.signer?SP(e.signer):e.regionInfoProvider?()=>SP(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{const{signingRegion:r,signingService:o}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||o||e.serviceId;const a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i};return new(e.signerConstructor||Sj)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await SP(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const o={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i};return new(e.signerConstructor||Sj)(o)};return Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:a})};const Ej=async(e,t,n)=>({operation:pP(t).operation,region:await gP(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const kj=e=>{const t=[];switch(e.operation){case"AssociateSoftwareToken":case"ChangePassword":case"CompleteWebAuthnRegistration":case"ConfirmDevice":case"ConfirmForgotPassword":case"ConfirmSignUp":case"DeleteUser":case"DeleteUserAttributes":case"DeleteWebAuthnCredential":case"ForgetDevice":case"ForgotPassword":case"GetDevice":case"GetTokensFromRefreshToken":case"GetUser":case"GetUserAttributeVerificationCode":case"GetUserAuthFactors":case"GlobalSignOut":case"InitiateAuth":case"ListDevices":case"ListWebAuthnCredentials":case"ResendConfirmationCode":case"RespondToAuthChallenge":case"RevokeToken":case"SetUserMFAPreference":case"SetUserSettings":case"SignUp":case"StartWebAuthnRegistration":case"UpdateAuthEventFeedback":case"UpdateDeviceStatus":case"UpdateUserAttributes":case"VerifySoftwareToken":case"VerifyUserAttribute":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},Cj={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Aj="3.1033.0";var Nj="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function Tj(e){return e instanceof Uint8Array?e:"string"==typeof e?Nj(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Rj(e){return"string"==typeof e?0===e.length:0===e.byteLength}var Dj={name:"SHA-256"},Ij={name:"HMAC",hash:Dj},Fj=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const Oj={};function Pj(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:Oj}var Mj=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!Rj(e)){var t=Tj(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Pj().crypto.subtle.sign(Ij,t,e.toHash).then(function(e){return new Uint8Array(e)})}):Rj(this.toHash)?Promise.resolve(Fj):Promise.resolve().then(function(){return Pj().crypto.subtle.digest(Dj,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise(function(t,n){Pj().crypto.subtle.importKey("raw",Tj(e.secret),Ij,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function Lj(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(bU){o(bU)}}function a(e){try{l(r.throw(e))}catch(bU){o(bU)}}function l(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())})}function zj(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(bU){a=[6,bU],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError;var jj=64,Uj=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Bj=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],$j=Math.pow(2,53)-1,qj=function(){function e(){this.state=Int32Array.from(Bj),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>$j)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===jj&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%jj>=56){for(var r=this.bufferLength;r<jj;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=0;u<jj;u++){if(u<16)this.temp[u]=(255&e[4*u])<<24|(255&e[4*u+1])<<16|(255&e[4*u+2])<<8|255&e[4*u+3];else{var d=this.temp[u-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[u-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[u]=(f+this.temp[u-7]|0)+(h+this.temp[u-16]|0)}var p=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&a^~s&l)|0)+(c+(Uj[u]+this.temp[u]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;c=l,l=a,a=s,s=o+p|0,o=i,i=r,r=n,n=p+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=s,t[5]+=a,t[6]+=l,t[7]+=c},e}(),Gj=function(){function e(e){this.secret=e,this.hash=new qj,this.reset()}return e.prototype.update=function(e){if(!Rj(e)&&!this.error)try{this.hash.update(Tj(e))}catch(bU){this.error=bU}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return Lj(this,void 0,void 0,function(){return zj(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new qj,this.secret){this.outer=new qj;var e=function(e){var t=Tj(e);if(t.byteLength>jj){var n=new qj;n.update(t),t=n.digest()}var r=new Uint8Array(jj);return r.set(t),r}(this.secret),t=new Uint8Array(jj);t.set(e);for(var n=0;n<jj;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}();var Vj=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Kj(e){return!(!function(e){if("object"==typeof e&&"object"==typeof e.crypto){return"function"==typeof e.crypto.getRandomValues}return!1}(e)||"object"!=typeof e.crypto.subtle)&&function(e){return e&&Vj.every(function(t){return"function"==typeof e[t]})}(e.crypto.subtle)}var Wj=function(){function e(e){Kj(Pj())?this.hash=new Mj(e):this.hash=new Gj(e)}return e.prototype.update=function(e,t){this.hash.update(Tj(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();const Hj=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window?window.navigator:void 0,i=r?.userAgent??"",o=r?.userAgentData?.platform??Jj.os(i)??"other",s=r?.userAgentData?.brands??[],a=s[s.length-1],l=a?.brand??Jj.browser(i)??"unknown",c=[["aws-sdk-js",t],["ua","2.1"],[`os/${o}`,void 0],["lang/js"],["md/browser",`${l}_${a?.version??"unknown"}`]];e&&c.push([`api/${e}`,t]);const u=await(n?.userAgentAppId?.());return u&&c.push([`app/${u}`]),c},Jj={os:e=>/iPhone|iPad|iPod/.test(e)?"iOS":/Macintosh|Mac OS X/.test(e)?"macOS":/Windows NT/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":void 0,browser:e=>/EdgiOS|EdgA|Edg\//.test(e)?"Microsoft Edge":/Firefox\//.test(e)?"Firefox":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)?"Safari":void 0},Xj=e=>()=>Promise.reject(e),Qj="function"==typeof TextEncoder?new TextEncoder:null,Yj=e=>{if("string"==typeof e){if(Qj)return Qj.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)},Zj=["in-region","cross-region","mobile","standard","legacy"],eU=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:n,downlink:r}=e?.connection;if("string"==typeof t&&"4g"!==t||Number(n)>100||Number(r)<10)return!0}return e?.userAgentData?.mobile||"number"==typeof e?.maxTouchPoints&&e?.maxTouchPoints>1};class tU{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),r=Object.values(n).find(e=>!!e.getMergedTraits().httpPayload);if(r){const t=r.getMergedTraits().mediaType;return t||(r.isStringSchema()?"text/plain":r.isBlobSchema()?"application/octet-stream":e)}if(!t.isUnitSchema()){const t=Object.values(n).find(e=>{const{httpQuery:t,httpQueryParams:n,httpHeader:r,httpLabel:i,httpPrefixHeaders:o}=e.getMergedTraits();return!t&&!n&&!r&&!i&&void 0===o});if(t)return e}}async getErrorSchemaOrThrowBaseException(e,t,n,r,i,o){let s=e;e.includes("#")&&([,s]=e.split("#"));const a={$metadata:i,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:o?.(this.errorRegistry,s)??this.errorRegistry.getSchema(e),errorMetadata:a}}catch(bU){r.message=r.message??r.Message??"UnknownError";const t=this.errorRegistry,n=t.getBaseException();if(n){const e=t.getErrorCtor(n)??Error;throw this.decorateServiceException(Object.assign(new e({name:s}),a),r)}const i=r,o=i?.message??i?.Message??i?.Error?.Message??i?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(o),{name:s},a),r)}}compose(e,t,n){let r=n;t.includes("#")&&([r]=t.split("#"));const i=lM.for(r),o=lM.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(i),e.copyFrom(o),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,r=Nz(e,t);n&&(r.message=n);const i=r.Error??{};i.Type=r.Error?.Type,i.Code=r.Error?.Code,i.Message=r.Error?.message??r.Error?.Message??n,r.Error=i;const o=r.$metadata.requestId;return o&&(r.RequestId=o),r}return Nz(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(void 0!==e&&null!=n){const[t,r]=n.split(";"),i=Object.keys(e),o={Code:t,Type:r};e.Code=t,e.Type=r;for(let n=0;n<i.length;n++){const t=i[n];o["message"===t?"Message":t]=e[t]}delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch(bU){return e.find(e=>iM.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}class nU{serdeContext;setSerdeContext(e){this.serdeContext=e}}class rU{from;to;keys;constructor(e,t){this.from=e,this.to=t;const n=Object.keys(this.from),r=new Set(n);r.delete("__type"),this.keys=r}mark(e){this.keys.delete(e)}hasUnknown(){return 1===this.keys.size&&0===Object.keys(this.to).length}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function iU(e,t,n){if(n?.source){const e=n.source;if("number"==typeof t&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||e!==String(t))){return e.includes(".")?new VM(e,"bigDecimal"):BigInt(e)}}return t}const oU=(e,t)=>((e,t)=>qP(e,t).then(e=>(t?.utf8Encoder??TP)(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(bU){throw"SyntaxError"===bU?.name&&Object.defineProperty(bU,"$responseBodyText",{value:e}),bU}return{}}),sU=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),aU=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t};class lU extends nU{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,"string"==typeof t?JSON.parse(t,iU):await oU(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=null!==t&&"object"==typeof t,r=iM.of(e);if(n){if(r.isStructSchema()){const e=t,n=r.isUnionSchema(),i={};let o;const{jsonName:s}=this.settings;let a;s&&(o={}),n&&(a=new rU(e,i));for(const[t,l]of r.structIterator()){let r=t;s&&(r=l.getMergedTraits().jsonName??r,o[r]=t),n&&a.mark(r),null!=e[r]&&(i[t]=this._read(l,e[r]))}if(n)a.writeUnknown();else if("string"==typeof e.__type)for(const t in e){const n=e[t],r=s?o[t]??t:t;r in i||(i[r]=n)}return i}if(Array.isArray(t)&&r.isListSchema()){const e=r.getValueSchema(),n=[];for(const r of t)n.push(this._read(e,r));return n}if(r.isMapSchema()){const e=r.getValueSchema(),n={};for(const r in t)n[r]=this._read(e,t[r]);return n}}if(r.isBlobSchema()&&"string"==typeof t)return CP(t);const i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&"string"==typeof t&&i){return"application/json"===i||i.endsWith("+json")?qM.from(t):t}if(r.isTimestampSchema()&&null!=t){switch(JM(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=wM.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,i,o,s,a,l,c,u]=t,d=yM(jM(r)),f=MM(i,"month",1,12),h=MM(o,"day",1,31),p=TM(d,f,h,{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c});return"Z"!=u.toUpperCase()&&p.setTime(p.getTime()-zM(u)),p})(t);case 6:return AM(t);case 7:return NM(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isBigIntegerSchema()&&("number"==typeof t||"string"==typeof t))return BigInt(t);if(r.isBigDecimalSchema()&&null!=t){if(t instanceof VM)return t;const e=t;return"bigDecimal"===e.type&&"string"in e?new VM(e.string,e.type):new VM(String(t),"bigDecimal")}if(r.isNumericSchema()&&"string"==typeof t){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(r.isDocumentSchema()){if(n){const e=Array.isArray(t)?[]:{};for(const n in t){const i=t[n];e[n]=i instanceof VM?i:this._read(r,i)}return e}return structuredClone(t)}return t}}const cU=String.fromCharCode(925);class uU{values=new Map;counter=0;stage=0;createReplacer(){if(1===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(2===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof VM){const e=cU+"nv"+this.counter+++"_"+t.string;return this.values.set(`"${e}"`,t.string),e}if("bigint"==typeof t){const e=t.toString(),n=cU+"b"+this.counter+++"_"+e;return this.values.set(`"${n}"`,e),n}return t}}replaceInJson(e){if(0===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(2===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,0===this.counter)return e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class dU extends nU{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=iM.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const e=new uU;return e.replaceInJson(JSON.stringify(this.buffer,e.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),"object"==typeof this.buffer&&(this.buffer.__type=iM.of(e).getName(!0))}_write(e,t,n){const r=null!==t&&"object"==typeof t,i=iM.of(e);if(r){if(i.isStructSchema()){const e=t,n={},{jsonName:r}=this.settings;let o;r&&(o={});let s=0;for(const[t,a]of i.structIterator()){const l=this._write(a,e[t],i);if(void 0!==l){let e=t;r&&(e=a.getMergedTraits().jsonName??t,o[t]=e),n[e]=l,s++}}if(i.isUnionSchema()&&0===s){const{$unknown:t}=e;if(Array.isArray(t)){const[e,r]=t;n[e]=this._write(15,r)}}else if("string"==typeof e.__type)for(const t in e){const i=e[t],s=r?o[t]??t:t;s in n||(n[s]=this._write(15,i))}return n}if(Array.isArray(t)&&i.isListSchema()){const e=i.getValueSchema(),n=[],r=!!i.getMergedTraits().sparse;for(const i of t)(r||null!=i)&&n.push(this._write(e,i));return n}if(i.isMapSchema()){const e=i.getValueSchema(),n={},r=!!i.getMergedTraits().sparse;for(const i in t){const o=t[i];(r||null!=o)&&(n[i]=this._write(e,o))}return n}if(t instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??RP)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema())){switch(JM(i,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return function(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),a=e.getUTCSeconds(),l=o<10?`0${o}`:`${o}`,c=s<10?`0${s}`:`${s}`,u=a<10?`0${a}`:`${a}`;return`${xM[r]}, ${i<10?`0${i}`:`${i}`} ${SM[n]} ${t} ${l}:${c}:${u} GMT`}(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}}t instanceof VM&&(this.useReplacer=!0)}if(null!==t||!n?.isStructSchema()){if(i.isStringSchema()){if(void 0===t&&i.isIdempotencyToken())return $M();const e=i.getMergedTraits().mediaType;if(null!=t&&e){if("application/json"===e||e.endsWith("+json"))return qM.from(t)}return t}if("number"==typeof t&&i.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if("string"==typeof t&&i.isBlobSchema())return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??RP)(t);if("bigint"==typeof t&&(this.useReplacer=!0),i.isDocumentSchema()){if(r){const e=Array.isArray(t)?[]:{};for(const n in t){const r=t[n];r instanceof VM?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r)}return e}return structuredClone(t)}return t}}}class fU extends nU{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new dU(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new lU(this.settings);return e.setSerdeContext(this.serdeContext),e}}class hU extends HM{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=i??new fU({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new tU(this.awsQueryCompatible)}async serializeRequest(e,t,n){const r=await super.serializeRequest(e,t,n);return r.path.endsWith("/")||(r.path+="/"),r.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,r.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),"unit"!==GP(e.input)&&r.body||(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);const o=((e,t)=>{const n=sU(e.headers,"x-amzn-errortype");if(void 0!==n)return aU(e.headers[n]);if(t&&"object"==typeof t){const e=sU(t,"code");if(e&&void 0!==t[e])return aU(t[e]);if(void 0!==t.__type)return aU(t.__type)}})(n,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);const{errorSchema:s,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),l=iM.of(s),c=r.message??r.Message??"UnknownError",u=new(this.compositeErrorRegistry.getErrorCtor(s)??Error)(c),d={},f=this.codec.createDeserializer();for(const[h,p]of l.structIterator())null!=r[h]&&(d[h]=f.readObject(p,r[h]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,a,{$fault:l.getMergedTraits().error,message:c},d),r)}}class pU extends hU{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const gU="ref",mU=-1,vU=!0,yU="isSet",_U="PartitionResult",bU="booleanEquals",xU="getAttr",SU="stringEquals",wU={[gU]:"Endpoint"},EU={[gU]:_U},kU={[gU]:"Region"},CU={},AU=[kU],NU={conditions:[[yU,[wU]],[yU,AU],["aws.partition",AU,_U],[bU,[{[gU]:"UseFIPS"},vU]],[bU,[{fn:xU,argv:[EU,"supportsFIPS"]},vU]],[bU,[{[gU]:"UseDualStack"},vU]],[bU,[{fn:xU,argv:[EU,"supportsDualStack"]},vU]],[SU,[{fn:xU,argv:[EU,"name"]},"aws"]],[SU,[kU,"us-east-1"]],[SU,[kU,"us-east-2"]],[SU,[kU,"us-west-1"]],[SU,[kU,"us-west-2"]]],results:[[mU],[mU,"Invalid Configuration: FIPS and custom endpoint are not supported"],[mU,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[wU,CU],["https://cognito-idp-fips.us-east-1.amazonaws.com",CU],["https://cognito-idp-fips.us-east-2.amazonaws.com",CU],["https://cognito-idp-fips.us-west-1.amazonaws.com",CU],["https://cognito-idp-fips.us-west-2.amazonaws.com",CU],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",CU],[mU,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",CU],[mU,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",CU],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",CU],[mU,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",CU],[mU,"Invalid Configuration: Missing Region"]]},TU=1e8,RU=new Int32Array([-1,1,-1,0,17,3,1,4,TU+16,2,5,TU+16,3,9,6,5,7,TU+15,6,8,TU+14,7,TU+12,TU+13,4,11,10,5,TU+9,TU+11,5,12,TU+10,6,13,TU+9,8,TU+4,14,9,TU+5,15,10,TU+6,16,11,TU+7,TU+8,3,TU+1,18,5,TU+2,TU+3]),DU=tL.from(RU,2,NU.conditions,NU.results),IU=new class{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),FU=(e,t={})=>IU.get(e,()=>((e,t)=>{const{nodes:n,root:r,results:i,conditions:o}=e;let s=r;const a={},l={referenceRecord:a,endpointParams:t.endpointParams,logger:t.logger};for(;1!==s&&-1!==s&&s<SL;){const e=3*(Math.abs(s)-1),[t,r,i]=[n[e],n[e+1],n[e+2]],[c,u,d]=o[t],f=mL({fn:c,assign:d,argv:u},l);if(f.toAssign){const{name:e,value:t}=f.toAssign;a[e]=t}s=s>=0===f.result?r:i}if(s>=SL){const e=i[s-SL];if(-1===e[0]){const[,t]=e;throw new nL(hL(t,"Error",l))}const[t,n,r]=e;return{url:xL(t,l),properties:yL(n,l),headers:vL(r??{},l)}}throw new nL("No matching endpoint.")})(DU,{endpointParams:e,logger:t.logger}));iL.aws=kL;class OU extends Az{constructor(e){super(e),Object.setPrototypeOf(this,OU.prototype)}}class PU extends OU{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,PU.prototype)}}class MU extends OU{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,MU.prototype)}}class LU extends OU{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,LU.prototype),this.reasonCode=e.reasonCode}}class zU extends OU{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,zU.prototype)}}class jU extends OU{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,jU.prototype)}}class UU extends OU{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,UU.prototype)}}class BU extends OU{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,BU.prototype)}}class $U extends OU{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,$U.prototype)}}class qU extends OU{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,qU.prototype)}}class GU extends OU{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,GU.prototype)}}class VU extends OU{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,VU.prototype)}}class KU extends OU{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,KU.prototype)}}class WU extends OU{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,WU.prototype)}}class HU extends OU{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,HU.prototype)}}class JU extends OU{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,JU.prototype)}}class XU extends OU{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,XU.prototype)}}class QU extends OU{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,QU.prototype)}}class YU extends OU{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,YU.prototype)}}class ZU extends OU{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,ZU.prototype)}}class eB extends OU{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,eB.prototype)}}class tB extends OU{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,tB.prototype)}}class nB extends OU{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,nB.prototype)}}class rB extends OU{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,rB.prototype)}}class iB extends OU{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,iB.prototype)}}class oB extends OU{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,oB.prototype)}}class sB extends OU{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,sB.prototype)}}class aB extends OU{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,aB.prototype)}}class lB extends OU{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,lB.prototype)}}class cB extends OU{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,cB.prototype)}}class uB extends OU{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,uB.prototype)}}class dB extends OU{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,dB.prototype)}}class fB extends OU{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,fB.prototype)}}class hB extends OU{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,hB.prototype)}}class pB extends OU{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,pB.prototype)}}class gB extends OU{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,gB.prototype)}}class mB extends OU{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,mB.prototype)}}class vB extends OU{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,vB.prototype)}}class yB extends OU{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,yB.prototype)}}class _B extends OU{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,_B.prototype)}}class bB extends OU{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,bB.prototype)}}class xB extends OU{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,xB.prototype)}}class SB extends OU{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,SB.prototype)}}class wB extends OU{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,wB.prototype)}}class EB extends OU{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,EB.prototype)}}class kB extends OU{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,kB.prototype)}}class CB extends OU{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,CB.prototype)}}class AB extends OU{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,AB.prototype)}}class NB extends OU{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,NB.prototype)}}class TB extends OU{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,TB.prototype)}}class RB extends OU{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,RB.prototype)}}class DB extends OU{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,DB.prototype)}}class IB extends OU{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,IB.prototype)}}class FB extends OU{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,FB.prototype)}}class OB extends OU{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,OB.prototype)}}class PB extends OU{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,PB.prototype)}}class MB extends OU{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,MB.prototype)}}class LB extends OU{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,LB.prototype)}}const zB="Session",jB="client",UB="error",BB="httpError",$B="message",qB="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",GB="server",VB="com.amazonaws.cognitoidentityprovider",KB=lM.for(qB);var WB=[-3,qB,"CognitoIdentityProviderServiceException",0,[],[]];KB.registerError(WB,OU);const HB=lM.for(VB);var JB=[-3,VB,"AccessDeniedException",{[UB]:jB,[BB]:403},[$B],[0]];HB.registerError(JB,PU);var XB=[-3,VB,"AliasExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(XB,nB);var QB=[-3,VB,"CodeDeliveryFailureException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(QB,JU);var YB=[-3,VB,"CodeMismatchException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(YB,uB);var ZB=[-3,VB,"ConcurrentModificationException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(ZB,pB);var e$=[-3,VB,"DeviceKeyExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(e$,SB);var t$=[-3,VB,"DuplicateProviderException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(t$,EB);var n$=[-3,VB,"EnableSoftwareTokenMFAException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(n$,LB);var r$=[-3,VB,"ExpiredCodeException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(r$,dB);var i$=[-3,VB,"FeatureUnavailableInTierException",{[UB]:jB,[BB]:403},[$B],[0]];HB.registerError(i$,AB);var o$=[-3,VB,"ForbiddenException",{[UB]:jB,[BB]:403},[$B],[0]];HB.registerError(o$,gB);var s$=[-3,VB,"GroupExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(s$,wB);var a$=[-3,VB,"InternalErrorException",{[UB]:GB},[$B],[0]];HB.registerError(a$,MU);var l$=[-3,VB,"InternalServerException",{[UB]:GB},[$B],[0]];HB.registerError(l$,$U);var c$=[-3,VB,"InvalidEmailRoleAccessPolicyException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(c$,iB);var u$=[-3,VB,"InvalidLambdaResponseException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(u$,VU);var d$=[-3,VB,"InvalidOAuthFlowException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(d$,RB);var f$=[-3,VB,"InvalidParameterException",{[UB]:jB,[BB]:400},[$B,"reasonCode"],[0,0]];HB.registerError(f$,LU);var h$=[-3,VB,"InvalidPasswordException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(h$,XU);var p$=[-3,VB,"InvalidSmsRoleAccessPolicyException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(p$,QU);var g$=[-3,VB,"InvalidSmsRoleTrustRelationshipException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(g$,YU);var m$=[-3,VB,"InvalidUserPoolConfigurationException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(m$,rB);var v$=[-3,VB,"LimitExceededException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(v$,qU);var y$=[-3,VB,"ManagedLoginBrandingExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(y$,kB);var _$=[-3,VB,"MFAMethodNotFoundException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(_$,oB);var b$=[-3,VB,"NotAuthorizedException",{[UB]:jB,[BB]:403},[$B],[0]];HB.registerError(b$,zU);var x$=[-3,VB,"PasswordHistoryPolicyViolationException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(x$,fB);var S$=[-3,VB,"PasswordResetRequiredException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(S$,sB);var w$=[-3,VB,"PreconditionNotMetException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(w$,ZU);var E$=[-3,VB,"RefreshTokenReuseException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(E$,FB);var k$=[-3,VB,"ResourceNotFoundException",{[UB]:jB,[BB]:404},[$B],[0]];HB.registerError(k$,jU);var C$=[-3,VB,"ScopeDoesNotExistException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(C$,DB);var A$=[-3,VB,"SoftwareTokenMFANotFoundException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(A$,hB);var N$=[-3,VB,"TermsExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(N$,CB);var T$=[-3,VB,"TierChangeNotAllowedException",{[UB]:jB,[BB]:403},[$B],[0]];HB.registerError(T$,NB);var R$=[-3,VB,"TooManyFailedAttemptsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(R$,KU);var D$=[-3,VB,"TooManyRequestsException",{[UB]:jB,[BB]:429},[$B],[0]];HB.registerError(D$,UU);var I$=[-3,VB,"UnauthorizedException",{[UB]:jB,[BB]:401},[$B],[0]];HB.registerError(I$,OB);var F$=[-3,VB,"UnexpectedLambdaException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(F$,WU);var O$=[-3,VB,"UnsupportedIdentityProviderException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(O$,IB);var P$=[-3,VB,"UnsupportedOperationException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(P$,aB);var M$=[-3,VB,"UnsupportedTokenTypeException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(M$,PB);var L$=[-3,VB,"UnsupportedUserStateException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(L$,eB);var z$=[-3,VB,"UserImportInProgressException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(z$,BU);var j$=[-3,VB,"UserLambdaValidationException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(j$,HU);var U$=[-3,VB,"UsernameExistsException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(U$,tB);var B$=[-3,VB,"UserNotConfirmedException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(B$,lB);var $$=[-3,VB,"UserNotFoundException",{[UB]:jB,[BB]:404},[$B],[0]];HB.registerError($$,GU);var q$=[-3,VB,"UserPoolAddOnNotEnabledException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(q$,cB);var G$=[-3,VB,"UserPoolTaggingException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(G$,TB);var V$=[-3,VB,"WebAuthnChallengeNotFoundException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(V$,mB);var K$=[-3,VB,"WebAuthnClientMismatchException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(K$,vB);var W$=[-3,VB,"WebAuthnConfigurationMissingException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(W$,MB);var H$=[-3,VB,"WebAuthnCredentialNotSupportedException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(H$,yB);var J$=[-3,VB,"WebAuthnNotEnabledException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(J$,_B);var X$=[-3,VB,"WebAuthnOriginNotAllowedException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(X$,bB);var Q$=[-3,VB,"WebAuthnRelyingPartyMismatchException",{[UB]:jB,[BB]:400},[$B],[0]];HB.registerError(Q$,xB);const Y$=[KB,HB];var Z$=[0,VB,"ClientIdType",8,0],eq=[0,VB,"SessionType",8,0],tq=[0,VB,"TokenModelType",8,0],nq=[3,VB,"AnalyticsMetadataType",0,["AnalyticsEndpointId"],[0]],rq=[3,VB,"AuthenticationResultType",0,["AccessToken","ExpiresIn","TokenType","RefreshToken","IdToken","NewDeviceMetadata"],[[()=>tq,0],1,0,[()=>tq,0],[()=>tq,0],()=>sq]],iq=[3,VB,"InitiateAuthRequest",0,["AuthFlow","ClientId","AuthParameters","ClientMetadata","AnalyticsMetadata","UserContextData",zB],[0,[()=>Z$,0],[()=>lq,0],128,()=>nq,[()=>aq,0],[()=>eq,0]],2],oq=[3,VB,"InitiateAuthResponse",0,["ChallengeName",zB,"ChallengeParameters","AuthenticationResult","AvailableChallenges"],[0,[()=>eq,0],128,[()=>rq,0],64]],sq=[3,VB,"NewDeviceMetadataType",0,["DeviceKey","DeviceGroupKey"],[0,0]],aq=[3,VB,"UserContextDataType",8,["IpAddress","EncodedData"],[0,0]],lq=[2,VB,"AuthParametersType",8,0,0],cq=[9,VB,"InitiateAuth",0,()=>iq,()=>oq];const uq=e=>{const t=(({defaultsMode:e}={})=>Kz(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(eU()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Zj.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(Tz),r=(e=>({apiVersion:"2016-04-18",base64Decoder:e?.base64Decoder??CP,base64Encoder:e?.base64Encoder??RP,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??FU,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??kj,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Vz},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new QM}],logger:e?.logger??new Fz,protocol:e?.protocol??pU,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:Y$,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:e?.serviceId??"Cognito Identity Provider",urlParser:e?.urlParser??WP,utf8Decoder:e?.utf8Decoder??AP,utf8Encoder:e?.utf8Encoder??TP}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Yj,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Hj({serviceId:r.serviceId,clientVersion:Aj}),maxAttempts:e?.maxAttempts??3,region:e?.region??Xj("Region is missing"),requestHandler:LP.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||NL),sha256:e?.sha256??Wj,streamCollector:e?.streamCollector??jP,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))}};class dq extends Sz{config;constructor(...[e]){const t=uq(e||{});super(t),this.initConfig=t;var n;const r=function(e){const t=SP(e.userAgentAppId??void 0),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:"string"==typeof n?[[n]]:n,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}((n=t,Object.assign(n,{useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}))),i=mz(r),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,o=null!=n?async()=>uz(await gP(n)()):void 0,s=!!n,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:s,useDualstackEndpoint:gP(r??!1),useFipsEndpoint:gP(i??!1)});let l;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!l&&(l=cz(e.serviceId)),l),a})(ZL(i)),s=(e=>{const t=wj(e);return Object.assign(t,{authSchemePreference:gP(e.authSchemePreference??[])})})(o),a=((e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),Dz(e),(e=>({setHttpHandler(t){e.httpHandler=t},httpHandler:()=>e.httpHandler,updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs:()=>e.httpHandler.httpHandlerConfigs()}))(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,{region:n.region()},Iz(n),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n))})(s,e?.extensions||[]);this.config=a,this.middlewareStack.use(QP(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.add(HL(e),XL)}}))(this.config)),this.middlewareStack.use(Uz(this.config)),this.middlewareStack.use(nz(this.config)),this.middlewareStack.use(dP(this.config)),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add((e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:o,logger:s,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:c}=a,u=l??t.inputFilterSensitiveLog,d=c??t.outputFilterSensitiveLog,{$metadata:f,...h}=r.output;return s?.info?.({clientName:i,commandName:o,input:u(n.input),output:d(h),metadata:f}),r}catch(One){const{clientName:r,commandName:i,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:a}=s,l=a??t.inputFilterSensitiveLog;throw o?.error?.({clientName:r,commandName:i,input:l(n.input),error:One,metadata:One.$metadata}),One}},fP)}})),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add(e=>async t=>e(t),hP)}})),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(mP(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),vP)}}))(this.config,{httpAuthSchemeParametersProvider:Ej,identityProviderConfigProvider:async e=>new XM({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(xP(this.config))}destroy(){super.destroy()}}class fq extends(kz.classBuilder().ep(Cj).m(function(e,t,n,r){return[pz(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(cq).build()){}let hq="reventless.role-switched",pq="activeRole",gq="availableRoles",mq="activeRoleStale";function vq(e){return e.split(",").map(e=>e.trim()).filter(e=>""!==e)}function yq(e){let t=t=>U(j(e[t],Je.string),""),n=me(U(j(e.groups,Je.array),[]),Je.string),r=t=>j(j(j(e.claims,Je.object),e=>e[t]),Je.string);return{userId:t("userId"),username:t("username"),groups:n,provider:t("provider"),activeRole:r(pq),availableRoles:L(r(gq),[],vq),staleRole:r(mq)}}function _q(e){let t,n=[["userId",e.userId],["username",e.username],["groups",e.groups.map(e=>e)],["provider",e.provider]],r=e.activeRole,i=e.availableRoles,o=e.staleRole,s=0;if(void 0!==r||0!==i.length||void 0!==o?s=1:t=[],1===s){let e=[];M(r,t=>{e.push([pq,t])}),0!==i.length&&e.push([gq,i.join(",")]),M(o,t=>{e.push([mq,t])}),t=[["claims",Object.fromEntries(e)]]}return Object.fromEntries(n.concat(t))}function bq(e,t){let n=[["token",t.token],["identity",_q(t.identity)]],r=t.refreshToken,i=void 0!==r?n.concat([["refreshToken",r]]):n,o=t.expiresAt,s=void 0!==o?i.concat([["expiresAt",o]]):i,a=JSON.stringify(Object.fromEntries(s));localStorage.setItem(e,a)}function xq(e){let t=t=>j(e[t],Je.string),n=me(U(j(e["cognito:groups"],Je.array),[]),Je.string);return{userId:U(t("sub"),""),username:U(B(t("cognito:username"),t("email")),""),groups:n,provider:"Cognito",activeRole:t(pq),availableRoles:L(t(gq),[],vq),staleRole:t(mq)}}async function Sq(e){try{let t=await e.text();return JSON.parse(t)}catch(t){return}}function wq(e,t){return t+" (HTTP "+e.status.toString()+")"}function Eq(e){return JSON.stringify(void 0!==e?Object.fromEntries([["activeRole",e]]):{})}async function kq(e,t,n){try{let r=JSON.stringify(Object.fromEntries([["query","mutation SetActiveRole($activeRole: String) {\n Platform_SetActiveRole(activeRole: $activeRole) {\n activeRole\n availableRoles\n }\n}"],["variables",Object.fromEntries([["activeRole",L(n,null,e=>e)]])]])),i=await fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+t},body:r}),o=j(j(j(j(j(j(j(await Sq(i),Je.object),e=>e.errors),Je.array),e=>e.at(0)),Je.object),e=>e.message),Je.string),s=i.ok;return void 0!==o?{TAG:"Error",_0:o}:s?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:"Could not switch role"}}catch(r){return{TAG:"Error",_0:iP(rP(F(r)))}}}function Cq(e){try{return function(e,t){if("string"!=typeof e)throw new ZO("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new ZO(`Invalid token specified: missing part #${n+1}`);let i;try{i=eP(r)}catch(bU){throw new ZO(`Invalid token specified: invalid base64 for part #${n+1} (${bU.message})`)}try{return JSON.parse(i)}catch(bU){throw new ZO(`Invalid token specified: invalid json for part #${n+1} (${bU.message})`)}}(e)}catch(t){return}}function Aq(e){let t=e.IdToken;if(void 0===t)return;let n=Cq(t);if(void 0===n)return;let r=e.ExpiresIn,i=void 0!==r?Date.now()+1e3*r:void 0;return{token:t,identity:xq(n),refreshToken:e.RefreshToken,expiresAt:i}}async function Nq(e,t,n,r){try{let i=new dq({region:t}),o=new fq({ClientId:e,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:Object.fromEntries([["REFRESH_TOKEN",n]])}),s=(await i.send(o)).AuthenticationResult;if(void 0===s)return{TAG:"Error",_0:"Cognito refresh returned no tokens"};let a=s.IdToken;if(void 0===a)return{TAG:"Error",_0:"Cognito refresh missing IdToken"};let l=U(z(Cq(a),xq),r),c=s.ExpiresIn,u=void 0!==c?Date.now()+1e3*c:void 0,d=s.RefreshToken;return{TAG:"Ok",_0:{token:a,identity:l,refreshToken:void 0!==d?d:n,expiresAt:u}}}catch(i){return{TAG:"Error",_0:iP(rP(F(i)))}}}let Tq=l(void 0),Rq=Tq.Provider;let Dq=function(e){let t=e.storageKey,n=e.region,r=e.cognitoClientId,i=e.apiEndpoint,o=e.authMode,l=void 0!==t?t:"reventless.auth.v1",u=s(()=>function(e){let t=localStorage.getItem(e);if(null!=t)try{let e=JSON.parse(t),n=Je.object(e);if(void 0===n)return;let r=j(n.token,Je.string),i=n.identity,o=j(n.refreshToken,Je.string),s=j(n.expiresAt,Je.float);return void 0!==r&&void 0!==i?z(Je.object(i),e=>({token:r,identity:yq(e),refreshToken:o,expiresAt:s})):void 0}catch(n){return}}(l)),d=u[1],f=u[0];a(()=>{if(void 0===f)return;let e=f.refreshToken;if(void 0===e)return;let t=f.expiresAt;if(void 0===t)return;let i=f.identity;switch(o){case"Anonymous":case"Local":return;case"Cognito":if(void 0===r)return;if(void 0===n)return;let o=Math.max(0,t-Date.now()-3e5),s=setTimeout(()=>{Nq(r,n,e,i).then(e=>{if("Ok"===e.TAG){let t=e._0;return bq(l,t),d(e=>t)}localStorage.removeItem(l),d(e=>{})})},o);return()=>{clearTimeout(s)}}},[f,o,r,n]);let h=z(f,e=>e.identity),p=$(f),g=function(e){switch(e){case"Anonymous":return!1;case"Local":case"Cognito":return!0}}(o),m={identity:h,isAuthenticated:p,login:async(e,t)=>{try{let s=0;switch(o){case"Anonymous":case"Local":s=1;break;case"Cognito":if(void 0===r)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};if(void 0===n)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};let i=await async function(e,t,n,r){try{let i=new dq({region:t}),o=new fq({ClientId:e,AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:Object.fromEntries([["USERNAME",n],["PASSWORD",r]])}),s=j((await i.send(o)).AuthenticationResult,Aq);return void 0!==s?{TAG:"Ok",_0:s}:{TAG:"Error",_0:"Cognito returned no usable tokens"}}catch(i){return{TAG:"Error",_0:iP(rP(F(i)))}}}(r,n,e,t);if("Ok"!==i.TAG)return{TAG:"LoginErr",_0:i._0};let o=i._0;return bq(l,o),d(e=>o),"LoginOk"}if(1===s){if(void 0===i)return{TAG:"LoginErr",_0:"Local auth mode requires an apiEndpoint"};let n=await fetch(function(e){return(e.endsWith("/graphql")?e.slice(0,e.length-8|0):e)+"/__inmemory/login"}(i),{method:"POST",headers:{"content-type":"application/json"},body:U(JSON.stringify({username:e,password:t}),"")}),r=await Sq(n);if(n.ok){let e=j(r,Je.object);if(void 0===e)return{TAG:"LoginErr",_0:"Malformed login response"};let t=j(e.token,Je.string),n=j(e.identity,Je.object);if(void 0===t)return{TAG:"LoginErr",_0:"Malformed login response"};if(void 0===n)return{TAG:"LoginErr",_0:"Malformed login response"};let i={token:t,identity:yq(n),refreshToken:void 0,expiresAt:void 0};return bq(l,i),d(e=>i),"LoginOk"}let o=U(j(j(j(r,Je.object),e=>e.error),Je.string),wq(n,"Login failed"));return{TAG:"LoginErr",_0:o}}}catch(s){return{TAG:"LoginErr",_0:iP(rP(F(s)))}}},switchRole:async e=>{try{let t=0;switch(o){case"Anonymous":case"Local":t=1;break;case"Cognito":if(void 0===f)return{TAG:"LoginErr",_0:"Not signed in"};let o=f.refreshToken;if(void 0===i)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===r)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===n)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===o)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};let s=await kq(i,f.token,e);if("Ok"!==s.TAG)return{TAG:"LoginErr",_0:s._0};let a=await Nq(r,n,o,f.identity),c=0;if("Ok"===a.TAG){let t=a._0;if(vt(t.identity.activeRole,e))return bq(l,t),sessionStorage.setItem(hq,"1"),d(e=>t),"LoginOk";c=2}else c=2;if(2===c)return await kq(i,f.token,f.identity.activeRole),"Ok"===a.TAG?{TAG:"LoginErr",_0:"The server did not narrow this session to that role"}:{TAG:"LoginErr",_0:a._0}}if(1===t){if(void 0===i)return{TAG:"LoginErr",_0:"Local auth mode requires an apiEndpoint"};if(void 0===f)return{TAG:"LoginErr",_0:"Not signed in"};let t=await fetch(function(e){return(e.endsWith("/graphql")?e.slice(0,e.length-8|0):e)+"/__inmemory/switch-role"}(i),{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+f.token},body:Eq(e)}),n=await Sq(t);if(!t.ok)return{TAG:"LoginErr",_0:U(j(j(j(n,Je.object),e=>e.error),Je.string),wq(t,"Could not switch role"))};let r=j(n,Je.object);if(void 0===r)return{TAG:"LoginErr",_0:"Malformed switch response"};let o=j(r.token,Je.string),s=j(r.identity,Je.object);if(void 0===o)return{TAG:"LoginErr",_0:"Malformed switch response"};if(void 0===s)return{TAG:"LoginErr",_0:"Malformed switch response"};let a={token:o,identity:yq(s),refreshToken:void 0,expiresAt:void 0};return bq(l,a),sessionStorage.setItem(hq,"1"),d(e=>a),"LoginOk"}}catch(t){let e=F(t);return console.error("[AuthProvider] switchRole threw; session left as it was",e),{TAG:"LoginErr",_0:"Could not switch role. You are still acting as the role you had."}}},canSwitchRoles:g,logout:()=>{localStorage.removeItem(l),d(e=>{})},getToken:()=>z(f,e=>e.token)};return c(Rq,{value:m,children:e.children})};function Iq(){return d(Tq)}function Fq(e){let t=globalThis.window;if(null!=t)try{return R(t.matchMedia(e))}catch(n){return}}function Oq(e){let t=Fq(e);if(void 0===t)return!1;try{return D(t).matches}catch(n){return!1}}function Pq(e){let t=s(()=>Oq(e)),n=t[1];return a(()=>{n(t=>Oq(e));let t=Fq(e);if(void 0===t)return;let r=D(t),i=()=>n(t=>Oq(e));try{return r.addEventListener("change",i),()=>{try{return void r.removeEventListener("change",i)}catch(e){return}}}catch(o){return}},[e]),t[0]}function Mq(){return{compact:Pq(At.compact),narrow:Pq(At.narrow),tight:Pq(At.tight)}}function Lq(e){return e.tight?"Tight":e.narrow?"Narrow":e.compact?"Compact":"Wide"}function zq(){return Lq(Mq())}let jq={background:"var("+_t.surface+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",display:"inline-flex",fontFamily:"var("+xt.fontFamily+")",fontSize:"var("+xt.sizeSm+")",fontWeight:"var("+xt.weightMedium+")",lineHeight:"1",padding:"0.375rem 0.75rem",borderRadius:"var("+St.md+")",alignItems:"center",gap:"0.375rem"},Uq={color:"var("+_t.textSecondary+")",fontSize:"0.625rem"},Bq={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",minWidth:"200px",padding:"0.75rem 1rem",position:"absolute",right:"0",top:"calc(100% + 0.5rem)",zIndex:"10",borderRadius:"var("+St.md+")",boxShadow:"var("+Et+")"},$q={background:"var("+_t.brandSubtle+")",color:"var("+_t.brand+")",display:"inline-block",fontSize:"var("+xt.sizeXs+")",marginRight:"0.25rem",marginBottom:"0.25rem",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"},qq={border:"none",borderTop:"1px solid var("+_t.borderSubtle+")",margin:"0.5rem 0"},Gq={background:"transparent",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"0.375rem 0.5rem",width:"100%",borderRadius:"var("+St.sm+")"},Vq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",letterSpacing:"0.04em",marginBottom:"0.25rem",textTransform:"uppercase"};let Kq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")"},Wq={color:"var("+_t.textSecondary+")",fontWeight:"var("+xt.weightNormal+")"},Hq={background:"transparent",border:"none",color:"var("+_t.textSecondary+")",cursor:"pointer",display:"block",fontFamily:"var("+xt.fontFamily+")",fontSize:"var("+xt.sizeSm+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+St.sm+")"},Jq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"},Xq={color:"var("+_t.error+")",fontSize:"var("+xt.sizeXs+")",marginTop:"0.25rem"},Qq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"};function Yq(e){let t=e.trim()[0];return void 0!==t&&""!==t.trim()?t.toUpperCase():"☺"}function Zq(e,t){if(!e)return[];let n=t.availableRoles;return 0!==n.length?n:t.groups}let eG=function(e){let t=Iq(),n=s(()=>!1),a=n[1],l=n[0],c=s(()=>!1),u=c[1],d=c[0],f=s(()=>{}),h=f[1],p=f[0],g=Pq(At.compact);if(void 0===t)return null;let m=t.identity;if(void 0===m)return null;let v,y=Zq(t.canSwitchRoles,m),_=function(e,t){let n=e.length;if(1!==n&&0!==n)return t.activeRole}(y,m),b=e=>{u(e=>!0),h(e=>{}),t.switchRole(e).then(e=>{if(u(e=>!1),"object"!=typeof e)return a(e=>!1);let t=e._0;h(e=>t)})};if(l){let e,n=m.staleRole,s=y.length;if(1!==s&&0!==s){let t=m.activeRole,n=m.activeRole;e=r(o,{children:[r("div",{children:[i("div",{children:"Acting as",style:Vq}),void 0!==t?null:i("div",{children:"All of them — choose one to narrow.",style:Jq}),y.map(e=>{let t=vt(m.activeRole,e);return r("button",{children:[e,t?i("span",{children:"✓",style:Kq}):null],"aria-checked":t?"true":"false",role:"radio",style:(n=t,{background:"transparent",border:"none",color:"var("+_t.textPrimary+")",cursor:n?"default":"pointer",display:"flex",fontSize:"var("+xt.sizeSm+")",fontWeight:"var("+(n?xt.weightMedium:xt.weightNormal)+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+St.sm+")",alignItems:"center",justifyContent:"space-between",gap:"0.75rem"}),disabled:d,onClick:n=>{if(!t)return b(e)}},e);var n})],"aria-label":"Acting as",role:"radiogroup"}),void 0!==n?r(o,{children:[i("hr",{style:qq}),i("button",{children:"Stop acting as one role",style:Hq,disabled:d,onClick:e=>b(void 0)})]}):null,void 0!==p?i("div",{children:p,style:Xq}):null]})}else e=null;v=r("div",{children:[i("div",{children:m.username,style:{fontSize:"var("+xt.sizeMd+")",fontWeight:"var("+xt.weightMedium+")",marginBottom:"0.25rem"}}),0!==m.groups.length&&y.length<=1?i("div",{children:m.groups.map(e=>i("span",{children:e,style:$q},e)),style:{marginBottom:"0.25rem"}}):null,void 0!==n?i("div",{children:n+" is no longer one of your roles, so you are acting as all of them.",style:Qq}):null,e,i("hr",{style:qq}),i("button",{children:"Sign out",style:Gq,onClick:e=>{a(e=>!1),t.logout()}})],style:Bq})}else v=null;return r("div",{children:[r("button",{children:[g?Yq(m.username):r(o,{children:[m.username,void 0!==_?i("span",{children:"· "+_,style:Wq}):null]}),i("span",{children:l?"▴":"▾",style:Uq})],"aria-label":void 0!==_?"Signed in as "+m.username+", acting as "+_:"Signed in as "+m.username,style:jq,onClick:e=>a(e=>!e)}),v],style:{position:"relative"}})},tG={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"360px",padding:"2rem",borderRadius:"var("+St.md+")"},nG={color:"var("+_t.textSecondary+")",display:"block",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.25rem"},rG={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",fontSize:"var("+xt.sizeMd+")",marginBottom:"1rem",padding:"0.5rem 0.75rem",width:"100%",borderRadius:"var("+St.sm+")",boxSizing:"border-box"};function iG(e){return{background:e?"var("+_t.textDisabled+")":"var("+_t.brand+")",border:"none",color:"var("+_t.textOnBrand+")",cursor:e?"not-allowed":"pointer",fontSize:"var("+xt.sizeMd+")",fontWeight:"var("+xt.weightMedium+")",padding:"0.625rem",width:"100%",borderRadius:"var("+St.sm+")"}}let oG={color:"var("+_t.error+")",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.75rem"};let sG=function(e){let t=Iq(),n=s(()=>""),o=n[1],a=n[0],l=s(()=>""),c=l[1],u=l[0],d=s(()=>{}),f=d[1],h=d[0],p=s(()=>!1),g=p[1],m=p[0];return r("div",{children:[i("h1",{children:"Sign in",style:{fontSize:"var("+xt.sizeXl+")",fontWeight:"var("+xt.weightBold+")",margin:"0 0 1.5rem"}}),r("form",{children:[i("label",{children:"Username",style:nG}),i("input",{style:rG,autoComplete:"username",autoFocus:!0,type:"text",value:a,onChange:e=>{let t=e.target.value;o(e=>t)}}),i("label",{children:"Password",style:nG}),i("input",{style:rG,autoComplete:"current-password",type:"password",value:u,onChange:e=>{let t=e.target.value;c(e=>t)}}),void 0!==h?i("div",{children:h,style:oG}):null,i("button",{children:m?"Signing in…":"Sign in",style:iG(m),disabled:m,type:"submit"})],onSubmit:e=>{e.preventDefault(),f(e=>{}),g(e=>!0),void 0!==t?ce(t.login(a,u).then(e=>{if(g(e=>!1),"object"!=typeof e)return;let t=e._0;f(e=>t)}),e=>(g(e=>!1),f(e=>"Unexpected error during sign-in"),Promise.resolve())):(f(e=>"Auth provider missing"),g(e=>!1),Promise.resolve())}})],style:tG})};let aG=function(e){let t=e.children,n=e.url,r=void 0!==n?n:"",i=void 0!==t?t:"No route matched!";return U(function(e,t){let n=Le(e,t);return"object"!=typeof n?void 0:T(n._0)}(e.routes,r),i)};let lG=function(e){let t=ee(d(Z).prefix,e.route);return i("a",{children:e.children,href:t,onClick:e=>{if(!e.defaultPrevented&&function(e){return!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}(e))return e.preventDefault(),J(t)}})},cG=l(void 0),uG=cG.Provider;let dG=function(e){let t=e.initialPages,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=s(()=>[]),a=o[1],l=r[0].concat(o[0]),u={register:e=>i(t=>t.concat(e)),deregister:e=>i(t=>t.filter(t=>t.fragmentId!==e)),setPluginPages:e=>a(t=>e),getPages:()=>l,getPage:e=>l.find(t=>t.fragmentId===e)};return c(uG,{value:u,children:e.children})};function fG(){let e=d(cG);return void 0!==e?e.getPages():[]}function hG(e){return!U(e.menuEntry.hidden,!1)}let pG=l({activeAccess:[],hasAccess:function(e){return!1}}),gG=pG.Provider;function mG(){return d(pG).hasAccess}let vG=function(e){let t=e.access,n={activeAccess:t,hasAccess:e=>t.some(t=>t===e)};return c(gG,{value:n,children:e.children})};function yG(e){return"var("+e+")"}let _G=co([gi("flex"),di("center"),ui("gap",yG(bt.sm)),ui("padding","6px var("+bt.sm+") 6px 14px"),ui("border-radius",yG(St.md)),ui("color",yG(_t.textDisabled)),ui("font-size",yG(xt.sizeSm)),pi("notAllowed"),Gi("none")]),bG=co([ui("font-size","14px"),yi(0)]),xG=co([vi(1),ui("font-weight",yG(xt.weightMedium))]),SG=co([ui("font-size",yG(xt.sizeXs)),ui("color",yG(_t.brand)),pi("pointer"),ui("text-decoration","none"),yi(0)]);let wG=function(e){return r("div",{children:[i("span",{children:"[locked]",className:bG}),i("span",{children:e.label,className:xG}),i("span",{children:"Upgrade",className:SG})],className:_G})};function EG(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r?0:n<r?-1:1}function kG(e,t){return e.menuEntry.sortOrder===t.menuEntry.sortOrder?EG(e.menuEntry.label,t.menuEntry.label):de(e.menuEntry.sortOrder,t.menuEntry.sortOrder)}function CG(e){return ge(e,999,(e,t)=>e<t.menuEntry.sortOrder?e:t.menuEntry.sortOrder)}function AG(e){return"var("+e+")"}let NG=co([gi("flex"),mi("column"),ui("gap","2px"),ui("padding","var("+bt.sm+")"),Wi("& a",[ui("text-decoration","none"),ui("color","inherit"),ui("display","block"),ui("outline-offset","2px")])]),TG=co([ui("color",AG(_t.textDisabled)),ui("font-size",AG(xt.sizeXs)),ui("font-weight",AG(xt.weightBold)),ui("letter-spacing","0.08em"),ui("text-transform","uppercase"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),Ti(to(12)),Ri(to(2))]),RG=co([Ui("relative"),gi("flex"),di("center"),ui("gap",AG(bt.sm)),ui("padding","6px var("+bt.sm+") 6px 14px"),ui("color",AG(_t.textSecondary)),ui("font-size",AG(xt.sizeMd)),ui("line-height","1.4"),pi("pointer"),ui("border-radius",AG(St.md)),ui("text-decoration","none"),ui("transition","background-color 140ms ease, color 140ms ease, transform 140ms ease"),Wi("&::before",[ui("content","''"),Ui("absolute"),ui("left","4px"),ui("top","50%"),ui("width","3px"),ui("height","0"),ui("border-radius",AG(St.full)),ui("background",AG(_t.brand)),ui("transform","translateY(-50%)"),ui("transition","height 160ms ease")]),Yi([ui("background",AG(_t.surfaceSubtle)),ui("color",AG(_t.textPrimary)),ui("transform","translateX(2px)")]),Hi("(prefers-reduced-motion: reduce)",[ui("transition","none"),Yi([ui("transform","none")]),Wi("&::before",[ui("transition","none")])])]),DG=co([ui("background",AG(_t.brandSubtle)),ui("color",AG(_t.textPrimary)),ui("font-weight",AG(xt.weightMedium)),Wi("&::before",[ui("height","56%")]),Yi([ui("background",AG(_t.brandSubtle)),ui("color",AG(_t.textPrimary)),ui("transform","none")])]),IG=co([ui("font-size","14px"),ui("line-height","1"),yi(0)]),FG=co([ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),OG=co([ui("font-size","12px"),ui("color",AG(_t.textDisabled)),Ai("auto"),yi(0)]);function PG(e,t){let n=e.url;return void 0!==n&&(n===t||t.startsWith(n+"/"))}function MG(e){let t=e.onNavigate,n=e.hasAccess,s=e.isActive,a=e.page,l=L(a.requiredAccess,!1,e=>!n(e)),c=s?RG+" "+DG:RG,u=r(o,{children:[L(a.menuEntry.icon,null,e=>i("span",{children:e,"aria-hidden":!0,className:IG})),i("span",{children:a.menuEntry.label,className:FG}),l?i("span",{children:"[locked]",className:OG}):null]}),d=a.url;return l||void 0===d?i("div",{children:u,className:c,role:"button"}):i(lG,{route:d,children:i("span",{children:u,"aria-current":s?"page":void 0,className:c,onClick:e=>t()})})}function LG(e){let t=e.onNavigate,n=e.hasAccess,s=e.currentUrl,a=e.pages.toSorted(kG);return r(o,{children:[L(e.label,null,e=>i("div",{children:e,className:TG})),a.map(e=>i(MG,{page:e,isActive:PG(e,s),hasAccess:n,onNavigate:t},e.fragmentId))]})}let zG=function(e){let t=e.onNavigate,n=e.currentUrl,o=void 0!==t?t:()=>{},s=fG(),a=mG(),l=s.filter(hG),c={};l.forEach(e=>{let t=U(e.menuEntry.group,""),n=U(c[t],[]);c[t]=n.concat([e])});let u=U(c[""],[]),d=Object.entries(c).filter(e=>""!==e[0]).toSorted((e,t)=>{let n=CG(e[1]),r=CG(t[1]);return n===r?EG(e[0],t[0]):de(n,r)});return r("nav",{children:[0!==u.length?i(LG,{label:void 0,pages:u,currentUrl:n,hasAccess:a,onNavigate:o}):null,d.map(e=>{let t=e[1],r=e[0],s=function(e,t){return 0===e.length?"Absent":e.every(e=>{let n=e.requiredAccess;return void 0!==n&&!t(n)})?"Locked":"Active"}(t,a);switch(s){case"Active":return i(LG,{label:r,pages:t,currentUrl:n,hasAccess:a,onNavigate:o},r);case"Locked":return i(wG,{label:r},r);case"Absent":return null}})],"aria-label":"primary navigation",className:NG})},jG=l(void 0),UG=l(void 0),BG=jG.Provider,$G=UG.Provider;let qG=function(e){return c(BG,{value:e.target,children:c($G,{value:e.controlsTarget,children:e.children})})};function GG(){return d(jG)}function VG(e,t){return void 0!==e?w(t,D(e)):t}function KG(e){return"var("+e+")"}let WG="52px",HG=co([gi("flex"),mi("row"),bi({NAME:"vh",VAL:100}),ui("overflow","hidden"),ui("background",KG(_t.background)),ui("font-family",KG(xt.fontFamily)),ui("color",KG(_t.textPrimary))]),JG=co([gi("flex"),mi("column"),ui("width","236px"),yi(0),ui("background",KG(_t.surface)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden"),Hi(At.compact,[Ui("fixed"),qi(to(0)),Si(to(0)),hi(to(0)),ui("width","min(268px, 82vw)"),ui("z-index","950"),ui("box-shadow",KG(kt)),ui("transform","translateX(-100%)"),ui("visibility","hidden"),ui("transition","transform 180ms ease, visibility 0s linear 180ms")]),Hi("(prefers-reduced-motion: reduce)",[ui("transition","none")])]),XG=uo([JG,co([Hi(At.compact,[ui("transform","translateX(0)"),ui("visibility","visible"),ui("transition","transform 180ms ease, visibility 0s linear 0s")])])]),QG=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.45)"),ui("z-index","900"),ui("display","none"),Hi(At.compact,[ui("display","block")])]),YG=co([ui("display","none"),Hi(At.compact,[ui("display","inline-flex")]),di("center"),xi("center"),ui("vertical-align","middle"),ui("margin-right",KG(bt.sm)),ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",KG(St.md)),ui("padding","2px var("+bt.sm+")"),ui("color",KG(_t.textSecondary)),ui("font-size",KG(xt.sizeMd)),ui("line-height","1.6"),pi("pointer"),Yi([ui("background",KG(_t.surfaceSubtle)),ui("color",KG(_t.textPrimary))])]),ZG=co([gi("flex"),di("center"),ui("gap",KG(bt.sm)),ui("height",WG),yi(0),ui("padding","0 var("+bt.md+")"),ui("color",KG(_t.textPrimary)),ui("font-size",KG(xt.sizeLg)),ui("font-weight",KG(xt.weightBold)),ui("letter-spacing","-0.01em")]),eV=co([ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),tV=co([vi(1),ui("overflow-y","auto"),ui("min-height","0")]),nV=co([gi("flex"),mi("column"),vi(1),ui("min-width","0"),ui("overflow","hidden")]),rV=co([gi("flex"),di("center"),ui("min-height",WG),yi(0),ui("padding","var("+bt.xs+") var("+bt.lg+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("background",KG(_t.surface))]),iV=co([ui("display","flow-root"),vi(1),ui("min-width","0")]),oV=co([ui("display","contents")]),sV=co([ui("float","right"),gi("flex"),di("center"),xi("flexEnd"),ui("flex-wrap","wrap"),ui("gap",KG(bt.sm)),ui("margin-left",KG(bt.md)),ui("max-width","100%"),Wi("& > *, & > ."+oV+" > *",[ui("min-width","0"),ui("max-width","100%")])]),aV=co([ui("display","block"),ui("min-width","0")]),lV=co([gi("flex"),mi("column"),vi(1),ui("overflow","auto"),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("background",KG(_t.background))]),cV="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])";let uV=function(e){let t=e.loading,n=e.routesReady,o=e.fallback,l=e.appName,c=void 0!==l?l:"Reventless",u=void 0!==o?o:"404 — Page not found",d=void 0===n||n,p=void 0!==t?t:null,g=le(),m=s(()=>{}),v=m[1],y=s(()=>{}),_=y[1],b=(e,t)=>{let n=null==t?void 0:T(t);return e(e=>void 0!==e&&null!=t&&D(e)===t?e:n)},x=s(()=>!1),S=x[1],w=x[0],E=Pq(At.compact),k=f(()=>S(e=>!1),[]),C=h(null),A=h(null),N=h(!1);return a(()=>{if(!w||E){if(w){N.current=!0;let e=A.current;return null!=e?(function(e){let t=Array.from(e.querySelectorAll(cV))[0];void 0===t||D(t).focus()}(e),function(e,t){let n=n=>{switch(n.key){case"Escape":return t();case"Tab":let r=Array.from(e.querySelectorAll(cV)),i=r.length;if(0===i)return void n.preventDefault();let o=r[0],s=r[i-1|0],a=document.activeElement,l=L(null==a?void 0:T(a),!1,t=>e.contains(t)),c=e=>null!=a&&void 0!==e&&a===D(e),u=l?n.shiftKey&&c(o)?s:!n.shiftKey&&c(s)?o:void 0:o;return void 0!==u?(n.preventDefault(),void D(u).focus()):void 0;default:return}};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}(e,k)):void 0}if(N.current&&(N.current=!1,E)){let e=C.current;null!=e&&e.focus()}}else S(e=>!1)},[w,E]),r("div",{children:[r("aside",{children:[r("div",{children:[L(e.logoUrl,null,e=>i("img",{style:{height:"22px"},alt:c,src:e})),i("span",{children:c,className:eV,title:c})],className:ZG}),i("div",{children:i(zG,{currentUrl:g,onNavigate:k}),className:tV})],ref:T(A),className:w?XG:JG,id:"rv-shell-nav"}),w?i("div",{"aria-hidden":!0,className:QG,onClick:e=>k()}):null,r("main",{children:[i("div",{children:r("div",{children:[r("div",{children:[i("div",{ref:T(e=>b(_,e)),className:oV}),U(e.headerSlot,null)],className:sV}),i("div",{children:i("button",{children:"☰",ref:T(C),"aria-label":w?"Close navigation":"Open navigation","aria-expanded":w,"aria-controls":"rv-shell-nav",className:YG,onClick:e=>S(e=>!e)}),ref:T(e=>b(v,e)),className:aV})],className:iV}),className:rV}),i("div",{children:i(qG,{target:m[0],controlsTarget:y[0],children:d?i(aG,{url:g,routes:e.router,children:u}):p}),className:lV})],className:nV})],className:HG})},dV=l(void 0),fV=dV.Provider;let hV=function(e){let t=e.access,n=e.initialPanels,r=void 0!==n?n:[],i=void 0!==t?t:[],o=s(()=>r),a=o[1],l=s(()=>[]),u=l[1],d=o[0].concat(l[0]),f={register:e=>a(t=>t.concat(e)),deregister:e=>a(t=>t.filter(t=>t.extensionPackage!==e)),setPluginPanels:e=>u(t=>e),getPanel:e=>d.find(t=>t.fragmentId===e),getPanelsForPosition:e=>d.filter(t=>t.positions.some(t=>t===e)),hasAccess:e=>i.some(t=>t===e)};return c(fV,{value:f,children:e.children})};function pV(e){return"/"+e.environment+"/"+e.platformName}function gV(e){let t=e.split("?")[0],n=t.split("/").filter(e=>""!==e),r=n[0],i=n[1];if(void 0===r)return;if(void 0===i)return;let o={environment:r,platformName:i},s=pV(o),a=t.startsWith(s)?t.slice(s.length):"/";return[o,""===a?"/":a]}let mV=l(void 0).Provider;let vV=function(e){return c(mV,{value:e.scope,children:e.children})};let yV=l(void 0),_V=l({routes:[],publicLinks:{}}),bV=l(!1),xV=yV.Provider;function SV(e){return c(xV,{value:e.value,children:e.children})}let wV=_V.Provider;function EV(e){return c(wV,{value:e.value,children:e.children})}let kV=bV.Provider;function CV(e){return c(kV,{value:e.value,children:e.children})}let AV=function(e){let t=s(()=>({routes:[],publicLinks:{}})),n=t[1],r=t[0],o=s(()=>({routes:[],publicLinks:{}})),a=o[1],l=o[0],c=s(()=>!1),u=c[1],d=r.routes.concat(l.routes),f=qe(r.publicLinks,l.publicLinks),h={routes:d,publicLinks:f},p={register:(e,t)=>n(n=>({routes:n.routes.concat(e),publicLinks:qe(n.publicLinks,t)})),setPluginRoutes:(e,t)=>{a(n=>({routes:e,publicLinks:t})),u(e=>!0)}};return i(SV,{value:p,children:i(CV,{value:c[0],children:i(EV,{value:h,children:i(Ke,{registry:f,children:e.children})})})})};function NV(){return d(yV)}function TV(e){return"var("+e+")"}let RV=co([ui("position","relative"),gi("inlineFlex")]),DV=co([gi("inlineFlex"),di("center"),ui("gap","3px"),ui("background",TV(_t.surface)),ui("color",TV(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",TV(St.md)),ui("padding","2px var("+bt.xs+")"),ui("font-family",TV(xt.fontFamily)),ui("font-size",TV(xt.sizeMd)),ui("line-height","1.4"),pi("pointer"),Yi([ui("background",TV(_t.surfaceSubtle))])]),IV=co([ui("font-size","0.625rem"),ui("color",TV(_t.textSecondary))]),FV=co([ui("position","absolute"),ui("top","calc(100% + 0.5rem)"),ui("right","0"),ui("min-width","170px"),ui("padding",TV(bt.xs)),ui("background",TV(_t.surfaceElevated)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",TV(St.md)),ui("box-shadow",TV(Et)),ui("z-index","10")]),OV=co([gi("flex"),di("center"),ui("gap",TV(bt.sm)),ui("width","100%"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("background","transparent"),ui("border","none"),ui("border-radius",TV(St.sm)),ui("color",TV(_t.textPrimary)),ui("font-family",TV(xt.fontFamily)),ui("font-size",TV(xt.sizeSm)),ui("text-align","left"),pi("pointer"),Yi([ui("background",TV(_t.surfaceSubtle))])]),PV=uo([OV,co([ui("font-weight",TV(xt.weightMedium))])]),MV=co([ui("font-size",TV(xt.sizeMd)),ui("line-height","1"),ui("width","1.25em"),ui("text-align","center"),yi(0)]),LV=co([ui("margin-left","auto"),ui("color",TV(_t.textSecondary)),ui("font-size",TV(xt.sizeXs))]);function zV(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"High contrast"}}function jV(e){switch(e){case"Dark":return"☾";case"Light":return"☀";case"Neutral":return"◯";case"HighContrast":return"◐"}}let UV=["Light","Dark","Neutral","HighContrast"];let BV=function(e){let t=nO(),n=t.setPreset,o=t.preset,l=s(()=>!1),c=l[1],u=l[0],d=h(null);return a(()=>{if(!u)return;let e=e=>{let t=e.target,n=d.current;if(null!=n&&!function(e,t){return e.contains(t)}(n,t))return c(e=>!1)},t=e=>{if("Escape"===e.key)return c(e=>!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u]),r("div",{children:[r("button",{children:[i("span",{children:jV(o),"aria-hidden":!0}),i("span",{children:u?"▴":"▾","aria-hidden":!0,className:IV})],"aria-label":"Theme: "+zV(o),"aria-expanded":u,"aria-haspopup":"menu",className:DV,title:"Theme: "+zV(o),onClick:e=>c(e=>!e)}),u?i("div",{children:UV.map(e=>{let t=e===o;return r("button",{children:[i("span",{children:jV(e),"aria-hidden":!0,className:MV}),zV(e),t?i("span",{children:"✓",className:LV}):null],"aria-checked":t?"true":"false",className:t?PV:OV,role:"radio",onClick:t=>{n(e),c(e=>!1)}},oO(e))}),"aria-label":"Theme",className:FV,role:"radiogroup"}):null],ref:T(d),className:RV})};function $V(e){return Object.fromEntries([["eq",e]])}let qV=/\$filter\s*:\s*[A-Za-z0-9_]*Filter\b/,GV=/\$filter\s*:/,VV={};function KV(e){return t=>(n,r)=>qV.test(n)?t(n,function(e,t){let n=Je.object(e),r=void 0!==n?Object.fromEntries(Object.entries(n)):{},i=j(r.filter,Je.object),o=void 0!==i?Object.fromEntries(Object.entries(i)):{};return o.environment=$V(t.environment),o.platformName=$V(t.platformName),r.filter=o,r}(r,e)):(GV.test(n)&&function(e){void 0!==VV[e]||(VV[e]=!0,console.warn("PlatformFilter: this query declares a `$filter` variable that is not a fleet-scope `<Type>Filter` input object, so it is left untouched. `$filter` is reserved for platform-scope injection in fleet mode — rename the variable (e.g. `$logFilter`) to avoid ambiguity. Query: "+e))}(n),t(n,r))}let WV={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"480px",padding:"2rem",borderRadius:"var("+St.md+")"},HV={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",display:"flex",fontSize:"var("+xt.sizeMd+")",marginBottom:"0.5rem",padding:"0.75rem 1rem",textAlign:"left",width:"100%",borderRadius:"var("+St.sm+")",alignItems:"center",justifyContent:"space-between"},JV={background:"var("+_t.brandSubtle+")",color:"var("+_t.brand+")",fontSize:"var("+xt.sizeXs+")",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"};let XV=function(e){let t,n=e.discover,o=NI(),l=s(()=>"Loading"),c=l[1],u=l[0];if(a(()=>{void 0!==o?(c(e=>"Loading"),ce(n(o).then(e=>c(t=>({TAG:"Loaded",_0:e}))),e=>{let t=U(j(function(e){if(e.RE_EXN_ID===I)return T(e._1)}(e),e=>e.message),"Platform discovery failed");return c(e=>({TAG:"Failed",_0:t})),Promise.resolve()})):c(e=>({TAG:"Failed",_0:"PlatformPicker rendered outside AutoGraphQL.Provider"}))},[$(o)]),"object"!=typeof u)t=i("div",{children:"Discovering platforms…",style:{color:"var("+_t.textSecondary+")"}});else if("Loaded"===u.TAG){let e=u._0;t=0!==e.length?e.map(e=>r("button",{children:[e.platformName,i("span",{children:e.environment,style:JV})],style:HV,onClick:t=>J(pV(e)+"/")},e.environment+"/"+e.platformName)):i("div",{children:"No platforms discovered.",style:{color:"var("+_t.textSecondary+")"}})}else t=i("div",{children:u._0,style:{color:"var("+_t.error+")",fontSize:"var("+xt.sizeSm+")"}});return r("div",{children:[i("h1",{children:"Select a platform",style:{fontSize:"var("+xt.sizeXl+")",fontWeight:"var("+xt.weightBold+")",margin:"0 0 1.5rem"}}),t],style:WV})};function QV(e){return j(e,e=>""===e.trim()?void 0:e)}function YV(e,t,n,r,i){let o=void 0!==i&&i,s=j(r,e=>e.nav),a=o?QV(j(s,e=>e.scopedLabel)):void 0,l=void 0!==a?a:QV(j(s,e=>e.label));return{label:U(l,t),icon:void 0,group:U(QV(j(s,e=>e.group)),e),sortOrder:U(j(s,e=>e.order),n),hidden:j(s,e=>e.hidden)}}function ZV(e){return"query AuditTrail($entityId: ID, $eventTypes: [String!], $user: String, $timeFrom: String, $timeTo: String, $first: Int, $after: String) {\n "+e+"(\n filter: {entityId: $entityId, eventTypes: $eventTypes, user: $user, timeFrom: $timeFrom, timeTo: $timeTo}\n first: $first\n after: $after\n ) {\n edges {\n node {\n position\n eventType\n payload\n tags { key value }\n meta { user time correlationId causationId }\n recordedAt\n }\n cursor\n }\n pageInfo { hasNextPage endCursor }\n }\n}"}let eK={contents:[]};function tK(e){if(!eK.contents.includes(e))return eK.contents.push(e),void console.error('[AutoUI] View "'+e+'" opted into an audit trail but no event log could be resolved for it — the view declares no linked write side, so there is no `…EventHistory` field to query. Remove the audit hint, or check that the read model projects an aggregate or slice.')}function nK(e,t){return j(Xe(e,t),dt)}function rK(e){let t=U(ht(e),{}),n=U(j(Xe(t,"meta"),ht),{}),r=me(U(j(Xe(t,"tags"),pt),[]),e=>{let t=U(ht(e),{}),n=nK(t,"key"),r=nK(t,"value");if(void 0!==n&&void 0!==r)return[n,r]}),i=nK(t,"position"),o=nK(t,"eventType");if(void 0===i)return;if(void 0===o)return;let s=U(nK(n,"time"),U(nK(t,"recordedAt"),""));return{position:i,eventType:o,payload:U(Xe(t,"payload"),{}),tags:r,actor:nK(n,"user"),time:s,recordedAt:U(nK(t,"recordedAt"),s)}}function iK(e,t){return lt(e.startsWith(t)&&e.length>t.length?e.slice(t.length):e).toLowerCase()}function oK(e){let t={};return e.map(e=>{let n=JSON.stringify(Ze(Qe(t)),null,2);var r;return(r=e.payload,U(z(ht(r),Qe),[]).filter(e=>"TAG"!==e[0])).forEach(e=>{t[e[0]]=e[1]}),[n,JSON.stringify(Ze(Qe(t)),null,2)]})}function sK(e,t){let n=oK(e);return e.map((e,r)=>{let i=U(n[r],["",""]),o=L(e.tags[0],t,e=>t+" "+e[1]);return{id:e.position,verb:iK(e.eventType,t),subject:o,actor:U(e.actor,"System"),timestamp:e.time,before:i[0],after:i[1]}}).toReversed()}function aK(e){let t=[];return e.forEach(e=>M(e.actor,e=>t.includes(e)?void 0:void t.push(e))),t.toSorted(ue)}function lK(e){let t=[];return e.forEach(e=>t.includes(e.eventType)?void 0:void t.push(e.eventType)),t.toSorted(ue)}function cK(e){return"var("+e+")"}let uK=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",cK(bt.lg)),ui("padding",cK(bt.xxl)),Vi({NAME:"percent",VAL:100}),bi({NAME:"percent",VAL:100}),$i("center"),ui("min-height","400px")]),dK=co([ui("font-size","48px"),ui("line-height","1")]),fK=co([ui("color",cK(_t.textPrimary)),ui("font-size",cK(xt.sizeXxl)),ui("font-weight",cK(xt.weightBold)),ki(to(0))]),hK=co([ui("color",cK(_t.textSecondary)),ui("font-size",cK(xt.sizeLg)),ui("line-height",cK(xt.lineHeightRelaxed)),ui("max-width","480px"),ki(to(0))]),pK=co([ui("background",cK(_t.brand)),ui("color",cK(_t.textOnBrand)),ui("border-radius",cK(St.md)),ui("padding","var("+bt.sm+") var("+bt.lg+")"),ui("font-size",cK(xt.sizeMd)),ui("font-weight",cK(xt.weightMedium)),ui("border","none"),ui("cursor","pointer"),Ti(to(8))]);let gK=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:dK}),i("h2",{children:t.title,className:fK}),i("p",{children:L(t.requiredAccess,"This feature requires an upgrade.",e=>'This feature requires the "'+e+'" access tier.'),className:hK}),i("button",{children:"Upgrade to unlock",className:pK})],className:uK})};let mK=function(e){let t=e.children,n=e.definition,r=mG(),o=n.requiredAccess;return void 0===o||r(o)?t:i(gK,{definition:n})},vK=Xe;function yK(e,t){let n=j(t[0],t=>Xe(e,t));if(void 0!==n&&t.every(t=>vt(Xe(e,t),n)))return n}function _K(e,t,n){let r=Xe(e,t);return void 0===r||n(r)}function bK(e,t,n){return me(t,t=>{let r=Xe(e,t);if(void 0!==r&&!n(r))return t+': requires "'+r+'"'})}let xK=["body","text","message","comment","content"],SK=["author","createdby","user","commenter","postedby"],wK=["createdat","postedat","at","commentedat"];function EK(e){return me(Sa(e),e=>{if(ka(e[1]))return e[0]})}function kK(e,t){return EK(e).find(e=>t.includes(e.toLowerCase()))}function CK(e){let t=Ba(e,void 0,void 0),n=Sa(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:kK(e,SK)}function AK(e){return EK(e).filter(e=>{let t=e.toLowerCase();return"id"!==t&&t.endsWith("id")})}function NK(e,t){let n=tt(t).toLowerCase();return AK(e).find(e=>e.toLowerCase()===n+"id")}function TK(e,t){let n=e.toLowerCase(),r=t.toLowerCase(),i=tt(t).toLowerCase();return!!n.endsWith("comments")&&(n===i+"comments"||n===r+"comments")}let RK=["addcomment","postcomment","comment","writecomment","leavecomment"];function DK(e,t){let n=me(e.linkedWriteSide,e=>t.aggregates.find(t=>t.name===e)).map(e=>e.commands).flat();return e.commands.concat(n).find(e=>RK.some(t=>e.name.toLowerCase().startsWith(t)))}let IK={contents:[]};function FK(e,t){return me(e.readModels.filter(e=>e.name!==t&&(!!L(j(ht(e.schema),e=>Xe(e,"x-reventless-comments")),!1,e=>{let t=ut(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||TK(e.name,t))),n=>{let r=NK(n.schema,t),i=void 0!==r?r:TK(n.name,t)?function(e){let t=AK(e);return 1!==t.length?void 0:t[0]}(n.schema):void 0,o=kK(n.schema,xK);return void 0!==o?void 0!==i?{readModel:n,entityField:i,bodyField:o,authorField:CK(n.schema),timestampField:(s=n.schema,me(Sa(s),e=>{if(Ca(e[1]))return e[0]}).find(e=>wK.includes(e.toLowerCase()))),postCommand:DK(n,e)}:void 0:void function(e){if(!IK.contents.includes(e))IK.contents.push(e),console.error('[AutoUI] Read model "'+e+'" announces itself as comments but has no body field — no comment thread is wired. The convention expects a string field named '+xK.join(" | ")+' (plus an entity ref like "orderId"); see docs/guides/comments-read-model-convention.md.')}(n.name);var s})[0]}function OK(e,t){return j(Xe(e,t),dt)}function PK(e){return{filter:e.isId||e.isCompositeId||e.isSubId||e.isCompositeSubId||$(e.index)||e.scan,sort:e.isId||e.isSubId||e.isCompositeSubId||$(e.index)||e.scanSort}}function MK(e){return PK(e.ann)}function LK(e){let t=$(Ps(e)),n=0!==Os(e).length,r=0!==zs(e).length;return{search:t||n||r}}function zK(e){let t=U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[]),n=t.map(e=>PK(Is(e[1]))),r=n.some(e=>e.filter),i=n.some(e=>e.sort);return{hasFilter:r,hasSort:i,hasSearch:LK(e).search}}function jK(e,t){let n={},r={};return Qe(e).forEach(e=>{let i=e[1];if(""===i)return;let o=e[0],s=t.find(e=>e.key===o);if(void 0!==s){return void(PK(s.ann).filter?n[o]=i:r[o]=i)}r[o]=i}),[n,r]}function UK(e,t,n){if(void 0===e)return"NoSort";let r=n.find(t=>t.key===e);return void 0!==r?PK(r.ann).sort?{TAG:"ServerSort",_0:e,_1:t}:{TAG:"ClientSort",_0:e,_1:t}:"NoSort"}function BK(e,t,n,r){let i={};return n.search&&""!==t&&(i.search=t),Qe(e).forEach(e=>{let t,n=e[1],o=e[0],s=r.find(e=>e.key===o),a=z(s,e=>e.kind);if(void 0!==a&&"object"!=typeof a)switch(a){case"KBoolean":t="true"===n;break;case"KNumber":t=U(z(ra(n),e=>e),n);break;default:t=n}else t=n;i[o+"Eq"]=t}),0===Qe(i).length?void 0:i}let $K={contents:[]};function qK(e,t){return me(e.readModels.filter(e=>e.name!==t),e=>{let n=NK(e.schema,t);if(void 0!==n)return function(e,t){return L(Sa(e).find(e=>e[0]===t),!1,e=>PK(Is(e[1])).filter)}(e.schema,n)?{readModel:e,refField:n}:void function(e,t,n){let r=e+"."+t;if(!$K.contents.includes(r))$K.contents.push(r),console.error('[AutoUI] View "'+e+'" references "'+n+'" through "'+t+'", but the server cannot filter on that field — so "'+n+'" gets no "'+e+'" panel on its detail page. Annotate '+t+" with @index (or @scan, for a small view) on the read model's state so the connection gains a "+t+"Eq filter; see docs/guides/related-rows.md.")}(e.name,n,t)})}function GK(e){return"var("+e+")"}function VK(e){switch(e){case"Success":return _t.success;case"Warning":return _t.warning;case"Error":return _t.error;case"Info":return _t.info}}function KK(e){return co([gi("flex"),di("flexStart"),ui("gap",GK(bt.sm)),ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("border-radius",GK(St.md)),ui("border-left","3px solid var("+VK(e)+")"),ui("background",GK(_t.surfaceElevated)),ui("font-size",GK(xt.sizeMd)),ui("line-height",GK(xt.lineHeightNormal))])}let WK=co([vi(1)]),HK=co([ui("font-weight",GK(xt.weightMedium)),ui("color",GK(_t.textPrimary)),Ri(to(2))]),JK=co([ui("color",GK(_t.textSecondary))]),XK=co([ui("background","none"),no(to(0),"none",ao),pi("pointer"),ui("color",GK(_t.textSecondary)),ui("font-size","16px"),ui("line-height","1"),ui("padding","0"),yi(0)]);function QK(e){switch(e){case"Success":return"OK";case"Warning":return"!";case"Error":return"X";case"Info":return"i"}}let YK=function(e){let t=e.variant,n=void 0!==t?t:"Info";return r("div",{children:[i("span",{children:QK(n),className:(o=n,co([ui("color",GK(VK(o))),ui("font-size","16px"),yi(0),Ti(to(1))]))}),r("div",{children:[L(e.title,null,e=>i("div",{children:e,className:HK})),i("div",{children:e.message,className:JK})],className:WK}),L(e.onDismiss,null,e=>i("button",{children:"×","aria-label":"Dismiss",className:XK,onClick:t=>e()}))],className:KK(n),role:"alert"});var o};function ZK(e){return"var("+e+")"}let eW=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.5)"),gi("flex"),di("center"),xi("center"),ui("z-index","1000"),ui("backdrop-filter","blur(2px)")]),tW=co([ui("background",ZK(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",ZK(St.lg)),ui("box-shadow",ZK(kt)),gi("flex"),mi("column"),ui("max-height","90vh"),ui("max-width","90vw"),ui("min-width","400px"),ui("overflow","hidden")]),nW=co([gi("flex"),di("center"),xi("spaceBetween"),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),yi(0)]),rW=co([ui("color",ZK(_t.textPrimary)),ui("font-size",ZK(xt.sizeLg)),ui("font-weight",ZK(xt.weightMedium)),ki(to(0))]),iW=co([ui("background","none"),ui("border","none"),ui("cursor","pointer"),ui("color",ZK(_t.textSecondary)),ui("font-size","18px"),ui("padding","0"),ui("line-height","1"),Yi([ui("color",ZK(_t.textPrimary))])]),oW=co([ui("padding",ZK(bt.lg)),ui("overflow-y","auto"),vi(1)]),sW=co([gi("flex"),di("center"),xi("flexEnd"),ui("gap",ZK(bt.sm)),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("border-top","1px solid var("+_t.borderSubtle+")"),yi(0)]);let aW=function(e){let t=e.onClose,n=e.isOpen;return a(()=>{if(!n)return;let e=e=>{if("Escape"===e.key)return t()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n]),n?i("div",{children:r("div",{children:[r("div",{children:[i("h2",{children:e.title,className:rW}),i("button",{children:"x",className:iW,onClick:e=>t()})],className:nW}),i("div",{children:e.children,className:oW}),L(e.footer,null,e=>i("div",{children:e,className:sW}))],className:tW,style:L(e.width,{},e=>({width:e})),onClick:e=>{e.stopPropagation()}}),className:eW,onClick:e=>t()}):null};function lW(e){switch(e){case"Added":return"Added";case"BulkInvalidated":return"BulkInvalidated";case"Removed":return"Removed";case"Updated":return"Updated";default:return}}function cW(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}let uW="default";function dW(e,t,n,r,i){let o=void 0===n||n,s=xO(),l=function(e,t){let n=cW(e);return"object"!=typeof t?"/"+uW+"/"+n+"/*":"/"+uW+"/"+n+"/"+cW(t._0)}(e,t),c=h(r);a(()=>{c.current=r},[r]);let u=h(i);a(()=>{u.current=i},[i]);let d=h(void 0);a(()=>{if(o){if(void 0===s)return;let t=s.apiForReadModel(e),n={contents:void 0},r={contents:void 0},i=setTimeout(()=>{let e=s.subscribe(t,l,e=>{let t=function(e){let t=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=t.state,i=void 0!==r&&$(Je.object(r))?r:void 0,o=j(n("changeKind"),lW),s=n("id");return void 0!==o&&void 0!==s?{changeKind:o,id:s,sortKeyValue:n("sortKeyValue"),state:i,seq:n("seq")}:void 0}(e);if(void 0!==t)return c.current(t)});n.contents=e;let i=s.registerReconnect(t,()=>M(u.current,e=>e()));if(r.contents=i,vt(d.current,l))return d.current=void 0,M(u.current,e=>e())},100);return()=>{clearTimeout(i);let e=n.contents;void 0!==e&&e();let t=r.contents;if(void 0!==t)return t()}}d.current=l},[l,o,s])}function fW(e){return"var("+e+")"}let hW=co([gi("flex"),mi("column"),ui("gap",fW(bt.sm))]),pW=co([ui("overflow-x","auto")]),gW=co([ui("border-collapse","collapse"),ui("font-size",fW(xt.sizeSm)),ui("min-width","min-content")]),mW=[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("background",fW(_t.surfaceSubtle)),ui("white-space","nowrap"),ui("font-weight",fW(xt.weightMedium))],vW=co(mW.concat([ui("text-align","left"),ui("color",fW(_t.textSecondary))])),yW=co(mW.concat([ui("text-align","right"),ui("color",fW(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("font-size",fW(xt.sizeXs))])),_W=co(mW.concat([ui("text-align","left"),ui("color",fW(_t.textPrimary))]));let bW=co([gi("flex"),di("center"),ui("gap","6px"),ui("font-size",fW(xt.sizeXs)),ui("color",fW(_t.textSecondary))]);function xW(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<.12?.12:n>1?1:n}let SW=[.12,.35,.6,.85,1];let wW=function(e){let t=e.cells,n=e.colHeaders,o=function(e){return ge(e,0,(e,t)=>ge(t,e,(e,t)=>t.value>e?t.value:e))}(t);return r("div",{children:[i("div",{children:r("table",{children:[i("thead",{children:r("tr",{children:[i("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:vW,scope:"col"}),n.map(e=>i("th",{children:e.label,className:yW,scope:"col"},e.value))]})}),i("tbody",{children:e.rowHeaders.map((e,s)=>r("tr",{children:[i("th",{children:e.label,className:_W,scope:"row"}),n.map((n,r)=>{let a=U(j(t[s],e=>e[r]),{value:0,display:""});return i("td",{children:i("span",{children:a.display,title:e.label+" × "+n.label+": "+a.display}),className:(l=xW(a.value,o),co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("white-space","nowrap"),ui("background",l<=0?"transparent":"color-mix(in srgb, var("+_t.brand+") "+Math.round(100*l).toString()+"%, transparent)"),ui("color",fW(l>=.55?_t.textOnBrand:l<=0?_t.textDisabled:_t.textPrimary))]))},e.value+":"+n.value);var l})]},e.value))})],className:gW}),className:pW}),r("div",{children:["0",SW.map(e=>{return i("span",{className:(t=e,co([ui("width","18px"),ui("height","10px"),ui("background","color-mix(in srgb, var("+_t.brand+") "+Math.round(100*t).toString()+"%, transparent)"),ui("border","1px solid var("+_t.borderSubtle+")")]))},e.toString());var t}),e.maxLabel],className:bW})],className:hW})};function EW(e){let t=e.parent;if(void 0!==t&&""!==t)return t}function kW(e){let t={};e.forEach(e=>{t[e.key]=e});let n=e.length,r={},i=[],o={contents:0},s={contents:0};e.forEach(e=>{let a=EW(e);if(void 0!==a){if(void 0!==Xe(t,a)){if(function(e,t,n){let r=j(Xe(e,t),EW);if(void 0===r)return!1;if(r===t)return!0;{let i=r,o=0;for(;;){let r=o;if(r>n)return!0;let s=j(Xe(e,i),EW);if(void 0===s)return!1;if(s===t)return!0;o=r+1|0,i=s}}}(t,e.key,n))return s.contents=s.contents+1|0,void i.push(e.key);let o=U(Xe(r,a),[]);return void(r[a]=o.concat([e.key]))}return o.contents=o.contents+1|0,void i.push(e.key)}i.push(e.key)});let a=(e,i)=>{let o=Xe(t,e);if(void 0!==o)return{node:o,children:i>=n?[]:me(U(Xe(r,e),[]),e=>a(e,i+1|0))}};return{roots:me(i,e=>a(e,0)),detached:o.contents,cycles:s.contents}}function CW(e){return ge(e.children,e.children.length,(e,t)=>e+CW(t)|0)}function AW(e){return"var("+e+")"}let NW=co([gi("flex"),mi("column"),ui("gap",AW(bt.sm))]),TW=co([ui("overflow-x","auto"),ui("padding-bottom","4px")]),RW=co([gi("flex"),di("flexStart"),xi("center"),ui("gap",AW(bt.lg)),ui("min-width","min-content"),ui("padding","var("+bt.xs+") 0")]),DW=co([gi("flex"),mi("column"),di("center"),ui("min-width","min-content")]);let IW=co([ui("font-size",AW(xt.sizeSm)),ui("font-weight",AW(xt.weightMedium)),ui("color",AW(_t.textPrimary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),FW=co([ui("font-size",AW(xt.sizeXs)),ui("color",AW(_t.textSecondary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),OW=co([ui("margin-top","2px"),ui("padding","0 6px"),ui("border","1px solid var("+_t.border+")"),ui("border-radius","10px"),ui("background",AW(_t.surface)),ui("color",AW(_t.textSecondary)),ui("font-size",AW(xt.sizeXs)),ui("line-height","16px"),pi("pointer"),Yi([ui("color",AW(_t.textPrimary))])]),PW=co([ui("width","1px"),ui("height","14px"),ui("background",AW(_t.border))]),MW=co([gi("flex"),di("flexStart"),ui("min-width","min-content")]),LW=co([gi("flex"),mi("column"),di("center"),ui("min-width","min-content")]),zW=co([ui("padding","0 var("+bt.xs+")")]),jW=co([gi("flex"),ui("width","100%"),ui("height","1px")]);function UW(e){return co([ui("flex","1 1 50%"),ui("background",e?AW(_t.border):"transparent")])}let BW=co([ui("font-size",AW(xt.sizeXs)),ui("color",AW(_t.textDisabled))]),$W="var("+_t.brand+")",qW=function(e,t){let n=t=>{throw{RE_EXN_ID:"Undefined_recursive_module",_1:e,Error:new Error}},r=(e,t,i)=>{if("object"==typeof e){if("Module"!==e.TAG)return void(t[i]=e._0);let n=e._0,o={};t[i]=o;let s=n.length;for(let e=0;e<s;++e){let t=n[e];r(t[0],o,t[1])}return}switch(e){case"Function":case"Lazy":return void(t[i]=n);case"Class":return void(t[i]=[n,n,n,0])}},i={},o="dummy";return r(t,i,o),i[o]}(["OrgChart.res",255,4],{TAG:"Module",_0:[["Function","make"]]});!function(e,t,n){let r=(e,t,n,i,o)=>{if("object"==typeof e){if("Module"!==e.TAG)return;let i=e._0;for(let e=0,o=i.length;e<o;++e){let o=i[e],s=o[1];r(o[0],t[s],n[s],t,s)}return}switch(e){case"Function":return void(i[o]=n);case"Lazy":case"Class":return void Object.assign(t,n)}};if("object"!=typeof e)throw{RE_EXN_ID:"Assert_failure",_1:["Primitive_module.res",68,9],Error:new Error};{let i=e._0;for(let e=0,o=i.length;e<o;++e){let o=i[e],s=o[1];r(o[0],t[s],n[s],t,s)}}}({_0:[["Function","make"]]},qW,{make:function(e){let t=e.depth,n=e.tree,a=s(()=>!1),l=a[1],c=a[0],u=CW(n),d=n.children.length,f=n.node.subtitle;return r("div",{children:[r("button",{children:[i("span",{children:n.node.title,className:IW}),void 0!==f&&""!==f?i("span",{children:f,className:FW}):null],className:(h=U(n.node.accent,$W),co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","132px"),ui("max-width","180px"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-top","3px solid "+h),ui("border-radius",AW(St.md)),ui("background",AW(_t.surface)),ui("text-align","left"),pi("pointer"),Yi([ui("background",AW(_t.surfaceSubtle))])])),title:n.node.title,onClick:e=>M(n.node.onOpen,e=>e())}),0===d?null:r(o,{children:[i("button",{children:c?"+"+u.toString():"−","aria-expanded":!c,className:OW,title:c?"Expand":"Collapse",onClick:e=>l(e=>!e)}),c?null:r(o,{children:[i("div",{className:PW}),i("div",{children:n.children.map((e,n)=>r("div",{children:[r("div",{children:[i("div",{className:UW(n>0)}),i("div",{className:UW(n<(d-1|0))})],className:jW}),i("div",{className:PW}),i("div",{children:i(qW.make,{tree:e,depth:t+1|0}),className:zW})],className:LW},e.node.key)),className:MW})]})]})],className:DW});var h}});let GW=function(e){let t=kW(e.nodes);if(0===t.roots.length)return i(_o,{title:"Nothing to chart",description:"No rows in this window."});let n=me([e.windowNote,t.detached>0?t.detached.toString()+" item(s) whose parent is outside this window":void 0,t.cycles>0?t.cycles.toString()+" item(s) in a parent loop, shown as roots":void 0],e=>e);return r("div",{children:[i("div",{children:i("div",{children:t.roots.map(e=>i(qW.make,{tree:e,depth:0},e.node.key)),className:RW}),className:TW}),0===n.length?null:i("span",{children:n.join(" · "),className:BW})],className:NW})};function VW(e){return"var("+e+")"}let KW=co([Ui("relative"),ui("padding-left","28px"),gi("flex"),mi("column"),ui("gap",VW(bt.md))]),WW=co([Ui("absolute"),Si(to(7)),qi(to(8)),hi(to(0)),ui("width","2px"),ui("background",VW(_t.borderSubtle))]),HW=co([Ui("absolute"),Si(to(-21)),qi(to(6)),ui("width","10px"),ui("height","10px"),ui("border-radius","50%"),ui("background",VW(_t.brand)),ui("border","2px solid var("+_t.surface+")"),yi(0)]),JW=co([Ui("relative"),gi("flex"),mi("column"),ui("gap","2px")]),XW=uo([JW,co([ui("background","none"),ui("border","none"),ui("padding","0"),$i("left"),pi("pointer"),Yi([ui("opacity","0.85")])])]),QW=co([gi("flex"),di("center"),ui("gap",VW(bt.sm))]),YW=co([ui("color",VW(_t.textDisabled)),ui("font-size",VW(xt.sizeXs)),ui("font-family",VW(xt.fontFamilyMono))]),ZW=co([ui("color",VW(_t.textPrimary)),ui("font-size",VW(xt.sizeMd)),ui("font-weight",VW(xt.weightMedium))]),eH=co([ui("color",VW(_t.textSecondary)),ui("font-size",VW(xt.sizeSm)),ui("line-height",VW(xt.lineHeightNormal)),Ai(to(0))]);let tH=function(e){let t=e.onSelect,n=e=>r(o,{children:[i("div",{className:HW,style:z(e.accent,e=>({background:e}))}),r("div",{children:[i("span",{children:e.timestamp,className:YW}),L(e.variant,null,t=>i(Ss,{variant:t,label:e.label})),L(e.variant,i("span",{children:e.label,className:ZW}),e=>null)],className:QW}),L(e.detail,null,e=>i("div",{children:e,className:eH}))]});return r("div",{children:[i("div",{className:WW}),e.entries.map(e=>void 0!==t?i("button",{children:n(e),className:XW,type:"button",onClick:n=>t(e.id)},e.id):i("div",{children:n(e),className:JW},e.id))],className:KW})};function nH(e){let t=j(j(ht(e),e=>Ye(e)[0]),ht),n=j(j(t,e=>Xe(e,"__typename")),dt);if(void 0===n)return{TAG:"NotExecuted",_0:"The server did not confirm this command. It may not have been applied."};switch(n){case"CommandAccepted":return"Accepted";case"CommandPending":return"Pending";case"CommandRejected":return{TAG:"Rejected",_0:{errorCode:j(j(t,e=>Xe(e,"errorCode")),dt),detail:j(j(t,e=>Xe(e,"errorDetail")),dt)}};default:return{TAG:"NotExecuted",_0:"The server answered with an unexpected result type ("+n+")."}}}function rH(e){let t=nH(e.data);if("object"!=typeof t)return t;if("NotExecuted"!==t.TAG)return t;let n=t._0,r=e.errors[0];return void 0!==r&&""!==r.message?{TAG:"NotExecuted",_0:r.message}:{TAG:"NotExecuted",_0:n}}function iH(e,t){let n=Xe(e,t);if(void 0===n)return;let r=dt(n);return void 0!==r?r:j(j(ht(n),e=>Xe(e,"TAG")),dt)}function oH(e,t,n){if(void 0===n)return e;let r=iH(t,n);return e.filter(e=>{let t=e.allowedStates;return void 0===t||void 0!==r&&t.includes(r)})}function sH(e){let t=0|new Date(e).getMonth();return U(uc[t],"").slice(0,3)}function aH(e,t){switch(t){case"Days":return pc(e);case"Weeks":return hc(e).toString()+" "+sH(e);case"Months":let t=new Date(e).getFullYear().toString();return sH(e)+" '"+t.slice(2)}}function lH(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function cH(e){return e<0?0:e>100?100:e}function uH(e,t,n){let r=cH(lH(e.start,t,n)),i=cH(lH(e.end_>e.start?e.end_:e.start,t,n))-r,o=i<.6?.6:i;return[r+o>100?100-o:r,o]}function dH(e){return e.map(t=>me(t.dependsOn,n=>z(e.find(e=>e.key===n&&e.key!==t.key),e=>({from:e.key,to_:t.key,violated:t.start<e.end_})))).flat()}function fH(e){return dH(e).filter(e=>e.violated)}let hH="184px";function pH(e){return"var("+e+")"}let gH=co([gi("flex"),mi("column"),ui("gap",pH(bt.sm))]),mH=co([gi("flex"),di("center"),xi("spaceBetween"),_i("wrap"),ui("gap",pH(bt.sm))]),vH=co([gi("inlineFlex"),di("center"),ui("gap",pH(bt.xs))]),yH=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",pH(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",pH(_t.textSecondary)),ui("font-size",pH(xt.sizeSm)),pi("pointer"),Yi([ui("background",pH(_t.surfaceSubtle)),ui("color",pH(_t.textPrimary))])]),_H=uo([yH,co([ui("background",pH(_t.surfaceSubtle)),ui("color",pH(_t.textPrimary)),ui("font-weight",pH(xt.weightMedium))])]),bH=co([ui("font-size",pH(xt.sizeMd)),ui("font-weight",pH(xt.weightMedium)),ui("color",pH(_t.textPrimary))]),xH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",pH(St.md)),ui("overflow","hidden")]),SH=co([gi("flex"),di("stretch")]),wH=uo([SH,co([ui("background",pH(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")])]),EH=co([ui("flex","0 0 "+hH),ui("padding","4px var("+bt.sm+")"),ui("font-size",pH(xt.sizeXs)),ui("color",pH(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),kH=co([Ui("relative"),ui("flex","1 1 auto"),ui("height","22px"),ui("overflow","hidden")]),CH=co([Ui("absolute"),ui("top","4px"),ui("padding-left","3px"),ui("border-left","1px solid var("+_t.borderSubtle+")"),ui("font-size",pH(xt.sizeXs)),ui("color",pH(_t.textSecondary)),ui("white-space","nowrap"),ui("pointer-events","none")]),AH=co([Ui("relative")]),NH=uo([SH,co([ui("height",30..toString()+"px"),ui("border-top","1px solid var("+_t.borderSubtle+")")])]),TH=co([ui("flex","0 0 "+hH),gi("flex"),di("center"),ui("gap","4px"),ui("padding","0 var("+bt.sm+")"),ui("font-size",pH(xt.sizeSm)),ui("color",pH(_t.textPrimary)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden")]),RH=co([ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),DH=co([ui("color",pH(_t.warning)),ui("font-size",pH(xt.sizeXs)),ui("flex","0 0 auto")]),IH=co([Ui("relative"),ui("flex","1 1 auto")]),FH=co([Ui("absolute"),ui("top","0"),ui("bottom","0"),ui("width","1px"),ui("background",pH(_t.borderSubtle)),ui("opacity","0.6"),ui("pointer-events","none")]);let OH=co([ui("outline","2px solid var("+_t.warning+")"),ui("outline-offset","1px")]),PH=co([Ui("absolute"),ui("top","0"),ui("left",hH),ui("right","0"),ui("bottom","0"),ui("pointer-events","none")]),MH=co([ui("display","block"),ui("width","100%"),ui("height","100%")]),LH=co([ui("font-size",pH(xt.sizeXs)),ui("color",pH(_t.textDisabled))]),zH="var("+_t.brand+")";function jH(e){return(Math.round(100*e)/100).toString()}function UH(e,t){let n=ec(t,-1);return dc(e)===dc(n)?dc(e):dc(e)+" – "+dc(n)}function BH(e){let t=e.to_,n=e.from,r=e.tasks,o=e.edge,s=e=>r.findIndex(t=>t.key===e),a=s(o.from),l=s(o.to_),c=r[a],u=r[l];if(void 0===c)return null;if(void 0===u)return null;let d,f=uH(c,n,t),h=uH(u,n,t)[0],p=f[0]+f[1],g=30*a+15,m=30*l+15,v=o.violated?e.arrowBadId:e.arrowId;if(h>p){let e=cH((p+h)/2);d=[[p,g],[e,g],[e,m],[h,m]]}else{let e=cH(p+1.4),t=cH(h-1.4),n=(g+m)/2;d=[[p,g],[e,g],[e,n],[t,n],[t,m],[h,m]]}let y=o.violated?"var("+_t.warning+")":"var("+_t.border+")",_=d.length-2|0;return i("g",{children:d.map((e,t)=>{let n=d[t+1|0];return void 0!==n?i("line",{markerEnd:t===_?"url(#"+v+")":void 0,stroke:y,strokeWidth:"1.5",x1:jH(e[0])+"%",x2:jH(n[0])+"%",y1:jH(e[1]),y2:jH(n[1])},t.toString()):null})})}let $H=function(e){let t=e.initialGranularity,n=e.windowNote,o=e.tasks,a=m(),l=s(()=>t),c=l[1],u="rv-gantt-arrow-"+a,d="rv-gantt-arrow-bad-"+a,f=function(e){let t=e[0];if(void 0===t)return;let n=ge(e,t.start,(e,t)=>t.start<e?t.start:e),r=ge(e,t.end_,(e,t)=>t.end_>e?t.end_:e);return[Zl(n),ec(Zl(r),1)]}(o);if(void 0===f)return i(_o,{title:"Nothing scheduled",description:"No row in this window carries a start and end date."});let h,p=f[1],g=f[0],v=U(l[0],function(e,t){let n=(t-e)/mc;return n<=21?"Days":n<=120?"Weeks":"Months"}(g,p)),y=function(e,t,n){let r=t=>{switch(n){case"Days":return ec(Zl(e),t);case"Weeks":return ec(nc(e),7*t|0);case"Months":return tc(rc(e),t)}},i=[],o=0;for(;r(o)<t&&o<2e3;){let t=r(o);t>=e&&i.push(t),o=o+1|0}let s=i.length,a=s<=40?1:1+(s/40|0)|0;return ve(i,(e,t)=>{if(0===fe(t,a))return[e,aH(e,n)]})}(g,p,v),_=dH(o),b=function(e){return ge(e,0,(t,n)=>t+n.dependsOn.filter(t=>!e.some(e=>e.key===t)).length|0)}(o),x=fH(o).length,S=(e,t)=>i("button",{children:t,className:v===e?_H:yH,onClick:t=>c(t=>e)}),w=0;if(void 0!==n||0!==b||0!==x?w=1:h=null,1===w){let e=me([n,b>0?b.toString()+" dependency link(s) outside this window":void 0,x>0?x.toString()+" start(s) before a dependency ends":void 0],e=>e);h=i("span",{children:e.join(" · "),className:LH})}return r("div",{children:[r("div",{children:[i("span",{children:UH(g,p),className:bH}),r("div",{children:[S("Days","Days"),S("Weeks","Weeks"),S("Months","Months")],className:vH})],className:mH}),r("div",{children:[r("div",{children:[i("div",{children:"Task",className:EH}),i("div",{children:y.map(e=>{let t=e[0];return i("span",{children:e[1],className:CH,style:{left:jH(lH(t,g,p))+"%"}},t.toString())}),className:kH})],className:wH}),r("div",{children:[o.map(e=>{let t=uH(e,g,p),n=function(e,t){return fH(e).some(e=>e.to_===t)}(o,e.key),s=(a=U(e.accent,zH),co([Ui("absolute"),ui("top","5px"),ui("height",19..toString()+"px"),ui("border","none"),ui("border-radius",pH(St.sm)),ui("background",a),ui("padding","0"),pi("pointer"),Yi([ui("filter","brightness(1.12)")])]));var a;let l=n?s+" "+OH:s;return r("div",{children:[r("div",{children:[n?i("span",{children:"▲",className:DH,title:"Starts before a dependency ends"}):null,i("span",{children:e.title,className:RH,title:e.title})],className:TH}),r("div",{children:[y.map(e=>{let t=e[0];return i("div",{className:FH,style:{left:jH(lH(t,g,p))+"%"}},t.toString())}),i("button",{className:l,style:{left:jH(t[0])+"%",width:jH(t[1])+"%"},title:e.title+" · "+pc(e.start)+" → "+pc(e.end_),onClick:t=>e.onOpen()})],className:IH})],className:NH},e.key)}),i("div",{children:r("svg",{children:[r("defs",{children:[i("marker",{children:i("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+_t.border+")"}),id:u,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"}),i("marker",{children:i("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+_t.warning+")"}),id:d,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"})]}),_.map(e=>i(BH,{edge:e,tasks:o,from:g,to_:p,arrowId:u,arrowBadId:d},e.from+"->"+e.to_))],className:MH}),className:PH})],className:AH})],className:xH}),h],className:gH})};function qH(e){return"var("+e+")"}let GH=co([ui("overflow-x","auto")]),VH=co([ui("border-collapse","collapse"),ui("font-size",qH(xt.sizeSm)),ui("color",qH(_t.textPrimary)),ui("min-width","min-content")]),KH=[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("white-space","nowrap")],WH=co(KH),HH=co(KH.concat([ui("color",qH(_t.textDisabled))])),JH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","left"),ui("color",qH(_t.textSecondary)),ui("font-weight",qH(xt.weightMedium)),ui("white-space","nowrap")]),XH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("background",qH(_t.surfaceSubtle)),ui("color",qH(_t.textSecondary)),ui("font-weight",qH(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("font-size",qH(xt.sizeXs)),ui("white-space","nowrap")]),QH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","left"),ui("background",qH(_t.surfaceSubtle)),ui("color",qH(_t.textPrimary)),ui("font-weight",qH(xt.weightMedium)),ui("white-space","nowrap")]),YH=co(KH.concat([ui("font-weight",qH(xt.weightMedium))])),ZH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("background",qH(_t.surfaceSubtle)),ui("color",qH(_t.textSecondary)),ui("font-weight",qH(xt.weightMedium)),ui("white-space","nowrap")]),eJ="Total";let tJ=function(e){let t=e.colTotals,n=e.rowTotals,o=e.cells,s=e.colHeaders;return i("div",{children:r("table",{children:[i("thead",{children:r("tr",{children:[i("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:JH,scope:"col"}),s.map(e=>i("th",{children:e.label,className:XH,scope:"col"},e.value)),i("th",{children:eJ,className:ZH,scope:"col"})]})}),i("tbody",{children:e.rowHeaders.map((e,t)=>{let a=U(o[t],[]);return r("tr",{children:[i("th",{children:e.label,className:QH,scope:"row"}),s.map((e,t)=>{let n=U(a[t],{display:"",empty:!0});return i("td",{children:n.empty?"—":n.display,className:n.empty?HH:WH},e.value)}),i("td",{children:U(n[t],""),className:YH})]},e.value)})}),i("tfoot",{children:r("tr",{children:[i("th",{children:eJ,className:ZH,scope:"row"}),s.map((e,n)=>i("td",{children:U(t[n],""),className:YH},e.value)),i("td",{children:e.grandTotal,className:YH})]})})],className:VH}),className:GH})};let nJ=function(e){let t=e.label,n=e.size;return i(sR,{kind:"Media",size:void 0!==n?n:"Detail",label:void 0!==t?t:"No image"})};function rJ(e){return"var("+e+")"}let iJ=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ui("gap",rJ(bt.md))]),oJ=co([gi("flex"),mi("column"),di("stretch"),ui("gap",rJ(bt.xs)),ui("padding","0"),ui("background","none"),ui("border","none"),ui("text-align","left"),pi("pointer"),Yi([ui("opacity","0.88")])]),sJ=co([ui("width","100%"),ui("aspect-ratio","4 / 3"),ui("object-fit","cover"),ui("background",rJ(_t.surfaceSubtle)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",rJ(St.md))]),aJ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",rJ(bt.sm))]),lJ=co([ui("color",rJ(_t.textPrimary)),ui("font-size",rJ(xt.sizeSm)),ui("font-weight",rJ(xt.weightMedium)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),cJ=co([ui("color",rJ(_t.textSecondary)),ui("font-size",rJ(xt.sizeXs)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),uJ=co([ui("background","rgba(255,255,255,0.12)"),ui("border","1px solid rgba(255,255,255,0.25)"),ui("border-radius",rJ(St.md)),ui("color","#f5f5f5"),ui("padding","4px var("+bt.sm+")"),ui("font-size",rJ(xt.sizeSm)),pi("pointer"),Yi([ui("background","rgba(255,255,255,0.22)")])]),dJ=co([ui("color",rJ(_t.textDisabled)),ui("font-size",rJ(xt.sizeSm))]);let fJ=function(e){let t,n=e.onOpen,a=e.items,l=s(()=>{}),c=l[1],u=l[0],d=function(e){return me(e,e=>z(e.src,t=>({key:e.key,src:t,title:e.title,caption:e.caption})))}(a);if(0===a.length)return i("span",{children:"(empty)",className:dJ});if(void 0!==u){let e=j(n,e=>z(d[u],t=>i("button",{children:"Open record →",className:uJ,type:"button",onClick:n=>{c(e=>{}),e(t.key)}})));t=i(Yl,{slides:d,index:u,onIndexChange:e=>c(t=>e),onClose:()=>c(e=>{}),action:e})}else t=null;return r(o,{children:[i("div",{children:a.map(e=>{let t=e.src,o=e.onUpload,s=e.caption;return r("button",{children:[void 0!==t?i("img",{className:sJ,alt:e.title,src:t}):i(nJ,void 0!==o?{size:"Tile",label:"Add image"}:{size:"Tile"}),r("div",{children:[i("span",{children:e.title,className:lJ}),U(e.badge,null)],className:aJ}),void 0!==s?i("span",{children:s,className:cJ}):null],className:oJ,title:q(e.src)&&$(e.onUpload)?"Add an image":e.title,type:"button",onClick:t=>{let r=e.src,i=e.onUpload;if(void 0===r)return void 0!==i?i():M(n,t=>t(e.key));let o=d.findIndex(t=>t.key===e.key);return-1!==o?c(e=>o):M(n,t=>t(e.key))}},e.key)}),className:iJ}),t]})};const hJ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function pJ(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function gJ(e){return"nodeType"in e}function mJ(e){var t,n;return e?pJ(e)?e:gJ(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function vJ(e){const{Document:t}=mJ(e);return e instanceof t}function yJ(e){return!pJ(e)&&e instanceof mJ(e).HTMLElement}function _J(e){return e instanceof mJ(e).SVGElement}function bJ(e){return e?pJ(e)?e.document:gJ(e)?vJ(e)?e:yJ(e)||_J(e)?e.ownerDocument:document:document:document}const xJ=hJ?v:a;function SJ(e){const t=h(e);return xJ(()=>{t.current=e}),f(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function wJ(e,t){void 0===t&&(t=[e]);const n=h(e);return xJ(()=>{n.current!==e&&(n.current=e)},t),n}function EJ(e,t){const n=h();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function kJ(e){const t=SJ(e),n=h(null),r=f(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function CJ(e){const t=h();return a(()=>{t.current=e},[e]),t.current}let AJ={};function NJ(e,t){return p(()=>{if(t)return t;const n=null==AJ[e]?0:AJ[e]+1;return AJ[e]=n,e+"-"+n},[e,t])}function TJ(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[i,o]of r){const n=t[i];null!=n&&(t[i]=n+e*o)}return t},{...t})}}const RJ=TJ(1),DJ=TJ(-1);function IJ(e){if(!e)return!1;const{KeyboardEvent:t}=mJ(e.target);return t&&e instanceof t}function FJ(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=mJ(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const OJ="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function PJ(e){return e.matches(OJ)?e:e.querySelector(OJ)}const MJ={display:"none"};function LJ(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:MJ},n)}function zJ(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return y.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const jJ=l(null);const UJ={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},BJ={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $J(e){let{announcements:t=BJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=UJ}=e;const{announce:o,announcement:l}=function(){const[e,t]=s(""),n=f(e=>{null!=e&&t(e)},[]);return{announce:n,announcement:e}}(),c=NJ("DndLiveRegion"),[u,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=d(jJ);a(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(p(()=>({onDragStart(e){let{active:n}=e;o(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&o(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;o(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;o(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;o(t.onDragCancel({active:n,over:r}))}}),[o,t])),!u)return null;const g=y.createElement(y.Fragment,null,y.createElement(LJ,{id:r,value:i.draggable}),y.createElement(zJ,{id:c,announcement:l}));return n?w(g,n):g}var qJ;function GJ(){}function VJ(e,t){return p(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(qJ||(qJ={}));const KJ=Object.freeze({x:0,y:0});function WJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function HJ(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const n=t.width*t.height,r=e.width*e.height,i=s*a;return Number((i/(n+r-i)).toFixed(4))}return 0}const JJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:e}=o,r=n.get(e);if(r){const n=HJ(r,t);n>0&&i.push({id:e,data:{droppableContainer:o,value:n}})}}return i.sort(WJ)};function XJ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:KJ}function QJ(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const YJ=QJ(1);const ZJ={ignoreTransform:!1};function eX(e,t){void 0===t&&(t=ZJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=mJ(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,t,r))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function tX(e){return eX(e,{ignoreTransform:!0})}function nX(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(vJ(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!yJ(i)||_J(i))return n;if(n.includes(i))return n;const o=mJ(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=mJ(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(i,o)&&n.push(i),function(e,t){return void 0===t&&(t=mJ(e).getComputedStyle(e)),"fixed"===t.position}(i,o)?n:r(i.parentNode)}(e):n}function rX(e){const[t]=nX(e,1);return null!=t?t:null}function iX(e){return hJ&&e?pJ(e)?e:gJ(e)?vJ(e)||e===bJ(e).scrollingElement?window:yJ(e)?e:null:null:null}function oX(e){return pJ(e)?e.scrollX:e.scrollLeft}function sX(e){return pJ(e)?e.scrollY:e.scrollTop}function aX(e){return{x:oX(e),y:sX(e)}}var lX;function cX(e){return!(!hJ||!e)&&e===document.scrollingElement}function uX(e){const t={x:0,y:0},n=cX(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(lX||(lX={}));const dX={x:.2,y:.2};function fX(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=dX);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=uX(e),h={x:0,y:0},p={x:0,y:0},g=t.height*i.y,m=t.width*i.x;return!c&&o<=t.top+g?(h.y=lX.Backward,p.y=r*Math.abs((t.top+g-o)/g)):!u&&l>=t.bottom-g&&(h.y=lX.Forward,p.y=r*Math.abs((t.bottom-g-l)/g)),!f&&a>=t.right-m?(h.x=lX.Forward,p.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=lX.Backward,p.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:p}}function hX(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function pX(e){return e.reduce((e,t)=>RJ(e,aX(t)),KJ)}const gX=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+oX(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+sX(t),0)}]];class mX{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=nX(t),r=pX(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of gX)for(const e of o)Object.defineProperty(this,e,{get:()=>{const t=s(n),o=r[i]-t;return this.rect[e]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vX{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function yX(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var _X,bX;function xX(e){e.preventDefault()}function SX(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(_X||(_X={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(bX||(bX={}));const wX={start:[bX.Space,bX.Enter],cancel:[bX.Esc],end:[bX.Space,bX.Enter,bX.Tab]},EX=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case bX.Right:return{...n,x:n.x+25};case bX.Left:return{...n,x:n.x-25};case bX.Down:return{...n,y:n.y+25};case bX.Up:return{...n,y:n.y-25}}};class kX{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new vX(bJ(t)),this.windowListeners=new vX(mJ(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_X.Resize,this.handleCancel),this.windowListeners.add(_X.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_X.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=eX),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);rX(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(KJ)}handleKeyDown(e){if(IJ(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=wX,coordinateGetter:o=EX,scrollBehavior:s="smooth"}=r,{code:a}=e;if(i.end.includes(a))return void this.handleEnd(e);if(i.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:KJ;this.referenceCoordinates||(this.referenceCoordinates=c);const u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=DJ(u,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:o,isRight:a,isLeft:l,isBottom:c,maxScroll:d,minScroll:f}=uX(n),h=hX(n),p={x:Math.min(i===bX.Right?h.right-h.width/2:h.right,Math.max(i===bX.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(i===bX.Down?h.bottom-h.height/2:h.bottom,Math.max(i===bX.Down?h.top:h.top+h.height/2,u.y))},g=i===bX.Right&&!a||i===bX.Left&&!l,m=i===bX.Down&&!c||i===bX.Up&&!o;if(g&&p.x!==u.x){const e=n.scrollLeft+t.x,o=i===bX.Right&&e<=d.x||i===bX.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=o?n.scrollLeft-e:i===bX.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&p.y!==u.y){const e=n.scrollTop+t.y,o=i===bX.Down&&e<=d.y||i===bX.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=o?n.scrollTop-e:i===bX.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,RJ(DJ(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function CX(e){return Boolean(e&&"distance"in e)}function AX(e){return Boolean(e&&"delay"in e)}kX.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=wX,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class NX{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=mJ(e);return e instanceof t?e:bJ(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:o}=i;this.props=e,this.events=t,this.document=bJ(o),this.documentListeners=new vX(this.document),this.listeners=new vX(n),this.windowListeners=new vX(mJ(o)),this.initialCoordinates=null!=(r=FJ(i))?r:KJ,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(_X.Resize,this.handleCancel),this.windowListeners.add(_X.DragStart,xX),this.windowListeners.add(_X.VisibilityChange,this.handleCancel),this.windowListeners.add(_X.ContextMenu,xX),this.documentListeners.add(_X.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(AX(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(CX(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(_X.Click,SX,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_X.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;const a=null!=(t=FJ(e))?t:KJ,l=DJ(r,a);if(!n&&s){if(CX(s)){if(null!=s.tolerance&&yX(l,s.tolerance))return this.handleCancel();if(yX(l,s.distance))return this.handleStart()}return AX(s)&&yX(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===bX.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const TX={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class RX extends NX{constructor(e){const{event:t}=e,n=bJ(t.target);super(e,TX,n)}}RX.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const DX={move:{name:"mousemove"},end:{name:"mouseup"}};var IX;!function(e){e[e.RightClick=2]="RightClick"}(IX||(IX={}));(class extends NX{constructor(e){super(e,DX,bJ(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==IX.RightClick&&(null==r||r({event:n}),!0)}}];const FX={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var OX,PX;function MX(e){let{acceleration:t,activator:n=OX.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:l=PX.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:g,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=CJ(t);return EJ(e=>{if(n||!r||!e)return LX;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[lX.Backward]:e.x[lX.Backward]||-1===i.x,[lX.Forward]:e.x[lX.Forward]||1===i.x},y:{[lX.Backward]:e.y[lX.Backward]||-1===i.y,[lX.Forward]:e.y[lX.Forward]||1===i.y}}},[n,t,r])}({delta:g,disabled:!o}),[y,_]=function(){const e=h(null);return[f((t,n)=>{e.current=setInterval(t,n)},[]),f(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=h({x:0,y:0}),x=h({x:0,y:0}),S=p(()=>{switch(n){case OX.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case OX.DraggableRect:return i}},[n,i,c]),w=h(null),E=f(()=>{const e=w.current;if(!e)return;const t=b.current.x*x.current.x,n=b.current.y*x.current.y;e.scrollBy(t,n)},[]),k=p(()=>l===PX.TreeOrder?[...u].reverse():u,[l,u]);a(()=>{if(o&&u.length&&S){for(const e of k){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),i=d[n];if(!i)continue;const{direction:o,speed:a}=fX(e,i,S,t,m);for(const e of["x","y"])v[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return _(),w.current=e,y(E,s),b.current=a,void(x.current=o)}b.current={x:0,y:0},x.current={x:0,y:0},_()}else _()},[t,E,r,_,o,s,JSON.stringify(S),JSON.stringify(v),y,u,k,d,JSON.stringify(m)])}(class extends NX{constructor(e){super(e,FX)}static setup(){return window.addEventListener(FX.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(FX.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return!(i.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(OX||(OX={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(PX||(PX={}));const LX={x:{[lX.Backward]:!1,[lX.Forward]:!1},y:{[lX.Backward]:!1,[lX.Forward]:!1}};var zX,jX;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(zX||(zX={})),function(e){e.Optimized="optimized"}(jX||(jX={}));const UX=new Map;function BX(e,t){return EJ(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function $X(e){let{callback:t,disabled:n}=e;const r=SJ(t),i=p(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function qX(e){return new mX(eX(e),e)}function GX(e,t,n){void 0===t&&(t=qX);const[r,i]=s(null);function o(){i(r=>{if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=r?r:n)?i:null;const o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o})}const l=function(e){let{callback:t,disabled:n}=e;const r=SJ(t),i=p(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),c=$X({callback:o});return xJ(()=>{o(),e?(null==c||c.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==l||l.disconnect())},[e]),r}const VX=[];function KX(e,t){void 0===t&&(t=[]);const n=h(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==KJ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?DJ(e,n.current):KJ}function WX(e){return p(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const HX=[];function JX(e){let{measure:t}=e;const[n,r]=s(null),i=f(e=>{for(const{target:n}of e)if(yJ(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),o=$X({callback:i}),a=f(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return yJ(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,c]=kJ(a);return p(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const XX=[{sensor:RX,options:{}},{sensor:kX,options:{}}],QX={current:{}},YX={draggable:{measure:tX},droppable:{measure:tX,strategy:zX.WhileDragging,frequency:jX.Optimized},dragOverlay:{measure:eX}};class ZX extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const eQ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ZX,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:GJ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:YX,measureDroppableContainers:GJ,windowRect:null,measuringScheduled:!1},tQ=l({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:GJ,draggableNodes:new Map,over:null,measureDroppableContainers:GJ}),nQ=l(eQ);function rQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ZX}}}function iQ(e,t){switch(t.type){case qJ.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qJ.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case qJ.DragEnd:case qJ.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qJ.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new ZX(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case qJ.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new ZX(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case qJ.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new ZX(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function oQ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=d(tQ),o=CJ(r),s=CJ(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&o&&null!=s){if(!IJ(o))return;if(document.activeElement===o.target)return;const e=i.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=PJ(e);if(t){t.focus();break}}})}},[r,t,i,s,o]),null}const sQ=l({...KJ,scaleX:1,scaleY:1});var aQ;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(aQ||(aQ={}));const lQ=_(function(e){var t,n,r,i;let{id:o,accessibility:l,autoScroll:c=!0,children:u,sensors:d=XX,collisionDetection:g=JJ,measuring:m,modifiers:v,..._}=e;const x=b(iQ,void 0,rQ),[S,w]=x,[k,C]=function(){const[e]=s(()=>new Set),t=f(t=>(e.add(t),()=>e.delete(t)),[e]);return[f(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[A,N]=s(aQ.Uninitialized),T=A===aQ.Initialized,{draggable:{active:R,nodes:D,translate:I},droppable:{containers:F}}=S,O=null!=R?D.get(R):null,P=h({initial:null,translated:null}),M=p(()=>{var e;return null!=R?{id:R,data:null!=(e=null==O?void 0:O.data)?e:QX,rect:P}:null},[R,O]),L=h(null),[z,j]=s(null),[U,B]=s(null),$=wJ(_,Object.values(_)),q=NJ("DndDescribedBy",o),G=p(()=>F.getEnabled(),[F]),V=function(e){return p(()=>({draggable:{...YX.draggable,...null==e?void 0:e.draggable},droppable:{...YX.droppable,...null==e?void 0:e.droppable},dragOverlay:{...YX.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(m),{droppableRects:K,measureDroppableContainers:W,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,l]=s(null),{frequency:c,measure:u,strategy:d}=i,p=h(e),g=function(){switch(d){case zX.Always:return!1;case zX.BeforeDragging:return n;default:return!n}}(),m=wJ(g),v=f(function(e){void 0===e&&(e=[]),m.current||l(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[m]),y=h(null),_=EJ(t=>{if(g&&!n)return UX;if(!t||t===UX||p.current!==e||null!=o){const t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new mX(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,n,g,u]);return a(()=>{p.current=e},[e]),a(()=>{g||v()},[n,g]),a(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),a(()=>{g||"number"!=typeof c||null!==y.current||(y.current=setTimeout(()=>{v(),y.current=null},c))},[c,g,v,...r]),{droppableRects:_,measureDroppableContainers:v,measuringScheduled:null!=o}}(G,{dragging:T,dependencies:[I.x,I.y],config:V.droppable}),J=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return EJ(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(D,R),X=p(()=>U?FJ(U):null,[U]),Q=function(){const e=!1===(null==z?void 0:z.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=T&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),Y=function(e,t){return BX(e,t)}(J,V.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=h(!1),{x:s,y:a}="boolean"==typeof i?{x:i,y:i}:i;xJ(()=>{if(!s&&!a||!t)return void(o.current=!1);if(o.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const i=XJ(n(e),r);if(s||(i.x=0),a||(i.y=0),o.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const t=rX(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,s,a,r,n])}({activeNode:null!=R?D.get(R):null,config:Q.layoutShiftCompensation,initialRect:Y,measure:V.draggable.measure});const Z=GX(J,V.draggable.measure,Y),ee=GX(J?J.parentElement:null),te=h({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=F.getNodeFor(null==(t=te.current.over)?void 0:t.id),re=JX({measure:V.dragOverlay.measure}),ie=null!=(n=re.nodeRef.current)?n:J,oe=T?null!=(r=re.rect)?r:Z:null,se=Boolean(re.nodeRef.current&&re.rect),ae=XJ(le=se?null:Z,BX(le));var le;const ce=WX(ie?mJ(ie):null),ue=function(e){const t=h(e),n=EJ(n=>e?n&&n!==VX&&e&&t.current&&e.parentNode===t.current.parentNode?n:nX(e):VX,[e]);return a(()=>{t.current=e},[e]),n}(T?null!=ne?ne:J:null),de=function(e,t){void 0===t&&(t=eX);const[n]=e,r=WX(n?mJ(n):null),[i,o]=s(HX);function a(){o(()=>e.length?e.map(e=>cX(e)?r:new mX(t(e),e)):HX)}const l=$X({callback:a});return xJ(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),i}(ue),fe=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(v,{transform:{x:I.x-ae.x,y:I.y-ae.y,scaleX:1,scaleY:1},activatorEvent:U,active:M,activeNodeRect:Z,containerNodeRect:ee,draggingNodeRect:oe,over:te.current.over,overlayNodeRect:re.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:ce}),he=X?RJ(X,I):null,pe=function(e){const[t,n]=s(null),r=h(e),i=f(e=>{const t=iX(e.target);t&&n(e=>e?(e.set(t,aX(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const s=e.map(e=>{const t=iX(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,aX(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=iX(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>RJ(e,t),KJ):pX(e):KJ,[e,t])}(ue),ge=KX(pe),me=KX(pe,[Z]),ve=RJ(fe,ge),ye=oe?YJ(oe,fe):null,_e=M&&ye?g({active:M,collisionRect:ye,droppableRects:K,droppableContainers:G,pointerCoordinates:he}):null,be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(_e,"id"),[xe,Se]=s(null),we=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(se?fe:RJ(fe,me),null!=(i=null==xe?void 0:xe.rect)?i:null,Z),Ee=h(null),ke=f((e,t)=>{let{sensor:n,options:r}=t;if(null==L.current)return;const i=D.get(L.current);if(!i)return;const o=e.nativeEvent,s=new n({active:L.current,activeNode:i,event:o,options:r,context:te,onAbort(e){if(!D.get(e))return;const{onDragAbort:t}=$.current,n={id:e};null==t||t(n),k({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!D.get(e))return;const{onDragPending:i}=$.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==i||i(o),k({type:"onDragPending",event:o})},onStart(e){const t=L.current;if(null==t)return;const n=D.get(t);if(!n)return;const{onDragStart:r}=$.current,i={activatorEvent:o,active:{id:t,data:n.data,rect:P}};E(()=>{null==r||r(i),N(aQ.Initializing),w({type:qJ.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:i}),j(Ee.current),B(o)})},onMove(e){w({type:qJ.DragMove,coordinates:e})},onEnd:a(qJ.DragEnd),onCancel:a(qJ.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=te.current;let s=null;if(t&&i){const{cancelDrop:a}=$.current;if(s={activatorEvent:o,active:t,collisions:n,delta:i,over:r},e===qJ.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=qJ.DragCancel)}}L.current=null,E(()=>{w({type:e}),N(aQ.Uninitialized),Se(null),j(null),B(null),Ee.current=null;const t=e===qJ.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=$.current[t];null==e||e(s),k({type:t,event:s})}})}}Ee.current=s},[D]),Ce=f((e,t)=>(n,r)=>{const i=n.nativeEvent,o=D.get(r);if(null!==L.current||!o||i.dndKit||i.defaultPrevented)return;const s={active:o};!0===e(n,t.options,s)&&(i.dndKit={capturedBy:t.sensor},L.current=r,ke(n,t))},[D,ke]),Ae=function(e,t){return p(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,Ce);!function(e){a(()=>{if(!hJ)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),xJ(()=>{Z&&A===aQ.Initializing&&N(aQ.Initialized)},[Z,A]),a(()=>{const{onDragMove:e}=$.current,{active:t,activatorEvent:n,collisions:r,over:i}=te.current;if(!t||!n)return;const o={active:t,activatorEvent:n,collisions:r,delta:{x:ve.x,y:ve.y},over:i};E(()=>{null==e||e(o),k({type:"onDragMove",event:o})})},[ve.x,ve.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=te.current;if(!e||null==L.current||!t||!i)return;const{onDragOver:o}=$.current,s=r.get(be),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:a};E(()=>{Se(a),null==o||o(l),k({type:"onDragOver",event:l})})},[be]),xJ(()=>{te.current={activatorEvent:U,active:M,activeNode:J,collisionRect:ye,collisions:_e,droppableRects:K,draggableNodes:D,draggingNode:ie,draggingNodeRect:oe,droppableContainers:F,over:xe,scrollableAncestors:ue,scrollAdjustedTranslate:ve},P.current={initial:oe,translated:ye}},[M,J,_e,ye,D,ie,oe,K,F,xe,ue,ve]),MX({...Q,delta:I,draggingRect:ye,pointerCoordinates:he,scrollableAncestors:ue,scrollableAncestorRects:de});const Ne=p(()=>({active:M,activeNode:J,activeNodeRect:Z,activatorEvent:U,collisions:_e,containerNodeRect:ee,dragOverlay:re,draggableNodes:D,droppableContainers:F,droppableRects:K,over:xe,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:V,measuringScheduled:H,windowRect:ce}),[M,J,Z,U,_e,ee,re,D,F,K,xe,W,ue,de,V,H,ce]),Te=p(()=>({activatorEvent:U,activators:Ae,active:M,activeNodeRect:Z,ariaDescribedById:{draggable:q},dispatch:w,draggableNodes:D,over:xe,measureDroppableContainers:W}),[U,Ae,M,Z,w,q,D,xe,W]);return y.createElement(jJ.Provider,{value:C},y.createElement(tQ.Provider,{value:Te},y.createElement(nQ.Provider,{value:Ne},y.createElement(sQ.Provider,{value:we},u)),y.createElement(oQ,{disabled:!1===(null==l?void 0:l.restoreFocus)})),y.createElement($J,{...l,hiddenTextDescribedById:q}))}),cQ=l(null),uQ="button";function dQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=NJ("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=d(tQ),{role:g=uQ,roleDescription:m="draggable",tabIndex:v=0}=null!=i?i:{},y=(null==l?void 0:l.id)===t,_=d(y?sQ:cQ),[b,x]=kJ(),[S,w]=kJ(),E=function(e,t){return p(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(s,t),k=wJ(n);xJ(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:S,data:k}),()=>{const e=f.get(t);e&&e.key===o&&f.delete(t)}),[f,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:p(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!y||g!==uQ)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,g,v,y,m,u.draggable]),isDragging:y,listeners:r?void 0:E,node:b,over:h,setNodeRef:x,setActivatorNodeRef:w,transform:_}}const fQ={timeout:25};function hQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=NJ("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=d(tQ),p=h({disabled:n}),g=h(!1),m=h(null),v=h(null),{disabled:y,updateMeasurementsFor:_,timeout:b}={...fQ,...i},x=wJ(null!=_?_:r),S=$X({callback:f(()=>{g.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),v.current=null},b)):g.current=!0},[b]),disabled:y||!s}),w=f((e,t)=>{S&&(t&&(S.unobserve(t),g.current=!1),e&&S.observe(e))},[S]),[E,k]=kJ(w),C=wJ(t);return a(()=>{S&&E.current&&(S.disconnect(),g.current=!1,S.observe(E.current))},[E,S]),a(()=>(l({type:qJ.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:m,data:C}}),()=>l({type:qJ.UnregisterDroppable,key:o,id:r})),[r]),a(()=>{n!==p.current.disabled&&(l({type:qJ.SetDroppableDisabled,id:r,key:o,disabled:n}),p.current.disabled=n)},[r,o,n,l]),{active:s,rect:m,isOver:(null==c?void 0:c.id)===r,node:E,over:c,setNodeRef:k}}function pQ(e,t){M(R(e.onPointerDown),e=>e(t))}function gQ(e,t){M(R(e.onKeyDown),e=>e(t))}function mQ(e){return z(null==e?void 0:T(e),e=>"translate3d("+e.x.toString()+"px, "+e.y.toString()+"px, 0)")}let vQ=[{bg:"#d1fae5",border:"#059669",fg:"#065f46"},{bg:"#fef3c7",border:"#d97706",fg:"#78350f"},{bg:"#ede9fe",border:"#7c3aed",fg:"#4c1d95"},{bg:"#ccfbf1",border:"#0d9488",fg:"#134e4a"},{bg:"#fce7f3",border:"#db2777",fg:"#831843"},{bg:"#ffedd5",border:"#ea580c",fg:"#7c2d12"},{bg:"#ecfccb",border:"#65a30d",fg:"#365314"}],yQ={bg:"#e2e8f0",border:"#64748b",fg:"#1e293b"};function _Q(e,t){let n=e.indexOf(t);return-1!==n?function(e){return e<0?yQ:vQ[fe(e,vQ.length)]}(n):yQ}let bQ={bg:"#dbeafe",border:"#2563eb",fg:"#1e3a8a"};function xQ(e){return"var("+e+")"}let SQ=[gi("inlineFlex"),di("center"),ui("gap","4px"),ui("font-size",xQ(xt.sizeXs)),ui("font-weight",xQ(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap")];function wQ(e,t){return co(SQ.concat([ui("background",e.bg),ui("border","1px solid "+e.border),ui("color",e.fg)]).concat(t))}function EQ(e){return wQ(e,[ui("padding","2px 8px"),ui("border-radius",xQ(St.full))])}let kQ=wQ(bQ,[ui("padding","2px 8px"),ui("border-radius",xQ(St.sm))]),CQ=co(SQ.concat([ui("padding","2px 0"),ui("color",xQ(_t.textSecondary)),ui("font-weight",xQ(xt.weightNormal)),ui("font-style","italic"),ui("border-bottom","1px dashed var("+_t.border+")")]));let AQ={make:function(e){let t=e.dot,n=e.swatch;return r("span",{children:[void 0===t||t?i("span",{style:(o=n,{background:o.border,display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",flexShrink:"0"})}):null,e.label],className:EQ(n)});var o}};let NQ={make:function(e){return i("span",{children:e.label,className:kQ})}};let TQ={make:function(e){let t=e.label;return i("span",{children:t,className:CQ,title:t+" — run by the platform, not callable"})}};function RQ(e){return"var("+e+")"}let DQ=co([gi("flex"),di("stretch"),ui("gap",RQ(bt.md)),ui("overflow-x","auto"),ui("padding-bottom",RQ(bt.sm))]),IQ=[gi("flex"),mi("column"),ui("gap",RQ(bt.sm)),ui("flex","0 0 240px"),ui("padding",RQ(bt.sm)),ui("background",RQ(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",RQ(St.md)),ui("min-height","120px")],FQ=co(IQ);let OQ=co([ui("border-color",RQ(_t.brand))]),PQ=co([Pi(.45)]),MQ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",RQ(bt.sm)),ui("font-size",RQ(xt.sizeSm)),ui("font-weight",RQ(xt.weightMedium)),ui("color",RQ(_t.textSecondary))]),LQ=co([ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),zQ=co([gi("flex"),mi("column"),di("stretch"),ui("gap","4px"),ui("padding",RQ(bt.sm)),ui("background",RQ(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",RQ(St.sm)),ui("text-align","left"),pi("pointer"),Yi([ui("border-color",RQ(_t.brand))])]),jQ=co([pi("grab")]),UQ=co([Pi(.85),ui("z-index","10"),pi("grabbing")]),BQ=co([ui("font-size",RQ(xt.sizeSm)),ui("font-weight",RQ(xt.weightMedium)),ui("color",RQ(_t.textPrimary))]),$Q=co([ui("font-size",RQ(xt.sizeXs)),ui("color",RQ(_t.textSecondary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),qQ=co([ui("color",RQ(_t.textDisabled)),ui("font-size",RQ(xt.sizeSm))]);function GQ(e){let t=e.onClick,n=e.draggable,o=e.card,s=dQ({id:o.key,disabled:!n}),a=n?zQ+" "+jQ:zQ,l=s.isDragging?a+" "+UQ:a,c=mQ(s.transform),u=void 0!==c?{transform:c}:void 0,d=s.listeners,f=null==d?void 0:T(d),h=o.meta;return r("div",{children:[i("span",{children:o.title,className:BQ}),void 0!==h?i("span",{children:h,className:$Q,title:h}):null],ref:T(s.setNodeRef),className:l,role:"button",style:u,tabIndex:0,onKeyDown:e=>M(f,t=>gQ(t,e)),onClick:e=>M(t,e=>e(o.key)),onPointerDown:e=>M(f,t=>pQ(t,e))})}function VQ(e){let t=e.accepts,n=e.onCardClick,o=e.draggable,s=e.column,a=void 0===t||t,l=hQ({id:s.value,disabled:!a}),c=s.swatch,u=void 0!==c?function(e){return co(IQ.concat([ui("border-top","3px solid "+e.border)]))}(c):FQ,d=l.isOver,f=a?d?u+" "+OQ:u:u+" "+PQ,h=s.swatch;return r("div",{children:[r("div",{children:[void 0!==h?i(AQ.make,{swatch:h,label:s.label}):i("span",{children:s.label,className:LQ}),i(ps,{count:s.cards.length,label:""})],className:MQ}),0===s.cards.length?i("span",{children:"—",className:qQ}):s.cards.map(e=>i(GQ,{card:e,draggable:o,onClick:n},e.key))],ref:T(l.setNodeRef),className:f})}let KQ=function(e){let t=e.canDrop,n=e.onMove,r=e.onCardClick,o=e.columns,a=$(n),l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(()=>[...t].filter(e=>null!=e),[...t])}(VJ(RX,{activationConstraint:{distance:5}}),VJ(kX,{})),c=s(()=>{}),u=c[1],d=c[0],f=e=>void 0===t||void 0===d||t(d,e.value);return i(lQ,{sensors:T(l),onDragStart:e=>u(t=>e.active.id),onDragEnd:e=>{u(e=>{});let r=e.over;if(void 0===n)return;if(null==r)return;let i=o.find(t=>t.cards.some(t=>t.key===e.active.id));return L(t,!0,t=>t(e.active.id,r.id))&&L(i,!0,e=>e.value!==r.id)?n(e.active.id,r.id):void 0},onDragCancel:()=>u(e=>{}),children:i("div",{children:o.map(e=>i(VQ,{column:e,draggable:a,onCardClick:r,accepts:f(e)},e.value)),className:DQ})})};function WQ(e){return"var("+e+")"}let HQ=co([gi("flex"),mi("column"),ui("gap",WQ(bt.sm))]),JQ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",WQ(bt.sm))]),XQ=co([gi("inlineFlex"),di("center"),ui("gap",WQ(bt.xs))]),QQ=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",WQ(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",WQ(_t.textSecondary)),ui("font-size",WQ(xt.sizeSm)),pi("pointer"),Yi([ui("background",WQ(_t.surfaceSubtle)),ui("color",WQ(_t.textPrimary))])]),YQ=uo([QQ,co([ui("background",WQ(_t.surfaceSubtle)),ui("color",WQ(_t.textPrimary)),ui("font-weight",WQ(xt.weightMedium))])]),ZQ=co([ui("font-size",WQ(xt.sizeMd)),ui("font-weight",WQ(xt.weightMedium)),ui("color",WQ(_t.textPrimary))]),eY=co([gi("grid"),ui("grid-template-columns","repeat(7, 1fr)"),ui("gap","1px")]),tY=co([ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("padding","2px var("+bt.xs+")")]),nY=co([gi("grid"),ui("grid-template-columns","repeat(7, 1fr)"),ui("gap","1px"),ui("background",WQ(_t.borderSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",WQ(St.md)),ui("overflow","hidden")]),rY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","96px"),ui("padding","4px"),ui("background",WQ(_t.surface))]),iY=uo([rY,co([ui("opacity","0.55")])]),oY=co([ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.textSecondary))]),sY=uo([oY,co([ui("color",WQ(_t.brand)),ui("font-weight",WQ(xt.weightMedium))])]);let aY=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("text-align","left"),ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.brand)),pi("pointer"),Yi([ui("text-decoration","underline")])]);let lY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","200px"),ui("padding","4px"),ui("background",WQ(_t.surface))]),cY=co([ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.textSecondary)),ui("padding-bottom","2px"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),uY=co([gi("flex"),_i("wrap"),di("center"),ui("gap",WQ(bt.md)),ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.textSecondary))]);let dY=co([ui("font-size",WQ(xt.sizeXs)),ui("color",WQ(_t.textDisabled))]),fY="var("+_t.brand+")";function hY(e,t){return e.filter(e=>sc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function pY(e,t){return cc(e.start)||!ic(e.start,t)?e.title:lc(e.start)+" "+e.title}let gY=function(e){let t,n,a=e.initialDate,l=e.windowNote,c=e.legend,u=e.events,d=void 0!==c?c:[],f=s(()=>"Month"),h=f[1],p=f[0],g=s(()=>Zl(U(a,Date.now()))),m=g[1],v=g[0],y=Zl(Date.now()),_=e=>m(t=>{switch(p){case"Month":return tc(t,e);case"Week":return ec(t,7*e|0);case"Day":return ec(t,e)}}),b=(e,t)=>{return i("button",{children:pY(e,t),className:(n=U(e.accent,fY),co([gi("block"),ui("width","100%"),ui("text-align","left"),ui("border","none"),ui("border-left","3px solid "+n),ui("border-radius",WQ(St.sm)),ui("background",WQ(_t.surfaceSubtle)),ui("color",WQ(_t.textPrimary)),ui("font-size",WQ(xt.sizeXs)),ui("padding","1px var("+bt.xs+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",WQ(_t.surfaceElevated))])])),title:e.title,onClick:t=>e.onOpen()},e.key);var n},x=()=>{let e=function(e){let t=nc(rc(e));return pe(42,e=>ec(t,e))}(v);return r(o,{children:[i("div",{children:fc.map(e=>i("div",{children:e,className:tY},e)),className:eY}),i("div",{children:e.map(e=>{let t=hY(u,e),n=t.slice(0,3),o=t.length-n.length|0;return r("div",{children:[i("span",{children:hc(e).toString(),className:e===y?sY:oY}),n.map(t=>b(t,e)),o>0?i("button",{children:"+"+o.toString()+" more",className:aY,onClick:t=>{m(t=>e),h(e=>"Day")}}):null],className:oc(e,v)?rY:iY},e.toString())}),className:nY})]})},S=e=>{return i("div",{children:e.map(e=>r("div",{children:[i("div",{children:pc(e),className:cY}),hY(u,e).map(t=>b(t,e))],className:lY},e.toString())),className:(t=e.length,co([gi("grid"),ui("grid-template-columns","repeat("+t.toString()+", 1fr)"),ui("gap","1px"),ui("background",WQ(_t.borderSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",WQ(St.md)),ui("overflow","hidden")]))});var t};switch(p){case"Month":t=x();break;case"Week":t=S(pe(7,e=>ec(nc(v),e)));break;case"Day":t=S([Zl(v)])}switch(p){case"Month":case"Week":n=dc(v);break;case"Day":n=pc(v)+" — "+dc(v)}let w=(e,t)=>i("button",{children:t,className:p===e?YQ:QQ,onClick:t=>h(t=>e)});return r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:QQ,onClick:e=>_(-1)}),i("button",{children:"Today",className:QQ,onClick:e=>m(e=>y)}),i("button",{children:"›",className:QQ,onClick:e=>_(1)}),i("span",{children:n,className:ZQ})],className:XQ}),r("div",{children:[w("Month","Month"),w("Week","Week"),w("Day","Day")],className:XQ})],className:JQ}),0!==d.length?i("div",{children:d.map(e=>{return r("span",{children:[i("span",{className:(t=e.accent,co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",t),ui("margin-right","4px")]))}),e.label]},e.label);var t}),className:uY}):null,t,void 0!==l?i("span",{children:l,className:dY}):null],className:HQ})};function mY(e){return"var("+e+")"}let vY=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(220px, 1fr))"),ui("gap",mY(bt.md))]),yY=co([gi("flex"),mi("column"),di("stretch"),ui("gap",mY(bt.sm)),ui("padding",mY(bt.md)),ui("background",mY(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",mY(St.md)),ui("text-align","left"),Yi([ui("border-color",mY(_t.brand)),ui("background",mY(_t.surfaceSubtle))])]),_Y=co([gi("flex"),mi("column"),di("stretch"),ui("gap",mY(bt.sm)),ui("background","none"),ui("border","none"),ui("padding","0"),ui("font","inherit"),ui("color","inherit"),ui("text-align","left"),pi("pointer")]),bY=co([gi("flex"),_i("wrap"),ui("gap","4px")]),xY=co([ui("background",mY(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",mY(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",mY(_t.textPrimary)),ui("font-size",mY(xt.sizeSm)),pi("pointer"),Yi([ui("border-color",mY(_t.brand)),ui("color",mY(_t.brand))])]),SY=co([ui("width","100%"),ui("height","96px"),ui("object-fit","cover"),ui("border-radius",mY(St.sm))]),wY=co([ui("width","100%"),ui("height","96px")]),EY=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",mY(bt.sm))]),kY=co([ui("font-size",mY(xt.sizeMd)),ui("font-weight",mY(xt.weightMedium)),ui("color",mY(_t.textPrimary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),CY=co([gi("flex"),di("baseline"),ui("gap",mY(bt.sm)),ui("font-size",mY(xt.sizeSm))]),AY=co([ui("color",mY(_t.textSecondary)),ui("white-space","nowrap"),yi(0)]),NY=co([ui("color",mY(_t.textPrimary)),ui("min-width","0"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),TY=co([ui("color",mY(_t.textDisabled)),ui("font-size",mY(xt.sizeSm))]);let RY=function(e){let t=e.cards;if(0===t.length)return i("span",{children:"(empty)",className:TY});let n=e.onCardClick;return i("div",{children:t.map(e=>{let t,o=e.media;t=void 0!==o?"object"!=typeof o?i("span",{children:i(nJ,{size:"Fill"}),className:wY}):i("img",{className:SY,alt:e.title,src:o._0}):null;let s=e.actions;return r("div",{children:[r("button",{children:[t,r("div",{children:[i("span",{children:e.title,className:kY,title:e.title}),U(e.badge,null)],className:EY}),e.fields.map(e=>r("div",{children:[i("span",{children:e.label,className:AY}),i("span",{children:e.value,className:NY})],className:CY},e.label))],className:_Y,onClick:t=>M(n,t=>t(e.key))}),void 0!==s&&0!==s.length?i("div",{children:s.map(e=>i("button",{children:e.label,className:xY,onClick:t=>e.onClick()},e.label)),className:bY}):null],className:yY},e.key)}),className:vY})};function DY(e){return"var("+e+")"}let IY=co([ui("font-family",DY(xt.fontFamilyMono)),ui("font-size",DY(xt.sizeSm)),ui("line-height",DY(xt.lineHeightNormal)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",DY(St.md)),Mi("auto")]),FY=co([gi("flex"),ui("padding","1px var("+bt.md+")")]),OY=co([ui("background","rgba(248,81,73,0.12)"),ui("color",DY(_t.error))]),PY=co([ui("background","rgba(63,185,80,0.12)"),ui("color",DY(_t.success))]),MY=co([ui("color",DY(_t.textSecondary))]),LY=co([ui("width","16px"),yi(0),ui("user-select","none"),Ni(to(8))]);let zY=function(e){let t=function(e,t){let n=e.length,r=t.length,i=he((n+1|0)*(r+1|0)|0,0),o=(e,t)=>i[(e*(r+1|0)|0)+t|0];for(let c=0;c<n;++c)for(let n=0;n<r;++n)i[((c+1|0)*(r+1|0)|0)+(n+1|0)|0]=e[c]===t[n]?o(c,n)+1|0:o(c,n+1|0)>o(c+1|0,n)?o(c,n+1|0):o(c+1|0,n);let s=[],a=n,l=r;for(;a>0||l>0;){let n=e[a-1|0],r=t[l-1|0];a>0&&l>0&&n===r?(s=[{kind:"Unchanged",text:n}].concat(s),a=a-1|0,l=l-1|0):l>0&&(0===a||o(a,l-1|0)>=o(a-1|0,l))?(s=[{kind:"Added",text:r}].concat(s),l=l-1|0):(s=[{kind:"Removed",text:n}].concat(s),a=a-1|0)}return s}(e.before.split("\n"),e.after.split("\n"));return i("div",{children:t.map((e,t)=>{let n;switch(e.kind){case"Removed":n=[FY+" "+OY,"-"];break;case"Added":n=[FY+" "+PY,"+"];break;case"Unchanged":n=[FY+" "+MY," "]}return r("div",{children:[i("span",{children:n[1],className:LY}),i("span",{children:e.text})],className:n[0]},t.toString())}),className:IY})};function jY(e,t){let n=new Date(t).getTime();if(Number.isNaN(n))return t;let r=(e-n)/1e3;return r<45?"just now":r<3600?Math.floor(r/60).toString()+"m ago":r<86400?Math.floor(r/3600).toString()+"h ago":r<1209600?Math.floor(r/86400).toString()+"d ago":t.slice(0,10)}function UY(e){return"var("+e+")"}let BY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("font-family",UY(xt.fontFamily)),ui("font-size",UY(xt.sizeSm))]),$Y=co([gi("flex"),di("flexStart"),ui("gap","10px"),ui("padding",UY(bt.xs)+" "+UY(bt.sm)),ui("border-radius",UY(St.sm))]),qY=co([pi("pointer"),Yi([ui("background",UY(_t.surfaceSubtle))])]),GY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0"),ui("flex","1")]),VY=co([ui("color",UY(_t.textPrimary))]),KY=co([ui("font-weight",UY(xt.weightMedium))]),WY=co([ui("color",UY(_t.textSecondary))]),HY=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("color",UY(_t.textSecondary)),ui("font-size",UY(xt.sizeXs)),ui("white-space","nowrap")]),JY=co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("flex-shrink","0")]),XY=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",UY(_t.brand)),ui("font-size",UY(xt.sizeXs)),pi("pointer"),ui("text-align","left"),Yi([ui("text-decoration","underline")])]),QY=co([ui("margin-top","4px"),ui("max-width","560px")]),YY=co([ui("color",UY(_t.textSecondary)),ui("padding",UY(bt.md)),$i("center")]);function ZY(e){let t=e.onClick,n=e.entry,o=s(()=>!1),a=o[1],l=o[0],c=$(n.before)&&$(n.after),u=U(n.actor,n.subject),d=void 0!==t?$Y+" "+qY:$Y,f=n.actor,h=n.accent,p=n.timestamp;return r("div",{children:[i(Ho,{name:u,src:n.actorImageUrl,size:"Medium"}),r("div",{children:[r("span",{children:[void 0!==f?i("span",{children:f+" ",className:KY}):null,i("span",{children:n.verb+" ",className:WY}),n.subject],className:VY}),r("span",{children:[void 0!==h?i("span",{className:JY,style:{background:h}}):null,void 0!==p?jY(e.nowMs,p):null],className:HY}),c?i("button",{children:l?"Hide changes":"Show changes",className:XY,onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null,l&&c?i("div",{children:i(zY,{before:U(n.before,""),after:U(n.after,"")}),className:QY}):null],className:GY})],className:d,onClick:e=>M(t,e=>e(n))})}let eZ=function(e){let t=e.nowMs,n=e.onEntryClick,r=e.emptyLabel,o=e.entries,s=void 0!==r?r:"No activity yet",a=void 0!==t?t:Date.now();return 0===o.length?i("div",{children:s,className:YY}):i("div",{children:o.map(e=>i(ZY,{entry:e,nowMs:a,onClick:n},e.id)),className:BY})};function tZ(e){return"var("+e+")"}let nZ=co([gi("flex"),di("flexStart"),ui("gap","0"),ui("width","100%")]),rZ=co([gi("flex"),mi("column"),di("center"),ui("gap","4px"),ui("flex","0 0 auto")]);let iZ=[gi("inlineFlex"),di("center"),xi("center"),ui("width","24px"),ui("height","24px"),ui("border-radius","50%"),ui("font-size",tZ(xt.sizeXs)),ui("font-weight",tZ(xt.weightMedium)),ui("box-sizing","border-box")],oZ=co(iZ.concat([ui("background",tZ(_t.brand)),ui("color","#fff")])),sZ=co(iZ.concat([ui("background",tZ(_t.surface)),ui("color",tZ(_t.brand)),ui("border","2px solid var("+_t.brand+")")])),aZ=co(iZ.concat([ui("background",tZ(_t.surface)),ui("color",tZ(_t.textDisabled)),ui("border","1px solid var("+_t.border+")")])),lZ=[ui("font-size",tZ(xt.sizeXs)),ui("text-align","center"),ui("max-width","96px")],cZ=co(lZ.concat([ui("color",tZ(_t.textPrimary))])),uZ=co(lZ.concat([ui("color",tZ(_t.textDisabled))])),dZ=co([ui("display","none")]);function fZ(e){switch(e){case"Done":return oZ;case"Current":return sZ;case"Upcoming":return aZ}}function hZ(e,t){switch(e){case"Done":return"✓";case"Current":case"Upcoming":return(t+1|0).toString()}}let pZ=function(e){let t=e.compact,n=void 0!==t&&t;return i("div",{children:e.steps.map((e,t)=>{let o=0===t?null:i("div",{className:(s="Done"===e.state||"Current"===e.state,co([ui("flex","1 1 auto"),ui("height","2px"),ui("margin","0 6px"),ui("margin-top","11px"),ui("min-width","16px"),ui("background",tZ(s?_t.brand:_t.borderSubtle))]))},e.key+":c");var s;let a=n?dZ:function(e){switch(e){case"Done":case"Current":return cZ;case"Upcoming":return uZ}}(e.state);return r(g,{children:[o,r("div",{children:[i("span",{children:hZ(e.state,t),className:fZ(e.state)}),i("span",{children:e.label,className:a})],className:rZ,role:"listitem"})]},e.key)}),"aria-label":"Progress",className:nZ,role:"list"})};function gZ(e){switch(e.toLowerCase().replaceAll("_","").replaceAll("-","")){case"accepted":case"approve":case"approved":case"confirmed":case"granted":case"signed":return"Approved";case"awaiting":case"escalated":case"inreview":case"pending":case"submitted":case"underreview":return"Pending";case"na":case"notrequired":case"skipped":case"waived":return"Skipped";case"declined":case"denied":case"refused":case"reject":case"rejected":case"withdrawn":return"Rejected";default:return{TAG:"Other",_0:e}}}function mZ(e){if("object"==typeof e)return lt(e._0);switch(e){case"Approved":return"Approved";case"Rejected":return"Rejected";case"Pending":return"Pending";case"Skipped":return"Skipped"}}function vZ(e){if("object"==typeof e)return"Neutral";switch(e){case"Approved":return"Success";case"Rejected":return"Error";case"Pending":return"Info";case"Skipped":return"Neutral"}}function yZ(e){if("object"==typeof e)return"•";switch(e){case"Approved":return"✓";case"Rejected":return"✕";case"Pending":return"•";case"Skipped":return"–"}}function _Z(e){if("object"==typeof e)return"var("+_t.border+")";switch(e){case"Approved":return"var("+_t.success+")";case"Rejected":return"var("+_t.error+")";case"Pending":return"var("+_t.info+")";case"Skipped":return"var("+_t.border+")"}}function bZ(e){return"var("+e+")"}let xZ=co([gi("flex"),mi("column"),ui("gap",bZ(bt.md)),ui("font-family",bZ(xt.fontFamily))]),SZ=co([gi("flex"),mi("column")]),wZ=co([gi("flex"),di("stretch"),ui("gap",bZ(bt.sm))]),EZ=co([gi("flex"),mi("column"),di("center"),ui("flex","0 0 22px")]);let kZ=co([ui("flex","1 1 auto"),ui("width","1px"),ui("min-height","12px"),ui("background",bZ(_t.borderSubtle))]),CZ=co([gi("flex"),mi("column"),ui("gap","2px"),ui("flex","1 1 auto"),ui("min-width","0"),ui("padding-bottom",bZ(bt.sm))]),AZ=co([pi("pointer"),Yi([ui("background",bZ(_t.surfaceSubtle))]),ui("border-radius",bZ(St.sm)),ui("padding-left","4px"),ui("margin-left","-4px")]),NZ=co([gi("flex"),di("center"),_i("wrap"),ui("gap",bZ(bt.xs))]),TZ=co([ui("font-size",bZ(xt.sizeSm)),ui("font-weight",bZ(xt.weightMedium)),ui("color",bZ(_t.textPrimary))]),RZ=co([gi("flex"),di("center"),ui("gap","6px"),ui("font-size",bZ(xt.sizeXs)),ui("color",bZ(_t.textSecondary))]),DZ=co([ui("font-size",bZ(xt.sizeSm)),ui("color",bZ(_t.textSecondary)),ui("white-space","pre-wrap")]),IZ=co([ui("font-size",bZ(xt.sizeXs)),ui("color",bZ(_t.textDisabled))]);let FZ=function(e){let t=e.entries;if(0===t.length)return i(_o,{title:"No approvals",description:"Nothing in this window carries a decision."});let n=e.windowNote,s=e.nowMs,a=e.steps,l=t.length-1|0;return r("div",{children:[void 0!==a&&a.length>1?i(pZ,{steps:a}):null,i("div",{children:t.map((e,t)=>{let n,a=$(e.onOpen),c=e.actor,u=e.at,d=0;void 0!==c||void 0!==u?d=1:n=null,1===d&&(n=r("div",{children:[void 0!==c?r(o,{children:[i(Ho,{name:c,src:e.actorImageUrl,size:"Small"}),i("span",{children:c})]}):null,void 0!==u?i("span",{children:jY(U(s,Date.now()),u),title:U(ys(u),u)}):null],className:RZ}));let f=e.note;return r("div",{children:[r("div",{children:[i("span",{children:yZ(e.decision),className:(h=_Z(e.decision),co([gi("inlineFlex"),di("center"),xi("center"),ui("width","20px"),ui("height","20px"),ui("border-radius","50%"),ui("box-sizing","border-box"),ui("border","2px solid "+h),ui("color",h),ui("background",bZ(_t.surface)),ui("font-size","11px"),ui("line-height","1"),ui("flex","0 0 auto")]))}),t===l?null:i("div",{className:kZ})],className:EZ}),r("div",{children:[r("div",{children:[i("span",{children:e.step,className:TZ}),i(Ss,{variant:vZ(e.decision),label:mZ(e.decision)})],className:NZ}),n,void 0!==f&&""!==f?i("div",{children:f,className:DZ}):null],className:a?CZ+" "+AZ:CZ,onClick:t=>M(e.onOpen,e=>e())})],className:wZ},e.key);var h}),className:SZ}),void 0!==n?i("span",{children:n,className:IZ}):null],className:xZ})};function OZ(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let PZ=["approved","approve","accepted","granted","signed","confirmed","rejected","reject","declined","denied","refused","withdrawn","pending","awaiting","submitted","inreview","underreview","escalated","skipped","waived","notrequired"],MZ=["decision","outcome","verdict","approval","approvalstatus","result"],LZ=["step","stage","level","tier","approvalstep","approvallevel","phase"],zZ=["note","notes","comment","comments","reason","remarks","justification","rationale"];function jZ(e){return me(Sa(e),e=>{let t=e[1],n=e[0];if(ka(t))return z(function(e){let t=$s(e);if(void 0!==t&&t.length>=2&&t.length<=12)return t}(t),e=>[n,e])})}function UZ(e){let t=jZ(e),n=t.find(e=>MZ.includes(OZ(e[0])));return void 0!==n?n:t.find(e=>function(e){return e.filter(e=>PZ.includes(OZ(e))).length>=2}(e[1]))}function BZ(e,t){let n=Sa(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:Sa(e).map(e=>e[0]).find(e=>L(tI(e),!1,Na))}function $Z(e,t){let n=U(t,Ba(e,void 0,void 0)),r=UZ(e),i=n.dateSpan;if(void 0===r)return;if(void 0===i)return;let o=r[0],s=jZ(e).find(e=>{let t=e[0];return t!==o&&LZ.includes(OZ(t))});return{decisionField:o,dateSpan:i,stepField:z(s,e=>e[0]),stepValues:L(s,[],e=>e[1]),actorField:BZ(e,n),noteField:me(Sa(e),e=>{let t=e[0];if(ka(e[1])&&zZ.includes(OZ(t)))return t})[0]}}function qZ(e){return e.rows.map((e,t)=>{let n=U(ht(e),{});return{key:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}})}function GZ(e,t){return j(Xe(e,t),dt)}function VZ(e,t){return j(fa(t,e),gc)}function KZ(e,t){if(void 0===t)return e.length;let n=e.findIndex(e=>OZ(e)===OZ(t));return-1!==n?n:e.length}function WZ(e){return e.rows.map((e,t)=>{let n=U(ht(e),{});return{key:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}})}function HZ(e,t){return j(Xe(e,t),dt)}function JZ(e,t,n){return z(HZ(t,n),t=>{let r=tI(n);return void 0!==r?U(j(e.refLabels,e=>e.lookupLabel(r,t)),t):t})}function XZ(e,t){return U(j(e.semantics.labelField,e=>HZ(t.dict,e)),t.key)}function QZ(e,t,n){M(t.find(e=>e.key===n),t=>e.onOpenRow(t.key,t.json))}function YZ(e,t,n){return i("span",{children:iF(e,t,void 0!==n?n:"item"),style:{color:"var("+_t.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})}function ZZ(e,t,n,i){return r("div",{children:[e,YZ(t,n,void 0!==i?i:"item")],style:{display:"flex",flexDirection:"column",gap:"var("+bt.sm+")"}})}function e0(e){let t=e.source,n=Wa(),s=Ge(),a=WZ(t),l=aI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),c=JI(a.map(e=>e.dict),l,n,t.ownEntity,q(t.refLabels)),u=t.refLabels,d=void 0!==u?u:{lookupLabel:(e,t)=>LI(c,e,n,t),isMissing:(e,t)=>UI(c,e,n,t),retiredBadge:(e,t)=>zI(c,e,n,t),linkable:(e,t)=>jI(c,e,n,t,!1)},f=me([t.semantics.labelField,t.semantics.imageField,t.semantics.statusField],e=>e),h=l.filter(e=>!f.includes(e.key)).slice(0,4),p=a.map(e=>{let a=z(j(t.semantics.statusField,t=>iH(e.dict,t)),e=>i(Ss,{variant:"Neutral",label:lt(e),dot:!1})),l=j(t.retired,t=>Ks(t,Xe(e.dict,t.field))),c=void 0!==a?void 0!==l?r(o,{children:[a,l]}):a:void 0!==l?l:void 0,u=function(e,t){return z(e.semantics.imageField,e=>{let n=j(HZ(t.dict,e),e=>""===e?void 0:e);return void 0!==n?{TAG:"Picture",_0:He(n)}:"EmptySlot"})}(t,e),f=z(t.rowActionsFor,t=>t(e.key,e.json).map(e=>({label:e.label,onClick:e.run})));return{key:e.key,title:XZ(t,e),media:u,badge:c,fields:h.map(r=>({label:fI(r,n,t.ownEntity),value:vI(r.key,r.kind,r.propSchema,Xe(e.dict,r.key),r.ann,n,s,d,t.ownEntity)})),actions:f}});return ZZ(i(RY,{cards:p,onCardClick:e=>QZ(t,a,e)}),[t],void 0,void 0)}function t0(e){let t=e.source,n=WZ(t),r=U(t.semantics.statusField,""),o=function(e){let t=WZ(e),n=U(e.semantics.statusField,""),r=qs(e.schema,n),i=e=>U(iH(e.dict,n),""),o=o=>o.map(o=>({value:o,label:""===o?"(no status)":lt(o),cards:t.filter(e=>i(e)===o).map(t=>{let r=me(Os(e.schema),r=>r===n?void 0:JZ(e,t.dict,r))[0];return{key:t.key,title:XZ(e,t),meta:r}}),swatch:_Q(r,o)})),s=ge(t.map(i).filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return o(r).concat(o(s))}(t),s=(e,i)=>j(t.statusCommandFor,t=>t((e=>U(j(n.find(t=>t.key===e),e=>iH(e.dict,r)),""))(e),i)),a=t.onCommand,l=void 0!==a&&$(t.statusCommandFor)?(e,t)=>M(s(e,t),t=>a(t.command,e,t.patch)):void 0,c=t.statusCommandFor;return ZZ(i(KQ,{columns:o,onCardClick:e=>QZ(t,n,e),onMove:l,canDrop:void 0!==c?(e,t)=>$(s(e,t)):void 0}),[t],void 0,"card")}let n0=["var("+_t.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function r0(e,t){return U(e.accent,n0[fe(t,n0.length)])}function i0(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=r0(e,t),r=e.semantics.dateSpan;return void 0!==r?me(WZ(e),i=>z(j(fa(r,i.dict),gc),o=>{let s=j(ha(r,i.dict),gc);return{key:t.toString()+":"+i.key,title:XZ(e,i),start:o,end_:s,accent:n,onOpen:()=>e.onOpenRow(i.key,i.json)}})):[]}).flat()}(t),r=t.length>1?t.map((e,t)=>({label:e.readModelName,accent:r0(e,t)})):[];return i(gY,{events:n,legend:r,windowNote:iF(t,void 0,void 0)})}function o0(e){let t=e.sources,n=function(e){let t=e.map((e,t)=>{let n=e.semantics.dateSpan,r=r0(e,t);return WZ(e).map(i=>{let o=j(n,e=>fa(e,i.dict)),s=j(o,gc),a=void 0!==o?U(ys(o),o):"",l=z(j(e.semantics.statusField,e=>iH(i.dict,e)),lt);return{entry:{id:t.toString()+":"+i.key,timestamp:a,label:XZ(e,i),detail:l,variant:void 0,accent:r},sort:s,open_:()=>e.onOpenRow(i.key,i.json)}})}).flat();return t.toSorted((e,t)=>{let n=e.sort,r=t.sort;return void 0!==n?void 0!==r?r-n:-1:void 0!==r?1:0})}(t);return ZZ(i(tH,{entries:n.map(e=>e.entry),onSelect:e=>M(n.find(t=>t.entry.id===e),e=>e.open_())}),t,void 0,void 0)}function s0(e,t){let n=Xe(e,t);if(void 0===n)return[];let r=dt(n);return void 0!==r?[r]:me(U(pt(n),[]),dt)}function a0(e){let t=WZ(e),n=function(e,t){let n=t.map(e=>e.key);return me(Sa(e.schema),e=>{let t=e[0];return z(tI(t),e=>t)}).filter(e=>t.some(t=>s0(t.dict,e).some(e=>e!==t.key&&n.includes(e))))}(e,t),r=P(e.semantics.dateSpan,pa);return void 0!==r?me(t,t=>z(j(fa(r,t.dict),gc),i=>{let o=U(j(ha(r,t.dict),gc),i);return{key:t.key,title:XZ(e,t),start:i,end_:o<i?i:o,accent:e.accent,dependsOn:n.map(e=>s0(t.dict,e)).flat(),onOpen:()=>e.onOpenRow(t.key,t.json)}})):[]}function l0(e){let t=e.source,n=a0(t),r=t.rows.length,o=n.length,s=iF([t],o,void 0);return i($H,{tasks:n,windowNote:o===r?s:s+" (the rest carry no start date)"})}function c0(e,t){let n=e.semantics.labelField,r=j(e.semantics.statusField,e=>HZ(t.dict,e));return void 0!==r?r:j(Os(e.schema).find(t=>!!yt(t,n)&&yt(t,e.semantics.parentField)),n=>JZ(e,t.dict,n))}function u0(e){let t=e.source,n=function(e){let t=WZ(e),n=e.semantics.parentField;return t.map(t=>({key:t.key,title:XZ(e,t),subtitle:c0(e,t),parent:j(n,e=>HZ(t.dict,e)),accent:e.accent,onOpen:()=>e.onOpenRow(t.key,t.json)}))}(t);return i(GW,{nodes:n,windowNote:iF([t],void 0,void 0)})}function d0(e){let t=e.source,n=Wa(),r=qZ(t),o=aI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=JI(r.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),a=t.refLabels,l=void 0!==a?a.lookupLabel:(e,t)=>LI(s,e,n,t),c=$Z(t.schema,t.semantics);if(void 0===c)return null;let u=function(e,t,n){let r=void 0!==n?n:e=>e,i=qZ(e).map(e=>{let n=j(t.stepField,t=>GZ(e.dict,t)),r=GZ(e.dict,t.decisionField);return[e,n,r]}),o=i.slice();void 0!==t.stepField?o.sort((e,n)=>KZ(t.stepValues,e[1])-KZ(t.stepValues,n[1])|0):o.sort((e,n)=>{let r=VZ(e[0].dict,t.dateSpan),i=VZ(n[0].dict,t.dateSpan);return void 0!==r?void 0!==i?r-i:-1:void 0!==i?1:0});let s=o.map(n=>{let i=n[0];return{key:i.key,step:U(z(n[1],lt),U(j(e.semantics.labelField,e=>GZ(i.dict,e)),"Decision")),decision:L(n[2],"Pending",gZ),actor:z(j(t.actorField,e=>GZ(i.dict,e)),r),at:fa(t.dateSpan,i.dict),note:j(t.noteField,e=>GZ(i.dict,e)),onOpen:()=>e.onOpenRow(i.key,i.json)}}),a=me(o,e=>z(e[1],OZ)),l=t.stepValues.filter(e=>!a.includes(OZ(e))).map(e=>({key:"pending:"+e,step:lt(e),decision:"Pending"}));return s.concat(l)}(t,c,e=>{let t=j(c.actorField,tI);return void 0!==t?U(l(t,e),e):e}),d=function(e,t){let n=t.stepField;if(void 0===n)return[];let r=me(qZ(e),e=>{let r=GZ(e.dict,n),i=GZ(e.dict,t.decisionField);if(void 0===r)return;if(void 0===i)return;let o=gZ(i);return"object"!=typeof o&&"Pending"===o?void 0:OZ(r)}),i=t.stepValues.find(e=>!r.includes(OZ(e)));return t.stepValues.map(e=>({key:e,label:lt(e),state:r.includes(OZ(e))?"Done":vt(i,e)?"Current":"Upcoming"}))}(t,c);return i(FZ,{entries:u,steps:d,windowNote:iF([t],void 0,"decision")})}function f0(e){let t=function(e){return me(Sa(e),e=>{let t=$s(e[1]);if(void 0!==t&&t.length>=2&&t.length<=12)return[e[0],t]})}(e),n=Ba(e,void 0,void 0).statusField,r=void 0!==n&&t.some(e=>e[0]===n)?t.filter(e=>e[0]===n).concat(t.filter(e=>e[0]!==n)):t,i=r[0],o=r[1];if(void 0!==i&&void 0!==o)return[i,o]}function h0(e){let t=e.source,n=s(()=>"Numbers"),o=n[1],a=n[0],l=function(e){return z(f0(e.schema),t=>{let n=t[1],r=n[1],i=n[0],o=t[0],s=o[1],a=o[0],l=WZ(e),c=(e,t)=>U(iH(e.dict,t),""),u=(e,t)=>ge(l.map(t=>c(t,e)).filter(e=>!t.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t])),d=s.concat(u(a,s)),f=r.concat(u(i,r)),h=d.map(e=>f.map(t=>ge(l,0,(n,r)=>c(r,a)===e&&c(r,i)===t?n+1|0:n))),p=h.map(e=>ge(e,0,(e,t)=>e+t|0)),g=f.map((e,t)=>ge(h,0,(e,n)=>e+n[t]|0)),m=ge(p,0,(e,t)=>e+t|0);return{rowField:a,colField:i,rowValues:d,colValues:f,counts:h,rowTotals:p,colTotals:g,grandTotal:m}})}(t);if(void 0===l)return null;let c,u=e=>""===e?"(none)":lt(e),d=lt(l.rowField),f=lt(l.colField),h=l.rowValues.map(e=>[e,u(e)]),p=l.colValues.map(e=>[e,u(e)]),g=ge(l.counts,0,(e,t)=>ge(t,e,(e,t)=>t>e?t:e)),m=e=>function(e,t){return Uo(e.toString(),function(e){return"object"==typeof e}(t))}(e,rF([t])),v=(e,t)=>i("button",{children:t,style:{background:"none",backgroundColor:a===e?"var("+_t.surfaceSubtle+")":"transparent",border:"1px solid var("+_t.border+")",color:a===e?"var("+_t.textPrimary+")":"var("+_t.textSecondary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"2px var("+bt.sm+")",borderRadius:"var("+St.sm+")"},type:"button",onClick:t=>o(t=>e)});return c="Numbers"===a?i(tJ,{rowDimLabel:d,colDimLabel:f,rowHeaders:h.map(e=>({value:e[0],label:e[1]})),colHeaders:p.map(e=>({value:e[0],label:e[1]})),cells:l.counts.map(e=>e.map(e=>({display:e.toString(),empty:0===e}))),rowTotals:l.rowTotals.map(m),colTotals:l.colTotals.map(m),grandTotal:m(l.grandTotal)}):i(wW,{rowDimLabel:d,colDimLabel:f,rowHeaders:h.map(e=>({value:e[0],label:e[1]})),colHeaders:p.map(e=>({value:e[0],label:e[1]})),cells:l.counts.map(e=>e.map(e=>({value:e,display:e.toString()}))),maxLabel:g.toString()}),r("div",{children:[r("div",{children:[v("Numbers","Numbers"),v("Heat","Heat")],style:{display:"inline-flex",alignSelf:"flex-end",gap:"var("+bt.xs+")"}}),c,YZ([t],void 0,"row")],style:{display:"flex",flexDirection:"column",gap:"var("+bt.sm+")"}})}function p0(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=e.semantics.imageField;return WZ(e).map(r=>{let i=j(j(n,e=>HZ(r.dict,e)),e=>""===e?void 0:He(e)),o=z(j(e.semantics.statusField,e=>iH(r.dict,e)),lt),s=e.fillSlot,a=void 0!==i||void 0===s||void 0===n?void 0:s(r.key,n);return{item:{key:t.toString()+":"+r.key,src:i,title:XZ(e,r),caption:o,onUpload:a},open_:()=>e.onOpenRow(r.key,r.json)}})}).flat()}(t);return ZZ(i(fJ,{items:n.map(e=>e.item),onOpen:e=>M(n.find(t=>t.item.key===e),e=>e.open_())}),t,void 0,void 0)}function g0(e){return i("span",{children:e,"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}})}function m0(e,t){let n=e[0];return void 0!==n?t(n):null}function v0(e,t){return e===t?0:e<t?-1:1}function y0(e,t){if(void 0===t)return"";let n=ut(t),r=0;if("object"!=typeof n){if("JSONNull"===n)return"";r=2}else switch(n.TAG){case"JSONString":return n._0;case"JSONNumber":return n._0.toString();default:r=2}if(2===r)if("object"!=typeof e)switch(e){case"KBoolean":return"object"!=typeof n?"JSONFalse"===n?"No":"Yes":JSON.stringify(t);case"KArrayOfStrings":if("object"==typeof n)return"JSONObject"===n.TAG?JSON.stringify(t):me(n._0,dt).join(", ")}else if("KUnion"===e.TAG&&"object"==typeof n){if("JSONObject"!==n.TAG)return JSON.stringify(t);let r=va(t);if(void 0===r)return"";let i=r[0];return L(Pt(e._0,i),i,e=>e.tag)}return"object"!=typeof n?"JSONFalse"===n?"false":"true":JSON.stringify(t)}function _0(e,t,n){let r=Qe(n).filter(e=>""!==e[1]);return 0===r.length?e:e.filter(e=>r.every(n=>{let r=n[0],i=t.find(e=>e.key===r);return void 0===i||function(e,t,n){if(""===n)return!0;if("object"==typeof e)return"KEnum"!==e.TAG||L(j(t,dt),!1,e=>e===n);if("KBoolean"!==e)return!0;let r=z(t,ut);if(void 0===r)return!1;if("object"==typeof r)return!1;switch(r){case"JSONFalse":return"false"===n;case"JSONTrue":return"true"===n;default:return!1}}(i.kind,Xe(e,r),n[1])}))}function b0(e,t,n){return""===n?e:e.filter(e=>function(e,t,n){if(""===n)return!0;let r=n.toLowerCase();return t.some(t=>y0(t.kind,Xe(e,t.key)).toLowerCase().includes(r))}(e,t,n))}function x0(e,t,n,r){if(void 0===n)return e;let i=t.find(e=>e.key===n);if(void 0===i)return e;let o="Asc"===r?1:-1;return e.toSorted((e,t)=>function(e,t,n){let r=e=>void 0===e||"JSONNull"===ut(e),i=r(t),o=r(n);if(i)return o?0:1;if(o)return-1;if("object"!=typeof e)switch(e){case"KBoolean":let r=e=>{if(void 0===e)return 0;let t=ut(e);return"object"==typeof t?0:"JSONTrue"===t?1:0};return r(t)-r(n);case"KDate":return v0(y0(e,t),y0(e,n));case"KNumber":return U(j(t,ft),0)-U(j(n,ft),0)}return v0(y0(e,t),y0(e,n))}(i.kind,Xe(e,n),Xe(t,n))*o)}function S0(e){return"var("+e+")"}ZI({id:"cards",label:"Cards",icon:g0("▤"),arity:"Single",isCapable:(e,t,n)=>!0,render:e=>m0(e,e=>i(e0,{source:e})),capability:"always — richer with label/image semantics and summary fields"}),ZI({id:"board",label:"Board",icon:g0("▥"),arity:"Single",isCapable:(e,t,n)=>L(t.statusField,!1,t=>0!==qs(e,t).length),render:e=>m0(e,e=>i(t0,{source:e})),capability:"statusField — status/state/stage string enum (≤ 8 values) supplying the columns"}),ZI({id:"calendar",label:"Calendar",icon:g0("▣"),arity:{TAG:"Multi",min:1},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(i0,{sources:e}),capability:"dateSpan — a `date-range` field, a start*/end* date-time pair, or a lone non-infrastructure date field"}),ZI({id:"timeline",label:"Timeline",icon:g0("▚"),arity:{TAG:"Multi",min:2},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(o0,{sources:e}),capability:"dateSpan — a date field to place rows on a most-recent-first chronological stream; several sources merge into one stream, accent-coded per source"}),ZI({id:"gantt",label:"Gantt",icon:g0("▬"),arity:"Single",isCapable:(e,t,n)=>L(t.dateSpan,!1,pa),render:e=>m0(e,e=>i(l0,{source:e})),capability:"dateSpan stating an end — a `date-range` field or a start*/end* date-time pair; dependency connectors come from entity-ref fields whose ids point at other loaded rows"}),ZI({id:"hierarchy",label:"Hierarchy",icon:g0("⑂"),arity:"Single",isCapable:(e,t,n)=>$(t.parentField),render:e=>m0(e,e=>i(u0,{source:e})),capability:"parentField — a parent*/manager/reportsTo/supervisor string field (or one annotated `parent-ref`) whose values point at other rows of the same collection"}),ZI({id:"approvals",label:"Approvals",icon:g0("✓"),arity:"Single",isCapable:(e,t,n)=>function(e){return $($Z(e,void 0))}(e),render:e=>m0(e,e=>i(d0,{source:e})),capability:"a decision enum — a small string enum named decision/outcome/verdict/approval/result, or any small enum declaring two or more approval values (approved/rejected/pending/…) — plus a date field to sequence the chain"}),ZI({id:"pivot",label:"Pivot",icon:g0("⊞"),arity:"Single",isCapable:(e,t,n)=>$(f0(e)),render:e=>m0(e,e=>i(h0,{source:e})),capability:"two small string enums (2–12 values) as the row and column dimensions"}),ZI({id:"gallery",label:"Gallery",icon:g0("▨"),arity:"Single",isCapable:(e,t,n)=>$(t.imageField),render:e=>i(p0,{sources:e}),capability:"imageField — a string field named image/imageUrl/photo/avatar/thumbnail (or annotated `image`) supplying each row's picture"});let w0=co([Ui("relative"),gi("inlineFlex"),di("center")]),E0=co([ui("background",S0(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",S0(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("padding-left","32px"),ui("font-size",S0(xt.sizeMd)),ui("color",S0(_t.textPrimary)),ui("outline","none"),ui("width","240px"),Xi([ui("border-color",S0(_t.brand))]),eo([ui("color",S0(_t.textDisabled))])]),k0=co([Ui("absolute"),Si(to(10)),ui("color",S0(_t.textDisabled)),ui("font-size",S0(xt.sizeSm)),ui("pointer-events","none")]),C0=co([Ui("absolute"),Bi(to(8)),ui("background","none"),ui("border","none"),ui("cursor","pointer"),ui("color",S0(_t.textDisabled)),ui("font-size",S0(xt.sizeSm)),ui("padding","0"),ui("line-height","1"),Yi([ui("color",S0(_t.textSecondary))])]);let A0=function(e){let t=e.placeholder,n=e.onChange,o=e.value,s=void 0!==t?t:"Search...";return r("div",{children:[i("span",{children:"/",className:k0}),i("input",{className:E0,placeholder:s,type:"text",value:o,onChange:e=>n(e.target.value)}),""!==o?i("button",{children:"x",className:C0,onClick:e=>n("")}):null],className:w0})};function N0(e){return"var("+e+")"}let T0=co([gi("flex"),di("center"),ui("gap",N0(bt.sm)),_i("wrap")]),R0=co([gi("flex"),di("center"),ui("gap","4px")]),D0=co([ui("color",N0(_t.textSecondary)),ui("font-size",N0(xt.sizeSm)),ui("white-space","nowrap")]),I0=co([ui("background",N0(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",N0(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",N0(xt.sizeSm)),ui("color",N0(_t.textPrimary)),ui("cursor","pointer"),ui("outline","none"),Xi([ui("border-color",N0(_t.brand))])]);function F0(e){let t=e.onChange,n=e.filter;return r("div",{children:[i("span",{children:n.label+":",className:D0}),r("select",{children:[i("option",{children:"All",value:""}),n.options.map(e=>i("option",{children:e.label,value:e.value},e.value))],className:I0,value:n.value,onChange:e=>t(n.key,e.target.value)})],className:R0})}let O0=F0;let P0=function(e){let t=e.onSearchChange,n=e.searchValue,o=e.onFilterChange;return r("div",{children:[void 0!==n&&void 0!==t?i(A0,{value:n,onChange:t}):null,e.filters.map(e=>i(F0,{filter:e,onChange:o},e.key))],className:T0})};function M0(){let e=s(()=>{}),t=e[1],n=e[0];return{element:void 0!==n?i(YK,{variant:"Error",title:n.command,message:n.reason,onDismiss:()=>t(e=>{})}):null,onNotice:e=>{if("object"!=typeof e)return t(e=>{});let n=e._0;t(e=>n)}}}function L0(e){try{return decodeURIComponent(e)}catch(t){return e}}function z0(e){let t=e.split("/");if(2!==t.length)return[e,void 0];let n=t[0],r=t[1];return[L0(n),L0(r)]}function j0(e){return"var("+e+")"}let U0=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",j0(bt.md)),vi(1),ui("min-height","160px"),$i("center"),ui("padding",j0(bt.lg))]),B0=co([ui("font-size","32px"),ui("color",j0(_t.error)),ui("line-height","1")]),$0=co([ui("color",j0(_t.textPrimary)),ui("font-size",j0(xt.sizeLg)),ui("font-weight",j0(xt.weightMedium)),ki(to(0))]),q0=co([ui("color",j0(_t.textSecondary)),ui("font-size",j0(xt.sizeSm)),ui("line-height",j0(xt.lineHeightNormal)),ki(to(0))]),G0=co([ui("background",j0(_t.brand)),ui("color",j0(_t.textOnBrand)),ui("border","none"),ui("border-radius",j0(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",j0(xt.sizeSm)),ui("cursor","pointer"),Ti(to(4))]);let V0=function(e){let t=e.title,n=void 0!==t?t:"Something went wrong";return r("div",{children:[i("div",{children:"X",className:B0}),i("h3",{children:n,className:$0}),L(e.detail,null,e=>i("p",{children:e,className:q0})),L(e.onRetry,null,e=>i("button",{children:"Try again",className:G0,onClick:t=>e()}))],className:U0})};function K0(e){return"var("+e+")"}let W0=co([gi("flex"),di("center"),ui("gap",K0(bt.xs)),ui("font-size",K0(xt.sizeSm)),ui("color",K0(_t.textSecondary)),ui("min-width","0")]),H0=co([ui("color",K0(_t.brand)),ui("text-decoration","none"),ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("max-width","18ch"),Yi([ui("text-decoration","underline")])]),J0=co([ui("color",K0(_t.textPrimary)),ui("font-weight",K0(xt.weightMedium))]),X0=co([ui("color",K0(_t.textDisabled)),ui("font-size",K0(xt.sizeLg)),ui("line-height","1"),yi(0),Gi("none")]),Q0=i("span",{children:"›","aria-hidden":!0,className:X0});let Y0=function(e){let t=e.allLinks,n=e.crumbs,o=void 0!==t&&t;return i("nav",{children:n.map((e,t)=>{let s=!o&&t===(n.length-1|0);return r(g,{children:[t>0?Q0:null,s||q(e.href)&&q(e.onClick)?i("span",{children:e.label,className:J0}):i("a",{children:e.label,className:H0,title:e.label,href:U(e.href,"#"),onClick:z(e.onClick,e=>t=>{if(!function(e){return!!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)||0!==e.button}(t))return t.preventDefault(),e()})})]},e.label)}),"aria-label":"breadcrumbs",className:W0})};function Z0(e){return"var("+e+")"}let e1=co([Ui("relative"),gi("inlineBlock")]),t1=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Z0(St.sm)),ui("cursor","pointer"),ui("color",Z0(_t.textSecondary)),ui("padding","2px var("+bt.sm+")"),ui("font-size",Z0(xt.sizeSm)),Yi([ui("background",Z0(_t.surfaceSubtle)),ui("color",Z0(_t.textPrimary))])]),n1=co([Ui("absolute"),Bi(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),ui("background",Z0(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Z0(St.md)),ui("box-shadow",Z0(Et)),ui("min-width","160px"),ui("z-index","200"),ui("overflow","hidden"),ji(to(4),to(0))]);let r1=co([ui("border","none"),ui("border-top","1px solid var("+_t.borderSubtle+")"),Ci(to(4),to(0))]);let i1=function(e){let t=e.triggerLabel,n=void 0!==t?t:"...",o=s(()=>!1),l=o[1],c=o[0];return a(()=>{if(!c)return;let e=e=>l(e=>!1);return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[c]),r("div",{children:[i("button",{children:n,className:t1,onClick:e=>{e.stopPropagation(),l(e=>!e)}}),c?i("div",{children:e.items.map((e,t)=>{if("object"!=typeof e)return i("hr",{className:r1},t.toString());let n=e.onClick,r=e.label;return i("button",{children:r,className:(o=e.danger,co([gi("block"),Vi({NAME:"percent",VAL:100}),ui("background","none"),ui("border","none"),ui("text-align","left"),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",Z0(xt.sizeMd)),ui("color",Z0(o?_t.error:_t.textPrimary)),pi("pointer"),Yi([ui("background",Z0(_t.surfaceSubtle))])])),onClick:e=>{l(e=>!1),n()}},r);var o}),className:n1,onClick:e=>{e.stopPropagation()}}):null],className:e1})};function o1(e){return"var("+e+")"}let s1=co([gi("flex"),di("center"),ui("gap",o1(bt.md)),ui("flex-wrap","wrap"),ui("padding-bottom",o1(bt.sm)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),a1=co([ui("display","inline-flex"),di("center"),ui("vertical-align","middle"),ui("gap",o1(bt.xs)),ui("min-width","0"),ui("max-width","100%"),ui("margin-right",o1(bt.md)),ui("flex","0 1 auto")]),l1=co([ui("font-size",o1(xt.sizeLg)),ui("font-weight",o1(xt.weightMedium)),ui("color",o1(_t.textPrimary)),ui("line-height",o1(xt.lineHeightTight)),ki(to(0)),ui("min-width","8ch"),ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),c1=co([ui("display","inline-flex"),di("center"),ui("vertical-align","middle"),ui("flex-wrap","wrap"),ui("gap",o1(bt.sm)),ui("flex","0 1 auto"),ui("min-width","0"),ui("max-width","100%")]),u1=co([gi("flex"),di("center"),ui("flex-wrap","wrap"),xi("flexEnd"),ui("gap",o1(bt.sm)),yi(0),ui("margin-left","auto")]),d1={titleGroup:a1};function f1(e){return"var("+e+")"}let h1=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("border-radius",f1(St.md)),ui("padding","2px var("+bt.sm+")"),ui("font-size",f1(xt.sizeSm)),ui("line-height","1.6"),ui("white-space","nowrap"),pi("pointer"),Ji([ui("opacity","0.4"),pi("notAllowed")])]),p1=uo([h1,co([ui("background",f1(_t.brand)),ui("color",f1(_t.textOnBrand)),ui("border","1px solid transparent"),Yi([ui("filter","brightness(1.08)")])])]),g1=uo([h1,co([ui("background",f1(_t.surface)),ui("color",f1(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),Yi([ui("background",f1(_t.surfaceSubtle))])])]);let m1=g1,v1=function(e){let t,n=e.inBar,s=e.actions,a=e.commands,l=e.titleAccessory,c=e.title,u=e.crumbs,f=void 0!==u?u:[],h=void 0!==l?l:null,p=void 0!==a?a:[],g=void 0!==s?s:null,m=void 0!==n&&n,v=d(UG),y=Pq(At.narrow),_=0!==f.length,b=e=>i("button",{children:e.label,className:U(e.primary,!1)?p1:g1,onClick:t=>e.run()},e.key);if(y&&p.length>2){let e=p.slice(1);t=r(o,{children:[L(p[0],null,b),i(i1,{items:e.map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1})),triggerLabel:"⋯ "+e.length.toString()})]})}else t=p.map(b);let x=L(e.controls,null,e=>VG(m?v:void 0,i("div",{children:e,className:u1}))),S=r(o,{children:[r("div",{children:[_?i(Y0,{crumbs:f,allLinks:!0}):null,_?Q0:null,i("h1",{children:c,className:l1,title:c}),h],className:a1}),r("div",{children:[t,g],className:c1}),x]});return m?S:i("div",{children:S,className:s1})};function y1(e,t){return void 0!==t?(e,n)=>t(e,n).then(rH):void 0!==e?(t,n)=>e(t,n).then(nH):void 0}function _1(){return y1(NI(),TI())}let b1=Ze([["ProductsNotAvailable",{template:"These products aren't available yet: {{missing}}.",idFields:[{field:"missing",entityStem:"product"}]}],["OrderAlreadyPlaced",{template:"This order has already been placed.",idFields:[]}],["CategoryAlreadyArchived",{template:"This category is already archived.",idFields:[]}]]);function x1(e,t){return L(j(ht(e),e=>Xe(e,t)),[],e=>{let t=ut(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,dt).filter(e=>""!==e);default:return[]}})}function S1(e,t){return ge(Qe(t),e,(e,t)=>e.replaceAll("{{"+t[0]+"}}",t[1]))}function w1(e,t,n,r){let i=function(e,t){return void 0!==e?void 0!==t?t+" ("+e+")":"Command rejected: "+e:void 0!==t?t:"Command rejected"}(n,r);if(void 0===n)return Promise.resolve(i);let o=Xe(b1,n);if(void 0===o)return Promise.resolve(i);if(0===o.idFields.length)return Promise.resolve(o.template);let s=function(e){return j(e,e=>{try{return JSON.parse(e)}catch(t){return}})}(r);if(void 0===s)return Promise.resolve(o.template);if(void 0!==e){let n=o.idFields.map(n=>{let r=n.field,i=x1(s,r);return 0===i.length?Promise.resolve([r,""]):function(e,t,n,r){let i=Ha(t,n);return void 0!==i?ce(GI(e,i,r).then(e=>{let t=e[0];return r.map(e=>{let n=Xe(t,e);return void 0!==n?n:e})}),e=>Promise.resolve(r)):Promise.resolve(r)}(e,t,n.entityStem,i).then(e=>Promise.resolve([r,e.join(", ")]))});return Promise.all(n).then(e=>{let t={};return e.forEach(e=>{t[e[0]]=e[1]}),Promise.resolve(S1(o.template,t))})}let a={};return o.idFields.forEach(e=>{let t=e.field,n=x1(s,t);a[t]=n.join(", ")}),Promise.resolve(S1(o.template,a))}let E1="This command could not be sent. See the console for details.";function k1(e,t,n,r,i,o,s,a,l){let c=void 0!==s?s:[],u=void 0!==a?a:e=>{},d=void 0!==l?l:e=>{},f=n.filter(e=>"Instance"===e.level),h=y1(e,t);return(t,n,s)=>{let a=f.find(e=>e.name===t);return void 0!==h?void 0!==a?(d(n),void ce(h(a.mutationDocument,function(e,t,n){let r={};return Qe(U(ht(n),{})).forEach(e=>{r[e[0]]=e[1]}),r[U(e.aggregateIdField,"id")]=t,r}(a,n,s)).then(n=>{if("object"!=typeof n)return"Accepted"===n?(i||o(),u("Cleared"),Promise.resolve()):(i||setTimeout(()=>o(),500),u("Cleared"),Promise.resolve());{if("Rejected"===n.TAG){let i=n._0;return console.warn("[AutoUI] "+r+": command "+t+" rejected"+L(i.errorCode,"",e=>" ("+e+")")),o(),w1(e,c,i.errorCode,i.detail).then(e=>(u({TAG:"Failed",_0:{command:a.label,reason:e}}),Promise.resolve()))}let i=n._0;return console.error("[AutoUI] "+r+": command "+t+" not executed — "+i),o(),u({TAG:"Failed",_0:{command:a.label,reason:i}}),Promise.resolve()}}),e=>(console.error("[AutoUI] "+r+": command "+t+" failed to reach the server"),u({TAG:"Failed",_0:{command:a.label,reason:"The request failed — the change was not sent."}}),o(),Promise.resolve()))):(console.error("[AutoUI] "+r+': command "'+t+'" is not an instance command of this view'),u({TAG:"Failed",_0:{command:t,reason:E1}})):(console.error("[AutoUI] "+r+': command "'+t+'" not sent — no GraphQL executor in context'),u({TAG:"Failed",_0:{command:t,reason:E1}}))}}function C1(e){return"var("+e+")"}let A1=co([Ui("relative"),gi("inlineBlock")]),N1=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background",C1(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",C1(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",C1(_t.textSecondary)),ui("font-size",C1(xt.sizeSm)),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",C1(_t.surfaceSubtle)),ui("color",C1(_t.textPrimary))])]),T1=co([gi("inlineFlex"),di("center"),xi("center"),ui("min-width","16px"),ui("height","16px"),ui("padding","0 4px"),ui("border-radius",C1(St.full)),ui("background",C1(_t.brand)),ui("color",C1(_t.textOnBrand)),ui("font-size",C1(xt.sizeXs)),ui("line-height","1")]),R1=co([Ui("absolute"),Si(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),gi("flex"),mi("column"),ui("gap",C1(bt.sm)),ui("align-items","stretch"),ui("background",C1(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",C1(St.md)),ui("box-shadow",C1(Et)),ui("padding",C1(bt.md)),ui("min-width","220px"),ui("max-width","min(320px, calc(100vw - 32px))"),ui("max-height","min(60vh, 420px)"),ui("overflow-y","auto"),ui("z-index","200")]);let D1=function(e){let t=e.label,n=e.activeCount,o=void 0!==t?t:"Filters",l=s(()=>!1),c=l[1],u=l[0];return a(()=>{if(!u)return;let e=e=>c(e=>!1);return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[u]),r("div",{children:[r("button",{children:[o,n>0?i("span",{children:n.toString(),className:T1}):null,i("span",{children:"▾","aria-hidden":!0})],"aria-expanded":u,className:N1,onClick:e=>{e.stopPropagation(),c(e=>!e)}}),u?i("div",{children:e.children,className:R1,onKeyDown:e=>{if("Escape"===e.key)return c(e=>!1)},onClick:e=>{e.stopPropagation()}}):null],className:A1})};function I1(e){return"var("+e+")"}let F1=co([gi("grid"),ui("grid-template-columns","minmax(0, 1fr) minmax(0, 1.4fr)"),ui("gap",I1(bt.lg)),ui("align-items","start"),Hi(At.narrow,[ui("grid-template-columns","minmax(0, 1fr)")])]),O1=co([ui("min-width","0"),ui("overflow","auto")]),P1=uo([O1,co([ui("border-left","1px solid var("+_t.border+")"),ui("padding-left",I1(bt.lg)),Hi(At.narrow,[ui("border-left","none"),ui("padding-left","0"),ui("border-top","1px solid var("+_t.border+")"),ui("padding-top",I1(bt.lg))])])]);let M1=function(e){return r("div",{children:[i("div",{children:e.master,className:O1}),i("div",{children:e.detail,className:P1})],className:F1})};function L1(e){return"var("+e+")"}let z1=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",L1(bt.md)),vi(1),ui("min-height","160px"),ui("color",L1(_t.textSecondary))]),j1=co([ui("width","32px"),ui("height","32px"),ui("border","3px solid var("+_t.borderSubtle+")"),ui("border-top-color",L1(_t.brand)),ui("border-radius","50%"),ui("animation","rv-spin 0.7s linear infinite")]),U1=co([ui("font-size",L1(xt.sizeSm)),ui("color",L1(_t.textSecondary))]);lo("@keyframes rv-spin",[Wi("from",[ui("transform","rotate(0deg)")]),Wi("to",[ui("transform","rotate(360deg)")])]);let B1=function(e){return r("div",{children:[i("div",{className:j1}),L(e.label,null,e=>i("span",{children:e,className:U1}))],className:z1})};function $1(e,t,n){let r={},i=[];e.forEach(e=>{let n=function(e,t){return U(j(Xe(e,t),dt),"")}(e,t),o=Xe(r,n);void 0!==o?o.push(e):(r[n]=[e],i.push(n))});let o=e=>{if(""===e)return n.length+1|0;let t=n.indexOf(e);return-1!==t?t:n.length};return i.toSorted((e,t)=>{let n=o(e),r=o(t);return n!==r?n-r|0:e<t?-1:e>t?1:0}).map(e=>[e,U(Xe(r,e),[])])}function q1(e){return j(j(ht(e),e=>Xe(e,"id")),dt)}function G1(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function V1(e,t){return j(ht(e),e=>Xe(e,t))}function K1(e){return!!e.startsWith("__")||e.startsWith("$")}let W1="$offload";function H1(e){let t=ut(e);if("object"!=typeof t)return!1;switch(t.TAG){case"JSONObject":let e=t._0;return!!$(Xe(e,W1))||Ye(e).some(H1);case"JSONArray":return t._0.some(H1);default:return!1}}function J1(e){let t=ut(e);if("object"==typeof t)switch(t.TAG){case"JSONObject":let e=t._0,n=j(Xe(e,W1),ht);if(void 0===n)return ge(Ye(e),void 0,(e,t)=>B(e,J1(t)));let r=j(Xe(n,"hash"),dt);return void 0!==r?r:j(Xe(n,"key"),dt);case"JSONArray":return ge(t._0,void 0,(e,t)=>B(e,J1(t)));default:return}}function X1(e,t){return me(t,t=>z(j(V1(e,t),J1),e=>[t,e]))}let Q1=new Map;function Y1(e,t,n,r){let i=void 0!==r?r:[],o=t.state;if(void 0===o)return;let s=G1(n);if(0===s.length)return;!function(e,t){let n=L(ht(e),[],e=>Object.keys(e).filter(e=>!K1(e)&&!t.includes(e)));if(0===n.length)return;let r=n.join(",");q(Q1.get(r))&&(Q1.set(r,!0),console.warn("AutoLiveApply: the live-update payload carries fields the state schema does not declare ("+r+") — they will not be merged. The persisted manifest is likely behind the deployed projection."))}(o,s);let a=function(e,t,n,r){return me(X1(t,n),t=>{let n=t[1],i=t[0],o=r.some(e=>e[0]===i&&e[1]===n),s=L(V1(e,i),!1,e=>"JSONNull"!==ut(e));if(o&&s)return i})}(e,o,s,i),l=function(e,t,n,r){let i=void 0!==r?r:[],o=ht(e),s=ht(t);if(void 0===o)return e;if(void 0===s)return e;let a=Ze(Qe(o));return n.filter(e=>!i.includes(e)).forEach(e=>{let t=Xe(s,e),n=Xe(o,e);return void 0!==t?void(a[e]=t):void 0!==n?void(a[e]=null):void 0}),a}(e,o,s,a);return function(e,t,n,r){let i=void 0!==r?r:[],o=n.some(e=>!i.includes(e)&&L(V1(t,e),!1,H1)),s=L(ht(e),!1,e=>Object.keys(e).some(e=>!K1(e)&&!n.includes(e))),a=s&&n.some(n=>!!function(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id"))||n>3&&t.endsWith("ids")}(n)&&yt(V1(e,n),V1(t,n)));return!o&&!a}(e,l,s,a)?l:void 0}let Z1={fromBatch:function(e,t,n){return z(j(j(ht(t),e=>Xe(e,n)),pt),t=>{let n=me(t,q1);return{rows:t,gone:e.filter(e=>!n.includes(e))}})},fromSingle:function(e,t){let n=j(ht(e),e=>Xe(e,t));if(void 0!==n)return"JSONNull"===ut(n)?"Absent":{TAG:"Present",_0:n}},drop:function(e,t){return 0===t.length?e:e.filter(e=>{let n=q1(e);return void 0===n||!t.includes(n)})}},e2=/^[0-9]+$/;function t2(e){if(!e2.test(e))return;let t=e.length;return e.slice((n=>{for(;;){let r=n;if(!(r<(t-1|0)&&vt(e[r],"0")))return r;n=r+1|0}})(0))}function n2(e,t,n){if(void 0===n)return!0;let r=e.get(t);return void 0===r||function(e,t){let n=t2(e),r=t2(t);if(void 0===n)return!0;if(void 0===r)return!0;let i=n.length,o=r.length;return i===o?n>r:i>o}(n,r)}let r2={make:function(){return new Map},shouldApply:n2,record:function(e,t,n){void 0!==n&&n2(e,t,n)&&e.set(t,n)}};function i2(e,t){return U(e.get(t),[])}function o2(e,t,n){0===n.length||e.set(t,n)}let s2={make:function(){return new Map},known:i2,record:o2,apply:function(e,t,n,r){let i=Y1(t,n,r,i2(e,n.id)),o=n.state;return void 0!==o&&o2(e,n.id,X1(o,G1(r))),i}};function a2(e,t,n){return me(FI(e,t),e=>{let t=j(Xe(e,"id"),dt),r=U(j(Xe(e,n),dt),U(t,""));return z(t,e=>({id:e,label:r}))})}function l2(e){return"var("+e+")"}function c2(e){if(""===e)return[];let t=pt(JSON.parse(e));return void 0!==t?me(t,dt):[e]}function u2(e){return JSON.stringify(e.map(e=>e))}let d2=co([Ui("relative"),Vi({NAME:"percent",VAL:100})]),f2=co([ui("background",l2(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",l2(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",l2(xt.sizeMd)),ui("color",l2(_t.textPrimary)),ui("outline","none"),Vi({NAME:"percent",VAL:100}),Fi(to(34)),gi("flex"),di("center"),_i("wrap"),ui("gap","4px"),pi("pointer"),$i("left"),Xi([ui("border-color",l2(_t.brand))])]),h2=co([ui("border-color",l2(_t.brand))]),p2=co([ui("border-color",l2(_t.error))]),g2=co([ui("color",l2(_t.textSecondary))]),m2=co([gi("inlineFlex"),di("center"),ui("background",l2(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",l2(St.sm)),ui("padding","2px 6px"),ui("font-size",l2(xt.sizeSm)),ui("gap","4px")]),v2=co([pi("pointer"),ui("color",l2(_t.textSecondary)),ui("font-weight",l2(xt.weightBold))]),y2=co([ui("border","none"),ui("background","transparent"),ui("outline","none"),ui("color",l2(_t.textPrimary)),ui("font-size",l2(xt.sizeMd)),vi(1),Oi(to(40))]),_2=co([Ui("absolute"),qi({NAME:"percent",VAL:100}),Si("zero"),Bi("zero"),Ti(to(2)),ui("background",l2(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",l2(St.sm)),ui("box-shadow",l2(Et)),Ei("none"),ki("zero"),zi("zero"),Di(to(240)),Li("auto"),Ki(20)]),b2=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),pi("pointer"),ui("color",l2(_t.textPrimary)),ui("font-size",l2(xt.sizeMd))]),x2=co([ui("background",l2(_t.surfaceSubtle))]),S2=co([ui("background",l2(_t.brandSubtle))]),w2=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",l2(_t.textSecondary)),ui("font-size",l2(xt.sizeSm))]);let E2=function(e){let t,n=e.autoFocus,o=e.hasError,l=e.onBlur,c=e.onChange,u=e.value,d=e.required,f=e.multi,p=e.labelField,g=e.queryField,m=e.fieldKey,y=void 0!==l?l:()=>{},_=void 0!==o&&o,b=void 0!==n&&n,x=function(e,t){let n=NI(),r=s(()=>({loading:!0,options:[],hasMore:!1})),i=r[1];return a(()=>{let r={contents:!1};if(i(e=>({loading:!0,options:[],hasMore:!1})),void 0!==n){let o="id"===t?"id":"id "+t,s="query { "+e+"(first: "+21..toString()+") { edges { node { "+o+" } } } }";ce(n(s,{}).then(n=>{if(!r.contents){let r=a2(n,e,t),o=r.length>=21,s=o?r.slice(0,20):r;i(e=>({loading:!1,options:s,hasMore:o}))}return Promise.resolve()}),t=>(r.contents||(console.warn("[AutoUI] RefField "+e+" fetch failed",t),i(e=>({loading:!1,options:[],hasMore:!1}))),Promise.resolve()))}else r.contents||i(e=>({loading:!1,options:[],hasMore:!1}));return()=>{r.contents=!0}},[n,e,t]),r[0]}(g,p),S=x.options,w=x.loading,E=h(void 0);if(f)t="Search";else{let e=E.current;if(void 0!==e)t=e;else if(w)t="Inline";else{let e=x.hasMore?"Search":"Inline";E.current=e,t=e}}let k=s(()=>!1),C=k[1],A=k[0],N=s(()=>0),R=N[1],D=N[0],I=s(()=>""),F=I[1],O=I[0],P=s(()=>[!1,240]),M=P[1],L=P[0],B=h(null),$=h(null),q=!f&&""!==u&&!S.some(e=>e.id===u),G=function(e,t,n){let r=NI(),i=s(()=>{}),o=i[1];return a(()=>{let i={contents:!1},s=0;if(void 0!==r&&void 0!==t&&""!==t){let s="query($id: ID!) { "+e+"(id: $id) { "+("id"===n?"id":"id "+n)+" } }",a={};a.id=t,ce(r(s,a).then(r=>{if(!i.contents){let i=ht(r),s=U(j(j(i,e=>Xe(e,"data")),ht),{}),a=Xe(s,e),l=void 0!==a?a:j(i,t=>Xe(t,e)),c=j(l,ht);if(void 0!==c){let e=U(j(Xe(c,"id"),dt),t),r=U(j(Xe(c,n),dt),e);o(t=>({id:e,label:r}))}else o(e=>{})}return Promise.resolve()}),e=>Promise.resolve())}else s=1;return 1===s&&o(e=>{}),()=>{i.contents=!0}},[r,t,n]),i[0]}(e.singleQueryField,q?u:void 0,p),V=e=>{let t=z(S.find(t=>t.id===e),e=>e.label),n=j(G,t=>{if(t.id===e)return t.label});return void 0!==t?t:void 0!==n?n:e};a(()=>{if(!A)return;let e=e=>{let t=e.target,n=B.current;if(null!=n&&!function(e,t){return e.contains(t)}(n,t))return C(e=>!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[A]),v(()=>{if(A){let e=B.current;null!=e&&M(t=>function(e){let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-12,r=t.top-12,i=n<240&&r>n,o=i?r:n;return[i,Math.max(120,Math.min(240,o))]}(e))}},[A]);let K,W="Search"===t&&""!==O,H=function(e,t,n){let r=NI(),i=s(()=>({loading:!1,options:[],error:!1})),o=i[1];return a(()=>{if(""===n)return void o(e=>({loading:!1,options:[],error:!1}));let i={contents:!1};o(e=>({loading:!0,options:e.options,error:e.error}));let s=setTimeout(()=>{if(i.contents)return;if(void 0===r)return o(e=>({loading:!1,options:[],error:!1}));let s="id"===t?"id":"id "+t,a="query($q: String!) { "+e+"(first: "+20..toString()+", filter: {search: $q}) { edges { node { "+s+" } } } }",l={};l.q=n,ce(r(a,l).then(n=>{if(!i.contents){let r=a2(n,e,t);o(e=>({loading:!1,options:r,error:!1}))}return Promise.resolve()}),t=>(i.contents||(console.warn("[AutoUI] RefField "+e+" search failed; falling back to client-side filter",t),o(e=>({loading:!1,options:[],error:!0}))),Promise.resolve()))},250);return()=>{i.contents=!0,clearTimeout(s)}},[r,n,e]),i[0]}(g,p,W?O:""),J=function(e,t){if(""===t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n))}(S,O),X=W&&!H.error?H.options:J,Q=X.length,Y=w||W&&H.loading,Z=e=>{let t=c2(u),n=t.some(t=>t===e)?t.filter(t=>t!==e):t.concat([e]);c(m,JSON.stringify(n.map(e=>e))),F(e=>""),R(e=>0);let r=$.current;null==r||r.focus()},ee=e=>{let t=X[e];if(void 0!==t){if(f)return Z(t.id);{let e=t.id;return c(m,e),C(e=>!1),F(e=>"")}}},te=e=>{switch(e.key){case"ArrowDown":return e.preventDefault(),A?R(e=>0===Q?0:fe(e+1|0,Q)):C(e=>!0);case"ArrowUp":return e.preventDefault(),R(e=>0===Q?0:fe((e-1|0)+Q|0,Q));case"Backspace":if(!f||""!==O)return;let t=c2(u);if(0===t.length)return;let n=t.slice(0,t.length-1|0);return c(m,JSON.stringify(n.map(e=>e)));case"Enter":return A?(e.preventDefault(),ee(D)):void 0;case"Escape":return A?C(e=>!1):void 0;default:return}},ne=A?f2+" "+h2:f2,re=_?ne+" "+p2:ne,ie=(0|L[1]).toString()+"px",oe=L[0]?{bottom:"100%",marginTop:"0",marginBottom:"2px",maxHeight:ie,top:"auto"}:{maxHeight:ie};if(Y)K=i("li",{children:"Loading…",className:w2});else if(0===Q)K=i("li",{children:""===O?"No options":"No matches",className:w2});else{let e=f?c2(u):""===u?[]:[u];K=X.map((t,n)=>{let r=e.some(e=>e===t.id),o=function(e){let t=e.length,n=0;for(let i=0;i<t;++i)n=n+e[i].length|0;let r=new Array(n);n=0;for(let i=0;i<t;++i){let t=e[i];for(let e=0,i=t.length;e<i;++e)r[n]=t[e],n=n+1|0}return r}([[b2],n===D?[x2]:[],r?[S2]:[]]).join(" ");return i("li",{children:t.label,"aria-selected":r,className:o,role:"option",onMouseDown:e=>{e.preventDefault(),ee(n)},onMouseEnter:e=>R(e=>n)},t.id)})}let se,ae=i("ul",{children:K,className:_2,role:"listbox",style:oe});return se="Inline"===t?i("button",{children:""===u?i("span",{children:d?"Select…":"—",className:g2}):V(u),className:re,autoFocus:b,type:"button",onKeyDown:te,onBlur:e=>y(),onClick:e=>C(e=>!e)}):r("div",{children:[f?c2(u).map(e=>r("span",{children:[V(e),i("span",{children:"×",className:v2,onClick:t=>{t.stopPropagation(),Z(e)}})],className:m2},e)):null,i("input",{ref:T($),className:y2,autoFocus:b,placeholder:d?"Search…":"—",type:"text",value:f||A?O:""===u?"":V(u),onKeyDown:te,onFocus:e=>C(e=>!0),onBlur:e=>y(),onChange:e=>{let t=e.target.value;F(e=>t)}})],className:re,onClick:e=>C(e=>!0)}),r("div",{children:[se,A?ae:null],ref:T(B),className:d2})};function k2(e){return e.pluginId+"."+e.slice+"."+e.command.name}function C2(e,t,n){return e}function A2(e,t,n){let r=void 0!==n?n:C2;return z(function(e,t,n,r){return j(e.find(e=>e.id===t),e=>{let t=e.aggregates.find(e=>e.name===n);return void 0!==t?z(t.commands.find(e=>e.name===r),n=>({plugin:e,enclosingAggregate:t,command:n})):j(e.stateChangeSlices.find(e=>e.name===n),t=>z(t.commands.find(e=>e.name===r),t=>({plugin:e,enclosingAggregate:void 0,command:t})))})}(t,e.pluginId,e.slice,e.command),t=>{let n=t.plugin,i=r(t.command,t.enclosingAggregate,n.id);return{label:U(e.label,i.label),pluginId:n.id,slice:e.slice,command:i,field:e.field,whenState:e.whenState,whenRetired:e.whenRetired,navigateTo:j(e.then,e=>""===e.trim()?void 0:e)}})}function N2(e,t,n,r){let i=U(j(r,e=>Vs(e,Xe(t,e.field))),!1),o=j(n,e=>iH(t,e));return e.filter(e=>{if(i&&!vt(e.whenRetired,!0))return!1;let t=e.whenState;return void 0===t||L(o,!1,e=>t.includes(e))})}function T2(e,t){let n=e.refFields.find(e=>e.propertyKey===t);return void 0!==n?n.multi:"array"===U(j(j(j(z(j(j(j(ht(e.schema),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),Lt),ht),e=>Xe(e,"type")),dt),"")}function R2(e,t){return Ze([[e.field,T2(e.command,e.field)?u2([t]):t]])}function D2(e,t){return{command:e.command,initialValues:R2(e,t),navigateTo:e.navigateTo,formKey:e.command.name+":"+t}}function I2(e){return"var("+e+")"}let F2="168px",O2=co([gi("flex"),mi("column"),ui("gap",I2(bt.sm))]),P2=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",I2(bt.sm))]),M2=co([gi("inlineFlex"),di("center"),ui("gap",I2(bt.xs))]),L2=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",I2(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",I2(_t.textSecondary)),ui("font-size",I2(xt.sizeSm)),pi("pointer"),Yi([ui("background",I2(_t.surfaceSubtle)),ui("color",I2(_t.textPrimary))])]),z2=uo([L2,co([ui("background",I2(_t.surfaceSubtle)),ui("color",I2(_t.textPrimary)),ui("font-weight",I2(xt.weightMedium))])]),j2=co([ui("font-size",I2(xt.sizeMd)),ui("font-weight",I2(xt.weightMedium)),ui("color",I2(_t.textPrimary))]),U2=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",I2(St.md)),ui("overflow","hidden")]),B2=co([gi("flex"),di("stretch")]),$2=uo([B2,co([ui("background",I2(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")])]),q2=uo([B2,co([ui("border-top","1px solid var("+_t.borderSubtle+")")])]),G2=co([ui("flex","0 0 "+F2),ui("padding","4px var("+bt.sm+")"),ui("font-size",I2(xt.sizeXs)),ui("color",I2(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),V2=co([ui("flex","0 0 "+F2),ui("padding","6px var("+bt.sm+")"),ui("font-size",I2(xt.sizeSm)),ui("font-weight",I2(xt.weightMedium)),ui("color",I2(_t.textPrimary)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),K2=uo([V2,co([ui("color",I2(_t.textDisabled)),ui("font-style","italic")])]);function W2(e){return co([gi("grid"),ui("flex","1 1 auto"),ui("grid-template-columns","repeat("+e.toString()+", minmax(0, 1fr))")])}let H2=co([ui("background",I2(_t.surfaceSubtle))]),J2=co([ui("padding","4px var("+bt.xs+")"),ui("font-size",I2(xt.sizeXs)),ui("color",I2(_t.textSecondary)),ui("border-left","1px solid var("+_t.borderSubtle+")")]),X2=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","48px"),ui("padding","3px"),ui("border-left","1px solid var("+_t.borderSubtle+")")]),Q2=uo([X2,co([ui("background",I2(_t.surfaceSubtle))])]);function Y2(e){return co([gi("block"),ui("width","100%"),ui("text-align","left"),ui("border","none"),ui("border-left","3px solid "+e),ui("border-radius",I2(St.sm)),ui("background",I2(_t.surfaceSubtle)),ui("color",I2(_t.textPrimary)),ui("font-size",I2(xt.sizeXs)),ui("padding","1px var("+bt.xs+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",I2(_t.surfaceElevated))])])}let Z2=co([pi("grab")]),e3=co([Pi(.85),ui("z-index","10"),pi("grabbing")]),t3=co([ui("font-size",I2(xt.sizeXs)),ui("color",I2(_t.textDisabled))]),n3="var("+_t.brand+")";function r3(e,t){return e.filter(e=>sc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function i3(e,t){return cc(e.start)||!ic(e.start,t)?e.title:lc(e.start)+" "+e.title}function o3(e){let t=e.draggable,n=e.event,r=dQ({id:n.key,disabled:!t}),o=t?Y2(U(n.accent,n3))+" "+Z2:Y2(U(n.accent,n3)),s=r.isDragging?o+" "+e3:o,a=z(mQ(r.transform),e=>({transform:e})),l=r.listeners,c=null==l?void 0:T(l);return i("button",{children:i3(n,e.day),ref:T(r.setNodeRef),className:s,style:a,title:n.title,onKeyDown:e=>M(c,t=>gQ(t,e)),onClick:e=>n.onOpen(),onPointerDown:e=>M(c,t=>pQ(t,e))})}function s3(e){let t=e.draggable,n=e.today,o=e.days,s=e.lane,a=hQ({id:s.unassigned?"":s.resourceId}),l=!s.unassigned&&a.isOver?W2(o.length)+" "+H2:W2(o.length);return r("div",{children:[i("div",{children:s.label,className:s.unassigned?K2:V2}),i("div",{children:o.map(e=>i("div",{children:r3(s.events,e).map(n=>i(o3,{event:n,day:e,draggable:t},n.key)),className:e===n?Q2:X2},e.toString())),ref:T(a.setNodeRef),className:l})],className:q2})}let a3=function(e){let t,n=e.onReassign,o=e.initialDate,a=e.windowNote,l=e.lanes,c=s(()=>"Week"),u=c[1],d=c[0],f=s(()=>Zl(U(o,Date.now()))),h=f[1],p=f[0],g=Zl(Date.now()),m=$(n);t="Week"===d?pe(7,e=>ec(nc(p),e)):[Zl(p)];let v,y=e=>h(t=>ec(t,"Week"===d?7*e|0:e)),_=(e,t)=>i("button",{children:t,className:d===e?z2:L2,onClick:t=>u(t=>e)});return v="Week"===d?dc(p):pc(p)+" — "+dc(p),r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:L2,onClick:e=>y(-1)}),i("button",{children:"Today",className:L2,onClick:e=>h(e=>g)}),i("button",{children:"›",className:L2,onClick:e=>y(1)}),i("span",{children:v,className:j2})],className:M2}),r("div",{children:[_("Week","Week"),_("Day","Day")],className:M2})],className:P2}),i(lQ,{onDragEnd:e=>{let t=e.over;if(void 0===n)return;if(null==t)return;if(""===t.id)return;let r=l.find(t=>t.events.some(t=>t.key===e.active.id));return L(r,!0,e=>e.resourceId!==t.id)?n(e.active.id,t.id):void 0},children:r("div",{children:[r("div",{children:[i("div",{children:"Resource",className:G2}),i("div",{children:t.map(e=>i("div",{children:pc(e),className:J2},e.toString())),className:W2(t.length)})],className:$2}),l.map(e=>i(s3,{lane:e,days:t,today:g,draggable:m},e.unassigned?"\0unassigned":e.resourceId))],className:U2})}),void 0!==a?i("span",{children:a,className:t3}):null],className:O2})};function l3(e){switch(e){case"Hints":return"hints";case"DeclaredTarget":return"declared-target";case"SchemaTarget":return"schema-target";case"Setter":return"setter"}}function c3(e,t){return e+"→"+t}function u3(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function d3(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt).filter(e=>"TAG"!==e)}function f3(e){return e.filter(e=>"Instance"===e.level)}function h3(e,t){let n=e.allowedStates;return void 0===n||0===n.length||n.includes(t)}function p3(e){let t=e.allowedStates,n=e.targetState;return void 0!==t&&void 0===n}function g3(e,t,n){return u3(e.schema).includes(t)?Ze([[t,n]]):{}}function m3(e){return 1!==e.length?void 0:e[0]}function v3(e,t,n){let r=f3(t),i=function(e,t){let n=e.filter(e=>!(p3(e)||!u3(e.schema).includes(t))&&d3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField)));return 1!==n.length?void 0:n[0]}(r,e);return(t,o)=>{let s=(n,r)=>{if(h3(n,t))return{command:n.name,patch:g3(n,e,o),tier:r}},a=j(j(j(n,e=>e[o]),e=>r.find(t=>t.name===e)),e=>s(e,"Hints"));if(void 0!==a)return a;let l=j(m3(r.filter(e=>!!h3(e,t)&&vt(e.targetState,o))),e=>s(e,"DeclaredTarget"));if(void 0!==l)return l;let c=j(m3(r.filter(n=>!(p3(n)||!h3(n,t))&&vt(function(e,t){let n=j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Xe(e,t));if(void 0===n)return;let r=j(j(ht(n),e=>Xe(e,"const")),dt);if(void 0!==r)return r;let i=$s(n);return void 0!==i&&1===i.length?i[0]:void 0}(n.schema,e),o))),e=>s(e,"SchemaTarget"));return void 0!==c?c:j(i,e=>s(e,"Setter"))}}function y3(e,t,n,r){let i=v3(t,n,r),o=qs(e,t),s={};return o.forEach(e=>{o.forEach(t=>M(i(e,t),n=>{s[c3(e,t)]=n}))}),s}function _3(e,t,n){let r=t+"→",i=me(Object.entries(e),e=>{let t=e[0];if(e[1].command===n&&t.startsWith(r))return t.slice(r.length)});return 1!==i.length?void 0:i[0]}let b3="resources",x3="events";function S3(e){return e.filter(e=>vt(e.role,x3))}function w3(e,t){return j(Xe(e,t),dt)}function E3(e){let t=function(e){return e.find(e=>vt(e.role,b3))}(e),n=S3(e),r=void 0!==t?t.rows.map(e=>{let n=U(ht(e),{}),r=U(w3(n,"id"),""),i=U(j(t.semantics.labelField,e=>w3(n,e)),r);return[r,i]}):[],i=r.map(e=>e[0]),o=n.map((e,t)=>me(e.rows,n=>{let r=U(ht(n),{}),i=U(w3(r,"id"),""),o=e.semantics.dateSpan;if(void 0!==o)return z(j(fa(o,r),gc),s=>{let a=j(ha(o,r),gc),l=U(j(e.semantics.labelField,e=>w3(r,e)),i),c=U(j(e.resourceRef,e=>w3(r,e)),""),u=function(e,t){return e.toString()+"::"+t}(t,i);return[c,{key:u,title:l,start:s,end_:a,accent:e.accent,onOpen:()=>e.onOpenRow(i,n)}]})})).flat(),s=e=>me(o,t=>{if(e(t[0]))return t[1]}),a=r.map(e=>{let t=e[0];return{resourceId:t,label:e[1],unassigned:!1,events:s(e=>e===t)}}),l=s(e=>!i.includes(e)),c=0!==l.length?[{resourceId:"",label:"Unassigned",unassigned:!0,events:l}]:[];return a.concat(c)}function k3(e){let t=e.sources,n=E3(t),r=S3(t),o=r.some(e=>!(!$(e.onCommand)||!$(e.assignCommand))&&$(e.resourceRef)),s=o?(e,t)=>M(function(e){let t=e.indexOf("::");if(-1!==t)return z(_e(e.slice(0,t)),n=>[n,e.slice(t+2|0)])}(e),e=>{let n=e[1];M(r[e[0]],e=>{let r=e.onCommand,i=e.assignCommand,o=e.resourceRef;if(void 0!==r&&void 0!==i&&void 0!==o)return r(i,n,Ze([[o,t]]))})}):void 0,a=ge(r,0,(e,t)=>e+t.rows.length|0),l=jo(rF(t),a,void 0,"scheduled item");return i(a3,{lanes:n,windowNote:l,onReassign:s})}let C3=i("span",{children:"☰","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),A3="scheduler";function N3(e){return!!$(Ba(e,void 0,void 0).dateSpan)&&Sa(e).some(e=>$(tI(e[0])))}function T3(e,t){let n=e.filter(e=>"Instance"===e.level).filter(e=>!!u3(e.schema).includes(t)&&d3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField)));if(1===n.length)return n[0].name}function R3(e){return"var("+e+")"}ZI({id:A3,label:"Scheduler",icon:C3,arity:{TAG:"Slots",_0:[{role:b3,min:1,max:1},{role:x3,min:1}]},isCapable:(e,t,n)=>N3(e),render:e=>i(k3,{sources:e}),capability:"role join: a resources source (lanes) + an events source with a date span and an entity-ref to the resource"});let D3=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",R3(St.full)),ui("padding","2px var("+bt.sm+")"),ui("color",R3(_t.textSecondary)),ui("font-size",R3(xt.sizeXs)),ui("line-height","1.5")]),I3=co([pi("pointer"),Yi([ui("background",R3(_t.surfaceSubtle)),ui("color",R3(_t.textPrimary))])]),F3=co([Pi(.6),pi("notAllowed")]),O3=co([Hi(At.compact,[ui("display","none")])]);function P3(e){return co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",e)])}let M3=P3(R3(_t.success)),L3=P3(R3(_t.border)),z3=P3(R3(_t.border)),j3=fo([[0,[Pi(.4)]],[50,[Pi(1)]],[100,[Pi(.4)]]]),U3=co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",R3(_t.warning)),ro(j3),io({NAME:"ms",VAL:1200}),oo("infinite"),so("easeInOut")]);let B3=function(e){let t=e.onToggle,n=e.reconnecting,o=e.canBeLive,s=e.live,a=void 0!==n&&n,l=o?s&&a?[D3+" "+I3,U3,"Reconnecting…"]:s?[D3+" "+I3,M3,"Live"]:[D3+" "+I3,L3,"Snapshot"]:[D3+" "+F3,z3,"Off"],c=l[2],u=o?e=>t():void 0,d=o?s&&a?"Live updates on — reconnecting to the server":s?"Live updates on — click for snapshot mode":"Snapshot mode — click for live updates":"Live updates disabled globally";return r("button",{children:[i("span",{className:l[1]}),i("span",{children:c,className:O3})],"aria-label":"Live updates: "+c,className:l[0],title:d,disabled:!o,type:"button",onClick:u})};function $3(e){return"var("+e+")"}let q3=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background",$3(_t.brand)),ui("color",$3(_t.textOnBrand)),ui("border","none"),ui("border-radius",$3(St.full)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",$3(xt.sizeSm)),ui("font-weight",$3(xt.weightMedium)),pi("pointer"),Yi([ui("opacity","0.85")])]),G3=co([gi("flex"),di("center"),xi("center"),ui("padding","var("+bt.xs+") 0")]);let V3=function(e){let t=e.onClick,n=e.count,r=1===n?"1 new item — click to refresh":n.toString()+" new items — click to refresh";return i("div",{children:i("button",{children:r,className:q3,type:"button",onClick:e=>t()}),className:G3})};function K3(e,t,n,r,i,o){let l=void 0!==t?t:{},c=void 0!==n?n:"",u=void 0===r||r,d=void 0!==i?i:()=>{},f=NI(),h=TI(),p=s(()=>[]),g=p[1],m=s(()=>RI),v=m[1],y=m[0],_=s(()=>"Loading"),b=_[1],x=s(()=>0),S=x[1],w=s(()=>1),E=w[1],k=w[0],C=void 0!==h?(t,n)=>h(t,n).then(t=>[t.data,XO(t,e.queryField)]):void 0!==f?(e,t)=>f(e,t).then(e=>[e,void 0]):void 0;return a(()=>{if(u)if(void 0!==C){let t;if(b(e=>"Loading"),d(),void 0!==o){let e=Ze(L(ht(l),[],Qe));e.first=o*k|0,t=e}else t=l;ce(C(e.queryDocument,t).then(t=>{let n=t[1],r=t[0];return void 0!==n?b(e=>({TAG:"Refused",_0:n.message})):(g(t=>II(r,e.queryField)),v(t=>OI(r,e.queryField)),b(e=>"Loaded")),Promise.resolve()}),e=>(b(e=>({TAG:"Error",_0:"Failed to load data"})),Promise.resolve()))}else b(e=>({TAG:"Error",_0:"Not connected"}));else b(e=>"Loaded")},[x[0],c,u,k]),{rows:p[0],setRows:g,pageInfo:y,fetchState:_[0],refetch:()=>S(e=>e+1|0),loadMore:()=>E(e=>e+1|0),canLoadMore:y.hasNextPage}}function W3(e,t,n){let r=void 0===t||t,i=K3(e,void 0,void 0,r,void 0,50),o=h(void 0),s=h(r2.make()),a=h(s2.make()),l=xO(),c=r&&L(l,!1,t=>t.isLive(e.queryField));return dW(e.queryField,"All",c,t=>{if(!r2.shouldApply(s.current,t.id,t.seq))return;r2.record(s.current,t.id,t.seq);let n,r=t.changeKind;return n="Updated"===r?j(i.rows.find(e=>vt(q1(e),t.id)),n=>s2.apply(a.current,n,t,e.schema)):void 0,void 0!==n?i.setRows(e=>e.map(e=>vt(q1(e),t.id)?n:e)):(()=>{let e=o.current;void 0!==e&&clearTimeout(e),o.current=setTimeout(()=>{o.current=void 0,i.refetch()},250)})()},i.refetch),{rows:i.rows,fetchState:i.fetchState,refetch:i.refetch,isLive:c,loadMore:i.loadMore,canLoadMore:i.canLoadMore}}function H3(){try{return R(globalThis.localStorage)}catch(e){return}}let J3="reventless.live.";function X3(e){let t=H3();if(void 0===t)return!1;try{let n=D(t).getItem(J3+e);return null!=n&&"true"===n}catch(n){return!1}}function Q3(e){let t=s(()=>X3(e)),n=t[1],r=t[0];a(()=>{n(t=>X3(e))},[e]);let i=f(()=>{let t=!r;!function(e,t){let n=H3();if(void 0!==n)try{return void D(n).setItem(J3+e,t?"true":"false")}catch(r){return}}(e,t),n(e=>t)},[r,e]);return[r,i]}function Y3(e){switch(e.TAG){case"Invalid":return e._1;case"Valid":case"Pending":return 0}}function Z3(e){return[e._0,Y3(e)]}function e4(e,t){return Ee(t,e,(e,t)=>t(e))}function t4(e){switch(e.TAG){case"Invalid":return e;case"Valid":case"Pending":return{TAG:"Valid",_0:e._0}}}function n4(e){if(!e.includes("."))return e;let t=e.replace(/0+$/,"");return t.endsWith(".")?t.slice(0,t.length-1|0):t}function r4(e){let t=Z3(e),n=t[0];return isFinite(n)&&(0|n)===n?t4(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a whole number",tl:t[1]}}}function i4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return 0|n._0}function o4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return n._0}function s4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONString"===n.TAG)return n._0}function a4(e){let t=i4(e,"minLength"),n=i4(e,"maxLength"),r=z(s4(e,"pattern"),e=>new RegExp(e)),i=function(e){let t=s4(e,"format");if("cuid"===s4(e,"x-reventless-format"))return"Cuid";if(void 0!==t)switch(t){case"date-time":return"DateTime";case"email":return"Email";case"uri":return"Url";case"uuid":return"Uuid";default:return}}(e);return{minLength:t,maxLength:n,pattern:r,format:i,patternHint:s4(e,"description")}}function l4(e,t){return{min:o4(e,"minimum"),max:o4(e,"maximum"),integer:t}}function c4(e){return{minItems:i4(e,"minItems"),maxItems:i4(e,"maxItems")}}function u4(e){if("object"!=typeof e)return!1;switch(e.TAG){case"TextField":case"NumberField":case"EnumField":case"RefField":case"ItemsField":return e.required}}function d4(e){let t=e.indexOf("[]");if(-1===t)return;let n=e.slice(0,t),r=e.slice(t+2|0),i=r.startsWith(".")?r.slice(1):r;return""===n||""===i||i.includes("[]")?void 0:[n,i]}function f4(e){return j(Xe(e,"items"),e=>{let t=j(ht(e),e=>Xe(e,"type"));if(void 0!==t&&vt(dt(t),"object"))return e})}function h4(e,t){let n={},r={};(void 0!==t?t:[]).forEach(e=>{let t=d4(e.propertyKey);if(void 0!==t){let n=t[0],i=U(Xe(r,n),[]);return i.push({propertyKey:t[1],queryField:e.queryField,singleQueryField:e.singleQueryField,labelField:e.labelField,multi:e.multi,required:e.required,entityName:e.entityName,entityNamePlural:e.entityNamePlural}),void(r[n]=i)}n[e.propertyKey]=e});let i=ut(e);if("object"!=typeof i)return[];if("JSONObject"!==i.TAG)return[];let o,s=i._0,a=Xe(s,"required");if(void 0!==a){let e=ut(a);o="object"!=typeof e?[]:"JSONArray"===e.TAG?me(e._0,e=>{let t=ut(e);return"object"!=typeof t||"JSONString"!==t.TAG?void 0:t._0}):[]}else o=[];let l=Xe(s,"properties");if(void 0===l)return[];let c=ut(l);return"object"!=typeof c?[]:"JSONObject"===c.TAG?me(Qe(c._0),e=>{let t=e[1],i=e[0],s=ut(t);if("object"!=typeof s)return;if("JSONObject"!==s.TAG)return;let a=s._0;if($(Xe(a,"const")))return;let l,c=Xe(a,"type");if(void 0!==c){let e=ut(c);l="object"!=typeof e||"JSONString"!==e.TAG?"string":e._0}else l="string";let u,d=o.some(e=>e===i),f=Xe(n,i);if(void 0!==f)u=f.multi?f.entityNamePlural:f.entityName;else{let e=Xe(a,"title");if(void 0!==e){let t=ut(e);u="object"!=typeof t||"JSONString"!==t.TAG?lt(i):t._0}else u=lt(i)}let h,p,g=Xe(a,"enum");if(void 0!==g){let e=ut(g);h="object"!=typeof e||"JSONArray"!==e.TAG?void 0:me(e._0,e=>{let t=ut(e);return"object"!=typeof t||"JSONString"!==t.TAG?void 0:t._0})}else h=void 0;if(void 0!==f)p={TAG:"RefField",queryField:f.queryField,singleQueryField:f.singleQueryField,labelField:f.labelField,multi:f.multi,required:d,constraints:f.multi?c4(a):{}};else if("boolean"===l)p="BoolField";else if(void 0!==h)p={TAG:"EnumField",options:h,required:d};else switch(l){case"array":let e=f4(a);p=void 0!==e?{TAG:"ItemsField",itemSchema:e,itemRefFields:U(Xe(r,i),[]),required:d}:{TAG:"TextField",required:d,constraints:a4(a)};break;case"integer":p={TAG:"NumberField",required:d,constraints:l4(a,!0)};break;case"number":p={TAG:"NumberField",required:d,constraints:l4(a,!1)};break;default:p={TAG:"TextField",required:d,constraints:a4(a)}}return z(p,e=>({key:i,label:u,fieldType:e,propSchema:t}))}):[]}function p4(e){let t={};return e.forEach(e=>{let n,r=e.fieldType;if("object"!=typeof r)n="false";else switch(r.TAG){case"EnumField":n=U(r.options[0],"");break;case"ItemsField":n="[]";break;default:n=""}t[e.key]=n}),t}function g4(e,t){return j(z(Xe(e,t),Lt),ht)}function m4(e,t){let n=function(e){return U(j(j(ht(e),e=>Xe(e,"properties")),ht),{})}(e),r=FO(e),i={};return Qe(t).forEach(e=>{let t=e[1],o=e[0],s=function(e,t){return U(j(j(g4(e,t),e=>Xe(e,"type")),dt),"string")}(n,o),a=function(e,t){return $(j(j(g4(e,t),e=>Xe(e,"enum")),pt))}(n,o),l=""===t&&(e=>void 0!==r&&!r.includes(e))(o)&&(a||"string"!==s);l||(i[o]=function(e,t,n){let r=0,i=0,o=0;if(""===n){if(void 0!==t&&t)return null;o=3}else o=3;if(3===o)switch(e){case"array":if(""===n)return[];try{return JSON.parse(n)}catch(s){return[n]}case"boolean":case"integer":case"number":case"object":i=2;break;default:r=1}if(2===i){if(""===n)return null;r=1}if(1===r){let t=0;switch(e){case"boolean":return"true"===n;case"integer":case"number":t=2;break;case"object":try{return JSON.parse(n)}catch(a){return null}default:return n}if(2===t)return U(z(ra(n),e=>e),n)}}(s,a,t))}),i}function v4(e){let t={};return M(ht(e),e=>{Qe(e).forEach(e=>{t[e[0]]=function(e){let t=ut(e);if("object"!=typeof t)switch(t){case"JSONFalse":return"false";case"JSONTrue":return"true";case"JSONNull":return""}else switch(t.TAG){case"JSONString":return t._0;case"JSONNumber":return t._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}(e[1])})}),t}let y4=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function _4(e){let t=Z3(e),n=t[0];return null!==y4.exec(n)?t4(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid email address",tl:t[1]}}}function b4(e){let t,n=Z3(e),r=n[0];try{new URL(r),t=!0}catch(i){t=!1}return t?t4(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid URL",tl:n[1]}}}let x4=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function S4(e){let t=Z3(e),n=t[0];return null!==x4.exec(n)?t4(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid UUID",tl:t[1]}}}let w4=/^c[a-z0-9]{23,24}$/;function E4(e){let t=Z3(e),n=t[0];return null!==w4.exec(n)?t4(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid CUID",tl:t[1]}}}function k4(e){let t=Z3(e),n=t[0],r=Date.parse(n);return Number.isNaN(r)?{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid ISO 8601 date-time",tl:t[1]}}:t4(e)}function C4(e){let t=Y3(e);if(0!==t)return t.hd}function A4(e,t,n){if(""===e)return t?function(e){let t=Z3(e),n=t[0];return n.length>0?t4(e):{TAG:"Invalid",_0:n,_1:{hd:"Must not be empty",tl:t[1]}}}({TAG:"Pending",_0:e}):{TAG:"Valid",_0:e};let r=[];return M(n.minLength,e=>{r.push(function(e){return t=>{let n=Z3(t),r=n[0];return r.length>=e?t4(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+e.toString()+" characters",tl:n[1]}}}}(e))}),M(n.maxLength,e=>{r.push(function(e){return t=>{let n=Z3(t),r=n[0];return r.length<=e?t4(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+e.toString()+" characters",tl:n[1]}}}}(e))}),M(n.format,e=>{r.push(function(e){switch(e){case"Email":return _4;case"Url":return b4;case"Uuid":return S4;case"Cuid":return E4;case"DateTime":return k4}}(e))}),M(n.pattern,e=>{r.push(function(e,t){return n=>{let r=Z3(n),i=r[0];return null!==e.exec(i)?t4(n):{TAG:"Invalid",_0:i,_1:{hd:U(t,"Does not match the required pattern"),tl:r[1]}}}}(e,n.patternHint))}),0===r.length?{TAG:"Valid",_0:e}:e4({TAG:"Pending",_0:e},xe(r))}function N4(e,t,n){if(""===e)return t?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e};let r=ra(e);if(void 0===r)return{TAG:"Invalid",_0:e,_1:{hd:"Must be a number",tl:0}};let i=[];U(n.integer,!1)&&i.push(r4),M(n.min,e=>{i.push(function(e){return t=>{let n=Z3(t),r=n[0];return r>=e?t4(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+n4(e.toString()),tl:n[1]}}}}(e))}),M(n.max,e=>{i.push(function(e){return t=>{let n=Z3(t),r=n[0];return r<=e?t4(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+n4(e.toString()),tl:n[1]}}}}(e))});let o=Y3(e4({TAG:"Pending",_0:r},xe(i)));return 0!==o?{TAG:"Invalid",_0:e,_1:o}:{TAG:"Valid",_0:e}}function T4(e,t){return t&&""===e?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e}}function R4(e,t){let n=e.propSchema;if(void 0!==n&&function(e,t){return L(bD(e,t),!1,e=>$(e.input))}(e.key,n)){let r=u4(e.fieldType),i=function(e,t,n,r){return j(j(bD(e,t),e=>e.validateInput),i=>i(e,t,n,r))}(e.key,n,t,r);return void 0!==i?{TAG:"Invalid",_0:t,_1:{hd:i,tl:0}}:{TAG:"Valid",_0:t}}let r=e.fieldType;if("object"!=typeof r)return{TAG:"Valid",_0:t};switch(r.TAG){case"TextField":return A4(t,r.required,r.constraints);case"NumberField":return N4(t,r.required,r.constraints);case"EnumField":return T4(t,r.required);case"RefField":return r.multi?function(e,t,n){let r=c2(e).length;if(0===r&&t)return{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}};let i={contents:0};return M(n.maxItems,e=>{r>e&&(i.contents={hd:"Select at most "+e.toString()+" items",tl:i.contents})}),M(n.minItems,e=>{r<e&&(t||r>0)&&(i.contents={hd:"Select at least "+e.toString()+" items",tl:i.contents})}),0!==i.contents?{TAG:"Invalid",_0:e,_1:i.contents}:{TAG:"Valid",_0:e}}(t,r.required,r.constraints):T4(t,r.required);case"ItemsField":return function(e,t,n,r){let i;if(""===e)i=[];else try{i=pt(JSON.parse(e))}catch(a){i=void 0}if(void 0===i)return{TAG:"Invalid",_0:e,_1:{hd:"Not a valid list",tl:0}};if(0===i.length)return t?{TAG:"Invalid",_0:e,_1:{hd:"Add at least one row",tl:0}}:{TAG:"Valid",_0:e};let o=h4(n,r),s=me(i.map((e,t)=>{let n=v4(e);return me(o,e=>z(C4(R4(e,U(Xe(n,e.key),""))),e=>"Row "+(t+1|0).toString()+": "+e))[0]}),e=>e);return 0!==s.length?{TAG:"Invalid",_0:e,_1:xe(s)}:{TAG:"Valid",_0:e}}(t,r.required,r.itemSchema,r.itemRefFields)}}function D4(e){return"var("+e+")"}let I4=co([gi("flex"),mi("column"),ui("gap",D4(bt.md))]),F4=co([gi("flex"),mi("column"),ui("gap","4px")]),O4=co([ui("color",D4(_t.textSecondary)),ui("font-size",D4(xt.sizeSm)),ui("font-weight",D4(xt.weightMedium))]),P4=co([ui("color",D4(_t.error)),Ai(to(2))]),M4=co([ui("background",D4(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",D4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",D4(xt.sizeMd)),ui("color",D4(_t.textPrimary)),ui("outline","none"),Vi({NAME:"percent",VAL:100}),ui("transition","border-color 120ms, box-shadow 120ms"),Xi([ui("border-color",D4(_t.brand))])]),L4=co([ui("border-color",D4(_t.error)),Xi([ui("border-color",D4(_t.error)),ui("box-shadow","0 0 0 2px color-mix(in srgb, var("+_t.error+") 25%, transparent)")])]),z4=co([ui("color",D4(_t.error)),ui("font-size",D4(xt.sizeXs)),ui("min-height","1.1em"),ui("line-height","1.1"),Ti(to(2))]),j4=co([pi("pointer"),Ni(to(6))]),U4=co([ui("background",D4(_t.brand)),ui("color",D4(_t.textOnBrand)),ui("border","none"),ui("border-radius",D4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",D4(xt.sizeMd)),pi("pointer"),fi("flexStart"),ui("transition","opacity 120ms")]),B4=co([Pi(.5),pi("notAllowed")]),$4=co([gi("flex"),mi("column"),ui("gap",D4(bt.sm)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",D4(St.sm)),ui("padding",D4(bt.sm))]),q4=co([ui("color",D4(_t.textSecondary)),ui("font-size",D4(xt.sizeSm))]),G4=co([gi("flex"),di("flexStart"),ui("gap",D4(bt.sm)),ui("padding-bottom",D4(bt.sm)),ui("border-bottom","1px solid var("+_t.border+")")]),V4=co([gi("flex"),_i("wrap"),ui("gap",D4(bt.sm)),vi(1),Oi(to(0))]),K4=co([ui("background",D4(_t.surface)),ui("color",D4(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",D4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",D4(xt.sizeSm)),pi("pointer")]),W4=co([ui("margin-top","1.4em")]),H4=co([fi("flexStart")]);function J4(e){let t=e.error;return r("div",{children:[r("label",{children:[e.label,e.required?i("span",{children:"*",className:P4}):null],className:O4}),e.children,i("div",{children:void 0!==t?t:null,className:z4})],className:F4})}function X4(e){let t=e.autoFocus,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value,l=e.field,c=void 0!==n&&n,u=void 0!==t&&t,d=u4(l.fieldType),f=c?M4+" "+L4:M4,h=e=>o(l.key),p=l.propSchema,g=void 0!==p?function(e,t,n,r,i,o,s){return z(j(bD(e,t),e=>e.input),a=>a(e,t,n,r,i,o,s))}(l.key,p,a,e=>s(l.key,e),()=>o(l.key),d,c):void 0;if(void 0!==g)return g;let m=l.fieldType;if("object"!=typeof m)return r("label",{children:[i("input",{className:j4,checked:"true"===a,type:"checkbox",onBlur:h,onChange:e=>s(l.key,e.target.checked?"true":"false")}),"Enabled"],className:O4});switch(m.TAG){case"TextField":let e,t=m.constraints.format;if(void 0!==t)switch(t){case"Email":e="email";break;case"Url":e="url";break;default:e="text"}else e="text";return i("input",{className:f,autoFocus:u,type:e,value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"NumberField":return i("input",{className:f,autoFocus:u,type:"number",value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"EnumField":return i("select",{children:m.options.map(e=>i("option",{children:e,value:e},e)),className:f,value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"RefField":return i(E2,{fieldKey:l.key,queryField:m.queryField,singleQueryField:m.singleQueryField,labelField:m.labelField,multi:m.multi,required:m.required,value:a,onChange:s,onBlur:()=>o(l.key),hasError:c,autoFocus:u});case"ItemsField":return i("input",{className:f,autoFocus:u,type:"text",value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)})}}function Q4(e){let t=e.showError,n=e.onBlur,o=e.onChange,s=e.itemRefFields,a=e.itemSchema,l=e.fieldKey,c=p(()=>h4(a,s),[a,s]),u=function(e,t){let n,r=p4(t);if(""===e)n=[];else{let t;try{t=pt(JSON.parse(e))}catch(i){t=void 0}n=void 0!==t?t:[]}return n.map(e=>{let t=Ze(Qe(r));return Qe(v4(e)).forEach(e=>{t[e[0]]=e[1]}),t})}(e.value,c),d=e=>o(l,function(e,t){return JSON.stringify(e.map(e=>m4(t,e)))}(e,a));return r("div",{children:[0===u.length?i("div",{children:"No rows yet.",className:q4}):null,u.map((e,o)=>r("div",{children:[i("div",{children:c.map(r=>{let s=U(Xe(e,r.key),""),a=t?C4(R4(r,s)):void 0;return i(J4,{label:r.label,required:u4(r.fieldType),error:a,children:i(X4,{field:r,value:s,onChange:(e,t)=>d(u.map((n,r)=>{if(r!==o)return n;let i=Ze(Qe(n));return i[e]=t,i})),onBlur:e=>n(l),hasError:$(a)})},r.key)}),className:V4}),i("button",{children:"Remove","aria-label":"Remove row "+(o+1|0).toString(),className:K4+" "+W4,type:"button",onClick:e=>d(u.filter((e,t)=>t!==o))})],className:G4},o.toString())),i("button",{children:"Add row",className:K4+" "+H4,type:"button",onClick:e=>d(u.concat([p4(c)]))})],className:$4})}function Y4(e){let t,n=e.autoFocus,r=e.showError,o=e.errorMessage,s=e.onBlur,a=e.onChange,l=e.value,c=e.field,u=void 0!==r&&r,d=void 0!==n&&n,f=u4(c.fieldType),h=u&&$(o),p=c.fieldType,g=0;return"object"!=typeof p||"ItemsField"!==p.TAG?g=1:t=i(Q4,{fieldKey:c.key,itemSchema:p.itemSchema,itemRefFields:p.itemRefFields,value:l,onChange:a,onBlur:s,showError:u}),1===g&&(t=i(X4,{field:c,value:l,onChange:a,onBlur:s,hasError:h,autoFocus:d})),i(J4,{label:c.label,required:f,error:h?o:void 0,children:t})}let Z4=function(e){let t=e.refFields,n=e.initialValues,o=e.submitLabel,a=e.onSubmit,l=e.schema,c=void 0!==o?o:"Submit",u=void 0!==t?t:[],d=p(()=>h4(l,u),[l,u]),f=s(()=>{let e=p4(d);return M(n,t=>{Qe(t).forEach(t=>{e[t[0]]=t[1]})}),e}),h=f[1],g=f[0],m=s(()=>({})),v=m[1],y=m[0],_=s(()=>!1),b=_[1],x=_[0],S=p(()=>d.map(e=>{let t=U(Xe(g,e.key),"");return[e.key,R4(e,t)]}),[d,g]),w=S.every(e=>function(e){return function(e){switch(e.TAG){case"Valid":return!0;case"Invalid":case"Pending":return!1}}(e)}(e[1])),E={};S.forEach(e=>{let t=C4(e[1]);void 0===t||(E[e[0]]=t)});let k=(e,t)=>h(n=>{let r=Ze(Qe(n));return r[e]=t,r}),C=e=>v(t=>{let n=Ze(Qe(t));return n[e]=!0,n}),A=x&&!w,N=A?U4+" "+B4:U4;return r("form",{children:[d.map((e,t)=>{let n=U(Xe(y,e.key),!1);return i(Y4,{field:e,value:U(Xe(g,e.key),""),onChange:k,onBlur:C,errorMessage:Xe(E,e.key),showError:n||x,autoFocus:0===t},e.key)}),i("button",{children:c,className:N,disabled:A,type:"submit"})],className:I4,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),b(e=>!0),w)return a(g)}})};function e5(e){switch(e){case"SubmitStarted":return!1;case"FormOpened":case"SubmitFailed":return!0}}let t5=l(void 0),n5=t5.Provider;let r5=function(e){return c(n5,{value:e.session,children:e.children})};let i5=co([gi("flex"),mi("column"),ui("gap",function(e){return"var("+e+")"}(bt.md))]);let o5=function(e){let t=e.submitLabel,n=e.onSubmit,o=e.refFields,a=e.ownerValue,l=e.ownerField,c=e.injectNewId,u=e.aggregateIdField,d=e.aggregateId,f=e.schema,g=void 0!==c&&c,m=void 0!==o?o:[],v=void 0!==t?t:"Submit",y=s(()=>{}),_=y[1],b=s(()=>!1),x=b[1],S=s(()=>crypto.randomUUID())[0],w=h(e5("FormOpened")),E=p(()=>({armed:w}),[]),k=void 0!==l&&void 0!==a?[l,a]:void 0,C=me([void 0!==d?void 0!==u||g?u:void 0:g?u:void 0,z(k,e=>e[0])],e=>e),A=0===C.length?f:U(z(ht(f),e=>{let t=Ze(Qe(e));return M(j(Xe(t,"properties"),ht),e=>{let n=Ze(Qe(e).filter(e=>!C.includes(e[0])));t.properties=n}),t}),f);return i(r5,{session:E,children:r("div",{children:[L(y[0],null,e=>i(YK,{variant:"Error",message:e})),b[0]?i(B1,{label:"Submitting..."}):null,i(Z4,{schema:A,onSubmit:e=>{let t=Ze(Qe(e));M(k,e=>{t[e[0]]=e[1]}),M(d,e=>{t[U(u,"id")]=e}),g&&(t[U(u,"id")]=S),x(e=>!0),_(e=>{}),w.current=e5("SubmitStarted"),n(t).then(e=>{if(x(e=>!1),"object"==typeof e){let t=e._0;w.current=e5("SubmitFailed"),_(e=>t)}return Promise.resolve()})},submitLabel:v,initialValues:e.initialValues,refFields:m})],className:i5})})};function s5(e){let t=Qe(e).filter(e=>""!==e[1]).toSorted((e,t)=>function(e,t){return e===t?0:e<t?-1:1}(e[0],t[0]));return 0===t.length?"":"?"+t.map(e=>encodeURIComponent(e[0])+"="+encodeURIComponent(e[1])).join("&")}function a5(e,t){let n=t.filter(e=>""===e[1]).map(e=>e[0]),r=t.filter(e=>""!==e[1]),i=Qe(e).filter(e=>{let t=e[0];return!n.includes(t)&&!r.some(e=>e[0]===t)});return Ze(i.concat(r))}function l5(){let e=Q(),t=function(e){let t={},n=e.startsWith("?")?e.slice(1):e;return""===n||n.split("&").forEach(e=>{let n=e.split("="),r=n.length;if(!(r>=3))switch(r){case 0:return;case 1:let e=n[0];return""!==e?void(t[decodeURIComponent(e)]=""):void 0;case 2:let r=n[0],i=n[1];return""!==r?void(t[decodeURIComponent(r)]=decodeURIComponent(i)):void 0}}),t}(e.search),n=function(e){if(0===e.path)return"/";let t=[];return function(e,t){for(;;){let n=e;if(0===n)return;t(n.hd),e=n.tl}}(e.path,e=>{t.push(e)}),"/"+t.join("/")}(e),r=""===e.hash?"":"#"+e.hash,i=e=>{let t=s5(e);J(n+t+r)};return{params:t,get:e=>Xe(t,e),set:(e,n)=>i(a5(t,[[e,n]])),setMany:e=>i(a5(t,e))}}let c5=l(void 0),u5=c5.Provider;let d5=function(e){return c(u5,{value:e.chrome,children:e.children})};function f5(e){return"var("+e+")"}let h5=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",f5(bt.md)),vi(1),ui("min-height","160px"),$i("center"),ui("padding",f5(bt.lg))]),p5=co([ui("font-size","32px"),ui("color",f5(_t.warning)),ui("line-height","1")]),g5=co([ui("color",f5(_t.textPrimary)),ui("font-size",f5(xt.sizeLg)),ui("font-weight",f5(xt.weightMedium)),ki(to(0))]),m5=co([ui("color",f5(_t.textSecondary)),ui("font-size",f5(xt.sizeSm)),ui("line-height",f5(xt.lineHeightNormal)),ui("max-width","440px"),ki(to(0))]),v5=co([ui("background","transparent"),ui("color",f5(_t.textSecondary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",f5(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",f5(xt.sizeSm)),ui("cursor","pointer"),Ti(to(4))]);let y5=function(e){let t=e.title,n=void 0!==t?t:"Unavailable";return r("div",{children:[i("div",{children:"( ! )",className:p5}),i("h3",{children:n,className:g5}),i("p",{children:e.detail,className:m5}),L(e.onRetry,null,e=>i("button",{children:"Try again",className:v5,onClick:t=>e()}))],className:h5})};function _5(e){return L(j(j(ht(e),e=>Xe(e,"properties")),ht),[],Qe)}function b5(e){return 1!==e.length?void 0:T(e[0])}function x5(e,t){return z(b5(_5(e.schema).filter(e=>t(e[0],e[1]))),e=>e[0])}function S5(e,t,n){return b5(me(e,e=>j(x5(e,n),n=>{if(function(e,t){return d3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField))}(e,n))return{command:e,argument:n,tier:t}})))}function w5(e,t){return vt(Is(e).storeTarget,t)}let E5={contents:[]};function k5(e,t,n){let r=e+"."+t.command+"."+U(t.field,"")+"."+n;if(!E5.contents.some(e=>e===r))return E5.contents.push(r),void console.error('[AutoUI] x-reventless-setter on field "'+e+'": '+n)}function C5(e,t,n,r){let i=b5(e.filter(e=>e.name===t.command));if(void 0!==i){let e=function(e,t,n,r){let i=t.field;return void 0!==i?_5(e.schema).some(e=>e[0]===i)?i:void 0:B(j(r,t=>x5(e,(e,n)=>w5(n,t))),x5(e,(e,t)=>e===n))}(i,t,n,r);return void 0!==e?{command:i,argument:e,tier:"Declared"}:void k5(n,t,'"'+t.command+'" takes no argument this field could fill — the slot stays static.')}k5(n,t,'no exposed instance command named "'+t.command+'" — the slot stays static.')}function A5(e,t,n){return j(function(e,t){return z(_5(e).find(e=>e[0]===t),e=>e[1])}(e,t),e=>{let r=Is(e),i=r.storeTarget,o=n.filter(e=>"Instance"===e.level),s=r.setter;if(void 0!==s)return C5(o,s,t,i);let a=j(i,e=>S5(o,"StoreMatch",(t,n)=>w5(n,e)));return void 0!==a?a:S5(o,"NameMatch",(e,n)=>e===t)})}function N5(e,t){let n=e.requiredRole;return void 0===n||t.includes(n)}let T5=function(e){let t=e.resource,n=W3(t,void 0),r={readModelName:t.name,rows:n.rows,schema:t.schema,semantics:e.resourceSemantics,window:Lo(n.canLoadMore),onOpenRow:(e,t)=>{},role:b3},o={readModelName:e.eventReadModelName,rows:e.eventRows,schema:e.eventSchema,semantics:e.eventSemantics,accent:e.eventAccent,window:e.eventWindow,onOpenRow:e.onOpenEvent,onCommand:e.onCommand,role:x3,resourceRef:e.resourceRef,assignCommand:e.assignCommand},s=n.fetchState;return"object"!=typeof s?"Loading"===s?i(B1,{}):e.mode.render([r,o]):"Error"===s.TAG?i(V0,{detail:s._0,onRetry:()=>n.refetch()}):i(y5,{detail:s._0,onRetry:()=>n.refetch()})},R5=l(void 0),D5=R5.Provider;let I5=function(e){return c(D5,{value:e.refresh,children:e.children})};function F5(e){return"var("+e+")"}let O5=co([gi("flex"),mi("column"),ui("gap",F5(bt.lg))]),P5=co([gi("flex"),mi("column"),ui("gap",F5(bt.lg))]),M5=co([gi("flex"),mi("column"),ui("gap",F5(bt.sm))]),L5=co([ui("font-size",F5(xt.sizeSm)),ui("font-weight",F5(xt.weightMedium)),ui("color",F5(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ki(to(0))]),z5=co([gi("flex"),di("center"),ui("gap",F5(bt.sm)),ui("flex-wrap","wrap")]),j5=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("margin-left","auto"),ui("font-size",F5(xt.sizeSm)),ui("color",F5(_t.textSecondary)),ui("cursor","pointer"),ui("white-space","nowrap")]),U5=co([gi("flex"),mi("column"),ui("gap",F5(bt.sm)),ui("align-items","stretch"),Wi("& ."+j5,[ui("margin-left","0")])]),B5=co([gi("flex"),di("center"),xi("flexEnd"),ui("gap",F5(bt.xs)),ui("padding-top",F5(bt.sm))]),$5=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",F5(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",F5(_t.textSecondary)),ui("font-size",F5(xt.sizeSm)),pi("pointer"),Yi([ui("background",F5(_t.surfaceSubtle)),ui("color",F5(_t.textPrimary))]),Ji([ui("opacity","0.4"),pi("notAllowed")])]);let q5={contents:[]},G5={contents:[]};let V5={contents:[]};let K5=function(e){let t,n=e.archiveOffered,l=e.rowActions,c=e.schedulerJoin,u=e.uiHints,d=e.liveOffered,f=e.sortKeyField,p=e.byIdsQueryDocument,g=e.byIdsQueryField,m=e.detailQueryDocument,v=e.singleQueryField,y=e.drillPath,_=e.openRowId,b=e.pluginId,x=e.detailView,S=e.rows,w=e.readModel,E=void 0!==y?y:[],k=void 0===d||d,C=void 0!==l?l:[],A=void 0!==n&&n,N=NI(),T=TI(),I=_1(),F=s(()=>{}),O=F[1],B=s(()=>{}),G=B[1],V=B[0],K=s(()=>({})),W=K[1],H=K[0],X=s(()=>"Loaded"),Q=X[1],Y=X[0],Z=s(()=>{}),ee=Z[1],te=Z[0],ne=xO(),re=L(ne,!1,e=>e.isLive(w.queryField)),ie=Q3(U(b,"default")+"."+w.name),oe=ie[0],se=re&&k&&oe,le=Wa(),ue=z(b,e=>({pluginId:e,viewName:w.name})),de=j(u,e=>xF(e,w.name)),fe=jF(w.schema,de,{registry:le,ownEntity:ue}),he=L(j(de,e=>e.suppress),!1,e=>e.includes(A3));if(void 0!==c&&(pe=w.schema,!he&&N3(pe))){let e=eF(A3);t=void 0===e||fe.some(t=>t.id===e.id)?fe:fe.concat([e])}else t=fe;var pe;let ve=sF(b,w.name,void 0),ye=s(()=>aF(ve)),_e=ye[1],be=Mq(),xe=be.narrow,Se=Lq(be),we=UF(ye[0],de,Bs(w.schema),Se,t),Ee=void 0!==c&&void 0!==we&&we.id===A3,ke=$(x)&&!Ee,Ce="reventless.layout."+U(b,"default")+"."+w.name,Ae=s(()=>function(e){try{return R(localStorage.getItem(e))}catch(t){return}}(Ce)),Ne=Ae[1],Te=function(e,t,n,r){if(!r)return"Full";let i=j(e,BF);if(void 0!==i)return i;let o=j(j(t,e=>e.layout),BF);return void 0!==o?o:U(j(n,BF),"Full")}(Ae[0],de,function(e){return j(j(ht(e),e=>Xe(e,"x-reventless-layout")),dt)}(w.schema),ke),Re=!(void 0===ne||!se)&&"Open"!==ne.statusFor(ne.apiForReadModel(w.queryField)),De=se&&!Re,Ie=s(()=>0),Fe=Ie[1],Oe=Ie[0],Pe=h({}),Me=h(void 0),Le=h(r2.make()),ze=h(r2.make()),je=h(s2.make()),Be=h(s2.make()),$e=h(new Map),qe=e=>{$e.current.set(e,Date.now())},Ve=l5(),Ke=s5(Ve.params),We=h(PI),He=ae(),Je=z(b,e=>Ue(Xa(e,w.name))+Ke),Ye=js(w.schema),et=$(Ls(w.schema)),tt=e=>z(j(Xe(e,"id"),dt),t=>{let n=j(Ye,t=>j(Xe(e,t),dt));return void 0!==n?function(e,t){return encodeURIComponent(e)+"/"+encodeURIComponent(t)}(t,n):t}),nt=e=>void 0!==Ye?z0(e)[0]:e,rt=(e,t)=>{let n=void 0===e||e,r={};if(void 0!==Ye){let e=z0(t);r.id=e[0],M(e[1],e=>{r.subId=e})}else r.id=t;return et&&(r.includeRetired=n),r},it=void 0!==_?_:V,ot=e=>void 0!==b?He(Ya(b,w.name,e,[])+Ke):G(t=>e),st=()=>void 0!==Je?He(Je):G(e=>{}),at=zK(w.schema),ct=LK(w.schema),ft=at.hasFilter||at.hasSort||at.hasSearch,gt=Ba(w.schema,j(u,e=>SF(e,w.name)),{field:w.labelField,source:w.labelFieldSource}),mt=aI(w.schema,void 0,le,ue,gt.labelField,gt.projectedLabelField),_t=Gs(w.schema,j(de,e=>e.retiredLabel)),bt=Hs.offered(A,_t),xt=Hs.showing(bt,Ve.get(Hs.param)),St=[];Qe(Ve.params).forEach(e=>{let t=e[1];if(""===t)return;let n=e[0];if("after"===n||"before"===n)return void St.push(n+"="+t);if(n===Hs.param&&bt)return void St.push(n+"="+t);if(!ft)return;if("sort"===n||"dir"===n)return void St.push(n+"="+t);if("q"===n&&ct.search)return void St.push(n+"="+t);if(!n.startsWith("f."))return;let r=n.slice(2),i=L(mt.find(e=>e.key===r),!1,e=>MK(e).filter);i&&St.push(n+"="+t)});let wt=St.toSorted((e,t)=>e===t?0:e<t?-1:1).join("|"),Et={};if(ft){let e={};Qe(Ve.params).forEach(t=>{let n=t[0];n.startsWith("f.")&&(e[n.slice(2)]=t[1])});let t=jK(e,mt),n=U(Ve.get("q"),""),r=BK(t[0],n,ct,mt),i="desc"===Ve.get("dir")?"Desc":"Asc",o=function(e){if("object"!=typeof e)return;if("ServerSort"!==e.TAG)return;let t="Asc"===e._1?"ASC":"DESC";return Ze([["field",e._0],["direction",t]])}(UK(Ve.get("sort"),i,mt));M(r,e=>{Et.filter=e}),M(o,e=>{Et.orderBy=e})}var kt,Ct,At;(kt=Ve.get("after"),Ct=Ve.get("before"),At=50,void 0!==Ct&&""!==Ct?[["before",Ct],["first",At]]:void 0!==kt&&""!==kt?[["first",At],["after",kt]]:[["first",At]]).forEach(e=>{Et[e[0]]=e[1]}),bt&&(Et.includeRetired=xt);let Nt=K3(w,Et,wt,void 0,()=>W(e=>({})),void 0),Tt=Nt.refetch,Rt=Nt.fetchState,Dt=Nt.pageInfo,It=Nt.setRows,Ft=Nt.rows,Ot=e=>{if(void 0===m)return;if(void 0===v)return;let t=((e,t,n)=>void 0!==T?()=>T(e,rt(void 0,n)).then(e=>[e.data,XO(e,t)]):void 0!==N?()=>N(e,rt(void 0,n)).then(e=>[e,void 0]):void 0)(m,v,e);return void 0!==t?(Q(e=>"Loading"),void ce(t().then(t=>{let n=t[1],r=j(ht(t[0]),e=>Xe(e,v)),i=0;return void 0!==n||void 0===r||"JSONNull"===ut(r)?i=1:(W(t=>{let n=Ze(Qe(t));return n[e]=r,n}),Q(e=>"Loaded")),1===i&&(W(t=>Ze(Qe(t).filter(t=>t[0]!==e))),Q(e=>void 0!==n?{TAG:"Refused",_0:n.message}:{TAG:"Error",_0:"Detail not found"})),Promise.resolve()}),e=>(Q(e=>({TAG:"Error",_0:"Failed to load detail"})),Promise.resolve()))):void 0};a(()=>{let e=void 0!==_?_:V;void 0!==e&&(q(Xe(H,e))?Ot(e):Q(e=>"Loaded"))},[_,V]);let Pt=Ge(),Mt=M0(),Lt=L(j(Iq(),e=>e.identity),[],e=>e.groups),zt=(e,t)=>z(P(A5(w.schema,t,w.commands),e=>N5(e.command,Lt)),t=>()=>O(n=>({command:t.command,rowId:e,formKey:t.command.name+":"+e}))),jt=e=>{let t=j(Xe(e,"id"),dt);return void 0!==t?N2(C,e,w.lifecycleField,_t).map(e=>{let n=D2(e,t);return{label:e.label,run:()=>O(e=>({command:n.command,rowId:void 0,initialValues:n.initialValues,navigateTo:n.navigateTo,formKey:n.formKey}))}}):[]},Ut=(e,t)=>jt(U(ht(t),{})),Bt=(void 0!==S?S:Ft).map(e=>U(ht(e),{})),$t=JI(Bt,mt,le,ue,void 0),qt={lookupLabel:(e,t)=>LI($t,e,le,t),isMissing:(e,t)=>UI($t,e,le,t),retiredBadge:(e,t)=>zI($t,e,le,t),linkable:(e,t)=>jI($t,e,le,t,A)},Gt=function(e,t){return void 0!==t&&""!==t?"Backward":void 0!==e&&""!==e?"Forward":"FirstPage"}(Ve.get("after"),Ve.get("before")),Vt=function(e,t){return!!e.hasNextPage||"Backward"===t}(Dt,Gt),Kt=function(e,t){return!!e.hasPreviousPage||"Forward"===t}(Dt,Gt),Wt=Vt||Kt,Ht=bI(mt,le,Pt,Xe,!0,qt,ue,(e,t)=>j(j(Xe(e,"id"),dt),e=>zt(e,t)),_t,gt.labelField).map(e=>{if(!e.sortable)return e;if(!Wt)return e;let t=L(mt.find(t=>t.key===e.key),!1,e=>MK(e).sort);return{key:e.key,label:e.label,render:e.render,sortable:t,width:e.width}}),Jt=Ve.get("sort"),Xt="desc"===Ve.get("dir")?"Desc":"Asc",Qt=e=>It(t=>t.map(t=>{let n=q1(t);if(void 0===n)return t;let r=e.find(e=>vt(q1(e),n));return void 0!==r?r:t})),Yt=void 0!==f?me(Ft,e=>j(j(ht(e),e=>Xe(e,f)),dt)):[],Zt=e=>{let t=Dt.hasNextPage,n=Yt.length;if(void 0===e)return!1;if(void 0===f)return!1;if(!t)return!1;if(n<=0)return!1;let r=Yt[0];if("Asc"===Xt){let t=ge(Yt,r,(e,t)=>e>t?e:t);return e>t}let i=ge(Yt,r,(e,t)=>e<t?e:t);return e<i},en=e=>{if(0!==e.length)return It(t=>Z1.drop(t,e))},tn=()=>{let e=Object.keys(Pe.current);if(Pe.current={},Me.current=void 0,0!==e.length){if(e.length>10)return Tt();if(void 0!==g&&void 0!==p&&void 0!==N){let t={};return t.ids=e.map(e=>e),bt&&(t.includeRetired=xt),void ce(N(p,t).then(t=>{let n=Z1.fromBatch(e,t,g);return void 0!==n&&(Qt(n.rows),q(Ye)&&en(n.gone)),Promise.resolve()}),e=>Promise.resolve())}return void 0!==Ye||void 0===v||void 0===m||void 0===N?Tt():void e.forEach(e=>{let t=rt(xt,e);ce(N(m,t).then(t=>{let n=Z1.fromSingle(t,v);return void 0!==n&&("object"!=typeof n?en([e]):Qt([n._0])),Promise.resolve()}),e=>Promise.resolve())})}},nn=e=>{Pe.current[e]=!0;let t=Me.current;void 0!==t&&clearTimeout(t),Me.current=setTimeout(tn,150)},rn=e=>It(t=>{let n=t.map(t=>{let n=q1(t);if(void 0===n)return t;let r=e.find(e=>vt(q1(e),n));return void 0!==r?r:t}),r=me(n,q1),i=e.filter(e=>{let t=q1(e);return void 0!==t&&!r.includes(t)});return n.concat(i)}),on=e=>Ft.find(t=>vt(q1(t),e)),sn=e=>!De||L(e,!1,e=>q(on(e))),an=()=>{if(M(it,Ot),sn(z(it,nt)))return Tt()},ln=HI.useInvalidate();dW(w.queryField,"All",se,e=>{if(!r2.shouldApply(Le.current,e.id,e.seq))return;r2.record(Le.current,e.id,e.seq),ln(w.queryField);let t=on(e.id),n=$(t);switch(e.changeKind){case"Added":if(!(e=>{let t=$e.current.get(e);return void 0!==t&&Date.now()-t<6e4})(e.id))return Zt(e.sortKeyValue)?void 0:Fe(e=>e+1|0);if($e.current.delete(e.id),n)return;let r=function(e,t){return Y1({},e,t,void 0)}(e,w.schema);if(void 0!==Ye||void 0===r){let t=e.id;if(void 0!==Ye)return Tt();if(void 0!==g&&void 0!==p&&void 0!==N){let e={};return e.ids=[t],et&&(e.includeRetired=xt),void ce(N(p,e).then(e=>{let t=U(j(j(ht(e),e=>Xe(e,g)),pt),[]);return rn(t),Promise.resolve()}),e=>Promise.resolve())}if(void 0===v)return Tt();if(void 0===m)return Tt();if(void 0===N)return Tt();let n=rt(xt,t);return void ce(N(m,n).then(e=>{let t=j(ht(e),e=>Xe(e,v));return void 0!==t&&"JSONNull"!==ut(t)&&rn([t]),Promise.resolve()}),e=>Promise.resolve())}return rn([r]);case"Updated":if(void 0!==Ye)return n?nn(e.id):void 0;if(void 0===t)return;let i=Zt(e.sortKeyValue),o=s2.apply(je.current,t,e,w.schema);return i||void 0===o?nn(e.id):Qt([o]);case"Removed":return n?void 0!==Ye?nn(e.id):It(t=>t.filter(t=>yt(q1(t),e.id))):void 0;case"BulkInvalidated":return Fe(e=>0),Tt()}},()=>Tt()),dW(w.queryField,{_0:U(z(it,nt),"")},se&&$(it),e=>{if(void 0===it)return;if(e.id!==nt(it))return;if(!r2.shouldApply(ze.current,e.id,e.seq))return;r2.record(ze.current,e.id,e.seq),ln(w.queryField);let t=e.changeKind;if(void 0!==Ye)switch(t){case"Updated":case"Removed":return Ot(it);case"Added":case"BulkInvalidated":return}else switch(t){case"Updated":let t=j(Xe(H,it),t=>s2.apply(Be.current,t,e,w.schema));return void 0!==t?(W(e=>{let n=Ze(Qe(e));return n[it]=t,n}),Q(e=>"Loaded")):Ot(it);case"Removed":return ee(e=>it);case"Added":case"BulkInvalidated":return}},()=>{void 0===it||void 0===m||void 0===v||void 0===N||ce(N(m,rt(void 0,it)).then(e=>{let t=j(ht(e),e=>Xe(e,v)),n=0;return void 0!==t&&"JSONNull"!==ut(t)?(W(e=>{let n=Ze(Qe(e));return n[it]=t,n}),Q(e=>"Loaded")):n=1,1===n&&ee(e=>it),Promise.resolve()}),e=>Promise.resolve())}),a(()=>{ee(e=>{})},[U(it,"")]);let cn=U(Ve.get("q"),""),un={};Qe(Ve.params).forEach(e=>{let t=e[0];t.startsWith("f.")&&(un[t.slice(2)]=e[1])});let dn,fn=function(e,t){return me(e,e=>{if(!("object"!=typeof(n=e.kind)?"KBoolean"===n:"KEnum"===n.TAG))return;var n;let r=function(e){return"object"!=typeof e?"KBoolean"===e?[["true","Yes"],["false","No"]]:void 0:"KEnum"===e.TAG?e._0.map(e=>[e,e]):void 0}(e.kind);if(void 0===r)return;let i=r.map(e=>({label:e[1],value:e[0]}));return{key:e.key,label:e.label,options:i,value:U(Xe(t,e.key),"")}})}(mt,un),hn=0!==fn.length,pn=z(Jt,e=>({key:e,direction:"Asc"===Xt?"Asc":"Desc"})),gn=(e,t)=>{let n="Asc"===t?"asc":"desc";We.current=PI,Ve.setMany([["sort",e],["dir",n],["after",""],["before",""]])},mn=(e,t)=>{We.current=PI,Ve.setMany([["f."+e,t],["after",""],["before",""]])},vn=()=>M(Dt.endCursor,e=>{We.current=function(e,t){return e.concat([U(t,"")])}(We.current,Ve.get("after")),Ve.setMany([["after",e],["before",""]])}),yn=w.commands.filter(e=>"Instance"===e.level);if(0!==yn.length||0!==C.length){let e=e=>{let t=j(Xe(e,"id"),dt),n=w.lifecycleField;if(void 0!==n){void 0!==Xe(e,n)?void 0===iH(e,n)&&function(e,t,n){let r=U(e,"<no-plugin>")+"."+t;if(!G5.contents.some(e=>e===r))G5.contents.push(r),console.warn("[AutoUI] Read model "+t+' lifecycleField="'+n+'" value is neither a string nor a TAG-shaped object; per-row command filter cannot match against allowedStates.')}(b,w.name,n):function(e,t,n){let r=U(e,"<no-plugin>")+"."+t+"."+n;if(!q5.contents.some(e=>e===r))q5.contents.push(r),console.warn("[AutoUI] Read model "+t+' declared lifecycleField="'+n+"\" but the list-view rows don't include that field; per-row command filtering is disabled.")}(b,w.name,n)}let r=oH(yn,e,w.lifecycleField).map(e=>({TAG:"Action",label:e.label,onClick:()=>O(n=>({command:e,rowId:t,formKey:e.name+":"+U(t,"")})),danger:!1})),o=jt(e).map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1}));return i(i1,{items:r.concat(o),triggerLabel:"..."})},t={key:"__actions",label:"",render:e,sortable:!1,width:"56px"};dn=Ht.concat([t])}else dn=Ht;let _n,bn=w.commands.filter(e=>"Collection"===e.level),xn=e=>{let t,n=e.map(e=>U(ht(e),{})),r=jK(un,mt),i=ft&&ct.search?"":cn,o=UK(Jt,Xt,mt);return t="object"!=typeof o||"ServerSort"===o.TAG?[void 0,Xt]:[o._0,o._1],x0(b0(_0(n,mt,r[1]),mt,i),mt,t[0],t[1])},Sn=e=>{if(void 0!==we&&we.id!==QI){let n=z(gt.statusField,e=>v3(e,yn,j(de,e=>e.transitions))),r=k1(N,T,yn,w.name,se,()=>Tt(),le,Mt.onNotice,qe),o=xn(e).map(e=>e),s=(t=Vt,Kt?t?{TAG:"Partial",_0:"Between"}:{TAG:"Partial",_0:"ToEnd"}:t?{TAG:"Partial",_0:"FromStart"}:"Complete");if(void 0!==c&&we.id===A3){let e=Ba(c.resource.schema,j(u,e=>SF(e,c.resource.name)),{field:c.resource.labelField,source:c.resource.labelFieldSource});return i(T5,{mode:we,resource:c.resource,resourceSemantics:e,resourceRef:c.resourceRef,assignCommand:T3(yn,c.resourceRef),eventReadModelName:w.name,eventSchema:w.schema,eventRows:o,eventWindow:s,eventSemantics:gt,eventAccent:j(de,e=>e.accent),onOpenEvent:(e,t)=>M(j(ht(t),tt),ot),onCommand:r})}let a=w.name,l=w.schema,d=j(de,e=>e.accent),f=s,h=(e,t)=>M(j(ht(t),tt),ot),p=z(n,e=>r),g=zt,m=0===C.length?void 0:Ut,v={readModelName:a,rows:o,schema:l,semantics:gt,accent:d,window:f,onOpenRow:h,onCommand:p,statusCommandFor:n,fillSlot:g,rowActionsFor:m,ownEntity:ue,retired:_t,refLabels:qt};return we.render([v])}{let t=xn(e),n=z(x,e=>e=>M(tt(e),ot)),o=e=>U(tt(e),JSON.stringify(e)),s=(e,t)=>{let r=t.map(o),s={};return r.forEach(e=>{s[e]=!0}),Object.keys(s).length!==r.length&&function(e,t){let n=U(e,"<no-plugin>")+"."+t;if(!V5.contents.some(e=>e===n))V5.contents.push(n),console.warn("[AutoUI] Read model "+t+" produced duplicate row keys — row identity is ambiguous and row clicks may open the wrong row. Give each row a unique id, or annotate the distinguishing field with @subId.")}(b,w.name),i(Mo,{columns:e,data:t,keyFn:o,sortState:pn,onSort:gn,onRowClick:n,activeKey:it})},a=function(e){return Fs(e,e=>e.groupBy)[0]}(w.schema);if(void 0===a)return s(dn,t);let l=$1(t,a,qs(w.schema,a)),c=l.length;if(1===c)return s(dn,t);if(0===c)return s(dn,t);let u=dn.filter(e=>e.key!==a);return i("div",{children:l.map(e=>{let t=e[0];return r("div",{children:[i("div",{children:lt(t),className:L5}),s(u,e[1])],className:M5},t)}),className:P5})}var t},wn=void 0!==S?Sn(S):"object"!=typeof Rt?"Loading"===Rt?i(B1,{}):Sn(Ft):"Error"===Rt.TAG?i(V0,{detail:Rt._0,onRetry:()=>Tt()}):i(y5,{detail:Rt._0,onRetry:()=>Tt()});if(void 0!==it&&void 0!==x){let e=(void 0!==S?S:Ft).find(e=>vt(j(ht(e),tt),it)),t=Xe(H,it);_n=[it,x,void 0!==t?t:e]}else _n=void 0;let En,kn=e=>{let t=e[2],n=e[0];if(vt(te,n))return i(V0,{title:"Entity removed",detail:"This entity no longer exists. Return to the list to continue.",onRetry:()=>st()});if(void 0!==t)return e[1](nt(n),E,D(t));let r=0,o=0,s=0;if("object"!=typeof Rt){if("Loading"===Rt)return i(B1,{});if("object"!=typeof Y){if("Loading"!==Y)return i(V0,{title:"Row not found",detail:"The row data is no longer in the current page."});s=4}else{if("Error"!==Y.TAG)return i(y5,{detail:Y._0,onRetry:()=>Tt()});r=2}}else s=4;if(4===s)if("object"!=typeof Y){if("Loading"===Y)return i(B1,{});o=3}else o=3;if(3===o&&"object"==typeof Rt){if("Error"===Rt.TAG)return i(V0,{detail:Rt._0,onRetry:()=>Tt()});r=2}return 2===r&&"object"==typeof Y&&"Error"===Y.TAG?i(V0,{detail:Y._0,onRetry:()=>Tt()}):i(y5,{detail:Rt._0,onRetry:()=>Tt()})},Cn=ke?i("div",{children:[["full","Full","▭"],["split","Split","▤"]].map(e=>{let t,n=e[1],o=e[0];return t="Full"===Te?"full"===o:"split"===o,r("button",{children:[i("span",{children:e[2],"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),i("span",{children:n,className:pF.Style.btnLabel})],"aria-label":n,"aria-pressed":t?"true":"false",className:t?pF.Style.btnActive:pF.Style.btn,title:n,onClick:e=>{!function(e,t){try{return localStorage.setItem(e,t)}catch(n){return}}(Ce,o),Ne(e=>o)}},o)}),"aria-label":"Layout",className:pF.Style.group,role:"group"}):null,An=GG(),Nn=k?i(B3,{live:oe,canBeLive:re,reconnecting:Re,onToggle:ie[1]}):null,Tn=i(v1,{title:w.name,commands:bn.map(e=>({key:e.name,label:"+ "+e.label,run:()=>O(t=>({command:e,rowId:void 0,formKey:e.name})),primary:!0})),controls:r(o,{children:[t.length>1?i(pF.make,{modes:t,activeId:L(we,QI,e=>e.id),onSelect:e=>{lF(ve,e,Se),_e(t=>({mode:e,band:Se}))}}):null,Cn,Nn]}),inBar:$(An)}),Rn=VG(An,Tn),Dn=void 0!==_t&&bt?r("label",{children:[i("input",{checked:xt,type:"checkbox",onChange:e=>Ve.setMany(Hs.toggleParams(xt))}),Hs.label(_t)],className:j5}):null,In=hn?i(P0,{filters:fn,onFilterChange:mn}):null,Fn=ge(fn,0,(e,t)=>""===t.value?e:e+1|0)+(xt&&bt?1:0)|0,On=r(o,{children:[r("div",{children:[i(A0,{value:cn,onChange:e=>{We.current=PI,Ve.setMany([["q",e],["after",""],["before",""]])}}),xe&&(hn||bt)?i(D1,{activeCount:Fn,children:r("div",{children:[fn.map(e=>i(O0,{filter:e,onChange:mn},e.key)),Dn],className:U5})}):r(o,{children:[In,Dn]})],className:z5}),Oe>0?i(V3,{count:Oe,onClick:()=>{Fe(e=>0),We.current=PI,Ve.setMany([["after",""],["before",""]]),Tt()}}):null]}),Pn=Wt?r("div",{children:[i("button",{children:"‹ Prev",className:$5,disabled:!Kt,onClick:e=>(()=>{let e=function(e){let t=e.length;return 0!==t?[e.slice(0,t-1|0),e[t-1|0]]:[e,void 0]}(We.current),t=e[1];return void 0!==t?(We.current=e[0],Ve.setMany([["after",t],["before",""]])):M(Dt.startCursor,e=>Ve.setMany([["before",e],["after",""]]))})()}),i("button",{children:"Next ›",className:$5,disabled:!Vt,onClick:e=>vn()})],className:B5}):null,Mn=function(e){let t=ht(e),n=e=>U(j(j(j(j(j(j(t,e=>Xe(e,"properties")),ht),t=>Xe(t,e)),ht),e=>Xe(e,"title")),dt),lt(e));return j(j(j(t,e=>Xe(e,"x-reventless-owner-unscoped")),ht),e=>z(j(Xe(e,"field"),dt),t=>({ownerLabel:n(t),matchedGroups:L(j(Xe(e,"as"),pt),[],e=>me(e,dt))})))}(w.schema);if(void 0!==Mn){let e=Mn.matchedGroups,t=e.length,n=1!==t?0!==t?e.join(" / "):"an elevated role":e[0];En=i(YK,{variant:"Info",title:"Viewing as "+n,message:"This list is not filtered to you — it shows rows for every "+Mn.ownerLabel+"."})}else En=null;let Ln,zn=r(o,{children:[On,En,Mt.element,wn,Pn]});if("Full"===Te)if(void 0!==_n){let e=_n[2],t=_n[1],n=_n[0],o={label:w.name,href:Je,onClick:st},s=(e=>!!yt(te,e[0])&&$(e[2]))([n,t,e]),a={placement:$(An)?"Bar":"Pane",ancestors:[o],controls:Nn};Ln=i(I5,{refresh:an,children:r("div",{children:[s?null:VG(An,i("div",{children:i(Y0,{crumbs:[o],allLinks:!0}),className:d1.titleGroup})),i(d5,{chrome:a,children:kn([n,t,e])})],className:O5})})}else Ln=r("div",{children:[Rn,zn],className:O5});else{let e=void 0!==_n?kn(_n):i(_o,{title:"Select an item",description:"Choose a row on the left to see its details here."});Ln=i(I5,{refresh:an,children:r("div",{children:[Rn,i(d5,{chrome:{placement:"Pane",ancestors:[]},children:i(M1,{master:zn,detail:e})})],className:O5})})}return r(o,{children:[Ln,L(F[0],null,e=>i(aW,{isOpen:!0,onClose:()=>O(e=>{}),title:e.command.label,children:i(o5,{schema:e.command.schema,aggregateId:e.rowId,aggregateIdField:e.command.aggregateIdField,injectNewId:"Collection"===e.command.level,ownerField:e.command.ownerField,ownerValue:e.command.ownerValue,initialValues:e.initialValues,refFields:e.command.refFields,onSubmit:t=>{if(void 0!==I){let n=e.rowId;return void 0!==n?qe(n):M(Xe(t,U(e.command.aggregateIdField,"id")),qe),ce(I(e.command.mutationDocument,m4(e.command.schema,t)).then(t=>{if("object"!=typeof t)return"Accepted"===t?(O(e=>{}),sn(e.rowId)&&Tt(),M(e.navigateTo,J),Promise.resolve("Ok")):(O(e=>{}),sn(e.rowId)&&q(e.navigateTo)&&setTimeout(()=>Tt(),500),M(e.navigateTo,J),Promise.resolve("Ok"));{if("Rejected"===t.TAG){let e=t._0;return w1(N,le,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let n=t._0;return console.error("[AutoUI] "+w.name+": command "+e.command.name+" not executed — "+n),Promise.resolve({TAG:"Err",_0:n})}}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"}))}return O(e=>{}),Promise.resolve("Ok")},submitLabel:"Execute"},e.formKey)}))]})};function W5(e){return e.map(e=>e.x.toString()+","+e.y.toString()).join(" ")}let H5=function(e){let t=e.color,n=e.height,r=e.width,o=void 0!==r?r:80,s=void 0!==n?n:24,a=void 0!==t?t:"",l=function(e,t,n){if(e.length<2)return[];let r=ge(e,Number.MAX_VALUE,(e,t)=>e<t?e:t),i=ge(e,Number.MIN_VALUE,(e,t)=>e>t?e:t),o=i-r,s=t/(e.length-1|0);return e.map((e,t)=>({x:t*s,y:0===o?n/2:n-(e-r)/o*n}))}(e.values,o,s),c=""===a?"var("+_t.brand+")":a;return l.length<2?null:i("svg",{children:i("polyline",{fill:"none",points:W5(l),stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),style:{display:"block",overflow:"visible"},height:s.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+s.toString()})};function J5(e){return"var("+e+")"}let X5=co([gi("flex"),mi("column"),ui("gap",J5(bt.xs)),ui("padding",J5(bt.lg)),ui("background",J5(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",J5(St.md))]),Q5=co([ui("color",J5(_t.textSecondary)),ui("font-size",J5(xt.sizeSm)),ui("font-weight",J5(xt.weightMedium))]),Y5=co([gi("flex"),di("baseline"),ui("gap",J5(bt.sm))]),Z5=co([ui("color",J5(_t.textPrimary)),ui("font-size",J5(xt.sizeXxl)),ui("font-weight",J5(xt.weightBold)),ui("line-height",J5(xt.lineHeightTight))]);function e6(e){switch(e){case"Up":return _t.success;case"Down":return _t.error;case"Neutral":return _t.textDisabled}}function t6(e){return co([ui("color",J5(e6(e))),ui("font-size",J5(xt.sizeSm)),ui("font-weight",J5(xt.weightMedium))])}let n6=function(e){let t,n=e.trendLabel,o=e.trend;if(void 0!==o&&void 0!==n){let e;switch(o){case"Up":e="^";break;case"Down":e="v";break;case"Neutral":e="-"}t=i("span",{children:e+" "+n,className:t6(o)})}else t=null;return r("div",{children:[i("div",{children:e.label,className:Q5}),r("div",{children:[i("span",{children:e.value,className:Z5}),t],className:Y5}),L(e.sublabel,null,e=>i("div",{children:e,style:{color:"var("+_t.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})),U(e.footer,null)],className:X5})};function r6(e){return"var("+e+")"}let i6=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ui("gap",r6(bt.md))]),o6=co([pi("pointer"),ui("border-radius",r6(St.md)),Yi([ui("filter","brightness(0.98)")])]);let s6=function(e){let t=e.kpis;return 0===t.length?null:i("div",{children:t.map(e=>{let t=z(e.spark,e=>i(H5,{values:e,width:120,height:24})),n=i(n6,{label:e.label,value:e.value,trend:e.trend,trendLabel:e.trendLabel,sublabel:e.sublabel,footer:t}),r=e.onOpen;return i("div",void 0!==r?{children:n,className:o6,role:"button",tabIndex:0,onKeyDown:e=>{if("Enter"===e.key)return r()},onClick:e=>r()}:{children:n},e.key)}),className:i6})},a6=["var("+_t.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function l6(e,t){return U(e.color,a6[fe(t,a6.length)])}function c6(e,t,n,r){let i=2*(r-.25)*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function u6(e){return(Math.round(1e3*e)/1e3).toString()}function d6(e,t,n,r,i,o){let s=c6(e,t,n,i),a=s[1],l=s[0],c=c6(e,t,n,o),u=c[1],d=c[0],f=o-i>.5?"1":"0";if(r<=0)return"M "+u6(e)+" "+u6(t)+" L "+u6(l)+" "+u6(a)+" A "+u6(n)+" "+u6(n)+" 0 "+f+" 1 "+u6(d)+" "+u6(u)+" Z";let h=c6(e,t,r,i),p=c6(e,t,r,o);return"M "+u6(l)+" "+u6(a)+" A "+u6(n)+" "+u6(n)+" 0 "+f+" 1 "+u6(d)+" "+u6(u)+" L "+u6(p[0])+" "+u6(p[1])+" A "+u6(r)+" "+u6(r)+" 0 "+f+" 0 "+u6(h[0])+" "+u6(h[1])+" Z"}let f6=function(e){let t=e.innerRatio,n=e.size,r=e.slices,o=void 0!==n?n:120,s=void 0!==t?t:0,a=function(e){let t=ge(e,0,(e,t)=>e+(t.value>0?t.value:0));if(t<=0)return[];let n={contents:0};return e.map(e=>{let r=n.contents,i=(e.value>0?e.value:0)/t;return n.contents=r+i,[r,r+i]})}(r);if(0===a.length)return null;let l=o/2,c=o/2-1,u=s>0?c*s:0;return i("svg",{children:a.map((e,t)=>{let n=e[1],o=e[0],s=r[t],a=l6(s,t),d=n-o>=.999?d6(l,l,c,u,o,o+.5)+" "+d6(l,l,c,u,o+.5,n):d6(l,l,c,u,o,n);return i("path",{children:i("title",{children:s.label}),d:d,fill:a},s.label+t.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:o.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+o.toString()})},h6=["var("+_t.brand+")","var("+_t.success+")"];let p6=function(e){let t=e.height,n=e.width,o=e.series,s=void 0!==n?n:320,a=void 0!==t?t:120;if(0===o.length||o.every(e=>e.values.length<2))return null;let l=function(e){let t=e.flatMap(e=>e.values),n=ge(t,Number.MAX_VALUE,(e,t)=>e<t?e:t),r=ge(t,Number.MIN_VALUE,(e,t)=>e>t?e:t);return[n,r]}(o),c=l[0],u=l[1]-c,d=0===u?1:u,f=a-16,h=ge(o,0,(e,t)=>e>t.values.length?e:t.values.length),p=s/(h-1|0),g=8+f;return i("svg",{children:o.map((e,t)=>{let n=U(e.color,U(h6[t],"var("+_t.brand+")")),o=e.values.map((e,t)=>[t*p,8+f-(e-c)/d*f]),s=o.map(e=>e[0].toString()+","+e[1].toString()).join(" "),a=(e.values.length-1|0)*p,l="0,"+g.toString()+" "+s+" "+a.toString()+","+g.toString();return r("g",{children:[i("polygon",{fill:n,fillOpacity:"0.15",points:l,stroke:"none"}),i("polyline",{fill:"none",points:s,stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]},e.label)}),style:{display:"block",height:"auto",maxWidth:"100%"},height:a.toString(),width:s.toString(),viewBox:"0 0 "+s.toString()+" "+a.toString()})};let g6=function(e){let t=e.size,n=void 0!==t?t:120;return i(f6,{slices:e.slices,size:n,innerRatio:.6})};function m6(e){return"var("+e+")"}let v6=co([Ui("relative"),ui("width","100%"),ui("line-height","0")]),y6=co([Ui("absolute"),ui("left","0"),ui("right","0"),ui("bottom","0"),ui("text-align","center"),ui("line-height","1.1"),ui("font-size",m6(xt.sizeXl)),ui("font-weight",m6(xt.weightMedium)),ui("color",m6(_t.textPrimary))]),_6=co([gi("flex"),xi("spaceBetween"),ui("width","100%"),ui("font-size",m6(xt.sizeXs)),ui("color",m6(_t.textDisabled))]),b6=co([ui("font-size",m6(xt.sizeSm)),ui("color",m6(_t.textSecondary))]);function x6(e){return(Math.round(100*e)/100).toString()}function S6(e,t,n,r){let i=Math.PI+r*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function w6(e,t,n,r,i){let o=S6(e,t,n,r),s=S6(e,t,n,i);return"M "+x6(o[0])+" "+x6(o[1])+" A "+x6(n)+" "+x6(n)+" 0 0 1 "+x6(s[0])+" "+x6(s[1])}let E6=function(e){let t=e.size,n=e.caption,o=e.max,s=e.min,a=e.value,l=void 0!==s?s:0,c=void 0!==t?t:160;if(o<=l)return null;let u=function(e,t,n){if(n<=t)return 0;let r=(e-t)/(n-t);return r<0?0:r>1?1:r}(a,l,o),d=.09*c,f=c/2,h=c/2-d/2,p=h+d/2,g=p+d/2;return r("div",{children:[r("div",{children:[r("svg",{children:[i("path",{d:w6(f,p,h,0,1),fill:"none",stroke:"var("+_t.surfaceSubtle+")",strokeLinecap:"round",strokeWidth:x6(d)}),u<=0?null:i("path",{d:w6(f,p,h,0,u),fill:"none",stroke:"var("+_t.brand+")",strokeLinecap:"round",strokeWidth:x6(d)})],"aria-label":x6(a)+" of "+x6(o),role:"img",style:{display:"block",height:"auto",maxWidth:"100%"},height:x6(g),width:x6(c),viewBox:"0 0 "+x6(c)+" "+x6(g)}),i("div",{children:U(e.display,x6(a)),className:y6})],className:v6}),r("div",{children:[i("span",{children:x6(l)}),i("span",{children:x6(o)})],className:_6}),void 0!==n?i("div",{children:n,className:b6}):null],className:(m=c,co([gi("flex"),mi("column"),di("center"),ui("gap","2px"),ui("width","100%"),ui("max-width",m.toString()+"px")]))});var m};function k6(e){return"var("+e+")"}let C6=co([gi("flex"),mi("column"),ui("gap","6px")]),A6=co([ui("overflow-x","auto")]),N6=co([gi("flex"),ui("gap","4px"),di("flexStart")]);function T6(e){return co([gi("grid"),ui("grid-template-rows","repeat(7, "+e.toString()+"px)"),ui("gap","2px"),di("center"),ui("font-size",k6(xt.sizeXs)),ui("color",k6(_t.textDisabled)),ui("line-height","1")])}function R6(e){return co([gi("grid"),ui("grid-auto-flow","column"),ui("grid-auto-columns",e.toString()+"px"),ui("grid-template-rows","repeat(7, "+e.toString()+"px)"),ui("gap","2px")])}let D6=co([ui("visibility","hidden")]),I6=co([gi("flex"),di("center"),_i("wrap"),ui("gap",k6(bt.md)),ui("font-size",k6(xt.sizeXs)),ui("color",k6(_t.textSecondary))]),F6=co([gi("flex"),di("center"),ui("gap","4px")]);function O6(e){let t=e[0];if(void 0===t)return[];let n=pe(function(e){let t=0|new Date(e).getDay();return 0===t?6:t-1|0}(t.time),e=>{});for(e.forEach(e=>{n.push(e)});n.length%7!=0;)n.push(void 0);return pe(n.length/7|0,e=>n.slice(7*e|0,7+(7*e|0)|0))}function P6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let M6=function(e){let t=e.cellSize,n=e.days,o=void 0!==t?t:11,s=O6(n);if(0===s.length)return null;let a=function(e){return ge(e,0,(e,t)=>t.value>e?t.value:e)}(n),l=n[0],c=n[n.length-1|0],u=void 0!==l&&void 0!==c?dc(l.time)+" – "+dc(c.time):"";return r("div",{children:[i("div",{children:r("div",{children:[i("div",{children:pe(7,e=>{return i("span",{children:(t=e,t%2==0?U(fc[t],""):"")},e.toString());var t}),className:T6(o)}),i("div",{children:s.map((e,t)=>e.map((e,n)=>{return void 0!==e?i("div",{className:(r=xW(e.value,a),co([ui("border-radius","2px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("background",r<=0?"transparent":"color-mix(in srgb, var("+_t.brand+") "+Math.round(100*r).toString()+"%, transparent)")])),title:pc(e.time)+" "+dc(e.time)+": "+P6(e.value)},e.time.toString()):i("div",{className:D6},"b:"+t.toString()+":"+n.toString());var r})),className:R6(o)})],className:N6}),className:A6}),r("div",{children:[i("span",{children:u}),r("span",{children:["less",SW.map(e=>{return i("span",{className:(t=e,co([ui("width","10px"),ui("height","10px"),ui("border-radius","2px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("background","color-mix(in srgb, var("+_t.brand+") "+Math.round(100*t).toString()+"%, transparent)")]))},e.toString());var t}),"more (max "+P6(a)+")"],className:F6})],className:I6})],className:C6})};function L6(e){return"var("+e+")"}let z6=co([gi("flex"),mi("column"),ui("gap","2px")]),j6=co([gi("flex"),mi("column"),ui("gap","3px")]),U6=co([gi("flex"),xi("spaceBetween"),di("baseline"),ui("gap",L6(bt.sm)),ui("font-size",L6(xt.sizeSm))]),B6=co([ui("color",L6(_t.textPrimary))]),$6=co([ui("color",L6(_t.textPrimary)),ui("font-weight",L6(xt.weightMedium)),ui("white-space","nowrap")]),q6=co([ui("color",L6(_t.textSecondary)),ui("font-weight",L6(xt.weightNormal))]),G6=co([ui("background",L6(_t.surfaceSubtle)),ui("border-radius",L6(St.sm)),ui("height","14px"),Mi("hidden")]);function V6(e,t){return co([ui("background",t),ui("border-radius",L6(St.sm)),ui("height","100%"),ui("width",e.toString()+"%"),ui("min-width",e>0?"2px":"0")])}let K6=co([ui("padding","2px 0 4px"),ui("font-size",L6(xt.sizeXs)),ui("color",L6(_t.textDisabled))]),W6=co([ui("padding-top","4px"),ui("font-size",L6(xt.sizeXs)),ui("color",L6(_t.textDisabled))]);function H6(e,t){return t<=0?0:Math.round(e/t*1e3)/10}function J6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let X6=function(e){let t=e.stages;if(0===t.length)return null;let n=e.note,o=function(e){let t=L(e[0],0,e=>e.value);return e.map((n,r)=>{let i=e[r-1|0];return{conversion:H6(n.value,t),dropOff:void 0!==i&&i.value>0&&n.value<i.value?H6(i.value-n.value,i.value):void 0}})}(t),s=L(t[0],0,e=>e.value);return r("div",{children:[t.map((e,t)=>{let n=o[t],a=s<=0?0:e.value/s*100,l=j(n,e=>e.dropOff);return r("div",{children:[void 0!==l?i("div",{children:"↓ "+l.toString()+"% drop-off",className:K6}):null,r("div",{children:[r("div",{children:[i("span",{children:e.label,className:B6}),r("span",{children:[J6(e.value),0===t?null:i("span",{children:" · "+L(n,0,e=>e.conversion).toString()+"%",className:q6})],className:$6})],className:U6}),i("div",{children:i("div",{className:V6(a,U(e.color,"var("+_t.brand+")"))}),className:G6})],className:j6})]},e.label+":"+t.toString())}),void 0!==n?i("div",{children:n,className:W6}):null],className:z6})};function Q6(e){return"var("+e+")"}let Y6=co([gi("flex"),mi("column"),ui("gap","2px")]),Z6=co([gi("flex"),ui("gap","4px")]),e8=[ui("font-size",Q6(xt.sizeXs)),ui("color",Q6(_t.textDisabled)),ui("white-space","nowrap")],t8=co(e8.concat([gi("flex"),mi("column"),xi("spaceBetween"),ui("text-align","right")]));let n8=co([gi("flex"),xi("spaceBetween"),ui("gap",Q6(bt.sm)),ui("font-size",Q6(xt.sizeXs)),ui("color",Q6(_t.textSecondary))]);function r8(e){return(Math.round(100*e)/100).toString()}function i8(e,t,n){return n<=t?.5:(e-t)/(n-t)}let o8=function(e){let t=e.height,n=e.width,o=e.yLabel,s=e.xLabel,a=e.points,l=void 0!==n?n:320,c=void 0!==t?t:200,u=function(e){let t=e[0];if(void 0!==t)return ge(e,{xMin:t.x,xMax:t.x,yMin:t.y,yMax:t.y},(e,t)=>({xMin:t.x<e.xMin?t.x:e.xMin,xMax:t.x>e.xMax?t.x:e.xMax,yMin:t.y<e.yMin?t.y:e.yMin,yMax:t.y>e.yMax?t.y:e.yMax}))}(a);if(void 0===u)return null;let d,f=4.5,h=l-9,p=c-9,g=0;return void 0!==s||void 0!==o?g=1:d=null,1===g&&(d=r("div",{children:[i("span",{children:"↑ "+U(o,"y")}),i("span",{children:U(s,"x")+" →"})],className:n8})),r("div",{children:[r("div",{children:[r("div",{children:[i("span",{children:r8(u.yMax)}),i("span",{children:r8(u.yMin)})],className:t8,style:{width:34..toString()+"px"}}),r("svg",{children:[i("line",{stroke:"var("+_t.borderSubtle+")",strokeWidth:"1",x1:r8(f),x2:r8(l-f),y1:r8(c-f),y2:r8(c-f)}),i("line",{stroke:"var("+_t.borderSubtle+")",strokeWidth:"1",x1:r8(f),x2:r8(f),y1:r8(f),y2:r8(c-f)}),a.map((e,t)=>{let n=f+i8(e.x,u.xMin,u.xMax)*h,r=f+(1-i8(e.y,u.yMin,u.yMax))*p;return i("circle",{children:i("title",{children:e.label+" — "+U(s,"x")+": "+r8(e.x)+", "+U(o,"y")+": "+r8(e.y)}),cx:r8(n),cy:r8(r),fill:U(e.color,"var("+_t.brand+")"),fillOpacity:"0.75",r:r8(3.5)},e.label+":"+t.toString())})],style:{display:"block",height:"auto",maxWidth:"100%",minWidth:"0"},height:r8(c),width:r8(l),viewBox:"0 0 "+r8(l)+" "+r8(c)})],className:Z6}),r("div",{children:[i("span",{children:r8(u.xMin)}),i("span",{children:r8(u.xMax)})],className:(m=38,co(e8.concat([gi("flex"),xi("spaceBetween"),ui("margin-left",m.toString()+"px")])))}),d],className:Y6});var m};function s8(e){return"var("+e+")"}let a8=co([gi("flex"),mi("column"),ui("gap","6px"),ki(to(0)),ui("padding","0"),ui("list-style","none")]),l8=[gi("grid"),ui("grid-template-columns","1.5rem 1fr auto"),di("center"),ui("gap",s8(bt.sm)),ui("font-size",s8(xt.sizeSm)),ui("color",s8(_t.textPrimary))],c8=co(l8),u8=co(l8.concat([pi("pointer"),ui("background","transparent"),ui("border","none"),ui("padding","2px 0"),ui("text-align","left"),ui("width","100%"),ui("font","inherit"),Yi([ui("color",s8(_t.brand))])])),d8=co([ui("align-self","start"),ui("font-size",s8(xt.sizeXs)),ui("color",s8(_t.textDisabled)),ui("text-align","right"),ui("font-variant-numeric","tabular-nums")]),f8=co([gi("flex"),mi("column"),ui("gap","3px"),Oi(to(0))]),h8=co([ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),p8=co([ui("background",s8(_t.surfaceSubtle)),ui("border-radius",s8(St.sm)),ui("height","6px"),Mi("hidden")]);function g8(e){return co([ui("background",s8(_t.brand)),ui("border-radius",s8(St.sm)),ui("height","100%"),ui("width",e.toString()+"%"),ui("min-width",e>0?"2px":"0")])}let m8=co([ui("align-self","start"),ui("font-weight",s8(xt.weightMedium)),ui("white-space","nowrap"),ui("font-variant-numeric","tabular-nums")]);function v8(e,t){return t<=0||e<=0?0:e/t*100}let y8=function(e){let t=e.limit,n=void 0!==t?t:10,s=e.entries.slice(0,n);if(0===s.length)return null;let a=ge(s,0,(e,t)=>t.value>e?t.value:e);return i("ol",{children:s.map((e,t)=>{let n=r(o,{children:[i("span",{children:(t+1|0).toString(),className:d8}),r("span",{children:[i("span",{children:e.label,className:h8,title:e.label}),i("span",{children:i("span",{className:g8(v8(e.value,a))}),className:p8})],className:f8}),i("span",{children:e.display,className:m8})]}),s=e.onOpen;return i("li",{children:void 0!==s?i("button",{children:n,className:u8,type:"button",onClick:e=>s()}):i("div",{children:n,className:c8})},e.key)}),className:a8})};let _8=function(e){let t=e.height,n=e.width,r=e.bars,o=void 0!==n?n:320,s=void 0!==t?t:120;if(0===r.length)return null;let a=ge(r,0,(e,t)=>{let n=function(e){return ge(e.segments,0,(e,t)=>e+(t.value>0?t.value:0))}(t);return e>n?e:n}),l=0===a?1:a,c=r.length,u=(o-2*(c+1|0))/c,d=s-4;return i("svg",{children:r.map((e,t)=>{let n=2+t*(u+2),r={contents:s};return i("g",{children:e.segments.map((t,o)=>{let s=t.value>0?t.value:0,a=s/l*d,c=r.contents-a;return r.contents=c,0===s?null:i("rect",{children:i("title",{children:e.label+" — "+t.key+": "+s.toString()}),height:a.toString(),width:u.toString(),fill:U(t.color,"var("+_t.brand+")"),x:n.toString(),y:c.toString()},t.key+":"+o.toString())})},e.label+":"+t.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:s.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+s.toString()})};function b8(e){return"var("+e+")"}let x8=co([gi("flex"),mi("column"),ui("gap",b8(bt.lg))]),S8=co([ui("font-size",b8(xt.sizeXl)),ui("font-weight",b8(xt.weightMedium)),ui("color",b8(_t.textPrimary)),ki(to(0))]),w8=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(300px, 1fr))"),ui("gap",b8(bt.md))]),E8=co([gi("flex"),mi("column"),ui("gap",b8(bt.sm)),ui("padding",b8(bt.lg)),ui("background",b8(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",b8(St.md))]),k8=co([ui("font-size",b8(xt.sizeSm)),ui("font-weight",b8(xt.weightMedium)),ui("color",b8(_t.textSecondary))]),C8=co([gi("flex"),di("center"),ui("gap",b8(bt.lg))]),A8=co([gi("flex"),mi("column"),ui("gap","4px"),ui("font-size",b8(xt.sizeSm)),ui("color",b8(_t.textSecondary))]),N8=co([gi("flex"),di("center"),ui("gap","6px")]);function T8(e){return co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",e)])}let R8=co([ui("font-size",b8(xt.sizeXs)),ui("color",b8(_t.textDisabled))]),D8=co([gi("flex"),xi("spaceBetween"),di("center"),ui("gap",b8(bt.sm))]),I8=co([gi("inlineFlex"),ui("gap",b8(bt.xs))]);function F8(e,t){return j(Xe(e,t),e=>{let t=ft(e);return void 0!==t?t:z(KR(e),e=>e[0])})}function O8(e){return e.map(e=>U(ht(e),{}))}function P8(e,t,n){switch(t){case"avg":case"sum":break;default:return e.length}if(void 0===n)return e.length;let r=O8(e),i=me(r,e=>F8(e,n)),o=ge(i,0,(e,t)=>e+t),s=function(e,t){return ye(e,e=>z(j(Xe(e,t),KR),e=>e[1]))}(r,n),a=void 0!==s?function(e,t){return e/Math.pow(10,qR(t))}(o,s):o;return"sum"===t?a:0===i.length?0:a/i.length}function M8(e){let t=Math.round(100*e)/100;return t===Math.trunc(t)?Math.trunc(t).toString():t.toString()}function L8(e,t,n){return Uo(e,n&&("count"===t||"sum"===t))}function z8(e,t,n,r){return n?"avg"===t?e+" · avg of the first "+r.toString()+" loaded":e+" · over the first "+r.toString()+" loaded":e}function j8(e){let t=U(e.aggregate,"count"),n=e.label;if(void 0!==n)return n;let r=e.field;switch(t){case"avg":return void 0!==r?e.view+" — avg "+lt(r):e.view;case"sum":return void 0!==r?e.view+" — total "+lt(r):e.view;default:return e.view}}function U8(e,t,n,r){let i=pe(n,e=>[]);return O8(e).forEach(e=>M(j(fa(t,e),gc),t=>{let o=0|Math.floor((r-t)/864e5);if(o>=0&&o<n)return M(i[(n-1|0)-o|0],t=>{t.push(e)})})),i}function B8(e,t,n,r,i,o){return U8(e,t,n,r).map(e=>P8(e.map(e=>e),i,o))}function $8(e,t){return me(O8(e),e=>iH(e,t))}function q8(e,t,n){let r=qs(t,n),i=ge(e.filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r.concat(i)}function G8(e){return a6[fe(e,a6.length)]}function V8(e,t){return z(Xe(e.semantics,t),e=>e.semantic)}function K8(e,t,n){let r=function(e,t){return z(Sa(e).find(e=>e[0]===t),e=>e[1])}(e,t);if(void 0===r)return;let i=Da(r,"maximum");if(void 0===i)return vt(V8(n,t),"Percent")?{min:0,max:100}:void 0;let o=U(Da(r,"minimum"),0);return i>o?{min:o,max:i}:void 0}function W8(e,t,n){let r=V8(e,t);if(void 0===r)return M8(n);switch(r){case"Percent":return WR(n);case"Bytes":return HR(n);case"Duration":return JR(n);case"Currency":case"Money":return BR(n);default:return M8(n)}}function H8(e,t,n,r,i,o){return B8(e,t,n,r,i,o).map((e,t)=>({time:Zl(r-((n-1|0)-t|0)*mc),value:e}))}function J8(e){let t,n=s(()=>"Days30"),o=n[1],a=n[0],l=(e,t)=>{return i("button",{children:t,className:(n=a===e,co([ui("background",n?b8(_t.surfaceSubtle):"transparent"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",b8(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",b8(xt.sizeXs)),ui("color",b8(n?_t.textPrimary:_t.textSecondary)),pi("pointer")])),type:"button",onClick:t=>o(t=>e)});var n};return t="Days30"===a?e.body:i(M6,{days:e.yearDays}),r("div",{children:[r("div",{children:[i("span",{children:e.title,className:k8}),r("div",{children:[l("Days30","30 days"),l("Year","Year")],className:I8})],className:D8}),t],className:E8})}let X8=function(e){let t=e.viewAccess,n=e.mockRows,s=e.uiHints,a=e.readModels,l=e.metrics,c=e.pluginId,u=void 0!==t?t:{},d=ae(),f=mG(),h=me(ge(l.map(e=>e.view),[],(e,t)=>e.includes(t)?e:e.concat([t])),e=>a.find(t=>t.name===e)),p=h.map(e=>{let t=_K(u,e.name,f);return[e,t,W3(e,t&&q(n))]}),g=e=>void 0===n&&L(p.find(t=>t[0].name===e),!1,e=>e[2].canLoadMore),m=Date.now(),v=me(l,e=>z(h.find(t=>t.name===e.view&&_K(u,t.name,f)),t=>{return{metric:e,readModel:t,rows:(r=t.name,void 0!==n?U(Xe(n,r),[]):L(p.find(e=>e[0].name===r),[],e=>e[2].rows)),partial:g(t.name),semantics:Ba(t.schema,j(s,e=>SF(e,t.name)),{field:t.labelField,source:t.labelFieldSource})};var r})),y=v.map((e,t)=>{let n=U(e.metric.aggregate,"count"),r=z(e.semantics.dateSpan,t=>B8(e.rows,t,14,m,n,e.metric.field));return{key:t.toString()+":"+e.readModel.name,label:j8(e.metric),value:L8(M8(P8(e.rows,n,e.metric.field)),n,e.partial),sublabel:z8(e.readModel.name,n,e.partial,e.rows.length),spark:r,onOpen:()=>d(Ue(Xa(c,e.readModel.name)))}}),_=e=>{let t=e.readModel.lifecycleField;return void 0!==t?t:e.semantics.statusField},b=me(v,e=>z(e.semantics.dateSpan,t=>{let n,s,a=U(e.metric.aggregate,"count"),l=j8(e.metric)+" — trend",c=_(e);if("count"===a&&void 0!==c){let s=function(e,t,n,r,i,o){let s=U8(e,t,n,r),a=e=>me(e,e=>iH(e,o)),l=s.flatMap(a),c=q8(l,i,o).filter(e=>l.some(t=>t===e)),u=s.map((e,t)=>{let i=a(e);return{label:pc(r-864e5*((n-1|0)-t|0)),segments:c.map((e,t)=>({key:lt(e),value:i.filter(t=>t===e).length,color:G8(t)}))}});return{statuses:c,bars:u}}(e.rows,t,30,m,e.readModel.schema,c),a=s.statuses;n=0===a.length?void 0:r(o,{children:[i(_8,{bars:s.bars}),i("div",{children:a.map((e,t)=>r("span",{children:[i("span",{className:T8(G8(t))}),lt(e)],className:N8},e)),className:A8})]})}else n=void 0;if(void 0!==n)s=n;else{let n=B8(e.rows,t,30,m,a,e.metric.field);s=i(p6,{series:[{label:j8(e.metric),values:n}]})}return i(J8,{title:l,body:s,yearDays:H8(e.rows,t,365,m,a,e.metric.field)},"trend:"+j8(e.metric))})),x=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if("avg"===t&&void 0!==n)return z(K8(e.readModel.schema,n,e.semantics),t=>{let o=P8(e.rows,"avg",n);return r("div",{children:[i("span",{children:j8(e.metric),className:k8}),i(E6,{value:o,min:t.min,max:t.max,display:W8(e.semantics,n,o),caption:e.readModel.name+" · "+lt(n)})],className:E8},"gauge:"+j8(e.metric))})}),S=[],w=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if(void 0===t)return;switch(t){case"avg":case"sum":break;default:return}if(void 0===n)return;if(S.includes(e.readModel.name+":"+n))return;S.push(e.readModel.name+":"+n);let o=function(e,t,n,r){return me(O8(e),e=>z(F8(e,t),t=>{let r=U(j(Xe(e,"id"),dt),"");return{id:r,label:U(j(Xe(e,n),dt),""===r?"—":r),value:t}})).toSorted((e,t)=>t.value-e.value).slice(0,r)}(e.rows,n,e.readModel.labelField,10).map(t=>({key:""===t.id?t.label:t.id,label:t.label,display:W8(e.semantics,n,t.value),value:t.value,onOpen:""===t.id?void 0:()=>d(Ya(c,e.readModel.name,t.id,[]))}));return 0===o.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — top by "+lt(n),className:k8}),i(y8,{entries:o})],className:E8},"top:"+e.readModel.name+":"+n)}),E=me(v,e=>{let t=e.metric.viz,n=e.metric.field,o=e.metric.xField;if(void 0===t)return;if("scatter"!==t)return;if(void 0===n)return;if(void 0===o)return;let s=(a=e.rows,l=o,c=n,u=e.readModel.labelField,me(O8(a),e=>{let t=F8(e,l),n=F8(e,c);if(void 0!==t&&void 0!==n)return{label:U(j(Xe(e,u),dt),U(j(Xe(e,"id"),dt),"—")),x:t,y:n}}));var a,l,c,u;return 0===s.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — "+lt(n)+" by "+lt(o),className:k8}),i(o8,{points:s,xLabel:lt(o),yLabel:lt(n)})],className:E8},"scatter:"+j8(e.metric))}),k=me(v,e=>{let t=e.metric.viz,n=_(e);if(void 0===t)return;if("funnel"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=qs(t,n),i=$8(e,n),o=me(i,e=>{let t=r.indexOf(e);return t<0?void 0:t});return{stages:r.map((e,t)=>({label:lt(e),value:o.filter(e=>e>=t).length})),excluded:i.length-o.length|0}}(e.rows,e.readModel.schema,n),s=o.stages;if(0===s.length)return;let a=o.excluded;return r("div",{children:[i("span",{children:j8(e.metric)+" — "+lt(n)+" funnel",className:k8}),i(X6,{stages:s,note:0===a?void 0:a.toString()+" row(s) with an unlisted "+lt(n)+" excluded"})],className:E8},"funnel:"+j8(e.metric))}),C=me(v,e=>{let t=U(e.metric.aggregate,"count"),n=vt(e.metric.viz,"funnel")?void 0:_(e);if("count"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=$8(e,n);return me(q8(r,t,n),e=>{let t=r.filter(t=>t===e).length;return 0===t?void 0:{label:lt(e),value:t}})}(e.rows,e.readModel.schema,n);return 0===o.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — by "+lt(n),className:k8}),r("div",{children:[i(g6,{slices:o}),i("div",{children:o.map((e,t)=>r("span",{children:[i("span",{className:T8(l6(e,t))}),e.label+" ("+M8(e.value)+")"],className:N8},e.label)),className:A8})],className:C8})],className:E8},"status:"+e.readModel.name)}),A=($(n)?[]:me(p,e=>{let t=e[0],n=e[2].fetchState;if(e[1])return"object"!=typeof n?"Loading"===n?t.name+": loading…":void 0:(n.TAG,t.name+": "+n._0)})).concat(bK(u,h.map(e=>e.name),f)),N=[k,E,x,b,w,C].flatMap(e=>e),T=ge(me(v,e=>{if(e.partial)return e.readModel.name}),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r("div",{children:[i("h2",{children:"Dashboard",className:S8}),i(s6,{kpis:y}),0!==N.length?i("div",{children:N,className:w8}):null,0!==T.length?i("span",{children:"Figures cover the rows loaded for: "+T.join(", "),className:R8}):null,0!==A.length?i("span",{children:A.join(" · "),className:R8}):null],className:x8})};function Q8(e){switch(e){case"PlatformSuppliedField":return"platform-supplied-field";case"NewEntityIdentity":return"new-entity-identity";case"SelfReference":return"self-reference";case"AlreadyPlaced":return"already-placed";case"NarrowerRefTarget":return"narrower-ref-target";case"OptionalField":return"optional-field";case"SystemCommand":return"system-command"}}function Y8(e){switch(e){case"PlatformSuppliedField":return"the field is @owner — the resolver overwrites it with the caller's id";case"NewEntityIdentity":return"the field is the new entity's own id, minted at submit";case"SelfReference":return"the command's own aggregate is this view — it is already an Instance command";case"AlreadyPlaced":return"this view already offers the command";case"NarrowerRefTarget":return"an explicit @ref names a different view, so this one is wider than the command accepts";case"OptionalField":return"the field is optional, so the command is not about the row";case"SystemCommand":return"the command is platform-run, never clicked"}}function Z8(e){return!!$(e.tier)&&0===e.vetoes.length}function e9(e){return 0!==e.vetoes.length}function t9(e){return!!q(e.tier)&&0===e.vetoes.length}function n9(e,t,n,r,i,o){let s=[];vt(e.command.ownerField,n)&&s.push("PlatformSuppliedField");let a=e.enclosingAggregate,l=tI(n),c=void 0!==a&&void 0!==l&&l.toLowerCase()===a.name.toLowerCase();return"Collection"===e.command.level&&(vt(e.command.aggregateIdField,n)||c)&&s.push("NewEntityIdentity"),rI(function(e){let t=e.command.aggregateIdField;if(void 0!==t)return U(tI(t),t);let n=e.enclosingAggregate;return void 0!==n?n.name:e.slice}(e),o,{pluginId:t.pluginId,viewName:t.name})&&s.push("SelfReference"),t.placed.some(t=>t===e.command.name)&&s.push("AlreadyPlaced"),i&&s.push("NarrowerRefTarget"),r.some(e=>e===n)||s.push("OptionalField"),e.system&&s.push("SystemCommand"),s}function r9(e,t,n,r,i){let o=function(e){return e.flatMap(e=>{let t=(t,n,r,i)=>r.map(r=>({pluginId:e.id,slice:t,command:r,enclosingAggregate:n,system:i})),n=e.aggregates.flatMap(e=>t(e.name,e,e.commands,!1).concat(t(e.name,e,U(e.systemCommands,[]),!0))),r=e.stateChangeSlices.flatMap(e=>t(e.name,void 0,e.commands,!1).concat(t(e.name,void 0,U(e.systemCommands,[]),!0)));return n.concat(r)})}(t),s=void 0!==i?i:C2,a=[];return o.forEach(t=>{let n=d3(t.command.schema);var i;(i=t.command.schema,L(j(j(ht(i),e=>Xe(e,"properties")),ht),[],e=>me(Qe(e),e=>{let t=e[0],n=ht(e[1]),r=$(j(n,e=>Xe(e,"const"))),i=j(j(n,e=>Xe(e,"type")),dt),o=j(j(j(j(n,e=>Xe(e,"items")),ht),e=>Xe(e,"type")),dt);if(!r&&void 0!==i)switch(i){case"array":return"string"===o?t:void 0;case"string":return t;default:return}}))).forEach(i=>{let o,l=function(e,t,n){return z(e.references.find(e=>e.fieldName===t),e=>{let t=e.plugin,r=void 0!==t?n.filter(e=>e.pluginId===t):n,i=Ja(r,e.entity);return void 0!==i?i:Ha(r,e.entity)})}(t.command,i,r),c=function(e,t){return j(tI(e),e=>Ha(t,e))}(i,r);if(void 0!==l){let e=D(l),t=0;void 0!==e&&void 0!==c&&e.pluginId===c.pluginId&&e.name===c.name?o=[[e,!0]]:t=1,1===t&&(o=[[e,!0],[c,!1]])}else o=[[c,!1]];o.forEach(o=>{let c=o[1];M(o[0],o=>{e.filter(e=>e.pluginId===o.pluginId&&e.name===o.name).forEach(e=>{let o=n9(t,e,i,n,!c&&$(l),r),u=c&&t.pluginId===e.pluginId?"ExplicitRefSamePlugin":void 0,d=$(u)&&0===o.length?s(t.command,t.enclosingAggregate,t.pluginId):t.command;a.push({viewName:e.name,action:{label:d.label,pluginId:t.pluginId,slice:t.slice,command:d,field:i},tier:u,vetoes:o})})})})})}),a}function i9(e,t){return e.filter(e=>e.viewName===t)}let o9={actor:"",eventType:"",timeFrom:"",timeTo:""};function s9(e){return""!==e.actor||""!==e.eventType||""!==e.timeFrom||""!==e.timeTo}function a9(e){return"var("+e+")"}let l9=co([gi("flex"),mi("column"),ui("gap",a9(bt.sm))]),c9=co([gi("flex"),di("center"),ui("gap",a9(bt.md)),_i("wrap"),ui("padding-bottom",a9(bt.xs)),ui("border-bottom","1px solid var("+_t.border+")")]),u9=co([gi("flex"),di("center"),ui("gap","4px")]),d9=co([ui("color",a9(_t.textSecondary)),ui("font-size",a9(xt.sizeSm)),ui("white-space","nowrap")]),f9=co([ui("background",a9(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",a9(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",a9(xt.sizeSm)),ui("color",a9(_t.textPrimary)),ui("outline","none"),Xi([ui("border-color",a9(_t.brand))])]),h9=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",a9(_t.brand)),ui("font-size",a9(xt.sizeSm)),pi("pointer"),Yi([ui("text-decoration","underline")])]),p9=co([gi("flex"),xi("center"),ui("padding-top",a9(bt.xs))]),g9=co([ui("background",a9(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",a9(St.sm)),ui("padding","4px var("+bt.md+")"),ui("font-size",a9(xt.sizeSm)),ui("color",a9(_t.textPrimary)),pi("pointer"),Yi([ui("border-color",a9(_t.brand))])]);let m9=function(e){let t=e.emptyLabel,n=e.onLoadMore,o=e.loading,s=e.hasMore,a=e.onFilterChange,l=e.filter,c=void 0!==s&&s,u=void 0!==o&&o,d=void 0!==t?t:"No recorded history for this record",f=me([["actor","Actor",e.actors.map(e=>({label:e,value:e})),l.actor],["eventType","Event",e.eventTypes.map(e=>({label:lt(e),value:e})),l.eventType]],e=>{let t=e[2];return 0===t.length?void 0:{key:e[0],label:e[1],options:t,value:e[3]}});return r("div",{children:[r("div",{children:[i(P0,{filters:f,onFilterChange:(e,t)=>{switch(e){case"actor":return a({actor:t,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:l.timeTo});case"eventType":return a({actor:l.actor,eventType:t,timeFrom:l.timeFrom,timeTo:l.timeTo});default:return}}}),r("div",{children:[i("span",{children:"From:",className:d9}),i("input",{className:f9,type:"date",value:l.timeFrom,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:e.target.value,timeTo:l.timeTo})}),i("span",{children:"To:",className:d9}),i("input",{className:f9,type:"date",value:l.timeTo,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:e.target.value})})],className:u9}),s9(l)?i("button",{children:"Clear filters",className:h9,onClick:e=>a(o9)}):null],className:c9}),i(eZ,{entries:e.entries,emptyLabel:s9(l)?"No events match these filters":d,onEntryClick:e.onEntryClick,nowMs:e.nowMs}),c?i("div",{children:i("button",{children:u?"Loading…":"Load earlier events",className:g9,disabled:u,onClick:e=>M(n,e=>e())}),className:p9}):null],className:l9})};let v9=function(e){let t=e.entityId,n=e.binding,r=NI(),o=mG(),l=L(e.requiredAccess,!1,e=>!o(e)),c=s(()=>[]),u=c[1],d=c[0],f=s(()=>o9),p=f[1],g=f[0],m=s(()=>!0),v=m[1],y=s(()=>{}),_=y[1],b=y[0],x=s(()=>!1),S=x[1],w=s(()=>{})[1],E=s(()=>0),k=E[1],C=E[0],A=h(void 0),N=g.actor+"|"+g.eventType+"|"+g.timeFrom+"|"+g.timeTo;a(()=>{if(!l)if(void 0!==r){let e=0===C,i=e?void 0:A.current;v(e=>!0),_(e=>{}),ce(r(n.queryDocument,function(e,t,n){let r={};return r.entityId=e,r.first=50,M(n,e=>{r.after=e}),""!==t.actor&&(r.user=t.actor),""!==t.eventType&&(r.eventTypes=[t.eventType]),M(function(e){return""===e?void 0:e+"T00:00:00.000Z"}(t.timeFrom),e=>{r.timeFrom=e}),M(function(e){return""===e?void 0:e+"T23:59:59.999Z"}(t.timeTo),e=>{r.timeTo=e}),r}(t,g,i)).then(t=>{let r=function(e,t){return me(II(e,t),rK)}(t,n.queryField),i=function(e,t){let n=OI(e,t);return[n.hasNextPage,n.endCursor]}(t,n.queryField),o=i[1],s=i[0];return u(t=>e?r:r.concat(t)),S(e=>s),w(e=>o),A.current=o,v(e=>!1),Promise.resolve()}),e=>(v(e=>!1),_(e=>"Could not load the history for this record."),Promise.resolve()))}else _(e=>"Not connected")},[N,C,l]);let T=e=>{A.current=void 0,k(e=>0),u(e=>[]),p(t=>e)},R=()=>k(e=>e+1|0);return l?null:void 0!==b?i(V0,{title:"History unavailable",detail:b,onRetry:()=>k(e=>e+1|0)}):i(m9,{entries:sK(d,n.displayName),actors:aK(d),eventTypes:lK(d),filter:g,onFilterChange:T,hasMore:x[0],loading:m[0],onLoadMore:R})};function y9(e){return"var("+e+")"}let _9=co([gi("flex"),mi("column"),ui("gap",y9(bt.lg))]),b9=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",y9(bt.md))]),x9=co([ui("font-size",y9(xt.sizeXl)),ui("font-weight",y9(xt.weightMedium)),ui("color",y9(_t.textPrimary)),ki(to(0))]),S9=co([gi("flex"),_i("wrap"),di("center"),ui("gap",y9(bt.md)),ui("font-size",y9(xt.sizeSm)),ui("color",y9(_t.textSecondary))]),w9=co([gi("inlineFlex"),di("center"),ui("gap","4px"),pi("pointer")]);let E9=co([ui("font-size",y9(xt.sizeXs)),ui("color",y9(_t.textDisabled))]),k9=co([gi("flex"),di("center"),ui("gap",y9(bt.sm))]),C9=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",y9(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",y9(_t.textSecondary)),ui("font-size",y9(xt.sizeSm)),pi("pointer"),Yi([ui("background",y9(_t.surfaceSubtle)),ui("color",y9(_t.textPrimary))])]);let A9=function(e){let t=e.viewAccess,n=e.uiHints,o=e.readModels,a=e.pluginId,l=void 0!==t?t:{},c=ae(),u=mG(),d=NI(),f=TI(),h=Wa(),p=M0(),g=s(()=>[]),m=g[1],v=g[0],y=o.map((e,t)=>{let n=_K(l,e.name,u),r=n&&!v.includes(e.name);return[e,t,r,n,W3(e,r)]}),_=(e,t)=>U(j(j(n,t=>xF(t,e.name)),e=>e.accent),n0[fe(t,n0.length)]),b=me(y,e=>{let t=e[4],r=e[0],i=j(n,e=>xF(e,r.name)),o=Ba(r.schema,j(n,e=>SF(e,r.name)),{field:r.labelField,source:r.labelFieldSource}),s=z(o.statusField,e=>v3(e,r.commands,j(i,e=>e.transitions))),l=k1(d,f,r.commands,r.name,t.isLive,t.refetch,h,p.onNotice,void 0);if(e[2])return{readModelName:r.name,rows:t.rows,schema:r.schema,semantics:o,accent:_(r,e[1]),window:Lo(t.canLoadMore),onOpenRow:(e,t)=>c(Ya(a,r.name,e,[])),onCommand:z(s,e=>l),statusCommandFor:s,ownEntity:{pluginId:a,viewName:r.name}}}),x=me(y,e=>{if(e[2]&&e[4].canLoadMore)return e[0].name}),S=me(y,e=>{let t=e[0],n=e[4].fetchState;if(e[2])return"object"!=typeof n?"Loading"===n?t.name+": loading…":void 0:(n.TAG,t.name+": "+n._0)}).concat(bK(l,o.map(e=>e.name),u));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:x9}),className:b9}),i("div",{children:y.filter(e=>e[3]).map(e=>{let t=e[0];return r("label",{children:[i("input",{checked:e[2],type:"checkbox",onChange:e=>{let n=t.name;m(e=>e.includes(n)?e.filter(e=>e!==n):e.concat([n]))}}),i("span",{className:(n=_(t,e[1]),co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",n)]))}),t.name],className:w9},t.name);var n}),className:S9}),p.element,e.mode.render(b),0!==x.length?r("div",{children:[i("button",{children:"Load more",className:C9,onClick:e=>{y.forEach(e=>{let t=e[4];if(e[2]&&t.canLoadMore)return t.loadMore()})}}),i("span",{children:"More rows available: "+x.join(", "),className:E9})],className:k9}):null,0!==S.length?i("span",{children:S.join(" · "),className:E9}):null],className:_9})};function N9(e){return"var("+e+")"}let T9=co([gi("flex"),mi("column"),ui("gap",N9(bt.lg)),ui("padding","0 var("+bt.md+")"),ui("min-width","0")]),R9=co([gi("flex"),di("center"),ui("gap",N9(bt.sm)),yi(0)]),D9=co([gi("flex"),mi("column"),ui("gap",N9(bt.sm)),ui("min-width","0")]),I9=co([gi("flex"),di("start"),ui("gap",N9(bt.md)),ui("padding","var("+bt.xs+") 0"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Zi([ui("border-bottom","none")])]),F9=co([ui("color",N9(_t.textSecondary)),ui("font-size",N9(xt.sizeMd)),ui("font-weight",N9(xt.weightMedium)),ui("white-space","nowrap"),ui("padding-top","2px"),yi(0),ui("min-width","200px")]),O9=co([ui("color",N9(_t.textPrimary)),ui("font-size",N9(xt.sizeMd)),ui("word-break","break-word"),ui("min-width","0")]),P9=co([gi("flex"),di("start"),ui("gap",N9(bt.md)),ui("padding","var("+bt.xs+") 0"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Zi([ui("border-bottom","none")])]),M9=co([ui("color",N9(_t.textSecondary)),ui("font-size",N9(xt.sizeMd)),ui("font-weight",N9(xt.weightMedium)),ui("padding-top","2px"),yi(0),ui("min-width","200px")]),L9=co([gi("flex"),mi("column"),ui("gap",N9(bt.sm)),vi(1),ui("padding",N9(bt.md)),ui("background",N9(_t.surfaceSubtle)),ui("border-radius",N9(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("min-width","0")]),z9=co([gi("flex"),mi("column"),ui("gap",N9(bt.sm)),ui("min-width","0")]),j9=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",N9(bt.md)),ui("padding-bottom",N9(bt.xs)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),U9=co([ui("color",N9(_t.textPrimary)),ui("font-size",N9(xt.sizeMd)),ui("font-weight",N9(xt.weightMedium))]),B9=co([ui("overflow-x","auto"),ui("max-width","100%"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",N9(St.md))]),$9=co([ui("color",N9(_t.textDisabled)),ui("font-size",N9(xt.sizeSm))]);function q9(e,t){return U(j(j(ht(e),e=>Xe(e,"title")),dt),lt(t))}function G9(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function V9(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function K9(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function W9(e){let t=e.toLowerCase(),n=e.length,r=r=>{let i=r.length;if(n>i&&t.endsWith(r))return e.slice(0,n-i|0)},i=r("ids");if(void 0!==i)return i;let o=r("id");return void 0!==o?o:void 0}function H9(e,t){let n=Lt(t),r=G9(n),i=Ft(n);if(void 0!==i)return{TAG:"TaggedUnion",_0:i};if(void 0!==r)switch(r){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(n);if(void 0===t)return"ArrayOfScalars";let r=G9(t);if(K9(t)||vt(r,"object"))return{TAG:"ArrayOfObjects",_0:t};if(!vt(r,"string"))return"ArrayOfScalars";let i=W9(e);return void 0!==i?{TAG:"EntityRefArray",_0:i}:"ArrayOfStrings";case"boolean":return"Bool";case"object":return K9(n)?{TAG:"NestedObject",_0:n}:{TAG:"Scalar",_0:"object",_1:void 0}}if(!function(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}(e))return{TAG:"Scalar",_0:U(r,"string"),_1:V9(n)};let o=W9(e);return void 0!==o?{TAG:"EntityRef",_0:o}:{TAG:"Scalar",_0:U(r,"string"),_1:V9(n)}}function J9(e,t,n,r){let o=ut(e);if("object"!=typeof o)switch(o){case"JSONFalse":return i(Ss,{variant:"Neutral",label:"false",dot:!1});case"JSONTrue":return i(Ss,{variant:"Success",label:"true",dot:!1});case"JSONNull":return i("span",{children:"—",className:$9})}else switch(o.TAG){case"JSONString":let r=o._0;return"date-time"===t?ms(r):U(bs(n,r),r);case"JSONNumber":return o._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}function X9(e){return U(z(pt(e),e=>e.map(e=>{let t=ut(e);if("object"!=typeof t)switch(t){case"JSONFalse":return"false";case"JSONTrue":return"true";case"JSONNull":return"—"}else switch(t.TAG){case"JSONString":return t._0;case"JSONNumber":return t._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}})),[])}function Q9(e){return U(z(pt(e),e=>me(e,ht)),[])}function Y9(e,t){let n=j(Xe(e,"id"),dt);if(void 0!==n)return n;let r=j(Xe(e,"compositeId"),dt);return void 0!==r?r:"#"+t.toString()}function Z9(e){return e.map((e,t)=>({key:Y9(e,t),row:e}))}let e7=function(e){let t,n,o=e.headerAccessory,a=e.entityPanel,l=e.uiHints,c=e.viewName,u=e.pluginId,f=e.drillPath,h=e.labelField,p=e.aggregateId,g=e.lifecycleField,m=e.rowActions,v=e.commands,y=e.rootLabel,_=e.schema,b=e.data,x=void 0!==v?v:[],S=void 0!==m?m:[],w=void 0!==f?f:[],E=NI(),k=_1(),C=Wa(),A=Ge(),N=d(R5),T=GG(),R=d(c5),D=L(R,!1,e=>"Bar"===e.placement)&&$(T),I=void 0!==u&&void 0!==c?{pluginId:u,viewName:c}:void 0,F=ae(),O=s(()=>[]),B=O[1],G=s(()=>{}),V=G[1],K=s(()=>({})),W=K[1],H=K[0],X=zq(),Q=$(u)&&$(c)?w:O[0],Y=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return F(Ya(u,c,p,e));B(t=>e)},Z=function(e,t,n){for(;;){let r=t,i=r[0];if(void 0===i)return e;let o=e[e.length-1|0];if(void 0===o)return;let s,a=$(ht(o.data)),l=pt(o.data);if(a){let e=U(ht(o.data),{}),t=j(j(ht(o.schema),e=>Xe(e,"properties")),ht),n=j(t,e=>Xe(e,i)),r=Xe(e,i);s=void 0!==r&&void 0!==n?{data:r,schema:n,label:q9(n,i)}:void 0}else if($(l)){let e=U(l,[]),t=U(j(ht(o.schema),e=>Xe(e,"items")),o.schema),n=e.find((e,t)=>Y9(U(ht(e),{}),t)===i);s=void 0!==n?{data:n,schema:t,label:i}:void 0}else s=void 0;if(void 0===s)return;e.push(s),n.push(i),t=r.slice(1)}}([{data:b,schema:_,label:y}],Q,[]),ee=U(ht(b),{}),te=aI(_,"Drill",C,I,h,void 0),ne=JI([ee],te,C,I,void 0),re={lookupLabel:(e,t)=>LI(ne,e,C,t),isMissing:(e,t)=>UI(ne,e,C,t),retiredBadge:(e,t)=>zI(ne,e,C,t),linkable:(e,t)=>jI(ne,e,C,t,!1)},ie=L(j(Iq(),e=>e.identity),[],e=>e.groups),oe=(e,t,n)=>r("div",{children:[i("div",{children:t,className:F9}),i("div",{children:n,className:O9})],className:I9},e),se=(e,t,n)=>rI(e,C,I)?n:dI(e,t,C,n),le=function(e,t){if(void 0!==t&&"id"!==t)return j(j(j(ht(e),e=>Xe(e,t)),dt),e=>""===e?void 0:e)}(b,h),ue=e=>{let t=ut(e.data);if("object"!=typeof t){if("JSONNull"===t)return i("span",{children:"—",className:$9})}else switch(t.TAG){case"JSONObject":let t=U(ht(e.data),{}),n=0===Q.length,o=aI(e.schema,"Drill",C,I,n?h:void 0,void 0),s=n&&$(le)?function(e,t){let n=e.filter(e=>yt(e.key,t));return 0===n.length?e:n}(o,h):o;return 0===s.length?i("span",{children:"(no fields)",className:$9}):i("div",{children:s.map(e=>{let n=e.key,o=e.propSchema,s=P(Xe(t,n),e=>"JSONNull"!==ut(e)),a=q9(o,n),d=H9(n,o);if(void 0===s)return oe(n,a,U(function(e,t){return _D(e,t,null)}(n,o),i("span",{children:"—",className:$9})));if("object"!=typeof d){if("Bool"===d)return oe(n,a,J9(s,void 0,n))}else switch(d.TAG){case"Scalar":let e=_D(n,o,s);return oe(n,a,void 0!==e?e:J9(s,d._1,n));case"EntityRef":let f=d._0;return oe(n,se(f,!1,a),pI(0,f,s,C,0,re,I,void 0,void 0));case"EntityRefArray":let h=d._0;return oe(n,se(h,!0,a),pI(0,h,s,C,0,re,I,void 0,void 0));case"NestedObject":let p=_D(n,o,s);if(void 0!==p)return oe(n,a,p);let g=aI(d._0,"Drill",C,I,void 0,void 0),m=U(j(Xe(t,n),ht),{});return r("div",{children:[i("div",{children:a,className:M9}),i("div",{children:g.map(e=>{let t=Xe(m,e.key);return r("div",{children:[i("div",{children:fI(e,C,I),className:F9}),i("div",{children:vI(e.key,e.kind,e.propSchema,t,void 0,C,A,re,I),className:O9})],className:I9},e.key)}),className:L9})],className:P9},n);case"ArrayOfObjects":let v=d._0,_=Z9(Q9(s)),b=_.length,x=U(c,y),S=x+"."+n,w=j(l,e=>xF(e,S)),E=jF(v,w,{registry:C,ownEntity:I}),k=sF(u,x,n),N=Xe(H,n),T=UF(void 0!==N?N:aF(k),w,Bs(v),void 0,E),R=e=>{lF(k,e,X),W(t=>{let r=Ze(Qe(t));return r[n]={mode:e,band:X},r})},D=U(pt(s),[]),F=e=>{let t=Ba(v,j(l,e=>SF(e,S)),void 0),r=j(w,e=>e.accent),i={readModelName:S,rows:D,schema:v,semantics:t,accent:r,window:"Complete",onOpenRow:(e,t)=>{let r=function(e,t){let n=e.findIndex(t);if(-1!==n)return n}(D,e=>e===t),i=void 0!==r?L(_[r],e,e=>e.key):e;Y(Q.concat([n,i]))}};return e.render([i])},O=aI(v,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:e.label,render:t=>vI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width})),P=0===b?i("span",{children:"(empty)",className:$9}):i("div",{children:i(Mo,{columns:O,data:_,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([n,e.key])),density:"Comfortable"}),className:B9}),M=void 0!==T&&T.id!==QI?F(T):P;return r("div",{children:[r("div",{children:[i("span",{children:a,className:U9}),r("span",{children:[E.length>1?i(pF.make,{modes:E,activeId:L(T,QI,e=>e.id),onSelect:R}):null,i(ps,{count:b,label:"items",onClick:()=>Y(Q.concat([n]))})],style:{display:"inline-flex",alignItems:"center",gap:"8px"}})],className:j9}),M],className:z9},n);case"TaggedUnion":let z=_D(n,o,s);if(void 0!==z)return oe(n,a,z);let B=va(s);if(void 0===B)return oe(n,a,J9(s,void 0,n));let $=B[1],q=B[0],G=Pt(d._0,q),V=L(G,q,e=>e.tag),K=L(G,[],e=>aI(Mt(e),"Drill",C,I,void 0,void 0)),J=r("span",{children:[a,cI(V)],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}});return 0!==K.length?r("div",{children:[i("div",{children:J,className:M9}),i("div",{children:K.map(e=>r("div",{children:[i("div",{children:fI(e,C,I),className:F9}),i("div",{children:vI(e.key,e.kind,e.propSchema,Xe($,e.key),void 0,C,A,re,I),className:O9})],className:I9},e.key)),className:L9})],className:P9},n):oe(n,a,cI(V))}return oe(n,a,i(Zo,{items:X9(s)}))}),className:D9});case"JSONArray":let a=Z9(Q9(e.data)),d=U(j(ht(e.schema),e=>Xe(e,"items")),e.schema),f=aI(d,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:fI(e,C,I),render:t=>vI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width}));return 0===a.length?i("span",{children:"(empty)",className:$9}):i("div",{children:i(Mo,{columns:f,data:a,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([e.key])),density:"Comfortable"}),className:B9})}return i("div",{children:J9(e.data,void 0,void 0),className:O9})},de=U(le,U(p,y)),fe=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return Ya(u,c,p,Q.slice(0,e))},he=void 0!==Z?Z.slice(0,Z.length-1|0).map((e,t)=>({label:0===t?de:e.label,href:fe(t),onClick:()=>Y(Q.slice(0,t))})):[],pe=L(R,[],e=>e.ancestors).concat(he);if(void 0!==Z){let e=Z.length,n=Z[Z.length-1|0];t=1!==e&&void 0!==n?n.label:de}else t=de;if(void 0!==Z){let e=Z[Z.length-1|0];n=void 0!==e?ue(e):null}else n=i(V0,{title:"Drill path no longer valid",detail:"The data shape has changed since this view was opened.",onRetry:()=>Y([])});let ge,me=0===Q.length,ve=me?oH(x.filter(e=>"Instance"===e.level),ee,g):[];if(me&&void 0!==g){let e=qs(_,g),t=v3(g,x,j(j(l,e=>j(c,t=>xF(e,t))),e=>e.transitions));if(e.map((n,r)=>e.slice(0,r).some(e=>$(t(n,e)))).some(e=>e))ge=void 0;else{let e=function(e,t,n){return function(e,t){let n=e.indexOf(t);return e.map((e,t)=>[e,n<0?"Upcoming":t<n?"Done":t===n?"Current":"Upcoming"])}(qs(e,t),n).map(e=>{let t=e[0];return{key:t,label:lt(t),state:e[1]}})}(_,g,U(iH(ee,g),""));ge=0!==e.length?i(pZ,{steps:e}):void 0}}else ge=void 0;let ye=Gs(_,j(j(l,e=>j(c,t=>xF(e,t))),e=>e.retiredLabel)),_e=me?U(j(ye,e=>Ks(e,Xe(ee,e.field))),null):null,be=me&&void 0!==p?N2(S,ee,g,ye).map(e=>{let t=D2(e,p);return{key:"rowAction:"+e.command.name,label:e.label,run:()=>V(e=>({command:t.command,rowId:void 0,initialValues:t.initialValues,navigateTo:t.navigateTo,formKey:t.formKey}))}}):[],xe=i(v1,{crumbs:pe,title:t,titleAccessory:r("div",{children:[_e,me&&void 0!==o&&void 0!==p?o(p):null],className:R9}),commands:ve.map(e=>({key:e.name,label:e.label,run:()=>V(t=>({command:e,rowId:p,formKey:e.name+":"+U(p,"")}))})).concat(be),controls:j(R,e=>e.controls),inBar:D});return r("div",{children:[VG(D?T:void 0,xe),U(ge,null),me?i(na,{fill:e=>{if(void 0!==p)return z(P(A5(_,e,x),e=>N5(e.command,ie)),e=>()=>V(t=>({command:e.command,rowId:p,formKey:e.command.name+":"+U(p,"")})))},children:n}):n,me&&void 0!==a&&void 0!==p?a(p):null,L(G[0],null,e=>{let t=e.command;return i(aW,{isOpen:!0,onClose:()=>V(e=>{}),title:t.label,children:i(o5,{schema:t.schema,aggregateId:e.rowId,aggregateIdField:t.aggregateIdField,injectNewId:"Collection"===t.level,ownerField:t.ownerField,ownerValue:t.ownerValue,initialValues:e.initialValues,refFields:t.refFields,onSubmit:n=>void 0!==k?ce(k(t.mutationDocument,m4(t.schema,n)).then(n=>{if("object"!=typeof n)return"Accepted"===n?(V(e=>{}),M(N,e=>e()),M(e.navigateTo,J),Promise.resolve("Ok")):(V(e=>{}),q(e.navigateTo)&&M(N,e=>{setTimeout(e,500)}),M(e.navigateTo,J),Promise.resolve("Ok"));{if("Rejected"===n.TAG){let e=n._0;return w1(E,C,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let e=n._0;return console.error("[AutoUI] "+t.name+": command not executed — "+e),Promise.resolve({TAG:"Err",_0:e})}}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(V(e=>{}),Promise.resolve("Ok")),submitLabel:"Execute"},e.formKey)})})],className:T9})};function t7(e){return"var("+e+")"}let n7=co([gi("flex"),mi("column"),ui("gap",t7(bt.md))]),r7=co([gi("flex"),di("center"),ui("gap",t7(bt.md)),ui("flex-wrap","wrap"),ui("padding-bottom",t7(bt.sm)),ui("border-bottom","1px solid var("+_t.border+")")]),i7=co([ui("font-size",t7(xt.sizeLg)),ui("font-weight",t7(xt.weightMedium)),ui("color",t7(_t.textPrimary)),ki(to(0))]),o7=co([gi("flex"),di("center"),_i("wrap"),ui("gap",t7(bt.sm)),ui("margin-left","auto")]);let s7=function(e){let t=e.contextId,n=e.slice,o=NI(),a=_1(),l=Wa(),c=s(()=>{}),u=c[1];return r("div",{children:[r("div",{children:[i("h2",{children:n.name,className:i7}),i("div",{children:n.commands.map(e=>i("button",{children:e.label,className:m1,onClick:t=>u(t=>e)},e.name)),className:o7})],className:r7}),L(c[0],null,e=>i(aW,{isOpen:!0,onClose:()=>u(e=>{}),title:e.label,children:i(o5,{schema:e.schema,aggregateId:t,aggregateIdField:e.aggregateIdField,injectNewId:"Collection"===e.level,ownerField:e.ownerField,ownerValue:e.ownerValue,refFields:e.refFields,onSubmit:t=>void 0!==a?ce(a(e.mutationDocument,m4(e.schema,t)).then(t=>{if("object"==typeof t){if("Rejected"===t.TAG){let e=t._0;return w1(o,l,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let n=t._0;return console.error("[AutoUI] "+e.name+": command not executed — "+n),Promise.resolve({TAG:"Err",_0:n})}return u(e=>{}),Promise.resolve("Ok")}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(u(e=>{}),Promise.resolve("Ok")),submitLabel:"Execute"},e.name+":"+U(t,""))}))],className:n7})};let a7=function(e){let t=e.uiHints,n=e.hostViewName,a=e.entityId,l=e.binding,c=Wa(),u=Ge(),d=ae(),f=mG(),h=L(e.requiredAccess,!1,e=>!f(e)),p=K3(l.readModel,function(e,t){let n={};return M(BK(Ze([[e.refField,t]]),"",{search:!1},[]),e=>{n.filter=e}),n}(l,a),a,!h,void 0,25),g=p.rows.map(e=>U(ht(e),{})),m=function(e,t){let n=ht(e);if(void 0===n)return e;let r=Ze(Qe(n)),i=j(Xe(r,"properties"),ht);if(void 0===i)return e;let o=Ze(Qe(i).filter(e=>e[0]!==t));r.properties=o;let s=j(Xe(r,"required"),pt);return void 0!==s&&(r.required=s.filter(e=>yt(dt(e),t))),r}(l.readModel.schema,l.refField),v=Ja(c,l.readModel.name),y=z(v,e=>({pluginId:e.pluginId,viewName:l.readModel.name})),_=function(e,t){return e+"."+t.readModel.name}(n,l),b=Ba(m,j(t,e=>SF(e,_)),{field:l.readModel.labelField,source:l.readModel.labelFieldSource}),x=aI(m,"List",c,y,b.labelField,b.projectedLabelField),S=j(t,e=>xF(e,_)),w=jF(l.readModel.schema,S,{registry:c,ownEntity:y}),E=sF(e.pluginId,n,l.readModel.name),k=s(()=>aF(E)),C=k[1],A=zq(),N=UF(k[0],S,Bs(l.readModel.schema),void 0,w),T=JI(g,x,c,y,void 0),R={lookupLabel:(e,t)=>LI(T,e,c,t),isMissing:(e,t)=>UI(T,e,c,t),retiredBadge:(e,t)=>zI(T,e,c,t),linkable:(e,t)=>jI(T,e,c,t,!1)},D=bI(x,c,u,Xe,void 0,R,y,void 0,void 0,void 0),I=e=>j(Xe(e,"id"),dt),F=e=>U(I(e),JSON.stringify(e)),O=e=>M(v,t=>d(Ya(t.pluginId,t.name,e,[]))),P=z(v,e=>e=>M(I(e),O));if(h)return null;let B,$=p.fetchState;if("object"!=typeof $)if("Loading"===$)B=i(B1,{});else{let e,t=0;void 0!==N&&N.id!==QI?e=(e=>{let t=l.readModel.name,n=p.rows,r=j(S,e=>e.accent),i=Lo(p.canLoadMore),o={readModelName:t,rows:n,schema:m,semantics:b,accent:r,window:i,onOpenRow:(e,t)=>{let n=j(ht(t),I);return O(void 0!==n?n:e)},ownEntity:y,refLabels:R};return e.render([o])})(N):t=1,1===t&&(e=i(Mo,{columns:D,data:g,keyFn:F,onRowClick:P})),B=r(o,{children:[e,p.canLoadMore?i("button",{children:"Load more",onClick:e=>p.loadMore()}):null]})}else B="Error"===$.TAG?i(V0,{title:"Could not load related rows",detail:$._0,onRetry:p.refetch}):i(V0,{title:"Not available",detail:$._0});return r("section",{children:[r("div",{children:[i("h3",{children:lt(l.readModel.name)}),w.length>1?i(pF.make,{modes:w,activeId:L(N,QI,e=>e.id),onSelect:e=>{lF(E,e,A),C(t=>({mode:e,band:A}))}}):null],style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}}),B]})},l7={contents:void 0};function c7(e){l7.contents=e}function u7(e){return e.filter(e=>"Instance"===e.level)}function d7(e,t,n,r,i){let o=void 0!==r?r:[],s=u7(n),a=u7(o),l=qs(e,t),c=y3(e,t,n,i),u=function(e,t,n){let r=f3(n),i=qs(e,t),o={};return r.forEach(e=>{let t=e.targetState;void 0===t||U(e.allowedStates,[]).forEach(n=>{i.includes(n)&&i.includes(t)&&(o[c3(n,t)]={command:e.name,patch:{},tier:"DeclaredTarget"})})}),o}(e,t,o),d=(e,t,n)=>({commandName:n.name,label:n.label,toState:void 0!==e?_3(t?u:c,e,n.name):n.targetState,system:t}),f=(e,t,n)=>me(n,n=>{let r=n.allowedStates;if(void 0!==r&&r.includes(e))return d(e,t,n)}),h=l.map(e=>{let t=f(e,!1,s).concat(f(e,!0,a));return{value:e,label:lt(e),terminal:0===t.length,outgoing:t}}),p=(e,t)=>t.filter(e=>q(e.allowedStates)).map(t=>d(void 0,e,t));return{lifecycleField:t,states:h,anyState:p(!1,s).concat(p(!0,a))}}function f7(e,t){let n=void 0!==t?t:[],r=e.states.flatMap(e=>me(e.outgoing,t=>z(t.toState,n=>({fromState:e.value,toState:n,command:t.label,selfLoop:n===e.value,system:t.system})))),i=me(r,e=>e.selfLoop?void 0:e.toState).concat(function(e){return me(u7(e),e=>e.targetState)}(n)),o=z(e.states[0],e=>e.value),s=e.states.map(e=>({value:e.value,label:e.label,terminal:e.terminal,unreachable:!i.includes(e.value)&&yt(e.value,o),unresolved:e.outgoing.filter(e=>q(e.toState)).map(e=>e.label)}));return{nodes:s,edges:r,anyState:e.anyState.map(e=>({label:e.label,system:e.system,toState:e.toState}))}}function h7(e){return"var("+e+")"}let p7=co([gi("flex"),mi("column"),ui("gap",h7(bt.md))]),g7=co([ui("font-size",h7(xt.sizeLg)),ui("font-weight",h7(xt.weightMedium)),ui("color",h7(_t.textPrimary)),ki(to(0))]),m7=co([ui("font-size",h7(xt.sizeXs)),ui("color",h7(_t.textDisabled))]),v7=co([gi("flex"),ui("flex-wrap","wrap"),di("flexStart"),ui("gap",h7(bt.md))]);let y7=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",h7(bt.sm))]),_7=co([ui("font-size",h7(xt.sizeXs)),ui("color",h7(_t.textDisabled)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),b7=co([gi("flex"),mi("column"),ui("gap","6px")]),x7=co([gi("flex"),di("center"),ui("flex-wrap","wrap"),ui("gap","4px")]),S7=co([ui("color",h7(_t.textSecondary)),ui("font-size",h7(xt.sizeSm))]),w7=co([ui("font-size",h7(xt.sizeXs)),ui("color",h7(_t.textDisabled))]),E7=co([gi("flex"),mi("column"),ui("gap",h7(bt.sm)),ui("padding-top",h7(bt.sm))]),k7=co([ui("font-size",h7(xt.sizeXs)),ui("font-weight",h7(xt.weightMedium)),ui("color",h7(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),C7=co([gi("flex"),ui("flex-wrap","wrap"),ui("gap","6px")]);function A7(e,t){let n=t.toState;return r("div",{children:[t.system?i(TQ.make,{label:t.label}):i(NQ.make,{label:t.label}),void 0!==n?r(o,{children:[i("span",{children:"→",className:S7}),i(AQ.make,{swatch:_Q(e,n),label:lt(n),dot:!1})]}):null],className:x7},t.commandName)}let N7=function(e){let t,n=e.display,s=e.title,a=e.systemCommands,l=e.lifecycleField,c=void 0!==a?a:[],u=void 0!==n?n:"Lane",d=d7(e.schema,l,e.commands,c,e.transitions),f=d.states.map(e=>e.value);return t="Lane"===u?void 0:function(e,t){return z(l7.contents,n=>n(e,t))}(f7(d,c),U(s,lt(l))),r("div",{children:[void 0!==s?i("h3",{children:s,className:g7}):null,i("div",{children:"Lifecycle on “"+lt(l)+"”",className:m7}),void 0!==t?t:r(o,{children:[i("div",{children:d.states.map(e=>{let t=_Q(f,e.value);return r("div",{children:[r("div",{children:[i(AQ.make,{swatch:t,label:e.label}),e.terminal?i("span",{children:"end",className:_7}):null],className:y7}),e.terminal?i("span",{children:"No commands available",className:w7}):i("div",{children:e.outgoing.map(e=>A7(f,e)),className:b7})],className:(n=t,co([gi("flex"),mi("column"),ui("gap",h7(bt.sm)),ui("flex","0 1 240px"),ui("padding",h7(bt.md)),ui("background",h7(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-left","3px solid "+n.border),ui("border-radius",h7(St.md))]))},e.value);var n}),className:v7}),0!==d.anyState.length?r("div",{children:[i("span",{children:"Any state",className:k7}),i("div",{children:d.anyState.map(e=>A7(f,e)),className:C7})],className:E7}):null]})],className:p7})};function T7(e){return"var("+e+")"}let R7=co([gi("flex"),mi("column"),ui("gap",T7(bt.xl))]),D7=co([ui("font-size",T7(xt.sizeXl)),ui("font-weight",T7(xt.weightMedium)),ui("color",T7(_t.textPrimary)),ki(to(0))]),I7=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",T7(bt.md))]),F7=co([gi("flex"),mi("column"),ui("gap",T7(bt.md)),ui("padding",T7(bt.lg)),ui("background",T7(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",T7(St.md))]);function O7(e){return e.filter(e=>function(e,t,n,r){let i=void 0!==r?r:[];return void 0!==t&&0!==qs(e,t).length&&u7(n.concat(i)).some(e=>{let t=e.allowedStates;return void 0!==t&&0!==t.length})}(e.schema,e.lifecycleField,e.commands,U(e.systemCommands,[])))}let P7="lifecycle",M7="diagram";let L7=function(e){let t=e.uiHints,n=l5(),o=O7(e.views),s=vt(n.get(P7),M7)?"Diagram":"Lane",a=(e,t,r)=>i("button",{children:e,"aria-pressed":r?"true":"false",className:r?pF.Style.btnActive:pF.Style.btn,onClick:e=>n.set(P7,t)},t),l=$(l7.contents)?r("div",{children:[a("Lane","","Lane"===s),a("Diagram",M7,"Diagram"===s)],"aria-label":"Lifecycle rendering",className:pF.Style.group,role:"group"}):null;return r("div",{children:[r("div",{children:[i("h2",{children:"Lifecycles",className:D7}),l],className:I7}),0!==o.length?o.map(e=>i("div",{children:i(N7,{schema:e.schema,lifecycleField:U(e.lifecycleField,""),commands:e.commands,systemCommands:U(e.systemCommands,[]),title:e.name,transitions:j(j(t,t=>xF(t,e.name)),e=>e.transitions),display:s}),className:F7},e.name)):i(_o,{title:"No lifecycles",description:"No view in this plugin declares a lifecycle enum with state-scoped commands."})],className:R7})};function z7(e){return"var("+e+")"}let j7=co([gi("flex"),mi("column"),ui("gap",z7(bt.md)),ui("font-family",z7(xt.fontFamily))]),U7=co([gi("flex"),di("center"),ui("gap",z7(bt.sm)),ui("color",z7(_t.textSecondary)),ui("font-size",z7(xt.sizeSm)),ui("font-weight",z7(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),B7=co([gi("inlineFlex"),di("center"),ui("padding","0 6px"),ui("border-radius",z7(St.full)),ui("background",z7(_t.surfaceElevated)),ui("color",z7(_t.textPrimary)),ui("font-size",z7(xt.sizeXs)),ui("letter-spacing","0")]),$7=co([gi("flex"),mi("column"),ui("gap",z7(bt.md))]),q7=co([gi("flex"),di("flexStart"),ui("gap",z7(bt.sm))]),G7=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0"),vi(1)]),V7=co([gi("flex"),di("baseline"),ui("gap",z7(bt.sm))]),K7=co([ui("color",z7(_t.textPrimary)),ui("font-size",z7(xt.sizeSm)),ui("font-weight",z7(xt.weightMedium))]),W7=co([ui("color",z7(_t.textDisabled)),ui("font-size",z7(xt.sizeXs))]),H7=co([ui("color",z7(_t.textPrimary)),ui("font-size",z7(xt.sizeSm)),ui("line-height",z7(xt.lineHeightNormal)),ui("white-space","pre-wrap"),ui("word-break","break-word")]),J7=co([ui("color",z7(_t.textDisabled)),ui("font-size",z7(xt.sizeSm)),ui("padding","var("+bt.sm+") 0")]),X7=co([gi("flex"),mi("column"),di("flexEnd"),ui("gap",z7(bt.sm))]),Q7=co([ui("width","100%"),ui("min-height","64px"),ui("padding",z7(bt.sm)),ui("background",z7(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",z7(St.md)),ui("color",z7(_t.textPrimary)),ui("font-family",z7(xt.fontFamily)),ui("font-size",z7(xt.sizeSm)),ui("resize","vertical")]),Y7=co([ui("background",z7(_t.brand)),ui("border","none"),ui("border-radius",z7(St.md)),ui("color",z7(_t.textOnBrand)),ui("padding","4px var("+bt.md+")"),ui("font-size",z7(xt.sizeSm)),ui("font-weight",z7(xt.weightMedium)),pi("pointer"),Ji([ui("opacity","0.5"),pi("default")])]),Z7=co([ui("color",z7(_t.error)),ui("font-size",z7(xt.sizeXs)),ui("align-self","flex-start")]);function eee(e){let t=e.comment,n=t.timestamp;return r("div",{children:[i(Ho,{name:U(t.author,"?"),src:t.authorImageUrl,size:"Medium"}),r("div",{children:[r("div",{children:[i("span",{children:U(t.author,"Unknown"),className:K7}),void 0!==n?i("span",{children:jY(e.nowMs,n),className:W7}):null],className:V7}),i("span",{children:t.body,className:H7})],className:G7})],className:q7})}let tee=function(e){let t=e.nowMs,n=e.error,o=e.posting,a=e.onPost,l=e.emptyLabel,c=e.title,u=e.comments,d=void 0!==c?c:"Comments",f=void 0!==l?l:"No comments yet",h=void 0!==o&&o,p=void 0!==t?t:Date.now(),g=s(()=>""),m=g[1],v=g[0],y=v.trim(),_=""!==y&&!h,b=()=>{if(_)return M(a,e=>e(y)),m(e=>"")};return r("div",{children:[r("div",{children:[d,i("span",{children:u.length.toString(),className:B7})],className:U7}),0===u.length?i("div",{children:f,className:J7}):i("div",{children:u.map(e=>i(eee,{comment:e,nowMs:p},e.id)),className:$7}),void 0!==a?r("div",{children:[i("textarea",{className:Q7,disabled:h,placeholder:"Write a comment…",value:v,onKeyDown:e=>{if("Enter"===e.key&&(e.metaKey||e.ctrlKey))return e.preventDefault(),b()},onChange:e=>{let t=e.target.value;m(e=>t)}}),void 0!==n?i("span",{children:n,className:Z7}):null,i("button",{children:h?"Posting…":"Comment",className:Y7,disabled:!_,onClick:e=>b()})],className:X7}):null],className:j7})};let nee=function(e){let t=e.entityId,n=e.binding,r=NI(),o=_1(),a=Wa(),l=mG(),c=L(e.requiredAccess,!1,e=>!l(e)),u=W3(n.readModel,!c),d=s(()=>!1),f=d[1],h=s(()=>{}),p=h[1];if(c)return null;let g=function(e,t,n){let r=me(t,t=>{let r=U(ht(t),{});if(vt(OK(r,e.entityField),n))return r}),i=t=>j(j(e.timestampField,e=>OK(t,e)),gc);return r.toSorted((e,t)=>{let n=i(e),r=i(t);return void 0!==n?void 0!==r?n-r:-1:void 0!==r?1:0}).map((t,n)=>({id:U(OK(t,"id"),"#"+n.toString()),body:U(OK(t,e.bodyField),""),author:j(e.authorField,e=>OK(t,e)),timestamp:j(e.timestampField,e=>OK(t,e))}))}(n,u.rows,t),m=n.postCommand,v=void 0!==r&&void 0!==m?e=>{let i=n.postCommand;if(void 0!==o&&void 0!==i)return f(e=>!0),p(e=>{}),void ce(o(i.mutationDocument,function(e,t,n){let r=e.postCommand,i=U(j(r,e=>e.aggregateIdField),e.entityField),o=U(j(r,e=>kK(e.schema,xK)),e.bodyField);return Ze([[i,t],[o,n]])}(n,t,e)).then(e=>{if(f(e=>!1),"object"!=typeof e)return u.refetch(),Promise.resolve();{if("Rejected"===e.TAG){let t=e._0;return w1(r,a,t.errorCode,t.detail).then(e=>(p(t=>e),Promise.resolve()))}let t=e._0;return console.error("[AutoUI] comment not posted — "+t),p(e=>t),Promise.resolve()}}),e=>(f(e=>!1),p(e=>"Could not post the comment."),Promise.resolve()))}:void 0;return i(tee,{comments:g,onPost:v,posting:d[0],error:h[0]})};function ree(e){return"var("+e+")"}let iee=co([gi("flex"),mi("column"),ui("gap",ree(bt.lg))]),oee=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",ree(bt.md))]),see=co([ui("font-size",ree(xt.sizeXl)),ui("font-weight",ree(xt.weightMedium)),ui("color",ree(_t.textPrimary)),ki(to(0))]),aee=co([gi("flex"),_i("wrap"),di("center"),ui("gap",ree(bt.md)),ui("font-size",ree(xt.sizeSm)),ui("color",ree(_t.textSecondary))]),lee=co([gi("inlineFlex"),di("center"),ui("gap","4px"),pi("pointer")]);let cee=co([ui("font-size",ree(xt.sizeXs)),ui("color",ree(_t.textDisabled))]),uee=co([gi("flex"),di("center"),ui("gap",ree(bt.sm))]),dee=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",ree(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",ree(_t.textSecondary)),ui("font-size",ree(xt.sizeSm)),pi("pointer"),Yi([ui("background",ree(_t.surfaceSubtle)),ui("color",ree(_t.textPrimary))])]);let fee=function(e){let t,n=e.viewAccess,o=e.uiHints,a=e.events,l=e.resource,c=e.pluginId,u=void 0!==n?n:{},d=ae(),f=mG(),h=NI(),p=TI(),g=Wa(),m=M0(),v=s(()=>[]),y=v[1],_=v[0],b=e=>Ba(e.schema,j(o,t=>SF(t,e.name)),{field:e.labelField,source:e.labelFieldSource}),x=W3(l,!0),S={readModelName:l.name,rows:x.rows,schema:l.schema,semantics:b(l),window:Lo(x.canLoadMore),onOpenRow:(e,t)=>d(Ya(c,l.name,e,[])),role:b3,ownEntity:{pluginId:c,viewName:l.name}},w=a.map((e,t)=>{let n=_K(u,e.readModel.name,f),r=n&&!_.includes(e.readModel.name);return[e,t,r,n,W3(e.readModel,r)]}),E=(e,t)=>U(j(j(o,t=>xF(t,e.name)),e=>e.accent),n0[fe(t,n0.length)]),k=me(w,e=>{let t=e[4],n=e[0],r=T3(n.readModel.commands,n.resourceRef),i=k1(h,p,n.readModel.commands,n.readModel.name,t.isLive,t.refetch,g,m.onNotice,void 0);if(e[2])return{readModelName:n.readModel.name,rows:t.rows,schema:n.readModel.schema,semantics:b(n.readModel),accent:E(n.readModel,e[1]),window:Lo(t.canLoadMore),onOpenRow:(e,t)=>d(Ya(c,n.readModel.name,e,[])),onCommand:z(r,e=>i),role:x3,resourceRef:n.resourceRef,assignCommand:r,ownEntity:{pluginId:c,viewName:n.readModel.name}}}),C=[S].concat(k),A=(x.canLoadMore?[l.name]:[]).concat(me(w,e=>{if(e[2]&&e[4].canLoadMore)return e[0].readModel.name})),N=x.fetchState,T=0;"object"!=typeof N?t="Loading"===N?[l.name+": loading…"]:[]:T=1,1===T&&(t=[l.name+": "+N._0]);let R=t.concat(me(w,e=>{let t=e[0],n=e[4].fetchState;if(e[2])return"object"!=typeof n?"Loading"===n?t.readModel.name+": loading…":void 0:(n.TAG,t.readModel.name+": "+n._0)}).concat(bK(u,a.map(e=>e.readModel.name),f)));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:see}),className:oee}),i("div",{children:w.filter(e=>e[3]).map(e=>{let t=e[0];return r("label",{children:[i("input",{checked:e[2],type:"checkbox",onChange:e=>{let n=t.readModel.name;y(e=>e.includes(n)?e.filter(e=>e!==n):e.concat([n]))}}),i("span",{className:(n=E(t.readModel,e[1]),co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",n)]))}),t.readModel.name],className:lee},t.readModel.name);var n}),className:aee}),m.element,e.mode.render(C),0!==A.length?r("div",{children:[i("button",{children:"Load more",className:dee,onClick:e=>(x.canLoadMore&&x.loadMore(),void w.forEach(e=>{let t=e[4];if(e[2]&&t.canLoadMore)return t.loadMore()}))}),i("span",{children:"More rows available: "+A.join(", "),className:cee})],className:uee}):null,0!==R.length?i("span",{children:R.join(" · "),className:cee}):null],className:iee})};function hee(e){return e}function pee(e,t){let n=void 0!==t?t:[];return e.map(e=>({name:e.name,schema:e.schema,commands:e.commands,rowActionCandidates:i9(n,e.name),declaredLabelField:e.labelField,declaredLabelSource:e.labelFieldSource}))}function gee(e){if("object"==typeof e)return"heuristic:"+e._0;switch(e){case"Annotation":return"annotation";case"Type":return"type";case"Hint":return"hint"}}function mee(e,t,n){return void 0!==t?Object.entries(y3(e.schema,t,e.commands,j(n,e=>e.transitions))):[]}function vee(e){let t=[["command",k2(e.action)],["field",e.action.field]],n=L(e.tier,[],e=>[["tier","explicit-ref-same-plugin"]]),r=e.vetoes,i=0!==r.length?[["vetoes",r.map(Q8)]]:[];return Ze(t.concat(n).concat(i))}function yee(e){let t=t=>e.filter(t).map(vee);return Ze([["attached",t(Z8)],["vetoed",t(e9)],["deferred",t(t9)]])}function _ee(e){return z(e.declaredLabelField,t=>({field:t,source:e.declaredLabelSource}))}function bee(e,t){return L(P(e.declaredLabelSource,n=>vt(e.declaredLabelField,t)),t,e=>t+" ("+e+")")}function xee(e,t){if("Pair"===t.TAG){let e=t.endField,n=t.startField;return void 0!==e?n+".."+e:n}let n=t._0;return L(Xe(e.semantics,n),n,e=>n+" ("+gee(e.provenance)+")")}function See(e,t){switch(t.TAG){case"Paired":return t.latField+"/"+t.lngField;case"Pointed":let n=t._0;return L(Xe(e.semantics,n),n,e=>n+" ("+gee(e.provenance)+")");case"Geolocated":let r=t._0;return L(Xe(e.semantics,r),r+" (point on Located)",e=>r+" ("+gee(e.provenance)+", point on Located)")}}function wee(e,t,n,r){return Ze([["plugin",e],["hintErrors",(void 0!==r?r:[]).map(hee)],["views",t.map(e=>function(e,t,n){let r=e.name,i=e.schema,o=Ba(i,t,_ee(e)),s=Qe(o.semantics).map(e=>{let t=e[1];return Ze([["field",e[0]],["semantic",ia(t.semantic)],["provenance",gee(t.provenance)]])}),a=[];M(o.geo,e=>{a.push(["geo",See(o,e)])}),M(o.dateSpan,e=>{a.push(["dateSpan",xee(o,e)])}),M(o.statusField,e=>{a.push(["status",e])}),M(o.labelField,t=>{a.push(["label",bee(e,t)])}),M(o.imageField,e=>{a.push(["image",e])}),M(o.parentField,e=>{a.push(["parent",e])});let l=nF(i,void 0).map(e=>e.id),c=mee(e,o.statusField,n).map(e=>{let t=e[1];return[e[0],t.command+" ("+l3(t.tier)+")"]});return Ze([["view",r],["capableModes",l],["roles",Ze(a)],["transitions",Ze(c)],["rowActions",yee(U(e.rowActionCandidates,[]))],["fields",s]])}(e,j(n,t=>SF(t,e.name)),j(n,t=>xF(t,e.name))))]])}function Eee(e,t,n,r){let i=void 0!==r?r:[];console.log('[AutoUI] Inference report — plugin "'+e+'"'),function(e,t){return e.map(e=>{let n=e.name,r=e.schema,i=Ba(r,j(t,e=>SF(e,n)),_ee(e)),o=nF(r,void 0).map(e=>e.id).join(", "),s=[];M(i.geo,e=>{s.push("geo="+See(i,e))}),M(i.dateSpan,e=>{s.push("dateSpan="+xee(i,e))}),M(i.statusField,e=>{s.push("status="+e)}),M(i.labelField,t=>{s.push("label="+bee(e,t))}),M(i.imageField,e=>{s.push("image="+e)}),M(i.parentField,e=>{s.push("parent="+e)});let a=0===s.length?"":"; "+s.join("; "),l=Object.keys(i.semantics).length,c=mee(e,i.statusField,j(t,e=>xF(e,n))),u=i.statusField,d=c.length,f=void 0!==u?"; "+d.toString()+" transition(s)":"",h=U(e.rowActionCandidates,[]),p=e=>h.filter(e).length.toString(),g=0!==h.length?"; row actions "+p(Z8)+" attached, "+p(e9)+" vetoed, "+p(t9)+" deferred":"";return n+": modes "+o+a+f+g+"; "+l.toString()+" field semantic(s)"})}(t,n).forEach(e=>{console.log(" "+e)}),t.forEach(e=>{U(e.rowActionCandidates,[]).forEach(t=>{let n,r=t.tier,i=t.vetoes,o=0;void 0!==r&&0===i.length?n="attached (explicit-ref-same-plugin)":o=1,1===o&&(n=0!==i.length?"not offered — "+i.map(Y8).join("; "):"deferred — no tier admits it yet"),console.log(" "+e.name+" · "+k2(t.action)+"("+t.action.field+"): "+n)})}),console.log(JSON.stringify(wee(e,t,n,i),null,2))}function kee(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}function Cee(e){return Object.fromEntries([["kind",e.kind],["senderId",e.senderId],["sentAt",e.sentAt],["body",e.body]])}function Aee(e,t,n,r,i){let o=void 0===r||r,s=xO(),l=j(s,e=>e.clientNamespace()),c=o&&$(l)&&L(s,!1,e=>e.clientChannelsAvailable()),u=void 0!==l?function(e,t,n){return"/"+kee(e)+"/"+kee(t)+"/"+kee(n)}(l,e,t):void 0,d=h(i);d.current=i,a(()=>{let e=c?s:void 0;if(void 0!==e&&void 0!==u)return e.subscribe("Domain",u,e=>{let t=function(e){let t=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=n("kind"),i=n("senderId");return void 0!==r&&void 0!==i?{kind:r,senderId:i,sentAt:U(j(t.sentAt,Je.float),0),body:U(t.body,null)}:void 0}(e);if(void 0!==t&&t.senderId!==n)return d.current(t)})},[c,U(u,""),n]);return{available:c,publish:(e,t)=>{let r=c?s:void 0;if(void 0===r)return;if(void 0===u)return;let i=Date.now(),o={kind:e,senderId:n,sentAt:i,body:t};r.publish("Domain",u,[Cee(o)]).then(e=>{"Ok"!==e.TAG&&console.warn("[AutoClientChannel] publish to "+u+" failed: "+e._0)})}}}let Nee="heartbeat",Tee="hello",Ree="leave";function Dee(e){let t=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=n("userId");return void 0!==r&&""!==r?[r,U(n("username"),r)]:void 0}function Iee(e,t,n,r,i){let o=void 0===i||i,l=s(()=>[]),c=l[1],u=h(void 0),d=Aee("presence",t,n,o&&""!==n,e=>{if(c(t=>function(e,t,n){let r=t.kind;if(r===Ree){let n=Dee(t.body);if(void 0===n)return e;let r=n[0];return e.filter(e=>e.userId!==r)}if(r!==Nee&&r!==Tee)return e;let i=Dee(t.body);if(void 0===i)return e;let o=i[0],s=e.filter(e=>e.userId!==o);return s.concat([{userId:o,username:i[1],lastSeen:n}])}(t,e,Date.now())),e.kind!==Tee)return;let t=u.current;void 0===t||setTimeout(()=>t(),1e3*Math.random())}),f=d.available,p=d.publish;return a(()=>{if(!f)return;let e=function(e,t){return Object.fromEntries([["userId",e],["username",t]])}(n,r),t=()=>p(Nee,e);u.current=t,p(Tee,e),p(Nee,e);let i=setInterval(t,1e4);return()=>{clearInterval(i),u.current=void 0,p(Ree,e)}},[f,n,r,t]),a(()=>{if(!f)return;let e=setInterval(()=>c(e=>{return t=e,n=Date.now(),t.filter(e=>n-e.lastSeen<25e3);var t,n}),1e4);return()=>{clearInterval(e)}},[f]),f?l[0]:[]}function Fee(e){return"var("+e+")"}let Oee=co([gi("inlineFlex"),di("center"),ui("gap",Fee(bt.xs))]),Pee=co([ui("font-family",Fee(xt.fontFamily)),ui("font-size",Fee(xt.sizeSm)),ui("color",Fee(_t.textSecondary)),ui("white-space","nowrap")]);function Mee(e){return 1===e?"1 other here":e.toString()+" others here"}let Lee=function(e){let t=e.showLabel,n=e.max,o=e.size,s=e.people,a=void 0!==o?o:"Small",l=void 0!==n?n:4,c=void 0===t||t;if(0===s.length)return null;let u=s.map(e=>({name:e.username,imageUrl:e.imageUrl}));return r("span",{children:[i(Zs,{members:u,size:a,max:l}),c?i("span",{children:Mee(s.length),className:Pee}):null],className:Oee,title:s.map(e=>e.username).join(", ")})};let zee=function(e){let t=j(Iq(),e=>e.identity),n=L(t,"",e=>e.userId),r=L(t,"",e=>e.username),o=Iee(0,e.readModel+"-"+e.entityId,n,""===r?n:r,""!==n).map(e=>({userId:e.userId,username:e.username}));return i(Lee,{people:o})};function jee(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}let Uee={contents:[]},Bee={contents:[]};function $ee(e,t,n){if("id"!==n)return;let r=e+"."+t;return Uee.contents.some(e=>e===r)?void 0:(Uee.contents.push(r),void console.warn("[AutoUI] Entity "+r+' has labelField="id" — dropdown labels will render as raw UUIDs. Add a @displayName annotation on the source state to fix.'))}function qee(e,t,n,r){if("id"===n||0!==r.length&&r.some(e=>e===n))return;let i=e+"."+t;return Bee.contents.some(e=>e===i)?void 0:(Bee.contents.push(i),void console.warn("[AutoUI] Entity "+i+' labelField="'+n+"\" is not @searchable; the reference dropdown's search will scan the table — OK at small scale, worth designing around before production volumes."))}function Gee(e){let t=[];return e.forEach(e=>{let n=(n,r,i,o,s)=>{$ee(e.id,n,i),qee(e.id,n,i,o);let a=Gs(s,void 0),l=void 0!==a&&a.namedWhenRetired?a:void 0;t.push({pluginId:e.id,name:n,queryField:r,singleQueryField:tt(r),labelField:i,namedRetirement:l})};e.readModels.forEach(e=>n(e.name,e.queryField,e.labelField,e.searchableFields,e.schema)),e.stateViewSlices.concat(U(e.internalQueryables,[])).forEach(e=>n(e.name,e.queryField,e.labelField,e.searchableFields,e.schema))}),t}function Vee(e,t){let n=e.toLowerCase(),r=t=>{let r=t.length,i=e.length;if(i>r&&n.endsWith(t))return e.slice(0,i-r|0)};if(!t)return r("id");let i=r("ids");return void 0!==i?i:r("id")}function Kee(e){return[tt(e),nt(e)]}function Wee(e,t){return e.find(e=>e.name===t)}function Hee(e,t){let n=jee(t),r=Wee(e,nt(n));return void 0!==r?r:Wee(e,n)}function Jee(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt)}function Xee(e,t,n,r){return me(e.references,i=>{let o,s=i.fieldName.includes("[]"),a=d4(i.fieldName);if(void 0!==a){let e=a[1],t=j(j(Xe(r,a[0]),ht),f4),n=j(j(j(j(t,ht),e=>Xe(e,"properties")),ht),t=>Xe(t,e));o=void 0!==n?[n,!0,U(z(t,Jee),[]).some(t=>t===e)]:[void 0,!1,!1]}else o=s?[void 0,!1,!1]:[Xe(r,i.fieldName),!0,n.some(e=>e===i.fieldName)];let l=j(o[0],ht),c=j(j(l,e=>Xe(e,"type")),dt),u=vt(c,"array"),d=i.plugin,f=void 0!==d?t.filter(e=>e.pluginId===d):t,h=Wee(f,i.entity),p=void 0!==h?h:Hee(f,i.entity);if(o[1]){if(void 0!==p){let e=Kee(p.name);return{propertyKey:i.fieldName,queryField:p.queryField,singleQueryField:p.singleQueryField,labelField:p.labelField,multi:u,required:o[2],entityName:e[0],entityNamePlural:e[1]}}console.warn("[AutoUI] Command "+e.name+" field "+i.fieldName+': explicit @ref to "'+i.entity+'" did not resolve to a registered entity. Falling back to text input.')}else console.warn("[AutoUI] Command "+e.name+" field "+i.fieldName+": explicit @ref path does not name a property of a record array on this command. Falling back to text input.")})}function Qee(e,t,n,r,i,o){let s=[];return void 0!==i&&Qe(i).forEach(i=>{let a=i[0],l=ht(i[1]),c=$(j(l,e=>Xe(e,"const")));if(c)return;let u,d=j(j(l,e=>Xe(e,"type")),dt),f=j(j(j(j(l,e=>Xe(e,"items")),ht),e=>Xe(e,"type")),dt);if(void 0!==d)switch(d){case"array":u="string"===f||void 0;break;case"string":u=!1;break;default:u=void 0}else u=void 0;if(void 0===u)return;let h=!1;if("Collection"===e.level&&!u){let n;if(void 0!==t)if(vt(e.aggregateIdField,a))n=!0;else{let e=Vee(a,!1);n=void 0!==e&&e.toLowerCase()===t.name.toLowerCase()}else n=vt(e.aggregateIdField,a);h=n}if(h)return;let p,g,m=e.aggregateIdField;if(void 0===m||void 0===t||m!==a||u)p=void 0;else{let e=Wee(n,nt(t.name));p=void 0!==e?e:Wee(n,t.name)}if(void 0!==p)g=p;else{let e=Vee(a,u);g=void 0!==e?Hee(n,e):void 0}if(void 0!==g){g.pluginId!==o&&console.warn("[AutoUI] Command "+e.name+" field "+a+' resolved cross-plugin to "'+g.name+'" in plugin "'+g.pluginId+'" via naming heuristic. Add @ref("'+g.pluginId+"."+g.name+'") to make the cross-plugin reference explicit, or @ref("<LocalEntity>") to target a same-plugin entity.');let t=Kee(g.name),n=g.queryField,i=g.singleQueryField,l=g.labelField,c=r.some(e=>e===a),d=t[0],f=t[1],h={propertyKey:a,queryField:n,singleQueryField:i,labelField:l,multi:u,required:c,entityName:d,entityNamePlural:f};return void s.push(h)}void 0===Vee(a,u)||console.warn("[AutoUI] Command "+e.name+" field "+a+" looks like a reference but no matching entity was registered. Falling back to text input.")}),s}function Yee(e,t,n,r){let i=Jee(e.schema),o=j(j(ht(e.schema),e=>Xe(e,"properties")),ht);return 0===e.references.length?Qee(e,t,n,i,o,r):Xee(e,n,i,U(o,{}))}function Zee(e,t){let n=(n,r)=>{let i={...n};return i.refFields=Yee(n,r,t,e.id),i},r={...e};return r.stateChangeSlices=e.stateChangeSlices.map(e=>{let t={...e};return t.commands=e.commands.map(e=>n(e,void 0)),t}),r.aggregates=e.aggregates.map(e=>{let t={...e};return t.commands=e.commands.map(t=>n(t,e)),t}),r.readModels=e.readModels.map(e=>{let t={...e};return t.commands=e.commands.map(e=>n(e,void 0)),t}),r}let ete={capitalize:jee,singularize:tt,warnedIdLabel:Uee,warnedUnsearchable:Bee,warnIfIdLabel:$ee,warnIfUnsearchable:qee,buildRegistry:Gee,stemFromKey:Vee,entityDisplayNames:Kee,findByName:Wee,findByStem:Hee,requiredSet:Jee,resolveExplicitRefs:Xee,resolveByHeuristic:Qee,resolveForCommand:Yee,enrichPlugin:Zee};function tte(e){let t=Je.object(e);if(void 0===t)return;if($(Ft(e)))return;let n=j(t.properties,Je.object);if(void 0!==n)return n;let r=j(j(j(t.items,Je.object),e=>e.properties),Je.object);return void 0!==r?r:ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(t[n],Je.array),e=>ge(e,void 0,(e,t)=>void 0!==e?e:tte(t))))}function nte(e,t){let n=me(Object.entries(e),e=>L(Ds(e[1]),!1,e=>ks(e,"x-reventless-hidden"))?void 0:e[0]);return t&&!n.includes("id")?["id"].concat(n):n}let rte=new Map;function ite(e,t,n){let r=me(t.arms,e=>{let r=Ot(t,e);if(void 0===r)return;let i=n(e);return""===i?void 0:"... on "+r+" { "+i+" }"});return t.arms.some(e=>q(Ot(t,e)))&&function(e){if(q(rte.get(e)))rte.set(e,!0),console.error('AutoUI: the union field "'+e+'" carries neither '+Nt+" on the field nor "+Tt+" on its arms, so its member types cannot be named. It will be selected as `"+e+" { __typename }` — the arm is readable, its fields are not. The platform emitting this schema is behind the union contract.")}(e),0!==r.length?e+" { __typename "+r.join(" ")+" }":e+" { __typename }"}function ote(e,t,n){let r=void 0!==t?t:3;return nte(e,void 0===n||n).map(t=>{let n=j(e[t],Ft);if(void 0!==n)return ite(t,n,e=>r<=0?"":ote(e.properties,r-1|0,!1));if(r<=0)return t;let i=j(e[t],tte);return void 0!==i?t+" { "+ote(i,r-1|0,!1)+" }":t}).join(" ")}function ste(e,t,n){return me(nte(e,!0),t=>{let n=e[t];if(void 0===n)return t;let r=Ft(n);if(void 0!==r)return ite(t,r,e=>ote(e.properties,1,!1));let i=tte(n);if(void 0===i)return t;let o=function(e,t){return me(nte(e,t),t=>{let n=e[t];if(void 0===n)return t;let r=Ft(n);return void 0!==r?ite(t,r,e=>ote(e.properties,1,!1)):q(tte(n))?t:void 0}).join(" ")}(i,!1);return""===o?void 0:t+" { "+o+" }"}).join(" ")}function ate(e){return U(j(j(Je.object(e),e=>e.properties),Je.object),{})}function lte(e,t,n,r,i,o){let s,a=void 0!==r&&r,l=void 0!==i&&i,c=void 0!==o&&o,u=ste(ate(t)),d=a||c,f=["$first: Int","$after: String","$last: Int","$before: String"],h=["first: $first","after: $after","last: $last","before: $before"],p=$(Ls(t)),g=p?f.concat(["$includeRetired: Boolean"]):f,m=p?h.concat(["includeRetired: $includeRetired"]):h;if(void 0!==n){let e=d?["$filter: "+n+"Filter"].concat(g):g,t=d?["filter: $filter"].concat(m):m;s=[l?e.concat(["$orderBy: "+n+"OrderBy"]):e,l?t.concat(["orderBy: $orderBy"]):t]}else s=[g,m];return"query("+s[0].join(", ")+") { "+e+"("+s[1].join(", ")+") { pageInfo { hasNextPage hasPreviousPage startCursor endCursor } edges { cursor node { "+u+" } } } }"}function cte(e,t){let n=ote(ate(t),void 0,void 0),r=$(Ls(t))?[", $includeRetired: Boolean",", includeRetired: $includeRetired"]:["",""],i=r[1],o=r[0],s=js(t);return void 0!==s?"query($id: ID!, $subId: String!"+o+") { "+e+"(id: $id, "+s+": $subId"+i+") { "+n+" } }":"query($id: ID!"+o+") { "+e+"(id: $id"+i+") { "+n+" } }"}function ute(e,t,n){return"Operator"===e?t:U(n,[])}function dte(e,t){let n={},r=(e,t)=>{let r=Xe(n,e);if(void 0!==r){let i=t.filter(e=>!r.some(t=>t.name===e.name));return void(n[e]=r.concat(i))}n[e]=t};return e.aggregates.forEach(e=>{e.linkedViews.forEach(n=>r(n,ute(t,e.commands,e.systemCommands)))}),e.stateChangeSlices.forEach(e=>{let n=ute(t,e.commands,e.systemCommands),i=n.filter(e=>"Collection"===e.level),o=n.filter(e=>"Instance"===e.level);e.linkedViews.forEach(e=>r(e,i));let s=e.consistencyRead;return void 0!==s?r(s,o):void e.linkedViews.forEach(e=>r(e,o))}),n}function fte(e,t,n,r,i){let o=void 0!==i?i:C2,s=e.readModels.map(e=>e.name).concat(e.stateViewSlices.map(e=>e.name)).map(t=>({pluginId:e.id,name:t,placed:U(Xe(r,t),[]).map(e=>e.name)}));return r9(s,t,0,n,o)}function hte(e,t,n,r,s,a,l,c,u,d,f,h,p,m){let v,y=[],_=void 0!==s?s:[],b=void 0!==a?a:[],x=void 0!==l?l:[],S=void 0!==c?c:[],w={},E=void 0!==d?d:{},k=void 0!==f?f:{},C=void 0!==h&&h,A=0===_.length?[e]:_,N=Gee(A),T=Zee(e,N),R=dte(T,"Operator"),D=dte(T,"System"),I=(e,t,n)=>{let r={...e};return r.refFields=Yee(e,t,N,n),r},F=fte(T,A,N,R,I),O=b.find(e=>e.id===T.id);if(void 0!==O){let e=Gee(b);v=fte(O,b,e,dte(O,"Operator"),void 0)}else v=F;let P={};v.filter(Z8).forEach(e=>{P[e.viewName]=U(Xe(P,e.viewName),[]).concat([k2(e.action)])});let B=L(p,[],e=>zF(e,T,b,P)),G=[],V={},K=T.id,W=e=>{let t=T.derivedPages;return void 0===t||t.includes(e)},H=e=>{let t=j(p,t=>xF(t,e));return function(e,t,n){let r=void 0!==t?t:[],i=void 0!==n?n:[],o=e.slice();return r.forEach(e=>{o.some(t=>t.command.name===e.command.name)||o.push(e)}),0===i.length?o:o.filter(e=>!i.some(t=>t===k2(e)))}(function(e,t,n){let r=void 0!==n?n:C2;return me(U(j(e,e=>e.rowActions),[]),e=>A2(e,t,r))}(t,A,I),function(e,t){return i9(e,t).filter(Z8).map(e=>e.action)}(F,e),U(j(t,e=>e.suppressRowActions),[]))},J=(e,t,n,r,o,s)=>{let a=0===zs(l=e.schema).length&&q(js(l));var l;let c=a?e.queryField+"ByIds":void 0,u=a?function(e,t){let n=ste(ate(t)),r=$(Ls(t))?["$ids: [String!]!, $includeRetired: Boolean","ids: $ids, includeRetired: $includeRetired"]:["$ids: [String!]!","ids: $ids"];return"query("+r[0]+") { "+e+"ByIds("+r[1]+") { "+n+" } }"}(e.queryField,e.schema):void 0,d=function(e){let t=Object.keys(ate(e));return t.includes("updatedAt")?"updatedAt":t.includes("createdAt")?"createdAt":void 0}(e.schema),f=Us(e.schema),h=e.name,g=Ue(Xa(K,h)),m=Xe(E,h),v=n+h,y=YV(T.name,h,e.sortIndex,j(p,e=>xF(e,h)),C&&$(e.ownerField)),_={fragmentId:v,title:h,menuEntry:y,requiredAccess:m,url:g},b=H(h),x=K+"."+h;return G.push(Be(Qa(K,h),n=>{let a=function(e){let t=je.wildcard_match(e).split("/").filter(e=>""!==e);return 0===t.length?[void 0,[]]:[z(t[0],e=>decodeURIComponent(e)),t.slice(1).map(e=>decodeURIComponent(e))]}(n);return i(mK,{definition:_,children:(l=a[0],h=a[1],i(K5,{readModel:e,detailView:t,pluginId:K,openRowId:l,drillPath:h,singleQueryField:r,detailQueryDocument:o,byIdsQueryField:c,byIdsQueryDocument:u,sortKeyField:d,liveOffered:f,uiHints:p,schedulerJoin:s,rowActions:b,archiveOffered:!C},x))});var l,h})),function(e,t,n,r){e[function(e,t){return e+"."+t}(t,n)]=Ue(r)}(V,K,h,Xa(K,h)),_},X=T.readModels.filter(e=>!x.includes(e.name)).map(e=>{let t=U(Xe(R,e.name),e.commands),n=U(Xe(D,e.name),U(e.systemCommands,[])),r=tt(e.queryField),i=zK(e.schema);if(""===e.queryDocument){let o={...e};return o.systemCommands=n,o.commands=t,o.queryDocument=lte(e.queryField,e.schema,r,i.hasFilter,i.hasSort,i.hasSearch),o}let o={...e};return o.systemCommands=n,o.commands=t,o}),Q=T.stateViewSlices.filter(e=>!x.includes(e.name)).map(e=>{let t=U(Xe(R,e.name),[]),n=U(Xe(D,e.name),[]),r=tt(e.queryField),i=zK(e.schema),o=lte(e.queryField,e.schema,r,i.hasFilter,i.hasSort,i.hasSearch);return{name:e.name,schema:e.schema,queryDocument:o,queryField:e.queryField,sortIndex:e.sortIndex,commands:t,linkedWriteSide:e.linkedWriteSide,labelField:e.labelField,labelFieldSource:e.labelFieldSource,searchableFields:e.searchableFields,lifecycleField:e.lifecycleField,ownerField:e.ownerField,systemCommands:n}}),Y=function(e,t,n){let r=void 0!==n?n:(e,t)=>{},i={};return tF().filter(e=>{let t=e.arity;return"object"==typeof t&&"Multi"!==t.TAG}).forEach(n=>{let o={},s={},a=(e,t,n)=>{let r=Xe(e,t);void 0!==r?r.push(n):e[t]=[n]};e.forEach(e=>{let r=j(t,t=>xF(t,e.name)),i=U(j(r,e=>e.canvas),n.label),l=j(r,e=>e.role);if(void 0!==l)return l===b3?a(o,i,e):l===x3?M(j(r,e=>e.resourceRef),t=>a(s,i,[e,t])):void 0}),Qe(s).forEach(e=>{let t=e[0],n=U(Xe(o,t),[]),s=n.length;if(1!==s)return 0!==s?r(t,n.length):void 0;let a=n[0];e[1].forEach(e=>{i[e[0].name]={resource:a,resourceRef:e[1]}})})}),i}(X.concat(Q),p,(e,t)=>{console.warn("[AutoUI] "+T.id+': scheduler canvas "'+e+'" has '+t.toString()+" resource models — its events list omits the scheduler toggle (the generated page still renders)")}),Z={...T};Z.readModels=X;let ee=e=>{let t=U(p,bF),n=(r=xF(t,e.name),s=e.schema,o=L(j(ht(s),e=>Xe(e,"x-reventless-audit")),!1,e=>{let t=ut(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG}),!!U(j(r,e=>e.audit),!1)||o);var r,o,s;return z(function(e,t){if(!t)return;let n=e.linkedWriteSide[0],r=function(e){let t=e.lastIndexOf("_");if(-1!==t)return e.slice(0,t)}(e.queryField);if(void 0===n)tK(e.name);else{if(void 0!==r){let e=function(e,t){return e+"_"+t+"EventHistory"}(r,n);return{queryField:e,queryDocument:ZV(e),displayName:n}}tK(e.name)}}(e,n),t=>{let n=Xe(E,e.name);return e=>i(v9,{binding:t,entityId:e,requiredAccess:n})})},te=e=>{let t=U(p,bF);if(U(j(xF(t,e.name),e=>e.presence),!1))return t=>i(zee,{readModel:e.name,entityId:t})},ne={...T};ne.readModels=X.concat(Q);let re=e=>{let t=U(p,bF);return(n=qK(ne,e.name),s=xF(t,e.name),r=j(s,e=>e.related),o=e.name,void 0!==r?me(r,e=>{let t=n.find(t=>t.readModel.name===e);return void 0!==t?t:void console.error("[AutoUI] uiHints.views."+o+'.related names "'+e+'", which does not reference '+o+" through a filterable field — no panel for it. Detected: "+n.map(e=>e.readModel.name).join(", ")+".")}):n).map(t=>{let n=Xe(E,t.readModel.name);return r=>i(a7,{binding:t,entityId:r,hostViewName:e.name,pluginId:K,uiHints:p,requiredAccess:n})});var n,r,o,s},ie=e=>{let t=me([(n=e.name,z(FK(Z,n),e=>{let t=Xe(E,e.readModel.name);return n=>i(nee,{binding:e,entityId:n,requiredAccess:t})}))].concat(re(e).map(e=>e)).concat([ee(e)]),e=>e);var n;if(0!==t.length)return e=>i(o,{children:t.map((t,n)=>i(g,{children:t(e)},n.toString()))})},oe=X.map(e=>{let t=tt(e.queryField),n=cte(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(e7,{data:o,schema:e.schema,rootLabel:e.name,commands:e.commands,rowActions:r,lifecycleField:e.lifecycleField,aggregateId:t,labelField:e.labelField,drillPath:n,pluginId:T.id,viewName:e.name,uiHints:p,entityPanel:ie(e),headerAccessory:te(e)});return J(e,s,T.id+".",t,n,Xe(Y,e.name))}),se=Q.map(e=>{let t=tt(e.queryField),n=cte(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(e7,{data:o,schema:e.schema,rootLabel:e.name,commands:e.commands,rowActions:r,lifecycleField:e.lifecycleField,aggregateId:t,labelField:e.labelField,drillPath:n,pluginId:T.id,viewName:e.name,uiHints:p,entityPanel:ie(e),headerAccessory:te(e)});return J(e,s,T.id+".slice.",t,n,Xe(Y,e.name))}),ae=T.stateChangeSlices.filter(e=>!S.includes(e.name)).map(e=>({fragmentId:T.id+".commands."+e.name,title:e.name,description:"Auto-generated command panel for "+e.name,extensionPackage:T.id,positions:y,component:t=>i(s7,{slice:e,contextId:t.contextId}),requiredAccess:Xe(k,e.name),minWidth:void 0})),le=X.concat(Q).toSorted((e,t)=>e.sortIndex===t.sortIndex?ue(e.name,t.name):de(e.sortIndex,t.sortIndex));$(oF("autoui.inferenceReport"))&&Eee(T.id,pee(le,F),p,B),M(m,e=>e(wee(T.id,pee(le,F),p,B)));let ce,fe=le.map(e=>[e,Ba(e.schema,void 0,void 0)]),he=me(tF(),e=>{let t=e.arity;return"object"!=typeof t||"Multi"!==t.TAG?void 0:[e,t.min]}).flatMap(e=>{let t=e[1],n=e[0],r={};return fe.forEach(e=>{let t=e[0],i=j(p,e=>xF(e,t.name)),o=L(j(i,e=>e.suppress),!1,e=>e.includes(n.id)),s={registry:N};if(!n.isCapable(t.schema,e[1],s)||o)return;let a=U(j(i,e=>e.canvas),n.label),l=Xe(r,a);void 0!==l?l.push(t):r[a]=[t]}),me(Qe(r),e=>{let r=e[1];if(r.length>=t)return[n,e[0],r]})}),pe=W("canvas")?he.map(e=>{let t=e[2],n=e[0],r=((e,t)=>he.some(n=>n[1]===t&&n[0].id!==e.id)?t+" — "+e.label:t)(n,e[1]),o=T.id+".canvas."+r,s=YV(T.name,r,900,void 0,void 0),a=yK(E,t.map(e=>e.name)),l=Ue(Xa(K,r)),c={fragmentId:o,title:r,menuEntry:s,requiredAccess:a,url:l};return G.push(Be(Qa(K,r),e=>i(mK,{definition:c,children:i(A9,{pluginId:K,mode:n,canvasName:r,readModels:t,uiHints:p,viewAccess:E})}))),c}):[],ve=W("scheduler")?me(tF(),e=>{let t=e.arity;return"object"!=typeof t||"Multi"===t.TAG?void 0:[e,t._0]}).flatMap(e=>{let t=e[1],n=e[0],r={},o={},s=(e,t,n)=>{let r=Xe(e,t);void 0!==r?r.push(n):e[t]=[n]};le.forEach(e=>{let t=j(p,t=>xF(t,e.name)),i=U(j(t,e=>e.canvas),n.label),a=j(t,e=>e.role);if(void 0!==a)return a===b3?s(r,i,e):a===x3?M(j(t,e=>e.resourceRef),t=>s(o,i,[e,t])):void 0});let a=(e,n)=>L(t.find(t=>t.role===e),n,e=>e.min),l=a(b3,1),c=a(x3,1);return me(Qe(r),e=>{let t=e[1],r=e[0],s=U(Xe(o,r),[]),a=t[0];if(void 0===a)return;if(!(t.length>=l&&s.length>=c))return;let u=s.map(e=>({readModel:e[0],resourceRef:e[1]})),d=T.id+".scheduler."+r,f=YV(T.name,r,910,void 0,void 0),h=vK(E,a.name),g=Ue(Xa(K,r)),m={fragmentId:d,title:r,menuEntry:f,requiredAccess:h,url:g};return G.push(Be(Qa(K,r),e=>i(mK,{definition:m,children:i(fee,{pluginId:K,canvasName:r,mode:n,resource:a,events:u,uiHints:p,viewAccess:E})}))),m})}):[],ye=X.concat(Q).flatMap(e=>{return(t=e.schema,U(z(j(j(ht(t),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{let t=e[0];return j(j(j(ht(e[1]),e=>Xe(e,"x-reventless-metric")),ht),e=>{let n=j(Xe(e,"aggregate"),dt),r=j(Xe(e,"label"),dt);return z(n,e=>[t,e,r])})})),[])).map(t=>({view:e.name,label:t[2],field:t[0],aggregate:t[1]}));var t}),_e=X.concat(Q).flatMap(e=>function(e,t){let n=Ba(e,t,void 0).semantics;return me(Sa(e),e=>{let t=e[0];return j(Xe(n,t),e=>{if(ca(e.semantic).includes("Measure"))return t})})}(e.schema,j(p,t=>SF(t,e.name))).map(t=>({view:e.name,field:t,aggregate:"sum"}))),be=U(j(p,e=>e.dashboard),[]),xe=be.map(e=>[e.view,U(e.field,"")]),Se=(e,t)=>!e.some(e=>e[0]===t.view&&e[1]===U(t.field,"")),we=ye.filter(e=>Se(xe,e)),Ee=xe.concat(we.map(e=>[e.view,U(e.field,"")])),ke=be.concat(we).concat(_e.filter(e=>Se(Ee,e)));if(0!==ke.length&&W("dashboard")){let e="Dashboard",t=X.concat(Q),n=T.id+".dashboard",r=YV(T.name,e,-100,void 0,void 0),o=yK(E,ge(ke.map(e=>e.view),[],(e,t)=>e.includes(t)?e:e.concat([t])).filter(e=>t.some(t=>t.name===e))),s={fragmentId:n,title:e,menuEntry:r,requiredAccess:o,url:Ue(Xa(K,e))};G.push(Be(Qa(K,e),e=>i(mK,{definition:s,children:i(X8,{pluginId:K,metrics:ke,readModels:t,uiHints:p,viewAccess:E})}))),ce=[s]}else ce=[];let Ce,Ae=O7(X.concat(Q));if(0!==Ae.length&&W("lifecycles")){let e="Lifecycles",t={fragmentId:T.id+".lifecycles",title:e,menuEntry:YV(T.name,e,-50,void 0,void 0),requiredAccess:void 0,url:Ue(Xa(K,e))};G.push(Be(Qa(K,e),e=>i(L7,{views:Ae,uiHints:p}))),Ce=[t]}else Ce=[];return{pages:ce.concat(Ce.concat(oe.concat(se.concat(pe.concat(ve))))),panels:ae,routes:G,publicLinks:V}}function pte(e){return QO(JO(e))}function gte(e){return JO(e).errors.some(e=>!!vt(e.code,"FORBIDDEN")||vt(e.errorType,"Unauthorized"))}let mte=new Map;async function vte(t,n,r){!function(t,n){let r=mte.get(t);if(void 0===r||r!==n)e.registerRemotes([{name:t,entry:n,type:"module"}]),mte.set(t,n)}(t,r);try{let r=await e.loadRemote(t+"/"+n);return null==r?{TAG:"Error",_0:"Module Federation returned null for "+t+"/"+n+" — the plugin's vite federation config probably doesn't expose this fragment."}:{TAG:"Ok",_0:r.default}}catch(i){let e=F(i);return e.RE_EXN_ID!==I?{TAG:"Error",_0:"Failed to load "+t+"/"+n+" from "+r}:{TAG:"Error",_0:"Failed to load "+t+"/"+n+" from "+r+": "+U(e._1.message,"unknown error")}}}const yte=l(null),_te={didCatch:!1,error:null};class bte extends x{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_te}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(_te)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:r}=this.props;var i,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(e.resetKeys,r)&&(null===(i=(o=this.props).onReset)||void 0===i||i.call(o,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(_te))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:o}=this.state;let s=e;if(i){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(e);else if(n)s=c(n,e);else{if(void 0===r)throw o;s=r}}return c(yte.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function xte(e){let t=U(e.error.message,"unknown error");return i("div",{children:"Plugin fragment crashed: "+t,style:{color:"#a00",fontFamily:"system-ui",padding:"1rem"}})}function Ste(e,t){console.error("Fragment crashed:",e)}let wte=function(e){let t=e.fallbackComponent;return c(bte,{FallbackComponent:void 0!==t?t:xte,onError:Ste,children:e.children})};let Ete=function(e){let t=e.remoteEntryUrl,n=e.fragmentId,r=e.pluginId,o=s(()=>"Loading"),l=o[1],u=o[0];return a(()=>{l(e=>"Loading");let e={contents:!1};return vte(r,n,t).then(t=>{if(e.contents)return;if("Ok"===t.TAG){let e=t._0;return l(t=>({TAG:"Loaded",_0:e}))}let n=t._0;l(e=>({TAG:"Failed",_0:n}))}),()=>{e.contents=!0}},[r,n,t]),"object"!=typeof u?i("div",{children:"Loading panel…",style:{fontFamily:"system-ui",padding:"0.75rem"}}):"Loaded"===u.TAG?i(wte,{children:c(u._0,e.panelProps)}):i("div",{children:"Panel error: "+u._0,style:{color:"#a00",padding:"0.75rem"}})};function kte(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function Cte(e){return"object"===kte(e)}function Ate(e,t){return e.length<124?e:t}var Nte,Tte;function Rte(e){if(!Cte(e))throw new Error(`Message is expected to be an object, but got ${kte(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if("string"!=typeof e.type)throw new Error(`Message is expects the 'type' property to be a string, but got ${kte(e.type)}`);switch(e.type){case Tte.ConnectionInit:case Tte.ConnectionAck:case Tte.Ping:case Tte.Pong:if(null!=e.payload&&!Cte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case Tte.Subscribe:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${kte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Cte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${kte(e.payload)}`);if("string"!=typeof e.payload.query)throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${kte(e.payload.query)}`);if(null!=e.payload.variables&&!Cte(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${kte(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==kte(e.payload.operationName))throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${kte(e.payload.operationName)}`);if(null!=e.payload.extensions&&!Cte(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${kte(e.payload.extensions)}`);break;case Tte.Next:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${kte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Cte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${kte(e.payload)}`);break;case Tte.Error:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${kte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(t=e.payload,!(Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case Tte.Complete:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${kte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw new Error(`Invalid message 'type' property "${e.type}"`)}var t;return e}function Dte(e,t){return Rte(e),JSON.stringify(e,t)}!function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"}(Nte||(Nte={})),function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"}(Tte||(Tte={}));var Ite=function(e){return this instanceof Ite?(this.v=e,this):new Ite(e)},Fte=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{!function(e){e.value instanceof Ite?Promise.resolve(e.value.v).then(l,c):u(o[0][2],e)}(i[e](t))}catch(bU){u(o[0][3],bU)}}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}};function Ote(e){const{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:o=0,keepAlive:s=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:c=5,retryWait:u=async function(e){let t=1e3;for(let n=0;n<e;n++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(2700*Math.random()+300)))},shouldRetry:d=Mte,isFatalConnectionProblem:f,on:h,webSocketImpl:p,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:m,jsonMessageReviver:v}=e;let y;if(p){if(!("function"==typeof(_=p)&&"constructor"in _&&"CLOSED"in _&&"CLOSING"in _&&"CONNECTING"in _&&"OPEN"in _))throw new Error("Invalid WebSocket implementation provided");y=p}else"undefined"!=typeof WebSocket?y=WebSocket:"undefined"!=typeof global?y=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(y=window.WebSocket||window.MozWebSocket);var _;if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const b=y,x=(()=>{const e=(()=>{const e={};return{on:(t,n)=>(e[t]=n,()=>{delete e[t]}),emit(t){var n;"id"in t&&(null===(n=e[t.id])||void 0===n||n.call(e,t))}}})(),t={connecting:(null==h?void 0:h.connecting)?[h.connecting]:[],opened:(null==h?void 0:h.opened)?[h.opened]:[],connected:(null==h?void 0:h.connected)?[h.connected]:[],ping:(null==h?void 0:h.ping)?[h.ping]:[],pong:(null==h?void 0:h.pong)?[h.pong]:[],message:(null==h?void 0:h.message)?[e.emit,h.message]:[e.emit],closed:(null==h?void 0:h.closed)?[h.closed]:[],error:(null==h?void 0:h.error)?[h.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function S(e){const t=[x.on("error",n=>{t.forEach(e=>e()),e(n)}),x.on("closed",n=>{t.forEach(e=>e()),e(n)})]}let w,E,k=0,C=!1,A=0,N=!1;async function T(){clearTimeout(E);const[e,r]=await(null!=w?w:w=new Promise((e,r)=>(async()=>{if(C){if(await u(A),!k)return w=void 0,r({code:1e3,reason:"All Subscriptions Gone"});A++}x.emit("connecting",C);const i=new b("function"==typeof t?await t():t,"graphql-transport-ws");let o,c;function d(){isFinite(s)&&s>0&&(clearTimeout(c),c=setTimeout(()=>{i.readyState===b.OPEN&&(i.send(Dte({type:Tte.Ping})),x.emit("ping",!1,void 0))},s))}S(e=>{w=void 0,clearTimeout(o),clearTimeout(c),r(e),e instanceof Pte&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=e=>x.emit("error",e),i.onclose=e=>x.emit("closed",e),i.onopen=async()=>{try{x.emit("opened",i);const e="function"==typeof n?await n():n;if(i.readyState!==b.OPEN)return;i.send(Dte(e?{type:Tte.ConnectionInit,payload:e}:{type:Tte.ConnectionInit},m)),isFinite(l)&&l>0&&(o=setTimeout(()=>{i.close(Nte.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),d()}catch(e){x.emit("error",e),i.close(Nte.InternalClientError,Ate(e instanceof Error?e.message:new Error(e).message,"Internal client error"))}};let f=!1;i.onmessage=({data:t})=>{try{const n=function(e,t){return Rte("string"==typeof e?JSON.parse(e,t):e)}(t,v);if(x.emit("message",n),"ping"===n.type||"pong"===n.type)return x.emit(n.type,!0,n.payload),void("pong"===n.type?d():a||(i.send(Dte(n.payload?{type:Tte.Pong,payload:n.payload}:{type:Tte.Pong})),x.emit("pong",!1,n.payload)));if(f)return;if(n.type!==Tte.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(o),f=!0,x.emit("connected",i,n.payload,C),C=!1,A=0,e([i,new Promise((e,t)=>S(t))])}catch(n){i.onmessage=null,x.emit("error",n),i.close(Nte.BadResponse,Ate(n instanceof Error?n.message:new Error(n).message,"Bad response"))}}})()));e.readyState===b.CLOSING&&await r;let i=()=>{};const c=new Promise(e=>i=e);return[e,i,Promise.race([c.then(()=>{if(!k){const t=()=>e.close(1e3,"Normal Closure");isFinite(o)&&o>0?E=setTimeout(()=>{e.readyState===b.OPEN&&t()},o):t()}}),r])]}function R(e){if(Mte(e)&&(function(e){return![1e3,1001,1006,1005,1012,1013,1014].includes(e)&&(e>=1e3&&e<=1999)}(e.code)||[Nte.InternalServerError,Nte.InternalClientError,Nte.BadRequest,Nte.BadResponse,Nte.Unauthorized,Nte.SubprotocolNotAcceptable,Nte.SubscriberAlreadyExists,Nte.TooManyInitialisationRequests].includes(e.code)))throw e;if(N)return!1;if(Mte(e)&&1e3===e.code)return k>0;if(!c||A>=c)throw e;if(!d(e))throw e;if(null==f?void 0:f(e))throw e;return C=!0}function D(e,t){const n=g(e);let r=!1,i=!1,o=()=>{k--,r=!0};return(async()=>{for(k++;;)try{const[s,a,l]=await T();if(r)return a();const c=x.onMessage(n,e=>{switch(e.type){case Tte.Next:return void t.next(e.payload);case Tte.Error:return i=!0,r=!0,t.error(e.payload),void o();case Tte.Complete:return r=!0,void o()}});return s.send(Dte({id:n,type:Tte.Subscribe,payload:e},m)),o=()=>{r||s.readyState!==b.OPEN||s.send(Dte({id:n,type:Tte.Complete},m)),k--,r=!0,a()},void(await l.finally(c))}catch(s){if(!R(s))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||o()}}return r||(async()=>{for(k++;;)try{const[,,e]=await T();await e}catch(e){try{if(!R(e))return}catch(e){return null==i?void 0:i(e)}}})(),{on:x.on,subscribe:D,iterate(e){const t=[],n={done:!1,error:null,resolve:()=>{}},r=D(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=function(){return Fte(this,arguments,function*(){for(;;){for(t.length||(yield Ite(new Promise(e=>n.resolve=e)));t.length;)yield yield Ite(t.shift());if(n.error)throw n.error;if(n.done)return yield Ite(void 0)}})}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(N=!0,w){const[e]=await w;e.close(1e3,"Normal Closure")}},terminate(){w&&x.emit("closed",new Pte)}}}class Pte extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Mte(e){return Cte(e)&&"code"in e&&"reason"in e}function Lte(e,t){return j(e[t],Je.string)}function zte(e,t){return U(Lte(e,t),"")}function jte(e,t){return z(j(e[t],Je.float),e=>0|e)}function Ute(e,t){return me(U(j(e[t],Je.array),[]),Je.string)}function Bte(e){let t=Je.object(e);return void 0!==t?{label:zte(t,"label"),icon:Lte(t,"icon"),group:Lte(t,"group"),sortOrder:U(jte(t,"sortOrder"),0)}:{label:"",icon:void 0,group:void 0,sortOrder:0}}function $te(e){return z(Je.object(e),e=>({fragmentId:zte(e,"fragmentId"),title:zte(e,"title"),description:zte(e,"description"),positions:Ute(e,"positions"),requiredAccess:Lte(e,"requiredAccess")}))}function qte(e){return z(Je.object(e),e=>({fragmentId:zte(e,"fragmentId"),title:zte(e,"title"),menuEntry:U(z(e.menuEntry,Bte),{label:zte(e,"title"),icon:void 0,group:void 0,sortOrder:0}),requiredAccess:Lte(e,"requiredAccess")}))}function Gte(e){return z(Je.object(e),e=>({pluginId:zte(e,"pluginId"),remoteEntryUrl:zte(e,"remoteEntryUrl"),panels:me(U(j(e.panels,Je.array),[]),$te),pages:me(U(j(e.pages,Je.array),[]),qte),registeredAt:zte(e,"registeredAt"),updatedAt:zte(e,"updatedAt")}))}let Vte=["message","body","text","title","content"],Kte=["userId","recipientId","recipient","user","targetUserId"],Wte=["createdAt","sentAt","notifiedAt","at","timestamp"],Hte=["read","isRead","seen","acknowledged"];function Jte(e,t){return t.some(t=>t.toLowerCase()===e.toLowerCase())}function Xte(e){return me(Sa(e),e=>{if(ka(e[1]))return e[0]})}function Qte(e,t){return Xte(e).find(e=>Jte(e,t))}function Yte(e){return me(Sa(e),e=>{if(vt(wa(e[1],"type"),"boolean"))return e[0]}).find(e=>Jte(e,Hte))}function Zte(e,t){return me(Xte(e),e=>{let n=e.toLowerCase();return e!==t&&"id"!==n&&n.endsWith("id")?{field:e,stem:e.slice(0,e.length-2|0)}:void 0})}let ene=["markread","marknotificationread","readnotification","acknowledge","dismiss","markseen"];function tne(e,t){let n=me(e.linkedWriteSide,e=>t.aggregates.find(t=>t.name===e)).map(e=>e.commands).flat();return e.commands.concat(n).find(e=>ene.some(t=>e.name.toLowerCase().startsWith(t)))}let nne={contents:[]};function rne(e,t,n){if(!nne.contents.includes(e))return nne.contents.push(e),void console.error('[AutoUI] Read model "'+e+'" announces itself as notifications but has no '+t+" field — no notification bell is wired. The convention expects a string field named "+n.join(" | ")+"; see docs/guides/notifications-read-model-convention.md.")}function ine(e){return me(e.readModels.filter(e=>!!L(j(ht(e.schema),e=>Xe(e,"x-reventless-notifications")),!1,e=>{let t=ut(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||e.name.toLowerCase().endsWith("notifications")),t=>{let n=Qte(t.schema,Vte),r=function(e){let t=Qte(e,Kte);if(void 0!==t)return t;let n=Ba(e,void 0,void 0);return Sa(e).map(e=>e[0]).find(e=>L(Xe(n.semantics,e),!1,e=>"UserRef"===e.semantic))}(t.schema);return void 0!==n?void 0!==r?{readModel:t,messageField:n,recipientField:r,timestampField:(i=t.schema,me(Sa(i),e=>{if(Ca(e[1]))return e[0]}).find(e=>Jte(e,Wte))),readField:Yte(t.schema),refFields:Zte(t.schema,r),markReadCommand:tne(t,e)}:void rne(t.name,"recipient",Kte):void rne(t.name,"message",Vte);var i})[0]}function one(e,t){return j(Xe(e,t),dt)}function sne(e,t){return j(j(t.timestampField,t=>one(e,t)),gc)}function ane(e,t,n){let r=t.readField;if(void 0!==r){let t=z(Xe(e,r),ut);return"JSONTrue"===t&&"object"!=typeof t}let i=sne(e,t);return void 0===i||void 0!==n&&i<=n}function lne(e,t,n,r){return me(t,t=>{let r=U(ht(t),{});if(function(e,t,n){let r=one(e,t.recipientField);return void 0===r||void 0===n||r===n.userId||r===n.username}(r,e,n))return r}).toSorted((t,n)=>{let r=sne(t,e),i=sne(n,e);return void 0!==r?void 0!==i?i-r:-1:void 0!==i?1:0}).map((t,n)=>({id:U(one(t,"id"),"#"+n.toString()),message:U(one(t,e.messageField),""),timestamp:j(e.timestampField,e=>one(t,e)),read:ane(t,e,r),refs:me(e.refFields,e=>z(one(t,e.field),t=>[e.stem,t]))}))}let cne=l([]),une=l(e=>{}),dne=cne.Provider,fne=une.Provider;let hne=function(e){let t=e.initial,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=f(e=>i(t=>e),[]);return c(fne,{value:o,children:c(dne,{value:r[0],children:e.children})})};function pne(e,t){return e+"/"+t}function gne(e,t,n){return e.map(e=>{let r=function(e,t,n){return e.get(pne(t,n))}(n,t,e.fragmentId);return void 0!==r?{fragmentId:e.fragmentId,title:e.title,description:e.description,extensionPackage:e.extensionPackage,positions:e.positions,component:n=>i(Ete,{pluginId:t,fragmentId:e.fragmentId,remoteEntryUrl:r,panelProps:n}),requiredAccess:e.requiredAccess,minWidth:e.minWidth}:e})}function mne(e,t){let n=t+".",r=e.startsWith(n)?e.slice(n.length):e;return U(z([".list",".detail"].find(e=>r.endsWith(e)),e=>r.slice(0,r.length-e.length|0)),r)}let vne={contents:[]};function yne(e,t,n){let r=Object.fromEntries([["content-type","application/json"]]);return void 0!==n&&(r.Authorization="Bearer "+n),ce(fetch(e,{method:"POST",headers:r,body:U(JSON.stringify({query:t}),"")}).then(e=>e.json()),e=>Promise.resolve(null))}function _ne(e,t,n,r,i,o,s){let a,l=function(e){let t=new Map;return e.forEach(e=>{let n=e.remoteEntryUrl;if(n.length>0)return e.pages.forEach(r=>{t.set(pne(e.pluginId,r.fragmentId),n)}),void e.panels.forEach(r=>{t.set(pne(e.pluginId,r.fragmentId),n)})}),t}(t),c=function(e,t,n){return"Lock"===e?[n,KF(t,n),WF(t,n)]:[VF(t,n),{},{}]}(i,r,e),u=c[2],d=c[1],f=AO(o,s,c[0]);a="object"!=typeof o&&"Unknown"!==o;let h=ete.buildRegistry(f),p=me(f,e=>z(ine(e),t=>({pluginId:e.id,binding:t}))),g=[],m=[],v=[],y={contents:{}};return f.forEach(r=>{let i=function(e,t){let n=t.find(t=>t.pluginId===e&&t.remoteEntryUrl.length>0);return void 0!==n?[n.pages.map(t=>mne(t.fragmentId,e)),n.panels.map(t=>mne(t.fragmentId,e))]:[[],[]]}(r.id,t),o=hte(r,0,0,0,f,e,i[0],i[1],0,d,u,a,n[r.id],void 0),s=gne(o.panels,r.id,l);o.pages.forEach(e=>{g.push(e)}),s.forEach(e=>{m.push(e)}),o.routes.forEach(e=>{v.push(e)}),y.contents=qe(y.contents,o.publicLinks)}),t.forEach(e=>{}),{pages:g,panels:m,routes:v,publicLinks:y.contents,entities:h,notificationBindings:p}}let bne="Admin";function xne(e,t){let n=void 0!==e?"You are acting as "+e+", and this deployment has no surfaces configured for that role. Its pages are discovered from an admin-only query, which only the "+bne+" group can reach.":"This deployment has no surfaces configured for your roles. Its pages are discovered from an admin-only query, which only the Admin group can reach.";return void 0!==t?n+" The shell this platform serves does have surfaces for it: "+t:n}function Sne(e,t,n,r){if(void 0!==e.manifestUrl&&("object"!=typeof t||!n.includes(bne)))return function(e,t){return B(j(t,t=>e.journeyManifestUrls[t]),e.manifestUrl)}(e,r)}function wne(e,t){return"/"===t||e.some(e=>t===e||t.startsWith(e+"/"))}function Ene(e){if(null==sessionStorage.getItem(hq)||(sessionStorage.removeItem(hq),0))return;let t=vne.contents;if(wne(t,"/"+Se(Y(void 0).path).join("/")))return;let n=P(j(z(e.home,e=>e.trim()),e=>""===e?void 0:e),e=>wne(t,e));J(U(B(n,t[0]),"/"))}function kne(e){return"ManifestUnreadable"===e.TAG?"Component manifest could not be loaded":"Nothing here for the role you are acting as"}function Cne(e,t,n,r,i,o,s,a,l,c,u,d,f,h){let p=(t,n)=>function(e,t,n,r,i,o,s,a,l,c,u,d){let f=_ne(o,s,a,l,c,u,d);r(f.entities),i(f.notificationBindings),M(e,e=>e.setPluginPages(f.pages)),vne.contents=me(f.pages,e=>e.url),M(t,e=>e.setPluginPanels(f.panels)),M(n,e=>e.setPluginRoutes(f.routes,f.publicLinks))}(r,i,o,s,a,t,n,l,c,e.deniedSurfaces,u,d),g=Sne(e,u,f,h);if(void 0!==g)return KO(g).then(e=>{if("Ok"!==e.TAG)return{TAG:"ManifestUnreadable",_0:e._0};p(e._0,[])});let m=yne(e.platformApiEndpoint,"{\n Platform_ComponentDefinitions {\n pluginId\n readModels { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n aggregates { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed requiredAccess ownerField } linkedViews }\n stateViewSlices { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n internalQueryables { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n stateChangeSlices { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed requiredAccess ownerField } linkedViews consistencyRead }\n }\n}",t),v=yne(e.platformApiEndpoint,"{\n Platform_UIFragments {\n pluginId\n remoteEntryUrl\n panels { fragmentId title description positions requiredAccess }\n pages {\n fragmentId\n title\n menuEntry { label icon group sortOrder }\n requiredAccess\n }\n registeredAt\n updatedAt\n }\n}",t);return Promise.all([m,v]).then(t=>{let r=t[1],i=t[0],o=gte(i)||gte(r),s=o||pte(i)||pte(r);var a;if(p((a=i,U(z(j(j(j(Je.object(a),e=>e.data),Je.object),e=>e.Platform_ComponentDefinitions),BO),[])),function(e){return me(U(j(j(j(j(Je.object(e),e=>e.data),Je.object),e=>e.Platform_UIFragments),Je.array),[]),Gte)}(r)),s)return function(e,t){return!e&&t.includes(bne)}(o,f)?void n():{TAG:"NoSurfacesForCaller",_0:xne(h,e.hostShellUrl)}})}function Ane(e){return r("div",{children:[i("strong",{children:e.title}),i("p",{children:e.message,style:{margin:"0.5rem 0 0",whiteSpace:"pre-wrap"}})],role:"alert",style:{background:"var("+_t.surfaceSubtle+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.error+")",margin:"1rem",padding:"1rem 1.25rem",borderRadius:"0.375rem"}})}let Nne=function(e){let t=e.uiHints,n=e.config,r=void 0!==t?t:{},o=d(cG),l=d(dV),c=NV(),u=d(qa),f=d(une),h=Iq(),p=j(h,e=>e.getToken()),g=L(j(h,e=>e.identity),[],e=>e.groups),m=j(j(h,e=>e.identity),e=>e.activeRole),v=g.concat(n.accessTiers),y=kO(n.elevatedGroups,g),_=L(j(h,e=>e.identity),"",e=>e.userId),b=s(()=>{}),x=b[1],S=b[0];return a(()=>{Cne(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,_,g,m).then(e=>{M(e,e=>{console.error("[Shell] "+e._0)}),x(t=>e),Ene(n)})},[p,r]),a(()=>{if(function(e,t,n,r){return q(Sne(e,t,n,r))}(n,y,g,m))try{let e=function(e,t){return Ote({url:e,connectionParams:void 0!==t?{Authorization:"Bearer "+t}:void 0,lazy:!0,retryAttempts:5})}(n.platformApiSubscriptionEndpoint,p),t=()=>{Cne(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,_,g,m)},i=e.subscribe({query:"subscription OnPluginStatusChange {\n onPluginStatusChange { pluginId status }\n}",variables:void 0},{next:e=>t(),error:e=>{},complete:()=>{}}),s=e.subscribe({query:"subscription OnUIFragmentChange {\n onUIFragmentChange { pluginId changeKind }\n}",variables:void 0},{next:e=>t(),error:e=>{},complete:()=>{}});return()=>{i(),s(),e.dispose()}}catch(e){return}},[p]),void 0!==S?i(Ane,{message:S._0,title:kne(S)}):null};async function Tne(e,t,n,r,i,o){let s=[],a=function(e,t,n){return me(t,t=>vt(t,n)?void 0:z(e[t],e=>[t,e]))}(e.journeyManifestUrls,t,n),l=await Promise.all(a.map(e=>{let t=e[0];return KO(e[1]).then(e=>[t,e])}));return l.forEach(t=>{let n=t[1],a=t[0];if("Ok"!==n.TAG)return;let l=me(_ne(n._0,[],i,[a].concat(e.accessTiers),e.deniedSurfaces,kO(e.elevatedGroups,[a]),o).pages,e=>e.url);wne(l,r)&&s.push(a)}),s}let Rne={display:"flex",padding:"2rem",alignItems:"flex-start",flexDirection:"column",gap:"var("+bt.sm+")"},Dne={fontSize:"var("+xt.sizeLg+")",fontWeight:"var("+xt.weightMedium+")",margin:"0"},Ine={color:"var("+_t.textSecondary+")",margin:"0"},Fne={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",cursor:"pointer",padding:"0.4rem 0.9rem",borderRadius:"0.375rem"},One={color:"var("+_t.error+")",margin:"0"};let Pne=function(e){let t,n=e.uiHints,l=e.config,c=Iq(),u=le(),d=j(c,e=>e.identity),f=L(c,!1,e=>e.canSwitchRoles),h=L(d,[],e=>Zq(f,e)),p=j(d,e=>e.activeRole),g=L(d,"",e=>e.userId),m=s(()=>[]),v=m[1],y=m[0],_=s(()=>!1),b=_[1],x=_[0],S=s(()=>{}),w=S[1],E=S[0];if(a(()=>{let e={contents:!0};return Tne(l,h,p,u,n,g).then(t=>{if(e.contents)return v(e=>t)}),()=>{e.contents=!1}},[u,h.join(",")]),0!==y.length){let e;if(1!==y.length)e="This page is part of another role you hold: "+y.join(", ")+".";else{e="This page is part of your "+y[0]+" role."}t=r(o,{children:[i("p",{children:e,style:Ine}),y.map(e=>i("button",{children:"Act as "+e,style:Fne,disabled:x,onClick:t=>M(c,t=>{b(e=>!0),w(e=>{}),t.switchRole(e).then(e=>{if(b(e=>!1),"object"!=typeof e)return;let t=e._0;w(e=>t)})})},e)),void 0!==E?i("p",{children:E,style:One}):null]})}else t=null;return r("div",{children:[i("h1",{children:"404 — Page not found",style:Dne}),t],style:Rne})};function Mne(e){return"var("+e+")"}let Lne=co([Ui("relative"),gi("inlineBlock")]),zne=co([Ui("relative"),gi("inlineFlex"),di("center"),xi("center"),ui("background","none"),ui("border","none"),ui("border-radius",Mne(St.md)),ui("cursor","pointer"),ui("color",Mne(_t.textSecondary)),ui("padding","6px"),Yi([ui("background",Mne(_t.surfaceSubtle)),ui("color",Mne(_t.textPrimary))])]),jne=co([Ui("absolute"),qi(to(0)),Bi(to(0)),gi("inlineFlex"),di("center"),xi("center"),ui("min-width","16px"),ui("height","16px"),ui("padding","0 4px"),ui("border-radius",Mne(St.full)),ui("background",Mne(_t.brand)),ui("color",Mne(_t.textOnBrand)),ui("font-family",Mne(xt.fontFamily)),ui("font-size","10px"),ui("font-weight",Mne(xt.weightBold)),ui("line-height","1")]),Une=co([Ui("absolute"),Bi(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),ui("width","320px"),ui("background",Mne(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Mne(St.md)),ui("box-shadow",Mne(Et)),ui("z-index","200"),ui("overflow","hidden"),ui("font-family",Mne(xt.fontFamily))]),Bne=co([gi("flex"),di("center"),xi("spaceBetween"),ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("color",Mne(_t.textSecondary)),ui("font-size",Mne(xt.sizeSm)),ui("font-weight",Mne(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),$ne=co([ui("background","none"),ui("border","none"),ui("color",Mne(_t.brand)),ui("font-size",Mne(xt.sizeXs)),ui("text-transform","none"),ui("letter-spacing","0"),pi("pointer"),Yi([ui("text-decoration","underline")])]),qne=co([ui("max-height","360px"),ui("overflow-y","auto")]);function Gne(e){return co([gi("flex"),di("flexStart"),ui("gap",Mne(bt.sm)),ui("width","100%"),ui("background","none"),ui("border","none"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("text-align","left"),ui("padding","var("+bt.sm+") var("+bt.md+")"),pi(e?"pointer":"default"),Yi(e?[ui("background",Mne(_t.surfaceSubtle))]:[])])}function Vne(e){return co([ui("width","8px"),ui("height","8px"),ui("border-radius",Mne(St.full)),ui("margin-top","5px"),ui("flex-shrink","0"),ui("background",e?"transparent":Mne(_t.brand))])}let Kne=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0")]);function Wne(e){return co([ui("color",Mne(_t.textPrimary)),ui("font-size",Mne(xt.sizeSm)),ui("font-weight",Mne(e?xt.weightNormal:xt.weightMedium)),ui("line-height",Mne(xt.lineHeightNormal)),ui("word-break","break-word")])}let Hne=co([ui("color",Mne(_t.textDisabled)),ui("font-size",Mne(xt.sizeXs))]),Jne=co([ui("color",Mne(_t.textDisabled)),ui("font-size",Mne(xt.sizeSm)),ui("padding",Mne(bt.md)),ui("text-align","center")]);function Xne(e){return r("svg",{children:[i("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),i("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})],"aria-hidden":!0,height:"18",width:"18",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24"})}let Qne=function(e){let t=e.defaultOpen,n=e.nowMs,o=e.emptyLabel,l=e.onPanelOpen,c=e.onMarkAllRead,u=e.onOpen,d=e.notifications,f=void 0!==o?o:"No notifications",h=void 0!==t&&t,p=void 0!==n?n:Date.now(),g=s(()=>h),m=g[1],v=g[0],y=d.filter(e=>!e.read).length;return a(()=>{if(!v)return;let e=e=>m(e=>!1),t=e=>{if("Escape"===e.key)return m(e=>!1)};return document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[v]),r("div",{children:[r("button",{children:[i(Xne,{}),y>0?i("span",{children:y>99?"99+":y.toString(),className:jne}):null],"aria-label":y>0?"Notifications ("+y.toString()+" unread)":"Notifications",className:zne,title:"Notifications",type:"button",onClick:e=>{e.stopPropagation(),(()=>{let e=!v;e&&M(l,e=>e()),m(t=>e)})()}}),v?r("div",{children:[r("div",{children:["Notifications",void 0!==c&&y>0?i("button",{children:"Mark all read",className:$ne,type:"button",onClick:e=>c()}):null],className:Bne}),0===d.length?i("div",{children:f,className:Jne}):i("div",{children:d.map(e=>{let t=e.timestamp;return r("button",{children:[i("span",{className:Vne(e.read)}),r("span",{children:[i("span",{children:e.message,className:Wne(e.read)}),void 0!==t?i("span",{children:jY(p,t),className:Hne}):null],className:Kne})],className:Gne($(u)),type:"button",onClick:t=>{M(u,t=>t(e)),m(e=>!1)}},e.id)}),className:qne})],className:Une,onClick:e=>{e.stopPropagation()}}):null],className:Lne})};function Yne(e){return"autoui.notifications.seen."+e}function Zne(e){let t=e.onData,n=W3(e.binding.readModel,void 0);return a(()=>{t({rows:n.rows,refetch:n.refetch})},[n.rows]),null}let ere=function(e){let t=d(cne),n=Iq(),a=NI(),l=_1(),c=Wa(),u=ae(),f=s(()=>({})),h=f[1],p=f[0],g=s(()=>0)[1],m=z(j(n,e=>e.identity),e=>({userId:e.userId,username:e.username})),v=t.flatMap(e=>{let t=L(Xe(p,e.pluginId),[],e=>e.rows);return lne(e.binding,t,m,function(e){let t=localStorage.getItem(Yne(e));if(null!=t)return ra(t)}(e.pluginId)).map(t=>({key:e.pluginId+":"+t.id,appBinding:e,entry:t}))}).toSorted((e,t)=>{let n=j(e.entry.timestamp,gc),r=j(t.entry.timestamp,gc);return void 0!==n?void 0!==r?r-n:-1:void 0!==r?1:0}),y=(e,t)=>{let n=e.binding.markReadCommand;void 0===n||void 0===l||ce(l(n.mutationDocument,function(e,t){let n=U(j(e.markReadCommand,e=>e.aggregateIdField),"id");return Ze([[n,t]])}(e.binding,t)).then(t=>{if("object"!=typeof t){let t=e.pluginId;return M(Xe(p,t),e=>e.refetch())}"Rejected"!==t.TAG&&console.error("[AutoUI] notification markRead not executed — "+t._0)}),e=>Promise.resolve())},_=e=>M(v.find(t=>t.key===e.id),e=>{e.entry.read||y(e.appBinding,e.entry.id),M(ye(e.entry.refs,e=>{let t=e[1];return z(Ha(c,e[0]),e=>[e,t])}),e=>{let t=e[0];u(Ya(t.pluginId,t.name,e[1],[]))})}),b=$(a)&&t.some(e=>$(e.binding.markReadCommand)),x=()=>{v.forEach(e=>e.entry.read?void 0:y(e.appBinding,e.entry.id))},S=()=>{t.forEach(e=>{let t=L(Xe(p,e.pluginId),[],e=>e.rows);M(function(e,t){return ge(t,void 0,(t,n)=>{let r=sne(U(ht(n),{}),e);return void 0!==t?void 0!==r?Math.max(t,r):t:r})}(e.binding,t),t=>function(e,t){localStorage.setItem(Yne(e),t.toString())}(e.pluginId,t))}),g(e=>e+1|0)},w=v.map(e=>({id:e.key,message:e.entry.message,timestamp:e.entry.timestamp,read:e.entry.read}));return 0===t.length?null:r(o,{children:[t.map(e=>{return i(Zne,{binding:e.binding,onData:(t=e.pluginId,e=>h(n=>{let r=Ze(Qe(n));return r[t]=e,r}))},e.pluginId);var t}),i(Qne,{notifications:w,onOpen:_,onMarkAllRead:b?x:void 0,onPanelOpen:S})]})};let tre=function(e){let t,n=e.onChange,r=xO();switch(e.config.authMode){case"Local":t=!0;break;case"Anonymous":case"Cognito":t=!1}let i=h(n);return i.current=n,a(()=>{let e=t?r:void 0;if(void 0===e)return;let n=e.subscribe("Domain","/default/dev/uiHints",e=>i.current()),o=e.registerReconnect("Domain",()=>i.current());return()=>{n(),o()}},[!!t&&$(r)]),null};function nre(e){let t=["B","KB","MB","GB"],n=((e,n)=>{for(;;){if(!(e>=1024&&n<(t.length-1|0)))return[e,n];n=n+1|0,e=e/1024}})(e<0?0:e,0),r=n[1],i=n[0];return(0===r?Math.round(i).toString():(Math.round(10*i)/10).toString())+" "+t[r]}function rre(e){return"var("+e+")"}let ire=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap","6px"),ui("padding",rre(bt.lg)),ui("border","2px dashed var("+_t.border+")"),ui("border-radius",rre(St.md)),ui("color",rre(_t.textSecondary)),ui("font-family",rre(xt.fontFamily)),ui("font-size",rre(xt.sizeSm)),pi("pointer"),ui("transition","border-color 120ms, background 120ms"),$i("center")]),ore=co([ui("border-color",rre(_t.brand)),ui("background",rre(_t.brandSubtle))]),sre=co([ui("font-size",rre(xt.sizeXs))]),are=co([gi("flex"),di("center"),ui("gap","8px"),ui("padding",rre(bt.xs)+" 0"),ui("font-family",rre(xt.fontFamily)),ui("font-size",rre(xt.sizeSm)),ui("color",rre(_t.textPrimary))]),lre=co([ui("flex","1"),ui("min-width","0"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),cre=co([ui("color",rre(_t.textSecondary)),ui("font-size",rre(xt.sizeXs)),ui("white-space","nowrap")]),ure=co([ui("color",rre(_t.success))]),dre=co([ui("color",rre(_t.error))]),fre=co([ui("width","120px")]),hre=co([ui("flex","0 0 auto"),ui("border","none"),ui("background","transparent"),ui("padding","0 4px"),ui("color",rre(_t.textSecondary)),ui("font-size",rre(xt.sizeMd)),wi({NAME:"abs",VAL:1}),pi("pointer")]),pre=co([ui("width","40px"),ui("height","40px"),ui("flex","0 0 auto"),ui("object-fit","cover"),ui("border-radius",rre(St.sm)),ui("border","1px solid var("+_t.border+")")]);let gre=function(e){let t=e.onRemoved,n=e.onUploaded,o=e.label,l=e.multiple,c=e.accept,u=e.adapter,d=void 0===l||l,f=void 0!==o?o:"Drop files here or click to browse",p=s(()=>[]),g=p[1],m=p[0],v=s(()=>!1),y=v[1],_=h(null),b=h(0),x=h([]),S=h([]);a(()=>()=>{x.current.forEach(e=>{URL.revokeObjectURL(e)})},[]);let w=(e,t)=>g(n=>n.map(n=>n.key===e?{key:n.key,name:n.name,size:n.size,status:t,preview:n.preview}:n)),E=e=>M(u.remove,t=>{ce(t(e).then(t=>{"Ok"!==t.TAG&&console.error("[FileDropzone] could not remove "+e+": "+t._0)}),t=>(console.error("[FileDropzone] could not remove "+e),Promise.resolve()))}),k=e=>{S.current=S.current.concat([e.key]),(e=>{M(e.preview,e=>{URL.revokeObjectURL(e),x.current=x.current.filter(t=>t!==e)})})(e);let n=e.status;if("Done"!==n.TAG)return;let r=n._0;M(t,e=>e(r)),E(r)},C=e=>{let t=function(e,t){if(e)return[t,!1];let n=t.slice(0,1);return[n,0!==n.length]}(d,e),r=t[1];r&&m.forEach(k),t[0].forEach((e,t)=>{let i=r&&0===t;b.current=b.current+1|0;let o,s=b.current.toString()+":"+e.name,a=function(e,t,n){if(void 0===e)return!0;let r=t.toLowerCase(),i=n.toLowerCase();return e.split(",").map(e=>e.trim().toLowerCase()).filter(e=>""!==e).some(e=>e.startsWith(".")?r.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,e.length-1|0)):i===e)}(c,e.name,e.type),l=a?{TAG:"Uploading",_0:0}:{TAG:"Rejected",_0:"File type not accepted"};if(e.type.toLowerCase().startsWith("image/")){let t=URL.createObjectURL(e);x.current=x.current.concat([t]),o=t}else o=void 0;let d=e.name,f=e.size,h={key:s,name:d,size:f,status:l,preview:o};g(e=>i?[h]:e.concat([h])),a&&ce(u.upload(e,e=>w(s,{TAG:"Uploading",_0:e})).then(t=>{if("Ok"===t.TAG){let r=t._0;S.current.includes(s)?E(r):(w(s,{TAG:"Done",_0:r}),M(n,t=>t(e.name,r)))}else w(s,{TAG:"Failed",_0:t._0});return Promise.resolve()}),e=>(w(s,{TAG:"Failed",_0:"Upload failed"}),Promise.resolve()))})},A=v[0]?ire+" "+ore:ire;return r("div",{children:[r("div",{children:[i("span",{children:f}),void 0!==c?i("span",{children:"Accepted: "+c,className:sre}):null],className:A,role:"button",onClick:e=>M(R(_.current),e=>e.click()),onDragLeave:e=>y(e=>!1),onDragOver:e=>{e.preventDefault(),y(e=>!0)},onDrop:e=>{e.preventDefault(),y(e=>!1);let t=e.dataTransfer;if(null!=t)return C(Array.from(t.files))}}),i("input",{ref:T(_),style:{display:"none"},accept:c,multiple:d,type:"file",onChange:e=>{let t=e.target.files;null!=t&&C(Array.from(t)),e.target.value=""}}),m.map(e=>{let t,n=e.preview,o=e.status;switch(o.TAG){case"Uploading":t=i("span",{children:i(Uc,{value:o._0,showValue:!1}),className:fre});break;case"Done":t=i("span",{children:"Uploaded",className:ure});break;case"Rejected":t=i("span",{children:"Rejected",className:dre,title:o._0});break;case"Failed":t=i("span",{children:"Failed",className:dre,title:o._0})}return r("div",{children:[void 0!==n?i("img",{className:pre,alt:e.name,src:n}):null,i("span",{children:e.name,className:lre,title:e.name}),i("span",{children:nre(e.size),className:cre}),t,i("button",{children:"×","aria-label":"Remove "+e.name,className:hre,title:"Remove "+e.name,type:"button",onClick:t=>{t.stopPropagation();let n=e.key;M(m.find(e=>e.key===n),k),g(e=>e.filter(e=>e.key!==n))}})],className:are},e.key)})]})};function mre(e){if(""===e)return[];let t;try{t=pt(JSON.parse(e))}catch(n){return[e]}return void 0!==t?me(t,dt):[e]}function vre(e,t){let n=Ua(e,t);if(void 0!==n&&"Image"===n.semantic)return"image/*"}function yre(e){return vt(j(j(ht(Lt(e)),e=>Xe(e,"type")),dt),"array")}function _re(e){let t=e=>j(Is(e).storeTarget,ws);return B(t(e),j(zt(e),t))}function bre(e,t,n){return U(function(e,t,n){return B(j(_re(e),n),t)}(e,t,n),(r=_re(e),{upload:(e,t)=>Promise.resolve({TAG:"Error",_0:void 0!==r?'No upload endpoint is configured for the store "'+r+'".':"No upload endpoint is configured."})}));var r}function xre(e){let t=e.onChange,n=e.value,r=e.multiple,o=e.adapter,s=h(r?mre(n):""===n?[]:[n]),l=h([]),c=d(t5),u=e=>r?JSON.stringify(e.map(e=>e)):U(e[0],""),f=e=>M(o.remove,t=>{ce(t(e).then(t=>{"Ok"!==t.TAG&&console.error("[FileDropzoneInput] could not release "+e+": "+t._0)}),t=>(console.error("[FileDropzoneInput] could not release "+e),Promise.resolve()))});return a(()=>()=>{(function(e,t){return L(e,[],e=>e.armed.current?t:[])})(c,l.current).forEach(f)},[]),i(gre,{adapter:o,accept:e.accept,multiple:r,onUploaded:(e,n)=>{let i=r?s.current.concat([n]):[n];s.current=i,l.current=function(e,t){return e.concat([t])}(l.current,n),t(u(i))},onRemoved:e=>{let n=s.current.filter(t=>t!==e);s.current=n,l.current=function(e,t){return e.filter(e=>e!==t)}(l.current,e),t(u(n))}})}function Sre(e,t,n,r){if(r&&0===mre(n).length)return"Required"}function wre(e,t,n){let r=void 0!==e?e:e=>{},o=(e,o,s,a,l,c,u)=>i(xre,{adapter:bre(o,void 0,r),accept:B(t,vre(e,o)),multiple:U(n,yre(o)),value:s,onChange:a}),s=e=>{let t=U(function(e){return Xe(gD,ia(e))}(e),{cell:(e,t,n)=>{},detail:(e,t,n)=>{}}),n={...t};mD(e,(n.validateInput=Sre,n.input=o,n))};s("File"),s("Image")}var Ere={FRAGMENT:"Fragment",INLINE_DATA_FRAGMENT:"InlineDataFragment",LINKED_FIELD:"LinkedField",LITERAL:"Literal",LIST_VALUE:"ListValue",RELAY_LIVE_RESOLVER:"RelayLiveResolver",OBJECT_VALUE:"ObjectValue",REQUEST:"Request",SCALAR_FIELD:"ScalarField",SPLIT_OPERATION:"SplitOperation",UPDATABLE_QUERY:"UpdatableQuery",VARIABLE:"Variable"},kre=function(e,t,n,r,i,o,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}};function Cre(e){return function(){return e}}var Are=function(){};Are.thatReturns=Cre,Are.thatReturnsFalse=Cre(!1),Are.thatReturnsTrue=Cre(!0),Are.thatReturnsNull=Cre(null),Are.thatReturnsThis=function(){return this},Are.thatReturnsArgument=function(e){return e};var Nre=Ere,Tre=kre;function Rre(e){var t=e;return"function"==typeof t?t=t():t.default&&(t=t.default),t}function Dre(e){var t=Rre(e);return"object"==typeof t&&null!==t&&t.kind===Nre.FRAGMENT}function Ire(e){var t=Rre(e);return"object"==typeof t&&null!==t&&t.kind===Nre.REQUEST}function Fre(e){var t=Rre(e);return"object"==typeof t&&null!==t&&t.kind===Nre.INLINE_DATA_FRAGMENT}function Ore(e){var t=Rre(e);return Dre(t)||Tre(!1),t}var Pre,Mre={getFragment:Ore,getNode:Rre,getPaginationFragment:function(e){var t,n=Ore(e),r=null===(t=n.metadata)||void 0===t?void 0:t.refetch,i=null==r?void 0:r.connection;return null===r||"object"!=typeof r||null===i||"object"!=typeof i?null:n},getRefetchableFragment:function(e){var t,n=Ore(e),r=null===(t=n.metadata)||void 0===t?void 0:t.refetch;return null===r||"object"!=typeof r?null:n},getRequest:function(e){var t=Rre(e);return Ire(t)||Tre(!1),t},getUpdatableQuery:function(e){var t=Rre(e);return!function(e){var t=Rre(e);return"object"==typeof t&&null!==t&&t.kind===Nre.UPDATABLE_QUERY}(t)&&Tre(!1),t},getInlineDataFragment:function(e){var t=Rre(e);return Fre(t)||Tre(!1),t},graphql:function(e){Tre(!1)},isFragment:Dre,isRequest:Ire,isInlineDataFragment:Fre},Lre={exports:{}};(Pre=Lre).exports=function(e){return e&&e.__esModule?e:{default:e}},Pre.exports.__esModule=!0,Pre.exports.default=Pre.exports;var zre=Lre.exports,jre={exports:{}},Ure={exports:{}},Bre={exports:{}},$re={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}($re);var qre=$re.exports,Gre={exports:{}};!function(e){var t=qre.default;e.exports=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Gre);var Vre=Gre.exports;!function(e){var t=qre.default,n=Vre;e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(Bre);var Kre=Bre.exports;!function(e){var t=Kre;e.exports=function(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports}(Ure);var Wre=Ure.exports;!function(e){var t=Wre;function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}e.exports=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){t(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e},e.exports.__esModule=!0,e.exports.default=e.exports}(jre);var Hre=jre.exports,Jre={exports:{}},Xre={exports:{}},Qre={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(Qre);var Yre=Qre.exports;!function(e){var t=Yre;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Xre);var Zre=Xre.exports;!function(e){var t=Zre;e.exports=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=t(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}},e.exports.__esModule=!0,e.exports.default=e.exports}(Jre);var eie=Jre.exports,tie=zre.default,nie=tie(Hre),rie=tie(eie),iie=kre;function oie(e){switch(e.kind){case"relay_resolver.error":case"relay_field_payload.error":return e.shouldThrow&&!e.handled;case"missing_expected_data.throw":case"missing_required_field.throw":return!e.handled;case"missing_required_field.log":case"missing_expected_data.log":return!1;default:throw e.kind,new Error("Relay: Unexpected event kind")}}var sie={handlePotentialSnapshotErrors:function(e,t,n){null!=t&&function(e,t,n){var r,i=(0,rie.default)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.relayFieldLogger((0,nie.default)((0,nie.default)({},o),{},{uiContext:n}))}}catch(c){i.e(c)}finally{i.f()}var s,a=(0,rie.default)(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(oie(l))switch(l.kind){case"relay_resolver.error":throw new Error("Relay: Resolver error at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'. Message: ").concat(l.error.message));case"relay_field_payload.error":throw new Error("Relay: Unexpected response payload - check server logs for details.");case"missing_expected_data.throw":throw new Error("Relay: Missing expected data at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.throw":throw new Error("Relay: Missing @required value at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.log":case"missing_expected_data.log":break;default:l.kind,iie(!1)}}}catch(c){a.e(c)}finally{a.f()}}(e,t,n)},eventShouldThrow:oie},aie={exports:{}},lie={exports:{}};!function(e){var t=Yre;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(lie);var cie=lie.exports,uie={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(uie);var die=uie.exports,fie={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(fie);var hie=fie.exports;!function(e){var t=cie,n=die,r=Zre,i=hie;e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(aie);var pie=aie.exports,gie={DEFAULT_HANDLE_KEY:""},mie=gie.DEFAULT_HANDLE_KEY,vie=kre;var yie=function(e,t,n){return t&&t!==mie?"__".concat(t,"_").concat(e):(null==n&&vie(!1),"__".concat(n,"_").concat(e))},_ie={ENABLE_VARIABLE_CONNECTION_KEY:!1,ENABLE_RELAY_RESOLVERS:!1,ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION:!1,ENABLE_FRIENDLY_QUERY_NAME_GQL_URL:!1,ENABLE_DO_NOT_WRAP_LIVE_QUERY:!1,ENABLE_NOTIFY_SUBSCRIPTION:!1,BATCH_ASYNC_MODULE_UPDATES_FN:null,ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT:!1,MAX_DATA_ID_LENGTH:null,STRING_INTERN_LEVEL:0,LOG_MISSING_RECORDS_IN_PROD:!1,ENABLE_STORE_ID_COLLISION_LOGGING:!1,ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS:!1,ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION:!1,ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES:!1,ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE:!1,PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION:!1,MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD:!1,ENABLE_CYLE_DETECTION_IN_VARIABLES:!1,ENABLE_ACTIVITY_COMPATIBILITY:!1,ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX:!0,ENABLE_USE_PAGINATION_IS_LOADING_FIX:!1,DISALLOW_NESTED_UPDATES:!1,ENABLE_TYPENAME_PREFIXED_DATA_ID:!1,ENABLE_UI_CONTEXT_ON_RELAY_LOGGER:!1,CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES:!1};var bie={stableCopy:function e(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);for(var n=Object.keys(t).sort(),r={},i=0;i<n.length;i++)r[n[i]]=e(t[n[i]]);return r},hasCycle:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;if(!t||"object"!=typeof t)return!1;if(n.has(t))return!0;var r=new Set(n);return r.add(t),(Array.isArray(t)?t:Object.values(t)).some(function(t){return e(t,r)})}},xie=(0,zre.default)(pie),Sie=yie,wie=_ie,Eie=bie.stableCopy,kie=kre,Cie=Ere.VARIABLE,Aie=Ere.LITERAL,Nie=Ere.OBJECT_VALUE,Tie=Ere.LIST_VALUE;function Rie(e,t){if(e.kind===Cie)return function(e,t){return t.hasOwnProperty(e)||kie(!1),Eie(t[e])}(e.variableName,t);if(e.kind===Aie)return e.value;if(e.kind===Nie){var n={};return e.fields.forEach(function(e){n[e.name]=Rie(e,t)}),n}if(e.kind===Tie){var r=[];return e.items.forEach(function(e){null!=e&&r.push(Rie(e,t))}),r}}function Die(e,t,n){var r={};return n&&(r[Oie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),e&&e.forEach(function(e){r[e.name]=Rie(e,t)}),r}function Iie(e,t){if(e.storageKey)return e.storageKey;var n=function(e){if("RelayResolver"===e.kind||"RelayLiveResolver"===e.kind){var t,n;return null==e.args?null===(n=e.fragment)||void 0===n?void 0:n.args:null==(null===(t=e.fragment)||void 0===t?void 0:t.args)?e.args:e.args.concat(e.fragment.args)}var r=void 0===e.args?void 0:e.args;return r}(e),r=e.name;return n&&0!==n.length?Fie(r,Die(n,t)):r}function Fie(e,t){if(!t)return e;var n=[];for(var r in t)if(t.hasOwnProperty(r)){var i,o=t[r];if(null!=o)n.push(r+":"+(null!==(i=JSON.stringify(o))&&void 0!==i?i:"undefined"))}return 0===n.length?e:e+"(".concat(n.join(","),")")}var Oie={ACTOR_IDENTIFIER_KEY:"__actorIdentifier",CLIENT_EDGE_TRAVERSAL_PATH:"__clientEdgeTraversalPath",FRAGMENTS_KEY:"__fragments",FRAGMENT_OWNER_KEY:"__fragmentOwner",FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT:"$isWithinUnmatchedTypeRefinement",FRAGMENT_PROP_NAME_KEY:"__fragmentPropName",MODULE_COMPONENT_KEY:"__module_component",ERRORS_KEY:"__errors",ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",INVALIDATED_AT_KEY:"__invalidated_at",RELAY_RESOLVER_VALUE_KEY:"__resolverValue",RELAY_RESOLVER_INVALIDATION_KEY:"__resolverValueMayBeInvalid",RELAY_RESOLVER_SNAPSHOT_KEY:"__resolverSnapshot",RELAY_RESOLVER_ERROR_KEY:"__resolverError",RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS:"__resolverOutputTypeRecordIDs",getArgumentValues:Die,getHandleStorageKey:function(e,t){var n=e.dynamicKey,r=e.handle,i=e.key,o=e.name,s=e.args,a=e.filters,l=Sie(r,i,o),c=null;return s&&a&&0!==s.length&&0!==a.length&&(c=s.filter(function(e){return a.indexOf(e.name)>-1})),n&&(c=null!=c?[n].concat((0,xie.default)(c)):[n]),null===c?l:Fie(l,Die(c,t))},getStorageKey:Iie,getReadTimeResolverStorageKey:function(e,t){var n=Iie(e,t);return wie.ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX?"$r:"+n:n},getStableStorageKey:function(e,t){return Fie(e,Eie(t))},getModuleComponentKey:function(e){return"".concat("__module_component_").concat(e)},getModuleOperationKey:function(e){return"".concat("__module_operation_").concat(e)}},Pie=Oie,Mie=(0,zre.default)(Hre),Lie=Pie.getArgumentValues,zie=kre;var jie={getLocalVariables:function(e,t,n){if(null==t)return e;var r=(0,Mie.default)({},e),i=n?Lie(n,e):{};return t.forEach(function(e){var t,n=null!==(t=i[e.name])&&void 0!==t?t:e.defaultValue;r[e.name]=n}),r},getFragmentVariables:function(e,t,n){return null==e.argumentDefinitions?n:(e.argumentDefinitions.forEach(function(e){if(!n.hasOwnProperty(e.name))switch(r=r||(0,Mie.default)({},n),e.kind){case"LocalArgument":r[e.name]=e.defaultValue;break;case"RootArgument":if(!t.hasOwnProperty(e.name)){r[e.name]=void 0;break}r[e.name]=t[e.name];break;default:zie(!1)}}),r||n);var r},getOperationVariables:function(e,t,n){var r={};return e.argumentDefinitions.forEach(function(e){var t=e.defaultValue;null!=n[e.name]&&(t=n[e.name]),r[e.name]=t}),null!=t&&Object.keys(t).forEach(function(e){r[e]=t[e].get()}),r}},Uie=[],Bie=[];function $ie(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var i=Object.prototype.toString,o=i.call(e);if(o!=i.call(t))return!1;switch(o){case"[object String]":return e==String(t);case"[object Number]":return!isNaN(e)&&!isNaN(t)&&e==Number(t);case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}for(var s=n.length;s--;)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var a=0;if("[object Array]"===o){if((a=e.length)!==t.length)return!1;for(;a--;)if(!$ie(e[a],t[a],n,r))return!1}else{if(e.constructor!==t.constructor)return!1;if(e.hasOwnProperty("valueOf")&&t.hasOwnProperty("valueOf"))return e.valueOf()==t.valueOf();var l=Object.keys(e);if(l.length!=Object.keys(t).length)return!1;for(var c=0;c<l.length;c++)if(!$ie(e[l[c]],t[l[c]],n,r))return!1}return n.pop(),r.pop(),!0}var qie=
3
- /**
4
- * Checks if two values are equal. Values may be primitives, arrays, or objects.
5
- * Returns true if both arguments have the same keys and values.
6
- *
7
- * @see http://underscorejs.org
8
- * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
9
- * @license MIT
10
- */
11
- function(e,t){var n=Uie.length?Uie.pop():[],r=Bie.length?Bie.pop():[],i=$ie(e,t,n,r);return n.length=0,r.length=0,Uie.push(n),Bie.push(r),i},Gie=jie.getFragmentVariables,Vie=Pie,Kie=Vie.CLIENT_EDGE_TRAVERSAL_PATH,Wie=Vie.FRAGMENT_OWNER_KEY,Hie=Vie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT,Jie=Vie.FRAGMENTS_KEY,Xie=Vie.ID_KEY,Qie=qie,Yie=kre;function Zie(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Yie(!1);var n=t[Xie],r=t[Jie],i=t[Wie],o=t[Kie];if("string"==typeof n&&"object"==typeof r&&null!==r&&"object"==typeof r[e.name]&&null!==r[e.name]&&"object"==typeof i&&null!==i&&(null==o||Array.isArray(o))){var s=i,a=o,l=r[e.name];return loe(e,n,Gie(e,s.variables,l),s,!0===l[Hie],a)}return null}function eoe(e,t){var n=null;return t.forEach(function(t,r){var i=null!=t?Zie(e,t):null;null!=i&&(n=n||[]).push(i)}),null==n?null:{kind:"PluralReaderSelector",selectors:n}}function toe(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Yie(!1),eoe(e,t)):(Array.isArray(t)&&Yie(!1),Zie(e,t))}function noe(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Yie(!1),function(e,t){var n=null;return t.forEach(function(t){var r=null!=t?roe(e,t):null;null!=r&&(n=n||[]).push(r)}),n}(e,t)):(Array.isArray(t)&&Yie(!1),roe(e,t))}function roe(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Yie(!1);var n=t[Xie];return"string"==typeof n?n:null}function ioe(e,t){var n;return null==t?{}:!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)?(Array.isArray(t)||Yie(!1),soe(e,t)):(Array.isArray(t)&&Yie(!1),ooe(e,t)||{})}function ooe(e,t){var n=Zie(e,t);return n?n.variables:null}function soe(e,t){var n={};return t.forEach(function(t,r){if(null!=t){var i=ooe(e,t);null!=i&&Object.assign(n,i)}}),n}function aoe(e,t){return e.dataID===t.dataID&&e.node===t.node&&Qie(e.variables,t.variables)&&(n=e.owner,r=t.owner,n===r||n.identifier===r.identifier&&Qie(n.cacheConfig,r.cacheConfig))&&e.isWithinUnmatchedTypeRefinement===t.isWithinUnmatchedTypeRefinement&&function(e,t){if(e===t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var n=e.length;for(;n--;){var r=e[n],i=t[n];if(r!==i&&(null==r||null==i||r.clientEdgeDestinationID!==i.clientEdgeDestinationID||r.readerClientEdge!==i.readerClientEdge))return!1}return!0}(e.clientEdgeTraversalPath,t.clientEdgeTraversalPath);var n,r}function loe(e,t,n,r){var i=arguments.length>5?arguments[5]:void 0;return{kind:"SingularReaderSelector",dataID:t,isWithinUnmatchedTypeRefinement:arguments.length>4&&void 0!==arguments[4]&&arguments[4],clientEdgeTraversalPath:null!=i?i:null,node:e,variables:n,owner:r}}var coe={areEqualSelectors:function(e,t){return e===t||(null==e?null==t:null==t?null==e:"SingularReaderSelector"===e.kind&&"SingularReaderSelector"===t.kind?aoe(e,t):"PluralReaderSelector"===e.kind&&"PluralReaderSelector"===t.kind&&(e.selectors.length===t.selectors.length&&e.selectors.every(function(e,n){return aoe(e,t.selectors[n])})))},createReaderSelector:loe,createNormalizationSelector:function(e,t,n){return{dataID:t,node:e,variables:n}},getDataIDsFromFragment:noe,getDataIDsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=noe(i,o)}return n},getSingularSelector:Zie,getPluralSelector:eoe,getSelector:toe,getSelectorsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=toe(i,o)}return n},getVariablesFromSingularFragment:ooe,getVariablesFromPluralFragment:soe,getVariablesFromFragment:ioe,getVariablesFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=ioe(e[r],t[r]);Object.assign(n,i)}return n}},uoe=Mre.getFragment,doe=sie.eventShouldThrow,foe=coe.getSelector,hoe=kre,poe=[];var goe={},moe={readFragment:function(e,t){if(!poe.length)throw new Error("readFragment should be called only from within a Relay Resolver function.");var n=poe[poe.length-1],r=uoe(e),i=foe(r,t);null==i&&hoe(!1),"SingularReaderSelector"!==i.kind&&hoe(!1);var o=n.getDataForResolverFragment(i,t),s=o.data,a=o.isMissingData,l=o.fieldErrors;if(a||null!=l&&l.some(doe))throw goe;return s},withResolverContext:function(e,t){poe.push(e);try{return t()}finally{poe.pop()}},RESOLVER_FRAGMENT_ERRORED_SENTINEL:goe},voe={exports:{}};!function(e){function t(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,o){var s=e.apply(n,r);function a(e){t(s,i,o,a,l,"next",e)}function l(e){t(s,i,o,a,l,"throw",e)}a(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports}(voe);var yoe=voe.exports;var _oe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.then},boe=_oe,xoe=function(e,t){},Soe=function(){function e(e){this._source=e}e.create=function(t){return new e(t)},e.onUnhandledError=function(e){xoe=e},e.from=function(e){return function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}(e)?function(e){return e instanceof Soe?e:Soe.create(function(t){return e.subscribe(t)})}(e):boe(e)?(t=e,Soe.create(function(e){t.then(function(t){e.next(t),e.complete()},e.error)})):function(e){return Soe.create(function(t){t.next(e),t.complete()})}(e);var t};var t=e.prototype;return t.catch=function(t){var n=this;return e.create(function(e){var r;return n.subscribe({start:function(e){r=e},next:e.next,complete:e.complete,error:function(n){try{t(n).subscribe({start:function(e){r=e},next:e.next,complete:e.complete,error:e.error})}catch(i){e.error(i,!0)}}}),function(){return r.unsubscribe()}})},t.concat=function(t){var n=this;return e.create(function(e){var r;return n.subscribe({start:function(e){r=e},next:e.next,error:e.error,complete:function(){r=t.subscribe(e)}}),function(){r&&r.unsubscribe()}})},t.do=function(t){var n=this;return e.create(function(e){var r=function(n){return function(){try{t[n]&&t[n].apply(t,arguments)}catch(One){xoe(One,!0)}e[n]&&e[n].apply(e,arguments)}};return n.subscribe({start:r("start"),next:r("next"),error:r("error"),complete:r("complete"),unsubscribe:r("unsubscribe")})})},t.finally=function(t){var n=this;return e.create(function(e){var r=n.subscribe(e);return function(){r.unsubscribe(),t()}})},t.ifEmpty=function(t){var n=this;return e.create(function(e){var r,i=!1;return r=n.subscribe({next:function(t){i=!0,e.next(t)},error:e.error,complete:function(){i?e.complete():r=t.subscribe(e)}}),function(){r&&r.unsubscribe()}})},t.subscribe=function(e){return function(e,t){var n,r=!1,i=function(e){return Object.defineProperty(e,"closed",{get:function(){return r}})};function o(){if(n){if(n.unsubscribe)n.unsubscribe();else try{n()}catch(One){xoe(One,!0)}n=void 0}}var s=i({unsubscribe:function(){if(!r){r=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(One){xoe(One,!0)}finally{o()}}}});try{t.start&&t.start(s)}catch(One){xoe(One,!0)}if(r)return s;var a=i({next:function(e){if(!r&&t.next)try{t.next(e)}catch(One){xoe(One,!0)}},error:function(e,n){if(r||!t.error)r=!0,xoe(e,n||!1),o();else{r=!0;try{t.error(e)}catch(i){xoe(i,!0)}finally{o()}}},complete:function(){if(!r){r=!0;try{t.complete&&t.complete()}catch(One){xoe(One,!0)}finally{o()}}}});try{n=e(a)}catch(One){a.error(One,!0)}r&&o();return s}(this._source,e)},t.map=function(t){var n=this;return e.create(function(e){var r=n.subscribe({complete:e.complete,error:e.error,next:function(n){try{var r=t(n);e.next(r)}catch(One){e.error(One,!0)}}});return function(){r.unsubscribe()}})},t.mergeMap=function(t){var n=this;return e.create(function(r){var i=[];function o(e){this._sub=e,i.push(e)}function s(){i.splice(i.indexOf(this._sub),1),0===i.length&&r.complete()}return n.subscribe({start:o,next:function(n){try{r.closed||e.from(t(n)).subscribe({start:o,next:r.next,error:r.error,complete:s})}catch(One){r.error(One,!0)}},error:r.error,complete:s}),function(){i.forEach(function(e){return e.unsubscribe()}),i.length=0}})},t.poll=function(t){var n=this;return e.create(function(e){var r,i;return function o(){r=n.subscribe({next:e.next,error:e.error,complete:function(){i=setTimeout(o,t)}})}(),function(){clearTimeout(i),r.unsubscribe()}})},t.toPromise=function(){var e=this;return new Promise(function(t,n){var r=!1;e.subscribe({next:function(e){r||(r=!0,t(e))},error:n,complete:t})})},e}();var woe=Soe,Eoe=zre.default,koe=Eoe(eie),Coe=Eoe(Wre),Aoe=woe,Noe=kre,Toe=function(){function e(){var e=this;(0,Coe.default)(this,"_complete",!1),(0,Coe.default)(this,"_events",[]),(0,Coe.default)(this,"_sinks",new Set),(0,Coe.default)(this,"_subscription",[]),this._observable=Aoe.create(function(t){e._sinks.add(t);for(var n=e._events,r=0;r<n.length&&!t.closed;r++){var i=n[r];switch(i.kind){case"complete":t.complete();break;case"error":t.error(i.error);break;case"next":t.next(i.data);break;default:i.kind,Noe(!1)}}return function(){e._sinks.delete(t)}})}var t=e.prototype;return t.complete=function(){!0!==this._complete&&(this._complete=!0,this._events.push({kind:"complete"}),this._sinks.forEach(function(e){return e.complete()}))},t.error=function(e){!0!==this._complete&&(this._complete=!0,this._events.push({kind:"error",error:e}),this._sinks.forEach(function(t){return t.error(e)}))},t.next=function(e){!0!==this._complete&&(this._events.push({kind:"next",data:e}),this._sinks.forEach(function(t){return t.next(e)}))},t.subscribe=function(e){var t=this._observable.subscribe(e);return this._subscription.push(t),t},t.unsubscribe=function(){var e,t=(0,koe.default)(this._subscription);try{for(t.s();!(e=t.n()).done;){e.value.unsubscribe()}}catch(n){t.e(n)}finally{t.f()}this._subscription=[]},t.getObserverCount=function(){return this._sinks.size},e}(),Roe=Toe,Doe=woe,Ioe=Roe,Foe=kre,Ooe="function"==typeof WeakMap?new WeakMap:new Map;function Poe(e,t,n){return Doe.create(function(r){var i=Loe(e),o=i.get(t);return o||n().finally(function(){return i.delete(t)}).subscribe({start:function(e){o={identifier:t,subject:new Ioe,subjectForInFlightStatus:new Ioe,subscription:e,promise:null},i.set(t,o)},next:function(e){var n=zoe(i,t);n.subject.next(e),n.subjectForInFlightStatus.next(e)},error:function(e){var n=zoe(i,t);n.subject.error(e),n.subjectForInFlightStatus.error(e)},complete:function(){var e=zoe(i,t);e.subject.complete(),e.subjectForInFlightStatus.complete()},unsubscribe:function(e){var n=zoe(i,t);n.subject.unsubscribe(),n.subjectForInFlightStatus.unsubscribe()}}),null==o&&Foe(!1),function(e,t){return Doe.create(function(n){var r=t.subject.subscribe(n);return function(){r.unsubscribe();var n=e.get(t.identifier);if(n){var i=n.subscription;null!=i&&0===n.subject.getObserverCount()&&(i.unsubscribe(),e.delete(t.identifier))}}})}(i,o).subscribe(r)})}function Moe(e,t,n){return Doe.create(function(t){var r=n.subjectForInFlightStatus.subscribe({error:t.error,next:function(r){e.isRequestActive(n.identifier)?t.next():t.complete()},complete:t.complete,unsubscribe:t.complete});return function(){r.unsubscribe()}})}function Loe(e){var t=Ooe.get(e);if(null!=t)return t;var n=new Map;return Ooe.set(e,n),n}function zoe(e,t){var n=e.get(t);return null==n&&Foe(!1),n}var joe={fetchQuery:function(e,t){return Poe(e,t.request.identifier,function(){return e.execute({operation:t})})},fetchQueryDeduped:Poe,getPromiseForActiveRequest:function(e,t){var n=Loe(e),r=n.get(t.identifier);if(!r)return null;if(!e.isRequestActive(r.identifier))return null;var i=new Promise(function(t,n){var i=!1;Moe(e,0,r).subscribe({complete:t,error:n,next:function(e){i&&t(e)}}),i=!0});return i},getObservableForActiveRequest:function(e,t){var n=Loe(e),r=n.get(t.identifier);return r&&e.isRequestActive(r.identifier)?Moe(e,0,r):null}},Uoe=zre.default;yoe.default;Uoe(eie);var Boe=function e(t){return function(e){return null!=e&&(Array.isArray(e)||"object"==typeof e&&e.constructor===Object)}(t)?(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(n){var r=t[n];r&&"object"==typeof r&&!Object.isFrozen(r)&&e(r)}),t):t},$oe=bie.stableCopy,qoe=kre;var Goe=function(e,t){var n=null!=e.cacheID?e.cacheID:e.id;return null==n&&qoe(!1),n+JSON.stringify($oe(t))},Voe=Goe,Koe=_ie,Woe=bie.hasCycle,Hoe=jie.getOperationVariables,Joe=coe.createNormalizationSelector,Xoe=coe.createReaderSelector,Qoe=Pie.ROOT_ID,Yoe=kre;function Zoe(e,t,n){return{identifier:Voe(e.params,t),node:e,variables:t,cacheConfig:n}}var ese={createOperationDescriptor:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Qoe,i=e.operation,o=Hoe(i,e.params.providedVariables,t);Koe.ENABLE_CYLE_DETECTION_IN_VARIABLES&&Woe(o)&&Yoe(!1);var s=Zoe(e,o,n);return{fragment:Xoe(e.fragment,r,o,s),request:s,root:Joe(i,r,o)}},createRequestDescriptor:Zoe};(0,zre.default)(Wre);yoe.default;var tse=new Map,nse=1,rse=function(){for(var e=new Set,t=0;t<10;++t)e.add(t.toString());return e}();var ise={intern:function(e,t){if(null==t||e.length<t)return function(e){return"\t"===e[0]&&rse.has(e[1])||"\v"===e[0]?"\v"+e:e}(e);var n=tse.get(e);return null!=n||(n="\t"+nse++,tse.set(e,n)),n}},ose=_ie,sse=ise.intern,ase="client:";var lse=0;var cse={generateClientID:function(e,t,n){var r=(ose.STRING_INTERN_LEVEL<=0?e:sse(e,ose.MAX_DATA_ID_LENGTH))+":"+t;return null!=n&&(r+=":"+n),0!==r.indexOf(ase)&&(r=ase+r),r},generateClientObjectClientID:function(e,t,n){var r="".concat(ase).concat(e,":").concat(t);return null!=n&&(r+=":"+n),r},generateUniqueClientID:function(){return"".concat(ase,"local:").concat(lse++)},isClientID:function(e){return 0===e.indexOf(ase)}},use={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},dse={CURSOR:"cursor",EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},fse={inject:function(e){dse=e},get:function(){return dse},isConnectionCall:function(e){return use.hasOwnProperty(e.name)}},hse=cse.generateClientID,pse=Pie.getStableStorageKey,gse=yie,mse=fse,vse=kre,yse="connection",_se="__connection_next_edge_index";function bse(e,t,n){if(null==n)return n;var r=mse.get().EDGES,i=t.getValue(_se);"number"!=typeof i&&vse(!1);var o=hse(t.getDataID(),r,i),s=e.create(o,n.getType());return s.copyFieldsFrom(n),null==s.getValue("cursor")&&s.setValue(null,"cursor"),t.setValue(i+1,_se),s}function xse(e,t,n){for(var r=mse.get().NODE,i=0;i<e.length;i++){var o=e[i];if(o){var s=o.getLinkedRecord(r),a=s&&s.getDataID();if(a){if(n.has(a))continue;n.add(a)}t.push(o)}}}var Sse={buildConnectionEdge:bse,createEdge:function(e,t,n,r){var i=mse.get().NODE,o=hse(t.getDataID(),n.getDataID()),s=e.get(o);return s||(s=e.create(o,r)),s.setLinkedRecord(n,i),null==s.getValue("cursor")&&s.setValue(null,"cursor"),s},deleteNode:function(e,t){var n=mse.get(),r=n.EDGES,i=n.NODE,o=e.getLinkedRecords(r);if(o){for(var s,a=0;a<o.length;a++){var l=o[a],c=l&&l.getLinkedRecord(i);null!=c&&c.getDataID()===t?void 0===s&&(s=o.slice(0,a)):void 0!==s&&s.push(l)}void 0!==s&&e.setLinkedRecords(s,r)}},getConnection:function(e,t,n){var r=gse(yse,t,null);return e.getLinkedRecord(r,n)},getConnectionID:function(e,t,n){var r=gse(yse,t,null),i=pse(r,n);return hse(e,i)},insertEdgeAfter:function(e,t,n){var r=mse.get(),i=r.CURSOR,o=r.EDGES,s=e.getLinkedRecords(o);if(s){var a;if(null==n)a=s.concat(t);else{a=[];for(var l=!1,c=0;c<s.length;c++){var u=s[c];if(a.push(u),null!=u)n===u.getValue(i)&&(a.push(t),l=!0)}l||a.push(t)}e.setLinkedRecords(a,o)}else e.setLinkedRecords([t],o)},insertEdgeBefore:function(e,t,n){var r=mse.get(),i=r.CURSOR,o=r.EDGES,s=e.getLinkedRecords(o);if(s){var a;if(null==n)a=[t].concat(s);else{a=[];for(var l=!1,c=0;c<s.length;c++){var u=s[c];if(null!=u)n===u.getValue(i)&&(a.push(t),l=!0);a.push(u)}l||a.unshift(t)}e.setLinkedRecords(a,o)}else e.setLinkedRecords([t],o)},update:function(e,t){var n=e.get(t.dataID);if(n){var r=mse.get(),i=r.EDGES,o=r.END_CURSOR,s=r.HAS_NEXT_PAGE,a=r.HAS_PREV_PAGE,l=r.PAGE_INFO,c=r.PAGE_INFO_TYPE,u=r.START_CURSOR,d=n.getLinkedRecord(t.fieldKey),f=d&&d.getLinkedRecord(l);if(d){var h=hse(n.getDataID(),t.handleKey),p=n.getLinkedRecord(t.handleKey),g=null!=p?p:e.get(h),m=g&&g.getLinkedRecord(l);if(g){null==p&&n.setLinkedRecord(g,t.handleKey);var v=g,y=d.getLinkedRecords(i);y&&(y=y.map(function(t){return bse(e,v,t)}));var _=v.getLinkedRecords(i),b=v.getLinkedRecord(l);v.copyFieldsFrom(d),_&&v.setLinkedRecords(_,i),b&&v.setLinkedRecord(b,l);var x=[],S=t.args;if(_&&y)if(null!=S.after){var w,E=null===(w=m)||void 0===w?void 0:w.getValue(o),k=null==f?void 0:f.getValue(o);if(!(m&&S.after===E)&&!(m&&E===k))return;var C=new Set;xse(_,x,C),xse(y,x,C)}else if(null!=S.before){if(!m||S.before!==m.getValue(u))return;var A=new Set;xse(y,x,A),xse(_,x,A)}else x=y;else x=y||_;if(null!=x&&x!==_&&v.setLinkedRecords(x,i),m&&f)if(null==S.after&&null==S.before)m.copyFieldsFrom(f);else if(null!=S.before||null==S.after&&S.last){m.setValue(!!f.getValue(a),a);var N=f.getValue(u);"string"==typeof N&&m.setValue(N,u)}else if(null!=S.after||null==S.before&&S.first){m.setValue(!!f.getValue(s),s);var T=f.getValue(o);"string"==typeof T&&m.setValue(T,o)}}else{var R=e.create(h,d.getType());R.setValue(0,_se),R.copyFieldsFrom(d);var D=d.getLinkedRecords(i);D&&(D=D.map(function(t){return bse(e,R,t)}),R.setLinkedRecords(D,i)),n.setLinkedRecord(R,t.handleKey),(m=e.create(hse(R.getDataID(),l),c)).setValue(!1,s),m.setValue(!1,a),m.setValue(null,o),m.setValue(null,u),f&&m.copyFieldsFrom(f),R.setLinkedRecord(m,l)}}else n.setValue(null,t.handleKey,void 0,n.getErrors(t.fieldKey))}}},wse=(0,zre.default)(eie),Ese=Sse,kse=fse,Cse=kre,Ase={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=n.getValue(t.fieldKey);"string"==typeof r?e.delete(r):Array.isArray(r)&&r.forEach(function(t){"string"==typeof t&&e.delete(t)})}}},Nse={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=t.handleArgs.connections;null==r&&Cse(!1);var i=n.getValue(t.fieldKey);(Array.isArray(i)?i:[i]).forEach(function(t){if("string"==typeof t){var n,i=(0,wse.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=e.get(o);null!=s&&Ese.deleteNode(s,t)}}catch(a){i.e(a)}finally{i.f()}}})}}},Tse={update:Fse(Ese.insertEdgeAfter)},Rse={update:Fse(Ese.insertEdgeBefore)},Dse={update:Ose(Ese.insertEdgeAfter)},Ise={update:Ose(Ese.insertEdgeBefore)};function Fse(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs.connections;null==a&&Cse(!1);try{o=i.getLinkedRecord(n.fieldKey)}catch(m){}if(!o)try{s=i.getLinkedRecords(n.fieldKey)}catch(v){}if(null!=o||null!=s){var l,c=kse.get(),u=c.NODE,d=c.EDGES,f=null!==(r=s)&&void 0!==r?r:[o],h=(0,wse.default)(f);try{var p=function(){var n=l.value;if(null==n)return"continue";var r=n.getLinkedRecord("node");if(!r)return"continue";var i,o=r.getDataID(),s=(0,wse.default)(a);try{for(s.s();!(i=s.n()).done;){var c=i.value,f=t.get(c);if(null!=f)if(!(null===(g=f.getLinkedRecords(d))||void 0===g?void 0:g.some(function(e){var t;return(null==e||null===(t=e.getLinkedRecord(u))||void 0===t?void 0:t.getDataID())===o}))){var h=Ese.buildConnectionEdge(t,f,n);null==h&&Cse(!1),e(f,h)}}}catch(p){s.e(p)}finally{s.f()}};for(h.s();!(l=h.n()).done;){var g;p()}}catch(y){h.e(y)}finally{h.f()}}}}}function Ose(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs,l=a.connections,c=a.edgeTypeName;null==l&&Cse(!1),null==c&&Cse(!1);try{o=i.getLinkedRecord(n.fieldKey)}catch(y){}if(!o)try{s=i.getLinkedRecords(n.fieldKey)}catch(_){}if(null!=o||null!=s){var u,d=kse.get(),f=d.NODE,h=d.EDGES,p=null!==(r=s)&&void 0!==r?r:[o],g=(0,wse.default)(p);try{var m=function(){var n=u.value;if(null==n)return"continue";var r,i=n.getDataID(),o=(0,wse.default)(l);try{for(o.s();!(r=o.n()).done;){var s=r.value,a=t.get(s);if(null!=a)if(!(null===(v=a.getLinkedRecords(h))||void 0===v?void 0:v.some(function(e){var t;return(null==e||null===(t=e.getLinkedRecord(f))||void 0===t?void 0:t.getDataID())===i}))){var d=Ese.createEdge(t,a,n,c);null==d&&Cse(!1),e(a,d)}}}catch(p){o.e(p)}finally{o.f()}};for(g.s();!(u=g.n()).done;){var v;m()}}catch(b){g.e(b)}finally{g.f()}}}}}var Pse=Sse,Mse={AppendEdgeHandler:Tse,DeleteRecordHandler:Ase,PrependEdgeHandler:Rse,AppendNodeHandler:Dse,PrependNodeHandler:Ise,DeleteEdgeHandler:Nse},Lse=kre;var zse=function(e){switch(e){case"connection":return Pse;case"deleteRecord":return Mse.DeleteRecordHandler;case"deleteEdge":return Mse.DeleteEdgeHandler;case"appendEdge":return Mse.AppendEdgeHandler;case"prependEdge":return Mse.PrependEdgeHandler;case"appendNode":return Mse.AppendNodeHandler;case"prependNode":return Mse.PrependNodeHandler}Lse(!1)};var jse=function(e){return Boolean(e&&e["@@RelayModernEnvironment"])},Use=(0,zre.default)(eie),Bse=Sse;function $se(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}var qse={MutationTypes:Object.freeze({RANGE_ADD:"RANGE_ADD",RANGE_DELETE:"RANGE_DELETE",NODE_DELETE:"NODE_DELETE"}),RangeOperations:Object.freeze({APPEND:"append",PREPEND:"prepend"}),convert:function(e,t,n,r){var i=n?[n]:[],o=r?[r]:[];return e.forEach(function(e){switch(e.type){case"NODE_DELETE":var n=function(e,t){var n=e.deletedIDFieldName,r=$se(t);if(!r)return null;return function(e,t){var i=e.getRootField(r);if(i){var o=i.getValue(n);(Array.isArray(o)?o:[o]).forEach(function(t){t&&"string"==typeof t&&e.delete(t)})}}}(e,t);n&&(i.push(n),o.push(n));break;case"RANGE_ADD":var r=function(e,t){var n=e.parentID,r=e.connectionInfo,i=e.edgeName;if(!n)return null;var o=$se(t);if(!r||!o)return null;return function(e,t){var s=e.get(n);if(s){var a=e.getRootField(o);if(a){var l,c=a.getLinkedRecord(i),u=(0,Use.default)(r);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(c){var f=Bse.getConnection(s,d.key,d.filters);if(f){var h=Bse.buildConnectionEdge(e,f,c);if(h)switch(d.rangeBehavior){case"append":Bse.insertEdgeAfter(f,h);break;case"prepend":Bse.insertEdgeBefore(f,h)}}}}}catch(p){u.e(p)}finally{u.f()}}}}}(e,t);r&&(i.push(r),o.push(r));break;case"RANGE_DELETE":var s=function(e,t){var n=e.parentID,r=e.connectionKeys,i=e.pathToConnection,o=e.deletedIDFieldName;if(!n)return null;var s=$se(t);if(!s)return null;return function(e,t){if(t){var a=[],l=t[s];if(l&&Array.isArray(o)){var c,u=(0,Use.default)(o);try{for(u.s();!(c=u.n()).done;){var d=c.value;l&&"object"==typeof l&&(l=l[d])}}catch(f){u.e(f)}finally{u.f()}Array.isArray(l)?l.forEach(function(e){e&&e.id&&"object"==typeof e&&"string"==typeof e.id&&a.push(e.id)}):l&&l.id&&"string"==typeof l.id&&a.push(l.id)}else l&&"string"==typeof o&&"object"==typeof l&&("string"==typeof(l=l[o])?a.push(l):Array.isArray(l)&&l.forEach(function(e){"string"==typeof e&&a.push(e)}));!function(e,t,n,r,i){var o=r.get(e);if(!o)return;if(n.length<2)return;for(var s=o,a=1;a<n.length-1;a++)s&&(s=s.getLinkedRecord(n[a]));if(!t||!s)return;var l,c=(0,Use.default)(t);try{var u=function(){var e=l.value,t=Bse.getConnection(s,e.key,e.filters);t&&i.forEach(function(e){Bse.deleteNode(t,e)})};for(c.s();!(l=c.n()).done;)u()}catch(f){c.e(f)}finally{c.f()}}(n,r,i,e,a)}}}(e,t);s&&(i.push(s),o.push(s))}}),{optimisticUpdater:function(e,t){i.forEach(function(n){n(e,t)})},updater:function(e,t){o.forEach(function(n){n(e,t)})}}}},Gse=Mre.getRequest,Vse=jse,Kse=ese.createOperationDescriptor,Wse=qse,Hse=kre;var Jse=function(e,t){Vse(e)||Hse(!1);var n=Gse(t.mutation);if("mutation"!==n.params.operationKind)throw new Error("commitMutation: Expected mutation operation");var r=t.optimisticUpdater,i=t.configs,o=t.optimisticResponse,s=t.variables,a=Kse(n,s);return i&&(r=Wse.convert(i,n,r).optimisticUpdater),e.applyMutation({operation:a,response:o,updater:r})};var Xse=function(e,t){e.commitUpdate(t)};(0,zre.default)(Hre);var Qse=(0,zre.default)(pie),Yse=Mre.getRequest,Zse=cse.generateUniqueClientID,eae=jse,tae=ese.createOperationDescriptor,nae=qse,rae=kre;var iae=function(e,t){eae(e)||rae(!1);var n=Yse(t.mutation);if("mutation"!==n.params.operationKind)throw new Error("commitMutation: Expected mutation operation");if("Request"!==n.kind)throw new Error("commitMutation: Expected mutation to be of type request");var r=t.optimisticResponse,i=t.optimisticUpdater,o=t.updater,s=t.configs,a=t.cacheConfig,l=t.onError,c=t.onUnsubscribe,u=t.variables,d=t.uploadables,f=tae(n,u,a,Zse());if("function"==typeof r&&(r=r()),s){var h=nae.convert(s,n,i,o);i=h.optimisticUpdater,o=h.updater}var p=[],g=e.executeMutation({operation:f,optimisticResponse:r,optimisticUpdater:i,updater:o,uploadables:d}).subscribe({next:function(e){var n;Array.isArray(e)?e.forEach(function(e){e.errors&&p.push.apply(p,(0,Qse.default)(e.errors))}):e.errors&&p.push.apply(p,(0,Qse.default)(e.errors)),null===(n=t.onNext)||void 0===n||n.call(t)},complete:function(){var n=t.onCompleted;n&&n(e.lookup(f.fragment).data,0!==p.length?p:null)},error:l,unsubscribe:c});return{dispose:g.unsubscribe}},oae="function"==typeof WeakMap?new WeakMap:new Map;function sae(e,t){if(null!=t){var n={};return Object.assign(n,e),Object.keys(t).forEach(function(e){var r=t[e].get,i=r();if(oae.has(r)){var o=oae.get(r);n[e]=o}else oae.set(r,i),n[e]=i}),n}return e}sae.tests_only_resetDebugCache=void 0;var aae=woe;var lae={convertFetch:function(e){return function(t,n,r,i,o){var s=e(t,n,r,i,o);return s instanceof Error?aae.create(function(e){return e.error(s)}):aae.from(s)}}},cae=sae,uae=lae.convertFetch,dae=kre;var fae={create:function(e,t){var n=uae(e);return{execute:function(e,r,i,o,s){var a=cae(r,e.providedVariables);if("subscription"===e.operationKind)return t||dae(!1),o&&dae(!1),t(e,a,i);var l=i.poll;return null!=l?(o&&dae(!1),n(e,a,{force:!0}).poll(l)):n(e,a,i,o,s)}}}};(0,zre.default)(Hre);var hae=(0,zre.default)(Hre),pae=woe,gae=ese.createOperationDescriptor,mae=sie.handlePotentialSnapshotErrors,vae=joe,yae=Mre.getRequest,_ae=kre;function bae(e,t){return vae.fetchQuery(e,t).map(function(){return e.lookup(t.fragment)})}var xae=function(e,t,n,r){var i,o=yae(t);"query"!==o.params.operationKind&&_ae(!1);var s=(0,hae.default)({force:!0},null==r?void 0:r.networkCacheConfig),a=gae(o,n,s),l=null!==(i=null==r?void 0:r.fetchPolicy)&&void 0!==i?i:"network-only";function c(t){return mae(e,t.fieldErrors),t.data}switch(l){case"network-only":return bae(e,a).map(c);case"store-or-network":return"available"===e.check(a).status?pae.from(e.lookup(a.fragment)).map(c):bae(e,a).map(c);default:throw new Error("fetchQuery: Invalid fetchPolicy "+l)}},Sae=ese.createOperationDescriptor,wae=Mre.getRequest;var Eae=function(e,t,n,r){var i=wae(t);if("query"!==i.params.operationKind)throw new Error("fetchQuery: Expected query operation");var o=Sae(i,n,r);return e.execute({operation:o}).map(function(){return e.lookup(o.fragment).data}).toPromise()},kae=function(){function e(){this._preloadableQueries=new Map,this._callbacks=new Map}var t=e.prototype;return t.set=function(e,t){this._preloadableQueries.set(e,t);var n=this._callbacks.get(e);null!=n&&n.forEach(function(e){try{e(t)}catch(bU){setTimeout(function(){throw bU},0)}})},t.get=function(e){return this._preloadableQueries.get(e)},t.onLoad=function(e,t){var n,r=null!==(n=this._callbacks.get(e))&&void 0!==n?n:new Set;r.add(t);return this._callbacks.set(e,r),{dispose:function(){r.delete(t)}}},t.clear=function(){this._preloadableQueries.clear()},e}(),Cae=new kae,Aae=joe.getPromiseForActiveRequest;var Nae=function(e,t,n){var r,i,o=[],s=Aae(e,n);if(null!=s)o=[n];else{var a,l,c=e.getOperationTracker().getPendingOperationsAffectingOwner(n);o=null!==(a=null==c?void 0:c.pendingOperations)&&void 0!==a?a:[],s=null!==(l=null==c?void 0:c.promise)&&void 0!==l?l:null}if(!s)return null;var u=null!==(r=null===(i=o)||void 0===i?void 0:i.map(function(e){return e.node.params.name}).join(","))&&void 0!==r?r:null;null!=u&&0!==u.length||(u="Unknown pending operation");var d=t.name,f=u===d?"Relay(".concat(u,")"):"Relay(".concat(u,":").concat(d,")");return s.displayName=f,e.__log({name:"pendingoperation.found",fragment:t,fragmentOwner:n,pendingOperations:o}),{promise:s,pendingOperations:o}};var Tae=function(e,t){return e===t&&(null===e||"object"!=typeof e)};function Rae(e,t,n){if(e===t||"object"!=typeof e||!e||e.constructor!==Object&&!Array.isArray(e)||"object"!=typeof t||!t||t.constructor!==Object&&!Array.isArray(t))return t;var r=!1,i=Array.isArray(e)?e:null,o=Array.isArray(t)?t:null;if(i&&o){var s=n&&!Object.isFrozen(o);r=o.reduce(function(e,t,n){var r=Rae(i[n],t,s);return r!==o[n]&&s&&(o[n]=r),e&&r===i[n]},!0)&&i.length===o.length}else if(!i&&!o){var a=e,l=t,c=Object.keys(a),u=Object.keys(l),d=n&&!Object.isFrozen(l);r=u.reduce(function(e,t){var n=Rae(a[t],l[t],d);return n!==l[t]&&d&&(l[t]=n),e&&n===a[t]},!0)&&c.length===u.length}return r?e:t}var Dae=function(e,t){return Rae(e,t,!0)},Iae=zre.default,Fae=Iae(Hre),Oae=Iae(Wre),Pae=Nae,Mae=sie.handlePotentialSnapshotErrors,Lae=Tae,zae=Dae,jae=_ie,Uae=ese.createRequestDescriptor,Bae=coe.areEqualSelectors,$ae=coe.createReaderSelector,qae=coe.getSelectorsFromObject,Gae=qie,Vae=kre,Kae=function(){function e(e,t,n,r,i){var o=this;(0,Oae.default)(this,"_onChange",function(){o._stale=!0,"function"==typeof o._callback&&o._callback()}),this._callback=r,this._context=e,this._data={},this._fragments=t,this._props={},this._resolvers={},this._stale=!1,this._rootIsQueryRenderer=i,this.setProps(n)}var t=e.prototype;return t.dispose=function(){for(var e in this._resolvers)this._resolvers.hasOwnProperty(e)&&Jae(this._resolvers[e])},t.resolve=function(){if(this._stale){var e,t=this._data;for(var n in this._resolvers)if(this._resolvers.hasOwnProperty(n)){var r=this._resolvers[n],i=t[n];if(r){var o=r.resolve();(e||o!==i)&&((e=e||(0,Fae.default)({},t))[n]=o)}else{var s=this._props[n],a=void 0!==s?s:null;!e&&Lae(a,i)||((e=e||(0,Fae.default)({},t))[n]=a)}}this._data=e||t,this._stale=!1}return this._data},t.setCallback=function(e,t){this._callback=t,!0===jae.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this.setProps(e)},t.setProps=function(e){this._props={};var t=qae(this._fragments,e);for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=this._resolvers[n];null==r?(null!=i&&i.dispose(),i=null):"PluralReaderSelector"===r.kind?null==i?i=new Hae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Hae||Vae(!1),i.setSelector(r)):null==i?i=new Wae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Wae||Vae(!1),i.setSelector(r)),this._props[n]=e[n],this._resolvers[n]=i}this._stale=!0},t.setVariables=function(e,t){for(var n in this._resolvers)if(this._resolvers.hasOwnProperty(n)){var r=this._resolvers[n];r&&r.setVariables(e,t)}this._stale=!0},e}(),Wae=function(){function e(e,t,n,r,i){var o=this;(0,Oae.default)(this,"_onChange",function(e){o._data=e.data,o._isMissingData=e.isMissingData,o._fieldErrors=e.fieldErrors,o._callback()});var s=e.lookup(n);this._callback=i,this._data=s.data,this._isMissingData=s.isMissingData,this._fieldErrors=s.fieldErrors,this._environment=e,this._rootIsQueryRenderer=t,this._selector=n,!0===jae.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?r&&(this._subscription=e.subscribe(s,this._onChange)):this._subscription=e.subscribe(s,this._onChange)}var t=e.prototype;return t.dispose=function(){this._subscription&&(this._subscription.dispose(),this._subscription=null)},t.resolve=function(){if(!0===this._isMissingData){var e=Pae(this._environment,this._selector.node,this._selector.owner),t=null==e?void 0:e.promise;if(null!=t&&!this._rootIsQueryRenderer){var n,r=null!==(n=null==e?void 0:e.pendingOperations)&&void 0!==n?n:[];throw this._environment.__log({name:"suspense.fragment",data:this._data,fragment:this._selector.node,isRelayHooks:!1,isMissingData:this._isMissingData,isPromiseCached:!1,pendingOperations:r}),t}}return Mae(this._environment,this._fieldErrors),this._data},t.setSelector=function(e){if(null==this._subscription||!Bae(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=zae(this._data,t.data),this._isMissingData=t.isMissingData,this._fieldErrors=t.fieldErrors,this._selector=e,this._subscription=this._environment.subscribe(t,this._onChange)}},t.setVariables=function(e,t){if(!Gae(e,this._selector.variables)){var n=Uae(t,e),r=$ae(this._selector.node,this._selector.dataID,e,n);this.setSelector(r)}},e}(),Hae=function(){function e(e,t,n,r,i){var o=this;(0,Oae.default)(this,"_onChange",function(e){o._stale=!0,o._callback()}),this._callback=i,this._data=[],this._environment=e,this._resolvers=[],this._stale=!0,this._rootIsQueryRenderer=t,this._subscribeOnConstruction=r,this.setSelector(n)}var t=e.prototype;return t.dispose=function(){this._resolvers.forEach(Jae)},t.resolve=function(){if(this._stale){for(var e,t=this._data,n=0;n<this._resolvers.length;n++){var r=t[n],i=this._resolvers[n].resolve();(e||i!==r)&&(e=e||t.slice(0,n)).push(i)}e||this._resolvers.length===t.length||(e=t.slice(0,this._resolvers.length)),this._data=e||t,this._stale=!1}return this._data},t.setSelector=function(e){for(var t=e.selectors;this._resolvers.length>t.length;){this._resolvers.pop().dispose()}for(var n=0;n<t.length;n++)n<this._resolvers.length?this._resolvers[n].setSelector(t[n]):this._resolvers[n]=new Wae(this._environment,this._rootIsQueryRenderer,t[n],this._subscribeOnConstruction,this._onChange);this._stale=!0},t.setVariables=function(e,t){this._resolvers.forEach(function(n){return n.setVariables(e,t)}),this._stale=!0},e}();function Jae(e){e&&e.dispose()}var Xae=Kae;var Qae,Yae,Zae=function(e,t,n,r,i,o){return new Xae(e,n,r,o,i)},ele=kre;var tle,nle,rle=function(e){return Qae||(Qae=e.createContext(null),Yae=e),e!==Yae&&ele(!1),Qae},ile=kre;var ole=function(e){return tle||(tle=e.createContext(null),nle=e),e!==nle&&ile(!1),tle},sle=Object.freeze({__LIVE_RESOLVER_SUSPENSE_SENTINEL:!0});var ale={isSuspenseSentinel:function(e){return e===sle},suspenseSentinel:function(){return sle}},lle={exports:{}};!function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(lle);var cle=lle.exports,ule=zre.default,dle=ule(Wre),fle=ule(cle),hle=ule(Kre),ple=ule(Hre),gle=Boe,mle=cse,vle=mle.generateClientObjectClientID,yle=ale.isSuspenseSentinel,_le=Pie,ble=_le.ACTOR_IDENTIFIER_KEY,xle=_le.ERRORS_KEY,Sle=_le.ID_KEY,wle=_le.INVALIDATED_AT_KEY,Ele=_le.REF_KEY,kle=_le.REFS_KEY,Cle=_le.RELAY_RESOLVER_VALUE_KEY;_le.ROOT_ID;var Ale=_le.TYPENAME_KEY,Nle=qie,Tle=kre;function Rle(e,t){var n=e[t];return n&&"object"==typeof n&&(n.hasOwnProperty(Ele)||n.hasOwnProperty(kle))&&Tle(!1),n}function Dle(e,t,n){var r=e[xle];if(null!=n&&n.length>0)null==r?e[xle]=(0,dle.default)({},t,n):r[t]=n;else if(null!=r&&delete r[t]){for(var i in r)if(r.hasOwnProperty(i))return;delete e[xle]}}function Ile(e,t,n){e[t]=n}var Fle={clone:function(e){return(0,ple.default)({},e)},copyFields:function(e,t){for(var n in e)e.hasOwnProperty(n)&&n!==Sle&&n!==Ale&&(t[n]=e[n])},create:function(e,t){var n={};return n[Sle]=e,n[Ale]=t,n},freeze:function(e){gle(e)},fromObject:function(e){return e},getDataID:function(e){return e[Sle]},getErrors:function(e,t){var n;return null===(n=e[xle])||void 0===n?void 0:n[t]},getFields:function(e){return xle in e?Object.keys(e).filter(function(e){return e!==xle}):Object.keys(e)},getInvalidationEpoch:function(e){if(null==e)return null;var t=e[wle];return"number"!=typeof t?null:t},getLinkedRecordID:function(e,t){var n=e[t];if(null==n)return n;var r=n;return"object"==typeof r&&r&&"string"==typeof r[Ele]||Tle(!1),r[Ele]},getLinkedRecordIDs:function(e,t){var n=e[t];return null==n?n:("object"==typeof n&&Array.isArray(n[kle])||Tle(!1),n[kle])},getType:function(e){return e[Ale]},getValue:Rle,hasValue:function(e,t){return t in e},hasLinkedRecordID:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&n&&"string"==typeof n[Ele])},hasLinkedRecordIDs:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&Array.isArray(n[kle])&&n[kle].every(function(e){return"string"==typeof e}))},merge:function(e,t){if(xle in e||xle in t){var n=e[xle],r=(0,fle.default)(e,[xle].map(hle.default)),i=t[xle],o=(0,fle.default)(t,[xle].map(hle.default)),s=(0,ple.default)((0,ple.default)({},r),o);if(null==n&&null==i)return s;var a={};for(var l in n)o.hasOwnProperty(l)||(a[l]=n[l]);for(var c in i)a[c]=i[c];for(var u in a){s[xle]=a;break}return s}return(0,ple.default)((0,ple.default)({},e),t)},setErrors:Dle,setValue:Ile,setLinkedRecordID:function(e,t,n){var r={};r[Ele]=n,e[t]=r},setLinkedRecordIDs:function(e,t,n){var r={};r[kle]=n,e[t]=r},update:function(e,t){var n,r=e[xle],i=t[xle],o=null;if(null==r&&null==i){var s;for(var a in t)!o&&Nle(e[a],t[a])||((o=null!==o?o:(0,ple.default)({},e))[a]=t[a]);return null!==(s=o)&&void 0!==s?s:e}for(var l in t)if(l!==xle){var c=t[l],u=null==i?void 0:i[l];if(null==o){var d=e[l],f=null==r?void 0:r[l];if(Nle(d,c)&&Nle(f,u))continue;o=(0,ple.default)({},e),null!=r&&(o[xle]=(0,ple.default)({},r))}Ile(o,l,c),Dle(o,l,u)}return null!==(n=o)&&void 0!==n?n:e},getActorLinkedRecordID:function(e,t){var n=e[t];return null==n?n:(("object"!=typeof n||"string"!=typeof n[Ele]||null==n[ble])&&Tle(!1),[n[ble],n[Ele]])},setActorLinkedRecordID:function(e,t,n,r){var i={};i[Ele]=r,i[ble]=n,e[t]=i},getResolverLinkedRecordID:function(e,t){var n=Rle(e,Cle);return null==n||yle(n)?null:("object"==typeof n&&(n=n.id),"string"!=typeof n&&Tle(!1),vle(t,n))},getResolverLinkedRecordIDs:function(e,t){var n=Rle(e,Cle);return null==n||yle(n)?null:(Array.isArray(n)||Tle(!1),n.map(function(e){return null==e?null:("object"==typeof e&&(e=e.id),"string"!=typeof e&&Tle(!1),vle(t,e))}))},toJSON:function(e){return e}},Ole={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"},Ple=(0,zre.default)(eie),Mle=Fle,Lle=Ole.EXISTENT,zle=Ole.NONEXISTENT,jle=Ole.UNKNOWN,Ule=function(){function e(e){var t=this;this._records=new Map,null!=e&&Object.keys(e).forEach(function(n){var r=e[n],i=Mle.fromObject(r);t._records.set(n,i)})}e.create=function(t){return new e(t)};var t=e.prototype;return t.clear=function(){this._records=new Map},t.delete=function(e){this._records.set(e,null)},t.get=function(e){return this._records.get(e)},t.getRecordIDs=function(){return Array.from(this._records.keys())},t.getStatus=function(e){return this._records.has(e)?null==this._records.get(e)?zle:Lle:jle},t.has=function(e){return this._records.has(e)},t.remove=function(e){this._records.delete(e)},t.set=function(e,t){this._records.set(e,t)},t.size=function(){return this._records.size},t.toJSON=function(){var e,t={},n=(0,Ple.default)(this._records);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r[0],o=r[1];t[i]=Mle.toJSON(o)}}catch(s){n.e(s)}finally{n.f()}return t},e}(),Ble=Ule,$le=kre,qle="INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";var Gle={assertInternalActorIdentifier:function(e){e!==qle&&$le(!1)},getActorIdentifier:function(e){return e},INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE:qle},Vle="actor_key",Kle=Gle.getActorIdentifier;var Wle={ACTOR_IDENTIFIER_FIELD_NAME:Vle,getActorIdentifierFromPayload:function(e){if(null!=e&&"object"==typeof e&&"string"==typeof e[Vle])return Kle(e[Vle])}},Hle=zre.default,Jle=Hle(Hre),Xle=Hle(cle),Qle=Hle(eie),Yle=Hle(pie),Zle=["path","locations"],ece=Symbol("$SELF");function tce(e,t){var n,r=(0,Qle.default)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0],s=i[1],a=t.length;if(Array.isArray(s)?t.push.apply(t,(0,Yle.default)(s)):tce(s,t),o!==ece)for(var l=t.length,c=a;c<l;c++){var u=t[c];null==u.path?t[c]=(0,Jle.default)((0,Jle.default)({},u),{},{path:[o]}):u.path.unshift(o)}}}catch(d){r.e(d)}finally{r.f()}}var nce={buildErrorTrie:function(e){if(null==e)return null;var t,n=new Map,r=(0,Qle.default)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.path,s=(i.locations,(0,Xle.default)(i,Zle));if(null!=o){var a=o.length;if(0!==a){for(var l=a-1,c=n,u=0;u<l;u++){var d=o[u],f=c.get(d);if(f instanceof Map)c=f;else{var h=new Map;Array.isArray(f)&&h.set(ece,f),c.set(d,h),c=h}}var p=o[l],g=c.get(p);g instanceof Map&&(g=(c=g).get(p),p=ece),Array.isArray(g)?g.push(s):c.set(p,[s])}}}}catch(m){r.e(m)}finally{r.f()}return n},getNestedErrorTrieByKey:function(e,t){var n=e.get(t);return n instanceof Map?n:null},getErrorsByKey:function(e,t){var n=e.get(t);if(null==n)return null;if(Array.isArray(n))return n;var r=[];return tce(n,r),r}};var rce={generateTypeID:function(e){return"client:__type:"+e},TYPE_SCHEMA_TYPE:"__TypeSchema"},ice=zre.default,oce=ice(eie),sce=ice(pie),ace=Wle,lce=ace.getActorIdentifierFromPayload,cce=_ie,uce=cse.generateClientID,dce=cse.isClientID,fce=jie.getLocalVariables,hce=nce.buildErrorTrie,pce=nce.getErrorsByKey,gce=nce.getNestedErrorTrieByKey,mce=Fle,vce=coe.createNormalizationSelector,yce=Pie,_ce=yce.ROOT_ID,bce=yce.TYPENAME_KEY,xce=yce.getArgumentValues,Sce=yce.getHandleStorageKey,wce=yce.getModuleComponentKey,Ece=yce.getModuleOperationKey,kce=yce.getStorageKey,Cce=rce.TYPE_SCHEMA_TYPE,Ace=rce.generateTypeID,Nce=kre;var Tce=function(){function e(e,t,n,r){this._actorIdentifier=n.actorIdentifier,this._getDataId=n.getDataID,this._handleFieldPayloads=[],this._treatMissingFieldsAsNull=n.treatMissingFieldsAsNull,this._incrementalPlaceholders=[],this._isClientExtension=!1,this._isUnmatchedAbstractType=!1,this._useExecTimeResolvers=r,this._followupPayloads=[],this._path=n.path?(0,sce.default)(n.path):[],this._recordSource=e,this._variables=t,this._shouldProcessClientComponents=n.shouldProcessClientComponents,this._log=n.log}var t=e.prototype;return t.normalizeResponse=function(e,t,n,r){var i=this._recordSource.get(t);return i||Nce(!1),this._assignClientAbstractTypes(e),this._errorTrie=hce(r),this._traverseSelections(e,i,n),{errors:r,fieldPayloads:this._handleFieldPayloads,incrementalPlaceholders:this._incrementalPlaceholders,followupPayloads:this._followupPayloads,source:this._recordSource,isFinal:!1}},t._assignClientAbstractTypes=function(e){var t=e.clientAbstractTypes;if(null!=t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],s=(0,oce.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=Ace(a),c=this._recordSource.get(l);null==c&&(c=mce.create(l,Cce),this._recordSource.set(l,c)),mce.setValue(c,o,!0)}}catch(u){s.e(u)}finally{s.f()}}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||Nce(!1),this._variables[e]},t._getRecordType=function(e){var t=e[bce];return null==t&&Nce(!1),t},t._traverseSelections=function(e,t,n){for(var r=0;r<e.selections.length;r++){var i=e.selections[r];switch(i.kind){case"ScalarField":case"LinkedField":this._normalizeField(i,t,n);break;case"Condition":Boolean(this._getVariableValue(i.condition))===i.passingValue&&this._traverseSelections(i,t,n);break;case"FragmentSpread":var o=this._variables;this._variables=fce(this._variables,i.fragment.argumentDefinitions,i.args),this._traverseSelections(i.fragment,t,n),this._variables=o;break;case"InlineFragment":var s=i.abstractKey;if(null==s){mce.getType(t)===i.type&&this._traverseSelections(i,t,n)}else{var a=Object.prototype.hasOwnProperty.call(n,s),l=mce.getType(t),c=Ace(l),u=this._recordSource.get(c);null==u&&(u=mce.create(c,Cce),this._recordSource.set(c,u)),mce.setValue(u,s,a),a&&this._traverseSelections(i,t,n)}break;case"TypeDiscriminator":var d=i.abstractKey,f=Object.prototype.hasOwnProperty.call(n,d),h=mce.getType(t),p=Ace(h),g=this._recordSource.get(p);null==g&&(g=mce.create(p,Cce),this._recordSource.set(p,g)),mce.setValue(g,d,f);break;case"LinkedHandle":case"ScalarHandle":var m=i.args?xce(i.args,this._variables):{},v=kce(i,this._variables),y=Sce(i,this._variables);this._handleFieldPayloads.push({args:m,dataID:mce.getDataID(t),fieldKey:v,handle:i.handle,handleKey:y,handleArgs:i.handleArgs?xce(i.handleArgs,this._variables):{}});break;case"ModuleImport":this._normalizeModuleImport(i,t,n);break;case"Defer":this._normalizeDefer(i,t,n);break;case"Stream":this._normalizeStream(i,t,n);break;case"ClientExtension":var _=this._isClientExtension;this._isClientExtension=!0,this._traverseSelections(i,t,n),this._isClientExtension=_;break;case"ClientComponent":if(!1===this._shouldProcessClientComponents)break;this._traverseSelections(i.fragment,t,n);break;case"ActorChange":this._normalizeActorChange(i,t,n);break;case"RelayResolver":case"RelayLiveResolver":this._useExecTimeResolvers||this._normalizeResolver(i,t,n);break;case"ClientEdgeToClientObject":this._useExecTimeResolvers||this._normalizeResolver(i.backingField,t,n);break;default:Nce(!1)}}},t._normalizeResolver=function(e,t,n){null!=e.fragment&&this._traverseSelections(e.fragment,t,n)},t._normalizeDefer=function(e,t,n){!1===(null===e.if||this._getVariableValue(e.if))?this._traverseSelections(e,t,n):this._incrementalPlaceholders.push({kind:"defer",data:n,label:e.label,path:(0,sce.default)(this._path),selector:vce(e,mce.getDataID(t),this._variables),typeName:mce.getType(t),actorIdentifier:this._actorIdentifier})},t._normalizeStream=function(e,t,n){this._traverseSelections(e,t,n),!0===(null===e.if||this._getVariableValue(e.if))&&this._incrementalPlaceholders.push({kind:"stream",label:e.label,path:(0,sce.default)(this._path),parentID:mce.getDataID(t),node:e,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeModuleImport=function(e,t,n){"object"==typeof n&&n||Nce(!1);var r=mce.getType(t),i=wce(e.documentName),o=e.componentModuleProvider||n[i];mce.setValue(t,i,null!=o?o:null);var s=Ece(e.documentName),a=e.operationModuleProvider||n[s];mce.setValue(t,s,null!=a?a:null),null!=a&&this._followupPayloads.push({kind:"ModuleImportPayload",args:e.args,data:n,dataID:mce.getDataID(t),operationReference:a,path:(0,sce.default)(this._path),typeName:r,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeField=function(e,t,n){"object"==typeof n&&n||Nce(!1);var r=e.alias||e.name,i=kce(e,this._variables),o=n[r],s=cce.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(o)&&0===o.length;if(null==o||s){if(void 0===o){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}"ScalarField"===e.kind&&this._validateConflictingFieldsWithIdenticalId(t,i,null),s?"LinkedField"===e.kind?mce.setLinkedRecordIDs(t,i,[]):mce.setValue(t,i,[]):mce.setValue(t,i,null);var a=this._errorTrie;if(null!=a){var l=pce(a,r);null!=l&&mce.setErrors(t,i,l)}}else if("ScalarField"===e.kind)this._validateConflictingFieldsWithIdenticalId(t,i,o),mce.setValue(t,i,o);else if("LinkedField"===e.kind){this._path.push(r);var c=this._errorTrie;this._errorTrie=null==c?null:gce(c,r),e.plural?this._normalizePluralLink(e,t,i,o):this._normalizeLink(e,t,i,o),this._errorTrie=c,this._path.pop()}else Nce(!1)},t._normalizeActorChange=function(e,t,n){var r,i=e.linkedField;"object"==typeof n&&n||Nce(!1);var o=i.alias||i.name,s=kce(i,this._variables),a=n[o];if(null!=a){var l=lce(a);if(null!=l){var c=null!==(r=i.concreteType)&&void 0!==r?r:this._getRecordType(a),u=this._getDataId(a,c)||mce.getLinkedRecordID(t,s)||uce(mce.getDataID(t),s);"string"!=typeof u&&Nce(!1),mce.setActorLinkedRecordID(t,s,l,u),this._followupPayloads.push({kind:"ActorPayload",data:a,dataID:u,path:[].concat((0,sce.default)(this._path),[o]),typeName:c,variables:this._variables,node:i,actorIdentifier:l})}else mce.setValue(t,s,null)}else{if(void 0===a){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}mce.setValue(t,s,null)}},t._normalizeLink=function(e,t,n,r){var i;"object"==typeof r&&r||Nce(!1);var o=this._getDataId(r,null!==(i=e.concreteType)&&void 0!==i?i:this._getRecordType(r))||mce.getLinkedRecordID(t,n)||uce(mce.getDataID(t),n);"string"!=typeof o&&Nce(!1),this._validateConflictingLinkedFieldsWithIdenticalId(mce.getLinkedRecordID(t,n),o,n),mce.setLinkedRecordID(t,n,o);var s=this._recordSource.get(o);if(s)this._validateRecordType(s,e,r);else{var a=e.concreteType||this._getRecordType(r);s=mce.create(o,a),this._recordSource.set(o,s)}this._traverseSelections(e,s,r)},t._normalizePluralLink=function(e,t,n,r){var i=this;Array.isArray(r)||Nce(!1);var o=mce.getLinkedRecordIDs(t,n),s=[];r.forEach(function(r,a){var l;if(null!=r){i._path.push(String(a));var c=i._errorTrie;i._errorTrie=null==c?null:gce(c,a),"object"!=typeof r&&Nce(!1);var u=i._getDataId(r,null!==(l=e.concreteType)&&void 0!==l?l:i._getRecordType(r))||o&&o[a]||uce(mce.getDataID(t),n,a);"string"!=typeof u&&Nce(!1),s.push(u);var d=i._recordSource.get(u);if(d)i._validateRecordType(d,e,r);else{var f=e.concreteType||i._getRecordType(r);d=mce.create(u,f),i._recordSource.set(u,d)}o&&i._validateConflictingLinkedFieldsWithIdenticalId(o[a],u,n),i._traverseSelections(e,d,r),i._errorTrie=c,i._path.pop()}else s.push(r)}),mce.setLinkedRecordIDs(t,n,s)},t._validateRecordType=function(e,t,n){if(cce.ENABLE_STORE_ID_COLLISION_LOGGING){var r,i=null!==(r=t.concreteType)&&void 0!==r?r:this._getRecordType(n),o=mce.getDataID(e);if(!(dce(o)&&o!==_ce||mce.getType(e)===i)){var s={name:"idCollision.typename",previous_typename:mce.getType(e),new_typename:i};null!=this._log&&this._log(s)}}},t._validateConflictingFieldsWithIdenticalId=function(e,t,n){},t._validateConflictingLinkedFieldsWithIdenticalId=function(e,t,n){},e}(),Rce={normalize:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;return new Tce(e,l,r,null!=o&&o).normalizeResponse(a,s,n,i)}},Dce=zre.default,Ice=Dce(Hre),Fce=Dce(Fle),Oce=Dce(Ble),Pce=Dce(Rce);var Mce=function(e,t,n,r,i){var o,s=e.data,a=e.errors,l=Oce.default.create(),c=Fce.default.create(t.dataID,n);l.set(t.dataID,c);var u=Pce.default.normalize(l,t,s,r,a,i);return(0,Ice.default)((0,Ice.default)({},u),{},{isFinal:!0===(null===(o=e.extensions)||void 0===o?void 0:o.is_final)})},Lce=Mre.getInlineDataFragment,zce=Pie.FRAGMENTS_KEY,jce=kre;var Uce=function(e,t){var n,r=Lce(e);if(null==t)return t;"object"!=typeof t&&jce(!1);var i=null===(n=t[zce])||void 0===n?void 0:n[r.name];return null==i&&jce(!1),i},Bce=1e5;var $ce=function(){return Bce++},qce=$ce;var Gce=function(e,t){return{execute:function(n,r,i,o,s,a,l,c){var u=qce(),d={start:function(t){e.__log({name:"network.start",networkRequestId:u,params:n,variables:r,cacheConfig:i})},next:function(t){e.__log({name:"network.next",networkRequestId:u,response:t})},error:function(t){e.__log({name:"network.error",networkRequestId:u,error:t})},complete:function(){e.__log({name:"network.complete",networkRequestId:u})},unsubscribe:function(){e.__log({name:"network.unsubscribe",networkRequestId:u})}};return t.execute(n,r,i,o,function(t){e.__log({name:"network.info",networkRequestId:u,info:t})},a,l,c).do(d)}}},Vce=(0,zre.default)(eie),Kce=kre,Wce=function(){function e(){this._ownersToPendingOperations=new Map,this._pendingOperationsToOwners=new Map,this._ownersToPendingPromise=new Map}var t=e.prototype;return t.update=function(e,t){if(0!==t.size){var n,r=e.identifier,i=new Set,o=(0,Vce.default)(t);try{for(o.s();!(n=o.n()).done;){var s=n.value.identifier,a=this._ownersToPendingOperations.get(s);null!=a?a.has(r)||(a.set(r,e),i.add(s)):(this._ownersToPendingOperations.set(s,new Map([[r,e]])),i.add(s))}}catch(f){o.e(f)}finally{o.f()}if(0!==i.size){var l,c=this._pendingOperationsToOwners.get(r)||new Set,u=(0,Vce.default)(i);try{for(u.s();!(l=u.n()).done;){var d=l.value;this._resolveOwnerResolvers(d),c.add(d)}}catch(f){u.e(f)}finally{u.f()}this._pendingOperationsToOwners.set(r,c)}}},t.complete=function(e){var t=e.identifier,n=this._pendingOperationsToOwners.get(t);if(null!=n){var r,i=new Set,o=new Set,s=(0,Vce.default)(n);try{for(s.s();!(r=s.n()).done;){var a=r.value,l=this._ownersToPendingOperations.get(a);l&&(l.delete(t),l.size>0?o.add(a):i.add(a))}}catch(g){s.e(g)}finally{s.f()}var c,u=(0,Vce.default)(i);try{for(u.s();!(c=u.n()).done;){var d=c.value;this._resolveOwnerResolvers(d),this._ownersToPendingOperations.delete(d)}}catch(g){u.e(g)}finally{u.f()}var f,h=(0,Vce.default)(o);try{for(h.s();!(f=h.n()).done;){var p=f.value;this._resolveOwnerResolvers(p)}}catch(g){h.e(g)}finally{h.f()}this._pendingOperationsToOwners.delete(t)}},t._resolveOwnerResolvers=function(e){var t=this._ownersToPendingPromise.get(e);null!=t&&t.resolve(),this._ownersToPendingPromise.delete(e)},t.getPendingOperationsAffectingOwner=function(e){var t=e.identifier,n=this._ownersToPendingOperations.get(t);if(null==n||0===n.size)return null;var r,i=this._ownersToPendingPromise.get(t);if(null!=i)return{promise:i.promise,pendingOperations:i.pendingOperations};var o=new Promise(function(e){r=e});null==r&&Kce(!1);var s=Array.from(n.values());return this._ownersToPendingPromise.set(t,{promise:o,resolve:r,pendingOperations:s}),{promise:o,pendingOperations:s}},e}(),Hce=Wce;var Jce=function(e){var t=void 0!==k?k:"undefined"!=typeof window?window:void 0,n=t&&t.__RELAY_DEVTOOLS_HOOK__;n&&n.registerEnvironment(e)},Xce={VIEWER_ID:(0,cse.generateClientID)(Pie.ROOT_ID,"viewer"),VIEWER_TYPE:"Viewer"},Qce=Xce.VIEWER_ID,Yce=Xce.VIEWER_TYPE;var Zce=function(e,t){return t===Yce&&null==e.id?Qce:e.id},eue=function(e){},tue=Ere.REQUEST;var nue=function(e){return e.kind===tue?e.operation:e};function rue(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];var s=0,a=n.replace(/%s/g,function(){return String(i[s++])}),l=new Error(a),c=Object.assign(l,{name:t,messageFormat:n,messageParams:i,type:e,taalOpcodes:[2,2]});if(void 0===c.stack)try{throw c}catch(u){}return c}var iue,oue,sue={create:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return rue.apply(void 0,["error",e,t].concat(r))},createWarning:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return rue.apply(void 0,["warn",e,t].concat(r))}},aue="undefined"!=typeof window&&"function"==typeof(null===(iue=window)||void 0===iue||null===(oue=iue.performance)||void 0===oue?void 0:oue.now);function lue(){return aue?window.performance.now():Date.now()}var cue=function(e){var t=lue(),n=e();return[t,lue()-t,n]},uue=zre.default,due=uue(eie),fue=uue(pie),hue=woe,pue=$ce,gue=nue,mue=sue,vue=_ie,yue=bie.stableCopy,_ue=cue,bue=cse.generateClientID,xue=cse.generateUniqueClientID,Sue=jie.getLocalVariables,wue=Fle,Eue=coe.createNormalizationSelector,kue=coe.createReaderSelector,Cue=Ble,Aue=Pie,Nue=Aue.ROOT_TYPE,Tue=Aue.TYPENAME_KEY,Rue=Aue.getStorageKey,Due=kre;var Iue=function(){function e(e){var t,n,r,i=this,o=e.actorIdentifier,s=e.getDataID,a=e.getPublishQueue,l=e.getStore,c=e.isClientPayload,u=e.operation,d=e.operationExecutions,f=e.operationLoader,h=e.operationTracker,p=e.optimisticConfig,g=e.scheduler,m=e.shouldProcessClientComponents,v=e.sink,y=e.source,_=e.treatMissingFieldsAsNull,b=e.updater,x=e.log,S=e.normalizeResponse;this._actorIdentifier=o,this._getDataID=s,this._treatMissingFieldsAsNull=_,this._incrementalPayloadsPending=!1,this._incrementalResults=new Map,this._log=x,this._executeId=pue(),this._nextSubscriptionId=0,this._operation=u,this._operationExecutions=d,this._operationLoader=f,this._operationTracker=h,this._operationUpdateEpochs=new Map,this._optimisticUpdates=null,this._useExecTimeResolvers=null!==(t=null!==(n=this._operation.request.node.operation.use_exec_time_resolvers)&&void 0!==n?n:!0===(null===(r=this._operation.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===r?void 0:r.get()))&&void 0!==t&&t,this._execTimeResolverResponseComplete=!1,this._pendingModulePayloadsCount=0,this._getPublishQueue=a,this._scheduler=g,this._sink=v,this._source=new Map,this._state="started",this._getStore=l,this._subscriptions=new Map,this._updater=b,this._isClientPayload=!0===c,this._isSubscriptionOperation="subscription"===this._operation.request.node.params.operationKind,this._shouldProcessClientComponents=m,this._retainDisposables=new Map,this._seenActors=new Set,this._completeFns=[],this._normalizeResponse=S;var w=this._nextSubscriptionId++;vue.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION&&null!=p&&this._processOptimisticResponse(null!=p.response?{data:p.response}:null,p.updater,!1),y.subscribe({complete:function(){return i._complete(w)},error:function(e){return i._error(e)},next:function(e){try{i._next(w,e)}catch(One){v.error(One)}},start:function(e){var t;i._start(w,e),i._log({name:"execute.start",executeId:i._executeId,params:i._operation.request.node.params,variables:i._operation.request.variables,cacheConfig:null!==(t=i._operation.request.cacheConfig)&&void 0!==t?t:{}})},unsubscribe:function(){i._log({name:"execute.unsubscribe",executeId:i._executeId})}}),vue.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION||null==p||this._processOptimisticResponse(null!=p.response?{data:p.response}:null,p.updater,!1)}var t=e.prototype;return t.cancel=function(){var e=this;if("completed"!==this._state){this._state="completed",this._operationExecutions.delete(this._operation.request.identifier),0!==this._subscriptions.size&&(this._subscriptions.forEach(function(e){return e.unsubscribe()}),this._subscriptions.clear());var t=this._optimisticUpdates;null!==t&&(this._optimisticUpdates=null,t.forEach(function(t){return e._getPublishQueueAndSaveActor().revertUpdate(t)}),this._runPublishQueue()),this._incrementalResults.clear(),null!=this._asyncStoreUpdateDisposable&&(this._asyncStoreUpdateDisposable.dispose(),this._asyncStoreUpdateDisposable=null),this._completeFns=[],this._completeOperationTracker(),this._disposeRetainedData()}},t._updateActiveState=function(){var e;switch(this._state){case"started":case"loading_incremental":e="active";break;case"completed":e="inactive";break;case"loading_final":e=this._pendingModulePayloadsCount>0||this._useExecTimeResolvers&&!this._execTimeResolverResponseComplete?"active":"inactive";break;default:this._state,Due(!1)}this._operationExecutions.set(this._operation.request.identifier,e)},t._schedule=function(e,t){var n=this,r=this._scheduler;if(null!=r){var i=this._nextSubscriptionId++;hue.create(function(n){var i=r.schedule(function(){try{e(),n.complete()}catch(One){n.error(One)}},t);return function(){return r.cancel(i)}}).subscribe({complete:function(){return n._complete(i)},error:function(e){return n._error(e)},start:function(e){return n._start(i,e)}})}else e()},t._complete=function(e){this._subscriptions.delete(e),0===this._subscriptions.size&&(this.cancel(),this._sink.complete(),this._log({name:"execute.complete",executeId:this._executeId}))},t._error=function(e){this.cancel(),this._sink.error(e),this._log({name:"execute.error",executeId:this._executeId,error:e})},t._start=function(e,t){this._subscriptions.set(e,t),this._updateActiveState()},t._next=function(e,t){var n=this,r="loading_incremental"===this._state?"low":"default";this._schedule(function(){n._log({name:"execute.next.start",executeId:n._executeId,response:t,operation:n._operation}),n._handleNext(t),n._maybeCompleteSubscriptionOperationTracking(),n._log({name:"execute.next.end",executeId:n._executeId,response:t,operation:n._operation})},r)},t._handleErrorResponse=function(e){var t=this,n=[];return e.forEach(function(e){if(null!==e.data||null==e.extensions||e.hasOwnProperty("errors")){if(null==e.data){var r=e.hasOwnProperty("errors")&&null!=e.errors?e.errors:null,i=r?r.map(function(e){return e.message}).join("\n"):"(No errors)",o=mue.create("RelayNetwork","No data returned for operation `"+t._operation.request.node.params.name+"`, got error(s):\n"+i+"\n\nSee the error `source` property for more information.");throw o.source={errors:r,operation:t._operation.request.node,variables:t._operation.request.variables},o.stack,o}var s=e;n.push(s)}}),n},t._handleOptimisticResponses=function(e){var t;if(e.length>1)return e.some(function(e){var t;return!0===(null===(t=e.extensions)||void 0===t?void 0:t.isOptimistic)})&&Due(!1),!1;var n=e[0],r=!0===(null===(t=n.extensions)||void 0===t?void 0:t.isOptimistic);return r&&"started"!==this._state&&Due(!1),!!r&&(this._processOptimisticResponse(n,null,this._treatMissingFieldsAsNull),this._sink.next(n),!0)},t._handleNext=function(e){if("completed"!==this._state){this._seenActors.clear();var t=Array.isArray(e)?e:[e],n=this._handleErrorResponse(t);if(0===n.length){var r=t.some(function(e){var t;return!0===(null===(t=e.extensions)||void 0===t?void 0:t.is_final)});return r&&(this._state="loading_final",this._updateActiveState(),this._incrementalPayloadsPending=!1),void this._sink.next(e)}if(!this._handleOptimisticResponses(n)){var i=function(e){var t=[],n=[],r=[];return e.forEach(function(e){var i;if(null!=e.path||null!=e.label){var o=e.label,s=e.path;null!=o&&null!=s||Due(!1),n.push({label:o,path:s,response:e})}else!0===(null===(i=e.extensions)||void 0===i?void 0:i.is_normalized)?r.push(e):t.push(e)}),[t,n,r]}(n),o=i[0],s=i[1],a=i[2],l=o.length>0,c=a.length>0;if(l){if(this._isSubscriptionOperation){var u=xue();this._operation={request:this._operation.request,fragment:kue(this._operation.fragment.node,u,this._operation.fragment.variables,this._operation.fragment.owner),root:Eue(this._operation.root.node,u,this._operation.root.variables)}}var d=this._processResponses(o);this._processPayloadFollowups(d)}if(c)for(var f=[],h=0;h<a.length;h++){var p,g=a[h],m=new Cue(g.data),v={errors:[],fieldPayloads:[],followupPayloads:[],incrementalPlaceholders:[],isFinal:r=!0===(null===(p=g.extensions)||void 0===p?void 0:p.is_final),source:m};this._getPublishQueueAndSaveActor().commitPayload(this._operation,v,this._updater),f.push(v),this._execTimeResolverResponseComplete=r,r&&this._updateActiveState()}if(s.length>0){var y=this._processIncrementalResponses(s);this._processPayloadFollowups(y)}this._isSubscriptionOperation&&(null==n[0].extensions?n[0].extensions={__relay_subscription_root_id:this._operation.fragment.dataID}:n[0].extensions.__relay_subscription_root_id=this._operation.fragment.dataID);var _=this._runPublishQueue(l||c?this._operation:void 0);l&&this._incrementalPayloadsPending&&this._retainData(),this._updateOperationTracker(_),this._sink.next(e)}}},t._processOptimisticResponse=function(e,t,n){var r=this;if(null!==this._optimisticUpdates&&Due(!1),null!=e||null!=t){var i=[];if(e){var o=this._normalizeResponse(e,this._operation.root,Nue,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[],shouldProcessClientComponents:this._shouldProcessClientComponents,treatMissingFieldsAsNull:n},this._useExecTimeResolvers);Fue(o),i.push({operation:this._operation,payload:o,updater:t}),this._processOptimisticFollowups(o,i)}else t&&i.push({operation:this._operation,payload:{errors:null,fieldPayloads:null,incrementalPlaceholders:null,followupPayloads:null,source:Cue.create(),isFinal:!1},updater:t});this._optimisticUpdates=i,i.forEach(function(e){return r._getPublishQueueAndSaveActor().applyUpdate(e)});var s=this._runPublishQueue();vue.ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES&&this._updateOperationTracker(s)}},t._processOptimisticFollowups=function(e,t){if(e.followupPayloads&&e.followupPayloads.length){var n,r=e.followupPayloads,i=(0,due.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value;switch(o.kind){case"ModuleImportPayload":var s=this._expectOperationLoader().get(o.operationReference);if(null==s)this._processAsyncOptimisticModuleImport(o);else{var a=this._processOptimisticModuleImport(s,o);t.push.apply(t,(0,fue.default)(a))}break;case"ActorPayload":break;default:Due(!1)}}}catch(l){i.e(l)}finally{i.f()}}},t._normalizeFollowupPayload=function(e,t){var n;n="SplitOperation"===t.kind&&"ModuleImportPayload"===e.kind?Sue(e.variables,t.argumentDefinitions,e.args):e.variables;var r=Eue(t,e.dataID,n),i={data:e.data,extensions:"loading_final"===this._state?{is_final:!0}:void 0};return this._normalizeResponse(i,r,e.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:e.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers)},t._processOptimisticModuleImport=function(e,t){var n=gue(e),r=[],i=this._normalizeFollowupPayload(t,n);return Fue(i),r.push({operation:this._operation,payload:i,updater:null}),this._processOptimisticFollowups(i,r),r},t._processAsyncOptimisticModuleImport=function(e){var t=this;this._expectOperationLoader().load(e.operationReference).then(function(n){if(null!=n&&"started"===t._state){var r,i=t._processOptimisticModuleImport(n,e);if(i.forEach(function(e){return t._getPublishQueueAndSaveActor().applyUpdate(e)}),null==t._optimisticUpdates);else(r=t._optimisticUpdates).push.apply(r,(0,fue.default)(i)),t._runPublishQueue()}})},t._processResponses=function(e){var t=this;return this._log({name:"execute.normalize.start",operation:this._operation}),null!==this._optimisticUpdates&&(this._optimisticUpdates.forEach(function(e){t._getPublishQueueAndSaveActor().revertUpdate(e)}),this._optimisticUpdates=null),this._incrementalPayloadsPending=!1,this._incrementalResults.clear(),this._source.clear(),e.map(function(e){var n=t._normalizeResponse(e,t._operation.root,Nue,{actorIdentifier:t._actorIdentifier,getDataID:t._getDataID,log:t._log,path:[],treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,shouldProcessClientComponents:t._shouldProcessClientComponents},t._useExecTimeResolvers);return t._getPublishQueueAndSaveActor().commitPayload(t._operation,n,t._updater),t._log({name:"execute.normalize.end",operation:t._operation}),n})},t._processPayloadFollowups=function(e){var t=this;"completed"!==this._state&&e.forEach(function(e){var n=e.incrementalPlaceholders,r=e.followupPayloads,i=e.isFinal;if(t._state=i?"loading_final":"loading_incremental",t._updateActiveState(),i&&(t._incrementalPayloadsPending=!1),r&&0!==r.length&&r.forEach(function(e){var n,r=t._actorIdentifier;t._actorIdentifier=null!==(n=e.actorIdentifier)&&void 0!==n?n:t._actorIdentifier,t._processFollowupPayload(e),t._actorIdentifier=r}),n&&0!==n.length&&(t._incrementalPayloadsPending="loading_final"!==t._state,n.forEach(function(n){var r,i=t._actorIdentifier;t._actorIdentifier=null!==(r=n.actorIdentifier)&&void 0!==r?r:t._actorIdentifier,t._processIncrementalPlaceholder(e,n),t._actorIdentifier=i}),t._isClientPayload||"loading_final"===t._state)){var o=[];n.forEach(function(e){"defer"===e.kind&&o.push(t._processDeferResponse(e.label,e.path,e,{data:e.data,extensions:{is_final:!0}}))}),o.length>0&&t._processPayloadFollowups(o)}})},t._maybeCompleteSubscriptionOperationTracking=function(){(this._isSubscriptionOperation||this._useExecTimeResolvers&&this._execTimeResolverResponseComplete&&"loading_final"===this._state)&&0===this._pendingModulePayloadsCount&&!1===this._incrementalPayloadsPending&&this._completeOperationTracker()},t._processFollowupPayload=function(e){var t=this;switch(e.kind){case"ModuleImportPayload":var n=this._expectOperationLoader(),r=n.get(e.operationReference);if(null!=r)this._processFollowupPayloadWithNormalizationNode(e,gue(r));else{var i=this._nextSubscriptionId++;this._pendingModulePayloadsCount++;var o=function(){t._pendingModulePayloadsCount--,t._maybeCompleteSubscriptionOperationTracking()},s=hue.from(new Promise(function(t,r){n.load(e.operationReference).then(t,r)}));hue.create(function(n){var r,i=s.subscribe({next:function(i){if(null!=i){var o=function(){try{var r=gue(i),o=vue.BATCH_ASYNC_MODULE_UPDATES_FN,s=null!=o&&t._pendingModulePayloadsCount>1,a=_ue(function(){if(t._handleFollowupPayload(e,r),s)t._scheduleAsyncStoreUpdate(o,n.complete);else{var i=t._runPublishQueue();t._updateOperationTracker(i)}}),l=(a[0],a[1]);t._log({name:"execute.async.module",executeId:t._executeId,operationName:r.name,duration:l}),s||n.complete()}catch(One){n.error(One)}},s=t._scheduler;null==s?o():r=s.schedule(o)}else n.complete()},error:n.error});return function(){i.unsubscribe(),null!=t._scheduler&&null!=r&&t._scheduler.cancel(r)}}).subscribe({complete:function(){t._complete(i),o()},error:function(e){t._error(e),o()},start:function(e){return t._start(i,e)}})}break;case"ActorPayload":this._processFollowupPayloadWithNormalizationNode(e,e.node);break;default:Due(!1)}},t._processFollowupPayloadWithNormalizationNode=function(e,t){this._handleFollowupPayload(e,t),this._maybeCompleteSubscriptionOperationTracking()},t._handleFollowupPayload=function(e,t){var n=this._normalizeFollowupPayload(e,t);this._getPublishQueueAndSaveActor().commitPayload(this._operation,n),this._processPayloadFollowups([n])},t._processIncrementalPlaceholder=function(e,t){var n,r=t.label,i=t.path.map(String).join("."),o=this._incrementalResults.get(r);null==o&&(o=new Map,this._incrementalResults.set(r,o));var s,a=o.get(i),l=null!=a&&"response"===a.kind?a.responses:null;o.set(i,{kind:"placeholder",placeholder:t}),"stream"===t.kind?s=t.parentID:"defer"===t.kind?s=t.selector.dataID:Due(!1);var c,u,d=e.source.get(s),f=(null!==(n=e.fieldPayloads)&&void 0!==n?n:[]).filter(function(e){var t=bue(e.dataID,e.fieldKey);return e.dataID===s||t===s});null==d&&Due(!1);var h=this._source.get(s);if(null!=h){c=wue.update(h.record,d);var p=new Map,g=function(e){var t=function(e){var t;return null!==(t=JSON.stringify(yue(e)))&&void 0!==t?t:""}(e);p.set(t,e)};h.fieldPayloads.forEach(g),f.forEach(g),u=Array.from(p.values())}else c=d,u=f;if(this._source.set(s,{record:c,fieldPayloads:u}),null!=l){var m=this._processIncrementalResponses(l);this._processPayloadFollowups(m)}},t._processIncrementalResponses=function(e){var t=this,n=[];return e.forEach(function(e){var r=e.label,i=e.path,o=e.response,s=t._incrementalResults.get(r);if(null==s&&(s=new Map,t._incrementalResults.set(r,s)),-1!==r.indexOf("$defer$")){var a=i.map(String).join("."),l=s.get(a);if(null==l)return l={kind:"response",responses:[e]},void s.set(a,l);if("response"===l.kind)return void l.responses.push(e);var c=l.placeholder;"defer"!==c.kind&&Due(!1),n.push(t._processDeferResponse(r,i,c,o))}else{var u=i.slice(0,-2).map(String).join("."),d=s.get(u);if(null==d)return d={kind:"response",responses:[e]},void s.set(u,d);if("response"===d.kind)return void d.responses.push(e);var f=d.placeholder;"stream"!==f.kind&&Due(!1),n.push(t._processStreamResponse(r,i,f,o))}}),n},t._processDeferResponse=function(e,t,n,r){var i,o=n.selector.dataID,s=this._actorIdentifier;this._actorIdentifier=null!==(i=n.actorIdentifier)&&void 0!==i?i:this._actorIdentifier;var a=this._normalizeResponse(r,n.selector,n.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:n.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers);this._getPublishQueueAndSaveActor().commitPayload(this._operation,a);var l=this._source.get(o);null==l&&Due(!1);var c=l.fieldPayloads;if(0!==c.length){var u,d={errors:null,fieldPayloads:c,incrementalPlaceholders:null,followupPayloads:null,source:Cue.create(),isFinal:!0===(null===(u=r.extensions)||void 0===u?void 0:u.is_final)};this._getPublishQueueAndSaveActor().commitPayload(this._operation,d)}return this._actorIdentifier=s,a},t._processStreamResponse=function(e,t,n,r){var i=n.parentID,o=n.node,s=n.variables,a=n.actorIdentifier,l=this._actorIdentifier;this._actorIdentifier=null!=a?a:this._actorIdentifier;var c=o.selections[0];(null==c||"LinkedField"!==c.kind||!0!==c.plural)&&Due(!1);var u=this._normalizeStreamItem(r,i,c,s,t,n.path),d=u.fieldPayloads,f=u.itemID,h=u.itemIndex,p=u.prevIDs,g=u.relayPayload,m=u.storageKey;if(this._getPublishQueueAndSaveActor().commitPayload(this._operation,g,function(e){var t=e.get(i);if(null!=t){var n=t.getLinkedRecords(m);if(null!=n&&n.length===p.length&&!n.some(function(e,t){return p[t]!==(e&&e.getDataID())})){var r=(0,fue.default)(n);r[h]=e.get(f),t.setLinkedRecords(r,m)}}}),0!==d.length){var v={errors:null,fieldPayloads:d,incrementalPlaceholders:null,followupPayloads:null,source:Cue.create(),isFinal:!1};this._getPublishQueueAndSaveActor().commitPayload(this._operation,v)}return this._actorIdentifier=l,g},t._normalizeStreamItem=function(e,t,n,r,i,o){var s,a,l,c,u=e.data;"object"!=typeof u&&Due(!1);var d=null!==(s=n.alias)&&void 0!==s?s:n.name,f=Rue(n,r),h=this._source.get(t);null==h&&Due(!1);var p=h.record,g=h.fieldPayloads,m=wue.getLinkedRecordIDs(p,f);null==m&&Due(!1);var v=i[i.length-1],y=parseInt(v,10);y===v&&y>=0||Due(!1);var _=null!==(a=n.concreteType)&&void 0!==a?a:u[Tue];"string"!=typeof _&&Due(!1);var b=null!==(l=null!==(c=this._getDataID(u,_))&&void 0!==c?c:null==m?void 0:m[y])&&void 0!==l?l:bue(t,f,y);"string"!=typeof b&&Due(!1);var x=Eue(n,b,r),S=wue.clone(p),w=(0,fue.default)(m);return w[y]=b,wue.setLinkedRecordIDs(S,f,w),this._source.set(t,{record:S,fieldPayloads:g}),{fieldPayloads:g,itemID:b,itemIndex:y,prevIDs:m,relayPayload:this._normalizeResponse(e,x,_,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[].concat((0,fue.default)(o),[d,String(y)]),treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers),storageKey:f}},t._scheduleAsyncStoreUpdate=function(e,t){var n=this;this._completeFns.push(t),null==this._asyncStoreUpdateDisposable&&(this._asyncStoreUpdateDisposable=e(function(){n._asyncStoreUpdateDisposable=null;var e=n._runPublishQueue();n._updateOperationTracker(e);var t,r=(0,due.default)(n._completeFns);try{for(r.s();!(t=r.n()).done;){(0,t.value)()}}catch(i){r.e(i)}finally{r.f()}n._completeFns=[]}))},t._updateOperationTracker=function(e){null!=e&&e.length>0&&this._operationTracker.update(this._operation.request,new Set(e))},t._completeOperationTracker=function(){this._operationTracker.complete(this._operation.request)},t._getPublishQueueAndSaveActor=function(){return this._seenActors.add(this._actorIdentifier),this._getPublishQueue(this._actorIdentifier)},t._getActorsToVisit=function(){return 0===this._seenActors.size?new Set([this._actorIdentifier]):this._seenActors},t._runPublishQueue=function(e){var t,n=new Set,r=(0,due.default)(this._getActorsToVisit());try{for(r.s();!(t=r.n()).done;){var i=t.value;this._getPublishQueue(i).run(e).forEach(function(e){return n.add(e)})}}catch(o){r.e(o)}finally{r.f()}return Array.from(n)},t._retainData=function(){var e,t=(0,due.default)(this._getActorsToVisit());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._retainDisposables.has(n)||this._retainDisposables.set(n,this._getStore(n).retain(this._operation))}}catch(r){t.e(r)}finally{t.f()}},t._disposeRetainedData=function(){var e,t=(0,due.default)(this._retainDisposables.values());try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}this._retainDisposables.clear()},t._expectOperationLoader=function(){var e=this._operationLoader;return e||Due(!1),e},e}();function Fue(e){var t=e.incrementalPlaceholders;null!=t&&0!==t.length&&Due(!1)}var Oue={execute:function(e){return new Iue(e)}},Pue=Promise.resolve();function Mue(e){setTimeout(function(){throw e},0)}var Lue=function(e){Pue.then(e).catch(Mue)},zue=Fle,jue=Ole.EXISTENT,Uue=kre,Bue=function(){function e(e,t){this.__sources=[t,e],this._base=e,this._sink=t}var t=e.prototype;return t.unstable_getRawRecordWithChanges=function(e){var t=this._base.get(e),n=this._sink.get(e);return void 0===n?null==t?t:zue.clone(t):null===n?null:null!=t?zue.update(t,n):zue.clone(n)},t._getSinkRecord=function(e){var t=this._sink.get(e);if(!t){var n=this._base.get(e);n||Uue(!1),t=zue.create(e,zue.getType(n)),this._sink.set(e,t)}return t},t.copyFields=function(e,t){var n=this._sink.get(e),r=this._base.get(e);n||r||Uue(!1);var i=this._getSinkRecord(t);r&&zue.copyFields(r,i),n&&zue.copyFields(n,i)},t.copyFieldsFromRecord=function(e,t){var n=this._getSinkRecord(t);zue.copyFields(e,n)},t.create=function(e,t){(this._base.getStatus(e)===jue||this._sink.getStatus(e)===jue)&&Uue(!1);var n=zue.create(e,t);this._sink.set(e,n)},t.delete=function(e){this._sink.delete(e)},t.getStatus=function(e){return this._sink.has(e)?this._sink.getStatus(e):this._base.getStatus(e)},t.getType=function(e){for(var t=0;t<this.__sources.length;t++){var n=this.__sources[t].get(e);if(n)return zue.getType(n);if(null===n)return null}},t.getValue=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=zue.getValue(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setValue=function(e,t,n){var r=this._getSinkRecord(e);zue.setValue(r,t,n)},t.getErrors=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=zue.getErrors(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setErrors=function(e,t,n){var r=this._getSinkRecord(e);zue.setErrors(r,t,n)},t.getLinkedRecordID=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=zue.getLinkedRecordID(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setLinkedRecordID=function(e,t,n){var r=this._getSinkRecord(e);zue.setLinkedRecordID(r,t,n)},t.getLinkedRecordIDs=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=zue.getLinkedRecordIDs(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setLinkedRecordIDs=function(e,t,n){var r=this._getSinkRecord(e);zue.setLinkedRecordIDs(r,t,n)},e}(),$ue=Bue,que=(0,zre.default)(eie),Gue=Pie.getArgumentValues,Vue=["id","__id","__typename","js"];function Kue(e,t,n,r,i,o){var s,a,l=(0,que.default)(r);try{var c=function(){var r=a.value;switch(r.kind){case"LinkedField":r.plural?Object.defineProperty(e,null!==(u=r.alias)&&void 0!==u?u:r.name,{get:Jue(r,n,t,i,o),set:Wue(r,n,t,i)}):Object.defineProperty(e,null!==(d=r.alias)&&void 0!==d?d:r.name,{get:Xue(r,n,t,i,o),set:Hue(r,n,t,i)});break;case"ScalarField":var l=null!==(s=r.alias)&&void 0!==s?s:r.name;Object.defineProperty(e,l,{get:function(){var e,s=Gue(null!==(e=r.args)&&void 0!==e?e:[],n),a=t.getValue(r.name,s);return null==a&&(a=function(e,t,n,r,i){var o,s=(0,que.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("scalar"===a.kind){var l=a.handle(e,n,t,r);if(void 0!==l)return l}}}catch(c){s.e(c)}finally{s.f()}}(r,s,t,i,o)),a},set:Vue.includes(r.name)?void 0:function(e){var i,o=Gue(null!==(i=r.args)&&void 0!==i?i:[],n);t.setValue__UNSAFE(e,r.name,o)}});break;case"InlineFragment":t.getType()===r.type&&Kue(e,t,n,r.selections,i,o);break;case"ClientExtension":Kue(e,t,n,r.selections,i,o);break;case"FragmentSpread":break;case"Condition":case"ActorChange":case"InlineDataFragmentSpread":case"AliasedInlineFragmentSpread":case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":case"Defer":case"ModuleImport":case"RequiredField":case"CatchField":case"Stream":case"RelayResolver":case"RelayLiveResolver":throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");default:throw r.kind,new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.")}};for(l.s();!(a=l.n()).done;){var u,d;c()}}catch(f){l.e(f)}finally{l.f()}}function Wue(e,t,n,r){return function(i){var o,s=Gue(null!==(o=e.args)&&void 0!==o?o:[],t);if(null==i)throw new Error("Do not assign null to plural linked fields; assign an empty array instead.");var a=i.map(function(e){if(null==e)throw new Error("When assigning an array of items, none of the items should be null or undefined.");var t=e.__id;if(null==t)throw new Error("The __id field must be present on each item passed to the setter. This indicates a bug in Relay.");var n=r.get(t);if(null==n)throw new Error("Did not find item with data id ".concat(t," in the store."));return n});n.setLinkedRecords(a,e.name,s)}}function Hue(e,t,n,r){return function(i){var o,s=Gue(null!==(o=e.args)&&void 0!==o?o:[],t);if(null==i)n.setValue(i,e.name,s);else{var a=i.__id;if(null==a)throw new Error("The __id field must be present on the argument. This indicates a bug in Relay.");var l=r.get(a);if(null==l)throw new Error("Did not find item with data id ".concat(a," in the store."));n.setLinkedRecord(l,e.name,s)}}}function Jue(e,t,n,r,i){return function(){var o,s=Gue(null!==(o=e.args)&&void 0!==o?o:[],t),a=n.getLinkedRecords(e.name,s);return void 0===a&&(a=function(e,t,n,r,i){var o,s=(0,que.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("pluralLinked"===a.kind){var l=a.handle(e,n,t,r);if(null!=l)return l.map(function(e){if(null!=e)return r.get(e)})}}}catch(c){s.e(c)}finally{s.f()}}(e,s,n,r,i)),null!=a?a.map(function(n){if(null!=n){var o={};return Kue(o,n,t,e.selections,r,i),o}return n}):a}}function Xue(e,t,n,r,i){return function(){var o,s=Gue(null!==(o=e.args)&&void 0!==o?o:[],t),a=n.getLinkedRecord(e.name,s);if(void 0===a&&(a=function(e,t,n,r,i){var o,s=(0,que.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("linked"===a.kind){var l=a.handle(e,n,t,r);if(null!=l)return r.get(l)}}}catch(c){s.e(c)}finally{s.f()}}(e,s,n,r,i)),null!=a){var l={};return Kue(l,a,t,e.selections,r,i),l}return a}}var Que={createUpdatableProxy:function(e,t,n,r,i){var o={};return Kue(o,e,t,n,r,i),o}},Yue=Mre.getFragment,Zue=coe.getVariablesFromFragment,ede=Pie.ID_KEY,tde=Que.createUpdatableProxy,nde=kre;var rde={readUpdatableFragment:function(e,t,n,r){var i=Yue(e),o=Zue(i,t),s=t[ede],a=n.get(s);return null==a&&nde(!1),{updatableData:tde(a,o,i.selections,n,r)}}},ide=Mre.getUpdatableQuery,ode=Que.createUpdatableProxy;var sde={readUpdatableQuery:function(e,t,n,r){var i=ide(e);return{updatableData:ode(n.getRoot(),t,i.fragment.selections,n,r)}}},ade=cse.generateClientID,lde=Pie.getStableStorageKey,cde=kre,ude=function(){function e(e,t,n){this._dataID=n,this._mutator=t,this._source=e}var t=e.prototype;return t.copyFieldsFrom=function(e){this._mutator.copyFields(e.getDataID(),this._dataID)},t.getDataID=function(){return this._dataID},t.getType=function(){var e=this._mutator.getType(this._dataID);return null==e&&cde(!1),e},t.getValue=function(e,t){var n=lde(e,t);return this._mutator.getValue(this._dataID,n)},t.setValue=function(e,t,n,r){return dde(e)||cde(!1),this.setValue__UNSAFE(e,t,n,r)},t.getErrors=function(e,t){var n=lde(e,t);return this._mutator.getErrors(this._dataID,n)},t.setValue__UNSAFE=function(e,t,n,r){var i=lde(t,n);return this._mutator.setValue(this._dataID,i,e),null!=r&&(0===r.length?this._mutator.setErrors(this._dataID,i):this._mutator.setErrors(this._dataID,i,r)),this},t.getLinkedRecord=function(e,t){var n=lde(e,t),r=this._mutator.getLinkedRecordID(this._dataID,n);return null!=r?this._source.get(r):r},t.setLinkedRecord=function(t,n,r){t instanceof e||cde(!1);var i=lde(n,r),o=t.getDataID();return this._mutator.setLinkedRecordID(this._dataID,i,o),this},t.getOrCreateLinkedRecord=function(e,t,n){var r=this.getLinkedRecord(e,n);if(!r){var i,o=lde(e,n),s=ade(this.getDataID(),o);r=null!==(i=this._source.get(s))&&void 0!==i?i:this._source.create(s,t),this.setLinkedRecord(r,e,n)}return r},t.getLinkedRecords=function(e,t){var n=this,r=lde(e,t),i=this._mutator.getLinkedRecordIDs(this._dataID,r);return null==i?i:i.map(function(e){return null!=e?n._source.get(e):e})},t.setLinkedRecords=function(e,t,n){Array.isArray(e)||cde(!1);var r=lde(t,n),i=e.map(function(e){return e&&e.getDataID()});return this._mutator.setLinkedRecordIDs(this._dataID,r,i),this},t.invalidateRecord=function(){this._source.markIDForInvalidation(this._dataID)},e}();function dde(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every(dde)}var fde=ude,hde=Fle,pde=Ole.EXISTENT,gde=Ole.NONEXISTENT,mde=Pie,vde=mde.ROOT_ID,yde=mde.ROOT_TYPE,_de=rde.readUpdatableFragment,bde=sde.readUpdatableQuery,xde=fde,Sde=kre,wde=function(){function e(e,t,n,r,i){this.__mutator=e,this._handlerProvider=n||null,this._proxies={},this._getDataID=t,this._invalidatedStore=!1,this._idsMarkedForInvalidation=new Set,this._missingFieldHandlers=r,this._log=null!=i?i:function(e){}}var t=e.prototype;return t.publishSource=function(e,t){var n=this;e.getRecordIDs().forEach(function(t){var r=e.getStatus(t);if(r===pde){var i=e.get(t);i&&(n.__mutator.getStatus(t)!==pde&&n.create(t,hde.getType(i)),n.__mutator.copyFieldsFromRecord(i,t))}else r===gde&&n.delete(t)}),t&&t.length&&t.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);t||Sde(!1),t.update(n,e)})},t.create=function(e,t){this.__mutator.create(e,t),delete this._proxies[e];var n=this.get(e);return n||Sde(!1),n},t.delete=function(e){e===vde&&Sde(!1),delete this._proxies[e],this.__mutator.delete(e)},t.get=function(e){if(!this._proxies.hasOwnProperty(e)){var t=this.__mutator.getStatus(e);this._proxies[e]=t===pde?new xde(this,this.__mutator,e):t===gde?null:void 0}return this._proxies[e]},t.getRoot=function(){var e=this.get(vde);return e||(e=this.create(vde,yde)),e&&e.getType()===yde||Sde(!1),e},t.invalidateStore=function(){this._invalidatedStore=!0},t.isStoreMarkedForInvalidation=function(){return this._invalidatedStore},t.markIDForInvalidation=function(e){this._idsMarkedForInvalidation.add(e)},t.getIDsMarkedForInvalidation=function(){return this._idsMarkedForInvalidation},t.readUpdatableQuery=function(e,t){return bde(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return _de(e,t,this,this._missingFieldHandlers)},e}(),Ede=wde,kde=Ere.LINKED_FIELD,Cde=Pie.getHandleStorageKey,Ade=qie,Nde=kre;var Tde=function(e,t,n){var r=t.find(function(t){return t.kind===kde&&t.name===e.name&&t.alias===e.alias&&Ade(t.args,e.args)});r&&r.kind===kde||Nde(!1);var i=Cde(e,n);return{kind:"LinkedField",alias:r.alias,name:i,storageKey:i,args:null,concreteType:r.concreteType,plural:r.plural,selections:r.selections}},Rde=Ere.SCALAR_FIELD,Dde=Pie.getHandleStorageKey,Ide=qie,Fde=kre;var Ode=function(e,t,n){var r=t.find(function(t){return t.kind===Rde&&t.name===e.name&&t.alias===e.alias&&Ide(t.args,e.args)});r&&r.kind===Rde||Fde(!1);var i=Dde(e,n);return{kind:"ScalarField",alias:r.alias,name:i,storageKey:i,args:null}},Pde=(0,zre.default)(eie),Mde=$ue,Lde=Ede,zde=nue,jde=cse.isClientID,Ude=Tde,Bde=Ode,$de=jie.getLocalVariables,qde=Fle,Gde=Ole.EXISTENT,Vde=Ole.UNKNOWN,Kde=Pie,Wde=rce.TYPE_SCHEMA_TYPE,Hde=rce.generateTypeID,Jde=kre,Xde=Kde.getModuleOperationKey,Qde=Kde.getStorageKey,Yde=Kde.getArgumentValues;var Zde=function(){function e(e,t,n,r,i,o,s,a,l,c){this._getSourceForActor=e,this._getTargetForActor=t,this._getDataID=s,this._source=e(n),this._mutatorRecordSourceProxyCache=new Map;var u=this._getMutatorAndRecordProxyForActor(n),d=u[0],f=u[1];this._useExecTimeResolvers=null!=c&&c,this._mostRecentlyInvalidatedAt=null,this._handlers=i,this._mutator=d,this._operationLoader=null!=o?o:null,this._recordSourceProxy=f,this._recordWasMissing=!1,this._variables=r,this._shouldProcessClientComponents=a,this._log=l}var t=e.prototype;return t._getMutatorAndRecordProxyForActor=function(e){var t=this._mutatorRecordSourceProxyCache.get(e);if(null==t){var n=this._getTargetForActor(e),r=new Mde(this._getSourceForActor(e),n);t=[r,new Lde(r,this._getDataID,void 0,this._handlers,this._log)],this._mutatorRecordSourceProxyCache.set(e,t)}return t},t.check=function(e,t){return this._assignClientAbstractTypes(e),this._traverse(e,t),!0===this._recordWasMissing?{status:"missing",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}:{status:"available",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||Jde(!1),this._variables[e]},t._handleMissing=function(){this._recordWasMissing=!0},t._handleMissingScalarField=function(e,t){if("id"!==e.name||null!=e.alias||!jde(t)){var n,r=null!=e.args?Yde(e.args,this._variables):{},i=(0,Pde.default)(this._handlers);try{for(i.s();!(n=i.n()).done;){var o=n.value;if("scalar"===o.kind){var s=o.handle(e,this._recordSourceProxy.get(t),r,this._recordSourceProxy);if(void 0!==s)return s}}}catch(a){i.e(a)}finally{i.f()}this._handleMissing()}},t._handleMissingLinkField=function(e,t){var n,r=null!=e.args?Yde(e.args,this._variables):{},i=(0,Pde.default)(this._handlers);try{for(i.s();!(n=i.n()).done;){var o=n.value;if("linked"===o.kind){var s=o.handle(e,this._recordSourceProxy.get(t),r,this._recordSourceProxy);if(void 0!==s&&(null===s||this._mutator.getStatus(s)===Gde))return s}}}catch(a){i.e(a)}finally{i.f()}this._handleMissing()},t._handleMissingPluralLinkField=function(e,t){var n,r=this,i=null!=e.args?Yde(e.args,this._variables):{},o=(0,Pde.default)(this._handlers);try{for(o.s();!(n=o.n()).done;){var s=n.value;if("pluralLinked"===s.kind){var a=s.handle(e,this._recordSourceProxy.get(t),i,this._recordSourceProxy);if(null!=a){if(a.every(function(e){return null!=e&&r._mutator.getStatus(e)===Gde}))return a}else if(null===a)return null}}}catch(l){o.e(l)}finally{o.f()}this._handleMissing()},t._traverse=function(e,t){var n=this._mutator.getStatus(t);if(n===Vde&&this._handleMissing(),n===Gde){var r=this._source.get(t),i=qde.getInvalidationEpoch(r);null!=i&&(this._mostRecentlyInvalidatedAt=null!=this._mostRecentlyInvalidatedAt?Math.max(this._mostRecentlyInvalidatedAt,i):i),this._traverseSelections(e.selections,t)}},t._traverseSelections=function(e,t){var n=this;e.forEach(function(r){switch(r.kind){case"ScalarField":n._checkScalar(r,t);break;case"LinkedField":r.plural?n._checkPluralLink(r,t):n._checkLink(r,t);break;case"ActorChange":n._checkActorChange(r.linkedField,t);break;case"Condition":Boolean(n._getVariableValue(r.condition))===r.passingValue&&n._traverseSelections(r.selections,t);break;case"InlineFragment":var i=r.abstractKey;if(null==i){n._mutator.getType(t)===r.type&&n._traverseSelections(r.selections,t)}else{var o=n._mutator.getType(t);null==o&&Jde(!1);var s=Hde(o),a=n._mutator.getValue(s,i);!0===a?n._traverseSelections(r.selections,t):null==a&&n._handleMissing()}break;case"LinkedHandle":var l=Ude(r,e,n._variables);l.plural?n._checkPluralLink(l,t):n._checkLink(l,t);break;case"ScalarHandle":var c=Bde(r,e,n._variables);n._checkScalar(c,t);break;case"ModuleImport":n._checkModuleImport(r,t);break;case"Defer":case"Stream":n._traverseSelections(r.selections,t);break;case"FragmentSpread":var u=n._variables;n._variables=$de(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=u;break;case"ClientExtension":var d=n._recordWasMissing;n._traverseSelections(r.selections,t),n._recordWasMissing=d;break;case"TypeDiscriminator":var f=r.abstractKey,h=n._mutator.getType(t);null==h&&Jde(!1);var p=Hde(h);null==n._mutator.getValue(p,f)&&n._handleMissing();break;case"ClientComponent":if(!1===n._shouldProcessClientComponents)break;n._traverseSelections(r.fragment.selections,t);break;case"RelayResolver":case"RelayLiveResolver":n._useExecTimeResolvers||n._checkResolver(r,t);break;case"ClientEdgeToClientObject":n._useExecTimeResolvers||n._checkResolver(r.backingField,t);break;default:Jde(!1)}})},t._checkResolver=function(e,t){e.fragment&&this._traverseSelections([e.fragment],t)},t._checkModuleImport=function(e,t){var n=this._operationLoader;null===n&&Jde(!1);var r=Xde(e.documentName),i=this._mutator.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=zde(o),a=this._variables;this._variables=$de(this._variables,s.argumentDefinitions,e.args),this._traverse(s,t),this._variables=a}else this._handleMissing()}else void 0===i&&this._handleMissing()},t._checkScalar=function(e,t){var n=Qde(e,this._variables),r=this._mutator.getValue(t,n);void 0===r&&void 0!==(r=this._handleMissingScalarField(e,t))&&this._mutator.setValue(t,n,r)},t._checkLink=function(e,t){var n=Qde(e,this._variables),r=this._mutator.getLinkedRecordID(t,n);void 0===r&&(null!=(r=this._handleMissingLinkField(e,t))?this._mutator.setLinkedRecordID(t,n,r):null===r&&this._mutator.setValue(t,n,null)),null!=r&&this._traverse(e,r)},t._checkPluralLink=function(e,t){var n=this,r=Qde(e,this._variables),i=this._mutator.getLinkedRecordIDs(t,r);void 0===i&&(null!=(i=this._handleMissingPluralLinkField(e,t))?this._mutator.setLinkedRecordIDs(t,r,i):null===i&&this._mutator.setValue(t,r,null)),i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},t._checkActorChange=function(e,t){var n=Qde(e,this._variables),r=this._source.get(t),i=null!=r?qde.getActorLinkedRecordID(r,n):r;if(null==i)void 0===i&&this._handleMissing();else{var o=i[0],s=i[1],a=this._source,l=this._mutator,c=this._recordSourceProxy,u=this._getMutatorAndRecordProxyForActor(o),d=u[0],f=u[1];this._source=this._getSourceForActor(o),this._mutator=d,this._recordSourceProxy=f,this._assignClientAbstractTypes(e),this._traverse(e,s),this._source=a,this._mutator=l,this._recordSourceProxy=c}},t._assignClientAbstractTypes=function(e){var t=e.clientAbstractTypes;if(null!=t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],s=(0,Pde.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=Hde(a);null==this._source.get(l)&&this._mutator.create(l,Wde),null==this._mutator.getValue(l,o)&&this._mutator.setValue(l,o,!0)}}catch(c){s.e(c)}finally{s.f()}}},e}(),efe={check:function(e,t,n,r,i,o,s,a,l,c){null!=l&&l({name:"store.datachecker.start",selector:r});var u=r.dataID,d=r.node,f=r.variables,h=new Zde(e,t,n,f,i,o,s,a,l,c).check(d,u);return null!=l&&l({name:"store.datachecker.end",selector:r}),h}},tfe=Fle,nfe=Pie.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,rfe=kre;var ife=function(e){var t=tfe.getValue(e,nfe);return null==t?null:(t instanceof Set||rfe(!1),t)};var ofe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.read&&"function"==typeof e.subscribe},sfe=(0,zre.default)(eie),afe=Dae,lfe=Ere.RELAY_LIVE_RESOLVER,cfe=_ie,ufe=function(e){"object"!=typeof e||null==e||!Array.isArray(e)&&e.constructor!==Object||Object.freeze(e)},dfe=cse.generateClientID,ffe=cse.generateClientObjectClientID,hfe=Fle,pfe=coe.createNormalizationSelector,gfe=Ble,mfe=Rce.normalize,vfe=Pie,yfe=vfe.RELAY_RESOLVER_ERROR_KEY,_fe=vfe.RELAY_RESOLVER_INVALIDATION_KEY,bfe=vfe.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,xfe=vfe.RELAY_RESOLVER_SNAPSHOT_KEY,Sfe=vfe.RELAY_RESOLVER_VALUE_KEY,wfe=vfe.getReadTimeResolverStorageKey,Efe=vfe.getStorageKey,kfe=ife,Cfe=ofe,Afe=ale.isSuspenseSentinel,Nfe=kre,Tfe="__resolverLiveStateSubscription",Rfe="__resolverLiveStateValue",Dfe="__resolverLiveStateDirty",Ife="__RELAY_RESOLVER__";function Ffe(e,t,n){var r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}var Ofe=function(){function e(e,t){this._resolverIDToRecordIDs=new Map,this._recordIDToResolverIDs=new Map,this._getRecordSource=e,this._store=t,this._handlingBatch=!1,this._liveResolverBatchRecordSource=null}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){var o,s=this._getRecordSource(),a=Ufe(s,e),l=wfe(t,n),c=hfe.getLinkedRecordID(a,l),u=null==c?null:s.get(c);if(null==u||this._isInvalid(u,i)){var d;null!=u&&jfe(u),c=null!==(d=c)&&void 0!==d?d:dfe(e,l),u=hfe.create(c,Ife);var f=r();if(hfe.setValue(u,xfe,f.snapshot),hfe.setValue(u,yfe,f.error),t.kind===lfe){if(null!=f.resolverResult){null!=f.error&&Nfe(!1);var h=f.resolverResult;o=this._setLiveStateValue(u,c,h,t,n)}}else o=this._setResolverValue(u,f.resolverResult,t,n);s.set(c,u);var p=Ufe(s,e),g=hfe.clone(p);if(hfe.setLinkedRecordID(g,l,c),s.set(e,g),null!=t.fragment){var m,v=Efe(t.fragment,n),y=dfe(e,v);Ffe(this._resolverIDToRecordIDs,y,c),Ffe(this._recordIDToResolverIDs,e,y);var _=null===(m=f.snapshot)||void 0===m?void 0:m.seenRecords;if(null!=_){var b,x=(0,sfe.default)(_);try{for(x.s();!(b=x.n()).done;){var S=b.value;Ffe(this._recordIDToResolverIDs,S,y)}}catch(R){x.e(R)}finally{x.f()}}}}else if(t.kind===lfe&&hfe.getValue(u,Dfe)){var w;c=null!==(w=c)&&void 0!==w?w:dfe(e,l),u=hfe.clone(u);var E=hfe.getValue(u,Rfe);Cfe(E)||Nfe(!1),o=this._setLiveResolverValue(u,E,t,n),hfe.setValue(u,Dfe,!1),s.set(c,u)}var k,C=this._getResolverValue(u),A=hfe.getValue(u,xfe),N=hfe.getValue(u,yfe),T=null;Afe(C)&&(T=null!==(k=c)&&void 0!==k?k:dfe(e,l));return[C,c,N,A,T,o]},t.getLiveResolverPromise=function(e){var t=this._getRecordSource().get(e);null==t&&Nfe(!1);var n=hfe.getValue(t,Rfe);return new Promise(function(e){var t=n.subscribe(function(){t(),e()})})},t._setLiveStateValue=function(e,t,n,r,i){var o=this._makeLiveStateHandler(t),s=n.subscribe(o);hfe.setValue(e,Rfe,n);var a=this._setLiveResolverValue(e,n,r,i);return hfe.setValue(e,Dfe,!1),hfe.setValue(e,Tfe,s),a},t._makeLiveStateHandler=function(e){var t=this;return function(){var n=t._getRecordSource().get(e);if(n&&hfe.hasValue(n,Rfe)){var r=hfe.clone(n);hfe.setValue(r,Dfe,!0),t._setLiveResolverUpdate(e,r)}}},t._setLiveResolverUpdate=function(e,t){if(this._handlingBatch)null==this._liveResolverBatchRecordSource&&(this._liveResolverBatchRecordSource=gfe.create()),this._liveResolverBatchRecordSource.set(e,t);else{var n=gfe.create();n.set(e,t),this._store.publish(n),this._store.notify()}},t.batchLiveStateUpdates=function(e){this._handlingBatch&&Nfe(!1),this._handlingBatch=!0;try{e()}finally{null!=this._liveResolverBatchRecordSource&&(this._store.publish(this._liveResolverBatchRecordSource),this._store.notify()),this._liveResolverBatchRecordSource=null,this._handlingBatch=!1}},t._setLiveResolverValue=function(e,t,n,r){var i=null,o=null;try{i=t.read()}catch(bU){o=bU}return hfe.setValue(e,yfe,o),this._setResolverValue(e,i,n,r)},t._setResolverValue=function(e,t,n,r){var i=n.normalizationInfo,o=null;if(null==t||null==i||Afe(t))ufe(t),hfe.setValue(e,Sfe,t);else{var s,a=kfe(e),l=new Set,c=this._getRecordSource();if(i.plural){Array.isArray(t)||Nfe(!1),s=[];for(var u=gfe.create(),d=0;d<t.length;d++){var f=t[d];if(null!=f){"object"!=typeof f&&Nfe(!1);var h,p=Bfe(i,f),g=ffe(p,hfe.getDataID(e),d),m=this._normalizeOutputTypeValue(g,f,r,i,[n.path,String(d)],p),v=(0,sfe.default)(m.getRecordIDs());try{for(v.s();!(h=v.n()).done;){var y=h.value;u.set(y,Ufe(m,y)),l.add(y)}}catch(k){v.e(k)}finally{v.f()}s.push(g)}}o=Pfe(c,u,a)}else{"object"!=typeof t&&Nfe(!1);var _,b=Bfe(i,t),x=ffe(b,hfe.getDataID(e)),S=this._normalizeOutputTypeValue(x,t,r,i,[n.path],b),w=(0,sfe.default)(S.getRecordIDs());try{for(w.s();!(_=w.n()).done;){var E=_.value;l.add(E)}}catch(k){w.e(k)}finally{w.f()}s=x,o=Pfe(c,S,a)}hfe.setValue(e,bfe,l),ufe(s),hfe.setValue(e,Sfe,s)}return o},t.notifyUpdatedSubscribers=function(e){this._store.__notifyUpdatedSubscribers(e)},t._getResolverValue=function(e){return hfe.getValue(e,Sfe)},t.invalidateDataIDs=function(e){for(var t=this._getRecordSource(),n=new Set,r=Array.from(e);r.length;){var i=r.pop();n.add(i),e.add(i);var o=this._recordIDToResolverIDs.get(i);if(null!=o){var s,a=(0,sfe.default)(o);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(!n.has(l)){n.add(l);var c=this._resolverIDToRecordIDs.get(l);if(null==c)continue;var u,d=(0,sfe.default)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;Mfe(f,t),n.has(f)||(n.add(f),r.push(f))}}catch(h){d.e(h)}finally{d.f()}}}}catch(h){a.e(h)}finally{a.f()}}}},t._isInvalid=function(e,t){if(!hfe.getValue(e,_fe))return!1;var n=hfe.getValue(e,xfe),r=null==n?void 0:n.data,i=null==n?void 0:n.selector;if(null==r||null==i)return!0;var o=t(i).data;if(afe(r,o)!==r)return!0;if(cfe.MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD){var s=hfe.clone(e);hfe.setValue(s,_fe,!1),this._getRecordSource().set(hfe.getDataID(e),s)}return!1},t._normalizeOutputTypeValue=function(e,t,n,r,i,o){var s=gfe.create();switch(r.kind){case"OutputType":var a=hfe.create(e,o);s.set(e,a);var l=pfe(r.normalizationNode,e,n),c=this._store.__getNormalizationOptions(i);return mfe(s,l,t,c,void 0,!1).source;case"WeakModel":var u=hfe.create(e,o);return hfe.setValue(u,"__relay_model_instance",t),s.set(e,u),s;default:r.kind,Nfe(!1)}},t.ensureClientRecord=function(e,t){var n=ffe(t,e),r=this._getRecordSource();if(!r.has(n)){var i=hfe.create(n,t);hfe.setValue(i,"id",e),r.set(n,i)}return n},t.unsubscribeFromLiveResolverRecords=function(e){return function(e,t){if(0===t.size)return;var n,r=(0,sfe.default)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e.get(i);null!=o&&zfe(o)&&jfe(o)}}catch(s){r.e(s)}finally{r.f()}}(this._getRecordSource(),e)},t.invalidateResolverRecords=function(e){if(0!==e.size){var t,n=(0,sfe.default)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this._getRecordSource().get(r);null!=i&&zfe(i)&&this._getRecordSource().delete(r)}}catch(o){n.e(o)}finally{n.f()}}},e}();function Pfe(e,t,n){var r=new Set;if(null!=n){var i,o=(0,sfe.default)(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;t.has(s)||(r.add(s),e.remove(s))}}catch(h){o.e(h)}finally{o.f()}}var a,l=(0,sfe.default)(t.getRecordIDs());try{for(l.s();!(a=l.n()).done;){var c=a.value,u=Ufe(t,c);if(e.has(c)){var d=Ufe(e,c),f=hfe.update(d,u);f!==d&&(r.add(c),e.set(c,f),Lfe(d,e))}else e.set(c,u)}}catch(h){l.e(h)}finally{l.f()}return r}function Mfe(e,t){var n=t.get(e);if(n){var r=hfe.clone(n);hfe.setValue(r,_fe,!0),t.set(e,r)}}function Lfe(e,t){var n,r=function(e){var t=new Set;return hfe.getFields(e).forEach(function(n){if(hfe.hasLinkedRecordID(e,n)){var r=hfe.getLinkedRecordID(e,n);null!=r&&t.add(r)}else if(hfe.hasLinkedRecordIDs(e,n)){var i;null===(i=hfe.getLinkedRecordIDs(e,n))||void 0===i||i.forEach(function(e){null!=e&&t.add(e)})}}),t}(e),i=(0,sfe.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=t.get(o);null!=s&&zfe(s)&&Mfe(o,t)}}catch(a){i.e(a)}finally{i.f()}}function zfe(e){return hfe.getType(e)===Ife}function jfe(e){var t=hfe.getValue(e,Tfe);null!=t&&t()}function Ufe(e,t){var n=e.get(t);return null==n&&Nfe(!1),n}function Bfe(e,t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;return null==r&&Nfe(!1),r}var $fe={LiveResolverCache:Ofe,getUpdatedDataIDs:function(e){return e},RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY:Tfe},qfe=(0,zre.default)(Hre),Gfe=Fle,Vfe=Ble,Kfe=kre,Wfe=Gfe.fromObject(Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0})),Hfe=function(){function e(e){this._base=e,this._sink=Vfe.create()}var t=e.prototype;return t.has=function(e){return this._sink.has(e)?this._sink.get(e)!==Wfe:this._base.has(e)},t.get=function(e){if(this._sink.has(e)){var t=this._sink.get(e);return t===Wfe?void 0:t}return this._base.get(e)},t.getStatus=function(e){var t=this.get(e);return void 0===t?"UNKNOWN":null===t?"NONEXISTENT":"EXISTENT"},t.clear=function(){this._base=Vfe.create(),this._sink.clear()},t.delete=function(e){this._sink.delete(e)},t.remove=function(e){this._sink.set(e,Wfe)},t.set=function(e,t){this._sink.set(e,t)},t.getRecordIDs=function(){return Object.keys(this.toJSON())},t.size=function(){return Object.keys(this.toJSON()).length},t.toJSON=function(){var e=this,t=(0,qfe.default)({},this._base.toJSON());return this._sink.getRecordIDs().forEach(function(n){var r=e.get(n);void 0===r?delete t[n]:t[n]=Gfe.toJSON(r)}),t},t.getOptimisticRecordIDs=function(){return new Set(this._sink.getRecordIDs())},e}();var Jfe={create:function(e){return new Hfe(e)},getOptimisticRecordIDs:function(e){return e instanceof Hfe||Kfe(!1),e.getOptimisticRecordIDs()}},Xfe=Ere.RELAY_LIVE_RESOLVER,Qfe=kre,Yfe=function(){function e(){}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){t.kind===Xfe&&Qfe(!1);var o=r(),s=o.resolverResult,a=o.snapshot;return[s,void 0,o.error,a,void 0,void 0]},t.invalidateDataIDs=function(e){},t.ensureClientRecord=function(e,t){Qfe(!1)},t.notifyUpdatedSubscribers=function(e){},e}(),Zfe={NoopResolverCache:Yfe},ehe=zre.default,the=ehe(Hre),nhe=ehe(Wre),rhe=ehe(cle),ihe=ehe(pie),ohe=["message"],she=_ie,ahe=ale.isSuspenseSentinel,lhe=jie,che=Fle,uhe=Pie,dhe=uhe.CLIENT_EDGE_TRAVERSAL_PATH,fhe=uhe.FRAGMENT_OWNER_KEY,hhe=uhe.FRAGMENT_PROP_NAME_KEY,phe=uhe.FRAGMENTS_KEY,ghe=uhe.ID_KEY,mhe=uhe.MODULE_COMPONENT_KEY,vhe=uhe.ROOT_ID,yhe=uhe.getArgumentValues,_he=uhe.getModuleComponentKey,bhe=uhe.getStorageKey,xhe=Zfe.NoopResolverCache,She=moe.RESOLVER_FRAGMENT_ERRORED_SENTINEL,whe=moe.withResolverContext,Ehe=rce.generateTypeID,khe=kre;function Che(e,t,n,r){return new Ahe(e,t,null!=n?n:new xhe,r).read()}var Ahe=function(){function e(e,t,n,r){var i,o,s,a;this._clientEdgeTraversalPath=null!==(i=t.clientEdgeTraversalPath)&&void 0!==i&&i.length?(0,ihe.default)(t.clientEdgeTraversalPath):[],this._missingClientEdges=[],this._missingLiveResolverFields=[],this._isMissingData=!1,this._isWithinUnmatchedTypeRefinement=!1,this._fieldErrors=null,this._owner=t.owner,this._useExecTimeResolvers=null!==(o=null!==(s=this._owner.node.operation.use_exec_time_resolvers)&&void 0!==s?s:!0===(null===(a=this._owner.node.operation.exec_time_resolvers_enabled_provider)||void 0===a?void 0:a.get()))&&void 0!==o&&o,this._recordSource=e,this._seenRecords=new Set,this._selector=t,this._variables=t.variables,this._resolverCache=n,this._fragmentName=t.node.name,this._updatedDataIDs=new Set,this._resolverContext=r}var t=e.prototype;return t.read=function(){var e,t=this._selector,n=t.node,r=t.dataID,i=t.isWithinUnmatchedTypeRefinement,o=n.abstractKey,s=this._recordSource.get(r),a=!i;(a&&null==o&&null!=s&&(this._recordMatchesTypeCondition(s,n.type)||(a=!1)),a&&null!=o&&null!=s)&&(!1===this._implementsInterface(s,o)&&(a=!1));this._isWithinUnmatchedTypeRefinement=!a;var l=this._traverse(n,r,null),c=null===(e=this._selector.node.metadata)||void 0===e?void 0:e.catchTo;return null!=c&&(l=this._catchErrors(l,c,null)),this._updatedDataIDs.size>0&&(this._resolverCache.notifyUpdatedSubscribers(this._updatedDataIDs),this._updatedDataIDs.clear()),{data:l,isMissingData:this._isMissingData&&a,missingClientEdges:this._missingClientEdges.length?this._missingClientEdges:null,missingLiveResolverFields:this._missingLiveResolverFields,seenRecords:this._seenRecords,selector:this._selector,fieldErrors:this._fieldErrors}},t._maybeAddFieldErrors=function(e,t){var n=che.getErrors(e,t);if(null!=n){var r=this._fragmentName;null==this._fieldErrors&&(this._fieldErrors=[]);for(var i=0;i<n.length;i++){var o,s,a,l=n[i];this._fieldErrors.push({kind:"relay_field_payload.error",owner:r,fieldPath:(null!==(o=l.path)&&void 0!==o?o:[]).join("."),error:l,shouldThrow:null!==(s=null===(a=this._selector.node.metadata)||void 0===a?void 0:a.throwOnFieldError)&&void 0!==s&&s,handled:!1,uiContext:void 0})}}},t._markDataAsMissing=function(e){var t,n;if(!this._isWithinUnmatchedTypeRefinement){null==this._fieldErrors&&(this._fieldErrors=[]);var r=this._fragmentName;if(this._fieldErrors.push(null!==(t=null===(n=this._selector.node.metadata)||void 0===n?void 0:n.throwOnFieldError)&&void 0!==t&&t?{kind:"missing_expected_data.throw",owner:r,fieldPath:e,handled:!1,uiContext:void 0}:{kind:"missing_expected_data.log",owner:r,fieldPath:e,uiContext:void 0}),this._isMissingData=!0,this._clientEdgeTraversalPath.length){var i=this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1];null!==i&&this._missingClientEdges.push({request:i.readerClientEdge.operation,clientEdgeDestinationID:i.clientEdgeDestinationID})}}},t._traverse=function(e,t,n){var r=this._recordSource.get(t);if(this._seenRecords.add(t),null==r)return void 0===r&&this._markDataAsMissing("<record>"),r;var i=n||{};return this._traverseSelections(e.selections,r,i)?i:null},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||khe(!1),this._variables[e]},t._maybeReportUnexpectedNull=function(e){if("NONE"!==e.action){var t,n,r,i=this._fragmentName;if(null==this._fieldErrors&&(this._fieldErrors=[]),null!=e.field.linkedField)t=null!==(n=e.field.linkedField.alias)&&void 0!==n?n:e.field.linkedField.name;else t=null!==(r=e.field.alias)&&void 0!==r?r:e.field.name;switch(e.action){case"THROW":return void this._fieldErrors.push({kind:"missing_required_field.throw",fieldPath:t,owner:i,handled:!1,uiContext:void 0});case"LOG":return void this._fieldErrors.push({kind:"missing_required_field.log",fieldPath:t,owner:i,uiContext:void 0});default:e.action}}},t._handleRequiredFieldValue=function(e,t){return null!=t||(this._maybeReportUnexpectedNull(e),!1)},t._catchErrors=function(e,t,n){var r=e;switch(t){case"RESULT":r=this._asResult(e);break;case"NULL":null!=this._fieldErrors&&this._fieldErrors.length>0&&(r=null)}var i=this._fieldErrors;if(this._fieldErrors=n,null!=i){null==this._fieldErrors&&(this._fieldErrors=[]);for(var o=0;o<i.length;o++)this._fieldErrors.push(Nhe(i[o]))}return r},t._asResult=function(e){if(null==this._fieldErrors||0===this._fieldErrors.length)return{ok:!0,value:e};var t=this._fieldErrors.map(function(e){switch(e.kind){case"relay_field_payload.error":var t=e.error;return t.message,(0,rhe.default)(t,ohe);case"missing_expected_data.throw":case"missing_expected_data.log":return{path:e.fieldPath.split(".")};case"relay_resolver.error":return{message:"Relay: Error in resolver for field at ".concat(e.fieldPath," in ").concat(e.owner)};case"missing_required_field.throw":return{message:"Relay: Missing @required value at path '".concat(e.fieldPath,"' in '").concat(e.owner,"'.")};case"missing_required_field.log":return null;default:e.kind,khe(!1)}}).filter(Boolean);return{ok:!1,errors:t}},t._traverseSelections=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];switch(i.kind){case"RequiredField":var o=this._readClientSideDirectiveField(i,t,n);if(!this._handleRequiredFieldValue(i,o))return!1;break;case"CatchField":var s,a,l,c=this._fieldErrors;this._fieldErrors=null;var u=this._readClientSideDirectiveField(i,t,n),d=null!==(s=null===(a=i.field)||void 0===a?void 0:a.backingField)&&void 0!==s?s:i.field,f=null!==(l=null==d?void 0:d.alias)&&void 0!==l?l:null==d?void 0:d.name;null==f&&khe(!1),n[f]=this._catchErrors(u,i.to,c);break;case"ScalarField":this._readScalar(i,t,n);break;case"LinkedField":i.plural?this._readPluralLink(i,t,n):this._readLink(i,t,n);break;case"Condition":if(Boolean(this._getVariableValue(i.condition))===i.passingValue)if(!this._traverseSelections(i.selections,t,n))return!1;break;case"InlineFragment":if(!1===this._readInlineFragment(i,t,n,!1))return!1;break;case"RelayLiveResolver":case"RelayResolver":this._useExecTimeResolvers?this._readScalar(i,t,n):this._readResolverField(i,t,n);break;case"FragmentSpread":this._createFragmentPointer(i,t,n);break;case"AliasedInlineFragmentSpread":this._readAliasedInlineFragment(i,t,n);break;case"ModuleImport":this._readModuleImport(i,t,n);break;case"InlineDataFragmentSpread":this._createInlineDataOrResolverFragmentPointer(i,t,n);break;case"Defer":case"ClientExtension":var h=this._isMissingData,p=this._missingClientEdges.length;this._clientEdgeTraversalPath.push(null);var g=this._traverseSelections(i.selections,t,n);if(this._isMissingData=h||this._missingClientEdges.length>p||this._missingLiveResolverFields.length>0,this._clientEdgeTraversalPath.pop(),!g)return!1;break;case"Stream":if(!this._traverseSelections(i.selections,t,n))return!1;break;case"ActorChange":this._readActorChange(i,t,n);break;case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(!this._useExecTimeResolvers||"RelayResolver"!==i.backingField.kind&&"RelayLiveResolver"!==i.backingField.kind)this._readClientEdge(i,t,n);else{var m=i.linkedField;m.plural?this._readPluralLink(m,t,n):this._readLink(m,t,n)}break;default:khe(!1)}}return!0},t._readClientSideDirectiveField=function(e,t,n){switch(e.field.kind){case"ScalarField":return this._readScalar(e.field,t,n);case"LinkedField":return e.field.plural?this._readPluralLink(e.field,t,n):this._readLink(e.field,t,n);case"RelayResolver":case"RelayLiveResolver":return this._useExecTimeResolvers?this._readScalar(e.field,t,n):this._readResolverField(e.field,t,n);case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(!this._useExecTimeResolvers||"RelayResolver"!==e.field.backingField.kind&&"RelayLiveResolver"!==e.field.backingField.kind)return this._readClientEdge(e.field,t,n);var r=e.field;return r.linkedField.plural?this._readPluralLink(r.linkedField,t,n):this._readLink(r.linkedField,t,n);case"AliasedInlineFragmentSpread":return this._readAliasedInlineFragment(e.field,t,n);default:e.field.kind,khe(!1)}},t._readResolverField=function(e,t,n){var r,i=che.getDataID(t),o=this._fieldErrors;this._fieldErrors=null;var s=this._readResolverFieldImpl(e,i),a=null!==(r=e.alias)&&void 0!==r?r:e.name;return this._prependPreviousErrors(o,a),n[a]=s,s},t._readResolverFieldImpl=function(e,t){var n,r=this,i=e.fragment,o=function(e){return null!=n?{data:n.data,isMissingData:n.isMissingData,fieldErrors:n.fieldErrors}:{data:(n=Che(r._recordSource,e,r._resolverCache)).data,isMissingData:n.isMissingData,fieldErrors:n.fieldErrors}},s=this._resolverCache.readFromCacheOrEvaluate(t,e,this._variables,function(){if(null!=i){var s={__id:t,__fragmentOwner:r._owner,__fragments:(0,nhe.default)({},i.name,i.args?yhe(i.args,r._variables):{})};return r._clientEdgeTraversalPath.length>0&&null!==r._clientEdgeTraversalPath[r._clientEdgeTraversalPath.length-1]&&(s[dhe]=(0,ihe.default)(r._clientEdgeTraversalPath)),whe({getDataForResolverFragment:o},function(){var t=The(e,r._variables,s,r._resolverContext),i=t[0],o=t[1];return{resolverResult:i,snapshot:n,error:o}})}var a=The(e,r._variables,null,r._resolverContext);return{resolverResult:a[0],snapshot:void 0,error:a[1]}},o),a=s[0],l=s[1],c=s[2],u=s[3],d=s[4],f=s[5];return this._propagateResolverMetadata(e.path,u,c,l,d,f),a},t._propagateResolverMetadata=function(e,t,n,r,i,o){var s=this;if(null!=t){if(null!=t.missingClientEdges)for(var a=0;a<t.missingClientEdges.length;a++){var l=t.missingClientEdges[a];this._missingClientEdges.push(l)}if(null!=t.missingLiveResolverFields){this._isMissingData=this._isMissingData||t.missingLiveResolverFields.length>0;for(var c=0;c<t.missingLiveResolverFields.length;c++){var u=t.missingLiveResolverFields[c];this._missingLiveResolverFields.push(u)}}if(null!=t.fieldErrors){null==this._fieldErrors&&(this._fieldErrors=[]);for(var d=0;d<t.fieldErrors.length;d++){var f,h=t.fieldErrors[d];!0===(null===(f=this._selector.node.metadata)||void 0===f?void 0:f.throwOnFieldError)?this._fieldErrors.push(h):this._fieldErrors.push(Nhe(h))}}this._isMissingData=this._isMissingData||t.isMissingData}if(n){var p,g,m={kind:"relay_resolver.error",fieldPath:e,owner:this._fragmentName,error:n,shouldThrow:null!==(p=null===(g=this._selector.node.metadata)||void 0===g?void 0:g.throwOnFieldError)&&void 0!==p&&p,handled:!1,uiContext:void 0};null==this._fieldErrors?this._fieldErrors=[m]:this._fieldErrors.push(m)}null!=r&&this._seenRecords.add(r),null!=i&&(this._isMissingData=!0,this._missingLiveResolverFields.push(i)),null!=o&&o.forEach(function(e){s._updatedDataIDs.add(e)})},t._readClientEdge=function(e,t,n){var r,i=this,o=e.backingField;"ClientExtension"===o.kind&&khe(!1);var s=null!==(r=o.alias)&&void 0!==r?r:o.name,a={};this._traverseSelections([o],t,a);var l=a[s];if(null==l||ahe(l))return n[s]=l,l;if(e.linkedField.plural){var c;Array.isArray(l)||khe(!1),"ClientEdgeToClientObject"!==e.kind&&khe(!1),c=null==e.backingField.normalizationInfo?l.map(function(t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;"string"!=typeof r&&khe(!1);var s=Rhe(t,o.path,i._owner.identifier),a=i._resolverCache.ensureClientRecord(s,r),l=e.modelResolvers;if(null!=l){var c=l[r];return void 0===c&&khe(!1),null!=i._readResolverFieldImpl(c,a)?a:null}return a}):l.map(function(e){return Rhe(e,o.path,i._owner.identifier)}),this._clientEdgeTraversalPath.push(null);var u=this._readLinkedIds(e.linkedField,c,t,n);return this._clientEdgeTraversalPath.pop(),n[s]=u,u}var d,f,h,p=Rhe(l,o.path,this._owner.identifier),g=null!==(d=e.concreteType)&&void 0!==d?d:l.__typename;"ClientEdgeToClientObject"===e.kind?null==e.backingField.normalizationInfo?("string"!=typeof g&&khe(!1),f=this._resolverCache.ensureClientRecord(p,g),h=null):(f=p,h=null):(f=p,h={readerClientEdge:e,clientEdgeDestinationID:p});var m=e.modelResolvers;if(null!=m){"string"!=typeof g&&khe(!1);var v=m[g];if(void 0===v&&khe(!1),null==this._readResolverFieldImpl(v,f))return n[s]=null,null}this._clientEdgeTraversalPath.push(h);var y=n[s];null!=y&&"object"!=typeof y&&khe(!1);var _=this._fieldErrors;this._fieldErrors=null;var b=this._traverse(e.linkedField,f,y);return this._prependPreviousErrors(_,s),this._clientEdgeTraversalPath.pop(),n[s]=b,b},t._readScalar=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=bhe(e,this._variables),s=che.getValue(t,o);return null===s||she.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(s)&&0===s.length?this._maybeAddFieldErrors(t,o):void 0===s&&this._markDataAsMissing(i),n[i]=s,s},t._readLink=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=bhe(e,this._variables),s=che.getLinkedRecordID(t,o);if(null==s)return n[i]=s,null===s?this._maybeAddFieldErrors(t,o):void 0===s&&this._markDataAsMissing(i),s;var a=n[i];null!=a&&"object"!=typeof a&&khe(!1);var l=this._fieldErrors;this._fieldErrors=null;var c=this._traverse(e,s,a);return this._prependPreviousErrors(l,i),n[i]=c,c},t._prependPreviousErrors=function(e,t){if(null!=this._fieldErrors){for(var n=0;n<this._fieldErrors.length;n++){var r=this._fieldErrors[n];r.owner!==this._fragmentName||"missing_expected_data.throw"!==r.kind&&"missing_expected_data.log"!==r.kind&&"missing_required_field.throw"!==r.kind&&"missing_required_field.log"!==r.kind||(r.fieldPath="".concat(t,".").concat(r.fieldPath))}if(null!=e){for(var i=this._fieldErrors.length-1;i>=0;i--)e.push(this._fieldErrors[i]);this._fieldErrors=e}}else this._fieldErrors=e},t._readActorChange=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=bhe(e,this._variables),s=che.getActorLinkedRecordID(t,o);if(null==s)return n[i]=s,void 0===s?this._markDataAsMissing(i):null===s&&this._maybeAddFieldErrors(t,o),n[i];var a=s[0],l=s[1],c={};return this._createFragmentPointer(e.fragmentSpread,che.fromObject({__id:l}),c),n[i]={__fragmentRef:c,__viewer:a},n[i]},t._readPluralLink=function(e,t,n){var r=bhe(e,this._variables),i=che.getLinkedRecordIDs(t,r);return(null===i||she.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(i)&&0===i.length)&&this._maybeAddFieldErrors(t,r),this._readLinkedIds(e,i,t,n)},t._readLinkedIds=function(e,t,n,r){var i,o=this,s=null!==(i=e.alias)&&void 0!==i?i:e.name;if(null==t)return r[s]=t,void 0===t&&this._markDataAsMissing(s),t;var a=r[s];null==a||Array.isArray(a)||khe(!1);var l=this._fieldErrors;this._fieldErrors=null;var c=a||[];return t.forEach(function(t,n){if(null==t)return void 0===t&&o._markDataAsMissing(String(n)),void(c[n]=t);var r=c[n];null!=r&&"object"!=typeof r&&khe(!1);var i=o._fieldErrors;o._fieldErrors=null,c[n]=o._traverse(e,t,r),o._prependPreviousErrors(i,n)}),this._prependPreviousErrors(l,s),r[s]=c,c},t._readModuleImport=function(e,t,n){var r=_he(e.documentName),i=che.getValue(t,r),o=void 0!==i?i:e.componentModuleProvider;null!=o?(this._createFragmentPointer({kind:"FragmentSpread",name:e.fragmentName,args:e.args},t,n),n[hhe]=e.fragmentPropName,n[mhe]=o):void 0===o&&this._markDataAsMissing("<module-import>")},t._readAliasedInlineFragment=function(e,t,n){var r=this._fieldErrors;this._fieldErrors=null;var i=this._readInlineFragment(e.fragment,t,{},!0);this._prependPreviousErrors(r,e.name),!1===i&&(i=null),n[e.name]=i},t._readInlineFragment=function(e,t,n,r){if(null==e.type)return!1!==this._traverseSelections(e.selections,t,n)&&n;var i=e.abstractKey;if(null==i){if(!this._recordMatchesTypeCondition(t,e.type))return null;if(!this._traverseSelections(e.selections,t,n))return!1}else{var o=this._implementsInterface(t,i);if(!1===o&&r)return null;var s=this._isMissingData,a=this._isWithinUnmatchedTypeRefinement;this._isWithinUnmatchedTypeRefinement=a||!1===o;var l=this._traverseSelections(e.selections,t,n);if(this._isWithinUnmatchedTypeRefinement=a,!1===o)return this._isMissingData=s,null;if(null==o)return;if(!1===l)return!1}return n},t._recordMatchesTypeCondition=function(e,t){var n=che.getType(e);return null!=n&&n===t||che.getDataID(e)===vhe},t._createFragmentPointer=function(e,t,n){var r=n[phe];null==r&&(r=n[phe]={}),("object"!=typeof r||null==r)&&khe(!1),null==n[ghe]&&(n[ghe]=che.getDataID(t)),r[e.name]=yhe(e.args,this._variables,this._isWithinUnmatchedTypeRefinement),n[fhe]=this._owner,this._clientEdgeTraversalPath.length>0&&null!==this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1]&&(n[dhe]=(0,ihe.default)(this._clientEdgeTraversalPath))},t._createInlineDataOrResolverFragmentPointer=function(e,t,n){var r=n[phe];null==r&&(r=n[phe]={}),("object"!=typeof r||null==r)&&khe(!1),null==n[ghe]&&(n[ghe]=che.getDataID(t));var i={},o=this._fragmentName;this._fragmentName=e.name;var s=this._variables,a=e.args?yhe(e.args,this._variables):{};this._variables=lhe.getFragmentVariables(e,this._owner.variables,a),this._traverseSelections(e.selections,t,i),this._variables=s,this._fragmentName=o,r[e.name]=i},t._implementsInterface=function(e,t){var n=che.getType(e),r=this._recordSource.get(Ehe(n)),i=null!=r?che.getValue(r,t):null;return null==i&&this._markDataAsMissing("<abstract-type-hint>"),i},e}();function Nhe(e){switch(e.kind){case"missing_expected_data.throw":case"missing_required_field.throw":case"relay_field_payload.error":case"relay_resolver.error":return(0,the.default)((0,the.default)({},e),{},{handled:!0});case"missing_expected_data.log":case"missing_required_field.log":return e;default:e.kind,khe(!1)}}function The(e,t,n,r){var i="function"==typeof e.resolverModule?e.resolverModule:e.resolverModule.default,o=null,s=null;try{var a=[];null!=e.fragment&&a.push(n);var l=e.args?yhe(e.args,t):void 0;a.push(l),a.push(r),o=i.apply(null,a)}catch(bU){o=null,bU!==She&&(s=bU)}return[o,s]}function Rhe(e,t,n){return"string"==typeof e?e:"object"==typeof e&&null!=e&&"string"==typeof e.id?e.id:void khe(!1)}var Dhe={read:Che},Ihe=(0,zre.default)(eie),Fhe=nue,Ohe=Tde,Phe=ife,Mhe=jie.getLocalVariables,Lhe=Fle,zhe=Pie,jhe=rce.generateTypeID,Uhe=kre,Bhe=zhe.getReadTimeResolverStorageKey,$he=zhe.getStorageKey,qhe=zhe.getModuleOperationKey;var Ghe=function(){function e(e,t,n,r,i,o){this._operationLoader=null!=r?r:null,this._operationName=null,this._useExecTimeResolvers=null!=o&&o,this._recordSource=e,this._references=n,this._variables=t,this._shouldProcessClientComponents=i}var t=e.prototype;return t.mark=function(e,t){"Operation"!==e.kind&&"SplitOperation"!==e.kind||(this._operationName=e.name),this._traverse(e,t)},t._traverse=function(e,t){this._references.add(t);var n=this._recordSource.get(t);null!=n&&this._traverseSelections(e.selections,n)},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||Uhe(!1),this._variables[e]},t._traverseSelections=function(e,t){var n=this;e.forEach(function(r){switch(r.kind){case"ActorChange":n._traverseLink(r.linkedField,t);break;case"LinkedField":r.plural?n._traversePluralLink(r,t):n._traverseLink(r,t);break;case"Condition":Boolean(n._getVariableValue(r.condition))===r.passingValue&&n._traverseSelections(r.selections,t);break;case"InlineFragment":if(null==r.abstractKey){var i=Lhe.getType(t);(null!=i&&i===r.type||i===zhe.ROOT_TYPE)&&n._traverseSelections(r.selections,t)}else{var o=Lhe.getType(t),s=jhe(o);n._references.add(s),n._traverseSelections(r.selections,t)}break;case"FragmentSpread":var a=n._variables;n._variables=Mhe(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=a;break;case"LinkedHandle":var l=Ohe(r,e,n._variables);l.plural?n._traversePluralLink(l,t):n._traverseLink(l,t);break;case"Defer":case"Stream":case"ClientExtension":n._traverseSelections(r.selections,t);break;case"ScalarField":case"ScalarHandle":break;case"TypeDiscriminator":var c=Lhe.getType(t),u=jhe(c);n._references.add(u);break;case"ModuleImport":n._traverseModuleImport(r,t);break;case"ClientComponent":if(!1===n._shouldProcessClientComponents)break;n._traverseSelections(r.fragment.selections,t);break;case"RelayResolver":case"RelayLiveResolver":n._traverseResolverField(r,t);break;case"ClientEdgeToClientObject":n._traverseClientEdgeToClientObject(r,t);break;default:Uhe(!1)}})},t._traverseClientEdgeToClientObject=function(e,t){if(this._useExecTimeResolvers)this._traverseLink(e.linkedField,t);else{var n=this._traverseResolverField(e.backingField,t);if(null!=n){var r=this._recordSource.get(n);if(null!=r)if(e.backingField.isOutputType){var i=Phe(r);if(null!=i){var o,s=(0,Ihe.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;this._references.add(a)}}catch(g){s.e(g)}finally{s.f()}}}else{var l=e.linkedField,c=l.concreteType;if(null==c)return;if(l.plural){var u=Lhe.getResolverLinkedRecordIDs(r,c);if(null!=u){var d,f=(0,Ihe.default)(u);try{for(f.s();!(d=f.n()).done;){var h=d.value;null!=h&&this._traverse(l,h)}}catch(g){f.e(g)}finally{f.f()}}}else{var p=Lhe.getResolverLinkedRecordID(r,c);null!=p&&this._traverse(l,p)}}}}},t._traverseResolverField=function(e,t){if(!this._useExecTimeResolvers){var n=Bhe(e,this._variables),r=Lhe.getLinkedRecordID(t,n);null!=r&&this._references.add(r);var i=e.fragment;return null!=i&&this._traverseSelections([i],t),r}},t._traverseModuleImport=function(e,t){var n=this._operationLoader;null===n&&Uhe(!1);var r=qhe(e.documentName),i=Lhe.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=Fhe(o),a=this._variables;this._variables=Mhe(this._variables,s.argumentDefinitions,e.args),this._traverseSelections(s.selections,t),this._variables=a}}},t._traverseLink=function(e,t){var n=$he(e,this._variables),r=Lhe.getLinkedRecordID(t,n);null!=r&&this._traverse(e,r)},t._traversePluralLink=function(e,t){var n=this,r=$he(e,this._variables),i=Lhe.getLinkedRecordIDs(t,r);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}(),Vhe={mark:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;new Ghe(e,l,n,r,i,o).mark(a,s)}},Khe=Symbol.iterator;var Whe=function(e,t){for(var n=e[Khe](),r=n.next();!r.done;){var i=r.value;if(t.has(i))return!0;r=n.next()}return!1},Hhe=Pie.ROOT_ID,Jhe=Xce.VIEWER_ID,Xhe=Symbol.iterator;var Qhe=function(e,t){for(var n=e[Xhe](),r=n.next();!r.done;){var i=r.value;if(t.has(i)&&i!==Hhe&&i!==Jhe)return!0;r=n.next()}return!1},Yhe=Dae,Zhe=_ie,epe=Whe,tpe=Qhe,npe=Dhe,rpe=function(){function e(e,t,n){this._subscriptions=new Set,this.__log=e,this._resolverCache=t,this._resolverContext=n}var t=e.prototype;return t.subscribe=function(e,t){var n=this,r={backup:null,callback:t,snapshot:e,stale:!1};return this._subscriptions.add(r),{dispose:function(){n._subscriptions.delete(r)}}},t.snapshotSubscriptions=function(e){var t=this;this._subscriptions.forEach(function(n){if(n.stale){var r=n.snapshot,i=npe.read(e,r.selector,t._resolverCache,t._resolverContext),o=Yhe(r.data,i.data);i.data=o,n.backup=i}else n.backup=n.snapshot})},t.restoreSubscriptions=function(){this._subscriptions.forEach(function(e){var t=e.backup;e.backup=null,t?(t.data!==e.snapshot.data&&(e.stale=!0),e.snapshot={data:e.snapshot.data,isMissingData:t.isMissingData,missingClientEdges:t.missingClientEdges,missingLiveResolverFields:t.missingLiveResolverFields,seenRecords:t.seenRecords,selector:t.selector,fieldErrors:t.fieldErrors}):e.stale=!0})},t.updateSubscriptions=function(e,t,n,r){var i=this,o=0!==t.size;this._subscriptions.forEach(function(s){var a=i._updateSubscription(e,s,t,o,r);null!=a&&n.push(a)})},t._updateSubscription=function(e,t,n,r,i){var o=t.backup,s=t.callback,a=t.snapshot,l=t.stale,c=r&&epe(a.seenRecords,n);if(l||c){var u=c||!o?npe.read(e,a.selector,this._resolverCache,this._resolverContext):o;return u={data:Yhe(a.data,u.data),isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors},t.snapshot=u,t.stale=!1,u.data!==a.data?(this.__log&&Zhe.ENABLE_NOTIFY_SUBSCRIPTION&&this.__log({name:"store.notify.subscription",sourceOperation:i,snapshot:a,nextSnapshot:u}),s(u),a.selector.owner):Zhe.ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION&&(l||tpe(a.seenRecords,n))?a.selector.owner:void 0}},t.size=function(){return this._subscriptions.size},e}(),ipe=rpe,ope=zre.default,spe=ope(eie),ape=ope(Wre),lpe=Gle.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,cpe=Gle.assertInternalActorIdentifier,upe=Lue,dpe=efe,fpe=Zce,hpe=$fe.LiveResolverCache,ppe=$fe.RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY,gpe=$fe.getUpdatedDataIDs,mpe=Fle,vpe=Jfe,ype=Dhe,_pe=Vhe,bpe=ipe,xpe=Pie,Spe=Pie,wpe=Spe.ROOT_ID,Epe=Spe.ROOT_TYPE,kpe=kre,Cpe=function(){function e(e,t){var n,r,i,o,s,a,l,c,u=this;(0,ape.default)(this,"_gcStep",function(){u._gcRun&&(u._gcRun.next().done?u._gcRun=null:u._gcScheduler(u._gcStep))}),this._currentWriteEpoch=0,this._gcHoldCounter=0,this._gcReleaseBufferSize=null!==(n=null==t?void 0:t.gcReleaseBufferSize)&&void 0!==n?n:10,this._shouldRetainWithinTTL_EXPERIMENTAL=null!==(r=null==t?void 0:t.shouldRetainWithinTTL_EXPERIMENTAL)&&void 0!==r&&r,this._gcRun=null,this._gcScheduler=null!==(i=null==t?void 0:t.gcScheduler)&&void 0!==i?i:upe,this._getDataID=null!==(o=null==t?void 0:t.getDataID)&&void 0!==o?o:fpe,this._globalInvalidationEpoch=null,this._invalidationSubscriptions=new Set,this._invalidatedRecordIDs=new Set,this.__log=null!==(s=null==t?void 0:t.log)&&void 0!==s?s:null,this._queryCacheExpirationTime=null==t?void 0:t.queryCacheExpirationTime,this._operationLoader=null!==(a=null==t?void 0:t.operationLoader)&&void 0!==a?a:null,this._optimisticSource=null,this._recordSource=e,this._releaseBuffer=[],this._roots=new Map,this._shouldScheduleGC=!1,this._resolverCache=new hpe(function(){return u._getMutableRecordSource()},this),this._resolverContext=null==t?void 0:t.resolverContext,this._storeSubscriptions=new bpe(null==t?void 0:t.log,this._resolverCache,this._resolverContext),this._updatedRecordIDs=new Set,this._shouldProcessClientComponents=null!==(l=null==t?void 0:t.shouldProcessClientComponents)&&void 0!==l&&l,this._treatMissingFieldsAsNull=null!==(c=null==t?void 0:t.treatMissingFieldsAsNull)&&void 0!==c&&c,this._actorIdentifier=null==t?void 0:t.actorIdentifier,function(e){if(!e.has(wpe)){var t=mpe.create(wpe,Epe);e.set(wpe,t)}}(this._recordSource)}var t=e.prototype;return t.getSource=function(){var e;return null!==(e=this._optimisticSource)&&void 0!==e?e:this._recordSource},t.getOperationLoader=function(){return this._operationLoader},t._getMutableRecordSource=function(){var e;return null!==(e=this._optimisticSource)&&void 0!==e?e:this._recordSource},t.getLiveResolverPromise=function(e){return this._resolverCache.getLiveResolverPromise(e)},t.batchLiveStateUpdates=function(e){null!=this.__log&&this.__log({name:"liveresolver.batch.start"});try{this._resolverCache.batchLiveStateUpdates(e)}finally{null!=this.__log&&this.__log({name:"liveresolver.batch.end"})}},t.check=function(e,t){var n,r,i,o,s,a,l,c=e.root,u=this._getMutableRecordSource(),d=this._globalInvalidationEpoch,f=null!==(n=null!==(r=e.request.node.operation.use_exec_time_resolvers)&&void 0!==r?r:!0===(null===(i=e.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===i?void 0:i.get()))&&void 0!==n&&n,h=this._roots.get(e.request.identifier),p=null!=h?h.epoch:null;if(null!=d&&(null==p||p<=d))return{status:"stale"};var g=null!==(o=null==t?void 0:t.handlers)&&void 0!==o?o:[],m=null!==(s=null==t?void 0:t.getSourceForActor)&&void 0!==s?s:function(e){return cpe(e),u},v=null!==(a=null==t?void 0:t.getTargetForActor)&&void 0!==a?a:function(e){return cpe(e),u};return function(e,t,n,r){var i=e.mostRecentlyInvalidatedAt,o=e.status;if("number"==typeof i&&(null==t||i>t))return{status:"stale"};if("missing"===o)return{status:"missing"};if(null!=n&&null!=r){if(n<=Date.now()-r)return{status:"stale"}}return{status:"available",fetchTime:null!=n?n:null}}(dpe.check(m,v,null!==(l=null==t?void 0:t.defaultActorIdentifier)&&void 0!==l?l:lpe,c,g,this._operationLoader,this._getDataID,this._shouldProcessClientComponents,this.__log,f),p,null==h?void 0:h.fetchTime,this._queryCacheExpirationTime)},t.retain=function(e){var t=this,n=e.request.identifier,r=!1,i=this._roots.get(n);return null!=i?(0===i.refCount&&(this._releaseBuffer=this._releaseBuffer.filter(function(e){return e!==n})),i.refCount+=1):this._roots.set(n,{operation:e,refCount:1,epoch:null,fetchTime:null}),{dispose:function(){if(!r){r=!0;var e=t._roots.get(n);if(null!=e&&(e.refCount--,0===e.refCount)){var i=t._queryCacheExpirationTime;if(null!=e.fetchTime&&null!=i&&e.fetchTime<=Date.now()-i)t._shouldRetainWithinTTL_EXPERIMENTAL||t._roots.delete(n),t.scheduleGC();else if(t._releaseBuffer.push(n),t._releaseBuffer.length>t._gcReleaseBufferSize){var o=t._releaseBuffer.shift();t._shouldRetainWithinTTL_EXPERIMENTAL||t._roots.delete(o),t.scheduleGC()}}}}}},t.lookup=function(e){var t=this.__log;null!=t&&t({name:"store.lookup.start",selector:e});var n=this.getSource(),r=ype.read(n,e,this._resolverCache,this._resolverContext);return null!=t&&t({name:"store.lookup.end",selector:e}),r},t.notify=function(e,t){var n=this,r=this.__log;null!=r&&r({name:"store.notify.start",sourceOperation:e}),this._currentWriteEpoch++,!0===t&&(this._globalInvalidationEpoch=this._currentWriteEpoch),this._resolverCache.invalidateDataIDs(this._updatedRecordIDs);var i=this.getSource(),o=[];if(this._storeSubscriptions.updateSubscriptions(i,this._updatedRecordIDs,o,e),this._invalidationSubscriptions.forEach(function(e){n._updateInvalidationSubscription(e,!0===t)}),null!=e){var s=e.request.identifier,a=this._roots.get(s);if(null!=a)a.epoch=this._currentWriteEpoch,a.fetchTime=Date.now();else if("query"===e.request.node.params.operationKind&&this._gcReleaseBufferSize>0&&this._releaseBuffer.length<this._gcReleaseBufferSize){var l={operation:e,refCount:0,epoch:this._currentWriteEpoch,fetchTime:Date.now()};this._releaseBuffer.push(s),this._roots.set(s,l)}}return null!=r&&r({name:"store.notify.complete",sourceOperation:e,updatedRecordIDs:this._updatedRecordIDs,invalidatedRecordIDs:this._invalidatedRecordIDs,subscriptionsSize:this._storeSubscriptions.size(),updatedOwners:o}),this._updatedRecordIDs.clear(),this._invalidatedRecordIDs.clear(),o},t.publish=function(e,t){var n=this._getMutableRecordSource();!function(e,t,n,r,i,o){r&&r.forEach(function(r){var i,s=e.get(r),a=t.get(r);null!==a&&((i=null!=s?mpe.clone(s):null!=a?mpe.clone(a):null)&&(mpe.setValue(i,xpe.INVALIDATED_AT_KEY,n),o.add(r),e.set(r,i)))});for(var s=t.getRecordIDs(),a=0;a<s.length;a++){var l=s[a],c=t.get(l),u=e.get(l);if(c&&u){var d=mpe.update(u,c);d!==u&&(i.add(l),e.set(l,d))}else null===c?(e.delete(l),null!==u&&i.add(l)):c&&(e.set(l,c),i.add(l))}}(n,e,this._currentWriteEpoch+1,t,this._updatedRecordIDs,this._invalidatedRecordIDs);var r=this.__log;null!=r&&r({name:"store.publish",source:e,optimistic:n===this._optimisticSource})},t.subscribe=function(e,t){return this._storeSubscriptions.subscribe(e,t)},t.holdGC=function(){var e=this;this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._gcHoldCounter++;return{dispose:function(){e._gcHoldCounter>0&&(e._gcHoldCounter--,0===e._gcHoldCounter&&e._shouldScheduleGC&&(e.scheduleGC(),e._shouldScheduleGC=!1))}}},t.toJSON=function(){return"RelayModernStore()"},t.getEpoch=function(){return this._currentWriteEpoch},t.__getUpdatedRecordIDs=function(){return this._updatedRecordIDs},t.lookupInvalidationState=function(e){var t=this,n=new Map;return e.forEach(function(e){var r,i=t.getSource().get(e);n.set(e,null!==(r=mpe.getInvalidationEpoch(i))&&void 0!==r?r:null)}),n.set("global",this._globalInvalidationEpoch),{dataIDs:e,invalidations:n}},t.checkInvalidationState=function(e){var t=this.lookupInvalidationState(e.dataIDs).invalidations,n=e.invalidations;if(t.get("global")!==n.get("global"))return!0;var r,i=(0,spe.default)(e.dataIDs);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.get(o)!==n.get(o))return!0}}catch(s){i.e(s)}finally{i.f()}return!1},t.subscribeToInvalidationState=function(e,t){var n=this,r={callback:t,invalidationState:e};return this._invalidationSubscriptions.add(r),{dispose:function(){n._invalidationSubscriptions.delete(r)}}},t._updateInvalidationSubscription=function(e,t){var n=this,r=e.callback,i=e.invalidationState.dataIDs;(t||i.some(function(e){return n._invalidatedRecordIDs.has(e)}))&&r()},t.snapshot=function(){null!=this._optimisticSource&&kpe(!1);var e=this.__log;null!=e&&e({name:"store.snapshot"}),this._storeSubscriptions.snapshotSubscriptions(this.getSource()),this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._optimisticSource=vpe.create(this.getSource())},t.restore=function(){var e=this._optimisticSource;e||kpe(!1);var t=this.__log;null!=t&&t({name:"store.restore"});var n=vpe.getOptimisticRecordIDs(e);this._resolverCache.unsubscribeFromLiveResolverRecords(n),this._optimisticSource=null,this._shouldScheduleGC&&this.scheduleGC(),this._storeSubscriptions.restoreSubscriptions(),this._resolverCache.invalidateResolverRecords(n)},t.scheduleGC=function(){this._gcHoldCounter>0?this._shouldScheduleGC=!0:this._gcRun||(this._gcRun=this._collect(),this._gcScheduler(this._gcStep))},t.__gc=function(){if(null==this._optimisticSource)for(var e=this._collect();!e.next().done;);},t._collect=function*(){if(!this._shouldRetainWithinTTL_EXPERIMENTAL||null!=this._queryCacheExpirationTime){var e=this.__log;e:for(;;){null!=e&&e({name:"store.gc.start"});var t,n=this._currentWriteEpoch,r=new Set,i=(0,spe.default)(this._roots.entries());try{for(i.s();!(t=i.n()).done;){var o,s,a,l=t.value,c=l[0],u=l[1],d=u.operation,f=u.refCount,h=u.fetchTime;if(this._shouldRetainWithinTTL_EXPERIMENTAL){var p=this._queryCacheExpirationTime;if(null==p&&kpe(!1),(null==h||h<=Date.now()-p)&&0===f&&!this._releaseBuffer.includes(c))continue}var g=d.root,m=null!==(o=null!==(s=d.request.node.operation.use_exec_time_resolvers)&&void 0!==s?s:!0===(null===(a=d.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===a?void 0:a.get()))&&void 0!==o&&o;if(_pe.mark(this._recordSource,g,r,this._operationLoader,this._shouldProcessClientComponents,m),yield,n!==this._currentWriteEpoch){null!=e&&e({name:"store.gc.interrupted"});continue e}}}catch(S){i.e(S)}finally{i.f()}for(var v=this._recordSource.getRecordIDs(),y=0;y<v.length;y++){var _=v[y];if(!r.has(_)){var b=this._recordSource.get(_);if(null!=b){var x=mpe.getValue(b,ppe);null!=x&&x()}this._recordSource.remove(_),this._shouldRetainWithinTTL_EXPERIMENTAL&&this._roots.delete(_)}}return void(null!=e&&e({name:"store.gc.end",references:r}))}}},t.__getNormalizationOptions=function(e){return{path:e,getDataID:this._getDataID,log:this.__log,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents,actorIdentifier:this._actorIdentifier}},t.__notifyUpdatedSubscribers=function(e){var t=gpe(e),n=this._updatedRecordIDs;this._updatedRecordIDs=t,this.notify(),this._updatedRecordIDs=n},e}();var Ape,Npe,Tpe=Cpe,Rpe=Pie,Dpe=Rpe.ROOT_TYPE,Ipe=Rpe.getStorageKey,Fpe=rde.readUpdatableFragment,Ope=sde.readUpdatableQuery,Ppe=kre,Mpe=function(){function e(e,t,n,r){this.__mutator=e,this.__recordSource=t,this._readSelector=n,this._missingFieldHandlers=r}var t=e.prototype;return t.create=function(e,t){return this.__recordSource.create(e,t)},t.delete=function(e){this.__recordSource.delete(e)},t.get=function(e){return this.__recordSource.get(e)},t.getRoot=function(){return this.__recordSource.getRoot()},t.getOperationRoot=function(){var e=this.__recordSource.get(this._readSelector.dataID);return e||(e=this.__recordSource.create(this._readSelector.dataID,Dpe)),e},t._getRootField=function(e,t,n){var r=e.node.selections.find(function(e){return"LinkedField"===e.kind&&e.name===t||"RequiredField"===e.kind&&e.field.name===t});return r&&"RequiredField"===r.kind&&(r=r.field),r&&"LinkedField"===r.kind||Ppe(!1),r.plural!==n&&Ppe(!1),r},t.getRootField=function(e){var t=this._getRootField(this._readSelector,e,!1),n=Ipe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecord(n)},t.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),n=Ipe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecords(n)},t.invalidateStore=function(){this.__recordSource.invalidateStore()},t.readUpdatableQuery=function(e,t){return Ope(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return Fpe(e,t,this,this._missingFieldHandlers)},e}(),Lpe=$ue,zpe=Ede,jpe=Mpe,Upe=_ie,Bpe=Dhe,$pe=Ble,qpe=kre,Gpe=void 0!==k?k:"undefined"!=typeof window?window:void 0,Vpe=null!==(Ape=null==Gpe||null===(Npe=Gpe.ErrorUtils)||void 0===Npe?void 0:Npe.applyWithGuard)&&void 0!==Ape?Ape:function(e,t,n,r,i){return e.apply(t,n)},Kpe=function(){function e(e,t,n,r,i){this._hasStoreSnapshot=!1,this._handlerProvider=t||null,this._pendingBackupRebase=!1,this._pendingData=new Set,this._pendingOptimisticUpdates=new Set,this._store=e,this._appliedOptimisticUpdates=new Set,this._gcHold=null,this._getDataID=n,this._missingFieldHandlers=r,this._log=i}var t=e.prototype;return t.applyUpdate=function(e){(this._appliedOptimisticUpdates.has(e)||this._pendingOptimisticUpdates.has(e))&&qpe(!1),this._pendingOptimisticUpdates.add(e)},t.revertUpdate=function(e){this._pendingOptimisticUpdates.has(e)?this._pendingOptimisticUpdates.delete(e):this._appliedOptimisticUpdates.has(e)&&(this._pendingBackupRebase=!0,this._appliedOptimisticUpdates.delete(e))},t.revertAll=function(){this._pendingBackupRebase=!0,this._pendingOptimisticUpdates.clear(),this._appliedOptimisticUpdates.clear()},t.commitPayload=function(e,t,n){this._pendingBackupRebase=!0,this._pendingData.add({kind:"payload",operation:e,payload:t,updater:n})},t.commitUpdate=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"updater",updater:e})},t.commitSource=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"source",source:e})},t.run=function(e){var t=0===this._appliedOptimisticUpdates&&!!this._gcHold,n=!this._pendingBackupRebase&&0===this._pendingOptimisticUpdates.size&&!t;if(Upe.DISALLOW_NESTED_UPDATES&&!0===this._isRunning&&qpe(!1),this._isRunning=!0,n)return this._isRunning=!1,[];this._pendingBackupRebase&&this._hasStoreSnapshot&&(this._store.restore(),this._hasStoreSnapshot=!1);var r=this._commitData();return(this._pendingOptimisticUpdates.size||this._pendingBackupRebase&&this._appliedOptimisticUpdates.size)&&(this._hasStoreSnapshot||(this._store.snapshot(),this._hasStoreSnapshot=!0),this._applyUpdates()),this._pendingBackupRebase=!1,this._appliedOptimisticUpdates.size>0?this._gcHold||(this._gcHold=this._store.holdGC()):this._gcHold&&(this._gcHold.dispose(),this._gcHold=null),this._isRunning=!1,this._store.notify(e,r)},t._publishSourceFromPayload=function(e){var t=this,n=e.payload,r=e.operation,i=e.updater,o=n.source,s=n.fieldPayloads,a=new Lpe(this._store.getSource(),o),l=new zpe(a,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log);if(s&&s.length&&s.forEach(function(e){var n=t._handlerProvider&&t._handlerProvider(e.handle);n||qpe(!1),n.update(l,e)}),i){var c=r.fragment;null==c&&qpe(!1),i(new jpe(a,l,c,this._missingFieldHandlers),Wpe(o,c))}var u=l.getIDsMarkedForInvalidation();return this._store.publish(o,u),l.isStoreMarkedForInvalidation()},t._commitData=function(){var e=this;if(!this._pendingData.size)return!1;var t=!1;return this._pendingData.forEach(function(n){if("payload"===n.kind){var r=e._publishSourceFromPayload(n);t=t||r}else if("source"===n.kind){var i=n.source;e._store.publish(i)}else{var o=n.updater,s=$pe.create(),a=new Lpe(e._store.getSource(),s),l=new zpe(a,e._getDataID,e._handlerProvider,e._missingFieldHandlers,e._log);Vpe(o,null,[l],null,"RelayPublishQueue:commitData"),t=t||l.isStoreMarkedForInvalidation();var c=l.getIDsMarkedForInvalidation();e._store.publish(s,c)}}),this._pendingData.clear(),t},t._applyUpdates=function(){var e=this,t=$pe.create(),n=new Lpe(this._store.getSource(),t),r=new zpe(n,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log),i=function(t){if(t.storeUpdater){var i=t.storeUpdater;Vpe(i,null,[r],null,"RelayPublishQueue:applyUpdates")}else{var o=t.operation,s=t.payload,a=t.updater,l=s.source,c=s.fieldPayloads;if(l&&r.publishSource(l,c),a){var u;l&&(u=Wpe(l,o.fragment));var d=new jpe(n,r,o.fragment,e._missingFieldHandlers);Vpe(a,null,[d,u],null,"RelayPublishQueue:applyUpdates")}}};this._pendingBackupRebase&&this._appliedOptimisticUpdates.size&&this._appliedOptimisticUpdates.forEach(i),this._pendingOptimisticUpdates.size&&(this._pendingOptimisticUpdates.forEach(function(t){i(t),e._appliedOptimisticUpdates.add(t)}),this._pendingOptimisticUpdates.clear()),this._store.publish(t)},e}();function Wpe(e,t){return Bpe.read(e,t).data}var Hpe=Kpe,Jpe=(0,zre.default)(Hre),Xpe=zse,Qpe=Gle.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,Ype=Gle.assertInternalActorIdentifier,Zpe=woe,ege=Gce,tge=Hce,nge=Jce,rge=Zce,ige=eue,oge=Mce,sge=Oue,age=Tpe,lge=Hpe,cge=Ble,uge=function(){function e(e){var t,n,r,i,o,s,a,l,c,u,d,f=this;this.configName=e.configName,this._treatMissingFieldsAsNull=!0===e.treatMissingFieldsAsNull;var h=e.operationLoader,p=null!==(t=e.store)&&void 0!==t?t:new age(new cge,{log:e.log,operationLoader:e.operationLoader,getDataID:e.getDataID,shouldProcessClientComponents:e.shouldProcessClientComponents});this.__log=null!==(n=e.log)&&void 0!==n?n:dge,this.relayFieldLogger=null!==(r=e.relayFieldLogger)&&void 0!==r?r:ige,this._defaultRenderPolicy=null!==(i=e.UNSTABLE_defaultRenderPolicy)&&void 0!==i?i:"partial",this._operationLoader=h,this._operationExecutions=new Map,this._network=ege(this,e.network),this._getDataID=null!==(o=e.getDataID)&&void 0!==o?o:rge,this._missingFieldHandlers=null!==(s=e.missingFieldHandlers)&&void 0!==s?s:[],this._publishQueue=new lge(p,null!==(a=e.handlerProvider)&&void 0!==a?a:Xpe,this._getDataID,this._missingFieldHandlers,this.__log),this._scheduler=null!==(l=e.scheduler)&&void 0!==l?l:null,this._store=p,this.options=e.options,this._isServer=null!==(c=e.isServer)&&void 0!==c&&c,this._normalizeResponse=null!==(u=e.normalizeResponse)&&void 0!==u?u:oge,this.__setNet=function(e){return f._network=ege(f,e)},this._operationTracker=null!==(d=e.operationTracker)&&void 0!==d?d:new tge,this._shouldProcessClientComponents=e.shouldProcessClientComponents,nge(this)}var t=e.prototype;return t.getStore=function(){return this._store},t.getNetwork=function(){return this._network},t.getOperationTracker=function(){return this._operationTracker},t.getScheduler=function(){return this._scheduler},t.isRequestActive=function(e){return"active"===this._operationExecutions.get(e)},t.UNSTABLE_getDefaultRenderPolicy=function(){return this._defaultRenderPolicy},t.applyUpdate=function(e){var t=this;return this._scheduleUpdates(function(){t._publishQueue.applyUpdate(e),t._publishQueue.run()}),{dispose:function(){t._scheduleUpdates(function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()})}}},t.revertUpdate=function(e){var t=this;this._scheduleUpdates(function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()})},t.replaceUpdate=function(e,t){var n=this;this._scheduleUpdates(function(){n._publishQueue.revertUpdate(e),n._publishQueue.applyUpdate(t),n._publishQueue.run()})},t.applyMutation=function(e){var t=this._execute({createSource:function(){return Zpe.create(function(e){})},isClientPayload:!1,operation:e.operation,optimisticConfig:e,updater:null}).subscribe({});return{dispose:function(){return t.unsubscribe()}}},t.check=function(e){return 0!==this._missingFieldHandlers.length||function(e){return"Operation"===e.root.node.kind&&null!=e.root.node.clientAbstractTypes}(e)?this._checkSelectorAndHandleMissingFields(e,this._missingFieldHandlers):this._store.check(e)},t.commitPayload=function(e,t){this._execute({createSource:function(){return Zpe.from({data:t})},isClientPayload:!0,operation:e,optimisticConfig:null,updater:null}).subscribe({})},t.commitUpdate=function(e){var t=this;this._scheduleUpdates(function(){t._publishQueue.commitUpdate(e),t._publishQueue.run()})},t.lookup=function(e){return this._store.lookup(e)},t.subscribe=function(e,t){return this._store.subscribe(e,t)},t.retain=function(e){return this._store.retain(e)},t.isServer=function(){return this._isServer},t._checkSelectorAndHandleMissingFields=function(e,t){var n=this,r=cge.create(),i=this._store.getSource(),o=this._store.check(e,{handlers:t,defaultActorIdentifier:Qpe,getSourceForActor:function(e){return Ype(e),i},getTargetForActor:function(e){return Ype(e),r}});return r.size()>0&&this._scheduleUpdates(function(){n._publishQueue.commitSource(r),n._publishQueue.run()}),o},t._scheduleUpdates=function(e){var t=this._scheduler;null!=t?t.schedule(e):e()},t.execute=function(e){var t=this,n=e.operation;return this._execute({createSource:function(){return t.getNetwork().execute(n.request.node.params,n.request.variables,n.request.cacheConfig||{},null,void 0,void 0,void 0,function(){return t.check(n)})},isClientPayload:!1,operation:n,optimisticConfig:null,updater:null})},t.executeSubscription=function(e){var t=this,n=e.operation,r=e.updater;return this._execute({createSource:function(){return t.getNetwork().execute(n.request.node.params,n.request.variables,n.request.cacheConfig||{},null)},isClientPayload:!1,operation:n,optimisticConfig:null,updater:r})},t.executeMutation=function(e){var t,n=this,r=e.operation,i=e.optimisticResponse,o=e.optimisticUpdater,s=e.updater,a=e.uploadables;return(i||o)&&(t={operation:r,response:i,updater:o}),this._execute({createSource:function(){return n.getNetwork().execute(r.request.node.params,r.request.variables,(0,Jpe.default)((0,Jpe.default)({},r.request.cacheConfig),{},{force:!0}),a)},isClientPayload:!1,operation:r,optimisticConfig:t,updater:s})},t.executeWithSource=function(e){var t=e.operation,n=e.source;return this._execute({createSource:function(){return n},isClientPayload:!1,operation:t,optimisticConfig:null,updater:null})},t.toJSON=function(){var e;return"RelayModernEnvironment(".concat(null!==(e=this.configName)&&void 0!==e?e:"",")")},t._execute=function(e){var t=this,n=e.createSource,r=e.isClientPayload,i=e.operation,o=e.optimisticConfig,s=e.updater,a=this._publishQueue,l=this._store;return Zpe.create(function(e){var c=sge.execute({actorIdentifier:Qpe,getDataID:t._getDataID,isClientPayload:r,log:t.__log,operation:i,operationExecutions:t._operationExecutions,operationLoader:t._operationLoader,operationTracker:t._operationTracker,optimisticConfig:o,getPublishQueue:function(e){return Ype(e),a},scheduler:t._scheduler,shouldProcessClientComponents:t._shouldProcessClientComponents,sink:e,source:n(),getStore:function(e){return Ype(e),l},treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,updater:s,normalizeResponse:t._normalizeResponse});return function(){return c.cancel()}})},e}();function dge(){}uge.prototype["@@RelayModernEnvironment"]=!0;var fge=uge,hge=qse,pge=Mre.getRequest,gge=ese.createOperationDescriptor,mge=coe.createReaderSelector;var vge=function(e,t){var n=pge(t.subscription);if("subscription"!==n.params.operationKind)throw new Error("requestSubscription: Must use Subscription operation");var r=t.configs,i=t.onCompleted,o=t.onError,s=t.onNext,a=t.variables,l=t.cacheConfig,c=gge(n,a,l),u=(r?hge.convert(r,n,null,t.updater):t).updater,d=e.executeSubscription({operation:c,updater:u}).subscribe({next:function(t){if(null!=s){var n,r,i,o,a=c.fragment;if(Array.isArray(t))n=null===(r=t[0])||void 0===r||null===(i=r.extensions)||void 0===i?void 0:i.__relay_subscription_root_id;else n=null===(o=t.extensions)||void 0===o?void 0:o.__relay_subscription_root_id;"string"==typeof n&&(a=mge(a.node,n,a.variables,a.owner));var l=e.lookup(a).data;s(l)}},error:o,complete:i});return{dispose:d.unsubscribe}};(0,zre.default)(Hre);var yge=Pie;yge.getModuleComponentKey,yge.getModuleOperationKey;var _ge=Object.prototype.hasOwnProperty;var bge=coe.getDataIDsFromFragment,xge=coe.getSelector,Sge=coe.getVariablesFromFragment,wge=function(e){for(var t in e)if(_ge.call(e,t))return!1;return!0},Ege=_ie,kge=bie.stableCopy,Cge=ise.intern;var Age=function(e,t){var n=xge(e,t),r=null==n?"null":"SingularReaderSelector"===n.kind?n.owner.identifier:"["+n.selectors.map(function(e){return e.owner.identifier}).join(",")+"]",i=Sge(e,t),o=bge(e,t);if(Ege.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION){var s=void 0===o?"missing":null==o?"null":Array.isArray(o)?"["+o.join(",")+"]":o;return s=Ege.STRING_INTERN_LEVEL<=1?s:Cge(s,Ege.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+(null==i||wge(i)?"{}":JSON.stringify(kge(i)))+"/"+s}var a,l=null!==(a=JSON.stringify(o))&&void 0!==a?a:"missing";return l=Ege.STRING_INTERN_LEVEL<=1?l:Cge(l,Ege.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+JSON.stringify(kge(i))+"/"+l},Nge=kre;var Tge=function(e,t){var n,r;!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)&&Nge(!1);var i=null===(r=e.metadata)||void 0===r?void 0:r.refetch;null==i&&Nge(!1);var o=i.operation.default?i.operation.default:i.operation,s=i.fragmentPathInResult;"string"==typeof o&&Nge(!1);var a=i.identifierInfo;return null!=a&&(null!=a.identifierField&&"string"!=typeof a.identifierField&&Nge(!1),null!=a.identifierQueryVariableName&&"string"!=typeof a.identifierQueryVariableName&&Nge(!1)),{fragmentRefPathInResponse:s,identifierInfo:a,refetchableRequest:o,refetchMetadata:i}},Rge=Tge,Dge=kre;var Ige=function(e,t){var n,r,i=Rge(e),o=i.refetchableRequest,s=i.refetchMetadata,a=s.connection;null==a&&Dge(!1);var l=a.path,c=(null!==(n=null===(r=e.metadata)||void 0===r?void 0:r.connection)&&void 0!==n?n:[])[0];null==c&&Dge(!1);var u=s.identifierInfo;return null!=(null==u?void 0:u.identifierField)&&"string"!=typeof u.identifierField&&Dge(!1),{connectionPathInFragmentData:l,identifierField:null==u?void 0:u.identifierField,paginationRequest:o,paginationMetadata:a,stream:!0===c.stream}},Fge=zre.default,Oge=Fge(Wre),Pge=Fge(Hre),Mge=kre;var Lge=function(e,t,n,r,i,o){var s,a=o.backward,l=o.forward;if("backward"===e){var c;(null==a||null==a.count||null==a.cursor)&&Mge(!1);var u=(0,Pge.default)((0,Pge.default)((0,Pge.default)({},r),i),{},(c={},(0,Oge.default)(c,a.cursor,n),(0,Oge.default)(c,a.count,t),c));return l&&l.cursor&&(u[l.cursor]=null),l&&l.count&&(u[l.count]=null),u}(null==l||null==l.count||null==l.cursor)&&Mge(!1);var d=(0,Pge.default)((0,Pge.default)((0,Pge.default)({},r),i),{},(s={},(0,Oge.default)(s,l.cursor,n),(0,Oge.default)(s,l.count,t),s));return a&&a.cursor&&(d[a.cursor]=null),a&&a.count&&(d[a.count]=null),d},zge=(0,zre.default)(eie),jge=kre;var Uge=function(e,t){var n,r=e,i=(0,zge.default)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(null==r)return null;"number"==typeof o?(Array.isArray(r)||jge(!1),r=r[o]):(("object"!=typeof r||Array.isArray(r))&&jge(!1),r=r[o])}}catch(s){i.e(s)}finally{i.f()}return r},Bge=Sse,$ge=fse,qge=Jse,Gge=Xse,Vge=iae,Kge=qse,Wge=xae,Hge=Eae,Jge=joe,Xge=Mre,Qge=Cae,Yge=rle,Zge=ole,eme=jse,tme=Uce,nme=jie,rme=coe,ime=Pie,ome=moe,sme=Xce,ame=vge,lme=Boe,cme=Age,ume=Ige,dme=Lge,fme=Nae,hme=Tge,pme=Goe,gme=Uge,mme=sie.handlePotentialSnapshotErrors,vme=_oe,yme=Tae,_me=Dae,bme=gie,xme=_ie,Sme={Environment:fge,Network:fae,Observable:woe,RecordSource:Ble,ReplaySubject:Roe,Store:Tpe,areEqualSelectors:rme.areEqualSelectors,createFragmentSpecResolver:Zae,createNormalizationSelector:rme.createNormalizationSelector,createOperationDescriptor:ese.createOperationDescriptor,createReaderSelector:rme.createReaderSelector,createRequestDescriptor:ese.createRequestDescriptor,getArgumentValues:ime.getArgumentValues,getDataIDsFromFragment:rme.getDataIDsFromFragment,getDataIDsFromObject:rme.getDataIDsFromObject,getNode:Xge.getNode,getFragment:Xge.getFragment,getInlineDataFragment:Xge.getInlineDataFragment,getModuleComponentKey:ime.getModuleComponentKey,getModuleOperationKey:ime.getModuleOperationKey,getPaginationFragment:Xge.getPaginationFragment,getPluralSelector:rme.getPluralSelector,getRefetchableFragment:Xge.getRefetchableFragment,getRequest:Xge.getRequest,getRequestIdentifier:pme,getSelector:rme.getSelector,getSelectorsFromObject:rme.getSelectorsFromObject,getSingularSelector:rme.getSingularSelector,getStorageKey:ime.getStorageKey,getVariablesFromFragment:rme.getVariablesFromFragment,getVariablesFromObject:rme.getVariablesFromObject,getVariablesFromPluralFragment:rme.getVariablesFromPluralFragment,getVariablesFromSingularFragment:rme.getVariablesFromSingularFragment,handlePotentialSnapshotErrors:mme,graphql:Xge.graphql,isFragment:Xge.isFragment,isInlineDataFragment:Xge.isInlineDataFragment,isRequest:Xge.isRequest,readInlineData:tme,readFragment:ome.readFragment,MutationTypes:Kge.MutationTypes,RangeOperations:Kge.RangeOperations,ConnectionHandler:Bge,VIEWER_ID:sme.VIEWER_ID,VIEWER_TYPE:sme.VIEWER_TYPE,applyOptimisticMutation:qge,commitLocalUpdate:Gge,commitMutation:Vge,fetchQuery:Wge,fetchQuery_DEPRECATED:Hge,isRelayModernEnvironment:eme,requestSubscription:ame,ConnectionInterface:$ge,PreloadableQueryRegistry:Qge,RelayFeatureFlags:xme,DEFAULT_HANDLE_KEY:bme.DEFAULT_HANDLE_KEY,FRAGMENTS_KEY:ime.FRAGMENTS_KEY,FRAGMENT_OWNER_KEY:ime.FRAGMENT_OWNER_KEY,ID_KEY:ime.ID_KEY,REF_KEY:ime.REF_KEY,REFS_KEY:ime.REFS_KEY,ROOT_ID:ime.ROOT_ID,ROOT_TYPE:ime.ROOT_TYPE,TYPENAME_KEY:ime.TYPENAME_KEY,deepFreeze:lme,isPromise:vme,isScalarAndEqual:yme,recycleNodesInto:_me,getFragmentIdentifier:cme,getRefetchMetadata:hme,getPaginationMetadata:ume,getPaginationVariables:dme,getPendingOperationsForFragment:fme,getValueAtPath:gme,__internal:{createRelayContext:Yge,createRelayLoggingContext:Zge,getOperationVariables:nme.getOperationVariables,getLocalVariables:nme.getLocalVariables,fetchQuery:Jge.fetchQuery,fetchQueryDeduped:Jge.fetchQueryDeduped,getPromiseForActiveRequest:Jge.getPromiseForActiveRequest,getObservableForActiveRequest:Jge.getObservableForActiveRequest}},wme=Tpe;const Eme=C(wme),kme=N({__proto__:null,default:Eme},[wme]);let Cme={kind:"linked",handle:(e,t,n,r)=>{let i=e.name,o=n.id;return null==t||"node"!==i||t.getType()!==Sme.ROOT_TYPE?void 0:o}};let Ame={make:function(e,t,n){return new Sme.Store(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},makeLiveStore:function(e,t,n){return new Eme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},_makeLiveStoreCjs:function(e,t,n){return new kme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})}};function Nme(e,t,n){let r=[],i=e.getStore().getSource()._records.get(n);return void 0!==i&&Object.entries(i).forEach(e=>{e[0].startsWith("__"+t+"_connection")&&r.push(e[1].__ref)}),r}let Tme={make:function(e,t,n,r,i,o,s){return new Sme.Environment({network:e,store:t,getDataID:n,treatMissingFieldsAsNull:r,missingFieldHandlers:void 0!==i?i.concat([Cme]):[Cme],relayFieldLogger:o,isServer:s})},findAllConnectionIds:Nme,invalidateAllOfConnection:function(e,t,n,r){let i=void 0!==r?r:[];Sme.commitLocalUpdate(e,r=>{Nme(e,t,n).forEach(e=>{if(!i.includes(e))return M(R(r.get(e)),e=>{e.invalidateRecord()})})})}};var Rme=A,Dme=(0,Sme.__internal.createRelayContext)(Rme),Ime={exports:{}};!function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ime);var Fme=Ime.exports,Ome={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Ome);var Pme=Ome.exports,Mme={exports:{}},Lme={exports:{}};!function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Lme);var zme=Lme.exports;!function(e){var t=zme;e.exports=function(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(Mme);var jme=Mme.exports,Ume=kre;var Bme=function(e,t){for(var n in t&&"object"==typeof t||Ume(!1),t)if(t.hasOwnProperty(n)){var r=t[n];(!r||"object"!=typeof r&&"function"!=typeof r)&&Ume(!1)}};function $me(e){return e.displayName||e.name||"Component"}var qme={getComponentName:$me,getContainerName:function(e){return"Relay("+$me(e)+")"}},Gme=A.createContext({rootIsQueryRenderer:!1}),Vme=(0,zre.default)(Fme),Kme=Bme,Wme=qme.getComponentName,Hme=qme.getContainerName,Jme=Dme,Xme=Gme,Qme=kre,Yme=A,Zme=Sme.getFragment,eve=Yme.useContext;var tve=function(e,t,n){var r=Hme(e);Kme(Wme(e),t);var i={};for(var o in t)i[o]=Zme(t[o]);var s=n(e,i);function a(e,t){var n,r=eve(Jme);null==r&&Qme(!1);var i=eve(Xme);return Yme.createElement(s,(0,Vme.default)({},e,{__relayContext:r,__rootIsQueryRenderer:null!==(n=null==i?void 0:i.rootIsQueryRenderer)&&void 0!==n&&n,componentRef:e.componentRef||t}))}return s.displayName=r,a.displayName=r,Yme.forwardRef(a)};var nve=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.check&&"function"==typeof e.lookup&&"function"==typeof e.retain&&"function"==typeof e.execute&&"function"==typeof e.subscribe},rve=kre;var ive={assertRelayContext:function(e){return!function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&nve(e.environment)}(e)&&rve(!1),e}},ove=zre.default,sve=ove(Fme),ave=ove(cle),lve=ove(Pme),cve=ove(jme),uve=ove(Wre),dve=["componentRef","__relayContext","__rootIsQueryRenderer"],fve=tve,hve=qme.getContainerName,pve=ive.assertRelayContext,gve=qie,mve=A,vve=Sme,yve=vve.createFragmentSpecResolver,_ve=vve.getDataIDsFromObject,bve=vve.isScalarAndEqual;function xve(e,t){var n,r=hve(e);return n=function(n){function i(e){var i,o;o=n.call(this,e)||this,(0,uve.default)((0,lve.default)(o),"_handleFragmentDataUpdate",function(){var e=o.state.resolver;o.setState(function(t){return e===t.resolver?{data:t.resolver.resolve(),relayProp:Sve(t.relayProp.environment)}:null})});var s=pve(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=yve(s,r,t,e,a);return o.state={data:l.resolve(),prevProps:e,prevPropsContext:s,relayProp:Sve(s.environment),resolver:l},o}(0,cve.default)(i,n),i.getDerivedStateFromProps=function(e,n){var i,o=n.prevProps,s=pve(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=_ve(t,o),c=_ve(t,e),u=n.resolver;if(n.prevPropsContext.environment!==s.environment||!gve(l,c))return{data:(u=yve(s,r,t,e,a)).resolve(),prevPropsContext:s,prevProps:e,relayProp:Sve(s.environment),resolver:u};u.setProps(e);var d=u.resolve();return d!==n.data?{data:d,prevProps:e,prevPropsContext:s,relayProp:Sve(s.environment)}:null};var o=i.prototype;return o.componentDidMount=function(){this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},o.componentDidUpdate=function(e,t){this.state.resolver!==t.resolver?(t.resolver.dispose(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},o.componentWillUnmount=function(){this.state.resolver.dispose()},o.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(n.prevPropsContext.environment!==this.state.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!bve(e[o],this.props[o]))return!0}return!1},o._rerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver.resolve();t!==n&&this.setState({data:n})},o._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver,r=n.resolve();n.setCallback(this.props,this._handleFragmentDataUpdate),t!==r&&this.setState({data:r})},o.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,ave.default)(t,dve);return mve.createElement(e,(0,sve.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp}))},i}(mve.Component),(0,uve.default)(n,"displayName",r),n}function Sve(e){return{environment:e}}var wve={createContainer:function(e,t){return fve(e,t,xve)}},Eve=A,kve=Sme;kve.createOperationDescriptor,kve.deepFreeze,kve.getRequest,Eve.useLayoutEffect,Eve.useState,Eve.useRef,Eve.useMemo;var Cve=(0,zre.default)(Hre),Ave=Sme.getSelector;var Nve=function(e,t){var n={};return Object.keys(e).forEach(function(r){var i,o,s,a=e[r],l=t[r],c=Ave(a,l),u=null!=c&&"PluralReaderSelector"===c.kind?null!==(i=null===(o=c.selectors[0])||void 0===o?void 0:o.owner.variables)&&void 0!==i?i:{}:null!==(s=null==c?void 0:c.owner.variables)&&void 0!==s?s:{};n=(0,Cve.default)((0,Cve.default)({},n),u)}),n},Tve=(0,zre.default)(Wre),Rve=kre,Dve=Sme,Ive=Dve.__internal.fetchQuery,Fve=Dve.createOperationDescriptor,Ove=Dve.isRelayModernEnvironment,Pve=function(){function e(e){(0,Tve.default)(this,"_selectionReferences",[]),(0,Tve.default)(this,"_didFetchFinish",!1),null!=e&&(this._cacheSelectionReference=e.cacheSelectionReference,this._selectionReferences=e.selectionReferences)}var t=e.prototype;return t.getSelectionReferences=function(){return{cacheSelectionReference:this._cacheSelectionReference,selectionReferences:this._selectionReferences}},t.lookupInStore=function(e,t,n){return"store-and-network"!==n&&"store-or-network"!==n||"available"!==e.check(t).status?null:(this._retainCachedOperation(e,t),e.lookup(t.fragment))},t.getFetchResult=function(){return this._didFetchFinish?null!=this._error?{error:this._error}:null!=this._snapshot?{snapshot:this._snapshot}:void 0:null},t.execute=function(e){var t=this,n=e.environment,r=e.operation,i=e.preservePreviousReferences,o=void 0!==i&&i,s=n.retain(r),a=function(){t._selectionReferences=t._selectionReferences.concat(s)},l=function(){o||t.disposeSelectionReferences(),t._selectionReferences=t._selectionReferences.concat(s)},c=function(){t._selectionReferences=t._selectionReferences.concat(s)};return Ove(n)?Ive(n,r).do({error:a,complete:l,unsubscribe:c}):n.execute({operation:r}).do({error:a,complete:l,unsubscribe:c})},t.setOnDataChange=function(e){this._fetchOptions||Rve(!1),"function"==typeof e&&(this._fetchOptions.onDataChangeCallbacks=this._fetchOptions.onDataChangeCallbacks||[],this._fetchOptions.onDataChangeCallbacks.push(e),this._didFetchFinish&&(null!=this._error?e({error:this._error}):null!=this._snapshot&&e({snapshot:this._snapshot})))},t.fetch=function(e,t){var n,r=this,i=e.environment,o=e.operation,s=e.onDataChange,a=!1;this.disposeRequest();var l=this._fetchOptions&&this._fetchOptions.onDataChangeCallbacks;this._fetchOptions={environment:i,onDataChangeCallbacks:l||[],operation:o},s&&-1===this._fetchOptions.onDataChangeCallbacks.indexOf(s)&&this._fetchOptions.onDataChangeCallbacks.push(s);var c=t?Fve(o.request.node,o.request.variables,t):o,u=this.execute({environment:i,operation:c}).finally(function(){r._pendingRequest=null}).subscribe({next:function(){r._didFetchFinish=!0,r._error=null,r._onQueryDataAvailable({notifyFirstResult:a})},error:function(e){r._didFetchFinish=!0,r._error=e,r._snapshot=null;var t=r._fetchOptions&&r._fetchOptions.onDataChangeCallbacks;a?t&&t.forEach(function(t){t({error:e})}):n=e}});if(this._pendingRequest={dispose:function(){u.unsubscribe()}},a=!0,n)throw n;return this._snapshot},t.retry=function(e){return this._fetchOptions||Rve(!1),this.fetch({environment:this._fetchOptions.environment,operation:this._fetchOptions.operation,onDataChange:null},e)},t.dispose=function(){this.disposeRequest(),this.disposeSelectionReferences()},t.disposeRequest=function(){this._error=null,this._snapshot=null,this._pendingRequest&&this._pendingRequest.dispose(),this._rootSubscription&&(this._rootSubscription.dispose(),this._rootSubscription=null)},t._retainCachedOperation=function(e,t){this._disposeCacheSelectionReference(),this._cacheSelectionReference=e.retain(t)},t._disposeCacheSelectionReference=function(){this._cacheSelectionReference&&this._cacheSelectionReference.dispose(),this._cacheSelectionReference=null},t.disposeSelectionReferences=function(){this._disposeCacheSelectionReference(),this._selectionReferences.forEach(function(e){return e.dispose()}),this._selectionReferences=[]},t._onQueryDataAvailable=function(e){var t=this,n=e.notifyFirstResult;this._fetchOptions||Rve(!1);var r=this._fetchOptions,i=r.environment,o=r.onDataChangeCallbacks,s=r.operation;if(!this._snapshot&&(this._snapshot=i.lookup(s.fragment),this._rootSubscription=i.subscribe(this._snapshot,function(e){if(null!=t._fetchOptions){var n=t._fetchOptions.onDataChangeCallbacks;Array.isArray(n)&&n.forEach(function(t){return t({snapshot:e})})}}),this._snapshot&&n&&Array.isArray(o))){var a=this._snapshot;o.forEach(function(e){return e({snapshot:a})})}},e}(),Mve=Pve,Lve=zre.default,zve=Lve(Fme),jve=Lve(cle),Uve=Lve(Pme),Bve=Lve(jme),$ve=Lve(Wre),qve=Lve(Hre),Gve=["componentRef"],Vve=["componentRef","__relayContext","__rootIsQueryRenderer"],Kve=["componentRef","__relayContext","__rootIsQueryRenderer"],Wve=tve,Hve=Nve,Jve=qme.getComponentName,Xve=qme.getContainerName,Qve=Dme,Yve=Mve,Zve=ive.assertRelayContext,eye=qie,tye=kre,nye=A,rye=Sme,iye=rye.ConnectionInterface,oye=rye.Observable,sye=rye.RelayFeatureFlags,aye=rye.createFragmentSpecResolver,lye=rye.createOperationDescriptor,cye=rye.getDataIDsFromObject,uye=rye.getRequest,dye=rye.getVariablesFromObject,fye=rye.isScalarAndEqual,hye="forward";function pye(e){return"function"==typeof e?{error:e,complete:e,unsubscribe:function(t){"function"==typeof e&&e()}}:e||{}}function gye(e,t,n){var r;Jve(e);var i=Xve(e),o=function(e){var t=null,n=!1;for(var r in e){var i=e[r],o=i.metadata&&i.metadata.connection;void 0!==i.metadata&&(n=!0),o&&(1!==o.length&&tye(!1),t&&tye(!1),t=(0,qve.default)((0,qve.default)({},o[0]),{},{fragmentName:r}))}return n&&null===t&&tye(!1),t||{}}(t),s=n.getConnectionFromProps||function(e){var t=e.path;return t||tye(!1),function(n){for(var r=n[e.fragmentName],i=0;i<t.length;i++){if(!r||"object"!=typeof r)return null;r=r[t[i]]}return r}}(o),a=n.direction||o.direction;a||tye(!1);var l=n.getFragmentVariables||function(e){var t=e.count;return t||tye(!1),function(e,n){return(0,qve.default)((0,qve.default)({},e),{},(0,$ve.default)({},t,n))}}(o);return r=function(r){function o(e){var n,o;o=r.call(this,e)||this,(0,$ve.default)((0,Uve.default)(o),"_handleFragmentDataUpdate",function(){o.setState({data:o._resolver.resolve()})}),(0,$ve.default)((0,Uve.default)(o),"_hasMore",function(){var e=o._getConnectionData();return!!(e&&e.hasMore&&e.cursor)}),(0,$ve.default)((0,Uve.default)(o),"_isLoading",function(){return!!o._refetchSubscription}),(0,$ve.default)((0,Uve.default)(o),"_refetchConnection",function(e,t,n){if(!o._canFetchPage("refetchConnection"))return{dispose:function(){}};o._refetchVariables=n;var r={count:e,cursor:null,totalCount:e};return{dispose:o._fetchPage(r,pye(t),{force:!0}).unsubscribe}}),(0,$ve.default)((0,Uve.default)(o),"_loadMore",function(e,t,n){if(!o._canFetchPage("loadMore"))return{dispose:function(){}};var r=pye(t),i=o._getConnectionData();if(!i)return oye.create(function(e){return e.complete()}).subscribe(r),null;var s=i.edgeCount+e;if(n&&n.force)return o._refetchConnection(s,t);var a=iye.get();a.END_CURSOR,a.START_CURSOR;var l={count:e,cursor:i.cursor,totalCount:s};return{dispose:o._fetchPage(l,r,n).unsubscribe}});var s=Zve(e.__relayContext),a=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n;return o._isARequestInFlight=!1,o._refetchSubscription=null,o._refetchVariables=null,!0===sye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?o._resolver=aye(s,i,t,e,a):o._resolver=aye(s,i,t,e,a,o._handleFragmentDataUpdate),o.state={data:o._resolver.resolve(),prevContext:s,contextForChildren:s,relayProp:o._buildRelayProp(s),resolverGeneration:0},o._isUnmounted=!1,o._hasFetched=!1,o}(0,Bve.default)(o,r);var c=o.prototype;return c.componentDidMount=function(){this._isUnmounted=!1,!0===sye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},c.componentDidUpdate=function(e,t){!0===sye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&(t.resolverGeneration!==this.state.resolverGeneration?this._subscribeToNewResolverAndRerenderIfStoreHasChanged():this._rerenderIfStoreHasChanged())},c.UNSAFE_componentWillReceiveProps=function(e){var n,r=this,o=Zve(e.__relayContext),s=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n,a=cye(t,this.props),l=cye(t,e),c=Hve(t,this.props),u=Hve(t,e);o.environment===this.state.prevContext.environment&&eye(c,u)&&eye(a,l)?this._hasFetched||this._resolver.setProps(e):(this._cleanup(),!0===sye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?this._resolver=aye(o,i,t,e,s):this._resolver=aye(o,i,t,e,s,this._handleFragmentDataUpdate),this.setState(function(e){return{prevContext:o,contextForChildren:o,relayProp:r._buildRelayProp(o),resolverGeneration:e.resolverGeneration+1}}));var d=this._resolver.resolve();d!==this.state.data&&this.setState({data:d})},c.componentWillUnmount=function(){this._isUnmounted=!0,this._cleanup()},c.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data||n.relayProp!==this.state.relayProp||n.resolverGeneration!==this.state.resolverGeneration)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(n.prevContext.environment!==this.state.prevContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!fye(e[o],this.props[o]))return!0}return!1},c._buildRelayProp=function(e){return{hasMore:this._hasMore,isLoading:this._isLoading,loadMore:this._loadMore,refetchConnection:this._refetchConnection,environment:e.environment}},c._rerenderIfStoreHasChanged=function(){var e=this.state.data,t=this._resolver.resolve();e!==t&&this.setState({data:t})},c._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state.data,t=this._resolver.resolve();this._resolver.setCallback(this.props,this._handleFragmentDataUpdate),e!==t&&this.setState({data:t})},c._getConnectionData=function(){var e=this.props;e.componentRef;var t=(0,jve.default)(e,Gve),n=(0,qve.default)((0,qve.default)({},t),this.state.data),r=s(n);if(null==r)return null;var i=iye.get(),o=i.EDGES,l=i.PAGE_INFO,c=i.HAS_NEXT_PAGE,u=i.HAS_PREV_PAGE,d=i.END_CURSOR,f=i.START_CURSOR;"object"!=typeof r&&tye(!1);var h=r[o],p=r[l];if(null==h||null==p)return null;Array.isArray(h)||tye(!1),"object"!=typeof p&&tye(!1);var g=a===hye?p[c]:p[u],m=a===hye?p[d]:p[f];return"boolean"!=typeof g||0!==h.length&&void 0===m?null:{cursor:m,edgeCount:h.length,hasMore:g}},c._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new Yve),this._queryFetcher},c._canFetchPage=function(e){return!this._isUnmounted},c._fetchPage=function(e,r,i){var o=this,s=Zve(this.props.__relayContext).environment,a=this.props;a.componentRef,a.__relayContext,a.__rootIsQueryRenderer;var c,u=(0,jve.default)(a,Vve),d=(0,qve.default)((0,qve.default)({},u),this.state.data),f=Hve(t,u);c=dye(t,u),c=(0,qve.default)((0,qve.default)((0,qve.default)({},f),c),this._refetchVariables);var h=n.getVariables(d,{count:e.count,cursor:e.cursor},c);("object"!=typeof h||null===h)&&tye(!1),h=(0,qve.default)((0,qve.default)({},h),this._refetchVariables),c=(0,qve.default)((0,qve.default)({},h),c);var p=i?{force:!!i.force}:void 0;null!=p&&null!=(null==i?void 0:i.metadata)&&(p.metadata=null==i?void 0:i.metadata);var g=uye(n.query),m=lye(g,h,p),v=null;this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._hasFetched=!0;var y=function(){o._refetchSubscription===v&&(o._refetchSubscription=null,o._isARequestInFlight=!1)};return this._isARequestInFlight=!0,v=this._getQueryFetcher().execute({environment:s,operation:m,preservePreviousReferences:!0}).mergeMap(function(t){return oye.create(function(t){!function(t,n){var r=o._resolver.resolve();o._resolver.setVariables(l(c,e.totalCount),m.request.node);var i=o._resolver.resolve();eye(r,i)?n():o.setState({data:i,contextForChildren:{environment:o.props.__relayContext.environment}},n)}(0,function(){t.next(),t.complete()})})}).do({error:y,complete:y,unsubscribe:y}).subscribe(r||{}),this._refetchSubscription=this._isARequestInFlight?v:null,v},c._cleanup=function(){this._resolver.dispose(),this._refetchVariables=null,this._hasFetched=!1,this._refetchSubscription&&(this._refetchSubscription.unsubscribe(),this._refetchSubscription=null,this._isARequestInFlight=!1),this._queryFetcher&&this._queryFetcher.dispose()},c.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,jve.default)(t,Kve);return nye.createElement(Qve.Provider,{value:this.state.contextForChildren},nye.createElement(e,(0,zve.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp})))},o}(nye.Component),(0,$ve.default)(r,"displayName",i),r}var mye={createContainer:function(e,t,n){return Wve(e,t,function(e,t){return gye(e,t,n)})}},vye=zre.default,yye=(vye(Hre),vye(Pme),vye(jme),vye(Wre),A),_ye=Sme;_ye.createOperationDescriptor;_ye.deepFreeze;_ye.getRequest;yye.Component;var bye=zre.default,xye=bye(Fme),Sye=bye(cle),wye=bye(Hre),Eye=bye(Pme),kye=bye(jme),Cye=bye(Wre),Aye=["componentRef","__relayContext","__rootIsQueryRenderer"],Nye=tve,Tye=Nve,Rye=qme.getContainerName,Dye=Dme,Iye=Mve,Fye=ive.assertRelayContext,Oye=qie,Pye=A,Mye=Sme,Lye=Mye.Observable,zye=Mye.createFragmentSpecResolver,jye=Mye.createOperationDescriptor,Uye=Mye.getDataIDsFromObject,Bye=Mye.getRequest,$ye=Mye.getVariablesFromObject,qye=Mye.isScalarAndEqual;function Gye(e,t){return{environment:e,refetch:t}}var Vye={createContainer:function(e,t,n){return Nye(e,t,function(e,t){return function(e,t,n){var r,i=Rye(e);return r=function(r){function o(e){var o,s;s=r.call(this,e)||this,(0,Cye.default)((0,Eye.default)(s),"_handleFragmentDataUpdate",function(){var e=s.state.resolver;s.setState(function(t){return e===t.resolver?{data:t.resolver.resolve()}:null})}),(0,Cye.default)((0,Eye.default)(s),"_refetch",function(e,r,i,o){if(s._isUnmounted)return{dispose:function(){}};var a=Fye(s.props.__relayContext).environment,l=Tye(t,s.props),c="function"==typeof e?e(s._getFragmentVariables()):e;c=(0,wye.default)((0,wye.default)({},l),c);var u=r?(0,wye.default)((0,wye.default)({},c),r):c,d=o?{force:!!o.force}:void 0;null!=d&&null!=(null==o?void 0:o.metadata)&&(d.metadata=null==o?void 0:o.metadata);var f,h="function"==typeof i?{next:i,error:i}:i||{},p=Bye(n),g=jye(p,c,d);return s.state.localVariables=c,s._refetchSubscription&&s._refetchSubscription.unsubscribe(),null!=s._getQueryFetcher().lookupInStore(a,g,null==o?void 0:o.fetchPolicy)?(s.state.resolver.setVariables(u,g.request.node),s.setState(function(e){return{data:e.resolver.resolve(),contextForChildren:{environment:s.props.__relayContext.environment}}},function(){h.next&&h.next(),h.complete&&h.complete()}),{dispose:function(){}}):(s._getQueryFetcher().execute({environment:a,operation:g,preservePreviousReferences:!0}).mergeMap(function(e){return s.state.resolver.setVariables(u,g.request.node),Lye.create(function(e){return s.setState(function(e){return{data:e.resolver.resolve(),contextForChildren:{environment:s.props.__relayContext.environment}}},function(){e.next(),e.complete()})})}).finally(function(){s._refetchSubscription===f&&(s._refetchSubscription=null)}).subscribe((0,wye.default)((0,wye.default)({},h),{},{start:function(e){s._refetchSubscription=f=e,h.start&&h.start(e)}})),{dispose:function(){f&&f.unsubscribe()}})});var a=Fye(e.__relayContext),l=null!==(o=e.__rootIsQueryRenderer)&&void 0!==o&&o;s._refetchSubscription=null;var c=zye(a,i,t,e,l);return s.state={data:c.resolve(),localVariables:null,prevProps:e,prevPropsContext:a,contextForChildren:a,relayProp:Gye(a.environment,s._refetch),resolver:c},s._isUnmounted=!1,s}(0,kye.default)(o,r);var s=o.prototype;return s.componentDidMount=function(){this._isUnmounted=!1,this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},s.componentDidUpdate=function(e,t){this.state.resolver!==t.resolver?(t.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},o.getDerivedStateFromProps=function(e,n){var r,o=n.prevProps,s=Fye(e.__relayContext),a=null!==(r=e.__rootIsQueryRenderer)&&void 0!==r&&r,l=Uye(t,o),c=Uye(t,e),u=Tye(t,o),d=Tye(t,e),f=n.resolver;if(n.prevPropsContext.environment!==s.environment||!Oye(u,d)||!Oye(l,c))return{data:(f=zye(s,i,t,e,a)).resolve(),localVariables:null,prevProps:e,prevPropsContext:s,contextForChildren:s,relayProp:Gye(s.environment,n.relayProp.refetch),resolver:f};n.localVariables||f.setProps(e);var h=f.resolve();return h!==n.data?{data:h,prevProps:e}:null},s.componentWillUnmount=function(){this._isUnmounted=!0,this.state.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe()},s.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data||n.relayProp!==this.state.relayProp)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(this.state.prevPropsContext.environment!==n.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!qye(e[o],this.props[o]))return!0}return!1},s._rerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver.resolve();t!==n&&this.setState({data:n})},s._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver,r=n.resolve();n.setCallback(this.props,this._handleFragmentDataUpdate),t!==r&&this.setState({data:r})},s._getFragmentVariables=function(){return $ye(t,this.props)},s._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new Iye),this._queryFetcher},s.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,Sye.default)(t,Aye),i=this.state,o=i.relayProp,s=i.contextForChildren;return Pye.createElement(Dye.Provider,{value:s},Pye.createElement(e,(0,xye.default)({},r,this.state.data,{ref:n,relay:o})))},o}(Pye.Component),(0,Cye.default)(r,"displayName",i),r}(e,t,n)})}};A.createContext({wrapPrepareQueryResource:function(e){return e()}});var Kye=Dme,Wye=kre,Hye=A.useContext;var Jye=function(){var e=Hye(Kye);return null==e&&Wye(!1),e.environment},Xye=A;Xye.useContext,Xye.useEffect;(0,zre.default)(Hre);var Qye=Sme;Qye.__internal.fetchQueryDeduped,Qye.Observable,Qye.PreloadableQueryRegistry,Qye.ReplaySubject,Qye.createOperationDescriptor,Qye.getRequest,Qye.getRequestIdentifier;A.useMemo;var Yye=kre,Zye=function(){function e(e){this._capacity=e,this._capacity>0||Yye(!1),this._map=new Map}var t=e.prototype;return t.set=function(e,t){if(this._map.delete(e),this._map.set(e,t),this._map.size>this._capacity){var n=this._map.keys().next();n.done||this._map.delete(n.value)}},t.get=function(e){var t=this._map.get(e);return null!=t&&(this._map.delete(e),this._map.set(e,t)),t},t.has=function(e){return this._map.has(e)},t.delete=function(e){this._map.delete(e)},t.size=function(){return this._map.size},t.capacity=function(){return this._capacity-this._map.size},t.clear=function(){this._map.clear()},e}();var e_e={create:function(e){return new Zye(e)}},t_e=(0,zre.default)(Wre),n_e=function(){function e(e){var t=this;(0,t_e.default)(this,"_retainCount",0),(0,t_e.default)(this,"_retainDisposable",null),(0,t_e.default)(this,"_releaseTemporaryRetain",null),this._retain=function(n){return t._retainCount++,1===t._retainCount&&(t._retainDisposable=e(n)),{dispose:function(){t._retainCount=Math.max(0,t._retainCount-1),0===t._retainCount&&null!=t._retainDisposable&&(t._retainDisposable.dispose(),t._retainDisposable=null)}}}}var t=e.prototype;return t.temporaryRetain=function(e){var t,n=this;if(e.isServer())return{dispose:function(){}};var r=this._retain(e),i=null,o=function(){clearTimeout(i),i=null,n._releaseTemporaryRetain=null,r.dispose()};return i=setTimeout(o,3e5),null===(t=this._releaseTemporaryRetain)||void 0===t||t.call(this),this._releaseTemporaryRetain=o,{dispose:function(){var e;null===(e=n._releaseTemporaryRetain)||void 0===e||e.call(n)}}},t.permanentRetain=function(e){var t=this._retain(e);return this.releaseTemporaryRetain(),t},t.releaseTemporaryRetain=function(){var e;null===(e=this._releaseTemporaryRetain)||void 0===e||e.call(this),this._releaseTemporaryRetain=null},t.getRetainCount=function(){return this._retainCount},e}(),r_e=zre.default,i_e=r_e(Hre),o_e=r_e(Wre),s_e=e_e,a_e=n_e,l_e=kre,c_e=Sme.isPromise,u_e="store-or-network",d_e="store-and-network",f_e="function"==typeof WeakMap;function h_e(e){return void 0!==e.request.node.params.metadata.live}function p_e(e,t,n,r,i){var o=null!=n?n:h_e(t)?d_e:u_e,s=null!=r?r:e.UNSTABLE_getDefaultRenderPolicy(),a="".concat(o,"-").concat(s,"-").concat(t.request.identifier);return null!=i?"".concat(a,"-").concat(i):a}function g_e(e,t){var n={__id:e.fragment.dataID,__fragments:(0,o_e.default)({},e.fragment.node.name,e.request.variables),__fragmentOwner:e.request};return{cacheIdentifier:t,fragmentNode:e.request.node.fragment,fragmentRef:n,operation:e}}var m_e=2e5;function v_e(e,t,n,r,i,o){var s=h_e(t),a=r,l=i,c=new a_e(function(e){var n=e.retain(t);return{dispose:function(){s&&null!=l&&l.unsubscribe(),n.dispose(),o(u)}}}),u={cacheIdentifier:e,id:m_e++,processedPayloadsCount:0,operationAvailability:n,getValue:function(){return a},setValue:function(e){a=e},setNetworkSubscription:function(e){s&&null!=l&&l.unsubscribe(),l=e},temporaryRetain:function(e){return c.temporaryRetain(e)},permanentRetain:function(e){return c.permanentRetain(e)},releaseTemporaryRetain:function(){c.releaseTemporaryRetain()}};return u}var y_e=function(){function e(e){var t=this;(0,o_e.default)(this,"_clearCacheEntry",function(e){t._cache.delete(e.cacheIdentifier)}),this._environment=e,this._cache=s_e.create(1e3)}var t=e.prototype;return t.prepare=function(e,t,n,r,i,o,s){var a=p_e(this._environment,e,n,r,o);return this.prepareWithIdentifier(a,e,t,n,r,i,s)},t.prepareWithIdentifier=function(e,t,n,r,i,o,s){var a=this._environment,l=null!=r?r:h_e(t)?d_e:u_e,c=null!=i?i:a.UNSTABLE_getDefaultRenderPolicy(),u=this._cache.get(e),d=null,f=null!=u;null==u&&(u=this._fetchAndSaveQuery(e,t,n,l,c,s,(0,i_e.default)((0,i_e.default)({},o),{},{unsubscribe:function(e){null!=d&&d.dispose();var t=null==o?void 0:o.unsubscribe;t&&t(e)}}))),d=u.temporaryRetain(a);var h=u.getValue();if(c_e(h))throw a.__log({name:"suspense.query",fetchPolicy:l,isPromiseCached:f,operation:t,queryAvailability:u.operationAvailability,renderPolicy:c}),h;if(h instanceof Error)throw h;return h},t.retain=function(e,t){var n=this._environment,r=e.cacheIdentifier,i=e.operation,o=this._getOrCreateCacheEntry(r,i,null,e,null),s=o.permanentRetain(n);return n.__log({name:"queryresource.retain",profilerContext:t,resourceID:o.id}),{dispose:function(){s.dispose()}}},t.releaseTemporaryRetain=function(e){var t=this._cache.get(e.cacheIdentifier);null!=t&&t.releaseTemporaryRetain()},t.TESTS_ONLY__getCacheEntry=function(e,t,n,r){var i=p_e(this._environment,e,t,n,r);return this._cache.get(i)},t._getOrCreateCacheEntry=function(e,t,n,r,i){var o=this._cache.get(e);return null==o&&(o=v_e(e,t,n,r,i,this._clearCacheEntry),this._cache.set(e,o)),o},t._fetchAndSaveQuery=function(e,t,n,r,i,o,s){var a,l,c=this,u=this._environment,d=u.check(t),f=d.status,h="available"===f,p=h||"partial"===i&&"stale"!==f,g=function(){};switch(r){case"store-only":a=!1,l=!0;break;case"store-or-network":a=!h,l=p;break;case"store-and-network":a=!0,l=p;break;default:a=!0,l=!1}if(l){var m=g_e(t,e),v=v_e(e,t,d,m,null,this._clearCacheEntry);this._cache.set(e,v)}if(a){var y,_=g_e(t,e);n.subscribe({start:function(n){y=n;var r=c._cache.get(e);r&&r.setNetworkSubscription(y);var i=null==s?void 0:s.start;i&&i((0,i_e.default)((0,i_e.default)({},n),{},{unsubscribe:function(){h_e(t)&&n.unsubscribe()}}))},next:function(){var n=c._getOrCreateCacheEntry(e,t,d,_,y);n.processedPayloadsCount+=1,n.setValue(_),g();var r=null==s?void 0:s.next;null!=r&&r(u.lookup(t.fragment))},error:function(n){var r=c._getOrCreateCacheEntry(e,t,d,n,y);0===r.processedPayloadsCount&&r.setValue(n),g(),y=null,r.setNetworkSubscription(null);var i=null==s?void 0:s.error;i&&i(n)},complete:function(){g(),y=null;var t=c._cache.get(e);t&&t.setNetworkSubscription(null);var n=null==s?void 0:s.complete;n&&n()},unsubscribe:null==s?void 0:s.unsubscribe});var b=this._cache.get(e);if(!b){var x=new Promise(function(e){g=e});x.displayName="Relay("+t.fragment.node.name+")",b=v_e(e,t,d,x,y,this._clearCacheEntry),this._cache.set(e,b)}}else{var S=null==s?void 0:s.complete;S&&S()}var w=this._cache.get(e);return null==w&&l_e(!1),u.__log({name:"queryresource.fetch",resourceID:w.id,operation:t,profilerContext:o,fetchPolicy:r,renderPolicy:i,queryAvailability:d,shouldFetch:a}),w},e}();var __e=f_e?new WeakMap:new Map;var b_e={getQueryResourceForEnvironment:function(e){var t=__e.get(e);if(t)return t;var n=function(e){return new y_e(e)}(e);return __e.set(e,n),n},getQueryCacheIdentifier:p_e};A.useMemo;var x_e=A;x_e.useCallback,x_e.useEffect;var S_e=A,w_e=(0,Sme.__internal.createRelayLoggingContext)(S_e),E_e=A.useContext;var k_e=function(){return E_e(w_e)},C_e=zre.default,A_e=C_e(Hre),N_e=C_e(eie),T_e=C_e(pie),R_e=b_e.getQueryResourceForEnvironment,D_e=Jye,I_e=k_e,F_e=kre,O_e=A;O_e.useDebugValue;var P_e=O_e.useEffect,M_e=O_e.useMemo,L_e=O_e.useRef,z_e=O_e.useState,j_e=Sme,U_e=j_e.__internal,B_e=U_e.fetchQuery,$_e=U_e.getPromiseForActiveRequest,q_e=j_e.RelayFeatureFlags,G_e=j_e.areEqualSelectors,V_e=j_e.createOperationDescriptor,K_e=j_e.getPendingOperationsForFragment,W_e=j_e.getSelector,H_e=j_e.getVariablesFromFragment,J_e=j_e.handlePotentialSnapshotErrors,X_e=j_e.recycleNodesInto;function Q_e(e,t){if("bailout"===t.kind)return null;var n=e.getStore().getEpoch();if(n===t.epoch)return null;if("singular"===t.kind){var r=e.lookup(t.snapshot.selector),i=X_e(t.snapshot.data,r.data),o={data:i,isMissingData:r.isMissingData,missingClientEdges:r.missingClientEdges,missingLiveResolverFields:r.missingLiveResolverFields,seenRecords:r.seenRecords,selector:r.selector,fieldErrors:r.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:n}]}for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var c=t.snapshots[l],u=e.lookup(c.selector),d=X_e(c.data,u.data),f={data:d,isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors};d!==c.data&&(s=!0),a.push(f)}return a.length!==t.snapshots.length&&F_e(!1),[s,{kind:"plural",snapshots:a,epoch:n}]}function Y_e(e,t,n,r,i){var o=H_e(t,n),s=(0,A_e.default)((0,A_e.default)({},o),{},{id:r.clientEdgeDestinationID}),a=V_e(r.request,s,null==i?void 0:i.networkCacheConfig);return[R_e(e).prepare(a,B_e(e,a),null==i?void 0:i.fetchPolicy),$_e(e,a.request)]}function Z_e(e,t){return null==t?{kind:"bailout"}:"PluralReaderSelector"===t.kind?{kind:"plural",snapshots:t.selectors.map(function(t){return e.lookup(t)}),epoch:e.getStore().getEpoch()}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch()}}var ebe=function(e,t,n,r){var i,o,s=M_e(function(){return W_e(e,t)},[e,t]),a=!0===(null==e||null===(i=e.metadata)||void 0===i?void 0:i.plural);a?null==t||Array.isArray(t)||F_e(!1):Array.isArray(t)&&F_e(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||F_e(!1);var l,c=D_e();q_e.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=I_e());var u=z_e(function(){return Z_e(c,s)}),d=u[0],f=u[1],h=d,p=z_e(h),g=p[0],m=p[1],v=g,y=z_e(s),_=y[0],b=y[1],x=z_e(c),S=x[0],w=x[1];if(!G_e(s,_)||c!==S){b(s),w(c);var E=Z_e(c,s);f(E),m(E),h=E,v=E}var k=L_e(!1);if(P_e(function(){k.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||q_e.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var C=M_e(function(){var n,i=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingClientEdges)&&void 0!==t?t:null;var n,r=null,i=(0,N_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingClientEdges){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,N_e.default)(o.missingClientEdges);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h),o=[];if(null!=i&&i.length){n=[];var s,a=(0,N_e.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=Y_e(c,e,t,l,r),d=u[0],f=u[1];n.push(d),null!=f&&o.push(f)}}catch(p){a.e(p)}finally{a.f()}}return[n,o]},[h,c,e,t,r]),A=C[0],N=C[1];if(N.length)throw Promise.all(N);P_e(function(){var e=R_e(c);if(null!=A&&A.length){var t,n=[],r=(0,N_e.default)(A);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(e.retain(i))}}catch(o){r.e(o)}finally{r.f()}return function(){for(var e=0,t=n;e<t.length;e++){t[e].dispose()}}}},[c,A])}if(function(e){return"bailout"!==e.kind&&("singular"===e.kind?e.snapshot.isMissingData:e.snapshots.some(function(e){return e.isMissingData}))}(h)){var T=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingLiveResolverFields)&&void 0!==t?t:null;var n,r=null,i=(0,N_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingLiveResolverFields){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,N_e.default)(o.missingLiveResolverFields);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h);if(null!=T&&T.length>0)throw Promise.all(T.map(function(e){return c.getStore().getLiveResolverPromise(e)}));if(q_e.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==S||!k.current||!G_e(k.current,s)){null==s&&F_e(!1);var R="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,D=K_e(c,e,R);if(D)throw D.promise}}!function(e,t,n){if("singular"===t.kind)J_e(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,N_e.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;J_e(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var I,F=L_e(!1);if(P_e(function(){var e=v,t=Q_e(c,v);if(null!==t){var n=t[0],r=t[1];n&&f(r),e=r}return function(e,t,n,r){if("bailout"===t.kind)return function(){};if("singular"===t.kind){var i=e.subscribe(t.snapshot,function(t){n(function(n){if("singular"!==n.kind||n.snapshot.selector!==t.selector){var i=Q_e(e,n);if(null!=i){var o=i[0],s=i[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:o}),r.current=o,o?s:n}return n}return r.current=!0,{kind:"singular",snapshot:t,epoch:e.getStore().getEpoch()}})});return function(){i.dispose()}}var o=t.snapshots.map(function(t,i){return e.subscribe(t,function(t){n(function(n){var o;if("plural"!==n.kind||(null===(o=n.snapshots[i])||void 0===o?void 0:o.selector)!==t.selector){var s=Q_e(e,n);if(null!=s){var a=s[0],l=s[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:a}),r.current=r.current||a,a?l:n}return n}var c=(0,T_e.default)(n.snapshots);return c[i]=t,r.current=!0,{kind:"plural",snapshots:c,epoch:e.getStore().getEpoch()}})})});return function(){var e,t=(0,N_e.default)(o);try{for(t.s();!(e=t.n()).done;)e.value.dispose()}catch(n){t.e(n)}finally{t.f()}}}(c,e,f,F)},[c,v]),F.current){var O=Q_e(c,h);if(null!=O){var P=O[0],M=O[1];P&&(f(M),h=M)}F.current=!1}if(a){var L=null==t;I=M_e(function(){return"bailout"===h.kind?L?null:[]:("plural"!==h.kind&&F_e(!1),h.snapshots.map(function(e){return e.data}))},[h,L])}else"bailout"===h.kind?I=null:("singular"!==h.kind&&F_e(!1),I=h.snapshot.data);return q_e.LOG_MISSING_RECORDS_IN_PROD&&null!=t&&(void 0===I||Array.isArray(I)&&I.length>0&&I.every(function(e){return void 0===e})),I},tbe=zre.default,nbe=tbe(Hre),rbe=tbe(eie),ibe=tbe(pie),obe=b_e.getQueryResourceForEnvironment,sbe=Jye,abe=k_e,lbe=kre,cbe=A;cbe.useDebugValue;var ube=cbe.useEffect,dbe=cbe.useMemo,fbe=cbe.useRef,hbe=cbe.useState,pbe=Sme,gbe=pbe.__internal,mbe=gbe.fetchQuery,vbe=gbe.getPromiseForActiveRequest,ybe=pbe.RelayFeatureFlags,_be=pbe.areEqualSelectors,bbe=pbe.createOperationDescriptor,xbe=pbe.getPendingOperationsForFragment,Sbe=pbe.getSelector,wbe=pbe.getVariablesFromFragment,Ebe=pbe.handlePotentialSnapshotErrors,kbe=pbe.recycleNodesInto;function Cbe(e,t){if("bailout"===t.kind)return null;var n=e.getStore().getEpoch();if(n===t.epoch)return null;if("singular"===t.kind){var r=e.lookup(t.snapshot.selector),i=kbe(t.snapshot.data,r.data),o={data:i,isMissingData:r.isMissingData,missingClientEdges:r.missingClientEdges,missingLiveResolverFields:r.missingLiveResolverFields,seenRecords:r.seenRecords,selector:r.selector,fieldErrors:r.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:n,selector:t.selector,environment:t.environment}]}for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var c=t.snapshots[l],u=e.lookup(c.selector),d=kbe(c.data,u.data),f={data:d,isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors};d!==c.data&&(s=!0),a.push(f)}return a.length!==t.snapshots.length&&lbe(!1),[s,{kind:"plural",snapshots:a,epoch:n,selector:t.selector,environment:t.environment}]}function Abe(e,t,n,r,i){var o=wbe(t,n),s=(0,nbe.default)((0,nbe.default)({},o),{},{id:r.clientEdgeDestinationID}),a=bbe(r.request,s,null==i?void 0:i.networkCacheConfig),l=obe(e).prepare(a,mbe(e,a),null==i?void 0:i.fetchPolicy),c=vbe(e,a.request);return null!=c&&null==c.displayName&&(c.displayName=r.request.params.name),[l,c]}function Nbe(e,t,n){if("bailout"===t.kind)return function(){};if("singular"===t.kind){var r=e.subscribe(t.snapshot,function(r){n(function(n){var i=null;if("singular"!==n.kind||n.snapshot.selector!==r.selector||n.environment!==e){var o=Cbe(n.environment,n);if(null!=o){var s=o[0],a=o[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:s}),i=s?a:n}else i=n}else i={kind:"singular",snapshot:r,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment};return i})});return function(){r.dispose()}}var i=t.snapshots.map(function(r,i){return e.subscribe(r,function(r){n(function(n){var o,s=null;if("plural"!==n.kind||(null===(o=n.snapshots[i])||void 0===o?void 0:o.selector)!==r.selector||n.environment!==e){var a=Cbe(n.environment,n);if(null!=a){var l=a[0],c=a[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:l}),s=l?c:n}else s=n}else{var u=(0,ibe.default)(n.snapshots);u[i]=r,s={kind:"plural",snapshots:u,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment}}return s})})});return function(){var e,t=(0,rbe.default)(i);try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}}}function Tbe(e,t){return null==t?{kind:"bailout",environment:e}:"PluralReaderSelector"===t.kind?{kind:"plural",snapshots:t.selectors.map(function(t){return e.lookup(t)}),epoch:e.getStore().getEpoch(),selector:t,environment:e}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch(),selector:t,environment:e}}var Rbe=function(e,t,n,r){var i,o,s=dbe(function(){return Sbe(e,t)},[e,t]),a=!0===(null==e||null===(i=e.metadata)||void 0===i?void 0:i.plural);a?null==t||Array.isArray(t)||lbe(!1):Array.isArray(t)&&lbe(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||lbe(!1);var l,c=sbe();ybe.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=abe());var u=hbe(function(){return Tbe(c,s)}),d=u[0],f=u[1],h=d,p=h.environment;if(!_be(s,h.selector)||c!==h.environment){var g=Tbe(c,s);f(g),h=g}var m=fbe(!1);if(ube(function(){m.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||ybe.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var v=dbe(function(){var n,i=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingClientEdges)&&void 0!==t?t:null;var n,r=null,i=(0,rbe.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingClientEdges){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,rbe.default)(o.missingClientEdges);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h),o=[];if(null!=i&&i.length){n=[];var s,a=(0,rbe.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=Abe(c,e,t,l,r),d=u[0],f=u[1];n.push(d),null!=f&&o.push(f)}}catch(p){a.e(p)}finally{a.f()}}return[n,o]},[h,c,e,t,r]),y=v[0],_=v[1];if(_.length){var b=Promise.all(_);throw b.displayName="RelayClientEdge(".concat(_.map(function(e){return e.displayName}).join(","),")"),b}ube(function(){var e=obe(c);if(null!=y&&y.length){var t,n=[],r=(0,rbe.default)(y);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(e.retain(i))}}catch(o){r.e(o)}finally{r.f()}return function(){for(var e=0,t=n;e<t.length;e++){t[e].dispose()}}}},[c,y])}if(function(e){return"bailout"!==e.kind&&("singular"===e.kind?e.snapshot.isMissingData:e.snapshots.some(function(e){return e.isMissingData}))}(h)){var x=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingLiveResolverFields)&&void 0!==t?t:null;var n,r=null,i=(0,rbe.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingLiveResolverFields){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,rbe.default)(o.missingLiveResolverFields);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h);if(null!=x&&x.length>0){var S=Promise.all(x.map(function(e){return c.getStore().getLiveResolverPromise(e)}));throw S.displayName="RelayLiveResolver("+e.name+")",S}if(ybe.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==p||!m.current||!_be(m.current,s)){null==s&&lbe(!1);var w="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,E=xbe(c,e,w);if(E)throw E.promise}}!function(e,t,n){if("singular"===t.kind)Ebe(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,rbe.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;Ebe(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var k,C=fbe(null);if(ube(function(){var e=C.current;if(null!=e){if(h.environment===e.environment&&h.selector===e.selector)return;e.dispose()}if("bailout"!==h.kind){var t=h,n=Cbe(h.environment,h);if(null!==n){var r=n[0],i=n[1];if(r)return void f(i);t=i}var o=Nbe(h.environment,t,f);C.current={dispose:o,selector:h.selector,environment:h.environment}}},[h]),ube(function(){if(null==C.current&&"bailout"!==h.kind){var e=Nbe(h.environment,h,f);C.current={dispose:e,selector:h.selector,environment:h.environment}}return function(){var e;null===(e=C.current)||void 0===e||e.dispose(),C.current=null}},[]),a){var A=null==t;k=dbe(function(){return"bailout"===h.kind?A?null:[]:("plural"!==h.kind&&lbe(!1),h.snapshots.map(function(e){return e.data}))},[h,A])}else"bailout"===h.kind?k=null:("singular"!==h.kind&&lbe(!1),k=h.snapshot.data);return ybe.LOG_MISSING_RECORDS_IN_PROD&&null!=t&&(void 0===k||Array.isArray(k)&&k.length>0&&k.every(function(e){return void 0===e})),k},Dbe=zre.default;Dbe(ebe),Dbe(Rbe);var Ibe=A;Ibe.useContext,Ibe.useEffect,Ibe.useState,Ibe.useRef,A.useState;var Fbe=A,Obe=Sme;Obe.createOperationDescriptor,Obe.getRequest,Fbe.useMemo,Sme.__internal.fetchQuery,(0,zre.default)(Hre);var Pbe=A;Pbe.useEffect,Pbe.useRef,(0,zre.default)(eie);var Mbe=A;Mbe.useCallback,Mbe.useEffect,Mbe.useRef,Mbe.useState,A.useDebugValue,Sme.getFragment,(0,zre.default)(Hre);var Lbe=A;Sme.commitMutation,Lbe.useState,Lbe.useEffect,Lbe.useRef,Lbe.useCallback;var zbe=Sme;zbe.ConnectionInterface,zbe.getValueAtPath;var jbe=A,Ube=Sme;Ube.__internal.getObservableForActiveRequest,Ube.getSelector,jbe.useEffect,jbe.useState,jbe.useMemo,(0,zre.default)(Hre);var Bbe=A;Bbe.useCallback,Bbe.useRef,Bbe.useState;var $be=Sme;$be.__internal.fetchQuery,$be.createOperationDescriptor,$be.getPaginationVariables,$be.getRefetchMetadata,$be.getSelector,(0,zre.default)(Hre);var qbe=A;qbe.useCallback,qbe.useEffect,qbe.useState;var Gbe=Sme;Gbe.__internal.fetchQuery,Gbe.RelayFeatureFlags,Gbe.createOperationDescriptor,Gbe.getPaginationVariables,Gbe.getRefetchMetadata,Gbe.getSelector;var Vbe=zre.default;Vbe(Hre),Vbe(eie);var Kbe=Sme;Kbe.__internal.fetchQuery,Kbe.RelayFeatureFlags,Kbe.createOperationDescriptor,Kbe.getPendingOperationsForFragment,Kbe.getSelector,Kbe.getVariablesFromFragment,Kbe.handlePotentialSnapshotErrors,(0,zre.default)(eie);var Wbe=A;Wbe.useCallback,Wbe.useEffect,Wbe.useInsertionEffect,Wbe.useRef,Wbe.useState,Sme.getRequest,(0,zre.default)(eie);var Hbe=A;Hbe.useCallback,Hbe.useEffect,Hbe.useRef,Hbe.useState;var Jbe=Sme;Jbe.RelayFeatureFlags,Jbe.getRequest,(0,zre.default)(Hre);var Xbe=A;Xbe.useCallback,Xbe.useContext,Xbe.useReducer;var Qbe=Sme;Qbe.__internal.fetchQuery,Qbe.createOperationDescriptor,Qbe.getFragmentIdentifier,Qbe.getRefetchMetadata,Qbe.getSelector,Qbe.getValueAtPath,(0,zre.default)(Hre);var Ybe=A;Ybe.useCallback,Ybe.useDebugValue,Ybe.useState;var Zbe=Sme;Zbe.RelayFeatureFlags,Zbe.getFragment,Zbe.getFragmentIdentifier,Zbe.getPaginationMetadata,(0,zre.default)(Hre);var exe=A;exe.useCallback,exe.useDebugValue,exe.useEffect,exe.useLayoutEffect,exe.useMemo,exe.useRef,exe.useState;var txe=Sme;txe.getFragment,txe.getFragmentIdentifier,txe.getPaginationMetadata;var nxe=Sme;nxe.ConnectionInterface,nxe.RelayFeatureFlags,nxe.getSelector,nxe.getValueAtPath,A.useDebugValue;var rxe=Sme.__internal;rxe.fetchQueryDeduped,rxe.fetchQuery,A.useDebugValue,Sme.getFragment;var ixe=A;ixe.useEffect,ixe.useRef,A.useEffect,Sme.requestSubscription;var oxe=Dme,sxe=wve,axe=mye,lxe=Vye,cxe=Sme,uxe={ConnectionHandler:cxe.ConnectionHandler,MutationTypes:cxe.MutationTypes,RangeOperations:cxe.RangeOperations,ReactRelayContext:oxe,applyOptimisticMutation:cxe.applyOptimisticMutation,commitLocalUpdate:cxe.commitLocalUpdate,commitMutation:cxe.commitMutation,createFragmentContainer:sxe.createContainer,createPaginationContainer:axe.createContainer,createRefetchContainer:lxe.createContainer,fetchQuery_DEPRECATED:cxe.fetchQuery_DEPRECATED,graphql:cxe.graphql,readInlineData:cxe.readInlineData,requestSubscription:cxe.requestSubscription,fetchQuery:cxe.fetchQuery};let dxe={make:function(e){let t=uxe.ReactRelayContext.Provider;return c(t,{value:{environment:e.environment},children:e.children})}},fxe=dxe;let hxe=function(e){let t=e.config,n=Iq(),r=p(()=>function(e,t,n){return Tme.make(Sme.Network.create(async(r,i,o,s)=>{let a=U(R(r.text),""),l=a.includes("Platform")||a.includes("platform")?e.platformApiEndpoint:e.apiEndpoint,c=Object.fromEntries([["content-type","application/json"]]),u=t();void 0!==u&&(c.Authorization="Bearer "+u);let d=(await fetch(l,{method:"POST",headers:c,body:U(JSON.stringify({query:a,variables:i}),"")})).json,f=await d();return pte(f)&&n(),f}),Ame.make(new Sme.RecordSource,void 0,void 0),void 0,void 0,void 0,void 0,void 0)}(t,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),[t,n]);return i(fxe.make,{environment:r,children:e.children})};function pxe(e){return"var("+e+")"}let gxe=co([ui("background",pxe(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",pxe(St.md)),ui("padding",pxe(bt.lg)),gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",pxe(bt.sm)),ui("min-height","160px"),$i("center"),Vi({NAME:"percent",VAL:100}),ui("box-sizing","border-box")]),mxe=co([ui("font-size","32px"),ui("line-height","1"),Ri(to(4))]),vxe=co([ui("color",pxe(_t.textPrimary)),ui("font-size",pxe(xt.sizeMd)),ui("font-weight",pxe(xt.weightMedium)),Ri(to(4))]),yxe=co([ui("color",pxe(_t.textSecondary)),ui("font-size",pxe(xt.sizeSm)),ui("line-height",pxe(xt.lineHeightNormal))]),_xe=co([ui("color",pxe(_t.textDisabled)),ui("font-size",pxe(xt.sizeXs)),ui("font-family",pxe(xt.fontFamilyMono)),Ti(to(8))]);let bxe=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:mxe}),i("div",{children:t.title,className:vxe}),i("div",{children:t.description,className:yxe}),i("div",{children:t.extensionPackage,className:_xe})],className:gxe})},xxe=co([gi("flex"),di("center"),xi("center"),ui("min-height","160px"),ui("color","var("+_t.textSecondary+")"),ui("font-size","var("+xt.sizeSm+")")]);function Sxe(e){return i("div",{children:"Loading…",className:xxe})}co([gi("flex"),di("center"),xi("center"),ui("min-height","160px"),ui("color","var("+_t.error+")"),ui("font-size","var("+xt.sizeSm+")")]);let wxe=function(e){let t=mG(),n=function(e){let t=d(dV);if(void 0!==t)return t.getPanel(e)}(e.fragmentId);if(void 0===n)return null;let r=n.requiredAccess;return void 0===r||t(r)?i(S,{children:n.component(e.props),fallback:i(Sxe,{})}):i(bxe,{definition:n})};let Exe=function(e){let t=function(e){let t=d(dV);return void 0!==t?t.getPanelsForPosition(e):[]}(e.name),n={contextId:e.contextId,resourceId:e.resourceId};return 0!==t.length?i("div",{children:t.map(e=>i(wxe,{fragmentId:e.fragmentId,props:n},e.fragmentId)),style:{display:"flex",flexDirection:"column",gap:"1rem"}}):null};let kxe=function(e){return r("div",{children:[r("header",{children:[i("h1",{children:"Platform overview",style:{margin:"0"}}),i("p",{children:"Summary panels contributed by connected plugins appear below.",style:{color:"#666",margin:"0.25rem 0 0"}})]}),i(Exe,{name:"platform-summary"})],style:{display:"flex",fontFamily:"system-ui",padding:"1.5rem",flexDirection:"column",gap:"1.5rem"}})},Cxe={fragmentId:"host.home",title:"Home",menuEntry:{label:"Home",icon:void 0,group:void 0,sortOrder:0},requiredAccess:void 0,url:"/"};let Axe=function(e){let t=e.config,n=d(cG),r=NV(),o=fG(),s=se(void 0),l=function(e){return j(z(e.home,e=>e.trim()),e=>""===e||"/"===e?void 0:e)}(t);return a(()=>{!t.autoRedirectFirstPage&&q(l)&&(M(n,e=>e.register([Cxe])),M(r,e=>e.register([Be(ze(e=>e),i(kxe,{}))],{})))},[]),a(()=>{if((""===s||"/"===s)&&0!==o.length)if(void 0!==l)J(l);else if(t.autoRedirectFirstPage){let e=o.find(e=>!!$(e.url)&&hG(e));if(void 0!==e){let t=e.url;void 0!==t&&J(t)}}},[o.length,s]),null};function Nxe(e,t){return j(j(ht(e),e=>Xe(e,t)),ht)}function Txe(e){let t=Nxe(e,"Upload_Release");return void 0!==t?vt(j(Xe(t,"released"),gt),!0)?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:U(j(Xe(t,"reason"),dt),"Could not release the uploaded file")}:{TAG:"Error",_0:"Could not release the uploaded file"}}function Rxe(e,t){return{upload:(n,r)=>{let i=n.type;return ce(e()("mutation UploadPresign($store: ID!, $fileName: String!, $contentType: String) {\n Upload_Presign(store: $store, fileName: $fileName, contentType: $contentType) {\n uploadUrl\n storageRef\n }\n}",Ze([["store",t],["fileName",n.name],["contentType",i]])).then(e=>{let t=function(e){return j(Nxe(e,"Upload_Presign"),e=>{let t=j(Xe(e,"uploadUrl"),dt),n=j(Xe(e,"storageRef"),dt);if(void 0!==t&&void 0!==n)return{uploadUrl:t,storageRef:n}})}(e);return void 0!==t?function(e,t,n,r,i){return new Promise((o,s)=>{let a=new XMLHttpRequest;a.open("PUT",e),a.setRequestHeader("Content-Type",r),a.upload.onprogress=e=>{if(e.lengthComputable&&e.total>0)return i(e.loaded/e.total*100)},a.onload=()=>{let e=a.status;return e>=200&&e<300?(i(100),o({TAG:"Ok",_0:t})):o({TAG:"Error",_0:"Upload failed (status "+e.toString()+")"})},a.onerror=()=>o({TAG:"Error",_0:"Upload failed (network error)"}),a.send(n)})}(t.uploadUrl,t.storageRef,n,i,r):Promise.resolve({TAG:"Error",_0:"Could not obtain an upload target"})}),e=>Promise.resolve({TAG:"Error",_0:"Upload request failed"}))},remove:n=>ce(e()("mutation UploadRelease($store: ID!, $storageRef: String!) {\n Upload_Release(store: $store, storageRef: $storageRef) {\n released\n reason\n }\n}",Ze([["store",t],["storageRef",n]])).then(Txe),e=>Promise.resolve({TAG:"Error",_0:"Release request failed"}))}}let Dxe={pages:[],panels:[],routes:[]};function Ixe(e){return r("div",{children:[i("h1",{children:"Shell failed to boot"}),i("pre",{children:e.message})],style:{color:"#a00",fontFamily:"system-ui",padding:"2rem"}})}function Fxe(e){return i("div",{children:"Loading…",style:{fontFamily:"system-ui",padding:"2rem"}})}function Oxe(e){let t=e.extensions,n=d(cG),r=d(dV),i=NV();return a(()=>{0!==t.pages.length&&M(n,e=>e.register(t.pages)),0!==t.panels.length&&M(r,e=>e.register(t.panels)),0!==t.routes.length&&M(i,e=>e.register(t.routes,{}))},[]),null}function Pxe(e){let t=e.uiHints,n=e.config,s=function(){let e=d(_V).routes;return p(()=>Me(function(e){let t=e.length-1|0,n=0;for(;;){let r=n,i=t;if(i<0)return r;n={hd:e[i],tl:r},t=i-1|0}}(e.toReversed())),[e])}(),l=d(bV),c=function(e){let t=e.appName,n=e.platformName;return void 0!==t&&""!==t.trim()?t.trim():void 0!==n&&""!==n.trim()?lt(n):"Reventless"}(n),u=r(o,{children:[i(ere,{}),i(BV,{}),i(eG,{})]});return a(()=>{document.title=c},[c]),r(o,{children:[i(Axe,{config:n}),i(Nne,{config:n,uiHints:t}),i(Oxe,{extensions:e.extensions}),i(uV,{appName:c,logoUrl:n.logoUrl,router:s,headerSlot:u,fallback:i(Pne,{config:n,uiHints:t}),routesReady:l,loading:i(Fxe,{})})]})}function Mxe(e){let t=e.discoverPlatforms,n=gV(se(void 0));if(void 0===n)return void 0!==t?i(XV,{discover:t}):i(Ixe,{message:"config.json sets mode = fleet but the app supplied no discoverPlatforms adapter to ShellApp"});let r=n[0];return i(vV,{scope:r,children:i(ne,{value:{prefix:pV(r),path:n[1]},children:i(Pxe,{config:e.config,extensions:e.extensions,uiHints:e.uiHints})})})}function Lxe(e){let t=e.access;return i(vG,{access:t,children:i(dG,{children:i(hV,{access:t,children:i(AV,{children:i(Ka,{children:i(HI.Provider.make,{children:i(hne,{children:e.children})})})})})})})}function zxe(e){let t,n=e.uiHints,r=e.extensions,o=e.config,s=Iq();if("Single"===o.mode){let e=o.environment,s=o.platformName;t=void 0!==e&&void 0!==s?i(vV,{scope:{environment:e,platformName:s},children:i(Pxe,{config:o,extensions:r,uiHints:n})}):i(Pxe,{config:o,extensions:r,uiHints:n})}else t=i(Mxe,{config:o,extensions:r,uiHints:n,discoverPlatforms:e.discoverPlatforms});if("Anonymous"===o.authMode)return i(Lxe,{access:o.accessTiers,children:t});if(void 0===s)return i(sG,{});let a=s.identity;return void 0!==a&&s.isAuthenticated?i(Lxe,{access:a.groups.concat(o.accessTiers),children:t}):i(sG,{})}function jxe(e){let t=e.config,n=Iq();!function(e){We.contents=e}(t.assetOrigins);let o,s=se(void 0),l=t.mode;o="Single"===l?void 0:z(gV(s),e=>e[0]);let c=L(o,"",e=>e.environment+"|"+e.platformName),u=p(()=>{let e=function(e,t,n,r){return(i,o)=>{let s=i.includes("Platform")||i.includes("platform")?t:e,a=Object.fromEntries([["content-type","application/json"]]),l=n();return void 0!==l&&(a.Authorization="Bearer "+l),fetch(s,{method:"POST",headers:a,body:U(JSON.stringify({query:i,variables:o}),"")}).then(e=>(401===e.status&&r(),e.json())).then(e=>{let t=JO(e);return QO(t)&&r(),Promise.resolve(t)})}}(t.apiEndpoint,t.platformApiEndpoint,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),r=void 0!==o?(i=KV(o),e=>(t,n)=>{let r={contents:void 0};return i((t,n)=>e(t,n).then(e=>(r.contents=e,e.data)))(t,n).then(e=>{let t=r.contents;return void 0!==t?t:{data:e,errors:[]}})})(e):e;var i;return[YO(r),r]},[t,n,c]),d=u[0],f=h(d);f.current=d,EI.contents=d,a(()=>{let e={};wre(t=>(t=>{let n=e[t];if(void 0!==n)return n;let r=Rxe(()=>f.current,t);return e[t]=r,r})(t),void 0,void 0)},[]);let g=U(t.theme,"Light"),m=L(j(n,e=>e.identity),"anonymous",e=>e.userId+"|"+e.groups.toSorted(ue).join(","));return i(AI,{execute:d,executeResult:u[1],children:i(hxe,{config:t,children:r(EO,{domainEventsEndpoint:t.domainApiEventsEndpoint,platformEventsEndpoint:t.platformApiEventsEndpoint,liveUpdates:t.liveUpdates,liveReconnectRefetch:t.liveReconnectRefetch,clientEventsNamespace:t.clientEventsNamespace,onAuthFailure:()=>M(n,e=>e.logout()),platformReadModelPrefixes:t.platformReadModelPrefixes,getToken:()=>j(n,e=>e.getToken()),children:[i(tre,{config:t,onChange:e.reloadUiHints}),i(sO,{initialPreset:g,children:i(zxe,{config:t,extensions:e.extensions,uiHints:e.uiHints,discoverPlatforms:e.discoverPlatforms})})]})})},m)}function Uxe(e,t){let n=s(()=>{}),r=n[1],i=n[0],o=f(()=>{(function(e){return ce(fetch(e).then(t=>t.ok?t.json().then(FF):(console.warn("[AutoUI] "+e+": not loaded (status "+t.status.toString()+") — no UI hints applied"),Promise.resolve({}))),t=>(console.warn("[AutoUI] "+e+": not loaded ("+String(t)+") — no UI hints applied"),Promise.resolve({})))})(e.uiHintsUrl).then(e=>r(t=>e))},[e.uiHintsUrl]);a(()=>{o()},[e.uiHintsUrl]);let l=p(()=>z(i,e=>function(e,t){let n={};return Object.entries(e).forEach(e=>{n[e[0]]=e[1]}),Object.entries(t).forEach(t=>{let r=t[0];$(e[r])&&console.info("[AutoUI] uiHints ("+r+"): code-supplied hints replace the ui-hints.json entry"),n[r]=t[1]}),n}(e,U(t.uiHints,{}))),[i]);return[l,o]}function Bxe(e){let t=e.extensions,n=e.config,r=Uxe(n,t),o=r[0];return i(Dq,{authMode:n.authMode,apiEndpoint:n.apiEndpoint,cognitoClientId:n.identityProviderClientId,cognitoUserPoolId:n.identityProviderId,region:n.region,children:void 0!==o?i(jxe,{config:n,extensions:t,uiHints:o,reloadUiHints:r[1],discoverPlatforms:e.discoverPlatforms}):i(Fxe,{})})}let $xe=function(e){let t=e.registerModes,n=e.extensions,r=void 0!==n?n:Dxe,o=s(()=>"LoadingConfig"),l=o[1],c=o[0];return a(()=>{ce(fetch("/config.json").then(e=>e.ok?e.json().then(VO):Promise.resolve({TAG:"Error",_0:"config.json: fetch failed with status "+e.status.toString()})),e=>Promise.resolve({TAG:"Error",_0:"config.json: fetch threw — "+String(e)})).then(e=>{if("Ok"===e.TAG){let n=e._0;return void 0!==t?ce(t(n).then(()=>l(e=>({TAG:"Ready",_0:n}))),e=>(console.error("[ShellApp] optional view modes failed to register — continuing without them: "+String(e)),l(e=>({TAG:"Ready",_0:n})),Promise.resolve())):(l(e=>({TAG:"Ready",_0:n})),Promise.resolve())}let n=e._0;return l(e=>({TAG:"Failed",_0:n})),Promise.resolve()})},[]),"object"!=typeof c?i(Fxe,{}):"Ready"===c.TAG?i(Bxe,{config:c._0,extensions:r,discoverPlatforms:e.discoverPlatforms}):i(Ixe,{message:c._0})},qxe=document.querySelector("#root");if(null!=qxe){n(qxe).render(i($xe,{registerModes:async function(e){await Promise.all(e.viewModes.map(async n=>{try{return await async function(e,n){switch(e){case"graph":let r=await t(()=>import("./GraphMode.res-KmA2lHEG.js"),__vite__mapDeps([1,2])).then(e=>e.init);r(n.graphLayout,void 0);let i=await t(()=>import("./StateMachineDiagram.res-LhoVIZCt.js"),__vite__mapDeps([3,2])).then(e=>e.init);return i();case"map":let o=await t(()=>import("./MapMode.res-Dt2re0Fu.js"),__vite__mapDeps([4])).then(e=>e.init),s=await t(()=>import("./Geocoder.res-BghBa-Tc.js"),__vite__mapDeps([5])).then(e=>e.fromShell);return o(n.mapStyle,s(),void 0);default:return void console.error('[host-shell] config.json viewModes: unknown mode "'+e+'" — known modes: '+O.join(", "))}}(n,e)}catch(r){let e=F(r);if(e.RE_EXN_ID===I)return void console.error('[host-shell] view mode "'+n+'" failed to load: '+String(e._1));throw e}}))}}))}export{ce as $,D as A,z as B,NQ as C,fe as D,_t as E,bt as F,xt as G,xa as H,ht as I,R as J,$ as K,ft as L,mD as M,qD as N,EI as O,TP as P,AP as Q,St as R,AQ as S,TQ as T,c7 as a,Xe as b,bQ as c,ge as d,me as e,M as f,U as g,lt as h,Is as i,nI as j,rI as k,Sa as l,dt as m,j as n,QZ as o,WZ as p,pt as q,ZI as r,_Q as s,XZ as t,L as u,HZ as v,iF as w,Ze as x,nO as y,T as z};