shopify-chatbot-widget 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- .jaweb-chatbot-container{position:fixed;bottom:20px;right:20px;z-index:9999}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.chatbot-box{position:fixed;bottom:5%;right:10px;width:28%;top:2%;z-index:9999;height:86%;background:#fff;color:#000;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 8px 24px #0003;font-family:Inter,sans-serif}.chatbot-header{background:#f7f7f7;padding:16px;display:flex;align-items:center;height:8%;gap:12px;font-size:16px;font-weight:700;border-bottom:1px solid #e0e0e0}.chatbot-title{flex-grow:1}.chatbot-close{cursor:pointer;font-size:16px;color:#888}.chatbot-messages{flex:1;padding:16px;overflow-y:auto;display:flex;flex-direction:column;height:70%;gap:12px;background-color:#fafafa;min-height:70%;scrollbar-width:none;-ms-overflow-style:none}.chatbot-messages::-webkit-scrollbar{display:none}.chat-msg{max-width:85%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.4;word-break:break-word}.chat-msg.assistant{background:#f0f0f0;align-self:flex-start;color:#000}.chat-msg.user{background:#7f28f8;align-self:flex-end;color:#fff}.chatbot-input-area{width:100%;display:flex;flex-direction:column;height:22%;align-items:center;background:#fff;border-top:1px solid #e0e0e0}.typing-animation span{display:inline-block;animation:blink 1.2s infinite;font-size:18px;margin:0 2px}@media (max-width: 600px){.chatbot-box{position:fixed;width:100%;height:100%;right:0;bottom:0;top:0}.chat-launcher.chatbot-open{display:none}}.jawebcss-powered-container{display:inline-flex;margin-top:10px;align-items:center;gap:6px;font-family:Arial,sans-serif;font-size:14px;color:#555;padding:4px 8px;border-radius:6px;box-shadow:0 1px 2px #0000000d}.jawebcss-powered-label{font-weight:400}.jawebcss-powered-link{color:#7f28f8;font-weight:600;text-decoration:none;transition:color .2s ease}.jawebcss-powered-link:hover{color:#5e1dc3;text-decoration:underline}.typing-animation span{display:inline-block;animation:blink 1.4s infinite;font-size:20px;margin:0 2px;color:#555}.typing-animation span:nth-child(2){animation-delay:.2s}.typing-animation span:nth-child(3){animation-delay:.4s}@keyframes blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}.product-card{background-color:#fff;box-shadow:0 4px 12px #0000000f;border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:16px}@media (min-width: 640px){.product-card{flex-direction:row;align-items:flex-start}}.product-image-container{width:128px;height:128px}@media (min-width: 640px){.product-image-container{width:160px;height:160px}}.product-image{width:100%;height:100%;object-fit:cover;border-radius:12px;cursor:pointer}.product-details{flex:1;display:flex;flex-direction:column;gap:12px}.product-name{font-size:1.125rem;font-weight:600;color:#111827;text-decoration:none}.product-price{font-size:1rem;font-weight:500;color:#374151}.label{font-size:.875rem;font-weight:500;color:#6b7280}.color-options,.size-options{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.color-button,.size-button{padding:4px 12px;font-size:.875rem;border-radius:9999px;border:1px solid #d1d5db;background-color:#f3f4f6;color:#1f2937;cursor:pointer}.color-button.disabled,.size-button.disabled{opacity:.4;cursor:not-allowed}.color-button.active,.size-button.active{color:#fff}.cart-controls{display:inline-flex;align-items:center;gap:12px;margin-top:12px}.cart-button{padding:4px 12px;border:1px solid #d1d5db;border-radius:8px;background:none;cursor:pointer}.cart-count{min-width:20px;text-align:center;font-weight:500}.increment{background-color:#7f28f8;color:#fff}.chat-image-wrapper{padding:4px 12px}.jawebcss-notification{position:fixed;top:1.25rem;right:1rem;background-color:#9ca3af;color:#fff;padding:.5rem 1rem;border-radius:.5rem;box-shadow:0 2px 8px #0003;z-index:9999;font-family:Segoe UI,sans-serif;font-size:14px;max-width:90%;word-break:break-word;transition:opacity .3s ease-in-out}.jawebchatbotcss-cart-widget{position:relative;display:inline-block}.jawebchatbotcss-cart-button{display:flex;align-items:center;gap:6px;padding:6px 12px;border:none;background:none;cursor:pointer;border-radius:6px;transition:background .2s ease-in-out}.jawebchatbotcss-cart-button:hover{background-color:#f1f1f1}.jawebchatbotcss-cart-icon{font-size:18px}.jawebchatbotcss-cart-label{font-weight:600}.jawebchatbotcss-cart-dropdown{position:absolute;right:0;margin-top:16px;width:320px;background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 20px #00000014;z-index:999}.jawebchatbotcss-cart-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #f3f4f6}.jawebchatbotcss-cart-title{font-size:16px;font-weight:500}.jawebchatbotcss-refresh-button{font-size:14px;color:#2563eb;background:none;border:none;cursor:pointer}.jawebchatbotcss-refresh-button:disabled{opacity:.5;cursor:not-allowed}.jawebchatbotcss-cart-empty{padding:16px;text-align:center;color:#6b7280}.jawebchatbotcss-cart-list{max-height:240px;overflow-y:auto;margin:0;padding:0;list-style:none}.jawebchatbotcss-cart-item{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #f9fafb}.jawebchatbotcss-item-name{width:160px;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jawebchatbotcss-item-controls{display:flex;align-items:center;gap:8px}.jawebchatbotcss-item-qty{font-size:14px;color:#374151}.jawebchatbotcss-remove-icon{color:#ef4444;cursor:pointer}.jawebchatbotcss-remove-icon:hover{color:#b91c1c}.jawebchatbotcss-cart-footer{padding:16px;border-top:1px solid #f3f4f6}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}/*! tailwindcss v4.1.11 | 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)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-outline-style:solid;--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-ease:initial}}}@layer theme{:root,:host{--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-green-400:oklch(79.2% .209 151.711);--color-indigo-600:oklch(51.1% .262 276.966);--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-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--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{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;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);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{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-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::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;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.visible\!{visibility:visible!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.z-50{z-index:50}.container{width:100%}@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}}.container\!{width:100%!important}@media (min-width:40rem){.container\!{max-width:40rem!important}}@media (min-width:48rem){.container\!{max-width:48rem!important}}@media (min-width:64rem){.container\!{max-width:64rem!important}}@media (min-width:80rem){.container\!{max-width:80rem!important}}@media (min-width:96rem){.container\!{max-width:96rem!important}}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.h-1{height:calc(var(--spacing)*1)}.h-12{height:calc(var(--spacing)*12)}.h-32{height:calc(var(--spacing)*32)}.h-full{height:100%}.w-12{width:calc(var(--spacing)*12)}.w-32{width:calc(var(--spacing)*32)}.w-full{width:100%}.max-w-xs{max-width:var(--container-xs)}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300)}.border-green-400{border-color:var(--color-green-400)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-cover{object-fit:cover}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.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))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-indigo-600{color:var(--color-indigo-600)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--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)}.shadow-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)}.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)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px 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)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);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,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);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,)}.grayscale{--tw-grayscale:grayscale(100%);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,)}.filter{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,)}.transition{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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.hover\:border-black:hover{border-color:var(--color-black)}.hover\:opacity-90:hover{opacity:.9}}@media (min-width:40rem){.sm\:h-40{height:calc(var(--spacing)*40)}.sm\:w-40{width:calc(var(--spacing)*40)}}}.jaweb-reset input[type=submit],.jaweb-reset input[type=button],.jaweb-reset button{all:initial;color:#fff;font:inherit;background:#7f28f8;border:none;border-radius:5px;padding:10px 16px}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-outline-style{syntax:"*";inherits:false;initial-value:solid}@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-ease{syntax:"*";inherits:false}
1
+ .jaweb-chatbot-container{position:fixed;bottom:20px;right:20px;z-index:9999}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.chatbot-box{position:fixed;bottom:5%;right:10px;width:28%;top:2%;z-index:9999;height:86%;background:#fff;color:#000;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 8px 24px #0003;font-family:Inter,sans-serif}.chatbot-header{background:#f7f7f7;padding:16px;display:flex;align-items:center;height:8%;gap:12px;font-size:16px;font-weight:700;border-bottom:1px solid #e0e0e0}.chatbot-title{flex-grow:1}.chatbot-close{cursor:pointer;font-size:16px;color:#888}.chatbot-messages{flex:1;padding:16px;overflow-y:auto;display:flex;flex-direction:column;height:70%;gap:12px;background-color:#fafafa;min-height:70%;scrollbar-width:none;-ms-overflow-style:none}.chatbot-messages::-webkit-scrollbar{display:none}.chat-msg{max-width:85%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.4;word-break:break-word}.chat-msg.assistant{background:#f0f0f0;align-self:flex-start;color:#000}.chat-msg.user{background:#7f28f8;align-self:flex-end;color:#fff}.chatbot-input-area{width:100%;display:flex;flex-direction:column;height:22%;align-items:center;background:#fff;border-top:1px solid #e0e0e0}.typing-animation span{display:inline-block;animation:blink 1.2s infinite;font-size:18px;margin:0 2px}@media (max-width: 600px){.chatbot-box{position:fixed;width:100%;height:100%;right:0;bottom:0;top:0}.chat-launcher.chatbot-open{display:none}}.jawebcss-powered-container{display:inline-flex;margin-top:10px;align-items:center;gap:6px;font-family:Arial,sans-serif;font-size:14px;color:#555;padding:4px 8px;border-radius:6px;box-shadow:0 1px 2px #0000000d}.jawebcss-powered-label{font-weight:400}.jawebcss-powered-link{color:#7f28f8;font-weight:600;text-decoration:none;transition:color .2s ease}.jawebcss-powered-link:hover{color:#5e1dc3;text-decoration:underline}.typing-animation span{display:inline-block;animation:blink 1.4s infinite;font-size:20px;margin:0 2px;color:#555}.typing-animation span:nth-child(2){animation-delay:.2s}.typing-animation span:nth-child(3){animation-delay:.4s}@keyframes blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}.product-card{background-color:#fff;box-shadow:0 4px 12px #0000000f;border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:16px}@media (min-width: 640px){.product-card{flex-direction:row;align-items:flex-start}}.product-image-container{width:128px;height:128px}@media (min-width: 640px){.product-image-container{width:160px;height:160px}}.product-image{width:100%;height:100%;object-fit:cover;border-radius:12px;cursor:pointer}.product-details{flex:1;display:flex;flex-direction:column;gap:12px}.product-name{font-size:1.125rem;font-weight:600;color:#111827;text-decoration:none}.product-price{font-size:1rem;font-weight:500;color:#374151}.label{font-size:.875rem;font-weight:500;color:#6b7280}.color-options,.size-options{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.color-button,.size-button{padding:4px 12px;font-size:.875rem;border-radius:9999px;border:1px solid #d1d5db;background-color:#f3f4f6;color:#1f2937;cursor:pointer}.color-button.disabled,.size-button.disabled{opacity:.4;cursor:not-allowed}.color-button.active,.size-button.active{color:#fff}.cart-controls{display:inline-flex;align-items:center;gap:12px;margin-top:12px}.cart-button{padding:4px 12px;border:1px solid #d1d5db;border-radius:8px;background:none;cursor:pointer}.cart-count{min-width:20px;text-align:center;font-weight:500}.increment{background-color:#7f28f8;color:#fff}.chat-image-wrapper{padding:4px 12px}.jawebcss-notification{position:fixed;top:1.25rem;right:1rem;background-color:#9ca3af;color:#fff;padding:.5rem 1rem;border-radius:.5rem;box-shadow:0 2px 8px #0003;z-index:9999;font-family:Segoe UI,sans-serif;font-size:14px;max-width:90%;word-break:break-word;transition:opacity .3s ease-in-out}.jawebchatbotcss-cart-widget{position:relative;display:inline-block}.jawebchatbotcss-cart-button{display:flex;align-items:center;gap:6px;padding:6px 12px;border:none;background:none;cursor:pointer;border-radius:6px;transition:background .2s ease-in-out}.jawebchatbotcss-cart-button:hover{background-color:#f1f1f1}.jawebchatbotcss-cart-icon{font-size:18px}.jawebchatbotcss-cart-label{font-weight:600}.jawebchatbotcss-cart-dropdown{position:absolute;right:0;margin-top:16px;width:320px;background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 20px #00000014;z-index:999}.jawebchatbotcss-cart-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #f3f4f6}.jawebchatbotcss-cart-title{font-size:16px;font-weight:500}.jawebchatbotcss-refresh-button{font-size:14px;color:#2563eb;background:none;border:none;cursor:pointer}.jawebchatbotcss-refresh-button:disabled{opacity:.5;cursor:not-allowed}.jawebchatbotcss-cart-empty{padding:16px;text-align:center;color:#6b7280}.jawebchatbotcss-cart-list{max-height:240px;overflow-y:auto;margin:0;padding:0;list-style:none}.jawebchatbotcss-cart-item{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #f9fafb}.jawebchatbotcss-item-name{width:160px;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jawebchatbotcss-item-controls{display:flex;align-items:center;gap:8px}.jawebchatbotcss-item-qty{font-size:14px;color:#374151}.jawebchatbotcss-remove-icon{color:#ef4444;cursor:pointer}.jawebchatbotcss-remove-icon:hover{color:#b91c1c}.jawebchatbotcss-cart-footer{padding:16px;border-top:1px solid #f3f4f6}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}/*! tailwindcss v4.1.11 | 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)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-outline-style:solid;--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-ease:initial}}}@layer theme{:root,:host{--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-green-400:oklch(79.2% .209 151.711);--color-indigo-600:oklch(51.1% .262 276.966);--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-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--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{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;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);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{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-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::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;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.visible\!{visibility:visible!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.z-50{z-index:50}.container{width:100%}@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}}.container\!{width:100%!important}@media (min-width:40rem){.container\!{max-width:40rem!important}}@media (min-width:48rem){.container\!{max-width:48rem!important}}@media (min-width:64rem){.container\!{max-width:64rem!important}}@media (min-width:80rem){.container\!{max-width:80rem!important}}@media (min-width:96rem){.container\!{max-width:96rem!important}}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.h-1{height:calc(var(--spacing)*1)}.h-12{height:calc(var(--spacing)*12)}.h-32{height:calc(var(--spacing)*32)}.h-full{height:100%}.w-12{width:calc(var(--spacing)*12)}.w-32{width:calc(var(--spacing)*32)}.w-full{width:100%}.max-w-xs{max-width:var(--container-xs)}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300)}.border-green-400{border-color:var(--color-green-400)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-cover{object-fit:cover}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.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))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-indigo-600{color:var(--color-indigo-600)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--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)}.shadow-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)}.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)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px 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)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);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,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);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,)}.grayscale{--tw-grayscale:grayscale(100%);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,)}.filter{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,)}.transition{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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.hover\:border-black:hover{border-color:var(--color-black)}.hover\:opacity-90:hover{opacity:.9}}@media (min-width:40rem){.sm\:h-40{height:calc(var(--spacing)*40)}.sm\:w-40{width:calc(var(--spacing)*40)}}}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-outline-style{syntax:"*";inherits:false;initial-value:solid}@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-ease{syntax:"*";inherits:false}
@@ -569,7 +569,7 @@ html body {
569
569
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...a){const r=new this(t);return a.forEach(l=>r.set(l)),r}static accessor(t){const r=(this[K4]=this[K4]={accessors:{}}).accessors,l=this.prototype;function c(f){const m=m0(f);r[m]||(RW(l,f),r[m]=!0)}return He.isArray(t)?t.forEach(c):c(t),this}};go.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),He.reduceDescriptors(go.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[a]=r}}}),He.freezeMethods(go);function fO(e,t){const a=this||h0,r=t||a,l=go.from(r.headers);let c=r.data;return He.forEach(e,function(m){c=m.call(a,c,l.normalize(),t?t.status:void 0)}),l.normalize(),c}function Q4(e){return!!(e&&e.__CANCEL__)}function qm(e,t,a){xn.call(this,e??"canceled",xn.ERR_CANCELED,t,a),this.name="CanceledError"}He.inherits(qm,xn,{__CANCEL__:!0});function J4(e,t,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?e(a):t(new xn("Request failed with status code "+a.status,[xn.ERR_BAD_REQUEST,xn.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function AW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function MW(e,t){e=e||10;const a=new Array(e),r=new Array(e);let l=0,c=0,f;return t=t!==void 0?t:1e3,function(g){const p=Date.now(),y=r[c];f||(f=p),a[l]=g,r[l]=p;let S=c,E=0;for(;S!==l;)E+=a[S++],S=S%e;if(l=(l+1)%e,l===c&&(c=(c+1)%e),p-f<t)return;const T=y&&p-y;return T?Math.round(E*1e3/T):void 0}}function _W(e,t){let a=0,r=1e3/t,l,c;const f=(p,y=Date.now())=>{a=y,l=null,c&&(clearTimeout(c),c=null),e.apply(null,p)};return[(...p)=>{const y=Date.now(),S=y-a;S>=r?f(p,y):(l=p,c||(c=setTimeout(()=>{c=null,f(l)},r-S)))},()=>l&&f(l)]}const k1=(e,t,a=3)=>{let r=0;const l=MW(50,250);return _W(c=>{const f=c.loaded,m=c.lengthComputable?c.total:void 0,g=f-r,p=l(g),y=f<=m;r=f;const S={loaded:f,total:m,progress:m?f/m:void 0,bytes:g,rate:p||void 0,estimated:p&&m&&y?(m-f)/p:void 0,event:c,lengthComputable:m!=null,[t?"download":"upload"]:!0};e(S)},a)},e6=(e,t)=>{const a=e!=null;return[r=>t[0]({lengthComputable:a,total:e,loaded:r}),t[1]]},t6=e=>(...t)=>He.asap(()=>e(...t)),DW=xi.hasStandardBrowserEnv?((e,t)=>a=>(a=new URL(a,xi.origin),e.protocol===a.protocol&&e.host===a.host&&(t||e.port===a.port)))(new URL(xi.origin),xi.navigator&&/(msie|trident)/i.test(xi.navigator.userAgent)):()=>!0,NW=xi.hasStandardBrowserEnv?{write(e,t,a,r,l,c){const f=[e+"="+encodeURIComponent(t)];He.isNumber(a)&&f.push("expires="+new Date(a).toGMTString()),He.isString(r)&&f.push("path="+r),He.isString(l)&&f.push("domain="+l),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $W(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function n6(e,t,a){let r=!$W(t);return e&&(r||a==!1)?zW(e,t):t}const a6=e=>e instanceof go?{...e}:e;function jd(e,t){t=t||{};const a={};function r(p,y,S,E){return He.isPlainObject(p)&&He.isPlainObject(y)?He.merge.call({caseless:E},p,y):He.isPlainObject(y)?He.merge({},y):He.isArray(y)?y.slice():y}function l(p,y,S,E){if(He.isUndefined(y)){if(!He.isUndefined(p))return r(void 0,p,S,E)}else return r(p,y,S,E)}function c(p,y){if(!He.isUndefined(y))return r(void 0,y)}function f(p,y){if(He.isUndefined(y)){if(!He.isUndefined(p))return r(void 0,p)}else return r(void 0,y)}function m(p,y,S){if(S in t)return r(p,y);if(S in e)return r(void 0,p)}const g={url:c,method:c,data:c,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:m,headers:(p,y,S)=>l(a6(p),a6(y),S,!0)};return He.forEach(Object.keys(Object.assign({},e,t)),function(y){const S=g[y]||l,E=S(e[y],t[y],y);He.isUndefined(E)&&S!==m||(a[y]=E)}),a}const r6=e=>{const t=jd({},e);let{data:a,withXSRFToken:r,xsrfHeaderName:l,xsrfCookieName:c,headers:f,auth:m}=t;t.headers=f=go.from(f),t.url=Y4(n6(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),m&&f.set("Authorization","Basic "+btoa((m.username||"")+":"+(m.password?unescape(encodeURIComponent(m.password)):"")));let g;if(He.isFormData(a)){if(xi.hasStandardBrowserEnv||xi.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((g=f.getContentType())!==!1){const[p,...y]=g?g.split(";").map(S=>S.trim()).filter(Boolean):[];f.setContentType([p||"multipart/form-data",...y].join("; "))}}if(xi.hasStandardBrowserEnv&&(r&&He.isFunction(r)&&(r=r(t)),r||r!==!1&&DW(t.url))){const p=l&&c&&NW.read(c);p&&f.set(l,p)}return t},jW=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(a,r){const l=r6(e);let c=l.data;const f=go.from(l.headers).normalize();let{responseType:m,onUploadProgress:g,onDownloadProgress:p}=l,y,S,E,T,O;function M(){T&&T(),O&&O(),l.cancelToken&&l.cancelToken.unsubscribe(y),l.signal&&l.signal.removeEventListener("abort",y)}let A=new XMLHttpRequest;A.open(l.method.toUpperCase(),l.url,!0),A.timeout=l.timeout;function D(){if(!A)return;const z=go.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),$={data:!m||m==="text"||m==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:z,config:e,request:A};J4(function(H){a(H),M()},function(H){r(H),M()},$),A=null}"onloadend"in A?A.onloadend=D:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(D)},A.onabort=function(){A&&(r(new xn("Request aborted",xn.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new xn("Network Error",xn.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let j=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const $=l.transitional||W4;l.timeoutErrorMessage&&(j=l.timeoutErrorMessage),r(new xn(j,$.clarifyTimeoutError?xn.ETIMEDOUT:xn.ECONNABORTED,e,A)),A=null},c===void 0&&f.setContentType(null),"setRequestHeader"in A&&He.forEach(f.toJSON(),function(j,$){A.setRequestHeader($,j)}),He.isUndefined(l.withCredentials)||(A.withCredentials=!!l.withCredentials),m&&m!=="json"&&(A.responseType=l.responseType),p&&([E,O]=k1(p,!0),A.addEventListener("progress",E)),g&&A.upload&&([S,T]=k1(g),A.upload.addEventListener("progress",S),A.upload.addEventListener("loadend",T)),(l.cancelToken||l.signal)&&(y=z=>{A&&(r(!z||z.type?new qm(null,e,A):z),A.abort(),A=null)},l.cancelToken&&l.cancelToken.subscribe(y),l.signal&&(l.signal.aborted?y():l.signal.addEventListener("abort",y)));const _=AW(l.url);if(_&&xi.protocols.indexOf(_)===-1){r(new xn("Unsupported protocol "+_+":",xn.ERR_BAD_REQUEST,e));return}A.send(c||null)})},LW=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let r=new AbortController,l;const c=function(p){if(!l){l=!0,m();const y=p instanceof Error?p:this.reason;r.abort(y instanceof xn?y:new qm(y instanceof Error?y.message:y))}};let f=t&&setTimeout(()=>{f=null,c(new xn(`timeout ${t} of ms exceeded`,xn.ETIMEDOUT))},t);const m=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(c):p.removeEventListener("abort",c)}),e=null)};e.forEach(p=>p.addEventListener("abort",c));const{signal:g}=r;return g.unsubscribe=()=>He.asap(m),g}},VW=function*(e,t){let a=e.byteLength;if(a<t){yield e;return}let r=0,l;for(;r<a;)l=r+t,yield e.slice(r,l),r=l},HW=async function*(e,t){for await(const a of BW(e))yield*VW(a,t)},BW=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:a,value:r}=await t.read();if(a)break;yield r}}finally{await t.cancel()}},i6=(e,t,a,r)=>{const l=HW(e,t);let c=0,f,m=g=>{f||(f=!0,r&&r(g))};return new ReadableStream({async pull(g){try{const{done:p,value:y}=await l.next();if(p){m(),g.close();return}let S=y.byteLength;if(a){let E=c+=S;a(E)}g.enqueue(new Uint8Array(y))}catch(p){throw m(p),p}},cancel(g){return m(g),l.return()}},{highWaterMark:2})},G1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",o6=G1&&typeof ReadableStream=="function",PW=G1&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),l6=(e,...t)=>{try{return!!e(...t)}catch{return!1}},UW=o6&&l6(()=>{let e=!1;const t=new Request(xi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),s6=64*1024,dO=o6&&l6(()=>He.isReadableStream(new Response("").body)),q1={stream:dO&&(e=>e.body)};G1&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!q1[t]&&(q1[t]=He.isFunction(e[t])?a=>a[t]():(a,r)=>{throw new xn(`Response type '${t}' is not supported`,xn.ERR_NOT_SUPPORT,r)})})})(new Response);const IW=async e=>{if(e==null)return 0;if(He.isBlob(e))return e.size;if(He.isSpecCompliantForm(e))return(await new Request(xi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(He.isArrayBufferView(e)||He.isArrayBuffer(e))return e.byteLength;if(He.isURLSearchParams(e)&&(e=e+""),He.isString(e))return(await PW(e)).byteLength},FW=async(e,t)=>{const a=He.toFiniteNumber(e.getContentLength());return a??IW(t)},hO={http:cW,xhr:jW,fetch:G1&&(async e=>{let{url:t,method:a,data:r,signal:l,cancelToken:c,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:p,headers:y,withCredentials:S="same-origin",fetchOptions:E}=r6(e);p=p?(p+"").toLowerCase():"text";let T=LW([l,c&&c.toAbortSignal()],f),O;const M=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let A;try{if(g&&UW&&a!=="get"&&a!=="head"&&(A=await FW(y,r))!==0){let $=new Request(t,{method:"POST",body:r,duplex:"half"}),V;if(He.isFormData(r)&&(V=$.headers.get("content-type"))&&y.setContentType(V),$.body){const[H,P]=e6(A,k1(t6(g)));r=i6($.body,s6,H,P)}}He.isString(S)||(S=S?"include":"omit");const D="credentials"in Request.prototype;O=new Request(t,{...E,signal:T,method:a.toUpperCase(),headers:y.normalize().toJSON(),body:r,duplex:"half",credentials:D?S:void 0});let _=await fetch(O,E);const z=dO&&(p==="stream"||p==="response");if(dO&&(m||z&&M)){const $={};["status","statusText","headers"].forEach(q=>{$[q]=_[q]});const V=He.toFiniteNumber(_.headers.get("content-length")),[H,P]=m&&e6(V,k1(t6(m),!0))||[];_=new Response(i6(_.body,s6,H,()=>{P&&P(),M&&M()}),$)}p=p||"text";let j=await q1[He.findKey(q1,p)||"text"](_,e);return!z&&M&&M(),await new Promise(($,V)=>{J4($,V,{data:j,headers:go.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:O})})}catch(D){throw M&&M(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new xn("Network Error",xn.ERR_NETWORK,e,O),{cause:D.cause||D}):xn.from(D,D&&D.code,e,O)}})};He.forEach(hO,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const u6=e=>`- ${e}`,kW=e=>He.isFunction(e)||e===null||e===!1,c6={getAdapter:e=>{e=He.isArray(e)?e:[e];const{length:t}=e;let a,r;const l={};for(let c=0;c<t;c++){a=e[c];let f;if(r=a,!kW(a)&&(r=hO[(f=String(a)).toLowerCase()],r===void 0))throw new xn(`Unknown adapter '${f}'`);if(r)break;l[f||"#"+c]=r}if(!r){const c=Object.entries(l).map(([m,g])=>`adapter ${m} `+(g===!1?"is not supported by the environment":"is not available in the build"));let f=t?c.length>1?`since :
570
570
  `+c.map(u6).join(`
571
571
  `):" "+u6(c[0]):"as no adapter specified";throw new xn("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return r},adapters:hO};function mO(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qm(null,e)}function f6(e){return mO(e),e.headers=go.from(e.headers),e.data=fO.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c6.getAdapter(e.adapter||h0.adapter)(e).then(function(r){return mO(e),r.data=fO.call(e,e.transformResponse,r),r.headers=go.from(r.headers),r},function(r){return Q4(r)||(mO(e),r&&r.response&&(r.response.data=fO.call(e,e.transformResponse,r.response),r.response.headers=go.from(r.response.headers))),Promise.reject(r)})}const d6="1.10.0",Y1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Y1[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const h6={};Y1.transitional=function(t,a,r){function l(c,f){return"[Axios v"+d6+"] Transitional option '"+c+"'"+f+(r?". "+r:"")}return(c,f,m)=>{if(t===!1)throw new xn(l(f," has been removed"+(a?" in "+a:"")),xn.ERR_DEPRECATED);return a&&!h6[f]&&(h6[f]=!0,console.warn(l(f," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(c,f,m):!0}},Y1.spelling=function(t){return(a,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function GW(e,t,a){if(typeof e!="object")throw new xn("options must be an object",xn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let l=r.length;for(;l-- >0;){const c=r[l],f=t[c];if(f){const m=e[c],g=m===void 0||f(m,c,e);if(g!==!0)throw new xn("option "+c+" must be "+g,xn.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new xn("Unknown option "+c,xn.ERR_BAD_OPTION)}}const X1={assertOptions:GW,validators:Y1},Zs=X1.validators;let Ld=class{constructor(t){this.defaults=t||{},this.interceptors={request:new X4,response:new X4}}async request(t,a){try{return await this._request(t,a)}catch(r){if(r instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const c=l.stack?l.stack.replace(/^.+\n/,""):"";try{r.stack?c&&!String(r.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(r.stack+=`
