@spectric/ui 0.0.8 → 0.0.9
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/README.MD +5 -28
- package/dist/components/Button.d.ts +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input.d.ts +5 -1
- package/dist/components/table/body.d.ts +1 -1
- package/dist/components/table/cell.d.ts +6 -1
- package/dist/components/table/table.d.ts +11 -1
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +95 -0
- package/dist/custom-elements.json +103 -8
- package/dist/index.es.js +1828 -1645
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +116 -83
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Button.ts +12 -1
- package/src/components/button.css.ts +19 -2
- package/src/components/index.ts +2 -1
- package/src/components/input.css +6 -1
- package/src/components/input.ts +26 -5
- package/src/components/pagination/pagination.ts +3 -3
- package/src/components/table/body.ts +2 -2
- package/src/components/table/cell.ts +21 -5
- package/src/components/table/table.css +12 -2
- package/src/components/table/table.ts +46 -3
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.css +52 -0
- package/src/components/tooltip/tooltip.ts +228 -0
- package/src/docs/HTML-Vue-Python Integration.mdx +18 -0
- package/src/docs/React.mdx +20 -0
- package/src/docs/welcome.mdx +29 -0
- package/src/stories/Button.stories.ts +22 -0
- package/src/stories/fixtures/ExampleContent.ts +39 -4
- package/src/stories/fixtures/data.ts +20 -2
- package/src/stories/table.stories.ts +27 -13
- package/src/stories/tooltip.stories.ts +68 -0
package/dist/index.umd.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
(function(d,
|
|
1
|
+
(function(d,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(d=typeof globalThis<"u"?globalThis:d||self,X(d["Spectric-UI"]={}))})(this,function(d){"use strict";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var
|
|
5
|
+
*/var Jr;const X=globalThis,_t=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wt=Symbol(),ar=new WeakMap;let cr=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=s}get styleSheet(){let r=this.o;const s=this.t;if(_t&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=ar.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&ar.set(s,r))}return r}toString(){return this.cssText}};const as=o=>new cr(typeof o=="string"?o:o+"",void 0,wt),R=(o,...r)=>{const s=o.length===1?o[0]:r.reduce((i,a,e)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[e+1],o[0]);return new cr(s,o,wt)},cs=(o,r)=>{if(_t)o.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=X.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,o.appendChild(i)}},lr=_t?o=>o:o=>o instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return as(s)})(o):o;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:ls,defineProperty:ps,getOwnPropertyDescriptor:us,getOwnPropertyNames:ds,getOwnPropertySymbols:hs,getPrototypeOf:fs}=Object,G=globalThis,pr=G.trustedTypes,gs=pr?pr.emptyScript:"",St=G.reactiveElementPolyfillSupport,Pe=(o,r)=>o,qe={toAttribute(o,r){switch(r){case Boolean:o=o?gs:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,r){let s=o;switch(r){case Boolean:s=o!==null;break;case Number:s=o===null?null:Number(o);break;case Object:case Array:try{s=JSON.parse(o)}catch{s=null}}return s}},At=(o,r)=>!ls(o,r),ur={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:At};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);class fe extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??(this.l=[])).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,s=ur){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(r,i,s);a!==void 0&&ps(this.prototype,r,a)}}static getPropertyDescriptor(r,s,i){const{get:a,set:e}=us(this.prototype,r)??{get(){return this[s]},set(u){this[s]=u}};return{get(){return a==null?void 0:a.call(this)},set(u){const g=a==null?void 0:a.call(this);e.call(this,u),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??ur}static _$Ei(){if(this.hasOwnProperty(Pe("elementProperties")))return;const r=fs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Pe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Pe("properties"))){const s=this.properties,i=[...ds(s),...hs(s)];for(const a of i)this.createProperty(a,s[a])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const s=[];if(Array.isArray(r)){const i=new Set(r.flat(1/0).reverse());for(const a of i)s.unshift(lr(a))}else r!==void 0&&s.push(lr(r));return s}static _$Eu(r,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var r;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(r=this.constructor.l)==null||r.forEach(s=>s(this))}addController(r){var s;(this._$EO??(this._$EO=new Set)).add(r),this.renderRoot!==void 0&&this.isConnected&&((s=r.hostConnected)==null||s.call(r))}removeController(r){var s;(s=this._$EO)==null||s.delete(r)}_$E_(){const r=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(r.set(i,this[i]),delete this[i]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return cs(r,this.constructor.elementStyles),r}connectedCallback(){var r;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(r){}disconnectedCallback(){var r;(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(r,s,i){this._$AK(r,i)}_$EC(r,s){var e;const i=this.constructor.elementProperties.get(r),a=this.constructor._$Eu(r,i);if(a!==void 0&&i.reflect===!0){const u=(((e=i.converter)==null?void 0:e.toAttribute)!==void 0?i.converter:qe).toAttribute(s,i.type);this._$Em=r,u==null?this.removeAttribute(a):this.setAttribute(a,u),this._$Em=null}}_$AK(r,s){var e;const i=this.constructor,a=i._$Eh.get(r);if(a!==void 0&&this._$Em!==a){const u=i.getPropertyOptions(a),g=typeof u.converter=="function"?{fromAttribute:u.converter}:((e=u.converter)==null?void 0:e.fromAttribute)!==void 0?u.converter:qe;this._$Em=a,this[a]=g.fromAttribute(s,u.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??At)(this[r],s))return;this.P(r,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(r,s,i){this._$AL.has(r)||this._$AL.set(r,s),i.reflect===!0&&this._$Em!==r&&(this._$Ej??(this._$Ej=new Set)).add(r)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const r=this.scheduleUpdate();return r!=null&&await r,!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[e,u]of this._$Ep)this[e]=u;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[e,u]of a)u.wrapped!==!0||this._$AL.has(e)||this[e]===void 0||this.P(e,this[e],u)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(a=>{var e;return(e=a.hostUpdate)==null?void 0:e.call(a)}),this.update(s)):this._$EU()}catch(a){throw r=!1,this._$EU(),a}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(r){}firstUpdated(r){}}fe.elementStyles=[],fe.shadowRootOptions={mode:"open"},fe[Pe("elementProperties")]=new Map,fe[Pe("finalized")]=new Map,St==null||St({ReactiveElement:fe}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const Te=globalThis,We=Te.trustedTypes,dr=We?We.createPolicy("lit-html",{createHTML:o=>o}):void 0,hr="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,fr="?"+J,bs=`<${fr}>`,ne=document,Oe=()=>ne.createComment(""),Le=o=>o===null||typeof o!="object"&&typeof o!="function",xt=Array.isArray,vs=o=>xt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",kt=`[
|
|
14
|
+
\f\r]`,De=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gr=/-->/g,br=/>/g,ae=RegExp(`>|${kt}(?:([^\\s"'>=/]+)(${kt}*=${kt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),vr=/'/g,mr=/"/g,yr=/^(?:script|style|textarea|title)$/i,ms=o=>(r,...s)=>({_$litType$:o,strings:r,values:s}),A=ms(1),ce=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),$r=new WeakMap,le=ne.createTreeWalker(ne,129);function _r(o,r){if(!xt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return dr!==void 0?dr.createHTML(r):r}const ys=(o,r)=>{const s=o.length-1,i=[];let a,e=r===2?"<svg>":r===3?"<math>":"",u=De;for(let g=0;g<s;g++){const m=o[g];let w,x,S=-1,C=0;for(;C<m.length&&(u.lastIndex=C,x=u.exec(m),x!==null);)C=u.lastIndex,u===De?x[1]==="!--"?u=gr:x[1]!==void 0?u=br:x[2]!==void 0?(yr.test(x[2])&&(a=RegExp("</"+x[2],"g")),u=ae):x[3]!==void 0&&(u=ae):u===ae?x[0]===">"?(u=a??De,S=-1):x[1]===void 0?S=-2:(S=u.lastIndex-x[2].length,w=x[1],u=x[3]===void 0?ae:x[3]==='"'?mr:vr):u===mr||u===vr?u=ae:u===gr||u===br?u=De:(u=ae,a=void 0);const k=u===ae&&o[g+1].startsWith("/>")?" ":"";e+=u===De?m+bs:S>=0?(i.push(w),m.slice(0,S)+hr+m.slice(S)+J+k):m+J+(S===-2?g:k)}return[_r(o,e+(o[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Ne{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let e=0,u=0;const g=r.length-1,m=this.parts,[w,x]=ys(r,s);if(this.el=Ne.createElement(w,i),le.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(a=le.nextNode())!==null&&m.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const S of a.getAttributeNames())if(S.endsWith(hr)){const C=x[u++],k=a.getAttribute(S).split(J),N=/([.?@])?(.*)/.exec(C);m.push({type:1,index:e,name:N[2],strings:k,ctor:N[1]==="."?_s:N[1]==="?"?ws:N[1]==="@"?Ss:Ve}),a.removeAttribute(S)}else S.startsWith(J)&&(m.push({type:6,index:e}),a.removeAttribute(S));if(yr.test(a.tagName)){const S=a.textContent.split(J),C=S.length-1;if(C>0){a.textContent=We?We.emptyScript:"";for(let k=0;k<C;k++)a.append(S[k],Oe()),le.nextNode(),m.push({type:2,index:++e});a.append(S[C],Oe())}}}else if(a.nodeType===8)if(a.data===fr)m.push({type:2,index:e});else{let S=-1;for(;(S=a.data.indexOf(J,S+1))!==-1;)m.push({type:7,index:e}),S+=J.length-1}e++}}static createElement(r,s){const i=ne.createElement("template");return i.innerHTML=r,i}}function ge(o,r,s=o,i){var u,g;if(r===ce)return r;let a=i!==void 0?(u=s._$Co)==null?void 0:u[i]:s._$Cl;const e=Le(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==e&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),e===void 0?a=void 0:(a=new e(o),a._$AT(o,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=ge(o,a._$AS(o,r.values),a,i)),r}class $s{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??ne).importNode(s,!0);le.currentNode=a;let e=le.nextNode(),u=0,g=0,m=i[0];for(;m!==void 0;){if(u===m.index){let w;m.type===2?w=new je(e,e.nextSibling,this,r):m.type===1?w=new m.ctor(e,m.name,m.strings,this,r):m.type===6&&(w=new As(e,this,r)),this._$AV.push(w),m=i[++g]}u!==(m==null?void 0:m.index)&&(e=le.nextNode(),u++)}return le.currentNode=ne,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class je{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=ge(this,r,s),Le(r)?r===E||r==null||r===""?(this._$AH!==E&&this._$AR(),this._$AH=E):r!==this._$AH&&r!==ce&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):vs(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==E&&Le(this._$AH)?this._$AA.nextSibling.data=r:this.T(ne.createTextNode(r)),this._$AH=r}$(r){var e;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Ne.createElement(_r(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(s);else{const u=new $s(a,this),g=u.u(this.options);u.p(s),this.T(g),this._$AH=u}}_$AC(r){let s=$r.get(r.strings);return s===void 0&&$r.set(r.strings,s=new Ne(r)),s}k(r){xt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const e of r)a===s.length?s.push(i=new je(this.O(Oe()),this.O(Oe()),this,this.options)):i=s[a],i._$AI(e),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Ve{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,e){this.type=1,this._$AH=E,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,this.options=e,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(r,s=this,i,a){const e=this.strings;let u=!1;if(e===void 0)r=ge(this,r,s,0),u=!Le(r)||r!==this._$AH&&r!==ce,u&&(this._$AH=r);else{const g=r;let m,w;for(r=e[0],m=0;m<e.length-1;m++)w=ge(this,g[i+m],s,m),w===ce&&(w=this._$AH[m]),u||(u=!Le(w)||w!==this._$AH[m]),w===E?r=E:r!==E&&(r+=(w??"")+e[m+1]),this._$AH[m]=w}u&&!a&&this.j(r)}j(r){r===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class _s extends Ve{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===E?void 0:r}}class ws extends Ve{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==E)}}class Ss extends Ve{constructor(r,s,i,a,e){super(r,s,i,a,e),this.type=5}_$AI(r,s=this){if((r=ge(this,r,s,0)??E)===ce)return;const i=this._$AH,a=r===E&&i!==E||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,e=r!==E&&(i===E||a);a&&this.element.removeEventListener(this.name,this,i),e&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,r):this._$AH.handleEvent(r)}}class As{constructor(r,s,i){this.element=r,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(r){ge(this,r)}}const Et=Te.litHtmlPolyfillSupport;Et==null||Et(Ne,je),(Te.litHtmlVersions??(Te.litHtmlVersions=[])).push("3.2.1");const Ct=(o,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const e=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new je(r.insertBefore(Oe(),e),e,void 0,s??{})}return a._$AI(o),a};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let
|
|
19
|
+
*/let P=class extends fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const r=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=r.firstChild),r}update(r){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Ct(s,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return ce}};P._$litElement$=!0,P.finalized=!0,(Jr=globalThis.litElementHydrateSupport)==null||Jr.call(globalThis,{LitElement:P});const Pt=globalThis.litElementPolyfillSupport;Pt==null||Pt({LitElement:P}),(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 wr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Tt=o=>(...r)=>({_$litDirective$:o,values:r});let Sr=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,s,i){this._$Ct=r,this._$AM=s,this._$Ci=i}_$AS(r,s){return this.update(r,s)}update(r,s){return this.render(...s)}};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2018 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const Ar="important",xs=" !"+Ar,xr=Tt(class extends Sr{constructor(o){var r;if(super(o),o.type!==wr.ATTRIBUTE||o.name!=="style"||((r=o.strings)==null?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((r,s)=>{const i=o[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[r]){const{style:s}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(const i of this.ft)r[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in r){const a=r[i];if(a!=null){this.ft.add(i);const e=typeof a=="string"&&a.endsWith(xs);i.includes("-")||e?s.setProperty(i,e?a.slice(0,-11):a,e?Ar:""):s[i]=a}}return ce}}),ks=R`
|
|
28
28
|
:host{
|
|
29
29
|
display: inline-block;
|
|
30
30
|
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
@@ -47,9 +47,15 @@
|
|
|
47
47
|
--button-primary-hover: var(--spectric-button-primary-hover, #0050e6);
|
|
48
48
|
--button-secondary-hover: var(--spectric-button-secondary-hover, #474747);
|
|
49
49
|
--button-tertiary-hover: var(--spectric-button-tertiary-hover, #0050e6);
|
|
50
|
-
--button-disabled: var(--spectric-button-disabled, #
|
|
50
|
+
--button-disabled: var(--spectric-button-disabled, #cfcbcb4d);
|
|
51
|
+
}
|
|
52
|
+
:host([disabled]) {
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([disabled]) .animation{
|
|
57
|
+
visibility:hidden;
|
|
51
58
|
}
|
|
52
|
-
:host([disabled]) { pointer-events: none }
|
|
53
59
|
|
|
54
60
|
.spectric-button {
|
|
55
61
|
pointer-events:none;
|
|
@@ -108,8 +114,14 @@
|
|
|
108
114
|
display: flex;
|
|
109
115
|
align-items: center;
|
|
110
116
|
justify-content: center;
|
|
117
|
+
-webkit-user-select: none; /* For Safari */
|
|
118
|
+
-moz-user-select: none; /* For Firefox */
|
|
119
|
+
-ms-user-select: none; /* For IE 10+ */
|
|
120
|
+
user-select: none; /* Standard syntax */
|
|
111
121
|
}
|
|
112
122
|
|
|
123
|
+
|
|
124
|
+
|
|
113
125
|
/* :host([icon][size="small"]){
|
|
114
126
|
height:12px;
|
|
115
127
|
width:12px;
|
|
@@ -157,6 +169,11 @@
|
|
|
157
169
|
/* background-color:var(--button-disabled); */
|
|
158
170
|
color:var(--text-on-color-disabled);
|
|
159
171
|
}
|
|
172
|
+
.spectric-button.spectric-button--primary:disabled{
|
|
173
|
+
|
|
174
|
+
background-color:var(--button-disabled);
|
|
175
|
+
|
|
176
|
+
}
|
|
160
177
|
.spectric-button:disabled .animation , :host(:disabled:hover) .animation{
|
|
161
178
|
background-color: rgba(0, 0, 0, 0);
|
|
162
179
|
opacity:1
|
|
@@ -252,67 +269,68 @@ opacity:1
|
|
|
252
269
|
* @license
|
|
253
270
|
* Copyright 2017 Google LLC
|
|
254
271
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
255
|
-
*/const L=
|
|
272
|
+
*/const L=o=>(r,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(o,r)}):customElements.define(o,r)};/**
|
|
256
273
|
* @license
|
|
257
274
|
* Copyright 2017 Google LLC
|
|
258
275
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
259
|
-
*/const
|
|
276
|
+
*/const Es={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:At},Cs=(o=Es,r,s)=>{const{kind:i,metadata:a}=s;let e=globalThis.litPropertyMetadata.get(a);if(e===void 0&&globalThis.litPropertyMetadata.set(a,e=new Map),e.set(s.name,o),i==="accessor"){const{name:u}=s;return{set(g){const m=r.get.call(this);r.set.call(this,g),this.requestUpdate(u,m,o)},init(g){return g!==void 0&&this.P(u,void 0,o),g}}}if(i==="setter"){const{name:u}=s;return function(g){const m=this[u];r.call(this,g),this.requestUpdate(u,m,o)}}throw Error("Unsupported decorator location: "+i)};function v(o){return(r,s)=>typeof s=="object"?Cs(o,r,s):((i,a,e)=>{const u=a.hasOwnProperty(e);return a.constructor.createProperty(e,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(a,e):void 0})(o,r,s)}/**
|
|
260
277
|
* @license
|
|
261
278
|
* Copyright 2017 Google LLC
|
|
262
279
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
263
|
-
*/function
|
|
280
|
+
*/function ze(o){return v({...o,state:!0,attribute:!1})}/**
|
|
264
281
|
* @license
|
|
265
282
|
* Copyright 2017 Google LLC
|
|
266
283
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
267
|
-
*/const
|
|
284
|
+
*/const kr=(o,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(o,r,s),s);/**
|
|
268
285
|
* @license
|
|
269
286
|
* Copyright 2017 Google LLC
|
|
270
287
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
|
-
*/function
|
|
288
|
+
*/function be(o,r){return(s,i,a)=>{const e=u=>{var g;return((g=u.renderRoot)==null?void 0:g.querySelector(o))??null};return kr(s,i,{get(){return e(this)}})}}/**
|
|
272
289
|
* @license
|
|
273
290
|
* Copyright 2017 Google LLC
|
|
274
291
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
275
|
-
*/function
|
|
292
|
+
*/function Ye(o){return(r,s)=>kr(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Ps=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,I=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ts(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ps(r,s,a),a},Er=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Er||{}),Cr=(o=>(o.primary="primary",o.secondary="secondary",o.text="text",o))(Cr||{});const Os={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends P{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=r=>{if(r instanceof CustomEvent||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),this.disabled))return;const s={bubbles:!0,composed:!0,detail:r};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const r=Os[this.variant]||"spectric-button--primary";return A`
|
|
293
|
+
${this.tooltip?A`<spectric-tooltip .text=${this.tooltip} .position=${this.tooltipPosition||"right"} .triggerTarget=${this}></spectric-tooltip>`:null}
|
|
276
294
|
<button
|
|
277
295
|
type="button"
|
|
278
296
|
?disabled=${this.disabled}
|
|
279
297
|
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,r].join(" ")}
|
|
280
|
-
style=${
|
|
298
|
+
style=${xr({backgroundColor:this.backgroundColor})}
|
|
281
299
|
>
|
|
282
300
|
<span class="animation"></span>
|
|
283
301
|
<slot>${this.label}</slot>
|
|
284
302
|
</button>
|
|
285
|
-
`}},d.SpectricButton.styles=
|
|
303
|
+
`}},d.SpectricButton.styles=ks,I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltip",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltipPosition",2),d.SpectricButton=I([L("spectric-button")],d.SpectricButton);/**
|
|
286
304
|
* @license
|
|
287
305
|
* Copyright 2020 Google LLC
|
|
288
306
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
289
|
-
*/const
|
|
307
|
+
*/const Ls=o=>o.strings===void 0;/**
|
|
290
308
|
* @license
|
|
291
309
|
* Copyright 2017 Google LLC
|
|
292
310
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
293
|
-
*/const
|
|
311
|
+
*/const Be=(o,r)=>{var i;const s=o._$AN;if(s===void 0)return!1;for(const a of s)(i=a._$AO)==null||i.call(a,r,!1),Be(a,r);return!0},Ke=o=>{let r,s;do{if((r=o._$AM)===void 0)break;s=r._$AN,s.delete(o),o=r}while((s==null?void 0:s.size)===0)},Pr=o=>{for(let r;r=o._$AM;o=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(o))break;s.add(o),js(r)}};function Ds(o){this._$AN!==void 0?(Ke(this),this._$AM=o,Pr(this)):this._$AM=o}function Ns(o,r=!1,s=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(r)if(Array.isArray(i))for(let e=s;e<i.length;e++)Be(i[e],!1),Ke(i[e]);else i!=null&&(Be(i,!1),Ke(i));else Be(this,o)}const js=o=>{o.type==wr.CHILD&&(o._$AP??(o._$AP=Ns),o._$AQ??(o._$AQ=Ds))};class Tr extends Sr{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),Pr(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,a;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),s&&(Be(this,r),Ke(this))}setValue(r){if(Ls(this._$Ct))this._$Ct._$AI(r,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=r,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
|
|
294
312
|
* @license
|
|
295
313
|
* Copyright 2020 Google LLC
|
|
296
314
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
297
|
-
*/const
|
|
315
|
+
*/const Ze=()=>new zs;class zs{}const Ot=new WeakMap,Xe=Tt(class extends Tr{render(o){return E}update(o,[r]){var i;const s=r!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=o.options)==null?void 0:i.host,this.rt(this.ct=o.element)),E}rt(o){if(this.isConnected||(o=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=Ot.get(r);s===void 0&&(s=new WeakMap,Ot.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,o),o!==void 0&&this.Y.call(this.ht,o)}else this.Y.value=o}get lt(){var o,r;return typeof this.Y=="function"?(o=Ot.get(this.ht??globalThis))==null?void 0:o.get(this.Y):(r=this.Y)==null?void 0:r.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Bs=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,e=r.length;a<e;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Or{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(e=>{this._handler&&(this._node=e,this._node.addEventListener(this._type,this._handler,this._options))}):(this._node=r,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&(console.log(`removing event ${this._type} from `,this._node,this.__target instanceof Promise),this._node.removeEventListener(this._type,this._handler,this._options)),this.__target=void 0,this._node=void 0,this._handler=void 0)}}class Lr extends P{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(e=>e.event===s&&e.target===r&&e.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:r,event:s,handler:i}),this._connected&&this.registerDisposable(new Or(r,s,i))}registerDisposable(r){if(!r)return r;if(r===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(r),r}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:r,event:s,handler:i})=>{this.registerDisposable(new Or(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const Dr=o=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{o.apply(void 0,s)})}};var Rs=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,pe=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ms(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Rs(r,s,a),a};const Us=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ge={width:200,height:200},Je={width:10,height:10};d.BitDisplayCanvas=class extends Lr{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:Ze(),canvas:Ze(),scrollDiv:Ze()},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 r=new ResizeObserver(this.onResize);r.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=r,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};Us.forEach(i=>{this.addDisposableListener(this._canvas,i,Dr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var e=await this._canvas;let u=e.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-u.left)),y:Math.floor(Math.abs(a.clientY-u.top))},m=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==m)return;s[i]=m;let w="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(m!=-1){let x=new CustomEvent(w,{detail:{bitIndex:m,position:g,nativeEvent:a}});this.dispatchEvent(x)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Bs(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(r.has(i)){this.paint();return}}canvasPositionToBit(r){let s=Math.floor(r.x/this.scale),i=Math.floor(r.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:r,_bitArray:s}=this;if(r<=0)return;this.calculateViewport();const{width:i=Ge.width,height:a=Ge.height}=this,e=this.getPxPerBit(),u=this.refs.canvas.value.getContext("2d");if(!u)return;this.state.scale!=e&&(u.reset(),u.scale(e,e));let g=getComputedStyle(this);u.fillStyle=g.color,u.clearRect(0,0,i,a);let m=0;for(let w=this.yStart*r+this.xStart,x=s.length;w<x;w++){let S=w%r-this.xStart;if(!(S<0)){if(Math.floor(S*e)>i){m++,w=m*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(m*e)>a)break;s.getBit(w)===1&&u.fillRect(S,m,1,1),(w+1)%r===0&&w>=r-1&&m++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:r,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const a=s.length/r*i,e=r*i,u=this.refs.scrollDiv.value;u.style.width=e+"px",u.style.height=a+"px"}}render(){const{height:r=Ge.height,width:s=Ge.width}=this;return A`
|
|
298
316
|
<div
|
|
299
317
|
id="viewport"
|
|
300
|
-
${
|
|
318
|
+
${Xe(this.refs.viewport)}
|
|
301
319
|
@scroll=${this.handleScroll}
|
|
302
320
|
style=${`width:${s}px;height:${r}px;overflow:auto;position:relative`}
|
|
303
321
|
>
|
|
304
322
|
<div
|
|
305
323
|
id="fakescrolldiv"
|
|
306
|
-
${
|
|
324
|
+
${Xe(this.refs.scrollDiv)}
|
|
307
325
|
>
|
|
308
326
|
</div>
|
|
309
327
|
</div>
|
|
310
328
|
<canvas
|
|
311
|
-
${
|
|
312
|
-
width=${s-
|
|
313
|
-
height=${r-
|
|
329
|
+
${Xe(this.refs.canvas)}
|
|
330
|
+
width=${s-Je.width}
|
|
331
|
+
height=${r-Je.height}
|
|
314
332
|
></canvas>
|
|
315
|
-
`}},d.BitDisplayCanvas.styles=
|
|
333
|
+
`}},d.BitDisplayCanvas.styles=R`
|
|
316
334
|
:host{
|
|
317
335
|
position: relative;
|
|
318
336
|
--border-radius: var(--spectric-border-radius,4em);
|
|
@@ -336,8 +354,8 @@ opacity:1
|
|
|
336
354
|
background-color:var(--background-color);
|
|
337
355
|
}
|
|
338
356
|
::-webkit-scrollbar {
|
|
339
|
-
height: ${
|
|
340
|
-
width: ${
|
|
357
|
+
height: ${Je.height}px;
|
|
358
|
+
width: ${Je.width}px;
|
|
341
359
|
|
|
342
360
|
}
|
|
343
361
|
|
|
@@ -408,7 +426,7 @@ opacity:1
|
|
|
408
426
|
|
|
409
427
|
}
|
|
410
428
|
|
|
411
|
-
`,
|
|
429
|
+
`,pe([v({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"width",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"height",2),pe([Ye("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=pe([L("spectric-bit-display")],d.BitDisplayCanvas);const Is=R`.spectric-header {
|
|
412
430
|
display: flex;
|
|
413
431
|
justify-content: space-between;
|
|
414
432
|
align-items: center;
|
|
@@ -443,7 +461,7 @@ opacity:1
|
|
|
443
461
|
color: #333;
|
|
444
462
|
font-size: 14px;
|
|
445
463
|
}
|
|
446
|
-
`;var
|
|
464
|
+
`;var Fs=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,et=(o,r,s,i)=>{for(var a=i>1?void 0:i?Qs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Fs(r,s,a),a};d.Header=class extends P{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",r))},this.onLogin=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",r))},this.onCreateAccount=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",r))}}render(){return A`
|
|
447
465
|
<header>
|
|
448
466
|
<div class="spectric-header">
|
|
449
467
|
<div style="flex-grow:1;">
|
|
@@ -462,12 +480,12 @@ opacity:1
|
|
|
462
480
|
<slot name="end"></slot>
|
|
463
481
|
</div>
|
|
464
482
|
</header>
|
|
465
|
-
`}},d.Header.styles=
|
|
466
|
-
<header style=${
|
|
483
|
+
`}},d.Header.styles=Is,et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),et([v({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=et([L("spectric-header")],d.Header);var Hs=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,ve=(o,r,s,i)=>{for(var a=i>1?void 0:i?qs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Hs(r,s,a),a};const Ws={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ue=class extends P{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=o=>{o.preventDefault(),o.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:a,dismissable:e}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:a,dismissable:e},...r}))}}render(){if(!this._dismissed)return A`
|
|
484
|
+
<header style=${xr({...Ws,...this.headerStyle})}>
|
|
467
485
|
<div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
|
|
468
486
|
${this.dismissable?A`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
|
|
469
487
|
</header>
|
|
470
|
-
`}};
|
|
488
|
+
`}};ve([v({type:Boolean,reflect:!0})],ue.prototype,"dismissable",2),ve([v({type:String,reflect:!0})],ue.prototype,"text",2),ve([v({type:String,reflect:!0})],ue.prototype,"bannerId",2),ve([v({type:Object})],ue.prototype,"headerStyle",2),ve([v({state:!0,type:Boolean,attribute:!1})],ue.prototype,"_dismissed",2),ue=ve([L("spectric-banner")],ue);const Vs=R`
|
|
471
489
|
|
|
472
490
|
:host {
|
|
473
491
|
height:100vh;
|
|
@@ -627,7 +645,7 @@ article{
|
|
|
627
645
|
* @license
|
|
628
646
|
* Copyright 2018 Google LLC
|
|
629
647
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
630
|
-
*/const
|
|
648
|
+
*/const Lt=o=>o??E;class Ys extends Tr{constructor(){super(...arguments),this.prevData={}}render(r){return E}update(r,[s]){var i;this.element!==r.element&&(this.element=r.element),this.host=((i=r.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(r){if(!r)return;const{prevData:s,element:i}=this;for(const a in r){const e=r[a];e!==s[a]&&(i[a]=e)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const tt=Tt(Ys);var Dt=(o=>(o.None="none",o.Uscui="us.cui",o.Usclassified="us.classified",o.Usunclassified="us.unclassified",o.Usconfidential="us.confidential",o.Ussecret="us.secret",o.Ustopsecret="us.topsecret",o.UstopsecretSi="us.topsecret.si",o.Uknotset="uk.notset",o.Ukofficial="uk.official",o.Uksecret="uk.secret",o.Uktopsecret="uk.topsecret",o.Caprotected_a="ca.protected_a",o.Caprotected_b="ca.protected_b",o.Caprotected_c="ca.protected_c",o.Caconfidential="ca.confidential",o.Casecret="ca.secret",o.Catopsecret="ca.topsecret",o.Auunofficial="au.unofficial",o.Auofficial="au.official",o.Auofficialsensitive="au.officialsensitive",o.Auconfidential="au.confidential",o.Ausecret="au.secret",o.Autopsecret="au.topsecret",o))(Dt||{});const rt={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 Ks=Object.defineProperty,Zs=Object.getOwnPropertyDescriptor,F=(o,r,s,i)=>{for(var a=i>1?void 0:i?Zs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ks(r,s,a),a};d.SpectricPage=class extends P{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Dt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!rt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Dt.None);const r=this.classificationLevel?this.classificationText||rt[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Lt(this.username)}>
|
|
631
649
|
<slot name="branding" slot="branding"></slot>
|
|
632
650
|
<slot name="name" slot="name"></slot>
|
|
633
651
|
<slot name="center" slot="center"></slot>
|
|
@@ -635,10 +653,10 @@ article{
|
|
|
635
653
|
</spectric-header>`:null;return A`
|
|
636
654
|
${this.classificationLevel&&r?A`
|
|
637
655
|
<!-- Classification Banner -->
|
|
638
|
-
<spectric-banner ${
|
|
656
|
+
<spectric-banner ${tt({text:r,headerStyle:rt[this.classificationLevel]})}></spectric-banner>
|
|
639
657
|
`:null}
|
|
640
|
-
<spectric-theme theme=${
|
|
641
|
-
${this.notifications?this.notifications.map(i=>A`<spectric-banner ${
|
|
658
|
+
<spectric-theme theme=${Lt(this.theme)}>
|
|
659
|
+
${this.notifications?this.notifications.map(i=>A`<spectric-banner ${tt(i)} ></spectric-banner>`):null}
|
|
642
660
|
${this.headerSticky?s:null}
|
|
643
661
|
<article>
|
|
644
662
|
${this.headerSticky?null:s}
|
|
@@ -648,9 +666,9 @@ article{
|
|
|
648
666
|
</section>
|
|
649
667
|
</article>
|
|
650
668
|
</spectric-theme>
|
|
651
|
-
${this.classificationLevel&&r?A`<spectric-banner ${
|
|
669
|
+
${this.classificationLevel&&r?A`<spectric-banner ${tt({text:r,headerStyle:rt[this.classificationLevel]})}></spectric-banner>`:null}
|
|
652
670
|
|
|
653
|
-
`}},d.SpectricPage.styles=
|
|
671
|
+
`}},d.SpectricPage.styles=Vs,F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),F([v({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=F([L("spectric-page")],d.SpectricPage);var Xs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,T=(o,r,s,i)=>{for(var a=i>1?void 0:i?Gs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Xs(r,s,a),a},Nr=(o=>(o.Text="text",o.TextArea="text-area",o.number="number",o.color="color",o.date="date",o.datetime="datetime-local",o.email="email",o.file="file",o.hidden="hidden",o.password="password",o.checkbox="checkbox",o))(Nr||{});d.SpectricInput=class extends P{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="",this._handleInput=({target:r})=>{const s=r;this.value=s.value,this.invalid=!s.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(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}blur(){this._input&&this._input.blur()}focus(r){this._input&&(this._input.blur(),this._input.focus(r))}setSelectionRange(r,s,i="none"){this._input&&this._input.setSelectionRange(r,s,i)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return A`
|
|
654
672
|
<div class="inputWrapper">
|
|
655
673
|
<div class="text-input__label-helper-wrapper">
|
|
656
674
|
<div class="--text-input__label-wrapper">
|
|
@@ -664,15 +682,15 @@ article{
|
|
|
664
682
|
?disabled="${this.disabled}"
|
|
665
683
|
aria-describedby="helper-text"
|
|
666
684
|
id="input"
|
|
667
|
-
name="${
|
|
668
|
-
pattern="${
|
|
669
|
-
placeholder="${
|
|
670
|
-
autocomplete="${
|
|
685
|
+
name="${me(this.name)}"
|
|
686
|
+
pattern="${me(this.pattern)}"
|
|
687
|
+
placeholder="${me(this.placeholder)}"
|
|
688
|
+
autocomplete="${me(this.autocomplete)}"
|
|
671
689
|
?readonly="${this.readonly}"
|
|
672
690
|
?required="${this.required}"
|
|
673
|
-
type="${
|
|
691
|
+
type="${me(this.variant!=="password"?this.variant:this._showPassword?"text":"password")}"
|
|
674
692
|
.value="${this._value}"
|
|
675
|
-
maxlength="${
|
|
693
|
+
maxlength="${me(this.maxCount>0?this.maxCount:void 0)}"
|
|
676
694
|
@input="${this._handleInput}"
|
|
677
695
|
@change=${()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}}
|
|
678
696
|
/>
|
|
@@ -695,11 +713,18 @@ article{
|
|
|
695
713
|
|
|
696
714
|
</div>
|
|
697
715
|
</div>
|
|
698
|
-
`;case"hidden":return A`<input type="hidden"></input
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
`?(o.seenCR||o.line++,o.column=1,o.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(o.line++,o.column=1,o.seenCR=!0):(o.column++,o.seenCR=!1),l++;return lt[e]=o,o}function pt(e,o){var l=Bi(e),u=Bi(o);return{start:{offset:e,line:l.line,column:l.column},end:{offset:o,line:u.line,column:u.column}}}function b(e){a<q||(a>q&&(q=a,Zt=[]),Zt.push(e))}function Ri(e,o,l,u){function h(T){var D=1;for(T.sort(function(se,U){return se.description<U.description?-1:se.description>U.description?1:0});D<T.length;)T[D-1]===T[D]?T.splice(D,1):D++}function $(T,D){function se(pc){function mt(K){return K.charCodeAt(0).toString(16).toUpperCase()}return pc.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(K){return"\\x0"+mt(K)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(K){return"\\x"+mt(K)}).replace(/[\u0100-\u0FFF]/g,function(K){return"\\u0"+mt(K)}).replace(/[\u1000-\uFFFF]/g,function(K){return"\\u"+mt(K)})}var U=new Array(T.length),rs,is,Me;for(Me=0;Me<T.length;Me++)U[Me]=T[Me].description;return rs=T.length>1?U.slice(0,-1).join(", ")+" or "+U[T.length-1]:U[0],is=D?'"'+se(D)+'"':"end of input","Expected "+rs+" but "+is+" found."}return o!==null&&h(o),new r(e!==null?e:$(o,l),o,l,u)}function Ui(){var e,o,l,u;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();return o!==t?(l=dt(),l===t&&(l=null),l!==t?(u=bt(),u!==t?(_=e,o=v(l,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e}function dt(){var e,o,l,u;return e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Ya(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=a,o=Xt(),o!==t?(l=ft(),l!==t?(u=dt(),u!==t?(_=e,o=x(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Xt())),e}function Xt(){var e,o,l,u;return e=a,o=Mi(),o!==t?(l=ht(),l!==t?(u=Xt(),u!==t?(_=e,o=S(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Mi()),e}function Mi(){var e,o,l;return e=a,o=tr(),o!==t?(l=Ii(),l!==t?(_=e,o=E(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=Ii()),e}function Ii(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===40?(o=k,a++):(o=t,f===0&&b(N)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=dt(),u!==t?(h=bt(),h!==t?(i.charCodeAt(a)===41?($=nt,a++):($=t,f===0&&b(re)),$!==t?(_=e,o=Q(u,h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e===t&&(e=Ra()),e}function Ra(){var e,o,l,u,h,$,T,D,se,U;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();if(h!==t)if(i.charCodeAt(a)===123?($=$e,a++):($=t,f===0&&b(Ft)),$!==t){for(T=[],D=y();D!==t;)T.push(D),D=y();T!==t?(D=dt(),D!==t?(se=bt(),se!==t?(i.charCodeAt(a)===125?(U=Qt,a++):(U=t,f===0&&b(Ht)),U!==t?(_=e,o=Lo(o,D,se),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e===t&&(e=Ua()),e}function Ua(){var e;return e=Ma(),e===t&&(e=Ia(),e===t&&(e=Fa())),e}function Gt(){var e;return f++,e=rr(),f--,e===t&&f===0&&b(Do),e}function Ma(){var e,o,l,u,h,$;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(u=Yi(),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=rr(),$!==t?(_=e,o=No(o,u,$),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Ia(){var e,o,l,u,h,$;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=Jt(),$!==t?(_=e,o=jo(o,$),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Fa(){var e,o;return e=a,o=Hi(),o!==t&&(_=e,o=zo(o)),e=o,e}function Jt(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===40?(o=k,a++):(o=t,f===0&&b(N)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=Fi(),u!==t?(h=bt(),h!==t?(i.charCodeAt(a)===41?($=nt,a++):($=t,f===0&&b(re)),$!==t?(_=e,o=Bo(u,h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e===t&&(e=Hi()),e}function Fi(){var e,o,l,u;return e=a,o=er(),o!==t?(l=ft(),l!==t?(u=Fi(),u!==t?(_=e,o=Ro(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=er()),e}function er(){var e,o,l,u;return e=a,o=Qi(),o!==t?(l=ht(),l!==t?(u=er(),u!==t?(_=e,o=Uo(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Qi()),e}function Qi(){var e,o,l;return e=a,o=tr(),o!==t?(l=Jt(),l!==t?(_=e,o=Mo(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=Jt()),e}function Hi(){var e,o;return f++,e=a,o=gt(),o!==t&&(_=e,o=Fo(o)),e=o,e===t&&(e=a,o=qi(),o!==t&&(_=e,o=Qo(o)),e=o),f--,e===t&&(o=t,f===0&&b(Io)),e}function ft(){var e,o,l,u,h;if(f++,e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,2).toLowerCase()===Xr?(l=i.substr(a,2),a+=2):(l=t,f===0&&b(Gr)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Vi(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(Ho)),e}function ht(){var e,o,l,u,h;if(f++,e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,3).toLowerCase()===Jr?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ei)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Ki(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(qo)),e}function tr(){var e,o,l,u;if(f++,e=a,i.substr(a,3).toLowerCase()===ti?(o=i.substr(a,3),a+=3):(o=t,f===0&&b(ri)),o!==t){if(l=[],u=y(),u!==t)for(;u!==t;)l.push(u),u=y();else l=t;l!==t?(o=[o,l],e=o):(a=e,e=t)}else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Zi(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(Wo)),e}function rr(){var e;return f++,e=gt(),e===t&&(e=qi()),f--,e===t&&f===0&&b(Yo),e}function gt(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===34?(o=je,a++):(o=t,f===0&&b(ze)),o!==t){for(l=[],u=Se();u!==t;)l.push(u),u=Se();if(l!==t)if(u=Ue(),u!==t){for(h=[],$=Se();$!==t;)h.push($),$=Se();h!==t?(i.charCodeAt(a)===34?($=je,a++):($=t,f===0&&b(ze)),$!==t?(_=e,o=qt(l,u,h),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;if(e===t)if(e=a,i.charCodeAt(a)===34?(o=je,a++):(o=t,f===0&&b(ze)),o!==t){for(l=[],u=Se();u!==t;)l.push(u),u=Se();l!==t?(i.charCodeAt(a)===34?(u=je,a++):(u=t,f===0&&b(ze)),u!==t?(_=e,o=Vo(l),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function Se(){var e,o,l;return e=ir(),e===t&&(e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(Ko.test(i.charAt(a))?(l=i.charAt(a),a++):(l=t,f===0&&b(Zo)),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=a,o=a,f++,l=Ue(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(Xo.test(i.charAt(a))?(l=i.charAt(a),a++):(l=t,f===0&&b(Go)),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t))),e}function qi(){var e,o,l,u,h;for(e=a,o=[],l=Ae();l!==t;)o.push(l),l=Ae();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=Ae();h!==t;)u.push(h),h=Ae();u!==t?(_=e,o=qt(o,l,u),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;if(e===t){if(e=a,o=[],l=Ae(),l!==t)for(;l!==t;)o.push(l),l=Ae();else o=t;o!==t&&(_=e,o=Jo(o)),e=o}return e}function Ae(){var e,o,l,u,h;return e=ir(),e===t&&(e=Ha(),e===t&&(e=qa(),e===t&&(e=Qa(),e===t&&(e=a,o=a,f++,l=Wi(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(l=a,f++,u=Wa(),f--,u===t?l=void 0:(a=l,l=t),l!==t?(u=a,f++,h=Ue(),f--,h===t?u=void 0:(a=u,u=t),u!==t?(i.length>a?(h=i.charAt(a),a++):(h=t,f===0&&b(ii)),h!==t?(_=e,o=ot(h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t))))),e}function Qa(){var e,o;return e=a,i.charCodeAt(a)===42?(o=at,a++):(o=t,f===0&&b(ct)),o!==t&&(_=e,o=ea()),e=o,e}function bt(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=qt(o,l,u),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;if(e===t)for(e=[],o=y();o!==t;)e.push(o),o=y();return e}function ir(){var e,o;return e=a,i.substr(a,2)===si?(o=si,a+=2):(o=t,f===0&&b(ta)),o!==t&&(_=e,o=ra()),e=o,e===t&&(e=a,i.substr(a,2)===ni?(o=ni,a+=2):(o=t,f===0&&b(ia)),o!==t&&(_=e,o=sa()),e=o,e===t&&(e=a,i.substr(a,2)===oi?(o=oi,a+=2):(o=t,f===0&&b(na)),o!==t&&(_=e,o=oa()),e=o)),e}function Ha(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(l=Wi(),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t),e}function qa(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(i.substr(a,2).toLowerCase()===Xr?(l=i.substr(a,2),a+=2):(l=t,f===0&&b(Gr)),l===t&&(i.substr(a,3).toLowerCase()===Jr?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ei)),l===t&&(i.substr(a,3).toLowerCase()===ti?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ri)))),l!==t?(_=e,o=aa(l),e=o):(a=e,e=t)):(a=e,e=t),e}function Wa(){var e;return e=ft(),e===t&&(e=ht(),e===t&&(e=tr())),e}function Wi(){var e;return ca.test(i.charAt(a))?(e=i.charAt(a),a++):(e=t,f===0&&b(la)),e}function Yi(){var e,o;return e=a,i.substr(a,2)===ai?(o=ai,a+=2):(o=t,f===0&&b(ua)),o!==t&&(_=e,o=pa()),e=o,e===t&&(e=a,i.substr(a,2)===ci?(o=ci,a+=2):(o=t,f===0&&b(da)),o!==t&&(_=e,o=fa()),e=o,e===t&&(e=a,i.charCodeAt(a)===60?(o=li,a++):(o=t,f===0&&b(ui)),o!==t&&(_=e,o=ha()),e=o,e===t&&(e=a,i.charCodeAt(a)===62?(o=pi,a++):(o=t,f===0&&b(di)),o!==t&&(_=e,o=ga()),e=o))),e}function y(){var e;return f++,va.test(i.charAt(a))?(e=i.charAt(a),a++):(e=t,f===0&&b(ma)),f--,e===t&&f===0&&b(ba),e}function Ue(){var e,o,l;return e=a,_=a,o=ya(),o?o=void 0:o=t,o!==t?(i.substr(a,14)===fi?(l=fi,a+=14):(l=t,f===0&&b($a)),l!==t?(_=e,o=_a(),e=o):(a=e,e=t)):(a=e,e=t),e}function Vi(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(i.substr(a,2)===hi?(l=hi,a+=2):(l=t,f===0&&b(wa)),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=Sa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Ki(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(i.substr(a,2)===gi?(l=gi,a+=2):(l=t,f===0&&b(Aa)),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=bi(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,i.charCodeAt(a)===43?(o=vi,a++):(o=t,f===0&&b(mi)),o!==t&&(_=e,o=bi()),e=o),e}function Zi(){var e,o;return e=a,i.charCodeAt(a)===45?(o=yi,a++):(o=t,f===0&&b($i)),o!==t&&(_=e,o=_i()),e=o,e===t&&(e=a,i.charCodeAt(a)===33?(o=wi,a++):(o=t,f===0&&b(Si)),o!==t&&(_=e,o=_i()),e=o),e}function Ya(){var e;return e=Va(),e===t&&(e=Xi(),e===t&&(e=Ka())),e}function Va(){var e,o,l,u,h,$;if(e=a,o=xe(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=Xi(),$!==t?(o=[o,l,u,h,$],e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Xi(){var e;return e=Za(),e===t&&(e=sr(),e===t&&(e=Xa(),e===t&&(e=Ga(),e===t&&(e=Ja(),e===t&&(e=ec()))))),e}function Ka(){var e,o,l,u,h,$;if(e=a,i.substr(a,8)===Ai?(o=Ai,a+=8):(o=t,f===0&&b(xa)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=xe(),$!==t?(_=e,o=ka(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Za(){var e,o,l,u,h,$,T;if(e=a,o=Yi(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=xe(),u!==t?(_=e,o=xi(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;if(e===t)if(e=a,o=ic(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=xe(),u!==t?(h=es(),h!==t?($=xe(),$!==t?(T=sc(),T!==t?(_=e,o=xi(),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function sr(){var e,o,l,u,h;for(e=a,o=[],l=vt(),l===t&&(i.charCodeAt(a)===42?(l=at,a++):(l=t,f===0&&b(ct)));l!==t;)o.push(l),l=vt(),l===t&&(i.charCodeAt(a)===42?(l=at,a++):(l=t,f===0&&b(ct)));if(o!==t)if(i.charCodeAt(a)===63?(l=ki,a++):(l=t,f===0&&b(Ci)),l!==t){for(u=[],h=sr();h!==t;)u.push(h),h=sr();u!==t?(_=e,o=Ca(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Xa(){var e,o,l,u;if(e=a,i.charCodeAt(a)===47?(o=Wt,a++):(o=t,f===0&&b(Yt)),o!==t){for(l=[],Ei.test(i.charAt(a))?(u=i.charAt(a),a++):(u=t,f===0&&b(Oi));u!==t;)l.push(u),Ei.test(i.charAt(a))?(u=i.charAt(a),a++):(u=t,f===0&&b(Oi));l!==t?(i.charCodeAt(a)===47?(u=Wt,a++):(u=t,f===0&&b(Yt)),u!==t?(_=e,o=Ea(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function Ga(){var e,o,l,u,h;if(e=a,o=Gi(),o!==t)if(i.charCodeAt(a)===126?(l=Vt,a++):(l=t,f===0&&b(Kt)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Oa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Ja(){var e,o,l,u,h;if(e=a,o=gt(),o!==t)if(i.charCodeAt(a)===126?(l=Vt,a++):(l=t,f===0&&b(Kt)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Pa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function ec(){var e,o,l,u,h;if(e=a,o=xe(),o!==t)if(i.charCodeAt(a)===94?(l=Pi,a++):(l=t,f===0&&b(Ti)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Ta(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function xe(){var e;return e=gt(),e===t&&(e=Gi()),e}function Gi(){var e,o;if(e=[],o=vt(),o!==t)for(;o!==t;)e.push(o),o=vt();else e=t;return e}function vt(){var e,o,l,u;return e=ir(),e===t&&(e=rc(),e===t&&(e=a,o=a,f++,l=Ji(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(l=a,f++,u=tc(),f--,u===t?l=void 0:(a=l,l=t),l!==t?(i.length>a?(u=i.charAt(a),a++):(u=t,f===0&&b(ii)),u!==t?(o=[o,l,u],e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t))),e}function tc(){var e;return e=ft(),e===t&&(e=ht(),e===t&&(e=Vi(),e===t&&(e=Ki(),e===t&&(e=Zi(),e===t&&(e=es()))))),e}function rc(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(l=Ji(),l!==t?(_=e,o=La(),e=o):(a=e,e=t)):(a=e,e=t),e}function Ji(){var e;return i.charCodeAt(a)===43?(e=vi,a++):(e=t,f===0&&b(mi)),e===t&&(i.charCodeAt(a)===45?(e=yi,a++):(e=t,f===0&&b($i)),e===t&&(i.charCodeAt(a)===61?(e=Da,a++):(e=t,f===0&&b(Na)),e===t&&(i.charCodeAt(a)===62?(e=pi,a++):(e=t,f===0&&b(di)),e===t&&(i.charCodeAt(a)===60?(e=li,a++):(e=t,f===0&&b(ui)),e===t&&(i.charCodeAt(a)===33?(e=wi,a++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(a)===40?(e=k,a++):(e=t,f===0&&b(N)),e===t&&(i.charCodeAt(a)===41?(e=nt,a++):(e=t,f===0&&b(re)),e===t&&(i.charCodeAt(a)===123?(e=$e,a++):(e=t,f===0&&b(Ft)),e===t&&(i.charCodeAt(a)===125?(e=Qt,a++):(e=t,f===0&&b(Ht)),e===t&&(i.charCodeAt(a)===91?(e=Li,a++):(e=t,f===0&&b(Di)),e===t&&(i.charCodeAt(a)===93?(e=Ni,a++):(e=t,f===0&&b(ji)),e===t&&(i.charCodeAt(a)===94?(e=Pi,a++):(e=t,f===0&&b(Ti)),e===t&&(i.charCodeAt(a)===34?(e=je,a++):(e=t,f===0&&b(ze)),e===t&&(i.charCodeAt(a)===126?(e=Vt,a++):(e=t,f===0&&b(Kt)),e===t&&(i.charCodeAt(a)===42?(e=at,a++):(e=t,f===0&&b(ct)),e===t&&(i.charCodeAt(a)===63?(e=ki,a++):(e=t,f===0&&b(Ci)),e===t&&(i.charCodeAt(a)===58?(e=H,a++):(e=t,f===0&&b(B)),e===t&&(i.charCodeAt(a)===92?(e=Be,a++):(e=t,f===0&&b(Re)),e===t&&(i.charCodeAt(a)===47?(e=Wt,a++):(e=t,f===0&&b(Yt))))))))))))))))))))),e}function es(){var e,o,l,u,h;if(e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,2)===zi?(l=zi,a+=2):(l=t,f===0&&b(ja)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function ic(){var e;return i.charCodeAt(a)===91?(e=Li,a++):(e=t,f===0&&b(Di)),e===t&&(i.charCodeAt(a)===123?(e=$e,a++):(e=t,f===0&&b(Ft))),e}function sc(){var e;return i.charCodeAt(a)===93?(e=Ni,a++):(e=t,f===0&&b(ji)),e===t&&(i.charCodeAt(a)===125?(e=Qt,a++):(e=t,f===0&&b(Ht))),e}const{errorOnLuceneSyntax:nc,parseCursor:oc,cursorSymbol:ac,allowLeadingWildcards:cc=!0,helpers:{nodeTypes:de}}=c,W=de.function.buildNodeWithArgumentNodes,ie=de.literal.buildNode,lc=de.wildcard.buildNode,uc=de.namedArg.buildNode,{wildcardSymbol:ts}=de.wildcard;if(ut=g(),ut!==t&&a===i.length)return ut;throw ut!==t&&a<i.length&&b({type:"end",description:"end of input"}),Ri(null,Zt,q<i.length?i.charAt(q):null,q<i.length?pt(q,q+1):pt(q,q))}return{SyntaxError:r,parse:s}}(),Lt=(n,r={},s=et)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...r,helpers:{nodeTypes:V}})},me=(n,r={})=>Lt(n,{...r,startRule:"Literal"},et),tt=(n,r={})=>{try{return Lt(n,r,et)}catch(s){throw s.name==="SyntaxError"?new Nr(s,n):s}},Js=n=>{try{return Lt(n,{errorOnLuceneSyntax:!0},et),!1}catch(r){return r.message.startsWith("Lucene")}},j=(n,r,s,i)=>(r=void 0,!n||!n.type||!V[n.type]?j(V.function.buildNode("and",[]),r):V[n.type].toOpenSearchQuery(n,r,s,i)),Y="@kuery-wildcard@";function en(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function rn(n){return n.includes(Y)?{type:"wildcard",value:n}:me(n)}function jr(n,r){const{value:s}=n,i=s.split(Y).map(en).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function sn(n){const{value:r}=n;return r.split(Y).join("*")}function Dt(n){const{value:r}=n;return r.split(Y).map(tn).join("*")}function nn(n){const{value:r}=n;return r.startsWith(Y)&&r.replace(Y,"").length>0}const on=Object.freeze(Object.defineProperty({__proto__:null,buildNode:rn,hasLeadingWildcard:nn,test:jr,toOpenSearchQuery:sn,toQueryStringQuery:Dt,wildcardSymbol:Y},Symbol.toStringTag,{value:"Module"}));function Nt(n,r){if(!r)return[];if(n.type==="literal"){const s=Tt(n),i=r.fields.find(c=>c.name===s);return i?[i]:[]}else if(n.type==="wildcard")return r.fields.filter(i=>jr(n,i.name))}function fc(n){return n}function zr(n,r,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!r||i.type==="wildcard"&&!s)return i;const t=Nt(i,r).reduce((p,g)=>{const v=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!v?[...p,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:v&&!s?[...p,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:v!==s?[...p,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:p},[]);if(t.length>0)throw new Error(t.join(`
|
|
702
|
-
|
|
716
|
+
`;case"hidden":return A`<input type="hidden"></input>`;case"checkbox":return A`
|
|
717
|
+
<div class="checkbox">
|
|
718
|
+
<spectric-button @click=${()=>{this.checked=!this.checked,this.value=!!this.checked,console.log(this.checked,this.value),this.dispatchEvent(new Event("change",{bubbles:!0}))}} icon size=${this.size||"xxsmall"} variant=${this.checked?"primary":"secondary"}>${this.checked?"✓":" "}</spectric-button>
|
|
719
|
+
${this.invalid||this.helperText?A`<spectric-tooltip text=${this.invalid||this.helperText}></spectric-tooltip>`:null}
|
|
720
|
+
${this.label}
|
|
721
|
+
</div>
|
|
722
|
+
</label>
|
|
723
|
+
`}return`Not yet implemented ${this.variant}`}},T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"checked",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),T([v()],d.SpectricInput.prototype,"hidePasswordLabel",2),T([v()],d.SpectricInput.prototype,"showPasswordLabel",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),T([v()],d.SpectricInput.prototype,"name",2),T([v()],d.SpectricInput.prototype,"pattern",2),T([v({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),T([v({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),T([v({reflect:!0})],d.SpectricInput.prototype,"value",1),T([be("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=T([L("spectric-input")],d.SpectricInput);const me=o=>Lt(o===""?void 0:o??void 0),Js="end of input",eo={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class jr extends Error{constructor(r,s){let i=r.message;if(r.expected){const u=r.expected.map(m=>eo[m.description]||m.description).join(", ");let g=r.found?`"${r.found}"`:Js;i=`Expected ${u} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
|
|
724
|
+
`);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ye(o){return{type:"literal",value:o}}function Nt(o){return o.value}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ye,toOpenSearchQuery:Nt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:vc,parse:it}=function(){function o(i,a){function e(){this.constructor=i}e.prototype=a.prototype,i.prototype=new e}function r(i,a,e,u){this.message=i,this.expected=a,this.found=e,this.location=u,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}o(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},e={},u={start:Fi,Literal:sr},g=Fi,m=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t!==null?t:he.function.buildNode("is","*","*")},w=function(){return pc},x=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("or",[t,n])},S=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("and",[t,n])},C=function(t){return t.type==="cursor"?t:V("not",[t])},k="(",N={type:"literal",value:"(",description:'"("'},at=")",ie={type:"literal",value:")",description:'")"'},H=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},q=":",B={type:"literal",value:":",description:'":"'},Se="{",Ht={type:"literal",value:"{",description:'"{"'},qt="}",Wt={type:"literal",value:"}",description:'"}"'},Bn=function(t,n,l){return n.type==="cursor"?{...n,nestedPath:n.nestedPath?`${t.value}.${n.nestedPath}`:t.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:V("nested",[t,n])},Rn={type:"other",description:"fieldName"},Mn=function(t,n,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const p=gc(n,l);return V("range",[t,p])},Un=function(t,n){return n.type==="cursor"?{...n,fieldName:t.value,suggestionTypes:["value","conjunction"]}:n(t)},In=function(t){if(t.type==="cursor"){const l=`${t.prefix}${t.suffix}`.trim();return{...t,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const n=se(null);return t(n)},Fn=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},Qn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("or",[t(p),n(p)])},Hn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("and",[t(p),n(p)])},qn=function(t){return t.type==="cursor"?{...list,suggestionTypes:["value"]}:n=>V("not",[t(n)])},Wn={type:"other",description:"value"},Vn=function(t){if(t.type==="cursor")return t;const n=se(!0);return l=>V("is",[l,t,n])},Yn=function(t){if(t.type==="cursor")return t;!hc&&t.type==="wildcard"&&he.wildcard.hasLeadingWildcard(t)&&M("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const n=se(!1);return l=>V("is",[l,t,n])},Kn={type:"other",description:"OR"},ei="or",ti={type:"literal",value:"or",description:'"or"'},Zn={type:"other",description:"AND"},ri="and",ii={type:"literal",value:"and",description:'"and"'},Xn={type:"other",description:"NOT"},si="not",oi={type:"literal",value:"not",description:'"not"'},Gn={type:"other",description:"literal"},Me='"',Ue={type:"literal",value:'"',description:'"\\""'},Vt=function(t,n,l){const{start:p,end:f}=Fa();return{type:"cursor",start:p.offset,end:f.offset-n.length,prefix:t.join(""),suffix:l.join(""),text:Ia().replace(n,"")}},Jn=function(t){return se(t.join(""))},Ie="\\",Fe={type:"literal",value:"\\",description:'"\\\\"'},ea=/^[\\"]/,ta={type:"class",value:'[\\\\"]',description:'[\\\\"]'},ct=function(t){return t},ra=/^[^"]/,ia={type:"class",value:'[^"]',description:'[^"]'},sa=function(t){const n=t.join("").trim();return n==="null"?se(null):n==="true"?se(!0):n==="false"?se(!1):t.includes(ss)?fc(n):se(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(n)?isFinite(n)&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(n):Number(n):n)},ni={type:"any",description:"any character"},lt="*",pt={type:"literal",value:"*",description:'"*"'},oa=function(){return ss},ai="\\t",na={type:"literal",value:"\\t",description:'"\\\\t"'},aa=function(){return" "},ci="\\r",ca={type:"literal",value:"\\r",description:'"\\\\r"'},la=function(){return"\r"},li="\\n",pa={type:"literal",value:"\\n",description:'"\\\\n"'},ua=function(){return`
|
|
725
|
+
`},da=function(t){return t},ha=/^[\\():<>"*{}]/,fa={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},pi="<=",ga={type:"literal",value:"<=",description:'"<="'},ba=function(){return"lte"},ui=">=",va={type:"literal",value:">=",description:'">="'},ma=function(){return"gte"},di="<",hi={type:"literal",value:"<",description:'"<"'},ya=function(){return"lt"},fi=">",gi={type:"literal",value:">",description:'">"'},$a=function(){return"gt"},_a={type:"other",description:"whitespace"},wa=/^[ \t\r\n]/,Sa={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Aa=function(){return uc},bi="@kuery-cursor@",xa={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},ka=function(){return dc},vi="||",Ea={type:"literal",value:"||",description:'"||"'},Ca=function(){M("LuceneOr")},mi="&&",Pa={type:"literal",value:"&&",description:'"&&"'},yi=function(){M("LuceneAnd")},$i="+",_i={type:"literal",value:"+",description:'"+"'},wi="-",Si={type:"literal",value:"-",description:'"-"'},Ai=function(){M("LuceneNot")},xi="!",ki={type:"literal",value:"!",description:'"!"'},Ei="_exists_",Ta={type:"literal",value:"_exists_",description:'"_exists_"'},Oa=function(){M("LuceneExists")},Ci=function(){M("LuceneRange")},Pi="?",Ti={type:"literal",value:"?",description:'"?"'},La=function(){M("LuceneWildcard")},Yt="/",Kt={type:"literal",value:"/",description:'"/"'},Oi=/^[^\/]/,Li={type:"class",value:"[^/]",description:"[^/]"},Da=function(){M("LuceneRegex")},Zt="~",Xt={type:"literal",value:"~",description:'"~"'},Ae=/^[0-9]/,xe={type:"class",value:"[0-9]",description:"[0-9]"},Na=function(){M("LuceneFuzzy")},ja=function(){M("LuceneProximity")},Di="^",Ni={type:"literal",value:"^",description:'"^"'},za=function(){M("LuceneBoost")},Ba=function(){return char},Ra="=",Ma={type:"literal",value:"=",description:'"="'},ji="[",zi={type:"literal",value:"[",description:'"["'},Bi="]",Ri={type:"literal",value:"]",description:'"]"'},Mi="TO",Ua={type:"literal",value:"TO",description:'"TO"'},c=0,_=0,ut=[{line:1,column:1,seenCR:!1}],W=0,Gt=[],h=0,dt;if("startRule"in a){if(!(a.startRule in u))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=u[a.startRule]}function Ia(){return i.substring(_,c)}function Fa(){return ht(_,c)}function M(t){throw Ii(t,null,i.substring(_,c),ht(_,c))}function Ui(t){var n=ut[t],l,p;if(n)return n;for(l=t-1;!ut[l];)l--;for(n=ut[l],n={line:n.line,column:n.column,seenCR:n.seenCR};l<t;)p=i.charAt(l),p===`
|
|
726
|
+
`?(n.seenCR||n.line++,n.column=1,n.seenCR=!1):p==="\r"||p==="\u2028"||p==="\u2029"?(n.line++,n.column=1,n.seenCR=!0):(n.column++,n.seenCR=!1),l++;return ut[t]=n,n}function ht(t,n){var l=Ui(t),p=Ui(n);return{start:{offset:t,line:l.line,column:l.column},end:{offset:n,line:p.line,column:p.column}}}function b(t){c<W||(c>W&&(W=c,Gt=[]),Gt.push(t))}function Ii(t,n,l,p){function f(O){var D=1;for(O.sort(function(oe,U){return oe.description<U.description?-1:oe.description>U.description?1:0});D<O.length;)O[D-1]===O[D]?O.splice(D,1):D++}function $(O,D){function oe(bc){function $t(Z){return Z.charCodeAt(0).toString(16).toUpperCase()}return bc.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(Z){return"\\x0"+$t(Z)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Z){return"\\x"+$t(Z)}).replace(/[\u0100-\u0FFF]/g,function(Z){return"\\u0"+$t(Z)}).replace(/[\u1000-\uFFFF]/g,function(Z){return"\\u"+$t(Z)})}var U=new Array(O.length),os,ns,He;for(He=0;He<O.length;He++)U[He]=O[He].description;return os=O.length>1?U.slice(0,-1).join(", ")+" or "+U[O.length-1]:U[0],ns=D?'"'+oe(D)+'"':"end of input","Expected "+os+" but "+ns+" found."}return n!==null&&f(n),new r(t!==null?t:$(n,l),n,l,p)}function Fi(){var t,n,l,p;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();return n!==e?(l=ft(),l===e&&(l=null),l!==e?(p=mt(),p!==e?(_=t,n=m(l,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t}function ft(){var t,n,l,p;return t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ga(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=Jt(),n!==e?(l=gt(),l!==e?(p=ft(),p!==e?(_=t,n=x(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Jt())),t}function Jt(){var t,n,l,p;return t=c,n=Qi(),n!==e?(l=bt(),l!==e?(p=Jt(),p!==e?(_=t,n=S(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Qi()),t}function Qi(){var t,n,l;return t=c,n=ir(),n!==e?(l=Hi(),l!==e?(_=t,n=C(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=Hi()),t}function Hi(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=ft(),p!==e?(f=mt(),f!==e?(i.charCodeAt(c)===41?($=at,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=H(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Qa()),t}function Qa(){var t,n,l,p,f,$,O,D,oe,U;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();if(f!==e)if(i.charCodeAt(c)===123?($=Se,c++):($=e,h===0&&b(Ht)),$!==e){for(O=[],D=y();D!==e;)O.push(D),D=y();O!==e?(D=ft(),D!==e?(oe=mt(),oe!==e?(i.charCodeAt(c)===125?(U=qt,c++):(U=e,h===0&&b(Wt)),U!==e?(_=t,n=Bn(n,D,oe),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t===e&&(t=Ha()),t}function Ha(){var t;return t=qa(),t===e&&(t=Wa(),t===e&&(t=Va())),t}function er(){var t;return h++,t=sr(),h--,t===e&&h===0&&b(Rn),t}function qa(){var t,n,l,p,f,$;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(p=Zi(),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=sr(),$!==e?(_=t,n=Mn(n,p,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Wa(){var t,n,l,p,f,$;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=tr(),$!==e?(_=t,n=Un(n,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Va(){var t,n;return t=c,n=Vi(),n!==e&&(_=t,n=In(n)),t=n,t}function tr(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=qi(),p!==e?(f=mt(),f!==e?(i.charCodeAt(c)===41?($=at,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=Fn(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Vi()),t}function qi(){var t,n,l,p;return t=c,n=rr(),n!==e?(l=gt(),l!==e?(p=qi(),p!==e?(_=t,n=Qn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=rr()),t}function rr(){var t,n,l,p;return t=c,n=Wi(),n!==e?(l=bt(),l!==e?(p=rr(),p!==e?(_=t,n=Hn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Wi()),t}function Wi(){var t,n,l;return t=c,n=ir(),n!==e?(l=tr(),l!==e?(_=t,n=qn(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=tr()),t}function Vi(){var t,n;return h++,t=c,n=vt(),n!==e&&(_=t,n=Vn(n)),t=n,t===e&&(t=c,n=Yi(),n!==e&&(_=t,n=Yn(n)),t=n),h--,t===e&&(n=e,h===0&&b(Wn)),t}function gt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2).toLowerCase()===ei?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ti)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Xi(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Kn)),t}function bt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,3).toLowerCase()===ri?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(ii)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Gi(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Zn)),t}function ir(){var t,n,l,p;if(h++,t=c,i.substr(c,3).toLowerCase()===si?(n=i.substr(c,3),c+=3):(n=e,h===0&&b(oi)),n!==e){if(l=[],p=y(),p!==e)for(;p!==e;)l.push(p),p=y();else l=e;l!==e?(n=[n,l],t=n):(c=t,t=e)}else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ji(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Xn)),t}function sr(){var t;return h++,t=vt(),t===e&&(t=Yi()),h--,t===e&&h===0&&b(Gn),t}function vt(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();if(l!==e)if(p=Qe(),p!==e){for(f=[],$=ke();$!==e;)f.push($),$=ke();f!==e?(i.charCodeAt(c)===34?($=Me,c++):($=e,h===0&&b(Ue)),$!==e?(_=t,n=Vt(l,p,f),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;if(t===e)if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();l!==e?(i.charCodeAt(c)===34?(p=Me,c++):(p=e,h===0&&b(Ue)),p!==e?(_=t,n=Jn(l),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ke(){var t,n,l;return t=or(),t===e&&(t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(ea.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(ta)),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=c,h++,l=Qe(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(ra.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(ia)),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e))),t}function Yi(){var t,n,l,p,f;for(t=c,n=[],l=Ee();l!==e;)n.push(l),l=Ee();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=Ee();f!==e;)p.push(f),f=Ee();p!==e?(_=t,n=Vt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e){if(t=c,n=[],l=Ee(),l!==e)for(;l!==e;)n.push(l),l=Ee();else n=e;n!==e&&(_=t,n=sa(n)),t=n}return t}function Ee(){var t,n,l,p,f;return t=or(),t===e&&(t=Ka(),t===e&&(t=Za(),t===e&&(t=Ya(),t===e&&(t=c,n=c,h++,l=Ki(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=Xa(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(p=c,h++,f=Qe(),h--,f===e?p=void 0:(c=p,p=e),p!==e?(i.length>c?(f=i.charAt(c),c++):(f=e,h===0&&b(ni)),f!==e?(_=t,n=ct(f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))))),t}function Ya(){var t,n;return t=c,i.charCodeAt(c)===42?(n=lt,c++):(n=e,h===0&&b(pt)),n!==e&&(_=t,n=oa()),t=n,t}function mt(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Vt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e)for(t=[],n=y();n!==e;)t.push(n),n=y();return t}function or(){var t,n;return t=c,i.substr(c,2)===ai?(n=ai,c+=2):(n=e,h===0&&b(na)),n!==e&&(_=t,n=aa()),t=n,t===e&&(t=c,i.substr(c,2)===ci?(n=ci,c+=2):(n=e,h===0&&b(ca)),n!==e&&(_=t,n=la()),t=n,t===e&&(t=c,i.substr(c,2)===li?(n=li,c+=2):(n=e,h===0&&b(pa)),n!==e&&(_=t,n=ua()),t=n)),t}function Ka(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=Ki(),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Za(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(i.substr(c,2).toLowerCase()===ei?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ti)),l===e&&(i.substr(c,3).toLowerCase()===ri?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(ii)),l===e&&(i.substr(c,3).toLowerCase()===si?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(oi)))),l!==e?(_=t,n=da(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Xa(){var t;return t=gt(),t===e&&(t=bt(),t===e&&(t=ir())),t}function Ki(){var t;return ha.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(fa)),t}function Zi(){var t,n;return t=c,i.substr(c,2)===pi?(n=pi,c+=2):(n=e,h===0&&b(ga)),n!==e&&(_=t,n=ba()),t=n,t===e&&(t=c,i.substr(c,2)===ui?(n=ui,c+=2):(n=e,h===0&&b(va)),n!==e&&(_=t,n=ma()),t=n,t===e&&(t=c,i.charCodeAt(c)===60?(n=di,c++):(n=e,h===0&&b(hi)),n!==e&&(_=t,n=ya()),t=n,t===e&&(t=c,i.charCodeAt(c)===62?(n=fi,c++):(n=e,h===0&&b(gi)),n!==e&&(_=t,n=$a()),t=n))),t}function y(){var t;return h++,wa.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(Sa)),h--,t===e&&h===0&&b(_a),t}function Qe(){var t,n,l;return t=c,_=c,n=Aa(),n?n=void 0:n=e,n!==e?(i.substr(c,14)===bi?(l=bi,c+=14):(l=e,h===0&&b(xa)),l!==e?(_=t,n=ka(),t=n):(c=t,t=e)):(c=t,t=e),t}function Xi(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===vi?(l=vi,c+=2):(l=e,h===0&&b(Ea)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Ca(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Gi(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===mi?(l=mi,c+=2):(l=e,h===0&&b(Pa)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=yi(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,i.charCodeAt(c)===43?(n=$i,c++):(n=e,h===0&&b(_i)),n!==e&&(_=t,n=yi()),t=n),t}function Ji(){var t,n;return t=c,i.charCodeAt(c)===45?(n=wi,c++):(n=e,h===0&&b(Si)),n!==e&&(_=t,n=Ai()),t=n,t===e&&(t=c,i.charCodeAt(c)===33?(n=xi,c++):(n=e,h===0&&b(ki)),n!==e&&(_=t,n=Ai()),t=n),t}function Ga(){var t;return t=Ja(),t===e&&(t=es(),t===e&&(t=ec())),t}function Ja(){var t,n,l,p,f,$;if(t=c,n=Ce(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=es(),$!==e?(n=[n,l,p,f,$],t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function es(){var t;return t=tc(),t===e&&(t=nr(),t===e&&(t=rc(),t===e&&(t=ic(),t===e&&(t=sc(),t===e&&(t=oc()))))),t}function ec(){var t,n,l,p,f,$;if(t=c,i.substr(c,8)===Ei?(n=Ei,c+=8):(n=e,h===0&&b(Ta)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=Ce(),$!==e?(_=t,n=Oa(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function tc(){var t,n,l,p,f,$,O;if(t=c,n=Zi(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(_=t,n=Ci(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;if(t===e)if(t=c,n=cc(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(f=is(),f!==e?($=Ce(),$!==e?(O=lc(),O!==e?(_=t,n=Ci(),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function nr(){var t,n,l,p,f;for(t=c,n=[],l=yt(),l===e&&(i.charCodeAt(c)===42?(l=lt,c++):(l=e,h===0&&b(pt)));l!==e;)n.push(l),l=yt(),l===e&&(i.charCodeAt(c)===42?(l=lt,c++):(l=e,h===0&&b(pt)));if(n!==e)if(i.charCodeAt(c)===63?(l=Pi,c++):(l=e,h===0&&b(Ti)),l!==e){for(p=[],f=nr();f!==e;)p.push(f),f=nr();p!==e?(_=t,n=La(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function rc(){var t,n,l,p;if(t=c,i.charCodeAt(c)===47?(n=Yt,c++):(n=e,h===0&&b(Kt)),n!==e){for(l=[],Oi.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Li));p!==e;)l.push(p),Oi.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Li));l!==e?(i.charCodeAt(c)===47?(p=Yt,c++):(p=e,h===0&&b(Kt)),p!==e?(_=t,n=Da(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ic(){var t,n,l,p,f;if(t=c,n=ts(),n!==e)if(i.charCodeAt(c)===126?(l=Zt,c++):(l=e,h===0&&b(Xt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=Na(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function sc(){var t,n,l,p,f;if(t=c,n=vt(),n!==e)if(i.charCodeAt(c)===126?(l=Zt,c++):(l=e,h===0&&b(Xt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=ja(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function oc(){var t,n,l,p,f;if(t=c,n=Ce(),n!==e)if(i.charCodeAt(c)===94?(l=Di,c++):(l=e,h===0&&b(Ni)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=za(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Ce(){var t;return t=vt(),t===e&&(t=ts()),t}function ts(){var t,n;if(t=[],n=yt(),n!==e)for(;n!==e;)t.push(n),n=yt();else t=e;return t}function yt(){var t,n,l,p;return t=or(),t===e&&(t=ac(),t===e&&(t=c,n=c,h++,l=rs(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=nc(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(i.length>c?(p=i.charAt(c),c++):(p=e,h===0&&b(ni)),p!==e?(n=[n,l,p],t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))),t}function nc(){var t;return t=gt(),t===e&&(t=bt(),t===e&&(t=Xi(),t===e&&(t=Gi(),t===e&&(t=Ji(),t===e&&(t=is()))))),t}function ac(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=rs(),l!==e?(_=t,n=Ba(),t=n):(c=t,t=e)):(c=t,t=e),t}function rs(){var t;return i.charCodeAt(c)===43?(t=$i,c++):(t=e,h===0&&b(_i)),t===e&&(i.charCodeAt(c)===45?(t=wi,c++):(t=e,h===0&&b(Si)),t===e&&(i.charCodeAt(c)===61?(t=Ra,c++):(t=e,h===0&&b(Ma)),t===e&&(i.charCodeAt(c)===62?(t=fi,c++):(t=e,h===0&&b(gi)),t===e&&(i.charCodeAt(c)===60?(t=di,c++):(t=e,h===0&&b(hi)),t===e&&(i.charCodeAt(c)===33?(t=xi,c++):(t=e,h===0&&b(ki)),t===e&&(i.charCodeAt(c)===40?(t=k,c++):(t=e,h===0&&b(N)),t===e&&(i.charCodeAt(c)===41?(t=at,c++):(t=e,h===0&&b(ie)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(Ht)),t===e&&(i.charCodeAt(c)===125?(t=qt,c++):(t=e,h===0&&b(Wt)),t===e&&(i.charCodeAt(c)===91?(t=ji,c++):(t=e,h===0&&b(zi)),t===e&&(i.charCodeAt(c)===93?(t=Bi,c++):(t=e,h===0&&b(Ri)),t===e&&(i.charCodeAt(c)===94?(t=Di,c++):(t=e,h===0&&b(Ni)),t===e&&(i.charCodeAt(c)===34?(t=Me,c++):(t=e,h===0&&b(Ue)),t===e&&(i.charCodeAt(c)===126?(t=Zt,c++):(t=e,h===0&&b(Xt)),t===e&&(i.charCodeAt(c)===42?(t=lt,c++):(t=e,h===0&&b(pt)),t===e&&(i.charCodeAt(c)===63?(t=Pi,c++):(t=e,h===0&&b(Ti)),t===e&&(i.charCodeAt(c)===58?(t=q,c++):(t=e,h===0&&b(B)),t===e&&(i.charCodeAt(c)===92?(t=Ie,c++):(t=e,h===0&&b(Fe)),t===e&&(i.charCodeAt(c)===47?(t=Yt,c++):(t=e,h===0&&b(Kt))))))))))))))))))))),t}function is(){var t,n,l,p,f;if(t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2)===Mi?(l=Mi,c+=2):(l=e,h===0&&b(Ua)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function cc(){var t;return i.charCodeAt(c)===91?(t=ji,c++):(t=e,h===0&&b(zi)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(Ht))),t}function lc(){var t;return i.charCodeAt(c)===93?(t=Bi,c++):(t=e,h===0&&b(Ri)),t===e&&(i.charCodeAt(c)===125?(t=qt,c++):(t=e,h===0&&b(Wt))),t}const{errorOnLuceneSyntax:pc,parseCursor:uc,cursorSymbol:dc,allowLeadingWildcards:hc=!0,helpers:{nodeTypes:he}}=a,V=he.function.buildNodeWithArgumentNodes,se=he.literal.buildNode,fc=he.wildcard.buildNode,gc=he.namedArg.buildNode,{wildcardSymbol:ss}=he.wildcard;if(dt=g(),dt!==e&&c===i.length)return dt;throw dt!==e&&c<i.length&&b({type:"end",description:"end of input"}),Ii(null,Gt,W<i.length?i.charAt(W):null,W<i.length?ht(W,W+1):ht(W,W))}return{SyntaxError:r,parse:s}}(),jt=(o,r={},s=it)=>{if(typeof o>"u")throw new Error("expression must be a string, got undefined instead");return s(o,{...r,helpers:{nodeTypes:K}})},$e=(o,r={})=>jt(o,{...r,startRule:"Literal"},it),st=(o,r={})=>{try{return jt(o,r,it)}catch(s){throw s.name==="SyntaxError"?new jr(s,o):s}},ro=o=>{try{return jt(o,{errorOnLuceneSyntax:!0},it),!1}catch(r){return r.message.startsWith("Lucene")}},j=(o,r,s,i)=>(r=void 0,!o||!o.type||!K[o.type]?j(K.function.buildNode("and",[]),r):K[o.type].toOpenSearchQuery(o,r,s,i)),Y="@kuery-wildcard@";function io(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function so(o){return o.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function oo(o){return o.includes(Y)?{type:"wildcard",value:o}:$e(o)}function zr(o,r){const{value:s}=o,i=s.split(Y).map(io).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function no(o){const{value:r}=o;return r.split(Y).join("*")}function zt(o){const{value:r}=o;return r.split(Y).map(so).join("*")}function ao(o){const{value:r}=o;return r.startsWith(Y)&&r.replace(Y,"").length>0}const co=Object.freeze(Object.defineProperty({__proto__:null,buildNode:oo,hasLeadingWildcard:ao,test:zr,toOpenSearchQuery:no,toQueryStringQuery:zt,wildcardSymbol:Y},Symbol.toStringTag,{value:"Module"}));function Bt(o,r){if(!r)return[];if(o.type==="literal"){const s=Nt(o),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(o.type==="wildcard")return r.fields.filter(i=>zr(o,i.name))}function mc(o){return o}function Br(o,r,s){const i={...o,value:s?`${s}.${o.value}`:o.value};if(!r||i.type==="wildcard"&&!s)return i;const e=Bt(i,r).reduce((u,g)=>{const m=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!m?[...u,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:m&&!s?[...u,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:m!==s?[...u,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:u},[]);if(e.length>0)throw new Error(e.join(`
|
|
727
|
+
`));return i}function lo(o,r,s=!1){if(o===void 0)throw new Error("fieldName is a required argument");if(r===void 0)throw new Error("value is a required argument");const i=typeof o=="string"?$e(o):ye(o),a=typeof r=="string"?$e(r):ye(r),e=ye(s);return{arguments:[i,a,e]}}function po(o,r,s={},i={}){const{arguments:[a,e,u]}=o,g=Br(a,r,i!=null&&i.nested?i.nested.path:void 0),m=j(g),w=e!==void 0?j(e):e,x=u.value?"phrase":"best_fields";if(g.value===null)return e.type==="wildcard"?{query_string:{query:zt(e)}}:{multi_match:{type:x,query:w,lenient:!0}};const S=r?Bt(g,r):[];S&&S.length===0&&S.push({name:j(g),scripted:!1,type:""});const C=e.type==="wildcard"&&w==="*",k=g.type==="wildcard"&&m==="*"||S&&r&&S.length===r.fields.length;return C&&k?{match_all:{}}:{bool:{should:S.reduce((ie,H)=>{const q=B=>{var Se;return g.type!=="wildcard"||!((Se=H.subType)!=null&&Se.nested)||i!=null&&i.nested?B:{nested:{path:H.subType.nested.path,query:B,score_mode:"none"}}};if(H.scripted)return[];if(C)return[...ie,q({exists:{field:H.name}})];if(e.type==="wildcard")return[...ie,q({query_string:{fields:[H.name],query:zt(e)}})];if(H.type==="date"){const B=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...ie,q({range:{[H.name]:{gte:w,lte:w,...B}}})]}else{const B=x==="phrase"?"match_phrase":"match";return[...ie,q({[B]:{[H.name]:w}})]}},[])||[],minimum_should_match:1}}}const uo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:po},Symbol.toStringTag,{value:"Module"}));function ho(o){return{arguments:o}}function fo(o,r,s={},i={}){return{bool:{filter:(o.arguments||[]).map(e=>j(e,r,s,i))}}}const go=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ho,toOpenSearchQuery:fo},Symbol.toStringTag,{value:"Module"}));function bo(o){return{arguments:o}}function vo(o,r,s={},i={}){return{bool:{should:(o.arguments||[]).map(e=>j(e,r,s,i)),minimum_should_match:1}}}const mo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:bo,toOpenSearchQuery:vo},Symbol.toStringTag,{value:"Module"}));function yo(o){return{arguments:[o]}}function $o(o,r,s={},i={}){const[a]=o.arguments;return{bool:{must_not:j(a,r,s,i)}}}const _o=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:yo,toOpenSearchQuery:$o},Symbol.toStringTag,{value:"Module"}));function wo(o,...r){let s={};for(let i of r)s[i]=o[i];return s}function So(o,r){const s=wo(r,"gt","lt","gte","lte","format"),i=typeof o=="string"?$e(o):K.literal.buildNode(o),a=Object.entries(s).map(e=>{let[u,g]=e;return K.namedArg.buildNode(u,g)});return{arguments:[i,...a]}}function Ao(o,r,s={},i={}){const[a,...e]=o.arguments,u=Br(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Bt(u,r):[],m=xo(e),w=Object.fromEntries(Object.entries(m).map(([S,C])=>[S,j(C)]));return g&&g.length===0&&g.push({name:j(u),scripted:!1,type:""}),{bool:{should:g.map(S=>{const C=k=>{var N;return u.type!=="wildcard"||!((N=S.subType)!=null&&N.nested)||i.nested?k:{nested:{path:S.subType.nested.path,query:k,score_mode:"none"}}};if(S.scripted)return{};if(S.type==="date"){const k=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return C({range:{[S.name]:{...w,...k}}})}return C({range:{[S.name]:w}})}),minimum_should_match:1}}}function xo(o){if(o.gt&&o.gte||o.lt&&o.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return o.reduce((s,i,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const ko=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:So,toOpenSearchQuery:Ao},Symbol.toStringTag,{value:"Module"}));function Eo(o){return{arguments:[ye(o)]}}function Co(o,r,s={},i={}){const{arguments:[a]}=o,e={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},u=Nt(e),g=((r==null?void 0:r.fields)||[]).find(m=>m.name===u);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:u}}}const Po=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Eo,toOpenSearchQuery:Co},Symbol.toStringTag,{value:"Module"}));function To(o,r){return{arguments:[typeof o=="string"?$e(o):ye(o),r]}}function Oo(o,r,s={},i={}){var m;const[a,e]=o.arguments,u=j(a),g=(m=i==null?void 0:i.nested)!=null&&m.path?`${i.nested.path}.${u}`:u;return{nested:{path:g,query:j(e,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Rt={is:uo,and:go,or:mo,not:_o,range:ko,exists:Po,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:To,toOpenSearchQuery:Oo},Symbol.toStringTag,{value:"Module"}))};function Lo(o,...r){const s=Rt[o];if(s===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,...s.buildNodeParams(...r)}}function Do(o,r){if(Rt[o]===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,arguments:r}}function No(o,r,s,i){return Rt[o.function].toOpenSearchQuery(o,r,s,i)}const jo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Lo,buildNodeWithArgumentNodes:Do,toOpenSearchQuery:No},Symbol.toStringTag,{value:"Module"}));function zo(o,r){const s=r.type==="literal"?r:K.literal.buildNode(r);return{type:"namedArg",name:o,value:s}}function Bo(o){return j(o.value)}const K={function:jo,literal:to,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:zo,toOpenSearchQuery:Bo},Symbol.toStringTag,{value:"Module"})),wildcard:co},Ro=Y,Mo=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" AND ")+")",Uo=(o,r)=>{var{arguments:[s,i,a]}=o;let e="=";i.type==="wildcard"&&(e="");let u=de(i);a=a.value||typeof u=="string",i.type==="literal"&&a&&(u=`'${u}'`),i.type==="literal"&&!a&&(u=`${u}`);let g=de(s);return g==null?r&&a?`(${r.filter(m=>m.type==="string").map(m=>`${m.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(m=>m.type==="boolean").map(m=>`${m.name}=${i.value}`).join(" OR ")})`:"":g+e+u},Io=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" OR ")+")",Fo=(o,r)=>{const[s]=o.arguments;return"NOT ("+de(s,r)+")"},Qo={gt:">",lt:"<",gte:">=",lte:"<="},Ho={is:Uo,and:Mo,or:Io,not:Fo,range:o=>{const[r,s]=o.arguments;let i=s.value;const a=Qo[s.name];let e=de(i);return i.type==="literal"&&(e=`${e}`),`${r.value} ${a} ${e}`},exists:o=>{const[r]=o.arguments;return`${r.value} IS NOT NULL`},nested:o=>(console.warn("Nested types dont exist in CQL",o),"")},qo={function:(o,r)=>Ho[o.function](o,r),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return` LIKE '${r.split(Ro).join("%")}'`}},de=(o,r)=>{const s=qo[o.type];return s(o,r)},Wo=Y,Vo=o=>({$and:(o.arguments||[]).map(i=>ee(i))}),Yo=o=>{const{arguments:[r,s]}=o;let i=ee(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Rr(o);let e={};return e[ee(r)]={$eq:i},e},Ko=o=>({$or:(o.arguments||[]).map(s=>ee(s))}),Zo=o=>{const[r]=o.arguments;let s={};return s={$ne:ee(r)},s},Xo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Go=o=>{const[r,s]=o.arguments;let i=s.value;const a=Xo[s.name];let e=ee(i),u={};return u[r.value]={},u[r.value][a]=e,u},Rr=o=>{const[r]=o.arguments;return{[ee(r)]:{$ne:null}}},Jo={is:Yo,and:Vo,or:Ko,not:Zo,range:Go,exists:Rr,nested:o=>(console.warn("TODO Implement nested search",o),"")},en={function:o=>Jo[o.function](o),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return`/${r.split(Wo).join(".*")}/`}},ee=(o,r)=>{const s=en[o.type];return s(o,r)},tn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:jr,doesKueryExpressionHaveLuceneSyntaxError:ro,fromKueryExpression:st,fromLiteralExpression:$e,nodeTypes:K,parse:st,toCql:de,toDSL:j,toMongo:ee,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),rn=R`
|
|
703
728
|
:host {
|
|
704
729
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
705
730
|
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
@@ -746,7 +771,7 @@ spectric-button{
|
|
|
746
771
|
right: 0;
|
|
747
772
|
top: 0;
|
|
748
773
|
}
|
|
749
|
-
`;var
|
|
774
|
+
`;var sn=Object.defineProperty,on=Object.getOwnPropertyDescriptor,te=(o,r,s,i)=>{for(var a=i>1?void 0:i?on(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&sn(r,s,a),a};const Mt="spectric-dialog";d.DialogElement=class extends P{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async r=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===r.target&&(this.open=!1)},this._handleKeyDown=r=>{this.closeOnEscape||r.preventDefault(),this.open&&this.closeOnEscape&&r.key==="Escape"&&(this.open=!1)},this._onClose=r=>{r.preventDefault(),r.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(r,s){let i=document.createElement(Mt);i.addEventListener("close",()=>{i.remove()});for(let e in r)i[e]=r[e];let a=document.createDocumentFragment();return Ct(s,a),i.appendChild(a),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(r=>r.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(r=>r.removeEventListener("keydown",this._handleKeyDown))}updated(r){r.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return A`
|
|
750
775
|
<dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
|
|
751
776
|
<spectric-panel>
|
|
752
777
|
<div class="modal">
|
|
@@ -762,17 +787,17 @@ spectric-button{
|
|
|
762
787
|
</div>
|
|
763
788
|
</spectric-panel>
|
|
764
789
|
</dialog>
|
|
765
|
-
`}},d.DialogElement.styles=
|
|
790
|
+
`}},d.DialogElement.styles=rn,te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),te([v({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),te([Ye("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=te([L(Mt)],d.DialogElement);var nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,Q=(o,r,s,i)=>{for(var a=i>1?void 0:i?an(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&nn(r,s,a),a},Mr=(o=>(o.MONGO="toMongo",o.CQL="toCql",o.DSL="toDSL",o.AST="AST",o))(Mr||{});const Ur={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"}},cn={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},ln=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],pn=Object.fromEntries(Object.entries(Ur).map(([o,r])=>[o,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends P{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(r=void 0)=>{let s;if(r&&(r!=null&&r.currentTarget)&&r.currentTarget.value&&(this.value=r.currentTarget.value),this.value=="")return;try{r&&r.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"@kuery-cursor@"+e.substring(this._input.selectionStart));let u=st(e,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(u),s=st(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=tn[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let e=await r.onSelect();e!==void 0&&(this.value+=e,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery()},this._handleArrows=r=>{var s;r.key==="Escape"&&(this.completions=[]),(r.key=="ArrowLeft"||r.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(r.key)&&this.suggestion&&(r.preventDefault(),(r.key==="ArrowDown"||r.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),r.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let e of r.suggestionTypes){if(e=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(u=>({type:e,value:u,start:a,end:a}))),e==="field"){let u=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:e,value:g.name,start:i,end:a}]).flat();s.push(...u)}if(e==="operator"){let u=this.fields.find(g=>g.name===r.fieldName);u&&(u.type==="number"?s.push(...Object.values(Ur).map(g=>({type:e,...g,start:a,end:a}))):u.type==="string"?u.format==="date-time"?s.push(...Object.values(pn).map(g=>({type:e,...g,start:a,end:a,onSelect:async()=>{let m=await this.getValuesForField(r.fieldName,r.prefix);m.length===0&&(m=["now-1m","now-1d","now-1M"]);let w,x=Ze();return await new Promise(S=>{let C=d.DialogElement.display({},A`
|
|
766
791
|
<div class="query-bar-date-quick-select">
|
|
767
|
-
${
|
|
792
|
+
${m.map(k=>A`<a href="#" @click=${N=>{N.preventDefault(),w=`"${k}"`,S(w),C.open=!1}}>${k}</a>`)}
|
|
768
793
|
</div>
|
|
769
794
|
<spectric-input variant="datetime-local" @change=${k=>{if(!k.target)return;w=`"${new Date(k.target.value+":00.000Z").toISOString()}"`,x.value.disabled=w===void 0}}></spectric-input>
|
|
770
|
-
<spectric-button ${
|
|
771
|
-
`)}),w}}))):s.push(...Object.values(
|
|
795
|
+
<spectric-button ${Xe(x)} .disabled=${!0} @click=${()=>{S(w),C.open=!1}}>Submit</spectric-button>
|
|
796
|
+
`)}),w}}))):s.push(...Object.values(cn).map(g=>({type:e,...g,start:a,end:a}))):u.type==="boolean"&&s.push(...ln.map(g=>({type:e,...g,start:a,end:a}))))}if(e==="value"){let u=this.fields.find(g=>g.name===r.fieldName);if(u&&u.type=="boolean")s.push({type:e,value:"true",start:i,end:a},{type:e,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(u==null?void 0:u.type)==="string"&&(g=g.map(m=>`"${m}"`)),s.push(...g.map(m=>({type:e,value:m,start:i,end:a})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:e,left:u,bottom:g}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${u+3.75}px`,this._autocomplete.style.top=`${g}px`),this._autocomplete.style.width=`${e-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return A`
|
|
772
797
|
<spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${r=>r.stopPropagation()}></spectric-input>
|
|
773
798
|
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
774
799
|
${this.completions.map((r,s)=>A`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}} class=${this.completionIndex==s?"option active":"option"}><span class="optiontype ${r.type}">${r.type}</span> <span class="value">${r.value}</span> <span class="label">${r.label}</span></span> </div></div>`)}
|
|
775
|
-
</div>`}},
|
|
800
|
+
</div>`}},Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),Q([ze()],d.SpectricQuery.prototype,"completions",2),Q([ze()],d.SpectricQuery.prototype,"completionIndex",2),Q([v({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),Q([be(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),Q([Ye(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),Q([be("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=Q([L("spectric-query")],d.SpectricQuery);const Ir=R`
|
|
776
801
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
777
802
|
background-color: var(--panel-color,#0b0b0b);
|
|
778
803
|
--spectric-input-color: var(--spectric-background);
|
|
@@ -780,7 +805,7 @@ spectric-button{
|
|
|
780
805
|
--spectric-text-primary:var(--text-primary);
|
|
781
806
|
--spectric-text-secondary:var(--text-secondary);
|
|
782
807
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
783
|
-
`,
|
|
808
|
+
`,Fr=R`
|
|
784
809
|
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
785
810
|
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
786
811
|
color:var(--text-primary,#3c4c5b);
|
|
@@ -788,7 +813,7 @@ spectric-button{
|
|
|
788
813
|
--spectric-text-primary:var(--text-secondary);
|
|
789
814
|
--spectric-text-secondary:var(--text-primary);
|
|
790
815
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
791
|
-
`,
|
|
816
|
+
`,un=R`
|
|
792
817
|
:host{
|
|
793
818
|
display:block;
|
|
794
819
|
border:2px solid black;
|
|
@@ -798,20 +823,20 @@ spectric-button{
|
|
|
798
823
|
|
|
799
824
|
}
|
|
800
825
|
:host(spectric-panel[level='0']) {
|
|
801
|
-
${
|
|
826
|
+
${Ir};
|
|
802
827
|
}
|
|
803
828
|
|
|
804
829
|
:host(spectric-panel[level='1']) {
|
|
805
|
-
${
|
|
830
|
+
${Fr};
|
|
806
831
|
}
|
|
807
832
|
|
|
808
833
|
:host(spectric-panel[level='2']) {
|
|
809
|
-
${
|
|
834
|
+
${Ir};
|
|
810
835
|
}
|
|
811
836
|
:host(spectric-panel[level='3']) {
|
|
812
|
-
${
|
|
837
|
+
${Fr};
|
|
813
838
|
}
|
|
814
|
-
`;var
|
|
839
|
+
`;var dn=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ut=(o,r,s,i)=>{for(var a=i>1?void 0:i?hn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&dn(r,s,a),a};d.SpectricPanel=class extends P{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(r=>{r.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 A` <slot></slot> `}},d.SpectricPanel.styles=un,Ut([v({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Ut([v({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Ut([L("spectric-panel")],d.SpectricPanel);var fn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Qr=(o,r,s,i)=>{for(var a=i>1?void 0:i?gn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&fn(r,s,a),a};const bn={"--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"}},Hr={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},qr={...Hr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},It={undefined:{},light:{},dark:Hr,spectric:qr,spectricFlat:{...qr,"--border-radius":"1px"}},vn=Object.fromEntries(Object.keys(It).map(o=>[o,o])),mn=`
|
|
815
840
|
--spectric-background: var(--background,#ffffff);
|
|
816
841
|
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
817
842
|
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
@@ -854,12 +879,12 @@ spectric-button{
|
|
|
854
879
|
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
855
880
|
--spectric-button-disabled: #c6c6c6;
|
|
856
881
|
color: var(--spectric-text-primary);
|
|
857
|
-
`;d.SpectricThemeProvider=class extends
|
|
882
|
+
`;d.SpectricThemeProvider=class extends P{constructor(){super(...arguments),this.theme="undefined"}updated(r){if(r.has("theme")&&this.theme!=r.get("theme")){const s={old:r.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let r=Object.keys(It).includes(this.theme)?this.theme:"undefined",s=Object.entries(It[r]).map(i=>`${i[0]}:${i[1]};`).join(`
|
|
858
883
|
`);return A`
|
|
859
884
|
${this.theme&&this.theme!=="light"?A`
|
|
860
885
|
<style>:host{
|
|
861
886
|
${s};
|
|
862
|
-
${
|
|
887
|
+
${mn}
|
|
863
888
|
}
|
|
864
889
|
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
865
890
|
::-webkit-scrollbar-thumb {
|
|
@@ -930,9 +955,9 @@ spectric-button{
|
|
|
930
955
|
}
|
|
931
956
|
</style>`:null}
|
|
932
957
|
<slot></slot>
|
|
933
|
-
`}},d.SpectricThemeProvider.styles=
|
|
958
|
+
`}},d.SpectricThemeProvider.styles=R`:host{
|
|
934
959
|
display:contents;
|
|
935
|
-
}`,
|
|
960
|
+
}`,Qr([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=Qr([L("spectric-theme")],d.SpectricThemeProvider);const yn=R`
|
|
936
961
|
:host {
|
|
937
962
|
display: block;
|
|
938
963
|
height: 100%;
|
|
@@ -995,7 +1020,7 @@ spectric-button{
|
|
|
995
1020
|
width: 5px;
|
|
996
1021
|
cursor: ew-resize;
|
|
997
1022
|
}
|
|
998
|
-
`;var
|
|
1023
|
+
`;var $n=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,z=(o,r,s,i)=>{for(var a=i>1?void 0:i?_n(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&$n(r,s,a),a},Wr=(o=>(o.horizontal="horizontal",o.vertical="vertical",o))(Wr||{});const Vr="spectric-splitview";d.SplitView=class extends Lr{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:s,orientation:i,invisible:a,min:e,max:u,useSavedState:g}=this,m=this.getAttribute("id");m&&this.useSavedState&&localStorage.setItem(`splitview-${m}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:a,min:e,max:u,useSavedState:g}}))},this._onMouseMove=Dr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let a,e;this.orientation==="horizontal"?(a=s.clientX-i.left,e=a/i.width*100):(a=s.clientY-i.top,e=a/i.height*100),e=Math.min(Math.max(e,this.min),this.max),this.percentage=e,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let a=s.target.assignedNodes().filter(e=>e instanceof HTMLElement);a.length>2&&console.log("cannot assign more than 2 elements to a split view"),a.forEach(e=>{if(this._panel1.assignedNodes().length===0){e.slot="panel1";return}if(this._panel2.assignedNodes().length===0){e.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 r=this.getAttribute("id");if(r&&this.useSavedState){let s=localStorage.getItem(`splitview-${r}`);s&&(this.percentage=parseFloat(s))}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(r){r.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return A`
|
|
999
1024
|
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
1000
1025
|
<span class="error-display">${this._error}</span>
|
|
1001
1026
|
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
@@ -1007,12 +1032,12 @@ spectric-button{
|
|
|
1007
1032
|
</div>
|
|
1008
1033
|
</div>
|
|
1009
1034
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
1010
|
-
`}},d.SplitView.styles=
|
|
1035
|
+
`}},d.SplitView.styles=yn,z([v({type:String})],d.SplitView.prototype,"orientation",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),z([v({type:Boolean})],d.SplitView.prototype,"invisible",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),z([v({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),z([ze()],d.SplitView.prototype,"isDragging",2),z([ze()],d.SplitView.prototype,"_error",2),z([Ye(".splitter")],d.SplitView.prototype,"_splitter",2),z([be("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),z([be("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=z([L(Vr)],d.SplitView);var wn=Object.defineProperty,Sn=Object.getOwnPropertyDescriptor,_e=(o,r,s,i)=>{for(var a=i>1?void 0:i?Sn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&wn(r,s,a),a};const Yr="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends P{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=r=>{let s=parseInt(r.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:r,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:r,pageSize:s}}))}}createRenderRoot(){return this}updated(r){r.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i))}render(){let r=this.page*this.pageSize,s=!0;this.totalItems&&r<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),A`
|
|
1011
1036
|
<div class="spectric-pagination-container">
|
|
1012
1037
|
<div>
|
|
1013
1038
|
<!-- TODO/FIXME Make a select component and use it for cross browser styling-->
|
|
1014
1039
|
<select @change=${this._handleSizeChange} .value=${String(this.pageSize)}>
|
|
1015
|
-
${this.pageSizeOptions.map(
|
|
1040
|
+
${this.pageSizeOptions.map(a=>A`<option .value=${String(a)} class=${String(a)===String(this.pageSize)?"selected":""}>${a}</option>`)}
|
|
1016
1041
|
</select>
|
|
1017
1042
|
</div>
|
|
1018
1043
|
${this.totalItems?A`
|
|
@@ -1022,30 +1047,38 @@ spectric-button{
|
|
|
1022
1047
|
${i}
|
|
1023
1048
|
</div>
|
|
1024
1049
|
<div>
|
|
1025
|
-
<spectric-button size=${this.size} ?disabled=${this.page===1} @click=${this._handlePageDown}><</spectric-button>
|
|
1026
|
-
<spectric-button size=${this.size} ?disabled=${s} @click=${this._handlePageUp}>></spectric-button>
|
|
1050
|
+
<spectric-button size=${this.size} ?disabled=${this.page===1} @click=${this._handlePageDown} icon><</spectric-button>
|
|
1051
|
+
<spectric-button size=${this.size} ?disabled=${s} @click=${this._handlePageUp} icon>></spectric-button>
|
|
1027
1052
|
</div>
|
|
1028
1053
|
</div>
|
|
1029
1054
|
`:null}
|
|
1030
1055
|
</div>
|
|
1031
|
-
`}},
|
|
1056
|
+
`}},_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),_e([v({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),_e([v({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=_e([L(Yr)],d.PaginationElement);var An=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,Kr=(o,r,s,i)=>{for(var a=i>1?void 0:i?xn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&An(r,s,a),a};const kn="spectric-table-header";let Ft=class extends P{constructor(){super(...arguments),this.columns=[]}createRenderRoot(){return this}render(){return A`
|
|
1032
1057
|
<tr>
|
|
1033
|
-
${this.columns.map(
|
|
1058
|
+
${this.columns.map(o=>{let r=["header-contents"];return o.filterable,A`<td><div class=${r.join(" ")}>${o.title||o.key}</div></td>`})}
|
|
1034
1059
|
</tr>
|
|
1035
|
-
`}};
|
|
1060
|
+
`}};Kr([v({type:Array,attribute:!1})],Ft.prototype,"columns",2),Ft=Kr([L(kn)],Ft);var En=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,ot=(o,r,s,i)=>{for(var a=i>1?void 0:i?Cn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&En(r,s,a),a};const Pn="spectric-table-cell";let Re=class extends P{constructor(){super(),this._handleFilterOut=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:o,column:this.column}}))},this._handleFilterFor=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:o,column:this.column}}))},this.styleRules=document.createElement("span").style}updated(o){Object.assign(this.td.style,this.styleRules)}createRenderRoot(){return this}render(){let o;this.column.render?o=this.column.render(this.row,this.table):this.column.key&&typeof this.row=="object"?o=this.row[this.column.key]:o=A`error`;let r=["cell-contents"];this.column.filterable&&r.push("filterable");let s=A`<div class="table-cell-actions">
|
|
1061
|
+
<spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
|
|
1062
|
+
<spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`;return this.styleRules={...this.styleRules,width:this.column.width?this.column.width+"px":"",whiteSpace:this.column.whiteSpace||""},A`
|
|
1036
1063
|
<td>
|
|
1037
1064
|
${this.column.filterable?s:null}
|
|
1038
|
-
<div class=${r.join(" ")}>${
|
|
1065
|
+
<div class=${r.join(" ")}>${o}</div>
|
|
1039
1066
|
</td>
|
|
1040
|
-
`}};
|
|
1067
|
+
`}};ot([v({type:Object,attribute:!1})],Re.prototype,"row",2),ot([v({type:Object,attribute:!1})],Re.prototype,"column",2),ot([be("td")],Re.prototype,"td",2),Re=ot([L(Pn)],Re);var Tn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,Qt=(o,r,s,i)=>{for(var a=i>1?void 0:i?On(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Tn(r,s,a),a};const Ln="spectric-table-body";let nt=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}render(){return A`
|
|
1041
1068
|
<body>
|
|
1042
|
-
${this.data.map(
|
|
1069
|
+
${this.data.map(o=>A`<tr>${this.columns.map(r=>A`<spectric-table-cell .column=${r} .row=${o} .columns=${this.columns}></spectric-table-cell>`)}</tr>`)}
|
|
1043
1070
|
</body>
|
|
1044
|
-
`}};
|
|
1071
|
+
`}};Qt([v({type:Array,attribute:!1})],nt.prototype,"data",2),Qt([v({type:Array,attribute:!1})],nt.prototype,"columns",2),nt=Qt([L(Ln)],nt);var Dn=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,we=(o,r,s,i)=>{for(var a=i>1?void 0:i?Nn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Dn(r,s,a),a};const Zr="spectric-table";d.TableElement=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[],this._handlePaginationChange=r=>{r.preventDefault(),r.stopPropagation(),this.pagination&&(this.pagination.size,this.pagination={...this.pagination,...r.detail}),this._emitChange()},this._emitChange=()=>{let{pagination:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:r}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter"))},this.selected=[],this._handleSelectAllChange=r=>{r.stopPropagation(),r.target.checked?this.selected=[...this.data]:this.selected=[],this.dispatchEvent(new CustomEvent("select",{detail:this.selected}))}}createRenderRoot(){return this}render(){let r=this.columns.filter(s=>!s.hidden);return this.select&&r.unshift({title:this.select==="multi"?A`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:s=>A`<spectric-input variant="checkbox" .checked=${this.selected.includes(s)} @change=${i=>{if(i.stopPropagation(),this.select==="single"&&(this.selected=[]),i.target.checked)this.selected.push(s),this.dispatchEvent(new CustomEvent("select",{detail:this.selected}));else{let a=this.selected.findIndex(e=>e===s);a!==-1&&(this.selected.splice(a,1),this.dispatchEvent(new CustomEvent("select",{detail:this.selected})))}}}></spectric-input>`}),A`
|
|
1045
1072
|
<div role="table">
|
|
1046
1073
|
<spectric-table-header .columns=${r}></spectric-table-header>
|
|
1047
1074
|
<spectric-table-body .columns=${r} .data=${this.data} .table=${this}></spectric-table-body>
|
|
1048
1075
|
</div>
|
|
1049
|
-
${this.pagination?A`<spectric-pagination ${
|
|
1050
|
-
`}},
|
|
1076
|
+
${this.pagination?A`<spectric-pagination ${tt(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
|
|
1077
|
+
`}},we([v({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),we([v({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),we([v({attribute:!1})],d.TableElement.prototype,"columns",2),we([v({type:String,reflect:!1})],d.TableElement.prototype,"select",2),we([ze()],d.TableElement.prototype,"selected",2),d.TableElement=we([L(Zr)],d.TableElement);var jn=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,re=(o,r,s,i)=>{for(var a=i>1?void 0:i?zn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&jn(r,s,a),a};const Xr="spectric-tooltip";var Gr=(o=>(o.top="top",o.bottom="bottom",o.left="left",o.right="right",o.mouse="mouse",o))(Gr||{});d.TooltipElement=class extends P{constructor(){super(...arguments),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalElement=document.createElement("div"),this.portalTarget=document.body,this.open=!1,this._getMousePosition=r=>{this.mouseLocation={left:r.clientX,top:r.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this._hideTooltip=()=>{this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()},this.showToolTip=async()=>{this.timer&&clearTimeout(this.timer),await new Promise(s=>{this.timer=window.setTimeout(s,this.delay)}),this.portalElement.style.pointerEvents="none",this.portalElement.className=`spectric-tooltip-portal ${this.position}`;const r=A`<div class="tooltip-container">
|
|
1078
|
+
<span class="tooltip-caret"></span>
|
|
1079
|
+
<div class="tooltip-content">${this.text}</div>
|
|
1080
|
+
</div>`;Ct(r,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))},this.applyStyle=r=>{Object.entries(r).forEach(([s,i])=>{this.portalElement.style.setProperty(s,i)})},this.positionTooltip=()=>{if(!this.target)return;let r=getComputedStyle(this),s={"--spectric-primary":r.getPropertyValue("--spectric-primary"),"--spectric-background-inverse":r.getPropertyValue("--spectric-background-inverse"),"--spectric-background-hover":r.getPropertyValue("--spectric-background-hover"),"--spectric-text-on-color":r.getPropertyValue("--spectric-text-on-color"),"--spectric-border-radius":r.getPropertyValue("--spectric-border-radius")};const i=this.target.getBoundingClientRect(),a=this.portalElement.getBoundingClientRect();if(this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(a.width=Math.min(a.width,this.maxWidth)),this.position==="mouse"&&this.mouseLocation){this.mouseframe=void 0;const e={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-a.height/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="top"){const e={top:i.top-a.height+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="bottom"){const e={top:i.bottom+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="left"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.left-a.width+"px"};this.applyStyle({...s,...e})}else if(this.position==="right"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.right+"px"};this.applyStyle({...s,...e})}this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})}}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback(),this.target&&(this.target.addEventListener("mousemove",this._getMousePosition),this.target.addEventListener("mouseover",this.showToolTip),this.target.addEventListener("mouseleave",this._hideTooltip))}disconnectedCallback(){var r,s,i;super.connectedCallback(),(r=this.target)==null||r.removeEventListener("mousemove",this._getMousePosition),(s=this.target)==null||s.removeEventListener("mouseover",this.showToolTip),(i=this.target)==null||i.removeEventListener("mouseleave",this._hideTooltip),this.portalElement.remove()}render(){}},d.TooltipElement.styles=R`:host{max-height: 0px;
|
|
1081
|
+
max-width: 0px;
|
|
1082
|
+
display: none;
|
|
1083
|
+
pointer-events:none;}`,re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"delay",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"animationDuration",2),re([v({type:String,reflect:!1})],d.TooltipElement.prototype,"text",2),re([v({type:String,reflect:!0})],d.TooltipElement.prototype,"position",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"maxWidth",2),re([v({attribute:!1})],d.TooltipElement.prototype,"portalTarget",2),re([v({attribute:!1})],d.TooltipElement.prototype,"triggerTarget",2),d.TooltipElement=re([L(Xr)],d.TooltipElement),d.ButtonSizes=Er,d.ButtonVariants=Cr,d.CSSPropsControls=bn,d.DialogElementTag=Mt,d.ElementTag=Vr,d.InputVariants=Nr,d.Orientations=Wr,d.PaginationElementTag=Yr,d.SupportedLanguages=Mr,d.TableElementTag=Zr,d.ThemeSelections=vn,d.TooltipElementTag=Xr,d.TooltipPostions=Gr,d.nodeTypes=K,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
1051
1084
|
//# sourceMappingURL=index.umd.js.map
|