anarock-widgets 1.0.42 → 1.0.43
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/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -216,7 +216,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
216
216
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
217
217
|
|
|
218
218
|
`,`1) content: element.innerHTML
|
|
219
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&N9(c,n);return u&&l.push(u),l},[]);return ns(e)?s[0]:s}Fs.defaultProps=ir;Fs.setDefaultProps=T9;Fs.currentInput=Ur;Object.assign({},sE,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});Fs.setDefaultProps({render:AE});function EE(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var PE=typeof window<"u"&&typeof document<"u";function op(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function l1(){return PE&&document.createElement("div")}function I9(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function CE(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!CE(e[r],t[r]))return!1}else return!1;return!0}else return!1}function R9(e){var t=[];return e.forEach(function(r){t.find(function(n){return CE(r,n)})||t.push(r)}),t}function $9(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:R9([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var Wd=PE?k.useLayoutEffect:k.useEffect;function L9(e){var t=k.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function c1(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var B9={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!n()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}c1(r,"add",t.props.className)}function a(){n()&&c1(r,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:a,onAfterUpdate:i}}};function F9(e){function t(r){var n=r.children,i=r.content,a=r.visible,o=r.singleton,s=r.render,l=r.reference,c=r.disabled,u=c===void 0?!1:c,f=r.ignoreAttributes,d=f===void 0?!0:f;r.__source,r.__self;var h=EE(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),m=a!==void 0,p=o!==void 0,g=k.useState(!1),v=g[0],x=g[1],w=k.useState({}),y=w[0],_=w[1],O=k.useState(),A=O[0],P=O[1],T=L9(function(){return{container:l1(),renders:1}}),I=Object.assign({ignoreAttributes:d},h,{content:T.container});m&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){I[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),I.trigger="manual",I.hideOnClick=!1),p&&(u=!0);var j=I,S=I.plugins||[];s&&(j=Object.assign({},I,{plugins:p&&o.data!=null?[].concat(S,[{fn:function(){return{onTrigger:function(z,W){var Y=o.data.children.find(function(G){var L=G.instance;return L.reference===W.currentTarget});z.state.$$activeSingletonInstance=Y.instance,P(Y.content)}}}}]):S,render:function(){return{popper:T.container}}}));var D=[l].concat(n?[n.type]:[]);return Wd(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var R=e(M||T.ref||l1(),Object.assign({},j,{plugins:[B9].concat(I.plugins||[])}));return T.instance=R,u&&R.disable(),a&&R.show(),p&&o.hook({instance:R,content:i,props:j,setSingletonContent:P}),x(!0),function(){R.destroy(),o?.cleanup(R)}},D),Wd(function(){var M;if(T.renders===1){T.renders++;return}var R=T.instance;R.setProps($9(R.props,j)),(M=R.popperInstance)==null||M.forceUpdate(),u?R.disable():R.enable(),m&&(a?R.show():R.hide()),p&&o.hook({instance:R,content:i,props:j,setSingletonContent:P})}),Wd(function(){var M;if(s){var R=T.instance;R.setProps({popperOptions:Object.assign({},R.props.popperOptions,{modifiers:[].concat((((M=R.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(z){var W=z.name;return W!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(W){var Y,G=W.state,L=(Y=G.modifiersData)==null?void 0:Y.hide;(y.placement!==G.placement||y.referenceHidden!==L?.isReferenceHidden||y.escaped!==L?.hasPopperEscaped)&&_({placement:G.placement,referenceHidden:L?.isReferenceHidden,escaped:L?.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(D)),k.createElement(k.Fragment,null,n?k.cloneElement(n,{ref:function(R){T.ref=R,op(n.ref,R)}}):null,v&&kw.createPortal(s?s(I9(y),A,T.instance):i,T.container))}return t}var z9=(function(e,t){return k.forwardRef(function(n,i){var a=n.children,o=EE(n,["children"]);return k.createElement(e,Object.assign({},t,o),a?k.cloneElement(a,{ref:function(l){op(i,l),op(a.ref,l)}}):null)})}),W9=z9(F9(Fs));function V9(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function H9(e=[]){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:V9(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}const pa={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function U9({type:e,data:t,children:r}){if(!e||!t)return r;const n={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},a={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},o=b.jsx(Gi,{title:i[e],period:"Today",icon:b.jsx(Sp,{className:`${a[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:b.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:n[e].map(([s,l])=>b.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[b.jsx("div",{children:s}),b.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return b.jsx(W9,{content:o,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:r})}function K9({isStatic:e,data:t}){const r=t?.summary?.activeWalkins||{},n=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},a=H9(t?.chart||[]),o=Math.max(...a.flatMap(c=>[c.walkins,c.checkins,c.staffAttendance])),s=o>0?o:5,l=[0,Math.ceil(s/2),s];return b.jsx(Gi,{title:"Gate Updates",period:"Today",icon:b.jsx(Sp,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:b.jsxs("div",{children:[b.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:r,color:pa.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:pa.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:n,color:pa.preApproved,label:"Pre-approved"}].map(c=>b.jsx(U9,{type:c.key,data:c.data,children:b.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[b.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:c.label}),b.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:c.color},children:[c.key==="activeWalkins"?c.data?.visitor_in??0:c.key==="preApprovedCheckins"?c.data?.expected_pass_scanned??0:c.data?.total_in_now??0,b.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",c.key==="activeWalkins"?c.data?.total_pass??0:c.key==="preApprovedCheckins"?c.data?.total_expected_pass??0:c.data?.total_staff??0]})]})]})},c.key))}),b.jsx("div",{className:"w-full h-[105px]",children:b.jsx(ea,{width:"100%",height:"100%",children:b.jsxs(iE,{data:a,margin:{top:5,right:0,left:-40,bottom:0},children:[b.jsx(Bu,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(Fu,{dataKey:"time",tickFormatter:(c,u)=>u%4===0?c:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),b.jsx(es,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:l,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),b.jsx(Qi,{content:b.jsx(gs,{})}),b.jsx(Oa,{type:"monotone",dataKey:"walkins",stroke:pa.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),b.jsx(Oa,{type:"monotone",dataKey:"checkins",stroke:pa.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),b.jsx(Oa,{type:"monotone",dataKey:"staffAttendance",stroke:pa.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function q9({isStatic:e,data:t}){const r=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],n=[{name:"L1 Level",value:Number(t?.today_L1||0),color:r[0]},{name:"L2 Level",value:Number(t?.today_L2||0),color:r[1]},{name:"L3 Level",value:Number(t?.today_L3||0),color:r[2]},{name:"L4 Level",value:Number(t?.today_L4||0),color:r[3]}];n.reduce((a,o)=>a+o.value,0);const i=n;return b.jsx(Gi,{title:"Helpdesk",period:"As of Today",icon:b.jsx(gM,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:b.jsxs("div",{className:"flex gap-[12px] h-fit",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(m_,{value:t?.percent_change}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),b.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:b.jsx(ea,{width:"75%",height:"100%",children:b.jsxs(zu,{children:[b.jsx(Rs,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((a,o)=>b.jsx(Qr,{fill:r[o]||"#CBD5E1"},a.name))}),b.jsx(Qi,{content:b.jsx(gs,{})})]})})})]})})}/*!
|
|
219
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&N9(c,n);return u&&l.push(u),l},[]);return ns(e)?s[0]:s}Fs.defaultProps=ir;Fs.setDefaultProps=T9;Fs.currentInput=Ur;Object.assign({},sE,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});Fs.setDefaultProps({render:AE});function EE(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var PE=typeof window<"u"&&typeof document<"u";function op(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function l1(){return PE&&document.createElement("div")}function I9(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function CE(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!CE(e[r],t[r]))return!1}else return!1;return!0}else return!1}function R9(e){var t=[];return e.forEach(function(r){t.find(function(n){return CE(r,n)})||t.push(r)}),t}function $9(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:R9([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var Wd=PE?k.useLayoutEffect:k.useEffect;function L9(e){var t=k.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function c1(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var B9={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!n()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}c1(r,"add",t.props.className)}function a(){n()&&c1(r,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:a,onAfterUpdate:i}}};function F9(e){function t(r){var n=r.children,i=r.content,a=r.visible,o=r.singleton,s=r.render,l=r.reference,c=r.disabled,u=c===void 0?!1:c,f=r.ignoreAttributes,d=f===void 0?!0:f;r.__source,r.__self;var h=EE(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),m=a!==void 0,p=o!==void 0,g=k.useState(!1),v=g[0],x=g[1],w=k.useState({}),y=w[0],_=w[1],O=k.useState(),A=O[0],P=O[1],T=L9(function(){return{container:l1(),renders:1}}),I=Object.assign({ignoreAttributes:d},h,{content:T.container});m&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){I[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),I.trigger="manual",I.hideOnClick=!1),p&&(u=!0);var j=I,S=I.plugins||[];s&&(j=Object.assign({},I,{plugins:p&&o.data!=null?[].concat(S,[{fn:function(){return{onTrigger:function(z,W){var Y=o.data.children.find(function(G){var L=G.instance;return L.reference===W.currentTarget});z.state.$$activeSingletonInstance=Y.instance,P(Y.content)}}}}]):S,render:function(){return{popper:T.container}}}));var D=[l].concat(n?[n.type]:[]);return Wd(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var R=e(M||T.ref||l1(),Object.assign({},j,{plugins:[B9].concat(I.plugins||[])}));return T.instance=R,u&&R.disable(),a&&R.show(),p&&o.hook({instance:R,content:i,props:j,setSingletonContent:P}),x(!0),function(){R.destroy(),o?.cleanup(R)}},D),Wd(function(){var M;if(T.renders===1){T.renders++;return}var R=T.instance;R.setProps($9(R.props,j)),(M=R.popperInstance)==null||M.forceUpdate(),u?R.disable():R.enable(),m&&(a?R.show():R.hide()),p&&o.hook({instance:R,content:i,props:j,setSingletonContent:P})}),Wd(function(){var M;if(s){var R=T.instance;R.setProps({popperOptions:Object.assign({},R.props.popperOptions,{modifiers:[].concat((((M=R.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(z){var W=z.name;return W!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(W){var Y,G=W.state,L=(Y=G.modifiersData)==null?void 0:Y.hide;(y.placement!==G.placement||y.referenceHidden!==L?.isReferenceHidden||y.escaped!==L?.hasPopperEscaped)&&_({placement:G.placement,referenceHidden:L?.isReferenceHidden,escaped:L?.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(D)),k.createElement(k.Fragment,null,n?k.cloneElement(n,{ref:function(R){T.ref=R,op(n.ref,R)}}):null,v&&kw.createPortal(s?s(I9(y),A,T.instance):i,T.container))}return t}var z9=(function(e,t){return k.forwardRef(function(n,i){var a=n.children,o=EE(n,["children"]);return k.createElement(e,Object.assign({},t,o),a?k.cloneElement(a,{ref:function(l){op(i,l),op(a.ref,l)}}):null)})}),W9=z9(F9(Fs));function V9(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function H9(e=[]){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:V9(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}const pa={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function U9({type:e,data:t,children:r}){if(!e||!t)return r;const n={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},a={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},o=b.jsx(Gi,{title:i[e],period:"Today",icon:b.jsx(Sp,{className:`${a[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:b.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:n[e].map(([s,l])=>b.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[b.jsx("div",{children:s}),b.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return b.jsx(W9,{content:o,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:r})}function K9({isStatic:e,data:t}){const r=t?.summary?.activeWalkins||{},n=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},a=H9(t?.chart||[]),o=Math.max(...a.flatMap(c=>[c.walkins,c.checkins,c.staffAttendance])),s=o>0?o:5,l=[0,Math.ceil(s/2),s];return b.jsx(Gi,{title:"Gate Updates",period:"Today",icon:b.jsx(Sp,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:b.jsxs("div",{children:[b.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:r,color:pa.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:pa.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:n,color:pa.preApproved,label:"Pre-approved"}].map(c=>b.jsx(U9,{type:c.key,data:c.data,children:b.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[b.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:c.label}),b.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:c.color},children:[c.key==="activeWalkins"?c.data?.visitor_in??0:c.key==="preApprovedCheckins"?c.data?.currently_inside??0:c.data?.total_in_now??0,b.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",c.key==="activeWalkins"?c.data?.total_pass??0:c.key==="preApprovedCheckins"?c.data?.total_expected_pass??0:c.data?.total_staff??0]})]})]})},c.key))}),b.jsx("div",{className:"w-full h-[105px]",children:b.jsx(ea,{width:"100%",height:"100%",children:b.jsxs(iE,{data:a,margin:{top:5,right:0,left:-40,bottom:0},children:[b.jsx(Bu,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(Fu,{dataKey:"time",tickFormatter:(c,u)=>u%4===0?c:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),b.jsx(es,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:l,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),b.jsx(Qi,{content:b.jsx(gs,{})}),b.jsx(Oa,{type:"monotone",dataKey:"walkins",stroke:pa.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),b.jsx(Oa,{type:"monotone",dataKey:"checkins",stroke:pa.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),b.jsx(Oa,{type:"monotone",dataKey:"staffAttendance",stroke:pa.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function q9({isStatic:e,data:t}){const r=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],n=[{name:"L1 Level",value:Number(t?.today_L1||0),color:r[0]},{name:"L2 Level",value:Number(t?.today_L2||0),color:r[1]},{name:"L3 Level",value:Number(t?.today_L3||0),color:r[2]},{name:"L4 Level",value:Number(t?.today_L4||0),color:r[3]}];n.reduce((a,o)=>a+o.value,0);const i=n;return b.jsx(Gi,{title:"Helpdesk",period:"As of Today",icon:b.jsx(gM,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:b.jsxs("div",{className:"flex gap-[12px] h-fit",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(m_,{value:t?.percent_change}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),b.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:b.jsx(ea,{width:"75%",height:"100%",children:b.jsxs(zu,{children:[b.jsx(Rs,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((a,o)=>b.jsx(Qr,{fill:r[o]||"#CBD5E1"},a.name))}),b.jsx(Qi,{content:b.jsx(gs,{})})]})})})]})})}/*!
|
|
220
220
|
* @kurkle/color v0.3.4
|
|
221
221
|
* https://github.com/kurkle/color#readme
|
|
222
222
|
* (c) 2024 Jukka Kurkela
|
package/dist/index.es.js
CHANGED
|
@@ -24911,7 +24911,7 @@ function hG({ isStatic: e, data: t }) {
|
|
|
24911
24911
|
className: "text-[28px] font-medium flex items-center",
|
|
24912
24912
|
style: { color: c.color },
|
|
24913
24913
|
children: [
|
|
24914
|
-
c.key === "activeWalkins" ? c.data?.visitor_in ?? 0 : c.key === "preApprovedCheckins" ? c.data?.
|
|
24914
|
+
c.key === "activeWalkins" ? c.data?.visitor_in ?? 0 : c.key === "preApprovedCheckins" ? c.data?.currently_inside ?? 0 : c.data?.total_in_now ?? 0,
|
|
24915
24915
|
/* @__PURE__ */ b.jsxs("div", { className: "text-[20px] text-[#64748B] ml-1", children: [
|
|
24916
24916
|
"/",
|
|
24917
24917
|
c.key === "activeWalkins" ? c.data?.total_pass ?? 0 : c.key === "preApprovedCheckins" ? c.data?.total_expected_pass ?? 0 : c.data?.total_staff ?? 0
|
package/dist/index.umd.js
CHANGED
|
@@ -216,7 +216,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
216
216
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
217
217
|
|
|
218
218
|
`,`1) content: element.innerHTML
|
|
219
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&A9(c,n);return u&&l.push(u),l},[]);return vs(e)?s[0]:s}bs.defaultProps=fr,bs.setDefaultProps=w9,bs.currentInput=Yr,Object.assign({},wS,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}}),bs.setDefaultProps({render:nA});function iA(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var aA=typeof window<"u"&&typeof document<"u";function ng(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function oA(){return aA&&document.createElement("div")}function E9(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function sA(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!sA(e[r],t[r]))return!1}else return!1;return!0}else return!1}function P9(e){var t=[];return e.forEach(function(r){t.find(function(n){return sA(r,n)})||t.push(r)}),t}function C9(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:P9([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var ig=aA?k.useLayoutEffect:k.useEffect;function k9(e){var t=k.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function lA(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var T9={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!n()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}lA(r,"add",t.props.className)}function a(){n()&&lA(r,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:a,onAfterUpdate:i}}};function M9(e){function t(r){var n=r.children,i=r.content,a=r.visible,o=r.singleton,s=r.render,l=r.reference,c=r.disabled,u=c===void 0?!1:c,f=r.ignoreAttributes,d=f===void 0?!0:f;r.__source,r.__self;var h=iA(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),m=a!==void 0,p=o!==void 0,g=k.useState(!1),v=g[0],x=g[1],w=k.useState({}),y=w[0],_=w[1],O=k.useState(),A=O[0],P=O[1],T=k9(function(){return{container:oA(),renders:1}}),I=Object.assign({ignoreAttributes:d},h,{content:T.container});m&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){I[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),I.trigger="manual",I.hideOnClick=!1),p&&(u=!0);var j=I,S=I.plugins||[];s&&(j=Object.assign({},I,{plugins:p&&o.data!=null?[].concat(S,[{fn:function(){return{onTrigger:function(z,W){var Y=o.data.children.find(function(G){var L=G.instance;return L.reference===W.currentTarget});z.state.$$activeSingletonInstance=Y.instance,P(Y.content)}}}}]):S,render:function(){return{popper:T.container}}}));var D=[l].concat(n?[n.type]:[]);return ig(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var $=e(M||T.ref||oA(),Object.assign({},j,{plugins:[T9].concat(I.plugins||[])}));return T.instance=$,u&&$.disable(),a&&$.show(),p&&o.hook({instance:$,content:i,props:j,setSingletonContent:P}),x(!0),function(){$.destroy(),o?.cleanup($)}},D),ig(function(){var M;if(T.renders===1){T.renders++;return}var $=T.instance;$.setProps(C9($.props,j)),(M=$.popperInstance)==null||M.forceUpdate(),u?$.disable():$.enable(),m&&(a?$.show():$.hide()),p&&o.hook({instance:$,content:i,props:j,setSingletonContent:P})}),ig(function(){var M;if(s){var $=T.instance;$.setProps({popperOptions:Object.assign({},$.props.popperOptions,{modifiers:[].concat((((M=$.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(z){var W=z.name;return W!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(W){var Y,G=W.state,L=(Y=G.modifiersData)==null?void 0:Y.hide;(y.placement!==G.placement||y.referenceHidden!==L?.isReferenceHidden||y.escaped!==L?.hasPopperEscaped)&&_({placement:G.placement,referenceHidden:L?.isReferenceHidden,escaped:L?.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(D)),k.createElement(k.Fragment,null,n?k.cloneElement(n,{ref:function($){T.ref=$,ng(n.ref,$)}}):null,v&&Xg.createPortal(s?s(E9(y),A,T.instance):i,T.container))}return t}var j9=(function(e,t){return k.forwardRef(function(n,i){var a=n.children,o=iA(n,["children"]);return k.createElement(e,Object.assign({},t,o),a?k.cloneElement(a,{ref:function(l){ng(i,l),ng(a.ref,l)}}):null)})}),D9=j9(M9(bs));function N9(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function I9(e=[]){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:N9(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}const Wa={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function $9({type:e,data:t,children:r}){if(!e||!t)return r;const n={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},a={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},o=b.jsx(hi,{title:i[e],period:"Today",icon:b.jsx(Of,{className:`${a[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:b.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:n[e].map(([s,l])=>b.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[b.jsx("div",{children:s}),b.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return b.jsx(D9,{content:o,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:r})}function R9({isStatic:e,data:t}){const r=t?.summary?.activeWalkins||{},n=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},a=I9(t?.chart||[]),o=Math.max(...a.flatMap(c=>[c.walkins,c.checkins,c.staffAttendance])),s=o>0?o:5,l=[0,Math.ceil(s/2),s];return b.jsx(hi,{title:"Gate Updates",period:"Today",icon:b.jsx(Of,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:b.jsxs("div",{children:[b.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:r,color:Wa.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:Wa.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:n,color:Wa.preApproved,label:"Pre-approved"}].map(c=>b.jsx($9,{type:c.key,data:c.data,children:b.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[b.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:c.label}),b.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:c.color},children:[c.key==="activeWalkins"?c.data?.visitor_in??0:c.key==="preApprovedCheckins"?c.data?.expected_pass_scanned??0:c.data?.total_in_now??0,b.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",c.key==="activeWalkins"?c.data?.total_pass??0:c.key==="preApprovedCheckins"?c.data?.total_expected_pass??0:c.data?.total_staff??0]})]})]})},c.key))}),b.jsx("div",{className:"w-full h-[105px]",children:b.jsx(Ni,{width:"100%",height:"100%",children:b.jsxs(vS,{data:a,margin:{top:5,right:0,left:-40,bottom:0},children:[b.jsx(ru,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(iu,{dataKey:"time",tickFormatter:(c,u)=>u%4===0?c:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),b.jsx(ls,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:l,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),b.jsx(Di,{content:b.jsx(yo,{})}),b.jsx(Ia,{type:"monotone",dataKey:"walkins",stroke:Wa.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),b.jsx(Ia,{type:"monotone",dataKey:"checkins",stroke:Wa.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),b.jsx(Ia,{type:"monotone",dataKey:"staffAttendance",stroke:Wa.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function L9({isStatic:e,data:t}){const r=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],n=[{name:"L1 Level",value:Number(t?.today_L1||0),color:r[0]},{name:"L2 Level",value:Number(t?.today_L2||0),color:r[1]},{name:"L3 Level",value:Number(t?.today_L3||0),color:r[2]},{name:"L4 Level",value:Number(t?.today_L4||0),color:r[3]}];n.reduce((a,o)=>a+o.value,0);const i=n;return b.jsx(hi,{title:"Helpdesk",period:"As of Today",icon:b.jsx(lM,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:b.jsxs("div",{className:"flex gap-[12px] h-fit",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(Cy,{value:t?.percent_change}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),b.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:b.jsx(Ni,{width:"75%",height:"100%",children:b.jsxs(lu,{children:[b.jsx(as,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((a,o)=>b.jsx(Ur,{fill:r[o]||"#CBD5E1"},a.name))}),b.jsx(Di,{content:b.jsx(yo,{})})]})})})]})})}/*!
|
|
219
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&A9(c,n);return u&&l.push(u),l},[]);return vs(e)?s[0]:s}bs.defaultProps=fr,bs.setDefaultProps=w9,bs.currentInput=Yr,Object.assign({},wS,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}}),bs.setDefaultProps({render:nA});function iA(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var aA=typeof window<"u"&&typeof document<"u";function ng(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function oA(){return aA&&document.createElement("div")}function E9(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function sA(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!sA(e[r],t[r]))return!1}else return!1;return!0}else return!1}function P9(e){var t=[];return e.forEach(function(r){t.find(function(n){return sA(r,n)})||t.push(r)}),t}function C9(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:P9([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var ig=aA?k.useLayoutEffect:k.useEffect;function k9(e){var t=k.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function lA(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var T9={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!n()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}lA(r,"add",t.props.className)}function a(){n()&&lA(r,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:a,onAfterUpdate:i}}};function M9(e){function t(r){var n=r.children,i=r.content,a=r.visible,o=r.singleton,s=r.render,l=r.reference,c=r.disabled,u=c===void 0?!1:c,f=r.ignoreAttributes,d=f===void 0?!0:f;r.__source,r.__self;var h=iA(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),m=a!==void 0,p=o!==void 0,g=k.useState(!1),v=g[0],x=g[1],w=k.useState({}),y=w[0],_=w[1],O=k.useState(),A=O[0],P=O[1],T=k9(function(){return{container:oA(),renders:1}}),I=Object.assign({ignoreAttributes:d},h,{content:T.container});m&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){I[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),I.trigger="manual",I.hideOnClick=!1),p&&(u=!0);var j=I,S=I.plugins||[];s&&(j=Object.assign({},I,{plugins:p&&o.data!=null?[].concat(S,[{fn:function(){return{onTrigger:function(z,W){var Y=o.data.children.find(function(G){var L=G.instance;return L.reference===W.currentTarget});z.state.$$activeSingletonInstance=Y.instance,P(Y.content)}}}}]):S,render:function(){return{popper:T.container}}}));var D=[l].concat(n?[n.type]:[]);return ig(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var $=e(M||T.ref||oA(),Object.assign({},j,{plugins:[T9].concat(I.plugins||[])}));return T.instance=$,u&&$.disable(),a&&$.show(),p&&o.hook({instance:$,content:i,props:j,setSingletonContent:P}),x(!0),function(){$.destroy(),o?.cleanup($)}},D),ig(function(){var M;if(T.renders===1){T.renders++;return}var $=T.instance;$.setProps(C9($.props,j)),(M=$.popperInstance)==null||M.forceUpdate(),u?$.disable():$.enable(),m&&(a?$.show():$.hide()),p&&o.hook({instance:$,content:i,props:j,setSingletonContent:P})}),ig(function(){var M;if(s){var $=T.instance;$.setProps({popperOptions:Object.assign({},$.props.popperOptions,{modifiers:[].concat((((M=$.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(z){var W=z.name;return W!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(W){var Y,G=W.state,L=(Y=G.modifiersData)==null?void 0:Y.hide;(y.placement!==G.placement||y.referenceHidden!==L?.isReferenceHidden||y.escaped!==L?.hasPopperEscaped)&&_({placement:G.placement,referenceHidden:L?.isReferenceHidden,escaped:L?.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(D)),k.createElement(k.Fragment,null,n?k.cloneElement(n,{ref:function($){T.ref=$,ng(n.ref,$)}}):null,v&&Xg.createPortal(s?s(E9(y),A,T.instance):i,T.container))}return t}var j9=(function(e,t){return k.forwardRef(function(n,i){var a=n.children,o=iA(n,["children"]);return k.createElement(e,Object.assign({},t,o),a?k.cloneElement(a,{ref:function(l){ng(i,l),ng(a.ref,l)}}):null)})}),D9=j9(M9(bs));function N9(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function I9(e=[]){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:N9(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}const Wa={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function $9({type:e,data:t,children:r}){if(!e||!t)return r;const n={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},a={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},o=b.jsx(hi,{title:i[e],period:"Today",icon:b.jsx(Of,{className:`${a[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:b.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:n[e].map(([s,l])=>b.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[b.jsx("div",{children:s}),b.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return b.jsx(D9,{content:o,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:r})}function R9({isStatic:e,data:t}){const r=t?.summary?.activeWalkins||{},n=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},a=I9(t?.chart||[]),o=Math.max(...a.flatMap(c=>[c.walkins,c.checkins,c.staffAttendance])),s=o>0?o:5,l=[0,Math.ceil(s/2),s];return b.jsx(hi,{title:"Gate Updates",period:"Today",icon:b.jsx(Of,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:b.jsxs("div",{children:[b.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:r,color:Wa.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:Wa.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:n,color:Wa.preApproved,label:"Pre-approved"}].map(c=>b.jsx($9,{type:c.key,data:c.data,children:b.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[b.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:c.label}),b.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:c.color},children:[c.key==="activeWalkins"?c.data?.visitor_in??0:c.key==="preApprovedCheckins"?c.data?.currently_inside??0:c.data?.total_in_now??0,b.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",c.key==="activeWalkins"?c.data?.total_pass??0:c.key==="preApprovedCheckins"?c.data?.total_expected_pass??0:c.data?.total_staff??0]})]})]})},c.key))}),b.jsx("div",{className:"w-full h-[105px]",children:b.jsx(Ni,{width:"100%",height:"100%",children:b.jsxs(vS,{data:a,margin:{top:5,right:0,left:-40,bottom:0},children:[b.jsx(ru,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(iu,{dataKey:"time",tickFormatter:(c,u)=>u%4===0?c:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),b.jsx(ls,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:l,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),b.jsx(Di,{content:b.jsx(yo,{})}),b.jsx(Ia,{type:"monotone",dataKey:"walkins",stroke:Wa.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),b.jsx(Ia,{type:"monotone",dataKey:"checkins",stroke:Wa.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),b.jsx(Ia,{type:"monotone",dataKey:"staffAttendance",stroke:Wa.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function L9({isStatic:e,data:t}){const r=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],n=[{name:"L1 Level",value:Number(t?.today_L1||0),color:r[0]},{name:"L2 Level",value:Number(t?.today_L2||0),color:r[1]},{name:"L3 Level",value:Number(t?.today_L3||0),color:r[2]},{name:"L4 Level",value:Number(t?.today_L4||0),color:r[3]}];n.reduce((a,o)=>a+o.value,0);const i=n;return b.jsx(hi,{title:"Helpdesk",period:"As of Today",icon:b.jsx(lM,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:b.jsxs("div",{className:"flex gap-[12px] h-fit",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(Cy,{value:t?.percent_change}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),b.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:b.jsx(Ni,{width:"75%",height:"100%",children:b.jsxs(lu,{children:[b.jsx(as,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((a,o)=>b.jsx(Ur,{fill:r[o]||"#CBD5E1"},a.name))}),b.jsx(Di,{content:b.jsx(yo,{})})]})})})]})})}/*!
|
|
220
220
|
* @kurkle/color v0.3.4
|
|
221
221
|
* https://github.com/kurkle/color#readme
|
|
222
222
|
* (c) 2024 Jukka Kurkela
|