@marimo-team/frontend 0.14.17-dev53 → 0.14.17-dev54
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/assets/{ConnectedDataExplorerComponent-DKh08YWM.js → ConnectedDataExplorerComponent-DjCJrL8c.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-C4vT5pWU.js → ImageComparisonComponent-8zAgmEZc.js} +1 -1
- package/dist/assets/{VegaLite-Dog4hgsm.js → VegaLite-DrJCLVeG.js} +1 -1
- package/dist/assets/{_baseEach-RQ10f1k0.js → _baseEach-CW3YX-xa.js} +1 -1
- package/dist/assets/_baseMap-ustbOubK.js +1 -0
- package/dist/assets/{_baseUniq-89V6MClD.js → _baseUniq-rh38dNLc.js} +1 -1
- package/dist/assets/{_createAggregator-Besn85pg.js → _createAggregator-qgPv0UtB.js} +1 -1
- package/dist/assets/{any-language-editor-CzWgTXvd.js → any-language-editor-nsqS4mNe.js} +1 -1
- package/dist/assets/{architectureDiagram-SUXI7LT5-C3_H1AIT.js → architectureDiagram-SUXI7LT5-BXWqvg2p.js} +1 -1
- package/dist/assets/{blockDiagram-6J76NXCF-CQPh-Lgo.js → blockDiagram-6J76NXCF-BF2uoJ2C.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-D1c-W39K.js → c4Diagram-6F6E4RAY-BaFS21DX.js} +1 -1
- package/dist/assets/channel-DD5B19z-.js +1 -0
- package/dist/assets/{chunk-353BL4L5-Bl_vyR_x.js → chunk-353BL4L5-BzGqrlET.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-COJTNvW-.js → chunk-67H74DCK-BbDKDK1N.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-BdswCusP.js → chunk-AACKK3MU-Bm3fRza9.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-Bjs7j4oN.js → chunk-BFAMUDN2-r88iYW6-.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-CoS2l8l8.js → chunk-E2GYISFI-CqhYqoXU.js} +1 -1
- package/dist/assets/{chunk-OW32GOEJ-CKDr94D_.js → chunk-OW32GOEJ-CUe3qt6P.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-DimpXcnJ.js → chunk-SKB7J2MH-BQ24iETa.js} +1 -1
- package/dist/assets/{chunk-SZ463SBG-Bw0e7LjL.js → chunk-SZ463SBG-DrW4_XE0.js} +1 -1
- package/dist/assets/{circle-play-BgqSkGGN.js → circle-play-BKBMrAz5.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-CayKLiDC.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-CayKLiDC.js +1 -0
- package/dist/assets/clone-C3XJ1KI8.js +1 -0
- package/dist/assets/{compile-BSPBUxJI.js → compile-D2ccR_nA.js} +1 -1
- package/dist/assets/{dagre-JOIXM2OF-Cb3F6ssB.js → dagre-JOIXM2OF-Din0Rf-E.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-BwHC1Pqa.js → data-grid-overlay-editor-C0cIRvxO.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-B_gFwBq2.js → diagram-5UYTHUR4-CkZNlTvd.js} +1 -1
- package/dist/assets/{diagram-VMROVX33-BuRisVR5.js → diagram-VMROVX33-CwpjoANg.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-CxkgLZ7O.js → diagram-ZTM2IBQH-Bl56y9sb.js} +1 -1
- package/dist/assets/{edit-page-DzKadI3m.js → edit-page-Bk30GS0v.js} +15 -15
- package/dist/assets/edit-page-Go6-q-IH.css +1 -0
- package/dist/assets/{erDiagram-3M52JZNH-DxODY6mT.js → erDiagram-3M52JZNH-DhU-pjT5.js} +1 -1
- package/dist/assets/{flowDiagram-KYDEHFYC-BWyx7dlL.js → flowDiagram-KYDEHFYC-PTiY8S4q.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-CtCjyrxs.js → ganttDiagram-EK5VF46D-rn0CV3wu.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-DZVO-wQU.js → gitGraphDiagram-GW3U2K7C-j01epjnk.js} +1 -1
- package/dist/assets/{glide-data-editor-CVfcCyjx.js → glide-data-editor-C6IjL6Sz.js} +4 -4
- package/dist/assets/glide-data-editor-D6VlfICr.css +1 -0
- package/dist/assets/{graph-BBahpVHD.js → graph-C6hTPYsM.js} +1 -1
- package/dist/assets/home-page-DRO3ujsI.js +9 -0
- package/dist/assets/{index-HgmDNqr2.js → index-B0HxjhlY.js} +1 -1
- package/dist/assets/{index-DA5RESZN.js → index-BaNGlBPC.js} +1 -1
- package/dist/assets/{index-DP6jBolv.js → index-BthLbvoc.js} +1 -1
- package/dist/assets/{index-CAnNHKNy.js → index-C6lSsXHx.js} +1 -1
- package/dist/assets/index-CCrDNo99.css +1 -0
- package/dist/assets/{index-BHjOn5p_.js → index-CdIAeTVh.js} +1 -1
- package/dist/assets/{index-CmIWRwXc.js → index-CikeosA3.js} +27 -27
- package/dist/assets/{index-CIYtqntY.js → index-CjevVD1x.js} +1 -1
- package/dist/assets/{index-DyJe4dEG.js → index-CtvT3dzR.js} +1 -1
- package/dist/assets/{index-CRawUwC7.js → index-D1CYs_XA.js} +1 -1
- package/dist/assets/{index-CRs-dFsH.js → index-D2F1YfDe.js} +1 -1
- package/dist/assets/{index-C25GK5aN.js → index-D8YeALGV.js} +1 -1
- package/dist/assets/{index-BJcjg001.js → index-DLJ_7nAk.js} +1 -1
- package/dist/assets/{index-BeYufVys.js → index-DWhDTJDI.js} +1 -1
- package/dist/assets/{index-CSPza-CQ.js → index-DgZMvd8K.js} +1 -1
- package/dist/assets/{index-NnDUqWX_.js → index-DimuUs9s.js} +1 -1
- package/dist/assets/{index-BB80aoav.js → index-DlXu7jnp.js} +1 -1
- package/dist/assets/{index-DzZz43s7.js → index-DlnmbJSr.js} +1 -1
- package/dist/assets/{index-NI03pyES.js → index-YlkRqwLs.js} +1 -1
- package/dist/assets/{index-C4W9Ro3g.js → index-unCfmyJm.js} +1 -1
- package/dist/assets/infoDiagram-LHK5PUON-Cna3jMdU.js +2 -0
- package/dist/assets/{journeyDiagram-EWQZEKCU-CkcTmVdi.js → journeyDiagram-EWQZEKCU-HudMkC33.js} +1 -1
- package/dist/assets/{kanban-definition-ZSS6B67P-DJm2MlBR.js → kanban-definition-ZSS6B67P-LEcI8EUp.js} +1 -1
- package/dist/assets/{layout-JvgnInLJ.js → layout-DJ1kUf30.js} +1 -1
- package/dist/assets/{linear-BwE9Qacw.js → linear-CDRBtZNp.js} +1 -1
- package/dist/assets/{links-BimD3-ox.js → links-DGfr_enC.js} +3 -3
- package/dist/assets/links-Dn1Stwqz.css +1 -0
- package/dist/assets/{mermaid-Zixdf-t5.js → mermaid-ChZ44KCc.js} +4 -4
- package/dist/assets/{min-CEdlcixp.js → min-D34Pnfte.js} +1 -1
- package/dist/assets/{mindmap-definition-6CBA2TL7-BgDkJwOf.js → mindmap-definition-6CBA2TL7-9CAd4oms.js} +1 -1
- package/dist/assets/{number-overlay-editor-L5FraASh.js → number-overlay-editor-BEvgDv-J.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-DAZt23Zm.js → pieDiagram-NIOCPIFQ-Dwo-KM2X.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-DWNg3cS2.js → quadrantDiagram-2OG54O6I-DdXvKOXs.js} +1 -1
- package/dist/assets/{react-plotly-DxgAScfy.js → react-plotly-BDh8Kv4r.js} +1 -1
- package/dist/assets/{requirementDiagram-QOLK2EJ7-Dy1nALZO.js → requirementDiagram-QOLK2EJ7-MphvAXSE.js} +1 -1
- package/dist/assets/run-page-ORNzHtxx.js +1 -0
- package/dist/assets/{sankeyDiagram-4UZDY2LN-DOc6Fvnd.js → sankeyDiagram-4UZDY2LN-CgaxWuYI.js} +1 -1
- package/dist/assets/{sequenceDiagram-SKLFT4DO-CD4W5LDH.js → sequenceDiagram-SKLFT4DO-CkccI4cs.js} +1 -1
- package/dist/assets/{slides-component-BHD6_nqY.js → slides-component-BOPd_Bz0.js} +1 -1
- package/dist/assets/slides-component-DMjQomc3.css +1 -0
- package/dist/assets/{sortBy-C4lvXq3V.js → sortBy-O9IR6Qrs.js} +1 -1
- package/dist/assets/{stateDiagram-MI5ZYTHO--ZALIFoq.js → stateDiagram-MI5ZYTHO-Iv2wMtAt.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-BnsCAqrD.js +1 -0
- package/dist/assets/storage-B6yZpgAI.css +1 -0
- package/dist/assets/{storage-BGqE5cOP.js → storage-Ddhvks0j.js} +5 -5
- package/dist/assets/terminal-B3isKKSk.css +1 -0
- package/dist/assets/{terminal-BQNHLG5_.js → terminal-C2KFVAAU.js} +2 -2
- package/dist/assets/{time-CsGLRxve.js → time-y8ukgRAO.js} +1 -1
- package/dist/assets/{timeline-definition-MYPXXCX6-BckfZxxa.js → timeline-definition-MYPXXCX6-CbMNGtkb.js} +1 -1
- package/dist/assets/{tracing-DPLGzxiD.js → tracing-Nsu9auP7.js} +2 -2
- package/dist/assets/{trash-YzCmAnx5.js → trash-GFw8PsNX.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-cDfXIWBw.js → treemap-75Q7IDZK-B5rpZR4-.js} +1 -1
- package/dist/assets/{vega-component-DW6z7Oim.js → vega-component-CHZBkIbg.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-DSwnEPEp.js → xychartDiagram-H2YORKM3-DoPhlYa4.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +5 -5
- package/dist/assets/_baseMap-BR2OSMVR.js +0 -1
- package/dist/assets/channel-HDqiuCpB.js +0 -1
- package/dist/assets/classDiagram-M3E45YP4-BlulyYIs.js +0 -1
- package/dist/assets/classDiagram-v2-YAWTLIQI-BlulyYIs.js +0 -1
- package/dist/assets/clone-UMCgI6YN.js +0 -1
- package/dist/assets/edit-page-B7tjWZiy.css +0 -1
- package/dist/assets/glide-data-editor-DcmjcDkq.css +0 -1
- package/dist/assets/home-page-DTMS3dDR.js +0 -9
- package/dist/assets/index-DmaoBTfT.css +0 -1
- package/dist/assets/infoDiagram-LHK5PUON-Cs9qPzVq.js +0 -2
- package/dist/assets/links-C1rhMrxo.css +0 -1
- package/dist/assets/run-page-BagWBynq.js +0 -1
- package/dist/assets/slides-component-DeDT_a8V.css +0 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-DNE90FJX.js +0 -1
- package/dist/assets/storage-De8XnUVS.css +0 -1
- package/dist/assets/terminal-WqMRJt5Z.css +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import{c as Gn,z as zn,dg as po,j as x,dh as ho,di as go,dj as mo,dk as yo,a as Ee,U as Yn,dl as ke,ar as vo,a6 as Qn,dm as pt,dn as Vn,dp as ht,dq as Ke,dr as gt,L as bo,ds as xo,dt as Eo,al as To,V as Kt,du as Kn,bp as So,dv as Jn,dw as wo,dx as No,dy as Co,dz as Ao,dA as Oo,aJ as ko,am as Mo,aI as Io,E as Uo,at as Fo,dB as Do,aP as _o,dC as jo,b as Po}from"./index-
|
1
|
+
import{c as Gn,z as zn,dg as po,j as x,dh as ho,di as go,dj as mo,dk as yo,a as Ee,U as Yn,dl as ke,ar as vo,a6 as Qn,dm as pt,dn as Vn,dp as ht,dq as Ke,dr as gt,L as bo,ds as xo,dt as Eo,al as To,V as Kt,du as Kn,bp as So,dv as Jn,dw as wo,dx as No,dy as Co,dz as Ao,dA as Oo,aJ as ko,am as Mo,aI as Io,E as Uo,at as Fo,dB as Do,aP as _o,dC as jo,b as Po}from"./index-CikeosA3.js";import{U as Ro,e as $o,V as Bo}from"./compile-D2ccR_nA.js";import{a as Xn}from"./VegaLite-DrJCLVeG.js";import"./time-y8ukgRAO.js";import"./timer-BwIYMJWC.js";import"./linear-CDRBtZNp.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./step-BwsUM5iJ.js";import"./arc-ZB5pDULS.js";import"./index-BEQfoZiP.js";import"./index-DLJ_7nAk.js";/**
|
2
2
|
* @license lucide-react v0.525.0 - ISC
|
3
3
|
*
|
4
4
|
* This source code is licensed under the ISC license.
|
@@ -16,4 +16,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
16
16
|
|
17
17
|
See the Apache Version 2.0 License for specific language governing permissions
|
18
18
|
and limitations under the License.
|
19
|
-
***************************************************************************** */function $e(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}var Zn,er,tr,Ho={exports:{}};Zn||(Zn=1,function(e){var t=function(){function n(s,d){return d!=null&&s instanceof d}var o,i,c;try{o=Map}catch{o=function(){}}try{i=Set}catch{i=function(){}}try{c=Promise}catch{c=function(){}}function u(s,d,l,f,p){typeof d=="object"&&(l=d.depth,f=d.prototype,p=d.includeNonEnumerable,d=d.circular);var h=[],m=[],v=typeof Buffer<"u";return d===void 0&&(d=!0),l===void 0&&(l=1/0),function b(y,E){if(y===null)return null;if(E===0)return y;var T,S;if(typeof y!="object")return y;if(n(y,o))T=new o;else if(n(y,i))T=new i;else if(n(y,c))T=new c(function(ye,ve){y.then(function(be){ye(b(be,E-1))},function(be){ve(b(be,E-1))})});else if(u.__isArray(y))T=[];else if(u.__isRegExp(y))T=new RegExp(y.source,r(y)),y.lastIndex&&(T.lastIndex=y.lastIndex);else if(u.__isDate(y))T=new Date(y.getTime());else{if(v&&Buffer.isBuffer(y))return T=Buffer.allocUnsafe?Buffer.allocUnsafe(y.length):new Buffer(y.length),y.copy(T),T;n(y,Error)?T=Object.create(y):f===void 0?(S=Object.getPrototypeOf(y),T=Object.create(S)):(T=Object.create(f),S=f)}if(d){var N=h.indexOf(y);if(N!=-1)return m[N];h.push(y),m.push(T)}for(var C in n(y,o)&&y.forEach(function(ye,ve){var be=b(ve,E-1),lt=b(ye,E-1);T.set(be,lt)}),n(y,i)&&y.forEach(function(ye){var ve=b(ye,E-1);T.add(ve)}),y){var O;S&&(O=Object.getOwnPropertyDescriptor(S,C)),O&&O.set==null||(T[C]=b(y[C],E-1))}if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(y);for(C=0;C<M.length;C++){var U=M[C];(!(F=Object.getOwnPropertyDescriptor(y,U))||F.enumerable||p)&&(T[U]=b(y[U],E-1),F.enumerable||Object.defineProperty(T,U,{enumerable:!1}))}}if(p){var I=Object.getOwnPropertyNames(y);for(C=0;C<I.length;C++){var F,Ae=I[C];(F=Object.getOwnPropertyDescriptor(y,Ae))&&F.enumerable||(T[Ae]=b(y[Ae],E-1),Object.defineProperty(T,Ae,{enumerable:!1}))}}return T}(s,l)}function a(s){return Object.prototype.toString.call(s)}function r(s){var d="";return s.global&&(d+="g"),s.ignoreCase&&(d+="i"),s.multiline&&(d+="m"),d}return u.clonePrototype=function(s){if(s===null)return null;var d=function(){};return d.prototype=s,new d},u.__objToStr=a,u.__isDate=function(s){return typeof s=="object"&&a(s)==="[object Date]"},u.__isArray=function(s){return typeof s=="object"&&a(s)==="[object Array]"},u.__isRegExp=function(s){return typeof s=="object"&&a(s)==="[object RegExp]"},u.__getRegExpFlags=r,u}();e.exports&&(e.exports=t)}(Ho));var qo=(tr||(tr=1,er=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n,o=typeof t.cycles=="boolean"&&t.cycles,i=t.cmp&&(n=t.cmp,function(u){return function(a,r){var s={key:a,value:u[a]},d={key:r,value:u[r]};return n(s,d)}}),c=[];return function u(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var r,s;if(Array.isArray(a)){for(s="[",r=0;r<a.length;r++)r&&(s+=","),s+=u(a[r])||"null";return s+"]"}if(a===null)return"null";if(c.indexOf(a)!==-1){if(o)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var d=c.push(a)-1,l=Object.keys(a).sort(i&&i(a));for(s="",r=0;r<l.length;r++){var f=l[r],p=u(a[f]);p&&(s&&(s+=","),s+=JSON.stringify(f)+":"+p)}return c.splice(d,1),"{"+s+"}"}}(e)}),er);const nr=zn(qo);function Be(e,t,n){return e.fields=t||[],e.fname=n,e}function Jt(e){throw Error(e)}function Xt(e){var t,n,o,i=[],c=null,u=0,a=e.length,r="";function s(){i.push(r+e.substring(t,n)),r="",t=n+1}for(e+="",t=n=0;n<a;++n)if((o=e[n])==="\\")r+=e.substring(t,n),t=++n;else if(o===c)s(),c=null,u=-1;else{if(c)continue;t===u&&o==='"'||t===u&&o==="'"?(t=n+1,c=o):o!=="."||u?o==="["?(n>t&&s(),u=t=n+1):o==="]"&&(u||Jt("Access path missing open bracket: "+e),u>0&&s(),u=0,t=n+1):n>t?s():t=n+1}return u&&Jt("Access path missing closing bracket: "+e),c&&Jt("Access path missing closing quote: "+e),n>t&&(n++,s()),i}const mt=Array.isArray;function rr(e){return e===Object(e)}function Zt(e){return typeof e=="string"}function en(e){return mt(e)?"["+e.map(en)+"]":rr(e)||Zt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var Je=[];function yt(e,t,n){var o=[t].concat([].slice.call(n));console[e](...o)}(function(e){var t=Xt(e),n="return _["+t.map(en).join("][")+"];";Be(Function("_",n),[e=t.length===1?t[0]:e],e)})("id"),Be(function(e){return e},Je,"identity"),Be(function(){return 0},Je,"zero"),Be(function(){return 1},Je,"one"),Be(function(){return!0},Je,"true"),Be(function(){return!1},Je,"false");function tn(e){return typeof e=="boolean"}function Le(e){for(var t={},n=0,o=e.length;n<o;++n)t[e[n]]=!0;return t}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>nr(e)).join(",")})`};const K=nr;function Y(e,t){return e.indexOf(t)>-1}const ue=Object.keys,ne="row",ee="column",ir="facet",D="x",_="y",nn="x2",rn="y2",or="latitude",ar="longitude",sr="latitude2",cr="longitude2",de="color",vt="fill",bt="stroke",Xe="shape",Te="size",xt="opacity",Et="fillOpacity",Tt="strokeOpacity",St="strokeWidth",on="text",lr="order",an="detail",ur="key",dr="tooltip",fr="href",sn=Object.assign({},{x:1,y:1,x2:1,y2:1},{longitude:1,longitude2:1,latitude:1,latitude2:1},{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function wt(e){return e==="color"||e==="fill"||e==="stroke"}const Ze=Object.assign({},sn,{row:1,column:1,facet:1}),Go=ue(Ze),{order:bc,detail:xc}=Ze;$e(Ze,["order","detail"]);const{order:Ec,detail:Tc,row:Sc,column:wc,facet:Nc}=Ze;$e(Ze,["order","detail","row","column","facet"]);const{x:Cc,y:Ac,x2:Oc,y2:kc,latitude:Mc,longitude:Ic,latitude2:Uc,longitude2:Fc}=sn,cn=$e(sn,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),pr=ue(cn),{text:Dc,tooltip:_c,href:jc,detail:Pc,key:Rc,order:$c}=cn,zo=$e(cn,["text","tooltip","href","detail","key","order"]),Yo=Object.assign({},{x:1,y:1},zo);function Qo(e,t){return function(n){switch(n){case de:case vt:case bt:case an:case ur:case dr:case fr:case lr:case xt:case Et:case Tt:case St:case ir:case ne:case ee:return ln;case D:case _:case or:case ar:return Vo;case nn:case rn:case sr:case cr:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Te:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Xe:return{point:"always",geoshape:"always"};case on:return{text:"always"}}}(e)[t]}const ln={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Bc}=ln,Vo=$e(ln,["geoshape"]);function un(e){switch(e){case D:case _:case Te:case St:case xt:case Et:case Tt:case nn:case rn:return;case ir:case ne:case ee:case Xe:case on:case dr:case fr:return"discrete";case de:case vt:case bt:return"flexible";case or:case ar:case sr:case cr:case an:case ur:case lr:return}throw new Error("rangeType not implemented for "+e)}const hr={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},Ko=Object.assign({},hr,{encoding:1});Object.assign({gridScale:1,scale:1},hr,{encode:1});const gr=ue(Ko),mr={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};Object.assign({},mr,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1});const yr=ue(mr),Jo=Object.freeze(Object.defineProperty({__proto__:null,BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL:"Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.",CANNOT_FIX_RANGE_STEP_WITH_FIT:'Cannot use a fixed value of "rangeStep" when "autosize" is "fit".',CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:"custom domain scale cannot be unioned with default field-based domain",CONCAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",FIT_NON_SINGLE:'Autosize "fit" only works for single views and layered views.',INVALID_CHANNEL_FOR_AXIS:"Invalid channel for axis.",INVALID_SPEC:"Invalid spec",LINE_WITH_VARYING_SIZE:"Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.",MORE_THAN_ONE_SORT:"Domains that should be unioned has conflicting sort properties. Sort will be set to true.",NO_FIELDS_NEEDS_AS:'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.',NO_INIT_SCALE_BINDINGS:"Selections bound to scales cannot be separately initialized.",REPEAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).",SCALE_BINDINGS_CONTINUOUS:"Scale bindings are currently only supported for scales with unbinned, continuous domains.",UNABLE_TO_MERGE_DOMAINS:"Unable to merge domains",cannotApplySizeToNonOrientedMark:function(e){return`Cannot apply size to non-oriented mark "${e}".`},cannotProjectOnChannelWithoutField:function(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`},cannotStackNonLinearScale:function(e){return`Cannot stack non-linear scale (${e})`},cannotStackRangedMark:function(e){return`Cannot stack "${e}" if there is already "${e}2"`},cannotUseScalePropertyWithNonColor:function(e){return`Cannot use the scale property "${e}" with non-color channel.`},channelRequiredForBinned:function(e){return`Channel ${e} is required for "binned" bin`},columnsNotSupportByRowCol:function(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`},dayReplacedWithDate:function(e){return`Time unit "${e}" is not supported. We are replacing it with ${e.replace("day","date")}.`},differentParse:function(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`},discreteChannelCannotEncode:function(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`},domainRequiredForThresholdScale:function(e){return`Domain for ${e} is required for threshold scale`},domainSortDropped:function(e){return`Dropping sort property ${K(e)} as unioned domains only support boolean or op 'count'.`},droppedDay:function(e){return`Dropping day from datetime ${K(e)} as day cannot be combined with other units.`},droppingColor:function(e,t){const{fill:n,stroke:o}=t;return`Dropping color ${e} as the plot also has `+(n&&o?"fill and stroke":n?"fill":"stroke")},emptyFieldDef:function(e,t){return`Dropping ${K(e)} from channel "${t}" since it does not contain data field or value.`},encodingOverridden:function(e){return`Layer's shared ${e.join(",")} channel ${e.length===1?"is":"are"} overriden`},errorBand1DNotSupport:function(e){return`1D error band does not support ${e}`},errorBarCenterAndExtentAreNotNeeded:function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`},errorBarCenterIsNotNeeded:function(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`},errorBarCenterIsUsedWithWrongExtent:function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`},errorBarContinuousAxisHasCustomizedAggregate:function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`},facetChannelDropped:function(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`},facetChannelShouldBeDiscrete:function(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`},incompatibleChannel:function(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`},independentScaleMeansIndependentGuide:function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`},invalidAggregate:function(e){return`Invalid aggregation operator "${e}"`},invalidEncodingChannel:function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`},invalidFieldType:function(e){return`Invalid field type "${e}"`},invalidFieldTypeForCountAggregate:function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`},invalidTimeUnit:function(e,t){return`Invalid ${e}: ${K(t)}`},invalidTransformIgnored:function(e){return`Ignoring an invalid transform: ${K(e)}.`},latLongDeprecated:function(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`},lineWithRange:function(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`},mergeConflictingDomainProperty:function(e,t,n,o){return`Conflicting ${t.toString()} property "${e.toString()}" (${K(n)} and ${K(o)}). Using the union of the two domains.`},mergeConflictingProperty:function(e,t,n,o){return`Conflicting ${t.toString()} property "${e.toString()}" (${K(n)} and ${K(o)}). Using ${K(n)}.`},missingFieldType:function(e,t){return`Missing type for channel "${e}", using "${t}" instead.`},nearestNotSupportForContinuous:function(e){return`The "nearest" transform is not supported for ${e} marks.`},noSuchRepeatedValue:function(e){return`Unknown repeated value "${e}".`},nonZeroScaleUsedWithLengthMark:function(e,t,n){return`A ${n.scaleType?`${n.scaleType} scale`:n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${e}'s ${t}. This can be misleading as the ${t==="x"?"width":"height"} of the ${e} can be arbitrary based on the scale domain. You may want to use point mark instead.`},orientOverridden:function(e,t){return`Specified orient "${e}" overridden with "${t}"`},primitiveChannelDef:function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${K(n)}}.`},projectionOverridden:function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${K(t)} is overridden by a child projection ${K(n)}.`},rangeStepDropped:function(e){return`rangeStep for "${e}" is dropped as top-level ${e==="x"?"width":"height"} is provided.`},scalePropertyNotWorkWithScaleType:function(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`},scaleTypeNotWorkWithChannel:function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`},scaleTypeNotWorkWithFieldDef:function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`},scaleTypeNotWorkWithMark:function(e,t){return`Scale type "${t}" does not work with mark "${e}".`},selectionNotFound:function(e){return`Cannot find a selection named "${e}"`},selectionNotSupported:function(e){return`Selection not supported for ${e} yet`},stackNonSummativeAggregate:function(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}")`},unaggregateDomainHasNoEffectForRawField:function(e){return`Using unaggregated domain with raw field has no effect (${K(e)}).`},unaggregateDomainWithNonSharedDomainOp:function(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`},unaggregatedDomainWithLogScale:function(e){return`Unaggregated domain is currently unsupported for log scale (${K(e)}).`},unrecognizedParse:function(e){return`Unrecognized parse "${e}".`}},Symbol.toStringTag,{value:"Module"})),re=Jo;var Me;let vr=(Me=2,{level:function(e){return arguments.length?(Me=+e,this):Me},error:function(){return Me>=1&&yt("error","ERROR",arguments),this},warn:function(){return Me>=2&&yt("warn","WARN",arguments),this},info:function(){return Me>=3&&yt("log","INFO",arguments),this},debug:function(){return Me>=4&&yt("log","DEBUG",arguments),this}});function Se(...e){vr.warn.apply(vr,arguments)}const Xo={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1},R="quantitative",ce="ordinal",Q="temporal",ie="nominal";var j;(function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"})(j||(j={}));const Zo=ue({linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"}),br=["linear","log","pow","sqrt","symlog","time","utc"],ea=Le(br),ta=Le(["quantile","quantize","threshold"]),na=Le(br.concat(["quantile","quantize","threshold"])),ra=Le(["ordinal","bin-ordinal","point","band"]);function Ie(e){return e in ra}function We(e){return e in ea}const dn={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},xr=ue(dn),{type:Lc,domain:Wc,range:Hc,rangeStep:qc,scheme:Gc}=dn;function fn(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!Y(["point","band","identity"],e);case"bins":return!Y(["point","band","identity","ordinal"],e);case"round":return We(e)||e==="band"||e==="point";case"padding":return We(e)||Y(["point","band"],e);case"paddingOuter":case"rangeStep":case"align":return Y(["point","band"],e);case"paddingInner":return e==="band";case"clamp":return We(e);case"nice":return We(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return function(n){return n in na}(e)&&!Y(["log","time","utc","threshold","quantile"],e)}}function ia(e,t){switch(t){case"interpolate":case"scheme":return wt(e)?void 0:re.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function Er(e,t){return Y([ce,ie],t)?e===void 0||Ie(e):t===Q?Y([j.TIME,j.UTC,void 0],e):t!==R||Y([j.LOG,j.POW,j.SQRT,j.SYMLOG,j.QUANTILE,j.QUANTIZE,j.THRESHOLD,j.LINEAR,void 0],e)}function Tr(e,t){switch(e){case D:case _:return We(t)||Y(["band","point"],t);case Te:case St:case xt:case Et:case Tt:return We(t)||function(n){return n in ta}(t)||Y(["band","point"],t);case de:case vt:case bt:return t!=="band";case Xe:return t==="ordinal"}return!1}function oa(e,t){return e+"_"+t}$e(dn,["type","domain","range","rangeStep","scheme"]),function(){const e={};for(const t of Go)for(const n of ue(Xo))for(const o of Zo){const i=oa(t,n);Tr(t,o)&&Er(o,n)&&(e[i]=e[i]||[],e[i].push(o))}}();var Sr,wr={exports:{}};function et(){return Sr||(Sr=1,function(){var e=wr.exports,t="__name__";e.namedfunc=function(a,r){return r[t]=a,r},e.name=function(a){return a==null?null:a[t]},e.identity=function(a){return a},e.true=e.namedfunc("true",function(){return!0}),e.false=e.namedfunc("false",function(){return!1}),e.duplicate=function(a){return JSON.parse(JSON.stringify(a))},e.equal=function(a,r){return JSON.stringify(a)===JSON.stringify(r)},e.extend=function(a){for(var r,s,d=1,l=arguments.length;d<l;++d)for(s in r=arguments[d])a[s]=r[s];return a},e.length=function(a){return a!=null&&a.length!=null?a.length:null},e.keys=function(a){var r,s=[];for(r in a)s.push(r);return s},e.vals=function(a){var r,s=[];for(r in a)s.push(a[r]);return s},e.toMap=function(a,r){return(r=e.$(r))?a.reduce(function(s,d){return s[r(d)]=1,s},{}):a.reduce(function(s,d){return s[d]=1,s},{})},e.keystr=function(a){var r=a.length;if(!r)return"";for(var s=String(a[0]),d=1;d<r;++d)s+="|"+String(a[d]);return s};var n=Object.prototype.toString;e.isObject=function(a){return a===Object(a)},e.isFunction=function(a){return n.call(a)==="[object Function]"},e.isString=function(a){return typeof value=="string"||n.call(a)==="[object String]"},e.isArray=Array.isArray||function(a){return n.call(a)==="[object Array]"},e.isNumber=function(a){return typeof a=="number"||n.call(a)==="[object Number]"},e.isBoolean=function(a){return a===!0||a===!1||n.call(a)=="[object Boolean]"},e.isDate=function(a){return n.call(a)==="[object Date]"},e.isValid=function(a){return a!=null&&a==a},e.isBuffer=typeof Buffer=="function"&&Buffer.isBuffer||e.false,e.number=function(a){return a==null||a===""?null:+a},e.boolean=function(a){return a==null||a===""?null:a!=="false"&&!!a},e.date=function(a,r){var s=r||Date;return a==null||a===""?null:s.parse(a)},e.array=function(a){return a!=null?e.isArray(a)?a:[a]:[]},e.str=function(a){return e.isArray(a)?"["+a.map(e.str)+"]":e.isObject(a)||e.isString(a)?JSON.stringify(a).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):a};var o=/\[(.*?)\]|[^.\[]+/g;function i(a,r){var s,d="";for(s=0;s<a;++s)d+=r;return d}function c(a,r,s){var d=0,l=a.split(u);return(a=s?(l=l.reverse()).filter(function(f){return(d+=f.length)<=r}).reverse():l.filter(function(f){return(d+=f.length)<=r})).length?a.join("").trim():l[0].slice(0,r)}e.field=function(a){return String(a).match(o).map(function(r){return r[0]!=="["?r:r[1]!=="'"&&r[1]!=='"'?r.slice(1,-1):r.slice(2,-2).replace(/\\(["'])/g,"$1")})},e.accessor=function(a){return a==null||e.isFunction(a)?a:e.namedfunc(a,Function("x","return x["+e.field(a).map(e.str).join("][")+"];"))},e.$=e.accessor,e.mutator=function(a){var r;return e.isString(a)&&(r=e.field(a)).length>1?function(s,d){for(var l=0;l<r.length-1;++l)s=s[r[l]];s[r[l]]=d}:function(s,d){s[a]=d}},e.$func=function(a,r){return function(s){s=e.$(s)||e.identity;var d=a+(e.name(s)?"_"+e.name(s):"");return e.namedfunc(d,function(l){return r(s(l))})}},e.$valid=e.$func("valid",e.isValid),e.$length=e.$func("length",e.length),e.$in=function(a,r){a=e.$(a);var s=e.isArray(r)?e.toMap(r):r;return function(d){return!!s[a(d)]}},e.comparator=function(a){var r=[];return a===void 0&&(a=[]),a=e.array(a).map(function(s){var d=1;return s[0]==="-"?(d=-1,s=s.slice(1)):s[0]==="+"&&(d=1,s=s.slice(1)),r.push(d),e.accessor(s)}),function(s,d){var l,f,p,h;for(l=0,f=a.length;l<f;++l)if(p=a[l],h=e.cmp(p(s),p(d)))return h*r[l];return 0}},e.cmp=function(a,r){return(a<r||a==null)&&r!=null?-1:(a>r||r==null)&&a!=null?1:(r=r instanceof Date?+r:r,(a=a instanceof Date?+a:a)!==a&&r==r?-1:r!=r&&a==a?1:0)},e.numcmp=function(a,r){return a-r},e.stablesort=function(a,r,s){var d=a.reduce(function(l,f,p){return l[s(f)]=p,l},{});return a.sort(function(l,f){var p=r(l),h=r(f);return p<h?-1:p>h?1:d[s(l)]-d[s(f)]}),a},e.permute=function(a){for(var r,s,d=a.length;d;)s=Math.floor(Math.random()*d--),r=a[d],a[d]=a[s],a[s]=r},e.pad=function(a,r,s,d){d=d||" ";var l=r-a.length;if(l<=0)return a;switch(s){case"left":return i(l,d)+a;case"middle":case"center":return i(Math.floor(l/2),d)+a+i(Math.ceil(l/2),d);default:return a+i(l,d)}},e.truncate=function(a,r,s,d,l){var f=a.length;if(f<=r)return a;l=l!==void 0?String(l):"\u2026";var p=Math.max(0,r-l.length);switch(s){case"left":return l+(d?c(a,p,1):a.slice(f-p));case"middle":case"center":var h=Math.ceil(p/2),m=Math.floor(p/2);return(d?c(a,h):a.slice(0,h))+l+(d?c(a,m,1):a.slice(f-m));default:return(d?c(a,p):a.slice(0,p))+l}};var u=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}()),wr.exports}var k=et();function te(e,t){return e.indexOf(t)!==-1}function fe(e,t){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function V(e,t,n){if(e.forEach)e.forEach.call(n,t);else for(let o in e)t.call(n,e[o],o,e)}function he(e,t){let n,o=0;for(n in e)if(t(e[n],n,o++))return!0;return!1}function pe(e){return!!e.parent}const Nr={channel:1,aggregate:1,autoCount:1,bin:1,timeUnit:1,hasFn:1,sort:1,stack:1,field:1,type:1,format:1,scale:1,axis:1,legend:1,value:1},pn=(Cr=Nr,Object.keys(Cr));var Cr;const aa={bin:1,scale:1,sort:1,axis:1,legend:1};function hn(e){return aa[e]}const Ar=["maxbins","divide","extent","base","step","steps","minstep"].map(e=>({parent:"bin",child:e})),gn=["field","op","order"].map(e=>({parent:"sort",child:e})),Nt=xr.map(e=>({parent:"scale",child:e})),Or=gr.map(e=>({parent:"axis",child:e})),kr=yr.map(e=>({parent:"legend",child:e})),Ct=[].concat(Ar,gn,Nt,Or,kr),Mr=["width","height","background","padding","title"];function At(e){return pe(e)?e.parent+"."+e.child:e}const sa=Ct.reduce((e,t)=>(e[t.parent]=e[t.parent]||[],e[t.parent][t.child]=t,e),{});function ge(e,t){return(sa[e]||{})[t]}function Ir(e){return function(t){return t in Nr}(e)||pe(e)}const ca=[].concat(pn,Ct),Ur=["type","field","bin","timeUnit","aggregate","autoCount","channel","mark","stack","scale","sort","axis","legend"].concat(Ar,Nt,Or,kr,gn);var g;(function(e){e.MARK="mark",e.TRANSFORM="transform",e.STACK="stack",e.FORMAT="format",e.CHANNEL="channel",e.AGGREGATE="aggregate",e.AUTOCOUNT="autoCount",e.BIN="bin",e.HAS_FN="hasFn",e.TIMEUNIT="timeUnit",e.FIELD="field",e.TYPE="type",e.SORT="sort",e.SCALE="scale",e.AXIS="axis",e.LEGEND="legend",e.WIDTH="width",e.HEIGHT="height",e.BACKGROUND="background",e.PADDING="padding",e.TITLE="title"})(g||(g={}));const Ue="area",me="bar",tt="line",nt="point",mn="rect",yn="rule",Ot="text",rt="tick",kt="circle",Mt="square";function la(e){return Y(["line","area","trail"],e)}Le(ue({area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1})),["january","february","march","april","may","june","july","august","september","october","november","december"].map(e=>e.substr(0,3));var W;["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>e.substr(0,3)),function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(W||(W={}));const vn={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Fr=ue(vn),bn={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1},Dr={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},ua=Object.assign({},bn,Dr),da=Object.assign({},vn,bn,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},Dr),fa={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};function pa(e,t){const n=!!ua[e],o=n?new Date(Date.UTC(1972,0,1,0,0,0,0)):new Date(1972,0,1,0,0,0,0);for(const i of Fr)if(jr(e,i))switch(i){case W.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case W.QUARTER:{const{getDateMethod:c,setDateMethod:u}=_r("month",n);o[u](3*Math.floor(t[c]()/3));break}default:{const{getDateMethod:c,setDateMethod:u}=_r(i,n);o[u](t[c]())}}return o}function _r(e,t){const n=fa[e];return{setDateMethod:t?"setUTC"+n.substr(3):n,getDateMethod:"get"+(t?"UTC":"")+n.substr(3)}}function jr(e,t){const n=e.indexOf(t);return n>-1&&(t!==W.SECONDS||n===0||e.charAt(n-1)!=="i")}const P="?";function w(e){return It(e)||function(t){return!(t===void 0||t==null||!t.enum&&!t.name||k.isArray(t))}(e)}function It(e){return e===P}function xn(e,t,n){return k.extend({},{name:t,enum:n},e===P?{}:e)}function En(e){let t={},n={};for(const o of e){const i=[0];for(let u=0;u<o.length;u++)o.charAt(u).toUpperCase()===o.charAt(u)&&i.push(u);let c=i.map(u=>o.charAt(u)).join("").toLowerCase();if(n[c])if(i[i.length-1]===o.length-1||(c=i.concat([o.length-1]).map(u=>o.charAt(u)).join("").toLowerCase(),n[c]))for(let u=1;!t[o];u++){let a=c+"_"+u;if(!n[a]){t[o]=a,n[a]=!0;break}}else t[o]=c,n[c]=!0;else t[o]=c,n[c]=!0}return t}const Ut={mark:"m",channel:"c",aggregate:"a",autoCount:"#",hasFn:"h",bin:"b",sort:"so",stack:"st",scale:"s",format:"f",axis:"ax",legend:"l",value:"v",timeUnit:"tu",field:"f",type:"t",binProps:{maxbins:"mb",min:"mi",max:"ma",base:"b",step:"s",steps:"ss",minstep:"ms",divide:"d"},sortProps:{field:"f",op:"o",order:"or"},scaleProps:En(xr),axisProps:En(gr),legendProps:En(yr)};function it(e){if(pe(e))return Ut[e.parent]+"-"+Ut[e.parent+"Props"][e.child];if(Ut[e])return Ut[e];throw new Error("Default name undefined for "+e)}const X=[!1,!0],ha={maxbins:[5,10,20],extent:[void 0],base:[10],step:[void 0],steps:[void 0],minstep:[void 0],divide:[[5,2]],binned:[!1],anchor:[void 0],nice:[!0]},ga={field:[void 0],op:["min","mean"],order:["ascending","descending"]},ma={type:[void 0,j.LOG],domain:[void 0],base:[void 0],exponent:[1,2],constant:[void 0],bins:[void 0],clamp:X,nice:X,reverse:X,round:X,zero:X,padding:[void 0],paddingInner:[void 0],paddingOuter:[void 0],interpolate:[void 0],range:[void 0],rangeStep:[17,21],scheme:[void 0]},ya={zindex:[1,0],offset:[void 0],orient:[void 0],values:[void 0],bandPosition:[void 0],encoding:[void 0],domain:X,domainColor:[void 0],domainDash:[void 0],domainDashOffset:[void 0],domainOpacity:[void 0],domainWidth:[void 0],formatType:[void 0],grid:X,gridColor:[void 0],gridDash:[void 0],gridDashOffset:[void 0],gridOpacity:[void 0],gridWidth:[void 0],format:[void 0],labels:X,labelAlign:[void 0],labelAngle:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFlushOffset:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOpacity:[void 0],labelSeparation:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelBound:[void 0],labelFlush:[void 0],maxExtent:[void 0],minExtent:[void 0],position:[void 0],ticks:X,tickColor:[void 0],tickCount:[void 0],tickDash:[void 0],tickExtra:[void 0],tickDashOffset:[void 0],tickMinStep:[void 0],tickOffset:[void 0],tickOpacity:[void 0],tickRound:[void 0],tickSize:[void 0],tickWidth:[void 0],title:[void 0],titleAlign:[void 0],titleAnchor:[void 0],titleAngle:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titlePadding:[void 0],titleX:[void 0],titleY:[void 0]},va={orient:["left","right"],format:[void 0],type:[void 0],values:[void 0],zindex:[void 0],clipHeight:[void 0],columnPadding:[void 0],columns:[void 0],cornerRadius:[void 0],direction:[void 0],encoding:[void 0],fillColor:[void 0],formatType:[void 0],gridAlign:[void 0],offset:[void 0],padding:[void 0],rowPadding:[void 0],strokeColor:[void 0],labelAlign:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOffset:[void 0],labelOpacity:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelSeparation:[void 0],legendX:[void 0],legendY:[void 0],gradientLength:[void 0],gradientOpacity:[void 0],gradientStrokeColor:[void 0],gradientStrokeWidth:[void 0],gradientThickness:[void 0],symbolDash:[void 0],symbolDashOffset:[void 0],symbolFillColor:[void 0],symbolOffset:[void 0],symbolOpacity:[void 0],symbolSize:[void 0],symbolStrokeColor:[void 0],symbolStrokeWidth:[void 0],symbolType:[void 0],tickCount:[void 0],tickMinStep:[void 0],title:[void 0],titleAnchor:[void 0],titleAlign:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titleOrient:[void 0],titlePadding:[void 0]},ba={mark:[nt,me,tt,Ue,mn,rt,Ot],channel:[D,_,ne,ee,Te,de],aggregate:[void 0,"mean"],autoCount:X,bin:X,hasFn:X,timeUnit:[void 0,W.YEAR,W.MONTH,W.MINUTES,W.SECONDS],field:[void 0],type:[ie,ce,R,Q],sort:["ascending","descending"],stack:["zero","normalize","center",null],value:[void 0],format:[void 0],title:[void 0],scale:[!0],axis:X,legend:X,binProps:ha,sortProps:ga,scaleProps:ma,axisProps:ya,legendProps:va};function Tn(e,t,n){if(e==="field"||pe(e)&&e.parent==="sort"&&e.child==="field")return t.fieldNames();let o;if(o=pe(e)?n.enum[e.parent+"Props"][e.child]:n.enum[e],o!==void 0)return o;throw new Error("No default enumValues for "+JSON.stringify(e))}const ot={verbose:!1,defaultSpecConfig:{line:{point:!0},scale:{useUnaggregatedDomain:!0}},propertyPrecedence:Ur.map(At),enum:ba,numberNominalProportion:.05,numberNominalLimit:40,constraintManuallySpecifiedValue:!1,autoAddCount:!1,hasAppropriateGraphicTypeForMark:!0,omitAggregate:!1,omitAggregatePlotWithDimensionOnlyOnFacet:!0,omitAggregatePlotWithoutDimension:!1,omitBarLineAreaWithOcclusion:!0,omitBarTickWithSize:!0,omitMultipleNonPositionalChannels:!0,omitRaw:!1,omitRawContinuousFieldForAggregatePlot:!0,omitRepeatedField:!0,omitNonPositionalOrFacetOverPositionalChannels:!0,omitTableWithOcclusionIfAutoAddCount:!0,omitVerticalDotPlot:!1,omitInvalidStackSpec:!0,omitNonSumStack:!0,preferredBinAxis:D,preferredTemporalAxis:D,preferredOrdinalAxis:_,preferredNominalAxis:_,preferredFacet:ne,minCardinalityForBin:15,maxCardinalityForCategoricalColor:20,maxCardinalityForFacet:20,maxCardinalityForShape:6,timeUnitShouldHaveVariation:!0,typeMatchesSchemaType:!0,stylize:!0,smallRangeStepForHighCardinalityOrFacet:{maxCardinality:10,rangeStep:12},nominalColorScaleForHighCardinality:{maxCardinality:10,palette:"category20"},xAxisOnTopForHighYCardinalityWithoutColumn:{maxCardinality:30},maxGoodCardinalityForFacet:5,maxGoodCardinalityForColor:7,minPercentUniqueForKey:.8,minCardinalityForKey:50},xa={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Pr=["count","sum","distinct","valid","missing"];function Ea(e){return tn(e)&&(e=function(t,n){return tn(t)?{maxbins:Sn(n)}:t==="binned"?{binned:!0}:t.maxbins||t.step?t:Object.assign({},t,{maxbins:Sn(n)})}(e,void 0)),"bin"+ue(e).map(t=>function(n){const o=n.replace(/\W/g,"_");return(n.match(/^\d+/)?"_":"")+o}(`_${t}_${e[t]}`)).join("")}function Rr(e){return e===!0||function(t){return rr(t)}(e)&&!e.binned}function Sn(e){switch(e){case ne:case ee:case Te:case de:case vt:case bt:case St:case xt:case Et:case Tt:case Xe:return 6;default:return 10}}function $r(e){return!!e&&!!e.condition&&!mt(e.condition)&&we(e.condition)}function we(e){return!(!e||!e.field&&e.aggregate!=="count")}function wn(e){return we(e)&&Zt(e.field)}function Nn(e,t={}){let n=e.field;const o=t.prefix;let i=t.suffix,c="";if(function(a){return a.aggregate==="count"}(e))n=function(a){return function(r){return r.indexOf("__")===0}(a)?a:`__${a}`}("count");else{let a;if(!t.nofn)if(function(r){return!!r.op}(e))a=e.op;else{const{bin:r,aggregate:s,timeUnit:d}=e;Rr(r)?(a=Ea(r),i=(t.binSuffix||"")+(t.suffix||"")):s?(u=s)&&u.argmax?(c=`.${n}`,n=`argmax_${s.argmax}`):function(l){return!!l&&!!l.argmin}(s)?(c=`.${n}`,n=`argmin_${s.argmin}`):a=String(s):d&&(a=String(d))}a&&(n=n?`${a}_${n}`:a)}var u;return i&&(n=`${n}_${i}`),o&&(n=`${o}_${n}`),t.forAs?n:t.expr?function(a,r="datum"){return`${r}[${en(Xt(a).join("."))}]`}(n,t.expr)+c:`${Xt(n).map(a=>a.replace(".","\\.")).join("\\.")}`+c}function Br(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(re.invalidFieldType(e.type))}Le(["mean","average","median","q1","q3","min","max"]);const He={compatible:!0};function Ta(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case"row":case"column":case"facet":return function(o){return!Br(o)}(e)?{compatible:!1,warning:re.facetChannelShouldBeDiscrete(t)}:He;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return He;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==R?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:He;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return n!=="nominal"||e.sort?He:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"shape":return Y(["ordinal","nominal","geojson"],e.type)?He:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return e.type!=="nominal"||"sort"in e?He:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+t)}function Sa(e,t,n,o){const i=function(u,a,r){switch(a.type){case"nominal":case"ordinal":return wt(u)||un(u)==="discrete"?(u==="shape"&&a.type==="ordinal"&&Se(re.discreteChannelCannotEncode(u,"ordinal")),"ordinal"):Y(["x","y"],u)&&Y(["rect","bar","rule"],r)?"band":"point";case"temporal":return wt(u)?"time":un(u)==="discrete"?(Se(re.discreteChannelCannotEncode(u,"temporal")),"ordinal"):"time";case"quantitative":return wt(u)?Rr(a.bin)?"bin-ordinal":"linear":un(u)==="discrete"?(Se(re.discreteChannelCannotEncode(u,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(re.invalidFieldType(a.type))}(t,n,o),{type:c}=e;return function(u){return!!Yo[u]}(t)?c!==void 0?Tr(t,c)?Er(c,n.type)?c:(Se(re.scaleTypeNotWorkWithFieldDef(c,i)),i):(Se(re.scaleTypeNotWorkWithChannel(t,c,i)),i):i:null}var le;function Lr(e){return e===ce||e===ie||e===le.KEY}(function(e){e.QUANTITATIVE=R,e.ORDINAL=ce,e.TEMPORAL=Q,e.NOMINAL=ie,e.KEY="key"})(le||(le={}));class J{constructor(t=null){this.index=t?Object.assign({},t):{}}has(t){return At(t)in this.index}get(t){return this.index[At(t)]}set(t,n){return this.index[At(t)]=n,this}setByKey(t,n){this.index[t]=n}map(t){const n=new J;for(const o in this.index)n.index[o]=t(this.index[o]);return n}size(){return k.keys(this.index).length}duplicate(){return new J(this.index)}}function Wr(e,t){const n=e&&e[t];return!!n&&(mt(n)?function(o,i){let c=0;for(const[u,a]of o.entries())if(i(a,u,c++))return!0;return!1}(n,o=>!!o.field):we(n)||$r(n))}const wa={zero:1,center:1,normalize:1},Na=[me,Ue,yn,nt,kt,Mt,tt,Ot,rt],Ca=[me,Ue];function Aa(e,t,n,o={}){const i=function(p){return p.type}(e)?e.type:e;if(!Y(Na,i))return null;const c=function(p){const h=p.x,m=p.y;if(we(h)&&we(m))if(h.type==="quantitative"&&m.type==="quantitative"){if(h.stack)return"x";if(m.stack)return"y";if(!!h.aggregate!=!!m.aggregate)return h.aggregate?"x":"y"}else{if(h.type==="quantitative")return"x";if(m.type==="quantitative")return"y"}else{if(we(h)&&h.type==="quantitative")return"x";if(we(m)&&m.type==="quantitative")return"y"}}(t);if(!c)return null;const u=t[c],a=wn(u)?Nn(u,{}):void 0,r=c==="x"?"y":"x",s=t[r],d=wn(s)?Nn(s,{}):void 0,l=pr.reduce((p,h)=>{if(h!=="tooltip"&&Wr(t,h)){const m=t[h];(mt(m)?m:[m]).forEach(v=>{const b=function(E){return we(E)?E:$r(E)?E.condition:void 0}(v);if(b.aggregate)return;const y=wn(b)?Nn(b,{}):void 0;(!y||y!==d&&y!==a)&&p.push({channel:h,fieldDef:b})})}return p},[]);let f;if(u.stack!==void 0?f=tn(u.stack)?u.stack?"zero":null:u.stack:l.length>0&&(f=Y(Ca,i)?function(...p){for(const h of p)if(h!==void 0)return h}(n,"zero"):n),!f||!wa[f])return null;if(u.scale&&u.scale.type&&u.scale.type!==j.LINEAR){if(o.disallowNonLinearStack)return null;Se(re.cannotStackNonLinearScale(u.scale.type))}return Wr(t,c===D?nn:rn)?(u.stack!==void 0&&Se(re.cannotStackRangedMark(c)),null):(u.aggregate&&!Y(Pr,u.aggregate)&&Se(re.stackNonSummativeAggregate(u.aggregate)),{groupbyChannel:s?r:void 0,fieldChannel:c,impute:la(i),stackBy:l,offset:f})}function Hr(e){if(!function(n){if(w(n.mark))return!1;const o=[g.STACK,g.CHANNEL,g.MARK,g.FIELD,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],i=k.toMap((u=ca,a=o,u.filter(function(r){return!te(a,r)}))),c=n.encodings.filter(r=>!ae(r));var u,a;for(const r of c)if(qr(r,{exclude:i}))return!1;return!0}(e))return null;const t=Qr(e.encodings,{schema:null,wildcardMode:"null"});return Aa(e.mark,t,void 0,{disallowNonLinearStack:!0})}function qr(e,t={}){if(!k.isObject(e))return!1;for(const n in e)if(e.hasOwnProperty(n)&&(w(e[n])&&(!t.exclude||!t.exclude[n])||qr(e[n],t)))return!0;return!1}function Oa(e){return e.map(t=>function(n){return o=>n[o]!==void 0?n[o]:o}(t))}function Fe(e,t){return w(e)?!It(e)&&e.enum?P+JSON.stringify(e.enum):P:t?t(e):e}function Ft(e,t){return t?t(e):e}const Cn=new J,An=[].concat(Ur,gn,[g.TRANSFORM,g.STACK],Mr).reduce((e,t)=>e.set(t,!0),new J),On={axis:{x:!0,y:!0,row:!0,column:!0},legend:{color:!0,opacity:!0,size:!0,shape:!0},scale:{x:!0,y:!0,color:!0,opacity:!0,row:!0,column:!0,size:!0,shape:!0},sort:{x:!0,y:!0,path:!0,order:!0},stack:{x:!0,y:!0}};function qe(e,t=An,n=Cn){const o=[];let i;if(t.get(g.MARK)&&o.push(Fe(e.mark,n.get(g.MARK))),e.transform&&e.transform.length>0&&o.push("transform:"+JSON.stringify(e.transform)),t.get(g.STACK)&&(i=Hr(e)),e.encodings){const c=e.encodings.reduce((u,a)=>{if(!ae(a)){let r;r=i&&a.channel===i.fieldChannel?Gr(Object.assign({},a,{stack:i.offset}),t,n):Gr(a,t,n),r&&u.push(r)}return u},[]).sort().join("|");c&&o.push(c)}for(let c of Mr){const u=c.toString();if(t.get(c)&&e[u]){const a=e[u];o.push(`${u}=${JSON.stringify(a)}`)}}return o.join("|")}function Gr(e,t=An,n=Cn){const o=[];if(t.get(g.CHANNEL)&&o.push(Fe(e.channel,n.get(g.CHANNEL))),A(e)){const i=zr(e,t,n);i&&o.push(i)}else oe(e)?o.push(e.value):H(e)&&o.push("autocount()");return o.join(":")}function zr(e,t=An,n=Cn){if(t.get(g.AGGREGATE)&&ae(e))return"-";const o=function(u,a,r){if(a.get(g.AGGREGATE)&&u.aggregate&&!w(u.aggregate))return Ft(u.aggregate,r.get(g.AGGREGATE));if(a.get(g.AGGREGATE)&&Dt(u))return Ft("count",r.get(g.AGGREGATE));if(a.get(g.TIMEUNIT)&&u.timeUnit&&!w(u.timeUnit))return Ft(u.timeUnit,r.get(g.TIMEUNIT));if(a.get(g.BIN)&&u.bin&&!w(u.bin))return"bin";{let s=null;for(const d of[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN]){const l=u[d];a.get(d)&&u[d]&&w(l)&&(s=s||{},s[d]=It(l)?l:l.enum)}return s&&u.hasFn&&(s.hasFn=!0),s}}(e,t,n),i=function(u,a,r){const s=[];if(!k.isBoolean(u.bin)&&!It(u.bin)){const d=u.bin;for(const l in d){const f=ge("bin",l);f&&a.get(f)&&d[l]!==void 0&&s.push({key:l,value:Fe(d[l],r.get(f))})}s.sort((l,f)=>l.key.localeCompare(f.key))}for(const d of[g.SCALE,g.SORT,g.STACK,g.AXIS,g.LEGEND])if((w(u.channel)||On[d][u.channel])&&a.get(d)&&u[d]!==void 0){const l=u[d];if(k.isBoolean(l)||l===null)s.push({key:d+"",value:l||!1});else if(k.isString(l))s.push({key:d+"",value:Ft(JSON.stringify(l),r.get(d))});else{let f=[];for(const p in l){const h=ge(d,p);h&&a.get(h)&&l[p]!==void 0&&f.push({key:p,value:Fe(l[p],r.get(h))})}if(f.length>0){const p=f.sort((h,m)=>h.key.localeCompare(m.key)).reduce((h,m)=>(h[m.key]=m.value,h),{});s.push({key:d+"",value:JSON.stringify(p)})}}}return s}(e,t,n);let c;return A(e)?(c=t.get("field")?Fe(e.field,n.get("field")):"...",t.get(g.TYPE)&&(w(e.type)?c+=","+Fe(e.type,n.get(g.TYPE)):c+=","+Fe(((e.type||R)+"").substr(0,1),n.get(g.TYPE))),c+=i.map(u=>{let a=u.value instanceof Array?"["+u.value+"]":u.value;return","+u.key+"="+a}).join("")):H(e)&&(c="*,q"),c?o?(k.isString(o)?o:P+(k.keys(o).length>0?JSON.stringify(o):""))+"("+c+")":c:null}function kn(e,t,n){let o=[],i=0;for(let c=0;c<n;c++){let u=e.indexOf(t,i);if(u===-1)break;o.push(e.substring(i,u)),i=u+1}if(o.push(e.substr(i)),o.length!==n+1)for(;o.length!==n+1;)o.push("");return o}var Yr;function oe(e){return e!=null&&e.value!==void 0}function A(e){return e!=null&&(e.field||e.aggregate==="count")}function H(e){return e!=null&&"autoCount"in e}function ae(e){return H(e)&&e.autoCount===!1}function Dt(e){return H(e)&&e.autoCount===!0}(function(e){function t(i){const c={};c.field=i[0],c.type=function(s){if(s)switch(s=s.toLowerCase()){case"q":case R:return"quantitative";case"t":case Q:return"temporal";case"o":case ce:return"ordinal";case"n":case ie:return"nominal";case"geojson":return"geojson"}}(i[1].toUpperCase())||"?";let u=i[2],a=0,r=0;for(;r<u.length;){let s,d=u.indexOf("=",r);if(d===-1)break;{let l=u.substring(r,d);if(u[r+l.length+1]==="{"){let f=r+l.length+1;a=n(f,u,"}");const p=u.substring(f,a+1);s=JSON.parse(p),r=a+2}else if(u[r+l.length+1]==="["){let f=r+l.length+1,p=n(f,u,"]");const h=u.substring(f,p+1);s=JSON.parse(h),r=p+2}else{let f=r,p=u.indexOf(",",r+l.length);p===-1&&(p=u.length),r=p+1,s=JSON.parse(u.substring(f+l.length+1,p))}hn(l)?c[l]=s:(c.bin=c.bin||{},c.bin[l]=s)}}return c}function n(i,c,u){for(let a=i;a<c.length;a++)if(c[a]===u)return a}function o(i){const c={};if(i[0]==="?"){let a=n(1,i,"}"),r=JSON.parse(i.substring(1,a+1));for(let s in r)k.isArray(r[s])?c[s]={enum:r[s]}:c[s]=r[s];return Object.assign({},c,t(kn(i.substring(a+2,i.length-1),",",2)))}{let a=i.substring(0,i.indexOf("(")),r=kn(i.substring(a.length+1,i.length-1),",",2);if(Zt(u=a)&&xa[u])return Object.assign({aggregate:a},t(r));if(da[a])return Object.assign({timeUnit:a},t(r));if(a==="bin")return Object.assign({bin:{}},t(r))}var u}e.encoding=function(i,c){let u=c.indexOf("(")!==-1?o(c):t(kn(c,",",2));return Object.assign({channel:i},u)},e.rawFieldDef=t,e.getClosingIndex=n,e.fn=o})(Yr||(Yr={}));const ka=[g.AGGREGATE,g.BIN,g.TIMEUNIT,g.FIELD,g.TYPE,g.SCALE,g.SORT,g.AXIS,g.LEGEND,g.STACK,g.FORMAT];function Qr(e,t){const{wildcardMode:n="skip"}=t;let o={};for(const i of e){if(ae(i))continue;const{channel:c}=i;if(w(c))throw new Error("Cannot convert wildcard channel to a fixed channel");const u=oe(i)?Ma(i):Mn(i,t);if(u!==null)o[c]=u;else if(t.wildcardMode==="null")return null}return o}function Ma(e){const{value:t}=e;return w(t)?null:{value:t}}function Mn(e,t={}){const{props:n=ka,schema:o,wildcardMode:i="skip"}=t;if(A(e)){const c={};for(const u of n){let a=e[u];if(w(a)){if(i==="skip")continue;return null}if(a!==void 0){if(!(!On[u]||On[u][e.channel]))continue;if(hn(u)&&k.isObject(a)){a=Object.assign({},a);for(const r in a)if(w(a[r])){if(i==="null")return null;delete a[r]}}if(u==="bin"&&a===!1)continue;u==="type"&&a==="key"?c.type="nominal":c[u]=a}if(u===g.SCALE&&o&&e.type===ce){const r=e.scale,{ordinalDomain:s}=o.fieldSchema(e.field);r!==null&&s&&(c[g.SCALE]=Object.assign({domain:s},k.isObject(r)?r:{}))}}return c}if(e.autoCount===!1)throw new Error("Cannot convert {autoCount: false} into a field def");return{aggregate:"count",field:"*",type:"quantitative"}}function at(e){return A(e)?!Ne(e)&&e.type!=="temporal":H(e)}function Ne(e){if(A(e)){const t=Mn(e,{props:["bin","timeUnit","type"]});return Br(t)||!!t.timeUnit}return!1}function De(e){const t=e.scale===!0||e.scale===P?{}:e.scale||{},{type:n,channel:o,timeUnit:i,bin:c}=e;if(w(t.type)||w(n)||w(o)||w(c))return;if(t.type)return t.type;if(n==="temporal"&&w(i)||n==="quantitative"&&w(c))return;const u={type:n===le.KEY?"nominal":n,bin:c};return Sa({type:t.type},o,u,void 0)}var _t={exports:{}},In=new Date,Un=new Date;function G(e,t,n,o){function i(c){return e(c=new Date(+c)),c}return i.floor=i,i.round=function(c){var u=new Date(+c),a=new Date(c-1);return e(u),e(a),t(a,1),c-u<a-c?u:a},i.ceil=function(c){return e(c=new Date(c-1)),t(c,1),c},i.offset=function(c,u){return t(c=new Date(+c),u==null?1:Math.floor(u)),c},i.range=function(c,u,a){var r=[];if(c=new Date(c-1),u=new Date(+u),a=a==null?1:Math.floor(a),!(c<u&&a>0))return r;for(t(c,1),e(c),c<u&&r.push(new Date(+c));t(c,a),e(c),c<u;)r.push(new Date(+c));return r},i.filter=function(c){return G(function(u){for(;e(u),!c(u);)u.setTime(u-1)},function(u,a){for(;--a>=0;)for(;t(u,1),!c(u););})},n&&(i.count=function(c,u){return In.setTime(+c),Un.setTime(+u),e(In),e(Un),Math.floor(n(In,Un))},i.every=function(c){return c=Math.floor(c),isFinite(c)&&c>0?c>1?i.filter(o?function(u){return o(u)%c===0}:function(u){return i.count(0,u)%c===0}):i:null}),i}var st=G(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});st.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?G(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):st:null};const Vr=G(function(e){e.setMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getSeconds()}),Kr=G(function(e){e.setSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getMinutes()}),Jr=G(function(e){e.setMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),Xr=G(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5},function(e){return e.getDate()-1});function _e(e){return G(function(t){t.setHours(0,0,0,0),t.setDate(t.getDate()-(t.getDay()+7-e)%7)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}var jt=_e(0),Zr=_e(1),ei=_e(2),ti=_e(3),ni=_e(4),ri=_e(5),ii=_e(6);const oi=G(function(e){e.setHours(0,0,0,0),e.setDate(1)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()}),ai=G(function(e){e.setHours(0,0,0,0),e.setMonth(0,1)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}),si=G(function(e){e.setUTCMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),ci=G(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getUTCMinutes()}),li=G(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),ui=G(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1});function je(e){return G(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/6048e5})}var Pt=je(0),di=je(1),fi=je(2),pi=je(3),hi=je(4),gi=je(5),mi=je(6);const yi=G(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(1)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()}),vi=G(function(e){e.setUTCHours(0,0,0,0),e.setUTCMonth(0,1)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});var bi=st.range,Ia=Vr.range,Ua=Kr.range,Fa=Jr.range,Da=Xr.range,_a=jt.range,ja=Zr.range,Pa=ei.range,Ra=ti.range,$a=ni.range,Ba=ri.range,La=ii.range,Wa=jt.range,Ha=oi.range,qa=ai.range,Ga=st,za=bi,Ya=si.range,Qa=ci.range,Va=li.range,Ka=ui.range,Ja=Pt.range,Xa=di.range,Za=fi.range,es=pi.range,ts=hi.range,ns=gi.range,rs=mi.range,is=Pt.range,os=yi.range,as=vi.range;const ss=po(Object.freeze(Object.defineProperty({__proto__:null,day:Xr,days:Da,friday:ri,fridays:Ba,hour:Jr,hours:Fa,interval:G,millisecond:st,milliseconds:bi,minute:Kr,minutes:Ua,monday:Zr,mondays:ja,month:oi,months:Ha,saturday:ii,saturdays:La,second:Vr,seconds:Ia,sunday:jt,sundays:_a,thursday:ni,thursdays:$a,tuesday:ei,tuesdays:Pa,utcDay:ui,utcDays:Ka,utcFriday:gi,utcFridays:ns,utcHour:li,utcHours:Va,utcMillisecond:Ga,utcMilliseconds:za,utcMinute:ci,utcMinutes:Qa,utcMonday:di,utcMondays:Xa,utcMonth:yi,utcMonths:os,utcSaturday:mi,utcSaturdays:rs,utcSecond:si,utcSeconds:Ya,utcSunday:Pt,utcSundays:Ja,utcThursday:hi,utcThursdays:ts,utcTuesday:fi,utcTuesdays:Za,utcWednesday:pi,utcWednesdays:es,utcWeek:Pt,utcWeeks:is,utcYear:vi,utcYears:as,wednesday:ti,wednesdays:Ra,week:jt,weeks:Wa,year:ai,years:qa},Symbol.toStringTag,{value:"Module"})));var xi,Ei,Ti;function cs(){if(xi)return _t.exports;xi=1;var e=ss,t=new Date,n=new Date(0,0,1).setFullYear(0),o=new Date(Date.UTC(0,0,1)).setUTCFullYear(0);function i(l){return t.setTime(+l),t}function c(l,f,p,h,m,v){var b={type:l,date:f,unit:p};return h?b.step=h:b.minstep=1,m!=null&&(b.min=m),v!=null&&(b.max=v),b}function u(l,f,p,h,m,v){return c(l,function(b){return f.offset(p,b)},function(b){return f.count(p,b)},h,m,v)}var a=[u("second",e.second,n),u("minute",e.minute,n),u("hour",e.hour,n),u("day",e.day,n,[1,7]),u("month",e.month,n,[1,3,6]),u("year",e.year,n),c("seconds",function(l){return new Date(1970,0,1,0,0,l)},function(l){return i(l).getSeconds()},null,0,59),c("minutes",function(l){return new Date(1970,0,1,0,l)},function(l){return i(l).getMinutes()},null,0,59),c("hours",function(l){return new Date(1970,0,1,l)},function(l){return i(l).getHours()},null,0,23),c("weekdays",function(l){return new Date(1970,0,4+l)},function(l){return i(l).getDay()},[1],0,6),c("dates",function(l){return new Date(1970,0,l)},function(l){return i(l).getDate()},[1],1,31),c("months",function(l){return new Date(1970,l%12,1)},function(l){return i(l).getMonth()},[1],0,11)],r=[u("second",e.utcSecond,o),u("minute",e.utcMinute,o),u("hour",e.utcHour,o),u("day",e.utcDay,o,[1,7]),u("month",e.utcMonth,o,[1,3,6]),u("year",e.utcYear,o),c("seconds",function(l){return new Date(Date.UTC(1970,0,1,0,0,l))},function(l){return i(l).getUTCSeconds()},null,0,59),c("minutes",function(l){return new Date(Date.UTC(1970,0,1,0,l))},function(l){return i(l).getUTCMinutes()},null,0,59),c("hours",function(l){return new Date(Date.UTC(1970,0,1,l))},function(l){return i(l).getUTCHours()},null,0,23),c("weekdays",function(l){return new Date(Date.UTC(1970,0,4+l))},function(l){return i(l).getUTCDay()},[1],0,6),c("dates",function(l){return new Date(Date.UTC(1970,0,l))},function(l){return i(l).getUTCDate()},[1],1,31),c("months",function(l){return new Date(Date.UTC(1970,l%12,1))},function(l){return i(l).getUTCMonth()},[1],0,11)],s=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];function d(l){var f,p,h={};for(f=0,p=l.length;f<p;++f)h[l[f].type]=l[f];return h.find=function(m,v,b){return function(y,E,T,S){var N,C,O,M=s[0];for(N=1,C=s.length;N<C;++N)if(E>(M=s[N])[0]){if((O=E/M[0])>S)return y[s[N-1][1]];if(O>=T)return y[M[1]]}return y[s[C-1][1]]}(l,m,v,b)},h}return _t.exports=d(a),_t.exports.utc=d(r),_t.exports}var ls=function(){if(Ti)return Ei;Ti=1;var e=et(),t=cs();function n(a){if(!a)throw Error("Missing binning options.");var r,s,d,l,f,p,h,m=a.maxbins||15,v=a.base||10,b=Math.log(v),y=a.div||[5,2],E=a.min,T=a.max,S=T-E;if(a.step)r=a.step;else if(a.steps)r=a.steps[Math.min(a.steps.length-1,function(N,C,O,M){for(;O<M;){var U=O+M>>>1;e.cmp(N[U],C)<0?O=U+1:M=U}return O}(a.steps,S/m,0,a.steps.length))];else{for(s=Math.ceil(Math.log(m)/b),d=a.minstep||0,r=Math.max(d,Math.pow(v,Math.round(Math.log(S)/b)-s));Math.ceil(S/r)>m;)r*=v;for(p=0;p<y.length;++p)(f=r/y[p])>=d&&S/f<=m&&(r=f)}return l=(f=Math.log(r))>=0?0:1+~~(-f/b),h=Math.pow(v,-l-1),{start:E=Math.min(E,Math.floor(E/r+h)*r),stop:T=Math.ceil(T/r)*r,step:r,unit:{precision:l},value:o,index:i}}function o(a){return this.step*Math.floor(a/this.step+1e-15)}function i(a){return Math.floor((a-this.start)/this.step+1e-15)}function c(a){return this.unit.date(o.call(this,a))}function u(a){return i.call(this,this.unit.unit(a))}return n.date=function(a){if(!a)throw Error("Missing date binning options.");var r=a.utc?t.utc:t,s=a.min,d=a.max,l=a.maxbins||20,f=a.minbins||4,p=+d-+s,h=a.unit?r[a.unit]:r.find(p,f,l),m=n({min:h.min!=null?h.min:h.unit(s),max:h.max!=null?h.max:h.unit(d),maxbins:l,minstep:h.minstep,steps:h.step});return m.unit=h,m.index=u,a.raw||(m.value=c),m},Ei=n}();const us=zn(ls);var Si,wi;function Ni(){if(wi)return Si;wi=1;var e=et(),t="__types__",n={boolean:e.boolean,integer:e.number,number:e.number,date:e.date,string:function(r){return r==null||r===""?null:r+""}},o={boolean:function(r){return r==="true"||r==="false"||e.isBoolean(r)},integer:function(r){return o.number(r)&&(r=+r)===~~r},number:function(r){return!isNaN(+r)&&!e.isDate(r)},date:function(r){return!isNaN(Date.parse(r))}};function i(r){return e.keys(r)}function c(r){return"["+r+"]"}function u(r,s){var d,l,f;if(r=e.array(r),s=e.$(s),r[t]&&(d=s(r[t]),e.isString(d)))return d;for(l=0,f=r.length;!e.isValid(d)&&l<f;++l)d=s?s(r[l]):r[l];return e.isDate(d)?"date":e.isNumber(d)?"number":e.isBoolean(d)?"boolean":e.isString(d)?"string":null}function a(r,s){var d,l,f;r=e.array(r),s=e.$(s);var p=["boolean","integer","number","date"];for(d=0;d<r.length;++d){for(f=s?s(r[d]):r[d],l=0;l<p.length;++l)e.isValid(f)&&!o[p[l]](f)&&(p.splice(l,1),l-=1);if(p.length===0)return"string"}return p[0]}return u.annotation=function(r,s){if(!s)return r&&r[t]||null;r[t]=s},u.all=function(r,s){if(r.length){var d=s?e.identity:(s=i(r[0]),c);return s.reduce(function(l,f){return l[f]=u(r,d(f)),l},{})}},u.infer=a,u.inferAll=function(r,s){var d=s?e.identity:(s=i(r[0]),c);return s.reduce(function(l,f){return l[f]=a(r,d(f)),l},{})},u.parsers=n,Si=u}var Ci,Ai,ds=Ni(),Oi={exports:{}},ki={exports:{}},fs=(Ai||(Ai=1,function(e){var t=et(),n=Ni(),o=(Ci||(Ci=1,function(r){var s=et(),d=r.exports;d.repeat=function(l,f){var p,h=Array(f);for(p=0;p<f;++p)h[p]=l;return h},d.zeros=function(l){return d.repeat(0,l)},d.range=function(l,f,p){if(arguments.length<3&&(p=1,arguments.length<2&&(f=l,l=0)),(f-l)/p==1/0)throw new Error("Infinite range");var h,m=[],v=-1;if(p<0)for(;(h=l+p*++v)>f;)m.push(h);else for(;(h=l+p*++v)<f;)m.push(h);return m},d.random={},d.random.uniform=function(l,f){f===void 0&&(f=l===void 0?1:l,l=0);var p=f-l,h=function(){return l+p*Math.random()};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){return m>=l&&m<=f?1/p:0},h.cdf=function(m){return m<l?0:m>f?1:(m-l)/p},h.icdf=function(m){return m>=0&&m<=1?l+m*p:NaN},h},d.random.integer=function(l,f){f===void 0&&(f=l,l=0);var p=f-l,h=function(){return l+Math.floor(p*Math.random())};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){return m===Math.floor(m)&&m>=l&&m<f?1/p:0},h.cdf=function(m){var v=Math.floor(m);return v<l?0:v>=f?1:(v-l+1)/p},h.icdf=function(m){return m>=0&&m<=1?l-1+Math.floor(m*p):NaN},h},d.random.normal=function(l,f){var p;l=l||0,f=f||1;var h=function(){var m,v,b=0,y=0;if(p!==void 0)return b=p,p=void 0,b;do m=(b=2*Math.random()-1)*b+(y=2*Math.random()-1)*y;while(m===0||m>1);return v=Math.sqrt(-2*Math.log(m)/m),p=l+y*v*f,l+b*v*f};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){var v=Math.exp(Math.pow(m-l,2)/(-2*Math.pow(f,2)));return 1/(f*Math.sqrt(2*Math.PI))*v},h.cdf=function(m){var v,b=(m-l)/f,y=Math.abs(b);if(y>37)v=0;else{var E=Math.exp(-y*y/2);y<7.07106781186547?(v=E*((((((.0352624965998911*y+.700383064443688)*y+6.37396220353165)*y+33.912866078383)*y+112.079291497871)*y+221.213596169931)*y+220.206867912376),v/=((((((.0883883476483184*y+1.75566716318264)*y+16.064177579207)*y+86.7807322029461)*y+296.564248779674)*y+637.333633378831)*y+793.826512519948)*y+440.413735824752):v=E/(y+1/(y+2/(y+3/(y+4/(y+.65)))))/2.506628274631}return b>0?1-v:v},h.icdf=function(m){if(m<=0||m>=1)return NaN;var v=2*m-1,b=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),y=2/(Math.PI*b)+Math.log(1-Math.pow(v,2))/2,E=Math.log(1-v*v)/b,T=(v>0?1:-1)*Math.sqrt(Math.sqrt(y*y-E)-y);return l+f*Math.SQRT2*T},h},d.random.bootstrap=function(l,f){var p=l.filter(s.isValid),h=p.length,m=f?d.random.normal(0,f):null,v=function(){return p[~~(Math.random()*h)]+(m?m():0)};return v.samples=function(b){return d.zeros(b).map(v)},v}}(ki)),ki.exports),i=e.exports;function c(r,s,d){var l=r&&r.nullh||0,f=o.random.normal(0,1),p=i.mean(s,d),h=i.stdev(s,d)/Math.sqrt(i.count.valid(s,d));if(h===0)return p-l===0?1:0;var m=(p-l)/h;return 2*f.cdf(-Math.abs(m))}function u(r,s,d,l){var f,p=l?s.map(t.$(d)):s,h=l?s.map(t.$(l)):d,m=i.count(p),v=i.count(h),b=Array();if(m!==v)throw Error("Array lengths must match.");for(f=0;f<m;++f)t.isValid(p[f])&&t.isValid(h[f])&&b.push(p[f]-h[f]);return i.z.test(b,r&&r.nullh||0)}function a(r,s,d,l){var f=l?s.map(t.$(d)):s,p=l?s.map(t.$(l)):d,h=i.count.valid(f),m=i.count.valid(p),v=o.random.normal(0,1),b=i.mean(f)-i.mean(p)-(r&&r.nullh||0),y=Math.sqrt(i.variance(f)/h+i.variance(p)/m);if(y===0)return b===0?1:0;var E=b/y;return 2*v.cdf(-Math.abs(E))}i.unique=function(r,s,d){s=t.$(s),d=d||[];var l,f,p,h={};for(f=0,p=r.length;f<p;++f)(l=s?s(r[f]):r[f])in h||(h[l]=1,d.push(l));return d},i.count=function(r){return r&&r.length||0},i.count.valid=function(r,s){s=t.$(s);var d,l,f,p=0;for(l=0,f=r.length;l<f;++l)d=s?s(r[l]):r[l],t.isValid(d)&&(p+=1);return p},i.count.missing=function(r,s){s=t.$(s);var d,l,f=0;for(d=0,l=r.length;d<l;++d)(s?s(r[d]):r[d])==null&&(f+=1);return f},i.count.distinct=function(r,s){s=t.$(s);var d,l,f,p={},h=0;for(l=0,f=r.length;l<f;++l)(d=s?s(r[l]):r[l])in p||(p[d]=1,h+=1);return h},i.count.map=function(r,s){s=t.$(s);var d,l,f,p={};for(l=0,f=r.length;l<f;++l)p[d=s?s(r[l]):r[l]]=d in p?p[d]+1:1;return p},i.median=function(r,s){return s&&(r=r.map(t.$(s))),r=r.filter(t.isValid).sort(t.cmp),i.quantile(r,.5)},i.quartile=function(r,s){s&&(r=r.map(t.$(s))),r=r.filter(t.isValid).sort(t.cmp);var d=i.quantile;return[d(r,.25),d(r,.5),d(r,.75)]},i.quantile=function(r,s,d){d===void 0&&(d=s,s=t.identity),s=t.$(s);var l=(r.length-1)*d+1,f=Math.floor(l),p=+s(r[f-1]),h=l-f;return h?p+h*(s(r[f])-p):p},i.sum=function(r,s){s=t.$(s);for(var d,l=0,f=0,p=r.length;f<p;++f)d=s?s(r[f]):r[f],t.isValid(d)&&(l+=d);return l},i.mean=function(r,s){s=t.$(s);var d,l,f,p,h=0;for(d=0,f=0,l=r.length;d<l;++d)p=s?s(r[d]):r[d],t.isValid(p)&&(h+=(p-h)/++f);return h},i.mean.geometric=function(r,s){s=t.$(s);var d,l,f,p,h=1;for(p=0,d=0,l=r.length;p<l;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){if(f<=0)throw Error("Geometric mean only defined for positive values.");h*=f,++d}return h=d>0?Math.pow(h,1/d):0},i.mean.harmonic=function(r,s){s=t.$(s);var d,l,f,p,h=0;for(p=0,d=0,l=r.length;p<l;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(h+=1/f,++d);return d/h},i.variance=function(r,s){if(s=t.$(s),!t.isArray(r)||r.length<2)return 0;var d,l,f,p,h=0,m=0;for(l=0,f=0;l<r.length;++l)p=s?s(r[l]):r[l],t.isValid(p)&&(m+=(d=p-h)*(p-(h+=d/++f)));return m/=f-1},i.stdev=function(r,s){return Math.sqrt(i.variance(r,s))},i.modeskew=function(r,s){var d=i.mean(r,s),l=i.median(r,s),f=i.stdev(r,s);return f===0?0:(d-l)/f},i.min=function(r,s){return i.extent(r,s)[0]},i.max=function(r,s){return i.extent(r,s)[1]},i.extent=function(r,s){s=t.$(s);var d,l,f,p,h=r.length;for(p=0;p<h;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){d=l=f;break}for(;p<h;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(f<d&&(d=f),f>l&&(l=f));return[d,l]},i.extent.index=function(r,s){s=t.$(s);var d,l,f,p,h=-1,m=-1,v=r.length;for(p=0;p<v;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){d=l=f,h=m=p;break}for(;p<v;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(f<d&&(d=f,h=p),f>l&&(l=f,m=p));return[h,m]},i.dot=function(r,s,d){var l,f,p=0;if(d)for(s=t.$(s),d=t.$(d),l=0;l<r.length;++l)(f=s(r[l])*d(r[l]))==f&&(p+=f);else{if(r.length!==s.length)throw Error("Array lengths must match.");for(l=0;l<r.length;++l)(f=r[l]*s[l])==f&&(p+=f)}return p},i.dist=function(r,s,d,l){var f,p,h=t.isFunction(d)||t.isString(d),m=r,v=h?r:s,b=h?l:d,y=b===2||b==null,E=r.length,T=0;for(h&&(s=t.$(s),d=t.$(d)),p=0;p<E;++p)f=h?s(m[p])-d(v[p]):m[p]-v[p],T+=y?f*f:Math.pow(Math.abs(f),b);return y?Math.sqrt(T):Math.pow(T,1/b)},i.cohensd=function(r,s,d){var l=d?r.map(t.$(s)):r,f=d?r.map(t.$(d)):s,p=i.mean(l),h=i.mean(f),m=i.count.valid(l),v=i.count.valid(f);if(m+v-2<=0)return 0;var b=i.variance(l),y=i.variance(f),E=Math.sqrt(((m-1)*b+(v-1)*y)/(m+v-2));return E===0?0:(p-h)/E},i.covariance=function(r,s,d){var l,f,p,h,m,v=d?r.map(t.$(s)):r,b=d?r.map(t.$(d)):s,y=v.length,E=i.mean(v),T=i.mean(b),S=0,N=0;if(y!==b.length)throw Error("Input lengths must match.");for(l=0;l<y;++l)if(f=v[l],h=t.isValid(f),p=b[l],m=t.isValid(p),h&&m)S+=(f-E)*(p-T),++N;else if(h||m)throw Error("Valid values must align.");return S/(N-1)},i.rank=function(r,s){s=t.$(s)||t.identity;var d,l,f,p=r.map(function(y,E){return{idx:E,val:s(y)}}).sort(t.comparator("val")),h=r.length,m=Array(h),v=-1,b={};for(d=0;d<h;++d){if(l=p[d].val,v<0&&b===l)v=d-1;else if(v>-1&&b!==l){for(f=1+(d-1+v)/2;v<d;++v)m[p[v].idx]=f;v=-1}m[p[d].idx]=d+1,b=l}if(v>-1)for(f=1+(h-1+v)/2;v<h;++v)m[p[v].idx]=f;return m},i.cor=function(r,s,d){var l=d;d=l?r.map(t.$(d)):s,s=l?r.map(t.$(s)):r;var f=i.dot(s,d),p=i.mean(s),h=i.mean(d),m=i.stdev(s),v=i.stdev(d),b=r.length;return(f-b*p*h)/((b-1)*m*v)},i.cor.rank=function(r,s,d){var l,f,p,h=d?i.rank(r,s):i.rank(r),m=d?i.rank(r,d):i.rank(s),v=r.length;for(l=0,f=0;l<v;++l)f+=(p=h[l]-m[l])*p;return 1-6*f/(v*(v*v-1))},i.cor.dist=function(r,s,d){var l,f,p,h,m=d?r.map(t.$(s)):r,v=d?r.map(t.$(d)):s,b=i.dist.mat(m),y=i.dist.mat(v),E=b.length;for(l=0,f=0,p=0,h=0;l<E;++l)f+=b[l]*b[l],p+=y[l]*y[l],h+=b[l]*y[l];return Math.sqrt(h/Math.sqrt(f*p))},i.linearRegression=function(r,s,d){var l,f,p=d?r.map(t.$(s)):r,h=d?r.map(t.$(d)):s,m=p.length,v=i.covariance(p,h),b=i.stdev(p),y=i.stdev(h),E=v/(b*b),T=i.mean(h)-E*i.mean(p),S={slope:E,intercept:T,R:v/(b*y),rss:0};for(f=0;f<m;++f)t.isValid(p[f])&&t.isValid(h[f])&&(l=E*p[f]+T-h[f],S.rss+=l*l);return S},i.bootstrap={},i.bootstrap.ci=function(r,s,d,l,f){var p,h,m,v,b,y,E;for(t.isFunction(s)||t.isString(s)?(p=r.map(t.$(s)),h=d,m=l,v=f):(p=r,h=s,m=d,v=l),h=h?+h:1e3,m=m||.05,b=o.random.bootstrap(p,v),E=0,y=Array(h);E<h;++E)y[E]=i.mean(b.samples(p.length));return y.sort(t.numcmp),[i.quantile(y,m/2),i.quantile(y,1-m/2)]},i.z={},i.z.ci=function(r,s,d){var l=r,f=s;(t.isFunction(s)||t.isString(s))&&(l=r.map(t.$(s)),f=d);var p=(f=f||.05)===.05?1.96:o.random.normal(0,1).icdf(1-f/2),h=i.mean(l),m=i.stdev(l)/Math.sqrt(i.count.valid(l));return[h-p*m,h+p*m]},i.z.test=function(r,s,d,l){return t.isFunction(d)||t.isString(d)?(l&&l.paired?u:a)(l,r,s,d):t.isArray(s)?(d&&d.paired?u:a)(d,r,s):t.isFunction(s)||t.isString(s)?c(d,r,s):c(s,r)},i.dist.mat=function(r){var s,d,l,f=r.length,p=f*f,h=Array(p),m=o.zeros(f),v=0;for(d=0;d<f;++d)for(h[d*f+d]=0,l=d+1;l<f;++l)h[d*f+l]=s=Math.abs(r[d]-r[l]),h[l*f+d]=s,m[d]+=s,m[l]+=s;for(d=0;d<f;++d)v+=m[d],m[d]/=f;for(v/=p,d=0;d<f;++d)for(l=d;l<f;++l)h[d*f+l]+=v-m[d]-m[l],h[l*f+d]=h[d*f+l];return h},i.entropy=function(r,s){s=t.$(s);var d,l,f=0,p=0,h=r.length;for(d=0;d<h;++d)f+=s?s(r[d]):r[d];if(f===0)return 0;for(d=0;d<h;++d)(l=(s?s(r[d]):r[d])/f)&&(p+=l*Math.log(l));return-p/Math.LN2},i.mutual=function(r,s,d,l){var f,p,h,m=l?r.map(t.$(s)):r,v=l?r.map(t.$(d)):s,b=l?r.map(t.$(l)):d,y={},E={},T=b.length,S=0,N=0,C=0;for(h=0;h<T;++h)y[m[h]]=0,E[v[h]]=0;for(h=0;h<T;++h)y[m[h]]+=b[h],E[v[h]]+=b[h],S+=b[h];for(p=1/(S*Math.LN2),h=0;h<T;++h)b[h]!==0&&(f=S*b[h]/(y[m[h]]*E[v[h]]),N+=b[h]*p*Math.log(f),C+=b[h]*p*Math.log(b[h]/S));return[N,1+N/C]},i.mutual.info=function(r,s,d,l){return i.mutual(r,s,d,l)[0]},i.mutual.dist=function(r,s,d,l){return i.mutual(r,s,d,l)[1]},i.profile=function(r,s){var d,l,f,p,h,m=0,v=0,b=0,y=0,E=null,T=null,S=0,N=[],C={};for(f=0;f<r.length;++f)C[p=s?s(r[f]):r[f]]=p in C?C[p]+1:(y+=1,1),p==null?++b:t.isValid(p)&&(h=typeof p=="string"?p.length:p,(E===null||h<E)&&(E=h),(T===null||h>T)&&(T=h),S+=(d=h-m)*(h-(m+=d/++v)),N.push(h));return S/=v-1,l=Math.sqrt(S),N.sort(t.cmp),{type:n(r,s),unique:C,count:r.length,valid:v,missing:b,distinct:y,min:E,max:T,mean:m,stdev:l,median:p=i.quantile(N,.5),q1:i.quantile(N,.25),q3:i.quantile(N,.75),modeskew:l===0?0:(m-p)/l}},i.summary=function(r,s){var d=(s=s||t.keys(r[0])).map(function(l){var f=i.profile(r,t.$(l));return f.field=l,f});return d.__summary__=!0,d}}(Oi)),Oi.exports);const ps=us,Rt={nominal:0,key:1,ordinal:2,temporal:3,quantitative:4};class hs{constructor(t){this._tableSchema=t,t.fields.sort(function(n,o){return Rt[n.vlType]<Rt[o.vlType]?-1:Rt[n.vlType]>Rt[o.vlType]?1:n.name.localeCompare(o.name)}),t.fields.forEach((n,o)=>n.index=o),this._fieldSchemaIndex=t.fields.reduce((n,o)=>(n[o.name]=o,n),{})}fieldNames(){return this._tableSchema.fields.map(t=>t.name)}get fieldSchemas(){return this._tableSchema.fields}fieldSchema(t){return this._fieldSchemaIndex[t]}tableSchema(){const t=k.duplicate(this._tableSchema);return t.fields.sort((n,o)=>n.originalIndex-o.originalIndex),t}primitiveType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].type:null}vlType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].vlType:null}cardinality(t,n=!0,o=!1){const i=this._fieldSchemaIndex[t.field];if(t.aggregate||H(t)&&t.autoCount)return 1;if(t.bin){let c;c=typeof t.bin=="boolean"?{maxbins:Sn(t.channel)}:t.bin==="?"?{enum:[!0,!1]}:t.bin;const u=c.maxbins;return i.binStats[u]||(i.binStats[u]=Mi(u,i.stats)),i.binStats[u].distinct}if(t.timeUnit){if(n)switch(t.timeUnit){case W.SECONDS:case W.MINUTES:return 60;case W.HOURS:return 24;case W.DAY:return 7;case W.DATE:return 31;case W.MONTH:return 12;case W.QUARTER:return 4;case W.MILLISECONDS:return 1e3}let c=t.timeUnit,u=i.timeStats;return u&&u[c]||(u=Object.assign({},u,{[c]:Ii(t.timeUnit,i.stats)})),o?u[c].distinct-Ui(u[c].unique,["Invalid Date",null]):u[c].distinct}return i?o?i.stats.distinct-Ui(i.stats.unique,[NaN,null]):i.stats.distinct:null}timeUnitHasVariation(t){if(!t.timeUnit)return;if(t.timeUnit===W.DAY){const o=k.extend({},t,{timeUnit:W.DATE});if(this.cardinality(o,!1,!0)<=1)return!1}let n=t.timeUnit;for(let o of Fr)if(jr(n,o)){const i=k.extend({},t,{timeUnit:o});if(this.cardinality(i,!1,!0)<=1)return!1}return!0}domain(t){const n=this._fieldSchemaIndex[t.field];let o=k.keys(n.stats.unique);return n.vlType===R?[+n.stats.min,+n.stats.max]:n.type===L.DATETIME?[n.stats.min,n.stats.max]:n.type===L.INTEGER||n.type===L.NUMBER?(o=o.map(i=>+i),o.sort(k.cmp)):n.vlType===ce&&n.ordinalDomain?n.ordinalDomain:o.map(i=>i==="null"?null:i).sort(k.cmp)}stats(t){const n=this._fieldSchemaIndex[t.field];return n?n.stats:null}}function Mi(e,t){const n=ps({min:t.min,max:t.max,maxbins:e}),o=k.extend({},t);return o.unique=function(i,c){const u={};for(let a in c){let r;r=a===null?null:isNaN(Number(a))?NaN:i.value(Number(a)),u[r]=(u[r]||0)+c[a]}return u}(n,t.unique),o.distinct=(n.stop-n.start)/n.step,o.min=n.start,o.max=n.stop,o}function Ii(e,t){const n=k.extend({},t);let o={};return k.keys(t.unique).forEach(function(i){let c,u=i==="null"?null:new Date(i);c=u===null?null:isNaN(u.getTime())?"Invalid Date":(e===W.DAY?u.getDay():pa(e,u)).toString(),o[c]=(o[c]||0)+t.unique[i]}),n.unique=o,n.distinct=k.keys(o).length,n}function Ui(e,t){return t.reduce(function(n,o){return e[o]?n+1:n},0)}var L;(function(e){e[e.STRING="string"]="STRING",e[e.NUMBER="number"]="NUMBER",e[e.INTEGER="integer"]="INTEGER",e[e.BOOLEAN="boolean"]="BOOLEAN",e[e.DATETIME="datetime"]="DATETIME"})(L||(L={}));class Fi{constructor(t){this.constraint=t}name(){return this.constraint.name}description(){return this.constraint.description}properties(){return this.constraint.properties}strict(){return this.constraint.strict}}class Di extends Fi{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return fe(this.constraint.properties,n=>{if(pe(n)){let o=n.parent,i=n.child;return!t[o]||!w(t[o][i])}return!t[n]||!w(t[n])})}satisfy(t,n,o,i){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)||this.constraint.satisfy(t,n,o,i)}}const _i=[{name:"aggregateOpSupportedByType",description:"Aggregate function should be supported by data type.",properties:[g.TYPE,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.aggregate||!Lr(e.type)},{name:"asteriskFieldWithCountOnly",description:'Field="*" should be disallowed except aggregate="count"',properties:[g.FIELD,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>e.field==="*"==(e.aggregate==="count")},{name:"minCardinalityForBin",description:"binned quantitative field should not have too low cardinality",properties:[g.BIN,g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.bin&&e.type===R){let i={channel:e.channel,field:e.field,type:e.type};return t.cardinality(i)>=o.minCardinalityForBin}return!0}},{name:"binAppliedForQuantitative",description:"bin should be applied to quantitative field only.",properties:[g.TYPE,g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.bin||e.type===R},{name:"channelFieldCompatible",description:"encoding channel's range type be compatible with channel type.",properties:[g.CHANNEL,g.TYPE,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{const i=Object.assign({field:"f"},Mn(e,{schema:t,props:["bin","timeUnit","type"]})),{compatible:c}=Ta(i,e.channel);if(c)return!0;return!(e.channel!=="row"&&e.channel!=="column"||(u=i.timeUnit,!vn[u]&&!function(a){return!!bn[a]}(i.timeUnit)));var u}},{name:"hasFn",description:"A field with as hasFn flag should have one of aggregate, timeUnit, or bin.",properties:[g.AGGREGATE,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>!e.hasFn||!!e.aggregate||!!e.bin||!!e.timeUnit},{name:"omitScaleZeroWithBinnedField",description:"Do not use scale zero with binned field",properties:[g.SCALE,ge("scale","zero"),g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.bin||!e.scale||e.scale.zero!==!0},{name:"onlyOneTypeOfFunction",description:"Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.",properties:[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>A(e)?(!w(e.aggregate)&&e.aggregate?1:0)+(!w(e.bin)&&e.bin?1:0)+(!w(e.timeUnit)&&e.timeUnit?1:0)<=1:!0},{name:"timeUnitAppliedForTemporal",description:"Time unit should be applied to temporal field only.",properties:[g.TYPE,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.timeUnit||e.type===Q},{name:"timeUnitShouldHaveVariation",description:"A particular time unit should be applied only if they produce unique values.",properties:[g.TIMEUNIT,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>!e.timeUnit||e.type!==Q||!n.has("timeUnit")&&!o.constraintManuallySpecifiedValue||t.timeUnitHasVariation(e)},{name:"scalePropertiesSupportedByScaleType",description:"Scale properties must be supported by correct scale type",properties:[].concat(Nt,[g.SCALE,g.TYPE]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>{if(e.scale){const i=e.scale,c=De(e);if(c==null)return!0;for(let u in i){if(u==="type"||u==="name"||u==="enum")continue;const a=u;if(c==="point"){if(!fn("point",a)&&!fn("band",a))return!1}else if(!fn(c,a))return!1}}return!0}},{name:"scalePropertiesSupportedByChannel",description:"Not all scale properties are supported by all encoding channels",properties:[].concat(Nt,[g.SCALE,g.CHANNEL]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>{if(e){let i=e.channel,c=e.scale;if(i&&!w(i)&&c){if(i==="row"||i==="column")return!1;for(let u in c)if(c.hasOwnProperty(u)&&!(u==="type"||u==="name"||u==="enum")&&ia(i,u)!==void 0)return!1}}return!0}},{name:"typeMatchesPrimitiveType",description:"Data type should be supported by field's primitive type.",properties:[g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.field==="*")return!0;const i=t.primitiveType(e.field),c=e.type;if(!n.has("field")&&!n.has("type")&&!o.constraintManuallySpecifiedValue)return!0;switch(i){case L.BOOLEAN:case L.STRING:return c!==R&&c!==Q;case L.NUMBER:case L.INTEGER:return c!==Q;case L.DATETIME:return c===Q;case null:return!1}throw new Error("Not implemented")}},{name:"typeMatchesSchemaType",description:"Enumerated data type of a field should match the field's type in the schema.",properties:[g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>!(n.has("field")||n.has("type")||o.constraintManuallySpecifiedValue)||(e.field==="*"?e.type===R:t.vlType(e.field)===e.type)},{name:"maxCardinalityForCategoricalColor",description:"Categorical channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==de||e.type!==ie&&e.type!==le.KEY||t.cardinality(e)<=o.maxCardinalityForCategoricalColor},{name:"maxCardinalityForFacet",description:"Row/column channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==ne&&e.channel!==ee||t.cardinality(e)<=o.maxCardinalityForFacet},{name:"maxCardinalityForShape",description:"Shape channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==Xe||t.cardinality(e)<=o.maxCardinalityForShape},{name:"dataTypeAndFunctionMatchScaleType",description:"Scale type must match data type",properties:[g.TYPE,g.SCALE,ge("scale","type"),g.TIMEUNIT,g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.scale){const i=e.type,c=De(e);if(Lr(i))return c===void 0||Ie(c);if(i===Q)return e.timeUnit?te([j.TIME,j.UTC,void 0],c)||Ie(c):te([j.TIME,j.UTC,void 0],c);if(i===R)return e.bin?te([j.LINEAR,void 0],c):te([j.LOG,j.POW,j.SQRT,j.QUANTILE,j.QUANTIZE,j.LINEAR,void 0],c)}return!0}},{name:"stackIsOnlyUsedWithXY",description:"stack should only be allowed for x and y channels",properties:[g.STACK,g.CHANNEL],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.stack||e.channel===D||e.channel===_}].map(e=>new Di(e));_i.reduce((e,t)=>(e[t.name()]=t,e),{});const gs=_i.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J),ji=[{name:"doesNotSupportConstantValue",description:"row, column, x, y, order, and detail should not work with constant values.",properties:[g.TYPE,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!te(["row","column","x","y","detail","order"],e.channel)}].map(e=>new Di(e));ji.reduce((e,t)=>(e[t.name()]=t,e),{});const ms=ji.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J),ys=pr.reduce((e,t)=>(e[t]=!0,e),{});class vs extends Fi{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return fe(this.constraint.properties,n=>{if(n===g.MARK)return!w(t.getMark());if(pe(n)){let o=n.parent,i=n.child;return fe(t.getEncodings(),c=>!c[o]||!w(c[o][i]))}if(!Ir(n))throw new Error("UNIMPLEMENTED");return fe(t.getEncodings(),o=>!o[n]||!w(o[n]))})}satisfy(t,n,o){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)||this.constraint.satisfy(t,n,o)}}const Pi=[{name:"noRepeatedChannel",description:"Each encoding channel should only be used once.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{let o={};return fe(e.getEncodings(),i=>!!w(i.channel)||!o[i.channel]&&(o[i.channel]=!0,!0))}},{name:"alwaysIncludeZeroInScaleWithBarMark",description:"Do not recommend bar mark if scale does not start at zero",properties:[g.MARK,g.SCALE,ge("scale","zero"),g.CHANNEL,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark(),i=e.getEncodings();if(o===me){for(let c of i)if(A(c)&&(c.channel===D||c.channel===_)&&c.type===R&&c.scale&&c.scale.zero===!1)return!1}return!0}},{name:"autoAddCount",description:"Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.",properties:[g.BIN,g.TIMEUNIT,g.TYPE,g.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>he(e.getEncodings(),o=>Dt(o))?fe(e.getEncodings(),o=>{if(oe(o)||H(o))return!0;switch(o.type){case R:return!!o.bin;case Q:return!!o.timeUnit;case ce:case le.KEY:case ie:return!0}throw new Error("Unsupported Type")}):fe(e.wildcardIndex.encodingIndicesByProperty.get("autoCount")||[],o=>{let i=e.getEncodingQueryByIndex(o);return H(i)&&!w(i.autoCount)})?he(e.getEncodings(),o=>(A(o)||H(o))&&o.type===R?!ae(o)&&A(o)&&(!o.bin||w(o.bin)):!(!A(o)||o.type!==Q)&&(!o.timeUnit||w(o.timeUnit))):!0},{name:"channelPermittedByMarkType",description:"Each encoding channel should be supported by the mark type",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark();return!!w(o)||fe(e.getEncodings(),i=>!!w(i.channel)||!!Qo(i.channel,o))}},{name:"hasAllRequiredChannelsForMark",description:"All required channels for the specified mark should be specified",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark();switch(o){case Ue:case tt:return e.channelUsed(D)&&e.channelUsed(_);case Ot:return e.channelUsed(on);case me:case kt:case Mt:case rt:case yn:case mn:return e.channelUsed(D)||e.channelUsed(_);case nt:return!e.wildcardIndex.hasProperty(g.CHANNEL)||e.channelUsed(D)||e.channelUsed(_)}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+JSON.stringify(o))}},{name:"omitAggregate",description:"Omit aggregate plots.",properties:[g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()},{name:"omitAggregatePlotWithDimensionOnlyOnFacet",description:"Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.",properties:[g.CHANNEL,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){let o=!1,i=!1,c=!1;if(e.specQuery.encodings.forEach((u,a)=>{oe(u)||ae(u)||A(u)&&!u.aggregate&&(i=!0,te([ne,ee],u.channel)?e.wildcardIndex.hasEncodingProperty(a,g.CHANNEL)&&(c=!0):o=!0)}),i&&!o&&(c||n.constraintManuallySpecifiedValue))return!1}return!0}},{name:"omitAggregatePlotWithoutDimension",description:"Aggregate plots without dimension should be omitted",properties:[g.AGGREGATE,g.AUTOCOUNT,g.BIN,g.TIMEUNIT,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()||he(e.getEncodings(),o=>!!(Ne(o)||A(o)&&o.type==="temporal"))},{name:"omitBarLineAreaWithOcclusion",description:"Don't use bar, line or area to visualize raw plot as they often lead to occlusion.",properties:[g.MARK,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!te([me,tt,Ue],e.getMark())||e.isAggregate()},{name:"omitBarTickWithSize",description:"Do not map field to size channel with bar and tick mark",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.getMark();if(te([rt,me],o)&&e.channelEncodingField(Te)){if(n.constraintManuallySpecifiedValue)return!1;{const i=e.specQuery.encodings;for(let c=0;c<i.length;c++)if(i[c].channel===Te)return!e.wildcardIndex.hasEncodingProperty(c,g.CHANNEL)}}return!0}},{name:"omitBarAreaForLogScale",description:"Do not use bar and area mark for x and y's log scale",properties:[g.MARK,g.CHANNEL,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark(),i=e.getEncodings();if(o===Ue||o===me){for(let c of i)if(A(c)&&(c.channel===D||c.channel===_)&&c.scale&&De(c)===j.LOG)return!1}return!0}},{name:"omitMultipleNonPositionalChannels",description:"Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.specQuery.encodings;let i=0,c=!1;for(let u=0;u<o.length;u++){const a=o[u];if(oe(a)||ae(a))continue;const r=a.channel;if(!w(r)&&ys[r+""]&&(i+=1,e.wildcardIndex.hasEncodingProperty(u,g.CHANNEL)&&(c=!0),i>1&&(c||n.constraintManuallySpecifiedValue)))return!1}return!0}},{name:"omitNonPositionalOrFacetOverPositionalChannels",description:"Do not use non-positional channels unless all positional channels are used",properties:[g.CHANNEL],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const o=e.specQuery.encodings;let i=!1,c=!1,u=!1,a=!1;for(let r=0;r<o.length;r++){const s=o[r];if(oe(s)||ae(s))continue;const d=s.channel;d===D?u=!0:d===_?a=!0:w(d)||(i=!0,e.wildcardIndex.hasEncodingProperty(r,g.CHANNEL)&&(c=!0))}return!(c||n.constraintManuallySpecifiedValue&&i)||u&&a}},{name:"omitRaw",description:"Omit raw plots.",properties:[g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!!e.isAggregate()},{name:"omitRawContinuousFieldForAggregatePlot",description:"Aggregate plot should not use raw continuous field as group by values. (Quantitative should be binned. Temporal should have time unit.)",properties:[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN,g.TYPE],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){const o=e.specQuery.encodings;for(let i=0;i<o.length;i++){const c=o[i];if(!oe(c)&&!ae(c)&&(A(c)&&c.type===Q&&!c.timeUnit&&(e.wildcardIndex.hasEncodingProperty(i,g.TIMEUNIT)||n.constraintManuallySpecifiedValue)||c.type===R&&A(c)&&!c.bin&&!c.aggregate&&(e.wildcardIndex.hasEncodingProperty(i,g.BIN)||e.wildcardIndex.hasEncodingProperty(i,g.AGGREGATE)||e.wildcardIndex.hasEncodingProperty(i,g.AUTOCOUNT)||n.constraintManuallySpecifiedValue)))return!1}}return!0}},{name:"omitRawDetail",description:"Do not use detail channel with raw plot.",properties:[g.CHANNEL,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>!!e.isAggregate()||fe(e.specQuery.encodings,(o,i)=>!(!oe(o)&&!ae(o))||o.channel!==an||!e.wildcardIndex.hasEncodingProperty(i,g.CHANNEL)&&!n.constraintManuallySpecifiedValue)},{name:"omitRepeatedField",description:"Each field should be mapped to only one channel",properties:[g.FIELD],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{let o={},i={};const c=e.specQuery.encodings;for(let u=0;u<c.length;u++){const a=c[u];if(oe(a)||H(a))continue;let r;if(a.field&&!w(a.field)&&(r=a.field),H(a)&&!w(a.autoCount)&&(r="count_*"),r){if(e.wildcardIndex.hasEncodingProperty(u,g.FIELD)&&(i[r]=!0),o[r]&&(i[r]||n.constraintManuallySpecifiedValue))return!1;o[r]=!0}}return!0}},{name:"omitVerticalDotPlot",description:"Do not output vertical dot plot.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.getEncodings();return o.length!==1||o[0].channel!==_}},{name:"hasAppropriateGraphicTypeForMark",description:"Has appropriate graphic type for mark",properties:[g.CHANNEL,g.MARK,g.TYPE,g.TIMEUNIT,g.BIN,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const o=e.getMark();switch(o){case Ue:case tt:if(e.isAggregate()){const l=e.getEncodingQueryByChannel(D),f=e.getEncodingQueryByChannel(_),p=at(l),h=at(f);return l&&f&&p!==h&&!(A(l)&&!p&&te(["nominal","key"],l.type))&&!(A(f)&&!h&&te(["nominal","key"],f.type))}return!0;case Ot:return!0;case me:case rt:if(e.channelEncodingField(Te))return!1;{const l=e.getEncodingQueryByChannel(D),f=e.getEncodingQueryByChannel(_);return at(l)!==at(f)}case mn:const i=e.getEncodingQueryByChannel(D),c=e.getEncodingQueryByChannel(_),u=Ne(i),a=Ne(c),r=e.getEncodingQueryByChannel(de),s=at(r),d=!!A(r)&&r.type===ce;return(u&&a||u&&!e.channelUsed(_)||a&&!e.channelUsed(D))&&(!r||r&&(s||d));case kt:case nt:case Mt:case yn:return!0}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+o)}},{name:"omitInvalidStackSpec",description:"If stack is specified, must follow Vega-Lite stack rules",properties:[g.STACK,g.FIELD,g.CHANNEL,g.MARK,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{if(!e.wildcardIndex.hasProperty(g.STACK))return!0;const o=e.getVlStack();return(o!==null||e.getStackOffset()===null)&&o.fieldChannel===e.getStackChannel()}},{name:"omitNonSumStack",description:"Stack specifications that use non-summative aggregates should be omitted (even implicit ones)",properties:[g.CHANNEL,g.MARK,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getVlStack();if(o!=null){const i=e.getEncodingQueryByChannel(o.fieldChannel);if(!te(Pr,i.aggregate))return!1}return!0}},{name:"omitTableWithOcclusionIfAutoAddCount",description:"Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion",properties:[g.CHANNEL,g.TYPE,g.TIMEUNIT,g.BIN,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(n.autoAddCount){const o=e.getEncodingQueryByChannel("x"),i=e.getEncodingQueryByChannel("y");if((!A(o)||Ne(o))&&(!A(i)||Ne(i)))return!!e.isAggregate()&&fe(e.getEncodings(),c=>{let u=c.channel;return!(u!==D&&u!==_&&u!==ne&&u!==ee&&A(c)&&!c.aggregate)})}return!0}}].map(e=>new vs(e));Pi.reduce((e,t)=>(e[t.name()]=t,e),{});const bs=Pi.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J);function Ri(e,t,n,o,i){const c=bs.get(e)||[];for(const u of c)if((u.strict()||i[u.name()])&&!u.satisfy(n,o,i)){let a="(spec) "+u.name();return i.verbose&&console.log(a+" failed with "+n.toShorthand()+" for "+t.name),a}return null}const $t=new J;function $i(e){return(t,n,o)=>(i,c)=>{const u=t.encodingIndicesByProperty.get(e);return function a(r){if(r===u.length)return void i.push(c.duplicate());const s=u[r],d=t.encodings[s].get(e),l=c.getEncodingQueryByIndex(s),f=c.getEncodingProperty(s,e);oe(l)||ae(l)||!f?a(r+1):(d.enum.forEach(p=>{p===null&&(p=void 0),c.setEncodingProperty(s,e,p,d),!function(m,v,b,y,E,T){const S=gs.get(m)||[],N=y.getEncodingQueryByIndex(b);for(const O of S)if((O.strict()||T[O.name()])&&!O.satisfy(N,E,y.wildcardIndex.encodings[b],T)){let M="(enc) "+O.name();return T.verbose&&console.log(M+" failed with "+y.toShorthand()+" for "+v.name),M}const C=ms.get(m)||[];for(const O of C)if((O.strict()||T[O.name()])&&oe(N)&&!O.satisfy(N,E,y.wildcardIndex.encodings[b],T)){let M="(enc) "+O.name();return T.verbose&&console.log(M+" failed with "+y.toShorthand()+" for "+v.name),M}return null}(e,d,s,c,n,o)&&(Ri(e,d,c,n,o)||a(r+1))}),c.resetEncodingProperty(s,e,d))}(0),i}}function ct(e,t,n){return t=t||new J,n=n||new J,e.forEach(o=>{var i;i=o,k.isObject(i)&&i.property?(t.setByKey(o.property,!0),n.setByKey(o.property,o.replace)):t.setByKey(o,!0)}),{include:t,replaceIndex:n,replacer:Oa(n)}}$t.set("mark",(e,t,n)=>(o,i)=>(i.getMark().enum.forEach(c=>{i.setMark(c),Ri("mark",e.mark,i,t,n)||o.push(i.duplicate())}),i.resetMark(),o)),pn.forEach(e=>{$t.set(e,$i(e))}),Ct.forEach(e=>{$t.set(e,$i(e))});const Bi=[g.FIELD,g.TYPE,g.AGGREGATE,g.BIN,g.TIMEUNIT,g.STACK],xs=Bi.concat([{property:g.CHANNEL,replace:{x:"xy",y:"xy",color:"style",size:"style",shape:"style",opacity:"style",row:"facet",column:"facet"}}]);let Fn={};function Bt(e,t){Fn[e]=t}const Li=ct([g.FIELD]);Bt("field",e=>qe(e,Li.include,Li.replacer));const Wi=ct(Bi);Bt("fieldTransform",e=>qe(e,Wi.include,Wi.replacer));const Hi=ct(xs);Bt("encoding",e=>qe(e,Hi.include,Hi.replacer)),Bt("spec",e=>JSON.stringify(e));class Es{constructor(){this._mark=void 0,this._encodings={},this._encodingIndicesByProperty=new J}setEncodingProperty(t,n,o){const i=this._encodings;(i[t]=i[t]||new J).set(n,o);const c=this._encodingIndicesByProperty;return c.set(n,c.get(n)||[]),c.get(n).push(t),this}hasEncodingProperty(t,n){return!!this._encodings[t]&&this._encodings[t].has(n)}hasProperty(t){if(Ir(t))return this.encodingIndicesByProperty.has(t);if(t==="mark")return!!this.mark;throw new Error("Unimplemented for property "+t)}isEmpty(){return!this.mark&&this.encodingIndicesByProperty.size()===0}setMark(t){return this._mark=t,this}get mark(){return this._mark}get encodings(){return this._encodings}get encodingIndicesByProperty(){return this._encodingIndicesByProperty}}class Qt{constructor(t,n,o,i,c){this._rankingScore={},this._spec=t,this._channelFieldCount=t.encodings.reduce((u,a)=>(w(a.channel)||H(a)&&a.autoCount===!1||(u[a.channel+""]=1),u),{}),this._wildcardIndex=n,this._assignedWildcardIndex=c,this._opt=i,this._schema=o}static build(t,n,o){let i=new Es;if(w(t.mark)){const c=it(g.MARK);t.mark=xn(t.mark,c,o.enum.mark),i.setMark(t.mark)}if(t.encodings.forEach((c,u)=>{H(c)&&(console.warn("A field with autoCount should not be included as autoCount meant to be an internal object."),c.type=R),A(c)&&c.type===void 0&&(c.type=P),pn.forEach(a=>{if(w(c[a])){const r=it(a)+u,s=Tn(a,n,o),d=c[a]=xn(c[a],r,s);i.setEncodingProperty(u,a,d)}}),Ct.forEach(a=>{const r=c[a.parent];if(r){const s=a.child;if(w(r[s])){const d=it(a)+u,l=Tn(a,n,o),f=r[s]=xn(r[s],d,l);i.setEncodingProperty(u,a,f)}}})}),o.autoAddCount){const c={name:it(g.CHANNEL)+t.encodings.length,enum:Tn(g.CHANNEL,n,o)},u={name:it(g.AUTOCOUNT)+t.encodings.length,enum:[!1,!0]},a={channel:c,autoCount:u,type:R};t.encodings.push(a);const r=t.encodings.length-1;i.setEncodingProperty(r,g.CHANNEL,c),i.setEncodingProperty(r,g.AUTOCOUNT,u)}return new Qt(t,i,n,o,{})}get wildcardIndex(){return this._wildcardIndex}get schema(){return this._schema}get specQuery(){return this._spec}duplicate(){return new Qt(k.duplicate(this._spec),this._wildcardIndex,this._schema,this._opt,k.duplicate(this._assignedWildcardIndex))}setMark(t){const n=this._wildcardIndex.mark.name;this._assignedWildcardIndex[n]=this._spec.mark=t}resetMark(){const t=this._spec.mark=this._wildcardIndex.mark;delete this._assignedWildcardIndex[t.name]}getMark(){return this._spec.mark}getEncodingProperty(t,n){const o=this._spec.encodings[t];return pe(n)?o[n.parent][n.child]:o[n]}setEncodingProperty(t,n,o,i){const c=this._spec.encodings[t];n===g.CHANNEL&&c.channel&&!w(c.channel)&&this._channelFieldCount[c.channel]--,pe(n)?c[n.parent][n.child]=o:hn(n)&&o===!0?c[n]=k.extend({},c[n],{enum:void 0,name:void 0}):c[n]=o,this._assignedWildcardIndex[i.name]=o,n===g.CHANNEL&&(this._channelFieldCount[o]=(this._channelFieldCount[o]||0)+1)}resetEncodingProperty(t,n,o){const i=this._spec.encodings[t];n===g.CHANNEL&&this._channelFieldCount[i.channel]--,pe(n)?i[n.parent][n.child]=o:i[n]=o,delete this._assignedWildcardIndex[o.name]}channelUsed(t){return this._channelFieldCount[t]>0}channelEncodingField(t){return A(this.getEncodingQueryByChannel(t))}getEncodings(){return this._spec.encodings.filter(t=>!ae(t))}getEncodingQueryByChannel(t){for(let n of this._spec.encodings)if(n.channel===t)return n}getEncodingQueryByIndex(t){return this._spec.encodings[t]}isAggregate(){return he(this._spec.encodings,t=>A(t)&&!w(t.aggregate)&&!!t.aggregate||Dt(t))}getVlStack(){return Hr(this._spec)}getStackOffset(){return function(t){for(const n of t.encodings)if(n[g.STACK]!==void 0&&!w(n[g.STACK]))return n[g.STACK]}(this._spec)}getStackChannel(){return function(t){for(const n of t.encodings)if(n[g.STACK]!==void 0&&!w(n.channel))return n.channel;return null}(this._spec)}toShorthand(t){if(t){if(k.isString(t))return function(o,i){return Fn[i](o)}(this.specQuery,t);const n=ct(t);return qe(this._spec,n.include,n.replacer)}return qe(this._spec)}toSpec(t){if(w(this._spec.mark))return null;let n={};return(t=t||this._spec.data)&&(n.data=t),this._spec.transform&&(n.transform=this._spec.transform),n.mark=this._spec.mark,n.encoding=Qr(this.specQuery.encodings,{schema:this._schema,wildcardMode:"null"}),this._spec.width&&(n.width=this._spec.width),this._spec.height&&(n.height=this._spec.height),this._spec.background&&(n.background=this._spec.background),this._spec.padding&&(n.padding=this._spec.padding),this._spec.title&&(n.title=this._spec.title),n.encoding===null?null:((this._spec.config||this._opt.defaultSpecConfig)&&(n.config=k.extend({},this._opt.defaultSpecConfig,this._spec.config)),n)}getRankingScore(t){return this._rankingScore[t]}setRankingScore(t,n){this._rankingScore[t]=n}}function qi(e){return e.items!==void 0}function Dn(e){let t=e.items[0];for(;t&&qi(t);)t=t.items[0];return t}class Ge{constructor(t){this.type=t,this.scoreIndex=this.initScore()}getFeatureScore(t){const n=this.type,o=this.scoreIndex[t];if(o!==void 0)return{type:n,feature:t,score:o}}}var Z;(function(e){e[e.Q=R]="Q",e[e.BIN_Q="bin_"+R]="BIN_Q",e[e.T=Q]="T",e[e.TIMEUNIT_T="timeUnit_time"]="TIMEUNIT_T",e[e.TIMEUNIT_O="timeUnit_"+ce]="TIMEUNIT_O",e[e.O=ce]="O",e[e.N=ie]="N",e[e.K=le.KEY]="K",e[e.NONE="-"]="NONE"})(Z||(Z={}));const Gi=Z.Q,Lt=Z.BIN_Q,_n=Z.T,ze=Z.TIMEUNIT_T,Wt=Z.TIMEUNIT_O,Ht=Z.O,qt=Z.N,jn=Z.K,Gt=Z.NONE;function zt(e){return e.bin?Z.BIN_Q:e.timeUnit?Ie(De(e))?Z.TIMEUNIT_O:Z.TIMEUNIT_T:e.type}const Pn=-10;function q(e,t,n,o){return e+"_"+t+"_"+n+"_"+o}const Ts=[new class extends Ge{constructor(){super("Axis")}initScore(e={}){e=Object.assign({},ot,e);let t={};return[{feature:Lt,opt:"preferredBinAxis"},{feature:_n,opt:"preferredTemporalAxis"},{feature:ze,opt:"preferredTemporalAxis"},{feature:Wt,opt:"preferredTemporalAxis"},{feature:Ht,opt:"preferredOrdinalAxis"},{feature:qt,opt:"preferredNominalAxis"}].forEach(n=>{e[n.opt]===D?t[n.feature+"_"+_]=-.01:e[n.opt]===_&&(t[n.feature+"_"+D]=-.01)}),t}featurize(e,t){return e+"_"+t}getScore(e,t,n){return e.getEncodings().reduce((o,i)=>{if(A(i)||H(i)){const c=zt(i),u=this.featurize(c,i.channel),a=this.getFeatureScore(u);a&&o.push(a)}return o},[])}},new class extends Ge{constructor(){super("Dimension")}initScore(){return{row:-2,column:-2,color:0,opacity:0,size:0,shape:0}}getScore(e,t,n){return e.isAggregate()&&e.getEncodings().reduce((o,i)=>{if(H(i)||A(i)&&!i.aggregate){const c=this.getFeatureScore(i.channel+"");if(c&&c.score>o.score)return c}return o},{type:"Dimension",feature:"No Dimension",score:-5}),[]}},new class extends Ge{constructor(){super("Facet")}initScore(e){let t={};return(e=Object.assign({},ot,e)).preferredFacet===ne?t[ee]=-.01:e.preferredFacet===ee&&(t[ne]=-.01),t}getScore(e,t,n){return e.getEncodings().reduce((o,i)=>{if(A(i)||H(i)){const c=this.getFeatureScore(i.channel);c&&o.push(c)}return o},[])}},new class extends Ge{constructor(){super("Mark")}initScore(){return function(){const e=[Gi,_n],t=[Lt,Wt,Ht,qt,jn].concat([Gt]);let n={};e.forEach(o=>{e.forEach(i=>{V({point:0,text:-.2,tick:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c}),V({point:0,text:-.2,tick:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c})})}),e.forEach(o=>{t.forEach(i=>{V({tick:0,point:-.2,text:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c;const r=q(i,o,!0,u);n[r]=c})}),[ze].forEach(i=>{V({point:0,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c;const r=q(i,o,!0,u);n[r]=c})}),[Gt,qt,Ht,jn].forEach(i=>{V({bar:0,point:-.2,tick:-.25,text:-.3,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})}),[Lt].forEach(i=>{V({bar:0,point:-.2,tick:-.25,text:-.3,line:-.5,area:-.5,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})}),[ze,Wt].forEach(i=>{V({line:0,area:-.1,bar:-.2,point:-.3,tick:-.35,text:-.4,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})})}),[ze].forEach(o=>{[ze].forEach(i=>{const c={point:0,rect:-.1,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u})}),t.forEach(i=>{const c={tick:0,point:-.2,text:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(i,o,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u}),V(c,(u,a)=>{const r=q(i,o,!1,a);n[r]=u})})});for(const o of t)for(const i of t){const c={point:0,rect:0,text:-.1,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u})}return n}()}getScore(e,t,n){let o=e.getMark();o!==kt&&o!==Mt||(o=nt);const i=e.getEncodingQueryByChannel(D),c=i?zt(i):Gt,u=e.getEncodingQueryByChannel(_),a=c+"_"+(u?zt(u):Gt)+"_"+!e.isAggregate()+"_"+o,r=this.getFeatureScore(a);return r?[r]:(console.error("feature score missing for",a),[])}},new class extends Ge{constructor(){super("SizeChannel")}initScore(){return{bar_size:-2,tick_size:-2}}getScore(e,t,n){const o=e.getMark();return e.getEncodings().reduce((i,c)=>{if(A(c)||H(c)){const u=o+"_"+c.channel,a=this.getFeatureScore(u);a&&i.push(a)}return i},[])}},new class extends Ge{constructor(){super("TypeChannel")}initScore(){let e={};const t={x:0,y:0,size:-.575,color:-.725,text:-2,opacity:-3,shape:Pn,row:Pn,column:Pn,detail:-20};[Gi,_n,ze].forEach(i=>{k.keys(t).forEach(c=>{e[this.featurize(i,c)]=t[c]})});const n=k.extend({},t,{row:-.75,column:-.75,shape:-3.1,text:-3.2,detail:-4});[Lt,Wt,Ht].forEach(i=>{k.keys(n).forEach(c=>{e[this.featurize(i,c)]=n[c]})});const o={x:0,y:0,color:-.6,shape:-.65,row:-.7,column:-.7,text:-.8,detail:-2,size:-3,opacity:-3.1};return k.keys(o).forEach(i=>{e[this.featurize(qt,i)]=o[i],e[this.featurize(jn,i)]=te(["x","y","detail"],i)?-1:o[i]-2}),e}featurize(e,t){return e+"_"+t}getScore(e,t,n){const o=e.getEncodings().reduce((c,u)=>{if(A(u)||H(u)){const a=zr(u);(c[a]=c[a]||[]).push(u)}return c},{}),i=[];return V(o,c=>{const u=c.reduce((a,r)=>{if(A(r)||H(r)){const s=zt(r),d=this.featurize(s,r.channel),l=this.getFeatureScore(d);if(a===null||l.score>a.score)return l}return a},null);i.push(u)}),i}}],Ce="aggregationQuality";let zi={};function Rn(e,t){zi[e]=t}function Yi(e,t,n,o){return t.nest&&o!==t.nest.length?(e.items.forEach(i=>{Yi(i,t,n,o+1)}),t.nest[o].orderGroupBy&&e.items.sort(function(i,c,u){return(a,r)=>{const s=Dn(a),d=Dn(r);return Qi(i instanceof Array?i:[i],s,d,c,u)}}(t.nest[o].orderGroupBy,n,t.config))):(t.orderBy||t.chooseBy)&&(e.items.sort(function(i,c,u){return(a,r)=>Qi(i instanceof Array?i:[i],a,r,c,u)}(t.orderBy||t.chooseBy,n,t.config)),t.chooseBy&&e.items.length>0&&e.items.splice(1)),e}function Qi(e,t,n,o,i){for(let c of e){let u=Vi(n,c,o,i).score-Vi(t,c,o,i).score;if(u!==0)return u}return 0}function Vi(e,t,n,o){if(e.getRankingScore(t)!==void 0)return e.getRankingScore(t);const i=function(u){return zi[u]}(t),c=i(e,n,o);return e.setRankingScore(t,c),c}function Ss(e,t,n){let o={};return e=e.map(function(i){return n.smallRangeStepForHighCardinalityOrFacet&&(i=function(c,u,a,r){[ne,_,ee,D].forEach(l=>{a[l]=c.getEncodingQueryByChannel(l)});const s=a[_];if(s!==void 0&&A(s)&&(a[ne]||u.cardinality(s)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){s.scale===void 0&&(s.scale={});const l=De(s);s.scale&&(l===void 0||Ie(l))&&(s.scale.rangeStep||(s.scale.rangeStep=12))}const d=a[D];if(A(d)&&(a[ee]||u.cardinality(d)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){d.scale===void 0&&(d.scale={});const l=De(d);d.scale&&(l===void 0||Ie(l))&&(d.scale.rangeStep||(d.scale.rangeStep=12))}return c}(i,t,o,n)),n.nominalColorScaleForHighCardinality&&(i=function(c,u,a,r){a[de]=c.getEncodingQueryByChannel(de);const s=a[de];return A(s)&&s!==void 0&&(s.type===ie||s.type===le.KEY)&&u.cardinality(s)>r.nominalColorScaleForHighCardinality.maxCardinality&&(s.scale===void 0&&(s.scale={}),s.scale&&(s.scale.range||(s.scale.scheme=r.nominalColorScaleForHighCardinality.palette))),c}(i,t,o,n)),n.xAxisOnTopForHighYCardinalityWithoutColumn&&(i=function(c,u,a,r){if([ee,D,_].forEach(s=>{a[s]=c.getEncodingQueryByChannel(s)}),a[ee]===void 0){const s=a[D],d=a[_];A(s)&&A(d)&&d!==void 0&&d.field&&Ie(De(d))&&s!==void 0&&u.cardinality(d)>r.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality&&(s.axis===void 0&&(s.axis={}),s.axis&&!s.axis.orient&&(s.axis.orient="top"))}return c}(i,t,o,n)),i}),e}function ws(e,t,n=ot){const o=Qt.build(e,t,n),i=o.wildcardIndex;let c=[o];return n.propertyPrecedence.forEach(u=>{const a=function(r){const s=r.split(".");if(s.length===1)return r;if(s.length===2)return{parent:s[0],child:s[1]};throw"Invalid property key with "+s.length+" dots: "+r}(u);if(i.hasProperty(a)){const r=function(d){return $t.get(d)}(a),s=r(i,t,n);c=c.reduce(s,[])}}),!n.stylize||n.nominalColorScaleForHighCardinality===null&&n.smallRangeStepForHighCardinalityOrFacet===null&&n.xAxisOnTopForHighYCardinalityWithoutColumn===null?c:Ss(c,t,n)}function Ki(e,t,n){return e=Object.assign({},function(o){if(o.groupBy){let i={groupBy:o.groupBy};o.orderBy&&(i.orderGroupBy=o.orderBy);let c={spec:k.duplicate(o.spec),nest:[i]};return o.chooseBy&&(c.chooseBy=o.chooseBy),o.config&&(c.config=o.config),c}return k.duplicate(o)}(e),{config:Object.assign({},ot,n,e.config)}),{query:e,result:Yi(function(o,i){if(i){const c={name:"",path:"",items:[]};let u={},a=[],r=[],s=[];for(let d=0;d<i.length;d++){a.push(d>0?a[d-1].duplicate():new J),r.push(d>0?r[d-1].duplicate():new J);const l=i[d].groupBy;if(k.isArray(l)){let f=ct(l,a[d],r[d]);s.push(f.replacer)}}return o.forEach(d=>{let l="",f=c;for(let p=0;p<i.length;p++){const h=f.groupBy=i[p].groupBy;f.orderGroupBy=i[p].orderGroupBy;const m=k.isArray(h)?qe(d.specQuery,a[p],s[p]):Fn[h](d.specQuery);l+="/"+m,u[l]||(u[l]={name:m,path:l,items:[]},f.items.push(u[l])),f=u[l]}f.items.push(d)}),c}return{name:"",path:"",items:o}}(ws(e.spec,t,e.config),e.nest),e,t,0)}}Rn("effectiveness",function(e,t,n){const o=Ts.reduce((i,c)=>{const u=c.getScore(e,t,n);return i.concat(u)},[]);return{score:o.reduce((i,c)=>i+c.score,0),features:o}}),Rn(Ce,function(e,t,n){const o=function(i){const c=i.getEncodings();if(i.isAggregate()){if(he(c,u=>A(u)&&(u.type===R&&!u.bin&&!u.aggregate||u.type===Q&&!u.timeUnit)))return{type:Ce,score:.1,feature:"Aggregate with raw continuous"};if(he(c,u=>A(u)&&Ne(u))){let u=he(c,r=>A(r)&&r.aggregate==="count"||Dt(r)),a=he(c,r=>A(r)&&!!r.bin);return u?{type:Ce,score:.8,feature:"Aggregate with count"}:a?{type:Ce,score:.7,feature:"Aggregate with bin but without count"}:{type:Ce,score:.9,feature:"Aggregate without count and without bin"}}return{type:Ce,score:.3,feature:"Aggregate without dimension"}}return he(c,u=>A(u)&&!Ne(u))?{type:Ce,score:1,feature:"Raw with measure"}:{type:Ce,score:.2,feature:"Raw without measure"}}(e);return{score:o.score,features:[o]}}),Rn("fieldOrder",function(e,t,n){const o=e.wildcardIndex.encodingIndicesByProperty.get("field");if(!o)return{score:0,features:[]};const i=e.specQuery.encodings,c=t.fieldSchemas.length,u=[];let a=0,r=1;for(let s=o.length-1;s>=0;s--){const d=o[s],l=i[d];let f;if(!A(l))continue;f=l.field;const p=e.wildcardIndex.encodings[d].get("field"),h=t.fieldSchema(f).index,m=-h*r;a+=m,u.push({score:m,type:"fieldOrder",feature:`field ${p.name} is ${f} (#${h} in the schema)`}),r*=c}return{score:a,features:u}});const Ye={[L.BOOLEAN]:x.jsx(yo,{className:"h-5 w-5 inline-flex opacity-60"}),[L.DATETIME]:x.jsx(mo,{className:"h-5 w-5 inline-flex opacity-60"}),[L.NUMBER]:x.jsx(go,{className:"h-5 w-5 inline-flex opacity-60"}),[L.STRING]:x.jsx(ho,{className:"h-5 w-5 inline-flex opacity-60"}),[L.INTEGER]:x.jsx(Wo,{className:"h-5 w-5 inline-flex opacity-60"})},Ns=e=>{const t=Ee.c(26),{schema:n}=e,[o,i]=Yn.useState(),[c,u]=Yn.useState();let a;if(t[0]!==n||t[1]!==o||t[2]!==c){const r=n.fieldNames(),s=o?n.stats({field:o,channel:"x"}):void 0;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=x.jsx(Lo,{className:"text-muted-foreground",width:40,height:40,strokeWidth:1.5}),t[4]=d):d=t[4];const l=d,f=c?r:r.slice(0,12),p=r.length>12,h=r.length>0?r.length:"No";let m,v;t[5]!==h?(m=x.jsxs("span",{className:"text-muted-foreground font-semibold",children:[h," fields"]}),t[5]=h,t[6]=m):m=t[6],t[7]!==n||t[8]!==o?(v=I=>{const F=n.cardinality({channel:"x",field:I});return x.jsxs("span",{className:vo("hover:bg-muted self-start px-2 py-2 rounded flex flex-row gap-1 items-center cursor-pointer lg:justify-center text-sm truncate flex-shrink-0 overflow-hidden",o===I&&"bg-muted"),onClick:()=>{i(o!==I?I:void 0)},children:[Ye[n.primitiveType(I)],I,F>1&&x.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",F,")"]})]},I)},t[7]=n,t[8]=o,t[9]=v):v=t[9];const b=f.map(v);let y,E;t[10]!==p||t[11]!==c?(y=p&&x.jsx(Qn,{"data-testid":"marimo-plugin-data-explorer-show-more-columns",variant:"link",size:"sm",className:"self-center col-span-3 -mt-1",onClick:()=>u(Os),children:c?"Show less":"Show more"}),t[10]=p,t[11]=c,t[12]=y):y=t[12],t[13]!==b||t[14]!==y?(E=x.jsxs("div",{className:"hidden lg:grid grid-cols-2 xl:grid-cols-3 gap-2 p-2 bg-[var(--slate-1)] border rounded lg:items-center items-start w-fit grid-flow-dense max-h-[300px] overflow-auto",children:[b,y]}),t[13]=b,t[14]=y,t[15]=E):E=t[15];const T=o||"",S=r.length===0;let N,C,O,M,U;t[16]===Symbol.for("react.memo_cache_sentinel")?(N=I=>{i(I)},t[16]=N):N=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(C=x.jsx(pt,{className:"min-w-[210px] h-full",children:x.jsx(Vn,{placeholder:"Select a column"})}),t[17]=C):C=t[17],t[18]!==n?(O=n.fieldNames().map(I=>x.jsx(ke,{value:I.toString(),children:x.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[Ye[n.primitiveType(I)],x.jsx("span",{className:"flex-1",children:I}),x.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",n.vlType(I),")"]})]})},I)),t[18]=n,t[19]=O):O=t[19],t[20]!==O?(M=x.jsx(ht,{children:x.jsx(Ke,{children:O})}),t[20]=O,t[21]=M):M=t[21],t[22]!==S||t[23]!==M||t[24]!==T?(U=x.jsx("div",{className:"lg:hidden",children:x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-column-select",value:T,disabled:S,onValueChange:N,children:[C,M]})}),t[22]=S,t[23]=M,t[24]=T,t[25]=U):U=t[25],a=x.jsxs("div",{className:"flex flex-col justify-center items-center h-full flex-1 gap-2",children:[l,m,E,U,o&&x.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2 p-2 text-sm",children:Cs.map(I=>x.jsxs("div",{className:"flex flex-row gap-2 min-w-[100px]",children:[x.jsx("span",{className:"font-semibold",children:I}),x.jsx("span",{children:As(s==null?void 0:s[I])})]},I))})]}),t[0]=n,t[1]=o,t[2]=c,t[3]=a}else a=t[3];return a},Cs=["distinct","min","max","mean","median","q1","q3","stdev"];function As(e){return typeof e=="number"?new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e):typeof e=="string"?e:typeof e=="object"&&e instanceof Date?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(e):String(e)}function Os(e){return!e}function ks(e){return e?e==="bin"?{bin:!0}:Ro(e)?{aggregate:e}:function(t){return t?Ji.includes(t)||Xi.includes(t):!1}(e)?{timeUnit:e}:{}:{}}const Ms=["bin","min","max","mean","median","sum"],Ji=["year","month","date","day","hours","minutes","seconds","milliseconds"],Xi=["yearmonth","yearmonthdate","monthdate"],Is=[P,"area","bar","circle","geoshape","line","point","rect","rule","square","text","tick","trail"],Us={type:"histograms",limit:12,createQuery:e=>({spec:{data:e.spec.data,mark:P,transform:e.spec.transform,encodings:[{channel:P,bin:P,timeUnit:P,field:P,type:P},{channel:P,aggregate:"count",field:"*",type:"quantitative"}]},groupBy:"fieldTransform",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!1}})};function Zi(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function Fs(e){const{aggregate:t,bin:n,timeUnit:o,field:i,scale:c,legend:u,axis:a,sort:r,description:s}=e;let{type:d}=e;if(w(d))throw new Error("Wildcard not support");d==="ordinal"&&(bo.warn("Ordinal type is not supported. Using nominal type instead."),d="nominal");const l=function(f){const{aggregate:p,bin:h,timeUnit:m}=f;return h?"bin":p?p.toString():m?m.toString():void 0}({aggregate:t,bin:n,timeUnit:o});return xo(i!==void 0,"Field is required for fieldQ"),Zi({field:i,fn:l,type:d,sort:r,scale:c,axis:a,legend:u,description:s})}function Ds(e){return e?Object.entries(e).map(([t,n])=>function(o,i){const{fn:c,...u}=o;return{channel:i,...ks(c),...u}}(n,t)):[]}function $n(e){const{type:t,limit:n,additionalFieldQuery:o}=e;return{type:t,limit:n,createQuery:i=>({spec:{...i.spec,encodings:[...i.spec.encodings,o]},groupBy:"field",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!0}})}}const _s=$n({type:"addCategoricalField",limit:4,additionalFieldQuery:{channel:P,field:P,type:"nominal"}}),js=$n({type:"addQuantitativeField",limit:4,additionalFieldQuery:{channel:P,bin:P,aggregate:P,field:P,type:"quantitative"}}),Ps=$n({type:"addTemporalField",limit:2,additionalFieldQuery:{channel:P,hasFn:!0,timeUnit:P,field:P,type:"temporal"}});function eo(e){return e.encodings.length===0}function to(e){let t=!1,n=!1,o=!1;for(const i of e.encodings)oe(i)||(H(i)?w(i.autoCount)&&(n=!0):(w(i.field)&&(t=!0),(w(i.aggregate)||w(i.bin)||w(i.timeUnit))&&(n=!0),w(i.channel)&&(o=!0)));return{hasAnyWildcard:o||t||n,hasWildcardField:t,hasWildcardFn:n,hasWildcardChannel:o}}const no={name:"source"};function Rs(e,t){const n={},{hasOpenPosition:o,hasStyleChannel:i,hasOpenFacet:c}=function(u){let a=!1,r=!1,s=!1;return u.encodings.forEach(d=>{d.channel==="x"||d.channel==="y"?a=!0:d.channel==="row"||d.channel==="column"?s=!0:typeof d.channel=="string"&&$o(Bo,d.channel)&&(r=!0)}),{hasOpenPosition:a,hasStyleChannel:r,hasOpenFacet:s}}(e.spec);return(o||i)&&(n.addQuantitativeField=Yt(js,e,t)),(o||i||c)&&(n.addCategoricalField=Yt(_s,e,t)),o&&(n.addTemporalField=Yt(Ps,e,t)),n}function Bn(e,t){return eo(e.spec)?{plots:[],query:e,limit:1}:{plots:[ro(Ki(e,t).result,no)[0]],query:e,limit:1}}function Yt(e,t,n){const o=e.createQuery(t);return{plots:ro(Ki(o,n).result,no),query:o,limit:e.limit}}function ro(e,t){return e.items.map(n=>qi(n)?io(t,Dn(n)):io(t,n))}function io(e,t){return{fieldInfos:t.getEncodings().filter(A).map(n=>({fieldDef:Fs(n),channel:n.channel})),spec:t.toSpec(e)}}function $s(e){const{spec:t,autoAddCount:n}=e,o=function(r){return{mark:r.mark,encodings:Ds(r.encoding),config:r.config}}(t),{hasAnyWildcard:i,hasWildcardFn:c,hasWildcardField:u}=to(o),a=function(r){const{hasWildcardFn:s,hasWildcardField:d}=r;return s?"fieldTransform":d?"field":"encoding"}({hasWildcardFn:c,hasWildcardField:u});return{spec:o,groupBy:a,orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:i?{autoAddCount:n}:void 0}}const{valueAtom:Qe,useActions:Bs}=Eo(function(){return{mark:P,encoding:{},config:{},schema:null}},{setSchema:(e,t)=>({...e,schema:t}),setMark:(e,t)=>({...e,mark:t}),setEncoding:(e,t)=>{const n=Zi({...e.encoding,...t});return{...e,encoding:n}},set:(e,t)=>{const{schema:n,...o}=t;return{...e,...o}}});function oo(){return Bs()}const Ls=To(e=>{const t=e(Qe);if(!t.schema)return{};const n=$s({spec:t,autoAddCount:!0});return eo(n.spec)?{main:Bn(n,t.schema),histograms:Yt(Us,n,t.schema)}:function(o){return!to(o).hasAnyWildcard}(n.spec)&&!function(o){const i=new Set(o.encodings.map(a=>a.channel)),c=["x","y","color"].every(a=>i.has(a)),u=["row","column"].some(a=>i.has(a));return c&&u}(n.spec)?{main:Bn(n,t.schema),...Rs(n,t.schema)}:{main:Bn(n,t.schema)}}),Ws=["x","y","row","column"],Hs=["color","size","shape"],qs=e=>{const t=Ee.c(26),{schema:n,mark:o}=e,i=Kt(Qe),c=oo(),u=i.encoding.x&&i.encoding.y;let a;t[0]!==c||t[1]!==u||t[2]!==n||t[3]!==i.encoding?(a=S=>{const N=(S==="row"||S==="column")&&!u;return x.jsx(Gs,{schema:n,label:S,disabled:N,fieldDefinition:i.encoding[S],onChange:C=>c.setEncoding({[S]:C})},S)},t[0]=c,t[1]=u,t[2]=n,t[3]=i.encoding,t[4]=a):a=t[4];const r=a;let s,d,l,f,p;t[5]!==o?(s=o.toString(),t[5]=o,t[6]=s):s=t[6],t[7]!==c?(d=S=>c.setMark(S),t[7]=c,t[8]=d):d=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(l=x.jsx(pt,{children:x.jsx(Vn,{placeholder:"Mark"})}),t[9]=l):l=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=x.jsx(ht,{children:x.jsxs(Ke,{children:[x.jsx(Kn,{children:"Mark"}),Is.map(Ys)]})}),t[10]=f):f=t[10],t[11]!==s||t[12]!==d?(p=x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-mark-select",value:s,onValueChange:d,children:[l,f]}),t[11]=s,t[12]=d,t[13]=p):p=t[13];const h=p;let m,v,b,y,E,T;return t[14]===Symbol.for("react.memo_cache_sentinel")?(m=x.jsx("span",{className:"col-span-2 flex items-center justify-between w-full",children:x.jsx("div",{className:"text-sm font-semibold",children:"Encodings"})}),t[14]=m):m=t[14],t[15]!==r?(v=Ws.map(r),t[15]=r,t[16]=v):v=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(b=x.jsx("div",{children:"Mark"}),t[17]=b):b=t[17],t[18]!==h?(y=x.jsxs("span",{className:"col-span-2 text-sm font-semibold w-full border-t border-divider flex items-center justify-between pt-2 pr-[30px]",children:[b,h]}),t[18]=h,t[19]=y):y=t[19],t[20]!==r?(E=Hs.map(r),t[20]=r,t[21]=E):E=t[21],t[22]!==y||t[23]!==E||t[24]!==v?(T=x.jsxs("div",{className:"grid gap-x-2 gap-y-4 justify-items-start py-3 pl-4 pr-2 bg-[var(--slate-1)] border rounded items-center grid-template-columns-[repeat(2,_minmax(0,_min-content))] self-start",children:[m,v,y,E]}),t[22]=y,t[23]=E,t[24]=v,t[25]=T):T=t[25],T},Gs=e=>{const t=Ee.c(43),{label:n,schema:o,fieldDefinition:i,disabled:c,onChange:u}=e;let a;t[0]!==i||t[1]!==o?(a=()=>{if(!i)return"--";if(i.field==="*")return x.jsxs("span",{className:"flex gap-2 flex-1",children:[Ye[L.NUMBER],x.jsx("span",{className:"text-left flex-1",children:"Count"})]});const F=i.field.toString();return x.jsxs("span",{className:"flex gap-2 flex-1",children:[Ye[o.primitiveType(F)],x.jsx("span",{className:"text-left flex-1",children:i.fn?`${i.fn}(${i.field})`:F})]})},t[0]=i,t[1]=o,t[2]=a):a=t[2];const r=a;let s;t[3]!==u?(s=()=>{u(void 0)},t[3]=u,t[4]=s):s=t[4];const d=s;let l;t[5]!==(i==null?void 0:i.field)?(l=(i==null?void 0:i.field.toString())??"",t[5]=i==null?void 0:i.field,t[6]=l):l=t[6];const f=l;let p,h;t[7]!==n?(p=x.jsx(So,{className:"text-[var(--slate-11)] font-semibold",children:n}),t[7]=n,t[8]=p):p=t[8],t[9]!==u||t[10]!==o?(h=F=>{u(F==="*"?{field:"*",fn:"count",type:"quantitative"}:{field:F,type:o.vlType(F)})},t[9]=u,t[10]=o,t[11]=h):h=t[11];const m=f?d:void 0;let v,b,y,E,T,S,N,C,O,M,U,I;return t[12]!==r?(v=r(),t[12]=r,t[13]=v):v=t[13],t[14]!==m||t[15]!==v?(b=x.jsx(pt,{className:"min-w-[140px] lg:min-w-[210px] h-full",onClear:m,children:v}),t[14]=m,t[15]=v,t[16]=b):b=t[16],t[17]!==o?(y=o.fieldNames().map(F=>x.jsx(ke,{value:F.toString(),children:x.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[Ye[o.primitiveType(F)],x.jsx("span",{className:"flex-1",children:F}),x.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",o.vlType(F),")"]})]})},F)),t[17]=o,t[18]=y):y=t[18],t[19]!==o?(E=o.fieldNames().length===0&&x.jsx(ke,{disabled:!0,value:"--",children:"No columns"}),t[19]=o,t[20]=E):E=t[20],t[21]===Symbol.for("react.memo_cache_sentinel")?(T=x.jsx(Jn,{}),t[21]=T):T=t[21],t[22]===Symbol.for("react.memo_cache_sentinel")?(S=x.jsx(ke,{value:"*",children:x.jsxs("span",{className:"flex items-center gap-1 flex-1",children:[Ye[L.NUMBER],x.jsx("span",{className:"flex-1",children:"Count"})]})},"*"),t[22]=S):S=t[22],t[23]!==E||t[24]!==y?(N=x.jsx(ht,{children:x.jsxs(Ke,{children:[y,E,T,S]})}),t[23]=E,t[24]=y,t[25]=N):N=t[25],t[26]!==c||t[27]!==f||t[28]!==N||t[29]!==h||t[30]!==b?(C=x.jsxs(gt,{value:f,disabled:c,onValueChange:h,children:[b,N]}),t[26]=c,t[27]=f,t[28]=N,t[29]=h,t[30]=b,t[31]=C):C=t[31],t[32]!==i||t[33]!==u?(O=i&&x.jsx(zs,{field:i,onChange:u}),t[32]=i,t[33]=u,t[34]=O):O=t[34],t[35]!==O?(M=x.jsx("div",{className:"w-[26px]",children:O}),t[35]=O,t[36]=M):M=t[36],t[37]!==C||t[38]!==M?(U=x.jsxs("div",{className:"flex flex-row gap-1 h-[26px]",children:[C,M]}),t[37]=C,t[38]=M,t[39]=U):U=t[39],t[40]!==U||t[41]!==p?(I=x.jsxs(x.Fragment,{children:[p,U]}),t[40]=U,t[41]=p,t[42]=I):I=t[42],I},Ln="__",zs=e=>{const t=Ee.c(15),{field:n,onChange:o}=e;if(n.field==="*")return null;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],t[0]=i):i=t[0];let c=i;if(n.type===le.QUANTITATIVE){let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=[["",Ms]],t[1]=u):u=t[1],c=u}if(n.type===le.TEMPORAL){let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=[["Single",Ji],["Multi",Xi]],t[2]=u):u=t[2],c=u}if(c.length>0){let u,a,r,s,d,l;return t[3]!==n||t[4]!==o?(u=f=>{o({...n,fn:f===Ln?void 0:f})},t[3]=n,t[4]=o,t[5]=u):u=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(a=x.jsx(pt,{className:"h-full px-1",hideChevron:!0,variant:"ghost",children:x.jsx(No,{size:14,strokeWidth:1.5})}),t[6]=a):a=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(r=x.jsx(Ke,{children:x.jsx(ke,{value:Ln,children:"None"})}),s=x.jsx(Jn,{}),t[7]=r,t[8]=s):(r=t[7],s=t[8]),t[9]!==c?(d=x.jsxs(ht,{children:[r,s,c.map(Vs)]}),t[9]=c,t[10]=d):d=t[10],t[11]!==n.fn||t[12]!==u||t[13]!==d?(l=x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-field-options",value:n.fn,onValueChange:u,children:[a,d]}),t[11]=n.fn,t[12]=u,t[13]=d,t[14]=l):l=t[14],l}return null};function Ys(e){return x.jsx(ke,{value:e,children:e===P?"auto":e},e)}function Qs(e){return x.jsx(ke,{value:e??Ln,children:wo(e)},e)}function Vs(e){const[t,n]=e;return x.jsxs(Ke,{children:[t&&x.jsx(Kn,{children:t}),n.map(Qs)]},t)}const Ks=e=>{const t=Ee.c(5);let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=Co(),t[0]=o):o=t[0],n=o;const i=n;let c,u;return t[1]!==e?(c=()=>{const a=i.sub(Qe,()=>{const s=i.get(Qe),{schema:d,...l}=s;e.setValue(l)}),r=e.value;return r&&Object.keys(r).length>0&&i.set(Qe,r),a},t[1]=e,t[2]=c):c=t[2],Ao(c),t[3]!==e?(u=x.jsx(Oo,{store:i,children:x.jsx(ao,{...e})}),t[3]=e,t[4]=u):u=t[4],u},Js={export:{svg:!0,png:!0},source:!1,compiled:!1,editor:!1},Xs={left:20,right:20,top:20,bottom:20},ao=e=>{var Ae,ye,ve,be,lt,Wn;const t=Ee.c(43),{data:n}=e,o=oo();let i,c;t[0]!==o||t[1]!==n?(i=async()=>{if(!n)return{};const $=await Io(n,{type:"csv",parse:"auto"},{replacePeriod:!0}),Pe=function(xe,z={},Ve={fields:[]}){z=k.extend({},ot,z);let so=fs.summary(xe),Hn=ds.inferAll(xe),co=Ve.fields.reduce((B,se)=>(B[se.name]=se,B),{}),qn=so.map(function(B,se){const Re=B.field,ut=Hn[Re]==="date"?L.DATETIME:Hn[Re];let Oe,Vt=B.distinct;if(ut===L.NUMBER)Oe=R;else if(ut===L.INTEGER)Oe=Vt<z.numberNominalLimit&&Vt/B.count<z.numberNominalProportion?ie:R;else if(ut===L.DATETIME){Oe=Q,B.min=new Date(xe[0][Re]),B.max=new Date(xe[0][Re]);for(const fo of xe){const ft=new Date(fo[Re]).getTime();ft<B.min.getTime()&&(B.min=new Date(ft)),ft>B.max.getTime()&&(B.max=new Date(ft))}}else Oe=ie;Oe===ie&&Vt/B.count>z.minPercentUniqueForKey&&B.count>z.minCardinalityForKey&&(Oe=le.KEY);let dt={name:Re,originalIndex:se,vlType:Oe,type:ut,stats:B,timeStats:{},binStats:{}};const uo=co[dt.name];return dt=k.extend(dt,uo),dt});for(let B of qn)if(B.vlType===R)for(let se of z.enum.binProps.maxbins)B.binStats[se]=Mi(se,B.stats);else if(B.vlType===Q)for(let se of z.enum.timeUnit)se!==void 0&&(B.timeStats[se]=Ii(se,B.stats));const lo=Object.assign({},Ve,{fields:qn});return new hs(lo)}($);return o.setSchema(Pe),{chartData:$,schema:Pe}},t[0]=o,t[1]=n,t[2]=i):i=t[2],t[3]!==n?(c=[n],t[3]=n,t[4]=c):c=t[4];const{data:u,isPending:a,error:r}=ko(i,c),{mark:s}=Kt(Qe),d=Kt(Ls),{theme:l}=Mo();if(r){let $;return t[5]!==r?($=x.jsx(Uo,{error:r}),t[5]=r,t[6]=$):$=t[6],$}if(!u){let $;return t[7]===Symbol.for("react.memo_cache_sentinel")?($=x.jsx("div",{}),t[7]=$):$=t[7],$}const{chartData:f,schema:p}=u;if(a||!p){let $;return t[8]===Symbol.for("react.memo_cache_sentinel")?($=x.jsx("div",{}),t[8]=$):$=t[8],$}const h=(ye=(Ae=d.main)==null?void 0:Ae.plots)==null?void 0:ye[0];let m;t[9]!==(h==null?void 0:h.fieldInfos)?(m=new Set(h==null?void 0:h.fieldInfos.map(nc)),t[9]=h==null?void 0:h.fieldInfos,t[10]=m):m=t[10];const v=m;let b;t[11]!==f||t[12]!==h||t[13]!==p||t[14]!==l?(b=()=>h?x.jsx("div",{className:"flex overflow-y-auto justify-center items-center flex-1 w-[90%]",children:x.jsx(Xn,{data:{source:f},padding:Xs,actions:Js,spec:tc(h.spec),theme:l==="dark"?"dark":void 0})}):x.jsx(Ns,{schema:p}),t[11]=f,t[12]=h,t[13]=p,t[14]=l,t[15]=b):b=t[15];const y=b;let E,T,S;t[16]!==s||t[17]!==p?(E=x.jsx(qs,{mark:s,schema:p}),t[16]=s,t[17]=p,t[18]=E):E=t[18],t[19]!==y?(T=y(),t[19]=y,t[20]=T):T=t[20],t[21]!==E||t[22]!==T?(S=x.jsxs("div",{className:"flex items-center gap-2",children:[E,T]}),t[21]=E,t[22]=T,t[23]=S):S=t[23];const N=(ve=d.histograms)==null?void 0:ve.plots,C=(be=d.addCategoricalField)==null?void 0:be.plots,O=(lt=d.addQuantitativeField)==null?void 0:lt.plots,M=(Wn=d.addTemporalField)==null?void 0:Wn.plots;let U,I,F;if(t[24]!==o||t[25]!==f||t[26]!==v||t[27]!==O||t[28]!==M||t[29]!==N||t[30]!==C||t[31]!==l){let $;t[33]!==o||t[34]!==f||t[35]!==v||t[36]!==l?($=(Pe,xe)=>x.jsx(ec,{title:x.jsx("div",{className:"flex flex-row gap-1",children:Pe.fieldInfos.map(z=>{const Ve=z.fieldDef.field==="*"?"Count":z.fieldDef.fn?`${z.fieldDef.fn}(${z.fieldDef.field})`:z.fieldDef.field.toString();return x.jsx(jo,{variant:v.has(z.fieldDef.field)?"secondary":"defaultOutline",children:Ve},Ve)})}),actions:x.jsx(Fo,{content:"Make main plot",children:x.jsx(Qn,{"data-testid":"marimo-plugin-data-explorer-make-main-plot",variant:"text",size:"icon",onClick:()=>{const z=_o.fromEntries(Pe.fieldInfos.map(rc));o.setEncoding(z)},children:x.jsx(Do,{className:"w-4 h-4"})})}),children:x.jsx(Xn,{data:{source:f},actions:!1,spec:Pe.spec,theme:l==="dark"?"dark":void 0},xe)},xe),t[33]=o,t[34]=f,t[35]=v,t[36]=l,t[37]=$):$=t[37],U=[N,C,O,M].filter(Boolean).flat().map($),t[24]=o,t[25]=f,t[26]=v,t[27]=O,t[28]=M,t[29]=N,t[30]=C,t[31]=l,t[32]=U}else U=t[32];return t[38]!==U?(I=x.jsx(Zs,{children:U}),t[38]=U,t[39]=I):I=t[39],t[40]!==I||t[41]!==S?(F=x.jsxs("div",{className:"flex flex-col gap-2",children:[S,I]}),t[40]=I,t[41]=S,t[42]=F):F=t[42],F},Zs=e=>{const t=Ee.c(2),{children:n}=e;if(Po.Children.count(n)===0)return null;let o;return t[0]!==n?(o=x.jsx("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden gap-4 snap-x pb-4",children:n}),t[0]=n,t[1]=o):o=t[1],o},ec=e=>{const t=Ee.c(10),{title:n,children:o,actions:i}=e;let c,u,a,r;return t[0]!==n?(c=x.jsx("div",{className:"text-sm font-medium",children:n}),t[0]=n,t[1]=c):c=t[1],t[2]!==i||t[3]!==c?(u=x.jsxs("div",{className:"flex flex-row justify-between items-center bg-[var(--slate-3)] py-0.5 px-2",children:[c,i]}),t[2]=i,t[3]=c,t[4]=u):u=t[4],t[5]!==o?(a=x.jsx("div",{className:"px-6 pt-2 max-h-[280px] overflow-y-auto",children:o}),t[5]=o,t[6]=a):a=t[6],t[7]!==u||t[8]!==a?(r=x.jsxs("div",{className:"flex-shrink-0 bg-card shadow-md border overflow-hidden rounded snap-start",children:[u,a]}),t[7]=u,t[8]=a,t[9]=r):r=t[9],r};function tc(e){var t,n;return(t=e.encoding)!=null&&t.row||(n=e.encoding)!=null&&n.column||(e.width="container"),e}function nc(e){return e.fieldDef.field}function rc(e){return[e.channel,e.fieldDef]}export{ao as DataExplorerComponent,Ks as default};
|
19
|
+
***************************************************************************** */function $e(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}var Zn,er,tr,Ho={exports:{}};Zn||(Zn=1,function(e){var t=function(){function n(s,d){return d!=null&&s instanceof d}var o,i,c;try{o=Map}catch{o=function(){}}try{i=Set}catch{i=function(){}}try{c=Promise}catch{c=function(){}}function u(s,d,l,f,p){typeof d=="object"&&(l=d.depth,f=d.prototype,p=d.includeNonEnumerable,d=d.circular);var h=[],m=[],v=typeof Buffer<"u";return d===void 0&&(d=!0),l===void 0&&(l=1/0),function b(y,E){if(y===null)return null;if(E===0)return y;var T,S;if(typeof y!="object")return y;if(n(y,o))T=new o;else if(n(y,i))T=new i;else if(n(y,c))T=new c(function(ye,ve){y.then(function(be){ye(b(be,E-1))},function(be){ve(b(be,E-1))})});else if(u.__isArray(y))T=[];else if(u.__isRegExp(y))T=new RegExp(y.source,r(y)),y.lastIndex&&(T.lastIndex=y.lastIndex);else if(u.__isDate(y))T=new Date(y.getTime());else{if(v&&Buffer.isBuffer(y))return T=Buffer.allocUnsafe?Buffer.allocUnsafe(y.length):new Buffer(y.length),y.copy(T),T;n(y,Error)?T=Object.create(y):f===void 0?(S=Object.getPrototypeOf(y),T=Object.create(S)):(T=Object.create(f),S=f)}if(d){var N=h.indexOf(y);if(N!=-1)return m[N];h.push(y),m.push(T)}for(var C in n(y,o)&&y.forEach(function(ye,ve){var be=b(ve,E-1),lt=b(ye,E-1);T.set(be,lt)}),n(y,i)&&y.forEach(function(ye){var ve=b(ye,E-1);T.add(ve)}),y){var O;S&&(O=Object.getOwnPropertyDescriptor(S,C)),O&&O.set==null||(T[C]=b(y[C],E-1))}if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(y);for(C=0;C<M.length;C++){var U=M[C];(!(F=Object.getOwnPropertyDescriptor(y,U))||F.enumerable||p)&&(T[U]=b(y[U],E-1),F.enumerable||Object.defineProperty(T,U,{enumerable:!1}))}}if(p){var I=Object.getOwnPropertyNames(y);for(C=0;C<I.length;C++){var F,Ae=I[C];(F=Object.getOwnPropertyDescriptor(y,Ae))&&F.enumerable||(T[Ae]=b(y[Ae],E-1),Object.defineProperty(T,Ae,{enumerable:!1}))}}return T}(s,l)}function a(s){return Object.prototype.toString.call(s)}function r(s){var d="";return s.global&&(d+="g"),s.ignoreCase&&(d+="i"),s.multiline&&(d+="m"),d}return u.clonePrototype=function(s){if(s===null)return null;var d=function(){};return d.prototype=s,new d},u.__objToStr=a,u.__isDate=function(s){return typeof s=="object"&&a(s)==="[object Date]"},u.__isArray=function(s){return typeof s=="object"&&a(s)==="[object Array]"},u.__isRegExp=function(s){return typeof s=="object"&&a(s)==="[object RegExp]"},u.__getRegExpFlags=r,u}();e.exports&&(e.exports=t)}(Ho));var qo=(tr||(tr=1,er=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n,o=typeof t.cycles=="boolean"&&t.cycles,i=t.cmp&&(n=t.cmp,function(u){return function(a,r){var s={key:a,value:u[a]},d={key:r,value:u[r]};return n(s,d)}}),c=[];return function u(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var r,s;if(Array.isArray(a)){for(s="[",r=0;r<a.length;r++)r&&(s+=","),s+=u(a[r])||"null";return s+"]"}if(a===null)return"null";if(c.indexOf(a)!==-1){if(o)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var d=c.push(a)-1,l=Object.keys(a).sort(i&&i(a));for(s="",r=0;r<l.length;r++){var f=l[r],p=u(a[f]);p&&(s&&(s+=","),s+=JSON.stringify(f)+":"+p)}return c.splice(d,1),"{"+s+"}"}}(e)}),er);const nr=zn(qo);function Be(e,t,n){return e.fields=t||[],e.fname=n,e}function Jt(e){throw Error(e)}function Xt(e){var t,n,o,i=[],c=null,u=0,a=e.length,r="";function s(){i.push(r+e.substring(t,n)),r="",t=n+1}for(e+="",t=n=0;n<a;++n)if((o=e[n])==="\\")r+=e.substring(t,n),t=++n;else if(o===c)s(),c=null,u=-1;else{if(c)continue;t===u&&o==='"'||t===u&&o==="'"?(t=n+1,c=o):o!=="."||u?o==="["?(n>t&&s(),u=t=n+1):o==="]"&&(u||Jt("Access path missing open bracket: "+e),u>0&&s(),u=0,t=n+1):n>t?s():t=n+1}return u&&Jt("Access path missing closing bracket: "+e),c&&Jt("Access path missing closing quote: "+e),n>t&&(n++,s()),i}const mt=Array.isArray;function rr(e){return e===Object(e)}function Zt(e){return typeof e=="string"}function en(e){return mt(e)?"["+e.map(en)+"]":rr(e)||Zt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var Je=[];function yt(e,t,n){var o=[t].concat([].slice.call(n));console[e](...o)}(function(e){var t=Xt(e),n="return _["+t.map(en).join("][")+"];";Be(Function("_",n),[e=t.length===1?t[0]:e],e)})("id"),Be(function(e){return e},Je,"identity"),Be(function(){return 0},Je,"zero"),Be(function(){return 1},Je,"one"),Be(function(){return!0},Je,"true"),Be(function(){return!1},Je,"false");function tn(e){return typeof e=="boolean"}function Le(e){for(var t={},n=0,o=e.length;n<o;++n)t[e[n]]=!0;return t}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>nr(e)).join(",")})`};const K=nr;function Y(e,t){return e.indexOf(t)>-1}const ue=Object.keys,ne="row",ee="column",ir="facet",D="x",_="y",nn="x2",rn="y2",or="latitude",ar="longitude",sr="latitude2",cr="longitude2",de="color",vt="fill",bt="stroke",Xe="shape",Te="size",xt="opacity",Et="fillOpacity",Tt="strokeOpacity",St="strokeWidth",on="text",lr="order",an="detail",ur="key",dr="tooltip",fr="href",sn=Object.assign({},{x:1,y:1,x2:1,y2:1},{longitude:1,longitude2:1,latitude:1,latitude2:1},{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function wt(e){return e==="color"||e==="fill"||e==="stroke"}const Ze=Object.assign({},sn,{row:1,column:1,facet:1}),Go=ue(Ze),{order:bc,detail:xc}=Ze;$e(Ze,["order","detail"]);const{order:Ec,detail:Tc,row:Sc,column:wc,facet:Nc}=Ze;$e(Ze,["order","detail","row","column","facet"]);const{x:Cc,y:Ac,x2:Oc,y2:kc,latitude:Mc,longitude:Ic,latitude2:Uc,longitude2:Fc}=sn,cn=$e(sn,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),pr=ue(cn),{text:Dc,tooltip:_c,href:jc,detail:Pc,key:Rc,order:$c}=cn,zo=$e(cn,["text","tooltip","href","detail","key","order"]),Yo=Object.assign({},{x:1,y:1},zo);function Qo(e,t){return function(n){switch(n){case de:case vt:case bt:case an:case ur:case dr:case fr:case lr:case xt:case Et:case Tt:case St:case ir:case ne:case ee:return ln;case D:case _:case or:case ar:return Vo;case nn:case rn:case sr:case cr:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Te:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Xe:return{point:"always",geoshape:"always"};case on:return{text:"always"}}}(e)[t]}const ln={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Bc}=ln,Vo=$e(ln,["geoshape"]);function un(e){switch(e){case D:case _:case Te:case St:case xt:case Et:case Tt:case nn:case rn:return;case ir:case ne:case ee:case Xe:case on:case dr:case fr:return"discrete";case de:case vt:case bt:return"flexible";case or:case ar:case sr:case cr:case an:case ur:case lr:return}throw new Error("rangeType not implemented for "+e)}const hr={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},Ko=Object.assign({},hr,{encoding:1});Object.assign({gridScale:1,scale:1},hr,{encode:1});const gr=ue(Ko),mr={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};Object.assign({},mr,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1});const yr=ue(mr),Jo=Object.freeze(Object.defineProperty({__proto__:null,BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL:"Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.",CANNOT_FIX_RANGE_STEP_WITH_FIT:'Cannot use a fixed value of "rangeStep" when "autosize" is "fit".',CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:"custom domain scale cannot be unioned with default field-based domain",CONCAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",FIT_NON_SINGLE:'Autosize "fit" only works for single views and layered views.',INVALID_CHANNEL_FOR_AXIS:"Invalid channel for axis.",INVALID_SPEC:"Invalid spec",LINE_WITH_VARYING_SIZE:"Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.",MORE_THAN_ONE_SORT:"Domains that should be unioned has conflicting sort properties. Sort will be set to true.",NO_FIELDS_NEEDS_AS:'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.',NO_INIT_SCALE_BINDINGS:"Selections bound to scales cannot be separately initialized.",REPEAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).",SCALE_BINDINGS_CONTINUOUS:"Scale bindings are currently only supported for scales with unbinned, continuous domains.",UNABLE_TO_MERGE_DOMAINS:"Unable to merge domains",cannotApplySizeToNonOrientedMark:function(e){return`Cannot apply size to non-oriented mark "${e}".`},cannotProjectOnChannelWithoutField:function(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`},cannotStackNonLinearScale:function(e){return`Cannot stack non-linear scale (${e})`},cannotStackRangedMark:function(e){return`Cannot stack "${e}" if there is already "${e}2"`},cannotUseScalePropertyWithNonColor:function(e){return`Cannot use the scale property "${e}" with non-color channel.`},channelRequiredForBinned:function(e){return`Channel ${e} is required for "binned" bin`},columnsNotSupportByRowCol:function(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`},dayReplacedWithDate:function(e){return`Time unit "${e}" is not supported. We are replacing it with ${e.replace("day","date")}.`},differentParse:function(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`},discreteChannelCannotEncode:function(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`},domainRequiredForThresholdScale:function(e){return`Domain for ${e} is required for threshold scale`},domainSortDropped:function(e){return`Dropping sort property ${K(e)} as unioned domains only support boolean or op 'count'.`},droppedDay:function(e){return`Dropping day from datetime ${K(e)} as day cannot be combined with other units.`},droppingColor:function(e,t){const{fill:n,stroke:o}=t;return`Dropping color ${e} as the plot also has `+(n&&o?"fill and stroke":n?"fill":"stroke")},emptyFieldDef:function(e,t){return`Dropping ${K(e)} from channel "${t}" since it does not contain data field or value.`},encodingOverridden:function(e){return`Layer's shared ${e.join(",")} channel ${e.length===1?"is":"are"} overriden`},errorBand1DNotSupport:function(e){return`1D error band does not support ${e}`},errorBarCenterAndExtentAreNotNeeded:function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`},errorBarCenterIsNotNeeded:function(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`},errorBarCenterIsUsedWithWrongExtent:function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`},errorBarContinuousAxisHasCustomizedAggregate:function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`},facetChannelDropped:function(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`},facetChannelShouldBeDiscrete:function(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`},incompatibleChannel:function(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`},independentScaleMeansIndependentGuide:function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`},invalidAggregate:function(e){return`Invalid aggregation operator "${e}"`},invalidEncodingChannel:function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`},invalidFieldType:function(e){return`Invalid field type "${e}"`},invalidFieldTypeForCountAggregate:function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`},invalidTimeUnit:function(e,t){return`Invalid ${e}: ${K(t)}`},invalidTransformIgnored:function(e){return`Ignoring an invalid transform: ${K(e)}.`},latLongDeprecated:function(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`},lineWithRange:function(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`},mergeConflictingDomainProperty:function(e,t,n,o){return`Conflicting ${t.toString()} property "${e.toString()}" (${K(n)} and ${K(o)}). Using the union of the two domains.`},mergeConflictingProperty:function(e,t,n,o){return`Conflicting ${t.toString()} property "${e.toString()}" (${K(n)} and ${K(o)}). Using ${K(n)}.`},missingFieldType:function(e,t){return`Missing type for channel "${e}", using "${t}" instead.`},nearestNotSupportForContinuous:function(e){return`The "nearest" transform is not supported for ${e} marks.`},noSuchRepeatedValue:function(e){return`Unknown repeated value "${e}".`},nonZeroScaleUsedWithLengthMark:function(e,t,n){return`A ${n.scaleType?`${n.scaleType} scale`:n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${e}'s ${t}. This can be misleading as the ${t==="x"?"width":"height"} of the ${e} can be arbitrary based on the scale domain. You may want to use point mark instead.`},orientOverridden:function(e,t){return`Specified orient "${e}" overridden with "${t}"`},primitiveChannelDef:function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${K(n)}}.`},projectionOverridden:function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${K(t)} is overridden by a child projection ${K(n)}.`},rangeStepDropped:function(e){return`rangeStep for "${e}" is dropped as top-level ${e==="x"?"width":"height"} is provided.`},scalePropertyNotWorkWithScaleType:function(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`},scaleTypeNotWorkWithChannel:function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`},scaleTypeNotWorkWithFieldDef:function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`},scaleTypeNotWorkWithMark:function(e,t){return`Scale type "${t}" does not work with mark "${e}".`},selectionNotFound:function(e){return`Cannot find a selection named "${e}"`},selectionNotSupported:function(e){return`Selection not supported for ${e} yet`},stackNonSummativeAggregate:function(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}")`},unaggregateDomainHasNoEffectForRawField:function(e){return`Using unaggregated domain with raw field has no effect (${K(e)}).`},unaggregateDomainWithNonSharedDomainOp:function(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`},unaggregatedDomainWithLogScale:function(e){return`Unaggregated domain is currently unsupported for log scale (${K(e)}).`},unrecognizedParse:function(e){return`Unrecognized parse "${e}".`}},Symbol.toStringTag,{value:"Module"})),re=Jo;var Me;let vr=(Me=2,{level:function(e){return arguments.length?(Me=+e,this):Me},error:function(){return Me>=1&&yt("error","ERROR",arguments),this},warn:function(){return Me>=2&&yt("warn","WARN",arguments),this},info:function(){return Me>=3&&yt("log","INFO",arguments),this},debug:function(){return Me>=4&&yt("log","DEBUG",arguments),this}});function Se(...e){vr.warn.apply(vr,arguments)}const Xo={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1},R="quantitative",ce="ordinal",Q="temporal",ie="nominal";var j;(function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"})(j||(j={}));const Zo=ue({linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"}),br=["linear","log","pow","sqrt","symlog","time","utc"],ea=Le(br),ta=Le(["quantile","quantize","threshold"]),na=Le(br.concat(["quantile","quantize","threshold"])),ra=Le(["ordinal","bin-ordinal","point","band"]);function Ie(e){return e in ra}function We(e){return e in ea}const dn={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},xr=ue(dn),{type:Lc,domain:Wc,range:Hc,rangeStep:qc,scheme:Gc}=dn;function fn(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!Y(["point","band","identity"],e);case"bins":return!Y(["point","band","identity","ordinal"],e);case"round":return We(e)||e==="band"||e==="point";case"padding":return We(e)||Y(["point","band"],e);case"paddingOuter":case"rangeStep":case"align":return Y(["point","band"],e);case"paddingInner":return e==="band";case"clamp":return We(e);case"nice":return We(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return function(n){return n in na}(e)&&!Y(["log","time","utc","threshold","quantile"],e)}}function ia(e,t){switch(t){case"interpolate":case"scheme":return wt(e)?void 0:re.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function Er(e,t){return Y([ce,ie],t)?e===void 0||Ie(e):t===Q?Y([j.TIME,j.UTC,void 0],e):t!==R||Y([j.LOG,j.POW,j.SQRT,j.SYMLOG,j.QUANTILE,j.QUANTIZE,j.THRESHOLD,j.LINEAR,void 0],e)}function Tr(e,t){switch(e){case D:case _:return We(t)||Y(["band","point"],t);case Te:case St:case xt:case Et:case Tt:return We(t)||function(n){return n in ta}(t)||Y(["band","point"],t);case de:case vt:case bt:return t!=="band";case Xe:return t==="ordinal"}return!1}function oa(e,t){return e+"_"+t}$e(dn,["type","domain","range","rangeStep","scheme"]),function(){const e={};for(const t of Go)for(const n of ue(Xo))for(const o of Zo){const i=oa(t,n);Tr(t,o)&&Er(o,n)&&(e[i]=e[i]||[],e[i].push(o))}}();var Sr,wr={exports:{}};function et(){return Sr||(Sr=1,function(){var e=wr.exports,t="__name__";e.namedfunc=function(a,r){return r[t]=a,r},e.name=function(a){return a==null?null:a[t]},e.identity=function(a){return a},e.true=e.namedfunc("true",function(){return!0}),e.false=e.namedfunc("false",function(){return!1}),e.duplicate=function(a){return JSON.parse(JSON.stringify(a))},e.equal=function(a,r){return JSON.stringify(a)===JSON.stringify(r)},e.extend=function(a){for(var r,s,d=1,l=arguments.length;d<l;++d)for(s in r=arguments[d])a[s]=r[s];return a},e.length=function(a){return a!=null&&a.length!=null?a.length:null},e.keys=function(a){var r,s=[];for(r in a)s.push(r);return s},e.vals=function(a){var r,s=[];for(r in a)s.push(a[r]);return s},e.toMap=function(a,r){return(r=e.$(r))?a.reduce(function(s,d){return s[r(d)]=1,s},{}):a.reduce(function(s,d){return s[d]=1,s},{})},e.keystr=function(a){var r=a.length;if(!r)return"";for(var s=String(a[0]),d=1;d<r;++d)s+="|"+String(a[d]);return s};var n=Object.prototype.toString;e.isObject=function(a){return a===Object(a)},e.isFunction=function(a){return n.call(a)==="[object Function]"},e.isString=function(a){return typeof value=="string"||n.call(a)==="[object String]"},e.isArray=Array.isArray||function(a){return n.call(a)==="[object Array]"},e.isNumber=function(a){return typeof a=="number"||n.call(a)==="[object Number]"},e.isBoolean=function(a){return a===!0||a===!1||n.call(a)=="[object Boolean]"},e.isDate=function(a){return n.call(a)==="[object Date]"},e.isValid=function(a){return a!=null&&a==a},e.isBuffer=typeof Buffer=="function"&&Buffer.isBuffer||e.false,e.number=function(a){return a==null||a===""?null:+a},e.boolean=function(a){return a==null||a===""?null:a!=="false"&&!!a},e.date=function(a,r){var s=r||Date;return a==null||a===""?null:s.parse(a)},e.array=function(a){return a!=null?e.isArray(a)?a:[a]:[]},e.str=function(a){return e.isArray(a)?"["+a.map(e.str)+"]":e.isObject(a)||e.isString(a)?JSON.stringify(a).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):a};var o=/\[(.*?)\]|[^.\[]+/g;function i(a,r){var s,d="";for(s=0;s<a;++s)d+=r;return d}function c(a,r,s){var d=0,l=a.split(u);return(a=s?(l=l.reverse()).filter(function(f){return(d+=f.length)<=r}).reverse():l.filter(function(f){return(d+=f.length)<=r})).length?a.join("").trim():l[0].slice(0,r)}e.field=function(a){return String(a).match(o).map(function(r){return r[0]!=="["?r:r[1]!=="'"&&r[1]!=='"'?r.slice(1,-1):r.slice(2,-2).replace(/\\(["'])/g,"$1")})},e.accessor=function(a){return a==null||e.isFunction(a)?a:e.namedfunc(a,Function("x","return x["+e.field(a).map(e.str).join("][")+"];"))},e.$=e.accessor,e.mutator=function(a){var r;return e.isString(a)&&(r=e.field(a)).length>1?function(s,d){for(var l=0;l<r.length-1;++l)s=s[r[l]];s[r[l]]=d}:function(s,d){s[a]=d}},e.$func=function(a,r){return function(s){s=e.$(s)||e.identity;var d=a+(e.name(s)?"_"+e.name(s):"");return e.namedfunc(d,function(l){return r(s(l))})}},e.$valid=e.$func("valid",e.isValid),e.$length=e.$func("length",e.length),e.$in=function(a,r){a=e.$(a);var s=e.isArray(r)?e.toMap(r):r;return function(d){return!!s[a(d)]}},e.comparator=function(a){var r=[];return a===void 0&&(a=[]),a=e.array(a).map(function(s){var d=1;return s[0]==="-"?(d=-1,s=s.slice(1)):s[0]==="+"&&(d=1,s=s.slice(1)),r.push(d),e.accessor(s)}),function(s,d){var l,f,p,h;for(l=0,f=a.length;l<f;++l)if(p=a[l],h=e.cmp(p(s),p(d)))return h*r[l];return 0}},e.cmp=function(a,r){return(a<r||a==null)&&r!=null?-1:(a>r||r==null)&&a!=null?1:(r=r instanceof Date?+r:r,(a=a instanceof Date?+a:a)!==a&&r==r?-1:r!=r&&a==a?1:0)},e.numcmp=function(a,r){return a-r},e.stablesort=function(a,r,s){var d=a.reduce(function(l,f,p){return l[s(f)]=p,l},{});return a.sort(function(l,f){var p=r(l),h=r(f);return p<h?-1:p>h?1:d[s(l)]-d[s(f)]}),a},e.permute=function(a){for(var r,s,d=a.length;d;)s=Math.floor(Math.random()*d--),r=a[d],a[d]=a[s],a[s]=r},e.pad=function(a,r,s,d){d=d||" ";var l=r-a.length;if(l<=0)return a;switch(s){case"left":return i(l,d)+a;case"middle":case"center":return i(Math.floor(l/2),d)+a+i(Math.ceil(l/2),d);default:return a+i(l,d)}},e.truncate=function(a,r,s,d,l){var f=a.length;if(f<=r)return a;l=l!==void 0?String(l):"\u2026";var p=Math.max(0,r-l.length);switch(s){case"left":return l+(d?c(a,p,1):a.slice(f-p));case"middle":case"center":var h=Math.ceil(p/2),m=Math.floor(p/2);return(d?c(a,h):a.slice(0,h))+l+(d?c(a,m,1):a.slice(f-m));default:return(d?c(a,p):a.slice(0,p))+l}};var u=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}()),wr.exports}var k=et();function te(e,t){return e.indexOf(t)!==-1}function fe(e,t){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function V(e,t,n){if(e.forEach)e.forEach.call(n,t);else for(let o in e)t.call(n,e[o],o,e)}function he(e,t){let n,o=0;for(n in e)if(t(e[n],n,o++))return!0;return!1}function pe(e){return!!e.parent}const Nr={channel:1,aggregate:1,autoCount:1,bin:1,timeUnit:1,hasFn:1,sort:1,stack:1,field:1,type:1,format:1,scale:1,axis:1,legend:1,value:1},pn=(Cr=Nr,Object.keys(Cr));var Cr;const aa={bin:1,scale:1,sort:1,axis:1,legend:1};function hn(e){return aa[e]}const Ar=["maxbins","divide","extent","base","step","steps","minstep"].map(e=>({parent:"bin",child:e})),gn=["field","op","order"].map(e=>({parent:"sort",child:e})),Nt=xr.map(e=>({parent:"scale",child:e})),Or=gr.map(e=>({parent:"axis",child:e})),kr=yr.map(e=>({parent:"legend",child:e})),Ct=[].concat(Ar,gn,Nt,Or,kr),Mr=["width","height","background","padding","title"];function At(e){return pe(e)?e.parent+"."+e.child:e}const sa=Ct.reduce((e,t)=>(e[t.parent]=e[t.parent]||[],e[t.parent][t.child]=t,e),{});function ge(e,t){return(sa[e]||{})[t]}function Ir(e){return function(t){return t in Nr}(e)||pe(e)}const ca=[].concat(pn,Ct),Ur=["type","field","bin","timeUnit","aggregate","autoCount","channel","mark","stack","scale","sort","axis","legend"].concat(Ar,Nt,Or,kr,gn);var g;(function(e){e.MARK="mark",e.TRANSFORM="transform",e.STACK="stack",e.FORMAT="format",e.CHANNEL="channel",e.AGGREGATE="aggregate",e.AUTOCOUNT="autoCount",e.BIN="bin",e.HAS_FN="hasFn",e.TIMEUNIT="timeUnit",e.FIELD="field",e.TYPE="type",e.SORT="sort",e.SCALE="scale",e.AXIS="axis",e.LEGEND="legend",e.WIDTH="width",e.HEIGHT="height",e.BACKGROUND="background",e.PADDING="padding",e.TITLE="title"})(g||(g={}));const Ue="area",me="bar",tt="line",nt="point",mn="rect",yn="rule",Ot="text",rt="tick",kt="circle",Mt="square";function la(e){return Y(["line","area","trail"],e)}Le(ue({area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1})),["january","february","march","april","may","june","july","august","september","october","november","december"].map(e=>e.substr(0,3));var W;["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>e.substr(0,3)),function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(W||(W={}));const vn={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Fr=ue(vn),bn={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1},Dr={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},ua=Object.assign({},bn,Dr),da=Object.assign({},vn,bn,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},Dr),fa={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};function pa(e,t){const n=!!ua[e],o=n?new Date(Date.UTC(1972,0,1,0,0,0,0)):new Date(1972,0,1,0,0,0,0);for(const i of Fr)if(jr(e,i))switch(i){case W.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case W.QUARTER:{const{getDateMethod:c,setDateMethod:u}=_r("month",n);o[u](3*Math.floor(t[c]()/3));break}default:{const{getDateMethod:c,setDateMethod:u}=_r(i,n);o[u](t[c]())}}return o}function _r(e,t){const n=fa[e];return{setDateMethod:t?"setUTC"+n.substr(3):n,getDateMethod:"get"+(t?"UTC":"")+n.substr(3)}}function jr(e,t){const n=e.indexOf(t);return n>-1&&(t!==W.SECONDS||n===0||e.charAt(n-1)!=="i")}const P="?";function w(e){return It(e)||function(t){return!(t===void 0||t==null||!t.enum&&!t.name||k.isArray(t))}(e)}function It(e){return e===P}function xn(e,t,n){return k.extend({},{name:t,enum:n},e===P?{}:e)}function En(e){let t={},n={};for(const o of e){const i=[0];for(let u=0;u<o.length;u++)o.charAt(u).toUpperCase()===o.charAt(u)&&i.push(u);let c=i.map(u=>o.charAt(u)).join("").toLowerCase();if(n[c])if(i[i.length-1]===o.length-1||(c=i.concat([o.length-1]).map(u=>o.charAt(u)).join("").toLowerCase(),n[c]))for(let u=1;!t[o];u++){let a=c+"_"+u;if(!n[a]){t[o]=a,n[a]=!0;break}}else t[o]=c,n[c]=!0;else t[o]=c,n[c]=!0}return t}const Ut={mark:"m",channel:"c",aggregate:"a",autoCount:"#",hasFn:"h",bin:"b",sort:"so",stack:"st",scale:"s",format:"f",axis:"ax",legend:"l",value:"v",timeUnit:"tu",field:"f",type:"t",binProps:{maxbins:"mb",min:"mi",max:"ma",base:"b",step:"s",steps:"ss",minstep:"ms",divide:"d"},sortProps:{field:"f",op:"o",order:"or"},scaleProps:En(xr),axisProps:En(gr),legendProps:En(yr)};function it(e){if(pe(e))return Ut[e.parent]+"-"+Ut[e.parent+"Props"][e.child];if(Ut[e])return Ut[e];throw new Error("Default name undefined for "+e)}const X=[!1,!0],ha={maxbins:[5,10,20],extent:[void 0],base:[10],step:[void 0],steps:[void 0],minstep:[void 0],divide:[[5,2]],binned:[!1],anchor:[void 0],nice:[!0]},ga={field:[void 0],op:["min","mean"],order:["ascending","descending"]},ma={type:[void 0,j.LOG],domain:[void 0],base:[void 0],exponent:[1,2],constant:[void 0],bins:[void 0],clamp:X,nice:X,reverse:X,round:X,zero:X,padding:[void 0],paddingInner:[void 0],paddingOuter:[void 0],interpolate:[void 0],range:[void 0],rangeStep:[17,21],scheme:[void 0]},ya={zindex:[1,0],offset:[void 0],orient:[void 0],values:[void 0],bandPosition:[void 0],encoding:[void 0],domain:X,domainColor:[void 0],domainDash:[void 0],domainDashOffset:[void 0],domainOpacity:[void 0],domainWidth:[void 0],formatType:[void 0],grid:X,gridColor:[void 0],gridDash:[void 0],gridDashOffset:[void 0],gridOpacity:[void 0],gridWidth:[void 0],format:[void 0],labels:X,labelAlign:[void 0],labelAngle:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFlushOffset:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOpacity:[void 0],labelSeparation:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelBound:[void 0],labelFlush:[void 0],maxExtent:[void 0],minExtent:[void 0],position:[void 0],ticks:X,tickColor:[void 0],tickCount:[void 0],tickDash:[void 0],tickExtra:[void 0],tickDashOffset:[void 0],tickMinStep:[void 0],tickOffset:[void 0],tickOpacity:[void 0],tickRound:[void 0],tickSize:[void 0],tickWidth:[void 0],title:[void 0],titleAlign:[void 0],titleAnchor:[void 0],titleAngle:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titlePadding:[void 0],titleX:[void 0],titleY:[void 0]},va={orient:["left","right"],format:[void 0],type:[void 0],values:[void 0],zindex:[void 0],clipHeight:[void 0],columnPadding:[void 0],columns:[void 0],cornerRadius:[void 0],direction:[void 0],encoding:[void 0],fillColor:[void 0],formatType:[void 0],gridAlign:[void 0],offset:[void 0],padding:[void 0],rowPadding:[void 0],strokeColor:[void 0],labelAlign:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOffset:[void 0],labelOpacity:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelSeparation:[void 0],legendX:[void 0],legendY:[void 0],gradientLength:[void 0],gradientOpacity:[void 0],gradientStrokeColor:[void 0],gradientStrokeWidth:[void 0],gradientThickness:[void 0],symbolDash:[void 0],symbolDashOffset:[void 0],symbolFillColor:[void 0],symbolOffset:[void 0],symbolOpacity:[void 0],symbolSize:[void 0],symbolStrokeColor:[void 0],symbolStrokeWidth:[void 0],symbolType:[void 0],tickCount:[void 0],tickMinStep:[void 0],title:[void 0],titleAnchor:[void 0],titleAlign:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titleOrient:[void 0],titlePadding:[void 0]},ba={mark:[nt,me,tt,Ue,mn,rt,Ot],channel:[D,_,ne,ee,Te,de],aggregate:[void 0,"mean"],autoCount:X,bin:X,hasFn:X,timeUnit:[void 0,W.YEAR,W.MONTH,W.MINUTES,W.SECONDS],field:[void 0],type:[ie,ce,R,Q],sort:["ascending","descending"],stack:["zero","normalize","center",null],value:[void 0],format:[void 0],title:[void 0],scale:[!0],axis:X,legend:X,binProps:ha,sortProps:ga,scaleProps:ma,axisProps:ya,legendProps:va};function Tn(e,t,n){if(e==="field"||pe(e)&&e.parent==="sort"&&e.child==="field")return t.fieldNames();let o;if(o=pe(e)?n.enum[e.parent+"Props"][e.child]:n.enum[e],o!==void 0)return o;throw new Error("No default enumValues for "+JSON.stringify(e))}const ot={verbose:!1,defaultSpecConfig:{line:{point:!0},scale:{useUnaggregatedDomain:!0}},propertyPrecedence:Ur.map(At),enum:ba,numberNominalProportion:.05,numberNominalLimit:40,constraintManuallySpecifiedValue:!1,autoAddCount:!1,hasAppropriateGraphicTypeForMark:!0,omitAggregate:!1,omitAggregatePlotWithDimensionOnlyOnFacet:!0,omitAggregatePlotWithoutDimension:!1,omitBarLineAreaWithOcclusion:!0,omitBarTickWithSize:!0,omitMultipleNonPositionalChannels:!0,omitRaw:!1,omitRawContinuousFieldForAggregatePlot:!0,omitRepeatedField:!0,omitNonPositionalOrFacetOverPositionalChannels:!0,omitTableWithOcclusionIfAutoAddCount:!0,omitVerticalDotPlot:!1,omitInvalidStackSpec:!0,omitNonSumStack:!0,preferredBinAxis:D,preferredTemporalAxis:D,preferredOrdinalAxis:_,preferredNominalAxis:_,preferredFacet:ne,minCardinalityForBin:15,maxCardinalityForCategoricalColor:20,maxCardinalityForFacet:20,maxCardinalityForShape:6,timeUnitShouldHaveVariation:!0,typeMatchesSchemaType:!0,stylize:!0,smallRangeStepForHighCardinalityOrFacet:{maxCardinality:10,rangeStep:12},nominalColorScaleForHighCardinality:{maxCardinality:10,palette:"category20"},xAxisOnTopForHighYCardinalityWithoutColumn:{maxCardinality:30},maxGoodCardinalityForFacet:5,maxGoodCardinalityForColor:7,minPercentUniqueForKey:.8,minCardinalityForKey:50},xa={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Pr=["count","sum","distinct","valid","missing"];function Ea(e){return tn(e)&&(e=function(t,n){return tn(t)?{maxbins:Sn(n)}:t==="binned"?{binned:!0}:t.maxbins||t.step?t:Object.assign({},t,{maxbins:Sn(n)})}(e,void 0)),"bin"+ue(e).map(t=>function(n){const o=n.replace(/\W/g,"_");return(n.match(/^\d+/)?"_":"")+o}(`_${t}_${e[t]}`)).join("")}function Rr(e){return e===!0||function(t){return rr(t)}(e)&&!e.binned}function Sn(e){switch(e){case ne:case ee:case Te:case de:case vt:case bt:case St:case xt:case Et:case Tt:case Xe:return 6;default:return 10}}function $r(e){return!!e&&!!e.condition&&!mt(e.condition)&&we(e.condition)}function we(e){return!(!e||!e.field&&e.aggregate!=="count")}function wn(e){return we(e)&&Zt(e.field)}function Nn(e,t={}){let n=e.field;const o=t.prefix;let i=t.suffix,c="";if(function(a){return a.aggregate==="count"}(e))n=function(a){return function(r){return r.indexOf("__")===0}(a)?a:`__${a}`}("count");else{let a;if(!t.nofn)if(function(r){return!!r.op}(e))a=e.op;else{const{bin:r,aggregate:s,timeUnit:d}=e;Rr(r)?(a=Ea(r),i=(t.binSuffix||"")+(t.suffix||"")):s?(u=s)&&u.argmax?(c=`.${n}`,n=`argmax_${s.argmax}`):function(l){return!!l&&!!l.argmin}(s)?(c=`.${n}`,n=`argmin_${s.argmin}`):a=String(s):d&&(a=String(d))}a&&(n=n?`${a}_${n}`:a)}var u;return i&&(n=`${n}_${i}`),o&&(n=`${o}_${n}`),t.forAs?n:t.expr?function(a,r="datum"){return`${r}[${en(Xt(a).join("."))}]`}(n,t.expr)+c:`${Xt(n).map(a=>a.replace(".","\\.")).join("\\.")}`+c}function Br(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(re.invalidFieldType(e.type))}Le(["mean","average","median","q1","q3","min","max"]);const He={compatible:!0};function Ta(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case"row":case"column":case"facet":return function(o){return!Br(o)}(e)?{compatible:!1,warning:re.facetChannelShouldBeDiscrete(t)}:He;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return He;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==R?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:He;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return n!=="nominal"||e.sort?He:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"shape":return Y(["ordinal","nominal","geojson"],e.type)?He:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return e.type!=="nominal"||"sort"in e?He:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+t)}function Sa(e,t,n,o){const i=function(u,a,r){switch(a.type){case"nominal":case"ordinal":return wt(u)||un(u)==="discrete"?(u==="shape"&&a.type==="ordinal"&&Se(re.discreteChannelCannotEncode(u,"ordinal")),"ordinal"):Y(["x","y"],u)&&Y(["rect","bar","rule"],r)?"band":"point";case"temporal":return wt(u)?"time":un(u)==="discrete"?(Se(re.discreteChannelCannotEncode(u,"temporal")),"ordinal"):"time";case"quantitative":return wt(u)?Rr(a.bin)?"bin-ordinal":"linear":un(u)==="discrete"?(Se(re.discreteChannelCannotEncode(u,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(re.invalidFieldType(a.type))}(t,n,o),{type:c}=e;return function(u){return!!Yo[u]}(t)?c!==void 0?Tr(t,c)?Er(c,n.type)?c:(Se(re.scaleTypeNotWorkWithFieldDef(c,i)),i):(Se(re.scaleTypeNotWorkWithChannel(t,c,i)),i):i:null}var le;function Lr(e){return e===ce||e===ie||e===le.KEY}(function(e){e.QUANTITATIVE=R,e.ORDINAL=ce,e.TEMPORAL=Q,e.NOMINAL=ie,e.KEY="key"})(le||(le={}));class J{constructor(t=null){this.index=t?Object.assign({},t):{}}has(t){return At(t)in this.index}get(t){return this.index[At(t)]}set(t,n){return this.index[At(t)]=n,this}setByKey(t,n){this.index[t]=n}map(t){const n=new J;for(const o in this.index)n.index[o]=t(this.index[o]);return n}size(){return k.keys(this.index).length}duplicate(){return new J(this.index)}}function Wr(e,t){const n=e&&e[t];return!!n&&(mt(n)?function(o,i){let c=0;for(const[u,a]of o.entries())if(i(a,u,c++))return!0;return!1}(n,o=>!!o.field):we(n)||$r(n))}const wa={zero:1,center:1,normalize:1},Na=[me,Ue,yn,nt,kt,Mt,tt,Ot,rt],Ca=[me,Ue];function Aa(e,t,n,o={}){const i=function(p){return p.type}(e)?e.type:e;if(!Y(Na,i))return null;const c=function(p){const h=p.x,m=p.y;if(we(h)&&we(m))if(h.type==="quantitative"&&m.type==="quantitative"){if(h.stack)return"x";if(m.stack)return"y";if(!!h.aggregate!=!!m.aggregate)return h.aggregate?"x":"y"}else{if(h.type==="quantitative")return"x";if(m.type==="quantitative")return"y"}else{if(we(h)&&h.type==="quantitative")return"x";if(we(m)&&m.type==="quantitative")return"y"}}(t);if(!c)return null;const u=t[c],a=wn(u)?Nn(u,{}):void 0,r=c==="x"?"y":"x",s=t[r],d=wn(s)?Nn(s,{}):void 0,l=pr.reduce((p,h)=>{if(h!=="tooltip"&&Wr(t,h)){const m=t[h];(mt(m)?m:[m]).forEach(v=>{const b=function(E){return we(E)?E:$r(E)?E.condition:void 0}(v);if(b.aggregate)return;const y=wn(b)?Nn(b,{}):void 0;(!y||y!==d&&y!==a)&&p.push({channel:h,fieldDef:b})})}return p},[]);let f;if(u.stack!==void 0?f=tn(u.stack)?u.stack?"zero":null:u.stack:l.length>0&&(f=Y(Ca,i)?function(...p){for(const h of p)if(h!==void 0)return h}(n,"zero"):n),!f||!wa[f])return null;if(u.scale&&u.scale.type&&u.scale.type!==j.LINEAR){if(o.disallowNonLinearStack)return null;Se(re.cannotStackNonLinearScale(u.scale.type))}return Wr(t,c===D?nn:rn)?(u.stack!==void 0&&Se(re.cannotStackRangedMark(c)),null):(u.aggregate&&!Y(Pr,u.aggregate)&&Se(re.stackNonSummativeAggregate(u.aggregate)),{groupbyChannel:s?r:void 0,fieldChannel:c,impute:la(i),stackBy:l,offset:f})}function Hr(e){if(!function(n){if(w(n.mark))return!1;const o=[g.STACK,g.CHANNEL,g.MARK,g.FIELD,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],i=k.toMap((u=ca,a=o,u.filter(function(r){return!te(a,r)}))),c=n.encodings.filter(r=>!ae(r));var u,a;for(const r of c)if(qr(r,{exclude:i}))return!1;return!0}(e))return null;const t=Qr(e.encodings,{schema:null,wildcardMode:"null"});return Aa(e.mark,t,void 0,{disallowNonLinearStack:!0})}function qr(e,t={}){if(!k.isObject(e))return!1;for(const n in e)if(e.hasOwnProperty(n)&&(w(e[n])&&(!t.exclude||!t.exclude[n])||qr(e[n],t)))return!0;return!1}function Oa(e){return e.map(t=>function(n){return o=>n[o]!==void 0?n[o]:o}(t))}function Fe(e,t){return w(e)?!It(e)&&e.enum?P+JSON.stringify(e.enum):P:t?t(e):e}function Ft(e,t){return t?t(e):e}const Cn=new J,An=[].concat(Ur,gn,[g.TRANSFORM,g.STACK],Mr).reduce((e,t)=>e.set(t,!0),new J),On={axis:{x:!0,y:!0,row:!0,column:!0},legend:{color:!0,opacity:!0,size:!0,shape:!0},scale:{x:!0,y:!0,color:!0,opacity:!0,row:!0,column:!0,size:!0,shape:!0},sort:{x:!0,y:!0,path:!0,order:!0},stack:{x:!0,y:!0}};function qe(e,t=An,n=Cn){const o=[];let i;if(t.get(g.MARK)&&o.push(Fe(e.mark,n.get(g.MARK))),e.transform&&e.transform.length>0&&o.push("transform:"+JSON.stringify(e.transform)),t.get(g.STACK)&&(i=Hr(e)),e.encodings){const c=e.encodings.reduce((u,a)=>{if(!ae(a)){let r;r=i&&a.channel===i.fieldChannel?Gr(Object.assign({},a,{stack:i.offset}),t,n):Gr(a,t,n),r&&u.push(r)}return u},[]).sort().join("|");c&&o.push(c)}for(let c of Mr){const u=c.toString();if(t.get(c)&&e[u]){const a=e[u];o.push(`${u}=${JSON.stringify(a)}`)}}return o.join("|")}function Gr(e,t=An,n=Cn){const o=[];if(t.get(g.CHANNEL)&&o.push(Fe(e.channel,n.get(g.CHANNEL))),A(e)){const i=zr(e,t,n);i&&o.push(i)}else oe(e)?o.push(e.value):H(e)&&o.push("autocount()");return o.join(":")}function zr(e,t=An,n=Cn){if(t.get(g.AGGREGATE)&&ae(e))return"-";const o=function(u,a,r){if(a.get(g.AGGREGATE)&&u.aggregate&&!w(u.aggregate))return Ft(u.aggregate,r.get(g.AGGREGATE));if(a.get(g.AGGREGATE)&&Dt(u))return Ft("count",r.get(g.AGGREGATE));if(a.get(g.TIMEUNIT)&&u.timeUnit&&!w(u.timeUnit))return Ft(u.timeUnit,r.get(g.TIMEUNIT));if(a.get(g.BIN)&&u.bin&&!w(u.bin))return"bin";{let s=null;for(const d of[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN]){const l=u[d];a.get(d)&&u[d]&&w(l)&&(s=s||{},s[d]=It(l)?l:l.enum)}return s&&u.hasFn&&(s.hasFn=!0),s}}(e,t,n),i=function(u,a,r){const s=[];if(!k.isBoolean(u.bin)&&!It(u.bin)){const d=u.bin;for(const l in d){const f=ge("bin",l);f&&a.get(f)&&d[l]!==void 0&&s.push({key:l,value:Fe(d[l],r.get(f))})}s.sort((l,f)=>l.key.localeCompare(f.key))}for(const d of[g.SCALE,g.SORT,g.STACK,g.AXIS,g.LEGEND])if((w(u.channel)||On[d][u.channel])&&a.get(d)&&u[d]!==void 0){const l=u[d];if(k.isBoolean(l)||l===null)s.push({key:d+"",value:l||!1});else if(k.isString(l))s.push({key:d+"",value:Ft(JSON.stringify(l),r.get(d))});else{let f=[];for(const p in l){const h=ge(d,p);h&&a.get(h)&&l[p]!==void 0&&f.push({key:p,value:Fe(l[p],r.get(h))})}if(f.length>0){const p=f.sort((h,m)=>h.key.localeCompare(m.key)).reduce((h,m)=>(h[m.key]=m.value,h),{});s.push({key:d+"",value:JSON.stringify(p)})}}}return s}(e,t,n);let c;return A(e)?(c=t.get("field")?Fe(e.field,n.get("field")):"...",t.get(g.TYPE)&&(w(e.type)?c+=","+Fe(e.type,n.get(g.TYPE)):c+=","+Fe(((e.type||R)+"").substr(0,1),n.get(g.TYPE))),c+=i.map(u=>{let a=u.value instanceof Array?"["+u.value+"]":u.value;return","+u.key+"="+a}).join("")):H(e)&&(c="*,q"),c?o?(k.isString(o)?o:P+(k.keys(o).length>0?JSON.stringify(o):""))+"("+c+")":c:null}function kn(e,t,n){let o=[],i=0;for(let c=0;c<n;c++){let u=e.indexOf(t,i);if(u===-1)break;o.push(e.substring(i,u)),i=u+1}if(o.push(e.substr(i)),o.length!==n+1)for(;o.length!==n+1;)o.push("");return o}var Yr;function oe(e){return e!=null&&e.value!==void 0}function A(e){return e!=null&&(e.field||e.aggregate==="count")}function H(e){return e!=null&&"autoCount"in e}function ae(e){return H(e)&&e.autoCount===!1}function Dt(e){return H(e)&&e.autoCount===!0}(function(e){function t(i){const c={};c.field=i[0],c.type=function(s){if(s)switch(s=s.toLowerCase()){case"q":case R:return"quantitative";case"t":case Q:return"temporal";case"o":case ce:return"ordinal";case"n":case ie:return"nominal";case"geojson":return"geojson"}}(i[1].toUpperCase())||"?";let u=i[2],a=0,r=0;for(;r<u.length;){let s,d=u.indexOf("=",r);if(d===-1)break;{let l=u.substring(r,d);if(u[r+l.length+1]==="{"){let f=r+l.length+1;a=n(f,u,"}");const p=u.substring(f,a+1);s=JSON.parse(p),r=a+2}else if(u[r+l.length+1]==="["){let f=r+l.length+1,p=n(f,u,"]");const h=u.substring(f,p+1);s=JSON.parse(h),r=p+2}else{let f=r,p=u.indexOf(",",r+l.length);p===-1&&(p=u.length),r=p+1,s=JSON.parse(u.substring(f+l.length+1,p))}hn(l)?c[l]=s:(c.bin=c.bin||{},c.bin[l]=s)}}return c}function n(i,c,u){for(let a=i;a<c.length;a++)if(c[a]===u)return a}function o(i){const c={};if(i[0]==="?"){let a=n(1,i,"}"),r=JSON.parse(i.substring(1,a+1));for(let s in r)k.isArray(r[s])?c[s]={enum:r[s]}:c[s]=r[s];return Object.assign({},c,t(kn(i.substring(a+2,i.length-1),",",2)))}{let a=i.substring(0,i.indexOf("(")),r=kn(i.substring(a.length+1,i.length-1),",",2);if(Zt(u=a)&&xa[u])return Object.assign({aggregate:a},t(r));if(da[a])return Object.assign({timeUnit:a},t(r));if(a==="bin")return Object.assign({bin:{}},t(r))}var u}e.encoding=function(i,c){let u=c.indexOf("(")!==-1?o(c):t(kn(c,",",2));return Object.assign({channel:i},u)},e.rawFieldDef=t,e.getClosingIndex=n,e.fn=o})(Yr||(Yr={}));const ka=[g.AGGREGATE,g.BIN,g.TIMEUNIT,g.FIELD,g.TYPE,g.SCALE,g.SORT,g.AXIS,g.LEGEND,g.STACK,g.FORMAT];function Qr(e,t){const{wildcardMode:n="skip"}=t;let o={};for(const i of e){if(ae(i))continue;const{channel:c}=i;if(w(c))throw new Error("Cannot convert wildcard channel to a fixed channel");const u=oe(i)?Ma(i):Mn(i,t);if(u!==null)o[c]=u;else if(t.wildcardMode==="null")return null}return o}function Ma(e){const{value:t}=e;return w(t)?null:{value:t}}function Mn(e,t={}){const{props:n=ka,schema:o,wildcardMode:i="skip"}=t;if(A(e)){const c={};for(const u of n){let a=e[u];if(w(a)){if(i==="skip")continue;return null}if(a!==void 0){if(!(!On[u]||On[u][e.channel]))continue;if(hn(u)&&k.isObject(a)){a=Object.assign({},a);for(const r in a)if(w(a[r])){if(i==="null")return null;delete a[r]}}if(u==="bin"&&a===!1)continue;u==="type"&&a==="key"?c.type="nominal":c[u]=a}if(u===g.SCALE&&o&&e.type===ce){const r=e.scale,{ordinalDomain:s}=o.fieldSchema(e.field);r!==null&&s&&(c[g.SCALE]=Object.assign({domain:s},k.isObject(r)?r:{}))}}return c}if(e.autoCount===!1)throw new Error("Cannot convert {autoCount: false} into a field def");return{aggregate:"count",field:"*",type:"quantitative"}}function at(e){return A(e)?!Ne(e)&&e.type!=="temporal":H(e)}function Ne(e){if(A(e)){const t=Mn(e,{props:["bin","timeUnit","type"]});return Br(t)||!!t.timeUnit}return!1}function De(e){const t=e.scale===!0||e.scale===P?{}:e.scale||{},{type:n,channel:o,timeUnit:i,bin:c}=e;if(w(t.type)||w(n)||w(o)||w(c))return;if(t.type)return t.type;if(n==="temporal"&&w(i)||n==="quantitative"&&w(c))return;const u={type:n===le.KEY?"nominal":n,bin:c};return Sa({type:t.type},o,u,void 0)}var _t={exports:{}},In=new Date,Un=new Date;function G(e,t,n,o){function i(c){return e(c=new Date(+c)),c}return i.floor=i,i.round=function(c){var u=new Date(+c),a=new Date(c-1);return e(u),e(a),t(a,1),c-u<a-c?u:a},i.ceil=function(c){return e(c=new Date(c-1)),t(c,1),c},i.offset=function(c,u){return t(c=new Date(+c),u==null?1:Math.floor(u)),c},i.range=function(c,u,a){var r=[];if(c=new Date(c-1),u=new Date(+u),a=a==null?1:Math.floor(a),!(c<u&&a>0))return r;for(t(c,1),e(c),c<u&&r.push(new Date(+c));t(c,a),e(c),c<u;)r.push(new Date(+c));return r},i.filter=function(c){return G(function(u){for(;e(u),!c(u);)u.setTime(u-1)},function(u,a){for(;--a>=0;)for(;t(u,1),!c(u););})},n&&(i.count=function(c,u){return In.setTime(+c),Un.setTime(+u),e(In),e(Un),Math.floor(n(In,Un))},i.every=function(c){return c=Math.floor(c),isFinite(c)&&c>0?c>1?i.filter(o?function(u){return o(u)%c===0}:function(u){return i.count(0,u)%c===0}):i:null}),i}var st=G(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});st.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?G(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):st:null};const Vr=G(function(e){e.setMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getSeconds()}),Kr=G(function(e){e.setSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getMinutes()}),Jr=G(function(e){e.setMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),Xr=G(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5},function(e){return e.getDate()-1});function _e(e){return G(function(t){t.setHours(0,0,0,0),t.setDate(t.getDate()-(t.getDay()+7-e)%7)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}var jt=_e(0),Zr=_e(1),ei=_e(2),ti=_e(3),ni=_e(4),ri=_e(5),ii=_e(6);const oi=G(function(e){e.setHours(0,0,0,0),e.setDate(1)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()}),ai=G(function(e){e.setHours(0,0,0,0),e.setMonth(0,1)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}),si=G(function(e){e.setUTCMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),ci=G(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getUTCMinutes()}),li=G(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),ui=G(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1});function je(e){return G(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/6048e5})}var Pt=je(0),di=je(1),fi=je(2),pi=je(3),hi=je(4),gi=je(5),mi=je(6);const yi=G(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(1)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()}),vi=G(function(e){e.setUTCHours(0,0,0,0),e.setUTCMonth(0,1)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});var bi=st.range,Ia=Vr.range,Ua=Kr.range,Fa=Jr.range,Da=Xr.range,_a=jt.range,ja=Zr.range,Pa=ei.range,Ra=ti.range,$a=ni.range,Ba=ri.range,La=ii.range,Wa=jt.range,Ha=oi.range,qa=ai.range,Ga=st,za=bi,Ya=si.range,Qa=ci.range,Va=li.range,Ka=ui.range,Ja=Pt.range,Xa=di.range,Za=fi.range,es=pi.range,ts=hi.range,ns=gi.range,rs=mi.range,is=Pt.range,os=yi.range,as=vi.range;const ss=po(Object.freeze(Object.defineProperty({__proto__:null,day:Xr,days:Da,friday:ri,fridays:Ba,hour:Jr,hours:Fa,interval:G,millisecond:st,milliseconds:bi,minute:Kr,minutes:Ua,monday:Zr,mondays:ja,month:oi,months:Ha,saturday:ii,saturdays:La,second:Vr,seconds:Ia,sunday:jt,sundays:_a,thursday:ni,thursdays:$a,tuesday:ei,tuesdays:Pa,utcDay:ui,utcDays:Ka,utcFriday:gi,utcFridays:ns,utcHour:li,utcHours:Va,utcMillisecond:Ga,utcMilliseconds:za,utcMinute:ci,utcMinutes:Qa,utcMonday:di,utcMondays:Xa,utcMonth:yi,utcMonths:os,utcSaturday:mi,utcSaturdays:rs,utcSecond:si,utcSeconds:Ya,utcSunday:Pt,utcSundays:Ja,utcThursday:hi,utcThursdays:ts,utcTuesday:fi,utcTuesdays:Za,utcWednesday:pi,utcWednesdays:es,utcWeek:Pt,utcWeeks:is,utcYear:vi,utcYears:as,wednesday:ti,wednesdays:Ra,week:jt,weeks:Wa,year:ai,years:qa},Symbol.toStringTag,{value:"Module"})));var xi,Ei,Ti;function cs(){if(xi)return _t.exports;xi=1;var e=ss,t=new Date,n=new Date(0,0,1).setFullYear(0),o=new Date(Date.UTC(0,0,1)).setUTCFullYear(0);function i(l){return t.setTime(+l),t}function c(l,f,p,h,m,v){var b={type:l,date:f,unit:p};return h?b.step=h:b.minstep=1,m!=null&&(b.min=m),v!=null&&(b.max=v),b}function u(l,f,p,h,m,v){return c(l,function(b){return f.offset(p,b)},function(b){return f.count(p,b)},h,m,v)}var a=[u("second",e.second,n),u("minute",e.minute,n),u("hour",e.hour,n),u("day",e.day,n,[1,7]),u("month",e.month,n,[1,3,6]),u("year",e.year,n),c("seconds",function(l){return new Date(1970,0,1,0,0,l)},function(l){return i(l).getSeconds()},null,0,59),c("minutes",function(l){return new Date(1970,0,1,0,l)},function(l){return i(l).getMinutes()},null,0,59),c("hours",function(l){return new Date(1970,0,1,l)},function(l){return i(l).getHours()},null,0,23),c("weekdays",function(l){return new Date(1970,0,4+l)},function(l){return i(l).getDay()},[1],0,6),c("dates",function(l){return new Date(1970,0,l)},function(l){return i(l).getDate()},[1],1,31),c("months",function(l){return new Date(1970,l%12,1)},function(l){return i(l).getMonth()},[1],0,11)],r=[u("second",e.utcSecond,o),u("minute",e.utcMinute,o),u("hour",e.utcHour,o),u("day",e.utcDay,o,[1,7]),u("month",e.utcMonth,o,[1,3,6]),u("year",e.utcYear,o),c("seconds",function(l){return new Date(Date.UTC(1970,0,1,0,0,l))},function(l){return i(l).getUTCSeconds()},null,0,59),c("minutes",function(l){return new Date(Date.UTC(1970,0,1,0,l))},function(l){return i(l).getUTCMinutes()},null,0,59),c("hours",function(l){return new Date(Date.UTC(1970,0,1,l))},function(l){return i(l).getUTCHours()},null,0,23),c("weekdays",function(l){return new Date(Date.UTC(1970,0,4+l))},function(l){return i(l).getUTCDay()},[1],0,6),c("dates",function(l){return new Date(Date.UTC(1970,0,l))},function(l){return i(l).getUTCDate()},[1],1,31),c("months",function(l){return new Date(Date.UTC(1970,l%12,1))},function(l){return i(l).getUTCMonth()},[1],0,11)],s=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];function d(l){var f,p,h={};for(f=0,p=l.length;f<p;++f)h[l[f].type]=l[f];return h.find=function(m,v,b){return function(y,E,T,S){var N,C,O,M=s[0];for(N=1,C=s.length;N<C;++N)if(E>(M=s[N])[0]){if((O=E/M[0])>S)return y[s[N-1][1]];if(O>=T)return y[M[1]]}return y[s[C-1][1]]}(l,m,v,b)},h}return _t.exports=d(a),_t.exports.utc=d(r),_t.exports}var ls=function(){if(Ti)return Ei;Ti=1;var e=et(),t=cs();function n(a){if(!a)throw Error("Missing binning options.");var r,s,d,l,f,p,h,m=a.maxbins||15,v=a.base||10,b=Math.log(v),y=a.div||[5,2],E=a.min,T=a.max,S=T-E;if(a.step)r=a.step;else if(a.steps)r=a.steps[Math.min(a.steps.length-1,function(N,C,O,M){for(;O<M;){var U=O+M>>>1;e.cmp(N[U],C)<0?O=U+1:M=U}return O}(a.steps,S/m,0,a.steps.length))];else{for(s=Math.ceil(Math.log(m)/b),d=a.minstep||0,r=Math.max(d,Math.pow(v,Math.round(Math.log(S)/b)-s));Math.ceil(S/r)>m;)r*=v;for(p=0;p<y.length;++p)(f=r/y[p])>=d&&S/f<=m&&(r=f)}return l=(f=Math.log(r))>=0?0:1+~~(-f/b),h=Math.pow(v,-l-1),{start:E=Math.min(E,Math.floor(E/r+h)*r),stop:T=Math.ceil(T/r)*r,step:r,unit:{precision:l},value:o,index:i}}function o(a){return this.step*Math.floor(a/this.step+1e-15)}function i(a){return Math.floor((a-this.start)/this.step+1e-15)}function c(a){return this.unit.date(o.call(this,a))}function u(a){return i.call(this,this.unit.unit(a))}return n.date=function(a){if(!a)throw Error("Missing date binning options.");var r=a.utc?t.utc:t,s=a.min,d=a.max,l=a.maxbins||20,f=a.minbins||4,p=+d-+s,h=a.unit?r[a.unit]:r.find(p,f,l),m=n({min:h.min!=null?h.min:h.unit(s),max:h.max!=null?h.max:h.unit(d),maxbins:l,minstep:h.minstep,steps:h.step});return m.unit=h,m.index=u,a.raw||(m.value=c),m},Ei=n}();const us=zn(ls);var Si,wi;function Ni(){if(wi)return Si;wi=1;var e=et(),t="__types__",n={boolean:e.boolean,integer:e.number,number:e.number,date:e.date,string:function(r){return r==null||r===""?null:r+""}},o={boolean:function(r){return r==="true"||r==="false"||e.isBoolean(r)},integer:function(r){return o.number(r)&&(r=+r)===~~r},number:function(r){return!isNaN(+r)&&!e.isDate(r)},date:function(r){return!isNaN(Date.parse(r))}};function i(r){return e.keys(r)}function c(r){return"["+r+"]"}function u(r,s){var d,l,f;if(r=e.array(r),s=e.$(s),r[t]&&(d=s(r[t]),e.isString(d)))return d;for(l=0,f=r.length;!e.isValid(d)&&l<f;++l)d=s?s(r[l]):r[l];return e.isDate(d)?"date":e.isNumber(d)?"number":e.isBoolean(d)?"boolean":e.isString(d)?"string":null}function a(r,s){var d,l,f;r=e.array(r),s=e.$(s);var p=["boolean","integer","number","date"];for(d=0;d<r.length;++d){for(f=s?s(r[d]):r[d],l=0;l<p.length;++l)e.isValid(f)&&!o[p[l]](f)&&(p.splice(l,1),l-=1);if(p.length===0)return"string"}return p[0]}return u.annotation=function(r,s){if(!s)return r&&r[t]||null;r[t]=s},u.all=function(r,s){if(r.length){var d=s?e.identity:(s=i(r[0]),c);return s.reduce(function(l,f){return l[f]=u(r,d(f)),l},{})}},u.infer=a,u.inferAll=function(r,s){var d=s?e.identity:(s=i(r[0]),c);return s.reduce(function(l,f){return l[f]=a(r,d(f)),l},{})},u.parsers=n,Si=u}var Ci,Ai,ds=Ni(),Oi={exports:{}},ki={exports:{}},fs=(Ai||(Ai=1,function(e){var t=et(),n=Ni(),o=(Ci||(Ci=1,function(r){var s=et(),d=r.exports;d.repeat=function(l,f){var p,h=Array(f);for(p=0;p<f;++p)h[p]=l;return h},d.zeros=function(l){return d.repeat(0,l)},d.range=function(l,f,p){if(arguments.length<3&&(p=1,arguments.length<2&&(f=l,l=0)),(f-l)/p==1/0)throw new Error("Infinite range");var h,m=[],v=-1;if(p<0)for(;(h=l+p*++v)>f;)m.push(h);else for(;(h=l+p*++v)<f;)m.push(h);return m},d.random={},d.random.uniform=function(l,f){f===void 0&&(f=l===void 0?1:l,l=0);var p=f-l,h=function(){return l+p*Math.random()};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){return m>=l&&m<=f?1/p:0},h.cdf=function(m){return m<l?0:m>f?1:(m-l)/p},h.icdf=function(m){return m>=0&&m<=1?l+m*p:NaN},h},d.random.integer=function(l,f){f===void 0&&(f=l,l=0);var p=f-l,h=function(){return l+Math.floor(p*Math.random())};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){return m===Math.floor(m)&&m>=l&&m<f?1/p:0},h.cdf=function(m){var v=Math.floor(m);return v<l?0:v>=f?1:(v-l+1)/p},h.icdf=function(m){return m>=0&&m<=1?l-1+Math.floor(m*p):NaN},h},d.random.normal=function(l,f){var p;l=l||0,f=f||1;var h=function(){var m,v,b=0,y=0;if(p!==void 0)return b=p,p=void 0,b;do m=(b=2*Math.random()-1)*b+(y=2*Math.random()-1)*y;while(m===0||m>1);return v=Math.sqrt(-2*Math.log(m)/m),p=l+y*v*f,l+b*v*f};return h.samples=function(m){return d.zeros(m).map(h)},h.pdf=function(m){var v=Math.exp(Math.pow(m-l,2)/(-2*Math.pow(f,2)));return 1/(f*Math.sqrt(2*Math.PI))*v},h.cdf=function(m){var v,b=(m-l)/f,y=Math.abs(b);if(y>37)v=0;else{var E=Math.exp(-y*y/2);y<7.07106781186547?(v=E*((((((.0352624965998911*y+.700383064443688)*y+6.37396220353165)*y+33.912866078383)*y+112.079291497871)*y+221.213596169931)*y+220.206867912376),v/=((((((.0883883476483184*y+1.75566716318264)*y+16.064177579207)*y+86.7807322029461)*y+296.564248779674)*y+637.333633378831)*y+793.826512519948)*y+440.413735824752):v=E/(y+1/(y+2/(y+3/(y+4/(y+.65)))))/2.506628274631}return b>0?1-v:v},h.icdf=function(m){if(m<=0||m>=1)return NaN;var v=2*m-1,b=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),y=2/(Math.PI*b)+Math.log(1-Math.pow(v,2))/2,E=Math.log(1-v*v)/b,T=(v>0?1:-1)*Math.sqrt(Math.sqrt(y*y-E)-y);return l+f*Math.SQRT2*T},h},d.random.bootstrap=function(l,f){var p=l.filter(s.isValid),h=p.length,m=f?d.random.normal(0,f):null,v=function(){return p[~~(Math.random()*h)]+(m?m():0)};return v.samples=function(b){return d.zeros(b).map(v)},v}}(ki)),ki.exports),i=e.exports;function c(r,s,d){var l=r&&r.nullh||0,f=o.random.normal(0,1),p=i.mean(s,d),h=i.stdev(s,d)/Math.sqrt(i.count.valid(s,d));if(h===0)return p-l===0?1:0;var m=(p-l)/h;return 2*f.cdf(-Math.abs(m))}function u(r,s,d,l){var f,p=l?s.map(t.$(d)):s,h=l?s.map(t.$(l)):d,m=i.count(p),v=i.count(h),b=Array();if(m!==v)throw Error("Array lengths must match.");for(f=0;f<m;++f)t.isValid(p[f])&&t.isValid(h[f])&&b.push(p[f]-h[f]);return i.z.test(b,r&&r.nullh||0)}function a(r,s,d,l){var f=l?s.map(t.$(d)):s,p=l?s.map(t.$(l)):d,h=i.count.valid(f),m=i.count.valid(p),v=o.random.normal(0,1),b=i.mean(f)-i.mean(p)-(r&&r.nullh||0),y=Math.sqrt(i.variance(f)/h+i.variance(p)/m);if(y===0)return b===0?1:0;var E=b/y;return 2*v.cdf(-Math.abs(E))}i.unique=function(r,s,d){s=t.$(s),d=d||[];var l,f,p,h={};for(f=0,p=r.length;f<p;++f)(l=s?s(r[f]):r[f])in h||(h[l]=1,d.push(l));return d},i.count=function(r){return r&&r.length||0},i.count.valid=function(r,s){s=t.$(s);var d,l,f,p=0;for(l=0,f=r.length;l<f;++l)d=s?s(r[l]):r[l],t.isValid(d)&&(p+=1);return p},i.count.missing=function(r,s){s=t.$(s);var d,l,f=0;for(d=0,l=r.length;d<l;++d)(s?s(r[d]):r[d])==null&&(f+=1);return f},i.count.distinct=function(r,s){s=t.$(s);var d,l,f,p={},h=0;for(l=0,f=r.length;l<f;++l)(d=s?s(r[l]):r[l])in p||(p[d]=1,h+=1);return h},i.count.map=function(r,s){s=t.$(s);var d,l,f,p={};for(l=0,f=r.length;l<f;++l)p[d=s?s(r[l]):r[l]]=d in p?p[d]+1:1;return p},i.median=function(r,s){return s&&(r=r.map(t.$(s))),r=r.filter(t.isValid).sort(t.cmp),i.quantile(r,.5)},i.quartile=function(r,s){s&&(r=r.map(t.$(s))),r=r.filter(t.isValid).sort(t.cmp);var d=i.quantile;return[d(r,.25),d(r,.5),d(r,.75)]},i.quantile=function(r,s,d){d===void 0&&(d=s,s=t.identity),s=t.$(s);var l=(r.length-1)*d+1,f=Math.floor(l),p=+s(r[f-1]),h=l-f;return h?p+h*(s(r[f])-p):p},i.sum=function(r,s){s=t.$(s);for(var d,l=0,f=0,p=r.length;f<p;++f)d=s?s(r[f]):r[f],t.isValid(d)&&(l+=d);return l},i.mean=function(r,s){s=t.$(s);var d,l,f,p,h=0;for(d=0,f=0,l=r.length;d<l;++d)p=s?s(r[d]):r[d],t.isValid(p)&&(h+=(p-h)/++f);return h},i.mean.geometric=function(r,s){s=t.$(s);var d,l,f,p,h=1;for(p=0,d=0,l=r.length;p<l;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){if(f<=0)throw Error("Geometric mean only defined for positive values.");h*=f,++d}return h=d>0?Math.pow(h,1/d):0},i.mean.harmonic=function(r,s){s=t.$(s);var d,l,f,p,h=0;for(p=0,d=0,l=r.length;p<l;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(h+=1/f,++d);return d/h},i.variance=function(r,s){if(s=t.$(s),!t.isArray(r)||r.length<2)return 0;var d,l,f,p,h=0,m=0;for(l=0,f=0;l<r.length;++l)p=s?s(r[l]):r[l],t.isValid(p)&&(m+=(d=p-h)*(p-(h+=d/++f)));return m/=f-1},i.stdev=function(r,s){return Math.sqrt(i.variance(r,s))},i.modeskew=function(r,s){var d=i.mean(r,s),l=i.median(r,s),f=i.stdev(r,s);return f===0?0:(d-l)/f},i.min=function(r,s){return i.extent(r,s)[0]},i.max=function(r,s){return i.extent(r,s)[1]},i.extent=function(r,s){s=t.$(s);var d,l,f,p,h=r.length;for(p=0;p<h;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){d=l=f;break}for(;p<h;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(f<d&&(d=f),f>l&&(l=f));return[d,l]},i.extent.index=function(r,s){s=t.$(s);var d,l,f,p,h=-1,m=-1,v=r.length;for(p=0;p<v;++p)if(f=s?s(r[p]):r[p],t.isValid(f)){d=l=f,h=m=p;break}for(;p<v;++p)f=s?s(r[p]):r[p],t.isValid(f)&&(f<d&&(d=f,h=p),f>l&&(l=f,m=p));return[h,m]},i.dot=function(r,s,d){var l,f,p=0;if(d)for(s=t.$(s),d=t.$(d),l=0;l<r.length;++l)(f=s(r[l])*d(r[l]))==f&&(p+=f);else{if(r.length!==s.length)throw Error("Array lengths must match.");for(l=0;l<r.length;++l)(f=r[l]*s[l])==f&&(p+=f)}return p},i.dist=function(r,s,d,l){var f,p,h=t.isFunction(d)||t.isString(d),m=r,v=h?r:s,b=h?l:d,y=b===2||b==null,E=r.length,T=0;for(h&&(s=t.$(s),d=t.$(d)),p=0;p<E;++p)f=h?s(m[p])-d(v[p]):m[p]-v[p],T+=y?f*f:Math.pow(Math.abs(f),b);return y?Math.sqrt(T):Math.pow(T,1/b)},i.cohensd=function(r,s,d){var l=d?r.map(t.$(s)):r,f=d?r.map(t.$(d)):s,p=i.mean(l),h=i.mean(f),m=i.count.valid(l),v=i.count.valid(f);if(m+v-2<=0)return 0;var b=i.variance(l),y=i.variance(f),E=Math.sqrt(((m-1)*b+(v-1)*y)/(m+v-2));return E===0?0:(p-h)/E},i.covariance=function(r,s,d){var l,f,p,h,m,v=d?r.map(t.$(s)):r,b=d?r.map(t.$(d)):s,y=v.length,E=i.mean(v),T=i.mean(b),S=0,N=0;if(y!==b.length)throw Error("Input lengths must match.");for(l=0;l<y;++l)if(f=v[l],h=t.isValid(f),p=b[l],m=t.isValid(p),h&&m)S+=(f-E)*(p-T),++N;else if(h||m)throw Error("Valid values must align.");return S/(N-1)},i.rank=function(r,s){s=t.$(s)||t.identity;var d,l,f,p=r.map(function(y,E){return{idx:E,val:s(y)}}).sort(t.comparator("val")),h=r.length,m=Array(h),v=-1,b={};for(d=0;d<h;++d){if(l=p[d].val,v<0&&b===l)v=d-1;else if(v>-1&&b!==l){for(f=1+(d-1+v)/2;v<d;++v)m[p[v].idx]=f;v=-1}m[p[d].idx]=d+1,b=l}if(v>-1)for(f=1+(h-1+v)/2;v<h;++v)m[p[v].idx]=f;return m},i.cor=function(r,s,d){var l=d;d=l?r.map(t.$(d)):s,s=l?r.map(t.$(s)):r;var f=i.dot(s,d),p=i.mean(s),h=i.mean(d),m=i.stdev(s),v=i.stdev(d),b=r.length;return(f-b*p*h)/((b-1)*m*v)},i.cor.rank=function(r,s,d){var l,f,p,h=d?i.rank(r,s):i.rank(r),m=d?i.rank(r,d):i.rank(s),v=r.length;for(l=0,f=0;l<v;++l)f+=(p=h[l]-m[l])*p;return 1-6*f/(v*(v*v-1))},i.cor.dist=function(r,s,d){var l,f,p,h,m=d?r.map(t.$(s)):r,v=d?r.map(t.$(d)):s,b=i.dist.mat(m),y=i.dist.mat(v),E=b.length;for(l=0,f=0,p=0,h=0;l<E;++l)f+=b[l]*b[l],p+=y[l]*y[l],h+=b[l]*y[l];return Math.sqrt(h/Math.sqrt(f*p))},i.linearRegression=function(r,s,d){var l,f,p=d?r.map(t.$(s)):r,h=d?r.map(t.$(d)):s,m=p.length,v=i.covariance(p,h),b=i.stdev(p),y=i.stdev(h),E=v/(b*b),T=i.mean(h)-E*i.mean(p),S={slope:E,intercept:T,R:v/(b*y),rss:0};for(f=0;f<m;++f)t.isValid(p[f])&&t.isValid(h[f])&&(l=E*p[f]+T-h[f],S.rss+=l*l);return S},i.bootstrap={},i.bootstrap.ci=function(r,s,d,l,f){var p,h,m,v,b,y,E;for(t.isFunction(s)||t.isString(s)?(p=r.map(t.$(s)),h=d,m=l,v=f):(p=r,h=s,m=d,v=l),h=h?+h:1e3,m=m||.05,b=o.random.bootstrap(p,v),E=0,y=Array(h);E<h;++E)y[E]=i.mean(b.samples(p.length));return y.sort(t.numcmp),[i.quantile(y,m/2),i.quantile(y,1-m/2)]},i.z={},i.z.ci=function(r,s,d){var l=r,f=s;(t.isFunction(s)||t.isString(s))&&(l=r.map(t.$(s)),f=d);var p=(f=f||.05)===.05?1.96:o.random.normal(0,1).icdf(1-f/2),h=i.mean(l),m=i.stdev(l)/Math.sqrt(i.count.valid(l));return[h-p*m,h+p*m]},i.z.test=function(r,s,d,l){return t.isFunction(d)||t.isString(d)?(l&&l.paired?u:a)(l,r,s,d):t.isArray(s)?(d&&d.paired?u:a)(d,r,s):t.isFunction(s)||t.isString(s)?c(d,r,s):c(s,r)},i.dist.mat=function(r){var s,d,l,f=r.length,p=f*f,h=Array(p),m=o.zeros(f),v=0;for(d=0;d<f;++d)for(h[d*f+d]=0,l=d+1;l<f;++l)h[d*f+l]=s=Math.abs(r[d]-r[l]),h[l*f+d]=s,m[d]+=s,m[l]+=s;for(d=0;d<f;++d)v+=m[d],m[d]/=f;for(v/=p,d=0;d<f;++d)for(l=d;l<f;++l)h[d*f+l]+=v-m[d]-m[l],h[l*f+d]=h[d*f+l];return h},i.entropy=function(r,s){s=t.$(s);var d,l,f=0,p=0,h=r.length;for(d=0;d<h;++d)f+=s?s(r[d]):r[d];if(f===0)return 0;for(d=0;d<h;++d)(l=(s?s(r[d]):r[d])/f)&&(p+=l*Math.log(l));return-p/Math.LN2},i.mutual=function(r,s,d,l){var f,p,h,m=l?r.map(t.$(s)):r,v=l?r.map(t.$(d)):s,b=l?r.map(t.$(l)):d,y={},E={},T=b.length,S=0,N=0,C=0;for(h=0;h<T;++h)y[m[h]]=0,E[v[h]]=0;for(h=0;h<T;++h)y[m[h]]+=b[h],E[v[h]]+=b[h],S+=b[h];for(p=1/(S*Math.LN2),h=0;h<T;++h)b[h]!==0&&(f=S*b[h]/(y[m[h]]*E[v[h]]),N+=b[h]*p*Math.log(f),C+=b[h]*p*Math.log(b[h]/S));return[N,1+N/C]},i.mutual.info=function(r,s,d,l){return i.mutual(r,s,d,l)[0]},i.mutual.dist=function(r,s,d,l){return i.mutual(r,s,d,l)[1]},i.profile=function(r,s){var d,l,f,p,h,m=0,v=0,b=0,y=0,E=null,T=null,S=0,N=[],C={};for(f=0;f<r.length;++f)C[p=s?s(r[f]):r[f]]=p in C?C[p]+1:(y+=1,1),p==null?++b:t.isValid(p)&&(h=typeof p=="string"?p.length:p,(E===null||h<E)&&(E=h),(T===null||h>T)&&(T=h),S+=(d=h-m)*(h-(m+=d/++v)),N.push(h));return S/=v-1,l=Math.sqrt(S),N.sort(t.cmp),{type:n(r,s),unique:C,count:r.length,valid:v,missing:b,distinct:y,min:E,max:T,mean:m,stdev:l,median:p=i.quantile(N,.5),q1:i.quantile(N,.25),q3:i.quantile(N,.75),modeskew:l===0?0:(m-p)/l}},i.summary=function(r,s){var d=(s=s||t.keys(r[0])).map(function(l){var f=i.profile(r,t.$(l));return f.field=l,f});return d.__summary__=!0,d}}(Oi)),Oi.exports);const ps=us,Rt={nominal:0,key:1,ordinal:2,temporal:3,quantitative:4};class hs{constructor(t){this._tableSchema=t,t.fields.sort(function(n,o){return Rt[n.vlType]<Rt[o.vlType]?-1:Rt[n.vlType]>Rt[o.vlType]?1:n.name.localeCompare(o.name)}),t.fields.forEach((n,o)=>n.index=o),this._fieldSchemaIndex=t.fields.reduce((n,o)=>(n[o.name]=o,n),{})}fieldNames(){return this._tableSchema.fields.map(t=>t.name)}get fieldSchemas(){return this._tableSchema.fields}fieldSchema(t){return this._fieldSchemaIndex[t]}tableSchema(){const t=k.duplicate(this._tableSchema);return t.fields.sort((n,o)=>n.originalIndex-o.originalIndex),t}primitiveType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].type:null}vlType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].vlType:null}cardinality(t,n=!0,o=!1){const i=this._fieldSchemaIndex[t.field];if(t.aggregate||H(t)&&t.autoCount)return 1;if(t.bin){let c;c=typeof t.bin=="boolean"?{maxbins:Sn(t.channel)}:t.bin==="?"?{enum:[!0,!1]}:t.bin;const u=c.maxbins;return i.binStats[u]||(i.binStats[u]=Mi(u,i.stats)),i.binStats[u].distinct}if(t.timeUnit){if(n)switch(t.timeUnit){case W.SECONDS:case W.MINUTES:return 60;case W.HOURS:return 24;case W.DAY:return 7;case W.DATE:return 31;case W.MONTH:return 12;case W.QUARTER:return 4;case W.MILLISECONDS:return 1e3}let c=t.timeUnit,u=i.timeStats;return u&&u[c]||(u=Object.assign({},u,{[c]:Ii(t.timeUnit,i.stats)})),o?u[c].distinct-Ui(u[c].unique,["Invalid Date",null]):u[c].distinct}return i?o?i.stats.distinct-Ui(i.stats.unique,[NaN,null]):i.stats.distinct:null}timeUnitHasVariation(t){if(!t.timeUnit)return;if(t.timeUnit===W.DAY){const o=k.extend({},t,{timeUnit:W.DATE});if(this.cardinality(o,!1,!0)<=1)return!1}let n=t.timeUnit;for(let o of Fr)if(jr(n,o)){const i=k.extend({},t,{timeUnit:o});if(this.cardinality(i,!1,!0)<=1)return!1}return!0}domain(t){const n=this._fieldSchemaIndex[t.field];let o=k.keys(n.stats.unique);return n.vlType===R?[+n.stats.min,+n.stats.max]:n.type===L.DATETIME?[n.stats.min,n.stats.max]:n.type===L.INTEGER||n.type===L.NUMBER?(o=o.map(i=>+i),o.sort(k.cmp)):n.vlType===ce&&n.ordinalDomain?n.ordinalDomain:o.map(i=>i==="null"?null:i).sort(k.cmp)}stats(t){const n=this._fieldSchemaIndex[t.field];return n?n.stats:null}}function Mi(e,t){const n=ps({min:t.min,max:t.max,maxbins:e}),o=k.extend({},t);return o.unique=function(i,c){const u={};for(let a in c){let r;r=a===null?null:isNaN(Number(a))?NaN:i.value(Number(a)),u[r]=(u[r]||0)+c[a]}return u}(n,t.unique),o.distinct=(n.stop-n.start)/n.step,o.min=n.start,o.max=n.stop,o}function Ii(e,t){const n=k.extend({},t);let o={};return k.keys(t.unique).forEach(function(i){let c,u=i==="null"?null:new Date(i);c=u===null?null:isNaN(u.getTime())?"Invalid Date":(e===W.DAY?u.getDay():pa(e,u)).toString(),o[c]=(o[c]||0)+t.unique[i]}),n.unique=o,n.distinct=k.keys(o).length,n}function Ui(e,t){return t.reduce(function(n,o){return e[o]?n+1:n},0)}var L;(function(e){e[e.STRING="string"]="STRING",e[e.NUMBER="number"]="NUMBER",e[e.INTEGER="integer"]="INTEGER",e[e.BOOLEAN="boolean"]="BOOLEAN",e[e.DATETIME="datetime"]="DATETIME"})(L||(L={}));class Fi{constructor(t){this.constraint=t}name(){return this.constraint.name}description(){return this.constraint.description}properties(){return this.constraint.properties}strict(){return this.constraint.strict}}class Di extends Fi{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return fe(this.constraint.properties,n=>{if(pe(n)){let o=n.parent,i=n.child;return!t[o]||!w(t[o][i])}return!t[n]||!w(t[n])})}satisfy(t,n,o,i){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)||this.constraint.satisfy(t,n,o,i)}}const _i=[{name:"aggregateOpSupportedByType",description:"Aggregate function should be supported by data type.",properties:[g.TYPE,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.aggregate||!Lr(e.type)},{name:"asteriskFieldWithCountOnly",description:'Field="*" should be disallowed except aggregate="count"',properties:[g.FIELD,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>e.field==="*"==(e.aggregate==="count")},{name:"minCardinalityForBin",description:"binned quantitative field should not have too low cardinality",properties:[g.BIN,g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.bin&&e.type===R){let i={channel:e.channel,field:e.field,type:e.type};return t.cardinality(i)>=o.minCardinalityForBin}return!0}},{name:"binAppliedForQuantitative",description:"bin should be applied to quantitative field only.",properties:[g.TYPE,g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.bin||e.type===R},{name:"channelFieldCompatible",description:"encoding channel's range type be compatible with channel type.",properties:[g.CHANNEL,g.TYPE,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{const i=Object.assign({field:"f"},Mn(e,{schema:t,props:["bin","timeUnit","type"]})),{compatible:c}=Ta(i,e.channel);if(c)return!0;return!(e.channel!=="row"&&e.channel!=="column"||(u=i.timeUnit,!vn[u]&&!function(a){return!!bn[a]}(i.timeUnit)));var u}},{name:"hasFn",description:"A field with as hasFn flag should have one of aggregate, timeUnit, or bin.",properties:[g.AGGREGATE,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>!e.hasFn||!!e.aggregate||!!e.bin||!!e.timeUnit},{name:"omitScaleZeroWithBinnedField",description:"Do not use scale zero with binned field",properties:[g.SCALE,ge("scale","zero"),g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.bin||!e.scale||e.scale.zero!==!0},{name:"onlyOneTypeOfFunction",description:"Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.",properties:[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>A(e)?(!w(e.aggregate)&&e.aggregate?1:0)+(!w(e.bin)&&e.bin?1:0)+(!w(e.timeUnit)&&e.timeUnit?1:0)<=1:!0},{name:"timeUnitAppliedForTemporal",description:"Time unit should be applied to temporal field only.",properties:[g.TYPE,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.timeUnit||e.type===Q},{name:"timeUnitShouldHaveVariation",description:"A particular time unit should be applied only if they produce unique values.",properties:[g.TIMEUNIT,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>!e.timeUnit||e.type!==Q||!n.has("timeUnit")&&!o.constraintManuallySpecifiedValue||t.timeUnitHasVariation(e)},{name:"scalePropertiesSupportedByScaleType",description:"Scale properties must be supported by correct scale type",properties:[].concat(Nt,[g.SCALE,g.TYPE]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>{if(e.scale){const i=e.scale,c=De(e);if(c==null)return!0;for(let u in i){if(u==="type"||u==="name"||u==="enum")continue;const a=u;if(c==="point"){if(!fn("point",a)&&!fn("band",a))return!1}else if(!fn(c,a))return!1}}return!0}},{name:"scalePropertiesSupportedByChannel",description:"Not all scale properties are supported by all encoding channels",properties:[].concat(Nt,[g.SCALE,g.CHANNEL]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,o)=>{if(e){let i=e.channel,c=e.scale;if(i&&!w(i)&&c){if(i==="row"||i==="column")return!1;for(let u in c)if(c.hasOwnProperty(u)&&!(u==="type"||u==="name"||u==="enum")&&ia(i,u)!==void 0)return!1}}return!0}},{name:"typeMatchesPrimitiveType",description:"Data type should be supported by field's primitive type.",properties:[g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.field==="*")return!0;const i=t.primitiveType(e.field),c=e.type;if(!n.has("field")&&!n.has("type")&&!o.constraintManuallySpecifiedValue)return!0;switch(i){case L.BOOLEAN:case L.STRING:return c!==R&&c!==Q;case L.NUMBER:case L.INTEGER:return c!==Q;case L.DATETIME:return c===Q;case null:return!1}throw new Error("Not implemented")}},{name:"typeMatchesSchemaType",description:"Enumerated data type of a field should match the field's type in the schema.",properties:[g.FIELD,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>!(n.has("field")||n.has("type")||o.constraintManuallySpecifiedValue)||(e.field==="*"?e.type===R:t.vlType(e.field)===e.type)},{name:"maxCardinalityForCategoricalColor",description:"Categorical channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==de||e.type!==ie&&e.type!==le.KEY||t.cardinality(e)<=o.maxCardinalityForCategoricalColor},{name:"maxCardinalityForFacet",description:"Row/column channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==ne&&e.channel!==ee||t.cardinality(e)<=o.maxCardinalityForFacet},{name:"maxCardinalityForShape",description:"Shape channel should not have too high cardinality",properties:[g.CHANNEL,g.FIELD,g.BIN,g.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,o)=>e.channel!==Xe||t.cardinality(e)<=o.maxCardinalityForShape},{name:"dataTypeAndFunctionMatchScaleType",description:"Scale type must match data type",properties:[g.TYPE,g.SCALE,ge("scale","type"),g.TIMEUNIT,g.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>{if(e.scale){const i=e.type,c=De(e);if(Lr(i))return c===void 0||Ie(c);if(i===Q)return e.timeUnit?te([j.TIME,j.UTC,void 0],c)||Ie(c):te([j.TIME,j.UTC,void 0],c);if(i===R)return e.bin?te([j.LINEAR,void 0],c):te([j.LOG,j.POW,j.SQRT,j.QUANTILE,j.QUANTIZE,j.LINEAR,void 0],c)}return!0}},{name:"stackIsOnlyUsedWithXY",description:"stack should only be allowed for x and y channels",properties:[g.STACK,g.CHANNEL],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!e.stack||e.channel===D||e.channel===_}].map(e=>new Di(e));_i.reduce((e,t)=>(e[t.name()]=t,e),{});const gs=_i.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J),ji=[{name:"doesNotSupportConstantValue",description:"row, column, x, y, order, and detail should not work with constant values.",properties:[g.TYPE,g.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,o)=>!te(["row","column","x","y","detail","order"],e.channel)}].map(e=>new Di(e));ji.reduce((e,t)=>(e[t.name()]=t,e),{});const ms=ji.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J),ys=pr.reduce((e,t)=>(e[t]=!0,e),{});class vs extends Fi{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return fe(this.constraint.properties,n=>{if(n===g.MARK)return!w(t.getMark());if(pe(n)){let o=n.parent,i=n.child;return fe(t.getEncodings(),c=>!c[o]||!w(c[o][i]))}if(!Ir(n))throw new Error("UNIMPLEMENTED");return fe(t.getEncodings(),o=>!o[n]||!w(o[n]))})}satisfy(t,n,o){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)||this.constraint.satisfy(t,n,o)}}const Pi=[{name:"noRepeatedChannel",description:"Each encoding channel should only be used once.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{let o={};return fe(e.getEncodings(),i=>!!w(i.channel)||!o[i.channel]&&(o[i.channel]=!0,!0))}},{name:"alwaysIncludeZeroInScaleWithBarMark",description:"Do not recommend bar mark if scale does not start at zero",properties:[g.MARK,g.SCALE,ge("scale","zero"),g.CHANNEL,g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark(),i=e.getEncodings();if(o===me){for(let c of i)if(A(c)&&(c.channel===D||c.channel===_)&&c.type===R&&c.scale&&c.scale.zero===!1)return!1}return!0}},{name:"autoAddCount",description:"Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.",properties:[g.BIN,g.TIMEUNIT,g.TYPE,g.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>he(e.getEncodings(),o=>Dt(o))?fe(e.getEncodings(),o=>{if(oe(o)||H(o))return!0;switch(o.type){case R:return!!o.bin;case Q:return!!o.timeUnit;case ce:case le.KEY:case ie:return!0}throw new Error("Unsupported Type")}):fe(e.wildcardIndex.encodingIndicesByProperty.get("autoCount")||[],o=>{let i=e.getEncodingQueryByIndex(o);return H(i)&&!w(i.autoCount)})?he(e.getEncodings(),o=>(A(o)||H(o))&&o.type===R?!ae(o)&&A(o)&&(!o.bin||w(o.bin)):!(!A(o)||o.type!==Q)&&(!o.timeUnit||w(o.timeUnit))):!0},{name:"channelPermittedByMarkType",description:"Each encoding channel should be supported by the mark type",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark();return!!w(o)||fe(e.getEncodings(),i=>!!w(i.channel)||!!Qo(i.channel,o))}},{name:"hasAllRequiredChannelsForMark",description:"All required channels for the specified mark should be specified",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark();switch(o){case Ue:case tt:return e.channelUsed(D)&&e.channelUsed(_);case Ot:return e.channelUsed(on);case me:case kt:case Mt:case rt:case yn:case mn:return e.channelUsed(D)||e.channelUsed(_);case nt:return!e.wildcardIndex.hasProperty(g.CHANNEL)||e.channelUsed(D)||e.channelUsed(_)}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+JSON.stringify(o))}},{name:"omitAggregate",description:"Omit aggregate plots.",properties:[g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()},{name:"omitAggregatePlotWithDimensionOnlyOnFacet",description:"Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.",properties:[g.CHANNEL,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){let o=!1,i=!1,c=!1;if(e.specQuery.encodings.forEach((u,a)=>{oe(u)||ae(u)||A(u)&&!u.aggregate&&(i=!0,te([ne,ee],u.channel)?e.wildcardIndex.hasEncodingProperty(a,g.CHANNEL)&&(c=!0):o=!0)}),i&&!o&&(c||n.constraintManuallySpecifiedValue))return!1}return!0}},{name:"omitAggregatePlotWithoutDimension",description:"Aggregate plots without dimension should be omitted",properties:[g.AGGREGATE,g.AUTOCOUNT,g.BIN,g.TIMEUNIT,g.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()||he(e.getEncodings(),o=>!!(Ne(o)||A(o)&&o.type==="temporal"))},{name:"omitBarLineAreaWithOcclusion",description:"Don't use bar, line or area to visualize raw plot as they often lead to occlusion.",properties:[g.MARK,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!te([me,tt,Ue],e.getMark())||e.isAggregate()},{name:"omitBarTickWithSize",description:"Do not map field to size channel with bar and tick mark",properties:[g.CHANNEL,g.MARK],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.getMark();if(te([rt,me],o)&&e.channelEncodingField(Te)){if(n.constraintManuallySpecifiedValue)return!1;{const i=e.specQuery.encodings;for(let c=0;c<i.length;c++)if(i[c].channel===Te)return!e.wildcardIndex.hasEncodingProperty(c,g.CHANNEL)}}return!0}},{name:"omitBarAreaForLogScale",description:"Do not use bar and area mark for x and y's log scale",properties:[g.MARK,g.CHANNEL,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getMark(),i=e.getEncodings();if(o===Ue||o===me){for(let c of i)if(A(c)&&(c.channel===D||c.channel===_)&&c.scale&&De(c)===j.LOG)return!1}return!0}},{name:"omitMultipleNonPositionalChannels",description:"Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.specQuery.encodings;let i=0,c=!1;for(let u=0;u<o.length;u++){const a=o[u];if(oe(a)||ae(a))continue;const r=a.channel;if(!w(r)&&ys[r+""]&&(i+=1,e.wildcardIndex.hasEncodingProperty(u,g.CHANNEL)&&(c=!0),i>1&&(c||n.constraintManuallySpecifiedValue)))return!1}return!0}},{name:"omitNonPositionalOrFacetOverPositionalChannels",description:"Do not use non-positional channels unless all positional channels are used",properties:[g.CHANNEL],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const o=e.specQuery.encodings;let i=!1,c=!1,u=!1,a=!1;for(let r=0;r<o.length;r++){const s=o[r];if(oe(s)||ae(s))continue;const d=s.channel;d===D?u=!0:d===_?a=!0:w(d)||(i=!0,e.wildcardIndex.hasEncodingProperty(r,g.CHANNEL)&&(c=!0))}return!(c||n.constraintManuallySpecifiedValue&&i)||u&&a}},{name:"omitRaw",description:"Omit raw plots.",properties:[g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!!e.isAggregate()},{name:"omitRawContinuousFieldForAggregatePlot",description:"Aggregate plot should not use raw continuous field as group by values. (Quantitative should be binned. Temporal should have time unit.)",properties:[g.AGGREGATE,g.AUTOCOUNT,g.TIMEUNIT,g.BIN,g.TYPE],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){const o=e.specQuery.encodings;for(let i=0;i<o.length;i++){const c=o[i];if(!oe(c)&&!ae(c)&&(A(c)&&c.type===Q&&!c.timeUnit&&(e.wildcardIndex.hasEncodingProperty(i,g.TIMEUNIT)||n.constraintManuallySpecifiedValue)||c.type===R&&A(c)&&!c.bin&&!c.aggregate&&(e.wildcardIndex.hasEncodingProperty(i,g.BIN)||e.wildcardIndex.hasEncodingProperty(i,g.AGGREGATE)||e.wildcardIndex.hasEncodingProperty(i,g.AUTOCOUNT)||n.constraintManuallySpecifiedValue)))return!1}}return!0}},{name:"omitRawDetail",description:"Do not use detail channel with raw plot.",properties:[g.CHANNEL,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>!!e.isAggregate()||fe(e.specQuery.encodings,(o,i)=>!(!oe(o)&&!ae(o))||o.channel!==an||!e.wildcardIndex.hasEncodingProperty(i,g.CHANNEL)&&!n.constraintManuallySpecifiedValue)},{name:"omitRepeatedField",description:"Each field should be mapped to only one channel",properties:[g.FIELD],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{let o={},i={};const c=e.specQuery.encodings;for(let u=0;u<c.length;u++){const a=c[u];if(oe(a)||H(a))continue;let r;if(a.field&&!w(a.field)&&(r=a.field),H(a)&&!w(a.autoCount)&&(r="count_*"),r){if(e.wildcardIndex.hasEncodingProperty(u,g.FIELD)&&(i[r]=!0),o[r]&&(i[r]||n.constraintManuallySpecifiedValue))return!1;o[r]=!0}}return!0}},{name:"omitVerticalDotPlot",description:"Do not output vertical dot plot.",properties:[g.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const o=e.getEncodings();return o.length!==1||o[0].channel!==_}},{name:"hasAppropriateGraphicTypeForMark",description:"Has appropriate graphic type for mark",properties:[g.CHANNEL,g.MARK,g.TYPE,g.TIMEUNIT,g.BIN,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const o=e.getMark();switch(o){case Ue:case tt:if(e.isAggregate()){const l=e.getEncodingQueryByChannel(D),f=e.getEncodingQueryByChannel(_),p=at(l),h=at(f);return l&&f&&p!==h&&!(A(l)&&!p&&te(["nominal","key"],l.type))&&!(A(f)&&!h&&te(["nominal","key"],f.type))}return!0;case Ot:return!0;case me:case rt:if(e.channelEncodingField(Te))return!1;{const l=e.getEncodingQueryByChannel(D),f=e.getEncodingQueryByChannel(_);return at(l)!==at(f)}case mn:const i=e.getEncodingQueryByChannel(D),c=e.getEncodingQueryByChannel(_),u=Ne(i),a=Ne(c),r=e.getEncodingQueryByChannel(de),s=at(r),d=!!A(r)&&r.type===ce;return(u&&a||u&&!e.channelUsed(_)||a&&!e.channelUsed(D))&&(!r||r&&(s||d));case kt:case nt:case Mt:case yn:return!0}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+o)}},{name:"omitInvalidStackSpec",description:"If stack is specified, must follow Vega-Lite stack rules",properties:[g.STACK,g.FIELD,g.CHANNEL,g.MARK,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{if(!e.wildcardIndex.hasProperty(g.STACK))return!0;const o=e.getVlStack();return(o!==null||e.getStackOffset()===null)&&o.fieldChannel===e.getStackChannel()}},{name:"omitNonSumStack",description:"Stack specifications that use non-summative aggregates should be omitted (even implicit ones)",properties:[g.CHANNEL,g.MARK,g.AGGREGATE,g.AUTOCOUNT,g.SCALE,ge("scale","type"),g.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const o=e.getVlStack();if(o!=null){const i=e.getEncodingQueryByChannel(o.fieldChannel);if(!te(Pr,i.aggregate))return!1}return!0}},{name:"omitTableWithOcclusionIfAutoAddCount",description:"Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion",properties:[g.CHANNEL,g.TYPE,g.TIMEUNIT,g.BIN,g.AGGREGATE,g.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(n.autoAddCount){const o=e.getEncodingQueryByChannel("x"),i=e.getEncodingQueryByChannel("y");if((!A(o)||Ne(o))&&(!A(i)||Ne(i)))return!!e.isAggregate()&&fe(e.getEncodings(),c=>{let u=c.channel;return!(u!==D&&u!==_&&u!==ne&&u!==ee&&A(c)&&!c.aggregate)})}return!0}}].map(e=>new vs(e));Pi.reduce((e,t)=>(e[t.name()]=t,e),{});const bs=Pi.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new J);function Ri(e,t,n,o,i){const c=bs.get(e)||[];for(const u of c)if((u.strict()||i[u.name()])&&!u.satisfy(n,o,i)){let a="(spec) "+u.name();return i.verbose&&console.log(a+" failed with "+n.toShorthand()+" for "+t.name),a}return null}const $t=new J;function $i(e){return(t,n,o)=>(i,c)=>{const u=t.encodingIndicesByProperty.get(e);return function a(r){if(r===u.length)return void i.push(c.duplicate());const s=u[r],d=t.encodings[s].get(e),l=c.getEncodingQueryByIndex(s),f=c.getEncodingProperty(s,e);oe(l)||ae(l)||!f?a(r+1):(d.enum.forEach(p=>{p===null&&(p=void 0),c.setEncodingProperty(s,e,p,d),!function(m,v,b,y,E,T){const S=gs.get(m)||[],N=y.getEncodingQueryByIndex(b);for(const O of S)if((O.strict()||T[O.name()])&&!O.satisfy(N,E,y.wildcardIndex.encodings[b],T)){let M="(enc) "+O.name();return T.verbose&&console.log(M+" failed with "+y.toShorthand()+" for "+v.name),M}const C=ms.get(m)||[];for(const O of C)if((O.strict()||T[O.name()])&&oe(N)&&!O.satisfy(N,E,y.wildcardIndex.encodings[b],T)){let M="(enc) "+O.name();return T.verbose&&console.log(M+" failed with "+y.toShorthand()+" for "+v.name),M}return null}(e,d,s,c,n,o)&&(Ri(e,d,c,n,o)||a(r+1))}),c.resetEncodingProperty(s,e,d))}(0),i}}function ct(e,t,n){return t=t||new J,n=n||new J,e.forEach(o=>{var i;i=o,k.isObject(i)&&i.property?(t.setByKey(o.property,!0),n.setByKey(o.property,o.replace)):t.setByKey(o,!0)}),{include:t,replaceIndex:n,replacer:Oa(n)}}$t.set("mark",(e,t,n)=>(o,i)=>(i.getMark().enum.forEach(c=>{i.setMark(c),Ri("mark",e.mark,i,t,n)||o.push(i.duplicate())}),i.resetMark(),o)),pn.forEach(e=>{$t.set(e,$i(e))}),Ct.forEach(e=>{$t.set(e,$i(e))});const Bi=[g.FIELD,g.TYPE,g.AGGREGATE,g.BIN,g.TIMEUNIT,g.STACK],xs=Bi.concat([{property:g.CHANNEL,replace:{x:"xy",y:"xy",color:"style",size:"style",shape:"style",opacity:"style",row:"facet",column:"facet"}}]);let Fn={};function Bt(e,t){Fn[e]=t}const Li=ct([g.FIELD]);Bt("field",e=>qe(e,Li.include,Li.replacer));const Wi=ct(Bi);Bt("fieldTransform",e=>qe(e,Wi.include,Wi.replacer));const Hi=ct(xs);Bt("encoding",e=>qe(e,Hi.include,Hi.replacer)),Bt("spec",e=>JSON.stringify(e));class Es{constructor(){this._mark=void 0,this._encodings={},this._encodingIndicesByProperty=new J}setEncodingProperty(t,n,o){const i=this._encodings;(i[t]=i[t]||new J).set(n,o);const c=this._encodingIndicesByProperty;return c.set(n,c.get(n)||[]),c.get(n).push(t),this}hasEncodingProperty(t,n){return!!this._encodings[t]&&this._encodings[t].has(n)}hasProperty(t){if(Ir(t))return this.encodingIndicesByProperty.has(t);if(t==="mark")return!!this.mark;throw new Error("Unimplemented for property "+t)}isEmpty(){return!this.mark&&this.encodingIndicesByProperty.size()===0}setMark(t){return this._mark=t,this}get mark(){return this._mark}get encodings(){return this._encodings}get encodingIndicesByProperty(){return this._encodingIndicesByProperty}}class Qt{constructor(t,n,o,i,c){this._rankingScore={},this._spec=t,this._channelFieldCount=t.encodings.reduce((u,a)=>(w(a.channel)||H(a)&&a.autoCount===!1||(u[a.channel+""]=1),u),{}),this._wildcardIndex=n,this._assignedWildcardIndex=c,this._opt=i,this._schema=o}static build(t,n,o){let i=new Es;if(w(t.mark)){const c=it(g.MARK);t.mark=xn(t.mark,c,o.enum.mark),i.setMark(t.mark)}if(t.encodings.forEach((c,u)=>{H(c)&&(console.warn("A field with autoCount should not be included as autoCount meant to be an internal object."),c.type=R),A(c)&&c.type===void 0&&(c.type=P),pn.forEach(a=>{if(w(c[a])){const r=it(a)+u,s=Tn(a,n,o),d=c[a]=xn(c[a],r,s);i.setEncodingProperty(u,a,d)}}),Ct.forEach(a=>{const r=c[a.parent];if(r){const s=a.child;if(w(r[s])){const d=it(a)+u,l=Tn(a,n,o),f=r[s]=xn(r[s],d,l);i.setEncodingProperty(u,a,f)}}})}),o.autoAddCount){const c={name:it(g.CHANNEL)+t.encodings.length,enum:Tn(g.CHANNEL,n,o)},u={name:it(g.AUTOCOUNT)+t.encodings.length,enum:[!1,!0]},a={channel:c,autoCount:u,type:R};t.encodings.push(a);const r=t.encodings.length-1;i.setEncodingProperty(r,g.CHANNEL,c),i.setEncodingProperty(r,g.AUTOCOUNT,u)}return new Qt(t,i,n,o,{})}get wildcardIndex(){return this._wildcardIndex}get schema(){return this._schema}get specQuery(){return this._spec}duplicate(){return new Qt(k.duplicate(this._spec),this._wildcardIndex,this._schema,this._opt,k.duplicate(this._assignedWildcardIndex))}setMark(t){const n=this._wildcardIndex.mark.name;this._assignedWildcardIndex[n]=this._spec.mark=t}resetMark(){const t=this._spec.mark=this._wildcardIndex.mark;delete this._assignedWildcardIndex[t.name]}getMark(){return this._spec.mark}getEncodingProperty(t,n){const o=this._spec.encodings[t];return pe(n)?o[n.parent][n.child]:o[n]}setEncodingProperty(t,n,o,i){const c=this._spec.encodings[t];n===g.CHANNEL&&c.channel&&!w(c.channel)&&this._channelFieldCount[c.channel]--,pe(n)?c[n.parent][n.child]=o:hn(n)&&o===!0?c[n]=k.extend({},c[n],{enum:void 0,name:void 0}):c[n]=o,this._assignedWildcardIndex[i.name]=o,n===g.CHANNEL&&(this._channelFieldCount[o]=(this._channelFieldCount[o]||0)+1)}resetEncodingProperty(t,n,o){const i=this._spec.encodings[t];n===g.CHANNEL&&this._channelFieldCount[i.channel]--,pe(n)?i[n.parent][n.child]=o:i[n]=o,delete this._assignedWildcardIndex[o.name]}channelUsed(t){return this._channelFieldCount[t]>0}channelEncodingField(t){return A(this.getEncodingQueryByChannel(t))}getEncodings(){return this._spec.encodings.filter(t=>!ae(t))}getEncodingQueryByChannel(t){for(let n of this._spec.encodings)if(n.channel===t)return n}getEncodingQueryByIndex(t){return this._spec.encodings[t]}isAggregate(){return he(this._spec.encodings,t=>A(t)&&!w(t.aggregate)&&!!t.aggregate||Dt(t))}getVlStack(){return Hr(this._spec)}getStackOffset(){return function(t){for(const n of t.encodings)if(n[g.STACK]!==void 0&&!w(n[g.STACK]))return n[g.STACK]}(this._spec)}getStackChannel(){return function(t){for(const n of t.encodings)if(n[g.STACK]!==void 0&&!w(n.channel))return n.channel;return null}(this._spec)}toShorthand(t){if(t){if(k.isString(t))return function(o,i){return Fn[i](o)}(this.specQuery,t);const n=ct(t);return qe(this._spec,n.include,n.replacer)}return qe(this._spec)}toSpec(t){if(w(this._spec.mark))return null;let n={};return(t=t||this._spec.data)&&(n.data=t),this._spec.transform&&(n.transform=this._spec.transform),n.mark=this._spec.mark,n.encoding=Qr(this.specQuery.encodings,{schema:this._schema,wildcardMode:"null"}),this._spec.width&&(n.width=this._spec.width),this._spec.height&&(n.height=this._spec.height),this._spec.background&&(n.background=this._spec.background),this._spec.padding&&(n.padding=this._spec.padding),this._spec.title&&(n.title=this._spec.title),n.encoding===null?null:((this._spec.config||this._opt.defaultSpecConfig)&&(n.config=k.extend({},this._opt.defaultSpecConfig,this._spec.config)),n)}getRankingScore(t){return this._rankingScore[t]}setRankingScore(t,n){this._rankingScore[t]=n}}function qi(e){return e.items!==void 0}function Dn(e){let t=e.items[0];for(;t&&qi(t);)t=t.items[0];return t}class Ge{constructor(t){this.type=t,this.scoreIndex=this.initScore()}getFeatureScore(t){const n=this.type,o=this.scoreIndex[t];if(o!==void 0)return{type:n,feature:t,score:o}}}var Z;(function(e){e[e.Q=R]="Q",e[e.BIN_Q="bin_"+R]="BIN_Q",e[e.T=Q]="T",e[e.TIMEUNIT_T="timeUnit_time"]="TIMEUNIT_T",e[e.TIMEUNIT_O="timeUnit_"+ce]="TIMEUNIT_O",e[e.O=ce]="O",e[e.N=ie]="N",e[e.K=le.KEY]="K",e[e.NONE="-"]="NONE"})(Z||(Z={}));const Gi=Z.Q,Lt=Z.BIN_Q,_n=Z.T,ze=Z.TIMEUNIT_T,Wt=Z.TIMEUNIT_O,Ht=Z.O,qt=Z.N,jn=Z.K,Gt=Z.NONE;function zt(e){return e.bin?Z.BIN_Q:e.timeUnit?Ie(De(e))?Z.TIMEUNIT_O:Z.TIMEUNIT_T:e.type}const Pn=-10;function q(e,t,n,o){return e+"_"+t+"_"+n+"_"+o}const Ts=[new class extends Ge{constructor(){super("Axis")}initScore(e={}){e=Object.assign({},ot,e);let t={};return[{feature:Lt,opt:"preferredBinAxis"},{feature:_n,opt:"preferredTemporalAxis"},{feature:ze,opt:"preferredTemporalAxis"},{feature:Wt,opt:"preferredTemporalAxis"},{feature:Ht,opt:"preferredOrdinalAxis"},{feature:qt,opt:"preferredNominalAxis"}].forEach(n=>{e[n.opt]===D?t[n.feature+"_"+_]=-.01:e[n.opt]===_&&(t[n.feature+"_"+D]=-.01)}),t}featurize(e,t){return e+"_"+t}getScore(e,t,n){return e.getEncodings().reduce((o,i)=>{if(A(i)||H(i)){const c=zt(i),u=this.featurize(c,i.channel),a=this.getFeatureScore(u);a&&o.push(a)}return o},[])}},new class extends Ge{constructor(){super("Dimension")}initScore(){return{row:-2,column:-2,color:0,opacity:0,size:0,shape:0}}getScore(e,t,n){return e.isAggregate()&&e.getEncodings().reduce((o,i)=>{if(H(i)||A(i)&&!i.aggregate){const c=this.getFeatureScore(i.channel+"");if(c&&c.score>o.score)return c}return o},{type:"Dimension",feature:"No Dimension",score:-5}),[]}},new class extends Ge{constructor(){super("Facet")}initScore(e){let t={};return(e=Object.assign({},ot,e)).preferredFacet===ne?t[ee]=-.01:e.preferredFacet===ee&&(t[ne]=-.01),t}getScore(e,t,n){return e.getEncodings().reduce((o,i)=>{if(A(i)||H(i)){const c=this.getFeatureScore(i.channel);c&&o.push(c)}return o},[])}},new class extends Ge{constructor(){super("Mark")}initScore(){return function(){const e=[Gi,_n],t=[Lt,Wt,Ht,qt,jn].concat([Gt]);let n={};e.forEach(o=>{e.forEach(i=>{V({point:0,text:-.2,tick:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c}),V({point:0,text:-.2,tick:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c})})}),e.forEach(o=>{t.forEach(i=>{V({tick:0,point:-.2,text:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c;const r=q(i,o,!0,u);n[r]=c})}),[ze].forEach(i=>{V({point:0,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!0,u);n[a]=c;const r=q(i,o,!0,u);n[r]=c})}),[Gt,qt,Ht,jn].forEach(i=>{V({bar:0,point:-.2,tick:-.25,text:-.3,line:-2,area:-2,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})}),[Lt].forEach(i=>{V({bar:0,point:-.2,tick:-.25,text:-.3,line:-.5,area:-.5,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})}),[ze,Wt].forEach(i=>{V({line:0,area:-.1,bar:-.2,point:-.3,tick:-.35,text:-.4,rule:-2.5},(c,u)=>{const a=q(o,i,!1,u);n[a]=c;const r=q(i,o,!1,u);n[r]=c})})}),[ze].forEach(o=>{[ze].forEach(i=>{const c={point:0,rect:-.1,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u})}),t.forEach(i=>{const c={tick:0,point:-.2,text:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(i,o,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u}),V(c,(u,a)=>{const r=q(i,o,!1,a);n[r]=u})})});for(const o of t)for(const i of t){const c={point:0,rect:0,text:-.1,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};V(c,(u,a)=>{const r=q(o,i,!0,a);n[r]=u}),V(c,(u,a)=>{const r=q(o,i,!1,a);n[r]=u})}return n}()}getScore(e,t,n){let o=e.getMark();o!==kt&&o!==Mt||(o=nt);const i=e.getEncodingQueryByChannel(D),c=i?zt(i):Gt,u=e.getEncodingQueryByChannel(_),a=c+"_"+(u?zt(u):Gt)+"_"+!e.isAggregate()+"_"+o,r=this.getFeatureScore(a);return r?[r]:(console.error("feature score missing for",a),[])}},new class extends Ge{constructor(){super("SizeChannel")}initScore(){return{bar_size:-2,tick_size:-2}}getScore(e,t,n){const o=e.getMark();return e.getEncodings().reduce((i,c)=>{if(A(c)||H(c)){const u=o+"_"+c.channel,a=this.getFeatureScore(u);a&&i.push(a)}return i},[])}},new class extends Ge{constructor(){super("TypeChannel")}initScore(){let e={};const t={x:0,y:0,size:-.575,color:-.725,text:-2,opacity:-3,shape:Pn,row:Pn,column:Pn,detail:-20};[Gi,_n,ze].forEach(i=>{k.keys(t).forEach(c=>{e[this.featurize(i,c)]=t[c]})});const n=k.extend({},t,{row:-.75,column:-.75,shape:-3.1,text:-3.2,detail:-4});[Lt,Wt,Ht].forEach(i=>{k.keys(n).forEach(c=>{e[this.featurize(i,c)]=n[c]})});const o={x:0,y:0,color:-.6,shape:-.65,row:-.7,column:-.7,text:-.8,detail:-2,size:-3,opacity:-3.1};return k.keys(o).forEach(i=>{e[this.featurize(qt,i)]=o[i],e[this.featurize(jn,i)]=te(["x","y","detail"],i)?-1:o[i]-2}),e}featurize(e,t){return e+"_"+t}getScore(e,t,n){const o=e.getEncodings().reduce((c,u)=>{if(A(u)||H(u)){const a=zr(u);(c[a]=c[a]||[]).push(u)}return c},{}),i=[];return V(o,c=>{const u=c.reduce((a,r)=>{if(A(r)||H(r)){const s=zt(r),d=this.featurize(s,r.channel),l=this.getFeatureScore(d);if(a===null||l.score>a.score)return l}return a},null);i.push(u)}),i}}],Ce="aggregationQuality";let zi={};function Rn(e,t){zi[e]=t}function Yi(e,t,n,o){return t.nest&&o!==t.nest.length?(e.items.forEach(i=>{Yi(i,t,n,o+1)}),t.nest[o].orderGroupBy&&e.items.sort(function(i,c,u){return(a,r)=>{const s=Dn(a),d=Dn(r);return Qi(i instanceof Array?i:[i],s,d,c,u)}}(t.nest[o].orderGroupBy,n,t.config))):(t.orderBy||t.chooseBy)&&(e.items.sort(function(i,c,u){return(a,r)=>Qi(i instanceof Array?i:[i],a,r,c,u)}(t.orderBy||t.chooseBy,n,t.config)),t.chooseBy&&e.items.length>0&&e.items.splice(1)),e}function Qi(e,t,n,o,i){for(let c of e){let u=Vi(n,c,o,i).score-Vi(t,c,o,i).score;if(u!==0)return u}return 0}function Vi(e,t,n,o){if(e.getRankingScore(t)!==void 0)return e.getRankingScore(t);const i=function(u){return zi[u]}(t),c=i(e,n,o);return e.setRankingScore(t,c),c}function Ss(e,t,n){let o={};return e=e.map(function(i){return n.smallRangeStepForHighCardinalityOrFacet&&(i=function(c,u,a,r){[ne,_,ee,D].forEach(l=>{a[l]=c.getEncodingQueryByChannel(l)});const s=a[_];if(s!==void 0&&A(s)&&(a[ne]||u.cardinality(s)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){s.scale===void 0&&(s.scale={});const l=De(s);s.scale&&(l===void 0||Ie(l))&&(s.scale.rangeStep||(s.scale.rangeStep=12))}const d=a[D];if(A(d)&&(a[ee]||u.cardinality(d)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){d.scale===void 0&&(d.scale={});const l=De(d);d.scale&&(l===void 0||Ie(l))&&(d.scale.rangeStep||(d.scale.rangeStep=12))}return c}(i,t,o,n)),n.nominalColorScaleForHighCardinality&&(i=function(c,u,a,r){a[de]=c.getEncodingQueryByChannel(de);const s=a[de];return A(s)&&s!==void 0&&(s.type===ie||s.type===le.KEY)&&u.cardinality(s)>r.nominalColorScaleForHighCardinality.maxCardinality&&(s.scale===void 0&&(s.scale={}),s.scale&&(s.scale.range||(s.scale.scheme=r.nominalColorScaleForHighCardinality.palette))),c}(i,t,o,n)),n.xAxisOnTopForHighYCardinalityWithoutColumn&&(i=function(c,u,a,r){if([ee,D,_].forEach(s=>{a[s]=c.getEncodingQueryByChannel(s)}),a[ee]===void 0){const s=a[D],d=a[_];A(s)&&A(d)&&d!==void 0&&d.field&&Ie(De(d))&&s!==void 0&&u.cardinality(d)>r.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality&&(s.axis===void 0&&(s.axis={}),s.axis&&!s.axis.orient&&(s.axis.orient="top"))}return c}(i,t,o,n)),i}),e}function ws(e,t,n=ot){const o=Qt.build(e,t,n),i=o.wildcardIndex;let c=[o];return n.propertyPrecedence.forEach(u=>{const a=function(r){const s=r.split(".");if(s.length===1)return r;if(s.length===2)return{parent:s[0],child:s[1]};throw"Invalid property key with "+s.length+" dots: "+r}(u);if(i.hasProperty(a)){const r=function(d){return $t.get(d)}(a),s=r(i,t,n);c=c.reduce(s,[])}}),!n.stylize||n.nominalColorScaleForHighCardinality===null&&n.smallRangeStepForHighCardinalityOrFacet===null&&n.xAxisOnTopForHighYCardinalityWithoutColumn===null?c:Ss(c,t,n)}function Ki(e,t,n){return e=Object.assign({},function(o){if(o.groupBy){let i={groupBy:o.groupBy};o.orderBy&&(i.orderGroupBy=o.orderBy);let c={spec:k.duplicate(o.spec),nest:[i]};return o.chooseBy&&(c.chooseBy=o.chooseBy),o.config&&(c.config=o.config),c}return k.duplicate(o)}(e),{config:Object.assign({},ot,n,e.config)}),{query:e,result:Yi(function(o,i){if(i){const c={name:"",path:"",items:[]};let u={},a=[],r=[],s=[];for(let d=0;d<i.length;d++){a.push(d>0?a[d-1].duplicate():new J),r.push(d>0?r[d-1].duplicate():new J);const l=i[d].groupBy;if(k.isArray(l)){let f=ct(l,a[d],r[d]);s.push(f.replacer)}}return o.forEach(d=>{let l="",f=c;for(let p=0;p<i.length;p++){const h=f.groupBy=i[p].groupBy;f.orderGroupBy=i[p].orderGroupBy;const m=k.isArray(h)?qe(d.specQuery,a[p],s[p]):Fn[h](d.specQuery);l+="/"+m,u[l]||(u[l]={name:m,path:l,items:[]},f.items.push(u[l])),f=u[l]}f.items.push(d)}),c}return{name:"",path:"",items:o}}(ws(e.spec,t,e.config),e.nest),e,t,0)}}Rn("effectiveness",function(e,t,n){const o=Ts.reduce((i,c)=>{const u=c.getScore(e,t,n);return i.concat(u)},[]);return{score:o.reduce((i,c)=>i+c.score,0),features:o}}),Rn(Ce,function(e,t,n){const o=function(i){const c=i.getEncodings();if(i.isAggregate()){if(he(c,u=>A(u)&&(u.type===R&&!u.bin&&!u.aggregate||u.type===Q&&!u.timeUnit)))return{type:Ce,score:.1,feature:"Aggregate with raw continuous"};if(he(c,u=>A(u)&&Ne(u))){let u=he(c,r=>A(r)&&r.aggregate==="count"||Dt(r)),a=he(c,r=>A(r)&&!!r.bin);return u?{type:Ce,score:.8,feature:"Aggregate with count"}:a?{type:Ce,score:.7,feature:"Aggregate with bin but without count"}:{type:Ce,score:.9,feature:"Aggregate without count and without bin"}}return{type:Ce,score:.3,feature:"Aggregate without dimension"}}return he(c,u=>A(u)&&!Ne(u))?{type:Ce,score:1,feature:"Raw with measure"}:{type:Ce,score:.2,feature:"Raw without measure"}}(e);return{score:o.score,features:[o]}}),Rn("fieldOrder",function(e,t,n){const o=e.wildcardIndex.encodingIndicesByProperty.get("field");if(!o)return{score:0,features:[]};const i=e.specQuery.encodings,c=t.fieldSchemas.length,u=[];let a=0,r=1;for(let s=o.length-1;s>=0;s--){const d=o[s],l=i[d];let f;if(!A(l))continue;f=l.field;const p=e.wildcardIndex.encodings[d].get("field"),h=t.fieldSchema(f).index,m=-h*r;a+=m,u.push({score:m,type:"fieldOrder",feature:`field ${p.name} is ${f} (#${h} in the schema)`}),r*=c}return{score:a,features:u}});const Ye={[L.BOOLEAN]:x.jsx(yo,{className:"h-5 w-5 inline-flex opacity-60"}),[L.DATETIME]:x.jsx(mo,{className:"h-5 w-5 inline-flex opacity-60"}),[L.NUMBER]:x.jsx(go,{className:"h-5 w-5 inline-flex opacity-60"}),[L.STRING]:x.jsx(ho,{className:"h-5 w-5 inline-flex opacity-60"}),[L.INTEGER]:x.jsx(Wo,{className:"h-5 w-5 inline-flex opacity-60"})},Ns=e=>{const t=Ee.c(26),{schema:n}=e,[o,i]=Yn.useState(),[c,u]=Yn.useState();let a;if(t[0]!==n||t[1]!==o||t[2]!==c){const r=n.fieldNames(),s=o?n.stats({field:o,channel:"x"}):void 0;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=x.jsx(Lo,{className:"text-muted-foreground",width:40,height:40,strokeWidth:1.5}),t[4]=d):d=t[4];const l=d,f=c?r:r.slice(0,12),p=r.length>12,h=r.length>0?r.length:"No";let m,v;t[5]!==h?(m=x.jsxs("span",{className:"text-muted-foreground font-semibold",children:[h," fields"]}),t[5]=h,t[6]=m):m=t[6],t[7]!==n||t[8]!==o?(v=I=>{const F=n.cardinality({channel:"x",field:I});return x.jsxs("span",{className:vo("hover:bg-muted self-start px-2 py-2 rounded flex flex-row gap-1 items-center cursor-pointer lg:justify-center text-sm truncate shrink-0 overflow-hidden",o===I&&"bg-muted"),onClick:()=>{i(o!==I?I:void 0)},children:[Ye[n.primitiveType(I)],I,F>1&&x.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",F,")"]})]},I)},t[7]=n,t[8]=o,t[9]=v):v=t[9];const b=f.map(v);let y,E;t[10]!==p||t[11]!==c?(y=p&&x.jsx(Qn,{"data-testid":"marimo-plugin-data-explorer-show-more-columns",variant:"link",size:"sm",className:"self-center col-span-3 -mt-1",onClick:()=>u(Os),children:c?"Show less":"Show more"}),t[10]=p,t[11]=c,t[12]=y):y=t[12],t[13]!==b||t[14]!==y?(E=x.jsxs("div",{className:"hidden lg:grid grid-cols-2 xl:grid-cols-3 gap-2 p-2 bg-(--slate-1) border rounded lg:items-center items-start w-fit grid-flow-dense max-h-[300px] overflow-auto",children:[b,y]}),t[13]=b,t[14]=y,t[15]=E):E=t[15];const T=o||"",S=r.length===0;let N,C,O,M,U;t[16]===Symbol.for("react.memo_cache_sentinel")?(N=I=>{i(I)},t[16]=N):N=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(C=x.jsx(pt,{className:"min-w-[210px] h-full",children:x.jsx(Vn,{placeholder:"Select a column"})}),t[17]=C):C=t[17],t[18]!==n?(O=n.fieldNames().map(I=>x.jsx(ke,{value:I.toString(),children:x.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[Ye[n.primitiveType(I)],x.jsx("span",{className:"flex-1",children:I}),x.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",n.vlType(I),")"]})]})},I)),t[18]=n,t[19]=O):O=t[19],t[20]!==O?(M=x.jsx(ht,{children:x.jsx(Ke,{children:O})}),t[20]=O,t[21]=M):M=t[21],t[22]!==S||t[23]!==M||t[24]!==T?(U=x.jsx("div",{className:"lg:hidden",children:x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-column-select",value:T,disabled:S,onValueChange:N,children:[C,M]})}),t[22]=S,t[23]=M,t[24]=T,t[25]=U):U=t[25],a=x.jsxs("div",{className:"flex flex-col justify-center items-center h-full flex-1 gap-2",children:[l,m,E,U,o&&x.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2 p-2 text-sm",children:Cs.map(I=>x.jsxs("div",{className:"flex flex-row gap-2 min-w-[100px]",children:[x.jsx("span",{className:"font-semibold",children:I}),x.jsx("span",{children:As(s==null?void 0:s[I])})]},I))})]}),t[0]=n,t[1]=o,t[2]=c,t[3]=a}else a=t[3];return a},Cs=["distinct","min","max","mean","median","q1","q3","stdev"];function As(e){return typeof e=="number"?new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e):typeof e=="string"?e:typeof e=="object"&&e instanceof Date?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(e):String(e)}function Os(e){return!e}function ks(e){return e?e==="bin"?{bin:!0}:Ro(e)?{aggregate:e}:function(t){return t?Ji.includes(t)||Xi.includes(t):!1}(e)?{timeUnit:e}:{}:{}}const Ms=["bin","min","max","mean","median","sum"],Ji=["year","month","date","day","hours","minutes","seconds","milliseconds"],Xi=["yearmonth","yearmonthdate","monthdate"],Is=[P,"area","bar","circle","geoshape","line","point","rect","rule","square","text","tick","trail"],Us={type:"histograms",limit:12,createQuery:e=>({spec:{data:e.spec.data,mark:P,transform:e.spec.transform,encodings:[{channel:P,bin:P,timeUnit:P,field:P,type:P},{channel:P,aggregate:"count",field:"*",type:"quantitative"}]},groupBy:"fieldTransform",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!1}})};function Zi(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function Fs(e){const{aggregate:t,bin:n,timeUnit:o,field:i,scale:c,legend:u,axis:a,sort:r,description:s}=e;let{type:d}=e;if(w(d))throw new Error("Wildcard not support");d==="ordinal"&&(bo.warn("Ordinal type is not supported. Using nominal type instead."),d="nominal");const l=function(f){const{aggregate:p,bin:h,timeUnit:m}=f;return h?"bin":p?p.toString():m?m.toString():void 0}({aggregate:t,bin:n,timeUnit:o});return xo(i!==void 0,"Field is required for fieldQ"),Zi({field:i,fn:l,type:d,sort:r,scale:c,axis:a,legend:u,description:s})}function Ds(e){return e?Object.entries(e).map(([t,n])=>function(o,i){const{fn:c,...u}=o;return{channel:i,...ks(c),...u}}(n,t)):[]}function $n(e){const{type:t,limit:n,additionalFieldQuery:o}=e;return{type:t,limit:n,createQuery:i=>({spec:{...i.spec,encodings:[...i.spec.encodings,o]},groupBy:"field",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!0}})}}const _s=$n({type:"addCategoricalField",limit:4,additionalFieldQuery:{channel:P,field:P,type:"nominal"}}),js=$n({type:"addQuantitativeField",limit:4,additionalFieldQuery:{channel:P,bin:P,aggregate:P,field:P,type:"quantitative"}}),Ps=$n({type:"addTemporalField",limit:2,additionalFieldQuery:{channel:P,hasFn:!0,timeUnit:P,field:P,type:"temporal"}});function eo(e){return e.encodings.length===0}function to(e){let t=!1,n=!1,o=!1;for(const i of e.encodings)oe(i)||(H(i)?w(i.autoCount)&&(n=!0):(w(i.field)&&(t=!0),(w(i.aggregate)||w(i.bin)||w(i.timeUnit))&&(n=!0),w(i.channel)&&(o=!0)));return{hasAnyWildcard:o||t||n,hasWildcardField:t,hasWildcardFn:n,hasWildcardChannel:o}}const no={name:"source"};function Rs(e,t){const n={},{hasOpenPosition:o,hasStyleChannel:i,hasOpenFacet:c}=function(u){let a=!1,r=!1,s=!1;return u.encodings.forEach(d=>{d.channel==="x"||d.channel==="y"?a=!0:d.channel==="row"||d.channel==="column"?s=!0:typeof d.channel=="string"&&$o(Bo,d.channel)&&(r=!0)}),{hasOpenPosition:a,hasStyleChannel:r,hasOpenFacet:s}}(e.spec);return(o||i)&&(n.addQuantitativeField=Yt(js,e,t)),(o||i||c)&&(n.addCategoricalField=Yt(_s,e,t)),o&&(n.addTemporalField=Yt(Ps,e,t)),n}function Bn(e,t){return eo(e.spec)?{plots:[],query:e,limit:1}:{plots:[ro(Ki(e,t).result,no)[0]],query:e,limit:1}}function Yt(e,t,n){const o=e.createQuery(t);return{plots:ro(Ki(o,n).result,no),query:o,limit:e.limit}}function ro(e,t){return e.items.map(n=>qi(n)?io(t,Dn(n)):io(t,n))}function io(e,t){return{fieldInfos:t.getEncodings().filter(A).map(n=>({fieldDef:Fs(n),channel:n.channel})),spec:t.toSpec(e)}}function $s(e){const{spec:t,autoAddCount:n}=e,o=function(r){return{mark:r.mark,encodings:Ds(r.encoding),config:r.config}}(t),{hasAnyWildcard:i,hasWildcardFn:c,hasWildcardField:u}=to(o),a=function(r){const{hasWildcardFn:s,hasWildcardField:d}=r;return s?"fieldTransform":d?"field":"encoding"}({hasWildcardFn:c,hasWildcardField:u});return{spec:o,groupBy:a,orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:i?{autoAddCount:n}:void 0}}const{valueAtom:Qe,useActions:Bs}=Eo(function(){return{mark:P,encoding:{},config:{},schema:null}},{setSchema:(e,t)=>({...e,schema:t}),setMark:(e,t)=>({...e,mark:t}),setEncoding:(e,t)=>{const n=Zi({...e.encoding,...t});return{...e,encoding:n}},set:(e,t)=>{const{schema:n,...o}=t;return{...e,...o}}});function oo(){return Bs()}const Ls=To(e=>{const t=e(Qe);if(!t.schema)return{};const n=$s({spec:t,autoAddCount:!0});return eo(n.spec)?{main:Bn(n,t.schema),histograms:Yt(Us,n,t.schema)}:function(o){return!to(o).hasAnyWildcard}(n.spec)&&!function(o){const i=new Set(o.encodings.map(a=>a.channel)),c=["x","y","color"].every(a=>i.has(a)),u=["row","column"].some(a=>i.has(a));return c&&u}(n.spec)?{main:Bn(n,t.schema),...Rs(n,t.schema)}:{main:Bn(n,t.schema)}}),Ws=["x","y","row","column"],Hs=["color","size","shape"],qs=e=>{const t=Ee.c(26),{schema:n,mark:o}=e,i=Kt(Qe),c=oo(),u=i.encoding.x&&i.encoding.y;let a;t[0]!==c||t[1]!==u||t[2]!==n||t[3]!==i.encoding?(a=S=>{const N=(S==="row"||S==="column")&&!u;return x.jsx(Gs,{schema:n,label:S,disabled:N,fieldDefinition:i.encoding[S],onChange:C=>c.setEncoding({[S]:C})},S)},t[0]=c,t[1]=u,t[2]=n,t[3]=i.encoding,t[4]=a):a=t[4];const r=a;let s,d,l,f,p;t[5]!==o?(s=o.toString(),t[5]=o,t[6]=s):s=t[6],t[7]!==c?(d=S=>c.setMark(S),t[7]=c,t[8]=d):d=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(l=x.jsx(pt,{children:x.jsx(Vn,{placeholder:"Mark"})}),t[9]=l):l=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=x.jsx(ht,{children:x.jsxs(Ke,{children:[x.jsx(Kn,{children:"Mark"}),Is.map(Ys)]})}),t[10]=f):f=t[10],t[11]!==s||t[12]!==d?(p=x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-mark-select",value:s,onValueChange:d,children:[l,f]}),t[11]=s,t[12]=d,t[13]=p):p=t[13];const h=p;let m,v,b,y,E,T;return t[14]===Symbol.for("react.memo_cache_sentinel")?(m=x.jsx("span",{className:"col-span-2 flex items-center justify-between w-full",children:x.jsx("div",{className:"text-sm font-semibold",children:"Encodings"})}),t[14]=m):m=t[14],t[15]!==r?(v=Ws.map(r),t[15]=r,t[16]=v):v=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(b=x.jsx("div",{children:"Mark"}),t[17]=b):b=t[17],t[18]!==h?(y=x.jsxs("span",{className:"col-span-2 text-sm font-semibold w-full border-t border-divider flex items-center justify-between pt-2 pr-[30px]",children:[b,h]}),t[18]=h,t[19]=y):y=t[19],t[20]!==r?(E=Hs.map(r),t[20]=r,t[21]=E):E=t[21],t[22]!==y||t[23]!==E||t[24]!==v?(T=x.jsxs("div",{className:"grid gap-x-2 gap-y-4 justify-items-start py-3 pl-4 pr-2 bg-(--slate-1) border rounded items-center grid-template-columns-[repeat(2,_minmax(0,_min-content))] self-start",children:[m,v,y,E]}),t[22]=y,t[23]=E,t[24]=v,t[25]=T):T=t[25],T},Gs=e=>{const t=Ee.c(43),{label:n,schema:o,fieldDefinition:i,disabled:c,onChange:u}=e;let a;t[0]!==i||t[1]!==o?(a=()=>{if(!i)return"--";if(i.field==="*")return x.jsxs("span",{className:"flex gap-2 flex-1",children:[Ye[L.NUMBER],x.jsx("span",{className:"text-left flex-1",children:"Count"})]});const F=i.field.toString();return x.jsxs("span",{className:"flex gap-2 flex-1",children:[Ye[o.primitiveType(F)],x.jsx("span",{className:"text-left flex-1",children:i.fn?`${i.fn}(${i.field})`:F})]})},t[0]=i,t[1]=o,t[2]=a):a=t[2];const r=a;let s;t[3]!==u?(s=()=>{u(void 0)},t[3]=u,t[4]=s):s=t[4];const d=s;let l;t[5]!==(i==null?void 0:i.field)?(l=(i==null?void 0:i.field.toString())??"",t[5]=i==null?void 0:i.field,t[6]=l):l=t[6];const f=l;let p,h;t[7]!==n?(p=x.jsx(So,{className:"text-(--slate-11) font-semibold",children:n}),t[7]=n,t[8]=p):p=t[8],t[9]!==u||t[10]!==o?(h=F=>{u(F==="*"?{field:"*",fn:"count",type:"quantitative"}:{field:F,type:o.vlType(F)})},t[9]=u,t[10]=o,t[11]=h):h=t[11];const m=f?d:void 0;let v,b,y,E,T,S,N,C,O,M,U,I;return t[12]!==r?(v=r(),t[12]=r,t[13]=v):v=t[13],t[14]!==m||t[15]!==v?(b=x.jsx(pt,{className:"min-w-[140px] lg:min-w-[210px] h-full",onClear:m,children:v}),t[14]=m,t[15]=v,t[16]=b):b=t[16],t[17]!==o?(y=o.fieldNames().map(F=>x.jsx(ke,{value:F.toString(),children:x.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[Ye[o.primitiveType(F)],x.jsx("span",{className:"flex-1",children:F}),x.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",o.vlType(F),")"]})]})},F)),t[17]=o,t[18]=y):y=t[18],t[19]!==o?(E=o.fieldNames().length===0&&x.jsx(ke,{disabled:!0,value:"--",children:"No columns"}),t[19]=o,t[20]=E):E=t[20],t[21]===Symbol.for("react.memo_cache_sentinel")?(T=x.jsx(Jn,{}),t[21]=T):T=t[21],t[22]===Symbol.for("react.memo_cache_sentinel")?(S=x.jsx(ke,{value:"*",children:x.jsxs("span",{className:"flex items-center gap-1 flex-1",children:[Ye[L.NUMBER],x.jsx("span",{className:"flex-1",children:"Count"})]})},"*"),t[22]=S):S=t[22],t[23]!==E||t[24]!==y?(N=x.jsx(ht,{children:x.jsxs(Ke,{children:[y,E,T,S]})}),t[23]=E,t[24]=y,t[25]=N):N=t[25],t[26]!==c||t[27]!==f||t[28]!==N||t[29]!==h||t[30]!==b?(C=x.jsxs(gt,{value:f,disabled:c,onValueChange:h,children:[b,N]}),t[26]=c,t[27]=f,t[28]=N,t[29]=h,t[30]=b,t[31]=C):C=t[31],t[32]!==i||t[33]!==u?(O=i&&x.jsx(zs,{field:i,onChange:u}),t[32]=i,t[33]=u,t[34]=O):O=t[34],t[35]!==O?(M=x.jsx("div",{className:"w-[26px]",children:O}),t[35]=O,t[36]=M):M=t[36],t[37]!==C||t[38]!==M?(U=x.jsxs("div",{className:"flex flex-row gap-1 h-[26px]",children:[C,M]}),t[37]=C,t[38]=M,t[39]=U):U=t[39],t[40]!==U||t[41]!==p?(I=x.jsxs(x.Fragment,{children:[p,U]}),t[40]=U,t[41]=p,t[42]=I):I=t[42],I},Ln="__",zs=e=>{const t=Ee.c(15),{field:n,onChange:o}=e;if(n.field==="*")return null;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],t[0]=i):i=t[0];let c=i;if(n.type===le.QUANTITATIVE){let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=[["",Ms]],t[1]=u):u=t[1],c=u}if(n.type===le.TEMPORAL){let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=[["Single",Ji],["Multi",Xi]],t[2]=u):u=t[2],c=u}if(c.length>0){let u,a,r,s,d,l;return t[3]!==n||t[4]!==o?(u=f=>{o({...n,fn:f===Ln?void 0:f})},t[3]=n,t[4]=o,t[5]=u):u=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(a=x.jsx(pt,{className:"h-full px-1",hideChevron:!0,variant:"ghost",children:x.jsx(No,{size:14,strokeWidth:1.5})}),t[6]=a):a=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(r=x.jsx(Ke,{children:x.jsx(ke,{value:Ln,children:"None"})}),s=x.jsx(Jn,{}),t[7]=r,t[8]=s):(r=t[7],s=t[8]),t[9]!==c?(d=x.jsxs(ht,{children:[r,s,c.map(Vs)]}),t[9]=c,t[10]=d):d=t[10],t[11]!==n.fn||t[12]!==u||t[13]!==d?(l=x.jsxs(gt,{"data-testid":"marimo-plugin-data-explorer-field-options",value:n.fn,onValueChange:u,children:[a,d]}),t[11]=n.fn,t[12]=u,t[13]=d,t[14]=l):l=t[14],l}return null};function Ys(e){return x.jsx(ke,{value:e,children:e===P?"auto":e},e)}function Qs(e){return x.jsx(ke,{value:e??Ln,children:wo(e)},e)}function Vs(e){const[t,n]=e;return x.jsxs(Ke,{children:[t&&x.jsx(Kn,{children:t}),n.map(Qs)]},t)}const Ks=e=>{const t=Ee.c(5);let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=Co(),t[0]=o):o=t[0],n=o;const i=n;let c,u;return t[1]!==e?(c=()=>{const a=i.sub(Qe,()=>{const s=i.get(Qe),{schema:d,...l}=s;e.setValue(l)}),r=e.value;return r&&Object.keys(r).length>0&&i.set(Qe,r),a},t[1]=e,t[2]=c):c=t[2],Ao(c),t[3]!==e?(u=x.jsx(Oo,{store:i,children:x.jsx(ao,{...e})}),t[3]=e,t[4]=u):u=t[4],u},Js={export:{svg:!0,png:!0},source:!1,compiled:!1,editor:!1},Xs={left:20,right:20,top:20,bottom:20},ao=e=>{var Ae,ye,ve,be,lt,Wn;const t=Ee.c(43),{data:n}=e,o=oo();let i,c;t[0]!==o||t[1]!==n?(i=async()=>{if(!n)return{};const $=await Io(n,{type:"csv",parse:"auto"},{replacePeriod:!0}),Pe=function(xe,z={},Ve={fields:[]}){z=k.extend({},ot,z);let so=fs.summary(xe),Hn=ds.inferAll(xe),co=Ve.fields.reduce((B,se)=>(B[se.name]=se,B),{}),qn=so.map(function(B,se){const Re=B.field,ut=Hn[Re]==="date"?L.DATETIME:Hn[Re];let Oe,Vt=B.distinct;if(ut===L.NUMBER)Oe=R;else if(ut===L.INTEGER)Oe=Vt<z.numberNominalLimit&&Vt/B.count<z.numberNominalProportion?ie:R;else if(ut===L.DATETIME){Oe=Q,B.min=new Date(xe[0][Re]),B.max=new Date(xe[0][Re]);for(const fo of xe){const ft=new Date(fo[Re]).getTime();ft<B.min.getTime()&&(B.min=new Date(ft)),ft>B.max.getTime()&&(B.max=new Date(ft))}}else Oe=ie;Oe===ie&&Vt/B.count>z.minPercentUniqueForKey&&B.count>z.minCardinalityForKey&&(Oe=le.KEY);let dt={name:Re,originalIndex:se,vlType:Oe,type:ut,stats:B,timeStats:{},binStats:{}};const uo=co[dt.name];return dt=k.extend(dt,uo),dt});for(let B of qn)if(B.vlType===R)for(let se of z.enum.binProps.maxbins)B.binStats[se]=Mi(se,B.stats);else if(B.vlType===Q)for(let se of z.enum.timeUnit)se!==void 0&&(B.timeStats[se]=Ii(se,B.stats));const lo=Object.assign({},Ve,{fields:qn});return new hs(lo)}($);return o.setSchema(Pe),{chartData:$,schema:Pe}},t[0]=o,t[1]=n,t[2]=i):i=t[2],t[3]!==n?(c=[n],t[3]=n,t[4]=c):c=t[4];const{data:u,isPending:a,error:r}=ko(i,c),{mark:s}=Kt(Qe),d=Kt(Ls),{theme:l}=Mo();if(r){let $;return t[5]!==r?($=x.jsx(Uo,{error:r}),t[5]=r,t[6]=$):$=t[6],$}if(!u){let $;return t[7]===Symbol.for("react.memo_cache_sentinel")?($=x.jsx("div",{}),t[7]=$):$=t[7],$}const{chartData:f,schema:p}=u;if(a||!p){let $;return t[8]===Symbol.for("react.memo_cache_sentinel")?($=x.jsx("div",{}),t[8]=$):$=t[8],$}const h=(ye=(Ae=d.main)==null?void 0:Ae.plots)==null?void 0:ye[0];let m;t[9]!==(h==null?void 0:h.fieldInfos)?(m=new Set(h==null?void 0:h.fieldInfos.map(nc)),t[9]=h==null?void 0:h.fieldInfos,t[10]=m):m=t[10];const v=m;let b;t[11]!==f||t[12]!==h||t[13]!==p||t[14]!==l?(b=()=>h?x.jsx("div",{className:"flex overflow-y-auto justify-center items-center flex-1 w-[90%]",children:x.jsx(Xn,{data:{source:f},padding:Xs,actions:Js,spec:tc(h.spec),theme:l==="dark"?"dark":void 0})}):x.jsx(Ns,{schema:p}),t[11]=f,t[12]=h,t[13]=p,t[14]=l,t[15]=b):b=t[15];const y=b;let E,T,S;t[16]!==s||t[17]!==p?(E=x.jsx(qs,{mark:s,schema:p}),t[16]=s,t[17]=p,t[18]=E):E=t[18],t[19]!==y?(T=y(),t[19]=y,t[20]=T):T=t[20],t[21]!==E||t[22]!==T?(S=x.jsxs("div",{className:"flex items-center gap-2",children:[E,T]}),t[21]=E,t[22]=T,t[23]=S):S=t[23];const N=(ve=d.histograms)==null?void 0:ve.plots,C=(be=d.addCategoricalField)==null?void 0:be.plots,O=(lt=d.addQuantitativeField)==null?void 0:lt.plots,M=(Wn=d.addTemporalField)==null?void 0:Wn.plots;let U,I,F;if(t[24]!==o||t[25]!==f||t[26]!==v||t[27]!==O||t[28]!==M||t[29]!==N||t[30]!==C||t[31]!==l){let $;t[33]!==o||t[34]!==f||t[35]!==v||t[36]!==l?($=(Pe,xe)=>x.jsx(ec,{title:x.jsx("div",{className:"flex flex-row gap-1",children:Pe.fieldInfos.map(z=>{const Ve=z.fieldDef.field==="*"?"Count":z.fieldDef.fn?`${z.fieldDef.fn}(${z.fieldDef.field})`:z.fieldDef.field.toString();return x.jsx(jo,{variant:v.has(z.fieldDef.field)?"secondary":"defaultOutline",children:Ve},Ve)})}),actions:x.jsx(Fo,{content:"Make main plot",children:x.jsx(Qn,{"data-testid":"marimo-plugin-data-explorer-make-main-plot",variant:"text",size:"icon",onClick:()=>{const z=_o.fromEntries(Pe.fieldInfos.map(rc));o.setEncoding(z)},children:x.jsx(Do,{className:"w-4 h-4"})})}),children:x.jsx(Xn,{data:{source:f},actions:!1,spec:Pe.spec,theme:l==="dark"?"dark":void 0},xe)},xe),t[33]=o,t[34]=f,t[35]=v,t[36]=l,t[37]=$):$=t[37],U=[N,C,O,M].filter(Boolean).flat().map($),t[24]=o,t[25]=f,t[26]=v,t[27]=O,t[28]=M,t[29]=N,t[30]=C,t[31]=l,t[32]=U}else U=t[32];return t[38]!==U?(I=x.jsx(Zs,{children:U}),t[38]=U,t[39]=I):I=t[39],t[40]!==I||t[41]!==S?(F=x.jsxs("div",{className:"flex flex-col gap-2",children:[S,I]}),t[40]=I,t[41]=S,t[42]=F):F=t[42],F},Zs=e=>{const t=Ee.c(2),{children:n}=e;if(Po.Children.count(n)===0)return null;let o;return t[0]!==n?(o=x.jsx("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden gap-4 snap-x pb-4",children:n}),t[0]=n,t[1]=o):o=t[1],o},ec=e=>{const t=Ee.c(10),{title:n,children:o,actions:i}=e;let c,u,a,r;return t[0]!==n?(c=x.jsx("div",{className:"text-sm font-medium",children:n}),t[0]=n,t[1]=c):c=t[1],t[2]!==i||t[3]!==c?(u=x.jsxs("div",{className:"flex flex-row justify-between items-center bg-(--slate-3) py-0.5 px-2",children:[c,i]}),t[2]=i,t[3]=c,t[4]=u):u=t[4],t[5]!==o?(a=x.jsx("div",{className:"px-6 pt-2 max-h-[280px] overflow-y-auto",children:o}),t[5]=o,t[6]=a):a=t[6],t[7]!==u||t[8]!==a?(r=x.jsxs("div",{className:"shrink-0 bg-card shadow-md border overflow-hidden rounded snap-start",children:[u,a]}),t[7]=u,t[8]=a,t[9]=r):r=t[9],r};function tc(e){var t,n;return(t=e.encoding)!=null&&t.row||(n=e.encoding)!=null&&n.column||(e.width="container"),e}function nc(e){return e.fieldDef.field}function rc(e){return[e.channel,e.fieldDef]}export{ao as DataExplorerComponent,Ks as default};
|