'use strict';

var index = require('./index-DNtvXFvn.js');
var utils = require('./utils-ByWMmAEg.js');
var setup = require('./setup-R6y52Gvj.js');
var index$1 = require('./index-DV4LJn4u.js');
var icon = require('./icon-Ba1Tn3lu.js');
var quickMessage = require('./quick-message-DIxFV-j6.js');
var sortable_esm = require('./sortable.esm-B1ZNencO.js');

const masterTagAppCss = () => `@layer base{*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-shadow:0 0 #0000;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-alpha:100%;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-width:0;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-space-x-reverse:0;--tw-drop-shadow-alpha:100%;--tw-border-style:solid;border:0 solid;box-sizing:border-box;margin:0;padding:0}}@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-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-duration:initial;--tw-ease: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-font-weight:initial;--tw-space-x-reverse:0;--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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-border-style:solid}}}@layer theme{:host,:root{--color-yellow-500:oklch(79.5% .184 86.047);--container-xs:20rem;--container-sm:24rem;--color-red-700:oklch(50.5% .213 27.518);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-blue-500:oklch(62.3% .214 259.815);--color-pink-100:oklch(94.8% .028 342.258);--color-gray-400:oklch(70.7% .022 261.325);--font-weight-bold:700;--ease-in-out:cubic-bezier(.4,0,.2,1);--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-blue-600:oklch(54.6% .245 262.881);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--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;--text-xl:1.25rem;--text-xl--line-height:1.4;--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:"Kanit",var(--default-font);--default-mono-font-family:var(--font-mono);--default-font:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--color-primary:#e02848;--color-secondary:#023761;--color-background:#fff;--color-surface:#000;--color-surface-inverted:#fff;--color-paper:#f3f4f6;--color-divider:#e5e7eb;--color-theme-gray:#6b7280;--color-overlay:#0000004d;--color-selected:#fadfe4;--color-shimmer-gradient:linear-gradient(90deg,var(--color-divider)25%,var(--color-paper)50%,var(--color-divider)75%)}}@layer base{::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);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}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:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0;padding-bottom:0;padding-top:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0;padding-bottom:0;padding-top:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0;padding-bottom:0;padding-top:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0;padding-bottom:0;padding-top:0}::-webkit-datetime-edit-meridiem-field{padding-block:0;padding-bottom:0;padding-top:0}::-webkit-calendar-picker-indicator{line-height:1}:-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}input:where(:not([type])),input:where([type=date]),input:where([type=datetime-local]),input:where([type=email]),input:where([type=month]),input:where([type=number]),input:where([type=password]),input:where([type=search]),input:where([type=tel]),input:where([type=text]),input:where([type=time]),input:where([type=url]),input:where([type=week]),select,select:where([multiple]),textarea{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-color:oklch(55.1% .027 264.364);border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color);border-color:oklch(54.6% .245 262.881);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input::placeholder,textarea::placeholder{color:oklch(55.1% .027 264.364);opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;print-color-adjust:exact}select:where([multiple]),select:where([size]:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;print-color-adjust:unset}input:where([type=checkbox]),input:where([type=radio]){appearance:none;color:oklch(54.6% .245 262.881);print-color-adjust:exact;-webkit-user-select:none;user-select:none;vertical-align:middle;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-color:oklch(55.1% .027 264.364);border-width:1px;display:inline-block;flex-shrink:0;height:1rem;padding:0;width:1rem}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0'/%3E%3C/svg%3E")}input:where([type=radio]):checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}input:where([type=checkbox]):checked:focus,input:where([type=checkbox]):checked:hover,input:where([type=radio]):checked:focus,input:where([type=radio]):checked:hover{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):indeterminate:focus,input:where([type=checkbox]):indeterminate:hover{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components{.dialog-backdrop{align-items:center;background-color:#0006;display:flex;inset:calc(var(--spacing)*0);justify-content:center;position:fixed;z-index:50}@supports (color:color-mix(in lab,red,red)){.dialog-backdrop{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.dialog-wrapper{background-color:var(--color-background);border-radius:var(--radius-lg);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px 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);display:flex;flex-direction:column;max-height:80dvh;width:100%}.dialog-header{align-items:center;display:flex;justify-content:center;padding:calc(var(--spacing)*4);position:relative}.dialog-title{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);color:var(--color-surface);font-weight:var(--font-weight-semibold)}.dialog-close{position:absolute;right:calc(var(--spacing)*4);top:calc(var(--spacing)*4)}.chat-item{align-items:flex-start;border-radius:var(--radius-xl);cursor:pointer;display:flex;margin-block:calc(var(--spacing)*1);margin-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*3);padding-inline:calc(var(--spacing)*4);position:relative;--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)}:where(.chat-item>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-end:calc(var(--spacing)*4*(1 - var(--tw-space-x-reverse)));margin-inline-start:calc(var(--spacing)*4*var(--tw-space-x-reverse))}.chat-item .chat-item-pin{position:absolute;right:calc(var(--spacing)*-3);top:calc(var(--spacing)*1)}.chat-item .chat-item-pin-icon{fill:currentColor;height:calc(var(--spacing)*3);rotate:45deg;width:calc(var(--spacing)*3)}.chat-item .chat-item-content-container{display:flex;flex-direction:row;width:100%}:where(.chat-item .chat-item-content-container>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-end:calc(var(--spacing)*4*(1 - var(--tw-space-x-reverse)));margin-inline-start:calc(var(--spacing)*4*var(--tw-space-x-reverse))}.chat-item .chat-item-avatar-wrapper{align-self:center;flex-shrink:0;position:relative}.chat-item .chat-item-avatar-badge{bottom:calc(var(--spacing)*-.5);position:absolute;right:calc(var(--spacing)*-.5)}.chat-item .chat-item-avatar-badge-top-left{left:calc(var(--spacing)*-.5);position:absolute;top:calc(var(--spacing)*-.5)}.chat-item .chat-item-content-wrapper{min-height:calc(var(--spacing)*18);overflow:hidden;width:100%}.chat-item .chat-item-content-main{align-items:center;display:flex}:where(.chat-item .chat-item-content-main>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-end:calc(var(--spacing)*1*(1 - var(--tw-space-x-reverse)));margin-inline-start:calc(var(--spacing)*1*var(--tw-space-x-reverse))}.chat-item .chat-item-content-main-image{border-radius:3.40282e+38px;height:calc(var(--spacing)*4);width:calc(var(--spacing)*4)}.chat-item .chat-item-content-main-name{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.chat-item .chat-item-content-main-name,.chat-item .chat-item-content-main-time{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.chat-item .chat-item-content-main-time{color:var(--color-gray-500);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));margin-left:auto}.chat-item .chat-item-content-secondary{align-items:flex-start;display:flex;flex-direction:row;width:100%}.chat-item .chat-item-content-secondary-message,.chat-item .chat-item-content-secondary-nickname{color:var(--color-surface);font-size:var(--text-sm);-webkit-line-clamp:1;line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.chat-item .chat-item-content-secondary-message{text-overflow:ellipsis;white-space:nowrap}.chat-item .chat-item-content-unread{background-color:var(--color-primary);border-radius:3.40282e+38px;color:var(--color-white);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));margin-left:auto}.chat-item .chat-item-content-unread-mark{display:inline-block;height:calc(var(--spacing)*2.5);width:calc(var(--spacing)*2.5)}.chat-item .chat-item-content-unread-count{padding-block:calc(var(--spacing)*.5);padding-inline:calc(var(--spacing)*2)}.chat-item-locked{background-color:#e5e7eb40;border-radius:var(--radius-xl);cursor:not-allowed;inset:calc(var(--spacing)*0);position:absolute;--tw-backdrop-grayscale:grayscale(75%);-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,)}@supports (color:color-mix(in lab,red,red)){.chat-item-locked{background-color:color-mix(in oklab,var(--color-divider)25%,transparent)}}.z-icon-button{cursor:pointer;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);align-items:center;border-radius:3.40282e+38px;display:inline-flex;font-weight:var(--font-weight-medium);justify-content:center;transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.z-icon-button:focus{--tw-outline-style:none;outline-style:none}.z-icon-button-primary{background-color:var(--color-primary);color:var(--color-white)}.z-icon-button-outlined{border-color:var(--color-primary);border-style:var(--tw-border-style);border-width:1px}.z-icon-button-outlined,.z-icon-button-text{color:var(--color-primary)}.z-icon-button-disabled{cursor:not-allowed;opacity:.5}.z-button{cursor:pointer;--tw-font-weight:var(--font-weight-medium);align-items:center;border-radius:3.40282e+38px;display:inline-flex;font-weight:var(--font-weight-medium);justify-content:center;transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.z-button:focus{--tw-outline-style:none;outline-style:none}.z-button-x-small{padding-block:calc(var(--spacing)*1)}.z-button-small,.z-button-x-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-inline:calc(var(--spacing)*2)}.z-button-small{padding-block:calc(var(--spacing)*1.5)}.z-button-medium{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*3)}.z-button-large{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));padding-block:calc(var(--spacing)*3);padding-inline:calc(var(--spacing)*4)}.z-button-primary{background-color:var(--color-primary);color:var(--color-white)}.z-button-outlined{border-color:var(--color-primary);border-style:var(--tw-border-style);border-width:1px;color:var(--color-primary)}.z-button-disabled{cursor:not-allowed;opacity:.5}.z-button-text{margin-inline:calc(var(--spacing)*2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.z-input-area-label{margin-bottom:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);display:block;font-weight:var(--font-weight-medium)}.z-input-area-input,.z-input-area-label{color:var(--color-surface);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.z-input-area-input{background-color:var(--color-background);border-color:var(--color-divider);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*4);width:100%;--tw-ring-color:var(--color-primary)}.z-input-area-input:focus{border-color:var(--color-primary);--tw-outline-style:none;outline-style:none}.z-input-area-error{color:var(--color-red-500)}.z-input-area-error,.z-input-area-limit{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));margin-top:calc(var(--spacing)*1)}.z-input-area-limit{color:var(--color-theme-gray);margin-left:auto}.z-input-label{margin-bottom:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);display:block;font-weight:var(--font-weight-medium)}.z-input,.z-input-label{color:var(--color-surface);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.z-input{background-color:var(--color-background);border-color:var(--color-divider);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*4);width:100%;--tw-ring-color:var(--color-primary)}.z-input:focus{border-color:var(--color-primary);--tw-outline-style:none;outline-style:none}.z-input-error{color:var(--color-red-500);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));margin-top:calc(var(--spacing)*1)}.z-date-picker-label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));margin-bottom:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);color:var(--color-surface);display:block;font-weight:var(--font-weight-medium)}.z-date-picker-field{align-items:center;display:flex;position:relative}.z-date-picker-input{background-color:var(--color-background);border-color:var(--color-divider);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;color:var(--color-surface);cursor:pointer;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*4);padding-right:calc(var(--spacing)*10);width:100%;--tw-ring-color:var(--color-primary);color-scheme:light}.z-date-picker-input:focus{border-color:var(--color-primary);--tw-outline-style:none;outline-style:none}[data-theme=dark] .z-date-picker-input{color-scheme:dark}.z-date-picker-input::-webkit-calendar-picker-indicator{cursor:pointer;height:100%;opacity:0;position:absolute;right:0;top:0;width:100%}.z-date-picker-input::-webkit-datetime-edit{color:var(--color-surface);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0}.z-date-picker-input::-webkit-datetime-edit-fields-wrapper{color:var(--color-surface);padding:0}.z-date-picker-input::-webkit-datetime-edit-text{color:var(--color-theme-gray);padding:0 1px}.z-date-picker-input::-webkit-datetime-edit-day-field,.z-date-picker-input::-webkit-datetime-edit-month-field{border-radius:4px;color:var(--color-surface);padding:2px}.z-date-picker-input::-webkit-datetime-edit-year-field{border-radius:4px;color:var(--color-surface);padding:2px}.z-date-picker-input::-webkit-datetime-edit-month-field:focus{background-color:var(--color-primary);color:#fff;outline:none}.z-date-picker-input::-webkit-datetime-edit-day-field:focus{background-color:var(--color-primary);color:#fff;outline:none}.z-date-picker-input::-webkit-datetime-edit-year-field:focus{background-color:var(--color-primary);color:#fff;outline:none}.z-date-picker-icon-wrapper{align-items:center;display:flex;pointer-events:none;position:absolute;right:calc(var(--spacing)*3)}.z-date-picker-icon{color:var(--color-theme-gray);height:calc(var(--spacing)*5);width:calc(var(--spacing)*5)}.z-date-picker-error{color:var(--color-red-500);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));margin-top:calc(var(--spacing)*1)}.z-select-input-label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));margin-bottom:calc(var(--spacing)*1);--tw-font-weight:var(--font-weight-medium);display:block;font-weight:var(--font-weight-medium)}.z-tag-or-status-item{align-items:center;border-radius:var(--radius-2xl);gap:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1.5);padding-inline:calc(var(--spacing)*3);--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);display:inline-flex}.z-tag-or-status-item .z-tag-or-status-item-name{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));max-width:calc(var(--spacing)*20)}.z-tag-or-status-item .z-tag-or-status-item-icon{border-radius:3.40282e+38px;height:calc(var(--spacing)*4);width:calc(var(--spacing)*4)}.z-context-input{align-items:stretch;display:flex;flex-direction:row;margin-block:calc(var(--spacing)*1)}.z-context-input-key{background-color:var(--color-background);border-bottom-left-radius:var(--radius-3xl);border-color:var(--color-divider);border-style:var(--tw-border-style);border-top-left-radius:var(--radius-3xl);border-width:1px;color:var(--color-surface);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));max-height:6.4rem;min-height:2.4rem;padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*4);resize:none;width:100%;--tw-ring-color:var(--color-primary);flex:1}.z-context-input-key:focus{border-color:var(--color-primary);--tw-outline-style:none;outline-style:none}.z-context-input-value{background-color:var(--color-background);border-bottom-right-radius:var(--radius-3xl);border-color:var(--color-primary);border-style:var(--tw-border-style);border-top-right-radius:var(--radius-3xl);border-width:1px;color:var(--color-surface);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));max-height:6.4rem;min-height:2.4rem;padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*4);resize:none;width:100%;--tw-ring-color:var(--color-primary);flex:1}.z-context-input-value:focus{border-color:var(--color-primary);--tw-outline-style:none;outline-style:none}.z-text-with-link{color:var(--color-blue-600);display:inline;overflow-wrap:anywhere;text-decoration-line:underline;word-break:break-all}.z-button-group{display:inline-flex}.z-button-group-tab{border-radius:var(--radius-md);display:flex;gap:calc(var(--spacing)*1);padding:calc(var(--spacing)*.5)!important}.z-button-group-tab-overlay{background-color:var(--color-overlay)}.z-button-group-item{border-style:var(--tw-border-style);cursor:pointer;--tw-font-weight:var(--font-weight-medium);align-items:center;border-width:1px;display:inline-flex;font-weight:var(--font-weight-medium);justify-content:center;transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.z-button-group-item:focus{--tw-outline-style:none;outline-style:none}.z-button-group-item-tab{align-items:center;border-radius:var(--radius-sm);display:flex;flex:1;flex-direction:column;gap:calc(var(--spacing)*2);justify-content:center;padding:calc(var(--spacing)*1)!important}.z-button-group-item-tab,.z-button-group-item-tab-selected{border-style:var(--tw-border-style)!important;border-width:0!important}.z-button-group-item-tab-selected{background-color:var(--color-white);--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px 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)}.z-button-group-item-tab-unselected{border-style:var(--tw-border-style)!important;border-width:0!important}.z-button-group-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:calc(var(--spacing)*1.5);padding-inline:calc(var(--spacing)*2)}.z-button-group-medium{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding-block:calc(var(--spacing)*2);padding-inline:calc(var(--spacing)*3)}.z-button-group-large{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));padding-block:calc(var(--spacing)*3);padding-inline:calc(var(--spacing)*4)}.z-button-group-item-first{border-bottom-left-radius:3.40282e+38px;border-top-left-radius:3.40282e+38px}.z-button-group-item-last{border-bottom-right-radius:3.40282e+38px;border-top-right-radius:3.40282e+38px}.z-button-group-item-middle{border-radius:0}.z-button-group-item-primary-selected{background-color:var(--color-primary);border-color:var(--color-primary);color:var(--color-white)}.z-button-group-item-primary-unselected{background-color:var(--color-white);border-color:var(--color-primary);color:var(--color-primary)}.z-button-group-item-outlined-selected{background-color:var(--color-primary);border-color:var(--color-primary);color:var(--color-white)}.z-button-group-item-outlined-unselected{background-color:#0000;border-color:var(--color-primary);color:var(--color-primary)}.z-button-group-item-disabled{cursor:not-allowed;opacity:.5}.z-button-group-item:not(:first-child){margin-left:-1px}.z-avatar-wrapper{overflow:hidden;position:relative}.z-avatar-image{animation:z-fadeIn .3s ease-in-out;position:relative}.z-avatar-error{align-items:center;display:flex;justify-content:center}.z-avatar-2x-small{height:calc(var(--spacing)*3);min-height:calc(var(--spacing)*3);min-width:calc(var(--spacing)*3);width:calc(var(--spacing)*3)}.z-avatar-x-small{height:calc(var(--spacing)*4);min-height:calc(var(--spacing)*4);min-width:calc(var(--spacing)*4);width:calc(var(--spacing)*4)}.z-avatar-small{height:calc(var(--spacing)*8);min-height:calc(var(--spacing)*8);min-width:calc(var(--spacing)*8);width:calc(var(--spacing)*8)}.z-avatar-medium{height:calc(var(--spacing)*16);min-height:calc(var(--spacing)*16);min-width:calc(var(--spacing)*16);width:calc(var(--spacing)*16)}.z-avatar-large{height:calc(var(--spacing)*32);min-height:calc(var(--spacing)*32);min-width:calc(var(--spacing)*32);width:calc(var(--spacing)*32)}.z-avatar-full{height:100%;width:100%}.z-avatar-group{background-color:#023761;border-radius:3.40282e+38px}.divider{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-theme-gray)}}@layer utilities{.flex{display:flex}.size-8{height:calc(var(--spacing)*8);width:calc(var(--spacing)*8)}.min-h-75{min-height:calc(var(--spacing)*75)}.animate-spin{animation:var(--animate-spin)}.items-center{align-items:center}.justify-center{justify-content:center}.text-primary{color:var(--color-primary)}}[data-theme=light]{--color-primary:#e02848;--color-secondary:#023761;--color-background:#fff;--color-surface:#000;--color-surface-inverted:#fff;--color-paper:#f3f4f6;--color-divider:#e5e7eb;--color-theme-gray:#6b7280;--color-overlay:#0000004d;--color-selected:#fadfe4;--color-shimmer-gradient:linear-gradient(90deg,var(--color-divider)25%,var(--color-paper)50%,var(--color-divider)75%)}[data-theme=dark]{--color-primary:#b50f30;--color-secondary:#fff;--color-background:#23292d;--color-surface:#fff;--color-surface-inverted:#000;--color-paper:#374151;--color-divider:#4b5563;--color-theme-gray:#d1d5db;--color-overlay:#ffffff4d;--color-selected:#3a242e;--color-shimmer-gradient:linear-gradient(90deg,var(--color-divider)25%,var(--color-paper)50%,var(--color-divider)75%)}.scroll-container::-webkit-scrollbar{background:#0000001a;height:8px;width:8px}.scroll-container:hover::-webkit-scrollbar{background:#0003}.scroll-container:active::-webkit-scrollbar{background:#0003}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--color-overlay);border-radius:4px}.scroll-container:active::-webkit-scrollbar-thumb{background:var(--color-overlay);border-radius:4px}.z-zwiz-max-height{height:100svh}.z-zwiz-max-height.has-warning-notification{height:calc(100svh - 40px)}.bg-time-badge{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-time-badge{background-color:color-mix(in srgb,var(--color-surface)30%,transparent)}}.placeholder-surface::placeholder{color:var(--color-text-gray)}.z-width-100{width:100%}.z-width-90{width:90%}.z-width-75{width:75%}.z-width-50{width:50%}.z-width-25{width:25%}.z-width-0{width:0}.z-animate-width{transition-duration:.5s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.z-animate-grid-template-cols{transition:grid-template-rows .5s}[type=checkbox]{background-color:var(--color-gray-300);border-color:var(--color-gray-300);border-radius:4px;cursor:pointer}[type=checkbox]:checked,[type=checkbox]:indeterminate{background-color:var(--color-primary);border-color:var(--color-primary);border-radius:4px;cursor:pointer}[type=checkbox]:focus{offset:0;outline-offset:0;--tw-ring-color:var(--color-primary);outline:none}[type=radio]{background-color:var(--color-gray-300);border-color:var(--color-gray-300);cursor:pointer}[type=radio]:checked{background-color:var(--color-primary);border-color:var(--color-primary);cursor:pointer;offset:0;outline-offset:0;--tw-ring-color:var(--color-primary);outline:none}[type=radio]:focus{offset:0;outline-offset:0;--tw-ring-color:var(--color-primary);outline:none}@supports (background-color:highlight){::highlight(search-result-highlight){background-color:oklch(90.5% .182 98.111);color:#000}}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.grid-cols-1{grid-template-columns:1fr}.grid-cols-1_3{grid-template-columns:1fr 3fr}.grid-cols-1_2_1{grid-template-columns:1fr 2fr 1fr}@keyframes z-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes z-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{}@layer base{}@layer utilities{.mt-2{margin-top:calc(var(--spacing)*2)}.h-8{height:calc(var(--spacing)*8)}.w-8{width:calc(var(--spacing)*8)}.cursor-pointer{cursor:pointer}.gap-2{gap:calc(var(--spacing)*2)}.rounded{border-radius:.25rem}.border-0{border-style:var(--tw-border-style);border-width:0}.p-0{padding:calc(var(--spacing)*0)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-gray-500{color:var(--color-gray-500)}.relative{position:relative}.absolute{position:absolute}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.size-4{height:calc(var(--spacing)*4);width:calc(var(--spacing)*4)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.bg-background{background-color:var(--color-background)}.text-green-500{color:var(--color-green-500)}.text-red-500{color:var(--color-red-500)}.text-surface{color:var(--color-surface)}.text-theme-gray{color:var(--color-theme-gray)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.right-3{right:calc(var(--spacing)*3)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.left-0{left:calc(var(--spacing)*0)}.left-2\\.5{left:calc(var(--spacing)*2.5)}.z-10{z-index:10}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.m-0{margin:calc(var(--spacing)*0)}.m-2{margin:calc(var(--spacing)*2)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.inline-flex{display:inline-flex}.size-3{height:calc(var(--spacing)*3);width:calc(var(--spacing)*3)}.size-5{height:calc(var(--spacing)*5);width:calc(var(--spacing)*5)}.size-16{height:calc(var(--spacing)*16);width:calc(var(--spacing)*16)}.size-32{height:calc(var(--spacing)*32);width:calc(var(--spacing)*32)}.size-\\[8px\\]{height:8px;width:8px}.size-\\[10px\\]{height:10px;width:10px}.size-\\[18px\\]{height:18px;width:18px}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-7{height:calc(var(--spacing)*7)}.min-h-\\[20px\\]{min-height:20px}.min-h-\\[60px\\]{min-height:60px}.w-1\\/2{width:50%}.w-7{width:calc(var(--spacing)*7)}.w-9{width:calc(var(--spacing)*9)}.w-60{width:calc(var(--spacing)*60)}.w-\\[72px\\]{width:72px}.w-full{width:100%}.max-w-32{max-width:calc(var(--spacing)*32)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-left{transform-origin:0}.-translate-x-1{--tw-translate-x:calc(var(--spacing)*-1)}.-translate-x-1,.translate-x-0{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0)}.translate-x-10{--tw-translate-x:calc(var(--spacing)*10)}.-translate-y-1\\/2,.translate-x-10{translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:-50%}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0)}.translate-y-0,.translate-y-full{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-full{--tw-translate-y:100%}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-default{cursor:default}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-3{gap:calc(var(--spacing)*3)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.rounded-full{border-radius:3.40282e+38px}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-\\[0\\.5px\\]{border-bottom-style:var(--tw-border-style);border-bottom-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-divider{border-color:var(--color-divider)}.border-gray-300{border-color:var(--color-gray-300)}.border-primary{border-color:var(--color-primary)}.border-transparent{border-color:#0000}.bg-gray-300{background-color:var(--color-gray-300)}.bg-paper{background-color:var(--color-paper)}.bg-pink-100{background-color:var(--color-pink-100)}.bg-primary{background-color:var(--color-primary)}.bg-selected{background-color:var(--color-selected)}.bg-theme-gray{background-color:var(--color-theme-gray)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-linear-to-r{--tw-gradient-position:to right;background-image:linear-gradient(var(--tw-gradient-stops))}}@layer properties{}@layer base{}@layer utilities{}@layer properties{}@layer base{}@layer utilities{}@layer properties{}@layer base{}@layer utilities{@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-r{--tw-gradient-position:to right in oklab}}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\\[71\\.4\\%\\]{--tw-gradient-from-position:71.4%}.to-selected{--tw-gradient-to:var(--color-selected);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.px-1{padding-inline:calc(var(--spacing)*1)}.px-3{padding-inline:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.pt-0\\.5{padding-top:calc(var(--spacing)*.5)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pr-16{padding-right:calc(var(--spacing)*16)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.text-right{text-align:right}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-background{color:var(--color-background)}.text-black{color:var(--color-black)}.text-blue-500{color:var(--color-blue-500)}.text-gray-400{color:var(--color-gray-400)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.capitalize{text-transform:capitalize}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.ring-0,.shadow{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-colors{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-opacity{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.last\\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.focus-within\\:border-primary:focus-within{border-color:var(--color-primary)}.focus\\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(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\\:outline-none:focus{--tw-outline-style:none;outline-style:none}}@layer properties{}@layer base{}@layer properties{}@layer base{}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@layer properties{}@layer base{}:host{display:block}.master-tag-app{display:flex;flex-direction:column;max-height:calc(100svh - 120px);min-height:calc(100svh - 120px);overflow:hidden;width:100%}.master-tag-app,.master-tag-app-header{background-color:var(--color-background)}.master-tag-app-header{border-bottom:1px solid var(--color-border);padding:0 10px;position:sticky;top:0;z-index:10}.master-tag-app-title{color:var(--color-surface);font-size:1.25rem;font-weight:600;margin-bottom:1rem}.master-tag-app-controls{display:flex;flex-wrap:wrap;gap:1rem}.master-tag-app-search{flex-grow:1}.master-tag-app-content{flex:1;overflow-y:auto;padding:1rem}.master-tag-app-empty{align-items:center;color:var(--color-text-secondary);display:flex;flex-direction:column;justify-content:center;min-height:300px;text-align:center}.master-tag-app-empty-icon{color:var(--color-primary);height:80px;margin-bottom:1rem;transform:rotate(90deg);width:80px}.tag-sortable-ghost{background-color:var(--color-primary);opacity:.4}@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-font-weight{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@media (forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}input:where([type=radio]):checked{appearance:auto}input:where([type=checkbox]):indeterminate{appearance:auto}}@media (hover:hover){.z-icon-button-primary:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-icon-button-outlined:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-icon-button-text:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-button-primary:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-button-outlined:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-button-group-item-tab:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px 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)}.z-button-group-item-tab-unselected:hover{background-color:var(--color-white)}.z-button-group-item-primary-unselected:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.z-button-group-item-outlined-unselected:hover{background-color:#e028481a}@supports (color:color-mix(in lab,red,red)){.z-button-group-item-outlined-unselected:hover{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.hover\\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}@media screen and (min-width:0){.z-max-height{height:calc(100svh - 56px)}.z-max-height.has-warning-notification{height:calc(100svh - 96px)}}@media screen and (min-width:600px){.z-max-height{height:calc(100svh - 64px)}.z-max-height.has-warning-notification{height:calc(100svh - 104px)}}`;

