181 lines
628 KiB
JavaScript
181 lines
628 KiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-rXmQmLUY.js","../codeMirrorModule.-QdMvsKi.css"])))=>i.map(i=>d[i]);
|
|||
|
|
import{a as e,c as t,d as n,f as r,i,l as a,m as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./urlMatch-L3liM589.js";var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),x=(e,t)=>{let n={};for(var r in e)h(n,r,{get:e[r],enumerable:!0});return t||h(n,Symbol.toStringTag,{value:`Module`}),n},S=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=_(t),a=0,o=i.length,s;a<o;a++)s=i[a],!y.call(e,s)&&s!==n&&h(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=g(t,s))||r.enumerable});return e},C=(e,t,n)=>(n=e==null?{}:m(v(e)),S(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),w=b((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},ee=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return T(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(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 oe(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,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+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+ie(a,u),c+=oe(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+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(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 D(e,t,n){if(e==null)return e;var r=
|
|||
|
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|||
|
|
`+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!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(`
|
|||
|
|
`);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{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|||
|
|
Error generating stack: `+e.message+`
|
|||
|
|
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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-We(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&&M(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function M(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(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 ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=O.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function ut(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt;function bt(e){delete e[ft],del
|
|||
|
|
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(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=an(``+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`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`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=an(``+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`:Q(`beforetoggle`,e),Q(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break
|
|||
|
|
`,`\\n`)}function Me(e,t){if(e)for(let n of t.split(`|`)){if(n===`url`)try{let t=new URL(e[n]);return t.protocol===`data:`?t.protocol:[`about:`,`chrome:`,`edge:`].includes(t.protocol)?e[n]:t.pathname+t.search}catch{if(e[n]!==void 0)return e[n]}if(n===`timeNumber`&&e[n]!==void 0)return new Date(e[n]).toString();let t=Ne(e,n);if(t!==void 0)return t}}function Ne(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}if(r!==void 0)return String(r)}function Pe(e){return(e.title??Ae(e)?.title??e.method).replace(/\{([^}]+)\}/g,(t,n)=>je(e.params,n)??t)}function Fe(e){return Ae(e)?.group}var Ie=Symbol(`context`),Le=Symbol(`nextInContext`),Re=Symbol(`prevByEndTime`),ze=Symbol(`nextByStartTime`),Be=Symbol(`events`),Ve=class{constructor(e,t){this.pagerefToTitle=new Map,this.contextToTitle=new Map,t.forEach(e=>He(e));let n=t.find(e=>e.origin===`library`);this.traceUri=e,this.browserName=n?.browserName||``,this.sdkLanguage=n?.sdkLanguage,this.channel=n?.channel,this.testIdAttributeName=n?.testIdAttributeName,this.platform=n?.platform||``,this.playwrightVersion=t.find(e=>e.playwrightVersion)?.playwrightVersion,this.title=n?.title||``,this.options=n?.options||{},this.testTimeout=t.find(e=>e.origin===`testRunner`)?.testTimeout,this.actions=Ue(t),this.pages=[].concat(...t.map(e=>e.pages)),this.wallTime=t.map(e=>e.wallTime).reduce((e,t)=>Math.min(e||Number.MAX_VALUE,t),Number.MAX_VALUE),this.startTime=t.map(e=>e.startTime).reduce((e,t)=>Math.min(e,t),Number.MAX_VALUE),this.endTime=t.map(e=>e.endTime).reduce((e,t)=>Math.max(e,t),Number.MIN_VALUE),this.events=[].concat(...t.map(e=>e.events)),this.stdio=[].concat(...t.map(e=>e.stdio)),this.errors=[].concat(...t.map(e=>e.errors)),this.hasSource=t.some(e=>e.hasSource),this.hasStepData=t.some(e=>e.origin===`testRunner`),this.resources=[...t.map(e=>e.resources)].flat().map(e=>({...e,id:`${e.pageref}-${e.startedDateTime}-${e.request.url}`})),this.attachments=this.actions.flatMap(t=>t.attachments?.map(n=>({...n,callId:t.callId,traceUri:e}))??[]),this.visibleAttachments=this.attachments.filter(e=>!e.name.startsWith(`_`)),this.pages.forEach((e,t)=>this.pagerefToTitle.set(e.pageId,`page#`+(t+1)));let r=0,i=0;for(let e of t)e.resources.some(e=>e._apiRequest)?this.contextToTitle.set(e,`api#`+ ++r):this.contextToTitle.set(e,`browser#`+ ++i);this.events.sort((e,t)=>e.time-t.time),this.resources.sort((e,t)=>e._monotonicTime-t._monotonicTime),this.errorDescriptors=this.hasStepData?this._errorDescriptorsFromTestRunner():this._errorDescriptorsFromActions(),this.sources=tt(this.actions,this.errorDescriptors),this.actionCounters=new Map;for(let e of this.actions)e.group=e.group??Fe({type:e.class,method:e.method}),e.group&&this.actionCounters.set(e.group,1+(this.actionCounters.get(e.group)||0))}createRelativeUrl(e){let t=new URL(`http://localhost/`+e);return t.searchParams.set(`trace`,this.traceUri),t.toString().substring(17)}failedAction(){return this.actions.findLast(e=>e.error)}filteredActions(e){let t=new Set(e);return this.actions.filter(e=>!e.group||t.has(e.group))}renderActionTree(e){let{rootItem:t}=Je(this.filteredActions(e??[])),n=[],r=(e,t)=>{let i=Pe({...e.action,type:e.action.class});n.push(`${t}${i||e.id}`);for(let n of e.children)r(n,t+` `)};return t.children.forEach(e=>r(e,``)),n}_errorDescriptorsFromActions(){let e=[];for(let t of this.actions||[])t.error?.message&&e.push({action:t,stack:t.stack,message:t.error.message});return e}_errorDescriptorsFromTestRunner(){return this.errors.filter(e=>!!e.message).map((e,t)=>({stack:e.stack,message:e.message}))}};function He(e){for(let t of e.pages)t[Ie]=e;for(let t=0;t<e.actions.length;++t){let n=e.actions[t];n[Ie]=e}let t;for(let n=e.actions.length-1;n>=0;n--){let r=e.actions[n];r[Le]=t,r.class!==`Route`&&(t=r)}for(let t of e.events)t[Ie]=e;for(let t of e.resources)t[Ie]=e}function Ue(e){let t=[],n=Ge(e);t.push(...n),t.sort((e,t)=>t.parentId===e.callId?1:e.parentId===t.callId?-1:e.endTime-t.endTime);for(let e=1;e<t.length;++e)t[e][Re]=t[e-1];t.sort((e,t)=>t.parentId===e.callId?-1:e.parentId===t.callId?1:e.startTime-t.start
|
|||
|
|
`:this.value}},Xt=class extends Et{constructor(...e){super(...e),this.value=``}ASCIIMatch(e){return this.value.toLowerCase()===e.toLowerCase()}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}},Zt=class extends Xt{constructor(e){super(),this.tokenType=`IDENT`,this.value=e}toString(){return`IDENT(`+this.value+`)`}toSource(){return sn(this.value)}},Qt=class extends Xt{constructor(e){super(),this.tokenType=`FUNCTION`,this.value=e,this.mirror=`)`}toString(){return`FUNCTION(`+this.value+`)`}toSource(){return sn(this.value)+`(`}},$t=class extends Xt{constructor(e){super(),this.tokenType=`AT-KEYWORD`,this.value=e}toString(){return`AT(`+this.value+`)`}toSource(){return`@`+sn(this.value)}},en=class extends Xt{constructor(e){super(),this.tokenType=`HASH`,this.value=e,this.type=`unrestricted`}toString(){return`HASH(`+this.value+`)`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e}toSource(){return this.type===`id`?`#`+sn(this.value):`#`+cn(this.value)}},tn=class extends Xt{constructor(e){super(),this.tokenType=`STRING`,this.value=e}toString(){return`"`+ln(this.value)+`"`}},nn=class extends Xt{constructor(e){super(),this.tokenType=`URL`,this.value=e}toString(){return`URL(`+this.value+`)`}toSource(){return`url("`+ln(this.value)+`")`}},rn=class extends Et{constructor(){super(),this.tokenType=`NUMBER`,this.type=`integer`,this.repr=``}toString(){return this.type===`integer`?`INT(`+this.value+`)`:`NUMBER(`+this.value+`)`}toJSON(){let e=super.toJSON();return e.value=this.value,e.type=this.type,e.repr=this.repr,e}toSource(){return this.repr}},an=class extends Et{constructor(){super(),this.tokenType=`PERCENTAGE`,this.repr=``}toString(){return`PERCENTAGE(`+this.value+`)`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.repr=this.repr,e}toSource(){return this.repr+`%`}},on=class extends Et{constructor(){super(),this.tokenType=`DIMENSION`,this.type=`integer`,this.repr=``,this.unit=``}toString(){return`DIM(`+this.value+`,`+this.unit+`)`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e.unit=this.unit,e}toSource(){let e=this.repr,t=sn(this.unit);return t[0].toLowerCase()===`e`&&(t[1]===`-`||lt(t.charCodeAt(1),48,57))&&(t=`\\65 `+t.slice(1,t.length)),e+t}};function sn(e){e=``+e;let t=``,n=e.charCodeAt(0);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===0)throw new St(`Invalid character: the input contains U+0000.`);lt(i,1,31)||i===127||r===0&<(i,48,57)||r===1&<(i,48,57)&&n===45?t+=`\\`+i.toString(16)+` `:i>=128||i===45||i===95||lt(i,48,57)||lt(i,65,90)||lt(i,97,122)?t+=e[r]:t+=`\\`+e[r]}return t}function cn(e){e=``+e;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new St(`Invalid character: the input contains U+0000.`);r>=128||r===45||r===95||lt(r,48,57)||lt(r,65,90)||lt(r,97,122)?t+=e[n]:t+=`\\`+r.toString(16)+` `}return t}function ln(e){e=``+e;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new St(`Invalid character: the input contains U+0000.`);lt(r,1,31)||r===127?t+=`\\`+r.toString(16)+` `:r===34||r===92?t+=`\\`+e[n]:t+=e[n]}return t}var un=class extends Error{};function dn(e,t){let n;try{n=Tt(e),n[n.length-1]instanceof Jt||n.push(new Jt)}catch(t){let n=t.message+` while parsing css selector "${e}". Did you mean to CSS.escape it?`,r=(t.stack||``).indexOf(t.message);throw r!==-1&&(t.stack=t.stack.substring(0,r)+n+t.stack.substring(r+t.message.length)),t.message=n,t}let r=n.find(e=>e instanceof $t||e instanceof Dt||e instanceof Ot||e instanceof qt||e instanceof At||e instanceof jt||e instanceof Nt||e instanceof It||e instanceof Lt||e instanceof nn||e instanceof an);if(r)throw new un(`Unsupported token "${r.toSource()}" while parsing css selector "${e}". Did you mean to CSS.escape it?`);let i=0,a=new Set;function o(){return new un(`Unexpected token "${n[i].toSource()}" while parsing css select
|
|||
|
|
linear-gradient(-45deg, #80808020 25%, transparent 25%),
|
|||
|
|
linear-gradient(45deg, transparent 75%, #80808020 75%),
|
|||
|
|
linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:`20px 20px`,backgroundPosition:`0 0, 0 10px, 10px -10px, -10px 0px`,boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
|
|||
|
|
rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|||
|
|
rgb(0 0 0 / 10%) 0px -2px 4px,
|
|||
|
|
rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|||
|
|
rgb(0 0 0 / 25%) 0px 6px 12px`},fr=({diff:e,noTargetBlank:t,hideDetails:n})=>{let[r,i]=T.useState(e.diff?`diff`:`actual`),[a,o]=T.useState(!1),[s,c]=T.useState(null),[l,u]=T.useState(`Expected`),[d,f]=T.useState(null),[p,m]=T.useState(null),[h,g]=E();T.useEffect(()=>{(async()=>{c(await ur(e.expected?.attachment.path)),u(e.expected?.title||`Expected`),f(await ur(e.actual?.attachment.path)),m(await ur(e.diff?.attachment.path))})()},[e]);let _=s&&d&&p,v=_?Math.max(s.naturalWidth,d.naturalWidth,200):500,y=_?Math.max(s.naturalHeight,d.naturalHeight,200):500,b=Math.min(1,(h.width-30)/v),x=Math.min(1,(h.width-50)/v/2),S=v*b,C=y*b,w={flex:`none`,margin:`0 10px`,cursor:`pointer`,userSelect:`none`};return(0,M.jsx)(`div`,{"data-testid":`test-result-image-mismatch`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,flex:`auto`},ref:g,children:_&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{"data-testid":`test-result-image-mismatch-tabs`,style:{display:`flex`,margin:`10px 0 20px`},children:[e.diff&&(0,M.jsx)(`div`,{style:{...w,fontWeight:r===`diff`?600:`initial`},onClick:()=>i(`diff`),children:`Diff`}),(0,M.jsx)(`div`,{style:{...w,fontWeight:r===`actual`?600:`initial`},onClick:()=>i(`actual`),children:`Actual`}),(0,M.jsx)(`div`,{style:{...w,fontWeight:r===`expected`?600:`initial`},onClick:()=>i(`expected`),children:l}),(0,M.jsx)(`div`,{style:{...w,fontWeight:r===`sxs`?600:`initial`},onClick:()=>i(`sxs`),children:`Side by side`}),(0,M.jsx)(`div`,{style:{...w,fontWeight:r===`slider`?600:`initial`},onClick:()=>i(`slider`),children:`Slider`})]}),(0,M.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,flex:`auto`,minHeight:C+60},children:[e.diff&&r===`diff`&&(0,M.jsx)(mr,{image:p,alt:`Diff`,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b}),e.diff&&r===`actual`&&(0,M.jsx)(mr,{image:d,alt:`Actual`,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b}),e.diff&&r===`expected`&&(0,M.jsx)(mr,{image:s,alt:l,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b}),e.diff&&r===`slider`&&(0,M.jsx)(pr,{expectedImage:s,actualImage:d,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b,expectedTitle:l}),e.diff&&r===`sxs`&&(0,M.jsxs)(`div`,{style:{display:`flex`},children:[(0,M.jsx)(mr,{image:s,title:l,hideSize:n,canvasWidth:x*v,canvasHeight:x*y,scale:x}),(0,M.jsx)(mr,{image:a?p:d,title:a?`Diff`:`Actual`,onClick:()=>o(!a),hideSize:n,canvasWidth:x*v,canvasHeight:x*y,scale:x})]}),!e.diff&&r===`actual`&&(0,M.jsx)(mr,{image:d,title:`Actual`,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b}),!e.diff&&r===`expected`&&(0,M.jsx)(mr,{image:s,title:l,hideSize:n,canvasWidth:S,canvasHeight:C,scale:b}),!e.diff&&r===`sxs`&&(0,M.jsxs)(`div`,{style:{display:`flex`},children:[(0,M.jsx)(mr,{image:s,title:l,canvasWidth:x*v,canvasHeight:x*y,scale:x}),(0,M.jsx)(mr,{image:d,title:`Actual`,canvasWidth:x*v,canvasHeight:x*y,scale:x})]})]}),!n&&(0,M.jsxs)(`div`,{style:{alignSelf:`start`,lineHeight:`18px`,marginLeft:`15px`},children:[(0,M.jsx)(`div`,{children:e.diff&&(0,M.jsx)(`a`,{target:`_blank`,href:e.diff.attachment.path,rel:`noreferrer`,children:e.diff.attachment.name})}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`a`,{target:t?``:`_blank`,href:e.actual.attachment.path,rel:`noreferrer`,children:e.actual.attachment.name})}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`a`,{target:t?``:`_blank`,href:e.expected.attachment.path,rel:`noreferrer`,children:e.expected.attachment.name})})]})]})})},pr=({expectedImage:e,actualImage:t,canvasWidth:n,canvasHeight:r,scale:i,expectedTitle:a,hideSize:o})=>{let s={position:`absolute`,top:0,left:0},[c,l]=T.useState(n/2),u=e.naturalWidth===t.naturalWidth&&e.naturalHeight===t.naturalHeight;return(0,M.jsxs)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`,flexDirection:`column`,userSelect:`none`},children:[!o&&(0,M.jsxs)(`div`,{style:{margin:5},children:[!u&&(0,M.jsx)(`span`,{style:{flex:`none`,margin:`0 5px`},children:`Actual `}),!u&&(0,M.jsx)(`span`,{children:t.naturalWidth}),!u&&(0,M.jsx)(`span`,{style:{flex:`none`,margin:`0 5px`},children:`x`}),!u&&(0,M.jsx)(`span`,{children:t.naturalHeight}),!u&&(0,M.jsxs)(`span`,{style
|
|||
|
|
`).length:0;return Math.min(Math.max(5,e),20)*20},[a]),h=(0,M.jsxs)(`span`,{style:{marginLeft:5},ref:d,"aria-label":e.name,children:[(0,M.jsx)(`span`,{children:kr(e.name)}),p&&(0,M.jsx)(`a`,{style:{marginLeft:5},href:Ir(n,e),children:`download`})]});return!f||!p?(0,M.jsx)(`div`,{style:{marginLeft:20},children:h}):(0,M.jsxs)(`div`,{className:k(l&&`yellow-flash`),children:[(0,M.jsx)(Or,{title:h,expanded:r,setExpanded:i,expandOnTitleClick:!0,children:s&&(0,M.jsx)(`i`,{children:s})}),r&&a!==null&&(0,M.jsx)(`div`,{className:`vbox`,style:{height:m},children:(0,M.jsx)(yr,{text:a,readOnly:!0,mimeType:e.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},Pr=({revealedAttachmentCallId:e})=>{let t=Mr(),{diffMap:n,screenshots:r,attachments:i}=T.useMemo(()=>{let e=new Set(t?.visibleAttachments??[]),n=new Set,r=new Map;for(let t of e){if(!t.path&&!t.sha1)continue;let i=t.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(i){let n=i[1],a=i[2],o=r.get(n)||{expected:void 0,actual:void 0,diff:void 0};o[a]=t,r.set(n,o),e.delete(t)}else t.contentType.startsWith(`image/`)&&(n.add(t),e.delete(t))}return{diffMap:r,attachments:e,screenshots:n}},[t]);return!n.size&&!r.size&&!i.size?(0,M.jsx)(Gn,{text:`No attachments`}):(0,M.jsxs)(`div`,{className:`attachments-tab`,children:[[...n.values()].map(({expected:e,actual:n,diff:r})=>(0,M.jsxs)(M.Fragment,{children:[e&&n&&(0,M.jsx)(`div`,{className:`attachments-section`,children:`Image diff`}),e&&n&&(0,M.jsx)(fr,{noTargetBlank:!0,diff:{name:`Image diff`,expected:{attachment:{...e,path:Ir(t,e)},title:`Expected`},actual:{attachment:{...n,path:Ir(t,n)}},diff:r?{attachment:{...r,path:Ir(t,r)}}:void 0}})]})),r.size?(0,M.jsx)(`div`,{className:`attachments-section`,children:`Screenshots`}):void 0,[...r.values()].map((e,n)=>{let r=Fr(t,e);return(0,M.jsxs)(`div`,{className:`attachment-item`,children:[(0,M.jsx)(`div`,{children:(0,M.jsx)(`img`,{draggable:`false`,src:r})}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`a`,{target:`_blank`,href:r,rel:`noreferrer`,children:e.name})})]},`screenshot-${n}`)}),i.size?(0,M.jsx)(`div`,{className:`attachments-section`,children:`Attachments`}):void 0,[...i.values()].map((t,n)=>(0,M.jsx)(`div`,{className:`attachment-item`,children:(0,M.jsx)(Nr,{attachment:t,reveal:e&&t.callId===e.callId?e:void 0})},Lr(t,n)))]})};function Fr(e,t){return e&&t.sha1?e.createRelativeUrl(`sha1/${t.sha1}`):`file?path=${encodeURIComponent(t.path)}`}function Ir(e,t){let n=t.contentType?`&dn=${encodeURIComponent(t.name)}`:``;return t.contentType&&(n+=`&dct=${encodeURIComponent(t.contentType)}`),Fr(e,t)+n}function Lr(e,t){return t+`-`+(e.sha1?`sha1-`+e.sha1:`path-`+e.path)}var Rr=({prompt:e})=>(0,M.jsx)(Wn,{value:e,description:`Copy prompt`,copiedDescription:(0,M.jsxs)(M.Fragment,{children:[`Copied `,(0,M.jsx)(`span`,{className:`codicon codicon-copy`,style:{marginLeft:`5px`}})]}),style:{width:`120px`,justifyContent:`center`}});function zr(e){return T.useMemo(()=>{if(!e)return{errors:new Map};let t=new Map;for(let n of e.errorDescriptors)t.set(n.message,n);return{errors:t}},[e])}function Br({message:e,error:t,sdkLanguage:n,revealInSource:r}){let i,a,o=t.stack?.[0];return o&&(i=o.file.replace(/.*[/\\](.*)/,`$1`)+`:`+o.line,a=o.file+`:`+o.line),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,overflowX:`clip`},children:[(0,M.jsxs)(`div`,{className:`hbox`,style:{alignItems:`center`,padding:`5px 10px`,minHeight:36,fontWeight:`bold`,color:`var(--vscode-errorForeground)`,flex:0},children:[t.action&&Vn(t.action,{sdkLanguage:n}),i&&(0,M.jsxs)(`div`,{className:`action-location`,children:[`@ `,(0,M.jsx)(`span`,{title:a,onClick:()=>r(t),children:i})]})]}),(0,M.jsx)(or,{error:e})]})}var Vr=({errorsModel:e,sdkLanguage:t,revealInSource:n,wallTime:r,testRunMetadata:i})=>{let a=Mr(),o=te(async()=>{let e=a?.attachments.find(e=>e.name===`error-context`);if(!e)return;let t=await fetch(Fr(a,e)).then(e=>e.text());if(t)return i?.gitDiff&&(t+=`
|
|||
|
|
|
|||
|
|
# Local changes
|
|||
|
|
|
|||
|
|
\`\`\`diff
|
|||
|
|
`+i.gitDiff+"\n```"),t},[a,i],void 0);return e.errors.size?(0,M.jsxs)(`div`,{className:`fill`,style:{overflow:`auto`},children:[(0,M.jsx)(`span`,{style:{position:`absolute`,right:`5px`,top:`5px`,zIndex:1},children:o&&(0,M.jsx)(Rr,{prompt:o})}),[...e.errors.entries()].map(([e,i])=>{let a=`error-${r}-${e}`;return(0,M.jsx)(Br,{message:e,error:i,revealInSource:n,sdkLanguage:t},a)})]}):(0,M.jsx)(Gn,{text:`No errors`})},Hr=Qn,Ur={log:{bg:`var(--vscode-editor-background)`,fg:`var(--vscode-editor-foreground)`},warning:{fg:`var(--vscode-list-warningForeground)`,bg:`var(--vscode-inputValidation-warningBackground)`},error:{fg:`var(--vscode-list-errorForeground)`,bg:`var(--vscode-inputValidation-errorBackground)`}};function Wr(e,t,n){let{entries:r}=T.useMemo(()=>{if(!e)return{entries:[]};let t=t=>t&&e.pagerefToTitle.get(t)||``,r=[];function i(e){let t=r[r.length-1];t&&e.browserMessage?.bodyString===t.browserMessage?.bodyString&&e.browserMessage?.location===t.browserMessage?.location&&e.browserError===t.browserError&&e.nodeMessage?.html===t.nodeMessage?.html&&e.isError===t.isError&&e.isWarning===t.isWarning&&e.pageId===t.pageId&&e.timestamp-t.timestamp<1e3?t.repeat++:r.push({...e,repeat:1})}let a=[...e.events,...e.stdio].sort((e,t)=>(`time`in e?e.time:e.timestamp)-(`time`in t?t.time:t.timestamp));for(let e of a){if(e.type===`console`){if(n&&e.pageId!==n)continue;let r=e.messageType===`error`?Ur.error:e.messageType===`warning`?Ur.warning:Ur.log,a=e.args&&e.args.length?Kr(e.args,r):qr(e.text,r),o=e.location.url,s=`${o?o.substring(o.lastIndexOf(`/`)+1):`<anonymous>`}:${e.location.lineNumber}`;i({browserMessage:{body:a,bodyString:e.text,location:s},isError:e.messageType===`error`,isWarning:e.messageType===`warning`,pageId:t(e.pageId),timestamp:e.time})}if(e.type===`event`&&e.method===`pageError`){if(n&&e.pageId!==n)continue;i({browserError:e.params.error,isError:!0,isWarning:!1,pageId:t(e.pageId),timestamp:e.time})}if(e.type===`stderr`||e.type===`stdout`){let t=``,n=e.type===`stderr`?Ur.error:Ur.log;e.text&&(t=tr(e.text.trim(),n)||``),e.base64&&(t=tr(atob(e.base64).trim(),n)||``),i({nodeMessage:{html:t},isError:e.type===`stderr`,isWarning:!1,pageId:``,timestamp:e.timestamp})}}return{entries:r}},[e,n]),i=T.useMemo(()=>t?r.filter(e=>e.timestamp>=t.minimum&&e.timestamp<=t.maximum):r,[r,t]),a=T.useMemo(()=>new Set(i.map(e=>e.pageId).filter(Boolean)).size>1,[i]);return{entries:i,hasMultiplePages:a,showSource:T.useMemo(()=>a||i.some(e=>!e.browserMessage&&!e.browserError),[i,a])}}var Gr=({consoleModel:e,boundaries:t,onEntryHovered:n,onAccepted:r})=>e.entries.length?(0,M.jsx)(`div`,{className:`console-tab`,children:(0,M.jsx)(Hr,{name:`console`,onAccepted:r,onHighlighted:e=>n?.(e?{minimum:e.timestamp,maximum:e.timestamp}:void 0),items:e.entries,isError:e=>e.isError,isWarning:e=>e.isWarning,render:n=>{let r=(0,M.jsx)(`span`,{className:`console-time`,children:st(n.timestamp-t.minimum)}),i=!!(n.browserMessage||n.browserError),a=i?e.hasMultiplePages&&n.pageId||`page`:`test`,o=e.showSource?(0,M.jsx)(`span`,{className:`console-source`,title:i?`Browser message`:`Runner message`,children:a}):void 0,s,c,l,u,{browserMessage:d,browserError:f,nodeMessage:p}=n;if(d&&(s=d.location,c=d.body),f){let{error:e,value:t}=f;e?(c=e.message,u=e.stack):c=String(t)}return p&&(l=p.html),(0,M.jsxs)(`div`,{className:`console-line`,children:[r,o,s&&(0,M.jsx)(`span`,{className:`console-location`,children:s}),n.repeat>1&&(0,M.jsx)(`span`,{className:`console-repeat`,children:n.repeat}),c&&(0,M.jsx)(`span`,{className:`console-line-message`,children:c}),l&&(0,M.jsx)(`span`,{className:`console-line-message`,dangerouslySetInnerHTML:{__html:l}}),u&&(0,M.jsx)(`div`,{className:`console-stack`,children:u})]})}})}):(0,M.jsx)(Gn,{text:`No console entries`});function Kr(e,t){if(e.length===1)return qr(e[0].preview,t);let n=typeof e[0].value==`string`&&e[0].value.includes(`%`),r=n?e[0].value:``,i=n?e.slice(1):e,a=0,o=/%([%sdifoOc])/g,s,c=[],l=[];c.push((0,M.jsx)(`span`,{children:l},c.length+1));let u=0;for(;(s=o.exec(r))!==null;){let e=r.substring(u,s.index);l.push((0,M.jsx)(`span`,{childre
|
|||
|
|
|
|||
|
|
`)+`^"`}function o(e){function t(e){let t=e.charCodeAt(0).toString(16);for(;t.length<4;)t=`0`+t;return`\\u`+t}return/[\0-\x1F\x7F-\x9F!]|\'/.test(e)?`$'`+e.replace(/\\/g,`\\\\`).replace(/\'/g,`\\'`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\0-\x1F\x7F-\x9F!]/g,t)+`'`:`'`+e+`'`}let s=n===`win`?a:o;r.push(s(t.request.url).replace(/[[{}\]]/g,`\\$&`));let c=`GET`,l=[],u=await ti(e,t);u&&(l.push(`--data-raw `+s(u)),i.add(`content-length`),c=`POST`),t.request.method!==c&&r.push(`-X `+s(t.request.method));let d=t.request.headers;for(let e=0;e<d.length;e++){let t=d[e],n=t.name.replace(/^:/,``);if(i.has(n.toLowerCase()))continue;let a=t.value;a.trim()?n.toLowerCase()===`cookie`?r.push(`-b `+s(a)):r.push(`-H `+s(n+`: `+a)):r.push(`-H `+s(n+`;`))}return r=r.concat(l),`curl `+r.join(r.length>=3?n===`win`?` ^
|
|||
|
|
`:` \\
|
|||
|
|
`:` `)}async function ei(e,t,n=0){let r=new Set([`method`,`path`,`scheme`,`version`,`accept-charset`,`accept-encoding`,`access-control-request-headers`,`access-control-request-method`,`connection`,`content-length`,`cookie`,`cookie2`,`date`,`dnt`,`expect`,`host`,`keep-alive`,`origin`,`referer`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`via`,`user-agent`]),i=new Set([`cookie`,`authorization`]),a=JSON.stringify(t.request.url),o=t.request.headers,s=o.reduce((e,t)=>{let n=t.name;return!r.has(n.toLowerCase())&&!n.includes(`:`)&&e.append(n,t.value),e},new Headers),c={};for(let e of s)c[e[0]]=e[1];let l=t.request.cookies.length||o.some(({name:e})=>i.has(e.toLowerCase()))?`include`:`omit`,u=o.find(({name:e})=>e.toLowerCase()===`referer`),d=u?u.value:void 0,f=await ti(e,t),p={headers:Object.keys(c).length?c:void 0,referrer:d,body:f,method:t.request.method,mode:`cors`};if(n===1){let e=o.find(e=>e.name.toLowerCase()===`cookie`),t={};delete p.mode,e&&(t.cookie=e.value),d&&(delete p.referrer,t.Referer=d),Object.keys(t).length&&(p.headers={...c,...t})}else p.credentials=l;return`fetch(${a}, ${JSON.stringify(p,null,2)});`}async function ti(e,t){return e&&t.request.postData?._sha1?await fetch(e.createRelativeUrl(`sha1/${t.request.postData._sha1}`)).then(e=>e.text()):t.request.postData?.text}var ni=class{generatePlaywrightRequestCall(e,t){let n=e.method.toLowerCase(),r=new URL(e.url),i=`${r.origin}${r.pathname}`,a={};[`delete`,`get`,`head`,`post`,`put`,`patch`].includes(n)||(a.method=n,n=`fetch`),r.searchParams.size&&(a.params=Object.fromEntries(r.searchParams.entries())),t&&(a.data=t),e.headers.length&&(a.headers=Object.fromEntries(e.headers.map(e=>[e.name,e.value])));let o=[`'${i}'`];return Object.keys(a).length>0&&o.push(this.prettyPrintObject(a)),`await page.request.${n}(${o.join(`, `)});`}prettyPrintObject(e,t=2,n=0){if(e===null)return`null`;if(e===void 0)return`undefined`;if(typeof e!=`object`)return typeof e==`string`?this.stringLiteral(e):String(e);if(Array.isArray(e)){if(e.length===0)return`[]`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`[\n${e.map(e=>`${i}${this.prettyPrintObject(e,t,n+1)}`).join(`,
|
|||
|
|
`)}\n${r}]`}if(Object.keys(e).length===0)return`{}`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`{\n${Object.entries(e).map(([e,r])=>{let a=this.prettyPrintObject(r,t,n+1);return`${i}${/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)?e:this.stringLiteral(e)}: ${a}`}).join(`,
|
|||
|
|
`)}\n${r}}`}stringLiteral(e){return e=e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`),e.includes(`
|
|||
|
|
`)||e.includes(`\r`)||e.includes(` `)?"`"+e+"`":`'${e}'`}},ri=class{generatePlaywrightRequestCall(e,t){let n=new URL(e.url),r=[`"${`${n.origin}${n.pathname}`}"`],i=e.method.toLowerCase();[`delete`,`get`,`head`,`post`,`put`,`patch`].includes(i)||(r.push(`method="${i}"`),i=`fetch`),n.searchParams.size&&r.push(`params=${this.prettyPrintObject(Object.fromEntries(n.searchParams.entries()))}`),t&&r.push(`data=${this.prettyPrintObject(t)}`),e.headers.length&&r.push(`headers=${this.prettyPrintObject(Object.fromEntries(e.headers.map(e=>[e.name,e.value])))}`);let a=r.length===1?r[0]:`\n${r.map(e=>this.indent(e,2)).join(`,
|
|||
|
|
`)}\n`;return`await page.request.${i}(${a})`}indent(e,t){return e.split(`
|
|||
|
|
`).map(e=>` `.repeat(t)+e).join(`
|
|||
|
|
`)}prettyPrintObject(e,t=2,n=0){if(e==null)return`None`;if(typeof e!=`object`)return typeof e==`string`?this.stringLiteral(e):typeof e==`boolean`?e?`True`:`False`:String(e);if(Array.isArray(e)){if(e.length===0)return`[]`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`[\n${e.map(e=>`${i}${this.prettyPrintObject(e,t,n+1)}`).join(`,
|
|||
|
|
`)}\n${r}]`}if(Object.keys(e).length===0)return`{}`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`{\n${Object.entries(e).map(([e,r])=>{let a=this.prettyPrintObject(r,t,n+1);return`${i}${this.stringLiteral(e)}: ${a}`}).join(`,
|
|||
|
|
`)}\n${r}}`}stringLiteral(e){return JSON.stringify(e)}},ii=class{generatePlaywrightRequestCall(e,t){let n=new URL(e.url),r=`${n.origin}${n.pathname}`,i={},a=[],o=e.method.toLowerCase();[`delete`,`get`,`head`,`post`,`put`,`patch`].includes(o)||(i.Method=o,o=`fetch`),n.searchParams.size&&(i.Params=Object.fromEntries(n.searchParams.entries())),t&&(i.Data=t),e.headers.length&&(i.Headers=Object.fromEntries(e.headers.map(e=>[e.name,e.value])));let s=[`"${r}"`];return Object.keys(i).length>0&&s.push(this.prettyPrintObject(i)),`${a.join(`
|
|||
|
|
`)}${a.length?`
|
|||
|
|
`:``}await request.${this.toFunctionName(o)}(${s.join(`, `)});`}toFunctionName(e){return e[0].toUpperCase()+e.slice(1)+`Async`}prettyPrintObject(e,t=2,n=0){if(e==null)return`null`;if(typeof e!=`object`)return typeof e==`string`?this.stringLiteral(e):typeof e==`boolean`?e?`true`:`false`:String(e);if(Array.isArray(e)){if(e.length===0)return`new object[] {}`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`new object[] {\n${e.map(e=>`${i}${this.prettyPrintObject(e,t,n+1)}`).join(`,
|
|||
|
|
`)}\n${r}}`}if(Object.keys(e).length===0)return`new {}`;let r=` `.repeat(n*t),i=` `.repeat((n+1)*t);return`new() {\n${Object.entries(e).map(([e,r])=>{let a=this.prettyPrintObject(r,t,n+1);return`${i}${n===0?e:`[${this.stringLiteral(e)}]`} = ${a}`}).join(`,
|
|||
|
|
`)}\n${r}}`}stringLiteral(e){return JSON.stringify(e)}},ai=class{generatePlaywrightRequestCall(e,t){let n=new URL(e.url),r=[`"${n.origin}${n.pathname}"`],i=[],a=e.method.toLowerCase();[`delete`,`get`,`head`,`post`,`put`,`patch`].includes(a)||(i.push(`setMethod("${a}")`),a=`fetch`);for(let[e,t]of n.searchParams)i.push(`setQueryParam(${this.stringLiteral(e)}, ${this.stringLiteral(t)})`);t&&i.push(`setData(${this.stringLiteral(t)})`);for(let t of e.headers)i.push(`setHeader(${this.stringLiteral(t.name)}, ${this.stringLiteral(t.value)})`);return i.length>0&&r.push(`RequestOptions.create()\n .${i.join(`
|
|||
|
|
.`)}\n`),`request.${a}(${r.join(`, `)});`}stringLiteral(e){return JSON.stringify(e)}};function oi(e){if(e===`javascript`)return new ni;if(e===`python`)return new ri;if(e===`csharp`)return new ii;if(e===`java`)return new ai;throw Error(`Unsupported language: `+e)}var si=({resource:e,sdkLanguage:t,startTimeOffset:n,onClose:r})=>{let[i,a]=T.useState(`headers`),o=Mr(),s=te(async()=>{if(o&&e.request.postData){let t=e.request.headers.find(e=>e.name.toLowerCase()===`content-type`),n=t?t.value:``;return e.request.postData._sha1?{text:await(await fetch(o.createRelativeUrl(`sha1/${e.request.postData._sha1}`))).text(),mimeType:n}:{text:e.request.postData.text,mimeType:n}}else return null},[e],null);return(0,M.jsx)(Zr,{leftToolbar:[(0,M.jsx)(Fn,{icon:`close`,title:`Close`,onClick:r},`close`)],rightToolbar:[(0,M.jsx)(ci,{requestBody:s,resource:e,sdkLanguage:t},`dropdown`)],tabs:[{id:`headers`,title:`Headers`,render:()=>(0,M.jsx)(di,{resource:e,startTimeOffset:n})},{id:`payload`,title:`Payload`,render:()=>(0,M.jsx)(fi,{resource:e,requestBody:s})},{id:`response`,title:`Response`,render:()=>(0,M.jsx)(pi,{resource:e})}],selectedTab:i,setSelectedTab:a})},ci=({resource:e,sdkLanguage:t,requestBody:n})=>{let r=Mr(),i=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`codicon codicon-check`,style:{marginRight:`5px`}}),` Copied `]});return(0,M.jsxs)(`div`,{className:`copy-request-dropdown`,children:[(0,M.jsxs)(Fn,{className:`copy-request-dropdown-toggle`,children:[(0,M.jsx)(`span`,{className:`codicon codicon-copy`,style:{marginRight:`5px`}}),`Copy request`,(0,M.jsx)(`span`,{className:`codicon codicon-chevron-down`,style:{marginLeft:`5px`}})]}),(0,M.jsxs)(`div`,{className:`copy-request-dropdown-menu`,children:[(0,M.jsx)(Wn,{description:`Copy as cURL`,copiedDescription:i,value:()=>$r(r,e)}),(0,M.jsx)(Wn,{description:`Copy as Fetch`,copiedDescription:i,value:()=>ei(r,e)}),(0,M.jsx)(Wn,{description:`Copy as Playwright`,copiedDescription:i,value:async()=>oi(t).generatePlaywrightRequestCall(e.request,n?.text)})]})]})},li=({toggled:e,error:t,onToggle:n})=>(0,M.jsx)(Fn,{icon:`json`,title:`Pretty print`,toggled:e,errorBadge:t?`Formatting failed`:void 0,onClick:e=>{e.stopPropagation(),n()}}),ui=({title:e,data:t,showCount:n,children:r,titleChildren:i,className:a})=>{let[o,s]=ae(`trace-viewer-network-details-${e.replaceAll(` `,`-`)}`,!0);return(0,M.jsxs)(Or,{expanded:o,setExpanded:s,expandOnTitleClick:!0,title:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`span`,{className:`network-request-details-header`,children:[e,n&&(0,M.jsxs)(`span`,{className:`network-request-details-header-count`,children:[` × `,t?.length??0]})]}),i]}),className:a,children:[t&&(0,M.jsx)(`table`,{className:`network-request-details-table`,children:(0,M.jsx)(`tbody`,{children:t.map(({name:e,value:t},n)=>t!==null&&(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:e}),(0,M.jsx)(`td`,{children:t})]},n))})}),r]})},di=({resource:e,startTimeOffset:t})=>(0,M.jsxs)(`div`,{className:`vbox network-request-details-tab`,children:[(0,M.jsx)(ui,{title:`General`,data:T.useMemo(()=>Object.entries({URL:e.request.url,Method:e.request.method,"Status Code":e.response.status===-1?`canceled`:e.response.status>0&&(0,M.jsxs)(`span`,{className:Ci(e.response.status),children:[` `,e.response.status,` `,e.response.statusText]}),Start:st(t),Duration:st(e.time)}).map(([e,t])=>({name:e,value:t})),[e,t])}),(0,M.jsx)(ui,{title:`Request Headers`,showCount:!0,data:e.request.headers}),(0,M.jsx)(ui,{title:`Response Headers`,showCount:!0,data:e.response.headers})]}),fi=({resource:e,requestBody:t})=>{let[n,r]=ae(`trace-viewer-network-details-show-formatted-payload`,!0),i=e.request.queryString.length>0,a=!!(t||e.request.postData),o=Di(t,n);return(0,M.jsxs)(`div`,{className:`vbox network-request-details-tab`,children:[!i&&!a&&(0,M.jsx)(`em`,{className:`network-request-no-payload`,children:`No payload for this request.`}),i&&(0,M.jsx)(ui,{title:`Query String Parameters`,showCount:!0,data:e.request.queryString}),t&&(0,M.jsx)(ui,{title:`Request Body`,className:`network-request-request-body`,titleChildren:(0,M.jsx
|
|||
|
|
`).filter(Boolean).map(e=>JSON.parse(e)).map((e,t)=>({...e,index:t,byteLength:xi(e)})):[]}catch{return[]}return[]},[e,t],void 0),[r,i]=T.useState(void 0),a=r===void 0?void 0:n?.[r],o=T.useMemo(()=>{if(n){for(let e of n)if(e.time>0)return e.time}},[n]);if(n===void 0)return(0,M.jsx)(Gn,{text:`Loading...`});if(n.length===0)return(0,M.jsx)(Gn,{text:`No messages captured`});let s=(0,M.jsx)(_i,{name:`network-websocket-messages`,ariaLabel:`WebSocket messages`,items:n,id:e=>String(e.index),selectedItem:a,onSelected:e=>i(e.index),render:e=>yi(e,o)});return a?(0,M.jsx)(ot,{sidebarSize:200,orientation:`vertical`,sidebarIsFirst:!1,settingName:`networkWebSocketMessageDetails`,main:s,sidebar:(0,M.jsx)(vi,{message:a})}):s},_i=Qn,vi=({message:e})=>{let[t,n]=ae(`trace-viewer-network-details-show-formatted-message`,!0),r=T.useMemo(()=>{if(e.opcode===1){let t=e.data,n;try{JSON.parse(t),n=`application/json`}catch{n=`text/plain`}return{text:t,mimeType:n}}if(e.opcode===8||e.opcode===9||e.opcode===10){if(!e.data)return{text:``};try{return{text:ki(e.data),mimeType:`text/plain`}}catch{return{text:Ai(e.data)}}}return{text:Ai(e.data)}},[e]),i=Di(r,t);return(0,M.jsxs)(`div`,{className:`vbox network-websocket-message-detail`,children:[(0,M.jsxs)(Xr,{noShadow:!0,noMinHeight:!0,className:`network-websocket-message-detail-toolbar`,children:[(0,M.jsxs)(`span`,{className:`network-websocket-message-detail-summary`,children:[e.type===`send`?`Sent`:`Received`,` · `,bi(e.opcode),` · `,ct(xi(e))]}),(0,M.jsx)(`div`,{style:{margin:`auto`}}),(0,M.jsx)(li,{toggled:t,error:i.error,onToggle:()=>n(!t)})]}),(0,M.jsx)(`div`,{className:`vbox network-websocket-message-detail-body`,children:(0,M.jsx)(yr,{text:i.text,mimeType:r.mimeType,readOnly:!0,lineNumbers:!0})})]})};function yi(e,t){let n=e.type===`send`?`codicon-arrow-up`:`codicon-arrow-down`,r=e.type===`send`?`Sent`:`Received`,i=bi(e.opcode),a=e.time>0&&t!==void 0?st(e.time-t):`-`,o=Si(e);return(0,M.jsxs)(`div`,{className:`network-websocket-message-row`,children:[(0,M.jsx)(`span`,{className:`network-websocket-message-direction-${e.type} codicon ${n}`,title:r}),(0,M.jsx)(`span`,{className:`network-websocket-message-preview`,title:o,children:o}),(0,M.jsx)(`span`,{className:`network-websocket-message-opcode`,title:`Opcode ${e.opcode}`,children:i}),(0,M.jsx)(`span`,{className:`network-websocket-message-length`,title:`${e.byteLength} bytes`,children:ct(e.byteLength)}),(0,M.jsx)(`span`,{className:`network-websocket-message-time`,children:a})]})}function bi(e){switch(e){case 0:return`Continuation`;case 1:return`Text`;case 2:return`Binary`;case 8:return`Close`;case 9:return`Ping`;case 10:return`Pong`;default:return`Opcode ${e}`}}function xi(e){return e.opcode===1?new TextEncoder().encode(e.data).length:Oi(e.data)}function Si(e){if(e.opcode===1){let t=e.data.replace(/\s+/g,` `);return t.length>200?t.substring(0,200)+`…`:t}return e.opcode===8?`(close)`:e.opcode===9?`(ping)`:e.opcode===10?`(pong)`:`(binary, ${ct(Oi(e.data))})`}function Ci(e){return e<300||e===304?`green-circle`:e<400?`yellow-circle`:`red-circle`}var wi=/<[^>]+>[^<]*<\//;function Ti(e,t=` `){let n=0,r=[],i=e.replace(/>\s*</g,`>
|
|||
|
|
<`).split(`
|
|||
|
|
`);for(let e of i){let i=e.trim();i&&(i.startsWith(`</`)?(n=Math.max(n-1,0),r.push(t.repeat(n)+i)):i.endsWith(`/>`)||i.startsWith(`<?`)||wi.test(i)?r.push(t.repeat(n)+i):i.startsWith(`<`)?(r.push(t.repeat(n)+i),n++):r.push(t.repeat(n)+i))}return r.join(`
|
|||
|
|
`)}function Ei(e,t){return!e.trim()||!t?e:Tr(t)?JSON.stringify(JSON.parse(e),null,2):Er(t)?Ti(e):t.includes(`application/x-www-form-urlencoded`)?decodeURIComponent(e):e}var Di=(e,t)=>T.useMemo(()=>{if(e?.text===void 0)return{text:``};if(!t)return{text:e.text};try{return{text:Ei(e.text,e.mimeType)}}catch{return{text:e.text,error:!0}}},[e,t]);function Oi(e){if(!e)return 0;let t=e[e.length-2]===`=`?2:+(e[e.length-1]===`=`);return Math.max(0,Math.floor(e.length*3/4)-t)}function ki(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return new TextDecoder(`utf-8`,{fatal:!1}).decode(n)}function Ai(e){if(!e)return``;let t=atob(e),n=[];for(let e=0;e<t.length;e+=16){let r=Math.min(16,t.length-e),i=[],a=[];for(let n=0;n<16;++n){if(n<r){let r=t.charCodeAt(e+n);i.push(r.toString(16).padStart(2,`0`)),a.push(r>=32&&r<127?t[e+n]:`.`)}else i.push(` `);n===7&&i.push(``)}n.push(`${e.toString(16).padStart(8,`0`)} ${i.join(` `)} ${a.join(``)}`)}return n.join(`
|
|||
|
|
`)}function ji(e){let[t,n]=T.useState([]);T.useEffect(()=>{let t=[];for(let n=0;n<e.columns.length-1;++n){let r=e.columns[n];t[n]=(t[n-1]||0)+e.columnWidths.get(r)}n(t)},[e.columns,e.columnWidths]);function r(t){let n=new Map(e.columnWidths.entries());for(let r=0;r<t.length;++r){let i=t[r]-(t[r-1]||0),a=e.columns[r];n.set(a,i)}e.setColumnWidths(n)}let i=T.useCallback(t=>{e.setSorting?.({by:t,negate:e.sorting?.by===t?!e.sorting.negate:!1})},[e]);return(0,M.jsxs)(`div`,{className:`grid-view ${e.name}-grid-view`,children:[(0,M.jsx)(lr,{orientation:`horizontal`,offsets:t,setOffsets:r,resizerColor:`var(--vscode-panel-border)`,resizerWidth:1,minColumnWidth:25}),(0,M.jsxs)(`div`,{className:`vbox`,children:[(0,M.jsx)(`div`,{className:`grid-view-header`,children:e.columns.map((t,n)=>(0,M.jsxs)(`div`,{className:`grid-view-header-cell `+Mi(t,e.sorting),style:{width:n<e.columns.length-1?e.columnWidths.get(t):void 0},onClick:()=>e.setSorting&&i(t),children:[(0,M.jsx)(`span`,{className:`grid-view-header-cell-title`,children:e.columnTitle(t)}),(0,M.jsx)(`span`,{className:`codicon codicon-triangle-up`}),(0,M.jsx)(`span`,{className:`codicon codicon-triangle-down`})]},e.columnTitle(t)))}),(0,M.jsx)(Qn,{name:e.name,items:e.items,ariaLabel:e.ariaLabel,id:e.id,render:(t,n)=>(0,M.jsx)(M.Fragment,{children:e.columns.map((r,i)=>{let{body:a,title:o}=e.render(t,r,n);return(0,M.jsx)(`div`,{className:`grid-view-cell grid-view-column-${String(r)}`,title:o,style:{width:i<e.columns.length-1?e.columnWidths.get(r):void 0},children:a},e.columnTitle(r))})}),icon:e.icon,isError:e.isError,isWarning:e.isWarning,isInfo:e.isInfo,selectedItem:e.selectedItem,onAccepted:e.onAccepted,onSelected:e.onSelected,onHighlighted:e.onHighlighted,onIconClicked:e.onIconClicked,noItemsMessage:e.noItemsMessage,dataTestId:e.dataTestId,notSelectable:e.notSelectable})]})]})}function Mi(e,t){return e===t?.by?` filter-`+(t.negate?`negative`:`positive`):``}var Ni=[`Fetch`,`HTML`,`JS`,`CSS`,`Font`,`Image`,`WS`],Pi={searchValue:``,resourceTypes:new Set},Fi=({filterState:e,onFilterStateChange:t})=>(0,M.jsxs)(`div`,{className:`network-filters`,children:[(0,M.jsx)(`input`,{type:`search`,placeholder:`Filter network`,spellCheck:!1,value:e.searchValue,onChange:n=>t({...e,searchValue:n.target.value})}),(0,M.jsxs)(`div`,{className:`network-filters-resource-types`,role:`tablist`,"aria-multiselectable":`true`,children:[(0,M.jsx)(`button`,{title:`All`,onClick:()=>t({...e,resourceTypes:new Set}),className:`network-filters-resource-type ${e.resourceTypes.size===0?`selected`:``}`,role:`tab`,"aria-selected":e.resourceTypes.size===0,children:`All`}),Ni.map(n=>(0,M.jsx)(`button`,{title:n,onClick:r=>{let i;i=r.ctrlKey||r.metaKey?e.resourceTypes.symmetricDifference(new Set([n])):new Set([n]),t({...e,resourceTypes:i})},className:`network-filters-resource-type ${e.resourceTypes.has(n)?`selected`:``}`,role:`tab`,"aria-selected":e.resourceTypes.has(n),children:n},n))]})]}),Ii=ji;function Li(e,t,n){return{resources:T.useMemo(()=>(e?.resources||[]).filter(e=>n&&e.pageref!==n?!1:t?!!e._monotonicTime&&e._monotonicTime>=t.minimum&&e._monotonicTime<=t.maximum:!0),[e,t,n]),model:e}}var Ri=({boundaries:e,networkModel:t,onResourceHovered:n,sdkLanguage:r})=>{let[i,a]=T.useState(void 0),[o,s]=T.useState(void 0),[c,l]=T.useState(Pi),{renderedEntries:u,multipleContexts:d}=T.useMemo(()=>{let n=t.resources.map(n=>Wi(n,e,t.model)).filter(Xi(c));return i&&qi(n,i),{renderedEntries:n,multipleContexts:new Set(n.map(e=>e.contextId).filter(Boolean)).size>1}},[t.resources,t.model,c,i,e]),f=T.useMemo(()=>o?u.find(e=>e.resource.id===o):void 0,[o,u]),[p,m]=T.useState(()=>new Map(Vi().map(e=>[e,Bi(e)]))),h=T.useCallback(e=>{l(e),s(void 0)},[]);if(!t.resources.length)return(0,M.jsx)(Gn,{text:`No network calls`});let g=(0,M.jsx)(Ii,{name:`network`,ariaLabel:`Network requests`,items:u,selectedItem:f,onSelected:e=>s(e.resource.id),onHighlighted:e=>n?.(e?Gi(e.resource):void 0),columns:N(!!f,d),columnTitle:zi,columnWidths:p,setColumnWidths:m,isError:e=>e.status.code>=400||e.status.code===-1,isInfo:e=>!!e.route,render:(e,t)=>Hi(e,t),sortin
|
|||
|
|
|
|||
|
|
`+t.value+`
|
|||
|
|
`+` `.repeat(e.pos)+`^
|
|||
|
|
`;return r.push({message:i,range:[n.lineCounter.linePos(t.range[0]),n.lineCounter.linePos(t.range[0]+e.pos)]}),null}throw e}}constructor(e){this._input=e,this._pos=0,this._length=e.length}_peek(){return this._input[this._pos]||``}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(e){this._eof()&&this._throwError(`Unexpected end of input when expecting ${e}`);let t=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(t,this._pos)}_readString(){let e=``,t=!1;for(;!this._eof();){let n=this._next();if(t)e+=n,t=!1;else if(n===`\\`)t=!0;else if(n===`"`)return e;else e+=n}this._throwError(`Unterminated string`)}_throwError(e,t=0){throw new ra(e,t||this._pos)}_readRegex(){let e=``,t=!1,n=!1;for(;!this._eof();){let r=this._next();if(t)e+=r,t=!1;else if(r===`\\`)t=!0,e+=r;else if(r===`/`&&!n)return{pattern:e};else r===`[`?(n=!0,e+=r):r===`]`&&n?(e+=r,n=!1):e+=r}this._throwError(`Unterminated regex`)}_readStringOrRegex(){let e=this._peek();return e===`"`?(this._next(),ea(this._readString())):e===`/`?(this._next(),this._readRegex()):null}_readAttributes(e){let t=this._pos;for(;this._skipWhitespace(),this._peek()===`[`;){this._next(),this._skipWhitespace(),t=this._pos;let n=this._readIdentifier(`attribute`);this._skipWhitespace();let r=``;if(this._peek()===`=`)for(this._next(),this._skipWhitespace(),t=this._pos;this._peek()!==`]`&&!this._isWhitespace()&&!this._eof();)r+=this._next();this._skipWhitespace(),this._peek()!==`]`&&this._throwError(`Expected ]`),this._next(),this._applyAttribute(e,n,r||`true`,t)}}_parse(){this._skipWhitespace();let e=this._readIdentifier(`role`);this._skipWhitespace();let t={kind:`role`,role:e,name:this._readStringOrRegex()||``};return this._readAttributes(t),this._skipWhitespace(),this._eof()||this._throwError(`Unexpected input`),t}_applyAttribute(e,t,n,r){if(t===`checked`){this._assert(n===`true`||n===`false`||n===`mixed`,`Value of "checked" attribute must be a boolean or "mixed"`,r),e.checked=n===`true`?!0:n===`false`?!1:`mixed`;return}if(t===`disabled`){this._assert(n===`true`||n===`false`,`Value of "disabled" attribute must be a boolean`,r),e.disabled=n===`true`;return}if(t===`expanded`){this._assert(n===`true`||n===`false`,`Value of "expanded" attribute must be a boolean`,r),e.expanded=n===`true`;return}if(t===`active`){this._assert(n===`true`||n===`false`,`Value of "active" attribute must be a boolean`,r),e.active=n===`true`;return}if(t===`invalid`){this._assert(n===`true`||n===`false`||n===`grammar`||n===`spelling`,`Value of "invalid" attribute must be a boolean, "grammar" or "spelling"`,r),e.invalid=n===`true`?!0:n===`false`?!1:n;return}if(t===`level`){this._assert(!isNaN(Number(n)),`Value of "level" attribute must be a number`,r),e.level=Number(n);return}if(t===`pressed`){this._assert(n===`true`||n===`false`||n===`mixed`,`Value of "pressed" attribute must be a boolean or "mixed"`,r),e.pressed=n===`true`?!0:n===`false`?!1:`mixed`;return}if(t===`selected`){this._assert(n===`true`||n===`false`,`Value of "selected" attribute must be a boolean`,r),e.selected=n===`true`;return}this._assert(!1,`Unsupported attribute [${t}]`,r)}_assert(e,t,n){e||this._throwError(t||`Assertion error`,n)}},ra=class extends Error{constructor(e,t){super(e),this.pos=t}};function ia(e,t){function n(e,t,r){let i=1,a=r+i;for(let r of e.children||[])typeof r==`string`?(i++,a++):(i+=n(r,t,a),a+=i);if(![`none`,`presentation`,`fragment`,`iframe`,`generic`].includes(e.role)&&e.name){let n=t.get(e.role);n||(n=new Map,t.set(e.role,n));let a=n.get(e.name),o=i*100-r;(!a||a.sizeAndPosition<o)&&n.set(e.name,{node:e,sizeAndPosition:o})}return i}let r=new Map;e&&n(e,r,0);let i=new Map;n(t,i,0);let a=[];for(let[e,t]of i)for(let[n,i]of t)r.get(e)?.get(n)||a.push(i);return a.sort((e,t)=>t.sizeAndPosition-e.sizeAndPosition),a[0]?.node}function aa(e,t,n){return`internal:attr=[${e}=${u(t,n?.exact||!1)}]`}function oa(e){
|
|||
|
|
`:return`\\n`;case`\r`:return`\\r`;case` `:return`\\t`;default:return`\\x`+e.charCodeAt(0).toString(16).padStart(2,`0`)}})+`"`:e}function _a(e){return!!(e.length===0||/^\s|\s$/.test(e)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(e)||/^-/.test(e)||/[\n:](\s|$)/.test(e)||/\s#/.test(e)||/[\n\r]/.test(e)||/^[&*\],?!>|@"'#%]/.test(e)||/[{}`]/.test(e)||/^\[/.test(e)||!isNaN(Number(e))||[`y`,`n`,`yes`,`no`,`true`,`false`,`on`,`off`,`null`].includes(e.toLowerCase()))}function va(e,t){ya(e,t.mode===`ai`?ka:Oa,t)}function ya(e,t,n){let r={snapshot:e,depth:-1,maxDepth:n.depth,ancestors:[],pendingContentRefs:new Set},i=(e,n)=>{let a=[],o=e=>{if(typeof e==`string`){a.push(e);return}r.depth=n+1;for(let n of t){let t=n.enter?.(e,r);if(t===`remove`)return;if(t===`unwrap`){e.children.forEach(o);return}}i(e,n+1),r.depth=n+1;for(let n of t){let t=n.exit?.(e,r);if(t===`remove`)return;if(t===`unwrap`){a.push(...e.children);return}}a.push(e)};r.ancestors.push(e),e.children.forEach(o),r.ancestors.pop(),e.children=a};for(let n of t)n.enter?.(e.root,r);i(e.root,-1),r.depth=-1;for(let n of t)n.exit?.(e.root,r)}function ba(e){return e.role===`generic`&&e.children.every(e=>typeof e==`string`)}function xa(e,t){return!!e.ref&&Zi(e)&&!t.ancestors.some(e=>!!e.ref&&Zi(e))}var Sa={name:`mergeStringChildren`,exit(e){let t=[],n=[],r=()=>{if(!n.length)return;let e=a(n.join(``));e&&t.push(e),n.length=0};for(let i of e.children)typeof i==`string`?n.push(i):(r(),t.push(i));r(),e.children=t,e.children.length===1&&e.children[0]===e.name&&(e.children=[])}},Ca={name:`unwrapSingleChildGenerics`,exit(e,t){if(!(e.role!==`generic`||e.name||e.children.length>1||!e.children.every(e=>typeof e!=`string`&&!!e.ref))&&!(!e.children.length&&xa(e,t)))return`unwrap`}},wa={name:`removeNamelessImages`,exit(e,t){if(e.role===`img`&&!e.name&&!e.children.length&&!xa(e,t))return`remove`}},Ta={name:`removeRedundantNames`,enter(e,t){if(e.ref){for(let n of t.snapshot.info.get(e.ref)?.nameFromContentRefs||[])t.pendingContentRefs.add(n);!(t.maxDepth&&t.depth>t.maxDepth)&&!ba(e)&&t.pendingContentRefs.delete(e.ref)}},exit(e,t){if(!e.ref)return;let n=t.snapshot.info.get(e.ref)?.nameFromContentRefs;if(n?.length)if(n.every(e=>!t.pendingContentRefs.has(e)))e.name=``;else for(let e of n)t.pendingContentRefs.delete(e)}},Ea={name:`removeNameRepeatingChild`,exit(e,t){let n=t.ancestors[t.ancestors.length-1];if(!n?.name||e.role!==`generic`||e.active||Object.keys(e.props).length)return;let r=e.children.length===1&&typeof e.children[0]==`string`?e.children[0]:void 0,i=e.name?e.children.length?void 0:e.name:r;if(i&&i===n.name)return e.ref&&t.pendingContentRefs.add(e.ref),`remove`}},Da={name:`inlineTextIntoGeneric`,exit(e){if(e.role!==`generic`||Object.keys(e.props).length||e.children.length!==1)return;let t=e.children[0];typeof t!=`string`&&(t.role!==`generic`||t.name||t.active||Object.keys(t.props).length||t.children.length===1&&typeof t.children[0]==`string`&&(e.children=[t.children[0]]))}},Oa=[Sa,Ca],ka=[Sa,wa,Ta,Da,Ea,Ca],Aa={};function ja(e){Aa=e}function Ma(e,t){for(;t;){if(e.contains(t))return!0;t=Fa(t)}return!1}function Na(e){if(e.parentElement)return e.parentElement;if(e.parentNode&&e.parentNode.nodeType===11&&e.parentNode.host)return e.parentNode.host}function Pa(e){let t=e;for(;t.parentNode;)t=t.parentNode;if(t.nodeType===11||t.nodeType===9)return t}function Fa(e){for(;e.parentElement;)e=e.parentElement;return Na(e)}function Ia(e,t,n){for(;e;){let r=e.closest(t);if(n&&r!==n&&r?.contains(n))return;if(r)return r;e=Fa(e)}}function La(e,t){let n=t===`::before`?Ga:t===`::after`?Ka:Wa;if(n&&n.has(e))return n.get(e);let r=e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,t):void 0;return n?.set(e,r),r}function Ra(e,t){let n=qa?.get(e);if(n!==void 0)return n;let r=za(e,t);return qa?.set(e,r),r}function za(e,t){if(t??=La(e),!t)return!0;if(Element.prototype.checkVisibility&&Aa.browserNameForWorkarounds!==`webkit`){if(!e.checkVisibility())return!1}else{let t=e.closest(`details,summary`);if(t!==e&&t?.nodeName===`DETAILS`&&!t.open)return!1}return t.visibility===
|
|||
|
|
`).replace(/[\u200b\u00ad]/g,``).replace(/\s\s*/g,` `)).join(`\xA0`).trim()}function yo(e,t){let n=[...e.querySelectorAll(t)];for(let r of vo(e,e.getAttribute(`aria-owns`)))r.matches(t)&&n.push(r),n.push(...r.querySelectorAll(t));return n}function bo(e,t){let n=t===`::before`?fs:t===`::after`?ps:ds;if(n?.has(e))return n?.get(e);let r=La(e,t),i;if(r){let n=r.content;n&&n!==`none`&&n!==`normal`&&r.display!==`none`&&r.visibility!==`hidden`&&(i=xo(e,n,!!t))}return t&&i!==void 0&&(r?.display||`inline`)!==`inline`&&(i=` `+i+` `),n&&n.set(e,i),i}function xo(e,t,n){if(!(!t||t===`none`||t===`normal`))try{let r=Tt(t).filter(e=>!(e instanceof kt)),i=r.findIndex(e=>e instanceof Yt&&e.value===`/`);if(i!==-1)r=r.slice(i+1);else if(!n)return;let a=[],o=0;for(;o<r.length;)if(r[o]instanceof tn)a.push(r[o].value),o++;else if(o+2<r.length&&r[o]instanceof Qt&&r[o].value===`attr`&&r[o+1]instanceof Zt&&r[o+2]instanceof Vt){let t=r[o+1].value;a.push(e.getAttribute(t)||``),o+=3}else return;return a.join(``)}catch{}}function So(e){let t=e.getAttribute(`aria-labelledby`);if(t===null)return null;let n=vo(e,t);return n.length?n:null}function Co(e,t){let n=[`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`tooltip`,`treeitem`].includes(e),r=t&&[``,`caption`,`code`,`contentinfo`,`definition`,`deletion`,`emphasis`,`insertion`,`list`,`listitem`,`mark`,`none`,`paragraph`,`presentation`,`region`,`row`,`rowgroup`,`section`,`strong`,`subscript`,`superscript`,`table`,`term`,`time`].includes(e);return n||r}function wo(e,t,n){if([`caption`,`code`,`definition`,`deletion`,`emphasis`,`generic`,`insertion`,`mark`,`paragraph`,`presentation`,`strong`,`subscript`,`suggestion`,`superscript`,`term`,`time`].includes(po(e)||``))return xs();let r=jo(e,{includeHidden:t,collectElements:n,visitedElements:new Set,embeddedInTargetElement:`self`});return{text:I(r.text),elements:r.elements}}function To(e,t){let n=t?is:rs,r=n?.get(e);return r===void 0&&(r=wo(e,t,!0),n?.set(e,r)),r}function Eo(e,t){let n=(t?is:rs)?.get(e);if(n!==void 0)return n.text;let r=t?os:as,i=r?.get(e);return i===void 0&&(i=wo(e,t,!1).text,r?.set(e,i)),i}function L(e,t){let n=t?cs:ss,r=n?.get(e);return r===void 0&&(r=``,r=e.hasAttribute(`aria-describedby`)?I(vo(e,e.getAttribute(`aria-describedby`)).map(e=>jo(e,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:{element:e,hidden:P(e)}}).text).join(` `)):e.hasAttribute(`aria-description`)?I(e.getAttribute(`aria-description`)||``):I(e.getAttribute(`title`)||``),n?.set(e,r)),r}var Do=[`application`,`checkbox`,`columnheader`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`rowheader`,`searchbox`,`slider`,`spinbutton`,`switch`,`textbox`,`tree`];function Oo(e){let t=e.getAttribute(`aria-invalid`);return!t||t.trim()===``||t.toLocaleLowerCase()===`false`?`false`:t===`true`||t===`grammar`||t===`spelling`?t:`true`}function ko(e){return`validity`in e?e.validity?.valid===!1:!1}function Ao(e){let t=ls,n=ls?.get(e);if(n===void 0){n=``;let r=Oo(e)!==`false`,i=ko(e);(r||i)&&(n=vo(e,e.getAttribute(`aria-errormessage`)).map(e=>I(jo(e,{visitedElements:new Set,embeddedInDescribedBy:{element:e,hidden:P(e)}}).text)).join(` `).trim()),t?.set(e,n)}return n}function jo(e,t){if(t.visitedElements.has(e))return xs();let n={...t,embeddedInTargetElement:t.embeddedInTargetElement===`self`?`descendant`:t.embeddedInTargetElement};if(!t.includeHidden){let n=!!t.embeddedInLabelledBy?.hidden||!!t.embeddedInDescribedBy?.hidden||!!t.embeddedInNativeTextAlternative?.hidden||!!t.embeddedInLabel?.hidden;if(go(e)||!n&&P(e))return t.visitedElements.add(e),xs()}let r=So(e);if(!t.embeddedInLabelledBy){let e=Ss((r||[]).map(e=>jo(e,{...t,embeddedInLabelledBy:{element:e,hidden:P(e)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})),` `,t.collectElements);if(e.text)return e}let i=po(e)||``,a=Ua(e);if(t.embeddedInLabel||t.embeddedInLabelledBy||t.embeddedInTargetElement===`descendant`){let o=[...e.labels||[]].
|
|||
|
|
`),iframeDepths:i}}function Bs(t){let n=[{regex:/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/,replacement:`[0-9a-fA-F-]+`},{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:`[\\d,.]+[bkmBKM]+`},{regex:/\b\d+[hmsp]+\b/,replacement:`\\d+[hmsp]+`},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:`[\\d,.]+[hmsp]+`},{regex:/\b\d+,\d+\b/,replacement:`\\d+,\\d+`},{regex:/\b\d+\.\d{2,}\b/,replacement:`\\d+\\.\\d+`},{regex:/\b\d{2,}\.\d+\b/,replacement:`\\d+\\.\\d+`},{regex:/\b\d{2,}\b/,replacement:`\\d+`}],r=``,i=0,a=new RegExp(n.map(e=>`(`+e.regex.source+`)`).join(`|`),`g`);return t.replace(a,(a,...o)=>{let s=o[o.length-2],c=o.slice(0,-2);r+=e(t.slice(i,s));for(let e=0;e<c.length;e++)if(c[e]){let{replacement:t}=n[e];r+=t;break}return i=s+a.length,a}),r?(r+=e(t.slice(i)),String(new RegExp(r))):t}function Vs(e,t){if(!t.length)return!1;if(!e.name)return!0;let n=t.length<=200&&e.name.length<=200?d(t,e.name):``,r=t;for(;n&&r.includes(n);)r=r.replace(n,``);return r.trim().length/t.length>.1}var Hs=Symbol(`element`);function Us(e){return e[Hs]}function Ws(e,t){e[Hs]=t}function Gs(e,t){let n=ia(e,t);return n?Us(n):void 0}var Ks=`:host{color:#333;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;font-size:13px}svg{height:0;position:absolute}x-pw-tooltip{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;flex-direction:column;max-width:600px;padding:0;font-size:12.8px;font-weight:400;line-height:1.5;display:none;position:absolute;top:0;left:0;overflow:hidden;box-shadow:0 .5rem 1.2rem #0000004d}x-pw-tooltip-line{-webkit-user-select:none;user-select:none;cursor:pointer;max-width:600px;padding:6px;display:flex}x-pw-tooltip-footer{-webkit-user-select:none;user-select:none;color:#777;max-width:600px;padding:6px;display:flex}x-pw-dialog{pointer-events:auto;z-index:10;background-color:#fff;border-radius:6px;flex-direction:column;font-size:13px;display:flex;position:absolute;box-shadow:0 .5rem 1.2rem #0000004d}x-pw-dialog:not(.autosize){width:400px;height:150px}x-pw-dialog-body{flex-direction:column;flex:auto;display:flex}x-pw-dialog-body label{flex-direction:row;align-items:center;margin:5px 8px;display:flex}x-pw-highlight{width:0;height:0;position:absolute;top:0;left:0}x-pw-action-point{z-index:2;background:red;border-radius:10px;width:20px;height:20px;margin:-10px 0 0 -10px;position:absolute}x-pw-action-cursor{pointer-events:none;z-index:4;filter:drop-shadow(0 1px 2px #0006);width:18px;height:22px;position:absolute}x-pw-action-cursor svg{width:100%;height:100%;position:static}x-pw-title{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);color:#fff;white-space:nowrap;-webkit-user-select:none;user-select:none;z-index:3;background-color:#00000080;border-radius:6px;padding:6px;font-size:24px;line-height:1.4;position:absolute}x-pw-user-overlays,x-pw-user-overlay{position:absolute;inset:0}@keyframes pw-fade-out{0%{opacity:1}to{opacity:0}}x-pw-separator{background:#949494e6;height:1px;margin:6px 9px}x-pw-tool-gripper{cursor:grab;width:24px;height:28px;margin:2px 0}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{clip-path:url(#icon-gripper);background-color:#555;width:16px;height:16px;margin:6px 4px}x-pw-tools-list>label{-webkit-user-select:none;user-select:none;align-items:center;margin:0 10px;display:flex}x-pw-tools-list{border-bottom:1px solid #ddd;width:100%;display:flex}x-pw-tool-item{pointer-events:auto;border-radius:3px;width:28px;height:28px}x-pw-tool-item:not(.disabled){cursor:pointer}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.toggled{background-color:#8acae480}x-pw-tool-item.toggled:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{background-color:#3a3a3a;width:16px;height:16px;margin:6px}x-pw-tool-item.disabled>x-div{cursor:default;background-color:#61616180}x-pw-tool-item.record.toggled{background-color:#0000}x-pw-tool-item.record.toggled:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.record.toggled>x-div{back
|
|||
|
|
(() => {
|
|||
|
|
const module = {};
|
|||
|
|
${e}
|
|||
|
|
return module.exports.default();
|
|||
|
|
})()`))(this,t)}async viewportRatio(e){return await new Promise(t=>{let n=new IntersectionObserver(e=>{t(e[0].intersectionRatio),n.disconnect()});n.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};let t=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(t.borderLeftWidth||``,10),top:parseInt(t.borderTopWidth||``,10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return`error:notconnected`;let t=e.ownerDocument.defaultView;for(let n=e;n;n=Na(n))if(t.getComputedStyle(n).transform!==`none`)return`transformed`;let n=t.getComputedStyle(e);return{left:parseInt(n.borderLeftWidth||``,10)+parseInt(n.paddingLeft||``,10),top:parseInt(n.borderTopWidth||``,10)+parseInt(n.paddingTop||``,10)}}retarget(e,t){let n=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!n)return null;if(t===`none`)return n;if(!n.matches(`input, textarea, select`)&&!n.isContentEditable&&(n=t===`button-link`?n.closest(`button, [role=button], a, [role=link]`)||n:n.closest(`button, [role=button], [role=checkbox], [role=radio]`)||n),t===`follow-label`&&!n.matches(`a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]`)&&!n.isContentEditable){let e=n.closest(`label`);e&&e.control&&(n=e.control)}return n}async checkElementStates(e,t){if(t.includes(`stable`)){let t=await this._checkElementIsStable(e);if(t===!1)return{missingState:`stable`};if(t===`error:notconnected`)return`error:notconnected`}for(let n of t)if(n!==`stable`){let t=this.elementState(e,n);if(t.received===`error:notconnected`)return`error:notconnected`;if(!t.matches)return{missingState:n}}}async _checkElementIsStable(e){let t=Symbol(`continuePolling`),n,r=0,i=0,a=()=>{let a=this.retarget(e,`no-follow-label`);if(!a)return`error:notconnected`;let o=this.utils.builtins.performance.now();if(this._stableRafCount>1&&o-i<15)return t;i=o;let s=a.getBoundingClientRect(),c={x:s.top,y:s.left,width:s.width,height:s.height};if(n){if(!(c.x===n.x&&c.y===n.y&&c.width===n.width&&c.height===n.height))return!1;if(++r>=this._stableRafCount)return!0}return n=c,t},o,s,c=new Promise((e,t)=>{o=e,s=t}),l=()=>{try{let e=a();e===t?this.utils.builtins.requestAnimationFrame(l):o(e)}catch(e){s(e)}};return this.utils.builtins.requestAnimationFrame(l),c}_createAriaRefEngine(){return{queryAll:(e,t)=>{let n=this._lastAriaSnapshotForQuery?.info?.get(t);return n&&n.element.isConnected?[n.element]:[]}}}elementState(e,t){let n=this.retarget(e,[`visible`,`hidden`].includes(t)?`none`:`follow-label`);if(!n||!n.isConnected)return t===`hidden`?{matches:!0,received:`hidden`}:{matches:!1,received:`error:notconnected`};if(t===`visible`||t===`hidden`){let e=Va(n);return{matches:t===`visible`?e:!e,received:e?`visible`:`hidden`}}if(t===`disabled`||t===`enabled`){let e=Yo(n);return{matches:t===`disabled`?e:!e,received:e?`disabled`:`enabled`}}if(t===`editable`){let e=Yo(n),t=Vo(n);if(t===`error`)throw this.createStacklessError(`Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]`);return{matches:!e&&!t,received:e?`disabled`:t?`readOnly`:`editable`}}if(t===`checked`||t===`unchecked`){let e=t===`checked`,r=Ro(n);if(r===`error`)throw this.createStacklessError(`Not a checkbox or radio button`);let i=n.nodeName===`INPUT`&&n.type===`radio`;return{matches:e===r,received:r?`checked`:`unchecked`,isRadio:i}}if(t===`indeterminate`){let e=Lo(n);if(e===`error`)throw this.createStacklessError(`Not a checkbox or radio button`);return{matches:e===`mixed`,received:e===!0?`checked`:e===!1?`unchecked`:`mixed`}}throw this.createStacklessError(`Unexpected element state "${t}"`)}selectOptions(e,t){let n=this.retarget(e,`follow-label`);if(!n)return`error:notconnected`;if(n.nodeName.toLowerCase()!==`select`)throw this.createStacklessError(`Element is not a <select> element`);let r=n,i=[...r.options],o=[],s=t.slice();for(let e=0;e<i.length;e++){let t=i[e],n=a(t.label),c=r=>{if(r inst
|
|||
|
|
`+e);return n.length<t.length&&n.push(`
|
|||
|
|
...`),this.createStacklessError(`strict mode violation: ${Cn(this._sdkLanguage,_n(e))} resolved to ${t.length} elements:${n.join(``)}\n`)}checkDeprecatedSelectorUsage(e,t){let n=new Set([`_react`,`_vue`,`xpath:light`,`text:light`,`id:light`,`data-testid:light`,`data-test-id:light`,`data-test:light`]);if(!t.length)return;let r=e.parts.find(e=>n.has(e.name));if(!r)return;let i=this._generateSelectors(t).map(e=>`
|
|||
|
|
`+e);throw i.length<t.length&&i.push(`
|
|||
|
|
...`),this.createStacklessError(`"${r.name}" selector is not supported: ${Cn(this._sdkLanguage,_n(e))} resolved to ${t.length} element${t.length===1?``:`s`}:${i.join(``)}\n`)}createStacklessError(e){let t=this._shouldPrependErrorPrefix?Error(`Error: `+e):Error(e);return this._browserName===`firefox`?(t.stack=``,t):(delete t.stack,t)}createHighlight(){return new qs(this)}addMaskedElements(e,t){this._ensureHighlight().addMaskedElements(e,t)}_ensureHighlight(){return this._highlight||(this._highlight=new qs(this),this._highlight.install()),this._highlight}addHighlight(e,t){this._ensureHighlight().addElementHighlight(e,t)}removeHighlight(e){this._ensureHighlight().removeElementHighlight(e)}setScreencastAnnotation(e){let t=this._ensureHighlight();if(!e){t.updateHighlight([]),t.hideActionPoint(),t.hideActionTitle(),t.hideActionCursor();return}let n=e.duration??500;e.box&&t.updateHighlight([{box:e.box,color:`rgba(0, 128, 255, 0.15)`,borderColor:`rgba(0, 128, 255, 0.6)`,fadeDuration:n}]),e.point&&(e.cursor!==`none`&&t.moveActionCursor(e.point.x,e.point.y,n),t.showActionPoint(e.point.x,e.point.y,n)),e.actionTitle&&t.showActionTitle(e.actionTitle,n,e.position,e.fontSize)}addUserOverlay(e,t){this._ensureHighlight().addUserOverlay(e,t)}getUserOverlay(e){return this._ensureHighlight().getUserOverlay(e)}removeUserOverlay(e){this._ensureHighlight().removeUserOverlay(e)}setUserOverlaysVisible(e){this._ensureHighlight().setUserOverlaysVisible(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e){let t=new CustomEvent(`__playwright_reset_targets__`,{bubbles:!0,cancelable:!0,composed:!0});this.document.dispatchEvent(t);let n=new CustomEvent(`__playwright_mark_target__`,{bubbles:!0,cancelable:!0,composed:!0});for(let t of e)t.dispatchEvent(n)}_setupGlobalListenersRemovalDetection(){let e=`__playwright_global_listeners_check__`,t=!1,n=()=>t=!0;this.window.addEventListener(e,n),new MutationObserver(r=>{if(r.some(e=>Array.from(e.addedNodes).includes(this.document.documentElement))&&(t=!1,this.window.dispatchEvent(new CustomEvent(e)),!t)){this.window.addEventListener(e,n);for(let e of this.onGlobalListenersRemoved)e()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){let e=e=>this._hitTargetInterceptor?.(e),t=()=>{for(let t of this._allHitTargetInterceptorEvents)this.window.addEventListener(t,e,{capture:!0,passive:!1})};t(),this.onGlobalListenersRemoved.add(t)}async expect(e,t,n){let r=t.expression===`to.have.count`||t.expression.endsWith(`.array`)?this.expectArray(n,t):await this.expectSingleElement(e,t),i=r.matches===t.isNot?this._ariaSnapshotForExpect(e,t):void 0;return r.received===void 0&&i===void 0?{matches:r.matches}:{matches:r.matches,received:{value:r.received,ariaSnapshot:i}}}_ariaSnapshotForExpect(e,t){let n=t.expression;if(!(n===`to.have.count`||n.endsWith(`.array`)||n===`to.match.aria`)){if(Va(e)&&n!==`to.have.title`&&n!==`to.have.url`){let t=n===`to.have.text`;return this.ariaSnapshotForExpectFailure(e,{mode:`default`,depth:t?void 0:1})}if(this.document.body)return this.ariaSnapshotForExpectFailure(this.document.body,{mode:`default`})}}async expectSingleElement(e,t){let n=t.expression;if(n===`to.have.title`){let e=this.document.title;return{received:e,matches:new Bl(t.expectedText[0]).matches(e)}}if(n===`to.have.url`){let e=this.document.location.href;return{received:e,matches:new Bl(t.expectedText[0]).matches(e)}}{let r;if(n===`to.have.attribute`){let n=e.hasAttribute(t.expressionArg);r={matches:n,received:n?`attribute present`:`attribute not present`}}else if(n===`to.be.checked`){let{checked:n,indeterminate:i}=t.expectedValue;if(i){if(n!==void 0)throw this.createStacklessError(`Can't assert indeterminate and checked at the same time`);r=this.elementState(e,`indeterminate`)}else r=this.elementState(e,n===!1?`unchecked`:`checked`)}else if(n===`to.be.disabled`)r=this.elementState(e,`disabled`);else if(n===`to.be.editable`)r=this.elementState(e,`editable`);else if(n===`to.be.readonly`)r=this.elementState(e,`editable`),r.matches=!r.matches;else if(n===
|
|||
|
|
body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }
|
|||
|
|
body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }
|
|||
|
|
`),this.installListeners(),e.utils.cacheNormalizedWhitespaces(),e.isUnderTest&&console.error(`Recorder script ready for test`),e.consoleApi.install()}installListeners(){tu(this._listeners),this._listeners=[q(this.document,`click`,e=>this._onClick(e),!0),q(this.document,`auxclick`,e=>this._onClick(e),!0),q(this.document,`dblclick`,e=>this._onDblClick(e),!0),q(this.document,`contextmenu`,e=>this._onContextMenu(e),!0),q(this.document,`dragstart`,e=>this._onDragStart(e),!0),q(this.document,`input`,e=>this._onInput(e),!0),q(this.document,`keydown`,e=>this._onKeyDown(e),!0),q(this.document,`keyup`,e=>this._onKeyUp(e),!0),q(this.document,`pointerdown`,e=>this._onPointerDown(e),!0),q(this.document,`pointerup`,e=>this._onPointerUp(e),!0),q(this.document,`mousedown`,e=>this._onMouseDown(e),!0),q(this.document,`mouseup`,e=>this._onMouseUp(e),!0),q(this.document,`mousemove`,e=>this._onMouseMove(e),!0),q(this.document,`mouseleave`,e=>this._onMouseLeave(e),!0),q(this.document,`mouseenter`,e=>this._onMouseEnter(e),!0),q(this.document,`focus`,e=>this._onFocus(e),!0),q(this.document,`scroll`,e=>this._onScroll(e),!0)],this.highlight.install();let e,t=()=>{this.highlight.install(),e=this.injectedScript.utils.builtins.setTimeout(t,500)};e=this.injectedScript.utils.builtins.setTimeout(t,500),this._listeners.push(()=>this.injectedScript.utils.builtins.clearTimeout(e)),this.highlight.appendChild(ru(this.document,Hl)),this.overlay?.install(),this._currentTool?.install?.(),this.document.adoptedStyleSheets.push(this._stylesheet)}_switchCurrentTool(){let e=this._tools[this.state.mode];if(e===this._currentTool)return;this._currentTool.uninstall?.(),this.clearHighlight(),this._currentTool=e,this._currentTool.install?.();let t=e.cursor?.();t&&this.injectedScript.document.body?.setAttribute(`data-pw-cursor`,t)}setUIState(e,t){this._delegate=t,e.actionPoint&&this.state.actionPoint&&e.actionPoint.x===this.state.actionPoint.x&&e.actionPoint.y===this.state.actionPoint.y||!e.actionPoint&&!this.state.actionPoint||(e.actionPoint?this.highlight.showActionPoint(e.actionPoint.x,e.actionPoint.y):this.highlight.hideActionPoint()),this.state=e,this.highlight.setLanguage(e.language),this._switchCurrentTool(),this.overlay?.setUIState(e);let n=`noop`;if(e.actionSelector!==this._lastHighlightedSelector){let t=e.actionSelector?nu(this.injectedScript,e.language,e.actionSelector,this.document):null;n=t?.length?t:`clear`,this._lastHighlightedSelector=t?.length?e.actionSelector:void 0}let r=JSON.stringify(e.ariaTemplate);if(this._lastHighlightedAriaTemplateJSON!==r){let t=e.ariaTemplate?this.injectedScript.getAllElementsMatchingExpectAriaTemplate(this.document,e.ariaTemplate):[];if(t.length){let e=t.length>1?Ul.multiple:Ul.single;n=t.map(t=>({element:t,color:e})),this._lastHighlightedAriaTemplateJSON=r}else this._lastHighlightedSelector||(n=`clear`),this._lastHighlightedAriaTemplateJSON=`undefined`}n===`clear`?this.highlight.clearHighlight():n!==`noop`&&this.highlight.updateHighlight(n)}clearHighlight(){this.updateHighlight(null,!1)}_onClick(e){e.isTrusted&&(this.overlay?.onClick(e)||this._ignoreOverlayEvent(e)||this._currentTool.onClick?.(e))}_onDblClick(e){e.isTrusted&&(this.overlay?.onDblClick(e)||this._ignoreOverlayEvent(e)||this._currentTool.onDblClick?.(e))}_onContextMenu(e){e.isTrusted&&this._currentTool.onContextMenu?.(e)}_onDragStart(e){e.isTrusted&&(this._ignoreOverlayEvent(e)||this._currentTool.onDragStart?.(e))}_onPointerDown(e){e.isTrusted&&(this._ignoreOverlayEvent(e)||this._currentTool.onPointerDown?.(e))}_onPointerUp(e){e.isTrusted&&(this._ignoreOverlayEvent(e)||this._currentTool.onPointerUp?.(e))}_onMouseDown(e){e.isTrusted&&(this._ignoreOverlayEvent(e)||this._currentTool.onMouseDown?.(e))}_onMouseUp(e){e.isTrusted&&(this.overlay?.onMouseUp(e)||this._ignoreOverlayEvent(e)||this._currentTool.onMouseUp?.(e))}_onMouseMove(e){e.isTrusted&&(this.overlay?.onMouseMove(e)||this._ignoreOverlayEvent(e)||this._currentTool.onMouseMove?.(e))}_onMouseEnter(e){e.isTrusted&&(this._ignoreOverlayEvent(e)||this._currentTool.onMouseEnter?.(e))}_onMouseLeave(e){e.isTruste
|
|||
|
|
`:e[t]===`r`?o+=`\r`:e[t]===`t`?o+=` `:o+=e[t]),++t;continue}if(e[t]!==i){o+=e[t++];continue}break}n.push({quote:i,text:o}),r+=(i===`/`?`r`:``)+`$`+n.length}r=r.toLowerCase().replace(/get_by_alt_text/g,`getbyalttext`).replace(/get_by_test_id/g,`getbytestid`).replace(/get_by_([\w]+)/g,`getby$1`).replace(/has_not_text/g,`hasnottext`).replace(/has_text/g,`hastext`).replace(/has_not/g,`hasnot`).replace(/frame_locator/g,`framelocator`).replace(/content_frame/g,`contentframe`).replace(/[{}\s]/g,``).replace(/new\(\)/g,``).replace(/new[\w]+\.[\w]+options\(\)/g,``).replace(/\.set/g,`,set`).replace(/\.or_\(/g,`or(`).replace(/\.and_\(/g,`and(`).replace(/:/g,`=`).replace(/,re\.ignorecase/g,`i`).replace(/,pattern.case_insensitive/g,`i`).replace(/,regexoptions.ignorecase/g,`i`).replace(/re.compile\(([^)]+)\)/g,`$1`).replace(/pattern.compile\(([^)]+)\)/g,`r$1`).replace(/newregex\(([^)]+)\)/g,`r$1`).replace(/string=/g,`=`).replace(/regex=/g,`=`).replace(/,,/g,`,`).replace(/,\)/g,`)`);let i=n.map(e=>e.quote).filter(e=>`'"\``.includes(e))[0];return{selector:lu(r,n,t),preferredQuote:i}}function su(e){return[...e.matchAll(/\$\d+/g)].length}function cu(e,t){return e.replace(/\$(\d+)/g,(e,n)=>`$${n-t}`)}function lu(e,t,n){for(;;){let r=e.match(/filter\(,?(has=|hasnot=|sethas\(|sethasnot\()/);if(!r)break;let i=r.index+r[0].length,a=0,o=i;for(;o<e.length&&(e[o]===`(`?a++:e[o]===`)`&&a--,!(a<0));o++);let s=e.substring(0,i),c=0;[`sethas(`,`sethasnot(`].includes(r[1])&&(c=1,s=s.replace(/sethas\($/,`has=`).replace(/sethasnot\($/,`hasnot=`));let l=su(e.substring(0,i)),u=cu(e.substring(i,o),l),d=su(u),f=t.slice(l,l+d),p=JSON.stringify(lu(u,f,n));e=s.replace(/=$/,`2=`)+`$${l+1}`+cu(e.substring(o+c),d-1);let m=t.slice(0,l),h=t.slice(l+d);t=m.concat([{quote:`"`,text:p}]).concat(h)}e=e.replace(/\,set([\w]+)\(([^)]+)\)/g,(e,t,n)=>`,`+t.toLowerCase()+`=`+n.toLowerCase()).replace(/framelocator\(([^)]+)\)/g,`$1.internal:control=enter-frame`).replace(/contentframe(\(\))?/g,`internal:control=enter-frame`).replace(/locator\(([^)]+),hastext=([^),]+)\)/g,`locator($1).internal:has-text=$2`).replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g,`locator($1).internal:has-not-text=$2`).replace(/locator\(([^)]+),hastext=([^),]+)\)/g,`locator($1).internal:has-text=$2`).replace(/locator\(([^)]+)\)/g,`$1`).replace(/getbyrole\(([^)]+)\)/g,`internal:role=$1`).replace(/getbytext\(([^)]+)\)/g,`internal:text=$1`).replace(/getbylabel\(([^)]+)\)/g,`internal:label=$1`).replace(/getbytestid\(([^)]+)\)/g,`internal:testid=[${sa(n)}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g,`internal:attr=[$1=$2]`).replace(/first(\(\))?/g,`nth=0`).replace(/last(\(\))?/g,`nth=-1`).replace(/nth\(([^)]+)\)/g,`nth=$1`).replace(/filter\(,?visible=true\)/g,`visible=true`).replace(/filter\(,?visible=false\)/g,`visible=false`).replace(/filter\(,?hastext=([^)]+)\)/g,`internal:has-text=$1`).replace(/filter\(,?hasnottext=([^)]+)\)/g,`internal:has-not-text=$1`).replace(/filter\(,?has2=([^)]+)\)/g,`internal:has=$1`).replace(/filter\(,?hasnot2=([^)]+)\)/g,`internal:has-not=$1`).replace(/,exact=false/g,``).replace(/(,name=\$\d+)(,description=\$\d+),exact=true/g,`$1s$2s`).replace(/,exact=true/g,`s`).replace(/,includehidden=/g,`,include-hidden=`).replace(/\,/g,`][`);let r=e.split(`.`);for(let e=0;e<r.length-1;e++)if(r[e]===`internal:control=enter-frame`&&r[e+1].startsWith(`nth=`)){let[t]=r.splice(e,1);r.splice(e+1,0,t)}return r.map(e=>!e.startsWith(`internal:`)||e===`internal:control`?e.replace(/\$(\d+)/g,(e,n)=>t[n-1].text):(e=e.includes(`[`)?e.replace(/\]/,``)+`]`:e,e=e.replace(/(?:r)\$(\d+)(i)?/g,(n,r,a)=>{let o=t[r-1];return e.startsWith(`internal:attr`)||e.startsWith(`internal:testid`)||e.startsWith(`internal:role`)?u(new RegExp(o.text),!1)+(a||``):i(new RegExp(o.text,a),!1)}).replace(/\$(\d+)(i|s)?/g,(n,r,a)=>{let o=t[r-1];return e.startsWith(`internal:has=`)||e.startsWith(`internal:has-not=`)?o.text:e.startsWith(`internal:testid`)?u(o.text,!0):e.startsWith(`internal:attr`)||e.startsWith(`internal:role`)?u(o.text,a===`s`):i(o.text,a===`s`)}),e)).join(` >> `)}function uu(e,t,n=`data-testid`
|
|||
|
|
`)}};Bu.defaultYaml={explicit:!1,version:`1.2`},Bu.defaultTags={"!!":`tag:yaml.org,2002:`};function Vu(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 Hu(e){let t=new Set;return ju(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Uu(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Wu(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Hu(e);let a=Uu(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Y(t.node)||Tu(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 Gu(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=Gu(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=Gu(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=Gu(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=Gu(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function X(e,t,n){if(Array.isArray(e))return e.map((e,t)=>X(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Du(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 Ku=class{constructor(e){Object.defineProperty(this,bu,{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(!Su(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=X(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Gu(i,{"":o},``,o):o}},qu=class extends Ku{constructor(e){super(mu),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ju(e,{Node:(e,t)=>{(xu(t)||Du(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||=(X(a,null,t),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=Ju(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(Vu(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 Ju(e,t,n){if(xu(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Tu(t)){let r=0;for(let i of t.items){let t=Ju(e,i,n);t>r&&(r=t)}return r}else if(J(t)){let r=Ju(e,t.key,n),i=Ju(e,t.value,n);return Math.max(r,i)}return 1}var Yu=e=>!e||typeof e!=`function`&&typeof e!=`object`,Z=class extends Ku{constructor(e){super(vu),this.value=e}toJSON(e,t){return t?.keep?this.value:X(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOT
|
|||
|
|
`)?rd(n,t):n.includes(`
|
|||
|
|
`)?`
|
|||
|
|
`+rd(n,t):(e.endsWith(` `)?``:` `)+n,ad=`flow`,od=`block`,sd=`quoted`;function cd(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=ld(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=ld(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!==`
|
|||
|
|
`&&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 ld(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 ud=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),dd=e=>/^(%|---|\.\.\.)/m.test(e);function fd(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 pd(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(dd(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+=`
|
|||
|
|
`,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:cd(o,a,sd,ud(t,!1))}function md(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|||
|
|
`)||/[ \t]\n|\n[ \t]/.test(e))return pd(e,t);let n=t.indent||(dd(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:cd(r,n,ad,ud(t,!1))}function hd(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=pd;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?md:i&&!t?pd:n?md:pd}return r(e,t)}var gd;try{gd=RegExp(`(^|(?<!
|
|||
|
|
))
|
|||
|
|
+(?!
|
|||
|
|
|$)`,`g`)}catch{gd=/\n+(?!\n|$)/g}function _d({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 hd(n,r);let l=r.indent||(r.forceBlockIndent||dd(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Z.BLOCK_FOLDED?!1:t===Z.BLOCK_LITERAL?!0:!fd(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!==`
|
|||
|
|
`&&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]===`
|
|||
|
|
`&&(p=p.slice(0,-1)),p.replace(gd,`$&${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.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=ud(r,!0);o!==`folded`&&t!==Z.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=cd(`${v}${e}${p}`,l,od,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function vd(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 hd(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|||
|
|
`)?hd(a,t):_d(e,t,n,r);if(!s&&!u&&i!==Z.PLAIN&&a.includes(`
|
|||
|
|
`))return _d(e,t,n,r);if(dd(a)){if(c===``)return t.forceBlockIndent=!0,_d(e,t,n,r);if(s&&c===l)return hd(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 hd(a,t)}return s?d:cd(d,c,ad,ud(t,!1))}function yd(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!==Z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Z.QUOTE_DOUBLE);let c=e=>{switch(e){case Z.BLOCK_FOLDED:case Z.BLOCK_LITERAL:return i||a?hd(o.value,t):_d(o,t,n,r);case Z.QUOTE_DOUBLE:return pd(o.value,t);case Z.QUOTE_SINGLE:return md(o.value,t);case Z.PLAIN:return vd(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 Q(e,t){let n=Object.assign({blockQuote:!0,commentString:nd,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 bd(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(Y(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 xd(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Y(e)||Tu(e))&&e.anchor;a&&Vu(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 Sd(e,t,n,r){if(J(e))return e.toString(t,n,r);if(xu(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=Eu(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=bd(t.doc.schema.tags,a);let o=xd(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):Y(a)?yd(a,t,n,r):a.toString(t,n,r);return o?Y(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Cd({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=Eu(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Tu(e)||!Eu(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||Tu(e)||(Y(e)?e.type===Z.BLOCK_FOLDED||e.type===Z.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Sd(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+=id(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=id(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=id(g,n.indent,l(f))));let _,v,y;Eu(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&&Y(t)&&(n.inde
|
|||
|
|
`:``,v){let e=l(v);S+=`\n${rd(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|||
|
|
`&&y&&(S=`
|
|||
|
|
|
|||
|
|
`):S+=`\n${n.indent}`}else if(!p&&Tu(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]===`
|
|||
|
|
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=id(g,n.indent,l(y)):h&&i&&i(),g}function wd(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Td=`<<`,Ed={identify:e=>e===Td||typeof e==`symbol`&&e.description===Td,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Z(Symbol(Td)),{addToJSMap:Od}),stringify:()=>Td},Dd=(e,t)=>(Ed.identify(t)||Y(t)&&(!t.type||t.type===Z.PLAIN)&&Ed.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Ed.tag&&e.default);function Od(e,t,n){let r=Ad(e,n);if(wu(r))for(let n of r.items)kd(e,t,n);else if(Array.isArray(r))for(let n of r)kd(e,t,n);else kd(e,t,r)}function kd(e,t,n){let r=Ad(e,n);if(!Cu(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 Ad(e,t){return e&&xu(t)?t.resolve(e.doc,e):t}function jd(e,t,{key:n,value:r}){if(Eu(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Dd(e,n))Od(e,t,r);else{let i=X(n,``,e);if(t instanceof Map)t.set(i,X(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Md(n,i,e),o=X(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Md(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Eu(e)&&n?.doc){let t=Q(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)+`..."`),wd(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 $(e,t,n){return new Nd(Qu(e,void 0,n),Qu(t,void 0,n))}var Nd=class e{constructor(e,t=null){Object.defineProperty(this,bu,{value:_u}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Eu(n)&&(n=n.clone(t)),Eu(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return jd(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Cd(this,e,t,n):JSON.stringify(this)}};function Pd(e,t,n){return(t.inFlow??e.flow?Id:Fd)(e,t,n)}function Fd({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(Eu(i))!d&&i.spaceBefore&&f.push(``),Ld(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(J(i)){let e=Eu(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Ld(n,f,e.commentBefore,d))}d=!1;let s=Sd(i,u,()=>o=null,()=>d=!0);o&&(s+=id(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+=`
|
|||
|
|
`+rd(l(e),c),s&&s()):d&&o&&o(),p}function Id({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(Eu(i))i.spaceBefore&&d.push(``),Ld(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(J(i)){let e=Eu(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Ld(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Eu(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=Sd(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|||
|
|
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=id(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 Ld({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=rd(t(r),e);n.push(i.trimStart())}}function Rd(e,t){let n=Y(t)?t.value:t;for(let r of e)if(J(r)&&(r.key===t||r.key===n||Y(r.key)&&r.key.value===n))return r}var zd=class extends td{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(gu,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($(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=J(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Nd(e,e?.value):new Nd(e.key,e.value);let r=Rd(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Y(r.value)&&Yu(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=Rd(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Rd(this.items,e)?.value;return(!t&&Y(n)?n.value:n)??void 0}has(e){return!!Rd(this.items,e)}set(e,t){this.add(new Nd(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)jd(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!J(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})),Pd(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Bd={collection:`map`,default:!0,nodeClass:zd,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Cu(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>zd.from(e,t,n)},Vd=class extends td{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(yu,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Hd(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=Hd(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Y(r)?r.value:r}has(e){let t=Hd(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Hd(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Y(r)&&Yu(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(X(e,String(r++),t));return n}toString(e,t,n){return e?Pd(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(Qu(a,void 0,n))}}return i}};function Hd(e){let t=Y(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Ud={collection:`seq`,default:!0,nodeClass:Vd,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return wu(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Vd.from(e,t,n)},Wd={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),yd(e,t,n,r)}},Gd={identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Z(null),stringify:({source:e},t)=>typeof e==`string`&&Gd.test.test(e)?e:t.options.nullStr},Kd={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Z(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Kd.test.
|
|||
|
|
`:` `)}return yd({comment:e,type:t,value:s},r,i,a)}};function uf(e,t){if(wu(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!J(r)){if(Cu(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Nd(new Z(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]=J(r)?r:new Nd(r)}}else t(`Expected a sequence for this tag`);return e}function df(e,t,n){let{replacer:r}=n,i=new Vd(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($(o,s,n))}return i}var ff={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:uf,createNode:df},pf=class e extends Vd{constructor(){super(),this.add=zd.prototype.add.bind(this),this.delete=zd.prototype.delete.bind(this),this.get=zd.prototype.get.bind(this),this.has=zd.prototype.has.bind(this),this.set=zd.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(J(e)?(r=X(e.key,``,t),i=X(e.value,r,t)):r=X(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=df(e,t,n),i=new this;return i.items=r.items,i}};pf.tag=`tag:yaml.org,2002:omap`;var mf={collection:`seq`,identify:e=>e instanceof Map,nodeClass:pf,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=uf(e,t),r=[];for(let{key:e}of n.items)Y(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new pf,n)},createNode:(e,t,n)=>pf.from(e,t,n)};function hf({value:e,source:t},n){return t&&(e?gf:_f).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var gf={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 Z(!0),stringify:hf},_f={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 Z(!1),stringify:hf},vf={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:qd},yf={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():qd(e)}},bf={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 Z(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:qd},xf=e=>typeof e==`bigint`||Number.isInteger(e);function Sf(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 Cf(e,t,n){let{value:r}=e;if(xf(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return qd(e)}var wf={identify:xf,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Sf(e,2,2,n),stringify:e=>Cf(e,2,`0b`)},Tf={identify:xf,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Sf(e,1,8,n),stringify:e=>Cf(e,8,`0`)},Ef={identify:xf,default:!0,tag:`tag:yam
|
|||
|
|
`)?(n.push(`...`),n.push(rd(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(rd(a(t),``)))}return n.join(`
|
|||
|
|
`)+`
|
|||
|
|
`}var Uf=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bu,{value:hu});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 Bu({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[bu]:{value:hu}});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=Eu(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Wf(this.contents)&&this.contents.add(e)}addIn(e,t){Wf(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Hu(this);e.anchor=!t||n.has(t)?Uu(t||`a`,n):t}return new qu(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}=Wu(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=Qu(e,l,p);return o&&Tu(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Nd(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Wf(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ed(e)?this.contents==null?!1:(this.contents=null,!0):Wf(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Tu(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ed(e)?!t&&Y(this.contents)?this.contents.value:this.contents:Tu(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Tu(this.contents)?this.contents.has(e):!1}hasIn(e){return ed(e)?this.contents!==void 0:Tu(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=$u(this.schema,[e],t):Wf(this.contents)&&this.contents.set(e,t)}setIn(e,t){ed(e)?this.contents=t:this.contents==null?this.contents=$u(this.schema,Array.from(e),t):Wf(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 Bu({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 Bu({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 Vf(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=X(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`?Gu(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 posit
|
|||
|
|
`),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 Yf(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`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),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??=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??=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 Xf(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(Xf(t.key)||Xf(t.value))return!0}return!1;default:return!0}}function Zf(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Xf(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Qf(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Y(e)&&Y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var $f=`All mapping items must start at the same column`;function ep({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??zd)(n.schema);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=Yf(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`,$f)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|||
|
|
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Xf(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`,$f);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Zf(r.indent,u,i),n.atKey=!1,Qf(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Yf(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&&Zf(r.indent,f,i),s=c.range[2];let l=new Nd(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 Nd(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 tp({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Vd)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=Yf(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&&Zf(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function np(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 rp=`Block collections are not allowed within flow collections`,ip=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function ap({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?zd:Vd))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),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=Yf(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&&Xf(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];J(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],ip(m)&&i(r.range,`BLOCK_IN_FLOW`,rp)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);ip(f)&&i(g.range,`BLOCK_IN_FLOW`,rp),n.atKey=!1;let _=Yf(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?ip(m)&&i(v.range,`BLOCK_IN_FLOW`,rp):_.comment&&(g.comment?g.comment+=`
|
|||
|
|
`+_.comment:g.comment=_.comment);let y=new Nd(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Qf(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new zd(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=np(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 op(e,t,n,r,i,a){let o=n.type===`block-map`?ep(e,t,n,r,a):n.type===`block-seq`?tp(e,t,n,r,a):ap(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function sp(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===zd.tagName&&s===`map`||o===Vd.tagName&&s===`seq`)return op(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),op(e,t,n,i,o)}let l=op(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Eu(u)?u:new Z(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function cp(e,t,n){let r=t.offset,i=lp(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?Z.BLOCK_FOLDED:Z.BLOCK_LITERAL,o=t.source?up(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)+`
|
|||
|
|
`;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===Z.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|||
|
|
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|||
|
|
`:!p&&f===`
|
|||
|
|
`&&(f=`
|
|||
|
|
|
|||
|
|
`),d+=f+t.slice(c)+r,f=`
|
|||
|
|
`,p=!0):r===``?f===`
|
|||
|
|
`?d+=`
|
|||
|
|
`:f=`
|
|||
|
|
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|||
|
|
`+o[e][0].slice(c);d[d.length-1]!==`
|
|||
|
|
`&&(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 lp({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 up(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 dp(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=Z.PLAIN,c=fp(a,l);break;case`single-quoted-scalar`:s=Z.QUOTE_SINGLE,c=pp(a,l);break;case`double-quoted-scalar`:s=Z.QUOTE_DOUBLE,c=hp(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=np(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function fp(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}`),mp(e)}function pp(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),mp(e.slice(1,-1)).replace(/''/g,`'`)}function mp(e){let t,n;try{t=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===`
|
|||
|
|
`?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 hp(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===`
|
|||
|
|
`){let{fold:t,offset:i}=gp(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=_p[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===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=vp(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]===`
|
|||
|
|
`)&&(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 gp(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|||
|
|
`||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
|
|||
|
|
`);)r===`
|
|||
|
|
`&&(n+=`
|
|||
|
|
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var _p={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|||
|
|
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function vp(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function yp(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?cp(e,t,r):dp(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[vu]:c?bp(e.schema,i,c,n,r):t.type===`scalar`?xp(e,i,t,r):e.schema[vu];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Y(a)?a:new Z(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new Z(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 bp(e,t,n,r,i){if(n===`!`)return e[vu];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[vu])}function xp({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[vu];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[vu];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 Sp(e,t,n){if(t){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 Cp={composeNode:wp,composeEmptyNode:Tp};function wp(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=Ep(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=yp(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=sp(Cp,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??=Tp(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&&(!Y(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 Tp(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=yp(e,{type:`scalar`,offset:Sp(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 Ep({options:e},{offset:t,source:n,end:r},i){let a=new qu(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=np(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Dp(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Uf(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Yf(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-
|
|||
|
|
|
|||
|
|
`:`
|
|||
|
|
`)+(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 Ap=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Op(e);r?this.warnings.push(new qf(i,t,n)):this.errors.push(new Kf(i,t,n))},this.directives=new Bu({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=kp(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(Tu(i)&&!i.flow&&i.items.length>0){let e=i.items[0];J(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}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:kp(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=Op(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Dp(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 Kf(Op(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 Kf(Op(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=np(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 Kf(Op(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 Uf(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}}};function jp(e,t=!0,n){if(e){let r=(e,t,r)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(n)n(i,t,r);else throw new Kf([i,i+1],t,r)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return dp(e,t,r);case`block-scalar`:return cp({options:{strict:t}},e,r)}}return null}function Mp(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:a=-1,type:o=`PLAIN`}=t,s=yd({type:o,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:`newline`,offset:-1,indent:r,source:`
|
|||
|
|
`}];switch(s[0]){case`|`:case`>`:{let e=s.indexOf(`
|
|||
|
|
`),t=s.substring(0,e),n=s.substring(e+1)+`
|
|||
|
|
`,i=[{type:`block-scalar-header`,offset:a,indent:r,source:t}];return Fp(i,c)||i.push({type:`newline`,offset:-1,indent:r,source:`
|
|||
|
|
`}),{type:`block-scalar`,offset:a,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:a,indent:r,source:s,end:c};case`'`:return{type:`single-quoted-scalar`,offset:a,indent:r,source:s,end:c};default:return{type:`scalar`,offset:a,indent:r,source:s,end:c}}}function Np(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:a=!1,type:o}=n,s=`indent`in e?e.indent:null;if(r&&typeof s==`number`&&(s+=2),!o)switch(e.type){case`single-quoted-scalar`:o=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:o=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);o=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:o=`PLAIN`}let c=yd({type:o,value:t},{implicitKey:i||s===null,indent:s!==null&&s>0?` `.repeat(s):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case`|`:case`>`:Pp(e,c);break;case`"`:Ip(e,c,`double-quoted-scalar`);break;case`'`:Ip(e,c,`single-quoted-scalar`);break;default:Ip(e,c,`scalar`)}}function Pp(e,t){let n=t.indexOf(`
|
|||
|
|
`),r=t.substring(0,n),i=t.substring(n+1)+`
|
|||
|
|
`;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];Fp(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
|
|||
|
|
`});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function Fp(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function Ip(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
|
|||
|
|
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}var Lp=e=>`type`in e?Rp(e):zp(e);function Rp(e){switch(e.type){case`block-scalar`:{let t=``;for(let n of e.props)t+=Rp(n);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=zp(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=zp(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=zp(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function zp({start:e,key:t,sep:n,value:r}){let i=``;for(let t of e)i+=t.source;if(t&&(i+=Rp(t)),n)for(let e of n)i+=e.source;return r&&(i+=Rp(r)),i}var Bp=Symbol(`break visit`),Vp=Symbol(`skip children`),Hp=Symbol(`remove item`);function Up(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Wp(Object.freeze([]),e,t)}Up.BREAK=Bp,Up.SKIP=Vp,Up.REMOVE=Hp,Up.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},Up.parentCollection=(e,t)=>{let n=Up.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 Wp(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=Wp(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Bp)return Bp;else r===Hp&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var Gp=x({BOM:()=>``,DOCUMENT:()=>``,FLOW_END:()=>``,SCALAR:()=>``,createScalarToken:()=>Mp,isCollection:()=>Kp,isScalar:()=>qp,prettyToken:()=>Jp,resolveAsScalar:()=>jp,setScalarValue:()=>Np,stringify:()=>Lp,tokenType:()=>Yp,visit:()=>Up}),Kp=e=>!!e&&`items`in e,qp=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function Jp(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function Yp(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
|
|||
|
|
`: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 Xp(e){switch(e){case void 0:case` `:case`
|
|||
|
|
`:case`\r`:case` `:return!0;default:return!1}}var Zp=new Set(`0123456789ABCDEFabcdef`),Qp=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),$p=new Set(`,[]{}`),em=new Set(` ,[]{}
|
|||
|
|
\r `),tm=e=>!e||em.has(e),nm=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]===`
|
|||
|
|
`:!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===`
|
|||
|
|
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Xp(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===`...`)&&Xp(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&&!Xp(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===`:`)&&Xp(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}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(tm),`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(`...`))&&Xp(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(tm),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Xp(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return
|
|||
|
|
`,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=>Xp(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===`
|
|||
|
|
`)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===`
|
|||
|
|
`;)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(Xp(r)||e&&$p.has(r))break;t=n}else if(Xp(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|||
|
|
`?(n+=1,r=`
|
|||
|
|
`,i=this.buffer[n+1]):t=n),i===`#`||e&&$p.has(i))break;if(r===`
|
|||
|
|
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&$p.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(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(tm),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(Xp(n)||t&&$p.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Xp(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(Qp.has(t))t=this.buffer[++e];else if(t===`%`&&Zp.has(this.buffer[e+1])&&Zp.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(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)}},rm=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 im(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function am(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 om(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 sm(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 cm(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 lm(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function um(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!im(t.start,`explicit-key-ind`)&&!im(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,om(t.value)?t.value.end?lm(t.value.end,t.sep):t.value.end=t.sep:lm(t.start,t.sep),delete t.sep)}var dm=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 nm,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=Yp(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.
|
|||
|
|
`)+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)){lm(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(im(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=cm(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(im(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(om(t.key)&&!im(t.sep,`newline`)){let e=cm(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]}):im(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&&!im(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)){lm(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(thi
|
|||
|
|
`)+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=cm(sm(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=cm(sm(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 fm(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new rm||null,prettyErrors:t}}function pm(e,t={}){let{lineCounter:n,prettyErrors:r}=fm(t),i=new dm(n?.addNewLine),a=new Ap(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(let t of o)t.errors.forEach(Jf(e,n)),t.warnings.forEach(Jf(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function mm(e,t={}){let{lineCounter:n,prettyErrors:r}=fm(t),i=new dm(n?.addNewLine),a=new Ap(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 Kf(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Jf(e,n)),o.warnings.forEach(Jf(e,n))),o}function hm(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=mm(e,n);if(!i)return null;if(i.warnings.forEach(e=>wd(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))}function gm(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Su(e)&&!r?e.toString(n):new Uf(e,r,n).toString(n)}var _m=x({Alias:()=>qu,CST:()=>Gp,Composer:()=>Ap,Document:()=>Uf,Lexer:()=>nm,LineCounter:()=>rm,Pair:()=>Nd,Parser:()=>dm,Scalar:()=>Z,Schema:()=>Vf,YAMLError:()=>Gf,YAMLMap:()=>zd,YAMLParseError:()=>Kf,YAMLSeq:()=>Vd,YAMLWarning:()=>qf,isAlias:()=>xu,isCollection:()=>Tu,isDocument:()=>Su,isMap:()=>Cu,isNode:()=>Eu,isPair:()=>J,isScalar:()=>Y,isSeq:()=>wu,parse:()=>hm,parseAllDocuments:()=>pm,parseDocument:()=>mm,stringify:()=>gm,visit:()=>ju,visitAsync:()=>Nu}),vm=[.5,1,2];function ym(e,t,n,r,i){let[a,o]=T.useState(!1),[s,c]=T.useState(1),[l,u]=T.useState(!1),[d,f]=T.useState(void 0),[p,m]=T.useState(void 0),h=vm[s],g=t?e.indexOf(t):-1,_=i.minimum,v=i.maximum,y=v-_||1,b=r?r.minimum:_,x=r?r.maximum:v,S=T.useMemo(()=>r?e.filter(e=>e.startTime>=r.minimum&&e.startTime<=r.maximum):e,[e,r]),C=S.length?e.indexOf(S[0]):0,w=S.length?e.indexOf(S[S.length-1]):e.length-1,ee=T.useRef(e);ee.current=e;let te=T.useRef(n);te.current=n;let E=T.useRef(null),ne=T.useCallback(t=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i].startTime<=t?n=i:r=i-1}if(n<e.length-1){let r=t-e[n].startTime;e[n+1].startTime-t<r&&(n+=1
|