"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[9242],{94465:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(53705),r=a(94387),l=a(73091);function o(e,t=!1){const a=t?n.DC:n.aL,o=a("%Y-%m-%d %H:%M:%S.%L"),i=a("%Y-%m-%d %H:%M:%S"),s=a("%Y-%m-%d %H:%M"),u=a("%Y-%m-%d %H:%M"),c=a("%Y-%m-%d"),d=a("%Y-%m-%d"),f=a("%Y"),{hasMillisecond:p,hasSecond:h,hasMinute:m,hasHour:S,isNotFirstDayOfMonth:v,isNotFirstMonth:g}=t?r.m:r.w;let w=f;return e.forEach((e=>{w===f&&g(e)&&(w=d),w===d&&v(e)&&(w=c),w===c&&S(e)&&(w=u),w===u&&m(e)&&(w=s),w===s&&h(e)&&(w=i),w===i&&p(e)&&(w=o)})),new l.A({description:"Use the finest grain in an array of dates to format all dates in the array",formatFunc:w,id:"finest_temporal_grain",label:"Format temporal columns with the finest grain",useLocalTime:t})}},2511:(e,t,a)=>{var n,r;a.d(t,{A:()=>n,v:()=>r}),function(e){e.Simple="SIMPLE",e.Sql="SQL"}(n||(n={})),function(e){e.Having="HAVING",e.Where="WHERE"}(r||(r={}))},66861:(e,t,a)=>{a.r(t),a.d(t,{default:()=>M});var n=a(38221),r=a.n(n),l=a(96540),o=a(62952),i=a(86444),s=a(94465),u=a(95579),c=a(58863),d=a(64687),f=a(15595),p=a(27023),h=a(3175),m=a(10504),S=a(67874),v=a(5815),g=a(2445);function w(e,t){switch(t.type){case"ownState":return e.ownState={...e.ownState,...t.ownState},e;case"filterState":return JSON.stringify(e.extraFormData)!==JSON.stringify(t.extraFormData)&&(e.extraFormData=t.extraFormData),JSON.stringify(e.filterState)!==JSON.stringify(t.filterState)&&(e.filterState={...e.filterState,...t.filterState}),e;default:return e}}function M(e){const{coltypeMap:t,data:a,filterState:n,formData:M,height:F,isRefreshing:y,width:b,setDataMask:C,setHoveredFilter:N,unsetHoveredFilter:A,setFocusedFilter:O,unsetFocusedFilter:x,setFilterActive:H,appSection:Y,showOverflow:D,parentRef:k,inputRef:I,filterBarOrientation:J}=e,{enableEmptyFilter:E,multiSelect:L,showSearch:$,inverseSelection:q,defaultToFirstItem:T,searchAllOptions:j}=M,R=(0,l.useMemo)((()=>(0,o.A)(M.groupby).map(i.A)),[M.groupby]),[P]=R,[B]=(0,l.useState)(t),[Q,U]=(0,l.useState)(""),[W,_]=(0,d.A)(w,{extraFormData:{},filterState:n}),z=t[P],V=(0,l.useMemo)((()=>(0,v.Sg)({timeFormatter:(0,s.A)(a.map((e=>e[P])))})),[a,P]),G=(0,l.useCallback)((e=>{const t=E&&!q&&!(null!=e&&e.length),a=q&&null!=e&&e.length?(0,u.t)(" (excluded)"):"";_({type:"filterState",extraFormData:(0,v.pA)(P,e,t,q),filterState:{...n,label:null!=e&&e.length?`${(e||[]).map((e=>V(e,z))).join(", ")}${a}`:void 0,value:Y===c.$s.FilterConfigModal&&T?void 0:e}})}),[Y,P,z,T,_,E,q,JSON.stringify(n),V]),K=Y===c.$s.FilterConfigModal&&T,X=(0,l.useMemo)((()=>r()((e=>{U(e),j&&_({type:"ownState",ownState:{coltypeMap:B,search:e}})}),p.Qs)),[_,B,j]),Z=(0,l.useCallback)((()=>{x(),X("")}),[X,x]),ee=(0,l.useCallback)((e=>{const t=null===e?[null]:(0,o.A)(e);0===t.length?G(null):G(t)}),[G]),te=0===a.length?(0,u.t)("No data"):(0,u.tn)("%s option","%s options",a.length,a.length),ae=(0,l.useMemo)((()=>{if(n.validateMessage)return(0,g.Y)(S.Mo,{status:n.validateStatus,children:n.validateMessage})}),[n.validateMessage,n.validateStatus]),ne=(0,l.useMemo)((()=>[...new Set([...a.map((e=>e[P]))])].map((e=>({label:V(e,z),value:e,isNewOption:!1})))),[a,z,P,V]),re=(0,l.useMemo)((()=>(!Q||L||(0,h.Kz)(Q,ne,!0)||ne.unshift({label:Q,value:Q,isNewOption:!0}),ne)),[L,Q,ne]),le=(0,l.useCallback)(((e,t)=>{const a=(0,h.qw)("label");return M.sortAscending?a(e,t):a(t,e)}),[M.sortAscending]);return(0,l.useEffect)((()=>{if(T&&void 0===n.value){const e=a[0]?R.map((e=>a[0][e])):null;void 0!==(null==e?void 0:e[0])&&G(e)}else G(K?null:n.value)}),[P,K,T,E,q,G,a,R,JSON.stringify(n.value)]),(0,l.useEffect)((()=>{C(W)}),[JSON.stringify(W)]),(0,g.Y)(S.j3,{height:F,width:b,children:(0,g.Y)(S.JF,{validateStatus:n.validateStatus,extra:ae,children:(0,g.Y)(f.l6,{name:M.nativeFilterId,allowClear:!0,allowNewOptions:!j,allowSelectAll:!j,value:n.value||[],disabled:K,getPopupContainer:D?()=>(null==k?void 0:k.current)||document.body:e=>(null==e?void 0:e.parentNode)||document.body,showSearch:$,mode:L?"multiple":"single",placeholder:te,onClear:()=>X(""),onSearch:X,onBlur:Z,onFocus:O,onMouseEnter:N,onMouseLeave:A,onChange:ee,ref:I,loading:y,oneLine:J===m.QI.Horizontal,invertSelection:q,options:re,sortComparator:le,onDropdownVisibleChange:H})})})}},67874:(e,t,a)=>{a.d(t,{JF:()=>i,Mo:()=>s,YH:()=>l,j3:()=>o});var n=a(96453),r=a(86523);const l=0,o=n.I4.div`
  min-height: ${({height:e})=>e}px;
  width: ${({width:e})=>e===l?"100%":`${e}px`};