const MasterTagApp = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    languagePref = 'en';
    themeMode = 'light';
    businessId;
    shopId;
    accessToken;
    isProduction = false;
    timeZone;
    tags = [];
    searchQuery = '';
    loading = false;
    dialogOpen = false;
    editingItem = null;
    dialogLoading = false;
    containerRef;
    sortable;
    connectedCallback() {
        setup.setupLanguage(this.languagePref);
        setup.setupTheme(this.themeMode);
        setup.setupBusinessId(this.businessId);
        setup.setupShopId(this.shopId);
        setup.setupAccessToken(this.accessToken);
        setup.setupIsProduction(this.isProduction);
        setup.setupTimeZone(this.timeZone);
    }
    componentWillLoad() {
        setup.setupBusinessId(this.businessId);
        setup.setupShopId(this.shopId);
        setup.setupAccessToken(this.accessToken);
        setup.setupIsProduction(this.isProduction);
        setup.setupTimeZone(this.timeZone);
        this.fetchData();
    }
    componentDidLoad() {
        if (this.containerRef) {
            this.sortable = new sortable_esm.Sortable(this.containerRef, {
                animation: 150,
                ghostClass: 'tag-sortable-ghost',
                handle: '.master-data-item-drag-handle',
                onEnd: async (evt) => {
                    const { oldIndex, newIndex } = evt;
                    if (oldIndex === newIndex || oldIndex === undefined || newIndex === undefined)
                        return;
                    const newTags = [...this.tags];
                    const [movedItem] = newTags.splice(oldIndex, 1);
                    newTags.splice(newIndex, 0, movedItem);
                    this.tags = newTags;
                    try {
                        await index$1.reorderUserTag({ id: movedItem.id, sequence: newIndex + 1 });
                    }
                    catch (error) {
                        quickMessage.handleError(error, 'Failed to reorder tag');
                        await this.fetchData(); // Revert on error
                    }
                },
            });
        }
    }
    disconnectedCallback() {
        if (this.sortable)
            this.sortable.destroy();
    }
    handleLanguageChange(newValue) {
        setup.setupLanguage(newValue);
    }
    handleThemeChange(newValue) {
        setup.setupTheme(newValue);
    }
    handleBusinessIdChange(newValue) {
        setup.setupBusinessId(newValue);
        this.fetchData();
    }
    handleShopIdChange(newValue) {
        setup.setupShopId(newValue);
        this.fetchData();
    }
    handleAccessTokenChange(newValue) {
        setup.setupAccessToken(newValue);
        this.fetchData();
    }
    handleIsProductionChange(newValue) {
        setup.setupIsProduction(newValue);
    }
    handleTimeZoneChange(newValue) {
        setup.setupTimeZone(newValue);
    }
    async fetchData() {
        if (!this.businessId || !this.shopId || !this.accessToken)
            return;
        this.loading = true;
        try {
            let response = await index$1.getUserTags({ limit: utils.GET_USER_TAG_MASTER_PAGE_LIMIT });
            const isInvalidOrder = response.tags.some((tag, index) => tag.sequence != index + 1);
            if (isInvalidOrder) {
                await index$1.resequenceUserTag();
                response = await index$1.getUserTags({ limit: utils.GET_USER_TAG_MASTER_PAGE_LIMIT });
            }
            this.tags = response.tags.sort((a, b) => a.sequence - b.sequence);
        }
        catch (error) {
            quickMessage.handleError(error, 'Failed to fetch tags');
        }
        finally {
            this.loading = false;
        }
    }
    handleCreate = async (e) => {
        const t = utils.useTranslation();
        this.dialogLoading = true;
        try {
            await index$1.createUserTag({ name: e.detail.name, color: e.detail.color });
            this.dialogOpen = false;
            quickMessage.openDialog({
                open: true,
                type: "SUCCESS" /* DIALOG_TYPE.SUCCESS */,
                title: t('success'),
                onCloseDialog: quickMessage.closeDialog,
            });
            await this.fetchData();
        }
        catch (error) {
            quickMessage.handleError(error, 'Failed to create tag');
        }
        finally {
            this.dialogLoading = false;
        }
    };
    handleUpdate = async (e) => {
        if (!this.editingItem)
            return;
        const t = utils.useTranslation();
        this.dialogLoading = true;
        try {
            await index$1.updateUserTag({
                id: this.editingItem.id,
                name: e.detail.name,
                color: e.detail.color,
            });
            this.dialogOpen = false;
            quickMessage.openDialog({
                open: true,
                type: "SUCCESS" /* DIALOG_TYPE.SUCCESS */,
                title: t('success'),
                onCloseDialog: quickMessage.closeDialog,
            });
            this.editingItem = null;
            await this.fetchData();
        }
        catch (error) {
            quickMessage.handleError(error, 'Failed to update tag');
        }
        finally {
            this.dialogLoading = false;
        }
    };
    handleDelete = async () => {
        if (!this.editingItem)
            return;
        const t = utils.useTranslation();
        let total;
        quickMessage.openDialog({
            open: true,
            type: "WARNING" /* DIALOG_TYPE.WARNING */,
            title: t('master_data.confirm_delete_tag'),
            buttonName: t('confirm'),
            cancelButtonName: t('cancel'),
            onSubmitDialog: async () => {
                try {
                    this.dialogLoading = true;
                    await index$1.deleteUserTag({ id: this.editingItem.id, });
                    quickMessage.openDialog({
                        open: true,
                        type: "SUCCESS" /* DIALOG_TYPE.SUCCESS */,
                        title: t('success'),
                        onCloseDialog: quickMessage.closeDialog,
                    });
                    await this.fetchData();
                }
                catch (error) {
                    if (error.response && error.response.data && error.response.data.code === 'user-tag-in-use') {
                        total = error.response.data.data ? error.response.data.data.total : undefined;
                        if (total) {
                            quickMessage.openDialog({
                                open: true,
                                type: "WARNING" /* DIALOG_TYPE.WARNING */,
                                title: t('quick_message.delete_item_with_users_confirmation', { total }),
                                buttonName: t('confirm'),
                                cancelButtonName: t('cancel'),
                                onSubmitDialog: async () => {
                                    try {
                                        await index$1.deleteUserTag({ id: this.editingItem.id, force: true });
                                        this.dialogOpen = false;
                                        this.editingItem = null;
                                        quickMessage.openDialog({
                                            open: true,
                                            type: "SUCCESS" /* DIALOG_TYPE.SUCCESS */,
                                            title: t('success'),
                                            onCloseDialog: quickMessage.closeDialog,
                                        });
                                        await this.fetchData();
                                    }
                                    catch (e) {
                                        quickMessage.handleError(e, 'Failed to delete tag');
                                    }
                                },
                            });
                        }
                    }
                    else {
                        quickMessage.handleError(error, 'Failed to delete tag');
                    }
                }
                finally {
                    if (!total) {
                        this.dialogOpen = false;
                        this.editingItem = null;
                        await this.fetchData();
                    }
                    this.dialogLoading = false;
                }
            }
        });
    };
    handleReorder = async (id, direction) => {
        const currentIndex = this.tags.findIndex((s) => s.id === id);
        if (currentIndex === -1)
            return;
        let newSequence = 0;
        if (direction === 'top') {
            newSequence = 1;
        }
        else {
            newSequence = this.tags.length;
        }
        const newTags = [...this.tags];
        const [movedItem] = newTags.splice(currentIndex, 1);
        newTags.splice(newSequence - 1, 0, movedItem);
        newTags.forEach((item, index) => {
            item.sequence = index;
        });
        this.tags = newTags;
        try {
            await index$1.reorderUserTag({ id, sequence: newSequence });
        }
        catch (error) {
            quickMessage.handleError(error, 'Failed to reorder tag');
        }
    };
    render() {
        const theme = utils.configStore.get('theme');
        const t = utils.useTranslation();
        const filteredTags = this.tags.filter((s) => s.name.toLowerCase().includes(this.searchQuery.toLowerCase()));
        return (index.h("div", { key: '862cb64d2c4a483365e35bdf90dd7d0093da6556', class: "master-tag-app", "data-theme": theme }, index.h("div", { key: 'a34ccf9d8bc70c0da9e0423a7928d97581fec6fe', class: "master-tag-app-header" }, index.h("h1", { key: 'ec5c2b35faf0228398b31b98171d659c5801a03b', class: "master-tag-app-title" }, t('tag')), index.h("div", { key: 'af74fced5cdbc2dbbf83e3d6895b456daee8a7da', class: "master-tag-app-controls" }, index.h("div", { key: '05ef18a4d90ca84ae5cc29ad7ec54b762caaea9b', class: "master-tag-app-search" }, index.h(icon.ZInput, { key: '5f5ad3082115da58a6348d76a24ff1dac496d0e6', placeholder: t('master_data.search_tag'), value: this.searchQuery, onChange: (val) => (this.searchQuery = val) })), index.h(icon.ZButton, { key: '3313e2ced23ceaceb568660d0131e477d524f6e8', variant: "outlined", id: "create-master-tag-button", label: t('master_data.add_tag'), onClick: () => {
                this.editingItem = null;
                this.dialogOpen = true;
            }, startIcon: index.h(icon.Icon, { name: "Plus" }) }))), index.h("div", { key: '984a625193fd910ad1526bbda39967b49a7e66ed', class: "master-tag-app-content", ref: (el) => (this.containerRef = el) }, this.loading ? (index.h("div", { class: "flex justify-center items-center min-h-75" }, index.h(icon.Icon, { name: "LoaderCircle", addClass: "animate-spin size-8 text-primary" }))) : filteredTags.length > 0 ? (filteredTags.map((tag, index$1) => (index.h("master-data-item", { key: tag.id, type: "tag", item: {
                id: tag.id || '',
                name: tag.name,
                color: tag.color || '',
                sequence: tag.sequence || 0
            }, index: index$1, isFirst: index$1 === 0, isLast: index$1 === filteredTags.length - 1, isSearching: !!this.searchQuery, draggableItem: !this.searchQuery, onEdit: () => {
                this.editingItem = tag;
                this.dialogOpen = true;
            }, onMoveToTop: (e) => this.handleReorder(e.detail, 'top'), onMoveToBottom: (e) => this.handleReorder(e.detail, 'bottom') })))) : (index.h("div", { class: "master-tag-app-empty" }, index.h(icon.Icon, { name: "Tag", addClass: "master-tag-app-empty-icon" }), index.h("p", null, this.searchQuery
            ? t('master_data.not_found_tag')
            : t('master_data.tag_empty'))))), index.h("create-master-data-dialog", { key: '740cfe5aba1d1909a1110e736b0a86967bd2835e', open: this.dialogOpen, dialogTitle: t('tag'), type: "tag", initialData: this.editingItem ? {
                id: this.editingItem.id || '',
                name: this.editingItem.name,
                color: this.editingItem.color || ''
            } : undefined, loading: this.dialogLoading, onClose: () => (this.dialogOpen = false), onSubmitData: (e) => (this.editingItem ? this.handleUpdate(e) : this.handleCreate(e)), onDelete: this.handleDelete }), index.h("z-dialog", { key: '56c3d2ef62ba3faef77efdc9ca4657c865061f19' })));
    }
    static get watchers() { return {
        "languagePref": [{
                "handleLanguageChange": 0
            }],
        "themeMode": [{
                "handleThemeChange": 0
            }],
        "businessId": [{
                "handleBusinessIdChange": 0
            }],
        "shopId": [{
                "handleShopIdChange": 0
            }],
        "accessToken": [{
                "handleAccessTokenChange": 0
            }],
        "isProduction": [{
                "handleIsProductionChange": 0
            }],
        "timeZone": [{
                "handleTimeZoneChange": 0
            }]
    }; }
};
MasterTagApp.style = masterTagAppCss();

exports.master_tag_app = MasterTagApp;
