@grasco/profile-picture 0.1.2 → 0.1.4

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import zt,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,html}from'lit';import {property,state,customElement}from'lit/decorators.js';import {styleMap}from'lit/directives/style-map.js';var Rt=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var s=(r,n,t,e)=>{for(var o=e>1?void 0:e?Tt(n,t):n,a=r.length-1,p;a>=0;a--)(p=r[a])&&(o=(e?p(n,t,o):p(o))||o);return e&&o&&Rt(n,t,o),o};var rt="grasco-profile-picture-styles",M=false;function nt(){if(M||typeof document>"u")return;if(document.getElementById(rt)){M=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){M=true;return}let n=Ut();if(!n)return;let t=document.createElement("link");t.id=rt,t.rel="stylesheet",t.href=n,document.head.appendChild(t),M=true;}function Ut(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=import.meta.url;if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var D={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},ot={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},it={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},C={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var R={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},S={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function x(...r){return r.filter(Boolean).join(" ")}function L(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function at(r){return {"top-left":"np:top-0 np:left-0","top-right":"np:top-0 np:right-0","bottom-left":"np:bottom-0 np:left-0","bottom-right":"np:bottom-0 np:right-0"}[r]}function st(r){return {"top-left":"np:-rotate-45 np:-translate-x-1/4 np:-translate-y-1/2","top-right":"np:rotate-45 np:translate-x-1/4 np:-translate-y-1/2","bottom-left":"np:rotate-45 np:-translate-x-1/4 np:translate-y-1/2","bottom-right":"np:-rotate-45 np:translate-x-1/4 np:translate-y-1/2"}[r]}function O(r){let t=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,1).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function X(r){return Math.round(r*.38)}function pt(r,n){let e=Math.max(n?18:10,Math.round(r*(n?.32:.22))),o=Math.round(e*.6);return {size:e,fontSize:o}}function dt(r,n){return Math.max(8,Math.round(r*.25))+(n-1)*2}function lt(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function ct(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let o=e/r.length*360,a=(e+1)/r.length*360;return `${t} ${o}deg ${a}deg`}).join(", ")})`}function Lt(r){let n=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);n=(n<<5)-n+e,n&=n;}return Math.abs(n)}function gt(r,n,t){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${t} ${o}deg 360deg)`}function F(r){let n=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],t=Lt(r)%n.length;return n[t]}function ut(r){return typeof r=="number"?r:D[r]??D[S.size]}function bt(r,n,t){let e=t?n-1:n;if(r<=e)return {visible:r,hidden:0,showCounter:false};let o=e-1,a=r-o;return {visible:o,hidden:a,showCounter:true}}function N(r,n,t,e,o){let a=o??n*(1-t);return r*a}function ft(r,n,t){return t==="ltr"?n-r:r+1}function ht(r,n,t,e){if(r===0)return 0;if(r===1)return n;let o=e??n*(1-t);return n+o*(r-1)}function mt(r){return r>99?"+99":`+${r}`}function Q(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function P(r){if(!(r&&L(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let t=Number.parseInt(n.slice(0,2),16),e=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*t+.587*e+.114*o)/255>.5?"light":"dark"}function _(r,n,t,e,o){let a=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${t}_${e}.webp`;return `${a}/api/profile-picture/cdn/${p}?hostname=${o}`}function xt(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function vt(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function yt(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function wt(r){return {boxShadow:it[r]}}var Bt={shimmer:`
1
+ import Ut,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,html,render}from'lit';import {property,state,customElement}from'lit/decorators.js';import {styleMap}from'lit/directives/style-map.js';var Ft=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var s=(r,o,t,e)=>{for(var n=e>1?void 0:e?Nt(o,t):o,i=r.length-1,p;i>=0;i--)(p=r[i])&&(n=(e?p(o,t,n):p(n))||n);return e&&n&&Ft(o,t,n),n};var ct="grasco-profile-picture-styles",K=false;function gt(){if(K||typeof document>"u")return;if(document.getElementById(ct)){K=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){K=true;return}let o=Ht();if(!o)return;let t=document.createElement("link");t.id=ct,t.rel="stylesheet",t.href=o,document.head.appendChild(t),K=true;}function Ht(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let o=import.meta.url;if(o)return `${o.substring(0,o.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let o=new URL(r.src);return `${o.href.substring(0,o.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var N={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},ut={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},ft={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},R={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var H={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},z={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function $(...r){return r.filter(Boolean).join(" ")}function V(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function bt(r){return {"top-left":"np:top-0 np:left-0","top-center":"np:top-0 np:left-1/2 np:-translate-x-1/2","top-right":"np:top-0 np:right-0","bottom-left":"np:bottom-0 np:left-0","bottom-center":"np:bottom-0 np:left-1/2 np:-translate-x-1/2","bottom-right":"np:bottom-0 np:right-0"}[r]}function ht(r){return {"top-left":"np:-rotate-45 np:-translate-x-1/4 np:-translate-y-1/2","top-center":"np:rotate-0 np:-translate-y-1/2","top-right":"np:rotate-45 np:translate-x-1/4 np:-translate-y-1/2","bottom-left":"np:rotate-45 np:-translate-x-1/4 np:translate-y-1/2","bottom-center":"np:rotate-0 np:translate-y-1/2","bottom-right":"np:-rotate-45 np:translate-x-1/4 np:translate-y-1/2"}[r]}function q(r){let t=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,1).toUpperCase():(t[0][0]+(t.at(-1)?.[0]??"")).toUpperCase()}function rt(r){return Math.round(r*.38)}function mt(r,o){let t;if(o){let n=Math.round(r*.31);t=Math.min(24,Math.max(14,n));}else {let n=Math.round(r*.22);t=Math.min(14,Math.max(8,n));}let e=Math.max(9,Math.round(t*.55));return {size:t,fontSize:e}}function xt(r,o){let t=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,t+(o-1)*2)}function vt(r,o){return typeof r=="string"?r:o&&r>o?`${o}+`:r.toString()}function yt(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let n=e/r.length*360,i=(e+1)/r.length*360;return `${t} ${n}deg ${i}deg`}).join(", ")})`}function Pt(r){let o=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);o=(o<<5)-o+e,o&=o;}return Math.abs(o)}function wt(r,o,t){let n=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${o} 0deg ${n}deg, ${t} ${n}deg 360deg)`}function X(r){let o=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],t=Pt(r)%o.length;return o[t]}function Ct(r){return typeof r=="number"?r:N[r]??N[z.size]}function nt(r,o,t){let e=t?o-1:o;if(r<=e)return {visible:r,hidden:0,showCounter:false};let n=e-1,i=r-n;return {visible:n,hidden:i,showCounter:true}}function Z(r,o,t,e,n){let i=n??o*(1-t);return r*i}function St(r,o,t){return t==="ltr"?o-r:r+1}function kt(r,o,t,e){if(r===0)return 0;if(r===1)return o;let n=e??o*(1-t);return o+n*(r-1)}function $t(r){return r>99?"+99":`+${r}`}function ot(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function it(r){if(!(r&&V(r)))return "light";let o=r.replace("#","");o.length===3&&(o=o.split("").map(p=>p+p).join(""));let t=Number.parseInt(o.slice(0,2),16),e=Number.parseInt(o.slice(2,4),16),n=Number.parseInt(o.slice(4,6),16);return (.299*t+.587*e+.114*n)/255>.5?"light":"dark"}function at(r,o,t,e,n){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${o}_${t}_${e}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${n}`}function Et(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function It(r,o){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:o,borderStyle:"solid"}}}function Rt(r,o){return o?{className:"",style:{background:o}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function zt(r){return {boxShadow:ft[r]}}var jt={shimmer:`
2
2
  @keyframes pp-shimmer {
3
3
  0% { transform: translateX(-100%); }
4
4
  100% { transform: translateX(100%); }
@@ -36,8 +36,8 @@ import zt,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
36
36
  0% { transform: scale(0.8); opacity: 0; }
37
37
  50% { transform: scale(1.05); }
38
38
  100% { transform: scale(1); opacity: 1; }
39
- }`},Gt=Object.values(Bt).join(`
40
- `),Mt=`
39
+ }`},Vt=Object.values(jt).join(`
40
+ `),Wt=`
41
41
  /* Profile Picture Component Styles */
42
42
  .pp-container {
43
43
  --pp-transition-duration: 200ms;
@@ -154,7 +154,6 @@ import zt,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
154
154
  display: flex;
155
155
  align-items: center;
156
156
  justify-content: center;
157
- border-radius: 9999px;
158
157
  font-weight: 600;
159
158
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
160
159
  line-height: 1;
@@ -259,8 +258,8 @@ import zt,{useRef,useCallback,useEffect}from'react';import {LitElement,nothing,h
259
258
  transition: none !important;
260
259
  }
261
260
  }
262
- `,Ct=`${Gt}
263
- ${Mt}`,St=`
261
+ `,At=`${Vt}
262
+ ${Wt}`,Tt=`
264
263
  @keyframes np-shimmer {
265
264
  0% { background-position: -200% 0; }
266
265
  100% { background-position: 200% 0; }
@@ -270,22 +269,22 @@ ${Mt}`,St=`
270
269
  background-size: 200% 100%;
271
270
  animation: np-shimmer 1.5s infinite;
272
271
  }
273
- `;function kt(r,n=.3){if(L(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var Ot=`
272
+ `;function Dt(r,o=.3){if(V(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),n=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${n}, ${o})`}return `0 0 20px 0 ${r}`}var Jt=`
274
273
  @keyframes ppg-tooltip-in {
275
274
  from {
276
275
  opacity: 0;
277
- transform: translateY(4px) scale(0.96);
276
+ transform: translateX(-50%) translateY(4px) scale(0.96);
278
277
  }
279
278
  to {
280
279
  opacity: 1;
281
- transform: translateY(0) scale(1);
280
+ transform: translateX(-50%) translateY(0) scale(1);
282
281
  }
283
282
  }
284
283
 
285
284
  @keyframes ppg-dropdown-in {
286
285
  from {
287
286
  opacity: 0;
288
- transform: translateY(-8px) scale(0.96);
287
+ transform: translateY(-6px) scale(0.95);
289
288
  }
290
289
  to {
291
290
  opacity: 1;
@@ -301,7 +300,27 @@ ${Mt}`,St=`
301
300
  transform: translateY(-4px) scale(1.08);
302
301
  }
303
302
  }
304
- `,Ft=`
303
+
304
+ @keyframes ppg-modal-in {
305
+ from {
306
+ opacity: 0;
307
+ transform: translate(-50%, -50%) scale(0.9);
308
+ }
309
+ to {
310
+ opacity: 1;
311
+ transform: translate(-50%, -50%) scale(1);
312
+ }
313
+ }
314
+
315
+ @keyframes ppg-backdrop-in {
316
+ from {
317
+ opacity: 0;
318
+ }
319
+ to {
320
+ opacity: 1;
321
+ }
322
+ }
323
+ `,Yt=`
305
324
  /* Profile Picture Group Container */
306
325
  .ppg-container {
307
326
  --ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -382,7 +401,7 @@ ${Mt}`,St=`
382
401
  }
383
402
 
384
403
  .ppg-counter:hover {
385
- background: #e8e8ed;
404
+ background: #ebebed;
386
405
  transform: scale(1.05);
387
406
  }
388
407
 
@@ -436,7 +455,7 @@ ${Mt}`,St=`
436
455
 
437
456
  /* Tooltip */
438
457
  .ppg-tooltip {
439
- position: fixed;
458
+ position: absolute;
440
459
  z-index: 9999;
441
460
  padding: 6px 12px;
442
461
  background: var(--ppg-tooltip-bg);
@@ -448,7 +467,8 @@ ${Mt}`,St=`
448
467
  box-shadow: var(--ppg-shadow-lg);
449
468
  pointer-events: none;
450
469
  white-space: nowrap;
451
- animation: ppg-tooltip-in 150ms ease-out;
470
+ transform: translateX(-50%);
471
+ animation: ppg-tooltip-in 150ms ease-out forwards;
452
472
  backdrop-filter: blur(20px);
453
473
  -webkit-backdrop-filter: blur(20px);
454
474
  }
@@ -477,111 +497,168 @@ ${Mt}`,St=`
477
497
  /* Dropdown */
478
498
  .ppg-dropdown {
479
499
  position: absolute;
480
- z-index: 1000;
481
- min-width: 200px;
482
- max-width: 280px;
500
+ z-index: 9998;
501
+ right: 0;
502
+ min-width: 220px;
503
+ max-width: 300px;
483
504
  background: var(--ppg-dropdown-bg);
484
- border-radius: var(--ppg-radius);
485
- box-shadow: var(--ppg-shadow-lg);
486
- border: 1px solid var(--ppg-border);
505
+ border-radius: 14px;
506
+ box-shadow:
507
+ 0 4px 24px rgba(0, 0, 0, 0.12),
508
+ 0 1px 4px rgba(0, 0, 0, 0.08),
509
+ 0 0 0 1px var(--ppg-border);
487
510
  overflow: hidden;
488
- animation: ppg-dropdown-in 200ms ease-out;
511
+ animation: ppg-dropdown-in 200ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
512
+ transform-origin: top right;
513
+ backdrop-filter: blur(20px);
514
+ -webkit-backdrop-filter: blur(20px);
489
515
  }
490
516
 
491
517
  .ppg-dropdown[data-position="bottom"] {
492
- top: calc(100% + 8px);
518
+ top: calc(100% + 10px);
493
519
  }
494
520
 
495
521
  .ppg-dropdown[data-position="top"] {
496
- bottom: calc(100% + 8px);
522
+ bottom: calc(100% + 10px);
523
+ transform-origin: bottom right;
524
+ }
525
+
526
+ /* Modal style for mobile */
527
+ .ppg-dropdown[data-position="modal"] {
528
+ transform-origin: center center;
529
+ animation: ppg-modal-in 250ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
530
+ border-radius: 20px;
531
+ }
532
+
533
+ .ppg-backdrop-visible {
534
+ background: rgba(0, 0, 0, 0.4);
535
+ animation: ppg-backdrop-in 200ms ease-out forwards;
497
536
  }
498
537
 
499
538
  .ppg-dropdown-header {
500
- padding: 12px 16px 8px;
501
- font-size: 12px;
539
+ padding: 14px 16px 10px;
540
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
541
+ font-size: 11px;
502
542
  font-weight: 600;
503
543
  color: #86868b;
504
544
  text-transform: uppercase;
505
- letter-spacing: 0.04em;
506
- border-bottom: 1px solid var(--ppg-border);
545
+ letter-spacing: 0.06em;
546
+ background: linear-gradient(to bottom, rgba(0,0,0,0.02), transparent);
507
547
  }
508
548
 
509
549
  .ppg-dropdown-list {
510
550
  overflow-y: auto;
511
- padding: 4px 0;
551
+ padding: 6px;
552
+ scrollbar-width: thin;
553
+ scrollbar-color: rgba(0,0,0,0.2) transparent;
554
+ }
555
+
556
+ .ppg-dropdown-list::-webkit-scrollbar {
557
+ width: 6px;
558
+ }
559
+
560
+ .ppg-dropdown-list::-webkit-scrollbar-track {
561
+ background: transparent;
562
+ }
563
+
564
+ .ppg-dropdown-list::-webkit-scrollbar-thumb {
565
+ background: rgba(0,0,0,0.15);
566
+ border-radius: 3px;
512
567
  }
513
568
 
514
569
  .ppg-dropdown-item {
515
570
  display: flex;
516
571
  align-items: center;
517
572
  gap: 12px;
518
- padding: 10px 16px;
573
+ padding: 10px 12px;
519
574
  cursor: pointer;
520
- transition: background-color var(--ppg-transition);
575
+ border-radius: 10px;
576
+ transition: all 150ms ease;
577
+ margin: 2px 0;
521
578
  }
522
579
 
523
580
  .ppg-dropdown-item:hover {
524
581
  background: var(--ppg-dropdown-hover);
582
+ transform: translateX(2px);
525
583
  }
526
584
 
527
585
  .ppg-dropdown-item:focus-visible {
528
586
  outline: none;
529
587
  background: var(--ppg-dropdown-hover);
588
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
589
+ }
590
+
591
+ .ppg-dropdown-item:active {
592
+ transform: scale(0.98);
530
593
  }
531
594
 
532
595
  .ppg-dropdown-avatar {
533
596
  flex-shrink: 0;
534
- width: 32px;
535
- height: 32px;
597
+ width: 36px;
598
+ height: 36px;
536
599
  border-radius: 9999px;
537
600
  object-fit: cover;
538
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
601
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
602
+ border: 2px solid rgba(255, 255, 255, 0.8);
539
603
  }
540
604
 
541
605
  .ppg-dropdown-avatar-fallback {
542
606
  flex-shrink: 0;
543
- width: 32px;
544
- height: 32px;
607
+ width: 36px;
608
+ height: 36px;
545
609
  border-radius: 9999px;
546
610
  display: flex;
547
611
  align-items: center;
548
612
  justify-content: center;
613
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
549
614
  font-size: 13px;
550
615
  font-weight: 600;
551
616
  color: white;
617
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
618
+ border: 2px solid rgba(255, 255, 255, 0.3);
552
619
  }
553
620
 
554
621
  .ppg-dropdown-info {
555
622
  flex: 1;
556
623
  min-width: 0;
624
+ padding-right: 4px;
625
+ text-align: left;
557
626
  }
558
627
 
559
628
  .ppg-dropdown-name {
629
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
560
630
  font-size: 14px;
561
631
  font-weight: 500;
562
632
  color: #1d1d1f;
563
633
  white-space: nowrap;
564
634
  overflow: hidden;
565
635
  text-overflow: ellipsis;
636
+ line-height: 1.3;
637
+ text-align: left;
566
638
  }
567
639
 
568
640
  .ppg-dropdown-status {
569
641
  display: flex;
570
642
  align-items: center;
571
- gap: 6px;
643
+ gap: 5px;
644
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
572
645
  font-size: 12px;
573
646
  color: #86868b;
574
647
  margin-top: 2px;
648
+ line-height: 1.2;
575
649
  }
576
650
 
577
651
  .ppg-dropdown-presence {
578
- width: 8px;
579
- height: 8px;
652
+ width: 7px;
653
+ height: 7px;
580
654
  border-radius: 9999px;
655
+ flex-shrink: 0;
656
+ box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg);
581
657
  }
582
658
 
583
659
  .ppg-dropdown-presence[data-status="online"] {
584
660
  background: #30D158;
661
+ box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg), 0 0 6px rgba(48, 209, 88, 0.5);
585
662
  }
586
663
 
587
664
  .ppg-dropdown-presence[data-status="away"] {
@@ -601,7 +678,7 @@ ${Mt}`,St=`
601
678
  .ppg-backdrop {
602
679
  position: fixed;
603
680
  inset: 0;
604
- z-index: 999;
681
+ z-index: 9997;
605
682
  }
606
683
 
607
684
  /* Reduced motion */
@@ -643,33 +720,69 @@ ${Mt}`,St=`
643
720
  box-shadow: 0 0 0 1.5px rgba(28, 28, 30, 0.95), var(--ppg-shadow-sm);
644
721
  }
645
722
 
723
+ .ppg-counter:hover {
724
+ background: #3a3a3c;
725
+ }
726
+
727
+ .ppg-dropdown {
728
+ background: rgba(44, 44, 46, 0.95);
729
+ box-shadow:
730
+ 0 4px 24px rgba(0, 0, 0, 0.4),
731
+ 0 1px 4px rgba(0, 0, 0, 0.2),
732
+ 0 0 0 1px rgba(255, 255, 255, 0.08);
733
+ }
734
+
646
735
  .ppg-dropdown-name {
647
736
  color: #ffffff;
648
737
  }
649
738
 
650
739
  .ppg-dropdown-header {
651
740
  color: #98989d;
741
+ background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
742
+ }
743
+
744
+ .ppg-dropdown-avatar {
745
+ border-color: rgba(255, 255, 255, 0.15);
746
+ }
747
+
748
+ .ppg-dropdown-avatar-fallback {
652
749
  border-color: rgba(255, 255, 255, 0.1);
653
750
  }
751
+
752
+ .ppg-dropdown-list {
753
+ scrollbar-color: rgba(255,255,255,0.35) transparent;
754
+ }
755
+
756
+ .ppg-dropdown-list::-webkit-scrollbar-thumb {
757
+ background: rgba(255,255,255,0.35);
758
+ }
759
+
760
+ .ppg-dropdown-presence {
761
+ box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95);
762
+ }
763
+
764
+ .ppg-dropdown-presence[data-status="online"] {
765
+ box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
766
+ }
654
767
  }
655
- `,$t=`${Ot}
656
- ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=C.size;this.variant=C.variant;this.shadow=C.shadow;this.border=false;this.borderWidth=C.borderWidth;this.borderColor=C.borderColor;this.rotation=0;this.loading=C.loading;this.placeholder=C.placeholder;this.placeholderColor=C.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(t){i.cdnBaseUrl=t,i.instances.forEach(e=>{e.extCustomerId&&!e.cdnImageUrl&&(e.cdnLoadFailed=false,e.retryTimeoutId&&(clearTimeout(e.retryTimeoutId),e.retryTimeoutId=void 0),e.previousExtCustomerId||(e.previousExtCustomerId=e.extCustomerId),e.loadCdnImage());});}static getCdnBaseUrl(){return i.cdnBaseUrl}createRenderRoot(){return i.injectStylesOnce(),this}static injectStylesOnce(){if(i.stylesInjected||typeof document>"u")return;let t=document.createElement("style");t.textContent=Ct,document.head.appendChild(t),i.stylesInjected=true;}get pixelSize(){let t=this.size;return typeof t=="number"?t:D[t]??D[C.size]}connectedCallback(){super.connectedCallback(),i.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),i.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&i.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(t){super.updated(t),this.extCustomerId&&i.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(t){t.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(t.has("extCustomerId")||t.has("size")||t.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&i.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&i.cdnBaseUrl)){this.cdnLoadFailed=true;return}let t=Q(this.pixelSize),e=P(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=_(i.cdnBaseUrl,this.extCustomerId,t,e,o);}getContainerStyles(){let t=yt(this.bgColor,this.bgGradient),e=this.border?vt(this.borderWidth,this.borderColor):null,o=wt(this.shadow),a={};if(this.glow){let l=this.glow.color??this.borderColor??"#6366f1";a={"--pp-glow-color":l,boxShadow:kt(l,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:x("pp-container",xt(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:R[this.variant],...t.style,...e?.style,...o,...a,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return nothing;let t={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return html`
657
- ${this.placeholder==="shimmer"?html`<style>${St}</style>`:nothing}
768
+ `,Lt=`${Jt}
769
+ ${Yt}`;var a=class extends LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=R.size;this.variant=R.variant;this.shadow=R.shadow;this.border=false;this.borderWidth=R.borderWidth;this.borderColor=R.borderColor;this.rotation=0;this.loading=R.loading;this.placeholder=R.placeholder;this.placeholderColor=R.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(t){a.cdnBaseUrl=t,a.instances.forEach(e=>{e.extCustomerId&&!e.cdnImageUrl&&(e.cdnLoadFailed=false,e.retryTimeoutId&&(clearTimeout(e.retryTimeoutId),e.retryTimeoutId=void 0),e.previousExtCustomerId||(e.previousExtCustomerId=e.extCustomerId),e.loadCdnImage());});}static getCdnBaseUrl(){return a.cdnBaseUrl}createRenderRoot(){return a.injectStylesOnce(),this}static injectStylesOnce(){if(a.stylesInjected||typeof document>"u")return;let t=document.createElement("style");t.textContent=At,document.head.appendChild(t),a.stylesInjected=true;}get pixelSize(){let t=this.size;return typeof t=="number"?t:N[t]??N[R.size]}connectedCallback(){super.connectedCallback(),a.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),a.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&a.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(t){super.updated(t),this.extCustomerId&&a.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(t){t.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(t.has("extCustomerId")||t.has("size")||t.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&a.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&a.cdnBaseUrl)){this.cdnLoadFailed=true;return}let t=ot(this.pixelSize),e=it(this.bgColor),n=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=at(a.cdnBaseUrl,this.extCustomerId,t,e,n);}getContainerStyles(){let t=Rt(this.bgColor,this.bgGradient),e=this.border?It(this.borderWidth,this.borderColor):null,n=zt(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:Dt(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:$("pp-container",Et(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:H[this.variant],...t.style,...e?.style,...n,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return nothing;let t={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return html`
770
+ ${this.placeholder==="shimmer"?html`<style>${Tt}</style>`:nothing}
658
771
  <div
659
- class=${x("np:absolute np:inset-0",t)}
772
+ class=${$("np:absolute np:inset-0",t)}
660
773
  style=${styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
661
774
  </div>
662
775
  `}renderFallback(){if(this.fallback)return html`
663
776
  <span
664
777
  class="pp-fallback"
665
- style=${styleMap({fontSize:`${X(this.pixelSize)}px`})}>
778
+ style=${styleMap({fontSize:`${rt(this.pixelSize)}px`})}>
666
779
  ${this.fallback}
667
780
  </span>
668
- `;if(this.alt){let e=F(this.alt);return html`
781
+ `;if(this.alt){let e=X(this.alt);return html`
669
782
  <div
670
783
  class="pp-fallback np:absolute np:inset-0"
671
- style=${styleMap({background:this.bgColor??e,fontSize:`${X(this.pixelSize)}px`})}>
672
- ${O(this.alt)}
784
+ style=${styleMap({background:this.bgColor??e,fontSize:`${rt(this.pixelSize)}px`})}>
785
+ ${q(this.alt)}
673
786
  </div>
674
787
  `}let t=this.pixelSize*.5;return html`
675
788
  <svg
@@ -679,7 +792,7 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
679
792
  viewBox="0 0 24 24">
680
793
  <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
681
794
  </svg>
682
- `}renderImage(){let t=!!(this.extCustomerId&&i.cdnBaseUrl),e;return this.cdnImageUrl?e=this.cdnImageUrl:(!t||this.cdnLoadFailed)&&(e=this.src),this.hasError||!e?this.renderFallback():html`
795
+ `}renderImage(){let t=!!(this.extCustomerId&&a.cdnBaseUrl),e;return this.cdnImageUrl?e=this.cdnImageUrl:(!t||this.cdnLoadFailed)&&(e=this.src),this.hasError||!e?this.renderFallback():html`
683
796
  <img
684
797
  src=${e}
685
798
  alt=${this.alt}
@@ -687,33 +800,33 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
687
800
  decoding="async"
688
801
  @load=${this.handleLoad}
689
802
  @error=${this.handleError}
690
- class=${x("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
803
+ class=${$("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
691
804
  draggable="false" />
692
- `}renderRing(){if(!this.ring?.show)return nothing;let t=this.ring.width??3,e=this.ring.gap??3,o=t+e,a,p=this.ring.progress!==void 0;if(p){let l=this.ring.progress??0,u=this.ring.color??"#30D158",b=this.ring.emptyColor??"#8E8E93";a=gt(l,u,b);}else this.ring.gradient&&this.ring.gradient.length>0?a=ct(this.ring.gradient):a=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return html`
805
+ `}renderRing(){if(!this.ring?.show)return nothing;let t=this.ring.width??3,e=this.ring.gap??3,n=t+e,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,u=this.ring.color??"#30D158",f=this.ring.emptyColor??"#8E8E93";i=wt(d,u,f);}else this.ring.gradient&&this.ring.gradient.length>0?i=yt(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return html`
693
806
  <div
694
- class=${x("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
695
- style=${styleMap({inset:`-${o}px`,padding:`${t}px`,background:a,borderRadius:R[this.variant]})}>
807
+ class=${$("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
808
+ style=${styleMap({inset:`-${n}px`,padding:`${t}px`,background:i,borderRadius:H[this.variant]})}>
696
809
  </div>
697
- `}renderPresence(){if(!this.presence)return nothing;let t=this.presence.thickness??2,e=dt(this.pixelSize,t),o=ot[this.presence.status],a=Math.max(0,this.pixelSize*.02);return html`
810
+ `}renderPresence(){if(!this.presence)return nothing;let t=this.presence.thickness??2,e=xt(this.pixelSize,t),n=ut[this.presence.status],i=Math.max(0,this.pixelSize*.02);return html`
698
811
  <div
699
- class=${x("pp-presence",this.presence.animate&&"pp-presence-animated")}
700
- style=${styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:o,bottom:`${a}px`,right:`${a}px`,color:o})}
812
+ class=${$("pp-presence",this.presence.animate&&"pp-presence-animated")}
813
+ style=${styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:n,bottom:`${i}px`,right:`${i}px`,color:n})}
701
814
  title=${this.presence.status}>
702
815
  </div>
703
- `}renderBadge(){if(!this.badge)return nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,o=this.badge.icon!==void 0,a=e||o,{size:p,fontSize:l}=pt(this.pixelSize,a),u=this.badge.bgColor??"#22c55e",b=this.badge.color??"#ffffff",h=e&&this.badge.content!==void 0?lt(this.badge.content,this.badge.max):null,k=o?this.badge.icon:null,$=l*.9,E={"top-left":{top:"-4px",left:"-4px"},"top-right":{top:"-4px",right:"-4px"},"bottom-left":{bottom:"-4px",left:"-4px"},"bottom-right":{bottom:"-4px",right:"-4px"}};return html`
816
+ `}renderBadge(){if(!this.badge)return nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,n=this.badge.icon!==void 0,i=e||n,{size:p,fontSize:d}=mt(this.pixelSize,i),u=this.badge.bgColor??"#22c55e",f=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",v=e&&this.badge.content!==void 0?vt(this.badge.content,this.badge.max):null,y=n?this.badge.icon:null,T=d*.9,l=`${-Math.round(this.pixelSize*.06)}px`,m={"top-left":{top:l,left:l},"top-center":{top:l,left:"50%",transform:"translateX(-50%)"},"top-right":{top:l,right:l},"bottom-left":{bottom:l,left:l},"bottom-center":{bottom:l,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:l,right:l}};return html`
704
817
  <div
705
- class=${x("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
706
- style=${styleMap({width:a?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:a?"0 6px":"0",fontSize:`${l}px`,backgroundColor:u,color:b,"--pp-badge-glow-color":u,gap:o&&e?"4px":"0",...E[t]})}>
707
- ${k?html`<span class="pp-badge-icon" style=${styleMap({fontSize:`${$}px`})}>${k}</span>`:nothing}
708
- ${h??nothing}
818
+ class=${$("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",n&&"pp-badge-with-icon")}
819
+ style=${styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:u,color:f,borderRadius:h,"--pp-badge-glow-color":u,gap:n&&e?"4px":"0",...m[t]})}>
820
+ ${y?html`<span class="pp-badge-icon" style=${styleMap({fontSize:`${T}px`})}>${y}</span>`:nothing}
821
+ ${v??nothing}
709
822
  </div>
710
- `}renderRibbon(){if(!this.ribbon)return nothing;let t=this.ribbon.position??"top-right",e=this.ribbon.bgColor??"#ef4444",o=this.ribbon.color??"#ffffff",a=L(e)?{backgroundColor:e}:{background:e},p={color:o},l=this.pixelSize*.9,u=this.pixelSize*.4,b=Math.max(8,this.pixelSize*.11);return html`
823
+ `}renderRibbon(){if(!this.ribbon)return nothing;let t=this.ribbon.position??"top-right",e=this.ribbon.bgColor??"#ef4444",n=this.ribbon.color??"#ffffff",i=V(e)?{backgroundColor:e}:{background:e},p={color:n},d=Math.min(75,this.pixelSize*.9),u=Math.min(32,this.pixelSize*.4),f=Math.min(13,Math.max(8,this.pixelSize*.11));return html`
711
824
  <div
712
- class=${x("pp-ribbon-container",at(t))}
713
- style=${styleMap({width:`${l}px`,height:`${u}px`})}>
825
+ class=${$("pp-ribbon-container",bt(t))}
826
+ style=${styleMap({width:`${d}px`,height:`${u}px`})}>
714
827
  <div
715
- class=${x("pp-ribbon np:origin-center np:transform",st(t))}
716
- style=${styleMap({fontSize:`${b}px`,padding:`${b*.3}px 0`,...a,...p})}>
828
+ class=${$("pp-ribbon np:origin-center np:transform",ht(t))}
829
+ style=${styleMap({fontSize:`${f}px`,padding:`${f*.3}px 0`,...i,...p})}>
717
830
  ${this.ribbon.icon?html`<span style="margin-right: 2px">${this.ribbon.icon}</span>`:nothing}
718
831
  ${this.ribbon.text}
719
832
  </div>
@@ -733,7 +846,7 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
733
846
  <!-- Inner container for image clipping -->
734
847
  <div
735
848
  class="pp-inner"
736
- style=${styleMap({borderRadius:R[this.variant]})}>
849
+ style=${styleMap({borderRadius:H[this.variant]})}>
737
850
  <!-- Placeholder -->
738
851
  ${this.renderPlaceholder()}
739
852
 
@@ -750,10 +863,58 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
750
863
  <!-- Presence Indicator -->
751
864
  ${this.renderPresence()}
752
865
  </div>
753
- `}};i.stylesInjected=false,i.cdnBaseUrl="",i.instances=new Set,s([property({type:String})],i.prototype,"src",2),s([property({type:String})],i.prototype,"alt",2),s([property({type:String,attribute:"ext-customer-id"})],i.prototype,"extCustomerId",2),s([property({type:String})],i.prototype,"size",2),s([property({type:String})],i.prototype,"variant",2),s([property({type:String})],i.prototype,"shadow",2),s([property({type:Boolean})],i.prototype,"border",2),s([property({type:Number,attribute:"border-width"})],i.prototype,"borderWidth",2),s([property({type:String,attribute:"border-color"})],i.prototype,"borderColor",2),s([property({type:Number})],i.prototype,"rotation",2),s([property({type:String,attribute:"bg-color"})],i.prototype,"bgColor",2),s([property({type:String,attribute:"bg-gradient"})],i.prototype,"bgGradient",2),s([property({type:Object,attribute:"ring",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"ring",2),s([property({type:Object,attribute:"presence",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"presence",2),s([property({type:Object,attribute:"glow",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"glow",2),s([property({type:Object,attribute:"ribbon",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"ribbon",2),s([property({type:Object,attribute:"badge",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"badge",2),s([property({type:String})],i.prototype,"loading",2),s([property({type:String})],i.prototype,"placeholder",2),s([property({type:String,attribute:"placeholder-color"})],i.prototype,"placeholderColor",2),s([property({type:String})],i.prototype,"fallback",2),s([property({type:Object,attribute:"interactive",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"interactive",2),s([state()],i.prototype,"isLoaded",2),s([state()],i.prototype,"hasError",2),s([state()],i.prototype,"cdnImageUrl",2),s([state()],i.prototype,"cdnLoadFailed",2),i=s([customElement("profile-picture")],i);var It=false;function Wt(){if(It||typeof document>"u")return;let r=document.createElement("style");r.textContent=$t,document.head.appendChild(r),It=true;}var g=class extends LitElement{constructor(){super(...arguments);this.max=S.max;this.direction=S.direction;this.overlap=S.overlap;this.size=S.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=S.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.handleBackdropClick=()=>{this.dropdownOpen=false;};}createRenderRoot(){return Wt(),this}get pixelSize(){return ut(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??S.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??S.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="profile-picture"&&e.getAttribute("slot")!=="internal");this.users=t.map((e,o)=>{let a=e.getAttribute("border-width"),p=a?Number.parseInt(a,10):void 0;return {id:e.getAttribute("data-user-id")??void 0,name:e.getAttribute("alt")??`User ${o+1}`,src:e.getAttribute("src")??void 0,status:e.getAttribute("data-status")??void 0,element:e,index:o,variant:e.getAttribute("variant")??void 0,shadow:e.getAttribute("shadow")??void 0,border:e.hasAttribute("border"),borderWidth:p,borderColor:e.getAttribute("border-color")??void 0,bgColor:e.getAttribute("bg-color")??void 0,bgGradient:e.getAttribute("bg-gradient")??void 0}});for(let e of this.users)e.element&&(e.element.style.display="none");}handleAvatarClick(t){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarHover(t,e){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(t){this.dropdownOpen=!this.dropdownOpen,this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:t,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(t){this.dropdownOpen=false,this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:t},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(t,e){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e());}renderAvatar(t,e,o){let a=N(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=ft(e,o,this.direction),l=t.variant??"circle",u=t.shadow??"none",b=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return html`
866
+ `}};a.stylesInjected=false,a.cdnBaseUrl="",a.instances=new Set,s([property({type:String})],a.prototype,"src",2),s([property({type:String})],a.prototype,"alt",2),s([property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId",2),s([property({type:String})],a.prototype,"size",2),s([property({type:String})],a.prototype,"variant",2),s([property({type:String})],a.prototype,"shadow",2),s([property({type:Boolean})],a.prototype,"border",2),s([property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth",2),s([property({type:String,attribute:"border-color"})],a.prototype,"borderColor",2),s([property({type:Number})],a.prototype,"rotation",2),s([property({type:String,attribute:"bg-color"})],a.prototype,"bgColor",2),s([property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient",2),s([property({type:Object,attribute:"ring",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"ring",2),s([property({type:Object,attribute:"presence",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"presence",2),s([property({type:Object,attribute:"glow",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"glow",2),s([property({type:Object,attribute:"ribbon",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"ribbon",2),s([property({type:Object,attribute:"badge",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"badge",2),s([property({type:String})],a.prototype,"loading",2),s([property({type:String})],a.prototype,"placeholder",2),s([property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor",2),s([property({type:String})],a.prototype,"fallback",2),s([property({type:Object,attribute:"interactive",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"interactive",2),s([state()],a.prototype,"isLoaded",2),s([state()],a.prototype,"hasError",2),s([state()],a.prototype,"cdnImageUrl",2),s([state()],a.prototype,"cdnLoadFailed",2),a=s([customElement("profile-picture")],a);var Mt=false;function Qt(){if(Mt||typeof document>"u")return;let r=document.createElement("style");r.textContent=Lt,document.head.appendChild(r),Mt=true;}var b=class extends LitElement{constructor(){super(...arguments);this.max=z.max;this.direction=z.direction;this.overlap=z.overlap;this.size=z.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=z.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.portalContainer=null;this.counterRef=null;this.handleBackdropClick=()=>{this.dropdownOpen=false,this.destroyPortal();};}createRenderRoot(){return Qt(),this}get pixelSize(){return Ct(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??z.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??z.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout(),this.destroyPortal();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="profile-picture"&&e.getAttribute("slot")!=="internal");this.users=t.map((e,n)=>{let i=e.getAttribute("border-width"),p=i?Number.parseInt(i,10):void 0;return {id:e.getAttribute("data-user-id")??void 0,name:e.getAttribute("alt")??`User ${n+1}`,src:e.getAttribute("src")??void 0,status:e.getAttribute("data-status")??void 0,element:e,index:n,variant:e.getAttribute("variant")??void 0,shadow:e.getAttribute("shadow")??void 0,border:e.hasAttribute("border"),borderWidth:p,borderColor:e.getAttribute("border-color")??void 0,bgColor:e.getAttribute("bg-color")??void 0,bgGradient:e.getAttribute("bg-gradient")??void 0}});for(let e of this.users)e.element&&(e.element.style.display="none");}createPortal(){this.portalContainer||(this.portalContainer=document.createElement("div"),this.portalContainer.className="ppg-portal",this.portalContainer.style.cssText="position: fixed; z-index: 99999; pointer-events: none;",document.body.appendChild(this.portalContainer),document.body.style.overflow="hidden");}destroyPortal(){this.portalContainer&&(render(nothing,this.portalContainer),this.portalContainer.remove(),this.portalContainer=null,document.body.style.overflow="");}updatePortalContent(t){if(!(this.portalContainer&&this.counterRef))return;let e=this.counterRef.getBoundingClientRect(),n=10,i=280,p=Math.min(this.dropdownMaxHeight+60,t.length*56+60),d=window.innerWidth,u=window.innerHeight;if(d<480){let S=html`
867
+ <div
868
+ class="ppg-backdrop ppg-backdrop-visible"
869
+ style="pointer-events: auto; background: rgba(0,0,0,0.5);"
870
+ @click=${this.handleBackdropClick}
871
+ aria-hidden="true"
872
+ ></div>
873
+ <div
874
+ class="ppg-dropdown ppg-dropdown-modal"
875
+ style=${styleMap({position:"fixed",pointerEvents:"auto",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:"320px",maxHeight:"70vh"})}
876
+ data-position="modal"
877
+ role="menu"
878
+ aria-label="Hidden users"
879
+ >
880
+ <div class="ppg-dropdown-header">
881
+ ${t.length} more
882
+ </div>
883
+ <div
884
+ class="ppg-dropdown-list"
885
+ style=${styleMap({maxHeight:"calc(70vh - 60px)"})}
886
+ >
887
+ ${t.map(L=>this.renderDropdownItem(L))}
888
+ </div>
889
+ </div>
890
+ `;render(S,this.portalContainer);return}let h=u-e.bottom-n,v=e.top-n,y=d-e.left,T=e.right,l=this.dropdownPosition;l==="bottom"&&h<p&&v>h?l="top":l==="top"&&v<p&&h>v&&(l="bottom");let m;y>=i?m=e.left:T>=i?m=e.right-i:m=(d-i)/2,m=Math.max(8,Math.min(m,d-i-8));let M=l==="bottom"?e.bottom+n:void 0,U=l==="top"?u-e.top+n:void 0,P=html`
891
+ <div
892
+ class="ppg-backdrop"
893
+ style="pointer-events: auto;"
894
+ @click=${this.handleBackdropClick}
895
+ aria-hidden="true"
896
+ ></div>
897
+ <div
898
+ class="ppg-dropdown ppg-dropdown-portal"
899
+ style=${styleMap({position:"fixed",pointerEvents:"auto",top:M!==void 0?`${M}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${m}px`,width:`${i}px`})}
900
+ data-position=${l}
901
+ role="menu"
902
+ aria-label="Hidden users"
903
+ >
904
+ <div class="ppg-dropdown-header">
905
+ ${t.length} more
906
+ </div>
907
+ <div
908
+ class="ppg-dropdown-list"
909
+ style=${styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
910
+ >
911
+ ${t.map(S=>this.renderDropdownItem(S))}
912
+ </div>
913
+ </div>
914
+ `;render(P,this.portalContainer);}handleAvatarClick(t){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarHover(t,e){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let n=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:n.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(t){this.dropdownOpen=!this.dropdownOpen,this.dropdownOpen?(this.createPortal(),this.updatePortalContent(t)):this.destroyPortal(),this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:t,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(t){this.dropdownOpen=false,this.destroyPortal(),this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:t},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(t,e){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e());}renderAvatar(t,e,n){let i=Z(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=St(e,n,this.direction),d=t.variant??"circle",u=t.shadow??"none",f=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return html`
754
915
  <div
755
916
  class="ppg-avatar-wrapper"
756
- style=${styleMap({left:`${a}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
917
+ style=${styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
757
918
  tabindex="0"
758
919
  role="button"
759
920
  aria-label=${t.name}
@@ -762,16 +923,16 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
762
923
  @mouseleave=${this.handleAvatarLeave}
763
924
  @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(t))}
764
925
  >
765
- ${this.renderProfilePicture(t,l,u,b)}
926
+ ${this.renderProfilePicture(t,d,u,f)}
766
927
  </div>
767
- `}renderProfilePicture(t,e,o,a){return html`
928
+ `}renderProfilePicture(t,e,n,i){return html`
768
929
  <profile-picture
769
930
  .src=${t.src??""}
770
931
  .alt=${t.name}
771
932
  .size=${this.pixelSize}
772
933
  .variant=${e}
773
- .shadow=${o}
774
- .rotation=${a}
934
+ .shadow=${n}
935
+ .rotation=${i}
775
936
  ?border=${t.border}
776
937
  .borderWidth=${t.border?t.borderWidth??2:2}
777
938
  .borderColor=${t.border?t.borderColor??"#ffffff":"#ffffff"}
@@ -780,16 +941,16 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
780
941
  data-user-id=${t.id??""}
781
942
  data-status=${t.status??""}
782
943
  ></profile-picture>
783
- `}renderCounter(t,e){return html`
944
+ `}renderCounter(t,e,n){return html`
784
945
  <button
785
946
  class="ppg-counter"
786
947
  style=${styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
787
948
  aria-label=${`${t} more users`}
788
949
  aria-expanded=${this.dropdownOpen}
789
950
  aria-haspopup="true"
790
- @click=${()=>this.handleCounterClick(this.users.slice(-t))}
951
+ @click=${()=>this.handleCounterClick(n)}
791
952
  >
792
- ${mt(t)}
953
+ ${$t(t)}
793
954
  </button>
794
955
  `}renderAddButton(t){let e=Math.round(this.pixelSize*.4);return html`
795
956
  <button
@@ -813,44 +974,22 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
813
974
  <line x1="5" y1="12" x2="19" y2="12"></line>
814
975
  </svg>
815
976
  </button>
816
- `}renderTooltip(){if(!this.tooltipData)return nothing;let{user:t,rect:e}=this.tooltipData,o=8,a,p;return this.tooltipPosition==="bottom"?(a=e.bottom+o,p=e.left+e.width/2):(a=e.top-o,p=e.left+e.width/2),html`
977
+ `}renderTooltip(){if(!this.tooltipData)return nothing;let{user:t,rect:e}=this.tooltipData,n=8,i=this.getBoundingClientRect(),p=e.left-i.left+e.width/2,d=e.top-i.top,u=e.bottom-i.top,f=this.tooltipPosition==="top";return html`
817
978
  <div
818
979
  class="ppg-tooltip"
819
- style=${styleMap({top:this.tooltipPosition==="top"?"auto":`${a}px`,bottom:this.tooltipPosition==="top"?`${window.innerHeight-e.top+o}px`:"auto",left:`${p}px`,transform:"translateX(-50%)"})}
980
+ style=${styleMap({top:f?"auto":`${u+n}px`,bottom:f?`${i.height-d+n}px`:"auto",left:`${p}px`})}
820
981
  data-position=${this.tooltipPosition}
821
982
  role="tooltip"
822
983
  >
823
984
  ${t.name}
824
985
  </div>
825
- `}renderDropdown(t){return this.dropdownOpen?html`
826
- <div
827
- class="ppg-backdrop"
828
- @click=${this.handleBackdropClick}
829
- aria-hidden="true"
830
- ></div>
831
- <div
832
- class="ppg-dropdown"
833
- data-position=${this.dropdownPosition}
834
- role="menu"
835
- aria-label="Hidden users"
836
- >
837
- <div class="ppg-dropdown-header">
838
- ${t.length} more
839
- </div>
840
- <div
841
- class="ppg-dropdown-list"
842
- style=${styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
843
- >
844
- ${t.map(e=>this.renderDropdownItem(e))}
845
- </div>
846
- </div>
847
- `:nothing}renderDropdownItem(t){let e=F(t.name);return html`
986
+ `}renderDropdownItem(t){let e=X(t.name);return html`
848
987
  <div
849
988
  class="ppg-dropdown-item"
850
989
  role="menuitem"
851
990
  tabindex="0"
852
991
  @click=${()=>this.handleDropdownItemClick(t)}
853
- @keydown=${o=>this.handleKeyDown(o,()=>this.handleDropdownItemClick(t))}
992
+ @keydown=${n=>this.handleKeyDown(n,()=>this.handleDropdownItemClick(t))}
854
993
  >
855
994
  ${t.src?html`<img
856
995
  class="ppg-dropdown-avatar"
@@ -860,7 +999,7 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
860
999
  class="ppg-dropdown-avatar-fallback"
861
1000
  style=${styleMap({background:e})}
862
1001
  >
863
- ${O(t.name)}
1002
+ ${q(t.name)}
864
1003
  </div>`}
865
1004
  <div class="ppg-dropdown-info">
866
1005
  <div class="ppg-dropdown-name">${t.name}</div>
@@ -875,9 +1014,9 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
875
1014
  `:nothing}
876
1015
  </div>
877
1016
  </div>
878
- `}formatStatus(t){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[t]??t}render(){let{visible:t,hidden:e,showCounter:o}=bt(this.users.length,this.max,this.showAddButton),a=this.direction==="ltr"?this.users.slice(0,t):this.users.slice(0,t).reverse(),p=this.users.slice(t),l=t;o&&l++,this.showAddButton&&l++;let u=ht(l,this.pixelSize,this.overlap,this.spacing),b=o?N(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=N(t+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return html`
1017
+ `}formatStatus(t){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[t]??t}updated(t){super.updated(t);let e=this.querySelector(".ppg-counter");if(e&&(this.counterRef=e),this.dropdownOpen&&this.portalContainer){let{visible:n}=nt(this.users.length,this.max,this.showAddButton),i=this.users.slice(n);this.updatePortalContent(i);}}render(){let{visible:t,hidden:e,showCounter:n}=nt(this.users.length,this.max,this.showAddButton),i=this.direction==="ltr"?this.users.slice(0,t):this.users.slice(0,t).reverse(),p=this.users.slice(t),d=t;n&&d++,this.showAddButton&&d++;let u=kt(d,this.pixelSize,this.overlap,this.spacing),f=n?Z(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=Z(t+(n?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return html`
879
1018
  <div
880
- class=${x("ppg-container",this.animated&&"ppg-animated")}
1019
+ class=${$("ppg-container",this.animated&&"ppg-animated")}
881
1020
  style=${styleMap({width:`${u}px`,height:`${this.pixelSize}px`})}
882
1021
  role="group"
883
1022
  aria-label="User avatars"
@@ -886,19 +1025,16 @@ ${Ft}`;var i=class extends LitElement{constructor(){super(...arguments);this.src
886
1025
  <slot style="display: none;"></slot>
887
1026
 
888
1027
  <!-- Visible avatars -->
889
- ${a.map((k,$)=>this.renderAvatar(k,$,t))}
1028
+ ${i.map((v,y)=>this.renderAvatar(v,y,t))}
890
1029
 
891
1030
  <!-- Counter -->
892
- ${o?this.renderCounter(e,b):nothing}
1031
+ ${n?this.renderCounter(e,f,p):nothing}
893
1032
 
894
1033
  <!-- Add button -->
895
1034
  ${this.showAddButton?this.renderAddButton(h):nothing}
896
1035
 
897
1036
  <!-- Tooltip -->
898
1037
  ${this.renderTooltip()}
899
-
900
- <!-- Dropdown -->
901
- ${o?this.renderDropdown(p):nothing}
902
1038
  </div>
903
- `}};s([property({type:Number})],g.prototype,"max",2),s([property({type:String})],g.prototype,"direction",2),s([property({type:Number})],g.prototype,"overlap",2),s([property({type:String})],g.prototype,"size",2),s([property({type:Number})],g.prototype,"spacing",2),s([property({type:Object})],g.prototype,"tooltip",2),s([property({type:Object})],g.prototype,"dropdown",2),s([property({type:Boolean,attribute:"show-add-button"})],g.prototype,"showAddButton",2),s([property({type:String,attribute:"add-button-label"})],g.prototype,"addButtonLabel",2),s([property({type:Boolean})],g.prototype,"animated",2),s([property({type:Number,attribute:"rotation-amount"})],g.prototype,"rotationAmount",2),s([state()],g.prototype,"users",2),s([state()],g.prototype,"dropdownOpen",2),s([state()],g.prototype,"tooltipData",2),g=s([customElement("profile-picture-group")],g);var et=zt.forwardRef(({max:r,direction:n,overlap:t,size:e,spacing:o,tooltip:a,dropdown:p,showAddButton:l,addButtonLabel:u,animated:b,onAvatarClick:h,onAvatarHover:k,onCounterClick:$,onDropdownItemClick:E,onAddClick:G,className:H,style:V,children:W},I)=>{let A=useRef(null),Y=useCallback(c=>{h?.(c.detail.user);},[h]),J=useCallback(c=>{k?.(c.detail.user);},[k]),K=useCallback(c=>{let U=c;$?.(U.detail.hiddenUsers,U.detail.open);},[$]),q=useCallback(c=>{E?.(c.detail.user);},[E]),Z=useCallback(()=>{G?.();},[G]);return useEffect(()=>{let c=A.current;if(c)return c.addEventListener("avatar-click",Y),c.addEventListener("avatar-hover",J),c.addEventListener("counter-click",K),c.addEventListener("dropdown-item-click",q),c.addEventListener("add-click",Z),()=>{c.removeEventListener("avatar-click",Y),c.removeEventListener("avatar-hover",J),c.removeEventListener("counter-click",K),c.removeEventListener("dropdown-item-click",q),c.removeEventListener("add-click",Z);}},[Y,J,K,q,Z]),useEffect(()=>{typeof I=="function"?I(A.current):I&&(I.current=A.current);},[I]),zt.createElement("profile-picture-group",{ref:A,max:r,direction:n,overlap:t,size:e,spacing:o,tooltip:a,dropdown:p,"show-add-button":l||void 0,"add-button-label":u,animated:b,class:H,style:V},W)});et.displayName="ProfilePictureGroup";var Dt=zt.forwardRef(({src:r,alt:n,size:t,variant:e,border:o,borderWidth:a,borderColor:p,bgColor:l,bgGradient:u,ribbon:b,badge:h,loading:k,placeholder:$,placeholderColor:E,fallback:G,onLoad:H,onError:V,className:W,style:I},A)=>zt.createElement("profile-picture",{ref:A,src:r,alt:n,size:t,variant:e,border:o,"border-width":a,"border-color":p,"bg-color":l,"bg-gradient":u,ribbon:b,badge:h,loading:k,placeholder:$,"placeholder-color":E,fallback:G,onLoad:H,onError:V,className:W,style:I}));Dt.displayName="ProfilePicture";nt();export{Dt as ProfilePicture,et as ProfilePictureGroup,_ as constructCdnUrl,P as detectThemeFromColor,Q as getCdnSizeLabel};//# sourceMappingURL=index.js.map
1039
+ `}};s([property({type:Number})],b.prototype,"max",2),s([property({type:String})],b.prototype,"direction",2),s([property({type:Number})],b.prototype,"overlap",2),s([property({type:String})],b.prototype,"size",2),s([property({type:Number})],b.prototype,"spacing",2),s([property({type:Object})],b.prototype,"tooltip",2),s([property({type:Object})],b.prototype,"dropdown",2),s([property({type:Boolean,attribute:"show-add-button"})],b.prototype,"showAddButton",2),s([property({type:String,attribute:"add-button-label"})],b.prototype,"addButtonLabel",2),s([property({type:Boolean})],b.prototype,"animated",2),s([property({type:Number,attribute:"rotation-amount"})],b.prototype,"rotationAmount",2),s([state()],b.prototype,"users",2),s([state()],b.prototype,"dropdownOpen",2),s([state()],b.prototype,"tooltipData",2),b=s([customElement("profile-picture-group")],b);var dt=Ut.forwardRef(({max:r,direction:o,overlap:t,size:e,spacing:n,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:u,animated:f,rotationAmount:h,onAvatarClick:v,onAvatarHover:y,onCounterClick:T,onDropdownItemClick:l,onAddClick:m,className:M,style:U,children:P},S)=>{let L=useRef(null),B=useCallback(g=>{v?.(g.detail.user);},[v]),O=useCallback(g=>{y?.(g.detail.user);},[y]),G=useCallback(g=>{let k=g;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),F=useCallback(g=>{l?.(g.detail.user);},[l]),j=useCallback(()=>{m?.();},[m]);return useEffect(()=>{let g=L.current;if(g)return g.addEventListener("avatar-click",B),g.addEventListener("avatar-hover",O),g.addEventListener("counter-click",G),g.addEventListener("dropdown-item-click",F),g.addEventListener("add-click",j),()=>{g.removeEventListener("avatar-click",B),g.removeEventListener("avatar-hover",O),g.removeEventListener("counter-click",G),g.removeEventListener("dropdown-item-click",F),g.removeEventListener("add-click",j);}},[B,O,G,F,j]),useEffect(()=>{typeof S=="function"?S(L.current):S&&(S.current=L.current);},[S]),Ut.createElement("profile-picture-group",{ref:L,max:r,direction:o,overlap:t,size:e,spacing:n,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":d||void 0,"add-button-label":u,animated:f,"rotation-amount":h,class:M,style:U},P)});dt.displayName="ProfilePictureGroup";function Gt({src:r,alt:o,extCustomerId:t,size:e,variant:n,shadow:i,border:p,borderWidth:d,borderColor:u,rotation:f,bgColor:h,bgGradient:v,glow:y,ring:T,presence:l,ribbon:m,badge:M,loading:U,placeholder:P,placeholderColor:S,fallback:L,interactive:B,onLoad:O,onError:G,onCdnError:F,className:j,style:g,ref:k}){let Y=useRef(null),_=useCallback(()=>{O?.();},[O]),tt=useCallback(()=>{G?.();},[G]),et=useCallback(D=>{F?.(D.detail);},[F]);return useEffect(()=>{let D=Y.current;if(D)return D.addEventListener("load",_),D.addEventListener("error",tt),D.addEventListener("cdn-error",et),()=>{D.removeEventListener("load",_),D.removeEventListener("error",tt),D.removeEventListener("cdn-error",et);}},[_,tt,et]),useEffect(()=>{typeof k=="function"?k(Y.current):k&&(k.current=Y.current);},[k]),Ut.createElement("profile-picture",{ref:Y,src:r,alt:o,"ext-customer-id":t,size:e,variant:n,shadow:i,border:p||void 0,"border-width":d,"border-color":u,rotation:f,"bg-color":h,"bg-gradient":v,glow:y?JSON.stringify(y):void 0,ring:T?JSON.stringify(T):void 0,presence:l?JSON.stringify(l):void 0,ribbon:m?JSON.stringify(m):void 0,badge:M?JSON.stringify(M):void 0,loading:U,placeholder:P,"placeholder-color":S,fallback:L,interactive:B?JSON.stringify(B):void 0,class:j,style:g})}Gt.displayName="ProfilePicture";gt();export{Gt as ProfilePicture,dt as ProfilePictureGroup,at as constructCdnUrl,it as detectThemeFromColor,ot as getCdnSizeLabel};//# sourceMappingURL=index.js.map
904
1040
  //# sourceMappingURL=index.js.map