`,i=(0,n.I4)(r.A)`
  &.ant-row.ant-form-item {
    margin: 0;
  }
`,s=n.I4.div`
  color: ${({theme:e,status:t="error"})=>{var a;return null==(a=e.colors[t])?void 0:a.base}};
`},5815:(e,t,a)=>{a.d(t,{SO:()=>i,Sg:()=>s,pA:()=>o});var n=a(87903),r=a(15151),l=a(2511);const o=(e,t,a=!1,n=!1)=>{const r={};return a?r.adhoc_filters=[{expressionType:l.A.Sql,clause:l.v.Where,sqlExpression:"1 = 0"}]:null!=t&&0!==t.length&&(r.filters=[{col:e,op:n?"NOT IN":"IN",val:t}]),r},i=(e,t,a)=>{const n=[];return null!=t&&t!==a&&n.push({col:e,op:">=",val:t}),null!=a&&a!==t&&n.push({col:e,op:"<=",val:a}),null!=a&&null!=t&&a===t&&n.push({col:e,op:"==",val:a}),n.length?{filters:n}:{}};function s({timeFormatter:e,numberFormatter:t}={}){return(a,l)=>{if(null==a)return r.mu;if("boolean"==typeof a)return a?r.PU:r.qC;if(l===n.s.Boolean)try{return JSON.parse(String(a).toLowerCase())?r.PU:r.qC}catch{return r.qC}return"string"==typeof a?a:e&&l===n.s.Temporal?e(a):t&&"number"==typeof a&&l===n.s.Numeric?t(a):String(a)}}},64687:(e,t,a)=>{a.d(t,{A:()=>o,e:()=>l});var n=a(1932),r=a(96540);function l(e){var t=(0,r.useState)((function(){return(0,n.CN)("function"==typeof e?e():e,!0)})),a=t[1];return[t[0],(0,r.useCallback)((function(e){a("function"==typeof e?(0,n.jM)(e):(0,n.CN)(e))}),[])]}function o(e,t,a){var l=(0,r.useMemo)((function(){return(0,n.jM)(e)}),[e]);return(0,r.useReducer)(l,t,a)}}}]);