"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[5181],{47249:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(90317),r=n(69842),o=n(69244);function l(e,t){void 0===t&&(t=!1);const n=t?a.i$:a.g0,l=n("%Y-%m-%d %H:%M:%S.%L"),i=n("%Y-%m-%d %H:%M:%S"),s=n("%Y-%m-%d %H:%M"),u=n("%Y-%m-%d %H:%M"),c=n("%Y-%m-%d"),d=n("%Y-%m-%d"),p=n("%Y"),{hasMillisecond:h,hasSecond:f,hasMinute:m,hasHour:v,isNotFirstDayOfMonth:g,isNotFirstMonth:S}=t?r.Z:r.b;let b=p;return e.forEach((e=>{b===p&&S(e)&&(b=d),b===d&&g(e)&&(b=c),b===c&&v(e)&&(b=u),b===u&&m(e)&&(b=s),b===s&&f(e)&&(b=i),b===i&&h(e)&&(b=l)})),new o.Z({description:"Use the finest grain in an array of dates to format all dates in the array",formatFunc:b,id:"finest_temporal_grain",label:"Format temporal columns with the finest grain",useLocalTime:t})}},45181:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var a=n(18446),r=n.n(a),o=n(87185),l=n.n(o),i=n(67294),s=n(55786),u=n(10581),c=n(47249),d=n(55867),p=n(16355),h=n(23279),f=n.n(h),m=n(90057),v=n(4715),g=n(27600),S=n(85633),b=n(52004),w=n(74448),M=n(56080),y=n(11965);function F(e,t){switch(t.type){case"ownState":return e.ownState={...e.ownState,...t.ownState},e;case"filterState":return e.extraFormData=t.extraFormData,e.__cache=t.__cache,e.filterState={...e.filterState,...t.filterState},e;default:return e}}function O(e){const{coltypeMap:t,data:n,filterState:a,formData:o,height:h,isRefreshing:O,width:N,setDataMask:C,setHoveredFilter:Z,unsetHoveredFilter:E,setFocusedFilter:T,unsetFocusedFilter:L,setFilterActive:_,appSection:A,showOverflow:x,parentRef:k,inputRef:D,filterBarOrientation:R}=e,{enableEmptyFilter:H,multiSelect:I,showSearch:j,inverseSelection:Y,defaultToFirstItem:$,searchAllOptions:P}=o,G=(0,i.useMemo)((()=>(0,s.Z)(o.groupby).map(u.Z)),[o.groupby]),[B]=G,[J]=(0,i.useState)(t),[K,V]=(0,i.useState)(""),[q,U]=(0,m.C)(F,{extraFormData:{},filterState:a}),W=t[B],Q=(0,i.useMemo)((()=>(0,M.EG)({timeFormatter:(0,c.Z)(n.map((e=>e[B])))})),[n,B]),z=(0,i.useCallback)((e=>{const t=H&&!Y&&!(null!=e&&e.length),n=Y&&null!=e&&e.length?(0,d.t)(" (excluded)"):"";U({type:"filterState",__cache:a,extraFormData:(0,M.vb)(B,e,t,Y),filterState:{...a,label:null!=e&&e.length?`${(e||[]).map((e=>Q(e,W))).join(", ")}${n}`:void 0,value:A===p.Tr.FILTER_CONFIG_MODAL&&$?void 0:e}})}),[A,B,W,$,U,H,Y,JSON.stringify(a),Q]),X=A===p.Tr.FILTER_CONFIG_MODAL&&$,ee=(0,i.useMemo)((()=>f()((e=>{V(e),P&&U({type:"ownState",ownState:{coltypeMap:J,search:e}})}),g.M$)),[U,J,P]),te=(0,i.useCallback)((()=>{L()}),[L]),ne=(0,i.useCallback)((e=>{const t=null===e?[null]:(0,s.Z)(e);0===t.length?z(null):z(t)}),[z]),ae=0===n.length?(0,d.t)("No data"):(0,d.tn)("%s option","%s options",n.length,n.length),re=(0,i.useMemo)((()=>{if(a.validateMessage)return(0,y.tZ)(w.Am,{status:a.validateStatus},a.validateMessage)}),[a.validateMessage,a.validateStatus]),oe=(0,i.useMemo)((()=>{const e=[...n];return l()(e,r()).map((e=>{const[t]=G.map((t=>e[t]));return{label:Q(t,W),value:t,isNewOption:!1}}))}),[n,W,G,Q]),le=(0,i.useMemo)((()=>(!K||I||(0,S.Gq)(K,oe,!0)||oe.unshift({label:K,value:K,isNewOption:!0}),oe)),[I,K,oe]),ie=(0,i.useCallback)(((e,t)=>{const n=(0,S.mj)("label");return o.sortAscending?n(e,t):n(t,e)}),[o.sortAscending]);return(0,i.useEffect)((()=>{if($&&void 0===a.value){const e=n[0]?G.map((e=>n[0][e])):null;void 0!==(null==e?void 0:e[0])&&z(e)}else z(X?null:a.value)}),[B,X,$,H,Y,z,n,G,JSON.stringify(a.value)]),(0,i.useEffect)((()=>{C(q)}),[JSON.stringify(q)]),(0,y.tZ)(w.un,{height:h,width:N},(0,y.tZ)(w.jp,{validateStatus:a.validateStatus,extra:re},(0,y.tZ)(v.Ph,{allowClear:!0,allowNewOptions:!0,allowSelectAll:!P,value:a.value||[],disabled:X,getPopupContainer:x?()=>(null==k?void 0:k.current)||document.body:e=>(null==e?void 0:e.parentNode)||document.body,showSearch:j,mode:I?"multiple":"single",placeholder:ae,onSearch:ee,onBlur:te,onFocus:T,onMouseEnter:Z,onMouseLeave:E,onChange:ne,ref:D,loading:O,oneLine:R===b.Bp.HORIZONTAL,invertSelection:Y,options:le,sortComparator:ie,onDropdownVisibleChange:_})))}},74448:(e,t,n)=>{n.d(t,{Am:()=>i,jp:()=>l,un:()=>o});var a=n(51995),r=n(4591);const o=a.iK.div`
  min-height: ${e=>{let{height:t}=e;return t}}px;
  width: ${e=>{let{width:t}=e;return t}}px;
