UNPKG

instantcode

Version:

AI-powered web inspection tool - Pick elements and get instant AI assistance

1,347 lines (1,332 loc) 358 kB
"use strict"; (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __typeError = (msg) => { throw TypeError(msg); }; var __decorateClass = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; for (var i6 = decorators.length - 1, decorator; i6 >= 0; i6--) if (decorator = decorators[i6]) result = (kind ? decorator(target, key, result) : decorator(result)) || result; if (kind && result) __defProp(target, key, result); return result; }; var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); // node_modules/@lit/reactive-element/css-tag.js var t = globalThis; var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; var s = Symbol(); var o = /* @__PURE__ */ new WeakMap(); var n = class { constructor(t6, e9, o9) { if (this._$cssResult$ = true, o9 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t6, this.t = e9; } get styleSheet() { let t6 = this.o; const s5 = this.t; if (e && void 0 === t6) { const e9 = void 0 !== s5 && 1 === s5.length; e9 && (t6 = o.get(s5)), void 0 === t6 && ((this.o = t6 = new CSSStyleSheet()).replaceSync(this.cssText), e9 && o.set(s5, t6)); } return t6; } toString() { return this.cssText; } }; var r = (t6) => new n("string" == typeof t6 ? t6 : t6 + "", void 0, s); var i = (t6, ...e9) => { const o9 = 1 === t6.length ? t6[0] : e9.reduce(((e10, s5, o10) => e10 + ((t7) => { if (true === t7._$cssResult$) return t7.cssText; if ("number" == typeof t7) return t7; throw Error("Value passed to 'css' function must be a 'css' function result: " + t7 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s5) + t6[o10 + 1]), t6[0]); return new n(o9, t6, s); }; var S = (s5, o9) => { if (e) s5.adoptedStyleSheets = o9.map(((t6) => t6 instanceof CSSStyleSheet ? t6 : t6.styleSheet)); else for (const e9 of o9) { const o10 = document.createElement("style"), n8 = t.litNonce; void 0 !== n8 && o10.setAttribute("nonce", n8), o10.textContent = e9.cssText, s5.appendChild(o10); } }; var c = e ? (t6) => t6 : (t6) => t6 instanceof CSSStyleSheet ? ((t7) => { let e9 = ""; for (const s5 of t7.cssRules) e9 += s5.cssText; return r(e9); })(t6) : t6; // node_modules/@lit/reactive-element/reactive-element.js var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: h, getOwnPropertyNames: r2, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; var a = globalThis; var c2 = a.trustedTypes; var l = c2 ? c2.emptyScript : ""; var p = a.reactiveElementPolyfillSupport; var d = (t6, s5) => t6; var u = { toAttribute(t6, s5) { switch (s5) { case Boolean: t6 = t6 ? l : null; break; case Object: case Array: t6 = null == t6 ? t6 : JSON.stringify(t6); } return t6; }, fromAttribute(t6, s5) { let i6 = t6; switch (s5) { case Boolean: i6 = null !== t6; break; case Number: i6 = null === t6 ? null : Number(t6); break; case Object: case Array: try { i6 = JSON.parse(t6); } catch (t7) { i6 = null; } } return i6; } }; var f = (t6, s5) => !i2(t6, s5); var b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f }; Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); var y = class extends HTMLElement { static addInitializer(t6) { this._$Ei(), (this.l ?? (this.l = [])).push(t6); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(t6, s5 = b) { if (s5.state && (s5.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t6) && ((s5 = Object.create(s5)).wrapped = true), this.elementProperties.set(t6, s5), !s5.noAccessor) { const i6 = Symbol(), h5 = this.getPropertyDescriptor(t6, i6, s5); void 0 !== h5 && e2(this.prototype, t6, h5); } } static getPropertyDescriptor(t6, s5, i6) { const { get: e9, set: r7 } = h(this.prototype, t6) ?? { get() { return this[s5]; }, set(t7) { this[s5] = t7; } }; return { get: e9, set(s6) { const h5 = e9?.call(this); r7?.call(this, s6), this.requestUpdate(t6, h5, i6); }, configurable: true, enumerable: true }; } static getPropertyOptions(t6) { return this.elementProperties.get(t6) ?? b; } static _$Ei() { if (this.hasOwnProperty(d("elementProperties"))) return; const t6 = n2(this); t6.finalize(), void 0 !== t6.l && (this.l = [...t6.l]), this.elementProperties = new Map(t6.elementProperties); } static finalize() { if (this.hasOwnProperty(d("finalized"))) return; if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { const t7 = this.properties, s5 = [...r2(t7), ...o2(t7)]; for (const i6 of s5) this.createProperty(i6, t7[i6]); } const t6 = this[Symbol.metadata]; if (null !== t6) { const s5 = litPropertyMetadata.get(t6); if (void 0 !== s5) for (const [t7, i6] of s5) this.elementProperties.set(t7, i6); } this._$Eh = /* @__PURE__ */ new Map(); for (const [t7, s5] of this.elementProperties) { const i6 = this._$Eu(t7, s5); void 0 !== i6 && this._$Eh.set(i6, t7); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(s5) { const i6 = []; if (Array.isArray(s5)) { const e9 = new Set(s5.flat(1 / 0).reverse()); for (const s6 of e9) i6.unshift(c(s6)); } else void 0 !== s5 && i6.push(c(s5)); return i6; } static _$Eu(t6, s5) { const i6 = s5.attribute; return false === i6 ? void 0 : "string" == typeof i6 ? i6 : "string" == typeof t6 ? t6.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); } _$Ev() { this._$ES = new Promise(((t6) => this.enableUpdating = t6)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t6) => t6(this))); } addController(t6) { (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t6), void 0 !== this.renderRoot && this.isConnected && t6.hostConnected?.(); } removeController(t6) { this._$EO?.delete(t6); } _$E_() { const t6 = /* @__PURE__ */ new Map(), s5 = this.constructor.elementProperties; for (const i6 of s5.keys()) this.hasOwnProperty(i6) && (t6.set(i6, this[i6]), delete this[i6]); t6.size > 0 && (this._$Ep = t6); } createRenderRoot() { const t6 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return S(t6, this.constructor.elementStyles), t6; } connectedCallback() { this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach(((t6) => t6.hostConnected?.())); } enableUpdating(t6) { } disconnectedCallback() { this._$EO?.forEach(((t6) => t6.hostDisconnected?.())); } attributeChangedCallback(t6, s5, i6) { this._$AK(t6, i6); } _$ET(t6, s5) { const i6 = this.constructor.elementProperties.get(t6), e9 = this.constructor._$Eu(t6, i6); if (void 0 !== e9 && true === i6.reflect) { const h5 = (void 0 !== i6.converter?.toAttribute ? i6.converter : u).toAttribute(s5, i6.type); this._$Em = t6, null == h5 ? this.removeAttribute(e9) : this.setAttribute(e9, h5), this._$Em = null; } } _$AK(t6, s5) { const i6 = this.constructor, e9 = i6._$Eh.get(t6); if (void 0 !== e9 && this._$Em !== e9) { const t7 = i6.getPropertyOptions(e9), h5 = "function" == typeof t7.converter ? { fromAttribute: t7.converter } : void 0 !== t7.converter?.fromAttribute ? t7.converter : u; this._$Em = e9; const r7 = h5.fromAttribute(s5, t7.type); this[e9] = r7 ?? this._$Ej?.get(e9) ?? r7, this._$Em = null; } } requestUpdate(t6, s5, i6) { if (void 0 !== t6) { const e9 = this.constructor, h5 = this[t6]; if (i6 ?? (i6 = e9.getPropertyOptions(t6)), !((i6.hasChanged ?? f)(h5, s5) || i6.useDefault && i6.reflect && h5 === this._$Ej?.get(t6) && !this.hasAttribute(e9._$Eu(t6, i6)))) return; this.C(t6, s5, i6); } false === this.isUpdatePending && (this._$ES = this._$EP()); } C(t6, s5, { useDefault: i6, reflect: e9, wrapped: h5 }, r7) { i6 && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t6) && (this._$Ej.set(t6, r7 ?? s5 ?? this[t6]), true !== h5 || void 0 !== r7) || (this._$AL.has(t6) || (this.hasUpdated || i6 || (s5 = void 0), this._$AL.set(t6, s5)), true === e9 && this._$Em !== t6 && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t6)); } async _$EP() { this.isUpdatePending = true; try { await this._$ES; } catch (t7) { Promise.reject(t7); } const t6 = this.scheduleUpdate(); return null != t6 && await t6, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { for (const [t8, s6] of this._$Ep) this[t8] = s6; this._$Ep = void 0; } const t7 = this.constructor.elementProperties; if (t7.size > 0) for (const [s6, i6] of t7) { const { wrapped: t8 } = i6, e9 = this[s6]; true !== t8 || this._$AL.has(s6) || void 0 === e9 || this.C(s6, void 0, i6, e9); } } let t6 = false; const s5 = this._$AL; try { t6 = this.shouldUpdate(s5), t6 ? (this.willUpdate(s5), this._$EO?.forEach(((t7) => t7.hostUpdate?.())), this.update(s5)) : this._$EM(); } catch (s6) { throw t6 = false, this._$EM(), s6; } t6 && this._$AE(s5); } willUpdate(t6) { } _$AE(t6) { this._$EO?.forEach(((t7) => t7.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t6)), this.updated(t6); } _$EM() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(t6) { return true; } update(t6) { this._$Eq && (this._$Eq = this._$Eq.forEach(((t7) => this._$ET(t7, this[t7])))), this._$EM(); } updated(t6) { } firstUpdated(t6) { } }; y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = /* @__PURE__ */ new Map(), y[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: y }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.1.1"); // node_modules/lit-html/lit-html.js var t2 = globalThis; var i3 = t2.trustedTypes; var s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t6) => t6 }) : void 0; var e3 = "$lit$"; var h2 = `lit$${Math.random().toFixed(9).slice(2)}$`; var o3 = "?" + h2; var n3 = `<${o3}>`; var r3 = document; var l2 = () => r3.createComment(""); var c3 = (t6) => null === t6 || "object" != typeof t6 && "function" != typeof t6; var a2 = Array.isArray; var u2 = (t6) => a2(t6) || "function" == typeof t6?.[Symbol.iterator]; var d2 = "[ \n\f\r]"; var f2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var v = /-->/g; var _ = />/g; var m = RegExp(`>|${d2}(?:([^\\s"'>=/]+)(${d2}*=${d2}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var p2 = /'/g; var g = /"/g; var $ = /^(?:script|style|textarea|title)$/i; var y2 = (t6) => (i6, ...s5) => ({ _$litType$: t6, strings: i6, values: s5 }); var x = y2(1); var b2 = y2(2); var w = y2(3); var T = Symbol.for("lit-noChange"); var E = Symbol.for("lit-nothing"); var A = /* @__PURE__ */ new WeakMap(); var C = r3.createTreeWalker(r3, 129); function P(t6, i6) { if (!a2(t6) || !t6.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== s2 ? s2.createHTML(i6) : i6; } var V = (t6, i6) => { const s5 = t6.length - 1, o9 = []; let r7, l3 = 2 === i6 ? "<svg>" : 3 === i6 ? "<math>" : "", c5 = f2; for (let i7 = 0; i7 < s5; i7++) { const s6 = t6[i7]; let a3, u3, d3 = -1, y3 = 0; for (; y3 < s6.length && (c5.lastIndex = y3, u3 = c5.exec(s6), null !== u3); ) y3 = c5.lastIndex, c5 === f2 ? "!--" === u3[1] ? c5 = v : void 0 !== u3[1] ? c5 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r7 = RegExp("</" + u3[2], "g")), c5 = m) : void 0 !== u3[3] && (c5 = m) : c5 === m ? ">" === u3[0] ? (c5 = r7 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c5.lastIndex - u3[2].length, a3 = u3[1], c5 = void 0 === u3[3] ? m : '"' === u3[3] ? g : p2) : c5 === g || c5 === p2 ? c5 = m : c5 === v || c5 === _ ? c5 = f2 : (c5 = m, r7 = void 0); const x2 = c5 === m && t6[i7 + 1].startsWith("/>") ? " " : ""; l3 += c5 === f2 ? s6 + n3 : d3 >= 0 ? (o9.push(a3), s6.slice(0, d3) + e3 + s6.slice(d3) + h2 + x2) : s6 + h2 + (-2 === d3 ? i7 : x2); } return [P(t6, l3 + (t6[s5] || "<?>") + (2 === i6 ? "</svg>" : 3 === i6 ? "</math>" : "")), o9]; }; var N = class _N { constructor({ strings: t6, _$litType$: s5 }, n8) { let r7; this.parts = []; let c5 = 0, a3 = 0; const u3 = t6.length - 1, d3 = this.parts, [f5, v2] = V(t6, s5); if (this.el = _N.createElement(f5, n8), C.currentNode = this.el.content, 2 === s5 || 3 === s5) { const t7 = this.el.content.firstChild; t7.replaceWith(...t7.childNodes); } for (; null !== (r7 = C.nextNode()) && d3.length < u3; ) { if (1 === r7.nodeType) { if (r7.hasAttributes()) for (const t7 of r7.getAttributeNames()) if (t7.endsWith(e3)) { const i6 = v2[a3++], s6 = r7.getAttribute(t7).split(h2), e9 = /([.?@])?(.*)/.exec(i6); d3.push({ type: 1, index: c5, name: e9[2], strings: s6, ctor: "." === e9[1] ? H : "?" === e9[1] ? I : "@" === e9[1] ? L : k }), r7.removeAttribute(t7); } else t7.startsWith(h2) && (d3.push({ type: 6, index: c5 }), r7.removeAttribute(t7)); if ($.test(r7.tagName)) { const t7 = r7.textContent.split(h2), s6 = t7.length - 1; if (s6 > 0) { r7.textContent = i3 ? i3.emptyScript : ""; for (let i6 = 0; i6 < s6; i6++) r7.append(t7[i6], l2()), C.nextNode(), d3.push({ type: 2, index: ++c5 }); r7.append(t7[s6], l2()); } } } else if (8 === r7.nodeType) if (r7.data === o3) d3.push({ type: 2, index: c5 }); else { let t7 = -1; for (; -1 !== (t7 = r7.data.indexOf(h2, t7 + 1)); ) d3.push({ type: 7, index: c5 }), t7 += h2.length - 1; } c5++; } } static createElement(t6, i6) { const s5 = r3.createElement("template"); return s5.innerHTML = t6, s5; } }; function S2(t6, i6, s5 = t6, e9) { if (i6 === T) return i6; let h5 = void 0 !== e9 ? s5._$Co?.[e9] : s5._$Cl; const o9 = c3(i6) ? void 0 : i6._$litDirective$; return h5?.constructor !== o9 && (h5?._$AO?.(false), void 0 === o9 ? h5 = void 0 : (h5 = new o9(t6), h5._$AT(t6, s5, e9)), void 0 !== e9 ? (s5._$Co ?? (s5._$Co = []))[e9] = h5 : s5._$Cl = h5), void 0 !== h5 && (i6 = S2(t6, h5._$AS(t6, i6.values), h5, e9)), i6; } var M = class { constructor(t6, i6) { this._$AV = [], this._$AN = void 0, this._$AD = t6, this._$AM = i6; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t6) { const { el: { content: i6 }, parts: s5 } = this._$AD, e9 = (t6?.creationScope ?? r3).importNode(i6, true); C.currentNode = e9; let h5 = C.nextNode(), o9 = 0, n8 = 0, l3 = s5[0]; for (; void 0 !== l3; ) { if (o9 === l3.index) { let i7; 2 === l3.type ? i7 = new R(h5, h5.nextSibling, this, t6) : 1 === l3.type ? i7 = new l3.ctor(h5, l3.name, l3.strings, this, t6) : 6 === l3.type && (i7 = new z(h5, this, t6)), this._$AV.push(i7), l3 = s5[++n8]; } o9 !== l3?.index && (h5 = C.nextNode(), o9++); } return C.currentNode = r3, e9; } p(t6) { let i6 = 0; for (const s5 of this._$AV) void 0 !== s5 && (void 0 !== s5.strings ? (s5._$AI(t6, s5, i6), i6 += s5.strings.length - 2) : s5._$AI(t6[i6])), i6++; } }; var R = class _R { get _$AU() { return this._$AM?._$AU ?? this._$Cv; } constructor(t6, i6, s5, e9) { this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t6, this._$AB = i6, this._$AM = s5, this.options = e9, this._$Cv = e9?.isConnected ?? true; } get parentNode() { let t6 = this._$AA.parentNode; const i6 = this._$AM; return void 0 !== i6 && 11 === t6?.nodeType && (t6 = i6.parentNode), t6; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t6, i6 = this) { t6 = S2(this, t6, i6), c3(t6) ? t6 === E || null == t6 || "" === t6 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t6 !== this._$AH && t6 !== T && this._(t6) : void 0 !== t6._$litType$ ? this.$(t6) : void 0 !== t6.nodeType ? this.T(t6) : u2(t6) ? this.k(t6) : this._(t6); } O(t6) { return this._$AA.parentNode.insertBefore(t6, this._$AB); } T(t6) { this._$AH !== t6 && (this._$AR(), this._$AH = this.O(t6)); } _(t6) { this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t6 : this.T(r3.createTextNode(t6)), this._$AH = t6; } $(t6) { const { values: i6, _$litType$: s5 } = t6, e9 = "number" == typeof s5 ? this._$AC(t6) : (void 0 === s5.el && (s5.el = N.createElement(P(s5.h, s5.h[0]), this.options)), s5); if (this._$AH?._$AD === e9) this._$AH.p(i6); else { const t7 = new M(e9, this), s6 = t7.u(this.options); t7.p(i6), this.T(s6), this._$AH = t7; } } _$AC(t6) { let i6 = A.get(t6.strings); return void 0 === i6 && A.set(t6.strings, i6 = new N(t6)), i6; } k(t6) { a2(this._$AH) || (this._$AH = [], this._$AR()); const i6 = this._$AH; let s5, e9 = 0; for (const h5 of t6) e9 === i6.length ? i6.push(s5 = new _R(this.O(l2()), this.O(l2()), this, this.options)) : s5 = i6[e9], s5._$AI(h5), e9++; e9 < i6.length && (this._$AR(s5 && s5._$AB.nextSibling, e9), i6.length = e9); } _$AR(t6 = this._$AA.nextSibling, i6) { for (this._$AP?.(false, true, i6); t6 !== this._$AB; ) { const i7 = t6.nextSibling; t6.remove(), t6 = i7; } } setConnected(t6) { void 0 === this._$AM && (this._$Cv = t6, this._$AP?.(t6)); } }; var k = class { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t6, i6, s5, e9, h5) { this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t6, this.name = i6, this._$AM = e9, this.options = h5, s5.length > 2 || "" !== s5[0] || "" !== s5[1] ? (this._$AH = Array(s5.length - 1).fill(new String()), this.strings = s5) : this._$AH = E; } _$AI(t6, i6 = this, s5, e9) { const h5 = this.strings; let o9 = false; if (void 0 === h5) t6 = S2(this, t6, i6, 0), o9 = !c3(t6) || t6 !== this._$AH && t6 !== T, o9 && (this._$AH = t6); else { const e10 = t6; let n8, r7; for (t6 = h5[0], n8 = 0; n8 < h5.length - 1; n8++) r7 = S2(this, e10[s5 + n8], i6, n8), r7 === T && (r7 = this._$AH[n8]), o9 || (o9 = !c3(r7) || r7 !== this._$AH[n8]), r7 === E ? t6 = E : t6 !== E && (t6 += (r7 ?? "") + h5[n8 + 1]), this._$AH[n8] = r7; } o9 && !e9 && this.j(t6); } j(t6) { t6 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t6 ?? ""); } }; var H = class extends k { constructor() { super(...arguments), this.type = 3; } j(t6) { this.element[this.name] = t6 === E ? void 0 : t6; } }; var I = class extends k { constructor() { super(...arguments), this.type = 4; } j(t6) { this.element.toggleAttribute(this.name, !!t6 && t6 !== E); } }; var L = class extends k { constructor(t6, i6, s5, e9, h5) { super(t6, i6, s5, e9, h5), this.type = 5; } _$AI(t6, i6 = this) { if ((t6 = S2(this, t6, i6, 0) ?? E) === T) return; const s5 = this._$AH, e9 = t6 === E && s5 !== E || t6.capture !== s5.capture || t6.once !== s5.once || t6.passive !== s5.passive, h5 = t6 !== E && (s5 === E || e9); e9 && this.element.removeEventListener(this.name, this, s5), h5 && this.element.addEventListener(this.name, this, t6), this._$AH = t6; } handleEvent(t6) { "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t6) : this._$AH.handleEvent(t6); } }; var z = class { constructor(t6, i6, s5) { this.element = t6, this.type = 6, this._$AN = void 0, this._$AM = i6, this.options = s5; } get _$AU() { return this._$AM._$AU; } _$AI(t6) { S2(this, t6); } }; var Z = { M: e3, P: h2, A: o3, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z }; var j = t2.litHtmlPolyfillSupport; j?.(N, R), (t2.litHtmlVersions ?? (t2.litHtmlVersions = [])).push("3.3.1"); var B = (t6, i6, s5) => { const e9 = s5?.renderBefore ?? i6; let h5 = e9._$litPart$; if (void 0 === h5) { const t7 = s5?.renderBefore ?? null; e9._$litPart$ = h5 = new R(i6.insertBefore(l2(), t7), t7, void 0, s5 ?? {}); } return h5._$AI(t6), h5; }; // node_modules/lit-element/lit-element.js var s3 = globalThis; var i4 = class extends y { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var _a; const t6 = super.createRenderRoot(); return (_a = this.renderOptions).renderBefore ?? (_a.renderBefore = t6.firstChild), t6; } update(t6) { const r7 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t6), this._$Do = B(r7, this.renderRoot, this.renderOptions); } connectedCallback() { super.connectedCallback(), this._$Do?.setConnected(true); } disconnectedCallback() { super.disconnectedCallback(), this._$Do?.setConnected(false); } render() { return T; } }; i4._$litElement$ = true, i4["finalized"] = true, s3.litElementHydrateSupport?.({ LitElement: i4 }); var o4 = s3.litElementPolyfillSupport; o4?.({ LitElement: i4 }); (s3.litElementVersions ?? (s3.litElementVersions = [])).push("4.2.1"); // node_modules/@lit/reactive-element/decorators/custom-element.js var t3 = (t6) => (e9, o9) => { void 0 !== o9 ? o9.addInitializer((() => { customElements.define(t6, e9); })) : customElements.define(t6, e9); }; // node_modules/@lit/reactive-element/decorators/property.js var o5 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; var r4 = (t6 = o5, e9, r7) => { const { kind: n8, metadata: i6 } = r7; let s5 = globalThis.litPropertyMetadata.get(i6); if (void 0 === s5 && globalThis.litPropertyMetadata.set(i6, s5 = /* @__PURE__ */ new Map()), "setter" === n8 && ((t6 = Object.create(t6)).wrapped = true), s5.set(r7.name, t6), "accessor" === n8) { const { name: o9 } = r7; return { set(r8) { const n9 = e9.get.call(this); e9.set.call(this, r8), this.requestUpdate(o9, n9, t6); }, init(e10) { return void 0 !== e10 && this.C(o9, void 0, t6, e10), e10; } }; } if ("setter" === n8) { const { name: o9 } = r7; return function(r8) { const n9 = this[o9]; e9.call(this, r8), this.requestUpdate(o9, n9, t6); }; } throw Error("Unsupported decorator location: " + n8); }; function n4(t6) { return (e9, o9) => "object" == typeof o9 ? r4(t6, e9, o9) : ((t7, e10, o10) => { const r7 = e10.hasOwnProperty(o10); return e10.constructor.createProperty(o10, t7), r7 ? Object.getOwnPropertyDescriptor(e10, o10) : void 0; })(t6, e9, o9); } // node_modules/@lit/reactive-element/decorators/state.js function r5(r7) { return n4({ ...r7, state: true, attribute: false }); } // node_modules/lit-html/directives/when.js function n5(n8, r7, t6) { return n8 ? r7(n8) : t6?.(n8); } // node_modules/lit-html/directive.js var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }; var e5 = (t6) => (...e9) => ({ _$litDirective$: t6, values: e9 }); var i5 = class { constructor(t6) { } get _$AU() { return this._$AM._$AU; } _$AT(t6, e9, i6) { this._$Ct = t6, this._$AM = e9, this._$Ci = i6; } _$AS(t6, e9) { return this.update(t6, e9); } update(t6, e9) { return this.render(...e9); } }; // node_modules/lit-html/directives/class-map.js var e6 = e5(class extends i5 { constructor(t6) { if (super(t6), t6.type !== t4.ATTRIBUTE || "class" !== t6.name || t6.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); } render(t6) { return " " + Object.keys(t6).filter(((s5) => t6[s5])).join(" ") + " "; } update(s5, [i6]) { if (void 0 === this.st) { this.st = /* @__PURE__ */ new Set(), void 0 !== s5.strings && (this.nt = new Set(s5.strings.join(" ").split(/\s/).filter(((t6) => "" !== t6)))); for (const t6 in i6) i6[t6] && !this.nt?.has(t6) && this.st.add(t6); return this.render(i6); } const r7 = s5.element.classList; for (const t6 of this.st) t6 in i6 || (r7.remove(t6), this.st.delete(t6)); for (const t6 in i6) { const s6 = !!i6[t6]; s6 === this.st.has(t6) || this.nt?.has(t6) || (s6 ? (r7.add(t6), this.st.add(t6)) : (r7.remove(t6), this.st.delete(t6))); } return T; } }); // node_modules/lit-html/directive-helpers.js var { I: t5 } = Z; var f3 = (o9) => void 0 === o9.strings; // node_modules/lit-html/async-directive.js var s4 = (i6, t6) => { const e9 = i6._$AN; if (void 0 === e9) return false; for (const i7 of e9) i7._$AO?.(t6, false), s4(i7, t6); return true; }; var o6 = (i6) => { let t6, e9; do { if (void 0 === (t6 = i6._$AM)) break; e9 = t6._$AN, e9.delete(i6), i6 = t6; } while (0 === e9?.size); }; var r6 = (i6) => { for (let t6; t6 = i6._$AM; i6 = t6) { let e9 = t6._$AN; if (void 0 === e9) t6._$AN = e9 = /* @__PURE__ */ new Set(); else if (e9.has(i6)) break; e9.add(i6), c4(t6); } }; function h3(i6) { void 0 !== this._$AN ? (o6(this), this._$AM = i6, r6(this)) : this._$AM = i6; } function n6(i6, t6 = false, e9 = 0) { const r7 = this._$AH, h5 = this._$AN; if (void 0 !== h5 && 0 !== h5.size) if (t6) if (Array.isArray(r7)) for (let i7 = e9; i7 < r7.length; i7++) s4(r7[i7], false), o6(r7[i7]); else null != r7 && (s4(r7, false), o6(r7)); else s4(this, i6); } var c4 = (i6) => { i6.type == t4.CHILD && (i6._$AP ?? (i6._$AP = n6), i6._$AQ ?? (i6._$AQ = h3)); }; var f4 = class extends i5 { constructor() { super(...arguments), this._$AN = void 0; } _$AT(i6, t6, e9) { super._$AT(i6, t6, e9), r6(this), this.isConnected = i6._$AU; } _$AO(i6, t6 = true) { i6 !== this.isConnected && (this.isConnected = i6, i6 ? this.reconnected?.() : this.disconnected?.()), t6 && (s4(this, i6), o6(this)); } setValue(t6) { if (f3(this._$Ct)) this._$Ct._$AI(t6, this); else { const i6 = [...this._$Ct._$AH]; i6[this._$Ci] = t6, this._$Ct._$AI(i6, this, 0); } } disconnected() { } reconnected() { } }; // node_modules/lit-html/directives/ref.js var e7 = () => new h4(); var h4 = class { }; var o7 = /* @__PURE__ */ new WeakMap(); var n7 = e5(class extends f4 { render(i6) { return E; } update(i6, [s5]) { const e9 = s5 !== this.G; return e9 && void 0 !== this.G && this.rt(void 0), (e9 || this.lt !== this.ct) && (this.G = s5, this.ht = i6.options?.host, this.rt(this.ct = i6.element)), E; } rt(t6) { if (this.isConnected || (t6 = void 0), "function" == typeof this.G) { const i6 = this.ht ?? globalThis; let s5 = o7.get(i6); void 0 === s5 && (s5 = /* @__PURE__ */ new WeakMap(), o7.set(i6, s5)), void 0 !== s5.get(this.G) && this.G.call(this.ht, void 0), s5.set(this.G, t6), void 0 !== t6 && this.G.call(this.ht, t6); } else this.G.value = t6; } get lt() { return "function" == typeof this.G ? o7.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value; } disconnected() { this.lt === this.ct && this.rt(void 0); } reconnected() { this.rt(this.ct); } }); // node_modules/lit-html/directives/unsafe-html.js var e8 = class extends i5 { constructor(i6) { if (super(i6), this.it = E, i6.type !== t4.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings"); } render(r7) { if (r7 === E || null == r7) return this._t = void 0, this.it = r7; if (r7 === T) return r7; if ("string" != typeof r7) throw Error(this.constructor.directiveName + "() called with a non-string value"); if (r7 === this.it) return this._t; this.it = r7; const s5 = [r7]; return s5.raw = s5, this._t = { _$litType$: this.constructor.resultType, strings: s5, values: [] }; } }; e8.directiveName = "unsafeHTML", e8.resultType = 1; var o8 = e5(e8); // node_modules/js-yaml/dist/js-yaml.mjs function isNothing(subject) { return typeof subject === "undefined" || subject === null; } function isObject(subject) { return typeof subject === "object" && subject !== null; } function toArray(sequence) { if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return []; return [sequence]; } function extend(target, source) { var index, length, key, sourceKeys; if (source) { sourceKeys = Object.keys(source); for (index = 0, length = sourceKeys.length; index < length; index += 1) { key = sourceKeys[index]; target[key] = source[key]; } } return target; } function repeat(string, count) { var result = "", cycle; for (cycle = 0; cycle < count; cycle += 1) { result += string; } return result; } function isNegativeZero(number) { return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; } var isNothing_1 = isNothing; var isObject_1 = isObject; var toArray_1 = toArray; var repeat_1 = repeat; var isNegativeZero_1 = isNegativeZero; var extend_1 = extend; var common = { isNothing: isNothing_1, isObject: isObject_1, toArray: toArray_1, repeat: repeat_1, isNegativeZero: isNegativeZero_1, extend: extend_1 }; function formatError(exception2, compact) { var where = "", message = exception2.reason || "(unknown reason)"; if (!exception2.mark) return message; if (exception2.mark.name) { where += 'in "' + exception2.mark.name + '" '; } where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; if (!compact && exception2.mark.snippet) { where += "\n\n" + exception2.mark.snippet; } return message + " " + where; } function YAMLException$1(reason, mark) { Error.call(this); this.name = "YAMLException"; this.reason = reason; this.mark = mark; this.message = formatError(this, false); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { this.stack = new Error().stack || ""; } } YAMLException$1.prototype = Object.create(Error.prototype); YAMLException$1.prototype.constructor = YAMLException$1; YAMLException$1.prototype.toString = function toString(compact) { return this.name + ": " + formatError(this, compact); }; var exception = YAMLException$1; function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { var head = ""; var tail = ""; var maxHalfLength = Math.floor(maxLineLength / 2) - 1; if (position - lineStart > maxHalfLength) { head = " ... "; lineStart = position - maxHalfLength + head.length; } if (lineEnd - position > maxHalfLength) { tail = " ..."; lineEnd = position + maxHalfLength - tail.length; } return { str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, pos: position - lineStart + head.length // relative position }; } function padStart(string, max) { return common.repeat(" ", max - string.length) + string; } function makeSnippet(mark, options) { options = Object.create(options || null); if (!mark.buffer) return null; if (!options.maxLength) options.maxLength = 79; if (typeof options.indent !== "number") options.indent = 1; if (typeof options.linesBefore !== "number") options.linesBefore = 3; if (typeof options.linesAfter !== "number") options.linesAfter = 2; var re = /\r?\n|\r|\0/g; var lineStarts = [0]; var lineEnds = []; var match; var foundLineNo = -1; while (match = re.exec(mark.buffer)) { lineEnds.push(match.index); lineStarts.push(match.index + match[0].length); if (mark.position <= match.index && foundLineNo < 0) { foundLineNo = lineStarts.length - 2; } } if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; var result = "", i6, line; var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); for (i6 = 1; i6 <= options.linesBefore; i6++) { if (foundLineNo - i6 < 0) break; line = getLine( mark.buffer, lineStarts[foundLineNo - i6], lineEnds[foundLineNo - i6], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i6]), maxLineLength ); result = common.repeat(" ", options.indent) + padStart((mark.line - i6 + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result; } line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; for (i6 = 1; i6 <= options.linesAfter; i6++) { if (foundLineNo + i6 >= lineEnds.length) break; line = getLine( mark.buffer, lineStarts[foundLineNo + i6], lineEnds[foundLineNo + i6], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i6]), maxLineLength ); result += common.repeat(" ", options.indent) + padStart((mark.line + i6 + 1).toString(), lineNoLength) + " | " + line.str + "\n"; } return result.replace(/\n$/, ""); } var snippet = makeSnippet; var TYPE_CONSTRUCTOR_OPTIONS = [ "kind", "multi", "resolve", "construct", "instanceOf", "predicate", "represent", "representName", "defaultStyle", "styleAliases" ]; var YAML_NODE_KINDS = [ "scalar", "sequence", "mapping" ]; function compileStyleAliases(map3) { var result = {}; if (map3 !== null) { Object.keys(map3).forEach(function(style) { map3[style].forEach(function(alias) { result[String(alias)] = style; }); }); } return result; } function Type$1(tag, options) { options = options || {}; Object.keys(options).forEach(function(name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); this.options = options; this.tag = tag; this.kind = options["kind"] || null; this.resolve = options["resolve"] || function() { return true; }; this.construct = options["construct"] || function(data) { return data; }; this.instanceOf = options["instanceOf"] || null; this.predicate = options["predicate"] || null; this.represent = options["represent"] || null; this.representName = options["representName"] || null; this.defaultStyle = options["defaultStyle"] || null; this.multi = options["multi"] || false; this.styleAliases = compileStyleAliases(options["styleAliases"] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } var type = Type$1; function compileList(schema2, name) { var result = []; schema2[name].forEach(function(currentType) { var newIndex = result.length; result.forEach(function(previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { newIndex = previousIndex; } }); result[newIndex] = currentType; }); return result; } function compileMap() { var result = { scalar: {}, sequence: {}, mapping: {}, fallback: {}, multi: { scalar: [], sequence: [], mapping: [], fallback: [] } }, index, length; function collectType(type2) { if (type2.multi) { result.multi[type2.kind].push(type2); result.multi["fallback"].push(type2); } else { result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2; } } for (index = 0, length = arguments.length; index < length; index += 1) { arguments[index].forEach(collectType); } return result; } function Schema$1(definition) { return this.extend(definition); } Schema$1.prototype.extend = function extend2(definition) { var implicit = []; var explicit = []; if (definition instanceof type) { explicit.push(definition); } else if (Array.isArray(definition)) { explicit = explicit.concat(definition); } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { if (definition.implicit) implicit = implicit.concat(definition.implicit); if (definition.explicit) explicit = explicit.concat(definition.explicit); } else { throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); } implicit.forEach(function(type$1) { if (!(type$1 instanceof type)) { throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); } if (type$1.loadKind && type$1.loadKind !== "scalar") { throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); } if (type$1.multi) { throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); } }); explicit.forEach(function(type$1) { if (!(type$1 instanceof type)) { throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); } }); var result = Object.create(Schema$1.prototype); result.implicit = (this.implicit || []).concat(implicit); result.explicit = (this.explicit || []).concat(explicit); result.compiledImplicit = compileList(result, "implicit"); result.compiledExplicit = compileList(result, "explicit"); result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); return result; }; var schema = Schema$1; var str = new type("tag:yaml.org,2002:str", { kind: "scalar", construct: function(data) { return data !== null ? data : ""; } }); var seq = new type("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(data) { return data !== null ? data : []; } }); var map = new type("tag:yaml.org,2002:map", { kind: "mapping", construct: function(data) { return data !== null ? data : {}; } }); var failsafe = new schema({ explicit: [ str, seq, map ] }); function resolveYamlNull(data) { if (data === null) return true; var max = data.length; return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); } function constructYamlNull() { return null; } function isNull(object) { return object === null; } var _null = new type("tag:yaml.org,2002:null", { kind: "scalar", resolve: resolveYamlNull, construct: constructYamlNull, predicate: isNull, represent: { canonical: function() { return "~"; }, lowercase: function() { return "null"; }, uppercase: function() { return "NULL"; }, camelcase: function() { return "Null"; }, empty: function() { return ""; } }, defaultStyle: "lowercase" }); function resolveYamlBoolean(data) { if (data === null) return false; var max = data.length; return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); } function constructYamlBoolean(data) { return data === "true" || data === "True" || data === "TRUE"; } function isBoolean(object) { return Object.prototype.toString.call(object) === "[object Boolean]"; } var bool = new type("tag:yaml.org,2002:bool", { kind: "scalar", resolve: resolveYamlBoolean, construct: constructYamlBoolean, predicate: isBoolean, represent: { lowercase: function(object) { return object ? "true" : "false"; }, uppercase: function(object) { return object ? "TRUE" : "FALSE"; }, camelcase: function(object) { return object ? "True" : "False"; } }, defaultStyle: "lowercase" }); function isHexCode(c5) { return 48 <= c5 && c5 <= 57 || 65 <= c5 && c5 <= 70 || 97 <= c5 && c5 <= 102; } function isOctCode(c5) { return 48 <= c5 && c5 <= 55; } function isDecCode(c5) { return 48 <= c5 && c5 <= 57; } function resolveYamlInteger(data) { if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; if (!max) return false; ch = data[index]; if (ch === "-" || ch === "+") { ch = data[++index]; } if (ch === "0") { if (index + 1 === max) return true; ch = data[++index]; if (ch === "b") { index++; for (; index < max; index++) { ch = data[index]; if (ch === "_") continue; if (ch !== "0" && ch !== "1") return false; hasDigits = true; } return hasDigits && ch !== "_"; } if (ch === "x") { index++; for (; index < max; index++) { ch = data[index]; if (ch === "_") continue; if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== "_"; } if (ch === "o") { index++; for (; index < max; index++) { ch = data[index]; if (ch === "_") continue; if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== "_"; } } if (ch === "_") return false; for (; index < max; index++) { ch = data[index]; if (ch === "_") continue; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } if (!hasDigits || ch === "_") return false; return true; } function constructYamlInteger(data) { var value = data, sign = 1, ch; if (value.indexOf("_") !== -1) { value = value.replace(/_/g, ""); } ch = value[0]; if (ch === "-" || ch === "+") { if (ch === "-") sign = -1; value = value.slice(1); ch = value[0]; } if (value === "0") return 0; if (ch === "0") { if (value[1] === "b") return sign * parseInt(value.slice(2), 2); if (value[1] === "x") return sign * parseInt(value.slice(2), 16); if (value[1] === "o") return sign * parseInt(value.slice(2), 8); } return sign * parseInt(value, 10); } function isInteger(object) { return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object)); } var int = new type("tag:yaml.org,2002:int", { kind: "scalar", resolve: resolveYamlInteger, construct: constructYamlInteger, predicate: isInteger, represent: { binary: function(obj) { return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); }, octal: function(obj) { return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); }, decimal: function(obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function(obj) { return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); } }, defaultStyle: "decimal", styleAliases: { binary: [2, "bin"], octal: [8, "oct"], decimal: [10, "dec"], hexadecimal: [16, "hex"] } }); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" ); function resolveYamlFloat(data) { if (data === null) return false; if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length - 1] === "_") { return false; } return true; } function constructYamlFloat(data) { var value, sign; value = data.replace(/_/g, "").toLowerCase(); sign = value[0] === "-" ? -1 : 1; if ("+-".indexOf(value[0]) >= 0) { value = value.slice(1); } if (value === ".inf") { return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; } else if (value === ".nan") { return NaN; } return sign * parseFloat(value, 10); } var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; function representYamlFloat(object, style) { var res; if (isNaN(object)) { switch (style) { case "lowercase": return ".nan"; case "uppercase": return ".NAN"; case "camelcase": return ".NaN"; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { case "lowercase": return ".inf"; case "uppercase": return ".INF"; case "camelcase": return ".Inf"; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { case "lowercase": return "-.inf"; case "uppercase": return "-.INF"; case "camelcase": return "-.Inf"; } } else if (common.isNegativeZero(object)) { return "-0.0"; } res = object.toString(10); return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; } function isFloat(object) { return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); } var float = new type("tag:yaml.org,2002:float", { kind: "scalar", resolve: resolveYamlFloat, construct: constructYamlFloat, predicate: isFloat, represent: representYamlFloat, defaultStyle: "lowercase" }); var json = failsafe.extend({ implicit: [ _null, bool, int, float ] }); var core = json; var YAML_DATE_REGEXP = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" ); var YAML_TIMESTAMP_REGEXP = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]