@spectric/ui 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ThemeProvider.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/table/virtualBody.d.ts +2 -1
- package/dist/custom-elements.json +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +719 -675
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +70 -67
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Button.ts +1 -1
- package/src/components/ThemeProvider.ts +34 -1
- package/src/components/button.css.ts +2 -2
- package/src/components/color_picker/ColorPicker.css +36 -0
- package/src/components/color_picker/ColorPicker.ts +31 -7
- package/src/components/input.css +4 -33
- package/src/components/input.ts +4 -2
- package/src/components/pagination/pagination.ts +2 -2
- package/src/components/table/__tests__/table.spec.ts +1 -1
- package/src/components/table/header.ts +0 -3
- package/src/components/table/table.ts +1 -1
- package/src/components/table/virtualBody.ts +16 -5
- package/src/components/tooltip/popover.ts +7 -7
- package/src/components/tooltip/tooltip.css +1 -1
- package/src/components/tooltip/tooltip.ts +1 -0
- package/src/stories/fixtures/ExampleContent.ts +1 -0
- package/src/stories/table.stories.ts +1 -2
package/dist/index.umd.js
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var
|
|
5
|
+
*/var zi;const se=globalThis,Mt=se.ShadowRoot&&(se.ShadyCSS===void 0||se.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,It=Symbol(),qr=new WeakMap;let Wr=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==It)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Mt&&e===void 0){const i=n!==void 0&&n.length===1;i&&(e=qr.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&qr.set(n,e))}return e}toString(){return this.cssText}};const Fs=s=>new Wr(typeof s=="string"?s:s+"",void 0,It),I=(s,...e)=>{const n=s.length===1?s[0]:e.reduce((i,o,t)=>i+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+s[t+1],s[0]);return new Wr(n,s,It)},Qs=(s,e)=>{if(Mt)s.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const i=document.createElement("style"),o=se.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=n.cssText,s.appendChild(i)}},Vr=Mt?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let n="";for(const i of e.cssRules)n+=i.cssText;return Fs(n)})(s):s;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:qs,defineProperty:Ws,getOwnPropertyDescriptor:Vs,getOwnPropertyNames:Ys,getOwnPropertySymbols:Zs,getPrototypeOf:Ks}=Object,ne=globalThis,Yr=ne.trustedTypes,Xs=Yr?Yr.emptyScript:"",Ht=ne.reactiveElementPolyfillSupport,qe=(s,e)=>s,pt={toAttribute(s,e){switch(e){case Boolean:s=s?Xs:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let n=s;switch(e){case Boolean:n=s!==null;break;case Number:n=s===null?null:Number(s);break;case Object:case Array:try{n=JSON.parse(s)}catch{n=null}}return n}},Ut=(s,e)=>!qs(s,e),Zr={attribute:!0,type:String,converter:pt,reflect:!1,hasChanged:Ut};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ne.litPropertyMetadata??(ne.litPropertyMetadata=new WeakMap);class Te extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Zr){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,n);o!==void 0&&Ws(this.prototype,e,o)}}static getPropertyDescriptor(e,n,i){const{get:o,set:t}=Vs(this.prototype,e)??{get(){return this[n]},set(l){this[n]=l}};return{get(){return o==null?void 0:o.call(this)},set(l){const d=o==null?void 0:o.call(this);t.call(this,l),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Zr}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;const e=Ks(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){const n=this.properties,i=[...Ys(n),...Zs(n)];for(const o of i)this.createProperty(o,n[o])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[i,o]of n)this.elementProperties.set(i,o)}this._$Eh=new Map;for(const[n,i]of this.elementProperties){const o=this._$Eu(n,i);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)n.unshift(Vr(o))}else e!==void 0&&n.push(Vr(e));return n}static _$Eu(e,n){const i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)==null||n.call(e))}removeController(e){var n;(n=this._$EO)==null||n.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qs(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(n=>{var i;return(i=n.hostConnected)==null?void 0:i.call(n)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(n=>{var i;return(i=n.hostDisconnected)==null?void 0:i.call(n)})}attributeChangedCallback(e,n,i){this._$AK(e,i)}_$EC(e,n){var t;const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(o!==void 0&&i.reflect===!0){const l=(((t=i.converter)==null?void 0:t.toAttribute)!==void 0?i.converter:pt).toAttribute(n,i.type);this._$Em=e,l==null?this.removeAttribute(o):this.setAttribute(o,l),this._$Em=null}}_$AK(e,n){var t;const i=this.constructor,o=i._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const l=i.getPropertyOptions(o),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((t=l.converter)==null?void 0:t.fromAttribute)!==void 0?l.converter:pt;this._$Em=o,this[o]=d.fromAttribute(n,l.type),this._$Em=null}}requestUpdate(e,n,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Ut)(this[e],n))return;this.P(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,n,i){this._$AL.has(e)||this._$AL.set(e,n),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,l]of this._$Ep)this[t]=l;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[t,l]of o)l.wrapped!==!0||this._$AL.has(t)||this[t]===void 0||this.P(t,this[t],l)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(o=>{var t;return(t=o.hostUpdate)==null?void 0:t.call(o)}),this.update(n)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$EO)==null||n.forEach(i=>{var o;return(o=i.hostUpdated)==null?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(e){}firstUpdated(e){}}Te.elementStyles=[],Te.shadowRootOptions={mode:"open"},Te[qe("elementProperties")]=new Map,Te[qe("finalized")]=new Map,Ht==null||Ht({ReactiveElement:Te}),(ne.reactiveElementVersions??(ne.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const We=globalThis,ut=We.trustedTypes,Kr=ut?ut.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ft="$lit$",te=`lit$${Math.random().toFixed(9).slice(2)}$`,Qt="?"+te,
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const We=globalThis,ut=We.trustedTypes,Kr=ut?ut.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ft="$lit$",te=`lit$${Math.random().toFixed(9).slice(2)}$`,Qt="?"+te,Gs=`<${Qt}>`,ge=document,Ve=()=>ge.createComment(""),Ye=s=>s===null||typeof s!="object"&&typeof s!="function",qt=Array.isArray,Xr=s=>qt(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Wt=`[
|
|
14
|
+
\f\r]`,Ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gr=/-->/g,Jr=/>/g,ve=RegExp(`>|${Wt}(?:([^\\s"'>=/]+)(${Wt}*=${Wt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ti=/"/g,ri=/^(?:script|style|textarea|title)$/i,Js=s=>(e,...n)=>({_$litType$:s,strings:e,values:n}),S=Js(1),oe=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),ii=new WeakMap,be=ge.createTreeWalker(ge,129);function si(s,e){if(!qt(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kr!==void 0?Kr.createHTML(e):e}const ni=(s,e)=>{const n=s.length-1,i=[];let o,t=e===2?"<svg>":e===3?"<math>":"",l=Ze;for(let d=0;d<n;d++){const f=s[d];let y,x,$=-1,E=0;for(;E<f.length&&(l.lastIndex=E,x=l.exec(f),x!==null);)E=l.lastIndex,l===Ze?x[1]==="!--"?l=Gr:x[1]!==void 0?l=Jr:x[2]!==void 0?(ri.test(x[2])&&(o=RegExp("</"+x[2],"g")),l=ve):x[3]!==void 0&&(l=ve):l===ve?x[0]===">"?(l=o??Ze,$=-1):x[1]===void 0?$=-2:($=l.lastIndex-x[2].length,y=x[1],l=x[3]===void 0?ve:x[3]==='"'?ti:ei):l===ti||l===ei?l=ve:l===Gr||l===Jr?l=Ze:(l=ve,o=void 0);const C=l===ve&&s[d+1].startsWith("/>")?" ":"";t+=l===Ze?f+Gs:$>=0?(i.push(y),f.slice(0,$)+Ft+f.slice($)+te+C):f+te+($===-2?d:C)}return[si(s,t+(s[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Ke{constructor({strings:e,_$litType$:n},i){let o;this.parts=[];let t=0,l=0;const d=e.length-1,f=this.parts,[y,x]=ni(e,n);if(this.el=Ke.createElement(y,i),be.currentNode=this.el.content,n===2||n===3){const $=this.el.content.firstChild;$.replaceWith(...$.childNodes)}for(;(o=be.nextNode())!==null&&f.length<d;){if(o.nodeType===1){if(o.hasAttributes())for(const $ of o.getAttributeNames())if($.endsWith(Ft)){const E=x[l++],C=o.getAttribute($).split(te),k=/([.?@])?(.*)/.exec(E);f.push({type:1,index:t,name:k[2],strings:C,ctor:k[1]==="."?ai:k[1]==="?"?ci:k[1]==="@"?li:Xe}),o.removeAttribute($)}else $.startsWith(te)&&(f.push({type:6,index:t}),o.removeAttribute($));if(ri.test(o.tagName)){const $=o.textContent.split(te),E=$.length-1;if(E>0){o.textContent=ut?ut.emptyScript:"";for(let C=0;C<E;C++)o.append($[C],Ve()),be.nextNode(),f.push({type:2,index:++t});o.append($[E],Ve())}}}else if(o.nodeType===8)if(o.data===Qt)f.push({type:2,index:t});else{let $=-1;for(;($=o.data.indexOf(te,$+1))!==-1;)f.push({type:7,index:t}),$+=te.length-1}t++}}static createElement(e,n){const i=ge.createElement("template");return i.innerHTML=e,i}}function me(s,e,n=s,i){var l,d;if(e===oe)return e;let o=i!==void 0?(l=n._$Co)==null?void 0:l[i]:n._$Cl;const t=Ye(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==t&&((d=o==null?void 0:o._$AO)==null||d.call(o,!1),t===void 0?o=void 0:(o=new t(s),o._$AT(s,n,i)),i!==void 0?(n._$Co??(n._$Co=[]))[i]=o:n._$Cl=o),o!==void 0&&(e=me(s,o._$AS(s,e.values),o,i)),e}let oi=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:i}=this._$AD,o=((e==null?void 0:e.creationScope)??ge).importNode(n,!0);be.currentNode=o;let t=be.nextNode(),l=0,d=0,f=i[0];for(;f!==void 0;){if(l===f.index){let y;f.type===2?y=new Oe(t,t.nextSibling,this,e):f.type===1?y=new f.ctor(t,f.name,f.strings,this,e):f.type===6&&(y=new pi(t,this,e)),this._$AV.push(y),f=i[++d]}l!==(f==null?void 0:f.index)&&(t=be.nextNode(),l++)}return be.currentNode=ge,o}p(e){let n=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}};class Oe{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,n,i,o){this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=me(this,e,n),Ye(e)?e===P||e==null||e===""?(this._$AH!==P&&this._$AR(),this._$AH=P):e!==this._$AH&&e!==oe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==P&&Ye(this._$AH)?this._$AA.nextSibling.data=e:this.T(ge.createTextNode(e)),this._$AH=e}$(e){var t;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ke.createElement(si(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===o)this._$AH.p(n);else{const l=new oi(o,this),d=l.u(this.options);l.p(n),this.T(d),this._$AH=l}}_$AC(e){let n=ii.get(e.strings);return n===void 0&&ii.set(e.strings,n=new Ke(e)),n}k(e){qt(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,o=0;for(const t of e)o===n.length?n.push(i=new Oe(this.O(Ve()),this.O(Ve()),this,this.options)):i=n[o],i._$AI(t),o++;o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}_$AR(e=this._$AA.nextSibling,n){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,n);e&&e!==this._$AB;){const o=e.nextSibling;e.remove(),e=o}}setConnected(e){var n;this._$AM===void 0&&(this._$Cv=e,(n=this._$AP)==null||n.call(this,e))}}class Xe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,o,t){this.type=1,this._$AH=P,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=t,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=P}_$AI(e,n=this,i,o){const t=this.strings;let l=!1;if(t===void 0)e=me(this,e,n,0),l=!Ye(e)||e!==this._$AH&&e!==oe,l&&(this._$AH=e);else{const d=e;let f,y;for(e=t[0],f=0;f<t.length-1;f++)y=me(this,d[i+f],n,f),y===oe&&(y=this._$AH[f]),l||(l=!Ye(y)||y!==this._$AH[f]),y===P?e=P:e!==P&&(e+=(y??"")+t[f+1]),this._$AH[f]=y}l&&!o&&this.j(e)}j(e){e===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ai extends Xe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===P?void 0:e}}class ci extends Xe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==P)}}class li extends Xe{constructor(e,n,i,o,t){super(e,n,i,o,t),this.type=5}_$AI(e,n=this){if((e=me(this,e,n,0)??P)===oe)return;const i=this._$AH,o=e===P&&i!==P||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,t=e!==P&&(i===P||o);o&&this.element.removeEventListener(this.name,this,i),t&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,e):this._$AH.handleEvent(e)}}class pi{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){me(this,e)}}const en={M:Ft,P:te,A:Qt,C:1,L:ni,R:oi,D:Xr,V:me,I:Oe,H:Xe,N:ci,U:li,B:ai,F:pi},Vt=We.litHtmlPolyfillSupport;Vt==null||Vt(Ke,Oe),(We.litHtmlVersions??(We.litHtmlVersions=[])).push("3.2.1");const Ge=(s,e,n)=>{const i=(n==null?void 0:n.renderBefore)??e;let o=i._$litPart$;if(o===void 0){const t=(n==null?void 0:n.renderBefore)??null;i._$litPart$=o=new Oe(e.insertBefore(Ve(),t),t,void 0,n??{})}return o._$AI(s),o};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let D=class extends Te{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const e=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ge(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return oe}};D._$litElement$=!0,D.finalized=!0,(
|
|
19
|
+
*/let D=class extends Te{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const e=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ge(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return oe}};D._$litElement$=!0,D.finalized=!0,(zi=globalThis.litElementHydrateSupport)==null||zi.call(globalThis,{LitElement:D});const Yt=globalThis.litElementPolyfillSupport;Yt==null||Yt({LitElement:D}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const Zt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Je=s=>(...e)=>({_$litDirective$:s,values:e});let ht=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,i){this._$Ct=e,this._$AM=n,this._$Ci=i}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2018 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const ui="important",tn=" !"+ui,Kt=Je(class extends ht{constructor(s){var e;if(super(s),s.type!==Zt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,n)=>{const i=s[n];return i==null?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[e]){const{style:n}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?n.removeProperty(i):n[i]=null);for(const i in e){const o=e[i];if(o!=null){this.ft.add(i);const t=typeof o=="string"&&o.endsWith(tn);i.includes("-")||t?n.setProperty(i,t?o.slice(0,-11):o,t?ui:""):n[i]=o}}return oe}}),rn=I`
|
|
28
28
|
:host{
|
|
29
29
|
display: inline-block;
|
|
30
30
|
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
height: 10px;
|
|
142
142
|
}
|
|
143
143
|
:host([icon][size="xxsmall"]) .spectric-button{
|
|
144
|
-
width:
|
|
145
|
-
height:
|
|
144
|
+
width: 16px;
|
|
145
|
+
height: 16px;
|
|
146
146
|
}
|
|
147
147
|
:host([icon][size="xsmall"]) .spectric-button{
|
|
148
148
|
width: 28px;
|
|
@@ -273,7 +273,7 @@ opacity:1
|
|
|
273
273
|
* @license
|
|
274
274
|
* Copyright 2017 Google LLC
|
|
275
275
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
276
|
-
*/const
|
|
276
|
+
*/const sn={attribute:!0,type:String,converter:pt,reflect:!1,hasChanged:Ut},nn=(s=sn,e,n)=>{const{kind:i,metadata:o}=n;let t=globalThis.litPropertyMetadata.get(o);if(t===void 0&&globalThis.litPropertyMetadata.set(o,t=new Map),t.set(n.name,s),i==="accessor"){const{name:l}=n;return{set(d){const f=e.get.call(this);e.set.call(this,d),this.requestUpdate(l,f,s)},init(d){return d!==void 0&&this.P(l,void 0,s),d}}}if(i==="setter"){const{name:l}=n;return function(d){const f=this[l];e.call(this,d),this.requestUpdate(l,f,s)}}throw Error("Unsupported decorator location: "+i)};function b(s){return(e,n)=>typeof n=="object"?nn(s,e,n):((i,o,t)=>{const l=o.hasOwnProperty(t);return o.constructor.createProperty(t,l?{...i,wrapped:!0}:i),l?Object.getOwnPropertyDescriptor(o,t):void 0})(s,e,n)}/**
|
|
277
277
|
* @license
|
|
278
278
|
* Copyright 2017 Google LLC
|
|
279
279
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -281,42 +281,42 @@ opacity:1
|
|
|
281
281
|
* @license
|
|
282
282
|
* Copyright 2017 Google LLC
|
|
283
283
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
284
|
-
*/function
|
|
284
|
+
*/function on(s){return(e,n)=>{const i=typeof e=="function"?e:e[n];Object.assign(i,s)}}/**
|
|
285
285
|
* @license
|
|
286
286
|
* Copyright 2017 Google LLC
|
|
287
287
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
288
|
-
*/const
|
|
288
|
+
*/const hi=(s,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(s,e,n),n);/**
|
|
289
289
|
* @license
|
|
290
290
|
* Copyright 2017 Google LLC
|
|
291
291
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
292
|
-
*/function ye(s,e){return(n,i,o)=>{const t=
|
|
292
|
+
*/function ye(s,e){return(n,i,o)=>{const t=l=>{var d;return((d=l.renderRoot)==null?void 0:d.querySelector(s))??null};return hi(n,i,{get(){return t(this)}})}}/**
|
|
293
293
|
* @license
|
|
294
294
|
* Copyright 2017 Google LLC
|
|
295
295
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
296
|
-
*/function dt(s){return(e,n)=>
|
|
297
|
-
${this.tooltip?S`<spectric-tooltip .text=${this.tooltip} .position=${this.tooltipPosition||"right"} .triggerTarget=${this}></spectric-tooltip>`:null}
|
|
296
|
+
*/function dt(s){return(e,n)=>hi(e,n,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(s))??null}})}let Xt=0;const di=()=>Xt;class fi{constructor(e,n,i,o){this._handler=i,this._type=n,this._handler=i,this._options=o||!1,e instanceof Promise?e.then(t=>{this._handler&&(this._node=t,this._node.addEventListener(this._type,this._handler,this._options))}):typeof e=="function"?(this._node=e(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=e,this._node.addEventListener(this._type,this._handler,this._options)),Xt+=1}dispose(){this._handler&&(this._node&&(Xt-=1,this._node.removeEventListener(this._type,this._handler,this._options)),this._node=void 0,this._handler=void 0)}}class ae extends D{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(e,n,i,o){if(this._disposableListeners.find(l=>l.event===n&&l.target===e&&l.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:e,event:n,handler:i,options:o}),this._connected&&this.registerDisposable(new fi(e,n,i,o))}registerDisposable(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(e),e}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:e,event:n,handler:i,options:o})=>{this.registerDisposable(new fi(e,n,i,o))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(e=>{e.dispose()}),this._isDisposed=!0}}var an=Object.defineProperty,cn=Object.getOwnPropertyDescriptor,V=(s,e,n,i)=>{for(var o=i>1?void 0:i?cn(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&an(e,n,o),o},Gt=(s=>(s.large="large",s.medium="medium",s.small="small",s.xsmall="xsmall",s.xxsmall="xxsmall",s.tiny="tiny",s))(Gt||{}),Jt=(s=>(s.primary="primary",s.secondary="secondary",s.text="text",s))(Jt||{});const ln={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};h.SpectricButton=class extends ae{constructor(){super(),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=e=>{if(e instanceof CustomEvent||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this.disabled))return;const n={bubbles:!0,composed:!0,detail:e};this.dispatchEvent(new CustomEvent("click",n))},this.addDisposableListener(this,"click",this._onClick,{capture:!0})}render(){const e=ln[this.variant]||"spectric-button--primary";return S`
|
|
297
|
+
${this.tooltip&&this.tooltip!==""?S`<spectric-tooltip .text=${this.tooltip} .position=${this.tooltipPosition||"right"} .triggerTarget=${this}></spectric-tooltip>`:null}
|
|
298
298
|
<button
|
|
299
299
|
type="button"
|
|
300
300
|
?disabled=${this.disabled}
|
|
301
301
|
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,e].join(" ")}
|
|
302
|
-
style=${
|
|
302
|
+
style=${Kt({backgroundColor:this.backgroundColor})}
|
|
303
303
|
>
|
|
304
304
|
<span class="animation"></span>
|
|
305
305
|
<slot>${this.label}</slot>
|
|
306
306
|
</button>
|
|
307
|
-
`}},h.SpectricButton.styles=
|
|
307
|
+
`}},h.SpectricButton.styles=rn,V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"variant",2),V([b({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"disabled",2),V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"backgroundColor",2),V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"size",2),V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"label",2),V([b({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"danger",2),V([b({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"icon",2),V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltip",2),V([b({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltipPosition",2),h.SpectricButton=V([O("spectric-button")],h.SpectricButton);/**
|
|
308
308
|
* @license
|
|
309
309
|
* Copyright 2020 Google LLC
|
|
310
310
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
311
|
-
*/const{I:
|
|
311
|
+
*/const{I:pn}=en,gi=(s,e)=>(s==null?void 0:s._$litType$)!==void 0,un=s=>{var e;return((e=s==null?void 0:s._$litType$)==null?void 0:e.h)!=null},hn=s=>s.strings===void 0,vi=()=>document.createComment(""),$e=(s,e,n)=>{var t;const i=s._$AA.parentNode,o=e===void 0?s._$AB:e._$AA;if(n===void 0){const l=i.insertBefore(vi(),o),d=i.insertBefore(vi(),o);n=new pn(l,d,s,s.options)}else{const l=n._$AB.nextSibling,d=n._$AM,f=d!==s;if(f){let y;(t=n._$AQ)==null||t.call(n,s),n._$AM=s,n._$AP!==void 0&&(y=s._$AU)!==d._$AU&&n._$AP(y)}if(l!==o||f){let y=n._$AA;for(;y!==l;){const x=y.nextSibling;i.insertBefore(y,o),y=x}}}return n},we=(s,e,n=s)=>(s._$AI(e,n),s),dn={},er=(s,e=dn)=>s._$AH=e,tr=s=>s._$AH,rr=s=>{var i;(i=s._$AP)==null||i.call(s,!1,!0);let e=s._$AA;const n=s._$AB.nextSibling;for(;e!==n;){const o=e.nextSibling;e.remove(),e=o}},fn=s=>{s._$AR()};/**
|
|
312
312
|
* @license
|
|
313
313
|
* Copyright 2017 Google LLC
|
|
314
314
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
315
|
-
*/const et=(s,e)=>{var i;const n=s._$AN;if(n===void 0)return!1;for(const o of n)(i=o._$AO)==null||i.call(o,e,!1),et(o,e);return!0},ft=s=>{let e,n;do{if((e=s._$AM)===void 0)break;n=e._$AN,n.delete(s),s=e}while((n==null?void 0:n.size)===0)},
|
|
315
|
+
*/const et=(s,e)=>{var i;const n=s._$AN;if(n===void 0)return!1;for(const o of n)(i=o._$AO)==null||i.call(o,e,!1),et(o,e);return!0},ft=s=>{let e,n;do{if((e=s._$AM)===void 0)break;n=e._$AN,n.delete(s),s=e}while((n==null?void 0:n.size)===0)},bi=s=>{for(let e;e=s._$AM;s=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(s))break;n.add(s),bn(e)}};function gn(s){this._$AN!==void 0?(ft(this),this._$AM=s,bi(this)):this._$AM=s}function vn(s,e=!1,n=0){const i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(let t=n;t<i.length;t++)et(i[t],!1),ft(i[t]);else i!=null&&(et(i,!1),ft(i));else et(this,s)}const bn=s=>{s.type==Zt.CHILD&&(s._$AP??(s._$AP=vn),s._$AQ??(s._$AQ=gn))};class mi extends ht{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,i){super._$AT(e,n,i),bi(this),this.isConnected=e._$AU}_$AO(e,n=!0){var i,o;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(o=this.disconnected)==null||o.call(this)),n&&(et(this,e),ft(this))}setValue(e){if(hn(this._$Ct))this._$Ct._$AI(e,this);else{const n=[...this._$Ct._$AH];n[this._$Ci]=e,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}/**
|
|
316
316
|
* @license
|
|
317
317
|
* Copyright 2020 Google LLC
|
|
318
318
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
319
|
-
*/const tt=()=>new
|
|
319
|
+
*/const tt=()=>new mn;let mn=class{};const ir=new WeakMap,rt=Je(class extends mi{render(s){return P}update(s,[e]){var i;const n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),P}rt(s){if(this.isConnected||(s=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let n=ir.get(e);n===void 0&&(n=new WeakMap,ir.set(e,n)),n.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),n.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,e;return typeof this.Y=="function"?(s=ir.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),sr=class{constructor(e){return this.buffer=e,this.u8=new Uint8Array(e),new Proxy(this,{get(n,i){return n[i]?n[i]:n.getBit(i)}})}getBit(e){var n=this.u8[e>>3],i=e&7;return n>>7-i&1}setBit(e,n){var i=e&7;n?this.u8[e>>3]|=128>>i:this.u8[e>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(e,n){for(let i=n||0,o=0,t=e.length;o<t;i++,o++)this.setBit(i,e[o])}subarray(e,n){let i=[];e=e||0,n=n||this.length,n=n>this.length?this.length:n;for(let o=e;o<n;o++)i.push(this.getBit(o));return i}},yi=(s,e)=>{let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>s.apply(void 0,i),e)}},gt=s=>{var e;return(...n)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{s.apply(void 0,n)})}};var yn=Object.defineProperty,$n=Object.getOwnPropertyDescriptor,_e=(s,e,n,i)=>{for(var o=i>1?void 0:i?$n(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&yn(e,n,o),o};const wn=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],vt={width:200,height:200},bt={width:10,height:10};h.BitDisplayCanvas=class extends ae{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:tt(),canvas:tt(),scrollDiv:tt()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let e=new ResizeObserver(this.onResize);e.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=e,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var n={};wn.forEach(i=>{this.addDisposableListener(this._canvas,i,gt(async o=>{o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault();var t=await this._canvas;let l=t.getBoundingClientRect(),d={x:Math.floor(Math.abs(o.clientX-l.left)),y:Math.floor(Math.abs(o.clientY-l.top))},f=this.canvasPositionToBit(d);if(i==="mousemove"&&n[i]==f)return;n[i]=f;let y="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(f!=-1){let x=new CustomEvent(y,{detail:{bitIndex:f,position:d,nativeEvent:o}});this.dispatchEvent(x)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(e){e.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new sr(this.arrayBuffer));const n=["arrayBuffer","scale","frameWidth","width","height"];for(const i of n)if(e.has(i)){this.paint();return}}canvasPositionToBit(e){let n=Math.floor(e.x/this.scale),i=Math.floor(e.y/this.scale);return n>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+n)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:e,_bitArray:n}=this;if(e<=0)return;this.calculateViewport();const{width:i=vt.width,height:o=vt.height}=this,t=this.getPxPerBit(),l=this.refs.canvas.value.getContext("2d");if(!l)return;this.state.scale!=t&&(l.reset(),l.scale(t,t));let d=getComputedStyle(this);l.fillStyle=d.color,l.clearRect(0,0,i,o);let f=0;for(let y=this.yStart*e+this.xStart,x=n.length;y<x;y++){let $=y%e-this.xStart;if(!($<0)){if(Math.floor($*t)>i){f++,y=f*e+this.yStart*e+this.xStart-1;continue}if(Math.floor(f*t)>o)break;n.getBit(y)===1&&l.fillRect($,f,1,1),(y+1)%e===0&&y>=e-1&&f++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:e,_bitArray:n}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const o=n.length/e*i,t=e*i,l=this.refs.scrollDiv.value;l.style.width=t+"px",l.style.height=o+"px"}}render(){const{height:e=vt.height,width:n=vt.width}=this;return S`
|
|
320
320
|
<div
|
|
321
321
|
id="viewport"
|
|
322
322
|
${rt(this.refs.viewport)}
|
|
@@ -430,7 +430,7 @@ opacity:1
|
|
|
430
430
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
`,_e([b({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"width",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"height",2),_e([dt("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=_e([O("spectric-bit-display")],h.BitDisplayCanvas);const
|
|
433
|
+
`,_e([b({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"width",2),_e([b({type:Number})],h.BitDisplayCanvas.prototype,"height",2),_e([dt("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=_e([O("spectric-bit-display")],h.BitDisplayCanvas);const _n=I`.spectric-header {
|
|
434
434
|
display: flex;
|
|
435
435
|
justify-content: space-between;
|
|
436
436
|
align-items: center;
|
|
@@ -465,7 +465,7 @@ opacity:1
|
|
|
465
465
|
color: #333;
|
|
466
466
|
font-size: 14px;
|
|
467
467
|
}
|
|
468
|
-
`;var
|
|
468
|
+
`;var Sn=Object.defineProperty,An=Object.getOwnPropertyDescriptor,mt=(s,e,n,i)=>{for(var o=i>1?void 0:i?An(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Sn(e,n,o),o};h.Header=class extends D{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",e))},this.onLogin=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",e))},this.onCreateAccount=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",e))}}render(){return S`
|
|
469
469
|
<header>
|
|
470
470
|
<div class="spectric-header">
|
|
471
471
|
<div style="flex-grow:1;">
|
|
@@ -484,12 +484,12 @@ opacity:1
|
|
|
484
484
|
<slot name="end"></slot>
|
|
485
485
|
</div>
|
|
486
486
|
</header>
|
|
487
|
-
`}},h.Header.styles=
|
|
488
|
-
<header style=${
|
|
487
|
+
`}},h.Header.styles=_n,mt([b({type:Boolean,reflect:!0})],h.Header.prototype,"showCreateAccount",2),mt([b({type:Boolean,reflect:!0})],h.Header.prototype,"showLoginButton",2),mt([b({type:String,reflect:!0})],h.Header.prototype,"username",2),h.Header=mt([O("spectric-header")],h.Header);var xn=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,De=(s,e,n,i)=>{for(var o=i>1?void 0:i?Cn(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&xn(e,n,o),o};const En={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let Se=class extends D{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=s=>{s.preventDefault(),s.stopPropagation();const e={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:n,text:i,headerStyle:o,dismissable:t}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:n,text:i,headerStyle:o,dismissable:t},...e}))}}render(){if(!this._dismissed)return S`
|
|
488
|
+
<header style=${Kt({...En,...this.headerStyle})}>
|
|
489
489
|
<div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
|
|
490
490
|
${this.dismissable?S`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
|
|
491
491
|
</header>
|
|
492
|
-
`}};De([b({type:Boolean,reflect:!0})],Se.prototype,"dismissable",2),De([b({type:String,reflect:!0})],Se.prototype,"text",2),De([b({type:String,reflect:!0})],Se.prototype,"bannerId",2),De([b({type:Object})],Se.prototype,"headerStyle",2),De([b({state:!0,type:Boolean,attribute:!1})],Se.prototype,"_dismissed",2),Se=De([O("spectric-banner")],Se);const
|
|
492
|
+
`}};De([b({type:Boolean,reflect:!0})],Se.prototype,"dismissable",2),De([b({type:String,reflect:!0})],Se.prototype,"text",2),De([b({type:String,reflect:!0})],Se.prototype,"bannerId",2),De([b({type:Object})],Se.prototype,"headerStyle",2),De([b({state:!0,type:Boolean,attribute:!1})],Se.prototype,"_dismissed",2),Se=De([O("spectric-banner")],Se);const kn=I`
|
|
493
493
|
|
|
494
494
|
:host {
|
|
495
495
|
height:100vh;
|
|
@@ -649,7 +649,7 @@ article{
|
|
|
649
649
|
* @license
|
|
650
650
|
* Copyright 2018 Google LLC
|
|
651
651
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
652
|
-
*/const nr=s=>s??P;class or extends
|
|
652
|
+
*/const nr=s=>s??P;class or extends mi{constructor(){super(...arguments),this.prevData={}}render(e){return P}update(e,[n]){var i;this.element!==e.element&&(this.element=e.element),this.host=((i=e.options)==null?void 0:i.host)||this.element,this.apply(n),this.groom(n),this.prevData={...n}}apply(e){if(!e)return;const{element:n}=this;for(const i in e){const o=e[i];n[i]!==o&&(n[i]=o)}}groom(e){const{prevData:n,element:i}=this;if(n)for(const o in n)(!e||!(o in e)&&i[o]===n[o])&&(i[o]=void 0)}}const Ae=Je(or);var ar=(s=>(s.None="none",s.Uscui="us.cui",s.Usclassified="us.classified",s.Usunclassified="us.unclassified",s.Usconfidential="us.confidential",s.Ussecret="us.secret",s.Ustopsecret="us.topsecret",s.UstopsecretSi="us.topsecret.si",s.Uknotset="uk.notset",s.Ukofficial="uk.official",s.Uksecret="uk.secret",s.Uktopsecret="uk.topsecret",s.Caprotected_a="ca.protected_a",s.Caprotected_b="ca.protected_b",s.Caprotected_c="ca.protected_c",s.Caconfidential="ca.confidential",s.Casecret="ca.secret",s.Catopsecret="ca.topsecret",s.Auunofficial="au.unofficial",s.Auofficial="au.official",s.Auofficialsensitive="au.officialsensitive",s.Auconfidential="au.confidential",s.Ausecret="au.secret",s.Autopsecret="au.topsecret",s))(ar||{});const yt={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var Pn=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,Y=(s,e,n,i)=>{for(var o=i>1?void 0:i?Tn(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Pn(e,n,o),o};h.SpectricPage=class extends D{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=ar.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!yt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=ar.None);const e=this.classificationLevel?this.classificationText||yt[this.classificationLevel].content:"",n=this.showHeader?S`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${nr(this.username)}>
|
|
653
653
|
<slot name="branding" slot="branding"></slot>
|
|
654
654
|
<slot name="name" slot="name"></slot>
|
|
655
655
|
<slot name="center" slot="center"></slot>
|
|
@@ -672,7 +672,7 @@ article{
|
|
|
672
672
|
</spectric-theme>
|
|
673
673
|
${this.classificationLevel&&e?S`<spectric-banner ${Ae({text:e,headerStyle:yt[this.classificationLevel]})}></spectric-banner>`:null}
|
|
674
674
|
|
|
675
|
-
`}},h.SpectricPage.styles=
|
|
675
|
+
`}},h.SpectricPage.styles=kn,Y([b({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showHeader",2),Y([b({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"headerSticky",2),Y([b({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationLevel",2),Y([b({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationText",2),Y([b({type:Array,reflect:!0})],h.SpectricPage.prototype,"notifications",2),Y([b({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showCreateAccount",2),Y([b({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showLoginButton",2),Y([b({type:String,reflect:!0})],h.SpectricPage.prototype,"username",2),Y([b({type:String,reflect:!0})],h.SpectricPage.prototype,"theme",2),h.SpectricPage=Y([O("spectric-page")],h.SpectricPage);var On=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,T=(s,e,n,i)=>{for(var o=i>1?void 0:i?Dn(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&On(e,n,o),o},cr=(s=>(s.Text="text",s.TextArea="text-area",s.number="number",s.color="color",s.date="date",s.datetime="datetime-local",s.email="email",s.file="file",s.hidden="hidden",s.password="password",s.checkbox="checkbox",s.range="range",s))(cr||{});h.SpectricInput=class extends D{constructor(){super(...arguments),this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="off",this._handleInput=({target:e})=>{const n=e;this.value=n.value,this.invalid=!n.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(e){const n=this._value;this._value=e,this.requestUpdate("value",n),this._input&&(this._input.value=String(e))}blur(){this._input&&this._input.blur()}focus(e){this._input&&(this._input.blur(),this._input.focus(e))}setSelectionRange(e,n,i="none"){this._input&&this._input.setSelectionRange(e,n,i)}updated(e){e.has("checked")&&this.dispatchEvent(new Event("change",{bubbles:!0}))}_handleChange(e){e.stopPropagation(),this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"range":return S`
|
|
676
676
|
<div class="inputWrapper">
|
|
677
677
|
<div class="text-input__label-helper-wrapper">
|
|
678
678
|
<div class="--text-input__label-wrapper">
|
|
@@ -738,16 +738,18 @@ article{
|
|
|
738
738
|
</div>
|
|
739
739
|
</div>`;case"hidden":return S`<input type="hidden"/>`;case"checkbox":return S`
|
|
740
740
|
<div class="checkbox">
|
|
741
|
-
<spectric-button
|
|
742
|
-
|
|
741
|
+
<spectric-button
|
|
742
|
+
.tooltip=${this.helperText}
|
|
743
|
+
@click=${()=>{this.checked=!this.checked,this.value=!!this.checked}} icon size=${this.size||"xxsmall"} variant=${this.checked?"primary":"secondary"}>${this.checked?"✓":" "}</spectric-button>
|
|
744
|
+
|
|
743
745
|
${this.label}
|
|
744
746
|
</div>
|
|
745
747
|
</label>
|
|
746
|
-
`}return`Not yet implemented ${this.variant}`}},T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),T([b()],h.SpectricInput.prototype,"hidePasswordLabel",2),T([b()],h.SpectricInput.prototype,"showPasswordLabel",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),T([b()],h.SpectricInput.prototype,"name",2),T([b()],h.SpectricInput.prototype,"pattern",2),T([b({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),T([b({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),T([b({reflect:!0})],h.SpectricInput.prototype,"value",1),T([ye("input")],h.SpectricInput.prototype,"_input",2),T([
|
|
747
|
-
`);super(o),this.name="DQLSyntaxError",this.shortMessage=i}}function Ne(s){return{type:"literal",value:s}}function
|
|
748
|
-
`},
|
|
749
|
-
`?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1),p++;return Pt[r]=a,a}function Ot(r,a){var p=ws(r),u=ws(a);return{start:{offset:r,line:p.line,column:p.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){l<J||(l>J&&(J=l,zr=[]),zr.push(r))}function _s(r,a,p,u){function v(L){var z=1;for(L.sort(function(fe,W){return fe.description<W.description?-1:fe.description>W.description?1:0});z<L.length;)L[z-1]===L[z]?L.splice(z,1):z++}function _(L,z){function fe(ac){function Rt(ie){return ie.charCodeAt(0).toString(16).toUpperCase()}return ac.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ie){return"\\x0"+Rt(ie)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ie){return"\\x"+Rt(ie)}).replace(/[\u0100-\u0FFF]/g,function(ie){return"\\u0"+Rt(ie)}).replace(/[\u1000-\uFFFF]/g,function(ie){return"\\u"+Rt(ie)})}var W=new Array(L.length),Is,Hs,ct;for(ct=0;ct<L.length;ct++)W[ct]=L[ct].description;return Is=L.length>1?W.slice(0,-1).join(", ")+" or "+W[L.length-1]:W[0],Hs=z?'"'+fe(z)+'"':"end of input","Expected "+Is+" but "+Hs+" found."}return a!==null&&v(a),new e(r!==null?r:_(a,p),a,p,u)}function Ss(){var r,a,p,u;for(r=l,a=[],p=w();p!==t;)a.push(p),p=w();return a!==t?(p=Dt(),p===t&&(p=null),p!==t?(u=jt(),u!==t?(A=r,a=f(p,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r}function Dt(){var r,a,p,u;return r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Fl(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=l,a=jr(),a!==t?(p=Lt(),p!==t?(u=Dt(),u!==t?(A=r,a=x(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=jr())),r}function jr(){var r,a,p,u;return r=l,a=As(),a!==t?(p=Nt(),p!==t?(u=jr(),u!==t?(A=r,a=$(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=As()),r}function As(){var r,a,p;return r=l,a=Ir(),a!==t?(p=xs(),p!==t?(A=r,a=E(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=xs()),r}function xs(){var r,a,p,u,v,_;if(r=l,i.charCodeAt(l)===40?(a=C,l++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Dt(),u!==t?(v=jt(),v!==t?(i.charCodeAt(l)===41?(_=N,l++):(_=t,g===0&&m(R)),_!==t?(A=r,a=M(u,v),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r===t&&(r=Nl()),r}function Nl(){var r,a,p,u,v,_,L,z,fe,W;if(r=l,a=Br(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(l)===58?(u=G,l++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();if(v!==t)if(i.charCodeAt(l)===123?(_=Me,l++):(_=t,g===0&&m(Er)),_!==t){for(L=[],z=w();z!==t;)L.push(z),z=w();L!==t?(z=Dt(),z!==t?(fe=jt(),fe!==t?(i.charCodeAt(l)===125?(W=kr,l++):(W=t,g===0&&m(Pr)),W!==t?(A=r,a=ka(a,z,fe),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r===t&&(r=zl()),r}function zl(){var r;return r=jl(),r===t&&(r=Bl(),r===t&&(r=Rl())),r}function Br(){var r;return g++,r=Hr(),g--,r===t&&g===0&&m(Pa),r}function jl(){var r,a,p,u,v,_;if(r=l,a=Br(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(u=Os(),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Hr(),_!==t?(A=r,a=Ta(a,u,_),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Bl(){var r,a,p,u,v,_;if(r=l,a=Br(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(l)===58?(u=G,l++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Rr(),_!==t?(A=r,a=Oa(a,_),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Rl(){var r,a;return r=l,a=ks(),a!==t&&(A=r,a=Da(a)),r=a,r}function Rr(){var r,a,p,u,v,_;if(r=l,i.charCodeAt(l)===40?(a=C,l++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Cs(),u!==t?(v=jt(),v!==t?(i.charCodeAt(l)===41?(_=N,l++):(_=t,g===0&&m(R)),_!==t?(A=r,a=La(u,v),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r===t&&(r=ks()),r}function Cs(){var r,a,p,u;return r=l,a=Mr(),a!==t?(p=Lt(),p!==t?(u=Cs(),u!==t?(A=r,a=Na(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=Mr()),r}function Mr(){var r,a,p,u;return r=l,a=Es(),a!==t?(p=Nt(),p!==t?(u=Mr(),u!==t?(A=r,a=za(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=Es()),r}function Es(){var r,a,p;return r=l,a=Ir(),a!==t?(p=Rr(),p!==t?(A=r,a=ja(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=Rr()),r}function ks(){var r,a;return g++,r=l,a=zt(),a!==t&&(A=r,a=Ra(a)),r=a,r===t&&(r=l,a=Ps(),a!==t&&(A=r,a=Ma(a)),r=a),g--,r===t&&(a=t,g===0&&m(Ba)),r}function Lt(){var r,a,p,u,v;if(g++,r=l,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(l,2).toLowerCase()===zi?(p=i.substr(l,2),l+=2):(p=t,g===0&&m(ji)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Ds(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ia)),r}function Nt(){var r,a,p,u,v;if(g++,r=l,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(l,3).toLowerCase()===Bi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(Ri)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Ls(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ha)),r}function Ir(){var r,a,p,u;if(g++,r=l,i.substr(l,3).toLowerCase()===Mi?(a=i.substr(l,3),l+=3):(a=t,g===0&&m(Ii)),a!==t){if(p=[],u=w(),u!==t)for(;u!==t;)p.push(u),u=w();else p=t;p!==t?(a=[a,p],r=a):(l=r,r=t)}else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Ns(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ua)),r}function Hr(){var r;return g++,r=zt(),r===t&&(r=Ps()),g--,r===t&&g===0&&m(Fa),r}function zt(){var r,a,p,u,v,_;if(r=l,i.charCodeAt(l)===34?(a=st,l++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();if(p!==t)if(u=lt(),u!==t){for(v=[],_=Ue();_!==t;)v.push(_),_=Ue();v!==t?(i.charCodeAt(l)===34?(_=st,l++):(_=t,g===0&&m(nt)),_!==t?(A=r,a=Tr(p,u,v),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;if(r===t)if(r=l,i.charCodeAt(l)===34?(a=st,l++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();p!==t?(i.charCodeAt(l)===34?(u=st,l++):(u=t,g===0&&m(nt)),u!==t?(A=r,a=Qa(p),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function Ue(){var r,a,p;return r=Ur(),r===t&&(r=l,i.charCodeAt(l)===92?(a=ot,l++):(a=t,g===0&&m(at)),a!==t?(qa.test(i.charAt(l))?(p=i.charAt(l),l++):(p=t,g===0&&m(Wa)),p!==t?(A=r,a=Ct(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=l,a=l,g++,p=lt(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(Va.test(i.charAt(l))?(p=i.charAt(l),l++):(p=t,g===0&&m(Ya)),p!==t?(A=r,a=Ct(p),r=a):(l=r,r=t)):(l=r,r=t))),r}function Ps(){var r,a,p,u,v;for(r=l,a=[],p=Fe();p!==t;)a.push(p),p=Fe();if(a!==t)if(p=lt(),p!==t){for(u=[],v=Fe();v!==t;)u.push(v),v=Fe();u!==t?(A=r,a=Tr(a,p,u),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;if(r===t){if(r=l,a=[],p=Fe(),p!==t)for(;p!==t;)a.push(p),p=Fe();else a=t;a!==t&&(A=r,a=Ka(a)),r=a}return r}function Fe(){var r,a,p,u,v;return r=Ur(),r===t&&(r=Il(),r===t&&(r=Hl(),r===t&&(r=Ml(),r===t&&(r=l,a=l,g++,p=Ts(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(p=l,g++,u=Ul(),g--,u===t?p=void 0:(l=p,p=t),p!==t?(u=l,g++,v=lt(),g--,v===t?u=void 0:(l=u,u=t),u!==t?(i.length>l?(v=i.charAt(l),l++):(v=t,g===0&&m(Hi)),v!==t?(A=r,a=Ct(v),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t))))),r}function Ml(){var r,a;return r=l,i.charCodeAt(l)===42?(a=Et,l++):(a=t,g===0&&m(kt)),a!==t&&(A=r,a=Za()),r=a,r}function jt(){var r,a,p,u,v;for(r=l,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(p=lt(),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=Tr(a,p,u),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;if(r===t)for(r=[],a=w();a!==t;)r.push(a),a=w();return r}function Ur(){var r,a;return r=l,i.substr(l,2)===Ui?(a=Ui,l+=2):(a=t,g===0&&m(Xa)),a!==t&&(A=r,a=Ga()),r=a,r===t&&(r=l,i.substr(l,2)===Fi?(a=Fi,l+=2):(a=t,g===0&&m(Ja)),a!==t&&(A=r,a=el()),r=a,r===t&&(r=l,i.substr(l,2)===Qi?(a=Qi,l+=2):(a=t,g===0&&m(tl)),a!==t&&(A=r,a=rl()),r=a)),r}function Il(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ot,l++):(a=t,g===0&&m(at)),a!==t?(p=Ts(),p!==t?(A=r,a=Ct(p),r=a):(l=r,r=t)):(l=r,r=t),r}function Hl(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ot,l++):(a=t,g===0&&m(at)),a!==t?(i.substr(l,2).toLowerCase()===zi?(p=i.substr(l,2),l+=2):(p=t,g===0&&m(ji)),p===t&&(i.substr(l,3).toLowerCase()===Bi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(Ri)),p===t&&(i.substr(l,3).toLowerCase()===Mi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(Ii)))),p!==t?(A=r,a=il(p),r=a):(l=r,r=t)):(l=r,r=t),r}function Ul(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Ir())),r}function Ts(){var r;return sl.test(i.charAt(l))?(r=i.charAt(l),l++):(r=t,g===0&&m(nl)),r}function Os(){var r,a;return r=l,i.substr(l,2)===qi?(a=qi,l+=2):(a=t,g===0&&m(ol)),a!==t&&(A=r,a=al()),r=a,r===t&&(r=l,i.substr(l,2)===Wi?(a=Wi,l+=2):(a=t,g===0&&m(ll)),a!==t&&(A=r,a=cl()),r=a,r===t&&(r=l,i.charCodeAt(l)===60?(a=Vi,l++):(a=t,g===0&&m(Yi)),a!==t&&(A=r,a=pl()),r=a,r===t&&(r=l,i.charCodeAt(l)===62?(a=Ki,l++):(a=t,g===0&&m(Zi)),a!==t&&(A=r,a=ul()),r=a))),r}function w(){var r;return g++,dl.test(i.charAt(l))?(r=i.charAt(l),l++):(r=t,g===0&&m(fl)),g--,r===t&&g===0&&m(hl),r}function lt(){var r,a,p;return r=l,A=l,a=gl(),a?a=void 0:a=t,a!==t?(i.substr(l,14)===Xi?(p=Xi,l+=14):(p=t,g===0&&m(vl)),p!==t?(A=r,a=bl(),r=a):(l=r,r=t)):(l=r,r=t),r}function Ds(){var r,a,p,u,v;for(r=l,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(l,2)===Gi?(p=Gi,l+=2):(p=t,g===0&&m(ml)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=yl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Ls(){var r,a,p,u,v;for(r=l,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(l,2)===Ji?(p=Ji,l+=2):(p=t,g===0&&m($l)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=es(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,i.charCodeAt(l)===43?(a=ts,l++):(a=t,g===0&&m(rs)),a!==t&&(A=r,a=es()),r=a),r}function Ns(){var r,a;return r=l,i.charCodeAt(l)===45?(a=is,l++):(a=t,g===0&&m(ss)),a!==t&&(A=r,a=ns()),r=a,r===t&&(r=l,i.charCodeAt(l)===33?(a=os,l++):(a=t,g===0&&m(as)),a!==t&&(A=r,a=ns()),r=a),r}function Fl(){var r;return r=Ql(),r===t&&(r=zs(),r===t&&(r=ql())),r}function Ql(){var r,a,p,u,v,_;if(r=l,a=Qe(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(l)===58?(u=G,l++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=zs(),_!==t?(a=[a,p,u,v,_],r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function zs(){var r;return r=Wl(),r===t&&(r=Fr(),r===t&&(r=Vl(),r===t&&(r=Yl(),r===t&&(r=Kl(),r===t&&(r=Zl()))))),r}function ql(){var r,a,p,u,v,_;if(r=l,i.substr(l,8)===ls?(a=ls,l+=8):(a=t,g===0&&m(wl)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(l)===58?(u=G,l++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Qe(),_!==t?(A=r,a=_l(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Wl(){var r,a,p,u,v,_,L;if(r=l,a=Os(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(A=r,a=cs(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;if(r===t)if(r=l,a=Jl(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(v=Rs(),v!==t?(_=Qe(),_!==t?(L=ec(),L!==t?(A=r,a=cs(),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function Fr(){var r,a,p,u,v;for(r=l,a=[],p=Bt(),p===t&&(i.charCodeAt(l)===42?(p=Et,l++):(p=t,g===0&&m(kt)));p!==t;)a.push(p),p=Bt(),p===t&&(i.charCodeAt(l)===42?(p=Et,l++):(p=t,g===0&&m(kt)));if(a!==t)if(i.charCodeAt(l)===63?(p=ps,l++):(p=t,g===0&&m(us)),p!==t){for(u=[],v=Fr();v!==t;)u.push(v),v=Fr();u!==t?(A=r,a=Sl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Vl(){var r,a,p,u;if(r=l,i.charCodeAt(l)===47?(a=Or,l++):(a=t,g===0&&m(Dr)),a!==t){for(p=[],hs.test(i.charAt(l))?(u=i.charAt(l),l++):(u=t,g===0&&m(ds));u!==t;)p.push(u),hs.test(i.charAt(l))?(u=i.charAt(l),l++):(u=t,g===0&&m(ds));p!==t?(i.charCodeAt(l)===47?(u=Or,l++):(u=t,g===0&&m(Dr)),u!==t?(A=r,a=Al(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function Yl(){var r,a,p,u,v;if(r=l,a=js(),a!==t)if(i.charCodeAt(l)===126?(p=Lr,l++):(p=t,g===0&&m(Nr)),p!==t){for(u=[],Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));u!==t?(A=r,a=xl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Kl(){var r,a,p,u,v;if(r=l,a=zt(),a!==t)if(i.charCodeAt(l)===126?(p=Lr,l++):(p=t,g===0&&m(Nr)),p!==t){for(u=[],Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));u!==t?(A=r,a=Cl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Zl(){var r,a,p,u,v;if(r=l,a=Qe(),a!==t)if(i.charCodeAt(l)===94?(p=fs,l++):(p=t,g===0&&m(gs)),p!==t){for(u=[],Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(l))?(v=i.charAt(l),l++):(v=t,g===0&&m(He));u!==t?(A=r,a=El(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Qe(){var r;return r=zt(),r===t&&(r=js()),r}function js(){var r,a;if(r=[],a=Bt(),a!==t)for(;a!==t;)r.push(a),a=Bt();else r=t;return r}function Bt(){var r,a,p,u;return r=Ur(),r===t&&(r=Gl(),r===t&&(r=l,a=l,g++,p=Bs(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(p=l,g++,u=Xl(),g--,u===t?p=void 0:(l=p,p=t),p!==t?(i.length>l?(u=i.charAt(l),l++):(u=t,g===0&&m(Hi)),u!==t?(a=[a,p,u],r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t))),r}function Xl(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Ds(),r===t&&(r=Ls(),r===t&&(r=Ns(),r===t&&(r=Rs()))))),r}function Gl(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ot,l++):(a=t,g===0&&m(at)),a!==t?(p=Bs(),p!==t?(A=r,a=kl(),r=a):(l=r,r=t)):(l=r,r=t),r}function Bs(){var r;return i.charCodeAt(l)===43?(r=ts,l++):(r=t,g===0&&m(rs)),r===t&&(i.charCodeAt(l)===45?(r=is,l++):(r=t,g===0&&m(ss)),r===t&&(i.charCodeAt(l)===61?(r=Pl,l++):(r=t,g===0&&m(Tl)),r===t&&(i.charCodeAt(l)===62?(r=Ki,l++):(r=t,g===0&&m(Zi)),r===t&&(i.charCodeAt(l)===60?(r=Vi,l++):(r=t,g===0&&m(Yi)),r===t&&(i.charCodeAt(l)===33?(r=os,l++):(r=t,g===0&&m(as)),r===t&&(i.charCodeAt(l)===40?(r=C,l++):(r=t,g===0&&m(k)),r===t&&(i.charCodeAt(l)===41?(r=N,l++):(r=t,g===0&&m(R)),r===t&&(i.charCodeAt(l)===123?(r=Me,l++):(r=t,g===0&&m(Er)),r===t&&(i.charCodeAt(l)===125?(r=kr,l++):(r=t,g===0&&m(Pr)),r===t&&(i.charCodeAt(l)===91?(r=vs,l++):(r=t,g===0&&m(bs)),r===t&&(i.charCodeAt(l)===93?(r=ms,l++):(r=t,g===0&&m(ys)),r===t&&(i.charCodeAt(l)===94?(r=fs,l++):(r=t,g===0&&m(gs)),r===t&&(i.charCodeAt(l)===34?(r=st,l++):(r=t,g===0&&m(nt)),r===t&&(i.charCodeAt(l)===126?(r=Lr,l++):(r=t,g===0&&m(Nr)),r===t&&(i.charCodeAt(l)===42?(r=Et,l++):(r=t,g===0&&m(kt)),r===t&&(i.charCodeAt(l)===63?(r=ps,l++):(r=t,g===0&&m(us)),r===t&&(i.charCodeAt(l)===58?(r=G,l++):(r=t,g===0&&m(U)),r===t&&(i.charCodeAt(l)===92?(r=ot,l++):(r=t,g===0&&m(at)),r===t&&(i.charCodeAt(l)===47?(r=Or,l++):(r=t,g===0&&m(Dr))))))))))))))))))))),r}function Rs(){var r,a,p,u,v;if(r=l,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(l,2)===$s?(p=$s,l+=2):(p=t,g===0&&m(Ol)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Jl(){var r;return i.charCodeAt(l)===91?(r=vs,l++):(r=t,g===0&&m(bs)),r===t&&(i.charCodeAt(l)===123?(r=Me,l++):(r=t,g===0&&m(Er))),r}function ec(){var r;return i.charCodeAt(l)===93?(r=ms,l++):(r=t,g===0&&m(ys)),r===t&&(i.charCodeAt(l)===125?(r=kr,l++):(r=t,g===0&&m(Pr))),r}const{errorOnLuceneSyntax:tc,parseCursor:rc,cursorSymbol:ic,allowLeadingWildcards:sc=!0,helpers:{nodeTypes:Pe}}=o,ee=Pe.function.buildNodeWithArgumentNodes,de=Pe.literal.buildNode,nc=Pe.wildcard.buildNode,oc=Pe.namedArg.buildNode,{wildcardSymbol:Ms}=Pe.wildcard;if(Tt=d(),Tt!==t&&l===i.length)return Tt;throw Tt!==t&&l<i.length&&m({type:"end",description:"end of input"}),_s(null,zr,J<i.length?i.charAt(J):null,J<i.length?Ot(J,J+1):Ot(J,J))}return{SyntaxError:e,parse:n}}(),pr=(s,e={},n=$t)=>{if(typeof s>"u")throw new Error("expression must be a string, got undefined instead");return n(s,{...e,helpers:{nodeTypes:K}})},ze=(s,e={})=>pr(s,{...e,startRule:"Literal"},$t),wt=(s,e={})=>{try{return pr(s,e,$t)}catch(n){throw n.name==="SyntaxError"?new yi(n,s):n}},zn=s=>{try{return pr(s,{errorOnLuceneSyntax:!0},$t),!1}catch(e){return e.message.startsWith("Lucene")}},j=(s,e,n,i)=>(e=void 0,!s||!s.type||!K[s.type]?j(K.function.buildNode("and",[]),e):K[s.type].toOpenSearchQuery(s,e,n,i)),re="@kuery-wildcard@";function jn(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bn(s){return s.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Rn(s){return s.includes(re)?{type:"wildcard",value:s}:ze(s)}function $i(s,e){const{value:n}=s,i=n.split(re).map(jn).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(e)}function Mn(s){const{value:e}=s;return e.split(re).join("*")}function ur(s){const{value:e}=s;return e.split(re).map(Bn).join("*")}function In(s){const{value:e}=s;return e.startsWith(re)&&e.replace(re,"").length>0}const Hn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Rn,hasLeadingWildcard:In,test:$i,toOpenSearchQuery:Mn,toQueryStringQuery:ur,wildcardSymbol:re},Symbol.toStringTag,{value:"Module"}));function hr(s,e){if(!e)return[];if(s.type==="literal"){const n=cr(s),i=e.fields.find(o=>o.name===n);return i?[i]:[]}else if(s.type==="wildcard")return e.fields.filter(i=>$i(s,i.name))}function cc(s){return s}function wi(s,e,n){const i={...s,value:n?`${n}.${s.value}`:s.value};if(!e||i.type==="wildcard"&&!n)return i;const t=hr(i,e).reduce((c,d)=>{const f=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return n&&!f?[...c,`${d.name} is not a nested field but is in nested group "${n}" in the DQL expression.`]:f&&!n?[...c,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:f!==n?[...c,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:c},[]);if(t.length>0)throw new Error(t.join(`
|
|
750
|
-
`));return i}function
|
|
748
|
+
`}return`Not yet implemented ${this.variant}`}},T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),T([b()],h.SpectricInput.prototype,"hidePasswordLabel",2),T([b()],h.SpectricInput.prototype,"showPasswordLabel",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),T([b({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),T([b({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),T([b()],h.SpectricInput.prototype,"name",2),T([b()],h.SpectricInput.prototype,"pattern",2),T([b({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),T([b({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),T([b({reflect:!0})],h.SpectricInput.prototype,"value",1),T([ye("input")],h.SpectricInput.prototype,"_input",2),T([on({capture:!0})],h.SpectricInput.prototype,"_handleChange",1),h.SpectricInput=T([O("spectric-input")],h.SpectricInput);const Le=s=>nr(s===""?void 0:s??void 0),Ln="end of input",Nn={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class $i extends Error{constructor(e,n){let i=e.message;if(e.expected){const l=e.expected.map(f=>Nn[f.description]||f.description).join(", ");let d=e.found?`"${e.found}"`:Ln;i=`Expected ${l} but ${d} found.`}const o=[i,n,"-".repeat(e.location.start.offset)+"^"].join(`
|
|
749
|
+
`);super(o),this.name="DQLSyntaxError",this.shortMessage=i}}function Ne(s){return{type:"literal",value:s}}function lr(s){return s.value}const zn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ne,toOpenSearchQuery:lr},Symbol.toStringTag,{value:"Module"})),{SyntaxError:ul,parse:$t}=function(){function s(i,o){function t(){this.constructor=i}t.prototype=o.prototype,i.prototype=new t}function e(i,o,t,l){this.message=i,this.expected=o,this.found=t,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}s(e,Error);function n(i){var o=arguments.length>1?arguments[1]:{},t={},l={start:As,Literal:Ur},d=As,f=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r!==null?r:Pe.function.buildNode("is","*","*")},y=function(){return sl},x=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p||ee("or",[r,a])},$=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p||ee("and",[r,a])},E=function(r){return r.type==="cursor"?r:ee("not",[r])},C="(",k={type:"literal",value:"(",description:'"("'},N=")",R={type:"literal",value:")",description:'")"'},M=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},G=":",U={type:"literal",value:":",description:'":"'},Me="{",kr={type:"literal",value:"{",description:'"{"'},Pr="}",Tr={type:"literal",value:"}",description:'"}"'},Oa=function(r,a,p){return a.type==="cursor"?{...a,nestedPath:a.nestedPath?`${r.value}.${a.nestedPath}`:r.value}:p.type==="cursor"?{...p,suggestionTypes:["conjunction"]}:ee("nested",[r,a])},Da={type:"other",description:"fieldName"},La=function(r,a,p){if(p.type==="cursor")return{...p,suggestionTypes:["conjunction"]};const u=ll(a,p);return ee("range",[r,u])},Na=function(r,a){return a.type==="cursor"?{...a,fieldName:r.value,suggestionTypes:["value","conjunction"]}:a(r)},za=function(r){if(r.type==="cursor"){const p=`${r.prefix}${r.suffix}`.trim();return{...r,fieldName:p,suggestionTypes:["field","operator","conjunction"]}}const a=de(null);return r(a)},Ba=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},ja=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p?{...p,suggestionTypes:["value"]}:u=>ee("or",[r(u),a(u)])},Ra=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p?{...p,suggestionTypes:["value"]}:u=>ee("and",[r(u),a(u)])},Ma=function(r){return r.type==="cursor"?{...list,suggestionTypes:["value"]}:a=>ee("not",[r(a)])},Ia={type:"other",description:"value"},Ha=function(r){if(r.type==="cursor")return r;const a=de(!0);return p=>ee("is",[p,r,a])},Ua=function(r){if(r.type==="cursor")return r;!al&&r.type==="wildcard"&&Pe.wildcard.hasLeadingWildcard(r)&&q("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const a=de(!1);return p=>ee("is",[p,r,a])},Fa={type:"other",description:"OR"},Bi="or",ji={type:"literal",value:"or",description:'"or"'},Qa={type:"other",description:"AND"},Ri="and",Mi={type:"literal",value:"and",description:'"and"'},qa={type:"other",description:"NOT"},Ii="not",Hi={type:"literal",value:"not",description:'"not"'},Wa={type:"other",description:"literal"},st='"',nt={type:"literal",value:'"',description:'"\\""'},Or=function(r,a,p){const{start:u,end:v}=Bc();return{type:"cursor",start:u.offset,end:v.offset-a.length,prefix:r.join(""),suffix:p.join(""),text:zc().replace(a,"")}},Va=function(r){return de(r.join(""))},ot="\\",at={type:"literal",value:"\\",description:'"\\\\"'},Ya=/^[\\"]/,Za={type:"class",value:'[\\\\"]',description:'[\\\\"]'},Ct=function(r){return r},Ka=/^[^"]/,Xa={type:"class",value:'[^"]',description:'[^"]'},Ga=function(r){const a=r.join("").trim();return a==="null"?de(null):a==="true"?de(!0):a==="false"?de(!1):r.includes(Is)?cl(a):de(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(a)?isFinite(a)&&(a>Number.MAX_SAFE_INTEGER||a<Number.MIN_SAFE_INTEGER)?BigInt(a):Number(a):a)},Ui={type:"any",description:"any character"},Et="*",kt={type:"literal",value:"*",description:'"*"'},Ja=function(){return Is},Fi="\\t",ec={type:"literal",value:"\\t",description:'"\\\\t"'},tc=function(){return" "},Qi="\\r",rc={type:"literal",value:"\\r",description:'"\\\\r"'},ic=function(){return"\r"},qi="\\n",sc={type:"literal",value:"\\n",description:'"\\\\n"'},nc=function(){return`
|
|
750
|
+
`},oc=function(r){return r},ac=/^[\\():<>"*{}]/,cc={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Wi="<=",lc={type:"literal",value:"<=",description:'"<="'},pc=function(){return"lte"},Vi=">=",uc={type:"literal",value:">=",description:'">="'},hc=function(){return"gte"},Yi="<",Zi={type:"literal",value:"<",description:'"<"'},dc=function(){return"lt"},Ki=">",Xi={type:"literal",value:">",description:'">"'},fc=function(){return"gt"},gc={type:"other",description:"whitespace"},vc=/^[ \t\r\n]/,bc={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},mc=function(){return nl},Gi="@kuery-cursor@",yc={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},$c=function(){return ol},Ji="||",wc={type:"literal",value:"||",description:'"||"'},_c=function(){q("LuceneOr")},es="&&",Sc={type:"literal",value:"&&",description:'"&&"'},ts=function(){q("LuceneAnd")},rs="+",is={type:"literal",value:"+",description:'"+"'},ss="-",ns={type:"literal",value:"-",description:'"-"'},os=function(){q("LuceneNot")},as="!",cs={type:"literal",value:"!",description:'"!"'},ls="_exists_",Ac={type:"literal",value:"_exists_",description:'"_exists_"'},xc=function(){q("LuceneExists")},ps=function(){q("LuceneRange")},us="?",hs={type:"literal",value:"?",description:'"?"'},Cc=function(){q("LuceneWildcard")},Dr="/",Lr={type:"literal",value:"/",description:'"/"'},ds=/^[^\/]/,fs={type:"class",value:"[^/]",description:"[^/]"},Ec=function(){q("LuceneRegex")},Nr="~",zr={type:"literal",value:"~",description:'"~"'},Ie=/^[0-9]/,He={type:"class",value:"[0-9]",description:"[0-9]"},kc=function(){q("LuceneFuzzy")},Pc=function(){q("LuceneProximity")},gs="^",vs={type:"literal",value:"^",description:'"^"'},Tc=function(){q("LuceneBoost")},Oc=function(){return char},Dc="=",Lc={type:"literal",value:"=",description:'"="'},bs="[",ms={type:"literal",value:"[",description:'"["'},ys="]",$s={type:"literal",value:"]",description:'"]"'},ws="TO",Nc={type:"literal",value:"TO",description:'"TO"'},c=0,A=0,Pt=[{line:1,column:1,seenCR:!1}],J=0,Br=[],g=0,Tt;if("startRule"in o){if(!(o.startRule in l))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');d=l[o.startRule]}function zc(){return i.substring(A,c)}function Bc(){return Ot(A,c)}function q(r){throw Ss(r,null,i.substring(A,c),Ot(A,c))}function _s(r){var a=Pt[r],p,u;if(a)return a;for(p=r-1;!Pt[p];)p--;for(a=Pt[p],a={line:a.line,column:a.column,seenCR:a.seenCR};p<r;)u=i.charAt(p),u===`
|
|
751
|
+
`?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1),p++;return Pt[r]=a,a}function Ot(r,a){var p=_s(r),u=_s(a);return{start:{offset:r,line:p.line,column:p.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){c<J||(c>J&&(J=c,Br=[]),Br.push(r))}function Ss(r,a,p,u){function v(L){var z=1;for(L.sort(function(fe,W){return fe.description<W.description?-1:fe.description>W.description?1:0});z<L.length;)L[z-1]===L[z]?L.splice(z,1):z++}function _(L,z){function fe(pl){function Rt(ie){return ie.charCodeAt(0).toString(16).toUpperCase()}return pl.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ie){return"\\x0"+Rt(ie)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ie){return"\\x"+Rt(ie)}).replace(/[\u0100-\u0FFF]/g,function(ie){return"\\u0"+Rt(ie)}).replace(/[\u1000-\uFFFF]/g,function(ie){return"\\u"+Rt(ie)})}var W=new Array(L.length),Hs,Us,lt;for(lt=0;lt<L.length;lt++)W[lt]=L[lt].description;return Hs=L.length>1?W.slice(0,-1).join(", ")+" or "+W[L.length-1]:W[0],Us=z?'"'+fe(z)+'"':"end of input","Expected "+Hs+" but "+Us+" found."}return a!==null&&v(a),new e(r!==null?r:_(a,p),a,p,u)}function As(){var r,a,p,u;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();return a!==t?(p=Dt(),p===t&&(p=null),p!==t?(u=Bt(),u!==t?(A=r,a=f(p,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r}function Dt(){var r,a,p,u;return r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Wc(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=jr(),a!==t?(p=Lt(),p!==t?(u=Dt(),u!==t?(A=r,a=x(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=jr())),r}function jr(){var r,a,p,u;return r=c,a=xs(),a!==t?(p=Nt(),p!==t?(u=jr(),u!==t?(A=r,a=$(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=xs()),r}function xs(){var r,a,p;return r=c,a=Hr(),a!==t?(p=Cs(),p!==t?(A=r,a=E(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Cs()),r}function Cs(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===40?(a=C,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Dt(),u!==t?(v=Bt(),v!==t?(i.charCodeAt(c)===41?(_=N,c++):(_=t,g===0&&m(R)),_!==t?(A=r,a=M(u,v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=jc()),r}function jc(){var r,a,p,u,v,_,L,z,fe,W;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();if(v!==t)if(i.charCodeAt(c)===123?(_=Me,c++):(_=t,g===0&&m(kr)),_!==t){for(L=[],z=w();z!==t;)L.push(z),z=w();L!==t?(z=Dt(),z!==t?(fe=Bt(),fe!==t?(i.charCodeAt(c)===125?(W=Pr,c++):(W=t,g===0&&m(Tr)),W!==t?(A=r,a=Oa(a,z,fe),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r===t&&(r=Rc()),r}function Rc(){var r;return r=Mc(),r===t&&(r=Ic(),r===t&&(r=Hc())),r}function Rr(){var r;return g++,r=Ur(),g--,r===t&&g===0&&m(Da),r}function Mc(){var r,a,p,u,v,_;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(u=Ds(),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Ur(),_!==t?(A=r,a=La(a,u,_),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Ic(){var r,a,p,u,v,_;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Mr(),_!==t?(A=r,a=Na(a,_),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Hc(){var r,a;return r=c,a=Ps(),a!==t&&(A=r,a=za(a)),r=a,r}function Mr(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===40?(a=C,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Es(),u!==t?(v=Bt(),v!==t?(i.charCodeAt(c)===41?(_=N,c++):(_=t,g===0&&m(R)),_!==t?(A=r,a=Ba(u,v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=Ps()),r}function Es(){var r,a,p,u;return r=c,a=Ir(),a!==t?(p=Lt(),p!==t?(u=Es(),u!==t?(A=r,a=ja(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=Ir()),r}function Ir(){var r,a,p,u;return r=c,a=ks(),a!==t?(p=Nt(),p!==t?(u=Ir(),u!==t?(A=r,a=Ra(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=ks()),r}function ks(){var r,a,p;return r=c,a=Hr(),a!==t?(p=Mr(),p!==t?(A=r,a=Ma(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Mr()),r}function Ps(){var r,a;return g++,r=c,a=zt(),a!==t&&(A=r,a=Ha(a)),r=a,r===t&&(r=c,a=Ts(),a!==t&&(A=r,a=Ua(a)),r=a),g--,r===t&&(a=t,g===0&&m(Ia)),r}function Lt(){var r,a,p,u,v;if(g++,r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,2).toLowerCase()===Bi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(ji)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Ls(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Fa)),r}function Nt(){var r,a,p,u,v;if(g++,r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,3).toLowerCase()===Ri?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Mi)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Ns(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Qa)),r}function Hr(){var r,a,p,u;if(g++,r=c,i.substr(c,3).toLowerCase()===Ii?(a=i.substr(c,3),c+=3):(a=t,g===0&&m(Hi)),a!==t){if(p=[],u=w(),u!==t)for(;u!==t;)p.push(u),u=w();else p=t;p!==t?(a=[a,p],r=a):(c=r,r=t)}else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=zs(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(qa)),r}function Ur(){var r;return g++,r=zt(),r===t&&(r=Ts()),g--,r===t&&g===0&&m(Wa),r}function zt(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===34?(a=st,c++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();if(p!==t)if(u=ct(),u!==t){for(v=[],_=Ue();_!==t;)v.push(_),_=Ue();v!==t?(i.charCodeAt(c)===34?(_=st,c++):(_=t,g===0&&m(nt)),_!==t?(A=r,a=Or(p,u,v),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;if(r===t)if(r=c,i.charCodeAt(c)===34?(a=st,c++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();p!==t?(i.charCodeAt(c)===34?(u=st,c++):(u=t,g===0&&m(nt)),u!==t?(A=r,a=Va(p),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Ue(){var r,a,p;return r=Fr(),r===t&&(r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(Ya.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(Za)),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=c,g++,p=ct(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(Ka.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(Xa)),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t))),r}function Ts(){var r,a,p,u,v;for(r=c,a=[],p=Fe();p!==t;)a.push(p),p=Fe();if(a!==t)if(p=ct(),p!==t){for(u=[],v=Fe();v!==t;)u.push(v),v=Fe();u!==t?(A=r,a=Or(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t){if(r=c,a=[],p=Fe(),p!==t)for(;p!==t;)a.push(p),p=Fe();else a=t;a!==t&&(A=r,a=Ga(a)),r=a}return r}function Fe(){var r,a,p,u,v;return r=Fr(),r===t&&(r=Fc(),r===t&&(r=Qc(),r===t&&(r=Uc(),r===t&&(r=c,a=c,g++,p=Os(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=qc(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(u=c,g++,v=ct(),g--,v===t?u=void 0:(c=u,u=t),u!==t?(i.length>c?(v=i.charAt(c),c++):(v=t,g===0&&m(Ui)),v!==t?(A=r,a=Ct(v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))))),r}function Uc(){var r,a;return r=c,i.charCodeAt(c)===42?(a=Et,c++):(a=t,g===0&&m(kt)),a!==t&&(A=r,a=Ja()),r=a,r}function Bt(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(p=ct(),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=Or(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t)for(r=[],a=w();a!==t;)r.push(a),a=w();return r}function Fr(){var r,a;return r=c,i.substr(c,2)===Fi?(a=Fi,c+=2):(a=t,g===0&&m(ec)),a!==t&&(A=r,a=tc()),r=a,r===t&&(r=c,i.substr(c,2)===Qi?(a=Qi,c+=2):(a=t,g===0&&m(rc)),a!==t&&(A=r,a=ic()),r=a,r===t&&(r=c,i.substr(c,2)===qi?(a=qi,c+=2):(a=t,g===0&&m(sc)),a!==t&&(A=r,a=nc()),r=a)),r}function Fc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(p=Os(),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t),r}function Qc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(i.substr(c,2).toLowerCase()===Bi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(ji)),p===t&&(i.substr(c,3).toLowerCase()===Ri?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Mi)),p===t&&(i.substr(c,3).toLowerCase()===Ii?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Hi)))),p!==t?(A=r,a=oc(p),r=a):(c=r,r=t)):(c=r,r=t),r}function qc(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Hr())),r}function Os(){var r;return ac.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(cc)),r}function Ds(){var r,a;return r=c,i.substr(c,2)===Wi?(a=Wi,c+=2):(a=t,g===0&&m(lc)),a!==t&&(A=r,a=pc()),r=a,r===t&&(r=c,i.substr(c,2)===Vi?(a=Vi,c+=2):(a=t,g===0&&m(uc)),a!==t&&(A=r,a=hc()),r=a,r===t&&(r=c,i.charCodeAt(c)===60?(a=Yi,c++):(a=t,g===0&&m(Zi)),a!==t&&(A=r,a=dc()),r=a,r===t&&(r=c,i.charCodeAt(c)===62?(a=Ki,c++):(a=t,g===0&&m(Xi)),a!==t&&(A=r,a=fc()),r=a))),r}function w(){var r;return g++,vc.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(bc)),g--,r===t&&g===0&&m(gc),r}function ct(){var r,a,p;return r=c,A=c,a=mc(),a?a=void 0:a=t,a!==t?(i.substr(c,14)===Gi?(p=Gi,c+=14):(p=t,g===0&&m(yc)),p!==t?(A=r,a=$c(),r=a):(c=r,r=t)):(c=r,r=t),r}function Ls(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(c,2)===Ji?(p=Ji,c+=2):(p=t,g===0&&m(wc)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=_c(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Ns(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(c,2)===es?(p=es,c+=2):(p=t,g===0&&m(Sc)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=ts(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,i.charCodeAt(c)===43?(a=rs,c++):(a=t,g===0&&m(is)),a!==t&&(A=r,a=ts()),r=a),r}function zs(){var r,a;return r=c,i.charCodeAt(c)===45?(a=ss,c++):(a=t,g===0&&m(ns)),a!==t&&(A=r,a=os()),r=a,r===t&&(r=c,i.charCodeAt(c)===33?(a=as,c++):(a=t,g===0&&m(cs)),a!==t&&(A=r,a=os()),r=a),r}function Wc(){var r;return r=Vc(),r===t&&(r=Bs(),r===t&&(r=Yc())),r}function Vc(){var r,a,p,u,v,_;if(r=c,a=Qe(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Bs(),_!==t?(a=[a,p,u,v,_],r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Bs(){var r;return r=Zc(),r===t&&(r=Qr(),r===t&&(r=Kc(),r===t&&(r=Xc(),r===t&&(r=Gc(),r===t&&(r=Jc()))))),r}function Yc(){var r,a,p,u,v,_;if(r=c,i.substr(c,8)===ls?(a=ls,c+=8):(a=t,g===0&&m(Ac)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Qe(),_!==t?(A=r,a=xc(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Zc(){var r,a,p,u,v,_,L;if(r=c,a=Ds(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(A=r,a=ps(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;if(r===t)if(r=c,a=rl(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(v=Ms(),v!==t?(_=Qe(),_!==t?(L=il(),L!==t?(A=r,a=ps(),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Qr(){var r,a,p,u,v;for(r=c,a=[],p=jt(),p===t&&(i.charCodeAt(c)===42?(p=Et,c++):(p=t,g===0&&m(kt)));p!==t;)a.push(p),p=jt(),p===t&&(i.charCodeAt(c)===42?(p=Et,c++):(p=t,g===0&&m(kt)));if(a!==t)if(i.charCodeAt(c)===63?(p=us,c++):(p=t,g===0&&m(hs)),p!==t){for(u=[],v=Qr();v!==t;)u.push(v),v=Qr();u!==t?(A=r,a=Cc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Kc(){var r,a,p,u;if(r=c,i.charCodeAt(c)===47?(a=Dr,c++):(a=t,g===0&&m(Lr)),a!==t){for(p=[],ds.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m(fs));u!==t;)p.push(u),ds.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m(fs));p!==t?(i.charCodeAt(c)===47?(u=Dr,c++):(u=t,g===0&&m(Lr)),u!==t?(A=r,a=Ec(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Xc(){var r,a,p,u,v;if(r=c,a=js(),a!==t)if(i.charCodeAt(c)===126?(p=Nr,c++):(p=t,g===0&&m(zr)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=kc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Gc(){var r,a,p,u,v;if(r=c,a=zt(),a!==t)if(i.charCodeAt(c)===126?(p=Nr,c++):(p=t,g===0&&m(zr)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=Pc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Jc(){var r,a,p,u,v;if(r=c,a=Qe(),a!==t)if(i.charCodeAt(c)===94?(p=gs,c++):(p=t,g===0&&m(vs)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=Tc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Qe(){var r;return r=zt(),r===t&&(r=js()),r}function js(){var r,a;if(r=[],a=jt(),a!==t)for(;a!==t;)r.push(a),a=jt();else r=t;return r}function jt(){var r,a,p,u;return r=Fr(),r===t&&(r=tl(),r===t&&(r=c,a=c,g++,p=Rs(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=el(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(i.length>c?(u=i.charAt(c),c++):(u=t,g===0&&m(Ui)),u!==t?(a=[a,p,u],r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))),r}function el(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Ls(),r===t&&(r=Ns(),r===t&&(r=zs(),r===t&&(r=Ms()))))),r}function tl(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(p=Rs(),p!==t?(A=r,a=Oc(),r=a):(c=r,r=t)):(c=r,r=t),r}function Rs(){var r;return i.charCodeAt(c)===43?(r=rs,c++):(r=t,g===0&&m(is)),r===t&&(i.charCodeAt(c)===45?(r=ss,c++):(r=t,g===0&&m(ns)),r===t&&(i.charCodeAt(c)===61?(r=Dc,c++):(r=t,g===0&&m(Lc)),r===t&&(i.charCodeAt(c)===62?(r=Ki,c++):(r=t,g===0&&m(Xi)),r===t&&(i.charCodeAt(c)===60?(r=Yi,c++):(r=t,g===0&&m(Zi)),r===t&&(i.charCodeAt(c)===33?(r=as,c++):(r=t,g===0&&m(cs)),r===t&&(i.charCodeAt(c)===40?(r=C,c++):(r=t,g===0&&m(k)),r===t&&(i.charCodeAt(c)===41?(r=N,c++):(r=t,g===0&&m(R)),r===t&&(i.charCodeAt(c)===123?(r=Me,c++):(r=t,g===0&&m(kr)),r===t&&(i.charCodeAt(c)===125?(r=Pr,c++):(r=t,g===0&&m(Tr)),r===t&&(i.charCodeAt(c)===91?(r=bs,c++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(c)===93?(r=ys,c++):(r=t,g===0&&m($s)),r===t&&(i.charCodeAt(c)===94?(r=gs,c++):(r=t,g===0&&m(vs)),r===t&&(i.charCodeAt(c)===34?(r=st,c++):(r=t,g===0&&m(nt)),r===t&&(i.charCodeAt(c)===126?(r=Nr,c++):(r=t,g===0&&m(zr)),r===t&&(i.charCodeAt(c)===42?(r=Et,c++):(r=t,g===0&&m(kt)),r===t&&(i.charCodeAt(c)===63?(r=us,c++):(r=t,g===0&&m(hs)),r===t&&(i.charCodeAt(c)===58?(r=G,c++):(r=t,g===0&&m(U)),r===t&&(i.charCodeAt(c)===92?(r=ot,c++):(r=t,g===0&&m(at)),r===t&&(i.charCodeAt(c)===47?(r=Dr,c++):(r=t,g===0&&m(Lr))))))))))))))))))))),r}function Ms(){var r,a,p,u,v;if(r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,2)===ws?(p=ws,c+=2):(p=t,g===0&&m(Nc)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function rl(){var r;return i.charCodeAt(c)===91?(r=bs,c++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(c)===123?(r=Me,c++):(r=t,g===0&&m(kr))),r}function il(){var r;return i.charCodeAt(c)===93?(r=ys,c++):(r=t,g===0&&m($s)),r===t&&(i.charCodeAt(c)===125?(r=Pr,c++):(r=t,g===0&&m(Tr))),r}const{errorOnLuceneSyntax:sl,parseCursor:nl,cursorSymbol:ol,allowLeadingWildcards:al=!0,helpers:{nodeTypes:Pe}}=o,ee=Pe.function.buildNodeWithArgumentNodes,de=Pe.literal.buildNode,cl=Pe.wildcard.buildNode,ll=Pe.namedArg.buildNode,{wildcardSymbol:Is}=Pe.wildcard;if(Tt=d(),Tt!==t&&c===i.length)return Tt;throw Tt!==t&&c<i.length&&m({type:"end",description:"end of input"}),Ss(null,Br,J<i.length?i.charAt(J):null,J<i.length?Ot(J,J+1):Ot(J,J))}return{SyntaxError:e,parse:n}}(),pr=(s,e={},n=$t)=>{if(typeof s>"u")throw new Error("expression must be a string, got undefined instead");return n(s,{...e,helpers:{nodeTypes:Z}})},ze=(s,e={})=>pr(s,{...e,startRule:"Literal"},$t),wt=(s,e={})=>{try{return pr(s,e,$t)}catch(n){throw n.name==="SyntaxError"?new $i(n,s):n}},Bn=s=>{try{return pr(s,{errorOnLuceneSyntax:!0},$t),!1}catch(e){return e.message.startsWith("Lucene")}},B=(s,e,n,i)=>(e=void 0,!s||!s.type||!Z[s.type]?B(Z.function.buildNode("and",[]),e):Z[s.type].toOpenSearchQuery(s,e,n,i)),re="@kuery-wildcard@";function jn(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rn(s){return s.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Mn(s){return s.includes(re)?{type:"wildcard",value:s}:ze(s)}function wi(s,e){const{value:n}=s,i=n.split(re).map(jn).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(e)}function In(s){const{value:e}=s;return e.split(re).join("*")}function ur(s){const{value:e}=s;return e.split(re).map(Rn).join("*")}function Hn(s){const{value:e}=s;return e.startsWith(re)&&e.replace(re,"").length>0}const Un=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Mn,hasLeadingWildcard:Hn,test:wi,toOpenSearchQuery:In,toQueryStringQuery:ur,wildcardSymbol:re},Symbol.toStringTag,{value:"Module"}));function hr(s,e){if(!e)return[];if(s.type==="literal"){const n=lr(s),i=e.fields.find(o=>o.name===n);return i?[i]:[]}else if(s.type==="wildcard")return e.fields.filter(i=>wi(s,i.name))}function hl(s){return s}function _i(s,e,n){const i={...s,value:n?`${n}.${s.value}`:s.value};if(!e||i.type==="wildcard"&&!n)return i;const t=hr(i,e).reduce((l,d)=>{const f=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return n&&!f?[...l,`${d.name} is not a nested field but is in nested group "${n}" in the DQL expression.`]:f&&!n?[...l,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:f!==n?[...l,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:l},[]);if(t.length>0)throw new Error(t.join(`
|
|
752
|
+
`));return i}function Fn(s,e,n=!1){if(s===void 0)throw new Error("fieldName is a required argument");if(e===void 0)throw new Error("value is a required argument");const i=typeof s=="string"?ze(s):Ne(s),o=typeof e=="string"?ze(e):Ne(e),t=Ne(n);return{arguments:[i,o,t]}}function Qn(s,e,n={},i={}){const{arguments:[o,t,l]}=s,d=_i(o,e,i!=null&&i.nested?i.nested.path:void 0),f=B(d),y=t!==void 0?B(t):t,x=l.value?"phrase":"best_fields";if(d.value===null)return t.type==="wildcard"?{query_string:{query:ur(t)}}:{multi_match:{type:x,query:y,lenient:!0}};const $=e?hr(d,e):[];$&&$.length===0&&$.push({name:B(d),scripted:!1,type:""});const E=t.type==="wildcard"&&y==="*",C=d.type==="wildcard"&&f==="*"||$&&e&&$.length===e.fields.length;return E&&C?{match_all:{}}:{bool:{should:$.reduce((R,M)=>{const G=U=>{var Me;return d.type!=="wildcard"||!((Me=M.subType)!=null&&Me.nested)||i!=null&&i.nested?U:{nested:{path:M.subType.nested.path,query:U,score_mode:"none"}}};if(M.scripted)return[];if(E)return[...R,G({exists:{field:M.name}})];if(t.type==="wildcard")return[...R,G({query_string:{fields:[M.name],query:ur(t)}})];if(M.type==="date"){const U=n.dateFormatTZ?{time_zone:n.dateFormatTZ}:{};return[...R,G({range:{[M.name]:{gte:y,lte:y,...U}}})]}else{const U=x==="phrase"?"match_phrase":"match";return[...R,G({[U]:{[M.name]:y}})]}},[])||[],minimum_should_match:1}}}const qn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Fn,toOpenSearchQuery:Qn},Symbol.toStringTag,{value:"Module"}));function Wn(s){return{arguments:s}}function Vn(s,e,n={},i={}){return{bool:{filter:(s.arguments||[]).map(t=>B(t,e,n,i))}}}const Yn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Wn,toOpenSearchQuery:Vn},Symbol.toStringTag,{value:"Module"}));function Zn(s){return{arguments:s}}function Kn(s,e,n={},i={}){return{bool:{should:(s.arguments||[]).map(t=>B(t,e,n,i)),minimum_should_match:1}}}const Xn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Zn,toOpenSearchQuery:Kn},Symbol.toStringTag,{value:"Module"}));function Gn(s){return{arguments:[s]}}function Jn(s,e,n={},i={}){const[o]=s.arguments;return{bool:{must_not:B(o,e,n,i)}}}const eo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Gn,toOpenSearchQuery:Jn},Symbol.toStringTag,{value:"Module"}));function to(s,...e){let n={};for(let i of e)n[i]=s[i];return n}function ro(s,e){const n=to(e,"gt","lt","gte","lte","format"),i=typeof s=="string"?ze(s):Z.literal.buildNode(s),o=Object.entries(n).map(t=>{let[l,d]=t;return Z.namedArg.buildNode(l,d)});return{arguments:[i,...o]}}function io(s,e,n={},i={}){const[o,...t]=s.arguments,l=_i(o,e,i!=null&&i.nested?i.nested.path:void 0),d=e?hr(l,e):[],f=so(t),y=Object.fromEntries(Object.entries(f).map(([$,E])=>[$,B(E)]));return d&&d.length===0&&d.push({name:B(l),scripted:!1,type:""}),{bool:{should:d.map($=>{const E=C=>{var k;return l.type!=="wildcard"||!((k=$.subType)!=null&&k.nested)||i.nested?C:{nested:{path:$.subType.nested.path,query:C,score_mode:"none"}}};if($.scripted)return{};if($.type==="date"){const C=n.dateFormatTZ?{time_zone:n.dateFormatTZ}:{};return E({range:{[$.name]:{...y,...C}}})}return E({range:{[$.name]:y}})}),minimum_should_match:1}}}function so(s){if(s.gt&&s.gte||s.lt&&s.lte)throw new Error("range ends cannot be both inclusive and exclusive");const e=["gte","lte","format"];return s.reduce((n,i,o)=>(i.type==="namedArg"?n[i.name]=i.value:n[e[o]]=i,n),{})}const no=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ro,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function oo(s){return{arguments:[Ne(s)]}}function ao(s,e,n={},i={}){const{arguments:[o]}=s,t={...o,value:i!=null&&i.nested?`${i.nested.path}.${o.value}`:o.value},l=lr(t),d=((e==null?void 0:e.fields)||[]).find(f=>f.name===l);if(d&&d.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:l}}}const co=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:oo,toOpenSearchQuery:ao},Symbol.toStringTag,{value:"Module"}));function lo(s,e){return{arguments:[typeof s=="string"?ze(s):Ne(s),e]}}function po(s,e,n={},i={}){var f;const[o,t]=s.arguments,l=B(o),d=(f=i==null?void 0:i.nested)!=null&&f.path?`${i.nested.path}.${l}`:l;return{nested:{path:d,query:B(t,e,n,{...i,nested:{path:d}}),score_mode:"none"}}}const dr={is:qn,and:Yn,or:Xn,not:eo,range:no,exists:co,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:po},Symbol.toStringTag,{value:"Module"}))};function uo(s,...e){const n=dr[s];if(n===void 0)throw new Error(`Unknown function "${s}"`);return{type:"function",function:s,...n.buildNodeParams(...e)}}function ho(s,e){if(dr[s]===void 0)throw new Error(`Unknown function "${s}"`);return{type:"function",function:s,arguments:e}}function fo(s,e,n,i){return dr[s.function].toOpenSearchQuery(s,e,n,i)}const go=Object.freeze(Object.defineProperty({__proto__:null,buildNode:uo,buildNodeWithArgumentNodes:ho,toOpenSearchQuery:fo},Symbol.toStringTag,{value:"Module"}));function vo(s,e){const n=e.type==="literal"?e:Z.literal.buildNode(e);return{type:"namedArg",name:s,value:n}}function bo(s){return B(s.value)}const Z={function:go,literal:zn,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:vo,toOpenSearchQuery:bo},Symbol.toStringTag,{value:"Module"})),wildcard:Un},mo=re,yo=(s,e)=>"("+(s.arguments||[]).map(i=>xe(i,e)).join(" AND ")+")",$o=(s,e)=>{var{arguments:[n,i,o]}=s;let t="=";i.type==="wildcard"&&(t="");let l=xe(i);o=o.value||typeof l=="string",i.type==="literal"&&o&&(l=`'${l}'`),i.type==="literal"&&!o&&(l=`${l}`);let d=xe(n);return d==null?e&&o?`(${e.filter(f=>f.type==="string").map(f=>`${f.name} ILIKE '%${i.value}%'`).join(" OR ")})`:e&&!o&&(i.value===!0||i.value===!1)?`(${e.filter(f=>f.type==="boolean").map(f=>`${f.name}=${i.value}`).join(" OR ")})`:"":d+t+l},wo=(s,e)=>"("+(s.arguments||[]).map(i=>xe(i,e)).join(" OR ")+")",_o=(s,e)=>{const[n]=s.arguments;return"NOT ("+xe(n,e)+")"},So={gt:">",lt:"<",gte:">=",lte:"<="},Ao={is:$o,and:yo,or:wo,not:_o,range:s=>{const[e,n]=s.arguments;let i=n.value;const o=So[n.name];let t=xe(i);return i.type==="literal"&&(t=`${t}`),`${e.value} ${o} ${t}`},exists:s=>{const[e]=s.arguments;return`${e.value} IS NOT NULL`},nested:s=>(console.warn("Nested types dont exist in CQL",s),"")},xo={function:(s,e)=>Ao[s.function](s,e),literal:s=>s.value,wildcard:s=>{const{value:e}=s;return` LIKE '${e.split(mo).join("%")}'`}},xe=(s,e)=>{const n=xo[s.type];return n(s,e)},Co=re,Eo=s=>({$and:(s.arguments||[]).map(i=>ce(i))}),ko=s=>{const{arguments:[e,n]}=s;let i=ce(n);if(n.type==="wildcard"&&n.value==="@kuery-wildcard@")return Si(s);let t={};return t[ce(e)]={$eq:i},t},Po=s=>({$or:(s.arguments||[]).map(n=>ce(n))}),To=s=>{const[e]=s.arguments;let n={};return n={$ne:ce(e)},n},Oo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Do=s=>{const[e,n]=s.arguments;let i=n.value;const o=Oo[n.name];let t=ce(i),l={};return l[e.value]={},l[e.value][o]=t,l},Si=s=>{const[e]=s.arguments;return{[ce(e)]:{$ne:null}}},Lo={is:ko,and:Eo,or:Po,not:To,range:Do,exists:Si,nested:s=>(console.warn("TODO Implement nested search",s),"")},No={function:s=>Lo[s.function](s),literal:s=>s.value,wildcard:s=>{const{value:e}=s;return`/${e.split(Co).join(".*")}/`}},ce=(s,e)=>{const n=No[s.type];return n(s,e)},zo=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:$i,doesKueryExpressionHaveLuceneSyntaxError:Bn,fromKueryExpression:wt,fromLiteralExpression:ze,nodeTypes:Z,parse:wt,toCql:xe,toDSL:B,toMongo:ce,toOpenSearchQuery:B},Symbol.toStringTag,{value:"Module"})),Bo=I`
|
|
751
753
|
:host {
|
|
752
754
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
753
755
|
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
@@ -794,7 +796,7 @@ spectric-button{
|
|
|
794
796
|
right: 0;
|
|
795
797
|
top: 0;
|
|
796
798
|
}
|
|
797
|
-
`;var jo=Object.defineProperty,
|
|
799
|
+
`;var jo=Object.defineProperty,Ro=Object.getOwnPropertyDescriptor,le=(s,e,n,i)=>{for(var o=i>1?void 0:i?Ro(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&jo(e,n,o),o};const _t="spectric-dialog";h.DialogElement=class extends D{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async e=>{const n=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||n===e.target&&(this.open=!1)},this._handleKeyDown=e=>{this.closeOnEscape||e.preventDefault(),this.open&&this.closeOnEscape&&e.key==="Escape"&&(this.open=!1)},this._onClose=e=>{e.preventDefault(),e.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(e,n){let i=document.createElement(_t);i.addEventListener("close",()=>{i.remove()});for(let t in e)i[t]=e[t];let o=document.createDocumentFragment();return Ge(n,o),i.appendChild(o),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(e=>e.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(e=>e.removeEventListener("keydown",this._handleKeyDown))}updated(e){e.has("open")&&this.dialogElement.then(n=>{this.open?n.showModal():n.close()})}render(){return S`
|
|
798
800
|
<dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
|
|
799
801
|
<spectric-panel>
|
|
800
802
|
<div class="modal">
|
|
@@ -810,17 +812,17 @@ spectric-button{
|
|
|
810
812
|
</div>
|
|
811
813
|
</spectric-panel>
|
|
812
814
|
</dialog>
|
|
813
|
-
`}},h.DialogElement.styles=
|
|
815
|
+
`}},h.DialogElement.styles=Bo,le([b({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),le([b({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),le([b({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),le([b({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),le([b({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),le([b({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),le([dt("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=le([O(_t)],h.DialogElement);var Mo=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,K=(s,e,n,i)=>{for(var o=i>1?void 0:i?Io(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Mo(e,n,o),o},fr=(s=>(s.MONGO="toMongo",s.CQL="toCql",s.DSL="toDSL",s.AST="AST",s))(fr||{});const Ai={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},Ho={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},Uo=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Fo=Object.fromEntries(Object.entries(Ai).map(([s,e])=>[s,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends D{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(e=void 0)=>{let n;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let t=this.value;this._input.selectionStart!==null&&(t=t.substring(0,this._input.selectionStart)+"@kuery-cursor@"+t.substring(this._input.selectionStart));let l=wt(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(l)}catch{return}try{n=wt(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=n:i=zo[this.outputLanguage](n,this.fields);let o=new CustomEvent("change",{detail:i});this.dispatchEvent(o)},this.getValuesForField=async(e,n)=>(console.log("getValuesForField isn't set no values returned",e,n),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let e=this.completions[this.completionIndex],n=this.value.substring(0,e.start)+e.value,i=n.length,o=this.value.substring(e.end);if(e.value.includes(o)?this.value=n:this.value=n+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(i,i),e.onSelect){let t=await e.onSelect();t!==void 0&&(this.value+=t,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=e=>{var n;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(n=this._asyncAutocomplete)==null||n.then(i=>{let o=i.querySelector(".option.active");o&&o.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){if(this.completions=[],e.type!=="cursor")return;let n=[];this.suggestion=e;let{start:i,end:o}=e;for(let t of e.suggestionTypes){if(t=="conjunction"&&e.text.endsWith(" ")&&n.push(...["and ","or "].map(l=>({type:t,value:l,start:o,end:o}))),t==="field"){let l=this.fields.filter(d=>d.name.includes(e.fieldName)||d.name.includes(e.prefix)).map(d=>[{type:t,value:d.name,start:i,end:o}]).flat();n.push(...l)}if(t==="operator"){let l=this.fields.find(d=>d.name===e.fieldName);l&&(l.type==="number"?n.push(...Object.values(Ai).map(d=>({type:t,...d,start:o,end:o}))):l.type==="string"?l.format==="date-time"?n.push(...Object.values(Fo).map(d=>({type:t,...d,start:o,end:o,onSelect:async()=>{let f=await this.getValuesForField(e.fieldName,e.prefix);f.length===0&&(f=["now-1m","now-1d","now-1M"]);let y,x=tt();return await new Promise($=>{let E=h.DialogElement.display({},S`
|
|
814
816
|
<div class="query-bar-date-quick-select">
|
|
815
817
|
${f.map(C=>S`<a href="#" @click=${k=>{k.preventDefault(),y=`"${C}"`,$(y),E.open=!1}}>${C}</a>`)}
|
|
816
818
|
</div>
|
|
817
819
|
<spectric-input variant="datetime-local" @change=${C=>{if(!C.target)return;y=`"${new Date(C.target.value+":00.000Z").toISOString()}"`,x.value.disabled=y===void 0}}></spectric-input>
|
|
818
820
|
<spectric-button ${rt(x)} .disabled=${!0} @click=${()=>{$(y),E.open=!1}}>Submit</spectric-button>
|
|
819
|
-
`)}),y}}))):n.push(...Object.values(
|
|
821
|
+
`)}),y}}))):n.push(...Object.values(Ho).map(d=>({type:t,...d,start:o,end:o}))):l.type==="boolean"&&n.push(...Uo.map(d=>({type:t,...d,start:o,end:o}))))}if(t==="value"){let l=this.fields.find(d=>d.name===e.fieldName);if(l&&l.type=="boolean")n.push({type:t,value:"true",start:i,end:o},{type:t,value:"false",start:i,end:o});else{console.log(`invoke callback to get values for ${e.fieldName}`);let d=await this.getValuesForField(e.fieldName,e.prefix);(l==null?void 0:l.type)==="string"&&(d=d.map(f=>`"${f}"`)),n.push(...d.map(f=>({type:t,value:f,start:i,end:o})))}}}if(this.completions=n,this.completions.length&&this._autocomplete){let{width:t,left:l,bottom:d}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${l+3.75}px`,this._autocomplete.style.top=`${d}px`),this._autocomplete.style.width=`${t-15}px`}}updated(e){e.has("outputLanguage")&&this._parseQuery()}render(){return S`
|
|
820
822
|
<spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${e=>e.stopPropagation()}></spectric-input>
|
|
821
823
|
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
822
824
|
${this.completions.map((e,n)=>S`<div @click=${()=>{this.completionIndex=n,this._selectCompletion()}} class=${this.completionIndex==n?"option active":"option"}><span class="optiontype ${e.type}">${e.type}</span> <span class="value">${e.value}</span> <span class="label">${e.label}</span></span> </div></div>`)}
|
|
823
|
-
</div>`}},
|
|
825
|
+
</div>`}},K([b({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),K([b({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),K([b({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),K([F()],h.SpectricQuery.prototype,"completions",2),K([F()],h.SpectricQuery.prototype,"completionIndex",2),K([b({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),K([ye(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),K([dt(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),K([ye("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=K([O("spectric-query")],h.SpectricQuery);const xi=I`
|
|
824
826
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
825
827
|
background-color: var(--panel-color,#0b0b0b);
|
|
826
828
|
--spectric-input-color: var(--spectric-background);
|
|
@@ -828,7 +830,7 @@ spectric-button{
|
|
|
828
830
|
--spectric-text-primary:var(--text-primary);
|
|
829
831
|
--spectric-text-secondary:var(--text-secondary);
|
|
830
832
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
831
|
-
`,
|
|
833
|
+
`,Ci=I`
|
|
832
834
|
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
833
835
|
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
834
836
|
color:var(--text-primary,#3c4c5b);
|
|
@@ -836,7 +838,7 @@ spectric-button{
|
|
|
836
838
|
--spectric-text-primary:var(--text-secondary);
|
|
837
839
|
--spectric-text-secondary:var(--text-primary);
|
|
838
840
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
839
|
-
`,
|
|
841
|
+
`,Qo=I`
|
|
840
842
|
:host{
|
|
841
843
|
display:block;
|
|
842
844
|
border:2px solid black;
|
|
@@ -846,20 +848,20 @@ spectric-button{
|
|
|
846
848
|
|
|
847
849
|
}
|
|
848
850
|
:host(spectric-panel[level='0']) {
|
|
849
|
-
${
|
|
851
|
+
${xi};
|
|
850
852
|
}
|
|
851
853
|
|
|
852
854
|
:host(spectric-panel[level='1']) {
|
|
853
|
-
${
|
|
855
|
+
${Ci};
|
|
854
856
|
}
|
|
855
857
|
|
|
856
858
|
:host(spectric-panel[level='2']) {
|
|
857
|
-
${
|
|
859
|
+
${xi};
|
|
858
860
|
}
|
|
859
861
|
:host(spectric-panel[level='3']) {
|
|
860
|
-
${
|
|
862
|
+
${Ci};
|
|
861
863
|
}
|
|
862
|
-
`;var
|
|
864
|
+
`;var qo=Object.defineProperty,Wo=Object.getOwnPropertyDescriptor,gr=(s,e,n,i)=>{for(var o=i>1?void 0:i?Wo(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&qo(e,n,o),o};h.SpectricPanel=class extends D{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(e=>{e.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return S` <slot></slot> `}},h.SpectricPanel.styles=Qo,gr([b({type:Number,reflect:!0})],h.SpectricPanel.prototype,"level",2),gr([b({attribute:!1})],h.SpectricPanel.prototype,"layers",2),h.SpectricPanel=gr([O("spectric-panel")],h.SpectricPanel);var Vo=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Ei=(s,e,n,i)=>{for(var o=i>1?void 0:i?Yo(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Vo(e,n,o),o};const ki={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},Pi={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},Ti={...Pi,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},vr={undefined:{},light:{},dark:Pi,spectric:Ti,spectricFlat:{...Ti,"--border-radius":"1px"}},Oi=Object.fromEntries(Object.keys(vr).map(s=>[s,s])),br=["--spectric-background","--spectric-background-hover","--spectric-background-inverse","--spectric-background-inverse-hover","--spectric-border-radius","--spectric-primary","--spectric-secondary","--spectric-tertiary","--spectric-disabled","--panel-color","--panel-color-inverse","--spectric-border-disabled","--spectric-input-color","--spectric-input-bottom","--spectric-text-on-color","--spectric-text-on-color-disabled","--spectric-text-placeholder","--spectric-text-primary","--spectric-text-secondary","--spectric-button-separator","--spectric-button-primary","--spectric-button-secondary","--spectric-button-tertiary","--spectric-button-danger-primary","--spectric-button-danger-secondary","--spectric-button-danger-active","--spectric-button-primary-active","--spectric-button-secondary-active","--spectric-button-tertiary-active","--spectric-button-danger-hover","--spectric-button-primary-hover","--spectric-button-secondary-hover","--spectric-button-tertiary-hover","--spectric-text-on-color-disabled"],Zo=`
|
|
863
865
|
--spectric-background: var(--background,#ffffff);
|
|
864
866
|
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
865
867
|
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
@@ -907,7 +909,7 @@ spectric-button{
|
|
|
907
909
|
${this.theme&&this.theme!=="light"?S`
|
|
908
910
|
<style>:host{
|
|
909
911
|
${n};
|
|
910
|
-
${
|
|
912
|
+
${Zo}
|
|
911
913
|
}
|
|
912
914
|
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
913
915
|
::-webkit-scrollbar-thumb {
|
|
@@ -980,7 +982,7 @@ spectric-button{
|
|
|
980
982
|
<slot></slot>
|
|
981
983
|
`}},h.SpectricThemeProvider.styles=I`:host{
|
|
982
984
|
display:contents;
|
|
983
|
-
}`,
|
|
985
|
+
}`,Ei([b({reflect:!0})],h.SpectricThemeProvider.prototype,"theme",2),h.SpectricThemeProvider=Ei([O("spectric-theme")],h.SpectricThemeProvider);const Ko=I`
|
|
984
986
|
:host {
|
|
985
987
|
display: block;
|
|
986
988
|
height: 100%;
|
|
@@ -1043,7 +1045,7 @@ spectric-button{
|
|
|
1043
1045
|
width: 5px;
|
|
1044
1046
|
cursor: ew-resize;
|
|
1045
1047
|
}
|
|
1046
|
-
`;var
|
|
1048
|
+
`;var Xo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,H=(s,e,n,i)=>{for(var o=i>1?void 0:i?Go(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Xo(e,n,o),o},mr=(s=>(s.horizontal="horizontal",s.vertical="vertical",s))(mr||{});const yr="spectric-splitview";h.SplitView=class extends ae{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:n,orientation:i,invisible:o,min:t,max:l,useSavedState:d}=this,f=this.getAttribute("id");f&&this.useSavedState&&localStorage.setItem(`splitview-${f}`,String(n)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:n,invisible:o,min:t,max:l,useSavedState:d}}))},this._onMouseMove=gt(n=>{if(this.isDragging){const i=this.getBoundingClientRect();let o,t;this.orientation==="horizontal"?(o=n.clientX-i.left,t=o/i.width*100):(o=n.clientY-i.top,t=o/i.height*100),t=Math.min(Math.max(t,this.min),this.max),this.percentage=t,this._emitChange()}}),this._assignSlot=n=>{if(!n.target)return;let o=n.target.assignedNodes().filter(t=>t instanceof HTMLElement);o.length>2&&console.log("cannot assign more than 2 elements to a split view"),o.forEach(t=>{if(this._panel1.assignedNodes().length===0){t.slot="panel1";return}if(this._panel2.assignedNodes().length===0){t.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let e=this.getAttribute("id");if(e&&this.useSavedState){let n=localStorage.getItem(`splitview-${e}`);n&&(this.percentage=parseFloat(n))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(e){e.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return S`
|
|
1047
1049
|
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
1048
1050
|
<span class="error-display">${this._error}</span>
|
|
1049
1051
|
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
@@ -1055,7 +1057,7 @@ spectric-button{
|
|
|
1055
1057
|
</div>
|
|
1056
1058
|
</div>
|
|
1057
1059
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
1058
|
-
`}},h.SplitView.styles=Ko,H([b({type:String})],h.SplitView.prototype,"orientation",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),H([b({type:Boolean})],h.SplitView.prototype,"invisible",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),H([b({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),H([F()],h.SplitView.prototype,"isDragging",2),H([F()],h.SplitView.prototype,"_error",2),H([dt(".splitter")],h.SplitView.prototype,"_splitter",2),H([ye("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),H([ye("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=H([O(
|
|
1060
|
+
`}},h.SplitView.styles=Ko,H([b({type:String})],h.SplitView.prototype,"orientation",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),H([b({type:Boolean})],h.SplitView.prototype,"invisible",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),H([b({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),H([b({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),H([F()],h.SplitView.prototype,"isDragging",2),H([F()],h.SplitView.prototype,"_error",2),H([dt(".splitter")],h.SplitView.prototype,"_splitter",2),H([ye("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),H([ye("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=H([O(yr)],h.SplitView);var Jo=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,Ce=(s,e,n,i)=>{for(var o=i>1?void 0:i?ea(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Jo(e,n,o),o};const $r="spectric-pagination";h.PaginationElement=class extends D{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=e=>{e.stopPropagation(),e.preventDefault();let n=parseInt(e.target.value);this.pageSize=n,this._emitChange()},this._emitChange=()=>{let{page:e,pageSize:n}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:e,pageSize:n}}))}}createRenderRoot(){return this}update(e){e.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((n,i)=>n-i),requestAnimationFrame(()=>{this.select&&this.select.value!==String(this.pageSize)&&(this.select.value=String(this.pageSize))})),super.update(e)}render(){let e=this.page*this.pageSize,n=!0;this.totalItems&&e<this.totalItems&&(n=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),S`
|
|
1059
1061
|
<div class="spectric-pagination-container">
|
|
1060
1062
|
<div>
|
|
1061
1063
|
<!-- TODO/FIXME Make a select component and use it for cross browser styling-->
|
|
@@ -1076,11 +1078,11 @@ spectric-button{
|
|
|
1076
1078
|
</div>
|
|
1077
1079
|
`:null}
|
|
1078
1080
|
</div>
|
|
1079
|
-
`}},Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),Ce([b({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),Ce([ye("select")],h.PaginationElement.prototype,"select",2),Ce([b({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=Ce([O(
|
|
1081
|
+
`}},Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),Ce([b({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),Ce([b({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),Ce([ye("select")],h.PaginationElement.prototype,"select",2),Ce([b({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=Ce([O($r)],h.PaginationElement);const ta=Object.freeze(Object.defineProperty({__proto__:null,BitArray:sr,DisposableElement:ae,getListeners:di},Symbol.toStringTag,{value:"Module"}));var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,wr=(s,e,n,i)=>{for(var o=i>1?void 0:i?ia(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&ra(e,n,o),o};const sa="spectric-table-header";let St=class extends ae{constructor(){super(),this.columns=[],this._handleSortChange=s=>{this._resizeStart||(s=JSON.parse(JSON.stringify(s)),s.sortable&&(s.sortDirection===j.none||s.sortDirection===void 0?s.sortDirection=j.ascending:s.sortDirection===j.ascending?s.sortDirection=j.descending:s.sortDirection===j.descending&&(s.sortDirection=j.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:s}))))},this._handleResizeStart=(s,e)=>{this._resizeStart={event:s,column:e}},this._handleResizeEnd=s=>{var n;if(!this._resizeStart)return;let e=s.pageX-((n=this._resizeStart)==null?void 0:n.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let i=this._resizeStart.event.target.closest("td");this._resizeStart.column.width=i.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let i=window.getSelection();i&&i.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return S`
|
|
1080
1082
|
<tr>
|
|
1081
1083
|
${this.columns.map(s=>this.renderCell(s))}
|
|
1082
1084
|
</tr>
|
|
1083
|
-
`}renderCell(s){let e=["header-contents"];s.filterable,s.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let n=s.width?`min-width:${s.width}px;max-width:${s.width}px;`:"",i=s.sortDirection===
|
|
1085
|
+
`}renderCell(s){let e=["header-contents"];s.filterable,s.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let n=s.width?`min-width:${s.width}px;max-width:${s.width}px;`:"",i=s.sortDirection===j.ascending?"🠉":s.sortDirection==j.descending?"🠋":"",o=s.sortDirection||j.none,l=s.allowResize||s.allowResize===void 0?S`<div
|
|
1084
1086
|
class="header-resize-handle"
|
|
1085
1087
|
@mousedown=${d=>{this._handleResizeStart(d,s)}}
|
|
1086
1088
|
@mouseup=${this._handleResizeEnd}
|
|
@@ -1088,27 +1090,27 @@ spectric-button{
|
|
|
1088
1090
|
@click=${()=>this._handleSortChange(s)}
|
|
1089
1091
|
style="${n}"
|
|
1090
1092
|
>
|
|
1091
|
-
${
|
|
1093
|
+
${l}
|
|
1092
1094
|
<div class=${e.join(" ")}>
|
|
1093
1095
|
${s.title||s.key}
|
|
1094
1096
|
<span class="sort-direction ${o}">${i}</span>
|
|
1095
1097
|
</div>
|
|
1096
|
-
</td>`}}
|
|
1098
|
+
</td>`}};wr([b({type:Array,attribute:!1})],St.prototype,"columns",2),wr([F()],St.prototype,"_resizeStart",2),St=wr([O(sa)],St);/**
|
|
1097
1099
|
* @license
|
|
1098
1100
|
* Copyright 2017 Google LLC
|
|
1099
1101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1100
|
-
*/const
|
|
1102
|
+
*/const Di=s=>un(s)?s._$litType$.h:s.strings,na=Je(class extends ht{constructor(s){super(s),this.et=new WeakMap}render(s){return[s]}update(s,[e]){const n=gi(this.it)?Di(this.it):null,i=gi(e)?Di(e):null;if(n!==null&&(i===null||n!==i)){const o=tr(s).pop();let t=this.et.get(n);if(t===void 0){const l=document.createDocumentFragment();t=Ge(P,l),t.setConnected(!1),this.et.set(n,t)}er(t,[o]),$e(t,void 0,o)}if(i!==null){if(n===null||n!==i){const o=this.et.get(i);if(o!==void 0){const t=tr(o).pop();fn(s),$e(s,void 0,t),er(s,[t])}}this.it=e}else this.it=void 0;return this.render(e)}});var oa=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,Be=(s,e,n,i)=>{for(var o=i>1?void 0:i?aa(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&oa(e,n,o),o};const ca="spectric-table-cell";let Ee=class extends D{constructor(){super(...arguments),this.overflow="",this.styleRules={whiteSpace:"",width:""},this._handleFilterOut=()=>{let s;this.column.key&&typeof this.row=="object"&&(s=je(this.row,this.column.key)),this._emitFilter({include:!1,row:this.row,value:s,column:this.column})},this._handleFilterFor=()=>{let s;this.column.key&&typeof this.row=="object"&&(s=je(this.row,this.column.key)),this._emitFilter({include:!0,row:this.row,value:s,column:this.column})},this._displayTooltip=()=>{let s=this.querySelector("div.cell-contents"),e=this.querySelector("span");if(s&&e){let n=e.getBoundingClientRect(),i=s.getBoundingClientRect();n.width*n.height>i.width*i.height?(console.log("We need to show a tooltip witht he content because we are overflowing"),this.overflow=this.getRenderedValue(),this.updateComplete.then(()=>{let o=this.querySelector("spectric-tooltip");o&&o.showToolTip()})):this.overflow=""}}}createRenderRoot(){return this}updated(s){}_emitFilter(s){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:s}))}getRenderedValue(){let s;return this.column.render?s=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?s=je(this.row,this.column.key):s=S`error`,s}render(){let s=this.getRenderedValue(),e=["cell-contents"];this.column.filterable&&e.push("filterable");let n=na(this.column.filterable?S`<div class="table-cell-actions">
|
|
1101
1103
|
<spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
|
|
1102
1104
|
<spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`:null);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},S`
|
|
1103
|
-
<td style=${
|
|
1105
|
+
<td style=${Kt(this.styleRules)} @mouseenter=${this._displayTooltip}>
|
|
1104
1106
|
${n}
|
|
1105
1107
|
<div class=${e.join(" ")}>${this.overflow?S`<spectric-tooltip .text=${this.overflow}></spectric-tooltip>`:null}<span>${s}</span></div>
|
|
1106
1108
|
</td>
|
|
1107
|
-
`}};
|
|
1109
|
+
`}};Be([b({type:Object,attribute:!1})],Ee.prototype,"row",2),Be([b({type:Number,attribute:!1})],Ee.prototype,"index",2),Be([b({type:Object,attribute:!1})],Ee.prototype,"column",2),Be([F()],Ee.prototype,"overflow",2),Be([ye("td")],Ee.prototype,"td",2),Ee=Be([O(ca)],Ee);const je=(s,e)=>{let n=e.split("."),i=s[n[0]];return i==null||n.length>1&&(i=je(i,n.slice(1).join("."))),i};/**
|
|
1108
1110
|
* @license
|
|
1109
1111
|
* Copyright 2017 Google LLC
|
|
1110
1112
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1111
|
-
*/const
|
|
1113
|
+
*/const Li=(s,e,n)=>{const i=new Map;for(let o=e;o<=n;o++)i.set(s[o],o);return i},At=Je(class extends ht{constructor(s){if(super(s),s.type!==Zt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,n){let i;n===void 0?n=e:e!==void 0&&(i=e);const o=[],t=[];let l=0;for(const d of s)o[l]=i?i(d,l):l,t[l]=n(d,l),l++;return{values:t,keys:o}}render(s,e,n){return this.dt(s,e,n).values}update(s,[e,n,i]){const o=tr(s),{values:t,keys:l}=this.dt(e,n,i);if(!Array.isArray(o))return this.ut=l,t;const d=this.ut??(this.ut=[]),f=[];let y,x,$=0,E=o.length-1,C=0,k=t.length-1;for(;$<=E&&C<=k;)if(o[$]===null)$++;else if(o[E]===null)E--;else if(d[$]===l[C])f[C]=we(o[$],t[C]),$++,C++;else if(d[E]===l[k])f[k]=we(o[E],t[k]),E--,k--;else if(d[$]===l[k])f[k]=we(o[$],t[k]),$e(s,f[k+1],o[$]),$++,k--;else if(d[E]===l[C])f[C]=we(o[E],t[C]),$e(s,o[$],o[E]),E--,C++;else if(y===void 0&&(y=Li(l,C,k),x=Li(d,$,E)),y.has(d[$]))if(y.has(d[E])){const N=x.get(l[C]),R=N!==void 0?o[N]:null;if(R===null){const M=$e(s,o[$]);we(M,t[C]),f[C]=M}else f[C]=we(R,t[C]),$e(s,o[$],R),o[N]=null;C++}else rr(o[E]),E--;else rr(o[$]),$++;for(;C<=k;){const N=$e(s,f[k+1]);we(N,t[C]),f[C++]=N}for(;$<=E;){const N=o[$++];N!==null&&rr(N)}return this.ut=l,er(s,f),oe}});var la=Object.defineProperty,pa=Object.getOwnPropertyDescriptor,_r=(s,e,n,i)=>{for(var o=i>1?void 0:i?pa(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&la(e,n,o),o};const ua="spectric-table-body";let xt=class extends D{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(s){this.data.length>100&&console.warn("Table is rendering excessive amounts of data to the DOM you should set rowHeight and use a virtualized scroll or use pagination")}render(){return S`
|
|
1112
1114
|
<body>
|
|
1113
1115
|
${At(this.data,(s,e)=>S`
|
|
1114
1116
|
<tr class="${e%2===0?"odd":""}">
|
|
@@ -1116,7 +1118,7 @@ spectric-button{
|
|
|
1116
1118
|
</tr>`)}
|
|
1117
1119
|
|
|
1118
1120
|
</body>
|
|
1119
|
-
`}};
|
|
1121
|
+
`}};_r([b({type:Array,attribute:!1})],xt.prototype,"data",2),_r([b({type:Array,attribute:!1})],xt.prototype,"columns",2),xt=_r([O(ua)],xt);var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,it=(s,e,n,i)=>{for(var o=i>1?void 0:i?da(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&ha(e,n,o),o};const fa="spectric-table-virtual-body";let Re=class extends ae{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.columnsMeasured=!1,this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const s=this.table.querySelector(".table-wrapper").scrollTop;requestAnimationFrame(()=>{this.startIndex=Math.floor(s/this.rowHeight)})})}updated(){if(this.columnsMeasured===!1){let s=this.querySelector("tr"),e=s==null?void 0:s.querySelectorAll("spectric-table-cell td");s&&e&&e.length&&this.columns.forEach((n,i)=>{if(!n.width||n.width===0){let o=e[i].getBoundingClientRect();o.width>0&&(this.columnsMeasured=!0,n.width=o.width)}})}}createRenderRoot(){return this}render(){let s=this.data.length,e=10,n=this.table.querySelector("spectric-table-header").clientHeight,i=this.table.querySelector(".table-wrapper"),o=Math.max(this.startIndex-e,0);const t=Math.ceil((i.clientHeight-n)/this.rowHeight),l=Math.min(o+t+e,s),d=l-o;let f=s*this.rowHeight,y=o*this.rowHeight+(i.scrollTop-o*this.rowHeight);l===s&&(y=o*this.rowHeight);let x=d*this.rowHeight,$=f-y-x,E=this.startIndex!=0?S`
|
|
1120
1122
|
<tr style="height:${y}px" class="virtual-scroll-spacer">
|
|
1121
1123
|
<td colspan="${this.columns.length}"></td></tr>`:null,C=S`
|
|
1122
1124
|
<tr style="height:${$}px" class="virtual-scroll-spacer">
|
|
@@ -1127,7 +1129,7 @@ spectric-button{
|
|
|
1127
1129
|
</tbody>
|
|
1128
1130
|
<div style="display:table-row-group;max-height:${x}px; overflow:hidden;">
|
|
1129
1131
|
|
|
1130
|
-
${At(this.data.slice(Math.max(o,0),
|
|
1132
|
+
${At(this.data.slice(Math.max(o,0),l),(k,N)=>S`
|
|
1131
1133
|
<tr class="${(N+o)%2===0?"odd":""}">
|
|
1132
1134
|
${At(this.columns,R=>S`<spectric-table-cell .column=${R} .row=${k} .index=${N+o} .columns=${this.columns}></spectric-table-cell>`)}
|
|
1133
1135
|
</tr>`)}
|
|
@@ -1136,7 +1138,7 @@ spectric-button{
|
|
|
1136
1138
|
${$>0?C:null}
|
|
1137
1139
|
</tbody>
|
|
1138
1140
|
|
|
1139
|
-
`}};it([b({type:Array,attribute:!1})],Re.prototype,"data",2),it([b({type:Array,attribute:!1})],Re.prototype,"columns",2),it([b({type:Number,attribute:!1})],Re.prototype,"rowHeight",2),it([b({type:Number,state:!0})],Re.prototype,"startIndex",2),Re=it([O(
|
|
1141
|
+
`}};it([b({type:Array,attribute:!1})],Re.prototype,"data",2),it([b({type:Array,attribute:!1})],Re.prototype,"columns",2),it([b({type:Number,attribute:!1})],Re.prototype,"rowHeight",2),it([b({type:Number,state:!0})],Re.prototype,"startIndex",2),Re=it([O(fa)],Re);function Ni(s){let e=!1,n;return function(...i){return e||(e=!0,n=s.apply(this,i)),n}}const ga=s=>s.map(({key:e,sortDirection:n,compareFn:i})=>(o,t)=>{if(!e)return;let l=je(o,e),d=je(t,e);if(i)return i(o,t);if(typeof l=="number"||typeof l=="bigint"||typeof l=="boolean"){let f=l-d;return n===j.descending&&(f=f*-1),f}else if(typeof l=="string")return l.localeCompare(d)*(n===j.descending?-1:1)});var va=Object.defineProperty,ba=Object.getOwnPropertyDescriptor,X=(s,e,n,i)=>{for(var o=i>1?void 0:i?ba(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&va(e,n,o),o};const Sr="spectric-table";var Ar=(s=>(s.multi="multi",s.single="single",s.none="none",s))(Ar||{}),xr=(s=>(s.multi="multi",s.single="single",s))(xr||{}),j=(s=>(s.ascending="ascending",s.descending="descending",s.none="none",s))(j||{});h.SpectricTableElement=class extends D{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.sortOrder=[],this.rowHeight=25,this.fontSize=16,this._handlePaginationChange=e=>{if(this.pagination){let n={...this.pagination,...e.detail},{totalItems:i,page:o,pageSize:t}=n;i&&o&&t&&(o-1)*t>i&&(n.page=1),this.pagination=n}this.dispatchEvent(new CustomEvent("paginationChange",{detail:e.detail})),this._emitChange()},this._handleSortChange=e=>{let n=e.detail,i=this.columns.find(o=>o.key==n.key);if(!i||i.key===void 0){console.warn("Unable to find sort column");return}if(this.sort=="single"&&(this.columns.forEach(o=>{o.sortDirection="none"}),this.sortOrder=[]),i.sortDirection=n.sortDirection,!i.sortDirection||i.sortDirection==="none"){let o=this.sortOrder.findIndex(t=>t===i.key);o!==-1&&this.sortOrder.splice(o,1)}else this.sortOrder.findIndex(t=>t===i.key)===-1&&(this.sortOrder=[...this.sortOrder,i.key]);this.columns=[...this.columns],this._emitChange()},this._handleColumnResize=e=>{let n=e.detail,i=this.columns.findIndex(o=>o.key==n.key);this.columns[i]={...this.columns[i]},this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:e,columns:n,sortOrder:i}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:e,columns:n,sortOrder:i}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter")),this.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._handleSelectAllChange=e=>{e.stopPropagation(),e.target.checked?this.selectAll():this.deselectAll()}}static getDefaultDataSorterAndPaginatior(e){return n=>{let i=(n.sortOrder||[]).map(d=>n.columns.find(f=>f.key===d)),o=[...e];if(i.length){let d=ga(i);o.sort((f,y)=>{for(let x of d){let $=x(f,y);if($)return $}return 0})}if(!n.pagination)return o;let{page:t,pageSize:l}=n.pagination;return!t||!l?o:n.pagination?o.slice((t-1)*l,t*l):o}}createRenderRoot(){return this}deselectAll(){this.selected=[],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}selectAll(){this.selected=[...this.data],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}update(e){e.has("select")&&this.select==="single"&&this.selected.length>1&&(this.selected=[this.selected[0]],this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))),super.update(e)}render(){let e=this.columns.filter(o=>!o.hidden);this.select!=="none"&&e.unshift({title:this.select==="multi"?S`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:o=>{let t=document.createElement("div"),l=this.selected.includes(o),d=S`<spectric-input variant="checkbox" class="table-checkbox-${this.select}" .helperText=${""} ${Ae({checked:l})} @change=${f=>{f.stopPropagation();let y=this.selected.findIndex(x=>x===o);if(!(f.target.checked&&y!==-1)){{if(!f.target.checked&&y===-1)return;!f.target.checked&&y!==-1&&this.selected.splice(y,1)}f.target.checked&&(this.select==="single"&&(this.selected=[]),this.selected.push(o)),this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))}}}></spectric-input>`;return Ge(d,t),d}});const n=4;let i=this.rowHeight-n;return i<this.fontSize+n&&(i=this.fontSize+n),S`
|
|
1140
1142
|
<div class="table-wrapper" style="--rowHeight:${i}px;--fontSize:${this.fontSize}px;--lineClamp:${Math.floor(i/this.fontSize)}">
|
|
1141
1143
|
<div role="table">
|
|
1142
1144
|
<spectric-table-header .columns=${e} @sortChange=${this._handleSortChange} @columnResize=${this._handleColumnResize}></spectric-table-header>
|
|
@@ -1144,31 +1146,32 @@ spectric-button{
|
|
|
1144
1146
|
</div>
|
|
1145
1147
|
</div>
|
|
1146
1148
|
${this.pagination?S`<spectric-pagination ${Ae(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
|
|
1147
|
-
`}},X([b({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),X([b({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),X([b({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),X([b({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),X([b({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),X([b({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),X([b({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),X([b({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),X([F()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=X([O(
|
|
1149
|
+
`}},X([b({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),X([b({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),X([b({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),X([b({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),X([b({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),X([b({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),X([b({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),X([b({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),X([F()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=X([O(Sr)],h.SpectricTableElement);var ma=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,pe=(s,e,n,i)=>{for(var o=i>1?void 0:i?ya(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&ma(e,n,o),o};const $a="spectric-popover";let Q=class extends ae{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this._getMousePosition=s=>{this.mouseLocation={left:s.clientX,top:s.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this.applyStyle=s=>{Object.entries(s).forEach(([e,n])=>{this.portalElement.style.setProperty(e,n)})},this.positionTooltip=()=>{if(!this.target)return;let s=getComputedStyle(this),e={};br.forEach(t=>{e[t]=s.getPropertyValue(t)});const n=this.target.getBoundingClientRect(),i=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(i.width=Math.min(i.width,this.maxWidth));let o;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,o={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-i.height/2+"px"}):this.position==="top"?o={top:n.top-i.height+"px",left:n.left+n.width/2-i.width/2+"px"}:this.position==="bottom"?o={top:n.bottom+"px",left:n.left+n.width/2-i.width/2+"px"}:this.position==="left"?o={top:Math.max(0,n.top+n.height/2-i.height/2)+"px",left:n.left-i.width+"px"}:this.position==="right"?o={top:Math.max(0,n.top+n.height/2-i.height/2)+"px",left:n.right+"px"}:(o={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...e,...o}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.showPopover=this.showPopover.bind(this),this.hidePopover=this.hidePopover.bind(this),this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition)}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback(),this.portalElement=document.createElement("div"),this.portalElement.className="spectric-tooltip-portal"}disconnectedCallback(){super.disconnectedCallback(),this.portalElement.remove(),this.portalElement=void 0}hidePopover(){this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()}async showPopover(){this.timer&&clearTimeout(this.timer),await new Promise(e=>{this.timer=window.setTimeout(e,this.delay)}),this.portalElement.className=`spectric-popover-portal ${this.position}`;const s=S`<div class="tooltip-container">
|
|
1148
1150
|
<span class="tooltip-caret"></span>
|
|
1149
1151
|
<div class="tooltip-content">${this.text}</div>
|
|
1150
1152
|
</div>`;Ge(s,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))}render(){return S`<!-- ToolTip -->`}};Q.styles=I`:host{max-height: 0px;
|
|
1151
1153
|
max-width: 0px;
|
|
1152
1154
|
display: none;
|
|
1153
|
-
pointer-events:none;}`,pe([b({type:Number,reflect:!0})],Q.prototype,"delay",2),pe([b({type:Number,reflect:!0})],Q.prototype,"animationDuration",2),pe([b({type:String,reflect:!1})],Q.prototype,"text",2),pe([b({type:String,reflect:!0})],Q.prototype,"position",2),pe([b({type:Number,reflect:!0})],Q.prototype,"maxWidth",2),pe([b({attribute:!1})],Q.prototype,"portalTarget",2),pe([b({attribute:!1})],Q.prototype,"triggerTarget",2),Q=pe([O(
|
|
1155
|
+
pointer-events:none;}`,pe([b({type:Number,reflect:!0})],Q.prototype,"delay",2),pe([b({type:Number,reflect:!0})],Q.prototype,"animationDuration",2),pe([b({type:String,reflect:!1})],Q.prototype,"text",2),pe([b({type:String,reflect:!0})],Q.prototype,"position",2),pe([b({type:Number,reflect:!0})],Q.prototype,"maxWidth",2),pe([b({attribute:!1})],Q.prototype,"portalTarget",2),pe([b({attribute:!1})],Q.prototype,"triggerTarget",2),Q=pe([O($a)],Q);var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,ue=(s,e,n,i)=>{for(var o=i>1?void 0:i?_a(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&wa(e,n,o),o};const Cr="spectric-tooltip";var Er=(s=>(s.top="top",s.bottom="bottom",s.left="left",s.right="right",s.mouse="mouse",s))(Er||{});h.TooltipElement=class extends Q{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this.showToolTip=this.showToolTip.bind(this),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this.hidePopover)}async showToolTip(){await super.showPopover(),this.portalElement.classList.add("spectric-tooltip-portal")}render(){return S`<!-- ToolTip -->`}},h.TooltipElement.styles=I`:host{max-height: 0px;
|
|
1154
1156
|
max-width: 0px;
|
|
1155
1157
|
display: none;
|
|
1156
|
-
pointer-events:none;}`,ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),ue([b({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),ue([b({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),ue([b({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),ue([b({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=ue([O(
|
|
1158
|
+
pointer-events:none;}`,ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),ue([b({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),ue([b({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),ue([b({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),ue([b({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),ue([b({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=ue([O(Cr)],h.TooltipElement);var Sa=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,ke=(s,e,n,i)=>{for(var o=i>1?void 0:i?Aa(e,n):e,t=s.length-1,l;t>=0;t--)(l=s[t])&&(o=(i?l(e,n,o):l(o))||o);return i&&o&&Sa(e,n,o),o};let xa,he=class extends D{constructor(){super(...arguments),this.value="#FF0000FF",this.showAlpha=!0,this.hue=0,this.alpha=1,this.saturation=1,this.lightness=1,this.canvas=tt(),this.sldown=!1,this._handleSaturationLightnessClick=s=>{if(!this.canvas.value)return;let{offsetX:e,offsetY:n}=s;this.saturation=e/this.canvas.value.width,this.lightness=(this.canvas.value.height-n)/this.canvas.value.height,this.updateValue()},this._handleHueChange=s=>{this.hue=parseInt(String(s.target.value))/100*360,s.target.style.setProperty("accent-color",`hsl(${this.hue}deg 100% 50%)`),this.renderHueSaturationGrid(),this.updateValue()},this._handleAlphaChange=s=>{this.alpha=parseInt(String(s.target.value))/100,this.updateValue()},this._handleApply=()=>{var s;this.updateValue(),(s=this.querySelector("spectric-popover"))==null||s.hidePopover()},this._cancel=()=>{var s;this.original&&(this.value=this.original),(s=this.querySelector("spectric-popover"))==null||s.hidePopover()},this._openPopover=async()=>{var s;for(this.original=this.value,(s=this.querySelector("spectric-popover"))==null||s.showPopover();!this.canvas.value;)await new Promise(e=>setTimeout(e,100));this.renderHueSaturationGrid()}}createRenderRoot(){return this}update(s){if(s.has("value")){let{h:e,s:n,l:i,a:o}=Pa(this.value);this.hue=e,this.saturation=n,this.lightness=i,this.alpha=o,this.renderHueSaturationGrid()}super.update(s)}renderHueSaturationGrid(){if(!this.canvas.value)return;let e=this.canvas.value.getContext("2d");if(!e)return;let n=this.canvas.value.width/100,i=this.canvas.value.height/100,o=0,t=0;for(let l of Ea(this.hue))e.fillStyle=l,e.fillRect(o,t,n,i),o+=n,o=o%(n*101),o||(t+=i)}updateValue(){this.value=ka(this.hue,this.saturation*100,this.lightness*100)+Math.round(this.alpha*255).toString(16).padStart(2,"0")}getPopover(){return S`
|
|
1157
1159
|
<spectric-input label="Hue" class="hue-gradient" variant="range" .value=${this.hue||0} style="accent-color:hsl(${this.hue}deg 100% 50%)" @change=${this._handleHueChange}></spectric-input>
|
|
1158
|
-
<canvas ${rt(this.canvas)} width=200 height=100 class="saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
|
|
1160
|
+
<canvas ${rt(this.canvas)} width=200 height=100 class="color-picker-saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
|
|
1159
1161
|
@mousedown=${()=>{this.sldown=!0}}
|
|
1160
1162
|
@mouseup=${()=>this.sldown=!1}
|
|
1161
1163
|
@mousemove=${s=>{this.sldown&&this._handleSaturationLightnessClick(s)}}
|
|
1162
1164
|
></canvas>
|
|
1163
1165
|
<spectric-input class="alpha-gradient" ?hidden=${!this.showAlpha} label="Opacity" variant="range" .value=${(this.alpha||1)*100} @change=${this._handleAlphaChange}></spectric-input>
|
|
1164
1166
|
<div class="color-picker-footer">
|
|
1167
|
+
<spectric-button ?hidden=${xa===void 0} icon class="color-picker-eyedropper" @click=${async()=>{}}>${Ca}</spectric-button>
|
|
1165
1168
|
<spectric-button @click=${this._handleApply}>Apply</spectric-button>
|
|
1166
1169
|
<spectric-button variant="secondary" @click=${this._cancel}>Cancel</spectric-button>
|
|
1167
1170
|
</div>
|
|
1168
1171
|
`}render(){return S`
|
|
1169
|
-
<spectric-button variant="text" @click=${this._openPopover}>
|
|
1172
|
+
<spectric-button variant="text" @click=${this._openPopover} icon>
|
|
1170
1173
|
<spectric-popover .text=${this.getPopover()} icon variant="text"></spectric-popover>
|
|
1171
1174
|
<div style="width:15px;height:15px;background-color:${this.value}"></div>
|
|
1172
1175
|
</spectric-button>
|
|
1173
|
-
`}};ke([b({type:String,reflect:!0})],he.prototype,"value",2),ke([b({type:Boolean,reflect:!0})],he.prototype,"showAlpha",2),ke([F()],he.prototype,"hue",2),ke([F()],he.prototype,"alpha",2),ke([F()],he.prototype,"saturation",2),ke([F()],he.prototype,"lightness",2),he=ke([O("spectric-colorpicker")],he);function*
|
|
1176
|
+
`}};ke([b({type:String,reflect:!0})],he.prototype,"value",2),ke([b({type:Boolean,reflect:!0})],he.prototype,"showAlpha",2),ke([F()],he.prototype,"hue",2),ke([F()],he.prototype,"alpha",2),ke([F()],he.prototype,"saturation",2),ke([F()],he.prototype,"lightness",2),he=ke([O("spectric-colorpicker")],he);const Ca=S`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" height="15" width="15" fill="currentColor"><path d="M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"/></svg>`;function*Ea(s){for(let e=100;e>=0;e--)for(let n=0;n<=100;n++)yield`hsl(${s}, ${n}%, ${e}%)`}function ka(s,e,n){n/=100;const i=e*Math.min(n,1-n)/100,o=t=>{const l=(t+s/30)%12,d=n-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}function Pa(s){let e=0,n=0,i=0,o=255;s.length===4||s.length===5?(e=parseInt(s[1]+s[1],16),n=parseInt(s[2]+s[2],16),i=parseInt(s[3]+s[3],16),s.length===5&&(o=parseInt(s[4]+s[4],16))):(s.length===7||s.length===9)&&(e=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),i=parseInt(s.substring(5,7),16),s.length===9&&(o=parseInt(s.substring(7,9),16))),e/=255,n/=255,i/=255,o/=255;const t=Math.max(e,n,i),l=Math.min(e,n,i);let d=0,f=0,y=(t+l)/2;if(t===l)d=0,f=0;else{const x=t-l;switch(f=y>.5?x/(2-t-l):x/(t+l),t){case e:d=(n-i)/x+(n<i?6:0);break;case n:d=(i-e)/x+2;break;case i:d=(e-n)/x+4;break}d/=6}return d=Math.round(d*360),{h:d,s:f,l:y,a:o}}const Ta={...ta,...Object.freeze(Object.defineProperty({__proto__:null,get BitDisplayCanvas(){return h.BitDisplayCanvas},ButtonSizes:Gt,ButtonVariants:Jt,CSSPropsControls:ki,get DialogElement(){return h.DialogElement},DialogElementTag:_t,ElementTag:yr,get Header(){return h.Header},InputVariants:cr,Orientations:mr,get PaginationElement(){return h.PaginationElement},PaginationElementTag:$r,SPECTRIC_CSS_VARIABLES:br,get SpectricButton(){return h.SpectricButton},get SpectricInput(){return h.SpectricInput},get SpectricPage(){return h.SpectricPage},get SpectricPanel(){return h.SpectricPanel},get SpectricQuery(){return h.SpectricQuery},get SpectricTableElement(){return h.SpectricTableElement},get SpectricThemeProvider(){return h.SpectricThemeProvider},get SplitView(){return h.SplitView},SupportedLanguages:fr,TableElementTag:Sr,TableSelectOptions:Ar,TableSortDirection:j,TableSortOption:xr,ThemeSelections:Oi,get TooltipElement(){return h.TooltipElement},TooltipElementTag:Cr,TooltipPostions:Er,nodeTypes:Z},Symbol.toStringTag,{value:"Module"})),...Object.freeze(Object.defineProperty({__proto__:null,SpreadPropsDirective:or,debounce:yi,debounceAnimation:gt,once:Ni,spreadProps:Ae},Symbol.toStringTag,{value:"Module"}))};h.BitArray=sr,h.ButtonSizes=Gt,h.ButtonVariants=Jt,h.CSSPropsControls=ki,h.DialogElementTag=_t,h.DisposableElement=ae,h.ElementTag=yr,h.InputVariants=cr,h.Orientations=mr,h.PaginationElementTag=$r,h.SPECTRIC_CSS_VARIABLES=br,h.SpreadPropsDirective=or,h.SupportedLanguages=fr,h.TableElementTag=Sr,h.TableSelectOptions=Ar,h.TableSortDirection=j,h.TableSortOption=xr,h.ThemeSelections=Oi,h.TooltipElementTag=Cr,h.TooltipPostions=Er,h.debounce=yi,h.debounceAnimation=gt,h.default=Ta,h.getListeners=di,h.nodeTypes=Z,h.once=Ni,h.spreadProps=Ae,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1174
1177
|
//# sourceMappingURL=index.umd.js.map
|