@mochabug/adapt-sdk 0.2.7 → 0.2.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/dist/api/index.d.ts.map +1 -1
- package/dist/cjs/api.cjs +1 -1
- package/dist/cjs/api.cjs.map +3 -3
- package/dist/cjs/react.cjs +1 -1
- package/dist/cjs/react.cjs.map +3 -3
- package/dist/cjs/router.cjs +1 -1
- package/dist/cjs/router.cjs.map +3 -3
- package/dist/esm/api.mjs +1 -1
- package/dist/esm/api.mjs.map +3 -3
- package/dist/esm/react.mjs +1 -1
- package/dist/esm/react.mjs.map +3 -3
- package/dist/esm/router.mjs +1 -1
- package/dist/esm/router.mjs.map +3 -3
- package/dist/genproto/buf/validate/validate_pb.d.ts.map +1 -1
- package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.d.ts +272 -0
- package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.d.ts.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts +2 -2
- package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/signal_binding_pb.d.ts +4 -2
- package/dist/genproto/mochabugapis/adapt/graph/signal_binding_pb.d.ts.map +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/configurator_service_pb.d.ts +13 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/configurator_service_pb.d.ts.map +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/styles.css +20 -0
- package/package.json +2 -2
package/dist/esm/react.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as we,useRef as le,useEffect as Ne,useCallback as de,useMemo as he}from"react";function I(t){return Array.isArray?Array.isArray(t):Se(t)==="[object Array]"}var _e=1/0;function xe(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-_e?"-0":e}function $e(t){return t==null?"":xe(t)}function _(t){return typeof t=="string"}function Ce(t){return typeof t=="number"}function Re(t){return t===!0||t===!1||Ie(t)&&Se(t)=="[object Boolean]"}function ye(t){return typeof t=="object"}function Ie(t){return ye(t)&&t!==null}function M(t){return t!=null}function Y(t){return!t.trim().length}function Se(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}var Le="Incorrect 'index' type",Oe=t=>`Invalid value for key ${t}`,Te=t=>`Pattern length exceeds max of ${t}.`,je=t=>`Missing ${t} property in key`,Pe=t=>`Property 'weight' in key '${t}' must be a positive integer`,fe=Object.prototype.hasOwnProperty,Q=class{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(n=>{let i=Fe(n);this._keys.push(i),this._keyMap[i.id]=i,s+=i.weight}),this._keys.forEach(n=>{n.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Fe(t){let e=null,s=null,n=null,i=1,r=null;if(_(t)||I(t))n=t,e=me(t),s=X(t);else{if(!fe.call(t,"name"))throw new Error(je("name"));let o=t.name;if(n=o,fe.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(Pe(o));e=me(o),s=X(o),r=t.getFn}return{path:e,id:s,weight:i,src:n,getFn:r}}function me(t){return I(t)?t:t.split(".")}function X(t){return I(t)?t.join("."):t}function Ke(t,e){let s=[],n=!1,i=(r,o,a)=>{if(M(r))if(!o[a])s.push(r);else{let c=o[a],u=r[c];if(!M(u))return;if(a===o.length-1&&(_(u)||Ce(u)||Re(u)))s.push($e(u));else if(I(u)){n=!0;for(let l=0,h=u.length;l<h;l+=1)i(u[l],o,a+1)}else o.length&&i(u,o,a+1)}};return i(t,_(e)?e.split("."):e,0),n?s:s[0]}var He={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Je={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},ze={location:0,threshold:.6,distance:100},Ve={useExtendedSearch:!1,getFn:Ke,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},d={...Je,...He,...ze,...Ve},We=/[^ ]+/g;function Ue(t=1,e=3){let s=new Map,n=Math.pow(10,e);return{get(i){let r=i.match(We).length;if(s.has(r))return s.get(r);let o=1/Math.pow(r,.5*t),a=parseFloat(Math.round(o*n)/n);return s.set(r,a),a},clear(){s.clear()}}}var K=class{constructor({getFn:e=d.getFn,fieldNormWeight:s=d.fieldNormWeight}={}){this.norm=Ue(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,_(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){let s=this.size();_(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!M(e)||Y(e))return;let n={v:e,i:s,n:this.norm.get(e)};this.records.push(n)}_addObject(e,s){let n={i:s,$:{}};this.keys.forEach((i,r)=>{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(M(o)){if(I(o)){let a=[],c=[{nestedArrIndex:-1,value:o}];for(;c.length;){let{nestedArrIndex:u,value:l}=c.pop();if(M(l))if(_(l)&&!Y(l)){let h={v:l,i:u,n:this.norm.get(l)};a.push(h)}else I(l)&&l.forEach((h,g)=>{c.push({nestedArrIndex:g,value:h})})}n.$[r]=a}else if(_(o)&&!Y(o)){let a={v:o,n:this.norm.get(o)};n.$[r]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function Me(t,e,{getFn:s=d.getFn,fieldNormWeight:n=d.fieldNormWeight}={}){let i=new K({getFn:s,fieldNormWeight:n});return i.setKeys(t.map(Fe)),i.setSources(e),i.create(),i}function Ge(t,{getFn:e=d.getFn,fieldNormWeight:s=d.fieldNormWeight}={}){let{keys:n,records:i}=t,r=new K({getFn:e,fieldNormWeight:s});return r.setKeys(n),r.setIndexRecords(i),r}function J(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:i=d.distance,ignoreLocation:r=d.ignoreLocation}={}){let o=e/t.length;if(r)return o;let a=Math.abs(n-s);return i?o+a/i:a?1:o}function Ye(t=[],e=d.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let o=t.length;r<o;r+=1){let a=t[r];a&&n===-1?n=r:!a&&n!==-1&&(i=r-1,i-n+1>=e&&s.push([n,i]),n=-1)}return t[r-1]&&r-n>=e&&s.push([n,r-1]),s}var T=32;function Qe(t,e,s,{location:n=d.location,distance:i=d.distance,threshold:r=d.threshold,findAllMatches:o=d.findAllMatches,minMatchCharLength:a=d.minMatchCharLength,includeMatches:c=d.includeMatches,ignoreLocation:u=d.ignoreLocation}={}){if(e.length>T)throw new Error(Te(T));let l=e.length,h=t.length,g=Math.max(0,Math.min(n,h)),f=r,m=g,D=a>1||c,y=D?Array(h):[],S;for(;(S=t.indexOf(e,m))>-1;){let C=J(e,{currentLocation:S,expectedLocation:g,distance:i,ignoreLocation:u});if(f=Math.min(C,f),m=S+l,D){let k=0;for(;k<l;)y[S+k]=1,k+=1}}m=-1;let F=[],w=1,N=l+h,j=1<<l-1;for(let C=0;C<l;C+=1){let k=0,B=N;for(;k<B;)J(e,{errors:C,currentLocation:g+B,expectedLocation:g,distance:i,ignoreLocation:u})<=f?k=B:N=B,B=Math.floor((N-k)/2+k);N=B;let H=Math.max(1,g-B+1),P=o?h:Math.min(g+B,h)+l,R=Array(P+2);R[P+1]=(1<<C)-1;for(let E=P;E>=H;E-=1){let v=E-1,O=s[t.charAt(v)];if(D&&(y[v]=+!!O),R[E]=(R[E+1]<<1|1)&O,C&&(R[E]|=(F[E+1]|F[E])<<1|1|F[E+1]),R[E]&j&&(w=J(e,{errors:C,currentLocation:v,expectedLocation:g,distance:i,ignoreLocation:u}),w<=f)){if(f=w,m=v,m<=g)break;H=Math.max(1,2*g-m)}}if(J(e,{errors:C+1,currentLocation:g,expectedLocation:g,distance:i,ignoreLocation:u})>f)break;F=R}let $={isMatch:m>=0,score:Math.max(.001,w)};if(D){let C=Ye(y,a);C.length?c&&($.indices=C):$.isMatch=!1}return $}function Xe(t){let e={};for(let s=0,n=t.length;s<n;s+=1){let i=t.charAt(s);e[i]=(e[i]||0)|1<<n-s-1}return e}var z=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t),V=class{constructor(e,{location:s=d.location,threshold:n=d.threshold,distance:i=d.distance,includeMatches:r=d.includeMatches,findAllMatches:o=d.findAllMatches,minMatchCharLength:a=d.minMatchCharLength,isCaseSensitive:c=d.isCaseSensitive,ignoreDiacritics:u=d.ignoreDiacritics,ignoreLocation:l=d.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l},e=c?e:e.toLowerCase(),e=u?z(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let h=(f,m)=>{this.chunks.push({pattern:f,alphabet:Xe(f),startIndex:m})},g=this.pattern.length;if(g>T){let f=0,m=g%T,D=g-m;for(;f<D;)h(this.pattern.substr(f,T),f),f+=T;if(m){let y=g-T;h(this.pattern.substr(y),y)}}else h(this.pattern,0)}searchIn(e){let{isCaseSensitive:s,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=s?e:e.toLowerCase(),e=n?z(e):e,this.pattern===e){let D={isMatch:!0,score:0};return i&&(D.indices=[[0,e.length-1]]),D}let{location:r,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:u,ignoreLocation:l}=this.options,h=[],g=0,f=!1;this.chunks.forEach(({pattern:D,alphabet:y,startIndex:S})=>{let{isMatch:F,score:w,indices:N}=Qe(e,D,y,{location:r+S,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:u,includeMatches:i,ignoreLocation:l});F&&(f=!0),g+=w,F&&N&&(h=[...h,...N])});let m={isMatch:f,score:f?g/this.chunks.length:1};return f&&i&&(m.indices=h),m}},x=class{constructor(e){this.pattern=e}static isMultiMatch(e){return Ae(e,this.multiRegex)}static isSingleMatch(e){return Ae(e,this.singleRegex)}search(){}};function Ae(t,e){let s=t.match(e);return s?s[1]:null}var Z=class extends x{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},q=class extends x{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}},ee=class extends x{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},te=class extends x{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},se=class extends x{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},ne=class extends x{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},W=class extends x{constructor(e,{location:s=d.location,threshold:n=d.threshold,distance:i=d.distance,includeMatches:r=d.includeMatches,findAllMatches:o=d.findAllMatches,minMatchCharLength:a=d.minMatchCharLength,isCaseSensitive:c=d.isCaseSensitive,ignoreDiacritics:u=d.ignoreDiacritics,ignoreLocation:l=d.ignoreLocation}={}){super(e),this._bitapSearch=new V(e,{location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},U=class extends x{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,n,i=[],r=this.pattern.length;for(;(n=e.indexOf(this.pattern,s))>-1;)s=n+r,i.push([n,s-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},ie=[Z,U,ee,te,ne,se,q,W],Ee=ie.length,Ze=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,qe="|";function et(t,e={}){return t.split(qe).map(s=>{let n=s.trim().split(Ze).filter(r=>r&&!!r.trim()),i=[];for(let r=0,o=n.length;r<o;r+=1){let a=n[r],c=!1,u=-1;for(;!c&&++u<Ee;){let l=ie[u],h=l.isMultiMatch(a);h&&(i.push(new l(h,e)),c=!0)}if(!c)for(u=-1;++u<Ee;){let l=ie[u],h=l.isSingleMatch(a);if(h){i.push(new l(h,e));break}}}return i})}var tt=new Set([W.type,U.type]),re=class{constructor(e,{isCaseSensitive:s=d.isCaseSensitive,ignoreDiacritics:n=d.ignoreDiacritics,includeMatches:i=d.includeMatches,minMatchCharLength:r=d.minMatchCharLength,ignoreLocation:o=d.ignoreLocation,findAllMatches:a=d.findAllMatches,location:c=d.location,threshold:u=d.threshold,distance:l=d.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:r,findAllMatches:a,ignoreLocation:o,location:c,threshold:u,distance:l},e=s?e:e.toLowerCase(),e=n?z(e):e,this.pattern=e,this.query=et(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){let s=this.query;if(!s)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:r}=this.options;e=i?e:e.toLowerCase(),e=r?z(e):e;let o=0,a=[],c=0;for(let u=0,l=s.length;u<l;u+=1){let h=s[u];a.length=0,o=0;for(let g=0,f=h.length;g<f;g+=1){let m=h[g],{isMatch:D,indices:y,score:S}=m.search(e);if(D){if(o+=1,c+=S,n){let F=m.constructor.type;tt.has(F)?a=[...a,...y]:a.push(y)}}else{c=0,o=0,a.length=0;break}}if(o){let g={isMatch:!0,score:c/o};return n&&(g.indices=a),g}}return{isMatch:!1,score:1}}},oe=[];function st(...t){oe.push(...t)}function ae(t,e){for(let s=0,n=oe.length;s<n;s+=1){let i=oe[s];if(i.condition(t,e))return new i(t,e)}return new V(t,e)}var G={AND:"$and",OR:"$or"},ce={PATH:"$path",PATTERN:"$val"},ue=t=>!!(t[G.AND]||t[G.OR]),nt=t=>!!t[ce.PATH],it=t=>!I(t)&&ye(t)&&!ue(t),De=t=>({[G.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Be(t,e,{auto:s=!0}={}){let n=i=>{let r=Object.keys(i),o=nt(i);if(!o&&r.length>1&&!ue(i))return n(De(i));if(it(i)){let c=o?i[ce.PATH]:r[0],u=o?i[ce.PATTERN]:i[c];if(!_(u))throw new Error(Oe(c));let l={keyId:X(c),pattern:u};return s&&(l.searcher=ae(u,e)),l}let a={children:[],operator:r[0]};return r.forEach(c=>{let u=i[c];I(u)&&u.forEach(l=>{a.children.push(n(l))})}),a};return ue(t)||(t=De(t)),n(t)}function rt(t,{ignoreFieldNorm:e=d.ignoreFieldNorm}){t.forEach(s=>{let n=1;s.matches.forEach(({key:i,norm:r,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),s.score=n})}function ot(t,e){let s=t.matches;e.matches=[],M(s)&&s.forEach(n=>{if(!M(n.indices)||!n.indices.length)return;let{indices:i,value:r}=n,o={indices:i,value:r};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function at(t,e){e.score=t.score}function ct(t,e,{includeMatches:s=d.includeMatches,includeScore:n=d.includeScore}={}){let i=[];return s&&i.push(ot),n&&i.push(at),t.map(r=>{let{idx:o}=r,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(r,a)}),a})}var L=class{constructor(e,s={},n){this.options={...d,...s},this.options.useExtendedSearch,this._keyStore=new Q(this.options.keys),this.setCollection(e,n)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof K))throw new Error(Le);this._myIndex=s||Me(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){M(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let s=[];for(let n=0,i=this._docs.length;n<i;n+=1){let r=this._docs[n];e(r,n)&&(this.removeAt(n),n-=1,i-=1,s.push(r))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:r,sortFn:o,ignoreFieldNorm:a}=this.options,c=_(e)?_(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return rt(c,{ignoreFieldNorm:a}),r&&c.sort(o),Ce(s)&&s>-1&&(c=c.slice(0,s)),ct(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){let s=ae(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:u,indices:l}=s.searchIn(r);c&&i.push({item:r,idx:o,matches:[{score:u,value:r,norm:a,indices:l}]})}),i}_searchLogical(e){let s=Be(e,this.options),n=(a,c,u)=>{if(!a.children){let{keyId:h,searcher:g}=a,f=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:g});return f&&f.length?[{idx:u,item:c,matches:f}]:[]}let l=[];for(let h=0,g=a.children.length;h<g;h+=1){let f=a.children[h],m=n(f,c,u);if(m.length)l.push(...m);else if(a.operator===G.AND)return[]}return l},i=this._myIndex.records,r={},o=[];return i.forEach(({$:a,i:c})=>{if(M(a)){let u=n(s,a,c);u.length&&(r[c]||(r[c]={idx:c,item:a,matches:[]},o.push(r[c])),u.forEach(({matches:l})=>{r[c].matches.push(...l)}))}}),o}_searchObjectList(e){let s=ae(e,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach(({$:o,i:a})=>{if(!M(o))return;let c=[];n.forEach((u,l)=>{c.push(...this._findMatches({key:u,value:o[l],searcher:s}))}),c.length&&r.push({idx:a,item:o,matches:c})}),r}_findMatches({key:e,value:s,searcher:n}){if(!M(s))return[];let i=[];if(I(s))s.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:u,indices:l}=n.searchIn(r);c&&i.push({score:u,key:e,value:r,idx:o,norm:a,indices:l})});else{let{v:r,n:o}=s,{isMatch:a,score:c,indices:u}=n.searchIn(r);a&&i.push({score:c,key:e,value:r,norm:o,indices:u})}return i}};L.version="7.1.0";L.createIndex=Me;L.parseIndex=Ge;L.config=d;L.parseQuery=Be;st(re);import{jsx as A,jsxs as b}from"react/jsx-runtime";function ge(t){return t.type?!(Array.isArray(t.enum)&&t.enum.length>0)&&!t.elements&&!(t.properties&&Object.keys(t.properties).length>0)&&!(t.optionalProperties&&Object.keys(t.optionalProperties).length>0)&&!t.values&&!t.discriminator&&!t.ref:!1}function ut(t){return!t.type&&!t.enum&&!t.elements&&!t.properties&&!t.optionalProperties&&!t.values&&!t.discriminator&&!t.ref}function Ct(t){return t.elements!==void 0}function lt(t){return ge(t)?t.type:t.enum?`enum (${t.enum.length} values)`:t.elements?"array":t.properties||t.optionalProperties?`object (${(t.properties?Object.keys(t.properties).length:0)+(t.optionalProperties?Object.keys(t.optionalProperties).length:0)} properties)`:t.values?"map":t.discriminator?"discriminated union":t.ref?`ref: ${t.ref}`:ut(t)?"empty schema":"complex schema"}function dt(t){return t.mimeType?t.mimeType:t.jtdSchema?lt(t.jtdSchema):"unknown"}var ve=class{fuse;data;constructor(e){this.fuse=new L(e,{includeScore:!1,threshold:.3,ignoreLocation:!0,useExtendedSearch:!0,keys:[{name:"node",weight:5},{name:"nodeLabel",weight:5},{name:"nodeDescription",weight:2},{name:"transmitter",weight:5},{name:"transmitterDescription",weight:2},{name:"signal.name",weight:5},{name:"signal.label",weight:5},{name:"signal.description",weight:2}]}),this.data=e}search(e){if(!e||e.trim().length===0)return this.fuse.search("").map(i=>i.item);if(!e.includes("/"))return this.fuse.search(e).map(i=>i.item);let s=e.split("/"),n="";return s.length===2&&s[1]===""&&s[0]?n={$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]}:s.length===2&&s[0]&&s[1]?n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length===3&&s[2]===""&&s[0]&&s[1]?n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length>=3&&s[0]&&s[1]&&s[2]&&(n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]},{$or:[{"signal.name":s[2]},{"signal.label":s[2]},{"signal.description":s[2]}]}]}),this.fuse.search(n).map(i=>i.item)}allSignals(){return this.data}};function yt(t){return(e,s)=>!s||s.length<2?e:t.search(s).sort((i,r)=>{let o=`${i.node}/${i.transmitter}`,a=`${r.node}/${r.transmitter}`;return o.localeCompare(a)})}function St(t){let e=[];for(let s of t.vertices??[])for(let n of s.transmitters??[])for(let i of n.signals??[])e.push({node:s.id??"",nodeLabel:s.label??s.id??"",nodeDescription:s.description,nodeLogoId:s.logoId,transmitter:n.name??"",transmitterDescription:n.description,transmitterMode:n.mode,signal:i});return e}function pe(t){return`${t.node}/${t.transmitter}/${t.signal.name}`}function ht(t){let[e,s]=t.group.split("/"),n=t.references.find(o=>`${o.node}/${o.transmitter}`===t.group);if(!n)return null;let i=n.transmitterMode,r=i==="MODE_FAILURE"?"adapt-signal-group-transmitter--failure":i==="MODE_STREAM"?"adapt-signal-group-transmitter--stream":"adapt-signal-group-transmitter--standard";return b("div",{className:`adapt-signal-group-header ${t.className??""}`.trim(),children:[n.nodeIcon&&A("span",{className:"adapt-signal-group-icon",children:n.nodeIcon}),A("span",{className:"adapt-signal-group-node-label",children:n.nodeLabel||e}),b("span",{className:"adapt-signal-group-node-id",children:["(",e,")"]}),A("span",{className:"adapt-signal-group-separator"}),A("span",{className:`adapt-signal-group-transmitter ${r}`,children:s})]})}function pt(t){let{reference:e}=t;return b("div",{className:`adapt-signal-option ${t.className??""}`.trim(),children:[b("div",{className:"adapt-signal-option-label",children:[A("span",{className:"adapt-signal-option-name",children:e.signal.label||e.signal.name}),e.signal.label&&b("span",{className:"adapt-signal-option-code",children:["(",e.signal.name,")"]}),e.signal.optional&&A("span",{className:"adapt-signal-option-optional",children:"Optional"})]}),e.signal.formats&&A(ft,{formats:e.signal.formats})]})}function gt(t){let{format:e,size:s="small",onDelete:n,onClick:i}=t,r=dt(e),o="primitive";e.mimeType?o="mime":e.jtdSchema&&!ge(e.jtdSchema)&&(o="complex");let a=o==="mime"||o==="complex";return b("span",{className:`adapt-signal-format-chip adapt-signal-format-chip--${o} ${s==="medium"?"adapt-signal-format-chip--medium":""} ${t.className??""}`.trim(),onClick:i&&a?u=>{u.stopPropagation(),i()}:void 0,children:[r,n&&A("span",{className:"adapt-signal-format-chip-delete",onClick:u=>{u.stopPropagation(),n()},children:"\xD7"})]})}function ft(t){let{formats:e,maxVisible:s=3,onViewSchema:n}=t;if(e.length===0)return A("span",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:"No formats defined"});let i=[],r=0;for(let a=0;a<e.length;a++){let c=e[a];c&&(!c.mimeType&&!c.jtdSchema||(r++,i.length<s&&i.push(A(gt,{format:c,onClick:n&&c.jtdSchema&&!ge(c.jtdSchema)?()=>n(c.jtdSchema):void 0},`fmt-${a}`))))}let o=r-i.length;return b("div",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:[i,o>0&&b("span",{className:"adapt-signal-format-overflow",children:["+",o]})]})}function Ft({currentReference:t,inputValue:e,availableReferences:s,filterOptions:n,disabled:i,hasError:r,errorMessage:o,placeholder:a="Search signals...",className:c,theme:u="auto",onInputChange:l,onReferenceChange:h}){let[g,f]=we(!1),[m,D]=we(-1),y=le(null),S=le(null),F=le(null),w=de(()=>{h(null),l(""),f(!0),D(0),setTimeout(()=>S.current?.focus(),0)},[h,l]),N=he(()=>{let p=[...s];return n(p,e)},[s,e,n]),j=he(()=>{let p=new Map;for(let E of N){let v=`${E.node}/${E.transmitter}`,O=p.get(v);O?O.push(E):p.set(v,[E])}return p},[N]),$=he(()=>{let p=[];for(let E of j.values())p.push(...E);return p},[j]);Ne(()=>{function p(E){y.current&&!y.current.contains(E.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);let C=de(p=>{h(pe(p)),l(pe(p)),f(!1)},[h,l]),k=de(p=>{if(t){if(p.key==="Backspace"||p.key==="Delete"){p.preventDefault(),w();return}if(p.key==="ArrowDown"||p.key==="ArrowUp"||p.key==="Enter"){p.preventDefault(),h(null),l(""),f(!0),D(0),setTimeout(()=>S.current?.focus(),0);return}if(p.key.length===1&&!p.ctrlKey&&!p.metaKey){p.preventDefault(),h(null),l(p.key),f(!0),D(0),setTimeout(()=>S.current?.focus(),0);return}return}p.key==="ArrowDown"?(p.preventDefault(),g?D(E=>Math.min(E+1,$.length-1)):(f(!0),D(0))):p.key==="ArrowUp"?(p.preventDefault(),D(E=>Math.max(E-1,0))):p.key==="Enter"?(p.preventDefault(),g&&m>=0&&$[m]&&C($[m])):p.key==="Escape"&&f(!1)},[t,w,h,l,g,m,$,C]);Ne(()=>{F.current&&m>=0&&F.current.querySelectorAll("[data-signal-option]")[m]?.scrollIntoView({block:"nearest"})},[m]);let B=[],H=0;for(let[p,E]of j){B.push(A(ht,{group:p,references:N},`group-${p}`));for(let v of E){let O=H++,be=O===m;B.push(A("div",{"data-signal-option":!0,className:`adapt-signal-selector-option ${be?"adapt-signal-selector-option--highlighted":""}`,onMouseDown:ke=>{ke.preventDefault(),C(v)},onMouseEnter:()=>D(O),children:A(pt,{reference:v})},pe(v)))}}let P=["adapt-signal-selector",r&&"adapt-signal-selector--error",c].filter(Boolean).join(" "),R=t?t.transmitterMode==="MODE_FAILURE"?"adapt-signal-selector-selected-dot--failure":t.transmitterMode==="MODE_STREAM"?"adapt-signal-selector-selected-dot--stream":"adapt-signal-selector-selected-dot--standard":"";return b("div",{ref:y,className:P,"data-adapt-theme":u==="auto"?void 0:u,children:[t&&!i&&b("div",{className:"adapt-signal-selector-selected",onClick:w,children:[A("span",{className:`adapt-signal-selector-selected-dot ${R}`}),t.nodeIcon&&A("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon}),A("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),A("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),A("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name}),A("span",{className:"adapt-signal-selector-selected-clear",onClick:p=>{p.stopPropagation(),w()},children:"\xD7"})]}),t&&i&&b("div",{className:"adapt-signal-selector-selected adapt-signal-selector-selected--disabled",children:[A("span",{className:`adapt-signal-selector-selected-dot ${R}`}),t.nodeIcon&&A("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon}),A("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),A("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),A("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name})]}),A("input",{ref:S,type:"text",className:`adapt-signal-selector-input${t?" adapt-signal-selector-input--hidden":""}`,value:e,placeholder:a,disabled:i,onChange:p=>{l(p.target.value),f(!0),D(0),p.target.value||h(null)},onFocus:()=>{t||f(!0)},onKeyDown:k}),o&&A("span",{className:"adapt-signal-selector-error",children:o}),g&&!i&&A("div",{ref:F,className:"adapt-signal-selector-dropdown",children:$.length>0?B:A("div",{className:"adapt-signal-selector-no-results",children:"No signals found"})})]})}export{gt as FormatChip,ft as FormatViewer,ht as SignalGroupHeader,pt as SignalOption,ve as SignalSearch,Ft as SignalSelector,yt as createSignalFilter,St as flattenSignals,dt as getFormatLabel,lt as getSchemaDescription,Ct as isArraySchema,ut as isEmptySchema,ge as isPrimitiveSchema,pe as signalReferenceKey};
|
|
1
|
+
import{useState as Ne,useRef as de,useEffect as be,useCallback as he,useMemo as pe}from"react";function R(t){return Array.isArray?Array.isArray(t):Fe(t)==="[object Array]"}var Ie=1/0;function Re(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-Ie?"-0":e}function Le(t){return t==null?"":Re(t)}function $(t){return typeof t=="string"}function Se(t){return typeof t=="number"}function Oe(t){return t===!0||t===!1||Te(t)&&Fe(t)=="[object Boolean]"}function ve(t){return typeof t=="object"}function Te(t){return ve(t)&&t!==null}function M(t){return t!=null}function Q(t){return!t.trim().length}function Fe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}var je="Incorrect 'index' type",Pe=t=>`Invalid value for key ${t}`,Ke=t=>`Pattern length exceeds max of ${t}.`,He=t=>`Missing ${t} property in key`,Ve=t=>`Property 'weight' in key '${t}' must be a positive integer`,Ae=Object.prototype.hasOwnProperty,X=class{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(n=>{let i=Me(n);this._keys.push(i),this._keyMap[i.id]=i,s+=i.weight}),this._keys.forEach(n=>{n.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Me(t){let e=null,s=null,n=null,i=1,r=null;if($(t)||R(t))n=t,e=Ee(t),s=Z(t);else{if(!Ae.call(t,"name"))throw new Error(He("name"));let o=t.name;if(n=o,Ae.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(Ve(o));e=Ee(o),s=Z(o),r=t.getFn}return{path:e,id:s,weight:i,src:n,getFn:r}}function Ee(t){return R(t)?t:t.split(".")}function Z(t){return R(t)?t.join("."):t}function ze(t,e){let s=[],n=!1,i=(r,o,a)=>{if(M(r))if(!o[a])s.push(r);else{let c=o[a],l=r[c];if(!M(l))return;if(a===o.length-1&&($(l)||Se(l)||Oe(l)))s.push(Le(l));else if(R(l)){n=!0;for(let u=0,p=l.length;u<p;u+=1)i(l[u],o,a+1)}else o.length&&i(l,o,a+1)}};return i(t,$(e)?e.split("."):e,0),n?s:s[0]}var Je={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},We={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},Ge={location:0,threshold:.6,distance:100},Ue={useExtendedSearch:!1,getFn:ze,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},h={...We,...Je,...Ge,...Ue},Ye=/[^ ]+/g;function Qe(t=1,e=3){let s=new Map,n=Math.pow(10,e);return{get(i){let r=i.match(Ye).length;if(s.has(r))return s.get(r);let o=1/Math.pow(r,.5*t),a=parseFloat(Math.round(o*n)/n);return s.set(r,a),a},clear(){s.clear()}}}var K=class{constructor({getFn:e=h.getFn,fieldNormWeight:s=h.fieldNormWeight}={}){this.norm=Qe(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,$(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){let s=this.size();$(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!M(e)||Q(e))return;let n={v:e,i:s,n:this.norm.get(e)};this.records.push(n)}_addObject(e,s){let n={i:s,$:{}};this.keys.forEach((i,r)=>{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(M(o)){if(R(o)){let a=[],c=[{nestedArrIndex:-1,value:o}];for(;c.length;){let{nestedArrIndex:l,value:u}=c.pop();if(M(u))if($(u)&&!Q(u)){let p={v:u,i:l,n:this.norm.get(u)};a.push(p)}else R(u)&&u.forEach((p,g)=>{c.push({nestedArrIndex:g,value:p})})}n.$[r]=a}else if($(o)&&!Q(o)){let a={v:o,n:this.norm.get(o)};n.$[r]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function Be(t,e,{getFn:s=h.getFn,fieldNormWeight:n=h.fieldNormWeight}={}){let i=new K({getFn:s,fieldNormWeight:n});return i.setKeys(t.map(Me)),i.setSources(e),i.create(),i}function Xe(t,{getFn:e=h.getFn,fieldNormWeight:s=h.fieldNormWeight}={}){let{keys:n,records:i}=t,r=new K({getFn:e,fieldNormWeight:s});return r.setKeys(n),r.setIndexRecords(i),r}function V(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:i=h.distance,ignoreLocation:r=h.ignoreLocation}={}){let o=e/t.length;if(r)return o;let a=Math.abs(n-s);return i?o+a/i:a?1:o}function Ze(t=[],e=h.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let o=t.length;r<o;r+=1){let a=t[r];a&&n===-1?n=r:!a&&n!==-1&&(i=r-1,i-n+1>=e&&s.push([n,i]),n=-1)}return t[r-1]&&r-n>=e&&s.push([n,r-1]),s}var O=32;function qe(t,e,s,{location:n=h.location,distance:i=h.distance,threshold:r=h.threshold,findAllMatches:o=h.findAllMatches,minMatchCharLength:a=h.minMatchCharLength,includeMatches:c=h.includeMatches,ignoreLocation:l=h.ignoreLocation}={}){if(e.length>O)throw new Error(Ke(O));let u=e.length,p=t.length,g=Math.max(0,Math.min(n,p)),f=r,A=g,E=a>1||c,y=E?Array(p):[],v;for(;(v=t.indexOf(e,A))>-1;){let D=V(e,{currentLocation:v,expectedLocation:g,distance:i,ignoreLocation:l});if(f=Math.min(D,f),A=v+u,E){let b=0;for(;b<u;)y[v+b]=1,b+=1}}A=-1;let F=[],w=1,N=u+p,T=1<<u-1;for(let D=0;D<u;D+=1){let b=0,B=N;for(;b<B;)V(e,{errors:D,currentLocation:g+B,expectedLocation:g,distance:i,ignoreLocation:l})<=f?b=B:N=B,B=Math.floor((N-b)/2+b);N=B;let H=Math.max(1,g-B+1),j=o?p:Math.min(g+B,p)+u,k=Array(j+2);k[j+1]=(1<<D)-1;for(let d=j;d>=H;d-=1){let C=d-1,I=s[t.charAt(C)];if(E&&(y[C]=+!!I),k[d]=(k[d+1]<<1|1)&I,D&&(k[d]|=(F[d+1]|F[d])<<1|1|F[d+1]),k[d]&T&&(w=V(e,{errors:D,currentLocation:C,expectedLocation:g,distance:i,ignoreLocation:l}),w<=f)){if(f=w,A=C,A<=g)break;H=Math.max(1,2*g-A)}}if(V(e,{errors:D+1,currentLocation:g,expectedLocation:g,distance:i,ignoreLocation:l})>f)break;F=k}let _={isMatch:A>=0,score:Math.max(.001,w)};if(E){let D=Ze(y,a);D.length?c&&(_.indices=D):_.isMatch=!1}return _}function et(t){let e={};for(let s=0,n=t.length;s<n;s+=1){let i=t.charAt(s);e[i]=(e[i]||0)|1<<n-s-1}return e}var z=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t),J=class{constructor(e,{location:s=h.location,threshold:n=h.threshold,distance:i=h.distance,includeMatches:r=h.includeMatches,findAllMatches:o=h.findAllMatches,minMatchCharLength:a=h.minMatchCharLength,isCaseSensitive:c=h.isCaseSensitive,ignoreDiacritics:l=h.ignoreDiacritics,ignoreLocation:u=h.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:l,ignoreLocation:u},e=c?e:e.toLowerCase(),e=l?z(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let p=(f,A)=>{this.chunks.push({pattern:f,alphabet:et(f),startIndex:A})},g=this.pattern.length;if(g>O){let f=0,A=g%O,E=g-A;for(;f<E;)p(this.pattern.substr(f,O),f),f+=O;if(A){let y=g-O;p(this.pattern.substr(y),y)}}else p(this.pattern,0)}searchIn(e){let{isCaseSensitive:s,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=s?e:e.toLowerCase(),e=n?z(e):e,this.pattern===e){let E={isMatch:!0,score:0};return i&&(E.indices=[[0,e.length-1]]),E}let{location:r,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:l,ignoreLocation:u}=this.options,p=[],g=0,f=!1;this.chunks.forEach(({pattern:E,alphabet:y,startIndex:v})=>{let{isMatch:F,score:w,indices:N}=qe(e,E,y,{location:r+v,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:l,includeMatches:i,ignoreLocation:u});F&&(f=!0),g+=w,F&&N&&(p=[...p,...N])});let A={isMatch:f,score:f?g/this.chunks.length:1};return f&&i&&(A.indices=p),A}},x=class{constructor(e){this.pattern=e}static isMultiMatch(e){return Ce(e,this.multiRegex)}static isSingleMatch(e){return Ce(e,this.singleRegex)}search(){}};function Ce(t,e){let s=t.match(e);return s?s[1]:null}var q=class extends x{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},ee=class extends x{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}},te=class extends x{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},se=class extends x{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},ne=class extends x{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},ie=class extends x{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},W=class extends x{constructor(e,{location:s=h.location,threshold:n=h.threshold,distance:i=h.distance,includeMatches:r=h.includeMatches,findAllMatches:o=h.findAllMatches,minMatchCharLength:a=h.minMatchCharLength,isCaseSensitive:c=h.isCaseSensitive,ignoreDiacritics:l=h.ignoreDiacritics,ignoreLocation:u=h.ignoreLocation}={}){super(e),this._bitapSearch=new J(e,{location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:l,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},G=class extends x{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,n,i=[],r=this.pattern.length;for(;(n=e.indexOf(this.pattern,s))>-1;)s=n+r,i.push([n,s-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},re=[q,G,te,se,ie,ne,ee,W],De=re.length,tt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,st="|";function nt(t,e={}){return t.split(st).map(s=>{let n=s.trim().split(tt).filter(r=>r&&!!r.trim()),i=[];for(let r=0,o=n.length;r<o;r+=1){let a=n[r],c=!1,l=-1;for(;!c&&++l<De;){let u=re[l],p=u.isMultiMatch(a);p&&(i.push(new u(p,e)),c=!0)}if(!c)for(l=-1;++l<De;){let u=re[l],p=u.isSingleMatch(a);if(p){i.push(new u(p,e));break}}}return i})}var it=new Set([W.type,G.type]),oe=class{constructor(e,{isCaseSensitive:s=h.isCaseSensitive,ignoreDiacritics:n=h.ignoreDiacritics,includeMatches:i=h.includeMatches,minMatchCharLength:r=h.minMatchCharLength,ignoreLocation:o=h.ignoreLocation,findAllMatches:a=h.findAllMatches,location:c=h.location,threshold:l=h.threshold,distance:u=h.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:r,findAllMatches:a,ignoreLocation:o,location:c,threshold:l,distance:u},e=s?e:e.toLowerCase(),e=n?z(e):e,this.pattern=e,this.query=nt(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){let s=this.query;if(!s)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:r}=this.options;e=i?e:e.toLowerCase(),e=r?z(e):e;let o=0,a=[],c=0;for(let l=0,u=s.length;l<u;l+=1){let p=s[l];a.length=0,o=0;for(let g=0,f=p.length;g<f;g+=1){let A=p[g],{isMatch:E,indices:y,score:v}=A.search(e);if(E){if(o+=1,c+=v,n){let F=A.constructor.type;it.has(F)?a=[...a,...y]:a.push(y)}}else{c=0,o=0,a.length=0;break}}if(o){let g={isMatch:!0,score:c/o};return n&&(g.indices=a),g}}return{isMatch:!1,score:1}}},ae=[];function rt(...t){ae.push(...t)}function ce(t,e){for(let s=0,n=ae.length;s<n;s+=1){let i=ae[s];if(i.condition(t,e))return new i(t,e)}return new J(t,e)}var U={AND:"$and",OR:"$or"},le={PATH:"$path",PATTERN:"$val"},ue=t=>!!(t[U.AND]||t[U.OR]),ot=t=>!!t[le.PATH],at=t=>!R(t)&&ve(t)&&!ue(t),ye=t=>({[U.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function we(t,e,{auto:s=!0}={}){let n=i=>{let r=Object.keys(i),o=ot(i);if(!o&&r.length>1&&!ue(i))return n(ye(i));if(at(i)){let c=o?i[le.PATH]:r[0],l=o?i[le.PATTERN]:i[c];if(!$(l))throw new Error(Pe(c));let u={keyId:Z(c),pattern:l};return s&&(u.searcher=ce(l,e)),u}let a={children:[],operator:r[0]};return r.forEach(c=>{let l=i[c];R(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return ue(t)||(t=ye(t)),n(t)}function ct(t,{ignoreFieldNorm:e=h.ignoreFieldNorm}){t.forEach(s=>{let n=1;s.matches.forEach(({key:i,norm:r,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),s.score=n})}function lt(t,e){let s=t.matches;e.matches=[],M(s)&&s.forEach(n=>{if(!M(n.indices)||!n.indices.length)return;let{indices:i,value:r}=n,o={indices:i,value:r};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function ut(t,e){e.score=t.score}function dt(t,e,{includeMatches:s=h.includeMatches,includeScore:n=h.includeScore}={}){let i=[];return s&&i.push(lt),n&&i.push(ut),t.map(r=>{let{idx:o}=r,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(r,a)}),a})}var L=class{constructor(e,s={},n){this.options={...h,...s},this.options.useExtendedSearch,this._keyStore=new X(this.options.keys),this.setCollection(e,n)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof K))throw new Error(je);this._myIndex=s||Be(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){M(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let s=[];for(let n=0,i=this._docs.length;n<i;n+=1){let r=this._docs[n];e(r,n)&&(this.removeAt(n),n-=1,i-=1,s.push(r))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:r,sortFn:o,ignoreFieldNorm:a}=this.options,c=$(e)?$(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return ct(c,{ignoreFieldNorm:a}),r&&c.sort(o),Se(s)&&s>-1&&(c=c.slice(0,s)),dt(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){let s=ce(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:l,indices:u}=s.searchIn(r);c&&i.push({item:r,idx:o,matches:[{score:l,value:r,norm:a,indices:u}]})}),i}_searchLogical(e){let s=we(e,this.options),n=(a,c,l)=>{if(!a.children){let{keyId:p,searcher:g}=a,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(c,p),searcher:g});return f&&f.length?[{idx:l,item:c,matches:f}]:[]}let u=[];for(let p=0,g=a.children.length;p<g;p+=1){let f=a.children[p],A=n(f,c,l);if(A.length)u.push(...A);else if(a.operator===U.AND)return[]}return u},i=this._myIndex.records,r={},o=[];return i.forEach(({$:a,i:c})=>{if(M(a)){let l=n(s,a,c);l.length&&(r[c]||(r[c]={idx:c,item:a,matches:[]},o.push(r[c])),l.forEach(({matches:u})=>{r[c].matches.push(...u)}))}}),o}_searchObjectList(e){let s=ce(e,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach(({$:o,i:a})=>{if(!M(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:s}))}),c.length&&r.push({idx:a,item:o,matches:c})}),r}_findMatches({key:e,value:s,searcher:n}){if(!M(s))return[];let i=[];if(R(s))s.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:l,indices:u}=n.searchIn(r);c&&i.push({score:l,key:e,value:r,idx:o,norm:a,indices:u})});else{let{v:r,n:o}=s,{isMatch:a,score:c,indices:l}=n.searchIn(r);a&&i.push({score:c,key:e,value:r,norm:o,indices:l})}return i}};L.version="7.1.0";L.createIndex=Be;L.parseIndex=Xe;L.config=h;L.parseQuery=we;rt(oe);import{Fragment as $e,jsx as m,jsxs as S}from"react/jsx-runtime";function me(t){return t.type?!(Array.isArray(t.enum)&&t.enum.length>0)&&!t.elements&&!(t.properties&&Object.keys(t.properties).length>0)&&!(t.optionalProperties&&Object.keys(t.optionalProperties).length>0)&&!t.values&&!t.discriminator&&!t.ref:!1}function ht(t){return!t.type&&!t.enum&&!t.elements&&!t.properties&&!t.optionalProperties&&!t.values&&!t.discriminator&&!t.ref}function vt(t){return t.elements!==void 0}function pt(t){return me(t)?t.type:t.enum?`enum (${t.enum.length} values)`:t.elements?"array":t.properties||t.optionalProperties?`object (${(t.properties?Object.keys(t.properties).length:0)+(t.optionalProperties?Object.keys(t.optionalProperties).length:0)} properties)`:t.values?"map":t.discriminator?"discriminated union":t.ref?`ref: ${t.ref}`:ht(t)?"empty schema":"complex schema"}function gt(t){return t.mimeType?t.mimeType:t.jtdSchema?pt(t.jtdSchema):"unknown"}var ke=class{fuse;data;constructor(e){this.fuse=new L(e,{includeScore:!1,threshold:.3,ignoreLocation:!0,useExtendedSearch:!0,keys:[{name:"node",weight:5},{name:"nodeLabel",weight:5},{name:"nodeDescription",weight:2},{name:"transmitter",weight:5},{name:"transmitterDescription",weight:2},{name:"signal.name",weight:5},{name:"signal.label",weight:5},{name:"signal.description",weight:2}]}),this.data=e}search(e){if(!e||e.trim().length===0)return this.fuse.search("").map(i=>i.item);if(!e.includes("/"))return this.fuse.search(e).map(i=>i.item);let s=e.split("/"),n="";return s[0]==="constant"&&s.length===2?s[1]?n={$and:[{node:"=constant"},{$or:[{"signal.name":s[1]},{"signal.label":s[1]},{"signal.description":s[1]}]}]}:n={node:"=constant"}:s.length===2&&s[1]===""&&s[0]?n={$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]}:s.length===2&&s[0]&&s[1]?n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length===3&&s[2]===""&&s[0]&&s[1]?n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length>=3&&s[0]&&s[1]&&s[2]&&(n={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]},{$or:[{"signal.name":s[2]},{"signal.label":s[2]},{"signal.description":s[2]}]}]}),this.fuse.search(n).map(i=>i.item)}allSignals(){return this.data}};function Ft(t){return(e,s)=>!s||s.length<2?e:t.search(s).sort((i,r)=>{let o=`${i.node}/${i.transmitter}`,a=`${r.node}/${r.transmitter}`;return o.localeCompare(a)})}function Mt(t){let e=[];for(let s of t.vertices??[])for(let n of s.transmitters??[])for(let i of n.signals??[])e.push({node:s.id??"",nodeLabel:s.label??s.id??"",nodeDescription:s.description,nodeLogoId:s.logoId,transmitter:n.name??"",transmitterDescription:n.description,transmitterMode:n.mode,signal:i});for(let s of t.constants??[])e.push({node:"constant",nodeLabel:"Constants",transmitter:"",signal:s});return e}function ge(t){return t.node==="constant"?`constant/${t.signal.name}`:`${t.node}/${t.transmitter}/${t.signal.name}`}function fe(){return S("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[m("path",{d:"M4,7v2c0,0.55-0.45,1-1,1H2v4h1c0.55,0,1,0.45,1,1v2c0,1.65,1.35,3,3,3h3v-2H7c-0.55,0-1-0.45-1-1v-2 c0-1.3-0.84-2.42-2-2.83v-0.34C5.16,11.42,6,10.3,6,9V7c0-0.55,0.45-1,1-1h3V4H7C5.35,4,4,5.35,4,7z"}),m("path",{d:"M21,10c-0.55,0-1-0.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c0.55,0,1,0.45,1,1v2c0,1.3,0.84,2.42,2,2.83v0.34 c-1.16,0.41-2,1.52-2,2.83v2c0,0.55-0.45,1-1,1h-3v2h3c1.65,0,3-1.35,3-3v-2c0-0.55,0.45-1,1-1h1v-4H21z"})]})}function ft(t){if(t.group==="constant")return S("div",{className:`adapt-signal-group-header adapt-signal-group-header--constant ${t.className??""}`.trim(),children:[m("span",{className:"adapt-signal-group-icon adapt-signal-group-icon--constant",children:m(fe,{})}),m("span",{className:"adapt-signal-group-node-label adapt-signal-group-node-label--constant",children:"Constants"})]});let[s,n]=t.group.split("/"),i=t.references.find(a=>`${a.node}/${a.transmitter}`===t.group);if(!i)return null;let r=i.transmitterMode,o=r==="MODE_FAILURE"?"adapt-signal-group-transmitter--failure":r==="MODE_STREAM"?"adapt-signal-group-transmitter--stream":"adapt-signal-group-transmitter--standard";return S("div",{className:`adapt-signal-group-header ${t.className??""}`.trim(),children:[i.nodeIcon&&m("span",{className:"adapt-signal-group-icon",children:i.nodeIcon}),m("span",{className:"adapt-signal-group-node-label",children:i.nodeLabel||s}),S("span",{className:"adapt-signal-group-node-id",children:["(",s,")"]}),m("span",{className:"adapt-signal-group-separator"}),m("span",{className:`adapt-signal-group-transmitter ${o}`,children:n})]})}function mt(t){let{reference:e}=t;return S("div",{className:`adapt-signal-option ${t.className??""}`.trim(),children:[S("div",{className:"adapt-signal-option-label",children:[m("span",{className:"adapt-signal-option-name",children:e.signal.label||e.signal.name}),e.signal.label&&S("span",{className:"adapt-signal-option-code",children:["(",e.signal.name,")"]}),e.signal.optional&&m("span",{className:"adapt-signal-option-optional",children:"Optional"})]}),e.signal.formats&&m(Et,{formats:e.signal.formats})]})}function At(t){let{format:e,size:s="small",onDelete:n,onClick:i}=t,r=gt(e),o="primitive";e.mimeType?o="mime":e.jtdSchema&&!me(e.jtdSchema)&&(o="complex");let a=o==="mime"||o==="complex";return S("span",{className:`adapt-signal-format-chip adapt-signal-format-chip--${o} ${s==="medium"?"adapt-signal-format-chip--medium":""} ${t.className??""}`.trim(),onClick:i&&a?l=>{l.stopPropagation(),i()}:void 0,children:[r,n&&m("span",{className:"adapt-signal-format-chip-delete",onClick:l=>{l.stopPropagation(),n()},children:"\xD7"})]})}function Et(t){let{formats:e,maxVisible:s=3,onViewSchema:n}=t;if(e.length===0)return m("span",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:"No formats defined"});let i=[],r=0;for(let a=0;a<e.length;a++){let c=e[a];c&&(!c.mimeType&&!c.jtdSchema||(r++,i.length<s&&i.push(m(At,{format:c,onClick:n&&c.jtdSchema&&!me(c.jtdSchema)?()=>n(c.jtdSchema):void 0},`fmt-${a}`))))}let o=r-i.length;return S("div",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:[i,o>0&&S("span",{className:"adapt-signal-format-overflow",children:["+",o]})]})}function Bt({currentReference:t,inputValue:e,availableReferences:s,filterOptions:n,disabled:i,hasError:r,errorMessage:o,placeholder:a="Search signals...",className:c,theme:l="auto",onInputChange:u,onReferenceChange:p}){let[g,f]=Ne(!1),[A,E]=Ne(-1),y=de(null),v=de(null),F=de(null),w=he(()=>{p(null),u(""),f(!0),E(0),setTimeout(()=>v.current?.focus(),0)},[p,u]),N=pe(()=>{let d=[...s];return n(d,e)},[s,e,n]),T=pe(()=>{let d=new Map;for(let C of N){let I=C.node==="constant"?"constant":`${C.node}/${C.transmitter}`,P=d.get(I);P?P.push(C):d.set(I,[C])}return d},[N]),_=pe(()=>{let d=[];for(let C of T.values())d.push(...C);return d},[T]);be(()=>{function d(C){y.current&&!y.current.contains(C.target)&&f(!1)}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);let D=he(d=>{p(ge(d)),u(ge(d)),f(!1)},[p,u]),b=he(d=>{if(t){if(d.key==="Backspace"||d.key==="Delete"){d.preventDefault(),w();return}if(d.key==="ArrowDown"||d.key==="ArrowUp"||d.key==="Enter"){d.preventDefault(),p(null),u(""),f(!0),E(0),setTimeout(()=>v.current?.focus(),0);return}if(d.key.length===1&&!d.ctrlKey&&!d.metaKey){d.preventDefault(),p(null),u(d.key),f(!0),E(0),setTimeout(()=>v.current?.focus(),0);return}return}d.key==="ArrowDown"?(d.preventDefault(),g?E(C=>Math.min(C+1,_.length-1)):(f(!0),E(0))):d.key==="ArrowUp"?(d.preventDefault(),E(C=>Math.max(C-1,0))):d.key==="Enter"?(d.preventDefault(),g&&A>=0&&_[A]&&D(_[A])):d.key==="Escape"&&f(!1)},[t,w,p,u,g,A,_,D]);be(()=>{F.current&&A>=0&&F.current.querySelectorAll("[data-signal-option]")[A]?.scrollIntoView({block:"nearest"})},[A]);let B=[],H=0;for(let[d,C]of T){B.push(m(ft,{group:d,references:N},`group-${d}`));for(let I of C){let P=H++,xe=P===A;B.push(m("div",{"data-signal-option":!0,className:`adapt-signal-selector-option ${xe?"adapt-signal-selector-option--highlighted":""}`,onMouseDown:_e=>{_e.preventDefault(),D(I)},onMouseEnter:()=>E(P),children:m(mt,{reference:I})},ge(I)))}}let j=["adapt-signal-selector",r&&"adapt-signal-selector--error",c].filter(Boolean).join(" "),k=t?.node==="constant",Y=t?k?"adapt-signal-selector-selected-dot--constant":t.transmitterMode==="MODE_FAILURE"?"adapt-signal-selector-selected-dot--failure":t.transmitterMode==="MODE_STREAM"?"adapt-signal-selector-selected-dot--stream":"adapt-signal-selector-selected-dot--standard":"";return S("div",{ref:y,className:j,"data-adapt-theme":l==="auto"?void 0:l,children:[t&&!i&&S("div",{className:"adapt-signal-selector-selected",onClick:w,children:[k?m("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:m(fe,{})}):S($e,{children:[m("span",{className:`adapt-signal-selector-selected-dot ${Y}`}),t.nodeIcon&&m("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),m("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),m("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),m("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name}),m("span",{className:"adapt-signal-selector-selected-clear",onClick:d=>{d.stopPropagation(),w()},children:"\xD7"})]}),t&&i&&S("div",{className:"adapt-signal-selector-selected adapt-signal-selector-selected--disabled",children:[k?m("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:m(fe,{})}):S($e,{children:[m("span",{className:`adapt-signal-selector-selected-dot ${Y}`}),t.nodeIcon&&m("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),m("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),m("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),m("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name})]}),m("input",{ref:v,type:"text",className:`adapt-signal-selector-input${t?" adapt-signal-selector-input--hidden":""}`,value:e,placeholder:a,disabled:i,onChange:d=>{u(d.target.value),f(!0),E(0),d.target.value||p(null)},onFocus:()=>{t||f(!0)},onKeyDown:b}),o&&m("span",{className:"adapt-signal-selector-error",children:o}),g&&!i&&m("div",{ref:F,className:"adapt-signal-selector-dropdown",children:_.length>0?B:m("div",{className:"adapt-signal-selector-no-results",children:"No signals found"})})]})}export{At as FormatChip,Et as FormatViewer,ft as SignalGroupHeader,mt as SignalOption,ke as SignalSearch,Bt as SignalSelector,Ft as createSignalFilter,Mt as flattenSignals,gt as getFormatLabel,pt as getSchemaDescription,vt as isArraySchema,ht as isEmptySchema,me as isPrimitiveSchema,ge as signalReferenceKey};
|
|
2
2
|
//# sourceMappingURL=react.mjs.map
|