This commit is contained in:
admin committed 2026-07-07 14:50:40 +07:00
1 parent ce0d83c281
commit 7760217423
2 files changed
+209 -93

No files matched your search

+207 -91
View File
@@ -6,85 +6,201 @@
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20class%3D%22iconify%20iconify--logos%22%20width%3D%2231.88%22%20height%3D%2232%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%20viewBox%3D%220%200%20256%20257%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb466%22%20x1%3D%22-.828%25%22%20x2%3D%2257.636%25%22%20y1%3D%227.652%25%22%20y2%3D%2278.411%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%2341D1FF%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23BD34FE%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb467%22%20x1%3D%2243.376%25%22%20x2%3D%2250.316%25%22%20y1%3D%222.242%25%22%20y2%3D%2289.03%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23FFEA83%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%228.333%25%22%20stop-color%3D%22%23FFDD35%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23FFA800%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb466)%22%20d%3D%22M255.153%2037.938L134.897%20252.976c-2.483%204.44-8.862%204.466-11.382.048L.875%2037.958c-2.746-4.814%201.371-10.646%206.827-9.67l120.385%2021.517a6.537%206.537%200%200%200%202.322-.004l117.867-21.483c5.438-.991%209.574%204.796%206.877%209.62Z%22%3E%3C%2Fpath%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb467)%22%20d%3D%22M185.432.063L96.44%2017.501a3.268%203.268%200%200%200-2.634%203.014l-5.474%2092.456a3.268%203.268%200%200%200%203.997%203.378l24.777-5.718c2.318-.535%204.413%201.507%203.936%203.838l-7.361%2036.047c-.495%202.426%201.782%204.5%204.151%203.78l15.304-4.649c2.372-.72%204.652%201.36%204.15%203.788l-11.698%2056.621c-.732%203.542%203.979%205.473%205.943%202.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505%204.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E" /> <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20class%3D%22iconify%20iconify--logos%22%20width%3D%2231.88%22%20height%3D%2232%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%20viewBox%3D%220%200%20256%20257%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb466%22%20x1%3D%22-.828%25%22%20x2%3D%2257.636%25%22%20y1%3D%227.652%25%22%20y2%3D%2278.411%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%2341D1FF%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23BD34FE%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb467%22%20x1%3D%2243.376%25%22%20x2%3D%2250.316%25%22%20y1%3D%222.242%25%22%20y2%3D%2289.03%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23FFEA83%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%228.333%25%22%20stop-color%3D%22%23FFDD35%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23FFA800%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb466)%22%20d%3D%22M255.153%2037.938L134.897%20252.976c-2.483%204.44-8.862%204.466-11.382.048L.875%2037.958c-2.746-4.814%201.371-10.646%206.827-9.67l120.385%2021.517a6.537%206.537%200%200%200%202.322-.004l117.867-21.483c5.438-.991%209.574%204.796%206.877%209.62Z%22%3E%3C%2Fpath%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb467)%22%20d%3D%22M185.432.063L96.44%2017.501a3.268%203.268%200%200%200-2.634%203.014l-5.474%2092.456a3.268%203.268%200%200%200%203.997%203.378l24.777-5.718c2.318-.535%204.413%201.507%203.936%203.838l-7.361%2036.047c-.495%202.426%201.782%204.5%204.151%203.78l15.304-4.649c2.372-.72%204.652%201.36%204.15%203.788l-11.698%2056.621c-.732%203.542%203.979%205.473%205.943%202.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505%204.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CLI Proxy API Management Center</title> <title>CLI Proxy API Management Center</title>
<script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._stLine truncated <script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status=Line truncated
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` `+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(` `),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+` Error generating stack: `+e.message+`
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Dp(e.type)):e}function st(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wf(e);e!==null;){if(n=e[lt])return n;e=wf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||(t=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3Line truncated `+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ke(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=L.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function at(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[st])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||(t=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3Line truncated
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,a.name,a,null),Kd(e,t,`formEncType`,a.formEncType,a,null),Kd(e,t,`formMethod`,a.formMethod,a,null),Kd(e,t,`formTarget`,a.formTarget,a,null)):(Kd(e,t,`encType`,a.encType,a,null),Kd(e,t,`method`,a.method,a,null),Kd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function qd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`inneLine truncated `).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:jd(`beforetoggle`,e),jd(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`inneLine truncated
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Cn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}M(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=$t(n.formData),s=n.formData;else if(n.body instanceof FormData)o=$t(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=en(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=en(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Cn(c.formMethod))return{path:t,submission:c};let l=re(t);return e&&l.search&&wn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:ne(l),submission:c}}function Et(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?gn(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&gn(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Xe(o),k=o.map((i,o)=>{let{route:s}=i,c=null;if(w!=null&&o>w?c=!1:s.lazy?c=!0:Dt(s)?u?c=Ot(s,a.loaderData,a.errors):kt(a.loaderData,a.matches[o],i)&&(c=!0):c=!1,c!==null)return Wt(n,r,e,O,i,l,t,c);let f=!1;typeof b==`boolean`?f=b:E?f=!1:d||S.pathname+S.search===C.pathname+C.search?f=!0:S.search===C.search?At(a.matches[o],i)&&(f=!0):f=!0;let p={...D,defaultShouldRevalidate:f};return Wt(n,r,e,O,i,l,t,jt(i,p),p,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=he(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Tn(y,e.path),S=new AbortController,C=Qt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Gt(n,r,C,y,x,l,t);else if(m)d&&(w=Gt(n,r,C,y,x,l,t));else{let e;e=typeof b==`boolean`?b:E?!1:d;let i={...D,defaultShouldRevalidate:e};jt(x,i)&&(w=Gt(n,r,C,y,x,l,t,i))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Dt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Ot(e,t,n){if(e.lazy)return!0;if(!Dt(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function kt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function At(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function jt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Mt(e,t,n,r,i,a){let o;if(e){let t=r[e];M(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Nt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=pe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=pe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Nt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>Nt(e,t))):!1}var Pt=new WeakMap,Ft=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(M(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Pt.get(i);o||(o={},Pt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=le(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)N(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)N(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},It=new WeakMap;function LtLine truncated `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!xn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}N(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Zt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Zt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Qt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Qt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(xn(c.formMethod))return{path:t,submission:c};let l=te(t);return e&&l.search&&Sn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:ee(l),submission:c}}function wt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?mn(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&mn(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Je(o),k=o.map((i,o)=>{let{route:s}=i,c=null;if(w!=null&&o>w?c=!1:s.lazy?c=!0:Tt(s)?u?c=Et(s,a.loaderData,a.errors):Dt(a.loaderData,a.matches[o],i)&&(c=!0):c=!1,c!==null)return Ht(n,r,e,O,i,l,t,c);let f=!1;typeof b==`boolean`?f=b:E?f=!1:d||S.pathname+S.search===C.pathname+C.search?f=!0:S.search===C.search?Ot(a.matches[o],i)&&(f=!0):f=!0;let p={...D,defaultShouldRevalidate:f};return Ht(n,r,e,O,i,l,t,kt(i,p),p,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=pe(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Cn(y,e.path),S=new AbortController,C=Xt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Ut(n,r,C,y,x,l,t);else if(m)d&&(w=Ut(n,r,C,y,x,l,t));else{let e;e=typeof b==`boolean`?b:E?!1:d;let i={...D,defaultShouldRevalidate:e};kt(x,i)&&(w=Ut(n,r,C,y,x,l,t,i))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Tt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Et(e,t,n){if(e.lazy)return!0;if(!Tt(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function Dt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ot(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function kt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function At(e,t,n,r,i,a){let o;if(e){let t=r[e];N(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>jt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=de(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=de([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function jt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>jt(e,t))):!1}var Mt=new WeakMap,Nt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(N(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Mt.get(i);o||(o={},Mt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=se(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)P(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)P(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Pt=new WeakMap;function FtLine truncated
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=$n(),p;if(t){let e=typeof t==`string`?re(t):t;M(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=he(e,{pathname:h});N(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),N(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=gr(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:We([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:We([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?y.createElement(Un.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function ur(){let e=Tr(),t=Ye(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=y.createElement(y.Fragment,null,y.createElement(`p`,null,`💿 Hey developer 👋`),y.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,y.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,y.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:i},n):null,o)}var dr=y.createElement(ur,null),fr=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Xn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Wn.Provider,{value:this.props.routeContext},y.createElement(Gn.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(mr,{error:e},t):t}};fr.contextType=Ln;var pr=new WeakMap;function mr({children:e,error:t}){let{basename:n}=y.useContext(Hn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Yn(t.digest);if(e){let r=pr.get(t);if(r)throw r;let i=Qe(e.location,n);if(Ze&&!pr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw pr.set(t,n),n}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function hr({routeContext:e,match:t,children:n}){let r=y.useContext(Fn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Wn.Provider,{value:e},n)}function gr(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);M(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&rLine truncated Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=Zn(),p;if(t){let e=typeof t==`string`?te(t):t;N(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=pe(e,{pathname:h});P(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),P(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=mr(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:He([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:He([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?y.createElement(Vn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function cr(){let e=Cr(),t=qe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=y.createElement(y.Fragment,null,y.createElement(`p`,null,`💿 Hey developer 👋`),y.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,y.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,y.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:i},n):null,o)}var lr=y.createElement(cr,null),ur=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Jn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Hn.Provider,{value:this.props.routeContext},y.createElement(Un.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(fr,{error:e},t):t}};ur.contextType=Fn;var dr=new WeakMap;function fr({children:e,error:t}){let{basename:n}=y.useContext(Bn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=qn(t.digest);if(e){let r=dr.get(t);if(r)throw r;let i=Xe(e.location,n);if(Ye&&!dr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw dr.set(t,n),n}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function pr({routeContext:e,match:t,children:n}){let r=y.useContext(Nn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Hn.Provider,{value:e},n)}function mr(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&rLine truncated
"Header-Name": "value" "Header-Name": "value"
}`,headers_hint:`以 JSON 对象格式输入自定义 HTTP 请求头,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自定义请求头必须是有效的 JSON。`,headers_invalid_object:`自定义请求头必须是 JSON 对象。`,headers_invalid_value:`每个自定义请求头的值都必须是字符串。`,prefix_proxy_invalid_json:`该认证文件不是 JSON 对象,无法编辑字段。`,prefix_proxy_html_challenge:`下载到的是 HTML 验证页面,不是认证 JSON 对象。请重新认证或替换该认证文件后再编辑字段。`,prefix_proxy_saved_success:`已更新认证文件 "{{name}}"`,quota_refresh_single:`刷新额度`,quota_refresh_hint:`仅刷新该认证文件的额度`,quota_refresh_success:`已刷新 "{{name}}" 的额度`,quota_refresh_failed:`刷新 "{{name}}" 的额度失败:{{message}}`},antigravity_subscription:{subscription_label:`订阅`,plan_badge:`套餐 {{plan}}`,loading_short:`套餐...`,error_badge:`套餐错误`,load_failed:`订阅状态获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无订阅数据`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity 额度`,empty_title:`暂无 Antigravity 认证`,empty_desc:`上传 Antigravity 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_project_id:`Antigravity 凭证缺少 project_id。请重新登录或刷新凭证以发现项目。`,empty_models:`暂无额度数据`,plan_label:`套餐`,group_gemini_models:`Gemini 模型`,group_claude_gpt_models:`Claude 和 GPT 模型`,group_models_description:`此分组包含:{{models}}`,weekly_limit:`周限额`,daily_limit:`日限额`,five_hour_limit:`5 小时限额`,monthly_limit:`月限额`,quota_available:`额度可用`,remaining_percent:`剩余 {{percent}}%`,refreshes_in:`{{duration}} 后刷新`,refresh_available:`可刷新`,duration_day_hour:`{{days}} 天 {{hours}} 小时`,duration_hour_minute:`{{hours}} 小时 {{minutes}} 分钟`,duration_minute:`{{minutes}} 分钟`,duration_less_than_minute:`小于 1 分钟`,refresh_button:`刷新额度`,fetch_all:`获取全部`},claude_quota:{title:`Claude 额度`,empty_title:`暂无 Claude OAuth 认证`,empty_desc:`使用 Claude OAuth 登录后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_windows:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,five_hour:`5 小时限额`,seven_day:`7 天限额`,seven_day_oauth_apps:`7 天 OAuth 应用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`额外用量`,plan_label:`套餐`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`专业版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`团队版`},codex_quota:{title:`Codex 额度`,empty_title:`暂无 Codex 认证`,empty_desc:`上传 Codex 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_account_id:`Codex 凭证缺少 ChatGPT 账号 ID`,empty_windows:`暂无额度数据`,no_access:`该凭证已无 Codex 访问权限(free)。`,refresh_button:`刷新额度`,fetch_all:`获取全部`,primary_window:`5 小时限额`,secondary_window:`周限额`,team_secondary_window:`月度限额`,code_review_primary_window:`代码审查 5 小时限额`,code_review_secondary_window:`代码审查周限额`,code_review_team_secondary_window:`代码审查月度限额`,additional_primary_window:`{{name}} 5 小时限额`,additional_secondary_window:`{{name}} 周限额`,additional_team_secondary_window:`{{name}} 月度限额`,plan_label:`套餐`,expires_label:`续期时间`,reset_credits_label:`主动重置次数`,reset_button:`重置额度`,reset_confirm_title:`重置 Codex 额度`,reset_confirm_message:`将消耗 1 次主动重置次数来重置 "{{name}}" 的 Codex 额度。是否继续?`,reset_confirm_button:`确认重置`,reset_success:`已重置 "{{name}}" 的 Codex 额度`,reset_failed:`重置 "{{name}}" 的 Codex 额度失败:{{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi 额度`,empty_title:`暂无 Kimi 认证`,empty_desc:`上传 Kimi 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,weekly_limit:`周限额`,limitLine truncated }`,headers_hint:`以 JSON 对象格式输入自定义 HTTP 请求头,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自定义请求头必须是有效的 JSON。`,headers_invalid_object:`自定义请求头必须是 JSON 对象。`,headers_invalid_value:`每个自定义请求头的值都必须是字符串。`,prefix_proxy_invalid_json:`该认证文件不是 JSON 对象,无法编辑字段。`,prefix_proxy_html_challenge:`下载到的是 HTML 验证页面,不是认证 JSON 对象。请重新认证或替换该认证文件后再编辑字段。`,prefix_proxy_saved_success:`已更新认证文件 "{{name}}"`,quota_refresh_single:`刷新额度`,quota_refresh_hint:`仅刷新该认证文件的额度`,quota_refresh_success:`已刷新 "{{name}}" 的额度`,quota_refresh_failed:`刷新 "{{name}}" 的额度失败:{{message}}`},antigravity_subscription:{subscription_label:`订阅`,plan_badge:`套餐 {{plan}}`,loading_short:`套餐...`,error_badge:`套餐错误`,load_failed:`订阅状态获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无订阅数据`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity 额度`,empty_title:`暂无 Antigravity 认证`,empty_desc:`上传 Antigravity 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_project_id:`Antigravity 凭证缺少 project_id。请重新登录或刷新凭证以发现项目。`,empty_models:`暂无额度数据`,plan_label:`套餐`,group_gemini_models:`Gemini 模型`,group_claude_gpt_models:`Claude 和 GPT 模型`,group_models_description:`此分组包含:{{models}}`,weekly_limit:`周限额`,daily_limit:`日限额`,five_hour_limit:`5 小时限额`,monthly_limit:`月限额`,quota_available:`额度可用`,remaining_percent:`剩余 {{percent}}%`,refreshes_in:`{{duration}} 后刷新`,refresh_available:`可刷新`,duration_day_hour:`{{days}} 天 {{hours}} 小时`,duration_hour_minute:`{{hours}} 小时 {{minutes}} 分钟`,duration_minute:`{{minutes}} 分钟`,duration_less_than_minute:`小于 1 分钟`,refresh_button:`刷新额度`,fetch_all:`获取全部`},claude_quota:{title:`Claude 额度`,empty_title:`暂无 Claude OAuth 认证`,empty_desc:`使用 Claude OAuth 登录后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_windows:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,five_hour:`5 小时限额`,seven_day:`7 天限额`,seven_day_oauth_apps:`7 天 OAuth 应用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`额外用量`,plan_label:`套餐`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`专业版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`团队版`},codex_quota:{title:`Codex 额度`,empty_title:`暂无 Codex 认证`,empty_desc:`上传 Codex 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_account_id:`Codex 凭证缺少 ChatGPT 账号 ID`,empty_windows:`暂无额度数据`,no_access:`该凭证已无 Codex 访问权限(free)。`,refresh_button:`刷新额度`,fetch_all:`获取全部`,primary_window:`5 小时限额`,secondary_window:`周限额`,team_secondary_window:`月度限额`,code_review_primary_window:`代码审查 5 小时限额`,code_review_secondary_window:`代码审查周限额`,code_review_team_secondary_window:`代码审查月度限额`,additional_primary_window:`{{name}} 5 小时限额`,additional_secondary_window:`{{name}} 周限额`,additional_team_secondary_window:`{{name}} 月度限额`,plan_label:`套餐`,expires_label:`续期时间`,reset_credits_label:`主动重置次数`,reset_credits_expiry_label:`主动重置过期时间(GMT+8)`,reset_credit_number:`第 {{index}} 次`,reset_credits_expiry_failed:`主动重置过期时间获取失败:{{message}}`,reset_credits_invalid_payload:`主动重置过期时间响应格式无效`,reset_button:`重置额度`,reset_confirm_title:`重置 Codex 额度`,reset_confirm_message:`将消耗 1 次主动重置次数来重置 "{{name}}" 的 Codex 额度。是否继续?`,reset_confirm_button:`确认重置`,reset_success:`已重置 "{{name}}" 的 Codex 额度`,reset_failed:`重置 "{{name}}" 的 Codex 额度失败:{{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi 额度`,empty_title:`暂无 Kimi 认证`,empty_desc:`上传 Kimi 认证文件后即可查看额度。`,idle:`点击此处Line truncated
"Header-Name": "value" "Header-Name": "value"
}`,headers_hint:`以 JSON 物件格式輸入自訂 HTTP 請求標頭,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自訂請求標頭必須是有效的 JSON。`,headers_invalid_object:`自訂請求標頭必須是 JSON 物件。`,headers_invalid_value:`每個自訂請求標頭的值都必須是字串。`,prefix_proxy_invalid_json:`該驗證檔案不是 JSON 物件,無法編輯欄位。`,prefix_proxy_html_challenge:`下載到的是 HTML 驗證頁面,不是驗證 JSON 物件。請重新驗證或替換該驗證檔案後再編輯欄位。`,prefix_proxy_saved_success:`已更新驗證檔案「{{name}}」`,quota_refresh_single:`重新整理配額`,quota_refresh_hint:`僅重新整理該驗證檔案的配額`,quota_refresh_success:`已重新整理「{{name}}」的配額`,quota_refresh_failed:`重新整理「{{name}}」的配額失敗:{{message}}`},antigravity_subscription:{subscription_label:`訂閱`,plan_badge:`方案 {{plan}}`,loading_short:`方案...`,error_badge:`方案錯誤`,load_failed:`訂閱狀態取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`暫無訂閱資料`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity 配額`,empty_title:`暫無 Antigravity 驗證`,empty_desc:`上傳 Antigravity 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_project_id:`Antigravity 憑證缺少 project_id。請重新登入或重新整理憑證以探索專案。`,empty_models:`暫無配額資料`,plan_label:`方案`,group_gemini_models:`Gemini 模型`,group_claude_gpt_models:`Claude 與 GPT 模型`,group_models_description:`此分組包含:{{models}}`,weekly_limit:`週限額`,daily_limit:`日限額`,five_hour_limit:`5 小時限額`,monthly_limit:`月限額`,quota_available:`配額可用`,remaining_percent:`剩餘 {{percent}}%`,refreshes_in:`{{duration}} 後重新整理`,refresh_available:`可重新整理`,duration_day_hour:`{{days}} 天 {{hours}} 小時`,duration_hour_minute:`{{hours}} 小時 {{minutes}} 分鐘`,duration_minute:`{{minutes}} 分鐘`,duration_less_than_minute:`小於 1 分鐘`,refresh_button:`重新整理配額`,fetch_all:`取得全部`},claude_quota:{title:`Claude 配額`,empty_title:`暫無 Claude OAuth 驗證`,empty_desc:`使用 Claude OAuth 登入後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_windows:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,five_hour:`5 小時限額`,seven_day:`7 天限額`,seven_day_oauth_apps:`7 天 OAuth 應用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`額外用量`,plan_label:`方案`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`專業版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`團隊版`},codex_quota:{title:`Codex 配額`,empty_title:`暫無 Codex 驗證`,empty_desc:`上傳 Codex 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_account_id:`Codex 憑證缺少 ChatGPT 帳號 ID`,empty_windows:`暫無配額資料`,no_access:`該憑證已無 Codex 存取權限(free)。`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,primary_window:`5 小時限額`,secondary_window:`週限額`,team_secondary_window:`月度限額`,code_review_primary_window:`程式碼審查 5 小時限額`,code_review_secondary_window:`程式碼審查週限額`,code_review_team_secondary_window:`程式碼審查月度限額`,additional_primary_window:`{{name}} 5 小時限額`,additional_secondary_window:`{{name}} 週限額`,additional_team_secondary_window:`{{name}} 月度限額`,plan_label:`方案`,expires_label:`續期時間`,reset_credits_label:`主動重置次數`,reset_button:`重置配額`,reset_confirm_title:`重置 Codex 配額`,reset_confirm_message:`將消耗 1 次主動重置次數來重置「{{name}}」的 Codex 配額。是否繼續?`,reset_confirm_button:`確認重置`,reset_success:`已重置「{{name}}」的 Codex 配額`,reset_failed:`重置「{{name}}」的 Codex 配額失敗:{{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi 配額`,empty_title:`暫無 Kimi 驗證`,empty_desc:`上傳 Kimi 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`Line truncated }`,headers_hint:`以 JSON 物件格式輸入自訂 HTTP 請求標頭,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自訂請求標頭必須是有效的 JSON。`,headers_invalid_object:`自訂請求標頭必須是 JSON 物件。`,headers_invalid_value:`每個自訂請求標頭的值都必須是字串。`,prefix_proxy_invalid_json:`該驗證檔案不是 JSON 物件,無法編輯欄位。`,prefix_proxy_html_challenge:`下載到的是 HTML 驗證頁面,不是驗證 JSON 物件。請重新驗證或替換該驗證檔案後再編輯欄位。`,prefix_proxy_saved_success:`已更新驗證檔案「{{name}}」`,quota_refresh_single:`重新整理配額`,quota_refresh_hint:`僅重新整理該驗證檔案的配額`,quota_refresh_success:`已重新整理「{{name}}」的配額`,quota_refresh_failed:`重新整理「{{name}}」的配額失敗:{{message}}`},antigravity_subscription:{subscription_label:`訂閱`,plan_badge:`方案 {{plan}}`,loading_short:`方案...`,error_badge:`方案錯誤`,load_failed:`訂閱狀態取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`暫無訂閱資料`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity 配額`,empty_title:`暫無 Antigravity 驗證`,empty_desc:`上傳 Antigravity 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_project_id:`Antigravity 憑證缺少 project_id。請重新登入或重新整理憑證以探索專案。`,empty_models:`暫無配額資料`,plan_label:`方案`,group_gemini_models:`Gemini 模型`,group_claude_gpt_models:`Claude 與 GPT 模型`,group_models_description:`此分組包含:{{models}}`,weekly_limit:`週限額`,daily_limit:`日限額`,five_hour_limit:`5 小時限額`,monthly_limit:`月限額`,quota_available:`配額可用`,remaining_percent:`剩餘 {{percent}}%`,refreshes_in:`{{duration}} 後重新整理`,refresh_available:`可重新整理`,duration_day_hour:`{{days}} 天 {{hours}} 小時`,duration_hour_minute:`{{hours}} 小時 {{minutes}} 分鐘`,duration_minute:`{{minutes}} 分鐘`,duration_less_than_minute:`小於 1 分鐘`,refresh_button:`重新整理配額`,fetch_all:`取得全部`},claude_quota:{title:`Claude 配額`,empty_title:`暫無 Claude OAuth 驗證`,empty_desc:`使用 Claude OAuth 登入後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_windows:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,five_hour:`5 小時限額`,seven_day:`7 天限額`,seven_day_oauth_apps:`7 天 OAuth 應用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`額外用量`,plan_label:`方案`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`專業版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`團隊版`},codex_quota:{title:`Codex 配額`,empty_title:`暫無 Codex 驗證`,empty_desc:`上傳 Codex 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_account_id:`Codex 憑證缺少 ChatGPT 帳號 ID`,empty_windows:`暫無配額資料`,no_access:`該憑證已無 Codex 存取權限(free)。`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,primary_window:`5 小時限額`,secondary_window:`週限額`,team_secondary_window:`月度限額`,code_review_primary_window:`程式碼審查 5 小時限額`,code_review_secondary_window:`程式碼審查週限額`,code_review_team_secondary_window:`程式碼審查月度限額`,additional_primary_window:`{{name}} 5 小時限額`,additional_secondary_window:`{{name}} 週限額`,additional_team_secondary_window:`{{name}} 月度限額`,plan_label:`方案`,expires_label:`續期時間`,reset_credits_label:`主動重置次數`,reset_credits_expiry_label:`主動重置過期時間(GMT+8)`,reset_credit_number:`第 {{index}} 次`,reset_credits_expiry_failed:`主動重置過期時間取得失敗:{{message}}`,reset_credits_invalid_payload:`主動重置過期時間回應格式無效`,reset_button:`重置配額`,reset_confirm_title:`重置 Codex 配額`,reset_confirm_message:`將消耗 1 次主動重置次數來重置「{{name}}」的 Codex 配額。是否繼續?`,reset_confirm_button:`確認重置`,reset_success:`已重置「{{name}}」的 Codex 配額`,reset_failed:`重置「{{name}}」的 Codex 配額失敗:{{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi 配額`,empty_title:`暫Line truncated
"Header-Name": "value" "Header-Name": "value"
}`,headers_hint:`Enter custom HTTP headers as a JSON object, e.g., {"X-My-Header": "value"}`,headers_invalid_json:`Custom headers must be valid JSON.`,headers_invalid_object:`Custom headers must be a JSON object.`,headers_invalid_value:`Each custom header value must be a string.`,prefix_proxy_invalid_json:`This auth file is not a JSON object, so fields cannot be edited.`,prefix_proxy_html_challenge:`Downloaded content is an HTML challenge page, not an auth JSON object. Re-authenticate or replace this auth file before editing fields.`,prefix_proxy_saved_success:`Updated auth file "{{name}}" successfully`,quota_refresh_single:`Refresh quota`,quota_refresh_hint:`Refresh quota only for this credential`,quota_refresh_success:`Quota refreshed for "{{name}}"`,quota_refresh_failed:`Failed to refresh quota for "{{name}}": {{message}}`},antigravity_subscription:{subscription_label:`Subscription`,plan_badge:`Plan {{plan}}`,loading_short:`Plan...`,error_badge:`Plan error`,load_failed:`Subscription check failed: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No subscription data available`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity Quota`,empty_title:`No Antigravity Auth Files`,empty_desc:`Upload an Antigravity credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_project_id:`Antigravity credential missing project_id. Re-login or refresh the credential to discover the project.`,empty_models:`No quota data available`,plan_label:`Plan`,group_gemini_models:`Gemini models`,group_claude_gpt_models:`Claude and GPT models`,group_models_description:`Models in this group: {{models}}`,weekly_limit:`Weekly limit`,daily_limit:`Daily limit`,five_hour_limit:`5-hour limit`,monthly_limit:`Monthly limit`,quota_available:`Quota available`,remaining_percent:`{{percent}}% remaining`,refreshes_in:`Refreshes in {{duration}}`,refresh_available:`Refresh available`,duration_day_hour:`{{days}}d {{hours}}h`,duration_hour_minute:`{{hours}}h {{minutes}}m`,duration_minute:`{{minutes}}m`,duration_less_than_minute:`<1m`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`},claude_quota:{title:`Claude Quota`,empty_title:`No Claude OAuth Files`,empty_desc:`Log in with Claude OAuth to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_windows:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,five_hour:`5-hour limit`,seven_day:`7-day limit`,seven_day_oauth_apps:`7-day OAuth apps`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_cowork:`7-day Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`Extra Usage`,plan_label:`Plan`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`Team`},codex_quota:{title:`Codex Quota`,empty_title:`No Codex Auth Files`,empty_desc:`Upload a Codex credential to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_account_id:`Codex credential missing ChatGPT account ID`,empty_windows:`No quota data available`,no_access:`This credential has no Codex access (plan: free).`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,primary_window:`5-hour limit`,secondary_window:`Weekly limit`,team_secondary_window:`Monthly limit`,code_review_primary_window:`Code review 5-hour limit`,code_review_secondary_window:`Code review weekly limit`,code_review_team_secondary_window:`Code review monthly limit`,additional_primary_window:`{{name}} 5-hour limit`,additional_secondary_window:`{{name}} weekly limit`,additional_team_secondary_window:`{{name}} monthly limit`,plan_label:`Plan`,expires_label:`Renewal time`,reset_credits_label:`Manual resets`,reset_button:`Reset quota`,reset_confirm_title:`Reset Codex quota`,reset_confirm_message:`This will consume 1 manual reset to reset the Codex quota for "{{name}}". Continue?`,reset_confirm_button:`Reset quota`,reset_success:`Reset Codex quota for "{{name}}"`,reset_failed:`Failed to reset Codex quota for "{{name}}": {{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi Quota`,empty_title:`No Kimi Auth Files`,empty_desc:`Upload a Kimi credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,weekly_limit:`Weekly limit`,limit_window:`{{duration}} limit`,limit_indeLine truncated }`,headers_hint:`Enter custom HTTP headers as a JSON object, e.g., {"X-My-Header": "value"}`,headers_invalid_json:`Custom headers must be valid JSON.`,headers_invalid_object:`Custom headers must be a JSON object.`,headers_invalid_value:`Each custom header value must be a string.`,prefix_proxy_invalid_json:`This auth file is not a JSON object, so fields cannot be edited.`,prefix_proxy_html_challenge:`Downloaded content is an HTML challenge page, not an auth JSON object. Re-authenticate or replace this auth file before editing fields.`,prefix_proxy_saved_success:`Updated auth file "{{name}}" successfully`,quota_refresh_single:`Refresh quota`,quota_refresh_hint:`Refresh quota only for this credential`,quota_refresh_success:`Quota refreshed for "{{name}}"`,quota_refresh_failed:`Failed to refresh quota for "{{name}}": {{message}}`},antigravity_subscription:{subscription_label:`Subscription`,plan_badge:`Plan {{plan}}`,loading_short:`Plan...`,error_badge:`Plan error`,load_failed:`Subscription check failed: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No subscription data available`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_ultra:`Ultra`,plan_ultra_lite:`Ultra Lite`},antigravity_quota:{title:`Antigravity Quota`,empty_title:`No Antigravity Auth Files`,empty_desc:`Upload an Antigravity credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_project_id:`Antigravity credential missing project_id. Re-login or refresh the credential to discover the project.`,empty_models:`No quota data available`,plan_label:`Plan`,group_gemini_models:`Gemini models`,group_claude_gpt_models:`Claude and GPT models`,group_models_description:`Models in this group: {{models}}`,weekly_limit:`Weekly limit`,daily_limit:`Daily limit`,five_hour_limit:`5-hour limit`,monthly_limit:`Monthly limit`,quota_available:`Quota available`,remaining_percent:`{{percent}}% remaining`,refreshes_in:`Refreshes in {{duration}}`,refresh_available:`Refresh available`,duration_day_hour:`{{days}}d {{hours}}h`,duration_hour_minute:`{{hours}}h {{minutes}}m`,duration_minute:`{{minutes}}m`,duration_less_than_minute:`<1m`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`},claude_quota:{title:`Claude Quota`,empty_title:`No Claude OAuth Files`,empty_desc:`Log in with Claude OAuth to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_windows:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,five_hour:`5-hour limit`,seven_day:`7-day limit`,seven_day_oauth_apps:`7-day OAuth apps`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_cowork:`7-day Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`Extra Usage`,plan_label:`Plan`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`Team`},codex_quota:{title:`Codex Quota`,empty_title:`No Codex Auth Files`,empty_desc:`Upload a Codex credential to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_account_id:`Codex credential missing ChatGPT account ID`,empty_windows:`No quota data available`,no_access:`This credential has no Codex access (plan: free).`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,primary_window:`5-hour limit`,secondary_window:`Weekly limit`,team_secondary_window:`Monthly limit`,code_review_primary_window:`Code review 5-hour limit`,code_review_secondary_window:`Code review weekly limit`,code_review_team_secondary_window:`Code review monthly limit`,additional_primary_window:`{{name}} 5-hour limit`,additional_secondary_window:`{{name}} weekly limit`,additional_team_secondary_window:`{{name}} monthly limit`,plan_label:`Plan`,expires_label:`Renewal time`,reset_credits_label:`Manual resets`,reset_credits_expiry_label:`Manual reset expiry (GMT+8)`,reset_credit_number:`Reset {{index}}`,reset_credits_expiry_failed:`Failed to load manual reset expiry: {{message}}`,reset_credits_invalid_payload:`Invalid manual reset expiry response`,reset_button:`Reset quota`,reset_confirm_title:`Reset Codex quota`,reset_confirm_message:`This will consume 1 manual reset to reset the Codex quota for "{{name}}". Continue?`,reset_confirm_button:`Reset quota`,reset_success:`Reset Codex quota for "{{name}}"`,reset_failed:`Failed to reset Codex quota for "{{name}}": {{message}}`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},kimi_quota:{title:`Kimi Quota`,empty_title:`No Kimi Auth Files`,empty_desc:`Upload a Kimi credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`FaileLine truncated
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&td[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},rd=Symbol(`internals`),id=/[^\x09\x20-\x7E\x80-\xFF]/g;function ad(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function od(e){return e&&String(e).trim().toLowerCase()}function sd(e){return ad(e.replace(id,``))}function cd(e){return e===!1||e==null?e:R.isArray(e)?e.map(cd):sd(String(e))}function ld(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var ud=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function dd(e,t,n,r,i){if(R.isFunction(r))return r.call(this,t,n);if(i&&(t=n),R.isString(t)){if(R.isString(r))return t.indexOf(r)!==-1;if(R.isRegExp(r))return r.test(t)}}function fd(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function pd(e,t){let n=R.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var md=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=od(t);if(!i)throw Error(`header name must be a non-empty string`);let a=R.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=cd(e))}let a=(e,t)=>R.forEach(e,(e,n)=>i(e,n,t));if(R.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(R.isString(e)&&(e=e.trim())&&!ud(e))a(nd(e),t);else if(R.isObject(e)&&R.isIterable(e)){let n={},r,i;for(let t of e){if(!R.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?R.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=od(e),e){let n=R.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return ld(e);if(R.isFunction(t))return t.call(this,e,n);if(R.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=od(e),e){let n=R.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||dd(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=od(e),e){let i=R.findKey(n,e);i&&(!t||dd(n,n[i],i,t))&&(delete n[i],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||dd(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return R.forEach(this,(r,i)=>{let a=R.findKey(n,i);if(a){t[a]=cd(r),delete t[i];return}let o=e?fd(i):String(i).trim();o!==i&&delete t[i],t[o]=cd(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&R.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` `).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&nd[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},id=Symbol(`internals`),ad=/[^\x09\x20-\x7E\x80-\xFF]/g;function od(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function sd(e){return e&&String(e).trim().toLowerCase()}function cd(e){return od(e.replace(ad,``))}function ld(e){return e===!1||e==null?e:B.isArray(e)?e.map(ld):cd(String(e))}function ud(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var dd=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function fd(e,t,n,r,i){if(B.isFunction(r))return r.call(this,t,n);if(i&&(t=n),B.isString(t)){if(B.isString(r))return t.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(t)}}function pd(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function md(e,t){let n=B.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var hd=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=sd(t);if(!i)throw Error(`header name must be a non-empty string`);let a=B.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=ld(e))}let a=(e,t)=>B.forEach(e,(e,n)=>i(e,n,t));if(B.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(B.isString(e)&&(e=e.trim())&&!dd(e))a(rd(e),t);else if(B.isObject(e)&&B.isIterable(e)){let n={},r,i;for(let t of e){if(!B.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?B.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=sd(e),e){let n=B.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return ud(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=sd(e),e){let n=B.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||fd(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=sd(e),e){let i=B.findKey(n,e);i&&(!t||fd(n,n[i],i,t))&&(delete n[i],r=!0)}}return B.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||fd(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return B.forEach(this,(r,i)=>{let a=B.findKey(n,i);if(a){t[a]=ld(r),delete t[i];return}let o=e?pd(i):String(i).trim();o!==i&&delete t[i],t[o]=ld(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return B.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&B.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[rd]=this[rd]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=od(e);t[r]||(pd(n,e),t[r]=!0)}return R.isArray(e)?e.forEach(r):r(e),this}};md.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),R.reduceDescriptors(md.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),R.freezeMethods(md);function hd(e,t){let n=this||ed,r=t||n,i=md.from(r.headers),a=r.data;return R.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function gd(e){return!!(e&&e.__CANCEL__)}var _d=class extends z{constructor(e,t,n){super(e??`canceled`,z.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function vd(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new z(`Request failed with status code `+n.status,[z.ERR_BAD_REQUEST,z.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function yd(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function bd(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function xd(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i)]}var Sd=(e,t,n=3)=>{let r=0,i=bd(50,250);return xd(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Cd=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wd=e=>(...t)=>R.asap(()=>e(...t)),Td=qu.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qu.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qu.origin),qu.navigator&&/(msie|trident)/i.test(qu.navigator.userAgent)):()=>!0,Ed=qu.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];R.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),R.isString(r)&&s.push(`path=${r}`),R.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),R.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Dd(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function Od(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function kd(e,t,n){let r=!Dd(t);return e&&(r||n===!1)?Od(e,t):t}var Ad=e=>e instanceof md?{...e}:e;function jd(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge.call({caseless:r},e,t):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function i(e,t,n,i){if(!R.isUndefined(t))return r(e,t,n,i);if(!R.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!R.isUndefined(t))return r(void 0,t)}function o(e,t){if(!R.isUndefined(t))return r(void 0,t);if(!R.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(R.hasOwnProp(t,a))return r(n,i);if(R.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(Ad(e),Ad(t),n,!0)};return R.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=R.hasOwnProp(c,r)?c[r]:i,o=a(R.hasOwnProp(e,r)?e[r]:void 0,R.hasOwnProp(t,r)?t[r]:void 0,r);R.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Md=e=>{let t=jd({},e),n=e=>R.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=md.from(s),t.url=Lu(kd(l,d,u),e.params,e.paramsSerializer),c&Line truncated `)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[id]=this[id]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=sd(e);t[r]||(md(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}};hd.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),B.reduceDescriptors(hd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),B.freezeMethods(hd);function gd(e,t){let n=this||td,r=t||n,i=hd.from(r.headers),a=r.data;return B.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function _d(e){return!!(e&&e.__CANCEL__)}var vd=class extends Du{constructor(e,t,n){super(e??`canceled`,Du.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function yd(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Du(`Request failed with status code `+n.status,[Du.ERR_BAD_REQUEST,Du.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bd(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function xd(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Sd(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i)]}var Cd=(e,t,n=3)=>{let r=0,i=xd(50,250);return Sd(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},wd=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Td=e=>(...t)=>B.asap(()=>e(...t)),Ed=Ju.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ju.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ju.origin),Ju.navigator&&/(msie|trident)/i.test(Ju.navigator.userAgent)):()=>!0,Dd=Ju.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];B.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),B.isString(r)&&s.push(`path=${r}`),B.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),B.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Od(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function kd(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function Ad(e,t,n){let r=!Od(t);return e&&(r||n===!1)?kd(e,t):t}var jd=e=>e instanceof hd?{...e}:e;function Md(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:r},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function i(e,t,n,i){if(!B.isUndefined(t))return r(e,t,n,i);if(!B.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!B.isUndefined(t))return r(void 0,t)}function o(e,t){if(!B.isUndefined(t))return r(void 0,t);if(!B.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(B.hasOwnProp(t,a))return r(n,i);if(B.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(jd(e),jd(t),n,!0)};return B.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=B.hasOwnProp(c,r)?c[r]:i,o=a(B.hasOwnProp(e,r)?e[r]:void 0,B.hasOwnProp(t,r)?t[r]:void 0,r);B.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Nd=e=>{let t=Md({},e),n=e=>B.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=hd.from(s),t.url=Ru(Ad(l,d,u),e.params,e.paramsSerializeLine truncated
`+e.map(Yd).join(` `+e.map(Xd).join(`
`):` `+Yd(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Qd={getAdapter:Zd,adapters:Jd};function $d(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _d(null,e)}function ef(e){return $d(e),e.headers=md.from(e.headers),e.data=hd.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Qd.getAdapter(e.adapter||ed.adapter,e)(e).then(function(t){return $d(e),t.data=hd.call(e,e.transformResponse,t),t.headers=md.from(t.headers),t},function(t){return gd(t)||($d(e),t&&t.response&&(t.response.data=hd.call(e,e.transformResponse,t.response),t.response.headers=md.from(t.response.headers))),Promise.reject(t)})}var tf=`1.15.2`,nf={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{nf[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var rf={};nf.transitional=function(e,t,n){function r(e,t){return`[Axios v`+tf+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new z(r(i,` has been removed`+(t?` in `+t:``)),z.ERR_DEPRECATED);return t&&!rf[i]&&(rf[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},nf.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function af(e,t,n){if(typeof e!=`object`)throw new z(`options must be an object`,z.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new z(`option `+a+` must be `+n,z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new z(`Unknown option `+a,z.ERR_BAD_OPTION)}}var of={assertOptions:af,validators:nf},sf=of.validators,cf=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ru,response:new Ru}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(` `):` `+Xd(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var $d={getAdapter:Qd,adapters:Yd};function ef(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vd(null,e)}function tf(e){return ef(e),e.headers=hd.from(e.headers),e.data=gd.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),$d.getAdapter(e.adapter||td.adapter,e)(e).then(function(t){return ef(e),t.data=gd.call(e,e.transformResponse,t),t.headers=hd.from(t.headers),t},function(t){return _d(t)||(ef(e),t&&t.response&&(t.response.data=gd.call(e,e.transformResponse,t.response),t.response.headers=hd.from(t.response.headers))),Promise.reject(t)})}var nf=`1.15.2`,rf={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{rf[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var af={};rf.transitional=function(e,t,n){function r(e,t){return`[Axios v`+nf+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new Du(r(i,` has been removed`+(t?` in `+t:``)),Du.ERR_DEPRECATED);return t&&!af[i]&&(af[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},rf.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function of(e,t,n){if(typeof e!=`object`)throw new Du(`options must be an object`,Du.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new Du(`option `+a+` must be `+n,Du.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Du(`Unknown option `+a,Du.ERR_BAD_OPTION)}}var sf={assertOptions:of,validators:rf},cf=sf.validators,lf=class{constructor(e){this.defaults=e||{},this.interceptors={request:new zu,response:new zu}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` `);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
`),r=t===-1?-1:n.indexOf(` `),r=t===-1?-1:n.indexOf(`
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` `,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=jd(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&of.assertOptions(n,{silentJSONParsing:sf.transitional(sf.boolean),forcedJSONParsing:sf.transitional(sf.boolean),clarifyTimeoutError:sf.transitional(sf.boolean),legacyInterceptorReqResOrdering:sf.transitional(sf.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:of.assertOptions(r,{encode:sf.function,serialize:sf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),of.assertOptions(t,{baseUrl:sf.spelling(`baseURL`),withXsrfToken:sf.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&R.merge(i.common,i[t.method]);i&&R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=md.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||zu;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[ef.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=ef.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=jd(this.defaults,e),Lu(kd(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};R.forEach([`delete`,`get`,`head`,`options`],function(e){cf.prototype[e]=function(t,n){return this.request(jd(n||{},{method:e,url:t,data:(n||{}).data}))}}),R.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(jd(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}cf.prototype[e]=t(),cf.prototype[e+`Form`]=t(!0)});var lf=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new _d(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function uf(e){return function(t){return e.apply(null,t)}}function df(e){return R.isObject(e)&&e.isAxiosError===!0}var ff={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ff).forEach(([e,t])=>{ff[t]=e});function pf(e){let t=new cf(e),n=gl(cf.prototype.request,t);return R.extend(n,cf.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return pf(jd(e,t))},n}var mf=pf(ed);mf.Axios=cf,mf.CanceledError=_d,mf.CancelToken=lf,mf.isCancel=gd,mf.VERSION=tf,mf.toFormData=Mu,mf.AxiosError=z,mf.Cancel=mf.CanceledErrorLine truncated `+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=Md(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&sf.assertOptions(n,{silentJSONParsing:cf.transitional(cf.boolean),forcedJSONParsing:cf.transitional(cf.boolean),clarifyTimeoutError:cf.transitional(cf.boolean),legacyInterceptorReqResOrdering:cf.transitional(cf.boolean)},!1),r!=null&&(B.isFunction(r)?t.paramsSerializer={serialize:r}:sf.assertOptions(r,{encode:cf.function,serialize:cf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),sf.assertOptions(t,{baseUrl:cf.spelling(`baseURL`),withXsrfToken:cf.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&B.merge(i.common,i[t.method]);i&&B.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=hd.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||Bu;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[tf.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=tf.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Md(this.defaults,e),Ru(Ad(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};B.forEach([`delete`,`get`,`head`,`options`],function(e){lf.prototype[e]=function(t,n){return this.request(Md(n||{},{method:e,url:t,data:(n||{}).data}))}}),B.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(Md(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}lf.prototype[e]=t(),lf.prototype[e+`Form`]=t(!0)});var uf=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new vd(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function df(e){return function(t){return e.apply(null,t)}}function ff(e){return B.isObject(e)&&e.isAxiosError===!0}var pf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pf).forEach(([e,t])=>{pf[t]=e});function mf(e){let t=new lf(e),n=gl(lf.prototype.request,t);return B.extend(n,lf.prototype,t,{allOwnKeys:!0}),B.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return mf(Md(e,t))},n}var hf=mf(td);hf.Axios=lf,hf.CanceledError=vd,hf.CancelToken=uf,hf.isCancel=_d,hf.VERSION=nf,hf.toFormData=Nu,hf.AxiosError=Du,hf.Cancel=hf.CanceledErroLine truncated
`),websockets:e===`codex`?i.websockets===!0:void 0,cloak:e===`claude`?{mode:i.cloak?.mode??``,strictMode:i.cloak?.strictMode===!0,sensitiveWordsText:i.cloak?.sensitiveWords?.join(` `),websockets:e===`codex`?i.websockets===!0:void 0,cloak:eS(e)?{mode:i.cloak?.mode??``,strictMode:i.cloak?.strictMode===!0,sensitiveWordsText:i.cloak?.sensitiveWords?.join(`
`)??``,cacheUserId:i.cloak?.cacheUserId===!0}:void 0,experimentalCchSigning:e===`claude`?i.experimentalCchSigning===!0:void 0,testModel:e===`codex`||e===`claude`||e===`gemini`?``:void 0}}function rb({state:e}){return e===`loading`?(0,I.jsx)(`span`,{className:`${V.statusIcon} ${V.statusIconLoading}`,children:(0,I.jsx)(Cs,{size:14})}):e===`success`?(0,I.jsx)(`span`,{className:`${V.statusIcon} ${V.statusIconSuccess}`,children:(0,I.jsx)(xs,{size:14})}):e===`error`?(0,I.jsx)(`span`,{className:`${V.statusIcon} ${V.statusIconError}`,children:(0,I.jsx)(bs,{size:14})}):null}function ib({brand:e,resource:t,mode:n,mutating:r,formId:i,onSubmit:a,onDirtyChange:o}){let{t:s}=Xo(),c=Iy[e],l=(0,y.useId)(),[u,d]=(0,y.useState)(()=>nb(e,t,n)),[f]=(0,y.useState)(()=>JSON.stringify(nb(e,t,n))),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(new Set),[_,v]=(0,y.useState)(!1),b=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},x=(0,y.useMemo)(()=>JSON.stringify(u)!==f,[u,f]);(0,y.useEffect)(()=>{o?.(x)},[x,o]);let S=(0,y.useMemo)(()=>n!==`edit`||!t||e===`openaiCompatibility`?``:t.raw?.apiKey??``,[e,n,t]),C=(0,y.useMemo)(()=>n!==`edit`||!t?``:t.raw?.authIndex??``,[n,t]),w=(0,y.useMemo)(()=>({baseUrlRequired:s(`providersPage.connectivity.baseUrlRequired`),endpointInvalid:s(`providersPage.connectivity.endpointInvalid`),apiKeyRequired:s(`providersPage.connectivity.apiKeyRequired`),modelRequired:s(`providersPage.connectivity.modelRequired`),timeout:e=>s(`providersPage.connectivity.timeout`,{seconds:e}),requestFailed:s(`providersPage.connectivity.requestFailed`)}),[s]),T=Ky({brand:e,baseUrl:u.baseUrl,testModel:u.testModel,models:u.models,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C},w),E=Yy({brand:e,baseUrl:u.baseUrl,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C}),[D,O]=(0,y.useState)(!1),k=(0,y.useMemo)(()=>{let e=new Set;return u.models.forEach(t=>{let n=(t.name??``).trim();n&&e.add(n)}),e},[u.models]),A=(0,y.useMemo)(()=>{let e=new Set,t=[];u.models.forEach(n=>{let r=(n.name??``).trim();!r||e.has(r)||(e.add(r),t.push(r))});let n=t[0],r=[{value:``,label:n?s(`providersPage.form.testModelAutoWith`,{name:n}):s(`providersPage.form.testModelAutoEmpty`)}];t.forEach(e=>r.push({value:e,label:e}));let i=(u.testModel??``).trim();return i&&!e.has(i)&&r.push({value:i,label:s(`providersPage.form.testModelCustom`,{name:i})}),r},[u.models,u.testModel,s]),ee=()=>{O(!0),!E.loading&&!E.hasFetched&&E.fetch()},j=()=>{O(!1)},M=e=>{e.length&&d(t=>{let n=new Set,r=[];t.models.forEach(e=>{let t=(e.name??``).trim();if(t){if(n.has(t))return;n.add(t)}r.push(e)});let i=r.findIndex(e=>!(e.name??``).trim()&&!(e.alias??``).trim());return i!==-1&&r.splice(i,1),e.forEach(e=>{let t=e.name.trim();!t||n.has(t)||(n.add(t),r.push({name:t,alias:(e.alias??``).trim()}))}),{...t,models:r}})},N=(e,t)=>{d(n=>({...n,[e]:t}))},te=(e,t)=>{d(n=>({...n,cloak:{...n.cloak??{mode:``,strictMode:!1,sensitiveWordsText:``,cacheUserId:!1},[e]:t}}))},P=()=>c.supportsName&&!u.name.trim()?s(`providersPage.form.validation.nameRequired`):c.supportsApiKey&&n===`create`&&!u.apiKey.trim()?s(`providersPage.form.validation.apiKeyRequired`):c.baseUrlRequired&&!u.baseUrl.trim()?s(`providersPage.form.validation.baseUrlRequired`):null,F=async e=>{e.preventDefault();let t=P();if(t){m(t);return}try{m(null),await a(u)}catch(e){m(e instanceof Error?e.message:String(e))}},ne=(0,y.useMemo)(()=>u.headers.length?u.headers:[Zy()],[u.headers]),re=(0,y.useMemo)(()=>u.models.length?u.models:[Qy()],[u.models]),ie=(0,y.useMemo)(()=>u.apiKeyEntries&&u.apiKeyEntries.length?u.apiKeyEntries:[$y()],[u.apiKeyEntries]),ae=u.apiKeyEntries??[],oe=e===`gemini`||e===`codex`||e===`claude`||e===`openaiCompatibility`,se=e===`openaiCompatibility`,ce=e===`codex`?{status:T.codexStatus,run:T.runCodex}:e===`gemini`?{status:T.geminiStatus,run:T.runGemini}:e===`claude`?{status:T.claudeStatus,run:T.runClaude}:null,le=e=>{g(t=>{if(!t.size)return t;let n=new Set;return t.forEach(t=>{t<e?n.add(t):t>e&&n.add(t-1)}),n}),N(`apiKeyEntries`,ae.filter((t,n)=>n!==e))},ue=(e,t)=>{N(`models`,re.map((n,r)=>r===e?{...n,...t}:n))},de=e=>{N(`models`,re.filter((t,n)=>n!==e))};return(0,I.jsxs)(`form`,{id:i,className:V.form,onSubmit:F,noValidate:!0,children:[(0,I.jsxs)(`div`,{className:V.section,children:[c.supportsName?(0,I.jsxs)(`div`,{className:V.field,children:[(0,I.jsx)(`label`,{className:V.label,htmlFor:`${l}-name`,children:s(`providersPage.form.name`)}),(0,I.jsx)(`input`,{id:`${l}-name`,className:V.input,value:u.name,onChange:e=>N(`name`,e.target.value),disabled:r})]}):null,c.supportsApiKey?(0,I.jsxs)(`div`,{className:V.field,children:[(0,I.jsx)(`label`,{className:V.label,htmlFor:`${l}-apiKey`,children:s(`providersPage.form.apiKey`)}),(0,I.jsxs)(`div`,{className:V.passwordField,children:[(0,I.jsx)(`input`,{id:`${l}-apiKey`,className:V.passwordInput,type:_?`text`:`password`,value:u.apiKey,onChange:e=>N(`apiKey`,e.target.value),autLine truncated `)??``,cacheUserId:i.cloak?.cacheUserId===!0}:void 0,experimentalCchSigning:eS(e)?i.experimentalCchSigning===!0:void 0,testModel:e===`codex`||eS(e)||e===`gemini`?``:void 0}}function nS({state:e}){return e===`loading`?(0,R.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconLoading}`,children:(0,R.jsx)(xs,{size:14})}):e===`success`?(0,R.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconSuccess}`,children:(0,R.jsx)(ys,{size:14})}):e===`error`?(0,R.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconError}`,children:(0,R.jsx)(vs,{size:14})}):null}function rS({brand:e,resource:t,mode:n,mutating:r,formId:i,onSubmit:a,onDirtyChange:o}){let{t:s}=Jo(),c=Bx[e],l=(0,y.useId)(),[u,d]=(0,y.useState)(()=>tS(e,t,n)),[f]=(0,y.useState)(()=>JSON.stringify(tS(e,t,n))),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(new Set),[_,v]=(0,y.useState)(!1),b=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},x=(0,y.useMemo)(()=>JSON.stringify(u)!==f,[u,f]);(0,y.useEffect)(()=>{o?.(x)},[x,o]);let S=(0,y.useMemo)(()=>n!==`edit`||!t||e===`openaiCompatibility`?``:t.raw?.apiKey??``,[e,n,t]),C=(0,y.useMemo)(()=>n!==`edit`||!t?``:t.raw?.authIndex??``,[n,t]),w=(0,y.useMemo)(()=>({baseUrlRequired:s(`providersPage.connectivity.baseUrlRequired`),endpointInvalid:s(`providersPage.connectivity.endpointInvalid`),apiKeyRequired:s(`providersPage.connectivity.apiKeyRequired`),modelRequired:s(`providersPage.connectivity.modelRequired`),timeout:e=>s(`providersPage.connectivity.timeout`,{seconds:e}),requestFailed:s(`providersPage.connectivity.requestFailed`)}),[s]),T=Jx({brand:e,baseUrl:u.baseUrl,testModel:u.testModel,models:u.models,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C},w),E=mx({brand:e,baseUrl:u.baseUrl,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C}),[D,O]=(0,y.useState)(!1),k=(0,y.useMemo)(()=>{let e=new Set;return u.models.forEach(t=>{let n=(t.name??``).trim();n&&e.add(n)}),e},[u.models]),A=(0,y.useMemo)(()=>{let e=new Set,t=[];u.models.forEach(n=>{let r=(n.name??``).trim();!r||e.has(r)||(e.add(r),t.push(r))});let n=t[0],r=[{value:``,label:n?s(`providersPage.form.testModelAutoWith`,{name:n}):s(`providersPage.form.testModelAutoEmpty`)}];t.forEach(e=>r.push({value:e,label:e}));let i=(u.testModel??``).trim();return i&&!e.has(i)&&r.push({value:i,label:s(`providersPage.form.testModelCustom`,{name:i})}),r},[u.models,u.testModel,s]),j=()=>{O(!0),!E.loading&&!E.hasFetched&&E.fetch()},M=()=>{O(!1)},N=e=>{e.length&&d(t=>{let n=new Set,r=[];t.models.forEach(e=>{let t=(e.name??``).trim();if(t){if(n.has(t))return;n.add(t)}r.push(e)});let i=r.findIndex(e=>!(e.name??``).trim()&&!(e.alias??``).trim());return i!==-1&&r.splice(i,1),e.forEach(e=>{let t=e.name.trim();!t||n.has(t)||(n.add(t),r.push({name:t,alias:(e.alias??``).trim()}))}),{...t,models:r}})},P=(e,t)=>{d(n=>({...n,[e]:t}))},F=(e,t)=>{d(n=>({...n,cloak:{...n.cloak??{mode:``,strictMode:!1,sensitiveWordsText:``,cacheUserId:!1},[e]:t}}))},I=()=>c.supportsName&&!u.name.trim()?s(`providersPage.form.validation.nameRequired`):c.supportsApiKey&&n===`create`&&!u.apiKey.trim()?s(`providersPage.form.validation.apiKeyRequired`):c.baseUrlRequired&&!u.baseUrl.trim()?s(`providersPage.form.validation.baseUrlRequired`):null,L=async e=>{e.preventDefault();let t=I();if(t){m(t);return}try{m(null),await a(u)}catch(e){m(e instanceof Error?e.message:String(e))}},ee=(0,y.useMemo)(()=>u.headers.length?u.headers:[Yx()],[u.headers]),te=(0,y.useMemo)(()=>u.models.length?u.models:[Xx()],[u.models]),ne=(0,y.useMemo)(()=>u.apiKeyEntries&&u.apiKeyEntries.length?u.apiKeyEntries:[Zx()],[u.apiKeyEntries]),re=u.apiKeyEntries??[],ie=e===`gemini`||e===`codex`||eS(e)||e===`openaiCompatibility`,ae=e===`openaiCompatibility`,oe=e===`codex`?{status:T.codexStatus,run:T.runCodex}:e===`gemini`?{status:T.geminiStatus,run:T.runGemini}:eS(e)?{status:T.claudeStatus,run:T.runClaude}:null,se=e=>{g(t=>{if(!t.size)return t;let n=new Set;return t.forEach(t=>{t<e?n.add(t):t>e&&n.add(t-1)}),n}),P(`apiKeyEntries`,re.filter((t,n)=>n!==e))},ce=(e,t)=>{P(`models`,te.map((n,r)=>r===e?{...n,...t}:n))},le=e=>{P(`models`,te.filter((t,n)=>n!==e))};return(0,R.jsxs)(`form`,{id:i,className:H.form,onSubmit:L,noValidate:!0,children:[(0,R.jsxs)(`div`,{className:H.section,children:[c.supportsName?(0,R.jsxs)(`div`,{className:H.field,children:[(0,R.jsx)(`label`,{className:H.label,htmlFor:`${l}-name`,children:s(`providersPage.form.name`)}),(0,R.jsx)(`input`,{id:`${l}-name`,className:H.input,value:u.name,onChange:e=>P(`name`,e.target.value),disabled:r})]}):null,c.supportsApiKey?(0,R.jsxs)(`div`,{className:H.field,children:[(0,R.jsx)(`label`,{className:H.label,htmlFor:`${l}-apiKey`,children:s(`providersPage.form.apiKey`)}),(0,R.jsxs)(`div`,{className:H.passwordField,children:[(0,R.jsx)(`input`,{id:`${l}-apiKey`,className:H.passwordInput,type:_?`text`:`password`,value:u.apiKey,onChange:e=>P(`apiKey`,e.target.value),autoComplete:`new-password`,"dataLine truncated
model-2`})]})}):null,c.supportsCloak&&u.cloak?(0,I.jsx)(zy,{label:s(`providersPage.form.cloakSection`),children:(0,I.jsxs)(`div`,{className:V.section,children:[(0,I.jsxs)(`div`,{className:V.field,children:[(0,I.jsx)(`label`,{className:V.label,children:s(`providersPage.form.cloakMode`)}),(0,I.jsx)(`input`,{className:V.input,value:u.cloak.mode,onChange:e=>te(`mode`,e.target.value),placeholder:`auto / always / never`,disabled:r})]}),(0,I.jsxs)(`label`,{className:V.checkboxRow,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:V.checkboxBox,checked:u.cloak.strictMode,disabled:r,onChange:e=>te(`strictMode`,e.target.checked)}),(0,I.jsx)(`span`,{className:V.checkboxText,children:(0,I.jsx)(`span`,{children:s(`providersPage.form.cloakStrict`)})})]}),(0,I.jsxs)(`label`,{className:V.checkboxRow,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:V.checkboxBox,checked:u.cloak.cacheUserId,disabled:r,onChange:e=>te(`cacheUserId`,e.target.checked)}),(0,I.jsxs)(`span`,{className:V.checkboxText,children:[(0,I.jsx)(`span`,{children:s(`providersPage.form.cloakCacheUserId`)}),(0,I.jsx)(`small`,{children:s(`providersPage.form.cloakCacheUserIdHint`)})]})]}),(0,I.jsxs)(`label`,{className:V.checkboxRow,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:V.checkboxBox,checked:u.experimentalCchSigning??!1,disabled:r,onChange:e=>N(`experimentalCchSigning`,e.target.checked)}),(0,I.jsxs)(`span`,{className:V.checkboxText,children:[(0,I.jsx)(`span`,{children:s(`providersPage.form.experimentalCchSigning`)}),(0,I.jsx)(`small`,{children:s(`providersPage.form.experimentalCchSigningHint`)})]})]}),(0,I.jsxs)(`div`,{className:V.field,children:[(0,I.jsx)(`label`,{className:V.label,children:s(`providersPage.form.cloakSensitiveWords`)}),(0,I.jsx)(`textarea`,{className:V.textarea,rows:3,value:u.cloak.sensitiveWordsText,onChange:e=>te(`sensitiveWordsText`,e.target.value),disabled:r})]})]})}):null,p?(0,I.jsx)(`div`,{className:V.errorBox,children:p}):null]})}function ab({resource:e,usageByProvider:t}){let{t:n}=Xo(),r=[[`identifier`,e.identifier],[`baseUrl`,e.baseUrl??n(`providersPage.status.notSet`)],[`proxyUrl`,e.proxyUrl??n(`providersPage.status.notSet`)],[`prefix`,e.prefix??n(`providersPage.status.none`)],[`models`,String(e.modelCount)],[`headers`,String(e.headerCount)]],i=[[`authIndex`,e.authIndex??n(`providersPage.status.notSet`)],[`excludedModels`,String(e.excludedModelCount)],[`apiKeyEntries`,String(e.apiKeyEntryCount)]],a=e.brand===`openaiCompatibility`?e.raw:null,o=a?.apiKeyEntries??[];return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:V.detailHeader,children:(0,I.jsx)(`div`,{className:V.sectionTitle,children:e.name??e.identifier})}),(0,I.jsx)(`dl`,{className:V.dl,children:r.map(([e,t])=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:V.dt,children:n(`providersPage.detail.fields.${e}`)}),(0,I.jsx)(`dd`,{className:V.dd,children:t})]},e))}),a&&o.length>0?(0,I.jsxs)(`div`,{className:V.apiKeyEntriesSection,children:[(0,I.jsxs)(`div`,{className:V.apiKeyEntriesLabel,children:[n(`providersPage.form.apiKeyEntriesSection`),`: `,o.length]}),(0,I.jsx)(`div`,{className:V.apiKeyEntryList,children:o.map((e,n)=>{let r=t?Gv(t,a.name,e.apiKey,a.baseUrl):{success:0,failure:0};return(0,I.jsxs)(`div`,{className:V.apiKeyEntryCard,children:[(0,I.jsx)(`span`,{className:V.apiKeyEntryIndex,children:n+1}),(0,I.jsx)(`span`,{className:V.apiKeyEntryKey,children:q_(e.apiKey)}),e.proxyUrl?(0,I.jsx)(`span`,{className:V.apiKeyEntryProxy,children:e.proxyUrl}):null,(0,I.jsxs)(`div`,{className:V.apiKeyEntryStats,children:[(0,I.jsxs)(`span`,{className:`${V.apiKeyEntryStat} ${V.apiKeyEntryStatSuccess}`,children:[(0,I.jsx)(ks,{size:12}),` `,r.success]}),(0,I.jsxs)(`span`,{className:`${V.apiKeyEntryStat} ${V.apiKeyEntryStatFailure}`,children:[(0,I.jsx)(Os,{size:12}),` `,r.failure]})]})]},`${e.apiKey}-${n}`)})})]}):null,(0,I.jsx)(`div`,{style:{marginTop:16},children:(0,I.jsx)(zy,{label:n(`providersPage.detail.metadataTitle`),children:(0,I.jsx)(`dl`,{className:V.dl,children:i.map(([e,t])=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:V.dt,children:n(`providersPage.detail.fields.${e}`)}),(0,I.jsx)(`dd`,{className:V.dd,children:t})]},e))})})})]})}function ob({state:e,onClose:t,onSwitchToEdit:n,workbench:r,onCreated:i,onUpdated:a,mutationDisabled:o=!1,usageByProvider:s,ref:c}){let{t:l}=Xo(),{showConfirmation:u}=Fc(),d=(0,y.useId)(),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(!1);(0,y.useEffect)(()=>{h(!1)},[e.brand,e.mode,e.resource?.id,e.open]);let g=(0,y.useCallback)(e=>{h(e)},[]),_=Iy[e.brand],v=e.mode===`create`||e.mode===`edit`,b=f||o,x=b||e.mode===`edit`&&!m,S=(0,y.useCallback)(()=>!v||!m||f?Promise.resolve(!0):new Promise(e=>{u({title:l(`providersPage.unsavedChanges.title`),message:l(`providersPage.unsavedChanges.message`),variant:`danger`,confirmText:l(`providersPage.unsavedChanges.discard`),cancelText:l(`providersPage.unsavedChanges.keepEditing`),onConfirm:()=>e(!0),onCancel:()=>e(!1)})}),[m,v,u,f,l]);(0,y.useImperativeHandle)(c,()=>({confirLine truncated model-2`})]})}):null,c.supportsCloak&&u.cloak?(0,R.jsx)(ux,{label:s(`providersPage.form.cloakSection`),children:(0,R.jsxs)(`div`,{className:H.section,children:[(0,R.jsxs)(`div`,{className:H.field,children:[(0,R.jsx)(`label`,{className:H.label,children:s(`providersPage.form.cloakMode`)}),(0,R.jsx)(`input`,{className:H.input,value:u.cloak.mode,onChange:e=>F(`mode`,e.target.value),placeholder:`auto / always / never`,disabled:r})]}),(0,R.jsxs)(`label`,{className:H.checkboxRow,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:H.checkboxBox,checked:u.cloak.strictMode,disabled:r,onChange:e=>F(`strictMode`,e.target.checked)}),(0,R.jsx)(`span`,{className:H.checkboxText,children:(0,R.jsx)(`span`,{children:s(`providersPage.form.cloakStrict`)})})]}),(0,R.jsxs)(`label`,{className:H.checkboxRow,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:H.checkboxBox,checked:u.cloak.cacheUserId,disabled:r,onChange:e=>F(`cacheUserId`,e.target.checked)}),(0,R.jsxs)(`span`,{className:H.checkboxText,children:[(0,R.jsx)(`span`,{children:s(`providersPage.form.cloakCacheUserId`)}),(0,R.jsx)(`small`,{children:s(`providersPage.form.cloakCacheUserIdHint`)})]})]}),(0,R.jsxs)(`label`,{className:H.checkboxRow,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:H.checkboxBox,checked:u.experimentalCchSigning??!1,disabled:r,onChange:e=>P(`experimentalCchSigning`,e.target.checked)}),(0,R.jsxs)(`span`,{className:H.checkboxText,children:[(0,R.jsx)(`span`,{children:s(`providersPage.form.experimentalCchSigning`)}),(0,R.jsx)(`small`,{children:s(`providersPage.form.experimentalCchSigningHint`)})]})]}),(0,R.jsxs)(`div`,{className:H.field,children:[(0,R.jsx)(`label`,{className:H.label,children:s(`providersPage.form.cloakSensitiveWords`)}),(0,R.jsx)(`textarea`,{className:H.textarea,rows:3,value:u.cloak.sensitiveWordsText,onChange:e=>F(`sensitiveWordsText`,e.target.value),disabled:r})]})]})}):null,p?(0,R.jsx)(`div`,{className:H.errorBox,children:p}):null]})}var iS=e=>e===`claude`?`anthropicEntries`:e===`codex`?`codexEntries`:`${e}Entries`;function aS({resource:e,usageByProvider:t}){let{t:n}=Jo();if(kb(e.brand)){let t=Ab(e.brand),r=e.raw,i=r.openai.reduce((e,t)=>e+(t.config.apiKeyEntries?.length??0),0),a=r.codex.length,o=r.gemini.length,s=r.openai.flatMap(e=>e.config.apiKeyEntries??[]).find(e=>e.apiKey?.trim())?.apiKey??r.codex.find(e=>e.config.apiKey?.trim())?.config.apiKey??r.claude.find(e=>e.config.apiKey?.trim())?.config.apiKey??r.gemini.find(e=>e.config.apiKey?.trim())?.config.apiKey,c=t.resolveBaseUrl(r.openai[0]?.config.baseUrl??r.codex[0]?.config.baseUrl??r.claude[0]?.config.baseUrl??r.gemini[0]?.config.baseUrl),l=t.getProtocolUrls(c),u={openai:i,codex:a,claude:r.claude.length,gemini:o};return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:H.detailHeader,children:[(0,R.jsx)(`div`,{className:H.sectionTitle,children:e.name??e.identifier}),(0,R.jsx)(`p`,{className:H.sectionDesc,children:n(`providersPage.sponsor.detailHint`,{provider:t.displayName})})]}),(0,R.jsx)(`div`,{className:H.sponsorProtocolGrid,children:t.protocols.map(e=>(0,R.jsxs)(`div`,{className:H.sponsorProtocolCard,children:[(0,R.jsx)(`span`,{className:H.sponsorProtocolName,children:n(`providersPage.sponsor.protocols.${jb(e)}`)}),(0,R.jsx)(`span`,{className:H.sponsorProtocolUrl,children:Pb(l,e)})]},e))}),(0,R.jsxs)(`dl`,{className:H.dl,style:{marginTop:16},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:H.dt,children:n(`providersPage.detail.fields.identifier`)}),(0,R.jsx)(`dd`,{className:H.dd,children:s?Uv(s):e.identifier})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:H.dt,children:n(`providersPage.detail.fields.prefix`)}),(0,R.jsx)(`dd`,{className:H.dd,children:e.prefix??n(`providersPage.status.none`)})]}),t.protocols.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:H.dt,children:n(`providersPage.sponsor.${iS(e)}`)}),(0,R.jsx)(`dd`,{className:H.dd,children:u[e]})]},e))]})]})}let r=[[`identifier`,e.identifier],[`baseUrl`,e.baseUrl??n(`providersPage.status.notSet`)],[`proxyUrl`,e.proxyUrl??n(`providersPage.status.notSet`)],[`prefix`,e.prefix??n(`providersPage.status.none`)],[`models`,String(e.modelCount)],[`headers`,String(e.headerCount)]],i=[[`authIndex`,e.authIndex??n(`providersPage.status.notSet`)],[`excludedModels`,String(e.excludedModelCount)],[`apiKeyEntries`,String(e.apiKeyEntryCount)]],a=e.brand===`openaiCompatibility`?e.raw:null,o=a?.apiKeyEntries??[];return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:H.detailHeader,children:(0,R.jsx)(`div`,{className:H.sectionTitle,children:e.name??e.identifier})}),(0,R.jsx)(`dl`,{className:H.dl,children:r.map(([e,t])=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:H.dt,children:n(`providersPage.detail.fields.${e}`)}),(0,R.jsx)(`dd`,{className:H.dd,children:t})]},e))}),a&&o.length>0?(0,R.jsxs)(`div`,{className:H.apiKeyEntriesSection,children:[(0,R.jsxs)(`div`,{className:H.apiKeyEntriesLabel,children:[n(`providersPage.form.apiKeyEntriesSection`),`: `,o.length]}),(0,R.jsx)Line truncated
`)}};jT.defaultYaml={explicit:!1,version:`1.2`},jT.defaultTags={"!!":`tag:yaml.org,2002:`};function MT(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function NT(e){let t=new Set;return ST(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function PT(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function FT(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=NT(e));let a=PT(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(mT(t.node)||gT(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function IT(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=IT(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=IT(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=IT(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=IT(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function LT(e,t,n){if(Array.isArray(e))return e.map((e,t)=>LT(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!vT(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var RT=class{constructor(e){Object.defineProperty(this,lT,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!dT(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=LT(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?IT(i,{"":o},``,o):o}},zT=class extends RT{constructor(e){super(rT),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ST(e,{Node:(e,t)=>{(uT(t)||vT(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||(LT(a,null,t),o=n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=BT(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(MT(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function BT(e,t,n){if(uT(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(gT(t)){let r=0;for(let i of t.items){let t=BT(e,i,n);t>r&&(r=t)}return r}else if(pT(t)){let r=BT(e,t.key,n),i=BT(e,t.value,n);return Math.max(r,i)}return 1}var VT=e=>!e||typeof e!=`function`&&typeof e!=`object`,HT=class extends RT{constructor(e){super(sT),this.value=e}toJSON(e,t){return t?.keep?this.value:LT(this.value,e,t)}toString(){return String(this.value)}};HT.BLOCK_FOLDED=`BLOCK_FOLDED`,HT.BLOCK_LITERAL=`BLOCK_LITERAL`,HT.PLAIN=`PLAIN`,HT.QUOTE_DOUBLE=`QUOTE_DOUBLE`,HT.QUOTE_SINGLE=`QUOTE_SINGLE`;var UT=`tag:yaml.org,2002:`;function WT(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function GT(e,t,n){if(dT(e)&&(e=e.contents),_T(e))return e;if(pT(e)){let t=n.schema[aT].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new zT(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=UT+t.slice(2));let l=WT(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new HT(e);return c&&(c.node=t),t}l=e instanceof Map?o[aT]:Symbol.iterator in Object(e)?o[cT]:o[aT]}a&&(a(l),delete n.onTagObjLine truncated layout(location=0) in vec2 a_pos;
`)?XT(n,t):n.includes(` out vec2 v_uv;
void main(){ v_uv=a_pos*0.5+0.5; gl_Position=vec4(a_pos,0.0,1.0); }
`,uC=`#version 300 es
precision highp float;
in vec2 v_uv; out vec4 fc;
uniform float u_time, u_slider, u_elapsed, u_grid_x;
uniform vec3 u_ember, u_glow, u_core;
uniform sampler2D u_back;
float hash(vec2 p){ return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453); }
void main(){
vec2 uv=v_uv;
vec2 g=uv*vec2(u_grid_x,6.0);
vec2 id=floor(g);
vec2 cf=fract(g);
float h=hash(id);
vec2 ap=abs(cf-0.5);
float cell=smoothstep(0.34,0.22,max(ap.x*0.9,ap.y));
vec3 prev=texture(u_back,uv).rgb;
float fade_mask = smoothstep(0.0, 0.45, uv.x);
vec3 decay = prev * 0.90 * fade_mask;
float act=smoothstep(0.95,1.0,u_slider);
if(act<0.01||u_elapsed<0.0){ fc=vec4(decay,1.0); return; }
float t=u_time;
float cellDelay = h * 1.2;
float cellAge = max(u_elapsed - cellDelay, 0.0);
float ignited = step(0.001, cellAge);
float cellSpd = 0.85 + h * 0.30;
float eased = 1.0 - pow(1.0 - clamp(cellAge / 2.5, 0.0, 1.0), 3.0);
float dist = eased * u_slider * cellSpd * ignited;
float cellOff = (h - 0.5) * 0.05;
float front = max(u_slider - dist - cellOff, 0.02);
float tail = max(u_slider - front, 0.001);
float inZ = step(front - 0.003, uv.x) * step(uv.x, u_slider + 0.003);
float dn = clamp(max(u_slider - uv.x, 0.0) / tail, 0.0, 1.0);
float bright = pow(1.0 - dn, 0.65);
bright = max(bright, 0.04 * ignited) * inZ;
bright *= 1.0 - smoothstep(0.94, 1.05, dn);
float es = mix(0.15, 0.5, min(u_elapsed / 1.0, 1.0));
float vy = abs(uv.y - 0.5) * 2.0;
float vf = pow(max(1.0 - vy * vy * 0.45, 0.0), 0.75);
float ts = mix(0.85, 1.0, min(u_elapsed / 1.5, 1.0));
float f1 = sin(uv.x * 30.0 + t * 15.0 * ts + h * 6.28);
float f2 = sin(uv.x * 17.0 + t * 8.0 * ts + h * 3.14);
float f3 = sin(uv.x * 52.0 + t * 25.0 * ts + h * 10.0);
float flame = smoothstep(0.08, 0.92, (f1 + f2 * 0.5 + f3 * 0.25) * 0.35 + 0.5);
float r1 = sin(dn * 16.0 - t * 5.0 * ts + h * 3.0);
float r2 = sin(dn * 8.0 - t * 2.5 * ts + h * 5.0);
float rhythm = smoothstep(-0.15, 0.55, r1) * (r2 * 0.5 + 0.5);
rhythm = pow(max(rhythm, 0.0), 1.2);
float avgSpd = dist / max(cellAge, 0.001);
float age = max(cellAge - max(u_slider - uv.x, 0.0) / max(avgSpd, 0.001), 0.0);
float flash = step(0.0, age) * exp(-age * 3.2);
float sp = fract(t * (0.38 + h * 0.15) + h * 7.0);
float sX = u_slider - sp * tail;
float sY = 0.5 + sin(sp * 11.0 + h * 6.28) * 0.28;
float spark = smoothstep(0.014, 0.0, abs(uv.x - sX))
* smoothstep(0.18, 0.0, abs(uv.y - sY))
* (1.0 - sp) * (1.0 - sp) * es;
float energy = bright * vf * (flame * 0.42 + rhythm * 0.38)
+ flash * bright * vf * 0.55
+ spark * 0.7 * inZ;
energy *= es;
float edgeBase = exp(-pow((uv.x - front) * 18.0, 2.0));
float ef1 = sin(uv.x * 45.0 + t * 20.0 * ts + h * 6.28) * 0.5 + 0.5;
float ef2 = sin(uv.x * 28.0 + t * 11.0 * ts + h * 3.14) * 0.5 + 0.5;
float edge = edgeBase * (0.25 + ef1 * ef2 * 1.5) * 1.6 * act * es;
float leadD = front - uv.x;
float leadZone = smoothstep(0.07, 0.0, leadD) * step(0.0, leadD) * vf;
float h2 = hash(id + vec2(99.0, 33.0));
float leadF = sin(leadD * 100.0 + t * 20.0 * ts + h2 * 6.28) * 0.5 + 0.5;
float leadSpark = leadZone * step(0.6, h2) * leadF * act * es * 0.5;
float total = energy + edge + leadSpark;
vec3 ember = u_ember;
vec3 wpur = u_glow;
vec3 wht = u_core;
float temp = 1.0 - dn;
vec3 col = mix(ember, wpur, temp);
col = mix(col, wht, pow(temp, 4.5));
col *= total;
float pulse = sin(t * 2.8) * 0.15 + 1.0;
float core = exp(-pow((uv.x - u_slider) * 16.0, 2.0));
col += wht * core * 2.2 * pulse * act * es;
col += wpur * exp(-pow((uv.x - u_slider) * 3.5, 2.0)) * 0.12 * act * es;
col *= cell;
col *= fade_mask;
fc = vec4(min(decay + col, vec3(1.5)), 1.0);
}
`,dC=`#version 300 es
precision highp float;
in vec2 v_uv; out vec4 fc;
uniform sampler2D u_tex;
uniform vec2 u_dir, u_res;
uniform float u_ext;
vec3 s(vec2 uv){
vec3 c=texture(u_tex,uv).rgb;
return u_ext>0.5 && dot(c,vec3(0.2126,0.7152,0.0722))<0.3 ? vec3(0.0) : c;
}
void main(){
vec2 o=u_dir*1.8/u_res;
vec3 r=s(v_uv)*0.227027;
r+=s(v_uv+o)*0.194595; r+=s(v_uv-o)*0.194595;
r+=s(v_uv+o*2.0)*0.121622;r+=s(v_uv-o*2.0)*0.121622;
r+=s(v_uv+o*3.0)*0.054054;r+=s(v_uv-o*3.0)*0.054054;
fc=vec4(r,1.0);
}
`,fC=`#version 300 es
precision highp float;
in vec2 v_uv; out vec4 fc;
uniform sampler2D u_scene, u_glow;
void main(){
vec3 s=texture(u_scene,v_uv).rgb;
vec3 g=texture(u_glow,v_uv).rgb;
fc=vec4(1.0-exp(-(s+g*1.2+s*g*0.35)*1.15),1.0);
}
`,pC=256,mC=58,hC=[198/255,87/255,70/255],gC=[139/255,134/255,128/255],_C=[1,1,1],vC={ember:[.38,.14,.1],glow:[.78,.34,.27],core:[1,.9,.86]};function yC(e){return Math.max(0,Math.min(1,e))}function bC(e){let t=e.trim();if(!t)return null;let n=t.match(/^#([\da-f]{3}|[\da-f]{6})$/i);if(n){let e=n[1],t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e,r=Number.parseInt(t,16);return[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255]}let r=t.match(/^rgba?\((.+)\)$/i);if(!r)return null;let i=r[1].replace(/\s*\/.*$/,``).split(/[,\s]+/).filter(Boolean).slice(0,3);if(i.length!==3)return null;let a=i.map(e=>e.endsWith(`%`)?yC(Number.parseFloat(e)/100):yC(Number.parseFloat(e)/255));return a.some(e=>Number.isNaN(e))?null:[a[0],a[1],a[2]]}function xC(e,t,n){let r=yC(n);return[e[0]*(1-r)+t[0]*r,e[1]*(1-r)+t[1]*r,e[2]*(1-r)+t[2]*r]}function SC(e){let t=window.getComputedStyle(e),n=window.getComputedStyle(document.documentElement),r=e=>bC(t.getPropertyValue(e))??bC(n.getPropertyValue(e)),i=r(`--warning-color`)??hC,a=r(`--primary-color`)??gC,o=r(`--primary-contrast`)??_C;return{ember:xC(i,[0,0,0],.46),glow:xC(i,a,.18),core:xC(i,o,.72)}}function CC(e,t,n){let r=(0,y.useRef)(t),i=(0,y.useRef)(n),a=(0,y.useRef)(null),o=(0,y.useRef)({ensureLoop:()=>{}});(0,y.useEffect)(()=>{r.current=t},[t]),(0,y.useEffect)(()=>{i.current=n,n?(a.current=performance.now(),o.current.ensureLoop()):a.current=null},[n]),(0,y.useEffect)(()=>{let t=null,n=null,s=null,c=null,l=null,u=!1,d=0,f=!1,p=null,m=null,h=null,g=null,_=null,v=!1,y=null,b=null,x=null,S=null,C={simTime:null,simSlider:null,simElapsed:null,simGridX:null,simEmber:null,simGlow:null,simCore:null,simBack:null,blurDir:null,blurExt:null,blurTex:null,blurRes:null,compScene:null,compGlow:null},w=mC,T=vC,E=null;function D(e){e.preventDefault()}function O(){j(),v&&(ee(),i.current&&te())}function k(e,n){if(!t)return null;let r=t.createShader(e);return r?(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)?r:(console.error(t.getShaderInfoLog(r)),t.deleteShader(r),null)):null}function A(e,n){if(!t)return null;let r=k(t.VERTEX_SHADER,e),i=k(t.FRAGMENT_SHADER,n);if(!r||!i)return null;let a=t.createProgram();return a?(t.attachShader(a,r),t.attachShader(a,i),t.bindAttribLocation(a,0,`a_pos`),t.linkProgram(a),t.deleteShader(r),t.deleteShader(i),t.getProgramParameter(a,t.LINK_STATUS)?a:(console.error(t.getProgramInfoLog(a)),null)):null}function j(){t&&(p=A(lC,uC),m=A(lC,dC),h=A(lC,fC),!(!p||!m||!h)&&(g=t.createVertexArray(),t.bindVertexArray(g),_=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,_),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),C.simTime=t.getUniformLocation(p,`u_time`),C.simSlider=t.getUniformLocation(p,`u_slider`),C.simElapsed=t.getUniformLocation(p,`u_elapsed`),C.simGridX=t.getUniformLocation(p,`u_grid_x`),C.simEmber=t.getUniformLocation(p,`u_ember`),C.simGlow=t.getUniformLocation(p,`u_glow`),C.simCore=t.getUniformLocation(p,`u_core`),C.simBack=t.getUniformLocation(p,`u_back`),C.blurDir=t.getUniformLocation(m,`u_dir`),C.blurExt=t.getUniformLocation(m,`u_ext`),C.blurTex=t.getUniformLocation(m,`u_tex`),C.blurRes=t.getUniformLocation(m,`u_res`),C.compScene=t.getUniformLocation(h,`u_scene`),C.compGlow=t.getUniformLocation(h,`u_glow`),v=!0))}function M(){if(!t||!n)return null;let e=t.createFramebuffer(),r=t.createTexture();return!e||!r?null:(t.bindFramebuffer(t.FRAMEBUFFER,e),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n.width,n.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),{fbo:e,tex:r})}function N(){!t||!n||(y=M(),b=M(),x=M(),S=M())}function P(e){!t||!e||(t.deleteFramebuffer(e.fbo),t.deleteTexture(e.tex))}function F(){P(y),y=null,P(b),b=null,P(x),x=null,P(S),S=null}function I(){n&&(T=SC(n))}function L(){t&&(p&&(t.deleteProgram(p),p=null),m&&(t.deleteProgram(m),m=null),h&&(t.deleteProgram(h),h=null),g&&(t.deleteVertexArray(g),g=null),_&&(t.deleteBuffer(_),_=null),v=!1)}function ee(){if(!t||!n)return;let e=n.getBoundingClientRect();if(!e.width||!e.height)return;let r=window.devicePixelRatio||1;w=Math.max(mC,Math.round(e.width/pC*mC)),n.width=Math.round(e.width*r),n.height=Math.round(e.height*r),F(),N()}function te(){if(!((!y||!b)&&(ee(),!y||!b))){if(u){d=0;return}u=!0,d=0,f=!1,t?.bindFramebuffer(t.FRAMEBUFFER,y.fbo),t?.clear(t.COLOR_BUFFER_BIT),t?.bindFramebuffer(t.FRAMEBUFFER,b.fbo),t?.clear(t.COLOR_BUFFER_BIT),s=requestAnimationFrame(ne)}}function ne(e){let o=i.current;if(!o&&!f){if(++d>180){u=!1,s=null;return}s=requestAnimationFrame(ne);return}if(d=0,o&&!f&&(t?.bindFramebLine truncated
`)}};EO.defaultYaml={explicit:!1,version:`1.2`},EO.defaultTags={"!!":`tag:yaml.org,2002:`};function DO(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function OO(e){let t=new Set;return _O(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function kO(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function AO(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=OO(e));let a=kO(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(lO(t.node)||dO(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function jO(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=jO(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=jO(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=jO(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=jO(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function MO(e,t,n){if(Array.isArray(e))return e.map((e,t)=>MO(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!pO(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var NO=class{constructor(e){Object.defineProperty(this,iO,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!oO(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=MO(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?jO(i,{"":o},``,o):o}},PO=class extends NO{constructor(e){super(QD),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],_O(e,{Node:(e,t)=>{(aO(t)||pO(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||(MO(a,null,t),o=n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=FO(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(DO(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function FO(e,t,n){if(aO(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(dO(t)){let r=0;for(let i of t.items){let t=FO(e,i,n);t>r&&(r=t)}return r}else if(cO(t)){let r=FO(e,t.key,n),i=FO(e,t.value,n);return Math.max(r,i)}return 1}var IO=e=>!e||typeof e!=`function`&&typeof e!=`object`,LO=class extends NO{constructor(e){super(nO),this.value=e}toJSON(e,t){return t?.keep?this.value:MO(this.value,e,t)}toString(){return String(this.value)}};LO.BLOCK_FOLDED=`BLOCK_FOLDED`,LO.BLOCK_LITERAL=`BLOCK_LITERAL`,LO.PLAIN=`PLAIN`,LO.QUOTE_DOUBLE=`QUOTE_DOUBLE`,LO.QUOTE_SINGLE=`QUOTE_SINGLE`;var RO=`tag:yaml.org,2002:`;function zO(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function BO(e,t,n){if(oO(e)&&(e=e.contents),fO(e))return e;if(cO(e)){let t=n.schema[eO].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new PO(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=RO+t.slice(2));let l=zO(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new LO(e);return c&&(c.node=t),t}l=e instanceof Map?o[eO]:Symbol.iterator in Object(e)?o[rO]:o[eO]}a&&(a(l),delete n.onTagObjLine truncated
`)?GO(n,t):n.includes(`
`)?` `)?`
`+XT(n,t):(e.endsWith(` `)?``:` `)+n,QT=`flow`,$T=`block`,eE=`quoted`;function tE(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=nE(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===` `+GO(n,t):(e.endsWith(` `)?``:` `)+n,qO=`flow`,JO=`block`,YO=`quoted`;function XO(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ZO(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=nE(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==` `)n===`block`&&(h=ZO(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==` `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function nE(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==` `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ZO(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var rE=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),iE=e=>/^(%|---|\.\.\.)/m.test(e);function aE(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===` `);r=t,i=t+1,a=e[i]}return r}var QO=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$O=e=>/^(%|---|\.\.\.)/m.test(e);function ek(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function oE(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(iE(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+` `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function tk(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||($O(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=` `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:tE(o,a,eE,rE(t,!1))}function sE(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(` `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:XO(o,a,YO,QO(t,!1))}function nk(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return oE(e,t);let n=t.indent||(iE(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:tE(r,n,QT,rE(t,!1))}function cE(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=oE;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?sE:i&&!t?oE:n?sE:oE}return r(e,t)}var lE;try{lE=RegExp(`(^|(?<! `)||/[ \t]\n|\n[ \t]/.test(e))return tk(e,t);let n=t.indent||($O(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:XO(r,n,qO,QO(t,!1))}function rk(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=tk;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?nk:i&&!t?tk:n?nk:tk}return r(e,t)}var ik;try{ik=RegExp(`(^|(?<!
)) ))
+(?! +(?!
|$)`,`g`)}catch{lE=/\n+(?!\n|$)/g}function uE({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return cE(n,r);let l=r.indent||(r.forceBlockIndent||iE(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===HT.BLOCK_FOLDED?!1:t===HT.BLOCK_LITERAL?!0:!aE(n,c,l.length);if(!n)return u?`| |$)`,`g`)}catch{ik=/\n+(?!\n|$)/g}function ak({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return rk(n,r);let l=r.indent||(r.forceBlockIndent||$O(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===LO.BLOCK_FOLDED?!1:t===LO.BLOCK_LITERAL?!0:!ek(n,c,l.length);if(!n)return u?`|
`:`> `:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==` `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(` `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&(n=n.slice(0,-p.length),p[p.length-1]===` `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p=p.replace(lE,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===` `&&(p=p.slice(0,-1)),p=p.replace(ik,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,` `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=rE(r,!0);o!==`folded`&&t!==HT.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=tE(`${v}${e}${p}`,l,$T,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function dE(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(` $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=QO(r,!0);o!==`folded`&&t!==LO.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=XO(`${v}${e}${p}`,l,JO,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function ok(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return cE(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` `)||u&&/[[\]{},]/.test(a))return rk(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?cE(a,t):uE(e,t,n,r);if(!s&&!u&&i!==HT.PLAIN&&a.includes(` `)?rk(a,t):ak(e,t,n,r);if(!s&&!u&&i!==LO.PLAIN&&a.includes(`
`))return uE(e,t,n,r);if(iE(a)){if(c===``)return t.forceBlockIndent=!0,uE(e,t,n,r);if(s&&c===l)return cE(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return cE(a,t)}return s?d:tE(d,c,QT,rE(t,!1))}function fE(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==HT.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=HT.QUOTE_DOUBLE);let c=e=>{switch(e){case HT.BLOCK_FOLDED:case HT.BLOCK_LITERAL:return i||a?cE(o.value,t):uE(o,t,n,r);case HT.QUOTE_DOUBLE:return oE(o.value,t);case HT.QUOTE_SINGLE:return sE(o.value,t);case HT.PLAIN:return dE(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function pE(e,t){let n=Object.assign({blockQuote:!0,commentString:YT,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function mE(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(mT(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function hE(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(mT(e)||gT(e))&&e.anchor;a&&MT(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function gE(e,t,n,r){if(pT(e))return e.toString(t,n,r);if(uT(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=_T(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=mE(t.doc.schema.tags,a));let o=hE(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):mT(a)?fE(a,t,n,r):a.toString(t,n,r);return o?mT(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function _E({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=_T(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(gT(e)||!_T(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||gT(e)||(mT(e)?e.type===HT.BLOCK_FOLDED||e.type===HT.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=gE(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=ZT(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=ZT(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=ZT(g,n.indent,l(f))));let _,v,y;_T(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&mT(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&hT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=gE(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?` `))return ak(e,t,n,r);if($O(a)){if(c===``)return t.forceBlockIndent=!0,ak(e,t,n,r);if(s&&c===l)return rk(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return rk(a,t)}return s?d:XO(d,c,qO,QO(t,!1))}function sk(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==LO.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=LO.QUOTE_DOUBLE);let c=e=>{switch(e){case LO.BLOCK_FOLDED:case LO.BLOCK_LITERAL:return i||a?rk(o.value,t):ak(o,t,n,r);case LO.QUOTE_DOUBLE:return tk(o.value,t);case LO.QUOTE_SINGLE:return nk(o.value,t);case LO.PLAIN:return ok(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function ck(e,t){let n=Object.assign({blockQuote:!0,commentString:WO,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function lk(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(lO(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function uk(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(lO(e)||dO(e))&&e.anchor;a&&DO(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function dk(e,t,n,r){if(cO(e))return e.toString(t,n,r);if(aO(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=fO(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=lk(t.doc.schema.tags,a));let o=uk(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):lO(a)?sk(a,t,n,r):a.toString(t,n,r);return o?lO(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function fk({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=fO(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(dO(e)||!fO(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||dO(e)||(lO(e)?e.type===LO.BLOCK_FOLDED||e.type===LO.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=dk(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=KO(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=KO(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=KO(g,n.indent,l(f))));let _,v,y;fO(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&lO(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&uO(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=dk(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${XT(e,n.indent)}`}x===``&&!n.inFlow?S===` `:``,v){let e=l(v);S+=`\n${GO(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=` `&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&gT(t)){let e=x[0],r=x.indexOf(` `):S+=`\n${n.indent}`}else if(!p&&dO(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===` `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=ZT(g,n.indent,l(y)):h&&i&&i(),g}function vE(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var yE=`<<`,bE={identify:e=>e===yE||typeof e==`symbol`&&e.description===yE,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new HT(Symbol(yE)),{addToJSMap:SE}),stringify:()=>yE},xE=(e,t)=>(bE.identify(t)||mT(t)&&(!t.type||t.type===HT.PLAIN)&&bE.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===bE.tag&&e.default);function SE(e,t,n){if(n=e&&uT(n)?n.resolve(e.doc):n,hT(n))for(let r of n.items)CE(e,t,r);else if(Array.isArray(n))for(let r of n)CE(e,t,r);else CE(e,t,n)}function CE(e,t,n){let r=e&&uT(n)?n.resolve(e.doc):n;if(!fT(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function wE(e,t,{key:n,value:r}){if(_T(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(xE(e,n))SE(e,t,r);else{let i=LT(n,``,e);if(t instanceof Map)t.set(i,LT(r,i,e));else if(t instanceof Set)t.add(i);else{let a=TE(n,i,e),o=LT(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function TE(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(_T(e)&&n?.doc){let t=pE(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),vE(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function EE(e,t,n){return new DE(GT(e,void 0,n),GT(t,void 0,n))}var DE=class e{constructor(e,t=null){Object.defineProperty(this,lT,{value:oT}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return _T(n)&&(n=n.clone(t)),_T(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return wE(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?_E(this,e,t,n):JSON.stringify(this)}};function OE(e,t,n){return(t.inFlow??e.flow?AE:kE)(e,t,n)}function kE({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(_T(i))!d&&i.spaceBefore&&f.push(``),jE(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(pT(i)){let e=_T(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),jE(n,f,e.commentBefore,d))}d=!1;let s=gE(i,u,()=>o=null,()=>d=!0);o&&(s+=ZT(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:` `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=KO(g,n.indent,l(y)):h&&i&&i(),g}function pk(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var mk=`<<`,hk={identify:e=>e===mk||typeof e==`symbol`&&e.description===mk,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new LO(Symbol(mk)),{addToJSMap:_k}),stringify:()=>mk},gk=(e,t)=>(hk.identify(t)||lO(t)&&(!t.type||t.type===LO.PLAIN)&&hk.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hk.tag&&e.default);function _k(e,t,n){if(n=e&&aO(n)?n.resolve(e.doc):n,uO(n))for(let r of n.items)vk(e,t,r);else if(Array.isArray(n))for(let r of n)vk(e,t,r);else vk(e,t,n)}function vk(e,t,n){let r=e&&aO(n)?n.resolve(e.doc):n;if(!sO(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function yk(e,t,{key:n,value:r}){if(fO(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(gk(e,n))_k(e,t,r);else{let i=MO(n,``,e);if(t instanceof Map)t.set(i,MO(r,i,e));else if(t instanceof Set)t.add(i);else{let a=bk(n,i,e),o=MO(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function bk(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(fO(e)&&n?.doc){let t=ck(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),pk(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function xk(e,t,n){return new Sk(BO(e,void 0,n),BO(t,void 0,n))}var Sk=class e{constructor(e,t=null){Object.defineProperty(this,iO,{value:tO}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return fO(n)&&(n=n.clone(t)),fO(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return yk(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?fk(this,e,t,n):JSON.stringify(this)}};function Ck(e,t,n){return(t.inFlow??e.flow?Tk:wk)(e,t,n)}function wk({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(fO(i))!d&&i.spaceBefore&&f.push(``),Ek(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(cO(i)){let e=fO(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Ek(n,f,e.commentBefore,d))}d=!1;let s=dk(i,u,()=>o=null,()=>d=!0);o&&(s+=KO(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=` `}}return e?(p+=`
`+XT(l(e),c),s&&s()):d&&o&&o(),p}function AE({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(_T(i))i.spaceBefore&&d.push(``),jE(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(pT(i)){let e=_T(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),jE(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=_T(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=gE(i,c,()=>a=null);l||(l=d.length>u||o.includes(` `+GO(l(e),c),s&&s()):d&&o&&o(),p}function Tk({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(fO(i))i.spaceBefore&&d.push(``),Ek(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(cO(i)){let e=fO(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Ek(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=fO(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=dk(i,c,()=>a=null);l||(l=d.length>u||o.includes(`
`)),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),l&&(o+=`,`)),a&&(o+=ZT(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:` `)),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),l&&(o+=`,`)),a&&(o+=KO(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function jE({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=XT(t(r),e);n.push(i.trimStart())}}function ME(e,t){let n=mT(t)?t.value:t;for(let r of e)if(pT(r)&&(r.key===t||r.key===n||mT(r.key)&&r.key.value===n))return r}var NE=class extends JT{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(aT,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(EE(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=pT(e)?e:!e||typeof e!=`object`||!(`key`in e)?new DE(e,e?.value):new DE(e.key,e.value);let r=ME(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);mT(r.value)&&VT(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=ME(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=ME(this.items,e)?.value;return(!t&&mT(n)?n.value:n)??void 0}has(e){return!!ME(this.items,e)}set(e,t){this.add(new DE(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)wE(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!pT(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),OE(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},PE={collection:`map`,default:!0,nodeClass:NE,tag:`tag:yaml.org,2002:map`,resolve(e,t){return fT(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>NE.from(e,t,n)},FE=class extends JT{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(cT,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=IE(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=IE(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&mT(r)?r.value:r}has(e){let t=IE(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=IE(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];mT(r)&&VT(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(LT(e,String(r++),t));return n}toString(e,t,n){return e?OE(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(GT(a,void 0,n))}}return i}};function IE(e){let t=mT(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var LE={collection:`seq`,default:!0,nodeClass:FE,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return hT(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>FE.from(e,t,n)},RE={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),fE(e,t,n,r)}},zE={identify:e=>e==null,createNode:()=>new HT(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new HT(null),stringify:({source:e},t)=>typeof e==`string`&&zE.test.test(e)?e:t.options.nullStr},BE={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new HT(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&BE.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function VE({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var HE={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:VE},UE={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let tLine truncated `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Ek({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=GO(t(r),e);n.push(i.trimStart())}}function Dk(e,t){let n=lO(t)?t.value:t;for(let r of e)if(cO(r)&&(r.key===t||r.key===n||lO(r.key)&&r.key.value===n))return r}var Ok=class extends UO{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(eO,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(xk(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=cO(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Sk(e,e?.value):new Sk(e.key,e.value);let r=Dk(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);lO(r.value)&&IO(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Dk(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Dk(this.items,e)?.value;return(!t&&lO(n)?n.value:n)??void 0}has(e){return!!Dk(this.items,e)}set(e,t){this.add(new Sk(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)yk(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!cO(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ck(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},kk={collection:`map`,default:!0,nodeClass:Ok,tag:`tag:yaml.org,2002:map`,resolve(e,t){return sO(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Ok.from(e,t,n)},Ak=class extends UO{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(rO,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=jk(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=jk(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&lO(r)?r.value:r}has(e){let t=jk(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=jk(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];lO(r)&&IO(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(MO(e,String(r++),t));return n}toString(e,t,n){return e?Ck(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(BO(a,void 0,n))}}return i}};function jk(e){let t=lO(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Mk={collection:`seq`,default:!0,nodeClass:Ak,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return uO(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Ak.from(e,t,n)},Nk={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),sk(e,t,n,r)}},Pk={identify:e=>e==null,createNode:()=>new LO(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new LO(null),stringify:({source:e},t)=>typeof e==`string`&&Pk.test.test(e)?e:t.options.nullStr},Fk={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new LO(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Fk.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Ik({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var Lk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Ik},Rk={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let tLine truncated
`:` `)}return fE({comment:e,type:t,value:s},r,i,a)}};function rD(e,t){if(hT(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!pT(r)){if(fT(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new DE(new HT(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=pT(r)?r:new DE(r)}}else t(`Expected a sequence for this tag`);return e}function iD(e,t,n){let{replacer:r}=n,i=new FE(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(EE(o,s,n))}return i}var aD={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:rD,createNode:iD},oD=class e extends FE{constructor(){super(),this.add=NE.prototype.add.bind(this),this.delete=NE.prototype.delete.bind(this),this.get=NE.prototype.get.bind(this),this.has=NE.prototype.has.bind(this),this.set=NE.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(pT(e)?(r=LT(e.key,``,t),i=LT(e.value,r,t)):r=LT(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=iD(e,t,n),i=new this;return i.items=r.items,i}};oD.tag=`tag:yaml.org,2002:omap`;var sD={collection:`seq`,identify:e=>e instanceof Map,nodeClass:oD,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=rD(e,t),r=[];for(let{key:e}of n.items)mT(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new oD,n)},createNode:(e,t,n)=>oD.from(e,t,n)};function cD({value:e,source:t},n){return t&&(e?lD:uD).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var lD={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new HT(!0),stringify:cD},uD={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new HT(!1),stringify:cD},dD={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:VE},fD={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():VE(e)}},pD={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new HT(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:VE},mD=e=>typeof e==`bigint`||Number.isInteger(e);function hD(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function gD(e,t,n){let{value:r}=e;if(mD(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return VE(e)}var _D={identify:mD,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>hD(e,2,2,n),stringify:e=>gD(e,2,`0b`)},vD={identify:mD,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>hD(e,1,8,n),stringify:e=>gD(e,8,`0`)},yD={identify:mD,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>hD(e,0,10,n),stringify:VE},bD={identify:mD,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>hD(e,2,16,n),stringify:e=>gD(e,16,`0x`)},xD=class e extends NE{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=pT(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new DE(e.key,null):new DE(e,null),ME(this.items,t.key)||this.items.push(t)}get(e,t){let n=ME(this.items,e);return!t&&pT(n)?mT(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ME(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new DE(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))retLine truncated `:` `)}return sk({comment:e,type:t,value:s},r,i,a)}};function Qk(e,t){if(uO(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!cO(r)){if(sO(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Sk(new LO(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=cO(r)?r:new Sk(r)}}else t(`Expected a sequence for this tag`);return e}function $k(e,t,n){let{replacer:r}=n,i=new Ak(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(xk(o,s,n))}return i}var eA={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Qk,createNode:$k},tA=class e extends Ak{constructor(){super(),this.add=Ok.prototype.add.bind(this),this.delete=Ok.prototype.delete.bind(this),this.get=Ok.prototype.get.bind(this),this.has=Ok.prototype.has.bind(this),this.set=Ok.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(cO(e)?(r=MO(e.key,``,t),i=MO(e.value,r,t)):r=MO(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=$k(e,t,n),i=new this;return i.items=r.items,i}};tA.tag=`tag:yaml.org,2002:omap`;var nA={collection:`seq`,identify:e=>e instanceof Map,nodeClass:tA,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Qk(e,t),r=[];for(let{key:e}of n.items)lO(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new tA,n)},createNode:(e,t,n)=>tA.from(e,t,n)};function rA({value:e,source:t},n){return t&&(e?iA:aA).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var iA={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new LO(!0),stringify:rA},aA={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new LO(!1),stringify:rA},oA={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Ik},sA={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ik(e)}},cA={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new LO(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Ik},lA=e=>typeof e==`bigint`||Number.isInteger(e);function uA(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function dA(e,t,n){let{value:r}=e;if(lA(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Ik(e)}var fA={identify:lA,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>uA(e,2,2,n),stringify:e=>dA(e,2,`0b`)},pA={identify:lA,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>uA(e,1,8,n),stringify:e=>dA(e,8,`0`)},mA={identify:lA,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>uA(e,0,10,n),stringify:Ik},hA={identify:lA,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>uA(e,2,16,n),stringify:e=>dA(e,16,`0x`)},gA=class e extends Ok{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=cO(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Sk(e.key,null):new Sk(e,null),Dk(this.items,t.key)||this.items.push(t)}get(e,t){let n=Dk(this.items,e);return!t&&cO(n)?lO(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Dk(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Sk(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))retLine truncated
`)?(n.push(`...`),n.push(XT(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(XT(a(t),``)))}return n.join(` `)?(n.push(`...`),n.push(GO(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(GO(a(t),``)))}return n.join(`
`)+` `)+`
`}var ID=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,lT,{value:iT});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new jT({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[lT]:{value:iT}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=_T(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){LD(this.contents)&&this.contents.add(e)}addIn(e,t){LD(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=NT(this);e.anchor=!t||n.has(t)?PT(t||`a`,n):t}return new zT(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=FT(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=GT(e,l,p);return o&&gT(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new DE(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return LD(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qT(e)?this.contents==null?!1:(this.contents=null,!0):LD(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return gT(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return qT(e)?!t&&mT(this.contents)?this.contents.value:this.contents:gT(this.contents)?this.contents.getIn(e,t):void 0}has(e){return gT(this.contents)?this.contents.has(e):!1}hasIn(e){return qT(e)?this.contents!==void 0:gT(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=KT(this.schema,[e],t):LD(this.contents)&&this.contents.set(e,t)}setIn(e,t){qT(e)?this.contents=t:this.contents==null?this.contents=KT(this.schema,Array.from(e),t):LD(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new jT({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new jT({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new PD(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=LT(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?IT(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return FD(this,e)}};function LD(e){if(gT(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var RD=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},zD=class extends RD{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},BD=class extends RD{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},VD=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… `}var jA=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,iO,{value:$D});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new EO({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[iO]:{value:$D}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=fO(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){MA(this.contents)&&this.contents.add(e)}addIn(e,t){MA(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=OO(this);e.anchor=!t||n.has(t)?kO(t||`a`,n):t}return new PO(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=AO(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=BO(e,l,p);return o&&dO(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Sk(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return MA(this.contents)?this.contents.delete(e):!1}deleteIn(e){return HO(e)?this.contents==null?!1:(this.contents=null,!0):MA(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return dO(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return HO(e)?!t&&lO(this.contents)?this.contents.value:this.contents:dO(this.contents)?this.contents.getIn(e,t):void 0}has(e){return dO(this.contents)?this.contents.has(e):!1}hasIn(e){return HO(e)?this.contents!==void 0:dO(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=VO(this.schema,[e],t):MA(this.contents)&&this.contents.set(e,t)}setIn(e,t){HO(e)?this.contents=t:this.contents==null?this.contents=VO(this.schema,Array.from(e),t):MA(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new EO({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new EO({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new kA(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=MO(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?jO(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return AA(this,e)}};function MA(e){if(dO(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var NA=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},PA=class extends NA{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},FA=class extends NA{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},IA=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function HD(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),m=!1),h&&(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),h=null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function UD(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function LA(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),m=!1),h&&(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),h=null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function RA(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(UD(t.key)||UD(t.value))return!0}return!1;default:return!0}}function WD(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&UD(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function GD(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||mT(e)&&mT(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var KD=`All mapping items must start at the same column`;function qD({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??NE)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=HD(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,KD)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=` `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(RA(t.key)||RA(t.value))return!0}return!1;default:return!0}}function zA(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&RA(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function BA(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||lO(e)&&lO(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var VA=`All mapping items must start at the same column`;function HA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Ok)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=LA(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,VA)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||UD(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,KD);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&WD(r.indent,u,i),n.atKey=!1,GD(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=HD(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&WD(r.indent,f,i),s=c.range[2];let l=new DE(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=` `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||RA(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,VA);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&zA(r.indent,u,i),n.atKey=!1,BA(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=LA(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&zA(r.indent,f,i),s=c.range[2];let l=new Sk(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new DE(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function JD({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??FE)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=HD(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&WD(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function YD(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var XD=`Block collections are not allowed within flow collections`,ZD=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function QD({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?NE:FE))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=HD(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=` `+_.comment:g.comment=_.comment);let e=new Sk(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function UA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Ak)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=LA(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&zA(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function WA(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var GA=`Block collections are not allowed within flow collections`,KA=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function qA({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?Ok:Ak))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=LA(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&UD(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];pT(t)&&(t=t.value??t.key),t.comment?t.comment+=` `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&RA(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];cO(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],ZD(m)&&i(r.range,`BLOCK_IN_FLOW`,XD)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);ZD(f)&&i(g.range,`BLOCK_IN_FLOW`,XD),n.atKey=!1;let _=HD(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?ZD(m)&&i(v.range,`BLOCK_IN_FLOW`,XD):_.comment&&(g.comment?g.comment+=` `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],KA(m)&&i(r.range,`BLOCK_IN_FLOW`,GA)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);KA(f)&&i(g.range,`BLOCK_IN_FLOW`,GA),n.atKey=!1;let _=LA(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?KA(m)&&i(v.range,`BLOCK_IN_FLOW`,GA):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new DE(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;GD(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new NE(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=YD(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=` `+_.comment:g.comment=_.comment);let y=new Sk(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;BA(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Ok(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=WA(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function $D(e,t,n,r,i,a){let o=n.type===`block-map`?qD(e,t,n,r,a):n.type===`block-seq`?JD(e,t,n,r,a):QD(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function eO(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===NE.tagName&&s===`map`||o===FE.tagName&&s===`seq`)return $D(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),$D(e,t,n,i,o)}let l=$D(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=_T(u)?u:new HT(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function tO(e,t,n){let r=t.offset,i=nO(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?HT.BLOCK_FOLDED:HT.BLOCK_LITERAL,o=t.source?rO(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?` `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function JA(e,t,n,r,i,a){let o=n.type===`block-map`?HA(e,t,n,r,a):n.type===`block-seq`?UA(e,t,n,r,a):qA(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function YA(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Ok.tagName&&s===`map`||o===Ak.tagName&&s===`seq`)return JA(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),JA(e,t,n,i,o)}let l=JA(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=fO(u)?u:new LO(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function XA(e,t,n){let r=t.offset,i=ZA(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?LO.BLOCK_FOLDED:LO.BLOCK_LITERAL,o=t.source?QA(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+` `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===HT.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=` `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===LO.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=` `):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===` `:!p&&f===`
`&&(f=` `&&(f=`
@@ -97,70 +213,70 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==` `+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=` `&&(d+=`
`);break;default:d+=` `);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function nO({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function rO(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function iO(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=HT.PLAIN,c=aO(a,l);break;case`single-quoted-scalar`:s=HT.QUOTE_SINGLE,c=oO(a,l);break;case`double-quoted-scalar`:s=HT.QUOTE_DOUBLE,c=cO(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=YD(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function aO(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),sO(e)}function oO(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),sO(e.slice(1,-1)).replace(/''/g,`'`)}function sO(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r? `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function ZA({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function QA(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function $A(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=LO.PLAIN,c=ej(a,l);break;case`single-quoted-scalar`:s=LO.QUOTE_SINGLE,c=tj(a,l);break;case`double-quoted-scalar`:s=LO.QUOTE_DOUBLE,c=rj(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=WA(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function ej(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),nj(e)}function tj(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),nj(e.slice(1,-1)).replace(/''/g,`'`)}function nj(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r? `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===` `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
`?i+=a:a=` `?i+=a:a=`
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function cO(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===` `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function rj(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
`))if(i===` `))if(i===`
`){let{fold:t,offset:i}=lO(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=uO[i];if(a)n+=a;else if(i===` `){let{fold:t,offset:i}=ij(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=aj[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===` `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=dO(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==` `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=oj(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&!(a===`\r`&&e[r+2]===` `&&!(a===`\r`&&e[r+2]===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function lO(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===` `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function ij(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&!(r===`\r`&&e[t+2]!==` `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
`);)r===` `);)r===`
`&&(n+=` `&&(n+=`
`),t+=1,r=e[t+1];return n||(n=` `),{fold:n,offset:t}}var uO={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:` `),t+=1,r=e[t+1];return n||(n=` `),{fold:n,offset:t}}var aj={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function dO(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function fO(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?tO(e,t,r):iO(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[sT]:c?pO(e.schema,i,c,n,r):t.type===`scalar`?mO(e,i,t,r):e.schema[sT];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=mT(a)?a:new HT(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new HT(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function pO(e,t,n,r,i){if(n===`!`)return e[sT];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[sT])}function mO({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[sT];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[sT];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function hO(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var gO={composeNode:_O,composeEmptyNode:vO};function _O(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=yO(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=fO(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=eO(gO,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=vO(e,t.offset,void 0,null,n,r)),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!mT(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function vO(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=fO(e,{type:`scalar`,offset:hO(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function yO({options:e},{offset:t,source:n,end:r},i){let a=new zT(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=YD(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function bO(e,t,{offset:n,start:r,value:i,end:a},o){let s=new ID(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=HD(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?_O(c,i,l,o):vO(c,l.end,r,null,l,o);let u=s.contents.range[2],d=YD(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function xO(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function SO(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?` `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function oj(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function sj(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?XA(e,t,r):$A(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[nO]:c?cj(e.schema,i,c,n,r):t.type===`scalar`?lj(e,i,t,r):e.schema[nO];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=lO(a)?a:new LO(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new LO(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function cj(e,t,n,r,i){if(n===`!`)return e[nO];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[nO])}function lj({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[nO];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[nO];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function uj(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var dj={composeNode:fj,composeEmptyNode:pj};function fj(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=mj(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=sj(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=YA(dj,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=pj(e,t.offset,void 0,null,n,r)),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!lO(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function pj(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=sj(e,{type:`scalar`,offset:uj(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function mj({options:e},{offset:t,source:n,end:r},i){let a=new PO(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=WA(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function hj(e,t,{offset:n,start:r,value:i,end:a},o){let s=new jA(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=LA(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?fj(c,i,l,o):pj(c,l.end,r,null,l,o);let u=s.contents.range[2],d=WA(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function gj(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function _j(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:` `:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var CO=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=xO(e);r?this.warnings.push(new BD(i,t,n)):this.errors.push(new zD(i,t,n))},this.directives=new jT({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=SO(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(gT(i)&&!i.flow&&i.items.length>0){let e=i.items[0];pT(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:SO(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=xO(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=bO(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new zD(xO(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new zD(xO(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=YD(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new zD(xO(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new ID(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},wO=Symbol(`break visit`),TO=Symbol(`skip children`),EO=Symbol(`remove item`);function DO(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),OO(Object.freeze([]),e,t)}DO.BREAK=wO,DO.SKIP=TO,DO.REMOVE=EO,DO.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},DO.parentCollection=(e,t)=>{let n=DO.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function OO(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=OO(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===wO)return wO;else r===EO&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function kO(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case` `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var vj=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=gj(e);r?this.warnings.push(new FA(i,t,n)):this.errors.push(new PA(i,t,n))},this.directives=new EO({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=_j(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(dO(i)&&!i.flow&&i.items.length>0){let e=i.items[0];cO(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_j(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=gj(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=hj(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new PA(gj(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new PA(gj(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=WA(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new PA(gj(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new jA(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},yj=Symbol(`break visit`),bj=Symbol(`skip children`),xj=Symbol(`remove item`);function Sj(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Cj(Object.freeze([]),e,t)}Sj.BREAK=yj,Sj.SKIP=bj,Sj.REMOVE=xj,Sj.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Sj.parentCollection=(e,t)=>{let n=Sj.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Cj(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Cj(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===yj)return yj;else r===xj&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function wj(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r `:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function AO(e){switch(e){case void 0:case` `:case` `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Tj(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var jO=new Set(`0123456789ABCDEFabcdef`),MO=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),NO=new Set(`,[]{}`),PO=new Set(` ,[]{} `:case`\r`:case` `:return!0;default:return!1}}var Ej=new Set(`0123456789ABCDEFabcdef`),Dj=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Oj=new Set(`,[]{}`),kj=new Set(` ,[]{}
\r `),FO=e=>!e||PO.has(e),IO=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===` \r `),Aj=e=>!e||kj.has(e),jj=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`?!0:t===`\r`?this.buffer[e+1]===` `?!0:t===`\r`?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===` `||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&AO(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(` `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Tj(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&AO(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!AO(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&AO(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(FO),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&AO(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(FO),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||AO(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(` `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Tj(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Tj(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Tj(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Aj),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Tj(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Aj),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Tj(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(` `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>AO(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case` `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Tj(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===` `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(` `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===` `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===` `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(AO(r)||e&&NO.has(r))break;t=n}else if(AO(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===` `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Tj(r)||e&&Oj.has(r))break;t=n}else if(Tj(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=` `?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&NO.has(i))break;if(r===` `,i=this.buffer[n+1]):t=n),i===`#`||e&&Oj.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&NO.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(FO))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(AO(t)||e&&NO.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!AO(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(MO.has(t))t=this.buffer[++e];else if(t===`%`&&jO.has(this.buffer[e+1])&&jO.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Oj.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(Aj))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(Tj(t)||e&&Oj.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Tj(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Dj.has(t))t=this.buffer[++e];else if(t===`%`&&Ej.has(this.buffer[e+1])&&Ej.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===` `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},LO=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function RO(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function zO(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function BO(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function VO(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function HO(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function UO(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!RO(t.start,`explicit-key-ind`)&&!RO(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,BO(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var WO=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new IO,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=kO(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&UO(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&zO(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.itLine truncated `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Mj=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Nj(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Pj(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Fj(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Ij(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function Lj(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function Rj(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Nj(t.start,`explicit-key-ind`)&&!Nj(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Fj(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var zj=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new jj,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=wj(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&Rj(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Pj(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.itLine truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(RO(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=HO(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(RO(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(BO(t.key)&&!RO(t.sep,`newline`)){let e=HO(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):RO(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!RO(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||RO(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newlLine truncated `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Nj(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=Lj(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Nj(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Fj(t.key)&&!Nj(t.sep,`newline`)){let e=Lj(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Nj(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Nj(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Nj(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newlLine truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=HO(VO(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=HO(VO(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function GO(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new LO||null,prettyErrors:t}}function KO(e,t={}){let{lineCounter:n,prettyErrors:r}=GO(t),i=new WO(n?.addNewLine),a=new CO(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new zD(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(VD(e,n)),o.warnings.forEach(VD(e,n))),o}function qO(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=KO(e,n);if(!i)return null;if(i.warnings.forEach(e=>vE(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var JO={section:`ConfigSection-module__section___36A5y`,header:`ConfigSection-module__header___9y9kI`,titleRow:`ConfigSection-module__titleRow___MDqPS`,indexBadge:`ConfigSection-module__indexBadge___BNk-6`,iconBadge:`ConfigSection-module__iconBadge___608--`,headingGroup:`ConfigSection-module__headingGroup___iqK3P`,title:`ConfigSection-module__title___fNwM-`,description:`ConfigSection-module__description___uM2Zw`,content:`ConfigSection-module__content___RBAGw`},YO=(0,y.forwardRef)(function({title:e,description:t,indexLabel:n,icon:r,className:i,children:a,...o},s){return(0,I.jsxs)(`section`,{ref:s,className:[JO.section,i].filter(Boolean).join(` `),...o,children:[(0,I.jsxs)(`header`,{className:JO.header,children:[(0,I.jsxs)(`div`,{className:JO.titleRow,children:[n?(0,I.jsx)(`span`,{className:JO.indexBadge,children:n}):null,r?(0,I.jsx)(`span`,{className:JO.iconBadge,children:r}):null]}),(0,I.jsxs)(`div`,{className:JO.headingGroup,children:[(0,I.jsx)(`h2`,{className:JO.title,children:e}),t?(0,I.jsx)(`p`,{className:JO.description,children:t}):null]})]}),(0,I.jsx)(`div`,{className:JO.content,children:a})]})});function XO(e){let[t,n]=(0,y.useState)(()=>window.matchMedia(e).matches);return(0,y.useEffect)(()=>{let t=window.matchMedia(e),r=e=>{n(e.matches)};return r({matches:t.matches}),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var G={visualEditor:`VisualConfigEditor-module__visualEditor___qt8bb`,expandableInputWrapper:`VisualConfigEditor-module__expandableInputWrapper___k5rpc`,expandableTextarea:`VisualConfigEditor-module__expandableTextarea___OVvmN`,expandableToggle:`VisualConfigEditor-module__expandableToggle___M5mBU`,expandableInputExpanded:`VisualConfigEditor-module__expandableInputExpanded___9zfyv`,overview:`VisualConfigEditor-module__overview___OzHQc`,overviewHeader:`VisualConfigEditor-module__overviewHeader___A8kWa`,overviewMeta:`VisualConfigEditor-module__overviewMeta___SM8ZF`,overviewPill:`VisualConfigEditor-module__overviewPill___eXq54`,overviewPillWarning:`VisualConfigEditor-module__overviewPillWarning___ruscj`,modeSwitch:`VisualConfigEditor-module__modeSwitch___RaXgu`,modeButton:`VisualConfigEditor-module__modeButton___4q91-`,modeButtonActive:`VisualConfigEditor-module__modeButtonActive___2l-EB`,searchBox:`VisualConfigEditor-module__searchBox___5Hbe-`,searchControl:`VisualConfigEditor-module__searchControl___qs3dO`,searchIcon:`VisualConfigEditor-module__searchIcon___SSFNZ`,searchResults:`VisualConfigEditor-module__searchResults___LmzzD`,searchResultItem:`VisualConfigEditor-module__searchResultItem___WXj4b`,searchResultItemActive:`VisualCLine truncated `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=Lj(Ij(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=Lj(Ij(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Bj(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Mj||null,prettyErrors:t}}function Vj(e,t={}){let{lineCounter:n,prettyErrors:r}=Bj(t),i=new zj(n?.addNewLine),a=new vj(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new PA(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(IA(e,n)),o.warnings.forEach(IA(e,n))),o}function Hj(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Vj(e,n);if(!i)return null;if(i.warnings.forEach(e=>pk(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var Uj={section:`ConfigSection-module__section___36A5y`,header:`ConfigSection-module__header___9y9kI`,titleRow:`ConfigSection-module__titleRow___MDqPS`,indexBadge:`ConfigSection-module__indexBadge___BNk-6`,iconBadge:`ConfigSection-module__iconBadge___608--`,headingGroup:`ConfigSection-module__headingGroup___iqK3P`,title:`ConfigSection-module__title___fNwM-`,description:`ConfigSection-module__description___uM2Zw`,content:`ConfigSection-module__content___RBAGw`},Wj=(0,y.forwardRef)(function({title:e,description:t,indexLabel:n,icon:r,className:i,children:a,...o},s){return(0,R.jsxs)(`section`,{ref:s,className:[Uj.section,i].filter(Boolean).join(` `),...o,children:[(0,R.jsxs)(`header`,{className:Uj.header,children:[(0,R.jsxs)(`div`,{className:Uj.titleRow,children:[n?(0,R.jsx)(`span`,{className:Uj.indexBadge,children:n}):null,r?(0,R.jsx)(`span`,{className:Uj.iconBadge,children:r}):null]}),(0,R.jsxs)(`div`,{className:Uj.headingGroup,children:[(0,R.jsx)(`h2`,{className:Uj.title,children:e}),t?(0,R.jsx)(`p`,{className:Uj.description,children:t}):null]})]}),(0,R.jsx)(`div`,{className:Uj.content,children:a})]})});function Gj(e){let[t,n]=(0,y.useState)(()=>window.matchMedia(e).matches);return(0,y.useEffect)(()=>{let t=window.matchMedia(e),r=e=>{n(e.matches)};return r({matches:t.matches}),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var K={visualEditor:`VisualConfigEditor-module__visualEditor___qt8bb`,expandableInputWrapper:`VisualConfigEditor-module__expandableInputWrapper___k5rpc`,expandableTextarea:`VisualConfigEditor-module__expandableTextarea___OVvmN`,expandableToggle:`VisualConfigEditor-module__expandableToggle___M5mBU`,expandableInputExpanded:`VisualConfigEditor-module__expandableInputExpanded___9zfyv`,overview:`VisualConfigEditor-module__overview___OzHQc`,overviewHeader:`VisualConfigEditor-module__overviewHeader___A8kWa`,overviewMeta:`VisualConfigEditor-module__overviewMeta___SM8ZF`,overviewPill:`VisualConfigEditor-module__overviewPill___eXq54`,overviewPillWarning:`VisualConfigEditor-module__overviewPillWarning___ruscj`,modeSwitch:`VisualConfigEditor-module__modeSwitch___RaXgu`,modeButton:`VisualConfigEditor-module__modeButton___4q91-`,modeButtonActive:`VisualConfigEditor-module__modeButtonActive___2l-EB`,storeAuthEditor:`VisualConfigEditor-module__storeAuthEditor___jw1fz`,storeAuthEmpty:`VisualConfigEditor-module__storeAuthEmpty___PXnX1`,storeAuthRule:`VisualConfigEditor-module__storeAuthRule___CcEWk`,storeAuthRuleHeader:`VisualConfigEditor-module__storeAuthRuleHeader___Y7bYd`,storeAuthGrid:`VisualConfigEditor-module__storeAuthGrid___zNz-e`,storeLine truncated
`)}function nk(e){if(Object.prototype.hasOwnProperty.call(e,`api-keys`))return tk(e[`api-keys`]);let t=$O($O($O(e.auth)?.providers)?.[`config-api-key`]);return t?Object.prototype.hasOwnProperty.call(t,`api-key-entries`)?tk(t[`api-key-entries`]):tk(t[`api-keys`]):``}function rk(e,t){return e.hasIn(t)}function ik(e,t){fT(e.getIn(t,!0))||e.setIn(t,e.createNode({}))}function ak(e,t){let n=e.getIn(t,!0);fT(n)&&n.items.length===0&&e.deleteIn(t)}function ok(e,t,n){if(n){e.setIn(t,!0);return}rk(e,t)&&e.setIn(t,!1)}function sk(e,t,n,r){return rk(e,t)||n.has(r)}function ck(e,t,n){let r=typeof n==`string`?n:``;if(r.trim()!==``){e.setIn(t,r);return}rk(e,t)&&e.setIn(t,``)}function lk(e,t,n){let r=n.map(e=>e.trim()).filter(Boolean);if(r.length>0){e.setIn(t,r);return}rk(e,t)&&e.deleteIn(t)}function uk(e,t,n){let r=(typeof n==`string`?n:``).trim();if(r===``){rk(e,t)&&e.deleteIn(t);return}if(!/^-?\d+$/.test(r))return;let i=Number(r);if(Number.isFinite(i)){e.setIn(t,i);return}}function dk(e,t,n){if(n===`chat`){e.setIn(t,`chat`);return}if(n===`true`){e.setIn(t,!0);return}rk(e,t)&&e.setIn(t,!1)}var fk=[`payloadDefaultRules`,`payloadDefaultRawRules`,`payloadOverrideRules`,`payloadOverrideRawRules`,`payloadFilterRules`];function pk(e){return fk.some(t=>e.has(t))}function mk(e){let t=e.trim();if(t)return/^-?\d+$/.test(t)&&Number(t)>=0?void 0:`non_negative_integer`}function hk(e){let t=e.trim();if(!t)return;if(!/^\d+$/.test(t))return`port_range`;let n=Number(t);return n>=1&&n<=65535?void 0:`port_range`}function gk(e){return{port:hk(e.port),errorLogsMaxFiles:mk(e.errorLogsMaxFiles),logsMaxTotalSizeMb:mk(e.logsMaxTotalSizeMb),redisUsageQueueRetentionSeconds:mk(e.redisUsageQueueRetentionSeconds),requestRetry:mk(e.requestRetry),maxRetryCredentials:mk(e.maxRetryCredentials),maxRetryInterval:mk(e.maxRetryInterval),authAutoRefreshWorkers:mk(e.authAutoRefreshWorkers),"streaming.keepaliveSeconds":mk(e.streaming.keepaliveSeconds),"streaming.bootstrapRetries":mk(e.streaming.bootstrapRetries),"streaming.nonstreamKeepaliveInterval":mk(e.streaming.nonstreamKeepaliveInterval)}}function _k(e){let t=e.value.trim();switch(e.valueType){case`number`:{if(!t)return`payload_invalid_number`;let e=Number(t);return Number.isFinite(e)?void 0:`payload_invalid_number`}case`boolean`:{let e=t.toLowerCase();return e===`true`||e===`false`?void 0:`payload_invalid_boolean`}case`json`:if(!t)return`payload_invalid_json`;try{JSON.parse(e.value);return}catch{return`payload_invalid_json`}default:return}}function vk(e){return e.some(e=>e.params.some(e=>!!_k(e))||e.models.some(e=>(e.match??[]).some(e=>!!_k(e))||(e.notMatch??[]).some(e=>!!_k(e))))}function yk(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function bk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.name!==i.name||r.protocol!==i.protocol||r.fromProtocol!==i.fromProtocol||!Sk(r.headers,i.headers)||!xk(r.match??[],i.match??[])||!xk(r.notMatch??[],i.notMatch??[])||!Ck(r.exist,i.exist)||!Ck(r.notExist,i.notExist))return!1}return!0}function xk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.path!==i.path||r.valueType!==i.valueType||r.value!==i.value)return!1}return!0}function Sk(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[e];if(!t||!i||t.id!==i.id||t.name!==i.name||t.value!==i.value)return!1}return!0}function Ck(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1)if(n[e]!==r[e])return!1;return!0}function wk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!bk(r.models,i.models)||!xk(r.params,i.params))return!1}return!0}function Tk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!bk(r.models,i.models)||r.params.length!==i.params.length)return!1;for(let e=0;e<r.params.length;e+=1)if(r.params[e]!==i.params[e])return!1}return!0}function Ek(e){if(typeof e==`number`)return{valueType:`number`,value:String(e)};if(typeof e==`boolean`)return{valueType:`boolean`,value:String(e)};if(e===null||typeof e==`object`)try{return{valueType:`json`,value:JSON.stringify(e,null,2)??`null`}}catch{return{valueType:`json`,value:String(e)}}return{valueType:`string`,value:String(e??``)}}function Dk(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e??``)}}function Ok(e){if(typeof e==`string`)return e.trim()?e:void 0}function kk(e){if(e===!0)return`true`;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`true`)return`true`;if(t===`chat`)return`chat`}return`false`}function Ak(e,t){let n=$O(e);return n?Object.entries(n).map(([e,n],r)=>({id:`${t}-header-${r}`,name:e,value:String(n??``)})):[]}function jk(e,t){if(!ALine truncated `)}function Zj(e){if(Object.prototype.hasOwnProperty.call(e,`api-keys`))return Xj(e[`api-keys`]);let t=Jj(Jj(Jj(e.auth)?.providers)?.[`config-api-key`]);return t?Object.prototype.hasOwnProperty.call(t,`api-key-entries`)?Xj(t[`api-key-entries`]):Xj(t[`api-keys`]):``}function Qj(e,t){return e.hasIn(t)}function $j(e,t){sO(e.getIn(t,!0))||e.setIn(t,e.createNode({}))}function eM(e,t){let n=e.getIn(t,!0);sO(n)&&n.items.length===0&&e.deleteIn(t)}function tM(e,t,n){if(n){e.setIn(t,!0);return}Qj(e,t)&&e.setIn(t,!1)}function nM(e,t,n,r){return Qj(e,t)||n.has(r)}function rM(e,t,n){let r=typeof n==`string`?n:``;if(r.trim()!==``){e.setIn(t,r);return}Qj(e,t)&&e.setIn(t,``)}function iM(e,t,n){let r=n.map(e=>e.trim()).filter(Boolean);if(r.length>0){e.setIn(t,r);return}Qj(e,t)&&e.deleteIn(t)}function aM(e,t,n){let r=(typeof n==`string`?n:``).trim();if(r===``){Qj(e,t)&&e.deleteIn(t);return}if(!/^-?\d+$/.test(r))return;let i=Number(r);if(Number.isFinite(i)){e.setIn(t,i);return}}function oM(e,t,n){if(n===`chat`){e.setIn(t,`chat`);return}if(n===`true`){e.setIn(t,!0);return}Qj(e,t)&&e.setIn(t,!1)}var sM=[`payloadDefaultRules`,`payloadDefaultRawRules`,`payloadOverrideRules`,`payloadOverrideRawRules`,`payloadFilterRules`];function cM(e){return sM.some(t=>e.has(t))}function lM(e){let t=e.trim();if(t)return/^-?\d+$/.test(t)&&Number(t)>=0?void 0:`non_negative_integer`}function uM(e){let t=e.trim();if(!t)return;if(!/^\d+$/.test(t))return`port_range`;let n=Number(t);return n>=1&&n<=65535?void 0:`port_range`}function dM(e){return{port:uM(e.port),errorLogsMaxFiles:lM(e.errorLogsMaxFiles),logsMaxTotalSizeMb:lM(e.logsMaxTotalSizeMb),redisUsageQueueRetentionSeconds:lM(e.redisUsageQueueRetentionSeconds),requestRetry:lM(e.requestRetry),maxRetryCredentials:lM(e.maxRetryCredentials),maxRetryInterval:lM(e.maxRetryInterval),authAutoRefreshWorkers:lM(e.authAutoRefreshWorkers),"streaming.keepaliveSeconds":lM(e.streaming.keepaliveSeconds),"streaming.bootstrapRetries":lM(e.streaming.bootstrapRetries),"streaming.nonstreamKeepaliveInterval":lM(e.streaming.nonstreamKeepaliveInterval)}}function fM(e){let t=e.value.trim();switch(e.valueType){case`number`:{if(!t)return`payload_invalid_number`;let e=Number(t);return Number.isFinite(e)?void 0:`payload_invalid_number`}case`boolean`:{let e=t.toLowerCase();return e===`true`||e===`false`?void 0:`payload_invalid_boolean`}case`json`:if(!t)return`payload_invalid_json`;try{JSON.parse(e.value);return}catch{return`payload_invalid_json`}default:return}}function pM(e){return e.some(e=>e.params.some(e=>!!fM(e))||e.models.some(e=>(e.match??[]).some(e=>!!fM(e))||(e.notMatch??[]).some(e=>!!fM(e))))}function mM(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function hM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.name!==i.name||r.protocol!==i.protocol||r.fromProtocol!==i.fromProtocol||!_M(r.headers,i.headers)||!gM(r.match??[],i.match??[])||!gM(r.notMatch??[],i.notMatch??[])||!vM(r.exist,i.exist)||!vM(r.notExist,i.notExist))return!1}return!0}function gM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.path!==i.path||r.valueType!==i.valueType||r.value!==i.value)return!1}return!0}function _M(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[e];if(!t||!i||t.id!==i.id||t.name!==i.name||t.value!==i.value)return!1}return!0}function vM(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1)if(n[e]!==r[e])return!1;return!0}function yM(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[e];if(!t||!i||t.match!==i.match||t.type!==i.type||t.tokenEnv!==i.tokenEnv||t.usernameEnv!==i.usernameEnv||t.passwordEnv!==i.passwordEnv||t.headerName!==i.headerName||t.headerValueEnv!==i.headerValueEnv||t.allowInsecure!==i.allowInsecure||!vM(t.applyTo,i.applyTo))return!1}return!0}function bM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!hM(r.models,i.models)||!gM(r.params,i.params))return!1}return!0}function xM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!hM(r.models,i.models)||r.params.length!==i.params.length)return!1;for(let e=0;e<r.params.length;e+=1)if(r.params[e]!==i.params[e])return!1}return!0}function SM(e){if(typeof e==`number`)return{valueType:`number`,value:String(e)};if(typeof e==`boolean`)return{valueType:`boolean`,value:String(e)};if(e===null||typeof e==`object`)try{return{valueType:`json`,value:JSON.stringify(e,null,2)??`null`}}catch{return{valueType:`json`,value:String(e)}}return{valueType:`string`,value:String(e??``)}}function CM(e){if(typeof e==`string`)return e;try{return JSON.stringify(Line truncated
`).map(e=>e.trim()).filter(Boolean);if(a.length>0?t.setIn([`api-keys`],a):rk(t,[`api-keys`])&&t.deleteIn([`api-keys`]),Nk(t),(rk(t,[`plugins`])||r.pluginsEnabled||r.pluginStoreSources.length>0||sk(t,[`plugins`,`enabled`],i,`pluginsEnabled`)||sk(t,[`plugins`,`store-sources`],i,`pluginStoreSources`))&&(ik(t,[`plugins`]),ok(t,[`plugins`,`enabled`],r.pluginsEnabled),(r.pluginStoreSources.length>0||sk(t,[`plugins`,`store-sources`],i,`pluginStoreSources`))&&lk(t,[`plugins`,`store-sources`],r.pluginStoreSources),ak(t,[`plugins`])),ok(t,[`debug`],r.debug),ok(t,[`commercial-mode`],r.commercialMode),ok(t,[`logging-to-file`],r.loggingToFile),uk(t,[`logs-max-total-size-mb`],r.logsMaxTotalSizeMb),uk(t,[`error-logs-max-files`],r.errorLogsMaxFiles),ok(t,[`usage-statistics-enabled`],r.usageStatisticsEnabled),uk(t,[`redis-usage-queue-retention-seconds`],r.redisUsageQueueRetentionSeconds),ck(t,[`proxy-url`],r.proxyUrl),ok(t,[`force-model-prefix`],r.forceModelPrefix),ok(t,[`passthrough-headers`],r.passthroughHeaders),uk(t,[`request-retry`],r.requestRetry),uk(t,[`max-retry-credentials`],r.maxRetryCredentials),uk(t,[`max-retry-interval`],r.maxRetryInterval),ok(t,[`disable-cooling`],r.disableCooling),dk(t,[`disable-image-generation`],r.disableImageGeneration),(r.gptImage2BaseModel.trim()||sk(t,[`gpt-image-2-base-model`],i,`gptImage2BaseModel`))&&ck(t,[`gpt-image-2-base-model`],r.gptImage2BaseModel),uk(t,[`auth-auto-refresh-workers`],r.authAutoRefreshWorkers),ok(t,[`ws-auth`],r.wsAuth),(rk(t,[`antigravity-signature-cache-enabled`])||!r.antigravitySignatureCacheEnabled)&&t.setIn([`antigravity-signature-cache-enabled`],r.antigravitySignatureCacheEnabled),ok(t,[`antigravity-signature-bypass-strict`],r.antigravitySignatureBypassStrict),(rk(t,[`claude-header-defaults`])||r.claudeHeaderUserAgent.trim()||r.claudeHeaderPackageVersion.trim()||r.claudeHeaderRuntimeVersion.trim()||r.claudeHeaderOs.trim()||r.claudeHeaderArch.trim()||r.claudeHeaderTimeout.trim()||r.claudeHeaderStabilizeDeviceProfile)&&(ik(t,[`claude-header-defaults`]),ck(t,[`claude-header-defaults`,`user-agent`],r.claudeHeaderUserAgent),ck(t,[`claude-header-defaults`,`package-version`],r.claudeHeaderPackageVersion),ck(t,[`claude-header-defaults`,`runtime-version`],r.claudeHeaderRuntimeVersion),ck(t,[`claude-header-defaults`,`os`],r.claudeHeaderOs),ck(t,[`claude-header-defaults`,`arch`],r.claudeHeaderArch),ck(t,[`claude-header-defaults`,`timeout`],r.claudeHeaderTimeout),ok(t,[`claude-header-defaults`,`stabilize-device-profile`],r.claudeHeaderStabilizeDeviceProfile),ak(t,[`claude-header-defaults`])),(rk(t,[`codex-header-defaults`])||r.codexHeaderUserAgent.trim()||r.codexHeaderBetaFeatures.trim())&&(ik(t,[`codex-header-defaults`]),ck(t,[`codex-header-defaults`,`user-agent`],r.codexHeaderUserAgent),ck(t,[`codex-header-defaults`,`beta-features`],r.codexHeaderBetaFeatures),ak(t,[`codex-header-defaults`])),(rk(t,[`codex`])||r.codexIdentityConfuse||sk(t,[`codex`,`identity-confuse`],i,`codexIdentityConfuse`))&&(ik(t,[`codex`]),ok(t,[`codex`,`identity-confuse`],r.codexIdentityConfuse),ak(t,[`codex`])),rk(t,[`quota-exceeded`])||!r.quotaSwitchProject||!r.quotaSwitchPreviewModel||sk(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`)){ik(t,[`quota-exceeded`]);let e=sk(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`);t.setIn([`quota-exceeded`,`switch-project`],r.quotaSwitchProject),t.setIn([`quota-exceeded`,`switch-preview-model`],r.quotaSwitchPreviewModel),e&&t.setIn([`quota-exceeded`,`antigravity-credits`],r.quotaAntigravityCredits),ak(t,[`quota-exceeded`])}(rk(t,[`routing`])||r.routingStrategy!==`round-robin`||r.routingSessionAffinity||r.routingSessionAffinityTTL.trim())&&(ik(t,[`routing`]),t.setIn([`routing`,`strategy`],r.routingStrategy),ok(t,[`routing`,`session-affinity`],r.routingSessionAffinity),ck(t,[`routing`,`session-affinity-ttl`],r.routingSessionAffinityTTL),ak(t,[`routing`]));let o=typeof r.streaming?.keepaliveSeconds==`string`?r.streaming.keepaliveSeconds:``,s=typeof r.streaming?.bootstrapRetries==`string`?r.streaming.bootstrapRetries:``,c=typeof r.streaming?.nonstreamKeepaliveInterval==`string`?r.streaming.nonstreamKeepaliveInterval:``;return(rk(t,[`streaming`])||o.trim()||s.trim())&&(ik(t,[`streaming`]),uk(t,[`streaming`,`keepalive-seconds`],o),uk(t,[`streaming`,`bootstrap-retries`],s),ak(t,[`streaming`])),uk(t,[`nonstream-keepalive-interval`],c),pk(i)&&(ik(t,[`payload`]),r.payloadDefaultRules.length>0?t.setIn([`payload`,`default`],Uk(r.payloadDefaultRules)):rk(t,[`payload`,`default`])&&t.deleteIn([`payload`,`default`]),r.payloadDefaultRawRules.length>0?t.setIn([`payload`,`default-raw`],Gk(r.payloadDefaultRawRules)):rk(t,[`payload`,`default-raw`])&&t.deleteIn([`payload`,`default-raw`]),r.payloadOverrideRules.length>0?t.setIn([`payload`,`override`],Uk(r.payloadOverrideRules)):rk(t,[`payload`,`override`])&&t.deleteIn([`payload`,`override`]),r.payloadOverrideRawRules.length>0?t.setIn([`payload`,`override-raw`],Gk(r.payloadOverrideRaLine truncated `).map(e=>e.trim()).filter(Boolean);if(o.length>0?t.setIn([`api-keys`],o):Qj(t,[`api-keys`])&&t.deleteIn([`api-keys`]),PM(t),Qj(t,[`plugins`])||r.pluginsEnabled||r.pluginStoreSources.length>0||a||nM(t,[`plugins`,`enabled`],i,`pluginsEnabled`)||nM(t,[`plugins`,`store-sources`],i,`pluginStoreSources`)||nM(t,[`plugins`,`store-auth`],i,`pluginStoreAuth`)){if($j(t,[`plugins`]),tM(t,[`plugins`,`enabled`],r.pluginsEnabled),(r.pluginStoreSources.length>0||nM(t,[`plugins`,`store-sources`],i,`pluginStoreSources`))&&iM(t,[`plugins`,`store-sources`],r.pluginStoreSources),a){let e=UM(r.pluginStoreAuth);e.length>0?t.setIn([`plugins`,`store-auth`],e):Qj(t,[`plugins`,`store-auth`])&&t.deleteIn([`plugins`,`store-auth`])}eM(t,[`plugins`])}if(tM(t,[`debug`],r.debug),tM(t,[`commercial-mode`],r.commercialMode),tM(t,[`logging-to-file`],r.loggingToFile),aM(t,[`logs-max-total-size-mb`],r.logsMaxTotalSizeMb),aM(t,[`error-logs-max-files`],r.errorLogsMaxFiles),tM(t,[`usage-statistics-enabled`],r.usageStatisticsEnabled),aM(t,[`redis-usage-queue-retention-seconds`],r.redisUsageQueueRetentionSeconds),rM(t,[`proxy-url`],r.proxyUrl),tM(t,[`force-model-prefix`],r.forceModelPrefix),tM(t,[`passthrough-headers`],r.passthroughHeaders),aM(t,[`request-retry`],r.requestRetry),aM(t,[`max-retry-credentials`],r.maxRetryCredentials),aM(t,[`max-retry-interval`],r.maxRetryInterval),tM(t,[`disable-cooling`],r.disableCooling),oM(t,[`disable-image-generation`],r.disableImageGeneration),(r.gptImage2BaseModel.trim()||nM(t,[`gpt-image-2-base-model`],i,`gptImage2BaseModel`))&&rM(t,[`gpt-image-2-base-model`],r.gptImage2BaseModel),aM(t,[`auth-auto-refresh-workers`],r.authAutoRefreshWorkers),tM(t,[`ws-auth`],r.wsAuth),(Qj(t,[`antigravity-signature-cache-enabled`])||!r.antigravitySignatureCacheEnabled)&&t.setIn([`antigravity-signature-cache-enabled`],r.antigravitySignatureCacheEnabled),tM(t,[`antigravity-signature-bypass-strict`],r.antigravitySignatureBypassStrict),(Qj(t,[`claude-header-defaults`])||r.claudeHeaderUserAgent.trim()||r.claudeHeaderPackageVersion.trim()||r.claudeHeaderRuntimeVersion.trim()||r.claudeHeaderOs.trim()||r.claudeHeaderArch.trim()||r.claudeHeaderTimeout.trim()||r.claudeHeaderStabilizeDeviceProfile)&&($j(t,[`claude-header-defaults`]),rM(t,[`claude-header-defaults`,`user-agent`],r.claudeHeaderUserAgent),rM(t,[`claude-header-defaults`,`package-version`],r.claudeHeaderPackageVersion),rM(t,[`claude-header-defaults`,`runtime-version`],r.claudeHeaderRuntimeVersion),rM(t,[`claude-header-defaults`,`os`],r.claudeHeaderOs),rM(t,[`claude-header-defaults`,`arch`],r.claudeHeaderArch),rM(t,[`claude-header-defaults`,`timeout`],r.claudeHeaderTimeout),tM(t,[`claude-header-defaults`,`stabilize-device-profile`],r.claudeHeaderStabilizeDeviceProfile),eM(t,[`claude-header-defaults`])),(Qj(t,[`codex-header-defaults`])||r.codexHeaderUserAgent.trim()||r.codexHeaderBetaFeatures.trim())&&($j(t,[`codex-header-defaults`]),rM(t,[`codex-header-defaults`,`user-agent`],r.codexHeaderUserAgent),rM(t,[`codex-header-defaults`,`beta-features`],r.codexHeaderBetaFeatures),eM(t,[`codex-header-defaults`])),(Qj(t,[`codex`])||r.codexIdentityConfuse||nM(t,[`codex`,`identity-confuse`],i,`codexIdentityConfuse`))&&($j(t,[`codex`]),tM(t,[`codex`,`identity-confuse`],r.codexIdentityConfuse),eM(t,[`codex`])),Qj(t,[`quota-exceeded`])||!r.quotaSwitchProject||!r.quotaSwitchPreviewModel||nM(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`)){$j(t,[`quota-exceeded`]);let e=nM(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`);t.setIn([`quota-exceeded`,`switch-project`],r.quotaSwitchProject),t.setIn([`quota-exceeded`,`switch-preview-model`],r.quotaSwitchPreviewModel),e&&t.setIn([`quota-exceeded`,`antigravity-credits`],r.quotaAntigravityCredits),eM(t,[`quota-exceeded`])}(Qj(t,[`routing`])||r.routingStrategy!==`round-robin`||r.routingSessionAffinity||r.routingSessionAffinityTTL.trim())&&($j(t,[`routing`]),t.setIn([`routing`,`strategy`],r.routingStrategy),tM(t,[`routing`,`session-affinity`],r.routingSessionAffinity),rM(t,[`routing`,`session-affinity-ttl`],r.routingSessionAffinityTTL),eM(t,[`routing`]));let s=typeof r.streaming?.keepaliveSeconds==`string`?r.streaming.keepaliveSeconds:``,c=typeof r.streaming?.bootstrapRetries==`string`?r.streaming.bootstrapRetries:``,l=typeof r.streaming?.nonstreamKeepaliveInterval==`string`?r.streaming.nonstreamKeepaliveInterval:``;return(Qj(t,[`streaming`])||s.trim()||c.trim())&&($j(t,[`streaming`]),aM(t,[`streaming`,`keepalive-seconds`],s),aM(t,[`streaming`,`bootstrap-retries`],c),eM(t,[`streaming`])),aM(t,[`nonstream-keepalive-interval`],l),cM(i)&&($j(t,[`payload`]),r.payloadDefaultRules.length>0?t.setIn([`payload`,`default`],GM(r.payloadDefaultRules)):Qj(t,[`payload`,`default`])&&t.deleteIn([`payload`,`default`]),r.payloadDefaultRawRules.length>0?t.setIn([`payload`,`default-raw`],qM(r.payloadDefaultRawRules)):Qj(t,[`payload`,`default-raw`])&&t.deleteIn([`payload`,`default-raw`]),r.payloadOverrideRules.length>0?t.setIn([`paLine truncated
`).map(e=>e.trim()).filter(Boolean),[e]),[o,s]=(0,y.useState)(()=>a.map(()=>ZO())),c=(0,y.useMemo)(()=>o.length===a.length?o:o.length>a.length?o.slice(0,a.length):[...o,...Array.from({length:a.length-o.length},()=>ZO())],[o,a.length]),l=(0,y.useId)(),u=`${l}-hint`,d=`${l}-error`,[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(``),[v,b]=(0,y.useState)(``);function x(){let e=new Uint8Array(17);return crypto.getRandomValues(e),`sk-`+Array.from(e,e=>`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[e%62]).join(``)}let S=()=>{h(null),_(``),b(``),p(!0)},C=e=>{let t=c.findIndex(t=>t===e);h(e),_(a[t]??``),b(``),p(!0)},w=()=>{p(!1),_(``),h(null),b(``)},T=e=>{n(e.join(` `).map(e=>e.trim()).filter(Boolean),[e]),[o,s]=(0,y.useState)(()=>a.map(()=>Kj())),c=(0,y.useMemo)(()=>o.length===a.length?o:o.length>a.length?o.slice(0,a.length):[...o,...Array.from({length:a.length-o.length},()=>Kj())],[o,a.length]),l=(0,y.useId)(),u=`${l}-hint`,d=`${l}-error`,[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(``),[v,b]=(0,y.useState)(``);function x(){let e=new Uint8Array(17);return crypto.getRandomValues(e),`sk-`+Array.from(e,e=>`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[e%62]).join(``)}let S=()=>{h(null),_(``),b(``),p(!0)},C=e=>{let t=c.findIndex(t=>t===e);h(e),_(a[t]??``),b(``),p(!0)},w=()=>{p(!1),_(``),h(null),b(``)},T=e=>{n(e.join(`
`))},E=e=>{let t=c.findIndex(t=>t===e);t<0||(s(c.filter(t=>t!==e)),T(a.filter((e,n)=>n!==t)))},D=()=>{let e=g.trim();if(!e){b(r(`config_management.visual.api_keys.error_empty`));return}if(!$k(e)){b(r(`config_management.visual.api_keys.error_invalid`));return}let t=m?c.findIndex(e=>e===m):-1,n=m===null?[...a,e]:a.map((n,r)=>r===t?e:n);m===null&&s([...c,ZO()]),T(n),w()},O=async e=>{let t=await Zb(e);i(r(t?`notification.link_copied`:`notification.copy_failed`),t?`success`:`error`)};return(0,I.jsxs)(`div`,{className:`form-group`,style:{marginBottom:0},children:[(0,I.jsxs)(`div`,{className:G.blockHeaderRow,children:[(0,I.jsx)(`label`,{style:{margin:0},children:r(`config_management.visual.api_keys.label`)}),(0,I.jsx)(L,{size:`sm`,onClick:S,disabled:t,children:r(`config_management.visual.api_keys.add`)})]}),a.length===0?(0,I.jsx)(`div`,{className:G.emptyState,children:r(`config_management.visual.api_keys.empty`)}):(0,I.jsx)(`div`,{className:`item-list`,style:{marginTop:4},children:a.map((e,n)=>(0,I.jsxs)(`div`,{className:`item-row`,children:[(0,I.jsxs)(`div`,{className:`item-meta`,children:[(0,I.jsxs)(`div`,{className:`pill`,children:[`#`,n+1]}),(0,I.jsx)(`div`,{className:`item-title`,children:r(`config_management.visual.api_keys.input_label`)}),(0,I.jsx)(`div`,{className:`item-subtitle`,children:q_(String(e||``))})]}),(0,I.jsxs)(`div`,{className:`item-actions`,children:[(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:()=>O(e),disabled:t,children:r(`common.copy`)}),(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:()=>C(c[n]??``),disabled:t,children:r(`config_management.visual.common.edit`)}),(0,I.jsx)(L,{variant:`danger`,size:`sm`,onClick:()=>E(c[n]??``),disabled:t,children:r(`config_management.visual.common.delete`)})]})]},c[n]??`${e}-${n}`))}),(0,I.jsx)(`div`,{className:`hint`,children:r(`config_management.visual.api_keys.hint`)}),(0,I.jsx)(Ap,{open:f,onClose:w,title:r(m===null?`config_management.visual.api_keys.add_title`:`config_management.visual.api_keys.edit_title`),footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{variant:`secondary`,onClick:w,disabled:t,children:r(`config_management.visual.common.cancel`)}),(0,I.jsx)(L,{onClick:D,disabled:t,children:r(m===null?`config_management.visual.common.add`:`config_management.visual.common.update`)})]}),children:(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{htmlFor:l,children:r(`config_management.visual.api_keys.input_label`)}),(0,I.jsxs)(`div`,{className:G.apiKeyModalInputRow,children:[(0,I.jsx)(`input`,{id:l,className:`input`,placeholder:r(`config_management.visual.api_keys.input_placeholder`),value:g,onChange:e=>_(e.target.value),disabled:t,"aria-describedby":v?`${d} ${u}`:u,"aria-invalid":!!v}),(0,I.jsx)(L,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>{_(x()),b(``)},disabled:t,children:r(`config_management.visual.api_keys.generate`)})]}),(0,I.jsx)(`div`,{id:u,className:`hint`,children:r(`config_management.visual.api_keys.input_hint`)}),v&&(0,I.jsx)(`div`,{id:d,className:`error-box`,children:v})]})})]})}),aA=(0,y.memo)(function({value:e,disabled:t,placeholder:n,inputAriaLabel:r,onChange:i}){let{t:a}=Xo(),o=e.length?e:[],[s,c]=(0,y.useState)(()=>o.map(()=>ZO())),l=(0,y.useMemo)(()=>s.length===o.length?s:s.length>o.length?s.slice(0,o.length):[...s,...Array.from({length:o.length-s.length},()=>ZO())],[s,o.length]),u=(e,t)=>i(o.map((n,r)=>r===e?t:n)),d=()=>{c([...l,ZO()]),i([...o,``])},f=e=>{c(l.filter((t,n)=>n!==e)),i(o.filter((t,n)=>n!==e))};return(0,I.jsxs)(`div`,{className:G.stringList,children:[o.map((e,i)=>(0,I.jsxs)(`div`,{className:G.stringListRow,children:[(0,I.jsx)(tA,{placeholder:n,ariaLabel:r??n,value:e,onChange:e=>u(i,e),disabled:t}),(0,I.jsx)(L,{variant:`ghost`,size:`sm`,onClick:()=>f(i),disabled:t,children:a(`config_management.visual.common.delete`)})]},l[i]??`item-${i}`)),(0,I.jsx)(`div`,{className:G.actionRow,children:(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:d,disabled:t,children:a(`config_management.visual.common.add`)})})]})});function oA(e){return!!(e.fromProtocol||(e.headers?.length??0)>0||(e.match?.length??0)>0||(e.notMatch?.length??0)>0||(e.exist?.length??0)>0||(e.notExist?.length??0)>0)}var sA=(0,y.memo)(function({value:e,disabled:t,protocolFirst:n=!1,rawJsonValues:r=!1,onChange:i}){let{t:a}=Xo(),o=e,s=(0,y.useMemo)(()=>rA(a,o),[o,a]),c=(0,y.useMemo)(()=>[{value:``,label:a(`config_management.visual.payload_rules.provider_default`)},{value:`openai`,label:a(`config_management.visual.payload_rules.provider_openai`)},{value:`responses`,label:a(`config_management.visual.payload_rules.provider_responses`)},{value:`gemini`,label:a(`config_management.visual.payload_rules.provider_gemini`)},{value:`claude`,label:a(`config_management.visual.payload_rules.provider_claude`)}],[a]),l=(0,y.useMemo)(()=>Qk.map(e=>({value:e.value,label:a(e.labelKey,{defaultValue:e.defaultLabel})})),[a]),u=(0,y.useMemo)(()=>[{value:`true`,label:a(`config_management.visual.payload_rules.boolean_true`)},{value:`false`,label:a(Line truncated `))},E=e=>{let t=c.findIndex(t=>t===e);t<0||(s(c.filter(t=>t!==e)),T(a.filter((e,n)=>n!==t)))},D=()=>{let e=g.trim();if(!e){b(r(`config_management.visual.api_keys.error_empty`));return}if(!tN(e)){b(r(`config_management.visual.api_keys.error_invalid`));return}let t=m?c.findIndex(e=>e===m):-1,n=m===null?[...a,e]:a.map((n,r)=>r===t?e:n);m===null&&s([...c,Kj()]),T(n),w()},O=async e=>{let t=await EC(e);i(r(t?`notification.link_copied`:`notification.copy_failed`),t?`success`:`error`)};return(0,R.jsxs)(`div`,{className:`form-group`,style:{marginBottom:0},children:[(0,R.jsxs)(`div`,{className:K.blockHeaderRow,children:[(0,R.jsx)(`label`,{style:{margin:0},children:r(`config_management.visual.api_keys.label`)}),(0,R.jsx)(z,{size:`sm`,onClick:S,disabled:t,children:r(`config_management.visual.api_keys.add`)})]}),a.length===0?(0,R.jsx)(`div`,{className:K.emptyState,children:r(`config_management.visual.api_keys.empty`)}):(0,R.jsx)(`div`,{className:`item-list`,style:{marginTop:4},children:a.map((e,n)=>(0,R.jsxs)(`div`,{className:`item-row`,children:[(0,R.jsxs)(`div`,{className:`item-meta`,children:[(0,R.jsxs)(`div`,{className:`pill`,children:[`#`,n+1]}),(0,R.jsx)(`div`,{className:`item-title`,children:r(`config_management.visual.api_keys.input_label`)}),(0,R.jsx)(`div`,{className:`item-subtitle`,children:Uv(String(e||``))})]}),(0,R.jsxs)(`div`,{className:`item-actions`,children:[(0,R.jsx)(z,{variant:`secondary`,size:`sm`,onClick:()=>O(e),disabled:t,children:r(`common.copy`)}),(0,R.jsx)(z,{variant:`secondary`,size:`sm`,onClick:()=>C(c[n]??``),disabled:t,children:r(`config_management.visual.common.edit`)}),(0,R.jsx)(z,{variant:`danger`,size:`sm`,onClick:()=>E(c[n]??``),disabled:t,children:r(`config_management.visual.common.delete`)})]})]},c[n]??`${e}-${n}`))}),(0,R.jsx)(`div`,{className:`hint`,children:r(`config_management.visual.api_keys.hint`)}),(0,R.jsx)(jp,{open:f,onClose:w,title:r(m===null?`config_management.visual.api_keys.add_title`:`config_management.visual.api_keys.edit_title`),footer:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{variant:`secondary`,onClick:w,disabled:t,children:r(`config_management.visual.common.cancel`)}),(0,R.jsx)(z,{onClick:D,disabled:t,children:r(m===null?`config_management.visual.common.add`:`config_management.visual.common.update`)})]}),children:(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{htmlFor:l,children:r(`config_management.visual.api_keys.input_label`)}),(0,R.jsxs)(`div`,{className:K.apiKeyModalInputRow,children:[(0,R.jsx)(`input`,{id:l,className:`input`,placeholder:r(`config_management.visual.api_keys.input_placeholder`),value:g,onChange:e=>_(e.target.value),disabled:t,"aria-describedby":v?`${d} ${u}`:u,"aria-invalid":!!v}),(0,R.jsx)(z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>{_(x()),b(``)},disabled:t,children:r(`config_management.visual.api_keys.generate`)})]}),(0,R.jsx)(`div`,{id:u,className:`hint`,children:r(`config_management.visual.api_keys.input_hint`)}),v&&(0,R.jsx)(`div`,{id:d,className:`error-box`,children:v})]})})]})}),sN=(0,y.memo)(function({value:e,disabled:t,placeholder:n,inputAriaLabel:r,onChange:i}){let{t:a}=Jo(),o=e.length?e:[],[s,c]=(0,y.useState)(()=>o.map(()=>Kj())),l=(0,y.useMemo)(()=>s.length===o.length?s:s.length>o.length?s.slice(0,o.length):[...s,...Array.from({length:o.length-s.length},()=>Kj())],[s,o.length]),u=(e,t)=>i(o.map((n,r)=>r===e?t:n)),d=()=>{c([...l,Kj()]),i([...o,``])},f=e=>{c(l.filter((t,n)=>n!==e)),i(o.filter((t,n)=>n!==e))};return(0,R.jsxs)(`div`,{className:K.stringList,children:[o.map((e,i)=>(0,R.jsxs)(`div`,{className:K.stringListRow,children:[(0,R.jsx)(rN,{placeholder:n,ariaLabel:r??n,value:e,onChange:e=>u(i,e),disabled:t}),(0,R.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>f(i),disabled:t,children:a(`config_management.visual.common.delete`)})]},l[i]??`item-${i}`)),(0,R.jsx)(`div`,{className:K.actionRow,children:(0,R.jsx)(z,{variant:`secondary`,size:`sm`,onClick:d,disabled:t,children:a(`config_management.visual.common.add`)})})]})}),cN=[{value:`bearer`,labelKey:`config_management.visual.sections.system.store_auth_type_bearer`},{value:`github-token`,labelKey:`config_management.visual.sections.system.store_auth_type_github_token`},{value:`basic`,labelKey:`config_management.visual.sections.system.store_auth_type_basic`},{value:`header`,labelKey:`config_management.visual.sections.system.store_auth_type_header`},{value:`none`,labelKey:`config_management.visual.sections.system.store_auth_type_none`}],lN=[{value:`registry`,labelKey:`config_management.visual.sections.system.store_auth_apply_registry`},{value:`metadata`,labelKey:`config_management.visual.sections.system.store_auth_apply_metadata`},{value:`artifact`,labelKey:`config_management.visual.sections.system.store_auth_apply_artifact`}],uN=()=>({id:Kj(),match:``,applyTo:[],type:`bearer`,tokenEnv:``,usernameEnv:``,passwordEnv:``,headerName:``,headerValueEnv:``,allowInsecure:!1}),dN=(0,y.memo)(function({value:e,disabled:t,onChange:n}){let{t:r}=Jo(),i=(t,r)Line truncated
`){[e,t]=zA(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},kj=class e extends Dj{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=zA(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=` `){[e,t]=GN(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},FP=class e extends NP{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=GN(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
`){[e,t]=zA(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new Oj(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof Oj&&c&&(n=u[u.length-1])instanceof Oj&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new Oj(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},Dj.empty=new Oj([``],0),Aj=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof Oj?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof Oj?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `){[e,t]=GN(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new PP(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof PP&&c&&(n=u[u.length-1])instanceof PP&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new PP(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},NP.empty=new PP([``],0),IP=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof PP?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof PP?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Oj){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof Oj?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},jj=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Aj(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},Mj=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(Dj.prototype[Symbol.iterator]=function(){return this.iter()},Aj.prototype[Symbol.iterator]=jj.prototype[Symbol.iterator]=Mj.prototype[Symbol.iterator]=function(){return this}),Nj=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},Pj=/\r\n?|\n/,Fj=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Fj||(Fj={})),Ij=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){JA(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:XA(this,e)}mapDesc(e,t=!1){return e.empty?this:YA(this,e,t)}mapPos(e,t=-1,n=Fj.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=Fj.Simple&&c>=e&&(n==Fj.TrackDel&&r<e&&c>e||n==Fj.TrackBefore&&r<e||n==Fj.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},Lj=class e extends Ij{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return JA(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return YA(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(Dj.empty);r.push(a?t.slice(i,i+a):Dj.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:XA(this,e,!0)}map(e,t=!1){return e.empty?this:YA(this,e,t,!0)}iterChanges(e,t=!1){JA(this,e,t)}get desc(){return Ij.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Rj(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);KA(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;KA(n,e,t),t>0&&qA(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);KA(n,e,-1),KA(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Ij.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+Line truncated `,this;e--}else if(r instanceof PP){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof PP?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},LP=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new IP(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},RP=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(NP.prototype[Symbol.iterator]=function(){return this.iter()},IP.prototype[Symbol.iterator]=LP.prototype[Symbol.iterator]=RP.prototype[Symbol.iterator]=function(){return this}),zP=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},BP=/\r\n?|\n/,VP=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(VP||(VP={})),HP=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){eP(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:nP(this,e)}mapDesc(e,t=!1){return e.empty?this:tP(this,e,t)}mapPos(e,t=-1,n=VP.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=VP.Simple&&c>=e&&(n==VP.TrackDel&&r<e&&c>e||n==VP.TrackBefore&&r<e||n==VP.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},UP=class e extends HP{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return eP(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return tP(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(NP.empty);r.push(a?t.slice(i,i+a):NP.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:nP(this,e,!0)}map(e,t=!1){return e.empty?this:tP(this,e,t,!0)}iterChanges(e,t=!1){eP(this,e,t)}get desc(){return HP.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new WP(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);QN(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;QN(n,e,t),t>0&&$N(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);QN(n,e,-1),QN(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:HP.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+Line truncated
`}get readOnly(){return this.facet(nM)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Xj))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return mj(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=BA(t,a,!1);if(i(t.slice(e,a))!=lM.Word)break;a=e}for(;o<r;){let e=BA(t,o);if(i(t.slice(o,e))!=lM.Word)break;o=e}return a==o?null:q.range(a+n,o+n)}},fM.allowMultipleSelections=Zj,fM.tabSize=J.define({combine:e=>e.length?e[0]:4}),fM.lineSeparator=Qj,fM.readOnly=nM,fM.phrases=J.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),fM.languageData=Xj,fM.changeFilter=$j,fM.transactionFilter=eM,fM.transactionExtender=tM,qj.reconfigure=oM.define(),pM=class{eq(e){return this==e}range(e,t=e){return mM.create(e,t,this)}},pM.prototype.startSide=pM.prototype.endSide=0,pM.prototype.point=!1,pM.prototype.mapMode=Fj.TrackDel,mM=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},hM=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},gM=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(gj)),this.isEmpty)return n.length?e.of(n):this;let s=new vM(this,null,-1).goto(0),c=0,l=[],u=new _M;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(mM.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return yM.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return yM.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=vj(a,o,n),c=new bM(a,s,i),l=new bM(o,s,i);n.iterGaps((e,t,n)=>bj(c,e,l,t,n,r)),n.empty&&n.length==0&&bj(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??(r=999999999);let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=vj(i,a),s=new bM(i,o,0).goto(n),c=new bM(a,o,0).goto(n);for(;;){if(s.to!=c.to||!xj(s.active,cLine truncated `}get readOnly(){return this.facet(lF)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(rF))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return bP(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=KN(t,a,!1);if(i(t.slice(e,a))!=gF.Word)break;a=e}for(;o<r;){let e=KN(t,o);if(i(t.slice(o,e))!=gF.Word)break;o=e}return a==o?null:J.range(a+n,o+n)}},yF.allowMultipleSelections=iF,yF.tabSize=qP.define({combine:e=>e.length?e[0]:4}),yF.lineSeparator=aF,yF.readOnly=lF,yF.phrases=qP.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),yF.languageData=rF,yF.changeFilter=oF,yF.transactionFilter=sF,yF.transactionExtender=cF,eF.reconfigure=pF.define(),bF=class{eq(e){return this==e}range(e,t=e){return xF.create(e,t,this)}},bF.prototype.startSide=bF.prototype.endSide=0,bF.prototype.point=!1,bF.prototype.mapMode=VP.TrackDel,xF=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},SF=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},CF=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(SP)),this.isEmpty)return n.length?e.of(n):this;let s=new TF(this,null,-1).goto(0),c=0,l=[],u=new wF;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(xF.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return EF.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return EF.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=wP(a,o,n),c=new DF(a,s,i),l=new DF(o,s,i);n.iterGaps((e,t,n)=>EP(c,e,l,t,n,r)),n.empty&&n.length==0&&EP(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??(r=999999999);let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=wP(i,a),s=new DF(i,o,0).goto(n),c=new DF(a,o,0).goto(n);for(;;){if(s.to!=c.to||!DP(s.activeLine truncated
`)}static newName(){let e=TM[CM]||1;return TM[CM]=e+1,SM+e.toString(36)}static mount(e,t,n){let r=e[wM],i=n&&n.nonce;r?i&&r.setNonce(i):r=new OM(e,i),r.mount(Array.isArray(t)?t:[t],e)}},DM=new Map,OM=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=DM.get(n);if(t)return e[wM]=t;this.sheet=new r.CSSStyleSheet,DM.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[wM]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+` `)}static newName(){let e=MF[AF]||1;return MF[AF]=e+1,kF+e.toString(36)}static mount(e,t,n){let r=e[jF],i=n&&n.nonce;r?i&&r.setNonce(i):r=new FF(e,i),r.mount(Array.isArray(t)?t:[t],e)}},PF=new Map,FF=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=PF.get(n);if(t)return e[jF]=t;this.sheet=new r.CSSStyleSheet,PF.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[jF]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function AM(e){var t=!(NM&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||PM&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?MM:jM)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var jM,MM,NM,PM,FM,IM=o((()=>{for(jM={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},MM={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},NM=typeof navigator<`u`&&/Mac/.test(navigator.platform),PM=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),FM=0;FM<10;FM++)jM[48+FM]=jM[96+FM]=String(FM);for(FM=1;FM<=24;FM++)jM[FM+111]=`F`+FM;for(FM=65;FM<=90;FM++)jM[FM]=String.fromCharCode(FM+32),MM[FM]=String.fromCharCode(FM);for(var e in jM)MM.hasOwnProperty(e)||(MM[e]=jM[e])}));function LM(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)RM(e,arguments[t]);return e}function RM(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)RM(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var zM=o((()=>{}));function BM(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function VM(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function HM(e,t){if(!t.anchorNode)return!1;try{return VM(e,t.anchorNode)}catch{return!1}}function UM(e){return e.nodeType==3?tN(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function WM(e,t,n,r){return n?qM(e,t,n,r,-1)||qM(e,t,n,r,1):!1}function GM(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function KM(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function qM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:JM(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=GM(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?JM(e):0}else return!1}}function JM(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function YM(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function XM(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function ZM(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function QM(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=XM(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=ZM(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0Line truncated `;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function LF(e){var t=!(BF&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||VF&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?zF:RF)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var RF,zF,BF,VF,HF,UF=o((()=>{for(RF={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},zF={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},BF=typeof navigator<`u`&&/Mac/.test(navigator.platform),VF=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),HF=0;HF<10;HF++)RF[48+HF]=RF[96+HF]=String(HF);for(HF=1;HF<=24;HF++)RF[HF+111]=`F`+HF;for(HF=65;HF<=90;HF++)RF[HF]=String.fromCharCode(HF+32),zF[HF]=String.fromCharCode(HF);for(var e in RF)zF.hasOwnProperty(e)||(zF[e]=RF[e])}));function WF(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)GF(e,arguments[t]);return e}function GF(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)GF(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var KF=o((()=>{}));function qF(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function JF(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function YF(e,t){if(!t.anchorNode)return!1;try{return JF(e,t.anchorNode)}catch{return!1}}function XF(e){return e.nodeType==3?cI(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function ZF(e,t,n,r){return n?eI(e,t,n,r,-1)||eI(e,t,n,r,1):!1}function QF(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function $F(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function eI(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:tI(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=QF(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?tI(e):0}else return!1}}function tI(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function nI(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function rI(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function iI(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function aI(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=rI(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=iI(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0Line truncated
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function uP(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==lM.Space&&(i=t),i==t}}function dP(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return q.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??(o=l.left-c.left),s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from))),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(f+t)*a,r=nP(e,{x:d,y:n},!1,a);if(n<c.top||n>c.bottom||(a<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return q.cursor(r,i,void 0,o)}}}function fP(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function pP(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=fP(e,i.from,0);t!=i.from&&(a=q.cursor(t,-1))}else{let t=fP(e,i.from,-1),n=fP(e,i.to,1);(t!=i.from||n!=i.to)&&(a=q.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?q.create(n,t.mainIndex):t}function mP(e,t,n){let r=fP(e.state.facet(_L).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:q.cursor(r,r<n.from?1:-1)}function hP(e,t,n){for(;;){if(!t||n<JM(t))return!1;if(t==e)return!0;n=GM(t)+1,t=t.parentNode}}function gP(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=_I.get(e);if(!(t?.isWidget||e.cmIgnore))return!1;t&&(n||(n=[])).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function _P(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||Y.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=bP(e.state.doc.sliceString(r,o,TL),t.text,s-r,c);l&&(Y.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==TL+TL&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:Dj.of(t.text.slice(l.from,l.toB).split(TL))})}else r&&(!e.hasFocus&&e.state.facet(cL)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(Y.mac||Y.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=q.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Dj.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:Y.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` `,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function _L(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==gF.Space&&(i=t),i==t}}function vL(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return J.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??(o=l.left-c.left),s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from))),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(f+t)*a,r=lL(e,{x:d,y:n},!1,a);if(n<c.top||n>c.bottom||(a<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return J.cursor(r,i,void 0,o)}}}function yL(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function bL(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=yL(e,i.from,0);t!=i.from&&(a=J.cursor(t,-1))}else{let t=yL(e,i.from,-1),n=yL(e,i.to,1);(t!=i.from||n!=i.to)&&(a=J.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?J.create(n,t.mainIndex):t}function xL(e,t,n){let r=yL(e.state.facet(wB).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:J.cursor(r,r<n.from?1:-1)}function SL(e,t,n){for(;;){if(!t||n<tI(t))return!1;if(t==e)return!0;n=QF(t)+1,t=t.parentNode}}function CL(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=wz.get(e);if(!(t?.isWidget||e.cmIgnore))return!1;t&&(n||(n=[])).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function wL(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||Y.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=DL(e.state.doc.sliceString(r,o,MB),t.text,s-r,c);l&&(Y.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==MB+MB&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:NP.of(t.text.slice(l.from,l.toB).split(MB))})}else r&&(!e.hasFocus&&e.state.facet(hB)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(Y.mac||Y.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:NP.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:Y.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
`&&e.lineWrapping&&(r&&(r=q.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Dj.of([` `])}),n)return vP(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=pP(e.state.facet(_L).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function vP(e,t,n,r=-1){if(Y.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Y.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&nN(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&nN(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&nN(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||(o=yP(e,t,n));return e.state.facet(QI).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function yP(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=fP(i.facet(_L).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:q.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&HN(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?q.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function bP(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function xP(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new DL(n,r)),(i!=n||a!=r)&&t.push(new DL(i,a))),t}function SP(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?q.single(n+t,r+t):null}function CP(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){RN(n.state,e)}}}function wP(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(CP(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(CP(t.value,r))}}for(let e in FL)n(e).handlers.push(FL[e]);for(let e in IL)n(e).observers.push(IL[e]);return t}function TP(e){return Math.max(0,e)*.7+8}function EP(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function DP(e,t){let n=e.state.facet(qI);return n.length?n[0](t):Y.mac?t.metaKey:t.ctrlKey}function OP(e,t){let n=e.state.facet(JI);return n.length?n[0](t):Y.mac?!t.altKey:!t.ctrlKey}function kP(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=BM(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function AP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=_I.get(n))&&r.ignoreEvent(t))return!1;return!0}function jP(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textaLine truncated `&&e.lineWrapping&&(r&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:NP.of([` `])}),n)return TL(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=bL(e.state.facet(wB).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function TL(e,t,n,r=-1){if(Y.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Y.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&lI(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&lI(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&lI(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||(o=EL(e,t,n));return e.state.facet(aB).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function EL(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=yL(i.facet(wB).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:J.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&YI(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?J.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function DL(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function OL(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new PB(n,r)),(i!=n||a!=r)&&t.push(new PB(i,a))),t}function kL(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?J.single(n+t,r+t):null}function AL(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){GI(n.state,e)}}}function jL(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(AL(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(AL(t.value,r))}}for(let e in HB)n(e).handlers.push(HB[e]);for(let e in UB)n(e).observers.push(UB[e]);return t}function ML(e){return Math.max(0,e)*.7+8}function NL(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function PL(e,t){let n=e.state.facet(eB);return n.length?n[0](t):Y.mac?t.metaKey:t.ctrlKey}function FL(e,t){let n=e.state.facet(tB);return n.length?n[0](t):Y.mac?!t.altKey:!t.ctrlKey}function IL(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=qF(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function LL(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=wz.get(n))&&r.ignoreEvent(t))return!1;return!0}function RL(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textaLine truncated
`))};if((Y.mac||Y.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:Dj.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);vP(e,u,q.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(DI.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:sL.of(DI.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=BM(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequeLine truncated `))};if((Y.mac||Y.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:NP.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);TL(e,u,J.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(Pz.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:mB.of(Pz.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=qF(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequeLine truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,GR),qR={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},JR=null,YR=J.define({combine(e){let t=hj(e,{render:null,specialChars:KR,addSpecialChars:null});return(t.replaceTabs=!EF())&&(t.specialChars=RegExp(` |`+t.specialChars.source,GR)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,GR)),t}}),XR=null,ZR=`•`,QR=class extends TI{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=kF(this.code),n=e.state.phrase(`Control character`)+` `+(qR[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},$R=class extends TI{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},ez=DI.line({class:`cm-activeLine`}),tz=dL.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(ez.range(i.from)),t=i.from)}return DI.set(n)}},{decorations:e=>e.decorations}),nz=class extends TI{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?UM(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=YM(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},rz=2e3,iz={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},az={style:`cursor: crosshair`},oz=`-10000px`,sz=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},cz=J.define({combine:e=>({position:Y.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||RF})}),lz=new WeakMap,uz=dL.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(cz);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new sz(e,pz,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.apLine truncated --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,QV),eH={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},tH=null,nH=qP.define({combine(e){let t=xP(e,{render:null,specialChars:$V,addSpecialChars:null});return(t.replaceTabs=!NR())&&(t.specialChars=RegExp(` |`+t.specialChars.source,QV)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,QV)),t}}),rH=null,iH=`•`,aH=class extends Mz{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=IR(this.code),n=e.state.phrase(`Control character`)+` `+(eH[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},oH=class extends Mz{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},sH=Pz.line({class:`cm-activeLine`}),cH=vB.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(sH.range(i.from)),t=i.from)}return Pz.set(n)}},{decorations:e=>e.decorations}),lH=class extends Mz{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?XF(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=nI(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},uH=2e3,dH={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},fH={style:`cursor: crosshair`},pH=`-10000px`,mH=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},hH=qP.define({combine:e=>({position:Y.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||GR})}),gH=new WeakMap,_H=vB.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(hH);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new mH(e,bH,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.Line truncated
`)),r=Dj.of(t.split(` `)),r=NP.of(t.split(`
`)),i=SU.build(n,r),a=0,o=0;return{hunks:i.map(e=>{let t=[],i=e.fromA<e.toA,s=e.fromB<e.toB,c=[];if(i){let t=n.lineAt(e.fromA).number,r=n.lineAt(e.toA-1).number;for(let e=t;e<=r;e++)c.push({num:e,text:n.line(e).text})}let l=[];if(s){let t=r.lineAt(e.fromB).number,n=r.lineAt(e.toB-1).number;for(let e=t;e<=n;e++)l.push({num:e,text:r.line(e).text})}o+=c.length,a+=l.length;let u,d,f,p;if(i)u=c[0].num-1,d=c[c.length-1].num+1;else{let t=MU(n,e.fromA),r=n.lineAt(t);e.fromA===r.from?(u=r.number-1,d=r.number):(u=r.number,d=r.number+1)}if(s)f=l[0].num-1,p=l[l.length-1].num+1;else{let t=MU(r,e.fromB),n=r.lineAt(t);e.fromB===n.from?(f=n.number-1,p=n.number):(f=n.number,p=n.number+1)}let m=Math.min(jU,Math.max(0,u),Math.max(0,f));for(let e=m;e>0;e--){let r=u-e+1,i=f-e+1;r>=1&&i>=1&&r<=n.lines&&t.push({type:`context`,oldNum:r,newNum:i,text:n.line(r).text})}for(let e of c)t.push({type:`deletion`,oldNum:e.num,newNum:null,text:e.text});for(let e of l)t.push({type:`addition`,oldNum:null,newNum:e.num,text:e.text});let h=Math.max(0,Math.min(jU,n.lines-d+1)),g=Math.max(0,Math.min(jU,r.lines-p+1)),_=Math.min(h,g);for(let e=0;e<_;e++){let i=d+e,a=p+e;i>=1&&i<=n.lines&&a>=1&&a<=r.lines&&t.push({type:`context`,oldNum:i,newNum:a,text:n.line(i).text})}let v=t.find(e=>e.oldNum!==null)?.oldNum??1,y=t.find(e=>e.newNum!==null)?.newNum??1;return{oldStart:v,oldCount:t.filter(e=>e.type!==`addition`).length,newStart:y,newCount:t.filter(e=>e.type!==`deletion`).length,lines:t}}),additions:a,deletions:o}}var PU=5;function FU({additions:e,deletions:t}){let n=e+t;if(n===0)return null;let r=Math.round(e/n*PU);return(0,I.jsx)(`span`,{className:AU.statBar,children:Array.from({length:PU},(e,t)=>(0,I.jsx)(`span`,{className:`${AU.statBlock} ${t<r?AU.statBlockAdd:AU.statBlockDel}`},t))})}function IU({open:e,original:t,modified:n,onConfirm:r,onCancel:i,loading:a=!1}){let{t:o}=Xo(),s=(0,y.useMemo)(()=>NU(t,n),[t,n]);return(0,I.jsx)(Ap,{open:e,title:o(`config_management.diff.title`),onClose:i,width:`min(1200px, 90vw)`,className:AU.diffModal,closeDisabled:a,footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{variant:`secondary`,onClick:i,disabled:a,children:o(`common.cancel`)}),(0,I.jsx)(L,{onClick:r,loading:a,disabled:a,children:o(`config_management.diff.confirm`)})]}),children:(0,I.jsx)(`div`,{className:AU.content,children:s.hunks.length===0?(0,I.jsx)(`div`,{className:AU.emptyState,children:o(`config_management.diff.no_changes`)}):(0,I.jsxs)(`div`,{className:AU.diffContainer,children:[(0,I.jsxs)(`div`,{className:AU.fileHeader,children:[(0,I.jsx)(`svg`,{className:AU.fileIcon,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,d:`M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z`,fill:`currentColor`})}),(0,I.jsx)(`span`,{className:AU.fileName,children:`config.yaml`}),(0,I.jsxs)(`span`,{className:AU.fileStats,children:[(0,I.jsxs)(`span`,{className:AU.statAdditions,children:[`+`,s.additions]}),(0,I.jsxs)(`span`,{className:AU.statDeletions,children:[`-`,s.deletions]}),(0,I.jsx)(FU,{additions:s.additions,deletions:s.deletions})]})]}),(0,I.jsx)(`div`,{className:AU.diffBody,children:s.hunks.map((e,t)=>(0,I.jsxs)(`div`,{className:AU.hunk,children:[(0,I.jsxs)(`div`,{className:AU.hunkHeader,children:[(0,I.jsx)(`span`,{className:AU.hunkGutter,children:(0,I.jsx)(`svg`,{className:AU.hunkExpandIcon,viewBox:`0 0 16 16`,width:`12`,height:`12`,children:(0,I.jsx)(`path`,{d:`M8.177 1.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V5H5.104a.25.25 0 01-.177-.427l2.896-2.896a.25.25 0 01.354 0zM7.25 11.75a.75.75 0 011.5 0V13h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 13H7.25v-1.25z`,fill:`currentColor`})})}),(0,I.jsx)(`span`,{className:AU.hunkGutter}),(0,I.jsxs)(`span`,{className:AU.hunkText,children:[`@@ -`,e.oldStart,`,`,e.oldCount,` +`,e.newStart,`,`,e.newCount,` @@`]})]}),e.lines.map((e,n)=>(0,I.jsxs)(`div`,{className:`${AU.diffLine} ${AU[e.type]}`,children:[(0,I.jsx)(`span`,{className:`${AU.lineNum} ${e.oldNum===null?AU.lineNumEmpty:``}`,children:e.oldNum??``}),(0,I.jsx)(`span`,{className:`${AU.lineNum} ${e.newNum===null?AU.lineNumEmpty:``}`,children:e.newNum??``}),(0,I.jsx)(`span`,{className:AU.linePrefix,children:e.type===`deletion`?`-`:e.type===`addition`?`+`:` `}),(0,I.jsx)(`code`,{className:AU.lineText,children:e.text||` `})]},`${t}-${n}`))]},t))})]})})})}function LU(e){let{enabled:t=!0,shouldBlock:n,dialog:r}=e,{showConfirmation:i}=Fc(),a=(0,y.useRef)(``),o=(0,y.useRef)(0),s=(0,y.useRef)(``),c=$n(),l=(0,y.useCallback)(()=>{o.current=Date.now()+2e3,s.current=``},[]),u=Dr((0,y.useCallback)(e=>{if(!t)return!1;let r=Date.now();if(o.current>r){let t=`${e.nextLocation.pathname}${e.nextLocation.search}${e.Line truncated `)),i=kK.build(n,r),a=0,o=0;return{hunks:i.map(e=>{let t=[],i=e.fromA<e.toA,s=e.fromB<e.toB,c=[];if(i){let t=n.lineAt(e.fromA).number,r=n.lineAt(e.toA-1).number;for(let e=t;e<=r;e++)c.push({num:e,text:n.line(e).text})}let l=[];if(s){let t=r.lineAt(e.fromB).number,n=r.lineAt(e.toB-1).number;for(let e=t;e<=n;e++)l.push({num:e,text:r.line(e).text})}o+=c.length,a+=l.length;let u,d,f,p;if(i)u=c[0].num-1,d=c[c.length-1].num+1;else{let t=zK(n,e.fromA),r=n.lineAt(t);e.fromA===r.from?(u=r.number-1,d=r.number):(u=r.number,d=r.number+1)}if(s)f=l[0].num-1,p=l[l.length-1].num+1;else{let t=zK(r,e.fromB),n=r.lineAt(t);e.fromB===n.from?(f=n.number-1,p=n.number):(f=n.number,p=n.number+1)}let m=Math.min(RK,Math.max(0,u),Math.max(0,f));for(let e=m;e>0;e--){let r=u-e+1,i=f-e+1;r>=1&&i>=1&&r<=n.lines&&t.push({type:`context`,oldNum:r,newNum:i,text:n.line(r).text})}for(let e of c)t.push({type:`deletion`,oldNum:e.num,newNum:null,text:e.text});for(let e of l)t.push({type:`addition`,oldNum:null,newNum:e.num,text:e.text});let h=Math.max(0,Math.min(RK,n.lines-d+1)),g=Math.max(0,Math.min(RK,r.lines-p+1)),_=Math.min(h,g);for(let e=0;e<_;e++){let i=d+e,a=p+e;i>=1&&i<=n.lines&&a>=1&&a<=r.lines&&t.push({type:`context`,oldNum:i,newNum:a,text:n.line(i).text})}let v=t.find(e=>e.oldNum!==null)?.oldNum??1,y=t.find(e=>e.newNum!==null)?.newNum??1;return{oldStart:v,oldCount:t.filter(e=>e.type!==`addition`).length,newStart:y,newCount:t.filter(e=>e.type!==`deletion`).length,lines:t}}),additions:a,deletions:o}}var VK=5;function HK({additions:e,deletions:t}){let n=e+t;if(n===0)return null;let r=Math.round(e/n*VK);return(0,R.jsx)(`span`,{className:LK.statBar,children:Array.from({length:VK},(e,t)=>(0,R.jsx)(`span`,{className:`${LK.statBlock} ${t<r?LK.statBlockAdd:LK.statBlockDel}`},t))})}function UK({open:e,original:t,modified:n,onConfirm:r,onCancel:i,loading:a=!1}){let{t:o}=Jo(),s=(0,y.useMemo)(()=>BK(t,n),[t,n]);return(0,R.jsx)(jp,{open:e,title:o(`config_management.diff.title`),onClose:i,width:`min(1200px, 90vw)`,className:LK.diffModal,closeDisabled:a,footer:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{variant:`secondary`,onClick:i,disabled:a,children:o(`common.cancel`)}),(0,R.jsx)(z,{onClick:r,loading:a,disabled:a,children:o(`config_management.diff.confirm`)})]}),children:(0,R.jsx)(`div`,{className:LK.content,children:s.hunks.length===0?(0,R.jsx)(`div`,{className:LK.emptyState,children:o(`config_management.diff.no_changes`)}):(0,R.jsxs)(`div`,{className:LK.diffContainer,children:[(0,R.jsxs)(`div`,{className:LK.fileHeader,children:[(0,R.jsx)(`svg`,{className:LK.fileIcon,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,R.jsx)(`path`,{fillRule:`evenodd`,d:`M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z`,fill:`currentColor`})}),(0,R.jsx)(`span`,{className:LK.fileName,children:`config.yaml`}),(0,R.jsxs)(`span`,{className:LK.fileStats,children:[(0,R.jsxs)(`span`,{className:LK.statAdditions,children:[`+`,s.additions]}),(0,R.jsxs)(`span`,{className:LK.statDeletions,children:[`-`,s.deletions]}),(0,R.jsx)(HK,{additions:s.additions,deletions:s.deletions})]})]}),(0,R.jsx)(`div`,{className:LK.diffBody,children:s.hunks.map((e,t)=>(0,R.jsxs)(`div`,{className:LK.hunk,children:[(0,R.jsxs)(`div`,{className:LK.hunkHeader,children:[(0,R.jsx)(`span`,{className:LK.hunkGutter,children:(0,R.jsx)(`svg`,{className:LK.hunkExpandIcon,viewBox:`0 0 16 16`,width:`12`,height:`12`,children:(0,R.jsx)(`path`,{d:`M8.177 1.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V5H5.104a.25.25 0 01-.177-.427l2.896-2.896a.25.25 0 01.354 0zM7.25 11.75a.75.75 0 011.5 0V13h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 13H7.25v-1.25z`,fill:`currentColor`})})}),(0,R.jsx)(`span`,{className:LK.hunkGutter}),(0,R.jsxs)(`span`,{className:LK.hunkText,children:[`@@ -`,e.oldStart,`,`,e.oldCount,` +`,e.newStart,`,`,e.newCount,` @@`]})]}),e.lines.map((e,n)=>(0,R.jsxs)(`div`,{className:`${LK.diffLine} ${LK[e.type]}`,children:[(0,R.jsx)(`span`,{className:`${LK.lineNum} ${e.oldNum===null?LK.lineNumEmpty:``}`,children:e.oldNum??``}),(0,R.jsx)(`span`,{className:`${LK.lineNum} ${e.newNum===null?LK.lineNumEmpty:``}`,children:e.newNum??``}),(0,R.jsx)(`span`,{className:LK.linePrefix,children:e.type===`deletion`?`-`:e.type===`addition`?`+`:` `}),(0,R.jsx)(`code`,{className:LK.lineText,children:e.text||` `})]},`${t}-${n}`))]},t))})]})})})}var WK={container:`ConfigPage-module__container___5kN-Y`,pageHeader:`ConfigPage-module__pageHeader___Zulyi`,pageHeaderCopy:`ConfigPage-module__pageHeaderCopy___fiTfJ`,pageTitle:`ConfigPage-module__pageTitle___BoVLE`,tabBar:`ConfigPage-module__tabBar___PelpE`,tabItem:`ConfigPage-module__tabItem___Uj1rU`,tabActive:`ConfigPage-module__tabActive___sZLh-Line truncated
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new oq(this):new aq(this)}getCursor(e,t=0,n){let r=e.doc?e:fM.create({doc:e});return n??(n=r.doc.length),this.regexp?TK(this,r,t,n):CK(this,r,t,n)}},iq=class{constructor(e){this.spec=e}},aq=class extends iq{constructor(e){super(e)}nextMatch(e,t,n){let r=CK(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=CK(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=CK(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=CK(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=CK(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},oq=class extends iq{nextMatch(e,t,n){let r=TK(this.spec,e,n,e.doc.length).next();return r.done&&(r=TK(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=TK(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=TK(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=TK(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},sq=oM.define(),cq=oM.define(),lq=Uj.define({create(e){return new uq(jK(e).create(),null)},update(e,t){for(let n of t.effects)n.is(sq)?e=new uq(n.value.create(),e.panel):n.is(cq)&&(e=new uq(e.query,n.value?AK:null));return e},provide:e=>Cz.from(e,e=>e.panel)}),uq=class{constructor(e,t){this.query=e,this.panel=t}},dq=DI.mark({class:`cm-searchMatch`}),fq=DI.mark({class:`cm-searchMatch cm-searchMatch-selected`}),pq=dL.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(lq))}update(e){let t=e.state.field(lq);(t!=e.startState.field(lq)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return DI.none;let{view:n}=this,r=new _M;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?fq:dq)})}return r.finish()}},{decorations:e=>e.decorations}),mq=kK((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=q.single(r.from,r.to),a=e.state.facet(nq);return e.dispatch({selection:i,effects:[FK(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),NK(e),!0}),hq=kK((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=q.single(i.from,i.to),o=e.state.facet(nq);return e.dispatch({selection:a,effects:[FK(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),NK(e),!0}),gq=kK((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:q.create(n.map(e=>q.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),_q=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new LK(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(q.range(t.value.from,t.value.to))}return t(e.update({selection:q.create(a,o),userEvent:`select.search.matches`})),!0},vq=kK((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(X.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=q.single(o.from,o.to).map(d),u.push(FK(e,o)),u.push(n.facet(nq).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effectLine truncated `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new fX(this):new dX(this)}getCursor(e,t=0,n){let r=e.doc?e:yF.create({doc:e});return n??(n=r.doc.length),this.regexp?jY(this,r,t,n):kY(this,r,t,n)}},uX=class{constructor(e){this.spec=e}},dX=class extends uX{constructor(e){super(e)}nextMatch(e,t,n){let r=kY(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=kY(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=kY(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=kY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=kY(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},fX=class extends uX{nextMatch(e,t,n){let r=jY(this.spec,e,n,e.doc.length).next();return r.done&&(r=jY(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=jY(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=jY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=jY(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},pX=pF.define(),mX=pF.define(),hX=XP.define({create(e){return new gX(LY(e).create(),null)},update(e,t){for(let n of t.effects)n.is(pX)?e=new gX(n.value.create(),e.panel):n.is(mX)&&(e=new gX(e.query,n.value?IY:null));return e},provide:e=>AH.from(e,e=>e.panel)}),gX=class{constructor(e,t){this.query=e,this.panel=t}},_X=Pz.mark({class:`cm-searchMatch`}),vX=Pz.mark({class:`cm-searchMatch cm-searchMatch-selected`}),yX=vB.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(hX))}update(e){let t=e.state.field(hX);(t!=e.startState.field(hX)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Pz.none;let{view:n}=this,r=new wF;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?vX:_X)})}return r.finish()}},{decorations:e=>e.decorations}),bX=FY((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=J.single(r.from,r.to),a=e.state.facet(cX);return e.dispatch({selection:i,effects:[VY(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),zY(e),!0}),xX=FY((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=J.single(i.from,i.to),o=e.state.facet(cX);return e.dispatch({selection:a,effects:[VY(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),zY(e),!0}),SX=FY((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:J.create(n.map(e=>J.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),CX=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new UY(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(J.range(t.value.from,t.value.to))}return t(e.update({selection:J.create(a,o),userEvent:`select.search.matches`})),!0},wX=FY((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(X.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=J.single(o.from,o.to).map(d),u.push(VY(e,o)),u.push(n.facet(cX).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effectLine truncated
`);XS({filename:`logs.txt`,blob:new Blob([n],{type:`text/plain`})}),t(e(`logs.download_success`),`success`)},Pe=async()=>{if(r!==`connected`){F(!1);return}if(u){F(!1),te([]),re(``);return}F(!0),re(``);try{let e=await E_.fetchErrorLogs();te(Array.isArray(e.files)?e.files:[])}catch(t){console.error(`Failed to load error logs:`,t),te([]);let n=pc(t);re(n?`${e(`logs.error_logs_load_error`)}: ${n}`:e(`logs.error_logs_load_error`))}finally{F(!1)}},Fe=async n=>{try{let r=await E_.downloadErrorLog(n);XS({filename:n,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.error_log_download_success`),`success`)}catch(n){let r=pc(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}},Ie=async t=>{let n=be.current+1;be.current=n,ae(t),se(``),le(``),de(!0);try{let e=await qQ((await E_.downloadErrorLog(t.name)).data);if(be.current!==n)return;se(e)}catch(t){if(be.current!==n)return;let r=pc(t);le(r?`${e(`logs.error_log_open_failed`)}: ${r}`:e(`logs.error_log_open_failed`))}finally{be.current===n&&de(!1)}},Le=()=>{be.current+=1,ae(null),se(``),le(``),de(!1)},Re=async()=>{let n=await Zb(oe);t(n?e(`logs.error_log_copy_success`):e(`logs.copy_failed`,{defaultValue:`Copy failed`}),n?`success`:`error`)};(0,y.useEffect)(()=>{r===`connected`&&(Te(),ye.current={},f(!1),je(!1))},[r,c]),(0,y.useEffect)(()=>{if(r!==`connected`||i!==`unknown`)return;let e=!1;return(async()=>{let t=await Sf.detectRuntimeKind();!e&&(t===`cpa`||t===`home`)&&a(t)})(),()=>{e=!0}},[r,i,a]),(0,y.useEffect)(()=>{m===`errors`&&r===`connected`&&Pe()},[m,r,s]),(0,y.useEffect)(()=>{if(!C||r!==`connected`||p)return;let e=window.setInterval(()=>{je(!0)},8e3);return()=>window.clearInterval(e)},[C,r,p]);let ze=(0,y.useMemo)(()=>g.buffer.slice(g.visibleFrom),[g.buffer,g.visibleFrom]),Be=D.trim(),Ve=Be.length>0,He=Ve?g.buffer:ze,Ue=(0,y.useMemo)(()=>{let e=He;if(O&&(e=e.filter(e=>!e.includes(_c))),Be){let t=Be.toLowerCase();e=e.filter(e=>e.toLowerCase().includes(t))}return e.map(e=>AQ(e))},[He,O,Be]),We=MQ({parsedLines:Ue}),Ge=`logs-structured-filters`,Ke=We.methodFilters.length+We.statusFilters.length+We.pathFilters.length,{filteredParsedLines:qe,filteredLines:Je,removedCount:Ye}=(0,y.useMemo)(()=>{let e=Ue.filter(e=>{if(We.methodFilterSet.size>0&&(!e.method||!We.methodFilterSet.has(e.method)))return!1;let t=lQ(e.statusCode);return!(We.statusFilterSet.size>0&&(!t||!We.statusFilterSet.has(t))||We.pathFilterSet.size>0&&(!e.path||!We.pathFilterSet.has(e.path)))});return{filteredParsedLines:e,filteredLines:e.map(e=>e.raw),removedCount:Math.max(He.length-e.length,0)}},[He,We.methodFilterSet,We.pathFilterSet,We.statusFilterSet,Ue]),Xe=(0,y.useMemo)(()=>A?[]:qe,[qe,A]),Ze=(0,y.useMemo)(()=>Je.join(` `);MT({filename:`logs.txt`,blob:new Blob([n],{type:`text/plain`})}),t(e(`logs.download_success`),`success`)},Me=async()=>{if(r!==`connected`){L(!1);return}if(u){L(!1),F([]),te(``);return}L(!0),te(``);try{let e=await H_.fetchErrorLogs();F(Array.isArray(e.files)?e.files:[])}catch(t){console.error(`Failed to load error logs:`,t),F([]);let n=pc(t);te(n?`${e(`logs.error_logs_load_error`)}: ${n}`:e(`logs.error_logs_load_error`))}finally{L(!1)}},Ne=async n=>{try{let r=await H_.downloadErrorLog(n);MT({filename:n,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.error_log_download_success`),`success`)}catch(n){let r=pc(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}},Pe=async t=>{let n=ve.current+1;ve.current=n,re(t),ae(``),se(``),le(!0);try{let e=await $0((await H_.downloadErrorLog(t.name)).data);if(ve.current!==n)return;ae(e)}catch(t){if(ve.current!==n)return;let r=pc(t);se(r?`${e(`logs.error_log_open_failed`)}: ${r}`:e(`logs.error_log_open_failed`))}finally{ve.current===n&&le(!1)}},Fe=()=>{ve.current+=1,re(null),ae(``),se(``),le(!1)},Ie=async()=>{let n=await EC(ie);t(n?e(`logs.error_log_copy_success`):e(`logs.copy_failed`,{defaultValue:`Copy failed`}),n?`success`:`error`)};(0,y.useEffect)(()=>{r===`connected`&&(Ce(),_e.current={},f(!1),ke(!1))},[r,c]),(0,y.useEffect)(()=>{if(r!==`connected`||i!==`unknown`)return;let e=!1;return(async()=>{let t=await Cf.detectRuntimeKind();!e&&(t===`cpa`||t===`home`)&&a(t)})(),()=>{e=!0}},[r,i,a]),(0,y.useEffect)(()=>{m===`errors`&&r===`connected`&&Me()},[m,r,s]),(0,y.useEffect)(()=>{if(!C||r!==`connected`||p)return;let e=window.setInterval(()=>{ke(!0)},8e3);return()=>window.clearInterval(e)},[C,r,p]);let Le=(0,y.useMemo)(()=>g.buffer.slice(g.visibleFrom),[g.buffer,g.visibleFrom]),Re=D.trim(),ze=Re.length>0,Be=ze?g.buffer:Le,Ve=(0,y.useMemo)(()=>{let e=Be;if(O&&(e=e.filter(e=>!e.includes(_c))),Re){let t=Re.toLowerCase();e=e.filter(e=>e.toLowerCase().includes(t))}return e.map(e=>I0(e))},[Be,O,Re]),He=R0({parsedLines:Ve}),Ue=`logs-structured-filters`,We=He.methodFilters.length+He.statusFilters.length+He.pathFilters.length,{filteredParsedLines:Ge,filteredLines:Ke,removedCount:qe}=(0,y.useMemo)(()=>{let e=Ve.filter(e=>{if(He.methodFilterSet.size>0&&(!e.method||!He.methodFilterSet.has(e.method)))return!1;let t=h0(e.statusCode);return!(He.statusFilterSet.size>0&&(!t||!He.statusFilterSet.has(t))||He.pathFilterSet.size>0&&(!e.path||!He.pathFilterSet.has(e.path)))});return{filteredParsedLines:e,filteredLines:e.map(e=>e.raw),removedCount:Math.max(Be.length-e.length,0)}},[Be,He.methodFilterSet,He.pathFilterSet,He.statusFilterSet,Ve]),Je=(0,y.useMemo)(()=>A?[]:Ge,[Ge,A]),Ye=(0,y.useMemo)(()=>Ke.join(`
`),[Je]),Qe=IQ({logState:g,setLogState:_,loading:v,isSearching:Ve,filteredLineCount:Je.length,hasStructuredFilters:We.hasStructuredFilters,showRawLogs:A});ve.current=Qe;let $e=async n=>{await Zb(n)?t(e(`logs.copy_success`,{defaultValue:`Copied to clipboard`}),`success`):t(e(`logs.copy_failed`,{defaultValue:`Copy failed`}),`error`)},et=()=>{xe.current?.timer&&(window.clearTimeout(xe.current.timer),xe.current.timer=null)},tt=(e,t)=>{s&&t&&(fe||(et(),xe.current={timer:window.setTimeout(()=>{pe(t),xe.current&&(xe.current.fired=!0,xe.current.timer=null)},zQ),startX:e.clientX,startY:e.clientY,fired:!1}))},nt=()=>{et(),xe.current=null},rt=e=>{let t=xe.current;if(!t||t.timer===null||t.fired)return;let n=Math.abs(e.clientX-t.startX),r=Math.abs(e.clientY-t.startY);(n>BQ||r>BQ)&&nt()},it=()=>{me||pe(null)},at=async n=>{he(!0);try{let r=await E_.downloadRequestLogById(n,ye.current[n]);XS({filename:`request-${n}.log`,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.request_log_download_success`),`success`),pe(null)}catch(n){let r=pc(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}finally{he(!1)}};return(0,y.useEffect)(()=>()=>{xe.current?.timer&&(window.clearTimeout(xe.current.timer),xe.current.timer=null)},[]),(0,y.useEffect)(()=>{if(!ge)return;document.body.classList.add(`logs-fullscreen-active`),Ep();let e=e=>{e.key===`Escape`&&(document.querySelector(`.modal-overlay`)||_e(!1))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),document.body.classList.remove(`logs-fullscreen-active`),Dp()}},[ge]),(0,I.jsxs)(`div`,{className:$.container,children:[(0,I.jsxs)(`div`,{className:$.pageHeader,children:[(0,I.jsx)(`h1`,{className:$.pageTitle,children:e(`logs.title`)}),(0,I.jsx)(`div`,{className:$.runtimeNotice,children:e(`logs.runtime_${i}`)})]}),(0,I.jsxs)(`div`,{className:$.tabBar,children:[(0,I.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`logs`?$.tabActive:``}`,onClick:()=>h(`logs`),children:e(`logs.log_content`)}),(0,I.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`errors`?$.tabActive:``}`,onClick:()=>{_e(!1),h(`errors`)},children:e(`logs.error_logs_modal_title`)})]}),(0,I.jsxs)(`div`,{className:$.content,children:[m===`logs`&&(0,I.jsxs)(Yb,{className:[$.logCard,ge?$.logCardFullscreen:``].filter(Boolean).join(` `),children:[p&&(0,I.jsx)(`div`,{className:`status-badge warning`,children:e(l?`logs.cpa_file_logging_required`:`logs.file_logging_required`)}),x&&(0,I.jsx)(`div`,{className:`error-box`,children:x}),(0,I.jsxs)(`div`,{className:$.filters,children:[!ge&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:$.searchWrapper,children:(0,I.jsx)($o,{value:T,onChange:e=>E(e.target.value),placeholder:e(`logs.search_placeholder`),className:$.searchInput,rightElement:T?(0,I.jsx)(`button`,{type:`button`,className:$.searchClear,onClick:()=>E(``),title:`Clear`,"aria-label":`Clear`,children:(0,I.jsx)(Os,{size:16})}):(0,I.jsx)(Ds,{size:16,className:$.searchIcon})})}),(0,I.jsx)(`div`,{className:$.filterPanelHeader,children:(0,I.jsx)(L,{type:`button`,variant:`secondary`,size:`sm`,className:$.filterPanelToggle,onClick:()=>M(e=>!e),"aria-expanded":j,"aria-controls":Ge,title:e(j?`logs.filter_panel_collapse`:`logs.filter_panel_expand`),children:(0,I.jsxs)(`span`,{className:$.filterPanelButtonContent,children:[(0,I.jsx)(ns,{size:16}),(0,I.jsx)(`span`,{children:e(`logs.filter_panel_title`)}),Ke>0&&(0,I.jsx)(`span`,{className:$.filterPanelCount,children:e(`logs.filter_panel_active_count`,{count:Ke})}),j?(0,I.jsx)(ws,{size:16}):(0,I.jsx)(Ts,{size:16})]})})})]}),!ge&&j&&(0,I.jsxs)(`div`,{id:Ge,className:$.structuredFilters,children:[(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_method`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:sQ.map(e=>{let t=We.methodFilters.includes(e),n=We.methodCounts[e]??0;return(0,I.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${t?$.filterChipActive:``}`,onClick:()=>We.toggleMethodFilter(e),disabled:n===0&&!t,"aria-pressed":t,children:[e,` (`,n,`)`]},e)})})]}),(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_status`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:cQ.map(t=>{let n=We.statusFilters.includes(t),r=We.statusCounts[t]??0;return(0,I.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>We.toggleStatusFilter(t),disabled:r===0&&!n,"aria-pressed":n,children:[e(`logs.filter_status_${t}`),` (`,r,`)`]},t)})})]}),(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_path`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:We.pathOptions.length===0?(0,I.jsx)(`span`,{className:$.filterChipHint,children:e(`logs.filter_path_empty`)}):We.pathOptions.map(({path:e,count:t})=>{let n=We.pathFilters.includes(e);retuLine truncated `),[Ke]),Xe=H0({logState:g,setLogState:_,loading:v,isSearching:ze,filteredLineCount:Ke.length,hasStructuredFilters:He.hasStructuredFilters,showRawLogs:A});ge.current=Xe;let Ze=async n=>{await EC(n)?t(e(`logs.copy_success`,{defaultValue:`Copied to clipboard`}),`success`):t(e(`logs.copy_failed`,{defaultValue:`Copy failed`}),`error`)},Qe=()=>{ye.current?.timer&&(window.clearTimeout(ye.current.timer),ye.current.timer=null)},$e=(e,t)=>{s&&t&&(ue||(Qe(),ye.current={timer:window.setTimeout(()=>{de(t),ye.current&&(ye.current.fired=!0,ye.current.timer=null)},G0),startX:e.clientX,startY:e.clientY,fired:!1}))},et=()=>{Qe(),ye.current=null},tt=e=>{let t=ye.current;if(!t||t.timer===null||t.fired)return;let n=Math.abs(e.clientX-t.startX),r=Math.abs(e.clientY-t.startY);(n>K0||r>K0)&&et()},nt=()=>{fe||de(null)},rt=async n=>{pe(!0);try{let r=await H_.downloadRequestLogById(n,_e.current[n]);MT({filename:`request-${n}.log`,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.request_log_download_success`),`success`),de(null)}catch(n){let r=pc(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}finally{pe(!1)}};return(0,y.useEffect)(()=>()=>{ye.current?.timer&&(window.clearTimeout(ye.current.timer),ye.current.timer=null)},[]),(0,y.useEffect)(()=>{if(!me)return;document.body.classList.add(`logs-fullscreen-active`),Dp();let e=e=>{e.key===`Escape`&&(document.querySelector(`.modal-overlay`)||he(!1))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),document.body.classList.remove(`logs-fullscreen-active`),Op()}},[me]),(0,R.jsxs)(`div`,{className:$.container,children:[(0,R.jsxs)(`div`,{className:$.pageHeader,children:[(0,R.jsx)(`h1`,{className:$.pageTitle,children:e(`logs.title`)}),(0,R.jsx)(`div`,{className:$.runtimeNotice,children:e(`logs.runtime_${i}`)})]}),(0,R.jsxs)(`div`,{className:$.tabBar,children:[(0,R.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`logs`?$.tabActive:``}`,onClick:()=>h(`logs`),children:e(`logs.log_content`)}),(0,R.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`errors`?$.tabActive:``}`,onClick:()=>{he(!1),h(`errors`)},children:e(`logs.error_logs_modal_title`)})]}),(0,R.jsxs)(`div`,{className:$.content,children:[m===`logs`&&(0,R.jsxs)(sC,{className:[$.logCard,me?$.logCardFullscreen:``].filter(Boolean).join(` `),children:[p&&(0,R.jsx)(`div`,{className:`status-badge warning`,children:e(l?`logs.cpa_file_logging_required`:`logs.file_logging_required`)}),x&&(0,R.jsx)(`div`,{className:`error-box`,children:x}),(0,R.jsxs)(`div`,{className:$.filters,children:[!me&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:$.searchWrapper,children:(0,R.jsx)(Zo,{value:T,onChange:e=>E(e.target.value),placeholder:e(`logs.search_placeholder`),className:$.searchInput,rightElement:T?(0,R.jsx)(`button`,{type:`button`,className:$.searchClear,onClick:()=>E(``),title:`Clear`,"aria-label":`Clear`,children:(0,R.jsx)(Es,{size:16})}):(0,R.jsx)(Ts,{size:16,className:$.searchIcon})})}),(0,R.jsx)(`div`,{className:$.filterPanelHeader,children:(0,R.jsx)(z,{type:`button`,variant:`secondary`,size:`sm`,className:$.filterPanelToggle,onClick:()=>N(e=>!e),"aria-expanded":M,"aria-controls":Ue,title:e(M?`logs.filter_panel_collapse`:`logs.filter_panel_expand`),children:(0,R.jsxs)(`span`,{className:$.filterPanelButtonContent,children:[(0,R.jsx)(es,{size:16}),(0,R.jsx)(`span`,{children:e(`logs.filter_panel_title`)}),We>0&&(0,R.jsx)(`span`,{className:$.filterPanelCount,children:e(`logs.filter_panel_active_count`,{count:We})}),M?(0,R.jsx)(Ss,{size:16}):(0,R.jsx)(Cs,{size:16})]})})})]}),!me&&M&&(0,R.jsxs)(`div`,{id:Ue,className:$.structuredFilters,children:[(0,R.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,R.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_method`)}),(0,R.jsx)(`div`,{className:$.filterChipList,children:p0.map(e=>{let t=He.methodFilters.includes(e),n=He.methodCounts[e]??0;return(0,R.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${t?$.filterChipActive:``}`,onClick:()=>He.toggleMethodFilter(e),disabled:n===0&&!t,"aria-pressed":t,children:[e,` (`,n,`)`]},e)})})]}),(0,R.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,R.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_status`)}),(0,R.jsx)(`div`,{className:$.filterChipList,children:m0.map(t=>{let n=He.statusFilters.includes(t),r=He.statusCounts[t]??0;return(0,R.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>He.toggleStatusFilter(t),disabled:r===0&&!n,"aria-pressed":n,children:[e(`logs.filter_status_${t}`),` (`,r,`)`]},t)})})]}),(0,R.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,R.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_path`)}),(0,R.jsx)(`div`,{className:$.filterChipList,children:He.pathOptions.length===0?(0,R.jsx)(`span`,{className:$.filterChipHint,children:e(`logs.filter_path_empty`)}):He.pathOptions.map(({path:e,count:t})=>{let n=He.pathFilters.includes(e);retuLine truncated
<style rel="stylesheet" crossorigin>*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}#root{width:100%;height:100%}button,input,textarea,select{font:inherit}a{color:inherit;text-decoration:none}ul,ol{list-style:none}:root{--bg-secondary:#faf9f5;--bg-primary:#f0eee8;--bg-tertiary:#e9e6df;--bg-hover:var(--bg-tertiary);--bg-quinary:#f6f4ee;--bg-error-light:#c657461a;--floating-surface:#fffdf9;--floating-border:#d8d3ca;--floating-shadow:0 12px 26px #00000024;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e3e1db;--border-secondary:var(--border-color);--border-primary:#d5d2cb;--border-hover:#cecac4;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary);--glass-blur:12px;--glass-backdrop-filter:blur(var(--glass-blur));--glass-filter:blur(var(--glass-blur));--glass-bg:color-mix(in srgb, var(--bg-primary) 82%, transparent);--glass-bg-secondary:color-mix(in srgb, var(--bg-secondary) 82%, transparent);--glass-border:color-mix(in srgb, var(--border-color) 60%, transparent)}[data-theme=white]{--bg-secondary:#fff;--bg-primary:#fff;--bg-tertiary:#f6f6f6;--bg-hover:var(--bg-tertiary);--bg-quinary:#fff;--bg-error-light:#c6574614;--floating-surface:#fff;--floating-border:#d9d9d9;--floating-shadow:0 12px 26px #0000001f;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e5e5e5;--border-secondary:var(--border-color);--border-primary:#d9d9d9;--border-hover:#ccc;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary)}[data-theme=dark]{--bg-secondary:#151412;--bg-primary:#1d1b18;--bg-tertiary:#262320;--bg-hover:#2e2a26;--bg-quinary:#191714;--bg-error-light:#c657462e;--floating-surface:#2a2723;--floating-border:#4a443d;--floating-shadow:0 14px 30px #0006;--text-primary:#f6f4f1;--text-secondary:#c9c3bb;--text-tertiary:#9c958d;--text-quaternary:#6f6962;--text-muted:var(--text-tertiary);--border-color:#3a3530;--border-seLine truncated <style rel="stylesheet" crossorigin>*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}#root{width:100%;height:100%}button,input,textarea,select{font:inherit}a{color:inherit;text-decoration:none}ul,ol{list-style:none}:root{--bg-secondary:#faf9f5;--bg-primary:#f0eee8;--bg-tertiary:#e9e6df;--bg-hover:var(--bg-tertiary);--bg-quinary:#f6f4ee;--bg-error-light:#c657461a;--floating-surface:#fffdf9;--floating-border:#d8d3ca;--floating-shadow:0 12px 26px #00000024;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e3e1db;--border-secondary:var(--border-color);--border-primary:#d5d2cb;--border-hover:#cecac4;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary);--glass-blur:12px;--glass-backdrop-filter:blur(var(--glass-blur));--glass-filter:blur(var(--glass-blur));--glass-bg:color-mix(in srgb, var(--bg-primary) 82%, transparent);--glass-bg-secondary:color-mix(in srgb, var(--bg-secondary) 82%, transparent);--glass-border:color-mix(in srgb, var(--border-color) 60%, transparent)}[data-theme=white]{--bg-secondary:#fff;--bg-primary:#fff;--bg-tertiary:#f6f6f6;--bg-hover:var(--bg-tertiary);--bg-quinary:#fff;--bg-error-light:#c6574614;--floating-surface:#fff;--floating-border:#d9d9d9;--floating-shadow:0 12px 26px #0000001f;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e5e5e5;--border-secondary:var(--border-color);--border-primary:#d9d9d9;--border-hover:#ccc;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary)}[data-theme=dark]{--bg-secondary:#151412;--bg-primary:#1d1b18;--bg-tertiary:#262320;--bg-hover:#2e2a26;--bg-quinary:#191714;--bg-error-light:#c657462e;--floating-surface:#2a2723;--floating-border:#4a443d;--floating-shadow:0 14px 30px #0006;--text-primary:#f6f4f1;--text-secondary:#c9c3bb;--text-tertiary:#9c958d;--text-quaternary:#6f6962;--text-muted:var(--text-tertiary);--border-color:#3a3530;--border-seLine truncated
/*$vite$:1*/</style> /*$vite$:1*/</style>
</head> </head>
<body> <body>
+2 -2
View File
@@ -124,8 +124,8 @@ Requires=cliproxyapi.service
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/home/admin/cliproxyapi/usage-dashboard WorkingDirectory=/home/orangepi/cliproxyapi/usage-dashboard
ExecStart=/usr/bin/python3 /home/admin/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser ExecStart=/usr/bin/python3 /home/orangepi/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser
Restart=always Restart=always
RestartSec=10 RestartSec=10