"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[9151],{479151:(e,t,i)=>{i.r(t),i.d(t,{default:()=>M});var r,n=i(296540),l=i(927099),o=i(469733),a=i(56016),c=i(459449),m=i(126457),s=i(705426),E=i(217439);!function(e){e.NOTE="note",e.CREATE_TIME="create_time"}(r||(r={}));var u=i(198494),d=i(602021),T=i(282556);const C=(0,n.memo)(({create_time:e})=>n.createElement(l.A,{size:"body",color:"secondary"},new Intl.DateTimeFormat((0,o.useSelector)(T.zi),{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hourCycle:(0,o.useSelector)(u.BQ),timeZone:(0,o.useSelector)(d.hq)}).format(1e3*e))),A={[r.NOTE]:"COMMON_NAME",[r.CREATE_TIME]:"COMMON_DATE"},h=(0,n.memo)(({id:e})=>n.createElement(l.A,{size:"body",weight:"bold",color:"primary"},n.createElement(c.sA,{id:A[e]}))),_=[{id:r.NOTE,label:n.createElement(h,{id:r.NOTE}),renderCell:({note:e})=>n.createElement(E.A,{size:"medium",color:"text-2"},e)},{id:r.CREATE_TIME,label:n.createElement(h,{id:r.CREATE_TIME}),renderCell:({create_time:e})=>n.createElement(C,{create_time:e})}],M=({hotspotVouchers:e,onPrint:t,setShowPrintPopover:i})=>{const E=(0,o.useDispatch)(),[u,d]=(0,n.useState)([]);(0,n.useEffect)(()=>{i(!1)},[i]);const T=(0,n.useCallback)(()=>{E((0,m.AS)())},[E]),C=(0,n.useMemo)(()=>{const t={},i=[],r=e.length;for(let n=0;n<r;n+=1){const{note:r,create_time:l}=e[n];l in t||(t[l]=!0,i.push({create_time:l,note:r}))}return i},[e]),A=(0,n.useCallback)(()=>{t(e.filter(({create_time:e})=>u.includes(e))),T()},[e,t,T,u]),h=(0,n.useCallback)(d,[d]),M=(0,n.useMemo)(()=>[{variant:"tertiary",text:n.createElement(c.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:T},{variant:"primary",text:n.createElement(c.sA,{id:"HOTSPOT_PRINT"}),type:"button",onClick:A,disabled:!u.length}],[T,A,u]);return n.createElement(s.A,{isOpen:!0,title:n.createElement(l.A,{size:"header-xs",weight:"bold",color:"primary"},n.createElement(c.sA,{id:"HOTSPOT_PRINT_BATCH"})),size:"medium",height:"small",actions:M},n.createElement(a.A,{columns:_,idField:r.CREATE_TIME,initialSortBy:r.CREATE_TIME,initiallySortAscending:!0,items:C,multiSelectMode:!0,disableColumnFilters:!0,width:"100%",onChangeSelection:h}))}}}]);