UNPKG

@kit-data-manager/pid-component

Version:

The PID-Component is a web component that can be used to evaluate and display FAIR Digital Objects, PIDs, ORCiDs, and possibly other identifiers in a user-friendly way. It is easily extensible to support other identifier types.

18 lines 53.2 kB
/*! * * Copyright 2024 Karlsruhe Institute of Technology. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import{r as t,h as e,H as i,a as o,c as r}from"./p-DzUQJMIf.js";const s=class{constructor(e){t(this,e);this.copied=false;this.copyValue=async t=>{t.stopPropagation();t.preventDefault();try{if("clipboard"in navigator){try{await navigator.clipboard.writeText(this.value);this.showSuccess();return}catch(t){}}const t=document.createElement("textarea");t.value=this.value;t.setAttribute("aria-hidden","true");t.setAttribute("tabindex","-1");t.setAttribute("readonly","readonly");t.className="fixed top-0 left-0 opacity-0 pointer-events-none z-[9999] w-[10em] h-[10em]";document.body.appendChild(t);setTimeout((()=>{t.focus();t.select();try{const e=document.execCommand("copy");if(e){this.showSuccess()}else{const e=document.createRange();e.selectNodeContents(t);const i=window.getSelection();if(i){i.removeAllRanges();i.addRange(e);t.setSelectionRange(0,t.value.length);const o=document.execCommand("copy");if(o){this.showSuccess()}}}}catch(t){}finally{document.body.removeChild(t)}}),200)}catch(t){console.error("Failed to copy text: ",t)}}}showSuccess(){this.copied=true;setTimeout((()=>{this.copied=false}),1500)}getAriaLabel(){const t=this.label||"content";return this.copied?`${t} copied to clipboard`:`Copy ${t} to clipboard`}render(){const t=this.copied?"✓ Copied!":"Copy";const o=this.getAriaLabel();const r=this.el.closest("pid-component");const s=r===null||r===void 0?void 0:r.classList.contains("bg-gray-800");return e(i,{key:"30c4993a4b0dd5bb0453f1e4564b95a6dc1fbe76",class:"inline-block align-baseline text-xs"},this.copied&&e("span",{key:"0e86f99522d6a10f954e0dc898fb1f438766dabc",class:"sr-only","aria-live":"assertive"},"Content copied to clipboard"),e("button",{key:"5fce7616e8ce231f5471674dc188287aa86559df",class:`${this.copied?s?"bg-green-700":"bg-green-200":s?"bg-gray-700 hover:bg-gray-600":"bg-white hover:bg-blue-200"} relative z-30 max-h-min flex-none items-center rounded-md border ${s?"border-gray-600 text-gray-200 hover:text-white":"border-slate-500 text-slate-800 hover:text-slate-900"} px-2 py-0.5 font-mono font-medium transition-colors duration-200 focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 focus:outline-none`,onClick:t=>this.copyValue(t),"aria-label":o,title:o,type:"button"},t))}get el(){return o(this)}};const a=class{constructor(e){t(this,e);this.actions=[];this.darkMode="system"}render(){if(this.actions.length===0){return null}const t=this.darkMode==="dark"||this.darkMode==="system"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;const i=this.actionsId||`actions-${Math.random().toString(36).substring(2,11)}`;return e("div",{id:i,class:`actions-container sticky right-0 bottom-0 left-0 z-20 mt-auto w-full border-t ${t?"border-gray-700 bg-gray-800":"border-gray-200 bg-white"} p-1`,role:"toolbar","aria-label":"Available actions"},e("span",{id:`${i}-desc`,class:"sr-only"},"The following links open related resources in new tabs"),e("div",{class:"flex flex-wrap justify-between gap-1","aria-describedby":`${i}-desc`},this.actions.map(((i,o)=>{const r="p-1 font-semibold text-sm rounded border transition-colors duration-200";const s="focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-blue-500";let a;if(t){switch(i.style){case"primary":a="bg-blue-700 text-white hover:bg-blue-600 border-blue-600";break;case"secondary":a="bg-slate-700 text-blue-300 hover:bg-slate-600 border-slate-600";break;case"danger":a="bg-red-700 text-white hover:bg-red-600 border-red-600";break;default:a="bg-gray-700 text-gray-200 hover:bg-gray-600 border-gray-600"}}else{switch(i.style){case"primary":a="bg-blue-500 text-white hover:bg-blue-600 border-blue-400";break;case"secondary":a="bg-slate-200 text-blue-500 hover:bg-slate-300 border-slate-300";break;case"danger":a="bg-red-500 text-white hover:bg-red-600 border-red-400";break;default:a="bg-gray-200 text-gray-700 hover:bg-gray-300 border-gray-300"}}return e("a",{key:`action-${i.title}-${o}`,href:i.link,class:`${r} ${a} ${s}`,rel:"noopener noreferrer",target:"_blank","aria-label":`${i.title} (opens in new tab)`,title:`${i.title} - Opens in a new tab`},e("span",null,i.title),e("span",{class:"sr-only"},"(opens in new tab)"))}))))}};const n='/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-yellow-50:oklch(98.7% .026 102.212);--color-green-50:oklch(98.2% .018 155.826);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-50:oklch(97.7% .014 308.299);--color-slate-400:oklch(70.4% .04 256.788);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:1.33333;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-lg:1.125rem;--text-lg--line-height:1.55556;--font-weight-medium:500;--font-weight-bold:700;--leading-normal:1.5;--radius-md:.375rem;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);tab-size:4;-webkit-tap-highlight-color:transparent;line-height:1.5}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:currentColor;color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.right-0{right:calc(var(--spacing)*0)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-50{z-index:50}.float-left{float:left}.container{width:100%}.mx-2{margin-inline:calc(var(--spacing)*2)}.my-0{margin-block:calc(var(--spacing)*0)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[3rem\\]{min-height:3rem}.w-3\\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-auto{width:auto}.w-full{width:100%}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*4*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*4*var(--tw-space-y-reverse))}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-blue-200{border-color:var(--color-blue-200)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-50{background-color:var(--color-green-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.p-0{padding:calc(var(--spacing)*0)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-8{padding:calc(var(--spacing)*8)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pl-5{padding-left:calc(var(--spacing)*5)}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-gray-300{color:var(--color-gray-300)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-slate-400{color:var(--color-slate-400)}.text-white{color:var(--color-white)}.opacity-60{opacity:.6}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all,.transition-transform{transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}.group-open\\:rotate-180:is(:where(.group):is([open],:popover-open,:open) *){rotate:180deg}.marker\\:hidden ::marker{display:none}.marker\\:hidden::marker{display:none}.marker\\:hidden ::-webkit-details-marker,.marker\\:hidden::-webkit-details-marker{display:none}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-400:focus-visible{--tw-ring-color:var(--color-blue-400)}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.\\[\\&\\:\\:-webkit-details-marker\\]\\:hidden::-webkit-details-marker{display:none}} /*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer base{}@layer components;details summary::-webkit-details-marker{display:none}pid-collapsible{clear:both;display:block}pid-collapsible.resize-both{max-width:100%!important;overflow:auto!important;resize:both!important;transition:none!important;will-change:width,height}pid-collapsible.resize-both:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' fill=\'none\' viewBox=\'0 0 24 24\'%3E%3Cpath stroke=\'currentColor\' stroke-linecap=\'round\' stroke-width=\'2\' d=\'M22 2 2 22M22 8 8 22m14-8-8 8\'/%3E%3C/svg%3E");background-position:100% 100%;background-repeat:no-repeat;bottom:0;content:"";cursor:nwse-resize;height:15px;pointer-events:none;position:absolute;right:0;width:15px;z-index:10}@supports ((-webkit-appearance:none)) and (not (display:-webkit-box)){pid-collapsible.resize-both{display:block!important;overflow:auto!important;position:relative!important;resize:both!important}pid-collapsible.resize-both:before{content:"";display:block;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:-1}}@supports ((-webkit-appearance:none)){pid-collapsible details{display:flex!important;flex-direction:column!important;min-height:100%}}:root{--z-back:-1;--z-resize:10;--z-content:20;--z-footer:30;--z-header:50}:host{--initial-width:500px;--initial-height:300px;--min-width:300px;--min-height:200px;display:block}pid-collapsible summary:focus-visible{outline:2px solid #0ea5e9;outline-offset:2px}pid-collapsible .overflow-visible,pid-pagination .overflow-visible{overflow:visible!important}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}@media not all and (min-resolution:.001dpcm){@supports ((-webkit-appearance:none)){pid-collapsible details summary{display:block!important}pid-collapsible.resize-both{overflow:auto!important;position:relative!important;-webkit-resize:both!important;resize:both!important}pid-collapsible.resize-both:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' fill=\'none\' viewBox=\'0 0 24 24\'%3E%3Cpath stroke=\'currentColor\' stroke-linecap=\'round\' stroke-width=\'2\' d=\'M22 2 2 22M22 8 8 22m14-8-8 8\'/%3E%3C/svg%3E");background-position:100% 100%;background-repeat:no-repeat;bottom:0;content:"";cursor:nwse-resize;height:15px;pointer-events:none;position:absolute;right:0;width:15px;z-index:10}}}@media (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm){pid-collapsible{display:inline-block;margin-bottom:1px;transform:translateZ(0);vertical-align:top}pid-collapsible.resizing{contain:layout size;pointer-events:none}pid-collapsible:not(.resize-both):after{clear:both;content:"";display:block;height:0;visibility:hidden}pid-collapsible.resize-both{-webkit-resize:both!important}pid-collapsible.resize-both:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' fill=\'none\' viewBox=\'0 0 24 24\'%3E%3Cpath stroke=\'currentColor\' stroke-linecap=\'round\' stroke-width=\'2\' d=\'M22 2 2 22M22 8 8 22m14-8-8 8\'/%3E%3C/svg%3E");background-position:100% 100%;background-repeat:no-repeat;bottom:0;content:"";cursor:nwse-resize;height:15px;pointer-events:none;position:absolute;right:0;width:15px;z-index:10}}@media (max-width:768px){:host{--initial-width:400px;--min-width:250px}}@media (max-width:480px){:host{--initial-width:300px;--min-width:200px}}@media (prefers-contrast:more){pid-collapsible summary{border:1px solid}pid-collapsible.resize-both:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'16\' height=\'16\' fill=\'none\' viewBox=\'0 0 24 24\'%3E%3Cpath stroke=\'currentColor\' stroke-linecap=\'round\' stroke-width=\'3\' d=\'M22 2 2 22M22 8 8 22m14-8-8 8\'/%3E%3C/svg%3E");opacity:.9}}@media print{pid-collapsible.resize-both{resize:none!important}pid-collapsible.resize-both:after{display:none!important}}';const l={DEFAULT_HEIGHT:"300px",MIN_WIDTH:300,MIN_HEIGHT:200,PADDING_WIDTH:40,PADDING_HEIGHT:60,FOOTER_HEIGHT:60};const c={RESIZE_HANDLE:10,FOOTER_CONTENT:30,STICKY_ELEMENTS:50};const h=`\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M22 2L2 22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>\n <path d="M22 8L8 22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>\n <path d="M22 14L14 22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>\n </svg>\n`;const d=class{constructor(e){t(this,e);this.collapsibleToggle=r(this,"collapsibleToggle");this.contentHeightChange=r(this,"contentHeightChange");this.open=false;this.emphasize=false;this.darkMode="system";this.lineHeight=24;this.showFooter=false;this.isDarkMode=false;this.isToggling=false;this.resizeDebounceTimer=null;this.lastResizeDimensions={width:0,height:0};this.handleDarkModeChange=()=>{this.updateDarkMode()};this.handlePageChange=t=>{console.debug("Page changed to:",t.detail);this.recalculateContentDimensions()};this.handleSafariCompatibility=t=>{if(!this.isSafari()||this.isToggling)return;this.isToggling=true;t.preventDefault();t.stopPropagation();this.toggleCollapsible(t);setTimeout((()=>{this.isToggling=false}),100)};this.handleToggle=t=>{if(this.isToggling)return;this.toggleCollapsible(t)}}watchOpen(){this.updateAppearance();if(this.open)this.recalculateContentDimensions()}watchDarkMode(){this.updateDarkMode()}componentWillLoad(){this.currentWidth=this.initialWidth||"75%";this.currentHeight=this.initialHeight||l.DEFAULT_HEIGHT;this.initializeDarkMode()}componentDidLoad(){this.setupResizeObserver();this.updateAppearance();this.addBrowserCompatibilityListeners();this.addComponentEventListeners();if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){this.el.style.display="inline-block";this.el.style.verticalAlign="top";const t=document.createElement("div");t.style.clear="both";t.style.display="block";t.style.height="0";t.style.visibility="hidden";t.classList.add("pid-collapsible-clearfix");if(this.el.parentNode){this.el.parentNode.insertBefore(t,this.el.nextSibling)}}}disconnectedCallback(){this.cleanupResources();if(this.el.parentNode){const t=this.el.nextSibling;if(t instanceof HTMLElement&&t.classList.contains("pid-collapsible-clearfix")){this.el.parentNode.removeChild(t)}}this.cleanupDarkModeListener()}initializeDarkMode(){if(window.matchMedia){this.darkModeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)");this.updateDarkMode();if(this.darkModeMediaQuery.addEventListener){this.darkModeMediaQuery.addEventListener("change",this.handleDarkModeChange)}else if(this.darkModeMediaQuery.addListener){this.darkModeMediaQuery.addListener(this.handleDarkModeChange)}}else{this.isDarkMode=this.darkMode==="dark"}}updateDarkMode(){if(this.darkMode==="dark"){this.isDarkMode=true}else if(this.darkMode==="light"){this.isDarkMode=false}else if(this.darkMode==="system"&&this.darkModeMediaQuery){this.isDarkMode=this.darkModeMediaQuery.matches}}cleanupDarkModeListener(){if(this.darkModeMediaQuery){if(this.darkModeMediaQuery.removeEventListener){this.darkModeMediaQuery.removeEventListener("change",this.handleDarkModeChange)}else if(this.darkModeMediaQuery.removeListener){this.darkModeMediaQuery.removeListener(this.handleDarkModeChange)}}}async recalculateContentDimensions(){if(this.open){this.el.classList.add("resizing");if(this.resizeDebounceTimer!==null){window.cancelAnimationFrame(this.resizeDebounceTimer)}return new Promise((t=>{this.resizeDebounceTimer=window.requestAnimationFrame((()=>{const e=this.calculateContentDimensions();requestAnimationFrame((()=>{const i=Math.max(e.maxWidth,e.contentWidth+l.PADDING_WIDTH);const o=Math.max(e.maxHeight,e.contentHeight+l.PADDING_HEIGHT+(this.showFooter?l.FOOTER_HEIGHT:0));this.el.style.maxWidth=`${i}px`;this.el.style.maxHeight=`${o}px`;const r=e.contentWidth+l.PADDING_WIDTH;const s=e.contentHeight+l.PADDING_HEIGHT+(this.showFooter?l.FOOTER_HEIGHT:0);if(!this.currentWidth||this.currentWidth==="auto"){this.currentWidth=this.initialWidth||"75%"}else if(!this.initialWidth){this.currentWidth="75%"}else{this.currentWidth=`${Math.max(r,e.contentWidth*1)}px`}if(!this.currentHeight||this.currentHeight===`${this.lineHeight}px`){this.currentHeight=this.initialHeight||`${s}px`}else{this.currentHeight=`${s}px`}this.el.style.width=this.currentWidth;this.el.style.height=this.currentHeight;this.lastExpandedWidth=this.currentWidth;this.lastExpandedHeight=this.currentHeight;this.contentHeightChange.emit({maxHeight:o});this.el.classList.remove("resizing");this.resizeDebounceTimer=null;t(e)}))}))}))}return null}setupResizeObserver(){if(!window.ResizeObserver){console.warn("ResizeObserver not supported in this browser");return}if(this.resizeObserver){this.resizeObserver.disconnect()}this.resizeObserver=new ResizeObserver((t=>{if(!this.open)return;const e=t[0];if(!e)return;const i=e.contentRect.width;const o=e.contentRect.height;if(Math.abs(i-this.lastResizeDimensions.width)<2&&Math.abs(o-this.lastResizeDimensions.height)<2){return}this.lastResizeDimensions={width:i,height:o};if(this.resizeDebounceTimer!==null){window.cancelAnimationFrame(this.resizeDebounceTimer)}this.resizeDebounceTimer=window.requestAnimationFrame((()=>{this.currentWidth=`${i}px`;this.currentHeight=`${o}px`;this.resizeDebounceTimer=null}))}));if(this.open){this.resizeObserver.observe(this.el)}}addBrowserCompatibilityListeners(){const t=this.el.querySelector("details");if(!t)return;const e=t.querySelector("summary");if(!e)return;e.addEventListener("click",this.handleSafariCompatibility,{capture:true})}isSafari(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/CriOS|FxiOS|EdgiOS/i.test(navigator.userAgent)}addComponentEventListeners(){const t=this.el.querySelectorAll("pid-data-table");t.forEach((t=>{t.addEventListener("pageChange",this.handlePageChange)}))}removeComponentEventListeners(){const t=this.el.querySelectorAll("pid-data-table");t.forEach((t=>{t.removeEventListener("pageChange",this.handlePageChange)}))}cleanupResources(){if(this.resizeDebounceTimer!==null){window.cancelAnimationFrame(this.resizeDebounceTimer);this.resizeDebounceTimer=null}if(this.resizeObserver){this.resizeObserver.disconnect();this.resizeObserver=null}this.removeComponentEventListeners();const t=this.el.querySelector("details");if(t){const e=t.querySelector("summary");if(e){e.removeEventListener("click",this.handleSafariCompatibility,{capture:true})}}}updateAppearance(){this.resetStyles();if(this.open){this.applyExpandedStyles()}else{this.applyCollapsedStyles()}}resetStyles(){const t=["resize-both","overflow-auto","w-auto","inline-block","align-middle","overflow-hidden","py-0","my-0","float-left","bg-white"];t.forEach((t=>{if(this.el.classList.contains(t)){this.el.classList.remove(t)}}));this.el.style.width="";this.el.style.height="";this.el.style.maxWidth="";this.el.style.maxHeight="";this.el.style.resize="";this.el.style.lineHeight=""}applyExpandedStyles(){try{this.el.classList.add("resize-both","overflow-auto","bg-white","relative","block");const t=this.calculateContentDimensions();this.el.style.maxWidth=`${t.maxWidth}px`;this.el.style.maxHeight=`${t.maxHeight}px`;this.updateDimensions(t);const e=this.el.querySelector("summary");if(e){e.style.height=`${this.lineHeight}px`;e.style.minHeight=`${this.lineHeight}px`;e.style.maxHeight=`${this.lineHeight}px`}this.el.style.resize="both";this.addResizeIndicator();if(this.resizeObserver){this.resizeObserver.observe(this.el)}}catch(t){console.error("Failed to apply expanded styles:",t)}}calculateContentDimensions(){const t=this.el.querySelector(".flex-grow");const e=(t===null||t===void 0?void 0:t.scrollWidth)||l.MIN_WIDTH;const i=(t===null||t===void 0?void 0:t.scrollHeight)||l.MIN_HEIGHT;const o=this.showFooter?l.FOOTER_HEIGHT:0;const r=e+l.PADDING_WIDTH;const s=i+l.PADDING_HEIGHT+o;return{contentWidth:e,contentHeight:i,maxWidth:r,maxHeight:s}}updateDimensions(t){this.el.classList.add("resizing");const{contentWidth:e,contentHeight:i,maxWidth:o,maxHeight:r}=t;const s=Math.min(Math.max(e+l.PADDING_WIDTH,l.MIN_WIDTH),o);this.currentWidth=`${s}px`;const a=this.showFooter?l.FOOTER_HEIGHT:0;const n=Math.min(Math.max(i+l.PADDING_HEIGHT+a,l.MIN_HEIGHT),r);this.currentHeight=`${n}px`;this.lastExpandedWidth=this.currentWidth;this.lastExpandedHeight=this.currentHeight;requestAnimationFrame((()=>{this.el.style.width=this.currentWidth;this.el.style.height=this.currentHeight;this.el.classList.remove("resizing")}))}applyCollapsedStyles(){if(this.el.style.width&&this.el.style.width!=="auto"){this.lastExpandedWidth=this.el.style.width;this.currentWidth=this.el.style.width}if(this.el.style.height&&this.el.style.height!==`${this.lineHeight}px`){this.lastExpandedHeight=this.el.style.height;this.currentHeight=this.el.style.height}if(this.lastExpandedWidth||this.lastExpandedHeight){console.debug("Storing dimensions for later restoration:",{width:this.lastExpandedWidth,height:this.lastExpandedHeight})}this.el.style.maxWidth="";this.el.style.maxHeight="";this.el.style.width="auto";this.el.classList.add("w-auto","inline-block","align-middle","overflow-hidden","py-0","my-0");this.el.style.height=`${this.lineHeight}px`;this.el.style.lineHeight=`${this.lineHeight}px`;this.el.style.minHeight=`${this.lineHeight}px`;this.el.style.maxHeight=`${this.lineHeight}px`;if(this.isSafari()){this.el.style.marginBottom="1px";this.el.style.verticalAlign="top"}this.el.style.resize="none";this.removeResizeIndicator();if(this.resizeObserver){this.resizeObserver.unobserve(this.el)}}addResizeIndicator(){try{this.removeResizeIndicator();const t=document.createElement("div");t.className=`absolute bottom-0 right-0 w-4 h-4 opacity-60 pointer-events-none resize-indicator cursor-nwse-resize text-slate-400 z-${c.RESIZE_HANDLE}`;t.innerHTML=h;t.setAttribute("aria-hidden","true");this.el.appendChild(t)}catch(t){console.error("Failed to add resize indicator:",t)}}removeResizeIndicator(){const t=this.el.querySelector(".resize-indicator");if(t){t.remove()}}toggleCollapsible(t){this.isToggling=true;t.stopPropagation();t.preventDefault();if(t.cancelable){t.stopImmediatePropagation()}const e=this.el.querySelector("details");if(!e){this.isToggling=false;return}this.open=!this.open;e.open=this.open;this.collapsibleToggle.emit(this.open);this.updateAppearance();if(this.open&&this.isSafari()){setTimeout((()=>{this.recalculateContentDimensions()}),50)}setTimeout((()=>{e.open=this.open;setTimeout((()=>{this.isToggling=false}),100)}),0)}getHostClasses(){const t=["relative","mx-2","font-sans","transition-all","duration-200","ease-in-out","box-border","leading-normal"];t.push("w-3/4");if(this.emphasize){if(this.isDarkMode){t.push("border","border-gray-600","rounded-md","shadow-sm")}else{t.push("border","border-gray-300","rounded-md","shadow-sm")}}if(this.open){t.push("mb-2","max-w-full","text-xs","block")}else{t.push("my-0","text-sm","float-left")}if(this.isDarkMode){t.push("text-white")}return t.join(" ")}getDetailsClasses(){const t=["group","w-full","font-sans","transition-all","duration-200","ease-in-out","flex","flex-col"];if(this.open){t.push("h-full","overflow-visible")}else{t.push("text-clip","overflow-hidden")}if(this.isDarkMode){t.push("bg-gray-800","text-white")}return t.join(" ")}getSummaryClasses(){const t=["font-bold","font-mono","cursor-pointer","list-none","flex","items-center","focus:outline-none","focus-visible:ring-2","focus-visible:ring-blue-400","focus-visible:ring-offset-1","rounded-lg","marker:hidden","[&::-webkit-details-marker]:hidden","select-none","box-border"];if(this.open){if(this.isDarkMode){t.push("sticky","top-0","bg-gray-800",`z-${c.STICKY_ELEMENTS}`,"border-b","border-gray-700","px-2","py-0","overflow-visible","backdrop-blur-sm")}else{t.push("sticky","top-0","bg-white",`z-${c.STICKY_ELEMENTS}`,"border-b","border-gray-100","px-2","py-0","overflow-visible","backdrop-blur-sm")}}else{t.push("px-1","py-0","whitespace-nowrap","overflow-hidden","text-ellipsis","max-w-full")}t.push(`h-[${this.lineHeight}px]`);return t.join(" ")}getContentClasses(){const t=["flex-grow","flex","flex-col","min-h-0"];if(this.open){t.push("overflow-auto","p-2")}else{t.push("overflow-hidden","p-0")}if(this.isDarkMode){t.push("bg-gray-800","text-white")}return t.join(" ")}getFooterClasses(){const t=["flex","flex-col","w-full","mt-auto","sticky","bottom-0","left-0","right-0","border-t",`z-${c.FOOTER_CONTENT}`,"backdrop-blur-sm"];if(this.isDarkMode){t.push("bg-gray-800","border-gray-700")}else{t.push("bg-white","border-gray-200")}return t.join(" ")}getFooterActionsClasses(){const t=["flex","items-center","justify-between","gap-2","p-2","min-h-[3rem]","flex-shrink-0"];if(this.isDarkMode){t.push("bg-gray-800")}else{t.push("bg-white")}return t.join(" ")}render(){const t=this.getHostClasses();const o=this.getDetailsClasses();const r=this.getSummaryClasses();const s=this.getContentClasses();const a=this.getFooterClasses();const n=this.getFooterActionsClasses();return e(i,{key:"d80da3a2a4b680852fb94d687b67a3eb11ba6bfe",class:t},e("details",{key:"b486f35478ff6abb10a3442cd556b787181acd88",class:o,open:this.open,onToggle:this.handleToggle,onClick:t=>{t.stopPropagation();t.stopImmediatePropagation()}},e("summary",{key:"83f43a1315f1b964a008f77e3fdbb45817a48ff4",class:r,style:{lineHeight:`${this.lineHeight}px`,height:`${this.lineHeight}px`},onClick:t=>{t.stopPropagation();t.stopImmediatePropagation()}},e("span",{key:"74fe43b1a4985dfcce8e03bf46755bfc52469fdd",class:`inline-flex h-full items-center gap-1 pr-2 ${this.open?"flex-nowrap whitespace-nowrap":"min-w-0 flex-nowrap overflow-hidden"}`},this.emphasize&&e("span",{key:"af05d92691742cddcdd82ab5ad15c5a1cd36f44b",class:"flex h-full flex-shrink-0 items-center"},e("svg",{key:"f264f034a7b5eb6497228d49b3ecf66948b1414f",class:`${this.isDarkMode?"text-gray-300":"text-gray-600"} transition-transform duration-200 group-open:rotate-180`,fill:"none",height:"12",width:"12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",viewBox:"0 0 12 12","aria-hidden":"true"},e("path",{key:"050903b89912d2c5e8890e251069864b4bf96af3",d:"M 2 3 l 4 6 l 4 -6"}))),e("span",{key:"ed1997263533c27516a02692d35b2b1c71fd8f23",class:`${this.open?"overflow-visible":"min-w-0 truncate"} flex h-full items-center`},e("slot",{key:"ed39d967ddff867b4637e45e7760b4fa4d5b2a1b",name:"summary"}))),e("div",{key:"51c0fcdb875f2f5a067587a8cefe20b5384823b1",class:"ml-auto flex h-full flex-shrink-0 items-center"},e("slot",{key:"bbb33dcd322fcb6ce29ce8f32c921d57e831db5e",name:"summary-actions"}))),e("div",{key:"07b70d0ad0b2d183856a0673060abf1adf47a6b9",class:`${s}`},e("slot",{key:"d9e4fc9cc82c966fd7a84959755443ab1352f9d2"})),this.showFooter&&this.open&&e("div",{key:"e77a6f33704487cf32ce3c6ea419ca79857dac40",class:a},e("div",{key:"64581a1dc9285b2cf01bae72663e4618d2e3596c",class:`z-50 overflow-visible border-b ${this.isDarkMode?"border-gray-700 bg-gray-800":"border-gray-100 bg-white"}`},e("slot",{key:"3716388ac91d77fb9ae828a786cf92b06d21912e",name:"footer"})),e("div",{key:"bfafe9c0bbbedfc433960bf431ff4c3864e949c0",class:n},e("div",{key:"0d9aa1bb073e5a39ba537810232b0ff132305c29",class:"flex-grow overflow-visible"},e("slot",{key:"a85b8d920b3bc7ac5a9ca9a0077d070af26b5e82",name:"footer-left"})),e("div",{key:"e2896745bcf4c037f86982a001a3afd09d2bfad5",class:"flex flex-shrink-0 items-center gap-2 overflow-visible"},e("slot",{key:"240cab1871ee2780a45f2f6a3995d11cdb15ed45",name:"footer-actions"}))))))}get el(){return o(this)}static get watchers(){return{open:["watchOpen"],darkMode:["watchDarkMode"]}}};d.style=n;const p=class{constructor(e){t(this,e);this.pageChange=r(this,"pageChange");this.itemsPerPageChange=r(this,"itemsPerPageChange");this.currentPage=0;this.totalItems=0;this.itemsPerPage=10;this.pageSizes=[5,10,25,50,100];this.showItemsPerPageControl=true;this.darkMode="system";this.handlePageChange=t=>{if(t>=0&&t<=this.totalPages-1){this.pageChange.emit(t);requestAnimationFrame((()=>{const t=this.el.closest("pid-collapsible");if(t&&typeof t.recalculateContentDimensions==="function"){t.recalculateContentDimensions()}}))}};this.handleItemsPerPageChange=t=>{this.itemsPerPageChange.emit(t);requestAnimationFrame((()=>{const t=this.el.closest("pid-collapsible");if(t&&typeof t.recalculateContentDimensions==="function"){t.recalculateContentDimensions()}}))}}get totalPages(){return Math.max(1,Math.ceil(this.totalItems/this.itemsPerPage))}get displayRange(){if(this.totalItems===0){return{start:0,end:0}}const t=this.currentPage*this.itemsPerPage+1;const e=Math.min((this.currentPage+1)*this.itemsPerPage,this.totalItems);return{start:t,end:e}}getVisiblePageNumbers(){const t=7;const e=[];if(this.totalPages<=t){return Array.from({length:this.totalPages},((t,e)=>e))}e.push(0);let i=Math.max(1,this.currentPage-1);let o=Math.min(this.totalPages-2,this.currentPage+1);if(o-i<2){if(this.currentPage<this.totalPages/2){o=Math.min(this.totalPages-2,i+2)}else{i=Math.max(1,o-2)}}if(i>1){e.push("...")}for(let t=i;t<=o;t++){e.push(t)}if(o<this.totalPages-2){e.push("...")}e.push(this.totalPages-1);return e}render(){if(this.totalItems<=0){return null}const t=this.getVisiblePageNumbers();const i=this.totalItems>this.itemsPerPage;const o=this.darkMode==="dark"||this.darkMode==="system"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;const r=`pagination-${Math.random().toString(36).substring(2,11)}`;return e("div",{class:`flex w-full resize-none flex-wrap items-center justify-between gap-2 ${o?"bg-gray-800 text-gray-200":"bg-white text-gray-800"} px-3 py-1 text-sm`,role:"navigation","aria-labelledby":`${r}-label`},e("span",{id:`${r}-label`,class:"sr-only"},"Pagination controls and display settings"),e("div",{class:`flex flex-wrap items-center gap-2 ${o?"text-gray-300":"text-gray-600"}`},this.showItemsPerPageControl&&e("div",{class:"flex items-center gap-1",role:"group","aria-label":"Items per page options"},e("span",{class:`text-xs whitespace-nowrap ${o?"text-gray-300":"text-gray-600"}`,id:`${r}-itemsperpage-label`},"Items per page:"),e("div",{class:`flex items-center gap-0.5 rounded border ${o?"border-gray-600 bg-gray-700":"border-gray-200 bg-white"} p-0.5`,role:"toolbar","aria-labelledby":`${r}-itemsperpage-label`},this.pageSizes.map((t=>e("button",{key:`size-${t}`,onClick:()=>this.handleItemsPerPageChange(t),class:`resize-none rounded px-2 py-0.5 text-xs transition-colors ${this.itemsPerPage===t?"bg-blue-600 font-medium text-white":o?"text-gray-200 hover:bg-gray-600":"text-gray-700 hover:bg-gray-100"}`,"aria-label":`Show ${t} items per page`,"aria-pressed":this.itemsPerPage===t?"true":"false","aria-current":this.itemsPerPage===t?"true":undefined,type:"button"},t))))),e("span",{class:`hidden text-xs whitespace-nowrap ${o?"text-gray-300":"text-gray-600"} sm:block`,role:"status","aria-live":"polite"},"Showing ",this.displayRange.start,"-",this.displayRange.end," of ",this.totalItems)),i&&e("div",{class:"flex items-center"},e("nav",{class:"isolate inline-flex resize-none -space-x-px rounded-md shadow-sm","aria-label":"Pagination",role:"navigation"},e("button",{onClick:()=>this.handlePageChange(this.currentPage-1),disabled:this.currentPage===0,class:`relative inline-flex resize-none items-center rounded-l-md px-2 py-1.5 ${o?"text-gray-300 ring-1 ring-gray-600 ring-inset hover:bg-gray-700":"text-gray-500 ring-1 ring-gray-300 ring-inset hover:bg-gray-50"} focus:z-20 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":"Previous page",title:"Go to previous page",type:"button"},e("svg",{class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",role:"img"},e("title",null,"Previous"),e("desc",null,"Arrow pointing to the left"),e("path",{"fill-rule":"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06-.02z","clip-rule":"evenodd"}))),t.map(((t,i)=>{if(t==="..."){return e("span",{key:`ellipsis-${i}`,class:`relative inline-flex resize-none items-center px-2 py-1.5 text-sm ${o?"text-gray-300 ring-1 ring-gray-600 ring-inset":"text-gray-700 ring-1 ring-gray-300 ring-inset"}`,role:"separator","aria-label":"More pages","aria-hidden":"true"},e("span",{"aria-hidden":"true"},"..."),e("span",{class:"sr-only"},"More pages"))}const r=t;const s=r===this.currentPage;const a=r+1;return e("button",{key:`page-${r}`,onClick:()=>this.handlePageChange(r),class:s?"relative z-10 inline-flex resize-none items-center bg-blue-600 px-2 py-1.5 text-xs font-semibold text-white focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600":`relative inline-flex resize-none items-center px-2 py-1.5 text-xs ${o?"text-gray-200 ring-1 ring-gray-600 ring-inset hover:bg-gray-700":"text-gray-900 ring-1 ring-gray-300 ring-inset hover:bg-gray-50"} focus:z-20 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500`,"aria-label":`Page ${a}`,"aria-current":s?"page":undefined,type:"button",title:`Go to page ${a}`},a)})),e("button",{onClick:()=>this.handlePageChange(this.currentPage+1),disabled:this.currentPage>=this.totalPages-1,class:`relative inline-flex resize-none items-center rounded-r-md px-2 py-1.5 ${o?"text-gray-300 ring-1 ring-gray-600 ring-inset hover:bg-gray-700":"text-gray-500 ring-1 ring-gray-300 ring-inset hover:bg-gray-50"} focus:z-20 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":"Next page",title:"Go to next page",type:"button"},e("svg",{class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",role:"img"},e("title",null,"Next"),e("desc",null,"Arrow pointing to the right"),e("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"}))))))}get el(){return o(this)}};const b=class{constructor(e){t(this,e);this.tooltipExpansionChange=r(this,"tooltipExpansionChange");this.isVisible=false;this.calculatedPosition="top";this.needsRowExpansion=false;this.tooltipId=`tooltip-${Math.random().toString(36).substring(2,11)}`;this.showTooltip=()=>{this.isVisible=true;setTimeout((()=>this.calculateOptimalPosition()),10)};this.hideTooltip=()=>{this.isVisible=false;this.restoreRowHeight()};this.toggleTooltip=t=>{t.preventDefault();t.stopPropagation();if(this.isVisible){this.hideTooltip()}else{this.showTooltip()}};this.handleButtonKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();this.toggleTooltip(t)}};this.position="top";this.maxWidth="250px";this.maxHeight="150px";this.fitContent=true}handleKeyDown(t){var e;if(t.key==="Escape"&&this.isVisible){this.hideTooltip();(e=this.buttonRef)===null||e===void 0?void 0:e.focus();t.preventDefault();t.stopPropagation()}}componentDidLoad(){this.calculatedPosition=this.position==="bottom"?"bottom":"top";this.tableRow=this.el.closest("tr")}calculateOptimalPosition(){if(!this.tooltipRef||!this.isVisible)return;const t=this.el.getBoundingClientRect();const e=this.el.closest("table");const i=(e===null||e===void 0?void 0:e.closest(".overflow-auto"))||(e===null||e===void 0?void 0:e.parentElement);if(!i){this.calculatedPosition=this.position==="bottom"?"bottom":"top";return}const o=i.getBoundingClientRect();const r=t.top-o.top;const s=o.bottom-t.bottom;const a=this.estimateTooltipHeight(this.text);const n=a+20;let l;let c=false;if(this.position==="top"&&r>=n){l=false}else if(this.position==="bottom"&&s>=n){l=true}else if(r>=s&&r>=n){l=false}else if(s>=n){l=true}else{l=true;c=true}this.calculatedPosition=l?"bottom":"top";this.needsRowExpansion=c;if(c){this.expandRowForTooltip(a)}}expandRowForTooltip(t){if(!this.tableRow)return;this.originalRowHeight=this.tableRow.style.height||"auto";const e=this.tableRow.offsetHeight;const i=t+40;const o=Math.max(e,i);this.tableRow.style.transition="height 0.2s ease-in-out";this.tableRow.style.height=`${o}px`;this.tooltipExpansionChange.emit({expand:true,requiredHeight:o})}restoreRowHeight(){if(!this.tableRow||!this.needsRowExpansion)return;this.tableRow.style.height=this.originalRowHeight||"auto";setTimeout((()=>{if(this.tableRow){this.tableRow.style.transition=""}}),200);this.needsRowExpansion=false;this.tooltipExpansionChange.emit({expand:false,requiredHeight:0})}estimateTooltipHeight(t){const e=document.createElement("div");e.setAttribute("aria-hidden","true");e.setAttribute("tabindex","-1");e.setAttribute("role","presentation");e.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: normal;\n word-wrap: break-word;\n max-width: ${this.maxWidth};\n padding: 12px;\n font-size: 12px;\n line-height: 1.4;\n border: 1px solid transparent;\n pointer-events: none;\n `;e.textContent=t;document.body.appendChild(e);const i=e.offsetHeight;document.body.removeChild(e);return i}render(){const t=this.text&&this.text.trim