"use strict";(self.webpackChunk_1js_people_in_taskbar=self.webpackChunk_1js_people_in_taskbar||[]).push([[4264],{91873:(e,t,o)=>{o.r(t),o.d(t,{default:()=>L});var a=o(71124),n=o(16873),l=o(27623);const r=(0,l.PK)((e=>({categoryTagsLayoutStyles:{display:"flex",flexWrap:"wrap",gap:`${e.spacing.s1} ${e.spacing.s2}`}})));function c(e){const{tagList:t,tagPlusIcon:o,addCategoryLink:l}=e,c=(0,n.D)(),s=r(c);return a.createElement("div",{className:s.categoryTagsLayoutStyles,role:"list"},t,o,l)}var s=o(88777),i=o(10868),u=o(29372),g=o(72825),d=o(22690),m=o(28859),p=o(51634),C=o(8618);const h=(0,p.qP)("contact-categories-ui.contactCategory.tag.remove");const k=e=>{let{tag:t,showDelete:o,onTagDelete:r,onTagClick:c}=e;const p=(0,n.D)(),{name:k,source:y}=t,b=i.V[t.color],{primaryColor:f,secondaryColor:v,textColor:x}=b,{removeTagListItemTitle:T}=function(e){let{categoryName:t}=e;const o=(0,C.hX)(h,{p0:t});return a.useMemo((()=>({removeTagListItemTitle:o})),[t])}({categoryName:k}),S=(0,a.useCallback)((e=>{null==r||r(t),e.stopPropagation()}),[r,t]),w=(0,a.useCallback)((()=>null==c?void 0:c(t)),[c,t]),D=(0,u.w)(g.o.Cancel),E=((e,t,o)=>(0,l.PK)((a=>({tagItemStyles:{color:`${t}`,background:e,fontSize:12,boxSizing:"border-box",height:20,display:"flex",alignItems:"center",border:`1px solid ${o}`,borderRadius:"3px",marginRight:"8px",selectors:{"&:focus":{border:`1px solid ${t}`,outline:"none"}}},tagChildItemStyles:{all:"unset",height:20,lineHeight:20,padding:"0 4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:120},tagBtnStyles:{padding:"0 14px",border:"none",outline:"none",background:"none",height:18,width:20,selectors:{"&:hover, &:focus":{backgroundColor:o}}},tagBtnFocused:{".ms-Fabric--isFocusVisible &:focus::after":{outlineColor:a.palette.black}}}))))(f,x,v)(p),P=()=>a.createElement("div",{onClick:w,className:E.tagItemStyles,role:"listitem",title:k,"aria-label":k,"data-is-focusable":"true"},a.createElement("div",{className:E.tagChildItemStyles},k),(null==o?void 0:o(t))&&a.createElement(s.n$,{callback:S},(e=>a.createElement(m.K,{iconProps:{iconName:D,styles:{root:{color:x,fontSize:10,margin:0,height:"20px",lineHeight:"20px"}}},title:T,ariaLabel:T,className:E.tagBtnStyles,styles:{rootFocused:E.tagBtnFocused},onClick:e}))));return y?a.createElement(d.S,{content:y},P()):P()},y=(0,p.qP)("contact-categories-ui.contactCategory.tag.moreCategories");var b=o(59453);const f=e=>{let{count:t,onClick:o}=e;const r=(0,n.D)(),c=(0,l.PK)((e=>({iconStyles:{all:"unset",color:e.palette.neutralSecondary,background:b.sl.select({Outlook:e.palette.neutralTertiarySurface,Default:e.palette.neutralLight}),borderRadius:"3px",padding:`0 ${e.spacing.s2}`,fontSize:12,boxSizing:"border-box",height:20,cursor:"pointer",selectors:{"&:hover, &:focus":{border:`1px solid ${e.palette.neutralTertiary}`,background:b.sl.select({Outlook:e.palette.neutralHover,Default:e.palette.neutralQuaternaryAlt})}}}})))(r),s=`+${t}`,{moreCategoriesCountTitle:i}=function(e){let{moreCategoriesCount:t}=e;const o=(0,C.hX)(y,{p0:t});return a.useMemo((()=>({moreCategoriesCountTitle:o})),[t])}({moreCategoriesCount:`${t}`||"0"});return t?a.createElement("button",{tabIndex:0,title:i,"aria-label":i,onClick:o,className:c.iconStyles},s):null};var v=o(51028);const x=(0,p.Ex)("contact-categories-ui.contactCategories.tag.addCategory");function T(){return{addCategoryTitle:(0,C.Lh)(x)}}const S=e=>{const t=T();return a.createElement(v.N,{onClick:e.onClick},t.addCategoryTitle)};var w=o(29880),D=o(37089);const E=(0,l.PK)((e=>({link:{color:e.palette.themeDarkAlt,backgroundColor:"transparent",height:"unset",padding:0,margin:0,selectors:{"&:active, &:hover, &:active:hover":{textDecoration:"none",color:e.palette.themeDarker}," span":{padding:0,margin:0}}}}))),P=e=>{const t=(0,n.D)(),o=E(t),l=T(),r={shouldFocusOnMount:!1,items:[{key:"CategoryMenu",text:"CategoryMenu",onRender:(t,o)=>{var a;return null===(a=e.onRender)||void 0===a?void 0:a.call(e,o)}}]};return a.createElement(w.c,{className:o.link,menuProps:r,onRenderMenuIcon:D.K},l.addCategoryTitle)},I=2;function L(e){let{menuButtonRef:t,tags:o,showDelete:n,showAll:l,onTagDelete:r,onTagClick:s,onShowMoreClick:i,onCategoryAddClick:u,showMenuForCategoryAddClick:g,onCategoryAddMenuRender:d}=e;const m=o.sort(((e,t)=>new Date(t.creationTime??"").getTime()-new Date(e.creationTime??"").getTime())),p=m.length,C=Boolean(l)||p<=I,h=(C?m:m.slice(0,I)).map((e=>a.createElement(k,{key:e.name,tag:e,showDelete:n,onTagDelete:r,onTagClick:s})));a.useEffect((()=>()=>{var e;null==t||null===(e=t.current)||void 0===e||e.focus()}),[t]);const y=(0,a.useCallback)((()=>{null==i||i()}),[]),b=C?null:a.createElement(f,{count:p-I,onClick:y}),v=u?a.createElement(S,{onClick:u}):null,x=d?a.createElement(P,{onRender:d}):null;return a.createElement(c,{tagList:h,tagPlusIcon:b,addCategoryLink:g?x:v})}L.defaultProps={showAll:!0,showDelete:!0}}}]);