572
- `+c):r.stack=c}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=jd(this.defaults,a);const{transitional:r,paramsSerializer:l,headers:c}=a;r!==void 0&&X1.assertOptions(r,{silentJSONParsing:Zs.transitional(Zs.boolean),forcedJSONParsing:Zs.transitional(Zs.boolean),clarifyTimeoutError:Zs.transitional(Zs.boolean)},!1),l!=null&&(He.isFunction(l)?a.paramsSerializer={serialize:l}:X1.assertOptions(l,{encode:Zs.function,serialize:Zs.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),X1.assertOptions(a,{baseUrl:Zs.spelling("baseURL"),withXsrfToken:Zs.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let f=c&&He.merge(c.common,c[a.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],O=>{delete c[O]}),a.headers=go.concat(f,c);const m=[];let g=!0;this.interceptors.request.forEach(function(M){typeof M.runWhen=="function"&&M.runWhen(a)===!1||(g=g&&M.synchronous,m.unshift(M.fulfilled,M.rejected))});const p=[];this.interceptors.response.forEach(function(M){p.push(M.fulfilled,M.rejected)});let y,S=0,E;if(!g){const O=[f6.bind(this),void 0];for(O.unshift.apply(O,m),O.push.apply(O,p),E=O.length,y=Promise.resolve(a);S<E;)y=y.then(O[S++],O[S++]);return y}E=m.length;let T=a;for(S=0;S<E;){const O=m[S++],M=m[S++];try{T=O(T)}catch(A){M.call(this,A);break}}try{y=f6.call(this,T)}catch(O){return Promise.reject(O)}for(S=0,E=p.length;S<E;)y=y.then(p[S++],p[S++]);return y}getUri(t){t=jd(this.defaults,t);const a=n6(t.baseURL,t.url,t.allowAbsoluteUrls);return Y4(a,t.params,t.paramsSerializer)}};He.forEach(["delete","get","head","options"],function(t){Ld.prototype[t]=function(a,r){return this.request(jd(r||{},{method:t,url:a,data:(r||{}).data}))}}),He.forEach(["post","put","patch"],function(t){function a(r){return function(c,f,m){return this.request(jd(m||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}Ld.prototype[t]=a(),Ld.prototype[t+"Form"]=a(!0)});let qW=class o8{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(c){a=c});const r=this;this.promise.then(l=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](l);r._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(m=>{r.subscribe(m),c=m}).then(l);return f.cancel=function(){r.unsubscribe(c)},f},t(function(c,f,m){r.reason||(r.reason=new qm(c,f,m),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new o8(function(l){t=l}),cancel:t}}};function YW(e){return function(a){return e.apply(null,a)}}function XW(e){return He.isObject(e)&&e.isAxiosError===!0}const pO={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pO).forEach(([e,t])=>{pO[t]=e});function m6(e){const t=new Ld(e),a=N4(Ld.prototype.request,t);return He.extend(a,Ld.prototype,t,{allOwnKeys:!0}),He.extend(a,t,null,{allOwnKeys:!0}),a.create=function(l){return m6(jd(e,l))},a}const $a=m6(h0);$a.Axios=Ld,$a.CanceledError=qm,$a.CancelToken=qW,$a.isCancel=Q4,$a.VERSION=d6,$a.toFormData=I1,$a.AxiosError=xn,$a.Cancel=$a.CanceledError,$a.all=function(t){return Promise.all(t)},$a.spread=YW,$a.isAxiosError=XW,$a.mergeConfig=jd,$a.AxiosHeaders=go,$a.formToJSON=e=>Z4(He.isHTMLForm(e)?new FormData(e):e),$a.getAdapter=c6.getAdapter,$a.HttpStatusCode=pO,$a.default=$a;const{Axios:Iie,AxiosError:Fie,CanceledError:kie,isCancel:Gie,CancelToken:qie,VERSION:Yie,all:Xie,Cancel:Wie,isAxiosError:Zie,spread:Kie,toFormData:Qie,AxiosHeaders:Jie,HttpStatusCode:eoe,formToJSON:toe,getAdapter:noe,mergeConfig:aoe}=$a;/*! js-cookie v3.0.5 | MIT */function W1(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)e[r]=a[r]}return e}var WW={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function gO(e,t){function a(l,c,f){if(!(typeof document>"u")){f=W1({},t,f),typeof f.expires=="number"&&(f.expires=new Date(Date.now()+f.expires*864e5)),f.expires&&(f.expires=f.expires.toUTCString()),l=encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var m="";for(var g in f)f[g]&&(m+="; "+g,f[g]!==!0&&(m+="="+f[g].split(";")[0]));return document.cookie=l+"="+e.write(c,l)+m}}function r(l){if(!(typeof document>"u"||arguments.length&&!l)){for(var c=document.cookie?document.cookie.split("; "):[],f={},m=0;m<c.length;m++){var g=c[m].split("="),p=g.slice(1).join("=");try{var y=decodeURIComponent(g[0]);if(f[y]=e.read(p,y),l===y)break}catch{}}return l?f[l]:f}}return Object.create({set:a,get:r,remove:function(l,c){a(l,"",W1({},c,{expires:-1}))},withAttributes:function(l){return gO(this.converter,W1({},this.attributes,l))},withConverter:function(l){return gO(W1({},this.converter,l),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ZW=gO(WW,{path:"/"});const nf=e=>ZW.get(e),Ei={apiUrl:"http://localhost:8000/api/",websocketUrl:"ws://localhost:8000/ws"},sn=e=>typeof e=="string",p0=()=>{let e,t;const a=new Promise((r,l)=>{e=r,t=l});return a.resolve=e,a.reject=t,a},p6=e=>e==null?"":""+e,KW=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},QW=/###/g,g6=e=>e&&e.indexOf("###")>-1?e.replace(QW,"."):e,v6=e=>!e||sn(e),g0=(e,t,a)=>{const r=sn(t)?t.split("."):t;let l=0;for(;l<r.length-1;){if(v6(e))return{};const c=g6(r[l]);!e[c]&&a&&(e[c]=new a),Object.prototype.hasOwnProperty.call(e,c)?e=e[c]:e={},++l}return v6(e)?{}:{obj:e,k:g6(r[l])}},y6=(e,t,a)=>{const{obj:r,k:l}=g0(e,t,Object);if(r!==void 0||t.length===1){r[l]=a;return}let c=t[t.length-1],f=t.slice(0,t.length-1),m=g0(e,f,Object);for(;m.obj===void 0&&f.length;)c=`${f[f.length-1]}.${c}`,f=f.slice(0,f.length-1),m=g0(e,f,Object),m?.obj&&typeof m.obj[`${m.k}.${c}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${c}`]=a},JW=(e,t,a,r)=>{const{obj:l,k:c}=g0(e,t,Object);l[c]=l[c]||[],l[c].push(a)},Z1=(e,t)=>{const{obj:a,k:r}=g0(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},eZ=(e,t,a)=>{const r=Z1(e,a);return r!==void 0?r:Z1(t,a)},b6=(e,t,a)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?sn(e[r])||e[r]instanceof String||sn(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):b6(e[r],t[r],a):e[r]=t[r]);return e},Ym=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var tZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const nZ=e=>sn(e)?e.replace(/[&<>"'\/]/g,t=>tZ[t]):e;class aZ{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rZ=[" ",",","?","!",";"],iZ=new aZ(20),oZ=(e,t,a)=>{t=t||"",a=a||"";const r=rZ.filter(f=>t.indexOf(f)<0&&a.indexOf(f)<0);if(r.length===0)return!0;const l=iZ.getRegExp(`(${r.map(f=>f==="?"?"\\?":f).join("|")})`);let c=!l.test(e);if(!c){const f=e.indexOf(a);f>0&&!l.test(e.substring(0,f))&&(c=!0)}return c},vO=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(a);let l=e;for(let c=0;c<r.length;){if(!l||typeof l!="object")return;let f,m="";for(let g=c;g<r.length;++g)if(g!==c&&(m+=a),m+=r[g],f=l[m],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<r.length-1)continue;c+=g-c+1;break}l=f}return l},v0=e=>e?.replace("_","-"),lZ={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class K1{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||lZ,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,r,l){return l&&!this.debug?null:(sn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new K1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new K1(this.logger,t)}}var Ks=new K1;class Q1{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const l=this.observers[r].get(a)||0;this.observers[r].set(a,l+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l.apply(l,[t,...a])})}}class S6 extends Q1{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,l={}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,f=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;t.indexOf(".")>-1?m=t.split("."):(m=[t,a],r&&(Array.isArray(r)?m.push(...r):sn(r)&&c?m.push(...r.split(c)):m.push(r)));const g=Z1(this.data,m);return!g&&!a&&!r&&t.indexOf(".")>-1&&(t=m[0],a=m[1],r=m.slice(2).join(".")),g||!f||!sn(r)?g:vO(this.data?.[t]?.[a],r,c)}addResource(t,a,r,l,c={silent:!1}){const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[t,a];r&&(m=m.concat(f?r.split(f):r)),t.indexOf(".")>-1&&(m=t.split("."),l=a,a=m[1]),this.addNamespaces(a),y6(this.data,m,l),c.silent||this.emit("added",t,a,r,l)}addResources(t,a,r,l={silent:!1}){for(const c in r)(sn(r[c])||Array.isArray(r[c]))&&this.addResource(t,a,c,r[c],{silent:!0});l.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,l,c,f={silent:!1,skipCopy:!1}){let m=[t,a];t.indexOf(".")>-1&&(m=t.split("."),l=r,r=a,a=m[1]),this.addNamespaces(a);let g=Z1(this.data,m)||{};f.skipCopy||(r=JSON.parse(JSON.stringify(r))),l?b6(g,r,c):g={...g,...r},y6(this.data,m,g),f.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(l=>a[l]&&Object.keys(a[l]).length>0)}toJSON(){return this.data}}var C6={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,l){return e.forEach(c=>{t=this.processors[c]?.process(t,a,r,l)??t}),t}};const x6={},E6=e=>!sn(e)&&typeof e!="boolean"&&typeof e!="number";class J1 extends Q1{constructor(t,a={}){super(),KW(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ks.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const r={...a};return t==null?!1:this.resolve(t,r)?.res!==void 0}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const f=r&&t.indexOf(r)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!oZ(t,r,l);if(f&&!m){const g=t.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:t,namespaces:sn(c)?[c]:c};const p=t.split(r);(r!==l||r===l&&this.options.ns.indexOf(p[0])>-1)&&(c=p.shift()),t=p.join(l)}return{key:t,namespaces:sn(c)?[c]:c}}translate(t,a,r){let l=typeof a=="object"?{...a}:a;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(l={...l}),l||(l={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const c=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(t[t.length-1],l),p=g[g.length-1];let y=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const S=l.lng||this.language,E=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(S?.toLowerCase()==="cimode")return E?c?{res:`${p}${y}${m}`,usedKey:m,exactUsedKey:m,usedLng:S,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:`${p}${y}${m}`:c?{res:m,usedKey:m,exactUsedKey:m,usedLng:S,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:m;const T=this.resolve(t,l);let O=T?.res;const M=T?.usedKey||m,A=T?.exactUsedKey||m,D=["[object Number]","[object Function]","[object RegExp]"],_=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,j=l.count!==void 0&&!sn(l.count),$=J1.hasDefaultValue(l),V=j?this.pluralResolver.getSuffix(S,l.count,l):"",H=l.ordinal&&j?this.pluralResolver.getSuffix(S,l.count,{ordinal:!1}):"",P=j&&!l.ordinal&&l.count===0,q=P&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${V}`]||l[`defaultValue${H}`]||l.defaultValue;let Y=O;z&&!O&&$&&(Y=q);const te=E6(Y),G=Object.prototype.toString.apply(Y);if(z&&Y&&te&&D.indexOf(G)<0&&!(sn(_)&&Array.isArray(Y))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(M,Y,{...l,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return c?(T.res=K,T.usedParams=this.getUsedParamsDetails(l),T):K}if(f){const K=Array.isArray(Y),J=K?[]:{},ie=K?A:M;for(const k in Y)if(Object.prototype.hasOwnProperty.call(Y,k)){const X=`${ie}${f}${k}`;$&&!O?J[k]=this.translate(X,{...l,defaultValue:E6(q)?q[k]:void 0,joinArrays:!1,ns:g}):J[k]=this.translate(X,{...l,joinArrays:!1,ns:g}),J[k]===X&&(J[k]=Y[k])}O=J}}else if(z&&sn(_)&&Array.isArray(O))O=O.join(_),O&&(O=this.extendTranslation(O,t,l,r));else{let K=!1,J=!1;!this.isValidLookup(O)&&$&&(K=!0,O=q),this.isValidLookup(O)||(J=!0,O=m);const k=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&J?void 0:O,X=$&&q!==O&&this.options.updateMissing;if(J||K||X){if(this.logger.log(X?"updateKey":"missingKey",S,p,m,X?q:O),f){const F=this.resolve(m,{...l,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Q=[];const le=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&le&&le[0])for(let F=0;F<le.length;F++)Q.push(le[F]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(l.lng||this.language):Q.push(l.lng||this.language);const U=(F,ne,ae)=>{const oe=$&&ae!==O?ae:k;this.options.missingKeyHandler?this.options.missingKeyHandler(F,p,ne,oe,X,l):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,p,ne,oe,X,l),this.emit("missingKey",F,p,ne,O)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?Q.forEach(F=>{const ne=this.pluralResolver.getSuffixes(F,l);P&&l[`defaultValue${this.options.pluralSeparator}zero`]&&ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&ne.push(`${this.options.pluralSeparator}zero`),ne.forEach(ae=>{U([F],m+ae,l[`defaultValue${ae}`]||q)})}):U(Q,m,q))}O=this.extendTranslation(O,t,l,T,r),J&&O===m&&this.options.appendNamespaceToMissingKey&&(O=`${p}${y}${m}`),(J||K)&&this.options.parseMissingKeyHandler&&(O=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${y}${m}`:m,K?O:void 0,l))}return c?(T.res=O,T.usedParams=this.getUsedParamsDetails(l),T):O}extendTranslation(t,a,r,l,c){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const g=sn(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(g){const S=t.match(this.interpolator.nestingRegexp);p=S&&S.length}let y=r.replace&&!sn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||l.usedLng,r),g){const S=t.match(this.interpolator.nestingRegexp),E=S&&S.length;p<E&&(r.nest=!1)}!r.lng&&l&&l.res&&(r.lng=this.language||l.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...S)=>c?.[0]===S[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${S[0]} in key: ${a[0]}`),null):this.translate(...S,a),r)),r.interpolation&&this.interpolator.reset()}const f=r.postProcess||this.options.postProcess,m=sn(f)?[f]:f;return t!=null&&m?.length&&r.applyPostProcessor!==!1&&(t=C6.handle(m,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,a={}){let r,l,c,f,m;return sn(t)&&(t=[t]),t.forEach(g=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(g,a),y=p.key;l=y;let S=p.namespaces;this.options.fallbackNS&&(S=S.concat(this.options.fallbackNS));const E=a.count!==void 0&&!sn(a.count),T=E&&!a.ordinal&&a.count===0,O=a.context!==void 0&&(sn(a.context)||typeof a.context=="number")&&a.context!=="",M=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);S.forEach(A=>{this.isValidLookup(r)||(m=A,!x6[`${M[0]}-${A}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(x6[`${M[0]}-${A}`]=!0,this.logger.warn(`key "${l}" for languages "${M.join(", ")}" won't get resolved as namespace "${m}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),M.forEach(D=>{if(this.isValidLookup(r))return;f=D;const _=[y];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(_,y,D,A,a);else{let j;E&&(j=this.pluralResolver.getSuffix(D,a.count,a));const $=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(E&&(_.push(y+j),a.ordinal&&j.indexOf(V)===0&&_.push(y+j.replace(V,this.options.pluralSeparator)),T&&_.push(y+$)),O){const H=`${y}${this.options.contextSeparator}${a.context}`;_.push(H),E&&(_.push(H+j),a.ordinal&&j.indexOf(V)===0&&_.push(H+j.replace(V,this.options.pluralSeparator)),T&&_.push(H+$))}}let z;for(;z=_.pop();)this.isValidLookup(r)||(c=z,r=this.getResource(D,A,z,a))}))})}),{res:r,usedKey:l,exactUsedKey:c,usedLng:f,usedNS:m}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,l={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,r,l):this.resourceStore.getResource(t,a,r,l)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!sn(t.replace);let l=r?t.replace:t;if(r&&typeof t.count<"u"&&(l.count=t.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!r){l={...l};for(const c of a)delete l[c]}return l}static hasDefaultValue(t){const a="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}}class w6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ks.create("languageUtils")}getScriptPartFromCode(t){if(t=v0(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=v0(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(sn(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let a;return t.forEach(r=>{if(a)return;const l=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(l))&&(a=l)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;const l=this.getScriptPartFromCode(r);if(this.isSupportedCode(l))return a=l;const c=this.getLanguagePartFromCode(r);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(f=>{if(f===c)return f;if(!(f.indexOf("-")<0&&c.indexOf("-")<0)&&(f.indexOf("-")>0&&c.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===c||f.indexOf(c)===0&&c.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),sn(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),l=[],c=f=>{f&&(this.isSupportedCode(f)?l.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return sn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(t))):sn(t)&&c(this.formatLanguageCode(t)),r.forEach(f=>{l.indexOf(f)<0&&c(this.formatLanguageCode(f))}),l}}const T6={zero:0,one:1,two:2,few:3,many:4,other:5},O6={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class sZ{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Ks.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const r=v0(t==="dev"?"en":t),l=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:r,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let f;try{f=new Intl.PluralRules(r,{type:l})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),O6;if(!t.match(/-|_/))return O6;const g=this.languageUtils.getLanguagePartFromCode(t);f=this.getRule(g,a)}return this.pluralRulesCache[c]=f,f}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(l=>`${a}${l}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((l,c)=>T6[l]-T6[c]).map(l=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(t,a,r={}){const l=this.getRule(t,r);return l?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${l.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}}const R6=(e,t,a,r=".",l=!0)=>{let c=eZ(e,t,a);return!c&&l&&sn(a)&&(c=vO(e,a,r),c===void 0&&(c=vO(t,a,r))),c},yO=e=>e.replace(/\$/g,"$$$$");class uZ{constructor(t={}){this.logger=Ks.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:l,prefix:c,prefixEscaped:f,suffix:m,suffixEscaped:g,formatSeparator:p,unescapeSuffix:y,unescapePrefix:S,nestingPrefix:E,nestingPrefixEscaped:T,nestingSuffix:O,nestingSuffixEscaped:M,nestingOptionsSeparator:A,maxReplaces:D,alwaysFormat:_}=t.interpolation;this.escape=a!==void 0?a:nZ,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?Ym(c):f||"{{",this.suffix=m?Ym(m):g||"}}",this.formatSeparator=p||",",this.unescapePrefix=y?"":S||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=E?Ym(E):T||Ym("$t("),this.nestingSuffix=O?Ym(O):M||Ym(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=D||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,r)=>a?.source===r?(a.lastIndex=0,a):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,a,r,l){let c,f,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=T=>{if(T.indexOf(this.formatSeparator)<0){const D=R6(a,g,T,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,r,{...l,...a,interpolationkey:T}):D}const O=T.split(this.formatSeparator),M=O.shift().trim(),A=O.join(this.formatSeparator).trim();return this.format(R6(a,g,M,this.options.keySeparator,this.options.ignoreJSONStructure),A,r,{...l,...a,interpolationkey:M})};this.resetRegExp();const y=l?.missingInterpolationHandler||this.options.missingInterpolationHandler,S=l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:T=>yO(T)},{regex:this.regexp,safeValue:T=>this.escapeValue?yO(this.escape(T)):yO(T)}].forEach(T=>{for(m=0;c=T.regex.exec(t);){const O=c[1].trim();if(f=p(O),f===void 0)if(typeof y=="function"){const A=y(t,c,l);f=sn(A)?A:""}else if(l&&Object.prototype.hasOwnProperty.call(l,O))f="";else if(S){f=c[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${t}`),f="";else!sn(f)&&!this.useRawValueToEscape&&(f=p6(f));const M=T.safeValue(f);if(t=t.replace(c[0],M),S?(T.regex.lastIndex+=f.length,T.regex.lastIndex-=c[0].length):T.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),t}nest(t,a,r={}){let l,c,f;const m=(g,p)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const S=g.split(new RegExp(`${y}[ ]*{`));let E=`{${S[1]}`;g=S[0],E=this.interpolate(E,f);const T=E.match(/'/g),O=E.match(/"/g);((T?.length??0)%2===0&&!O||O.length%2!==0)&&(E=E.replace(/'/g,'"'));try{f=JSON.parse(E),p&&(f={...p,...f})}catch(M){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,M),`${g}${y}${E}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;l=this.nestingRegexp.exec(t);){let g=[];f={...r},f=f.replace&&!sn(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const p=/{.*}/.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(p!==-1&&(g=l[1].slice(p).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),l[1]=l[1].slice(0,p)),c=a(m.call(this,l[1].trim(),f),f),c&&l[0]===t&&!sn(c))return c;sn(c)||(c=p6(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${t}`),c=""),g.length&&(c=g.reduce((y,S)=>this.format(y,S,r.lng,{...r,interpolationkey:l[1].trim()}),c.trim())),t=t.replace(l[0],c),this.regexp.lastIndex=0}return t}}const cZ=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const l=r[1].substring(0,r[1].length-1);t==="currency"&&l.indexOf(":")<0?a.currency||(a.currency=l.trim()):t==="relativetime"&&l.indexOf(":")<0?a.range||(a.range=l.trim()):l.split(";").forEach(f=>{if(f){const[m,...g]=f.split(":"),p=g.join(":").trim().replace(/^'+|'+$/g,""),y=m.trim();a[y]||(a[y]=p),p==="false"&&(a[y]=!1),p==="true"&&(a[y]=!0),isNaN(p)||(a[y]=parseInt(p,10))}})}return{formatName:t,formatOptions:a}},A6=e=>{const t={};return(a,r,l)=>{let c=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(c={...c,[l.interpolationkey]:void 0});const f=r+JSON.stringify(c);let m=t[f];return m||(m=e(v0(r),l),t[f]=m),m(a)}},fZ=e=>(t,a,r)=>e(v0(a),r)(t);class dZ{constructor(t={}){this.logger=Ks.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?A6:fZ;this.formats={number:r((l,c)=>{const f=new Intl.NumberFormat(l,{...c});return m=>f.format(m)}),currency:r((l,c)=>{const f=new Intl.NumberFormat(l,{...c,style:"currency"});return m=>f.format(m)}),datetime:r((l,c)=>{const f=new Intl.DateTimeFormat(l,{...c});return m=>f.format(m)}),relativetime:r((l,c)=>{const f=new Intl.RelativeTimeFormat(l,{...c});return m=>f.format(m,c.range||"day")}),list:r((l,c)=>{const f=new Intl.ListFormat(l,{...c});return m=>f.format(m)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=A6(a)}format(t,a,r,l={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(m=>m.indexOf(")")>-1)){const m=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,m)].join(this.formatSeparator)}return c.reduce((m,g)=>{const{formatName:p,formatOptions:y}=cZ(g);if(this.formats[p]){let S=m;try{const E=l?.formatParams?.[l.interpolationkey]||{},T=E.locale||E.lng||l.locale||l.lng||r;S=this.formats[p](m,T,{...y,...l,...E})}catch(E){this.logger.warn(E)}return S}else this.logger.warn(`there was no format function for ${p}`);return m},t)}}const hZ=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mZ extends Q1{constructor(t,a,r,l={}){super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=l,this.logger=Ks.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,l.backend,l)}queueLoad(t,a,r,l){const c={},f={},m={},g={};return t.forEach(p=>{let y=!0;a.forEach(S=>{const E=`${p}|${S}`;!r.reload&&this.store.hasResourceBundle(p,S)?this.state[E]=2:this.state[E]<0||(this.state[E]===1?f[E]===void 0&&(f[E]=!0):(this.state[E]=1,y=!1,f[E]===void 0&&(f[E]=!0),c[E]===void 0&&(c[E]=!0),g[S]===void 0&&(g[S]=!0)))}),y||(m[p]=!0)}),(Object.keys(c).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(f),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(t,a,r){const l=t.split("|"),c=l[0],f=l[1];a&&this.emit("failedLoading",c,f,a),!a&&r&&this.store.addResourceBundle(c,f,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);const m={};this.queue.forEach(g=>{JW(g.loaded,[c],f),hZ(g,t),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(p=>{m[p]||(m[p]={});const y=g.loaded[p];y.length&&y.forEach(S=>{m[p][S]===void 0&&(m[p][S]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(t,a,r,l=0,c=this.retryTimeout,f){if(!t.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:l,wait:c,callback:f});return}this.readingCalls++;const m=(p,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const S=this.waitingReads.shift();this.read(S.lng,S.ns,S.fcName,S.tried,S.wait,S.callback)}if(p&&y&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,l+1,c*2,f)},c);return}f(p,y)},g=this.backend[r].bind(this.backend);if(g.length===2){try{const p=g(t,a);p&&typeof p.then=="function"?p.then(y=>m(null,y)).catch(m):m(null,p)}catch(p){m(p)}return}return g(t,a,m)}prepareLoading(t,a,r={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();sn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),sn(a)&&(a=[a]);const c=this.queueLoad(t,a,r,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(f=>{this.loadOne(f)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){const r=t.split("|"),l=r[0],c=r[1];this.read(l,c,"read",void 0,void 0,(f,m)=>{f&&this.logger.warn(`${a}loading namespace ${c} for language ${l} failed`,f),!f&&m&&this.logger.log(`${a}loaded namespace ${c} for language ${l}`,m),this.loaded(t,f,m)})}saveMissing(t,a,r,l,c,f={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const g={...f,isUpdate:c},p=this.backend.create.bind(this.backend);if(p.length<6)try{let y;p.length===5?y=p(t,a,r,l,g):y=p(t,a,r,l),y&&typeof y.then=="function"?y.then(S=>m(null,S)).catch(m):m(null,y)}catch(y){m(y)}else p(t,a,r,l,m,g)}!t||!t[0]||this.store.addResource(t[0],a,r,l)}}}const M6=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),sn(e[1])&&(t.defaultValue=e[1]),sn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_6=e=>(sn(e.ns)&&(e.ns=[e.ns]),sn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),sn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),eC=()=>{},pZ=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class y0 extends Q1{constructor(t={},a){if(super(),this.options=_6(t),this.services={},this.logger=Ks,this.modules={external:[]},pZ(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(sn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=M6();this.options={...r,...this.options,..._6(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const l=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ks.init(l(this.modules.logger),this.options):Ks.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=dZ;const y=new w6(this.options);this.store=new S6(this.options.resources,this.options);const S=this.services;S.logger=Ks,S.resourceStore=this.store,S.languageUtils=y,S.pluralResolver=new sZ(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(S.formatter=l(p),S.formatter.init&&S.formatter.init(S,this.options),this.options.interpolation.format=S.formatter.format.bind(S.formatter)),S.interpolator=new uZ(this.options),S.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},S.backendConnector=new mZ(l(this.modules.backend),S.resourceStore,S,this.options),S.backendConnector.on("*",(T,...O)=>{this.emit(T,...O)}),this.modules.languageDetector&&(S.languageDetector=l(this.modules.languageDetector),S.languageDetector.init&&S.languageDetector.init(S,this.options.detection,this.options)),this.modules.i18nFormat&&(S.i18nFormat=l(this.modules.i18nFormat),S.i18nFormat.init&&S.i18nFormat.init(this)),this.translator=new J1(this.services,this.options),this.translator.on("*",(T,...O)=>{this.emit(T,...O)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,a||(a=eC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...y)=>this.store[p](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...y)=>(this.store[p](...y),this)});const m=p0(),g=()=>{const p=(y,S)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(S),a(y,S)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(t,a=eC){let r=a;const l=sn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(l?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&c.indexOf(p)<0&&c.push(p)})};l?f(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>f(g)),this.options.preload?.forEach?.(m=>f(m)),this.services.backendConnector.load(c,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(m)})}else r(null)}reloadResources(t,a,r){const l=p0();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=eC),this.services.backendConnector.reload(t,a,c=>{l.resolve(),r(c)}),l}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&C6.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a<this.languages.length;a++){const r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const r=p0();this.emit("languageChanging",t);const l=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},c=(m,g)=>{g?this.isLanguageChangingTo===t&&(l(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,r.resolve((...p)=>this.t(...p)),a&&a(m,(...p)=>this.t(...p))},f=m=>{!t&&!m&&this.services.languageDetector&&(m=[]);const g=sn(m)?m:m&&m[0],p=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(sn(m)?[m]:m);p&&(this.language||l(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,y=>{c(y,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(t),r}getFixedT(t,a,r){const l=(c,f,...m)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([c,f].concat(m)):g={...f},g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||r||l.keyPrefix);const p=this.options.keySeparator||".";let y;return g.keyPrefix&&Array.isArray(c)?y=c.map(S=>`${g.keyPrefix}${p}${S}`):y=g.keyPrefix?`${g.keyPrefix}${p}${c}`:c,this.t(y,g)};return sn(t)?l.lng=t:l.lngs=t,l.ns=a,l.keyPrefix=r,l}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=a.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const f=(m,g)=>{const p=this.services.backendConnector.state[`${m}|${g}`];return p===-1||p===0||p===2};if(a.precheck){const m=a.precheck(this,f);if(m!==void 0)return m}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(r,t)&&(!l||f(c,t)))}loadNamespaces(t,a){const r=p0();return this.options.ns?(sn(t)&&(t=[t]),t.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{r.resolve(),a&&a(l)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){const r=p0();sn(t)&&(t=[t]);const l=this.options.preload||[],c=t.filter(f=>l.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return c.length?(this.options.preload=l.concat(c),this.loadResources(f=>{r.resolve(),a&&a(f)}),r):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new w6(M6());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){return new y0(t,a)}cloneInstance(t={},a=eC){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const l={...this.options,...t,isClone:!0},c=new y0(l);if((t.debug!==void 0||t.prefix!==void 0)&&(c.logger=c.logger.clone(t)),["store","services","language"].forEach(m=>{c[m]=this[m]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},r){const m=Object.keys(this.store.data).reduce((g,p)=>(g[p]={...this.store.data[p]},g[p]=Object.keys(g[p]).reduce((y,S)=>(y[S]={...g[p][S]},y),g[p]),g),{});c.store=new S6(m,l),c.services.resourceStore=c.store}return c.translator=new J1(c.services,l),c.translator.on("*",(m,...g)=>{c.emit(m,...g)}),c.init(l,a),c.translator.options=l,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Zr=y0.createInstance();Zr.createInstance=y0.createInstance,Zr.createInstance,Zr.dir,Zr.init,Zr.loadResources,Zr.reloadResources,Zr.use,Zr.changeLanguage,Zr.getFixedT,Zr.t,Zr.exists,Zr.setDefaultNamespace,Zr.hasLoadedNamespace,Zr.loadNamespaces,Zr.loadLanguages;const gZ=(e,t,a,r)=>{const l=[a,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(l,"warn","react-i18next::",!0);Vd(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...l):console?.warn&&console.warn(...l)},D6={},bO=(e,t,a,r)=>{Vd(a)&&D6[a]||(Vd(a)&&(D6[a]=new Date),gZ(e,t,a,r))},N6=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},SO=(e,t,a)=>{e.loadNamespaces(t,N6(e,a))},$6=(e,t,a,r)=>{if(Vd(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return SO(e,a,r);a.forEach(l=>{e.options.ns.indexOf(l)<0&&e.options.ns.push(l)}),e.loadLanguages(t,N6(e,r))},vZ=(e,t,a={})=>!t.languages||!t.languages.length?(bO(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,l)=>{if(a.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!l(r.isLanguageChangingTo,e))return!1}}),Vd=e=>typeof e=="string",yZ=e=>typeof e=="object"&&e!==null,bZ=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SZ={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},CZ=e=>SZ[e];let CO={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(bZ,CZ)};const xZ=(e={})=>{CO={...CO,...e}},EZ=()=>CO;let z6;const wZ=e=>{z6=e},TZ=()=>z6,OZ={type:"3rdParty",init(e){xZ(e.options.react),wZ(e)}},RZ=C.createContext();class AZ{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const MZ=(e,t)=>{const a=C.useRef();return C.useEffect(()=>{a.current=e},[e,t]),a.current},j6=(e,t,a,r)=>e.getFixedT(t,a,r),_Z=(e,t,a,r)=>C.useCallback(j6(e,t,a,r),[e,t,a,r]),DZ=(e,t={})=>{const{i18n:a}=t,{i18n:r,defaultNS:l}=C.useContext(RZ)||{},c=a||r||TZ();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new AZ),!c){bO(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const j=(V,H)=>Vd(H)?H:yZ(H)&&Vd(H.defaultValue)?H.defaultValue:Array.isArray(V)?V[V.length-1]:V,$=[j,{},!1];return $.t=j,$.i18n={},$.ready=!1,$}c.options.react?.wait&&bO(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const f={...EZ(),...c.options.react,...t},{useSuspense:m,keyPrefix:g}=f;let p=l||c.options?.defaultNS;p=Vd(p)?[p]:p||["translation"],c.reportNamespaces.addUsedNamespaces?.(p);const y=(c.isInitialized||c.initializedStoreOnce)&&p.every(j=>vZ(j,c,f)),S=_Z(c,t.lng||null,f.nsMode==="fallback"?p:p[0],g),E=()=>S,T=()=>j6(c,t.lng||null,f.nsMode==="fallback"?p:p[0],g),[O,M]=C.useState(E);let A=p.join();t.lng&&(A=`${t.lng}${A}`);const D=MZ(A),_=C.useRef(!0);C.useEffect(()=>{const{bindI18n:j,bindI18nStore:$}=f;_.current=!0,!y&&!m&&(t.lng?$6(c,t.lng,p,()=>{_.current&&M(T)}):SO(c,p,()=>{_.current&&M(T)})),y&&D&&D!==A&&_.current&&M(T);const V=()=>{_.current&&M(T)};return j&&c?.on(j,V),$&&c?.store.on($,V),()=>{_.current=!1,c&&j?.split(" ").forEach(H=>c.off(H,V)),$&&c&&$.split(" ").forEach(H=>c.store.off(H,V))}},[c,A]),C.useEffect(()=>{_.current&&y&&M(E)},[c,g,y]);const z=[O,c,y];if(z.t=O,z.i18n=c,z.ready=y,y||!y&&!m)return z;throw new Promise(j=>{t.lng?$6(c,t.lng,p,()=>j()):SO(c,p,()=>j())})},NZ={en:{translation:{welcome:"Hi there, you’re speaking with Jaweb AI Assistant."}},ar:{translation:{welcome:"مرحبًا، أنت تتحدث إلى مساعد Jaweb AI."}}};Zr.use(OZ).init({resources:NZ,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const $Z=3,zZ=3e3,jZ=()=>{const[e,t]=C.useState(!0),[a,r]=C.useState(!1),[l,c]=C.useState(""),[f,m]=C.useState(""),[g,p]=C.useState(!1),[y,S]=C.useState(!1),[E,T]=C.useState(""),[O,M]=C.useState(""),[A,D]=C.useState(""),[_,z]=C.useState(""),[j,$]=C.useState([]),[V,H]=C.useState([]),[P,q]=C.useState(""),Y=async(te=0)=>{const G=nf("company_username");t(!0);const K={headers:{"Content-Type":"application/json",Accept:"application/json"},params:{username:G}};try{const ie=(await $a.get(`${Ei.apiUrl}chatbot-details/`,K)).data.data;ie.language==="Arabic"?Zr.changeLanguage("ar"):Zr.changeLanguage("en"),r(ie.chatbot_form),c(ie.chatbot_color),m(ie.chatbot_logo),p(ie.disable_chatbot_globally),S(ie.remove_powered_by_jaweb),T(ie.chatbot_initial_msg),M(ie.status),q(ie.mode),console.log(ie),ie.calendly_link&&D(ie.calendly_link),ie.phone_number_id&&z(`+${ie.phone_number_id}`);const k=await $a.get(`${Ei.apiUrl}chatbot-plugin-suggestions/`,K);let X=[];Array.isArray(k.data.data)?X=k.data.data:Array.isArray(k.data.user_questions)&&(X=k.data.user_questions),X.length>0?($(X.slice(0,3)),H(X.slice(3))):($([]),H([])),t(!1)}catch(J){console.error("Error fetching data:",J),te<$Z?setTimeout(()=>Y(te+1),zZ):console.error("Max retries reached. Could not fetch data.")}};return C.useEffect(()=>{Y()},[]),{isFetchingDetails:e,disableForm:a,colorCode:l,chatbotLogo:f,disableChatbotGlobally:g,removePoweredByJaweb:y,initialMessageText:E,subscription:O,calendly:A,merchantPhone:_,messagesSuggestions:j,restSuggestions:V,userType:P}},{Text:LZ,Title:VZ}=km,HZ=({chatbotLogo:e,colorCode:t,onNewSession:a,visitorId:r,onSessionSelect:l,setOpen:c,Opened:f,Phone:m})=>{const[g,p]=C.useState([]),[y,S]=C.useState(!0),E=async()=>{try{S(!0);const A=(await(await fetch(`${Ei.apiUrl}get-chatlogs-by-ip/?visitor_id=${r}&company_username=${nf("company_username")}`)).json()).map(D=>({id:D.user_session_id,agentName:D.assignee||"AI Agent",createdAt:D.date,isBlurred:D.closed,agentImage:D.assignee_picture}));p(A)}catch(O){console.error("Failed to load sessions:",O)}finally{S(!1)}};C.useEffect(()=>{r&&E()},[r]);const T=re.jsx(ku,{style:{fontSize:24},spin:!0});return re.jsxs("div",{style:{maxWidth:"100%",height:"100%",border:"1px solid #f0f0f0",borderRadius:8,overflow:"hidden",display:"flex",flexDirection:"column",paddingTop:20},children:[re.jsxs("div",{style:{padding:"0 16px 10px",display:"flex"},children:[re.jsx(VZ,{level:4,style:{margin:0},children:"Conversations"}),re.jsx(qv,{onClick:()=>c(!f),className:"chatbot-close",style:{marginLeft:"auto"}})]}),re.jsx("div",{style:{flex:1,overflowY:"auto"},children:y?re.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:re.jsx(tf,{indicator:T})}):g.length>0?re.jsx($1,{itemLayout:"horizontal",dataSource:g,split:!0,renderItem:O=>re.jsx($1.Item,{onClick:()=>!O.isBlurred&&l(O.id,O.agentName||"Ai Agent",O.agentImage||e),style:{padding:"12px",opacity:O.isBlurred?.5:1,cursor:O.isBlurred?"not-allowed":"pointer",borderBottom:"1px solid #f0f0f0"},children:re.jsx($1.Item.Meta,{avatar:re.jsx(RT,{size:"large",src:O.agentImage||e,icon:!O.agentImage&&!e?re.jsx(v4,{}):void 0}),title:re.jsx("span",{style:{fontWeight:600},children:O.agentName||"AI Agent"}),description:re.jsxs(re.Fragment,{children:[re.jsxs(LZ,{type:"secondary",children:["Created: ",new Date(O.createdAt).toLocaleDateString()]}),O.isBlurred&&re.jsx("div",{style:{color:"red",fontSize:"12px",marginTop:4},children:"This session is closed and cannot be reopened."})]})})},O.id)}):re.jsx("div",{style:{padding:"1rem",textAlign:"center",color:"#888"},children:"No conversations yet."})}),re.jsxs("div",{style:{padding:"12px",borderTop:"1px solid #f0f0f0",display:"flex",gap:4},children:[re.jsx(as,{type:"primary",size:"large",block:!0,style:{backgroundColor:t,color:"#fff"},onClick:a,children:"Ask a question ?"}),m?re.jsx(as,{type:"default",style:{backgroundColor:"white",color:t},className:"hover:border-black",size:"large",icon:re.jsx(y4,{style:{color:t}}),onClick:()=>{const O=`https://wa.me/${m}`;window.open(O,"_blank")},children:"Chat on WhatsApp"}):re.jsx(re.Fragment,{})]})]})},{Title:BZ,Text:xO}=km,PZ=({onBack:e,onCreate:t,colorCode:a,visitorId:r,country:l})=>{const[c,f]=C.useState(""),[m,g]=C.useState(""),[p,y]=C.useState(""),[S,E]=C.useState(!1),T=async()=>{const O={visitor_id:r,country:l,name:c,email:m,phone:p,company_username:nf("company_username")};try{E(!0);const M=await fetch(`${Ei.apiUrl}chatlog-create/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)}),A=await M.json();M.ok?t({name:c,email:m,phone:p,session_id:A?.user_session_id,messages:A.messages,hasInfo:!0}):console.error("Failed to register:",A)}catch(M){console.error("Error submitting session data:",M)}finally{E(!1)}};return re.jsxs("div",{style:{padding:"1.5rem"},children:[re.jsx(as,{type:"text",icon:re.jsx(FT,{}),onClick:e,style:{marginBottom:"1rem"},children:"Back"}),re.jsx(BZ,{level:4,style:{marginBottom:"2rem"},children:"Let's create a session"}),re.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"👋 Please, can I have your name?"}),re.jsx(Xu,{size:"large",placeholder:"John Doe",value:c,onChange:O=>f(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"📧 What’s your email address?"}),re.jsx(Xu,{size:"large",type:"email",placeholder:"you@example.com",value:m,onChange:O=>g(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"📱 May I have your phone number?"}),re.jsx(Xu,{size:"large",placeholder:"+1 234 567 8900",value:p,onChange:O=>y(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsx(as,{type:"primary",size:"large",style:{backgroundColor:a,color:"white"},onClick:T,disabled:!c||!m||!p,children:S?re.jsx(tf,{indicator:re.jsx(ku,{style:{fontSize:20,color:"white"},spin:!0})}):"Create Session"})]})]})},UZ=e=>{const[t,a]=C.useState([]),[r,l]=C.useState(!1),c=async()=>{const f=e;if(f){l(!0);try{const m=await $a.get(`${Ei.apiUrl}chat-message-history/`,{withCredentials:!0,params:{session_id:f,username:nf("company_username")}});m.data?.messages?.length>0&&(a(m.data.messages),l(!1))}catch(m){console.error("Couldn't load history",m)}}};return C.useEffect(()=>{c()},[e]),{messages:t,setMessages:a,isFetchingMessages:r}};function ri(e,t,a,r){return new(a||(a=Promise))(function(l,c){function f(p){try{g(r.next(p))}catch(y){c(y)}}function m(p){try{g(r.throw(p))}catch(y){c(y)}}function g(p){var y;p.done?l(p.value):(y=p.value,y instanceof a?y:new a(function(S){S(y)})).then(f,m)}g((r=r.apply(e,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;class b0{constructor(){this.listeners={}}on(t,a,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(a),r?.once){const l=()=>{this.un(t,l),this.un(t,a)};return this.on(t,l),l}return()=>this.un(t,a)}un(t,a){var r;(r=this.listeners[t])===null||r===void 0||r.delete(a)}once(t,a){return this.on(t,a,{once:!0})}unAll(){this.listeners={}}emit(t,...a){this.listeners[t]&&this.listeners[t].forEach(r=>r(...a))}}const tC={decode:function(e,t){return ri(this,void 0,void 0,function*(){const a=new AudioContext({sampleRate:t});return a.decodeAudioData(e).finally(()=>a.close())})},createBuffer:function(e,t){return typeof e[0]=="number"&&(e=[e]),function(a){const r=a[0];if(r.some(l=>l>1||l<-1)){const l=r.length;let c=0;for(let f=0;f<l;f++){const m=Math.abs(r[f]);m>c&&(c=m)}for(const f of a)for(let m=0;m<l;m++)f[m]/=c}}(e),{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:a=>e?.[a],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function L6(e,t){const a=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,l]of Object.entries(t))if(r==="children"&&l)for(const[c,f]of Object.entries(l))f instanceof Node?a.appendChild(f):typeof f=="string"?a.appendChild(document.createTextNode(f)):a.appendChild(L6(c,f));else r==="style"?Object.assign(a.style,l):r==="textContent"?a.textContent=l:a.setAttribute(r,l.toString());return a}function V6(e,t,a){const r=L6(e,t||{});return a?.appendChild(r),r}var IZ=Object.freeze({__proto__:null,createElement:V6,default:V6});const FZ={fetchBlob:function(e,t,a){return ri(this,void 0,void 0,function*(){const r=yield fetch(e,a);if(r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} (${r.statusText})`);return function(l,c){ri(this,void 0,void 0,function*(){if(!l.body||!l.headers)return;const f=l.body.getReader(),m=Number(l.headers.get("Content-Length"))||0;let g=0;const p=S=>ri(this,void 0,void 0,function*(){g+=S?.length||0;const E=Math.round(g/m*100);c(E)}),y=()=>ri(this,void 0,void 0,function*(){let S;try{S=yield f.read()}catch{return}S.done||(p(S.value),yield y())});y()})}(r.clone(),t),r.blob()})}};class kZ extends b0{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,a,r){return this.media.addEventListener(t,a,r),()=>this.media.removeEventListener(t,a,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,a){const r=this.getSrc();if(t&&r===t)return;this.revokeSrc();const l=a instanceof Blob&&(this.canPlayType(a.type)||!t)?URL.createObjectURL(a):t;if(r&&this.media.removeAttribute("src"),l||t)try{this.media.src=l}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(t){this.media=t}play(){return ri(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,a){a!=null&&(this.media.preservesPitch=a),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class Xm extends b0{constructor(t,a){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const r=this.parentFromOptionsContainer(t.container);this.parent=r;const[l,c]=this.initHtml();r.appendChild(l),this.container=l,this.scrollContainer=c.querySelector(".scroll"),this.wrapper=c.querySelector(".wrapper"),this.canvasWrapper=c.querySelector(".canvases"),this.progressWrapper=c.querySelector(".progress"),this.cursor=c.querySelector(".cursor"),a&&c.appendChild(a),this.initEvents()}parentFromOptionsContainer(t){let a;if(typeof t=="string"?a=document.querySelector(t):t instanceof HTMLElement&&(a=t),!a)throw new Error("Container not found");return a}initEvents(){const t=a=>{const r=this.wrapper.getBoundingClientRect(),l=a.clientX-r.left,c=a.clientY-r.top;return[l/r.width,c/r.height]};if(this.wrapper.addEventListener("click",a=>{const[r,l]=t(a);this.emit("click",r,l)}),this.wrapper.addEventListener("dblclick",a=>{const[r,l]=t(a);this.emit("dblclick",r,l)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:a,scrollWidth:r,clientWidth:l}=this.scrollContainer,c=a/r,f=(a+l)/r;this.emit("scroll",c,f,a,a+l)}),typeof ResizeObserver=="function"){const a=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{a().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,a,r,l,c=3,f=0,m=100){if(!t)return()=>{};const g=matchMedia("(pointer: coarse)").matches;let p=()=>{};const y=S=>{if(S.button!==f)return;S.preventDefault(),S.stopPropagation();let E=S.clientX,T=S.clientY,O=!1;const M=Date.now(),A=$=>{if($.preventDefault(),$.stopPropagation(),g&&Date.now()-M<m)return;const V=$.clientX,H=$.clientY,P=V-E,q=H-T;if(O||Math.abs(P)>c||Math.abs(q)>c){const Y=t.getBoundingClientRect(),{left:te,top:G}=Y;O||(r?.(E-te,T-G),O=!0),a(P,q,V-te,H-G),E=V,T=H}},D=$=>{if(O){const V=$.clientX,H=$.clientY,P=t.getBoundingClientRect(),{left:q,top:Y}=P;l?.(V-q,H-Y)}p()},_=$=>{$.relatedTarget&&$.relatedTarget!==document.documentElement||D($)},z=$=>{O&&($.stopPropagation(),$.preventDefault())},j=$=>{O&&$.preventDefault()};document.addEventListener("pointermove",A),document.addEventListener("pointerup",D),document.addEventListener("pointerout",_),document.addEventListener("pointercancel",_),document.addEventListener("touchmove",j,{passive:!1}),document.addEventListener("click",z,{capture:!0}),p=()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",D),document.removeEventListener("pointerout",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",j),setTimeout(()=>{document.removeEventListener("click",z,{capture:!0})},10)}};return t.addEventListener("pointerdown",y),()=>{p(),t.removeEventListener("pointerdown",y)}}(this.wrapper,(t,a,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,a){var r;const l=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const c=this.parent.clientHeight||128;return a?.every(f=>!f.overlay)?c/l:c}return 128}initHtml(){const t=document.createElement("div"),a=t.attachShadow({mode:"open"}),r=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return a.innerHTML=`
572
+ `+c):r.stack=c}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=jd(this.defaults,a);const{transitional:r,paramsSerializer:l,headers:c}=a;r!==void 0&&X1.assertOptions(r,{silentJSONParsing:Zs.transitional(Zs.boolean),forcedJSONParsing:Zs.transitional(Zs.boolean),clarifyTimeoutError:Zs.transitional(Zs.boolean)},!1),l!=null&&(He.isFunction(l)?a.paramsSerializer={serialize:l}:X1.assertOptions(l,{encode:Zs.function,serialize:Zs.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),X1.assertOptions(a,{baseUrl:Zs.spelling("baseURL"),withXsrfToken:Zs.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let f=c&&He.merge(c.common,c[a.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],O=>{delete c[O]}),a.headers=go.concat(f,c);const m=[];let g=!0;this.interceptors.request.forEach(function(M){typeof M.runWhen=="function"&&M.runWhen(a)===!1||(g=g&&M.synchronous,m.unshift(M.fulfilled,M.rejected))});const p=[];this.interceptors.response.forEach(function(M){p.push(M.fulfilled,M.rejected)});let y,S=0,E;if(!g){const O=[f6.bind(this),void 0];for(O.unshift.apply(O,m),O.push.apply(O,p),E=O.length,y=Promise.resolve(a);S<E;)y=y.then(O[S++],O[S++]);return y}E=m.length;let T=a;for(S=0;S<E;){const O=m[S++],M=m[S++];try{T=O(T)}catch(A){M.call(this,A);break}}try{y=f6.call(this,T)}catch(O){return Promise.reject(O)}for(S=0,E=p.length;S<E;)y=y.then(p[S++],p[S++]);return y}getUri(t){t=jd(this.defaults,t);const a=n6(t.baseURL,t.url,t.allowAbsoluteUrls);return Y4(a,t.params,t.paramsSerializer)}};He.forEach(["delete","get","head","options"],function(t){Ld.prototype[t]=function(a,r){return this.request(jd(r||{},{method:t,url:a,data:(r||{}).data}))}}),He.forEach(["post","put","patch"],function(t){function a(r){return function(c,f,m){return this.request(jd(m||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}Ld.prototype[t]=a(),Ld.prototype[t+"Form"]=a(!0)});let qW=class o8{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(c){a=c});const r=this;this.promise.then(l=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](l);r._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(m=>{r.subscribe(m),c=m}).then(l);return f.cancel=function(){r.unsubscribe(c)},f},t(function(c,f,m){r.reason||(r.reason=new qm(c,f,m),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new o8(function(l){t=l}),cancel:t}}};function YW(e){return function(a){return e.apply(null,a)}}function XW(e){return He.isObject(e)&&e.isAxiosError===!0}const pO={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pO).forEach(([e,t])=>{pO[t]=e});function m6(e){const t=new Ld(e),a=N4(Ld.prototype.request,t);return He.extend(a,Ld.prototype,t,{allOwnKeys:!0}),He.extend(a,t,null,{allOwnKeys:!0}),a.create=function(l){return m6(jd(e,l))},a}const $a=m6(h0);$a.Axios=Ld,$a.CanceledError=qm,$a.CancelToken=qW,$a.isCancel=Q4,$a.VERSION=d6,$a.toFormData=I1,$a.AxiosError=xn,$a.Cancel=$a.CanceledError,$a.all=function(t){return Promise.all(t)},$a.spread=YW,$a.isAxiosError=XW,$a.mergeConfig=jd,$a.AxiosHeaders=go,$a.formToJSON=e=>Z4(He.isHTMLForm(e)?new FormData(e):e),$a.getAdapter=c6.getAdapter,$a.HttpStatusCode=pO,$a.default=$a;const{Axios:Iie,AxiosError:Fie,CanceledError:kie,isCancel:Gie,CancelToken:qie,VERSION:Yie,all:Xie,Cancel:Wie,isAxiosError:Zie,spread:Kie,toFormData:Qie,AxiosHeaders:Jie,HttpStatusCode:eoe,formToJSON:toe,getAdapter:noe,mergeConfig:aoe}=$a;/*! js-cookie v3.0.5 | MIT */function W1(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)e[r]=a[r]}return e}var WW={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function gO(e,t){function a(l,c,f){if(!(typeof document>"u")){f=W1({},t,f),typeof f.expires=="number"&&(f.expires=new Date(Date.now()+f.expires*864e5)),f.expires&&(f.expires=f.expires.toUTCString()),l=encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var m="";for(var g in f)f[g]&&(m+="; "+g,f[g]!==!0&&(m+="="+f[g].split(";")[0]));return document.cookie=l+"="+e.write(c,l)+m}}function r(l){if(!(typeof document>"u"||arguments.length&&!l)){for(var c=document.cookie?document.cookie.split("; "):[],f={},m=0;m<c.length;m++){var g=c[m].split("="),p=g.slice(1).join("=");try{var y=decodeURIComponent(g[0]);if(f[y]=e.read(p,y),l===y)break}catch{}}return l?f[l]:f}}return Object.create({set:a,get:r,remove:function(l,c){a(l,"",W1({},c,{expires:-1}))},withAttributes:function(l){return gO(this.converter,W1({},this.attributes,l))},withConverter:function(l){return gO(W1({},this.converter,l),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ZW=gO(WW,{path:"/"});const nf=e=>ZW.get(e),Ei={apiUrl:"https://jawebcrm.onrender.com/api/",websocketUrl:"wss://jawebcrm.onrender.com/ws"},sn=e=>typeof e=="string",p0=()=>{let e,t;const a=new Promise((r,l)=>{e=r,t=l});return a.resolve=e,a.reject=t,a},p6=e=>e==null?"":""+e,KW=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},QW=/###/g,g6=e=>e&&e.indexOf("###")>-1?e.replace(QW,"."):e,v6=e=>!e||sn(e),g0=(e,t,a)=>{const r=sn(t)?t.split("."):t;let l=0;for(;l<r.length-1;){if(v6(e))return{};const c=g6(r[l]);!e[c]&&a&&(e[c]=new a),Object.prototype.hasOwnProperty.call(e,c)?e=e[c]:e={},++l}return v6(e)?{}:{obj:e,k:g6(r[l])}},y6=(e,t,a)=>{const{obj:r,k:l}=g0(e,t,Object);if(r!==void 0||t.length===1){r[l]=a;return}let c=t[t.length-1],f=t.slice(0,t.length-1),m=g0(e,f,Object);for(;m.obj===void 0&&f.length;)c=`${f[f.length-1]}.${c}`,f=f.slice(0,f.length-1),m=g0(e,f,Object),m?.obj&&typeof m.obj[`${m.k}.${c}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${c}`]=a},JW=(e,t,a,r)=>{const{obj:l,k:c}=g0(e,t,Object);l[c]=l[c]||[],l[c].push(a)},Z1=(e,t)=>{const{obj:a,k:r}=g0(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},eZ=(e,t,a)=>{const r=Z1(e,a);return r!==void 0?r:Z1(t,a)},b6=(e,t,a)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?sn(e[r])||e[r]instanceof String||sn(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):b6(e[r],t[r],a):e[r]=t[r]);return e},Ym=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var tZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const nZ=e=>sn(e)?e.replace(/[&<>"'\/]/g,t=>tZ[t]):e;class aZ{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rZ=[" ",",","?","!",";"],iZ=new aZ(20),oZ=(e,t,a)=>{t=t||"",a=a||"";const r=rZ.filter(f=>t.indexOf(f)<0&&a.indexOf(f)<0);if(r.length===0)return!0;const l=iZ.getRegExp(`(${r.map(f=>f==="?"?"\\?":f).join("|")})`);let c=!l.test(e);if(!c){const f=e.indexOf(a);f>0&&!l.test(e.substring(0,f))&&(c=!0)}return c},vO=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(a);let l=e;for(let c=0;c<r.length;){if(!l||typeof l!="object")return;let f,m="";for(let g=c;g<r.length;++g)if(g!==c&&(m+=a),m+=r[g],f=l[m],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<r.length-1)continue;c+=g-c+1;break}l=f}return l},v0=e=>e?.replace("_","-"),lZ={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class K1{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||lZ,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,r,l){return l&&!this.debug?null:(sn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new K1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new K1(this.logger,t)}}var Ks=new K1;class Q1{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const l=this.observers[r].get(a)||0;this.observers[r].set(a,l+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l.apply(l,[t,...a])})}}class S6 extends Q1{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,l={}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,f=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;t.indexOf(".")>-1?m=t.split("."):(m=[t,a],r&&(Array.isArray(r)?m.push(...r):sn(r)&&c?m.push(...r.split(c)):m.push(r)));const g=Z1(this.data,m);return!g&&!a&&!r&&t.indexOf(".")>-1&&(t=m[0],a=m[1],r=m.slice(2).join(".")),g||!f||!sn(r)?g:vO(this.data?.[t]?.[a],r,c)}addResource(t,a,r,l,c={silent:!1}){const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[t,a];r&&(m=m.concat(f?r.split(f):r)),t.indexOf(".")>-1&&(m=t.split("."),l=a,a=m[1]),this.addNamespaces(a),y6(this.data,m,l),c.silent||this.emit("added",t,a,r,l)}addResources(t,a,r,l={silent:!1}){for(const c in r)(sn(r[c])||Array.isArray(r[c]))&&this.addResource(t,a,c,r[c],{silent:!0});l.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,l,c,f={silent:!1,skipCopy:!1}){let m=[t,a];t.indexOf(".")>-1&&(m=t.split("."),l=r,r=a,a=m[1]),this.addNamespaces(a);let g=Z1(this.data,m)||{};f.skipCopy||(r=JSON.parse(JSON.stringify(r))),l?b6(g,r,c):g={...g,...r},y6(this.data,m,g),f.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(l=>a[l]&&Object.keys(a[l]).length>0)}toJSON(){return this.data}}var C6={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,l){return e.forEach(c=>{t=this.processors[c]?.process(t,a,r,l)??t}),t}};const x6={},E6=e=>!sn(e)&&typeof e!="boolean"&&typeof e!="number";class J1 extends Q1{constructor(t,a={}){super(),KW(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ks.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const r={...a};return t==null?!1:this.resolve(t,r)?.res!==void 0}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const f=r&&t.indexOf(r)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!oZ(t,r,l);if(f&&!m){const g=t.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:t,namespaces:sn(c)?[c]:c};const p=t.split(r);(r!==l||r===l&&this.options.ns.indexOf(p[0])>-1)&&(c=p.shift()),t=p.join(l)}return{key:t,namespaces:sn(c)?[c]:c}}translate(t,a,r){let l=typeof a=="object"?{...a}:a;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(l={...l}),l||(l={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const c=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(t[t.length-1],l),p=g[g.length-1];let y=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const S=l.lng||this.language,E=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(S?.toLowerCase()==="cimode")return E?c?{res:`${p}${y}${m}`,usedKey:m,exactUsedKey:m,usedLng:S,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:`${p}${y}${m}`:c?{res:m,usedKey:m,exactUsedKey:m,usedLng:S,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:m;const T=this.resolve(t,l);let O=T?.res;const M=T?.usedKey||m,A=T?.exactUsedKey||m,D=["[object Number]","[object Function]","[object RegExp]"],_=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,j=l.count!==void 0&&!sn(l.count),$=J1.hasDefaultValue(l),V=j?this.pluralResolver.getSuffix(S,l.count,l):"",H=l.ordinal&&j?this.pluralResolver.getSuffix(S,l.count,{ordinal:!1}):"",P=j&&!l.ordinal&&l.count===0,q=P&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${V}`]||l[`defaultValue${H}`]||l.defaultValue;let Y=O;z&&!O&&$&&(Y=q);const te=E6(Y),G=Object.prototype.toString.apply(Y);if(z&&Y&&te&&D.indexOf(G)<0&&!(sn(_)&&Array.isArray(Y))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(M,Y,{...l,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return c?(T.res=K,T.usedParams=this.getUsedParamsDetails(l),T):K}if(f){const K=Array.isArray(Y),J=K?[]:{},ie=K?A:M;for(const k in Y)if(Object.prototype.hasOwnProperty.call(Y,k)){const X=`${ie}${f}${k}`;$&&!O?J[k]=this.translate(X,{...l,defaultValue:E6(q)?q[k]:void 0,joinArrays:!1,ns:g}):J[k]=this.translate(X,{...l,joinArrays:!1,ns:g}),J[k]===X&&(J[k]=Y[k])}O=J}}else if(z&&sn(_)&&Array.isArray(O))O=O.join(_),O&&(O=this.extendTranslation(O,t,l,r));else{let K=!1,J=!1;!this.isValidLookup(O)&&$&&(K=!0,O=q),this.isValidLookup(O)||(J=!0,O=m);const k=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&J?void 0:O,X=$&&q!==O&&this.options.updateMissing;if(J||K||X){if(this.logger.log(X?"updateKey":"missingKey",S,p,m,X?q:O),f){const F=this.resolve(m,{...l,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Q=[];const le=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&le&&le[0])for(let F=0;F<le.length;F++)Q.push(le[F]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(l.lng||this.language):Q.push(l.lng||this.language);const U=(F,ne,ae)=>{const oe=$&&ae!==O?ae:k;this.options.missingKeyHandler?this.options.missingKeyHandler(F,p,ne,oe,X,l):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,p,ne,oe,X,l),this.emit("missingKey",F,p,ne,O)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?Q.forEach(F=>{const ne=this.pluralResolver.getSuffixes(F,l);P&&l[`defaultValue${this.options.pluralSeparator}zero`]&&ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&ne.push(`${this.options.pluralSeparator}zero`),ne.forEach(ae=>{U([F],m+ae,l[`defaultValue${ae}`]||q)})}):U(Q,m,q))}O=this.extendTranslation(O,t,l,T,r),J&&O===m&&this.options.appendNamespaceToMissingKey&&(O=`${p}${y}${m}`),(J||K)&&this.options.parseMissingKeyHandler&&(O=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${y}${m}`:m,K?O:void 0,l))}return c?(T.res=O,T.usedParams=this.getUsedParamsDetails(l),T):O}extendTranslation(t,a,r,l,c){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const g=sn(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(g){const S=t.match(this.interpolator.nestingRegexp);p=S&&S.length}let y=r.replace&&!sn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||l.usedLng,r),g){const S=t.match(this.interpolator.nestingRegexp),E=S&&S.length;p<E&&(r.nest=!1)}!r.lng&&l&&l.res&&(r.lng=this.language||l.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...S)=>c?.[0]===S[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${S[0]} in key: ${a[0]}`),null):this.translate(...S,a),r)),r.interpolation&&this.interpolator.reset()}const f=r.postProcess||this.options.postProcess,m=sn(f)?[f]:f;return t!=null&&m?.length&&r.applyPostProcessor!==!1&&(t=C6.handle(m,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,a={}){let r,l,c,f,m;return sn(t)&&(t=[t]),t.forEach(g=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(g,a),y=p.key;l=y;let S=p.namespaces;this.options.fallbackNS&&(S=S.concat(this.options.fallbackNS));const E=a.count!==void 0&&!sn(a.count),T=E&&!a.ordinal&&a.count===0,O=a.context!==void 0&&(sn(a.context)||typeof a.context=="number")&&a.context!=="",M=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);S.forEach(A=>{this.isValidLookup(r)||(m=A,!x6[`${M[0]}-${A}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(x6[`${M[0]}-${A}`]=!0,this.logger.warn(`key "${l}" for languages "${M.join(", ")}" won't get resolved as namespace "${m}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),M.forEach(D=>{if(this.isValidLookup(r))return;f=D;const _=[y];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(_,y,D,A,a);else{let j;E&&(j=this.pluralResolver.getSuffix(D,a.count,a));const $=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(E&&(_.push(y+j),a.ordinal&&j.indexOf(V)===0&&_.push(y+j.replace(V,this.options.pluralSeparator)),T&&_.push(y+$)),O){const H=`${y}${this.options.contextSeparator}${a.context}`;_.push(H),E&&(_.push(H+j),a.ordinal&&j.indexOf(V)===0&&_.push(H+j.replace(V,this.options.pluralSeparator)),T&&_.push(H+$))}}let z;for(;z=_.pop();)this.isValidLookup(r)||(c=z,r=this.getResource(D,A,z,a))}))})}),{res:r,usedKey:l,exactUsedKey:c,usedLng:f,usedNS:m}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,l={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,r,l):this.resourceStore.getResource(t,a,r,l)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!sn(t.replace);let l=r?t.replace:t;if(r&&typeof t.count<"u"&&(l.count=t.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!r){l={...l};for(const c of a)delete l[c]}return l}static hasDefaultValue(t){const a="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}}class w6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ks.create("languageUtils")}getScriptPartFromCode(t){if(t=v0(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=v0(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(sn(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let a;return t.forEach(r=>{if(a)return;const l=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(l))&&(a=l)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;const l=this.getScriptPartFromCode(r);if(this.isSupportedCode(l))return a=l;const c=this.getLanguagePartFromCode(r);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(f=>{if(f===c)return f;if(!(f.indexOf("-")<0&&c.indexOf("-")<0)&&(f.indexOf("-")>0&&c.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===c||f.indexOf(c)===0&&c.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),sn(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),l=[],c=f=>{f&&(this.isSupportedCode(f)?l.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return sn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(t))):sn(t)&&c(this.formatLanguageCode(t)),r.forEach(f=>{l.indexOf(f)<0&&c(this.formatLanguageCode(f))}),l}}const T6={zero:0,one:1,two:2,few:3,many:4,other:5},O6={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class sZ{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Ks.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const r=v0(t==="dev"?"en":t),l=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:r,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let f;try{f=new Intl.PluralRules(r,{type:l})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),O6;if(!t.match(/-|_/))return O6;const g=this.languageUtils.getLanguagePartFromCode(t);f=this.getRule(g,a)}return this.pluralRulesCache[c]=f,f}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(l=>`${a}${l}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((l,c)=>T6[l]-T6[c]).map(l=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(t,a,r={}){const l=this.getRule(t,r);return l?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${l.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}}const R6=(e,t,a,r=".",l=!0)=>{let c=eZ(e,t,a);return!c&&l&&sn(a)&&(c=vO(e,a,r),c===void 0&&(c=vO(t,a,r))),c},yO=e=>e.replace(/\$/g,"$$$$");class uZ{constructor(t={}){this.logger=Ks.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:l,prefix:c,prefixEscaped:f,suffix:m,suffixEscaped:g,formatSeparator:p,unescapeSuffix:y,unescapePrefix:S,nestingPrefix:E,nestingPrefixEscaped:T,nestingSuffix:O,nestingSuffixEscaped:M,nestingOptionsSeparator:A,maxReplaces:D,alwaysFormat:_}=t.interpolation;this.escape=a!==void 0?a:nZ,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?Ym(c):f||"{{",this.suffix=m?Ym(m):g||"}}",this.formatSeparator=p||",",this.unescapePrefix=y?"":S||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=E?Ym(E):T||Ym("$t("),this.nestingSuffix=O?Ym(O):M||Ym(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=D||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,r)=>a?.source===r?(a.lastIndex=0,a):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,a,r,l){let c,f,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=T=>{if(T.indexOf(this.formatSeparator)<0){const D=R6(a,g,T,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,r,{...l,...a,interpolationkey:T}):D}const O=T.split(this.formatSeparator),M=O.shift().trim(),A=O.join(this.formatSeparator).trim();return this.format(R6(a,g,M,this.options.keySeparator,this.options.ignoreJSONStructure),A,r,{...l,...a,interpolationkey:M})};this.resetRegExp();const y=l?.missingInterpolationHandler||this.options.missingInterpolationHandler,S=l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:T=>yO(T)},{regex:this.regexp,safeValue:T=>this.escapeValue?yO(this.escape(T)):yO(T)}].forEach(T=>{for(m=0;c=T.regex.exec(t);){const O=c[1].trim();if(f=p(O),f===void 0)if(typeof y=="function"){const A=y(t,c,l);f=sn(A)?A:""}else if(l&&Object.prototype.hasOwnProperty.call(l,O))f="";else if(S){f=c[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${t}`),f="";else!sn(f)&&!this.useRawValueToEscape&&(f=p6(f));const M=T.safeValue(f);if(t=t.replace(c[0],M),S?(T.regex.lastIndex+=f.length,T.regex.lastIndex-=c[0].length):T.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),t}nest(t,a,r={}){let l,c,f;const m=(g,p)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const S=g.split(new RegExp(`${y}[ ]*{`));let E=`{${S[1]}`;g=S[0],E=this.interpolate(E,f);const T=E.match(/'/g),O=E.match(/"/g);((T?.length??0)%2===0&&!O||O.length%2!==0)&&(E=E.replace(/'/g,'"'));try{f=JSON.parse(E),p&&(f={...p,...f})}catch(M){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,M),`${g}${y}${E}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;l=this.nestingRegexp.exec(t);){let g=[];f={...r},f=f.replace&&!sn(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const p=/{.*}/.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(p!==-1&&(g=l[1].slice(p).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),l[1]=l[1].slice(0,p)),c=a(m.call(this,l[1].trim(),f),f),c&&l[0]===t&&!sn(c))return c;sn(c)||(c=p6(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${t}`),c=""),g.length&&(c=g.reduce((y,S)=>this.format(y,S,r.lng,{...r,interpolationkey:l[1].trim()}),c.trim())),t=t.replace(l[0],c),this.regexp.lastIndex=0}return t}}const cZ=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const l=r[1].substring(0,r[1].length-1);t==="currency"&&l.indexOf(":")<0?a.currency||(a.currency=l.trim()):t==="relativetime"&&l.indexOf(":")<0?a.range||(a.range=l.trim()):l.split(";").forEach(f=>{if(f){const[m,...g]=f.split(":"),p=g.join(":").trim().replace(/^'+|'+$/g,""),y=m.trim();a[y]||(a[y]=p),p==="false"&&(a[y]=!1),p==="true"&&(a[y]=!0),isNaN(p)||(a[y]=parseInt(p,10))}})}return{formatName:t,formatOptions:a}},A6=e=>{const t={};return(a,r,l)=>{let c=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(c={...c,[l.interpolationkey]:void 0});const f=r+JSON.stringify(c);let m=t[f];return m||(m=e(v0(r),l),t[f]=m),m(a)}},fZ=e=>(t,a,r)=>e(v0(a),r)(t);class dZ{constructor(t={}){this.logger=Ks.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?A6:fZ;this.formats={number:r((l,c)=>{const f=new Intl.NumberFormat(l,{...c});return m=>f.format(m)}),currency:r((l,c)=>{const f=new Intl.NumberFormat(l,{...c,style:"currency"});return m=>f.format(m)}),datetime:r((l,c)=>{const f=new Intl.DateTimeFormat(l,{...c});return m=>f.format(m)}),relativetime:r((l,c)=>{const f=new Intl.RelativeTimeFormat(l,{...c});return m=>f.format(m,c.range||"day")}),list:r((l,c)=>{const f=new Intl.ListFormat(l,{...c});return m=>f.format(m)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=A6(a)}format(t,a,r,l={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(m=>m.indexOf(")")>-1)){const m=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,m)].join(this.formatSeparator)}return c.reduce((m,g)=>{const{formatName:p,formatOptions:y}=cZ(g);if(this.formats[p]){let S=m;try{const E=l?.formatParams?.[l.interpolationkey]||{},T=E.locale||E.lng||l.locale||l.lng||r;S=this.formats[p](m,T,{...y,...l,...E})}catch(E){this.logger.warn(E)}return S}else this.logger.warn(`there was no format function for ${p}`);return m},t)}}const hZ=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mZ extends Q1{constructor(t,a,r,l={}){super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=l,this.logger=Ks.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,l.backend,l)}queueLoad(t,a,r,l){const c={},f={},m={},g={};return t.forEach(p=>{let y=!0;a.forEach(S=>{const E=`${p}|${S}`;!r.reload&&this.store.hasResourceBundle(p,S)?this.state[E]=2:this.state[E]<0||(this.state[E]===1?f[E]===void 0&&(f[E]=!0):(this.state[E]=1,y=!1,f[E]===void 0&&(f[E]=!0),c[E]===void 0&&(c[E]=!0),g[S]===void 0&&(g[S]=!0)))}),y||(m[p]=!0)}),(Object.keys(c).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(f),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(t,a,r){const l=t.split("|"),c=l[0],f=l[1];a&&this.emit("failedLoading",c,f,a),!a&&r&&this.store.addResourceBundle(c,f,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);const m={};this.queue.forEach(g=>{JW(g.loaded,[c],f),hZ(g,t),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(p=>{m[p]||(m[p]={});const y=g.loaded[p];y.length&&y.forEach(S=>{m[p][S]===void 0&&(m[p][S]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(t,a,r,l=0,c=this.retryTimeout,f){if(!t.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:l,wait:c,callback:f});return}this.readingCalls++;const m=(p,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const S=this.waitingReads.shift();this.read(S.lng,S.ns,S.fcName,S.tried,S.wait,S.callback)}if(p&&y&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,l+1,c*2,f)},c);return}f(p,y)},g=this.backend[r].bind(this.backend);if(g.length===2){try{const p=g(t,a);p&&typeof p.then=="function"?p.then(y=>m(null,y)).catch(m):m(null,p)}catch(p){m(p)}return}return g(t,a,m)}prepareLoading(t,a,r={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();sn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),sn(a)&&(a=[a]);const c=this.queueLoad(t,a,r,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(f=>{this.loadOne(f)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){const r=t.split("|"),l=r[0],c=r[1];this.read(l,c,"read",void 0,void 0,(f,m)=>{f&&this.logger.warn(`${a}loading namespace ${c} for language ${l} failed`,f),!f&&m&&this.logger.log(`${a}loaded namespace ${c} for language ${l}`,m),this.loaded(t,f,m)})}saveMissing(t,a,r,l,c,f={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const g={...f,isUpdate:c},p=this.backend.create.bind(this.backend);if(p.length<6)try{let y;p.length===5?y=p(t,a,r,l,g):y=p(t,a,r,l),y&&typeof y.then=="function"?y.then(S=>m(null,S)).catch(m):m(null,y)}catch(y){m(y)}else p(t,a,r,l,m,g)}!t||!t[0]||this.store.addResource(t[0],a,r,l)}}}const M6=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),sn(e[1])&&(t.defaultValue=e[1]),sn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_6=e=>(sn(e.ns)&&(e.ns=[e.ns]),sn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),sn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),eC=()=>{},pZ=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class y0 extends Q1{constructor(t={},a){if(super(),this.options=_6(t),this.services={},this.logger=Ks,this.modules={external:[]},pZ(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(sn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=M6();this.options={...r,...this.options,..._6(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const l=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ks.init(l(this.modules.logger),this.options):Ks.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=dZ;const y=new w6(this.options);this.store=new S6(this.options.resources,this.options);const S=this.services;S.logger=Ks,S.resourceStore=this.store,S.languageUtils=y,S.pluralResolver=new sZ(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(S.formatter=l(p),S.formatter.init&&S.formatter.init(S,this.options),this.options.interpolation.format=S.formatter.format.bind(S.formatter)),S.interpolator=new uZ(this.options),S.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},S.backendConnector=new mZ(l(this.modules.backend),S.resourceStore,S,this.options),S.backendConnector.on("*",(T,...O)=>{this.emit(T,...O)}),this.modules.languageDetector&&(S.languageDetector=l(this.modules.languageDetector),S.languageDetector.init&&S.languageDetector.init(S,this.options.detection,this.options)),this.modules.i18nFormat&&(S.i18nFormat=l(this.modules.i18nFormat),S.i18nFormat.init&&S.i18nFormat.init(this)),this.translator=new J1(this.services,this.options),this.translator.on("*",(T,...O)=>{this.emit(T,...O)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,a||(a=eC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...y)=>this.store[p](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...y)=>(this.store[p](...y),this)});const m=p0(),g=()=>{const p=(y,S)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(S),a(y,S)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(t,a=eC){let r=a;const l=sn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(l?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&c.indexOf(p)<0&&c.push(p)})};l?f(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>f(g)),this.options.preload?.forEach?.(m=>f(m)),this.services.backendConnector.load(c,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(m)})}else r(null)}reloadResources(t,a,r){const l=p0();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=eC),this.services.backendConnector.reload(t,a,c=>{l.resolve(),r(c)}),l}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&C6.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a<this.languages.length;a++){const r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const r=p0();this.emit("languageChanging",t);const l=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},c=(m,g)=>{g?this.isLanguageChangingTo===t&&(l(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,r.resolve((...p)=>this.t(...p)),a&&a(m,(...p)=>this.t(...p))},f=m=>{!t&&!m&&this.services.languageDetector&&(m=[]);const g=sn(m)?m:m&&m[0],p=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(sn(m)?[m]:m);p&&(this.language||l(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,y=>{c(y,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(t),r}getFixedT(t,a,r){const l=(c,f,...m)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([c,f].concat(m)):g={...f},g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||r||l.keyPrefix);const p=this.options.keySeparator||".";let y;return g.keyPrefix&&Array.isArray(c)?y=c.map(S=>`${g.keyPrefix}${p}${S}`):y=g.keyPrefix?`${g.keyPrefix}${p}${c}`:c,this.t(y,g)};return sn(t)?l.lng=t:l.lngs=t,l.ns=a,l.keyPrefix=r,l}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=a.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const f=(m,g)=>{const p=this.services.backendConnector.state[`${m}|${g}`];return p===-1||p===0||p===2};if(a.precheck){const m=a.precheck(this,f);if(m!==void 0)return m}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(r,t)&&(!l||f(c,t)))}loadNamespaces(t,a){const r=p0();return this.options.ns?(sn(t)&&(t=[t]),t.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{r.resolve(),a&&a(l)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){const r=p0();sn(t)&&(t=[t]);const l=this.options.preload||[],c=t.filter(f=>l.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return c.length?(this.options.preload=l.concat(c),this.loadResources(f=>{r.resolve(),a&&a(f)}),r):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new w6(M6());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){return new y0(t,a)}cloneInstance(t={},a=eC){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const l={...this.options,...t,isClone:!0},c=new y0(l);if((t.debug!==void 0||t.prefix!==void 0)&&(c.logger=c.logger.clone(t)),["store","services","language"].forEach(m=>{c[m]=this[m]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},r){const m=Object.keys(this.store.data).reduce((g,p)=>(g[p]={...this.store.data[p]},g[p]=Object.keys(g[p]).reduce((y,S)=>(y[S]={...g[p][S]},y),g[p]),g),{});c.store=new S6(m,l),c.services.resourceStore=c.store}return c.translator=new J1(c.services,l),c.translator.on("*",(m,...g)=>{c.emit(m,...g)}),c.init(l,a),c.translator.options=l,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Zr=y0.createInstance();Zr.createInstance=y0.createInstance,Zr.createInstance,Zr.dir,Zr.init,Zr.loadResources,Zr.reloadResources,Zr.use,Zr.changeLanguage,Zr.getFixedT,Zr.t,Zr.exists,Zr.setDefaultNamespace,Zr.hasLoadedNamespace,Zr.loadNamespaces,Zr.loadLanguages;const gZ=(e,t,a,r)=>{const l=[a,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(l,"warn","react-i18next::",!0);Vd(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...l):console?.warn&&console.warn(...l)},D6={},bO=(e,t,a,r)=>{Vd(a)&&D6[a]||(Vd(a)&&(D6[a]=new Date),gZ(e,t,a,r))},N6=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},SO=(e,t,a)=>{e.loadNamespaces(t,N6(e,a))},$6=(e,t,a,r)=>{if(Vd(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return SO(e,a,r);a.forEach(l=>{e.options.ns.indexOf(l)<0&&e.options.ns.push(l)}),e.loadLanguages(t,N6(e,r))},vZ=(e,t,a={})=>!t.languages||!t.languages.length?(bO(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,l)=>{if(a.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!l(r.isLanguageChangingTo,e))return!1}}),Vd=e=>typeof e=="string",yZ=e=>typeof e=="object"&&e!==null,bZ=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SZ={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},CZ=e=>SZ[e];let CO={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(bZ,CZ)};const xZ=(e={})=>{CO={...CO,...e}},EZ=()=>CO;let z6;const wZ=e=>{z6=e},TZ=()=>z6,OZ={type:"3rdParty",init(e){xZ(e.options.react),wZ(e)}},RZ=C.createContext();class AZ{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const MZ=(e,t)=>{const a=C.useRef();return C.useEffect(()=>{a.current=e},[e,t]),a.current},j6=(e,t,a,r)=>e.getFixedT(t,a,r),_Z=(e,t,a,r)=>C.useCallback(j6(e,t,a,r),[e,t,a,r]),DZ=(e,t={})=>{const{i18n:a}=t,{i18n:r,defaultNS:l}=C.useContext(RZ)||{},c=a||r||TZ();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new AZ),!c){bO(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const j=(V,H)=>Vd(H)?H:yZ(H)&&Vd(H.defaultValue)?H.defaultValue:Array.isArray(V)?V[V.length-1]:V,$=[j,{},!1];return $.t=j,$.i18n={},$.ready=!1,$}c.options.react?.wait&&bO(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const f={...EZ(),...c.options.react,...t},{useSuspense:m,keyPrefix:g}=f;let p=l||c.options?.defaultNS;p=Vd(p)?[p]:p||["translation"],c.reportNamespaces.addUsedNamespaces?.(p);const y=(c.isInitialized||c.initializedStoreOnce)&&p.every(j=>vZ(j,c,f)),S=_Z(c,t.lng||null,f.nsMode==="fallback"?p:p[0],g),E=()=>S,T=()=>j6(c,t.lng||null,f.nsMode==="fallback"?p:p[0],g),[O,M]=C.useState(E);let A=p.join();t.lng&&(A=`${t.lng}${A}`);const D=MZ(A),_=C.useRef(!0);C.useEffect(()=>{const{bindI18n:j,bindI18nStore:$}=f;_.current=!0,!y&&!m&&(t.lng?$6(c,t.lng,p,()=>{_.current&&M(T)}):SO(c,p,()=>{_.current&&M(T)})),y&&D&&D!==A&&_.current&&M(T);const V=()=>{_.current&&M(T)};return j&&c?.on(j,V),$&&c?.store.on($,V),()=>{_.current=!1,c&&j?.split(" ").forEach(H=>c.off(H,V)),$&&c&&$.split(" ").forEach(H=>c.store.off(H,V))}},[c,A]),C.useEffect(()=>{_.current&&y&&M(E)},[c,g,y]);const z=[O,c,y];if(z.t=O,z.i18n=c,z.ready=y,y||!y&&!m)return z;throw new Promise(j=>{t.lng?$6(c,t.lng,p,()=>j()):SO(c,p,()=>j())})},NZ={en:{translation:{welcome:"Hi there, you’re speaking with Jaweb AI Assistant."}},ar:{translation:{welcome:"مرحبًا، أنت تتحدث إلى مساعد Jaweb AI."}}};Zr.use(OZ).init({resources:NZ,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const $Z=3,zZ=3e3,jZ=()=>{const[e,t]=C.useState(!0),[a,r]=C.useState(!1),[l,c]=C.useState(""),[f,m]=C.useState(""),[g,p]=C.useState(!1),[y,S]=C.useState(!1),[E,T]=C.useState(""),[O,M]=C.useState(""),[A,D]=C.useState(""),[_,z]=C.useState(""),[j,$]=C.useState([]),[V,H]=C.useState([]),[P,q]=C.useState(""),Y=async(te=0)=>{const G=nf("company_username");t(!0);const K={headers:{"Content-Type":"application/json",Accept:"application/json"},params:{username:G}};try{const ie=(await $a.get(`${Ei.apiUrl}chatbot-details/`,K)).data.data;ie.language==="Arabic"?Zr.changeLanguage("ar"):Zr.changeLanguage("en"),r(ie.chatbot_form),c(ie.chatbot_color),m(ie.chatbot_logo),p(ie.disable_chatbot_globally),S(ie.remove_powered_by_jaweb),T(ie.chatbot_initial_msg),M(ie.status),q(ie.mode),console.log(ie),ie.calendly_link&&D(ie.calendly_link),ie.phone_number_id&&z(`+${ie.phone_number_id}`);const k=await $a.get(`${Ei.apiUrl}chatbot-plugin-suggestions/`,K);let X=[];Array.isArray(k.data.data)?X=k.data.data:Array.isArray(k.data.user_questions)&&(X=k.data.user_questions),X.length>0?($(X.slice(0,3)),H(X.slice(3))):($([]),H([])),t(!1)}catch(J){console.error("Error fetching data:",J),te<$Z?setTimeout(()=>Y(te+1),zZ):console.error("Max retries reached. Could not fetch data.")}};return C.useEffect(()=>{Y()},[]),{isFetchingDetails:e,disableForm:a,colorCode:l,chatbotLogo:f,disableChatbotGlobally:g,removePoweredByJaweb:y,initialMessageText:E,subscription:O,calendly:A,merchantPhone:_,messagesSuggestions:j,restSuggestions:V,userType:P}},{Text:LZ,Title:VZ}=km,HZ=({chatbotLogo:e,colorCode:t,onNewSession:a,visitorId:r,onSessionSelect:l,setOpen:c,Opened:f,Phone:m})=>{const[g,p]=C.useState([]),[y,S]=C.useState(!0),E=async()=>{try{S(!0);const A=(await(await fetch(`${Ei.apiUrl}get-chatlogs-by-ip/?visitor_id=${r}&company_username=${nf("company_username")}`)).json()).map(D=>({id:D.user_session_id,agentName:D.assignee||"AI Agent",createdAt:D.date,isBlurred:D.closed,agentImage:D.assignee_picture}));p(A)}catch(O){console.error("Failed to load sessions:",O)}finally{S(!1)}};C.useEffect(()=>{r&&E()},[r]);const T=re.jsx(ku,{style:{fontSize:24},spin:!0});return re.jsxs("div",{style:{maxWidth:"100%",height:"100%",border:"1px solid #f0f0f0",borderRadius:8,overflow:"hidden",display:"flex",flexDirection:"column",paddingTop:20},children:[re.jsxs("div",{style:{padding:"0 16px 10px",display:"flex"},children:[re.jsx(VZ,{level:4,style:{margin:0},children:"Conversations"}),re.jsx(qv,{onClick:()=>c(!f),className:"chatbot-close",style:{marginLeft:"auto"}})]}),re.jsx("div",{style:{flex:1,overflowY:"auto"},children:y?re.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:re.jsx(tf,{indicator:T})}):g.length>0?re.jsx($1,{itemLayout:"horizontal",dataSource:g,split:!0,renderItem:O=>re.jsx($1.Item,{onClick:()=>!O.isBlurred&&l(O.id,O.agentName||"Ai Agent",O.agentImage||e),style:{padding:"12px",opacity:O.isBlurred?.5:1,cursor:O.isBlurred?"not-allowed":"pointer",borderBottom:"1px solid #f0f0f0"},children:re.jsx($1.Item.Meta,{avatar:re.jsx(RT,{size:"large",src:O.agentImage||e,icon:!O.agentImage&&!e?re.jsx(v4,{}):void 0}),title:re.jsx("span",{style:{fontWeight:600},children:O.agentName||"AI Agent"}),description:re.jsxs(re.Fragment,{children:[re.jsxs(LZ,{type:"secondary",children:["Created: ",new Date(O.createdAt).toLocaleDateString()]}),O.isBlurred&&re.jsx("div",{style:{color:"red",fontSize:"12px",marginTop:4},children:"This session is closed and cannot be reopened."})]})})},O.id)}):re.jsx("div",{style:{padding:"1rem",textAlign:"center",color:"#888"},children:"No conversations yet."})}),re.jsxs("div",{style:{padding:"12px",borderTop:"1px solid #f0f0f0",display:"flex",gap:4},children:[re.jsx(as,{type:"primary",size:"large",block:!0,style:{backgroundColor:t,color:"#fff"},onClick:a,children:"Ask a question ?"}),m?re.jsx(as,{type:"default",style:{backgroundColor:"white",color:t},className:"hover:border-black",size:"large",icon:re.jsx(y4,{style:{color:t}}),onClick:()=>{const O=`https://wa.me/${m}`;window.open(O,"_blank")},children:"Chat on WhatsApp"}):re.jsx(re.Fragment,{})]})]})},{Title:BZ,Text:xO}=km,PZ=({onBack:e,onCreate:t,colorCode:a,visitorId:r,country:l})=>{const[c,f]=C.useState(""),[m,g]=C.useState(""),[p,y]=C.useState(""),[S,E]=C.useState(!1),T=async()=>{const O={visitor_id:r,country:l,name:c,email:m,phone:p,company_username:nf("company_username")};try{E(!0);const M=await fetch(`${Ei.apiUrl}chatlog-create/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)}),A=await M.json();M.ok?t({name:c,email:m,phone:p,session_id:A?.user_session_id,messages:A.messages,hasInfo:!0}):console.error("Failed to register:",A)}catch(M){console.error("Error submitting session data:",M)}finally{E(!1)}};return re.jsxs("div",{style:{padding:"1.5rem"},children:[re.jsx(as,{type:"text",icon:re.jsx(FT,{}),onClick:e,style:{marginBottom:"1rem"},children:"Back"}),re.jsx(BZ,{level:4,style:{marginBottom:"2rem"},children:"Let's create a session"}),re.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"👋 Please, can I have your name?"}),re.jsx(Xu,{size:"large",placeholder:"John Doe",value:c,onChange:O=>f(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"📧 What’s your email address?"}),re.jsx(Xu,{size:"large",type:"email",placeholder:"you@example.com",value:m,onChange:O=>g(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsxs("div",{children:[re.jsx(xO,{strong:!0,children:"📱 May I have your phone number?"}),re.jsx(Xu,{size:"large",placeholder:"+1 234 567 8900",value:p,onChange:O=>y(O.target.value),style:{marginTop:"0.5rem"}})]}),re.jsx(as,{type:"primary",size:"large",style:{backgroundColor:a,color:"white"},onClick:T,disabled:!c||!m||!p,children:S?re.jsx(tf,{indicator:re.jsx(ku,{style:{fontSize:20,color:"white"},spin:!0})}):"Create Session"})]})]})},UZ=e=>{const[t,a]=C.useState([]),[r,l]=C.useState(!1),c=async()=>{const f=e;if(f){l(!0);try{const m=await $a.get(`${Ei.apiUrl}chat-message-history/`,{withCredentials:!0,params:{session_id:f,username:nf("company_username")}});m.data?.messages?.length>0&&(a(m.data.messages),l(!1))}catch(m){console.error("Couldn't load history",m)}}};return C.useEffect(()=>{c()},[e]),{messages:t,setMessages:a,isFetchingMessages:r}};function ri(e,t,a,r){return new(a||(a=Promise))(function(l,c){function f(p){try{g(r.next(p))}catch(y){c(y)}}function m(p){try{g(r.throw(p))}catch(y){c(y)}}function g(p){var y;p.done?l(p.value):(y=p.value,y instanceof a?y:new a(function(S){S(y)})).then(f,m)}g((r=r.apply(e,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;class b0{constructor(){this.listeners={}}on(t,a,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(a),r?.once){const l=()=>{this.un(t,l),this.un(t,a)};return this.on(t,l),l}return()=>this.un(t,a)}un(t,a){var r;(r=this.listeners[t])===null||r===void 0||r.delete(a)}once(t,a){return this.on(t,a,{once:!0})}unAll(){this.listeners={}}emit(t,...a){this.listeners[t]&&this.listeners[t].forEach(r=>r(...a))}}const tC={decode:function(e,t){return ri(this,void 0,void 0,function*(){const a=new AudioContext({sampleRate:t});return a.decodeAudioData(e).finally(()=>a.close())})},createBuffer:function(e,t){return typeof e[0]=="number"&&(e=[e]),function(a){const r=a[0];if(r.some(l=>l>1||l<-1)){const l=r.length;let c=0;for(let f=0;f<l;f++){const m=Math.abs(r[f]);m>c&&(c=m)}for(const f of a)for(let m=0;m<l;m++)f[m]/=c}}(e),{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:a=>e?.[a],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function L6(e,t){const a=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,l]of Object.entries(t))if(r==="children"&&l)for(const[c,f]of Object.entries(l))f instanceof Node?a.appendChild(f):typeof f=="string"?a.appendChild(document.createTextNode(f)):a.appendChild(L6(c,f));else r==="style"?Object.assign(a.style,l):r==="textContent"?a.textContent=l:a.setAttribute(r,l.toString());return a}function V6(e,t,a){const r=L6(e,t||{});return a?.appendChild(r),r}var IZ=Object.freeze({__proto__:null,createElement:V6,default:V6});const FZ={fetchBlob:function(e,t,a){return ri(this,void 0,void 0,function*(){const r=yield fetch(e,a);if(r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} (${r.statusText})`);return function(l,c){ri(this,void 0,void 0,function*(){if(!l.body||!l.headers)return;const f=l.body.getReader(),m=Number(l.headers.get("Content-Length"))||0;let g=0;const p=S=>ri(this,void 0,void 0,function*(){g+=S?.length||0;const E=Math.round(g/m*100);c(E)}),y=()=>ri(this,void 0,void 0,function*(){let S;try{S=yield f.read()}catch{return}S.done||(p(S.value),yield y())});y()})}(r.clone(),t),r.blob()})}};class kZ extends b0{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,a,r){return this.media.addEventListener(t,a,r),()=>this.media.removeEventListener(t,a,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,a){const r=this.getSrc();if(t&&r===t)return;this.revokeSrc();const l=a instanceof Blob&&(this.canPlayType(a.type)||!t)?URL.createObjectURL(a):t;if(r&&this.media.removeAttribute("src"),l||t)try{this.media.src=l}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(t){this.media=t}play(){return ri(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,a){a!=null&&(this.media.preservesPitch=a),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class Xm extends b0{constructor(t,a){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const r=this.parentFromOptionsContainer(t.container);this.parent=r;const[l,c]=this.initHtml();r.appendChild(l),this.container=l,this.scrollContainer=c.querySelector(".scroll"),this.wrapper=c.querySelector(".wrapper"),this.canvasWrapper=c.querySelector(".canvases"),this.progressWrapper=c.querySelector(".progress"),this.cursor=c.querySelector(".cursor"),a&&c.appendChild(a),this.initEvents()}parentFromOptionsContainer(t){let a;if(typeof t=="string"?a=document.querySelector(t):t instanceof HTMLElement&&(a=t),!a)throw new Error("Container not found");return a}initEvents(){const t=a=>{const r=this.wrapper.getBoundingClientRect(),l=a.clientX-r.left,c=a.clientY-r.top;return[l/r.width,c/r.height]};if(this.wrapper.addEventListener("click",a=>{const[r,l]=t(a);this.emit("click",r,l)}),this.wrapper.addEventListener("dblclick",a=>{const[r,l]=t(a);this.emit("dblclick",r,l)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:a,scrollWidth:r,clientWidth:l}=this.scrollContainer,c=a/r,f=(a+l)/r;this.emit("scroll",c,f,a,a+l)}),typeof ResizeObserver=="function"){const a=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{a().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,a,r,l,c=3,f=0,m=100){if(!t)return()=>{};const g=matchMedia("(pointer: coarse)").matches;let p=()=>{};const y=S=>{if(S.button!==f)return;S.preventDefault(),S.stopPropagation();let E=S.clientX,T=S.clientY,O=!1;const M=Date.now(),A=$=>{if($.preventDefault(),$.stopPropagation(),g&&Date.now()-M<m)return;const V=$.clientX,H=$.clientY,P=V-E,q=H-T;if(O||Math.abs(P)>c||Math.abs(q)>c){const Y=t.getBoundingClientRect(),{left:te,top:G}=Y;O||(r?.(E-te,T-G),O=!0),a(P,q,V-te,H-G),E=V,T=H}},D=$=>{if(O){const V=$.clientX,H=$.clientY,P=t.getBoundingClientRect(),{left:q,top:Y}=P;l?.(V-q,H-Y)}p()},_=$=>{$.relatedTarget&&$.relatedTarget!==document.documentElement||D($)},z=$=>{O&&($.stopPropagation(),$.preventDefault())},j=$=>{O&&$.preventDefault()};document.addEventListener("pointermove",A),document.addEventListener("pointerup",D),document.addEventListener("pointerout",_),document.addEventListener("pointercancel",_),document.addEventListener("touchmove",j,{passive:!1}),document.addEventListener("click",z,{capture:!0}),p=()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",D),document.removeEventListener("pointerout",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",j),setTimeout(()=>{document.removeEventListener("click",z,{capture:!0})},10)}};return t.addEventListener("pointerdown",y),()=>{p(),t.removeEventListener("pointerdown",y)}}(this.wrapper,(t,a,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,a){var r;const l=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const c=this.parent.clientHeight||128;return a?.every(f=>!f.overlay)?c/l:c}return 128}initHtml(){const t=document.createElement("div"),a=t.attachShadow({mode:"open"}),r=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return a.innerHTML=`
573
573
  <style${r?` nonce="${r}"`:""}>
574
574
  :host {
575
575
  user-select: none;
@@ -641,7 +641,7 @@ html body {
641
641
  <div class="cursor" part="cursor"></div>
642
642
  </div>
643
643
  </div>
644
- `,[t,a]}setOptions(t){if(this.options.container!==t.container){const a=this.parentFromOptionsContainer(t.container);a.appendChild(this.container),this.parent=a}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:a}=this.scrollContainer,r=a*t;this.setScroll(r)}destroy(){var t,a;this.subscriptions.forEach(r=>r()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(a=this.unsubscribeOnScroll)===null||a===void 0||a.forEach(r=>r()),this.unsubscribeOnScroll=[]}createDelay(t=10){let a,r;const l=()=>{a&&clearTimeout(a),r&&r()};return this.timeouts.push(l),()=>new Promise((c,f)=>{l(),r=f,a=setTimeout(()=>{a=void 0,r=void 0,c()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const a=document.createElement("canvas"),r=a.getContext("2d"),l=a.height*(window.devicePixelRatio||1),c=r.createLinearGradient(0,0,0,l),f=1/(t.length-1);return t.forEach((m,g)=>{const p=g*f;c.addColorStop(p,m)}),c}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,a,r,l){const c=t[0],f=t[1]||t[0],m=c.length,{width:g,height:p}=r.canvas,y=p/2,S=this.getPixelRatio(),E=a.barWidth?a.barWidth*S:1,T=a.barGap?a.barGap*S:a.barWidth?E/2:0,O=a.barRadius||0,M=g/(E+T)/m,A=O&&"roundRect"in r?"roundRect":"rect";r.beginPath();let D=0,_=0,z=0;for(let j=0;j<=m;j++){const $=Math.round(j*M);if($>D){const P=Math.round(_*y*l),q=P+Math.round(z*y*l)||1;let Y=y-P;a.barAlign==="top"?Y=0:a.barAlign==="bottom"&&(Y=p-q),r[A](D*(E+T),Y,E,q,O),D=$,_=0,z=0}const V=Math.abs(c[j]||0),H=Math.abs(f[j]||0);V>_&&(_=V),H>z&&(z=H)}r.fill(),r.closePath()}renderLineWaveform(t,a,r,l){const c=f=>{const m=t[f]||t[0],g=m.length,{height:p}=r.canvas,y=p/2,S=r.canvas.width/g;r.moveTo(0,y);let E=0,T=0;for(let O=0;O<=g;O++){const M=Math.round(O*S);if(M>E){const D=y+(Math.round(T*y*l)||1)*(f===0?-1:1);r.lineTo(E,D),E=M,T=0}const A=Math.abs(m[O]||0);A>T&&(T=A)}r.lineTo(E,y)};r.beginPath(),c(0),c(1),r.fill(),r.closePath()}renderWaveform(t,a,r){if(r.fillStyle=this.convertColorValues(a.waveColor),a.renderFunction)return void a.renderFunction(t,r);let l=a.barHeight||1;if(a.normalize){const c=Array.from(t[0]).reduce((f,m)=>Math.max(f,Math.abs(m)),0);l=c?1/c:1}a.barWidth||a.barGap||a.barAlign?this.renderBarWaveform(t,a,r,l):this.renderLineWaveform(t,a,r,l)}renderSingleCanvas(t,a,r,l,c,f,m){const g=this.getPixelRatio(),p=document.createElement("canvas");p.width=Math.round(r*g),p.height=Math.round(l*g),p.style.width=`${r}px`,p.style.height=`${l}px`,p.style.left=`${Math.round(c)}px`,f.appendChild(p);const y=p.getContext("2d");if(this.renderWaveform(t,a,y),p.width>0&&p.height>0){const S=p.cloneNode(),E=S.getContext("2d");E.drawImage(p,0,0),E.globalCompositeOperation="source-in",E.fillStyle=this.convertColorValues(a.progressColor),E.fillRect(0,0,p.width,p.height),m.appendChild(S)}}renderMultiCanvas(t,a,r,l,c,f){const m=this.getPixelRatio(),{clientWidth:g}=this.scrollContainer,p=r/m;let y=Math.min(Xm.MAX_CANVAS_WIDTH,g,p),S={};if(a.barWidth||a.barGap){const A=a.barWidth||.5,D=A+(a.barGap||A/2);y%D!=0&&(y=Math.floor(y/D)*D)}if(y===0)return;const E=A=>{if(A<0||A>=T||S[A])return;S[A]=!0;const D=A*y;let _=Math.min(p-D,y);if(a.barWidth||a.barGap){const j=a.barWidth||.5,$=j+(a.barGap||j/2);_=Math.floor(_/$)*$}if(_<=0)return;const z=t.map(j=>{const $=Math.floor(D/p*j.length),V=Math.floor((D+_)/p*j.length);return j.slice($,V)});this.renderSingleCanvas(z,a,_,l,D,c,f)},T=Math.ceil(p/y);if(!this.isScrollable){for(let A=0;A<T;A++)E(A);return}const O=this.scrollContainer.scrollLeft/p,M=Math.floor(O*T);if(E(M-1),E(M),E(M+1),T>1){const A=this.on("scroll",()=>{const{scrollLeft:D}=this.scrollContainer,_=Math.floor(D/p*T);Object.keys(S).length>Xm.MAX_NODES&&(c.innerHTML="",f.innerHTML="",S={}),E(_-1),E(_),E(_+1)});this.unsubscribeOnScroll.push(A)}}renderChannel(t,a,r,l){var{overlay:c}=a,f=function(y,S){var E={};for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&S.indexOf(T)<0&&(E[T]=y[T]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function"){var O=0;for(T=Object.getOwnPropertySymbols(y);O<T.length;O++)S.indexOf(T[O])<0&&Object.prototype.propertyIsEnumerable.call(y,T[O])&&(E[T[O]]=y[T[O]])}return E}(a,["overlay"]);const m=document.createElement("div"),g=this.getHeight(f.height,f.splitChannels);m.style.height=`${g}px`,c&&l>0&&(m.style.marginTop=`-${g}px`),this.canvasWrapper.style.minHeight=`${g}px`,this.canvasWrapper.appendChild(m);const p=m.cloneNode();this.progressWrapper.appendChild(p),this.renderMultiCanvas(t,f,r,g,m,p)}render(t){return ri(this,void 0,void 0,function*(){var a;this.timeouts.forEach(g=>g()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),l=this.scrollContainer.clientWidth,c=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=c>l;const f=this.options.fillParent&&!this.isScrollable,m=(f?l:c)*r;if(this.wrapper.style.width=f?"100%":`${c}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let g=0;g<t.numberOfChannels;g++){const p=Object.assign(Object.assign({},this.options),(a=this.options.splitChannels)===null||a===void 0?void 0:a[g]);this.renderChannel([t.getChannelData(g)],p,m,g)}else{const g=[t.getChannelData(0)];t.numberOfChannels>1&&g.push(t.getChannelData(1)),this.renderChannel(g,this.options,m,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(r=>r()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:a}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:r}=this.progressWrapper.getBoundingClientRect();let l=r-a;l*=2,l=l<0?Math.floor(l):Math.ceil(l),l/=2,this.scrollContainer.scrollLeft+=l}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,a=!1){const{scrollLeft:r,scrollWidth:l,clientWidth:c}=this.scrollContainer,f=t*l,m=r,g=r+c,p=c/2;if(this.isDragging)f+30>g?this.scrollContainer.scrollLeft+=30:f-30<m&&(this.scrollContainer.scrollLeft-=30);else{(f<m||f>g)&&(this.scrollContainer.scrollLeft=f-(this.options.autoCenter?p:0));const y=f-r-p;a&&this.options.autoCenter&&y>0&&(this.scrollContainer.scrollLeft+=Math.min(y,10))}{const y=this.scrollContainer.scrollLeft,S=y/l,E=(y+c)/l;this.emit("scroll",S,E,y,y+c)}}renderProgress(t,a){if(isNaN(t))return;const r=100*t;this.canvasWrapper.style.clipPath=`polygon(${r}% 0%, 100% 0%, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,a)}exportImage(t,a,r){return ri(this,void 0,void 0,function*(){const l=this.canvasWrapper.querySelectorAll("canvas");if(!l.length)throw new Error("No waveform data");if(r==="dataURL"){const c=Array.from(l).map(f=>f.toDataURL(t,a));return Promise.resolve(c)}return Promise.all(Array.from(l).map(c=>new Promise((f,m)=>{c.toBlob(g=>{g?f(g):m(new Error("Could not export image"))},t,a)})))})}}Xm.MAX_CANVAS_WIDTH=8e3,Xm.MAX_NODES=10;class GZ extends b0{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class EO extends b0{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return ri(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(a=>{if(a.status>=400)throw new Error(`Failed to fetch ${t}: ${a.status} (${a.statusText})`);return a.arrayBuffer()}).then(a=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(a)).then(a=>{this.currentSrc===t&&(this.buffer=a,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let a=this.playedDuration*this._playbackRate;(a>=this.duration||a<0)&&(a=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,a),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return ri(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const a=t-this.currentTime,r=this.bufferNode;r?.stop(this.audioContext.currentTime+a),r?.addEventListener("ended",()=>{r===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return ri(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const a=!this.paused;a&&this._pause(),this.playedDuration=t/this._playbackRate,a&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,a;return(t=this._duration)!==null&&t!==void 0?t:((a=this.buffer)===null||a===void 0?void 0:a.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const a=this.buffer.numberOfChannels;for(let r=0;r<a;r++)t.push(this.buffer.getChannelData(r));return t}}const qZ={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Wm extends kZ{static create(t){return new Wm(t)}constructor(t){const a=t.media||(t.backend==="WebAudio"?new EO:void 0);super({media:a,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},qZ,t),this.timer=new GZ;const r=a?void 0:this.getMediaElement();this.renderer=new Xm(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const l=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:c,duration:f}=this.options;(l||c&&f)&&this.load(l,c,f).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,a)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,a))}),this.renderer.on("dblclick",(t,a)=>{this.emit("dblclick",t,a)}),this.renderer.on("scroll",(t,a,r,l)=>{const c=this.getDuration();this.emit("scroll",t*c,a*c,r,l)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",a=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(a),clearTimeout(t),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(a)},r),this.emit("interaction",a*this.getDuration()),this.emit("drag",a)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(a=>{this.registerPlugin(a)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=tC.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=tC.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){t._init(this),this.plugins.push(t);const a=t.once("destroy",()=>{this.plugins=this.plugins.filter(r=>r!==t),this.subscriptions=this.subscriptions.filter(r=>r!==a)});return this.subscriptions.push(a),t}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const a=t/this.getDuration();this.renderer.setScrollPercentage(a)}getActivePlugins(){return this.plugins}loadAudio(t,a,r,l){return ri(this,void 0,void 0,function*(){var c;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!a&&!r){const m=this.options.fetchParams||{};window.AbortController&&!m.signal&&(this.abortController=new AbortController,m.signal=(c=this.abortController)===null||c===void 0?void 0:c.signal);const g=y=>this.emit("loading",y);a=yield FZ.fetchBlob(t,g,m);const p=this.options.blobMimeType;p&&(a=new Blob([a],{type:p}))}this.setSrc(t,a);const f=yield new Promise(m=>{const g=l||this.getDuration();g?m(g):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>m(this.getDuration()),{once:!0}))});if(!t&&!a){const m=this.getMediaElement();m instanceof EO&&(m.duration=f)}if(r)this.decodedData=tC.createBuffer(r,f||0);else if(a){const m=yield a.arrayBuffer();this.decodedData=yield tC.decode(m,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,a,r){return ri(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,a,r)}catch(l){throw this.emit("error",l),l}})}loadBlob(t,a,r){return ri(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,a,r)}catch(l){throw this.emit("error",l),l}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:a=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const l=Math.min(t,this.decodedData.numberOfChannels),c=[];for(let f=0;f<l;f++){const m=this.decodedData.getChannelData(f),g=[],p=m.length/a;for(let y=0;y<a;y++){const S=m.slice(Math.floor(y*p),Math.ceil((y+1)*p));let E=0;for(let T=0;T<S.length;T++){const O=S[T];Math.abs(O)>Math.abs(E)&&(E=O)}g.push(Math.round(E*r)/r)}c.push(g)}return c}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const a=this.getDuration()*t;this.setTime(a)}play(t,a){const r=Object.create(null,{play:{get:()=>super.play}});return ri(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const l=yield r.play.call(this);return a!=null&&(this.media instanceof EO?this.media.stopAt(a):this.stopAtPosition=a),l})}playPause(){return ri(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return ri(this,arguments,void 0,function*(t="image/png",a=1,r="dataURL"){return this.renderer.exportImage(t,a,r)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(a=>a.destroy()),this.subscriptions.forEach(a=>a()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}Wm.BasePlugin=class extends b0{constructor(e){super(),this.subscriptions=[],this.options=e}onInit(){}_init(e){this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(e=>e())}},Wm.dom=IZ;const YZ=({userMessage:e,setUserMessage:t,handleSendMessage:a,handleSendImage:r,handleSendVoice:l,selectedImage:c,setSelectedImage:f,audioBlob:m,setAudioBlob:g,isSending:p})=>{const{t:y}=DZ(),[S,E]=C.useState(!1),[T,O]=C.useState(!1),M=C.useRef(null),A=C.useRef(null),D=C.useRef([]),_=C.useRef(null),z=C.useRef(null),j=q=>{const Y=q.target.files?.[0];Y&&f(Y)},$=()=>{f(null)},V=async()=>{if(!navigator.mediaDevices?.getUserMedia){alert(y("chatInput.voice.notSupported"));return}if(S)M.current?.stop();else try{const q=await navigator.mediaDevices.getUserMedia({audio:!0}),Y=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/mp4",te=new MediaRecorder(q,{mimeType:Y});M.current=te,D.current=[],te.ondataavailable=G=>{G.data.size>0&&D.current.push(G.data)},te.onstop=()=>{const G=new Blob(D.current,{type:Y});g(G),E(!1),q.getTracks().forEach(K=>K.stop())},te.start(),E(!0)}catch(q){console.error(q),alert(y("chatInput.voice.permissionError"))}};C.useEffect(()=>{if(m&&_.current){z.current?.destroy();const q=URL.createObjectURL(m);z.current=Wm.create({container:_.current,waveColor:"#ccc",progressColor:"#7F28F8",cursorWidth:0,barWidth:3,barHeight:1.5,barGap:2,height:40,interact:!0}),z.current.load(q),z.current.on("finish",()=>O(!1))}},[m]);const H=()=>{z.current&&(z.current.playPause(),O(q=>!q))},P=()=>{E(!1),g(null),z.current?.destroy()};return re.jsxs("div",{style:{display:"flex",alignItems:"center",backgroundColor:"white",border:"1px solid #d1d5db",borderRadius:"9999px",padding:"0.5rem 0.75rem",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",width:"95%",height:"56px"},children:[re.jsx("button",{style:{color:"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer"},onClick:()=>A.current?.click(),children:c?re.jsxs("div",{style:{position:"relative"},children:[re.jsx("img",{src:URL.createObjectURL(c),alt:y("chatInput.image.selectedAlt"),style:{width:"2rem",height:"2rem",borderRadius:"9999px",objectFit:"cover"}}),re.jsx(c0,{style:{position:"absolute",top:"-0.5rem",right:"-0.5rem",fontSize:"14px",color:"#ef4444",background:"white",borderRadius:"9999px",cursor:"pointer"},onClick:q=>{q.stopPropagation(),$()}})]}):re.jsx(m4,{style:{fontSize:"20px"}})}),re.jsx("input",{disabled:p,type:"file",accept:"image/*",ref:A,onChange:j,style:{display:"none"}}),re.jsx(Nd,{title:S?"Stop Recording":"Send Audio",children:re.jsx("button",{onClick:V,style:{color:S?"#ef4444":"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer"},children:S?re.jsx(g4,{style:{fontSize:"20px"}}):re.jsx(c4,{style:{fontSize:"20px"}})})}),re.jsx("div",{style:{flex:1,margin:"0 0.5rem",minWidth:0,maxWidth:"100%",display:"flex",alignItems:"center"},children:m?re.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",backgroundColor:"#f3f4f6",padding:"0.5rem 1rem",borderRadius:"0.5rem"},children:[re.jsx("button",{style:{background:"none",border:"none",marginRight:"0.75rem",color:"#7f28f8",cursor:"pointer"},onClick:H,children:T?re.jsx(GT,{style:{fontSize:"24px"}}):re.jsx(qT,{style:{fontSize:"24px"}})}),re.jsx("div",{ref:_,style:{width:"100%",height:"2rem"}}),re.jsx(c0,{style:{fontSize:"18px",color:"#ef4444",marginLeft:"0.75rem",cursor:"pointer"},onClick:P})]}):S?re.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f4f6",padding:"0.5rem 1rem",borderRadius:"0.5rem",animation:"pulse 2s infinite"},children:re.jsx("span",{children:"Recording"})}):re.jsx(Xu,{type:"text",value:e,onChange:q=>t(q.target.value),placeholder:"Message...",style:{width:"100%",border:"none",fontSize:"16px",margin:0,lineHeight:1.5,color:"#374151"},onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),c?(r(c,e),$(),t("")):e.trim()&&(a(),t("")))}})}),re.jsx("button",{disabled:p,onClick:()=>{const q=!!c,Y=!!e.trim();q?(r(c,e),$(),t("")):!!m?(l(m),P()):Y&&a()},"aria-label":y("chatInput.send"),style:{color:"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer"},children:re.jsx(p4,{style:{fontSize:"20px"}})})]})};function XZ({suggestions:e,colorCode:t,sendMessageSuggestion:a}){return re.jsx("div",{style:{overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",paddingTop:"4px",paddingBottom:"8px",width:"100%",boxSizing:"border-box",marginLeft:"4%",marginTop:"4px",marginBottom:"4px"},children:re.jsx("div",{style:{display:"inline-flex",gap:"0.5rem"},children:e?.map((r,l)=>re.jsx("button",{onClick:()=>a(r),style:{whiteSpace:"nowrap",padding:"0.5rem 1rem",border:`1px solid ${t}`,borderRadius:"9999px",backgroundColor:"white",cursor:"pointer",fontSize:"14px",color:t,flexShrink:0},onMouseEnter:c=>{c.currentTarget.style.backgroundColor="#f3f3f3"},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="white"},children:r},l))})})}function WZ(){return re.jsxs("div",{className:"jawebcss-powered-container",children:[re.jsx("span",{className:"jawebcss-powered-label",children:"Powered by"}),re.jsx("a",{href:"https://jaweb.me/",target:"_blank",className:"jawebcss-powered-link",rel:"noopener noreferrer",children:"Jaweb"})]})}const ZZ=()=>re.jsxs("div",{className:"typing-animation",children:[re.jsx("span",{children:"."}),re.jsx("span",{children:"."}),re.jsx("span",{children:"."})]}),KZ=({message:e,colorCode:t,handleAddToCart:a,handleRemoveFromCart:r})=>{const[l,c]=C.useState({}),[f,m]=C.useState({}),g=T=>{const O=/(https?:\/\/[^\s]+)/g;return T?.split(O).map((M,A)=>O.test(M)?re.jsx("a",{href:M.trim(),style:{color:"#00b3bc"},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:M},A):re.jsx("span",{children:M},A))},p=T=>{const O=T.trim();if(!O.includes("Name:")||!O.includes("VariantId"))return null;const M=O.match(/Name\s*[:\-]\s*(.+)/i),A=O.match(/Price\s*[:\-]\s*(.+)/i),D=O.match(/Link\s*[:\-]\s*(https?:\/\/[^\s]+)/i),_=O.match(/VariantId\s*[:\-]\s*(.+)/i),z=O.match(/variant_tag_name\s*[:\-]\s*(.+)/i),j=O.match(/^color\s*[:\-]\s*([^\r\n]*)$/im),$=O.match(/^size\s*[:\-]\s*([^\r\n]*)$/im);return!M||!A||!D||!_||!z?null:{name:M[1].trim(),price:A[1].trim(),link:D[1].trim(),image:"",variant_id:_[1].trim(),variant_tag_name:z[1].trim(),color:j?.[1]?.trim(),size:$?.[1]?.trim()}},y=C.useMemo(()=>{const T=e.split("|||").map(A=>A.trim()).filter(Boolean),O=[];let M=null;for(const A of T)if(A.startsWith("img - ")){const D=A.replace(/^img\s*[-:]\s*/,"").trim();if(M)M.image=D;else{const _=[...O].reverse().find(z=>z.type==="product");_&&(_.data.image=D)}}else if(A.includes("Name:")&&A.includes("VariantId")){const D=p(A);D&&(O.push({type:"product",data:D}),M=D)}else O.push({type:"text",data:A}),M=null;return O},[e]),S=C.useMemo(()=>{const T={};for(const O of y)if(O.type==="product"){const M=O.data;T[M.variant_tag_name]||(T[M.variant_tag_name]=[]),T[M.variant_tag_name].push(M)}return T},[y]),E=(T,O=22)=>T.length>O?T.slice(0,O)+"...":T;return re.jsx("div",{className:"space-y-6 mt-4",children:(()=>{const T=new Set;return y.map((O,M)=>{if(O.type==="text")return re.jsx("p",{className:"whitespace-pre-wrap break-words",children:g(O.data)},M);if(O.type==="product"){const D=O.data.variant_tag_name;if(T.has(D))return null;T.add(D);const _=S[D],z=f[D]||_[0].variant_id,j=_.find(G=>G.variant_id===z)||_[0],$=l[j.variant_id]||0,V=Array.from(new Set(_.map(G=>G.color?.trim()).filter(G=>G&&G.toLowerCase()!=="none"))),H=Array.from(new Set(_.map(G=>G.size?.trim()).filter(G=>G&&G.toLowerCase()!=="none"))),P=(G,K)=>_.some(J=>J.color===G&&J.size===K),q=(G,K)=>{const J=_.find(ie=>(!G||ie.color===G)&&(!K||ie.size===K));J&&m(ie=>({...ie,[D]:J.variant_id}))},Y=async()=>{const G=$+1;c(K=>({...K,[j.variant_id]:G})),await a(j.variant_id,j.name,1)},te=async()=>{if($===0)return;const G=$-1;c(K=>({...K,[j.variant_id]:G})),await r(j.variant_id,1)};return re.jsxs("div",{className:"product-card",children:[re.jsx("div",{className:"product-image-container",children:re.jsx("img",{src:j.image,alt:j.name,className:"product-image",onClick:()=>window.open(j.link,"_blank")})}),re.jsxs("div",{className:"product-details",children:[re.jsx("a",{href:j.link,target:"_blank",rel:"noopener noreferrer",className:"product-name",children:E(j.name)}),re.jsx("p",{className:"product-price",children:j.price}),V.length>0&&re.jsxs("div",{children:[re.jsx("p",{className:"label",children:"Color:"}),re.jsx("div",{className:"color-options",children:V.map(G=>{const K=!P(G,j.size),J=G===j.color;return re.jsx("button",{disabled:K,onClick:()=>q(G,j.size),className:`color-button ${J?"active":""} ${K?"disabled":""}`,style:J?{backgroundColor:t,color:"white"}:{},children:G==="None"?"One Color":G},G)})})]}),H.length>0&&re.jsxs("div",{children:[re.jsx("p",{className:"label",children:"Size:"}),re.jsx("div",{className:"size-options",children:H.map(G=>{const K=!P(j.color,G),J=G===j.size;return re.jsx("button",{disabled:K,onClick:()=>q(j.color,G),className:`size-button ${J?"active":""} ${K?"disabled":""}`,style:J?{backgroundColor:t,color:"white"}:{},children:G==="None"?"One size":G},G)})})]}),re.jsxs("div",{className:"cart-controls",children:[re.jsx("button",{onClick:te,className:"cart-button",children:"–"}),re.jsx("span",{className:"cart-count",children:$}),re.jsx("button",{onClick:Y,className:"cart-button increment",style:{backgroundColor:t,color:"#fff"},children:"+"})]})]})]},M)}return null})})()})},H6=({message:e})=>{const t=e.find(r=>r.type==="image_url")?.image_url?.url,a=e?.isBusiness;return re.jsx("div",{children:re.jsx("div",{children:t&&re.jsx("div",{className:"mb-2 bg-transparent text-white ",children:re.jsx("img",{src:t,alt:"Chat image",style:{width:200},className:`rounded-md bg-transparent mt-2 max-w-xs ${a?"border border-gray-300 shadow-sm":""}`})})})})},QZ=({message:e,colorCode:t})=>{const a=e.find(l=>l.type==="text")?.text,r=l=>{const c=/(https?:\/\/[^\s]+)/g;return l.split(c).map((f,m)=>c.test(f)?re.jsx("a",{href:f.trim(),style:{color:t},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:f},m):re.jsx("span",{children:f},m))};return re.jsx(re.Fragment,{children:a&&re.jsx("div",{style:{color:"white",border:1,backgroundColor:t,paddingTop:10,paddingBottom:10,paddingInline:14,maxWidth:"85%",lineHeight:1.4,borderRadius:"16px",wordBreak:"break-word"},children:re.jsx("p",{children:r(a)})})})},JZ=({link:e,colorCode:t,transcription:a})=>{const r=C.useRef(null),l=C.useRef(null),[c,f]=C.useState(!1),[m,g]=C.useState(!1);C.useEffect(()=>{if(r.current)return l.current?.destroy(),l.current=Wm.create({container:r.current,waveColor:"white",progressColor:"white",cursorWidth:0,barWidth:3,barHeight:1.5,barGap:2,height:40,interact:!0}),l.current.load(e),l.current.on("finish",()=>f(!1)),()=>{l.current?.destroy()}},[e,t]);const p=()=>{l.current&&(l.current.playPause(),f(y=>!y))};return re.jsxs("div",{style:{backgroundColor:t,padding:"12px",borderRadius:"20px",color:"white",maxWidth:"350px",marginBottom:"16px"},children:[re.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[re.jsx("button",{onClick:p,style:{background:"transparent",border:"none",color:"white",marginRight:"12px",cursor:"pointer"},children:c?re.jsx(GT,{style:{fontSize:"24px"}}):re.jsx(qT,{style:{fontSize:"24px"}})}),re.jsx("div",{ref:r,style:{width:"130px",height:"40px",overflow:"hidden",color:"white"}})]}),a&&re.jsxs("div",{style:{marginTop:"12px",fontSize:"14px",color:"rgba(255,255,255,0.85)"},children:[re.jsx("button",{onClick:()=>g(!m),style:{background:"none",border:"none",color:"white",textDecoration:"underline",fontSize:"13px",cursor:"pointer",padding:0},children:m?"Hide transcript":"Show transcript"}),m&&re.jsx("p",{style:{marginTop:"6px",lineHeight:"1.4"},children:a})]})]})},eK=({status:e,user:t})=>{if(!e||!t)return null;let a=`${t} is ${e}`;return e==="typing"?a=`${t} is typing...`:a="",re.jsx(re.Fragment,{children:a&&re.jsx("div",{className:"flex justify-center mb-2",children:re.jsx("span",{className:"px-3 py-1 bg-gray-100 text-gray-500 text-sm rounded-full",children:a})})})},tK=({message:e,colorCode:t})=>{const a=l=>{const c=/(https?:\/\/[^\s]+)/g;return l?.split(c).map((f,m)=>c.test(f)?re.jsx("a",{href:f.trim(),style:{color:t},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:f},m):re.jsx("span",{children:f},m))};if(e?.startsWith("Add this to cart for me")&&e?.includes("name:")){const c=e?.match(/name:([^,]+)/i)?.[1]?.trim()||"Product";return re.jsxs("div",{style:{backgroundColor:"#E8F5E9",border:"1px solid #C8E6C9",borderRadius:"12px",padding:"12px 16px",color:"#2E7D32",fontWeight:500,fontSize:"15px",maxWidth:"360px",margin:"0 auto",textAlign:"center"},children:["✅ ",re.jsx("strong",{children:c})," has been added to your cart."]})}return re.jsx("p",{children:a(e)})},wO=C.createContext({});function TO(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const OO=typeof window<"u",B6=OO?C.useLayoutEffect:C.useEffect,nC=C.createContext(null);function RO(e,t){e.indexOf(t)===-1&&e.push(t)}function AO(e,t){const a=e.indexOf(t);a>-1&&e.splice(a,1)}const Wu=(e,t,a)=>a>t?t:a<e?e:a;function MO(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var nK={};let Zm=()=>{},Zu=()=>{};nK.NODE_ENV!=="production"&&(Zm=(e,t,a)=>{!e&&typeof console<"u"&&console.warn(MO(t,a))},Zu=(e,t,a)=>{if(!e)throw new Error(MO(t,a))});const Ku={},P6=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function U6(e){return typeof e=="object"&&e!==null}const I6=e=>/^0[^.\s]+$/u.test(e);function _O(e){let t;return()=>(t===void 0&&(t=e()),t)}const bl=e=>e,aK=(e,t)=>a=>t(e(a)),S0=(...e)=>e.reduce(aK),C0=(e,t,a)=>{const r=t-e;return r===0?1:(a-e)/r};class DO{constructor(){this.subscriptions=[]}add(t){return RO(this.subscriptions,t),()=>AO(this.subscriptions,t)}notify(t,a,r){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](t,a,r);else for(let c=0;c<l;c++){const f=this.subscriptions[c];f&&f(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const is=e=>e*1e3,Qs=e=>e/1e3;function F6(e,t){return t?e*(1e3/t):0}const k6=new Set;function NO(e,t,a){e||k6.has(t)||(console.warn(MO(t,a)),k6.add(t))}const G6=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,rK=1e-7,iK=12;function oK(e,t,a,r,l){let c,f,m=0;do f=t+(a-t)/2,c=G6(f,r,l)-e,c>0?a=f:t=f;while(Math.abs(c)>rK&&++m<iK);return f}function x0(e,t,a,r){if(e===t&&a===r)return bl;const l=c=>oK(c,0,1,e,a);return c=>c===0||c===1?c:G6(l(c),t,r)}const q6=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Y6=e=>t=>1-e(1-t),X6=x0(.33,1.53,.69,.99),$O=Y6(X6),W6=q6($O),Z6=e=>(e*=2)<1?.5*$O(e):.5*(2-Math.pow(2,-10*(e-1))),zO=e=>1-Math.sin(Math.acos(e)),K6=Y6(zO),Q6=q6(zO),lK=x0(.42,0,1,1),sK=x0(0,0,.58,1),J6=x0(.42,0,.58,1),uK=e=>Array.isArray(e)&&typeof e[0]!="number",ez=e=>Array.isArray(e)&&typeof e[0]=="number",tz={linear:bl,easeIn:lK,easeInOut:J6,easeOut:sK,circIn:zO,circInOut:Q6,circOut:K6,backIn:$O,backInOut:W6,backOut:X6,anticipate:Z6},cK=e=>typeof e=="string",nz=e=>{if(ez(e)){Zu(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,a,r,l]=e;return x0(t,a,r,l)}else if(cK(e))return Zu(tz[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),tz[e];return e},aC=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function fK(e,t){let a=new Set,r=new Set,l=!1,c=!1;const f=new WeakSet;let m={delta:0,timestamp:0,isProcessing:!1};function g(y){f.has(y)&&(p.schedule(y),e()),y(m)}const p={schedule:(y,S=!1,E=!1)=>{const O=E&&l?a:r;return S&&f.add(y),O.has(y)||O.add(y),y},cancel:y=>{r.delete(y),f.delete(y)},process:y=>{if(m=y,l){c=!0;return}l=!0,[a,r]=[r,a],a.forEach(g),a.clear(),l=!1,c&&(c=!1,p.process(y))}};return p}const dK=40;function az(e,t){let a=!1,r=!0;const l={delta:0,timestamp:0,isProcessing:!1},c=()=>a=!0,f=aC.reduce((z,j)=>(z[j]=fK(c),z),{}),{setup:m,read:g,resolveKeyframes:p,preUpdate:y,update:S,preRender:E,render:T,postRender:O}=f,M=()=>{const z=Ku.useManualTiming?l.timestamp:performance.now();a=!1,Ku.useManualTiming||(l.delta=r?1e3/60:Math.max(Math.min(z-l.timestamp,dK),1)),l.timestamp=z,l.isProcessing=!0,m.process(l),g.process(l),p.process(l),y.process(l),S.process(l),E.process(l),T.process(l),O.process(l),l.isProcessing=!1,a&&t&&(r=!1,e(M))},A=()=>{a=!0,r=!0,l.isProcessing||e(M)};return{schedule:aC.reduce((z,j)=>{const $=f[j];return z[j]=(V,H=!1,P=!1)=>(a||A(),$.schedule(V,H,P)),z},{}),cancel:z=>{for(let j=0;j<aC.length;j++)f[aC[j]].cancel(z)},state:l,steps:f}}const{schedule:Pa,cancel:af,state:ii,steps:jO}=az(typeof requestAnimationFrame<"u"?requestAnimationFrame:bl,!0);let rC;function hK(){rC=void 0}const vo={now:()=>(rC===void 0&&vo.set(ii.isProcessing||Ku.useManualTiming?ii.timestamp:performance.now()),rC),set:e=>{rC=e,queueMicrotask(hK)}},rz=e=>t=>typeof t=="string"&&t.startsWith(e),LO=rz("--"),mK=rz("var(--"),VO=e=>mK(e)?pK.test(e.split("/*")[0].trim()):!1,pK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Km={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},E0={...Km,transform:e=>Wu(0,1,e)},iC={...Km,default:1},w0=e=>Math.round(e*1e5)/1e5,HO=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gK(e){return e==null}const vK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BO=(e,t)=>a=>!!(typeof a=="string"&&vK.test(a)&&a.startsWith(e)||t&&!gK(a)&&Object.prototype.hasOwnProperty.call(a,t)),iz=(e,t,a)=>r=>{if(typeof r!="string")return r;const[l,c,f,m]=r.match(HO);return{[e]:parseFloat(l),[t]:parseFloat(c),[a]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},yK=e=>Wu(0,255,e),PO={...Km,transform:e=>Math.round(yK(e))},Hd={test:BO("rgb","red"),parse:iz("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+PO.transform(e)+", "+PO.transform(t)+", "+PO.transform(a)+", "+w0(E0.transform(r))+")"};function bK(e){let t="",a="",r="",l="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),l=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),l=e.substring(4,5),t+=t,a+=a,r+=r,l+=l),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:l?parseInt(l,16)/255:1}}const UO={test:BO("#"),parse:bK,transform:Hd.transform},T0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),rf=T0("deg"),Js=T0("%"),on=T0("px"),SK=T0("vh"),CK=T0("vw"),oz={...Js,parse:e=>Js.parse(e)/100,transform:e=>Js.transform(e*100)},Qm={test:BO("hsl","hue"),parse:iz("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Js.transform(w0(t))+", "+Js.transform(w0(a))+", "+w0(E0.transform(r))+")"},Cr={test:e=>Hd.test(e)||UO.test(e)||Qm.test(e),parse:e=>Hd.test(e)?Hd.parse(e):Qm.test(e)?Qm.parse(e):UO.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hd.transform(e):Qm.transform(e),getAnimatableNone:e=>{const t=Cr.parse(e);return t.alpha=0,Cr.transform(t)}},xK=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function EK(e){return isNaN(e)&&typeof e=="string"&&(e.match(HO)?.length||0)+(e.match(xK)?.length||0)>0}const lz="number",sz="color",wK="var",TK="var(",uz="${}",OK=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function O0(e){const t=e.toString(),a=[],r={color:[],number:[],var:[]},l=[];let c=0;const m=t.replace(OK,g=>(Cr.test(g)?(r.color.push(c),l.push(sz),a.push(Cr.parse(g))):g.startsWith(TK)?(r.var.push(c),l.push(wK),a.push(g)):(r.number.push(c),l.push(lz),a.push(parseFloat(g))),++c,uz)).split(uz);return{values:a,split:m,indexes:r,types:l}}function cz(e){return O0(e).values}function fz(e){const{split:t,types:a}=O0(e),r=t.length;return l=>{let c="";for(let f=0;f<r;f++)if(c+=t[f],l[f]!==void 0){const m=a[f];m===lz?c+=w0(l[f]):m===sz?c+=Cr.transform(l[f]):c+=l[f]}return c}}const RK=e=>typeof e=="number"?0:Cr.test(e)?Cr.getAnimatableNone(e):e;function AK(e){const t=cz(e);return fz(e)(t.map(RK))}const of={test:EK,parse:cz,createTransformer:fz,getAnimatableNone:AK};function IO(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function MK({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let l=0,c=0,f=0;if(!t)l=c=f=a;else{const m=a<.5?a*(1+t):a+t-a*t,g=2*a-m;l=IO(g,m,e+1/3),c=IO(g,m,e),f=IO(g,m,e-1/3)}return{red:Math.round(l*255),green:Math.round(c*255),blue:Math.round(f*255),alpha:r}}function oC(e,t){return a=>a>0?t:e}const Za=(e,t,a)=>e+(t-e)*a,FO=(e,t,a)=>{const r=e*e,l=a*(t*t-r)+r;return l<0?0:Math.sqrt(l)},_K=[UO,Hd,Qm],DK=e=>_K.find(t=>t.test(e));function dz(e){const t=DK(e);if(Zm(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let a=t.parse(e);return t===Qm&&(a=MK(a)),a}const hz=(e,t)=>{const a=dz(e),r=dz(t);if(!a||!r)return oC(e,t);const l={...a};return c=>(l.red=FO(a.red,r.red,c),l.green=FO(a.green,r.green,c),l.blue=FO(a.blue,r.blue,c),l.alpha=Za(a.alpha,r.alpha,c),Hd.transform(l))},kO=new Set(["none","hidden"]);function NK(e,t){return kO.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function $K(e,t){return a=>Za(e,t,a)}function GO(e){return typeof e=="number"?$K:typeof e=="string"?VO(e)?oC:Cr.test(e)?hz:LK:Array.isArray(e)?mz:typeof e=="object"?Cr.test(e)?hz:zK:oC}function mz(e,t){const a=[...e],r=a.length,l=e.map((c,f)=>GO(c)(c,t[f]));return c=>{for(let f=0;f<r;f++)a[f]=l[f](c);return a}}function zK(e,t){const a={...e,...t},r={};for(const l in a)e[l]!==void 0&&t[l]!==void 0&&(r[l]=GO(e[l])(e[l],t[l]));return l=>{for(const c in r)a[c]=r[c](l);return a}}function jK(e,t){const a=[],r={color:0,var:0,number:0};for(let l=0;l<t.values.length;l++){const c=t.types[l],f=e.indexes[c][r[c]],m=e.values[f]??0;a[l]=m,r[c]++}return a}const LK=(e,t)=>{const a=of.createTransformer(t),r=O0(e),l=O0(t);return r.indexes.var.length===l.indexes.var.length&&r.indexes.color.length===l.indexes.color.length&&r.indexes.number.length>=l.indexes.number.length?kO.has(e)&&!l.values.length||kO.has(t)&&!r.values.length?NK(e,t):S0(mz(jK(r,l),l.values),a):(Zm(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),oC(e,t))};function pz(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?Za(e,t,a):GO(e)(e,t)}const VK=e=>{const t=({timestamp:a})=>e(a);return{start:(a=!0)=>Pa.update(t,a),stop:()=>af(t),now:()=>ii.isProcessing?ii.timestamp:vo.now()}},gz=(e,t,a=10)=>{let r="";const l=Math.max(Math.round(t/a),2);for(let c=0;c<l;c++)r+=Math.round(e(c/(l-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},lC=2e4;function qO(e){let t=0;const a=50;let r=e.next(t);for(;!r.done&&t<lC;)t+=a,r=e.next(t);return t>=lC?1/0:t}function HK(e,t=100,a){const r=a({...e,keyframes:[0,t]}),l=Math.min(qO(r),lC);return{type:"keyframes",ease:c=>r.next(l*c).value/t,duration:Qs(l)}}const BK=5;function vz(e,t,a){const r=Math.max(t-BK,0);return F6(a-e(r),t-r)}const Ka={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},YO=.001;function PK({duration:e=Ka.duration,bounce:t=Ka.bounce,velocity:a=Ka.velocity,mass:r=Ka.mass}){let l,c;Zm(e<=is(Ka.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-t;f=Wu(Ka.minDamping,Ka.maxDamping,f),e=Wu(Ka.minDuration,Ka.maxDuration,Qs(e)),f<1?(l=p=>{const y=p*f,S=y*e,E=y-a,T=XO(p,f),O=Math.exp(-S);return YO-E/T*O},c=p=>{const S=p*f*e,E=S*a+a,T=Math.pow(f,2)*Math.pow(p,2)*e,O=Math.exp(-S),M=XO(Math.pow(p,2),f);return(-l(p)+YO>0?-1:1)*((E-T)*O)/M}):(l=p=>{const y=Math.exp(-p*e),S=(p-a)*e+1;return-YO+y*S},c=p=>{const y=Math.exp(-p*e),S=(a-p)*(e*e);return y*S});const m=5/e,g=IK(l,c,m);if(e=is(e),isNaN(g))return{stiffness:Ka.stiffness,damping:Ka.damping,duration:e};{const p=Math.pow(g,2)*r;return{stiffness:p,damping:f*2*Math.sqrt(r*p),duration:e}}}const UK=12;function IK(e,t,a){let r=a;for(let l=1;l<UK;l++)r=r-e(r)/t(r);return r}function XO(e,t){return e*Math.sqrt(1-t*t)}const FK=["duration","bounce"],kK=["stiffness","damping","mass"];function yz(e,t){return t.some(a=>e[a]!==void 0)}function GK(e){let t={velocity:Ka.velocity,stiffness:Ka.stiffness,damping:Ka.damping,mass:Ka.mass,isResolvedFromDuration:!1,...e};if(!yz(e,kK)&&yz(e,FK))if(e.visualDuration){const a=e.visualDuration,r=2*Math.PI/(a*1.2),l=r*r,c=2*Wu(.05,1,1-(e.bounce||0))*Math.sqrt(l);t={...t,mass:Ka.mass,stiffness:l,damping:c}}else{const a=PK(e);t={...t,...a,mass:Ka.mass},t.isResolvedFromDuration=!0}return t}function sC(e=Ka.visualDuration,t=Ka.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:l}=a;const c=a.keyframes[0],f=a.keyframes[a.keyframes.length-1],m={done:!1,value:c},{stiffness:g,damping:p,mass:y,duration:S,velocity:E,isResolvedFromDuration:T}=GK({...a,velocity:-Qs(a.velocity||0)}),O=E||0,M=p/(2*Math.sqrt(g*y)),A=f-c,D=Qs(Math.sqrt(g/y)),_=Math.abs(A)<5;r||(r=_?Ka.restSpeed.granular:Ka.restSpeed.default),l||(l=_?Ka.restDelta.granular:Ka.restDelta.default);let z;if(M<1){const $=XO(D,M);z=V=>{const H=Math.exp(-M*D*V);return f-H*((O+M*D*A)/$*Math.sin($*V)+A*Math.cos($*V))}}else if(M===1)z=$=>f-Math.exp(-D*$)*(A+(O+D*A)*$);else{const $=D*Math.sqrt(M*M-1);z=V=>{const H=Math.exp(-M*D*V),P=Math.min($*V,300);return f-H*((O+M*D*A)*Math.sinh(P)+$*A*Math.cosh(P))/$}}const j={calculatedDuration:T&&S||null,next:$=>{const V=z($);if(T)m.done=$>=S;else{let H=$===0?O:0;M<1&&(H=$===0?is(O):vz(z,$,V));const P=Math.abs(H)<=r,q=Math.abs(f-V)<=l;m.done=P&&q}return m.value=m.done?f:V,m},toString:()=>{const $=Math.min(qO(j),lC),V=gz(H=>j.next($*H).value,$,30);return $+"ms "+V},toTransition:()=>{}};return j}sC.applyToOptions=e=>{const t=HK(e,100,sC);return e.ease=t.ease,e.duration=is(t.duration),e.type="keyframes",e};function WO({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:l=10,bounceStiffness:c=500,modifyTarget:f,min:m,max:g,restDelta:p=.5,restSpeed:y}){const S=e[0],E={done:!1,value:S},T=P=>m!==void 0&&P<m||g!==void 0&&P>g,O=P=>m===void 0?g:g===void 0||Math.abs(m-P)<Math.abs(g-P)?m:g;let M=a*t;const A=S+M,D=f===void 0?A:f(A);D!==A&&(M=D-S);const _=P=>-M*Math.exp(-P/r),z=P=>D+_(P),j=P=>{const q=_(P),Y=z(P);E.done=Math.abs(q)<=p,E.value=E.done?D:Y};let $,V;const H=P=>{T(E.value)&&($=P,V=sC({keyframes:[E.value,O(E.value)],velocity:vz(z,P,E.value),damping:l,stiffness:c,restDelta:p,restSpeed:y}))};return H(0),{calculatedDuration:null,next:P=>{let q=!1;return!V&&$===void 0&&(q=!0,j(P),H(P)),$!==void 0&&P>=$?V.next(P-$):(!q&&j(P),E)}}}function qK(e,t,a){const r=[],l=a||Ku.mix||pz,c=e.length-1;for(let f=0;f<c;f++){let m=l(e[f],e[f+1]);if(t){const g=Array.isArray(t)?t[f]||bl:t;m=S0(g,m)}r.push(m)}return r}function YK(e,t,{clamp:a=!0,ease:r,mixer:l}={}){const c=e.length;if(Zu(c===t.length,"Both input and output ranges must be the same length","range-length"),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const f=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const m=qK(t,r,l),g=m.length,p=y=>{if(f&&y<e[0])return t[0];let S=0;if(g>1)for(;S<e.length-2&&!(y<e[S+1]);S++);const E=C0(e[S],e[S+1],y);return m[S](E)};return a?y=>p(Wu(e[0],e[c-1],y)):p}function XK(e,t){const a=e[e.length-1];for(let r=1;r<=t;r++){const l=C0(0,t,r);e.push(Za(a,1,l))}}function WK(e){const t=[0];return XK(t,e.length-1),t}function ZK(e,t){return e.map(a=>a*t)}function KK(e,t){return e.map(()=>t||J6).splice(0,e.length-1)}function Jm({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){const l=uK(r)?r.map(nz):nz(r),c={done:!1,value:t[0]},f=ZK(a&&a.length===t.length?a:WK(t),e),m=YK(f,t,{ease:Array.isArray(l)?l:KK(t,l)});return{calculatedDuration:e,next:g=>(c.value=m(g),c.done=g>=e,c)}}const QK=e=>e!==null;function ZO(e,{repeat:t,repeatType:a="loop"},r,l=1){const c=e.filter(QK),m=l<0||t&&a!=="loop"&&t%2===1?0:c.length-1;return!m||r===void 0?c[m]:r}const JK={decay:WO,inertia:WO,tween:Jm,keyframes:Jm,spring:sC};function bz(e){typeof e.type=="string"&&(e.type=JK[e.type])}class KO{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,a){return this.finished.then(t,a)}}var eQ={};const tQ=e=>e/100;class QO extends KO{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==vo.now()&&this.tick(vo.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bz(t);const{type:a=Jm,repeat:r=0,repeatDelay:l=0,repeatType:c,velocity:f=0}=t;let{keyframes:m}=t;const g=a||Jm;eQ.NODE_ENV!=="production"&&g!==Jm&&Zu(m.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${m}`,"spring-two-frames"),g!==Jm&&typeof m[0]!="number"&&(this.mixKeyframes=S0(tQ,pz(m[0],m[1])),m=[0,100]);const p=g({...t,keyframes:m});c==="mirror"&&(this.mirroredGenerator=g({...t,keyframes:[...m].reverse(),velocity:-f})),p.calculatedDuration===null&&(p.calculatedDuration=qO(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+l,this.totalDuration=this.resolvedDuration*(r+1)-l,this.generator=p}updateTime(t){const a=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(t,a=!1){const{generator:r,totalDuration:l,mixKeyframes:c,mirroredGenerator:f,resolvedDuration:m,calculatedDuration:g}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:y,repeat:S,repeatType:E,repeatDelay:T,type:O,onUpdate:M,finalKeyframe:A}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),a?this.currentTime=t:this.updateTime(t);const D=this.currentTime-p*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?D<0:D>l;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let z=this.currentTime,j=r;if(S){const P=Math.min(this.currentTime,l)/m;let q=Math.floor(P),Y=P%1;!Y&&P>=1&&(Y=1),Y===1&&q--,q=Math.min(q,S+1),!!(q%2)&&(E==="reverse"?(Y=1-Y,T&&(Y-=T/m)):E==="mirror"&&(j=f)),z=Wu(0,1,Y)*m}const $=_?{done:!1,value:y[0]}:j.next(z);c&&($.value=c($.value));let{done:V}=$;!_&&g!==null&&(V=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return H&&O!==WO&&($.value=ZO(y,this.options,A,this.speed)),M&&M($.value),H&&this.finish(),$}then(t,a){return this.finished.then(t,a)}get duration(){return Qs(this.calculatedDuration)}get time(){return Qs(this.currentTime)}set time(t){t=is(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(vo.now());const a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=Qs(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=VK,startTime:a}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=a??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(vo.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function nQ(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Bd=e=>e*180/Math.PI,JO=e=>{const t=Bd(Math.atan2(e[1],e[0]));return eR(t)},aQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:JO,rotateZ:JO,skewX:e=>Bd(Math.atan(e[1])),skewY:e=>Bd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},eR=e=>(e=e%360,e<0&&(e+=360),e),Sz=JO,Cz=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xz=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),rQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Cz,scaleY:xz,scale:e=>(Cz(e)+xz(e))/2,rotateX:e=>eR(Bd(Math.atan2(e[6],e[5]))),rotateY:e=>eR(Bd(Math.atan2(-e[2],e[0]))),rotateZ:Sz,rotate:Sz,skewX:e=>Bd(Math.atan(e[4])),skewY:e=>Bd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tR(e){return e.includes("scale")?1:0}function nR(e,t){if(!e||e==="none")return tR(t);const a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,l;if(a)r=rQ,l=a;else{const m=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=aQ,l=m}if(!l)return tR(t);const c=r[t],f=l[1].split(",").map(oQ);return typeof c=="function"?c(f):f[c]}const iQ=(e,t)=>{const{transform:a="none"}=getComputedStyle(e);return nR(a,t)};function oQ(e){return parseFloat(e.trim())}const ep=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tp=new Set(ep),Ez=e=>e===Km||e===on,lQ=new Set(["x","y","z"]),sQ=ep.filter(e=>!lQ.has(e));function uQ(e){const t=[];return sQ.forEach(a=>{const r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}const Pd={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nR(t,"x"),y:(e,{transform:t})=>nR(t,"y")};Pd.translateX=Pd.x,Pd.translateY=Pd.y;const Ud=new Set;let aR=!1,rR=!1,iR=!1;function wz(){if(rR){const e=Array.from(Ud).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{const l=uQ(r);l.length&&(a.set(r,l),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const l=a.get(r);l&&l.forEach(([c,f])=>{r.getValue(c)?.set(f)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rR=!1,aR=!1,Ud.forEach(e=>e.complete(iR)),Ud.clear()}function Tz(){Ud.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rR=!0)})}function cQ(){iR=!0,Tz(),wz(),iR=!1}class oR{constructor(t,a,r,l,c,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=l,this.element=c,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ud.add(this),aR||(aR=!0,Pa.read(Tz),Pa.resolveKeyframes(wz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:a,element:r,motionValue:l}=this;if(t[0]===null){const c=l?.get(),f=t[t.length-1];if(c!==void 0)t[0]=c;else if(r&&a){const m=r.readValue(a,f);m!=null&&(t[0]=m)}t[0]===void 0&&(t[0]=f),l&&c===void 0&&l.set(t[0])}nQ(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ud.delete(this)}cancel(){this.state==="scheduled"&&(Ud.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fQ=e=>e.startsWith("--");function dQ(e,t,a){fQ(t)?e.style.setProperty(t,a):e.style[t]=a}const hQ=_O(()=>window.ScrollTimeline!==void 0),mQ={};function pQ(e,t){const a=_O(e);return()=>mQ[t]??a()}const Oz=pQ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),R0=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,Rz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:R0([0,.65,.55,1]),circOut:R0([.55,0,1,.45]),backIn:R0([.31,.01,.66,-.59]),backOut:R0([.33,1.53,.69,.99])};function Az(e,t){if(e)return typeof e=="function"?Oz()?gz(e,t):"ease-out":ez(e)?R0(e):Array.isArray(e)?e.map(a=>Az(a,t)||Rz.easeOut):Rz[e]}function gQ(e,t,a,{delay:r=0,duration:l=300,repeat:c=0,repeatType:f="loop",ease:m="easeOut",times:g}={},p=void 0){const y={[t]:a};g&&(y.offset=g);const S=Az(m,l);Array.isArray(S)&&(y.easing=S);const E={delay:r,duration:l,easing:Array.isArray(S)?"linear":S,fill:"both",iterations:c+1,direction:f==="reverse"?"alternate":"normal"};return p&&(E.pseudoElement=p),e.animate(y,E)}function Mz(e){return typeof e=="function"&&"applyToOptions"in e}function vQ({type:e,...t}){return Mz(e)&&Oz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yQ extends KO{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:a,name:r,keyframes:l,pseudoElement:c,allowFlatten:f=!1,finalKeyframe:m,onComplete:g}=t;this.isPseudoElement=!!c,this.allowFlatten=f,this.options=t,Zu(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const p=vQ(t);this.animation=gQ(a,r,l,p,c),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const y=ZO(l,this.options,m,this.speed);this.updateMotionValue?this.updateMotionValue(y):dQ(a,r,y),this.animation.cancel()}g?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Qs(Number(t))}get time(){return Qs(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=is(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&hQ()?(this.animation.timeline=t,bl):a(this)}}const _z={anticipate:Z6,backInOut:W6,circInOut:Q6};function bQ(e){return e in _z}function SQ(e){typeof e.ease=="string"&&bQ(e.ease)&&(e.ease=_z[e.ease])}const Dz=10;class CQ extends yQ{constructor(t){SQ(t),bz(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:a,onUpdate:r,onComplete:l,element:c,...f}=this.options;if(!a)return;if(t!==void 0){a.set(t);return}const m=new QO({...f,autoplay:!1}),g=is(this.finishedTime??this.time);a.setWithVelocity(m.sample(g-Dz).value,m.sample(g).value,Dz),m.stop()}}const Nz=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(of.test(e)||e==="0")&&!e.startsWith("url("));function xQ(e){const t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function EQ(e,t,a,r){const l=e[0];if(l===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],f=Nz(l,t),m=Nz(c,t);return Zm(f===m,`You are trying to animate ${t} from "${l}" to "${c}". "${f?c:l}" is not an animatable value.`,"value-not-animatable"),!f||!m?!1:xQ(e)||(a==="spring"||Mz(a))&&r}const wQ=new Set(["opacity","clipPath","filter","transform"]),TQ=_O(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OQ(e){const{motionValue:t,name:a,repeatDelay:r,repeatType:l,damping:c,type:f}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:g,transformTemplate:p}=t.owner.getProps();return TQ()&&a&&wQ.has(a)&&(a!=="transform"||!p)&&!g&&!r&&l!=="mirror"&&c!==0&&f!=="inertia"}const RQ=40;class AQ extends KO{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:f="loop",keyframes:m,name:g,motionValue:p,element:y,...S}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=vo.now();const E={autoplay:t,delay:a,type:r,repeat:l,repeatDelay:c,repeatType:f,name:g,motionValue:p,element:y,...S},T=y?.KeyframeResolver||oR;this.keyframeResolver=new T(m,(O,M,A)=>this.onKeyframesResolved(O,M,E,!A),g,p,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,a,r,l){this.keyframeResolver=void 0;const{name:c,type:f,velocity:m,delay:g,isHandoff:p,onUpdate:y}=r;this.resolvedAt=vo.now(),EQ(t,c,f,m)||((Ku.instantAnimations||!g)&&y?.(ZO(t,r,a)),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const E={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>RQ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...r,keyframes:t},T=!p&&OQ(E)?new CQ({...E,element:E.motionValue.owner.current}):new QO(E);T.finished.then(()=>this.notifyFinished()).catch(bl),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,a){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),cQ()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const MQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _Q(e){const t=MQ.exec(e);if(!t)return[,];const[,a,r,l]=t;return[`--${a??r}`,l]}const DQ=4;function $z(e,t,a=1){Zu(a<=DQ,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,l]=_Q(e);if(!r)return;const c=window.getComputedStyle(t).getPropertyValue(r);if(c){const f=c.trim();return P6(f)?parseFloat(f):f}return VO(l)?$z(l,t,a+1):l}function lR(e,t){return e?.[t]??e?.default??e}const zz=new Set(["width","height","top","left","right","bottom",...ep]),NQ={test:e=>e==="auto",parse:e=>e},jz=e=>t=>t.test(e),Lz=[Km,on,Js,rf,CK,SK,NQ],Vz=e=>Lz.find(jz(e));function $Q(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||I6(e):!0}const zQ=new Set(["brightness","contrast","saturate","opacity"]);function jQ(e){const[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=a.match(HO)||[];if(!r)return e;const l=a.replace(r,"");let c=zQ.has(t)?1:0;return r!==a&&(c*=100),t+"("+c+l+")"}const LQ=/\b([a-z-]*)\(.*?\)/gu,sR={...of,getAnimatableNone:e=>{const t=e.match(LQ);return t?t.map(jQ).join(" "):e}},Hz={...Km,transform:Math.round},uR={borderWidth:on,borderTopWidth:on,borderRightWidth:on,borderBottomWidth:on,borderLeftWidth:on,borderRadius:on,radius:on,borderTopLeftRadius:on,borderTopRightRadius:on,borderBottomRightRadius:on,borderBottomLeftRadius:on,width:on,maxWidth:on,height:on,maxHeight:on,top:on,right:on,bottom:on,left:on,padding:on,paddingTop:on,paddingRight:on,paddingBottom:on,paddingLeft:on,margin:on,marginTop:on,marginRight:on,marginBottom:on,marginLeft:on,backgroundPositionX:on,backgroundPositionY:on,...{rotate:rf,rotateX:rf,rotateY:rf,rotateZ:rf,scale:iC,scaleX:iC,scaleY:iC,scaleZ:iC,skew:rf,skewX:rf,skewY:rf,distance:on,translateX:on,translateY:on,translateZ:on,x:on,y:on,z:on,perspective:on,transformPerspective:on,opacity:E0,originX:oz,originY:oz,originZ:on},zIndex:Hz,fillOpacity:E0,strokeOpacity:E0,numOctaves:Hz},VQ={...uR,color:Cr,backgroundColor:Cr,outlineColor:Cr,fill:Cr,stroke:Cr,borderColor:Cr,borderTopColor:Cr,borderRightColor:Cr,borderBottomColor:Cr,borderLeftColor:Cr,filter:sR,WebkitFilter:sR},Bz=e=>VQ[e];function Pz(e,t){let a=Bz(e);return a!==sR&&(a=of),a.getAnimatableNone?a.getAnimatableNone(t):void 0}const HQ=new Set(["auto","none","0"]);function BQ(e,t,a){let r=0,l;for(;r<e.length&&!l;){const c=e[r];typeof c=="string"&&!HQ.has(c)&&O0(c).values.length&&(l=e[r]),r++}if(l&&a)for(const c of t)e[c]=Pz(a,l)}class PQ extends oR{constructor(t,a,r,l,c){super(t,a,r,l,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let p=t[g];if(typeof p=="string"&&(p=p.trim(),VO(p))){const y=$z(p,a.current);y!==void 0&&(t[g]=y),g===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!zz.has(r)||t.length!==2)return;const[l,c]=t,f=Vz(l),m=Vz(c);if(f!==m)if(Ez(f)&&Ez(m))for(let g=0;g<t.length;g++){const p=t[g];typeof p=="string"&&(t[g]=parseFloat(p))}else Pd[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:a}=this,r=[];for(let l=0;l<t.length;l++)(t[l]===null||$Q(t[l]))&&r.push(l);r.length&&BQ(t,r,a)}measureInitialState(){const{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pd[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&t.getValue(r,l).jump(l,!1)}measureEndState(){const{element:t,name:a,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const l=t.getValue(a);l&&l.jump(this.measuredOrigin,!1);const c=r.length-1,f=r[c];r[c]=Pd[a](t.measureViewportBox(),window.getComputedStyle(t.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([m,g])=>{t.getValue(m).set(g)}),this.resolveNoneKeyframes()}}function UQ(e,t,a){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const l=a?.[e]??r.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e)}const Uz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Iz(e){return U6(e)&&"offsetHeight"in e}var IQ={};const Fz=30,FQ=e=>!isNaN(parseFloat(e));class kQ{constructor(t,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,l=!0)=>{const c=vo.now();if(this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty();l&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=vo.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FQ(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return IQ.NODE_ENV!=="production"&&NO(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new DO);const r=this.events[t].add(a);return t==="change"?()=>{r(),Pa.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fz)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,Fz);return F6(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function np(e,t){return new kQ(e,t)}const{schedule:cR}=az(queueMicrotask,!1),os={x:!1,y:!1};function kz(){return os.x||os.y}function GQ(e){return e==="x"||e==="y"?os[e]?null:(os[e]=!0,()=>{os[e]=!1}):os.x||os.y?null:(os.x=os.y=!0,()=>{os.x=os.y=!1})}function Gz(e,t){const a=UQ(e),r=new AbortController,l={passive:!0,...t,signal:r.signal};return[a,l,()=>r.abort()]}function qz(e){return!(e.pointerType==="touch"||kz())}function qQ(e,t,a={}){const[r,l,c]=Gz(e,a),f=m=>{if(!qz(m))return;const{target:g}=m,p=t(g,m);if(typeof p!="function"||!g)return;const y=S=>{qz(S)&&(p(S),g.removeEventListener("pointerleave",y))};g.addEventListener("pointerleave",y,l)};return r.forEach(m=>{m.addEventListener("pointerenter",f,l)}),c}const Yz=(e,t)=>t?e===t?!0:Yz(e,t.parentElement):!1,fR=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,YQ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function XQ(e){return YQ.has(e.tagName)||e.tabIndex!==-1}const uC=new WeakSet;function Xz(e){return t=>{t.key==="Enter"&&e(t)}}function dR(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WQ=(e,t)=>{const a=e.currentTarget;if(!a)return;const r=Xz(()=>{if(uC.has(a))return;dR(a,"down");const l=Xz(()=>{dR(a,"up")}),c=()=>dR(a,"cancel");a.addEventListener("keyup",l,t),a.addEventListener("blur",c,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function Wz(e){return fR(e)&&!kz()}function ZQ(e,t,a={}){const[r,l,c]=Gz(e,a),f=m=>{const g=m.currentTarget;if(!Wz(m))return;uC.add(g);const p=t(g,m),y=(T,O)=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",E),uC.has(g)&&uC.delete(g),Wz(T)&&typeof p=="function"&&p(T,{success:O})},S=T=>{y(T,g===window||g===document||a.useGlobalTarget||Yz(g,T.target))},E=T=>{y(T,!1)};window.addEventListener("pointerup",S,l),window.addEventListener("pointercancel",E,l)};return r.forEach(m=>{(a.useGlobalTarget?window:m).addEventListener("pointerdown",f,l),Iz(m)&&(m.addEventListener("focus",p=>WQ(p,l)),!XQ(m)&&!m.hasAttribute("tabindex")&&(m.tabIndex=0))}),c}function Zz(e){return U6(e)&&"ownerSVGElement"in e}function KQ(e){return Zz(e)&&e.tagName==="svg"}const wi=e=>!!(e&&e.getVelocity),QQ=[...Lz,Cr,of],JQ=e=>QQ.find(jz(e)),hR=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class eJ extends C.Component{getSnapshotBeforeUpdate(t){const a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){const r=a.offsetParent,l=Iz(r)&&r.offsetWidth||0,c=this.props.sizeRef.current;c.height=a.offsetHeight||0,c.width=a.offsetWidth||0,c.top=a.offsetTop,c.left=a.offsetLeft,c.right=l-c.width-c.left}return null}componentDidUpdate(){}render(){return this.props.children}}function tJ({children:e,isPresent:t,anchorX:a,root:r}){const l=C.useId(),c=C.useRef(null),f=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:m}=C.useContext(hR);return C.useInsertionEffect(()=>{const{width:g,height:p,top:y,left:S,right:E}=f.current;if(t||!c.current||!g||!p)return;const T=a==="left"?`left: ${S}`:`right: ${E}`;c.current.dataset.motionPopId=l;const O=document.createElement("style");m&&(O.nonce=m);const M=r??document.head;return M.appendChild(O),O.sheet&&O.sheet.insertRule(`
644
+ `,[t,a]}setOptions(t){if(this.options.container!==t.container){const a=this.parentFromOptionsContainer(t.container);a.appendChild(this.container),this.parent=a}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:a}=this.scrollContainer,r=a*t;this.setScroll(r)}destroy(){var t,a;this.subscriptions.forEach(r=>r()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(a=this.unsubscribeOnScroll)===null||a===void 0||a.forEach(r=>r()),this.unsubscribeOnScroll=[]}createDelay(t=10){let a,r;const l=()=>{a&&clearTimeout(a),r&&r()};return this.timeouts.push(l),()=>new Promise((c,f)=>{l(),r=f,a=setTimeout(()=>{a=void 0,r=void 0,c()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const a=document.createElement("canvas"),r=a.getContext("2d"),l=a.height*(window.devicePixelRatio||1),c=r.createLinearGradient(0,0,0,l),f=1/(t.length-1);return t.forEach((m,g)=>{const p=g*f;c.addColorStop(p,m)}),c}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,a,r,l){const c=t[0],f=t[1]||t[0],m=c.length,{width:g,height:p}=r.canvas,y=p/2,S=this.getPixelRatio(),E=a.barWidth?a.barWidth*S:1,T=a.barGap?a.barGap*S:a.barWidth?E/2:0,O=a.barRadius||0,M=g/(E+T)/m,A=O&&"roundRect"in r?"roundRect":"rect";r.beginPath();let D=0,_=0,z=0;for(let j=0;j<=m;j++){const $=Math.round(j*M);if($>D){const P=Math.round(_*y*l),q=P+Math.round(z*y*l)||1;let Y=y-P;a.barAlign==="top"?Y=0:a.barAlign==="bottom"&&(Y=p-q),r[A](D*(E+T),Y,E,q,O),D=$,_=0,z=0}const V=Math.abs(c[j]||0),H=Math.abs(f[j]||0);V>_&&(_=V),H>z&&(z=H)}r.fill(),r.closePath()}renderLineWaveform(t,a,r,l){const c=f=>{const m=t[f]||t[0],g=m.length,{height:p}=r.canvas,y=p/2,S=r.canvas.width/g;r.moveTo(0,y);let E=0,T=0;for(let O=0;O<=g;O++){const M=Math.round(O*S);if(M>E){const D=y+(Math.round(T*y*l)||1)*(f===0?-1:1);r.lineTo(E,D),E=M,T=0}const A=Math.abs(m[O]||0);A>T&&(T=A)}r.lineTo(E,y)};r.beginPath(),c(0),c(1),r.fill(),r.closePath()}renderWaveform(t,a,r){if(r.fillStyle=this.convertColorValues(a.waveColor),a.renderFunction)return void a.renderFunction(t,r);let l=a.barHeight||1;if(a.normalize){const c=Array.from(t[0]).reduce((f,m)=>Math.max(f,Math.abs(m)),0);l=c?1/c:1}a.barWidth||a.barGap||a.barAlign?this.renderBarWaveform(t,a,r,l):this.renderLineWaveform(t,a,r,l)}renderSingleCanvas(t,a,r,l,c,f,m){const g=this.getPixelRatio(),p=document.createElement("canvas");p.width=Math.round(r*g),p.height=Math.round(l*g),p.style.width=`${r}px`,p.style.height=`${l}px`,p.style.left=`${Math.round(c)}px`,f.appendChild(p);const y=p.getContext("2d");if(this.renderWaveform(t,a,y),p.width>0&&p.height>0){const S=p.cloneNode(),E=S.getContext("2d");E.drawImage(p,0,0),E.globalCompositeOperation="source-in",E.fillStyle=this.convertColorValues(a.progressColor),E.fillRect(0,0,p.width,p.height),m.appendChild(S)}}renderMultiCanvas(t,a,r,l,c,f){const m=this.getPixelRatio(),{clientWidth:g}=this.scrollContainer,p=r/m;let y=Math.min(Xm.MAX_CANVAS_WIDTH,g,p),S={};if(a.barWidth||a.barGap){const A=a.barWidth||.5,D=A+(a.barGap||A/2);y%D!=0&&(y=Math.floor(y/D)*D)}if(y===0)return;const E=A=>{if(A<0||A>=T||S[A])return;S[A]=!0;const D=A*y;let _=Math.min(p-D,y);if(a.barWidth||a.barGap){const j=a.barWidth||.5,$=j+(a.barGap||j/2);_=Math.floor(_/$)*$}if(_<=0)return;const z=t.map(j=>{const $=Math.floor(D/p*j.length),V=Math.floor((D+_)/p*j.length);return j.slice($,V)});this.renderSingleCanvas(z,a,_,l,D,c,f)},T=Math.ceil(p/y);if(!this.isScrollable){for(let A=0;A<T;A++)E(A);return}const O=this.scrollContainer.scrollLeft/p,M=Math.floor(O*T);if(E(M-1),E(M),E(M+1),T>1){const A=this.on("scroll",()=>{const{scrollLeft:D}=this.scrollContainer,_=Math.floor(D/p*T);Object.keys(S).length>Xm.MAX_NODES&&(c.innerHTML="",f.innerHTML="",S={}),E(_-1),E(_),E(_+1)});this.unsubscribeOnScroll.push(A)}}renderChannel(t,a,r,l){var{overlay:c}=a,f=function(y,S){var E={};for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&S.indexOf(T)<0&&(E[T]=y[T]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function"){var O=0;for(T=Object.getOwnPropertySymbols(y);O<T.length;O++)S.indexOf(T[O])<0&&Object.prototype.propertyIsEnumerable.call(y,T[O])&&(E[T[O]]=y[T[O]])}return E}(a,["overlay"]);const m=document.createElement("div"),g=this.getHeight(f.height,f.splitChannels);m.style.height=`${g}px`,c&&l>0&&(m.style.marginTop=`-${g}px`),this.canvasWrapper.style.minHeight=`${g}px`,this.canvasWrapper.appendChild(m);const p=m.cloneNode();this.progressWrapper.appendChild(p),this.renderMultiCanvas(t,f,r,g,m,p)}render(t){return ri(this,void 0,void 0,function*(){var a;this.timeouts.forEach(g=>g()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),l=this.scrollContainer.clientWidth,c=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=c>l;const f=this.options.fillParent&&!this.isScrollable,m=(f?l:c)*r;if(this.wrapper.style.width=f?"100%":`${c}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let g=0;g<t.numberOfChannels;g++){const p=Object.assign(Object.assign({},this.options),(a=this.options.splitChannels)===null||a===void 0?void 0:a[g]);this.renderChannel([t.getChannelData(g)],p,m,g)}else{const g=[t.getChannelData(0)];t.numberOfChannels>1&&g.push(t.getChannelData(1)),this.renderChannel(g,this.options,m,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(r=>r()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:a}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:r}=this.progressWrapper.getBoundingClientRect();let l=r-a;l*=2,l=l<0?Math.floor(l):Math.ceil(l),l/=2,this.scrollContainer.scrollLeft+=l}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,a=!1){const{scrollLeft:r,scrollWidth:l,clientWidth:c}=this.scrollContainer,f=t*l,m=r,g=r+c,p=c/2;if(this.isDragging)f+30>g?this.scrollContainer.scrollLeft+=30:f-30<m&&(this.scrollContainer.scrollLeft-=30);else{(f<m||f>g)&&(this.scrollContainer.scrollLeft=f-(this.options.autoCenter?p:0));const y=f-r-p;a&&this.options.autoCenter&&y>0&&(this.scrollContainer.scrollLeft+=Math.min(y,10))}{const y=this.scrollContainer.scrollLeft,S=y/l,E=(y+c)/l;this.emit("scroll",S,E,y,y+c)}}renderProgress(t,a){if(isNaN(t))return;const r=100*t;this.canvasWrapper.style.clipPath=`polygon(${r}% 0%, 100% 0%, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,a)}exportImage(t,a,r){return ri(this,void 0,void 0,function*(){const l=this.canvasWrapper.querySelectorAll("canvas");if(!l.length)throw new Error("No waveform data");if(r==="dataURL"){const c=Array.from(l).map(f=>f.toDataURL(t,a));return Promise.resolve(c)}return Promise.all(Array.from(l).map(c=>new Promise((f,m)=>{c.toBlob(g=>{g?f(g):m(new Error("Could not export image"))},t,a)})))})}}Xm.MAX_CANVAS_WIDTH=8e3,Xm.MAX_NODES=10;class GZ extends b0{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class EO extends b0{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return ri(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(a=>{if(a.status>=400)throw new Error(`Failed to fetch ${t}: ${a.status} (${a.statusText})`);return a.arrayBuffer()}).then(a=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(a)).then(a=>{this.currentSrc===t&&(this.buffer=a,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let a=this.playedDuration*this._playbackRate;(a>=this.duration||a<0)&&(a=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,a),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return ri(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const a=t-this.currentTime,r=this.bufferNode;r?.stop(this.audioContext.currentTime+a),r?.addEventListener("ended",()=>{r===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return ri(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const a=!this.paused;a&&this._pause(),this.playedDuration=t/this._playbackRate,a&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,a;return(t=this._duration)!==null&&t!==void 0?t:((a=this.buffer)===null||a===void 0?void 0:a.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const a=this.buffer.numberOfChannels;for(let r=0;r<a;r++)t.push(this.buffer.getChannelData(r));return t}}const qZ={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Wm extends kZ{static create(t){return new Wm(t)}constructor(t){const a=t.media||(t.backend==="WebAudio"?new EO:void 0);super({media:a,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},qZ,t),this.timer=new GZ;const r=a?void 0:this.getMediaElement();this.renderer=new Xm(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const l=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:c,duration:f}=this.options;(l||c&&f)&&this.load(l,c,f).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,a)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,a))}),this.renderer.on("dblclick",(t,a)=>{this.emit("dblclick",t,a)}),this.renderer.on("scroll",(t,a,r,l)=>{const c=this.getDuration();this.emit("scroll",t*c,a*c,r,l)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",a=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(a),clearTimeout(t),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(a)},r),this.emit("interaction",a*this.getDuration()),this.emit("drag",a)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(a=>{this.registerPlugin(a)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=tC.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=tC.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){t._init(this),this.plugins.push(t);const a=t.once("destroy",()=>{this.plugins=this.plugins.filter(r=>r!==t),this.subscriptions=this.subscriptions.filter(r=>r!==a)});return this.subscriptions.push(a),t}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const a=t/this.getDuration();this.renderer.setScrollPercentage(a)}getActivePlugins(){return this.plugins}loadAudio(t,a,r,l){return ri(this,void 0,void 0,function*(){var c;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!a&&!r){const m=this.options.fetchParams||{};window.AbortController&&!m.signal&&(this.abortController=new AbortController,m.signal=(c=this.abortController)===null||c===void 0?void 0:c.signal);const g=y=>this.emit("loading",y);a=yield FZ.fetchBlob(t,g,m);const p=this.options.blobMimeType;p&&(a=new Blob([a],{type:p}))}this.setSrc(t,a);const f=yield new Promise(m=>{const g=l||this.getDuration();g?m(g):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>m(this.getDuration()),{once:!0}))});if(!t&&!a){const m=this.getMediaElement();m instanceof EO&&(m.duration=f)}if(r)this.decodedData=tC.createBuffer(r,f||0);else if(a){const m=yield a.arrayBuffer();this.decodedData=yield tC.decode(m,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,a,r){return ri(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,a,r)}catch(l){throw this.emit("error",l),l}})}loadBlob(t,a,r){return ri(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,a,r)}catch(l){throw this.emit("error",l),l}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:a=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const l=Math.min(t,this.decodedData.numberOfChannels),c=[];for(let f=0;f<l;f++){const m=this.decodedData.getChannelData(f),g=[],p=m.length/a;for(let y=0;y<a;y++){const S=m.slice(Math.floor(y*p),Math.ceil((y+1)*p));let E=0;for(let T=0;T<S.length;T++){const O=S[T];Math.abs(O)>Math.abs(E)&&(E=O)}g.push(Math.round(E*r)/r)}c.push(g)}return c}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const a=this.getDuration()*t;this.setTime(a)}play(t,a){const r=Object.create(null,{play:{get:()=>super.play}});return ri(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const l=yield r.play.call(this);return a!=null&&(this.media instanceof EO?this.media.stopAt(a):this.stopAtPosition=a),l})}playPause(){return ri(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return ri(this,arguments,void 0,function*(t="image/png",a=1,r="dataURL"){return this.renderer.exportImage(t,a,r)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(a=>a.destroy()),this.subscriptions.forEach(a=>a()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}Wm.BasePlugin=class extends b0{constructor(e){super(),this.subscriptions=[],this.options=e}onInit(){}_init(e){this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(e=>e())}},Wm.dom=IZ;const YZ=({userMessage:e,setUserMessage:t,handleSendMessage:a,handleSendImage:r,handleSendVoice:l,selectedImage:c,setSelectedImage:f,audioBlob:m,setAudioBlob:g,isSending:p})=>{const{t:y}=DZ(),[S,E]=C.useState(!1),[T,O]=C.useState(!1),M=C.useRef(null),A=C.useRef(null),D=C.useRef([]),_=C.useRef(null),z=C.useRef(null),j=q=>{const Y=q.target.files?.[0];Y&&f(Y)},$=()=>{f(null)},V=async()=>{if(!navigator.mediaDevices?.getUserMedia){alert(y("chatInput.voice.notSupported"));return}if(S)M.current?.stop();else try{const q=await navigator.mediaDevices.getUserMedia({audio:!0}),Y=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/mp4",te=new MediaRecorder(q,{mimeType:Y});M.current=te,D.current=[],te.ondataavailable=G=>{G.data.size>0&&D.current.push(G.data)},te.onstop=()=>{const G=new Blob(D.current,{type:Y});g(G),E(!1),q.getTracks().forEach(K=>K.stop())},te.start(),E(!0)}catch(q){console.error(q),alert(y("chatInput.voice.permissionError"))}};C.useEffect(()=>{if(m&&_.current){z.current?.destroy();const q=URL.createObjectURL(m);z.current=Wm.create({container:_.current,waveColor:"#ccc",progressColor:"#7F28F8",cursorWidth:0,barWidth:3,barHeight:1.5,barGap:2,height:40,interact:!0}),z.current.load(q),z.current.on("finish",()=>O(!1))}},[m]);const H=()=>{z.current&&(z.current.playPause(),O(q=>!q))},P=()=>{E(!1),g(null),z.current?.destroy()};return re.jsxs("div",{style:{display:"flex",alignItems:"center",backgroundColor:"white",border:"1px solid #d1d5db",borderRadius:"9999px",padding:"0.5rem 0.75rem",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",width:"95%",height:"56px"},children:[re.jsx("button",{style:{color:"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer",padding:"0"},onClick:()=>A.current?.click(),children:c?re.jsxs("div",{style:{position:"relative"},children:[re.jsx("img",{src:URL.createObjectURL(c),alt:y("chatInput.image.selectedAlt"),style:{width:"2rem",height:"2rem",borderRadius:"9999px",objectFit:"cover",padding:"0"}}),re.jsx(c0,{style:{position:"absolute",top:"-0.5rem",right:"-0.5rem",fontSize:"14px",color:"#ef4444",background:"white",borderRadius:"9999px",cursor:"pointer"},onClick:q=>{q.stopPropagation(),$()}})]}):re.jsx(m4,{style:{fontSize:"20px"}})}),re.jsx("input",{disabled:p,type:"file",accept:"image/*",ref:A,onChange:j,style:{display:"none",padding:"0"}}),re.jsx(Nd,{title:S?"Stop Recording":"Send Audio",children:re.jsx("button",{onClick:V,style:{color:S?"#ef4444":"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer",padding:"0"},children:S?re.jsx(g4,{style:{fontSize:"20px"}}):re.jsx(c4,{style:{fontSize:"20px"}})})}),re.jsx("div",{style:{flex:1,margin:"0 0.5rem",minWidth:0,maxWidth:"100%",display:"flex",alignItems:"center"},children:m?re.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",backgroundColor:"#f3f4f6",padding:"0.5rem 1rem",borderRadius:"0.5rem"},children:[re.jsx("button",{style:{background:"none",border:"none",marginRight:"0.75rem",color:"#7f28f8",cursor:"pointer",padding:"0"},onClick:H,children:T?re.jsx(GT,{style:{fontSize:"24px"}}):re.jsx(qT,{style:{fontSize:"24px"}})}),re.jsx("div",{ref:_,style:{width:"100%",height:"2rem"}}),re.jsx(c0,{style:{fontSize:"18px",color:"#ef4444",marginLeft:"0.75rem",cursor:"pointer"},onClick:P})]}):S?re.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f4f6",padding:"0.5rem 1rem",borderRadius:"0.5rem",animation:"pulse 2s infinite"},children:re.jsx("span",{children:"Recording"})}):re.jsx(Xu,{type:"text",value:e,onChange:q=>t(q.target.value),placeholder:"Message...",style:{width:"100%",border:"none",fontSize:"16px",margin:0,lineHeight:1.5,color:"#374151",padding:"0"},onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),c?(r(c,e),$(),t("")):e.trim()&&(a(),t("")))}})}),re.jsx("button",{disabled:p,onClick:()=>{const q=!!c,Y=!!e.trim();q?(r(c,e),$(),t("")):!!m?(l(m),P()):Y&&a()},"aria-label":y("chatInput.send"),style:{color:"#6b7280",background:"none",border:"none",margin:"0 0.5rem",cursor:"pointer",padding:"0"},children:re.jsx(p4,{style:{fontSize:"20px"}})})]})};function XZ({suggestions:e,colorCode:t,sendMessageSuggestion:a}){return re.jsx("div",{style:{overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",paddingTop:"4px",paddingBottom:"8px",width:"100%",boxSizing:"border-box",marginLeft:"4%",marginTop:"4px",marginBottom:"4px"},children:re.jsx("div",{style:{display:"inline-flex",gap:"0.5rem"},children:e?.map((r,l)=>re.jsx("button",{onClick:()=>a(r),style:{whiteSpace:"nowrap",padding:"0.5rem 1rem",border:`1px solid ${t}`,borderRadius:"9999px",backgroundColor:"white",cursor:"pointer",fontSize:"14px",color:t,flexShrink:0},onMouseEnter:c=>{c.currentTarget.style.backgroundColor="#f3f3f3"},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="white"},children:r},l))})})}function WZ(){return re.jsxs("div",{className:"jawebcss-powered-container",children:[re.jsx("span",{className:"jawebcss-powered-label",children:"Powered by"}),re.jsx("a",{href:"https://jaweb.me/",target:"_blank",className:"jawebcss-powered-link",rel:"noopener noreferrer",children:"Jaweb"})]})}const ZZ=()=>re.jsxs("div",{className:"typing-animation",children:[re.jsx("span",{children:"."}),re.jsx("span",{children:"."}),re.jsx("span",{children:"."})]}),KZ=({message:e,colorCode:t,handleAddToCart:a,handleRemoveFromCart:r})=>{const[l,c]=C.useState({}),[f,m]=C.useState({}),g=T=>{const O=/(https?:\/\/[^\s]+)/g;return T?.split(O).map((M,A)=>O.test(M)?re.jsx("a",{href:M.trim(),style:{color:"#00b3bc"},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:M},A):re.jsx("span",{children:M},A))},p=T=>{const O=T.trim();if(!O.includes("Name:")||!O.includes("VariantId"))return null;const M=O.match(/Name\s*[:\-]\s*(.+)/i),A=O.match(/Price\s*[:\-]\s*(.+)/i),D=O.match(/Link\s*[:\-]\s*(https?:\/\/[^\s]+)/i),_=O.match(/VariantId\s*[:\-]\s*(.+)/i),z=O.match(/variant_tag_name\s*[:\-]\s*(.+)/i),j=O.match(/^color\s*[:\-]\s*([^\r\n]*)$/im),$=O.match(/^size\s*[:\-]\s*([^\r\n]*)$/im);return!M||!A||!D||!_||!z?null:{name:M[1].trim(),price:A[1].trim(),link:D[1].trim(),image:"",variant_id:_[1].trim(),variant_tag_name:z[1].trim(),color:j?.[1]?.trim(),size:$?.[1]?.trim()}},y=C.useMemo(()=>{const T=e.split("|||").map(A=>A.trim()).filter(Boolean),O=[];let M=null;for(const A of T)if(A.startsWith("img - ")){const D=A.replace(/^img\s*[-:]\s*/,"").trim();if(M)M.image=D;else{const _=[...O].reverse().find(z=>z.type==="product");_&&(_.data.image=D)}}else if(A.includes("Name:")&&A.includes("VariantId")){const D=p(A);D&&(O.push({type:"product",data:D}),M=D)}else O.push({type:"text",data:A}),M=null;return O},[e]),S=C.useMemo(()=>{const T={};for(const O of y)if(O.type==="product"){const M=O.data;T[M.variant_tag_name]||(T[M.variant_tag_name]=[]),T[M.variant_tag_name].push(M)}return T},[y]),E=(T,O=22)=>T.length>O?T.slice(0,O)+"...":T;return re.jsx("div",{className:"space-y-6 mt-4",children:(()=>{const T=new Set;return y.map((O,M)=>{if(O.type==="text")return re.jsx("p",{className:"whitespace-pre-wrap break-words",children:g(O.data)},M);if(O.type==="product"){const D=O.data.variant_tag_name;if(T.has(D))return null;T.add(D);const _=S[D],z=f[D]||_[0].variant_id,j=_.find(G=>G.variant_id===z)||_[0],$=l[j.variant_id]||0,V=Array.from(new Set(_.map(G=>G.color?.trim()).filter(G=>G&&G.toLowerCase()!=="none"))),H=Array.from(new Set(_.map(G=>G.size?.trim()).filter(G=>G&&G.toLowerCase()!=="none"))),P=(G,K)=>_.some(J=>J.color===G&&J.size===K),q=(G,K)=>{const J=_.find(ie=>(!G||ie.color===G)&&(!K||ie.size===K));J&&m(ie=>({...ie,[D]:J.variant_id}))},Y=async()=>{const G=$+1;c(K=>({...K,[j.variant_id]:G})),await a(j.variant_id,j.name,1)},te=async()=>{if($===0)return;const G=$-1;c(K=>({...K,[j.variant_id]:G})),await r(j.variant_id,1)};return re.jsxs("div",{className:"product-card",children:[re.jsx("div",{className:"product-image-container",children:re.jsx("img",{src:j.image,alt:j.name,className:"product-image",onClick:()=>window.open(j.link,"_blank")})}),re.jsxs("div",{className:"product-details",children:[re.jsx("a",{href:j.link,target:"_blank",rel:"noopener noreferrer",className:"product-name",children:E(j.name)}),re.jsx("p",{className:"product-price",children:j.price}),V.length>0&&re.jsxs("div",{children:[re.jsx("p",{className:"label",children:"Color:"}),re.jsx("div",{className:"color-options",children:V.map(G=>{const K=!P(G,j.size),J=G===j.color;return re.jsx("button",{disabled:K,onClick:()=>q(G,j.size),className:`color-button ${J?"active":""} ${K?"disabled":""}`,style:J?{backgroundColor:t,color:"white"}:{},children:G==="None"?"One Color":G},G)})})]}),H.length>0&&re.jsxs("div",{children:[re.jsx("p",{className:"label",children:"Size:"}),re.jsx("div",{className:"size-options",children:H.map(G=>{const K=!P(j.color,G),J=G===j.size;return re.jsx("button",{disabled:K,onClick:()=>q(j.color,G),className:`size-button ${J?"active":""} ${K?"disabled":""}`,style:J?{backgroundColor:t,color:"white"}:{},children:G==="None"?"One size":G},G)})})]}),re.jsxs("div",{className:"cart-controls",children:[re.jsx("button",{onClick:te,className:"cart-button",children:"–"}),re.jsx("span",{className:"cart-count",children:$}),re.jsx("button",{onClick:Y,className:"cart-button increment",style:{backgroundColor:t,color:"#fff"},children:"+"})]})]})]},M)}return null})})()})},H6=({message:e})=>{const t=e.find(r=>r.type==="image_url")?.image_url?.url,a=e?.isBusiness;return re.jsx("div",{children:re.jsx("div",{children:t&&re.jsx("div",{className:"mb-2 bg-transparent text-white ",children:re.jsx("img",{src:t,alt:"Chat image",style:{width:200},className:`rounded-md bg-transparent mt-2 max-w-xs ${a?"border border-gray-300 shadow-sm":""}`})})})})},QZ=({message:e,colorCode:t})=>{const a=e.find(l=>l.type==="text")?.text,r=l=>{const c=/(https?:\/\/[^\s]+)/g;return l.split(c).map((f,m)=>c.test(f)?re.jsx("a",{href:f.trim(),style:{color:t},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:f},m):re.jsx("span",{children:f},m))};return re.jsx(re.Fragment,{children:a&&re.jsx("div",{style:{color:"white",border:1,backgroundColor:t,paddingTop:10,paddingBottom:10,paddingInline:14,maxWidth:"85%",lineHeight:1.4,borderRadius:"16px",wordBreak:"break-word"},children:re.jsx("p",{children:r(a)})})})},JZ=({link:e,colorCode:t,transcription:a})=>{const r=C.useRef(null),l=C.useRef(null),[c,f]=C.useState(!1),[m,g]=C.useState(!1);C.useEffect(()=>{if(r.current)return l.current?.destroy(),l.current=Wm.create({container:r.current,waveColor:"white",progressColor:"white",cursorWidth:0,barWidth:3,barHeight:1.5,barGap:2,height:40,interact:!0}),l.current.load(e),l.current.on("finish",()=>f(!1)),()=>{l.current?.destroy()}},[e,t]);const p=()=>{l.current&&(l.current.playPause(),f(y=>!y))};return re.jsxs("div",{style:{backgroundColor:t,padding:"12px",borderRadius:"20px",color:"white",maxWidth:"350px",marginBottom:"16px"},children:[re.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[re.jsx("button",{onClick:p,style:{background:"transparent",border:"none",color:"white",marginRight:"12px",cursor:"pointer"},children:c?re.jsx(GT,{style:{fontSize:"24px"}}):re.jsx(qT,{style:{fontSize:"24px"}})}),re.jsx("div",{ref:r,style:{width:"130px",height:"40px",overflow:"hidden",color:"white"}})]}),a&&re.jsxs("div",{style:{marginTop:"12px",fontSize:"14px",color:"rgba(255,255,255,0.85)"},children:[re.jsx("button",{onClick:()=>g(!m),style:{background:"none",border:"none",color:"white",textDecoration:"underline",fontSize:"13px",cursor:"pointer",padding:0},children:m?"Hide transcript":"Show transcript"}),m&&re.jsx("p",{style:{marginTop:"6px",lineHeight:"1.4"},children:a})]})]})},eK=({status:e,user:t})=>{if(!e||!t)return null;let a=`${t} is ${e}`;return e==="typing"?a=`${t} is typing...`:a="",re.jsx(re.Fragment,{children:a&&re.jsx("div",{className:"flex justify-center mb-2",children:re.jsx("span",{className:"px-3 py-1 bg-gray-100 text-gray-500 text-sm rounded-full",children:a})})})},tK=({message:e,colorCode:t})=>{const a=l=>{const c=/(https?:\/\/[^\s]+)/g;return l?.split(c).map((f,m)=>c.test(f)?re.jsx("a",{href:f.trim(),style:{color:t},target:"_blank",rel:"noopener noreferrer",className:"underline break-words",children:f},m):re.jsx("span",{children:f},m))};if(e?.startsWith("Add this to cart for me")&&e?.includes("name:")){const c=e?.match(/name:([^,]+)/i)?.[1]?.trim()||"Product";return re.jsxs("div",{style:{backgroundColor:"#E8F5E9",border:"1px solid #C8E6C9",borderRadius:"12px",padding:"12px 16px",color:"#2E7D32",fontWeight:500,fontSize:"15px",maxWidth:"360px",margin:"0 auto",textAlign:"center"},children:["✅ ",re.jsx("strong",{children:c})," has been added to your cart."]})}return re.jsx("p",{children:a(e)})},wO=C.createContext({});function TO(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const OO=typeof window<"u",B6=OO?C.useLayoutEffect:C.useEffect,nC=C.createContext(null);function RO(e,t){e.indexOf(t)===-1&&e.push(t)}function AO(e,t){const a=e.indexOf(t);a>-1&&e.splice(a,1)}const Wu=(e,t,a)=>a>t?t:a<e?e:a;function MO(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var nK={};let Zm=()=>{},Zu=()=>{};nK.NODE_ENV!=="production"&&(Zm=(e,t,a)=>{!e&&typeof console<"u"&&console.warn(MO(t,a))},Zu=(e,t,a)=>{if(!e)throw new Error(MO(t,a))});const Ku={},P6=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function U6(e){return typeof e=="object"&&e!==null}const I6=e=>/^0[^.\s]+$/u.test(e);function _O(e){let t;return()=>(t===void 0&&(t=e()),t)}const bl=e=>e,aK=(e,t)=>a=>t(e(a)),S0=(...e)=>e.reduce(aK),C0=(e,t,a)=>{const r=t-e;return r===0?1:(a-e)/r};class DO{constructor(){this.subscriptions=[]}add(t){return RO(this.subscriptions,t),()=>AO(this.subscriptions,t)}notify(t,a,r){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](t,a,r);else for(let c=0;c<l;c++){const f=this.subscriptions[c];f&&f(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const is=e=>e*1e3,Qs=e=>e/1e3;function F6(e,t){return t?e*(1e3/t):0}const k6=new Set;function NO(e,t,a){e||k6.has(t)||(console.warn(MO(t,a)),k6.add(t))}const G6=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,rK=1e-7,iK=12;function oK(e,t,a,r,l){let c,f,m=0;do f=t+(a-t)/2,c=G6(f,r,l)-e,c>0?a=f:t=f;while(Math.abs(c)>rK&&++m<iK);return f}function x0(e,t,a,r){if(e===t&&a===r)return bl;const l=c=>oK(c,0,1,e,a);return c=>c===0||c===1?c:G6(l(c),t,r)}const q6=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Y6=e=>t=>1-e(1-t),X6=x0(.33,1.53,.69,.99),$O=Y6(X6),W6=q6($O),Z6=e=>(e*=2)<1?.5*$O(e):.5*(2-Math.pow(2,-10*(e-1))),zO=e=>1-Math.sin(Math.acos(e)),K6=Y6(zO),Q6=q6(zO),lK=x0(.42,0,1,1),sK=x0(0,0,.58,1),J6=x0(.42,0,.58,1),uK=e=>Array.isArray(e)&&typeof e[0]!="number",ez=e=>Array.isArray(e)&&typeof e[0]=="number",tz={linear:bl,easeIn:lK,easeInOut:J6,easeOut:sK,circIn:zO,circInOut:Q6,circOut:K6,backIn:$O,backInOut:W6,backOut:X6,anticipate:Z6},cK=e=>typeof e=="string",nz=e=>{if(ez(e)){Zu(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,a,r,l]=e;return x0(t,a,r,l)}else if(cK(e))return Zu(tz[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),tz[e];return e},aC=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function fK(e,t){let a=new Set,r=new Set,l=!1,c=!1;const f=new WeakSet;let m={delta:0,timestamp:0,isProcessing:!1};function g(y){f.has(y)&&(p.schedule(y),e()),y(m)}const p={schedule:(y,S=!1,E=!1)=>{const O=E&&l?a:r;return S&&f.add(y),O.has(y)||O.add(y),y},cancel:y=>{r.delete(y),f.delete(y)},process:y=>{if(m=y,l){c=!0;return}l=!0,[a,r]=[r,a],a.forEach(g),a.clear(),l=!1,c&&(c=!1,p.process(y))}};return p}const dK=40;function az(e,t){let a=!1,r=!0;const l={delta:0,timestamp:0,isProcessing:!1},c=()=>a=!0,f=aC.reduce((z,j)=>(z[j]=fK(c),z),{}),{setup:m,read:g,resolveKeyframes:p,preUpdate:y,update:S,preRender:E,render:T,postRender:O}=f,M=()=>{const z=Ku.useManualTiming?l.timestamp:performance.now();a=!1,Ku.useManualTiming||(l.delta=r?1e3/60:Math.max(Math.min(z-l.timestamp,dK),1)),l.timestamp=z,l.isProcessing=!0,m.process(l),g.process(l),p.process(l),y.process(l),S.process(l),E.process(l),T.process(l),O.process(l),l.isProcessing=!1,a&&t&&(r=!1,e(M))},A=()=>{a=!0,r=!0,l.isProcessing||e(M)};return{schedule:aC.reduce((z,j)=>{const $=f[j];return z[j]=(V,H=!1,P=!1)=>(a||A(),$.schedule(V,H,P)),z},{}),cancel:z=>{for(let j=0;j<aC.length;j++)f[aC[j]].cancel(z)},state:l,steps:f}}const{schedule:Pa,cancel:af,state:ii,steps:jO}=az(typeof requestAnimationFrame<"u"?requestAnimationFrame:bl,!0);let rC;function hK(){rC=void 0}const vo={now:()=>(rC===void 0&&vo.set(ii.isProcessing||Ku.useManualTiming?ii.timestamp:performance.now()),rC),set:e=>{rC=e,queueMicrotask(hK)}},rz=e=>t=>typeof t=="string"&&t.startsWith(e),LO=rz("--"),mK=rz("var(--"),VO=e=>mK(e)?pK.test(e.split("/*")[0].trim()):!1,pK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Km={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},E0={...Km,transform:e=>Wu(0,1,e)},iC={...Km,default:1},w0=e=>Math.round(e*1e5)/1e5,HO=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gK(e){return e==null}const vK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BO=(e,t)=>a=>!!(typeof a=="string"&&vK.test(a)&&a.startsWith(e)||t&&!gK(a)&&Object.prototype.hasOwnProperty.call(a,t)),iz=(e,t,a)=>r=>{if(typeof r!="string")return r;const[l,c,f,m]=r.match(HO);return{[e]:parseFloat(l),[t]:parseFloat(c),[a]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},yK=e=>Wu(0,255,e),PO={...Km,transform:e=>Math.round(yK(e))},Hd={test:BO("rgb","red"),parse:iz("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+PO.transform(e)+", "+PO.transform(t)+", "+PO.transform(a)+", "+w0(E0.transform(r))+")"};function bK(e){let t="",a="",r="",l="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),l=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),l=e.substring(4,5),t+=t,a+=a,r+=r,l+=l),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:l?parseInt(l,16)/255:1}}const UO={test:BO("#"),parse:bK,transform:Hd.transform},T0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),rf=T0("deg"),Js=T0("%"),on=T0("px"),SK=T0("vh"),CK=T0("vw"),oz={...Js,parse:e=>Js.parse(e)/100,transform:e=>Js.transform(e*100)},Qm={test:BO("hsl","hue"),parse:iz("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Js.transform(w0(t))+", "+Js.transform(w0(a))+", "+w0(E0.transform(r))+")"},Cr={test:e=>Hd.test(e)||UO.test(e)||Qm.test(e),parse:e=>Hd.test(e)?Hd.parse(e):Qm.test(e)?Qm.parse(e):UO.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hd.transform(e):Qm.transform(e),getAnimatableNone:e=>{const t=Cr.parse(e);return t.alpha=0,Cr.transform(t)}},xK=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function EK(e){return isNaN(e)&&typeof e=="string"&&(e.match(HO)?.length||0)+(e.match(xK)?.length||0)>0}const lz="number",sz="color",wK="var",TK="var(",uz="${}",OK=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function O0(e){const t=e.toString(),a=[],r={color:[],number:[],var:[]},l=[];let c=0;const m=t.replace(OK,g=>(Cr.test(g)?(r.color.push(c),l.push(sz),a.push(Cr.parse(g))):g.startsWith(TK)?(r.var.push(c),l.push(wK),a.push(g)):(r.number.push(c),l.push(lz),a.push(parseFloat(g))),++c,uz)).split(uz);return{values:a,split:m,indexes:r,types:l}}function cz(e){return O0(e).values}function fz(e){const{split:t,types:a}=O0(e),r=t.length;return l=>{let c="";for(let f=0;f<r;f++)if(c+=t[f],l[f]!==void 0){const m=a[f];m===lz?c+=w0(l[f]):m===sz?c+=Cr.transform(l[f]):c+=l[f]}return c}}const RK=e=>typeof e=="number"?0:Cr.test(e)?Cr.getAnimatableNone(e):e;function AK(e){const t=cz(e);return fz(e)(t.map(RK))}const of={test:EK,parse:cz,createTransformer:fz,getAnimatableNone:AK};function IO(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function MK({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let l=0,c=0,f=0;if(!t)l=c=f=a;else{const m=a<.5?a*(1+t):a+t-a*t,g=2*a-m;l=IO(g,m,e+1/3),c=IO(g,m,e),f=IO(g,m,e-1/3)}return{red:Math.round(l*255),green:Math.round(c*255),blue:Math.round(f*255),alpha:r}}function oC(e,t){return a=>a>0?t:e}const Za=(e,t,a)=>e+(t-e)*a,FO=(e,t,a)=>{const r=e*e,l=a*(t*t-r)+r;return l<0?0:Math.sqrt(l)},_K=[UO,Hd,Qm],DK=e=>_K.find(t=>t.test(e));function dz(e){const t=DK(e);if(Zm(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let a=t.parse(e);return t===Qm&&(a=MK(a)),a}const hz=(e,t)=>{const a=dz(e),r=dz(t);if(!a||!r)return oC(e,t);const l={...a};return c=>(l.red=FO(a.red,r.red,c),l.green=FO(a.green,r.green,c),l.blue=FO(a.blue,r.blue,c),l.alpha=Za(a.alpha,r.alpha,c),Hd.transform(l))},kO=new Set(["none","hidden"]);function NK(e,t){return kO.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function $K(e,t){return a=>Za(e,t,a)}function GO(e){return typeof e=="number"?$K:typeof e=="string"?VO(e)?oC:Cr.test(e)?hz:LK:Array.isArray(e)?mz:typeof e=="object"?Cr.test(e)?hz:zK:oC}function mz(e,t){const a=[...e],r=a.length,l=e.map((c,f)=>GO(c)(c,t[f]));return c=>{for(let f=0;f<r;f++)a[f]=l[f](c);return a}}function zK(e,t){const a={...e,...t},r={};for(const l in a)e[l]!==void 0&&t[l]!==void 0&&(r[l]=GO(e[l])(e[l],t[l]));return l=>{for(const c in r)a[c]=r[c](l);return a}}function jK(e,t){const a=[],r={color:0,var:0,number:0};for(let l=0;l<t.values.length;l++){const c=t.types[l],f=e.indexes[c][r[c]],m=e.values[f]??0;a[l]=m,r[c]++}return a}const LK=(e,t)=>{const a=of.createTransformer(t),r=O0(e),l=O0(t);return r.indexes.var.length===l.indexes.var.length&&r.indexes.color.length===l.indexes.color.length&&r.indexes.number.length>=l.indexes.number.length?kO.has(e)&&!l.values.length||kO.has(t)&&!r.values.length?NK(e,t):S0(mz(jK(r,l),l.values),a):(Zm(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),oC(e,t))};function pz(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?Za(e,t,a):GO(e)(e,t)}const VK=e=>{const t=({timestamp:a})=>e(a);return{start:(a=!0)=>Pa.update(t,a),stop:()=>af(t),now:()=>ii.isProcessing?ii.timestamp:vo.now()}},gz=(e,t,a=10)=>{let r="";const l=Math.max(Math.round(t/a),2);for(let c=0;c<l;c++)r+=Math.round(e(c/(l-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},lC=2e4;function qO(e){let t=0;const a=50;let r=e.next(t);for(;!r.done&&t<lC;)t+=a,r=e.next(t);return t>=lC?1/0:t}function HK(e,t=100,a){const r=a({...e,keyframes:[0,t]}),l=Math.min(qO(r),lC);return{type:"keyframes",ease:c=>r.next(l*c).value/t,duration:Qs(l)}}const BK=5;function vz(e,t,a){const r=Math.max(t-BK,0);return F6(a-e(r),t-r)}const Ka={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},YO=.001;function PK({duration:e=Ka.duration,bounce:t=Ka.bounce,velocity:a=Ka.velocity,mass:r=Ka.mass}){let l,c;Zm(e<=is(Ka.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-t;f=Wu(Ka.minDamping,Ka.maxDamping,f),e=Wu(Ka.minDuration,Ka.maxDuration,Qs(e)),f<1?(l=p=>{const y=p*f,S=y*e,E=y-a,T=XO(p,f),O=Math.exp(-S);return YO-E/T*O},c=p=>{const S=p*f*e,E=S*a+a,T=Math.pow(f,2)*Math.pow(p,2)*e,O=Math.exp(-S),M=XO(Math.pow(p,2),f);return(-l(p)+YO>0?-1:1)*((E-T)*O)/M}):(l=p=>{const y=Math.exp(-p*e),S=(p-a)*e+1;return-YO+y*S},c=p=>{const y=Math.exp(-p*e),S=(a-p)*(e*e);return y*S});const m=5/e,g=IK(l,c,m);if(e=is(e),isNaN(g))return{stiffness:Ka.stiffness,damping:Ka.damping,duration:e};{const p=Math.pow(g,2)*r;return{stiffness:p,damping:f*2*Math.sqrt(r*p),duration:e}}}const UK=12;function IK(e,t,a){let r=a;for(let l=1;l<UK;l++)r=r-e(r)/t(r);return r}function XO(e,t){return e*Math.sqrt(1-t*t)}const FK=["duration","bounce"],kK=["stiffness","damping","mass"];function yz(e,t){return t.some(a=>e[a]!==void 0)}function GK(e){let t={velocity:Ka.velocity,stiffness:Ka.stiffness,damping:Ka.damping,mass:Ka.mass,isResolvedFromDuration:!1,...e};if(!yz(e,kK)&&yz(e,FK))if(e.visualDuration){const a=e.visualDuration,r=2*Math.PI/(a*1.2),l=r*r,c=2*Wu(.05,1,1-(e.bounce||0))*Math.sqrt(l);t={...t,mass:Ka.mass,stiffness:l,damping:c}}else{const a=PK(e);t={...t,...a,mass:Ka.mass},t.isResolvedFromDuration=!0}return t}function sC(e=Ka.visualDuration,t=Ka.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:l}=a;const c=a.keyframes[0],f=a.keyframes[a.keyframes.length-1],m={done:!1,value:c},{stiffness:g,damping:p,mass:y,duration:S,velocity:E,isResolvedFromDuration:T}=GK({...a,velocity:-Qs(a.velocity||0)}),O=E||0,M=p/(2*Math.sqrt(g*y)),A=f-c,D=Qs(Math.sqrt(g/y)),_=Math.abs(A)<5;r||(r=_?Ka.restSpeed.granular:Ka.restSpeed.default),l||(l=_?Ka.restDelta.granular:Ka.restDelta.default);let z;if(M<1){const $=XO(D,M);z=V=>{const H=Math.exp(-M*D*V);return f-H*((O+M*D*A)/$*Math.sin($*V)+A*Math.cos($*V))}}else if(M===1)z=$=>f-Math.exp(-D*$)*(A+(O+D*A)*$);else{const $=D*Math.sqrt(M*M-1);z=V=>{const H=Math.exp(-M*D*V),P=Math.min($*V,300);return f-H*((O+M*D*A)*Math.sinh(P)+$*A*Math.cosh(P))/$}}const j={calculatedDuration:T&&S||null,next:$=>{const V=z($);if(T)m.done=$>=S;else{let H=$===0?O:0;M<1&&(H=$===0?is(O):vz(z,$,V));const P=Math.abs(H)<=r,q=Math.abs(f-V)<=l;m.done=P&&q}return m.value=m.done?f:V,m},toString:()=>{const $=Math.min(qO(j),lC),V=gz(H=>j.next($*H).value,$,30);return $+"ms "+V},toTransition:()=>{}};return j}sC.applyToOptions=e=>{const t=HK(e,100,sC);return e.ease=t.ease,e.duration=is(t.duration),e.type="keyframes",e};function WO({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:l=10,bounceStiffness:c=500,modifyTarget:f,min:m,max:g,restDelta:p=.5,restSpeed:y}){const S=e[0],E={done:!1,value:S},T=P=>m!==void 0&&P<m||g!==void 0&&P>g,O=P=>m===void 0?g:g===void 0||Math.abs(m-P)<Math.abs(g-P)?m:g;let M=a*t;const A=S+M,D=f===void 0?A:f(A);D!==A&&(M=D-S);const _=P=>-M*Math.exp(-P/r),z=P=>D+_(P),j=P=>{const q=_(P),Y=z(P);E.done=Math.abs(q)<=p,E.value=E.done?D:Y};let $,V;const H=P=>{T(E.value)&&($=P,V=sC({keyframes:[E.value,O(E.value)],velocity:vz(z,P,E.value),damping:l,stiffness:c,restDelta:p,restSpeed:y}))};return H(0),{calculatedDuration:null,next:P=>{let q=!1;return!V&&$===void 0&&(q=!0,j(P),H(P)),$!==void 0&&P>=$?V.next(P-$):(!q&&j(P),E)}}}function qK(e,t,a){const r=[],l=a||Ku.mix||pz,c=e.length-1;for(let f=0;f<c;f++){let m=l(e[f],e[f+1]);if(t){const g=Array.isArray(t)?t[f]||bl:t;m=S0(g,m)}r.push(m)}return r}function YK(e,t,{clamp:a=!0,ease:r,mixer:l}={}){const c=e.length;if(Zu(c===t.length,"Both input and output ranges must be the same length","range-length"),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const f=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const m=qK(t,r,l),g=m.length,p=y=>{if(f&&y<e[0])return t[0];let S=0;if(g>1)for(;S<e.length-2&&!(y<e[S+1]);S++);const E=C0(e[S],e[S+1],y);return m[S](E)};return a?y=>p(Wu(e[0],e[c-1],y)):p}function XK(e,t){const a=e[e.length-1];for(let r=1;r<=t;r++){const l=C0(0,t,r);e.push(Za(a,1,l))}}function WK(e){const t=[0];return XK(t,e.length-1),t}function ZK(e,t){return e.map(a=>a*t)}function KK(e,t){return e.map(()=>t||J6).splice(0,e.length-1)}function Jm({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){const l=uK(r)?r.map(nz):nz(r),c={done:!1,value:t[0]},f=ZK(a&&a.length===t.length?a:WK(t),e),m=YK(f,t,{ease:Array.isArray(l)?l:KK(t,l)});return{calculatedDuration:e,next:g=>(c.value=m(g),c.done=g>=e,c)}}const QK=e=>e!==null;function ZO(e,{repeat:t,repeatType:a="loop"},r,l=1){const c=e.filter(QK),m=l<0||t&&a!=="loop"&&t%2===1?0:c.length-1;return!m||r===void 0?c[m]:r}const JK={decay:WO,inertia:WO,tween:Jm,keyframes:Jm,spring:sC};function bz(e){typeof e.type=="string"&&(e.type=JK[e.type])}class KO{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,a){return this.finished.then(t,a)}}var eQ={};const tQ=e=>e/100;class QO extends KO{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==vo.now()&&this.tick(vo.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bz(t);const{type:a=Jm,repeat:r=0,repeatDelay:l=0,repeatType:c,velocity:f=0}=t;let{keyframes:m}=t;const g=a||Jm;eQ.NODE_ENV!=="production"&&g!==Jm&&Zu(m.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${m}`,"spring-two-frames"),g!==Jm&&typeof m[0]!="number"&&(this.mixKeyframes=S0(tQ,pz(m[0],m[1])),m=[0,100]);const p=g({...t,keyframes:m});c==="mirror"&&(this.mirroredGenerator=g({...t,keyframes:[...m].reverse(),velocity:-f})),p.calculatedDuration===null&&(p.calculatedDuration=qO(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+l,this.totalDuration=this.resolvedDuration*(r+1)-l,this.generator=p}updateTime(t){const a=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(t,a=!1){const{generator:r,totalDuration:l,mixKeyframes:c,mirroredGenerator:f,resolvedDuration:m,calculatedDuration:g}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:y,repeat:S,repeatType:E,repeatDelay:T,type:O,onUpdate:M,finalKeyframe:A}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),a?this.currentTime=t:this.updateTime(t);const D=this.currentTime-p*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?D<0:D>l;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let z=this.currentTime,j=r;if(S){const P=Math.min(this.currentTime,l)/m;let q=Math.floor(P),Y=P%1;!Y&&P>=1&&(Y=1),Y===1&&q--,q=Math.min(q,S+1),!!(q%2)&&(E==="reverse"?(Y=1-Y,T&&(Y-=T/m)):E==="mirror"&&(j=f)),z=Wu(0,1,Y)*m}const $=_?{done:!1,value:y[0]}:j.next(z);c&&($.value=c($.value));let{done:V}=$;!_&&g!==null&&(V=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return H&&O!==WO&&($.value=ZO(y,this.options,A,this.speed)),M&&M($.value),H&&this.finish(),$}then(t,a){return this.finished.then(t,a)}get duration(){return Qs(this.calculatedDuration)}get time(){return Qs(this.currentTime)}set time(t){t=is(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(vo.now());const a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=Qs(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=VK,startTime:a}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=a??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(vo.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function nQ(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Bd=e=>e*180/Math.PI,JO=e=>{const t=Bd(Math.atan2(e[1],e[0]));return eR(t)},aQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:JO,rotateZ:JO,skewX:e=>Bd(Math.atan(e[1])),skewY:e=>Bd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},eR=e=>(e=e%360,e<0&&(e+=360),e),Sz=JO,Cz=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xz=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),rQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Cz,scaleY:xz,scale:e=>(Cz(e)+xz(e))/2,rotateX:e=>eR(Bd(Math.atan2(e[6],e[5]))),rotateY:e=>eR(Bd(Math.atan2(-e[2],e[0]))),rotateZ:Sz,rotate:Sz,skewX:e=>Bd(Math.atan(e[4])),skewY:e=>Bd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tR(e){return e.includes("scale")?1:0}function nR(e,t){if(!e||e==="none")return tR(t);const a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,l;if(a)r=rQ,l=a;else{const m=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=aQ,l=m}if(!l)return tR(t);const c=r[t],f=l[1].split(",").map(oQ);return typeof c=="function"?c(f):f[c]}const iQ=(e,t)=>{const{transform:a="none"}=getComputedStyle(e);return nR(a,t)};function oQ(e){return parseFloat(e.trim())}const ep=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tp=new Set(ep),Ez=e=>e===Km||e===on,lQ=new Set(["x","y","z"]),sQ=ep.filter(e=>!lQ.has(e));function uQ(e){const t=[];return sQ.forEach(a=>{const r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}const Pd={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nR(t,"x"),y:(e,{transform:t})=>nR(t,"y")};Pd.translateX=Pd.x,Pd.translateY=Pd.y;const Ud=new Set;let aR=!1,rR=!1,iR=!1;function wz(){if(rR){const e=Array.from(Ud).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{const l=uQ(r);l.length&&(a.set(r,l),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const l=a.get(r);l&&l.forEach(([c,f])=>{r.getValue(c)?.set(f)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rR=!1,aR=!1,Ud.forEach(e=>e.complete(iR)),Ud.clear()}function Tz(){Ud.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rR=!0)})}function cQ(){iR=!0,Tz(),wz(),iR=!1}class oR{constructor(t,a,r,l,c,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=l,this.element=c,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ud.add(this),aR||(aR=!0,Pa.read(Tz),Pa.resolveKeyframes(wz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:a,element:r,motionValue:l}=this;if(t[0]===null){const c=l?.get(),f=t[t.length-1];if(c!==void 0)t[0]=c;else if(r&&a){const m=r.readValue(a,f);m!=null&&(t[0]=m)}t[0]===void 0&&(t[0]=f),l&&c===void 0&&l.set(t[0])}nQ(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ud.delete(this)}cancel(){this.state==="scheduled"&&(Ud.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fQ=e=>e.startsWith("--");function dQ(e,t,a){fQ(t)?e.style.setProperty(t,a):e.style[t]=a}const hQ=_O(()=>window.ScrollTimeline!==void 0),mQ={};function pQ(e,t){const a=_O(e);return()=>mQ[t]??a()}const Oz=pQ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),R0=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,Rz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:R0([0,.65,.55,1]),circOut:R0([.55,0,1,.45]),backIn:R0([.31,.01,.66,-.59]),backOut:R0([.33,1.53,.69,.99])};function Az(e,t){if(e)return typeof e=="function"?Oz()?gz(e,t):"ease-out":ez(e)?R0(e):Array.isArray(e)?e.map(a=>Az(a,t)||Rz.easeOut):Rz[e]}function gQ(e,t,a,{delay:r=0,duration:l=300,repeat:c=0,repeatType:f="loop",ease:m="easeOut",times:g}={},p=void 0){const y={[t]:a};g&&(y.offset=g);const S=Az(m,l);Array.isArray(S)&&(y.easing=S);const E={delay:r,duration:l,easing:Array.isArray(S)?"linear":S,fill:"both",iterations:c+1,direction:f==="reverse"?"alternate":"normal"};return p&&(E.pseudoElement=p),e.animate(y,E)}function Mz(e){return typeof e=="function"&&"applyToOptions"in e}function vQ({type:e,...t}){return Mz(e)&&Oz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yQ extends KO{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:a,name:r,keyframes:l,pseudoElement:c,allowFlatten:f=!1,finalKeyframe:m,onComplete:g}=t;this.isPseudoElement=!!c,this.allowFlatten=f,this.options=t,Zu(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const p=vQ(t);this.animation=gQ(a,r,l,p,c),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const y=ZO(l,this.options,m,this.speed);this.updateMotionValue?this.updateMotionValue(y):dQ(a,r,y),this.animation.cancel()}g?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Qs(Number(t))}get time(){return Qs(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=is(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&hQ()?(this.animation.timeline=t,bl):a(this)}}const _z={anticipate:Z6,backInOut:W6,circInOut:Q6};function bQ(e){return e in _z}function SQ(e){typeof e.ease=="string"&&bQ(e.ease)&&(e.ease=_z[e.ease])}const Dz=10;class CQ extends yQ{constructor(t){SQ(t),bz(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:a,onUpdate:r,onComplete:l,element:c,...f}=this.options;if(!a)return;if(t!==void 0){a.set(t);return}const m=new QO({...f,autoplay:!1}),g=is(this.finishedTime??this.time);a.setWithVelocity(m.sample(g-Dz).value,m.sample(g).value,Dz),m.stop()}}const Nz=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(of.test(e)||e==="0")&&!e.startsWith("url("));function xQ(e){const t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function EQ(e,t,a,r){const l=e[0];if(l===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],f=Nz(l,t),m=Nz(c,t);return Zm(f===m,`You are trying to animate ${t} from "${l}" to "${c}". "${f?c:l}" is not an animatable value.`,"value-not-animatable"),!f||!m?!1:xQ(e)||(a==="spring"||Mz(a))&&r}const wQ=new Set(["opacity","clipPath","filter","transform"]),TQ=_O(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OQ(e){const{motionValue:t,name:a,repeatDelay:r,repeatType:l,damping:c,type:f}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:g,transformTemplate:p}=t.owner.getProps();return TQ()&&a&&wQ.has(a)&&(a!=="transform"||!p)&&!g&&!r&&l!=="mirror"&&c!==0&&f!=="inertia"}const RQ=40;class AQ extends KO{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:f="loop",keyframes:m,name:g,motionValue:p,element:y,...S}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=vo.now();const E={autoplay:t,delay:a,type:r,repeat:l,repeatDelay:c,repeatType:f,name:g,motionValue:p,element:y,...S},T=y?.KeyframeResolver||oR;this.keyframeResolver=new T(m,(O,M,A)=>this.onKeyframesResolved(O,M,E,!A),g,p,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,a,r,l){this.keyframeResolver=void 0;const{name:c,type:f,velocity:m,delay:g,isHandoff:p,onUpdate:y}=r;this.resolvedAt=vo.now(),EQ(t,c,f,m)||((Ku.instantAnimations||!g)&&y?.(ZO(t,r,a)),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const E={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>RQ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...r,keyframes:t},T=!p&&OQ(E)?new CQ({...E,element:E.motionValue.owner.current}):new QO(E);T.finished.then(()=>this.notifyFinished()).catch(bl),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,a){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),cQ()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const MQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _Q(e){const t=MQ.exec(e);if(!t)return[,];const[,a,r,l]=t;return[`--${a??r}`,l]}const DQ=4;function $z(e,t,a=1){Zu(a<=DQ,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,l]=_Q(e);if(!r)return;const c=window.getComputedStyle(t).getPropertyValue(r);if(c){const f=c.trim();return P6(f)?parseFloat(f):f}return VO(l)?$z(l,t,a+1):l}function lR(e,t){return e?.[t]??e?.default??e}const zz=new Set(["width","height","top","left","right","bottom",...ep]),NQ={test:e=>e==="auto",parse:e=>e},jz=e=>t=>t.test(e),Lz=[Km,on,Js,rf,CK,SK,NQ],Vz=e=>Lz.find(jz(e));function $Q(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||I6(e):!0}const zQ=new Set(["brightness","contrast","saturate","opacity"]);function jQ(e){const[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=a.match(HO)||[];if(!r)return e;const l=a.replace(r,"");let c=zQ.has(t)?1:0;return r!==a&&(c*=100),t+"("+c+l+")"}const LQ=/\b([a-z-]*)\(.*?\)/gu,sR={...of,getAnimatableNone:e=>{const t=e.match(LQ);return t?t.map(jQ).join(" "):e}},Hz={...Km,transform:Math.round},uR={borderWidth:on,borderTopWidth:on,borderRightWidth:on,borderBottomWidth:on,borderLeftWidth:on,borderRadius:on,radius:on,borderTopLeftRadius:on,borderTopRightRadius:on,borderBottomRightRadius:on,borderBottomLeftRadius:on,width:on,maxWidth:on,height:on,maxHeight:on,top:on,right:on,bottom:on,left:on,padding:on,paddingTop:on,paddingRight:on,paddingBottom:on,paddingLeft:on,margin:on,marginTop:on,marginRight:on,marginBottom:on,marginLeft:on,backgroundPositionX:on,backgroundPositionY:on,...{rotate:rf,rotateX:rf,rotateY:rf,rotateZ:rf,scale:iC,scaleX:iC,scaleY:iC,scaleZ:iC,skew:rf,skewX:rf,skewY:rf,distance:on,translateX:on,translateY:on,translateZ:on,x:on,y:on,z:on,perspective:on,transformPerspective:on,opacity:E0,originX:oz,originY:oz,originZ:on},zIndex:Hz,fillOpacity:E0,strokeOpacity:E0,numOctaves:Hz},VQ={...uR,color:Cr,backgroundColor:Cr,outlineColor:Cr,fill:Cr,stroke:Cr,borderColor:Cr,borderTopColor:Cr,borderRightColor:Cr,borderBottomColor:Cr,borderLeftColor:Cr,filter:sR,WebkitFilter:sR},Bz=e=>VQ[e];function Pz(e,t){let a=Bz(e);return a!==sR&&(a=of),a.getAnimatableNone?a.getAnimatableNone(t):void 0}const HQ=new Set(["auto","none","0"]);function BQ(e,t,a){let r=0,l;for(;r<e.length&&!l;){const c=e[r];typeof c=="string"&&!HQ.has(c)&&O0(c).values.length&&(l=e[r]),r++}if(l&&a)for(const c of t)e[c]=Pz(a,l)}class PQ extends oR{constructor(t,a,r,l,c){super(t,a,r,l,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let p=t[g];if(typeof p=="string"&&(p=p.trim(),VO(p))){const y=$z(p,a.current);y!==void 0&&(t[g]=y),g===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!zz.has(r)||t.length!==2)return;const[l,c]=t,f=Vz(l),m=Vz(c);if(f!==m)if(Ez(f)&&Ez(m))for(let g=0;g<t.length;g++){const p=t[g];typeof p=="string"&&(t[g]=parseFloat(p))}else Pd[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:a}=this,r=[];for(let l=0;l<t.length;l++)(t[l]===null||$Q(t[l]))&&r.push(l);r.length&&BQ(t,r,a)}measureInitialState(){const{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pd[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&t.getValue(r,l).jump(l,!1)}measureEndState(){const{element:t,name:a,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const l=t.getValue(a);l&&l.jump(this.measuredOrigin,!1);const c=r.length-1,f=r[c];r[c]=Pd[a](t.measureViewportBox(),window.getComputedStyle(t.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([m,g])=>{t.getValue(m).set(g)}),this.resolveNoneKeyframes()}}function UQ(e,t,a){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const l=a?.[e]??r.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e)}const Uz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Iz(e){return U6(e)&&"offsetHeight"in e}var IQ={};const Fz=30,FQ=e=>!isNaN(parseFloat(e));class kQ{constructor(t,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,l=!0)=>{const c=vo.now();if(this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty();l&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=vo.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FQ(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return IQ.NODE_ENV!=="production"&&NO(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new DO);const r=this.events[t].add(a);return t==="change"?()=>{r(),Pa.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fz)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,Fz);return F6(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function np(e,t){return new kQ(e,t)}const{schedule:cR}=az(queueMicrotask,!1),os={x:!1,y:!1};function kz(){return os.x||os.y}function GQ(e){return e==="x"||e==="y"?os[e]?null:(os[e]=!0,()=>{os[e]=!1}):os.x||os.y?null:(os.x=os.y=!0,()=>{os.x=os.y=!1})}function Gz(e,t){const a=UQ(e),r=new AbortController,l={passive:!0,...t,signal:r.signal};return[a,l,()=>r.abort()]}function qz(e){return!(e.pointerType==="touch"||kz())}function qQ(e,t,a={}){const[r,l,c]=Gz(e,a),f=m=>{if(!qz(m))return;const{target:g}=m,p=t(g,m);if(typeof p!="function"||!g)return;const y=S=>{qz(S)&&(p(S),g.removeEventListener("pointerleave",y))};g.addEventListener("pointerleave",y,l)};return r.forEach(m=>{m.addEventListener("pointerenter",f,l)}),c}const Yz=(e,t)=>t?e===t?!0:Yz(e,t.parentElement):!1,fR=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,YQ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function XQ(e){return YQ.has(e.tagName)||e.tabIndex!==-1}const uC=new WeakSet;function Xz(e){return t=>{t.key==="Enter"&&e(t)}}function dR(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WQ=(e,t)=>{const a=e.currentTarget;if(!a)return;const r=Xz(()=>{if(uC.has(a))return;dR(a,"down");const l=Xz(()=>{dR(a,"up")}),c=()=>dR(a,"cancel");a.addEventListener("keyup",l,t),a.addEventListener("blur",c,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function Wz(e){return fR(e)&&!kz()}function ZQ(e,t,a={}){const[r,l,c]=Gz(e,a),f=m=>{const g=m.currentTarget;if(!Wz(m))return;uC.add(g);const p=t(g,m),y=(T,O)=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",E),uC.has(g)&&uC.delete(g),Wz(T)&&typeof p=="function"&&p(T,{success:O})},S=T=>{y(T,g===window||g===document||a.useGlobalTarget||Yz(g,T.target))},E=T=>{y(T,!1)};window.addEventListener("pointerup",S,l),window.addEventListener("pointercancel",E,l)};return r.forEach(m=>{(a.useGlobalTarget?window:m).addEventListener("pointerdown",f,l),Iz(m)&&(m.addEventListener("focus",p=>WQ(p,l)),!XQ(m)&&!m.hasAttribute("tabindex")&&(m.tabIndex=0))}),c}function Zz(e){return U6(e)&&"ownerSVGElement"in e}function KQ(e){return Zz(e)&&e.tagName==="svg"}const wi=e=>!!(e&&e.getVelocity),QQ=[...Lz,Cr,of],JQ=e=>QQ.find(jz(e)),hR=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class eJ extends C.Component{getSnapshotBeforeUpdate(t){const a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){const r=a.offsetParent,l=Iz(r)&&r.offsetWidth||0,c=this.props.sizeRef.current;c.height=a.offsetHeight||0,c.width=a.offsetWidth||0,c.top=a.offsetTop,c.left=a.offsetLeft,c.right=l-c.width-c.left}return null}componentDidUpdate(){}render(){return this.props.children}}function tJ({children:e,isPresent:t,anchorX:a,root:r}){const l=C.useId(),c=C.useRef(null),f=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:m}=C.useContext(hR);return C.useInsertionEffect(()=>{const{width:g,height:p,top:y,left:S,right:E}=f.current;if(t||!c.current||!g||!p)return;const T=a==="left"?`left: ${S}`:`right: ${E}`;c.current.dataset.motionPopId=l;const O=document.createElement("style");m&&(O.nonce=m);const M=r??document.head;return M.appendChild(O),O.sheet&&O.sheet.insertRule(`
645
645
  [data-motion-pop-id="${l}"] {
646
646
  position: absolute !important;
647
647
  width: ${g}px !important;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shopify-chatbot-widget",
3
3
  "private": false,
4
- "version": "0.2.6",
4
+ "version": "0.2.8",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",