`,l=(0,a.iK)(r.Z)`
  &.ant-row.ant-form-item {
    margin: 0;
  }
`,i=a.iK.div`
  color: ${e=>{var t;let{theme:n,status:a="error"}=e;return null==(t=n.colors[a])?void 0:t.base}};
`},56080:(e,t,n)=>{n.d(t,{EG:()=>s,WO:()=>i,vb:()=>l});var a=n(88889),r=n(54076),o=n(61641);const l=function(e,t,n,a){void 0===n&&(n=!1),void 0===a&&(a=!1);const r={};return n?r.adhoc_filters=[{expressionType:o.v.SQL,clause:o.P.WHERE,sqlExpression:"1 = 0"}]:null!=t&&0!==t.length&&(r.filters=[{col:e,op:a?"NOT IN":"IN",val:t}]),r},i=(e,t,n)=>{const a=[];return null!=t&&t!==n&&a.push({col:e,op:">=",val:t}),null!=n&&n!==t&&a.push({col:e,op:"<=",val:n}),null!=n&&null!=t&&n===t&&a.push({col:e,op:"==",val:n}),a.length?{filters:a}:{}};function s(e){let{timeFormatter:t,numberFormatter:n}=void 0===e?{}:e;return(e,o)=>{if(null==e)return r.li;if("boolean"==typeof e)return e?r.Tb:r.jy;if(o===a.Z.BOOLEAN)try{return JSON.parse(String(e).toLowerCase())?r.Tb:r.jy}catch{return r.jy}return"string"==typeof e?e:t&&o===a.Z.TEMPORAL?t(e):n&&"number"==typeof e&&o===a.Z.NUMERIC?n(e):String(e)}}},90057:(e,t,n)=>{n.d(t,{C:()=>l,x:()=>o});var a=n(12902),r=n(67294);function o(e){var t=(0,r.useState)((function(){return(0,a.vV)("function"==typeof e?e():e,!0)})),n=t[1];return[t[0],(0,r.useCallback)((function(e){n("function"==typeof e?(0,a.ZP)(e):(0,a.vV)(e))}),[])]}function l(e,t,n){var o=(0,r.useMemo)((function(){return(0,a.ZP)(e)}),[e]);return(0,r.useReducer)(o,t,n)}}}]);
//# sourceMappingURL=971d043109b2074fd928.chunk.js.map