diff --git a/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.css b/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.css index 18a15002..fb8ffac4 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.css +++ b/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.css @@ -1 +1 @@ -.tooltip-arrow{fill:var(--tooltip-background-color)}[data-slot=tooltip-content]{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1))}@keyframes aui-pulse{50%{opacity:.5}}:where(.aui-md[data-status=running]):empty:after,:where(.aui-md[data-status=running])>:where(:not(ol):not(ul):not(pre)):last-child:after,:where(.aui-md[data-status=running])>pre:last-child code:after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child):after{animation:aui-pulse 2s cubic-bezier(.4,0,.6,1) infinite;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--aui-content: "●";content:var(--aui-content);margin-left:.25rem;margin-right:.25rem}.aui-shiki-base{background-color:var(--chat-message-code-block-background-color)!important;padding:0 12px 12px!important;border-radius:0 0 12px 12px!important}.aui-shiki-base>pre{background-color:var( --chat-message-code-block-pre-background-color )!important;border:1px solid var(--chat-message-code-block-border-color)!important;border-radius:4px!important;padding:6px!important}.theme-light .line span{color:var(--shiki-light)!important}.theme-dark .line span{color:var(--shiki-dark)!important}.composer-root{border-color:var(--chat-composer-border-color);background:var(--chat-composer-background-color)}.composer-root:hover{border-color:var(--chat-composer-hover-border-color)}.composer-root:focus-within{border-color:var(--chat-composer-active-border-color)}.composer-input{font-size:14px;line-height:15px;color:var(--chat-composer-text-color)}.composer-input::placeholder{color:var(--chat-composer-placeholder-color)}.aui-md[data-status=running]:after,.aui-md[data-status=running]>*:last-child:after{display:none!important}.ͼ2 .cm-gutters,.ͼ2 .cm-activeLineGutter{background-color:var(--background-normal)!important;color:var(--text-secondary)!important;border:0px solid var(--border-divider)!important}.ͼe,.ͼ2 .cm-line{color:var(--text-normal)!important}.ͼ2 .cm-activeLine{background-color:transparent!important}@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-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--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-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@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;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-lg:.5rem;--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);--animate-spin:spin 1s linear infinite;--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}::-webkit-calendar-picker-indicator{line-height:1}:-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{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2,.top-\[50\%\]{top:50%}.right-\[10px\]{right:10px}.left-1\/2{left:50%}.left-\[10px\]{left:10px}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.z-\[9999\]{z-index:9999}.col-span-2{grid-column:span 2/span 2}.col-span-full{grid-column:1/-1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.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}}.m-0{margin:calc(var(--spacing)*0)}.mx-\[-32px\]{margin-inline:-32px}.mx-\[32px\]{margin-inline:32px}.mx-auto{margin-inline:auto}.my-4{margin-block:calc(var(--spacing)*4)}.my-5{margin-block:calc(var(--spacing)*5)}.my-\[4px\]{margin-block:4px}.my-\[8px\]{margin-block:8px}.my-\[16px\]{margin-block:16px}.ms-\[8px\]{margin-inline-start:8px}.ms-\[13px\]{margin-inline-start:13px}.ms-\[28px\]{margin-inline-start:28px}.ms-\[32px\]{margin-inline-start:32px}.ms-auto{margin-inline-start:auto}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-\[-15px\]{margin-top:-15px}.mt-\[4px\]{margin-top:4px}.mt-\[8px\]{margin-top:8px}.mt-\[16px\]{margin-top:16px}.mt-\[24px\]{margin-top:24px}.mt-\[32px\]{margin-top:32px}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\[8px\]{margin-bottom:8px}.mb-\[16px\]{margin-bottom:16px}.mb-\[32px\]{margin-bottom:32px}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-4{height:calc(var(--spacing)*4)}.h-\[10px\]{height:10px}.h-\[12px\]{height:12px}.h-\[14px\]{height:14px}.h-\[20px\]{height:20px}.h-\[24px\]{height:24px}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[40px\]{height:40px}.h-\[44px\]{height:44px}.h-\[48px\]{height:48px}.h-\[56px\]{height:56px}.h-\[64px\]{height:64px}.h-\[72px\]{height:72px}.h-\[100vh\]{height:100vh}.h-\[384px\]{height:384px}.h-\[400px\]{height:400px}.h-\[520px\]{height:520px}.h-\[560px\]{height:560px}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:calc(var(--spacing)*56)}.max-h-\[200px\]{max-height:200px}.max-h-\[calc\(50vh\)\]{max-height:50vh}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-6{min-height:calc(var(--spacing)*6)}.min-h-\[1px\]{min-height:1px}.min-h-\[16px\]{min-height:16px}.min-h-\[32px\]{min-height:32px}.min-h-\[36px\]{min-height:36px}.min-h-\[44px\]{min-height:44px}.min-h-\[56px\]{min-height:56px}.min-h-\[256px\]{min-height:256px}.min-h-\[280px\]{min-height:280px}.min-h-\[400px\]{min-height:400px}.w-4{width:calc(var(--spacing)*4)}.w-\[10px\]{width:10px}.w-\[12px\]{width:12px}.w-\[20px\]{width:20px}.w-\[24px\]{width:24px}.w-\[36px\]{width:36px}.w-\[72px\]{width:72px}.w-\[260px\]{width:260px}.w-\[264px\]{width:264px}.w-\[348px\]{width:348px}.w-\[352px\]{width:352px}.w-\[548px\]{width:548px}.w-\[564px\]{width:564px}.w-\[640px\]{width:640px}.w-\[720px\]{width:720px}.w-\[var\(--radix-dropdown-menu-trigger-width\)\]{width:var(--radix-dropdown-menu-trigger-width)}.w-\[var\(--thread-max-width\)\]{width:var(--thread-max-width)}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\[272px\]{max-width:272px}.max-w-\[300px\]{max-width:300px}.max-w-\[312px\]{max-width:312px}.max-w-\[490px\]{max-width:490px}.max-w-\[573px\]{max-width:573px}.max-w-\[640px\]{max-width:640px}.max-w-\[fit-content\]{max-width:fit-content}.max-w-\[var\(--thread-max-width\)\]{max-width:var(--thread-max-width)}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-6{min-width:calc(var(--spacing)*6)}.min-w-\[40px\]{min-width:40px}.min-w-\[150px\]{min-width:150px}.min-w-\[264px\]{min-width:264px}.min-w-\[274px\]{min-width:274px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:calc(var(--spacing)*0);--tw-border-spacing-y:calc(var(--spacing)*0);border-spacing:var(--tw-border-spacing-x)var(--tw-border-spacing-y)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[1px\]{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.resize{resize:both}.resize\!{resize:both!important}.resize-none{resize:none}.scroll-m-20{scroll-margin:calc(var(--spacing)*20)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.auto-rows-auto{grid-auto-rows:auto}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.grid-cols-\[minmax\(72px\,1fr\)_auto\]{grid-template-columns:minmax(72px,1fr) auto}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[4px\]{gap:4px}.gap-\[8px\]{gap:8px}.gap-\[10px\]{gap:10px}.gap-\[12px\]{gap:12px}.gap-\[16px\]{gap:16px}.gap-\[20px\]{gap:20px}.gap-\[24px\]{gap:24px}.gap-\[32px\]{gap:32px}.gap-\[40px\]{gap:40px}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:calc(var(--spacing)*1)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[8px\]{border-radius:8px}.rounded-\[12px\]{border-radius:12px}.rounded-\[16px\]{border-radius:16px}.rounded-full{border-radius:3.40282e38px}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-l-\[8px\]{border-top-left-radius:8px;border-bottom-left-radius:8px}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-r-\[8px\]{border-top-right-radius:8px;border-bottom-right-radius:8px}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-\[12px\]{border-bottom-right-radius:12px;border-bottom-left-radius:12px}.rounded-br{border-bottom-right-radius:.25rem}.rounded-br-\[0px\]{border-bottom-right-radius:0}.rounded-bl{border-bottom-left-radius:.25rem}.rounded-bl-\[0px\]{border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1px\]{border-style:var(--tw-border-style);border-width:1px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e,.border-e-\[1px\]{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t,.border-t-\[1px\]{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b,.border-b-\[1px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[1px\]{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\[var\(--border-divider\)\]{border-color:var(--border-divider)}.border-\[var\(--button-default-border-color\)\]{border-color:var(--button-default-border-color)}.border-\[var\(--chat-list-border-right\)\]{border-color:var(--chat-list-border-right)}.border-\[var\(--chat-message-code-block-border-color\)\]{border-color:var(--chat-message-code-block-border-color)}.border-\[var\(--chat-message-divider-color\)\]{border-color:var(--chat-message-divider-color)}.border-\[var\(--chat-message-error-border-color\)\]{border-color:var(--chat-message-error-border-color)}.border-\[var\(--chat-message-tool-call-pre-border-color\)\]{border-color:var(--chat-message-tool-call-pre-border-color)}.border-\[var\(--checkbox-color\)\]{border-color:var(--checkbox-color)}.border-\[var\(--drop-down-menu-border-color\)\]{border-color:var(--drop-down-menu-border-color)}.border-\[var\(--file-items-border-color\)\]{border-color:var(--file-items-border-color)}.border-\[var\(--header-border-color\)\]{border-color:var(--header-border-color)}.border-\[var\(--input-active-border-color\)\]{border-color:var(--input-active-border-color)}.border-\[var\(--input-border-color\)\]{border-color:var(--input-border-color)}.border-\[var\(--loader-border-color\)\]{border-color:var(--loader-border-color)}.border-\[var\(--radio-button-active-color\)\]{border-color:var(--radio-button-active-color)}.border-\[var\(--radio-button-color\)\]{border-color:var(--radio-button-color)}.border-\[var\(--servers-available-tools-border-color\)\]{border-color:var(--servers-available-tools-border-color)}.border-\[var\(--servers-edit-config-buttons-border-color\)\]{border-color:var(--servers-edit-config-buttons-border-color)}.border-\[var\(--servers-edit-config-json-editor-border-color\)\]{border-color:var(--servers-edit-config-json-editor-border-color)}.border-\[var\(--servers-logs-dialog-border-color\)\]{border-color:var(--servers-logs-dialog-border-color)}.border-\[var\(--tabs-border-color\)\]{border-color:var(--tabs-border-color)}.border-\[var\(--text-contrast-background\)\]{border-color:var(--text-contrast-background)}.border-\[var\(--tooltip-border-color\)\]{border-color:var(--tooltip-border-color)}.border-transparent{border-color:#0000}.border-r-transparent{border-right-color:#0000}.border-l-\[var\(--border-divider\)\]{border-left-color:var(--border-divider)}.bg-\[var\(--ai-provider-item-background-color\)\]{background-color:var(--ai-provider-item-background-color)}.bg-\[var\(--background-normal-element\)\]{background-color:var(--background-normal-element)}.bg-\[var\(--button-background-color\)\]{background-color:var(--button-background-color)}.bg-\[var\(--button-default-background-color\)\]{background-color:var(--button-default-background-color)}.bg-\[var\(--chat-composer-action-send-background-color\)\]{background-color:var(--chat-composer-action-send-background-color)}.bg-\[var\(--chat-list-item-active-background-color\)\]{background-color:var(--chat-list-item-active-background-color)}.bg-\[var\(--chat-message-code-block-background-color\)\]{background-color:var(--chat-message-code-block-background-color)}.bg-\[var\(--chat-message-code-block-pre-background-color\)\]{background-color:var(--chat-message-code-block-pre-background-color)}.bg-\[var\(--chat-message-tool-call-body-background-color\)\]{background-color:var(--chat-message-tool-call-body-background-color)}.bg-\[var\(--chat-message-tool-call-name-background-color\)\]{background-color:var(--chat-message-tool-call-name-background-color)}.bg-\[var\(--chat-message-tool-call-pre-background-color\)\]{background-color:var(--chat-message-tool-call-pre-background-color)}.bg-\[var\(--chat-user-message-background\)\]{background-color:var(--chat-user-message-background)}.bg-\[var\(--checkbox-active-color\)\]{background-color:var(--checkbox-active-color)}.bg-\[var\(--checkbox-bg-color\)\]{background-color:var(--checkbox-bg-color)}.bg-\[var\(--drop-down-menu-background-color\)\]{background-color:var(--drop-down-menu-background-color)}.bg-\[var\(--drop-down-menu-item-active-color\)\]{background-color:var(--drop-down-menu-item-active-color)}.bg-\[var\(--drop-down-menu-separator-color\)\]{background-color:var(--drop-down-menu-separator-color)}.bg-\[var\(--file-items-background-color\)\]{background-color:var(--file-items-background-color)}.bg-\[var\(--file-items-chat-background-color\)\]{background-color:var(--file-items-chat-background-color)}.bg-\[var\(--header-background-color\)\]{background-color:var(--header-background-color)}.bg-\[var\(--input-background-color\)\]{background-color:var(--input-background-color)}.bg-\[var\(--layout-background-color\)\]{background-color:var(--layout-background-color)}.bg-\[var\(--modal-dialog-background-color\)\]{background-color:var(--modal-dialog-background-color)}.bg-\[var\(--modal-dialog-overlay-background\)\]{background-color:var(--modal-dialog-overlay-background)}.bg-\[var\(--radio-button-active-color\)\]{background-color:var(--radio-button-active-color)}.bg-\[var\(--servers-available-tools-item-active-background-color\)\]{background-color:var(--servers-available-tools-item-active-background-color)}.bg-\[var\(--servers-available-tools-item-background-color\)\]{background-color:var(--servers-available-tools-item-background-color)}.bg-\[var\(--servers-edit-config-json-background-color\)\]{background-color:var(--servers-edit-config-json-background-color)}.bg-\[var\(--servers-edit-config-json-editor-background-color\)\]{background-color:var(--servers-edit-config-json-editor-background-color)}.bg-\[var\(--toggle-button-circle-color\)\]{background-color:var(--toggle-button-circle-color)}.bg-\[var\(--toggle-button-off-background-color\)\]{background-color:var(--toggle-button-off-background-color)}.bg-\[var\(--tooltip-background-color\)\]{background-color:var(--tooltip-background-color)}.bg-none{background-image:none}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-\[4px\]{padding:4px}.p-\[6px\]{padding:6px}.p-\[12px\]{padding:12px}.p-\[16px\]{padding:16px}.px-4{padding-inline:calc(var(--spacing)*4)}.px-\[8px\]{padding-inline:8px}.px-\[12px\]{padding-inline:12px}.px-\[16px\]{padding-inline:16px}.px-\[24px\]{padding-inline:24px}.px-\[32px\]{padding-inline:32px}.px-\[var\(--thread-padding-x\)\]{padding-inline:var(--thread-padding-x)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.py-\[2px\]{padding-block:2px}.py-\[8px\]{padding-block:8px}.py-\[12px\]{padding-block:12px}.py-\[16px\]{padding-block:16px}.ps-\[4px\]{padding-inline-start:4px}.ps-\[12px\]{padding-inline-start:12px}.ps-\[16px\]{padding-inline-start:16px}.ps-\[32px\]{padding-inline-start:32px}.ps-\[40px\]{padding-inline-start:40px}.ps-\[var\(--thread-padding-x\)\]{padding-inline-start:var(--thread-padding-x)}.pe-\[2px\]{padding-inline-end:2px}.pe-\[8px\]{padding-inline-end:8px}.pe-\[12px\]{padding-inline-end:12px}.pe-\[16px\]{padding-inline-end:16px}.pe-\[40px\]{padding-inline-end:40px}.pt-\[8px\]{padding-top:8px}.pt-\[12px\]{padding-top:12px}.pt-\[24px\]{padding-top:24px}.pr-\[4px\]{padding-right:4px}.pr-\[8px\]{padding-right:8px}.pr-\[24px\]{padding-right:24px}.pr-\[40px\]{padding-right:40px}.pb-\[3px\]{padding-bottom:3px}.pb-\[8px\]{padding-bottom:8px}.pb-\[12px\]{padding-bottom:12px}.pb-\[16px\]{padding-bottom:16px}.pb-\[24px\]{padding-bottom:24px}.pb-\[32px\]{padding-bottom:32px}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-\[4px\]{padding-left:4px}.pl-\[8px\]{padding-left:8px}.pl-\[24px\]{padding-left:24px}.pl-\[40px\]{padding-left:40px}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.align-\[-0\.125em\]{vertical-align:-.125em}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[24px\]{font-size:24px}.text-\[28px\]{font-size:28px}.text-\[32px\]{font-size:32px}.leading-7{--tw-leading:calc(var(--spacing)*7);line-height:calc(var(--spacing)*7)}.leading-\[14px\]{--tw-leading:14px;line-height:14px}.leading-\[16px\]{--tw-leading:16px;line-height:16px}.leading-\[18px\]{--tw-leading:18px;line-height:18px}.leading-\[20px\]{--tw-leading:20px;line-height:20px}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-\[24px\]{--tw-leading:24px;line-height:24px}.leading-\[28px\]{--tw-leading:28px;line-height:28px}.leading-\[32px\]{--tw-leading:32px;line-height:32px}.leading-\[36px\]{--tw-leading:36px;line-height:36px}.font-\[14px\]{--tw-font-weight:14px;font-weight:14px}.font-\[400\]{--tw-font-weight:400;font-weight:400}.font-\[700\]{--tw-font-weight:700;font-weight:700}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--ai-provider-item-color\)\]{color:var(--ai-provider-item-color)}.text-\[var\(--ai-provider-item-description-color\)\]{color:var(--ai-provider-item-description-color)}.text-\[var\(--button-color\)\]{color:var(--button-color)}.text-\[var\(--button-default-color\)\]{color:var(--button-default-color)}.text-\[var\(--chat-link-color\)\]{color:var(--chat-link-color)}.text-\[var\(--chat-list-color\)\]{color:var(--chat-list-color)}.text-\[var\(--chat-list-empty-color\)\]{color:var(--chat-list-empty-color)}.text-\[var\(--chat-list-item-color\)\]{color:var(--chat-list-item-color)}.text-\[var\(--chat-message-analyze-color\)\]{color:var(--chat-message-analyze-color)}.text-\[var\(--chat-message-code-block-header-color\)\]{color:var(--chat-message-code-block-header-color)}.text-\[var\(--chat-message-color\)\]{color:var(--chat-message-color)}.text-\[var\(--chat-message-error-color\)\]{color:var(--chat-message-error-color)}.text-\[var\(--chat-message-td-color\)\]{color:var(--chat-message-td-color)}.text-\[var\(--chat-message-th-color\)\]{color:var(--chat-message-th-color)}.text-\[var\(--chat-message-tool-call-header-color\)\]{color:var(--chat-message-tool-call-header-color)}.text-\[var\(--chat-message-tool-call-name-color\)\]{color:var(--chat-message-tool-call-name-color)}.text-\[var\(--chat-message-tool-call-pre-color\)\]{color:var(--chat-message-tool-call-pre-color)}.text-\[var\(--chat-user-message-color\)\]{color:var(--chat-user-message-color)}.text-\[var\(--drop-down-menu-item-active-color\)\]{color:var(--drop-down-menu-item-active-color)}.text-\[var\(--drop-down-menu-item-color\)\]{color:var(--drop-down-menu-item-color)}.text-\[var\(--empty-screen-color\)\]{color:var(--empty-screen-color)}.text-\[var\(--empty-screen-description-color\)\]{color:var(--empty-screen-description-color)}.text-\[var\(--field-container-error-color\)\]{color:var(--field-container-error-color)}.text-\[var\(--field-container-header-color\)\]{color:var(--field-container-header-color)}.text-\[var\(--file-items-color\)\]{color:var(--file-items-color)}.text-\[var\(--file-items-ext-color\)\]{color:var(--file-items-ext-color)}.text-\[var\(--header-color\)\]{color:var(--header-color)}.text-\[var\(--input-color\)\]{color:var(--input-color)}.text-\[var\(--input-placeholder-color\)\]{color:var(--input-placeholder-color)}.text-\[var\(--modal-dialog-header-color\)\]{color:var(--modal-dialog-header-color)}.text-\[var\(--servers-available-tools-current-tool-color\)\]{color:var(--servers-available-tools-current-tool-color)}.text-\[var\(--servers-available-tools-header-color\)\]{color:var(--servers-available-tools-header-color)}.text-\[var\(--servers-available-tools-item-name-color\)\]{color:var(--servers-available-tools-item-name-color)}.text-\[var\(--servers-available-tools-sub-header-color\)\]{color:var(--servers-available-tools-sub-header-color)}.text-\[var\(--servers-description-color\)\]{color:var(--servers-description-color)}.text-\[var\(--servers-edit-config-json-header-color\)\]{color:var(--servers-edit-config-json-header-color)}.text-\[var\(--servers-edit-config-json-lang-color\)\]{color:var(--servers-edit-config-json-lang-color)}.text-\[var\(--servers-logs-dialog-log-color\)\]{color:var(--servers-logs-dialog-log-color)}.text-\[var\(--settings-description-color\)\]{color:var(--settings-description-color)}.text-\[var\(--settings-header-color\)\]{color:var(--settings-header-color)}.text-\[var\(--tabs-color\)\]{color:var(--tabs-color)}.text-\[var\(--text-negative\)\]{color:var(--text-negative)}.text-\[var\(--text-normal\)\]{color:var(--text-normal)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-\[var\(--text-tertiary\)\]{color:var(--text-tertiary)}.text-\[var\(--tool-fallback-color\)\]{color:var(--tool-fallback-color)}.text-\[var\(--tooltip-text-color\)\]{color:var(--tooltip-text-color)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.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,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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-\[var\(--ai-provider-item-shadow\)\]{--tw-shadow:var(--ai-provider-item-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[var\(--drop-down-menu-shadow\)\]{--tw-shadow:var(--drop-down-menu-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[var\(--modal-dialog-shadows\)\]{--tw-shadow:var(--modal-dialog-shadows);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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,)}.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,)}.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,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.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)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.paused{animation-play-state:paused}.ring-inset{--tw-ring-inset:inset}.running{animation-play-state:running}.zoom-in{--tw-enter-scale:0}.zoom-out{--tw-exit-scale:0}@media(hover:hover){.group-hover\:\!bg-\[var\(--checkbox-active-hover-color\)\]:is(:where(.group):hover *){background-color:var(--checkbox-active-hover-color)!important}.group-hover\:\!bg-\[var\(--checkbox-bg-hover-color\)\]:is(:where(.group):hover *){background-color:var(--checkbox-bg-hover-color)!important}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-active\:\!bg-\[var\(--checkbox-active-pressed-color\)\]:is(:where(.group):active *){background-color:var(--checkbox-active-pressed-color)!important}.group-active\:\!bg-\[var\(--checkbox-bg-pressed-color\)\]:is(:where(.group):active *){background-color:var(--checkbox-bg-pressed-color)!important}.placeholder\:text-\[var\(--input-placeholder-color\)\]::placeholder{color:var(--input-placeholder-color)}.first\:mt-0:first-child{margin-top:calc(var(--spacing)*0)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.focus-within\:outline-none:focus-within{--tw-outline-style:none;outline-style:none}@media(hover:hover){.hover\:border-\[var\(--input-hover-border-color\)\]:hover{border-color:var(--input-hover-border-color)}.hover\:bg-\[var\(--chat-list-item-hover-background-color\)\]:hover{background-color:var(--chat-list-item-hover-background-color)}.hover\:bg-\[var\(--drop-down-menu-item-hover-color\)\]:hover{background-color:var(--drop-down-menu-item-hover-color)}.hover\:bg-\[var\(--file-items-chat-hover-background-color\)\]:hover{background-color:var(--file-items-chat-hover-background-color)}.hover\:bg-\[var\(--input-hover-background-color\)\]:hover{background-color:var(--input-hover-background-color)}.hover\:bg-\[var\(--servers-available-tools-item-hover-background-color\)\]:hover{background-color:var(--servers-available-tools-item-hover-background-color)}.hover\:text-\[var\(--drop-down-menu-item-hover-color\)\]:hover{color:var(--drop-down-menu-item-hover-color)}}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--button-border-focus-color\)\]:focus{border-color:var(--button-border-focus-color)}.focus\:border-\[var\(--input-active-border-color\)\]:focus{border-color:var(--input-active-border-color)}.focus\:bg-\[var\(--button-background-color\)\]:focus{background-color:var(--button-background-color)}.focus\:bg-\[var\(--input-active-background-color\)\]:focus{background-color:var(--input-active-background-color)}.focus\:shadow-\[var\(--button-default-focus-shadow\)\]:focus{--tw-shadow:var(--button-default-focus-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:shadow-\[var\(--button-shadow-focus\)\]:focus{--tw-shadow:var(--button-shadow-focus);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-\[var\(--chat-list-item-active-background-color\)\]:active{background-color:var(--chat-list-item-active-background-color)}.active\:bg-\[var\(--file-items-chat-pressed-background-color\)\]:active{background-color:var(--file-items-chat-pressed-background-color)}@media(hover:hover){.hover\:enabled\:bg-\[var\(--button-background-hover-color\)\]:hover:enabled{background-color:var(--button-background-hover-color)}.hover\:enabled\:bg-\[var\(--button-default-hover-background-color\)\]:hover:enabled{background-color:var(--button-default-hover-background-color)}.hover\:enabled\:bg-\[var\(--chat-composer-action-send-background-hover-color\)\]:hover:enabled{background-color:var(--chat-composer-action-send-background-hover-color)}.hover\:enabled\:bg-\[var\(--icon-button-hover-background-color\)\]:hover:enabled{background-color:var(--icon-button-hover-background-color)}.hover\:enabled\:bg-\[var\(--icon-button-hover-on-active-background-color\)\]:hover:enabled{background-color:var(--icon-button-hover-on-active-background-color)}}.active\:enabled\:bg-\[var\(--button-background-pressed-color\)\]:active:enabled{background-color:var(--button-background-pressed-color)}.active\:enabled\:bg-\[var\(--button-default-pressed-background-color\)\]:active:enabled{background-color:var(--button-default-pressed-background-color)}.active\:enabled\:bg-\[var\(--chat-composer-action-send-background-pressed-color\)\]:active:enabled{background-color:var(--chat-composer-action-send-background-pressed-color)}.active\:enabled\:bg-\[var\(--icon-button-pressed-background-color\)\]:active:enabled{background-color:var(--icon-button-pressed-background-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-\[var\(--button-default-disabled-background-color\)\]:disabled{background-color:var(--button-default-disabled-background-color)}.disabled\:text-\[var\(--button-default-disabled-color\)\]:disabled{color:var(--button-default-disabled-color)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled,.disabled\:opacity-\[0\.5\]:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[highlighted\]\:bg-\[var\(--drop-down-menu-item-active-color\)\][data-highlighted]{background-color:var(--drop-down-menu-item-active-color)}.data-\[highlighted\]\:text-\[var\(--drop-down-menu-item-active-color\)\][data-highlighted]{color:var(--drop-down-menu-item-active-color)}.data-\[state\=active\]\:font-bold[data-state=active]{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.data-\[state\=active\]\:after\:absolute[data-state=active]:after{content:var(--tw-content);position:absolute}.data-\[state\=active\]\:after\:right-0[data-state=active]:after{content:var(--tw-content);right:calc(var(--spacing)*0)}.data-\[state\=active\]\:after\:bottom-\[-5px\][data-state=active]:after{content:var(--tw-content);bottom:-5px}.data-\[state\=active\]\:after\:left-0[data-state=active]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[state\=active\]\:after\:h-\[4px\][data-state=active]:after{content:var(--tw-content);height:4px}.data-\[state\=active\]\:after\:rounded-t-\[3px\][data-state=active]:after{content:var(--tw-content);border-top-left-radius:3px;border-top-right-radius:3px}.data-\[state\=active\]\:after\:bg-\[var\(--tabs-active-border-color\)\][data-state=active]:after{content:var(--tw-content);background-color:var(--tabs-active-border-color)}.data-\[state\=active\]\:after\:content-\[\'\'\][data-state=active]:after{--tw-content:"";content:var(--tw-content)}.data-\[state\=checked\]\:translate-x-\[10px\][data-state=checked]{--tw-translate-x:10px;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[var\(--toggle-button-background-color\)\][data-state=checked]{background-color:var(--toggle-button-background-color)}@media(hover:hover){.data-\[state\=checked\]\:hover\:enabled\:bg-\[var\(--toggle-button-background-hover-color\)\][data-state=checked]:hover:enabled{background-color:var(--toggle-button-background-hover-color)}}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}@media(hover:hover){.hover\:enabled\:data-\[state\=inactive\]\:after\:absolute:hover:enabled[data-state=inactive]:after{content:var(--tw-content);position:absolute}.hover\:enabled\:data-\[state\=inactive\]\:after\:bottom-\[-5px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);bottom:-5px}.hover\:enabled\:data-\[state\=inactive\]\:after\:left-1\/2:hover:enabled[data-state=inactive]:after{content:var(--tw-content);left:50%}.hover\:enabled\:data-\[state\=inactive\]\:after\:h-\[4px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);height:4px}.hover\:enabled\:data-\[state\=inactive\]\:after\:w-\[24px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);width:24px}.hover\:enabled\:data-\[state\=inactive\]\:after\:-translate-x-1\/2:hover:enabled[data-state=inactive]:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:enabled\:data-\[state\=inactive\]\:after\:transform:hover:enabled[data-state=inactive]:after{content:var(--tw-content);transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.hover\:enabled\:data-\[state\=inactive\]\:after\:rounded-t-\[3px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);border-top-left-radius:3px;border-top-right-radius:3px}.hover\:enabled\:data-\[state\=inactive\]\:after\:bg-\[var\(--tabs-hover-border-color\)\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);background-color:var(--tabs-hover-border-color)}.hover\:enabled\:data-\[state\=inactive\]\:after\:content-\[\'\'\]:hover:enabled[data-state=inactive]:after{--tw-content:"";content:var(--tw-content)}}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-\[spin_1\.5s_linear_infinite\]{animation:1.5s linear infinite spin}}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-b-lg pre{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.\[\&_pre\]\:p-4 pre{padding:calc(var(--spacing)*4)}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:-webkit-search-decoration\]\:hidden::-webkit-search-decoration{display:none}.\[\&\>a\]\:text-xs>a{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&\>a\]\:no-underline>a{text-decoration-line:none}.\[\&\>li\]\:mt-\[4px\]>li{margin-top:4px}.\[\&\[align\=center\]\]\:text-center[align=center]{text-align:center}.\[\&\[align\=right\]\]\:text-right[align=right]{text-align:right}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.theme-light{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#888;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-dark{--background-normal:#333;--background-normal-element:#505050;--background-normal-element-light:#404040;--background-accent-button:#486f9e;--background-primary-button:#ddd;--background-scrim:#0009;--background-scroll-thumb:#404040;--border-divider:#505050;--border-regular-control:#666;--border-control-focus:#7d7d7d;--border-error:#f62211;--border-sidebar-icon:#666;--highlight-button-hover:#555;--highlight-button-pressed:#707070;--highlight-button-hover-on-active:#999;--highlight-button-pressed-on-active:#707070;--highlight-accent-button-hover:#75a2d6;--highlight-accent-button-pressed:#89afdc;--highlight-primary-button-hover:#fcfcfc;--highlight-primary-button-pressed:#fcfcfc;--highlight-scroll-thumb-hover:#999;--highlight-scroll-track-hover:#999;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#333;--checkbox-background-checked:#ddd;--checkbox-border-normal:#707070;--icon-normal:#fff;--icon-success:#090;--text-normal:#fffc;--text-normal-pressed:#fffc;--text-secondary:#fff9;--text-tertiary:#fff6;--text-link:#b5e4ff;--text-inverse:#333;--text-contrast-background:#fff;--text-negative:#fffc;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-white{--background-normal:#fff;--background-normal-element:#f3f3f3;--background-normal-element-light:#f9f9f9;--background-accent-button:#3483db;--background-primary-button:#3483db;--background-scrim:#0003;--background-scroll-thumb:#e0e0e0;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#848484;--border-error:#f62211;--border-sidebar-icon:#dfdfdf;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#ccc;--highlight-button-hover-on-active:#d4d4d4;--highlight-button-pressed-on-active:#e1e1e1;--highlight-accent-button-hover:#5293e2;--highlight-accent-button-pressed:#3475c5;--highlight-primary-button-hover:#2b2b2b;--highlight-primary-button-pressed:#2b2b2b;--highlight-scroll-thumb-hover:#ccc;--highlight-scroll-track-hover:#00000008;--highlight-toolbar-tab-underline-document:#4a87e7;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#4a87e7;--checkbox-border-normal:silver;--icon-normal:#000c;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#991b1b;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--background-normal);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-gray{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#999;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-classic-light{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#888;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-night{--background-normal:#404040;--background-normal-element:#4b4b4b;--background-normal-element-light:#4b4b4b;--background-accent-button:#3483db;--background-primary-button:#ddd;--background-scrim:#0009;--background-scroll-thumb:#555;--border-divider:#505050;--border-regular-control:#585858;--border-control-focus:#ccc;--border-error:#f62211;--border-sidebar-icon:#585858;--highlight-button-hover:#585858;--highlight-button-pressed:#686868;--highlight-button-hover-on-active:#606060;--highlight-button-pressed-on-active:#686868;--highlight-accent-button-hover:#5293e2;--highlight-accent-button-pressed:#3475c5;--highlight-primary-button-hover:#e5e5e5;--highlight-primary-button-pressed:#e5e5e5;--highlight-scroll-thumb-hover:#606060;--highlight-scroll-track-hover:#ffffff08;--highlight-toolbar-tab-underline-document:#4a87e7;--checkbox-check-mark-background:#000;--checkbox-background-checked:#f3f3f3;--checkbox-border-normal:silver;--icon-normal:#fffc;--icon-success:#090;--text-normal:#fffc;--text-normal-pressed:#fffc;--text-secondary:#fff9;--text-tertiary:#fff6;--text-link:#acbfff;--text-inverse:#333;--text-contrast-background:#fff;--text-negative:#f87171;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-contrast-dark{--background-normal:#212121;--background-normal-element:#2a2a2a;--background-normal-element-light:#2a2a2a;--background-accent-button:#4d76a8;--background-primary-button:#e6e6e6;--background-scrim:#0009;--background-scroll-thumb:#2a2a2a;--border-divider:#414141;--border-regular-control:#696969;--border-control-focus:#999;--border-error:#f62211;--border-sidebar-icon:#696969;--highlight-button-hover:#424242;--highlight-button-pressed:#666;--highlight-button-hover-on-active:#a6a6a6;--highlight-button-pressed-on-active:#666;--highlight-accent-button-hover:#75a2d6;--highlight-accent-button-pressed:#89afdc;--highlight-primary-button-hover:#a6a6a6;--highlight-primary-button-pressed:#a6a6a6;--highlight-scroll-thumb-hover:#424242;--highlight-scroll-track-hover:#616161;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#212121;--checkbox-background-checked:#e6e6e6;--checkbox-border-normal:#666;--icon-normal:#e8e8e8;--icon-success:#090;--text-normal:#e8e8e8;--text-normal-pressed:#e8e8e8;--text-secondary:#b8b8b8;--text-tertiary:#888;--text-link:#ffd78c;--text-inverse:#121212;--text-contrast-background:#fff;--text-negative:#e8e8e8;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}:root{font-family:Arial,Segoe UI,system-ui,Avenir,Helvetica,sans-serif}::-webkit-scrollbar-track{background-color:var(--background-normal-element)!important}::-webkit-scrollbar-thumb{background-color:var(--background-scroll-thumb)!important}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@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-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{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-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-leading{syntax:"*";inherits:false}@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:"";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:"";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:"";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:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} +.tooltip-arrow{fill:var(--tooltip-background-color)}[data-slot=tooltip-content]{filter:drop-shadow(0 1px 2px rgba(0,0,0,.1))}@keyframes aui-pulse{50%{opacity:.5}}:where(.aui-md[data-status=running]):empty:after,:where(.aui-md[data-status=running])>:where(:not(ol):not(ul):not(pre)):last-child:after,:where(.aui-md[data-status=running])>pre:last-child code:after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,:where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child):after{animation:aui-pulse 2s cubic-bezier(.4,0,.6,1) infinite;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--aui-content: "●";content:var(--aui-content);margin-left:.25rem;margin-right:.25rem}.aui-shiki-base{background-color:var(--chat-message-code-block-background-color)!important;padding:0 12px 12px!important;border-radius:0 0 12px 12px!important}.aui-shiki-base>pre{background-color:var( --chat-message-code-block-pre-background-color )!important;border:1px solid var(--chat-message-code-block-border-color)!important;border-radius:4px!important;padding:6px!important}.theme-light .line span{color:var(--shiki-light)!important}.theme-dark .line span{color:var(--shiki-dark)!important}.composer-root{border-color:var(--chat-composer-border-color);background:var(--chat-composer-background-color)}.composer-root:hover{border-color:var(--chat-composer-hover-border-color)}.composer-root:focus-within{border-color:var(--chat-composer-active-border-color)}.composer-input{font-size:14px;line-height:15px;color:var(--chat-composer-text-color)}.composer-input::placeholder{color:var(--chat-composer-placeholder-color)}.aui-md[data-status=running]:after,.aui-md[data-status=running]>*:last-child:after{display:none!important}.ͼ2 .cm-gutters,.ͼ2 .cm-activeLineGutter{background-color:var(--background-normal)!important;color:var(--text-secondary)!important;border:0px solid var(--border-divider)!important}.ͼe,.ͼ2 .cm-line{color:var(--text-normal)!important}.ͼ2 .cm-activeLine{background-color:transparent!important}@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-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--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-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@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;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-lg:.5rem;--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);--animate-spin:spin 1s linear infinite;--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}::-webkit-calendar-picker-indicator{line-height:1}:-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{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2,.top-\[50\%\]{top:50%}.right-\[10px\]{right:10px}.left-1\/2{left:50%}.left-\[10px\]{left:10px}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.z-\[9999\]{z-index:9999}.col-span-2{grid-column:span 2/span 2}.col-span-full{grid-column:1/-1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.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}}.m-0{margin:calc(var(--spacing)*0)}.mx-\[-32px\]{margin-inline:-32px}.mx-\[32px\]{margin-inline:32px}.mx-auto{margin-inline:auto}.my-4{margin-block:calc(var(--spacing)*4)}.my-5{margin-block:calc(var(--spacing)*5)}.my-\[4px\]{margin-block:4px}.my-\[8px\]{margin-block:8px}.my-\[16px\]{margin-block:16px}.ms-\[8px\]{margin-inline-start:8px}.ms-\[13px\]{margin-inline-start:13px}.ms-\[28px\]{margin-inline-start:28px}.ms-\[32px\]{margin-inline-start:32px}.ms-auto{margin-inline-start:auto}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-\[-15px\]{margin-top:-15px}.mt-\[4px\]{margin-top:4px}.mt-\[8px\]{margin-top:8px}.mt-\[16px\]{margin-top:16px}.mt-\[24px\]{margin-top:24px}.mt-\[32px\]{margin-top:32px}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\[8px\]{margin-bottom:8px}.mb-\[16px\]{margin-bottom:16px}.mb-\[32px\]{margin-bottom:32px}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-\[32px\]{margin-left:32px}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-4{height:calc(var(--spacing)*4)}.h-\[10px\]{height:10px}.h-\[12px\]{height:12px}.h-\[14px\]{height:14px}.h-\[20px\]{height:20px}.h-\[24px\]{height:24px}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[40px\]{height:40px}.h-\[44px\]{height:44px}.h-\[48px\]{height:48px}.h-\[56px\]{height:56px}.h-\[64px\]{height:64px}.h-\[72px\]{height:72px}.h-\[100vh\]{height:100vh}.h-\[384px\]{height:384px}.h-\[400px\]{height:400px}.h-\[520px\]{height:520px}.h-\[560px\]{height:560px}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:calc(var(--spacing)*56)}.max-h-\[200px\]{max-height:200px}.max-h-\[calc\(50vh\)\]{max-height:50vh}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-6{min-height:calc(var(--spacing)*6)}.min-h-\[1px\]{min-height:1px}.min-h-\[16px\]{min-height:16px}.min-h-\[32px\]{min-height:32px}.min-h-\[36px\]{min-height:36px}.min-h-\[44px\]{min-height:44px}.min-h-\[56px\]{min-height:56px}.min-h-\[256px\]{min-height:256px}.min-h-\[280px\]{min-height:280px}.min-h-\[400px\]{min-height:400px}.w-4{width:calc(var(--spacing)*4)}.w-\[10px\]{width:10px}.w-\[12px\]{width:12px}.w-\[20px\]{width:20px}.w-\[24px\]{width:24px}.w-\[36px\]{width:36px}.w-\[72px\]{width:72px}.w-\[260px\]{width:260px}.w-\[264px\]{width:264px}.w-\[348px\]{width:348px}.w-\[352px\]{width:352px}.w-\[548px\]{width:548px}.w-\[564px\]{width:564px}.w-\[640px\]{width:640px}.w-\[720px\]{width:720px}.w-\[var\(--radix-dropdown-menu-trigger-width\)\]{width:var(--radix-dropdown-menu-trigger-width)}.w-\[var\(--thread-max-width\)\]{width:var(--thread-max-width)}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\[272px\]{max-width:272px}.max-w-\[300px\]{max-width:300px}.max-w-\[312px\]{max-width:312px}.max-w-\[490px\]{max-width:490px}.max-w-\[573px\]{max-width:573px}.max-w-\[640px\]{max-width:640px}.max-w-\[fit-content\]{max-width:fit-content}.max-w-\[var\(--thread-max-width\)\]{max-width:var(--thread-max-width)}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-6{min-width:calc(var(--spacing)*6)}.min-w-\[40px\]{min-width:40px}.min-w-\[150px\]{min-width:150px}.min-w-\[264px\]{min-width:264px}.min-w-\[274px\]{min-width:274px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:calc(var(--spacing)*0);--tw-border-spacing-y:calc(var(--spacing)*0);border-spacing:var(--tw-border-spacing-x)var(--tw-border-spacing-y)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[1px\]{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.resize{resize:both}.resize\!{resize:both!important}.resize-none{resize:none}.scroll-m-20{scroll-margin:calc(var(--spacing)*20)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.auto-rows-auto{grid-auto-rows:auto}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.grid-cols-\[minmax\(72px\,1fr\)_auto\]{grid-template-columns:minmax(72px,1fr) auto}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[4px\]{gap:4px}.gap-\[8px\]{gap:8px}.gap-\[10px\]{gap:10px}.gap-\[12px\]{gap:12px}.gap-\[16px\]{gap:16px}.gap-\[20px\]{gap:20px}.gap-\[24px\]{gap:24px}.gap-\[32px\]{gap:32px}.gap-\[40px\]{gap:40px}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:calc(var(--spacing)*1)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[8px\]{border-radius:8px}.rounded-\[12px\]{border-radius:12px}.rounded-\[16px\]{border-radius:16px}.rounded-full{border-radius:3.40282e38px}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-l-\[8px\]{border-top-left-radius:8px;border-bottom-left-radius:8px}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-r-\[8px\]{border-top-right-radius:8px;border-bottom-right-radius:8px}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-\[12px\]{border-bottom-right-radius:12px;border-bottom-left-radius:12px}.rounded-br{border-bottom-right-radius:.25rem}.rounded-br-\[0px\]{border-bottom-right-radius:0}.rounded-bl{border-bottom-left-radius:.25rem}.rounded-bl-\[0px\]{border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1px\]{border-style:var(--tw-border-style);border-width:1px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e,.border-e-\[1px\]{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t,.border-t-\[1px\]{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r,.border-r-\[1px\]{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b,.border-b-\[1px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[1px\]{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\[var\(--border-divider\)\]{border-color:var(--border-divider)}.border-\[var\(--button-default-border-color\)\]{border-color:var(--button-default-border-color)}.border-\[var\(--chat-list-border-right\)\]{border-color:var(--chat-list-border-right)}.border-\[var\(--chat-message-code-block-border-color\)\]{border-color:var(--chat-message-code-block-border-color)}.border-\[var\(--chat-message-divider-color\)\]{border-color:var(--chat-message-divider-color)}.border-\[var\(--chat-message-error-border-color\)\]{border-color:var(--chat-message-error-border-color)}.border-\[var\(--chat-message-tool-call-pre-border-color\)\]{border-color:var(--chat-message-tool-call-pre-border-color)}.border-\[var\(--checkbox-color\)\]{border-color:var(--checkbox-color)}.border-\[var\(--drop-down-menu-border-color\)\]{border-color:var(--drop-down-menu-border-color)}.border-\[var\(--file-items-border-color\)\]{border-color:var(--file-items-border-color)}.border-\[var\(--header-border-color\)\]{border-color:var(--header-border-color)}.border-\[var\(--input-active-border-color\)\]{border-color:var(--input-active-border-color)}.border-\[var\(--input-border-color\)\]{border-color:var(--input-border-color)}.border-\[var\(--loader-border-color\)\]{border-color:var(--loader-border-color)}.border-\[var\(--radio-button-active-color\)\]{border-color:var(--radio-button-active-color)}.border-\[var\(--radio-button-color\)\]{border-color:var(--radio-button-color)}.border-\[var\(--servers-available-tools-border-color\)\]{border-color:var(--servers-available-tools-border-color)}.border-\[var\(--servers-edit-config-buttons-border-color\)\]{border-color:var(--servers-edit-config-buttons-border-color)}.border-\[var\(--servers-edit-config-json-editor-border-color\)\]{border-color:var(--servers-edit-config-json-editor-border-color)}.border-\[var\(--servers-logs-dialog-border-color\)\]{border-color:var(--servers-logs-dialog-border-color)}.border-\[var\(--tabs-border-color\)\]{border-color:var(--tabs-border-color)}.border-\[var\(--text-contrast-background\)\]{border-color:var(--text-contrast-background)}.border-\[var\(--tooltip-border-color\)\]{border-color:var(--tooltip-border-color)}.border-transparent{border-color:#0000}.border-r-transparent{border-right-color:#0000}.border-l-\[var\(--border-divider\)\]{border-left-color:var(--border-divider)}.bg-\[var\(--ai-provider-item-background-color\)\]{background-color:var(--ai-provider-item-background-color)}.bg-\[var\(--background-normal-element\)\]{background-color:var(--background-normal-element)}.bg-\[var\(--button-background-color\)\]{background-color:var(--button-background-color)}.bg-\[var\(--button-default-background-color\)\]{background-color:var(--button-default-background-color)}.bg-\[var\(--chat-composer-action-send-background-color\)\]{background-color:var(--chat-composer-action-send-background-color)}.bg-\[var\(--chat-list-item-active-background-color\)\]{background-color:var(--chat-list-item-active-background-color)}.bg-\[var\(--chat-message-code-block-background-color\)\]{background-color:var(--chat-message-code-block-background-color)}.bg-\[var\(--chat-message-code-block-pre-background-color\)\]{background-color:var(--chat-message-code-block-pre-background-color)}.bg-\[var\(--chat-message-tool-call-body-background-color\)\]{background-color:var(--chat-message-tool-call-body-background-color)}.bg-\[var\(--chat-message-tool-call-name-background-color\)\]{background-color:var(--chat-message-tool-call-name-background-color)}.bg-\[var\(--chat-message-tool-call-pre-background-color\)\]{background-color:var(--chat-message-tool-call-pre-background-color)}.bg-\[var\(--chat-user-message-background\)\]{background-color:var(--chat-user-message-background)}.bg-\[var\(--checkbox-active-color\)\]{background-color:var(--checkbox-active-color)}.bg-\[var\(--checkbox-bg-color\)\]{background-color:var(--checkbox-bg-color)}.bg-\[var\(--drop-down-menu-background-color\)\]{background-color:var(--drop-down-menu-background-color)}.bg-\[var\(--drop-down-menu-item-active-color\)\]{background-color:var(--drop-down-menu-item-active-color)}.bg-\[var\(--drop-down-menu-separator-color\)\]{background-color:var(--drop-down-menu-separator-color)}.bg-\[var\(--file-items-background-color\)\]{background-color:var(--file-items-background-color)}.bg-\[var\(--file-items-chat-background-color\)\]{background-color:var(--file-items-chat-background-color)}.bg-\[var\(--header-background-color\)\]{background-color:var(--header-background-color)}.bg-\[var\(--input-background-color\)\]{background-color:var(--input-background-color)}.bg-\[var\(--layout-background-color\)\]{background-color:var(--layout-background-color)}.bg-\[var\(--modal-dialog-background-color\)\]{background-color:var(--modal-dialog-background-color)}.bg-\[var\(--modal-dialog-overlay-background\)\]{background-color:var(--modal-dialog-overlay-background)}.bg-\[var\(--radio-button-active-color\)\]{background-color:var(--radio-button-active-color)}.bg-\[var\(--servers-available-tools-item-active-background-color\)\]{background-color:var(--servers-available-tools-item-active-background-color)}.bg-\[var\(--servers-available-tools-item-background-color\)\]{background-color:var(--servers-available-tools-item-background-color)}.bg-\[var\(--servers-edit-config-json-background-color\)\]{background-color:var(--servers-edit-config-json-background-color)}.bg-\[var\(--servers-edit-config-json-editor-background-color\)\]{background-color:var(--servers-edit-config-json-editor-background-color)}.bg-\[var\(--toggle-button-circle-color\)\]{background-color:var(--toggle-button-circle-color)}.bg-\[var\(--toggle-button-off-background-color\)\]{background-color:var(--toggle-button-off-background-color)}.bg-\[var\(--tooltip-background-color\)\]{background-color:var(--tooltip-background-color)}.bg-none{background-image:none}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-\[4px\]{padding:4px}.p-\[6px\]{padding:6px}.p-\[12px\]{padding:12px}.p-\[16px\]{padding:16px}.px-4{padding-inline:calc(var(--spacing)*4)}.px-\[8px\]{padding-inline:8px}.px-\[12px\]{padding-inline:12px}.px-\[16px\]{padding-inline:16px}.px-\[24px\]{padding-inline:24px}.px-\[32px\]{padding-inline:32px}.px-\[var\(--thread-padding-x\)\]{padding-inline:var(--thread-padding-x)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.py-\[2px\]{padding-block:2px}.py-\[8px\]{padding-block:8px}.py-\[12px\]{padding-block:12px}.py-\[16px\]{padding-block:16px}.ps-\[4px\]{padding-inline-start:4px}.ps-\[12px\]{padding-inline-start:12px}.ps-\[16px\]{padding-inline-start:16px}.ps-\[32px\]{padding-inline-start:32px}.ps-\[40px\]{padding-inline-start:40px}.ps-\[var\(--thread-padding-x\)\]{padding-inline-start:var(--thread-padding-x)}.pe-\[2px\]{padding-inline-end:2px}.pe-\[4px\]{padding-inline-end:4px}.pe-\[8px\]{padding-inline-end:8px}.pe-\[12px\]{padding-inline-end:12px}.pe-\[16px\]{padding-inline-end:16px}.pe-\[24px\]{padding-inline-end:24px}.pe-\[40px\]{padding-inline-end:40px}.pt-\[8px\]{padding-top:8px}.pt-\[12px\]{padding-top:12px}.pt-\[24px\]{padding-top:24px}.pr-\[4px\]{padding-right:4px}.pr-\[8px\]{padding-right:8px}.pr-\[24px\]{padding-right:24px}.pr-\[40px\]{padding-right:40px}.pb-\[3px\]{padding-bottom:3px}.pb-\[8px\]{padding-bottom:8px}.pb-\[12px\]{padding-bottom:12px}.pb-\[16px\]{padding-bottom:16px}.pb-\[24px\]{padding-bottom:24px}.pb-\[32px\]{padding-bottom:32px}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-\[4px\]{padding-left:4px}.pl-\[8px\]{padding-left:8px}.pl-\[24px\]{padding-left:24px}.pl-\[40px\]{padding-left:40px}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.align-\[-0\.125em\]{vertical-align:-.125em}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[24px\]{font-size:24px}.text-\[28px\]{font-size:28px}.text-\[32px\]{font-size:32px}.leading-7{--tw-leading:calc(var(--spacing)*7);line-height:calc(var(--spacing)*7)}.leading-\[14px\]{--tw-leading:14px;line-height:14px}.leading-\[16px\]{--tw-leading:16px;line-height:16px}.leading-\[18px\]{--tw-leading:18px;line-height:18px}.leading-\[20px\]{--tw-leading:20px;line-height:20px}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-\[24px\]{--tw-leading:24px;line-height:24px}.leading-\[28px\]{--tw-leading:28px;line-height:28px}.leading-\[32px\]{--tw-leading:32px;line-height:32px}.leading-\[36px\]{--tw-leading:36px;line-height:36px}.font-\[14px\]{--tw-font-weight:14px;font-weight:14px}.font-\[400\]{--tw-font-weight:400;font-weight:400}.font-\[700\]{--tw-font-weight:700;font-weight:700}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--ai-provider-item-color\)\]{color:var(--ai-provider-item-color)}.text-\[var\(--ai-provider-item-description-color\)\]{color:var(--ai-provider-item-description-color)}.text-\[var\(--button-color\)\]{color:var(--button-color)}.text-\[var\(--button-default-color\)\]{color:var(--button-default-color)}.text-\[var\(--chat-link-color\)\]{color:var(--chat-link-color)}.text-\[var\(--chat-list-color\)\]{color:var(--chat-list-color)}.text-\[var\(--chat-list-empty-color\)\]{color:var(--chat-list-empty-color)}.text-\[var\(--chat-list-item-color\)\]{color:var(--chat-list-item-color)}.text-\[var\(--chat-message-analyze-color\)\]{color:var(--chat-message-analyze-color)}.text-\[var\(--chat-message-code-block-header-color\)\]{color:var(--chat-message-code-block-header-color)}.text-\[var\(--chat-message-color\)\]{color:var(--chat-message-color)}.text-\[var\(--chat-message-error-color\)\]{color:var(--chat-message-error-color)}.text-\[var\(--chat-message-td-color\)\]{color:var(--chat-message-td-color)}.text-\[var\(--chat-message-th-color\)\]{color:var(--chat-message-th-color)}.text-\[var\(--chat-message-tool-call-header-color\)\]{color:var(--chat-message-tool-call-header-color)}.text-\[var\(--chat-message-tool-call-name-color\)\]{color:var(--chat-message-tool-call-name-color)}.text-\[var\(--chat-message-tool-call-pre-color\)\]{color:var(--chat-message-tool-call-pre-color)}.text-\[var\(--chat-user-message-color\)\]{color:var(--chat-user-message-color)}.text-\[var\(--drop-down-menu-item-active-color\)\]{color:var(--drop-down-menu-item-active-color)}.text-\[var\(--drop-down-menu-item-color\)\]{color:var(--drop-down-menu-item-color)}.text-\[var\(--empty-screen-color\)\]{color:var(--empty-screen-color)}.text-\[var\(--empty-screen-description-color\)\]{color:var(--empty-screen-description-color)}.text-\[var\(--field-container-error-color\)\]{color:var(--field-container-error-color)}.text-\[var\(--field-container-header-color\)\]{color:var(--field-container-header-color)}.text-\[var\(--file-items-color\)\]{color:var(--file-items-color)}.text-\[var\(--file-items-ext-color\)\]{color:var(--file-items-ext-color)}.text-\[var\(--header-color\)\]{color:var(--header-color)}.text-\[var\(--input-color\)\]{color:var(--input-color)}.text-\[var\(--input-placeholder-color\)\]{color:var(--input-placeholder-color)}.text-\[var\(--modal-dialog-header-color\)\]{color:var(--modal-dialog-header-color)}.text-\[var\(--servers-available-tools-current-tool-color\)\]{color:var(--servers-available-tools-current-tool-color)}.text-\[var\(--servers-available-tools-header-color\)\]{color:var(--servers-available-tools-header-color)}.text-\[var\(--servers-available-tools-item-name-color\)\]{color:var(--servers-available-tools-item-name-color)}.text-\[var\(--servers-available-tools-sub-header-color\)\]{color:var(--servers-available-tools-sub-header-color)}.text-\[var\(--servers-description-color\)\]{color:var(--servers-description-color)}.text-\[var\(--servers-edit-config-json-header-color\)\]{color:var(--servers-edit-config-json-header-color)}.text-\[var\(--servers-edit-config-json-lang-color\)\]{color:var(--servers-edit-config-json-lang-color)}.text-\[var\(--servers-logs-dialog-log-color\)\]{color:var(--servers-logs-dialog-log-color)}.text-\[var\(--settings-description-color\)\]{color:var(--settings-description-color)}.text-\[var\(--settings-header-color\)\]{color:var(--settings-header-color)}.text-\[var\(--tabs-color\)\]{color:var(--tabs-color)}.text-\[var\(--text-negative\)\]{color:var(--text-negative)}.text-\[var\(--text-normal\)\]{color:var(--text-normal)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-\[var\(--text-tertiary\)\]{color:var(--text-tertiary)}.text-\[var\(--tool-fallback-color\)\]{color:var(--tool-fallback-color)}.text-\[var\(--tooltip-text-color\)\]{color:var(--tooltip-text-color)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.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,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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-\[var\(--ai-provider-item-shadow\)\]{--tw-shadow:var(--ai-provider-item-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[var\(--drop-down-menu-shadow\)\]{--tw-shadow:var(--drop-down-menu-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[var\(--modal-dialog-shadows\)\]{--tw-shadow:var(--modal-dialog-shadows);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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,)}.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,)}.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,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.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)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.paused{animation-play-state:paused}.ring-inset{--tw-ring-inset:inset}.running{animation-play-state:running}.zoom-in{--tw-enter-scale:0}.zoom-out{--tw-exit-scale:0}@media(hover:hover){.group-hover\:\!bg-\[var\(--checkbox-active-hover-color\)\]:is(:where(.group):hover *){background-color:var(--checkbox-active-hover-color)!important}.group-hover\:\!bg-\[var\(--checkbox-bg-hover-color\)\]:is(:where(.group):hover *){background-color:var(--checkbox-bg-hover-color)!important}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-active\:\!bg-\[var\(--checkbox-active-pressed-color\)\]:is(:where(.group):active *){background-color:var(--checkbox-active-pressed-color)!important}.group-active\:\!bg-\[var\(--checkbox-bg-pressed-color\)\]:is(:where(.group):active *){background-color:var(--checkbox-bg-pressed-color)!important}.placeholder\:text-\[var\(--input-placeholder-color\)\]::placeholder{color:var(--input-placeholder-color)}.first\:mt-0:first-child{margin-top:calc(var(--spacing)*0)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.focus-within\:outline-none:focus-within{--tw-outline-style:none;outline-style:none}@media(hover:hover){.hover\:border-\[var\(--input-hover-border-color\)\]:hover{border-color:var(--input-hover-border-color)}.hover\:bg-\[var\(--chat-list-item-hover-background-color\)\]:hover{background-color:var(--chat-list-item-hover-background-color)}.hover\:bg-\[var\(--drop-down-menu-item-hover-color\)\]:hover{background-color:var(--drop-down-menu-item-hover-color)}.hover\:bg-\[var\(--file-items-chat-hover-background-color\)\]:hover{background-color:var(--file-items-chat-hover-background-color)}.hover\:bg-\[var\(--input-hover-background-color\)\]:hover{background-color:var(--input-hover-background-color)}.hover\:bg-\[var\(--servers-available-tools-item-hover-background-color\)\]:hover{background-color:var(--servers-available-tools-item-hover-background-color)}.hover\:text-\[var\(--drop-down-menu-item-hover-color\)\]:hover{color:var(--drop-down-menu-item-hover-color)}}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--button-border-focus-color\)\]:focus{border-color:var(--button-border-focus-color)}.focus\:border-\[var\(--input-active-border-color\)\]:focus{border-color:var(--input-active-border-color)}.focus\:bg-\[var\(--button-background-color\)\]:focus{background-color:var(--button-background-color)}.focus\:bg-\[var\(--input-active-background-color\)\]:focus{background-color:var(--input-active-background-color)}.focus\:shadow-\[var\(--button-default-focus-shadow\)\]:focus{--tw-shadow:var(--button-default-focus-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:shadow-\[var\(--button-shadow-focus\)\]:focus{--tw-shadow:var(--button-shadow-focus);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-\[var\(--chat-list-item-active-background-color\)\]:active{background-color:var(--chat-list-item-active-background-color)}.active\:bg-\[var\(--file-items-chat-pressed-background-color\)\]:active{background-color:var(--file-items-chat-pressed-background-color)}@media(hover:hover){.hover\:enabled\:bg-\[var\(--button-background-hover-color\)\]:hover:enabled{background-color:var(--button-background-hover-color)}.hover\:enabled\:bg-\[var\(--button-default-hover-background-color\)\]:hover:enabled{background-color:var(--button-default-hover-background-color)}.hover\:enabled\:bg-\[var\(--chat-composer-action-send-background-hover-color\)\]:hover:enabled{background-color:var(--chat-composer-action-send-background-hover-color)}.hover\:enabled\:bg-\[var\(--icon-button-hover-background-color\)\]:hover:enabled{background-color:var(--icon-button-hover-background-color)}.hover\:enabled\:bg-\[var\(--icon-button-hover-on-active-background-color\)\]:hover:enabled{background-color:var(--icon-button-hover-on-active-background-color)}}.active\:enabled\:bg-\[var\(--button-background-pressed-color\)\]:active:enabled{background-color:var(--button-background-pressed-color)}.active\:enabled\:bg-\[var\(--button-default-pressed-background-color\)\]:active:enabled{background-color:var(--button-default-pressed-background-color)}.active\:enabled\:bg-\[var\(--chat-composer-action-send-background-pressed-color\)\]:active:enabled{background-color:var(--chat-composer-action-send-background-pressed-color)}.active\:enabled\:bg-\[var\(--icon-button-pressed-background-color\)\]:active:enabled{background-color:var(--icon-button-pressed-background-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-\[var\(--button-default-disabled-background-color\)\]:disabled{background-color:var(--button-default-disabled-background-color)}.disabled\:text-\[var\(--button-default-disabled-color\)\]:disabled{color:var(--button-default-disabled-color)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled,.disabled\:opacity-\[0\.5\]:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[highlighted\]\:bg-\[var\(--drop-down-menu-item-active-color\)\][data-highlighted]{background-color:var(--drop-down-menu-item-active-color)}.data-\[highlighted\]\:text-\[var\(--drop-down-menu-item-active-color\)\][data-highlighted]{color:var(--drop-down-menu-item-active-color)}.data-\[state\=active\]\:font-bold[data-state=active]{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.data-\[state\=active\]\:after\:absolute[data-state=active]:after{content:var(--tw-content);position:absolute}.data-\[state\=active\]\:after\:right-0[data-state=active]:after{content:var(--tw-content);right:calc(var(--spacing)*0)}.data-\[state\=active\]\:after\:bottom-\[-5px\][data-state=active]:after{content:var(--tw-content);bottom:-5px}.data-\[state\=active\]\:after\:left-0[data-state=active]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[state\=active\]\:after\:h-\[4px\][data-state=active]:after{content:var(--tw-content);height:4px}.data-\[state\=active\]\:after\:rounded-t-\[3px\][data-state=active]:after{content:var(--tw-content);border-top-left-radius:3px;border-top-right-radius:3px}.data-\[state\=active\]\:after\:bg-\[var\(--tabs-active-border-color\)\][data-state=active]:after{content:var(--tw-content);background-color:var(--tabs-active-border-color)}.data-\[state\=active\]\:after\:content-\[\'\'\][data-state=active]:after{--tw-content:"";content:var(--tw-content)}.data-\[state\=checked\]\:translate-x-\[10px\][data-state=checked]{--tw-translate-x:10px;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[var\(--toggle-button-background-color\)\][data-state=checked]{background-color:var(--toggle-button-background-color)}@media(hover:hover){.data-\[state\=checked\]\:hover\:enabled\:bg-\[var\(--toggle-button-background-hover-color\)\][data-state=checked]:hover:enabled{background-color:var(--toggle-button-background-hover-color)}}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}@media(hover:hover){.hover\:enabled\:data-\[state\=inactive\]\:after\:absolute:hover:enabled[data-state=inactive]:after{content:var(--tw-content);position:absolute}.hover\:enabled\:data-\[state\=inactive\]\:after\:bottom-\[-5px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);bottom:-5px}.hover\:enabled\:data-\[state\=inactive\]\:after\:left-1\/2:hover:enabled[data-state=inactive]:after{content:var(--tw-content);left:50%}.hover\:enabled\:data-\[state\=inactive\]\:after\:h-\[4px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);height:4px}.hover\:enabled\:data-\[state\=inactive\]\:after\:w-\[24px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);width:24px}.hover\:enabled\:data-\[state\=inactive\]\:after\:-translate-x-1\/2:hover:enabled[data-state=inactive]:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:enabled\:data-\[state\=inactive\]\:after\:transform:hover:enabled[data-state=inactive]:after{content:var(--tw-content);transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.hover\:enabled\:data-\[state\=inactive\]\:after\:rounded-t-\[3px\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);border-top-left-radius:3px;border-top-right-radius:3px}.hover\:enabled\:data-\[state\=inactive\]\:after\:bg-\[var\(--tabs-hover-border-color\)\]:hover:enabled[data-state=inactive]:after{content:var(--tw-content);background-color:var(--tabs-hover-border-color)}.hover\:enabled\:data-\[state\=inactive\]\:after\:content-\[\'\'\]:hover:enabled[data-state=inactive]:after{--tw-content:"";content:var(--tw-content)}}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-\[spin_1\.5s_linear_infinite\]{animation:1.5s linear infinite spin}}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-b-lg pre{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.\[\&_pre\]\:p-4 pre{padding:calc(var(--spacing)*4)}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:-webkit-search-decoration\]\:hidden::-webkit-search-decoration{display:none}.\[\&\>a\]\:text-xs>a{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&\>a\]\:no-underline>a{text-decoration-line:none}.\[\&\>li\]\:mt-\[4px\]>li{margin-top:4px}.\[\&\[align\=center\]\]\:text-center[align=center]{text-align:center}.\[\&\[align\=right\]\]\:text-right[align=right]{text-align:right}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.theme-light{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#888;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-dark{--background-normal:#333;--background-normal-element:#505050;--background-normal-element-light:#404040;--background-accent-button:#486f9e;--background-primary-button:#ddd;--background-scrim:#0009;--background-scroll-thumb:#404040;--border-divider:#505050;--border-regular-control:#666;--border-control-focus:#7d7d7d;--border-error:#f62211;--border-sidebar-icon:#666;--highlight-button-hover:#555;--highlight-button-pressed:#707070;--highlight-button-hover-on-active:#999;--highlight-button-pressed-on-active:#707070;--highlight-accent-button-hover:#75a2d6;--highlight-accent-button-pressed:#89afdc;--highlight-primary-button-hover:#fcfcfc;--highlight-primary-button-pressed:#fcfcfc;--highlight-scroll-thumb-hover:#999;--highlight-scroll-track-hover:#999;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#333;--checkbox-background-checked:#ddd;--checkbox-border-normal:#707070;--icon-normal:#fff;--icon-success:#090;--text-normal:#fffc;--text-normal-pressed:#fffc;--text-secondary:#fff9;--text-tertiary:#fff6;--text-link:#b5e4ff;--text-inverse:#333;--text-contrast-background:#fff;--text-negative:#fffc;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-white{--background-normal:#fff;--background-normal-element:#f3f3f3;--background-normal-element-light:#f9f9f9;--background-accent-button:#3483db;--background-primary-button:#3483db;--background-scrim:#0003;--background-scroll-thumb:#e0e0e0;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#848484;--border-error:#f62211;--border-sidebar-icon:#dfdfdf;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#ccc;--highlight-button-hover-on-active:#d4d4d4;--highlight-button-pressed-on-active:#e1e1e1;--highlight-accent-button-hover:#5293e2;--highlight-accent-button-pressed:#3475c5;--highlight-primary-button-hover:#2b2b2b;--highlight-primary-button-pressed:#2b2b2b;--highlight-scroll-thumb-hover:#ccc;--highlight-scroll-track-hover:#00000008;--highlight-toolbar-tab-underline-document:#4a87e7;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#4a87e7;--checkbox-border-normal:silver;--icon-normal:#000c;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#991b1b;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--background-normal);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-gray{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#999;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-classic-light{--background-normal:#fff;--background-normal-element:#efefef;--background-normal-element-light:#f7f7f7;--background-accent-button:#446995;--background-primary-button:#444;--background-scrim:#0003;--background-scroll-thumb:#f7f7f7;--border-divider:#dfdfdf;--border-regular-control:silver;--border-control-focus:#888;--border-error:#f62211;--border-sidebar-icon:silver;--highlight-button-hover:#e0e0e0;--highlight-button-pressed:#cbcbcb;--highlight-button-hover-on-active:silver;--highlight-button-pressed-on-active:#cbcbcb;--highlight-accent-button-hover:#375478;--highlight-accent-button-pressed:#293f59;--highlight-primary-button-hover:#1c1c1c;--highlight-primary-button-pressed:#1c1c1c;--highlight-scroll-thumb-hover:silver;--highlight-scroll-track-hover:#cbcbcb;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#fff;--checkbox-background-checked:#444;--checkbox-border-normal:#cbcbcb;--icon-normal:#444;--icon-success:#090;--text-normal:#000c;--text-normal-pressed:#000c;--text-secondary:#0009;--text-tertiary:#0006;--text-link:#445799;--text-inverse:#fff;--text-contrast-background:#fff;--text-negative:#000c;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-night{--background-normal:#404040;--background-normal-element:#4b4b4b;--background-normal-element-light:#4b4b4b;--background-accent-button:#3483db;--background-primary-button:#ddd;--background-scrim:#0009;--background-scroll-thumb:#555;--border-divider:#505050;--border-regular-control:#585858;--border-control-focus:#ccc;--border-error:#f62211;--border-sidebar-icon:#585858;--highlight-button-hover:#585858;--highlight-button-pressed:#686868;--highlight-button-hover-on-active:#606060;--highlight-button-pressed-on-active:#686868;--highlight-accent-button-hover:#5293e2;--highlight-accent-button-pressed:#3475c5;--highlight-primary-button-hover:#e5e5e5;--highlight-primary-button-pressed:#e5e5e5;--highlight-scroll-thumb-hover:#606060;--highlight-scroll-track-hover:#ffffff08;--highlight-toolbar-tab-underline-document:#4a87e7;--checkbox-check-mark-background:#000;--checkbox-background-checked:#f3f3f3;--checkbox-border-normal:silver;--icon-normal:#fffc;--icon-success:#090;--text-normal:#fffc;--text-normal-pressed:#fffc;--text-secondary:#fff9;--text-tertiary:#fff6;--text-link:#acbfff;--text-inverse:#333;--text-contrast-background:#fff;--text-negative:#f87171;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}.theme-contrast-dark{--background-normal:#212121;--background-normal-element:#2a2a2a;--background-normal-element-light:#2a2a2a;--background-accent-button:#4d76a8;--background-primary-button:#e6e6e6;--background-scrim:#0009;--background-scroll-thumb:#2a2a2a;--border-divider:#414141;--border-regular-control:#696969;--border-control-focus:#999;--border-error:#f62211;--border-sidebar-icon:#696969;--highlight-button-hover:#424242;--highlight-button-pressed:#666;--highlight-button-hover-on-active:#a6a6a6;--highlight-button-pressed-on-active:#666;--highlight-accent-button-hover:#75a2d6;--highlight-accent-button-pressed:#89afdc;--highlight-primary-button-hover:#a6a6a6;--highlight-primary-button-pressed:#a6a6a6;--highlight-scroll-thumb-hover:#424242;--highlight-scroll-track-hover:#616161;--highlight-toolbar-tab-underline-document:#446995;--checkbox-check-mark-background:#212121;--checkbox-background-checked:#e6e6e6;--checkbox-border-normal:#666;--icon-normal:#e8e8e8;--icon-success:#090;--text-normal:#e8e8e8;--text-normal-pressed:#e8e8e8;--text-secondary:#b8b8b8;--text-tertiary:#888;--text-link:#ffd78c;--text-inverse:#121212;--text-contrast-background:#fff;--text-negative:#e8e8e8;--layout-background-color:var(--background-normal);--header-color:var(--text-normal);--header-background-color:var(--background-normal);--header-border-color:var(--border-divider);--chat-list-color:var(--text-normal);--chat-list-border-right:var(--border-divider);--chat-list-empty-color:var(--text-tertiary);--chat-list-item-color:var(--text-normal);--chat-list-item-hover-background-color:var(--highlight-button-hover);--chat-list-item-active-background-color:var(--highlight-button-pressed);--icon-button-color:var(--icon-normal);--icon-button-background-color:transparent;--icon-button-hover-background-color:var(--highlight-button-hover);--icon-button-pressed-background-color:var(--highlight-button-pressed);--icon-button-hover-on-active-background-color:var(--highlight-button-hover-on-active);--icon-button-pressed-on-active-background-color:var(--highlight-button-pressed-on-active);--button-color:var(--text-contrast-background);--button-background-color:var(--background-accent-button);--button-background-hover-color:var(--highlight-accent-button-hover);--button-background-pressed-color:var(--highlight-accent-button-pressed);--button-border-focus-color:var(--text-contrast-background);--button-shadow-focus:0px 0px 0px 2px #4781d1bf;--button-default-color:var(--text-normal);--button-default-background-color:var(--background-normal);--button-default-border-color:var(--highlight-button-pressed);--button-default-hover-background-color:var(--background-normal-element-light);--button-default-pressed-background-color:var(--highlight-button-hover);--button-default-focus-shadow:0px 0px 0px 2px #4781d180;--button-default-disabled-border-color:var(--border-regular-control);--button-default-disabled-color:var(--text-normal);--button-default-disabled-background-color:var(--background-normal);--input-background-color:var(--background-normal-element);--input-placeholder-color:var(--text-tertiary);--input-color:var(--text-normal);--input-border-color:var(--border-regular-control);--input-hover-background-color:var(--highlight-button-hover);--input-hover-border-color:var(--checkbox-border-normal);--input-active-border-color:var(--background-accent-button);--input-active-background-color:var(--background-normal);--input-error-color:var(--border-error);--tabs-color:var(--text-normal);--tabs-border-color:var(--border-divider);--tabs-hover-border-color:var(--checkbox-border-normal);--tabs-active-border-color:var(--background-accent-button);--modal-dialog-background-color:var(--background-normal);--modal-dialog-footer-border-color:var(--border-divider);--modal-dialog-header-color:var(--text-normal);--modal-dialog-shadows:0px 8px 16px 0px #040f1b29,0px 0px 4px 0px #040f1b1f;--modal-dialog-overlay-background:var(--background-scrim);--field-container-header-color:var(--text-normal);--field-container-error-color:var(--text-negative);--drop-down-menu-background-color:var(--background-normal);--drop-down-menu-border-color:#0000001a;--drop-down-menu-shadow:0px 8px 16px 0px #040f1b14,0px 0px 4px 0px #040f1b0a;--drop-down-menu-item-color:var(--text-normal);--drop-down-menu-separator-color:var(--border-divider);--drop-down-menu-item-hover-color:var(--highlight-button-hover);--drop-down-menu-item-active-color:var(--highlight-button-pressed);--radio-button-color:var(--checkbox-border-normal);--radio-button-active-color:var(--background-accent-button);--toggle-button-background-color:var(--background-accent-button);--toggle-button-background-hover-color:var(--highlight-accent-button-hover);--toggle-button-off-background-color:var(--checkbox-border-normal);--toggle-button-circle-color:var(--background-normal);--file-items-background-color:var(--background-normal);--file-items-color:var(--text-normal);--file-items-ext-color:var(--text-secondary);--file-items-border-color:var(--border-divider);--file-items-chat-background-color:var(--background-normal-element);--file-items-chat-hover-background-color:var(--highlight-button-hover);--file-items-chat-pressed-background-color:var(--highlight-button-pressed);--tooltip-background-color:var(--background-normal);--tooltip-text-color:var(--text-normal);--tooltip-border-color:var(--border-divider);--tooltip-shadow:0px 1px 4px -1px #0003;--loader-border-color:var(--background-accent-button);--tool-fallback-color:var(--text-normal);--checkbox-color:var(--checkbox-border-normal);--checkbox-bg-color:var(--background-normal);--checkbox-bg-hover-color:var(--highlight-button-hover);--checkbox-bg-pressed-color:var(--highlight-button-pressed);--checkbox-active-color:var(--background-accent-button);--checkbox-active-hover-color:var(--highlight-accent-button-hover);--checkbox-active-pressed-color:var(--highlight-accent-button-pressed);--checkbox-active-icon-color:var(--background-normal);--empty-screen-color:var(--text-normal);--empty-screen-description-color:var(--text-secondary);--settings-header-color:var(--text-normal);--settings-description-color:var(--text-tertiary);--ai-provider-item-color:var(--text-normal);--ai-provider-item-description-color:var(--text-secondary);--ai-provider-item-background-color:var(--background-normal);--ai-provider-item-shadow:0px 1px 2px 0px #0000000f,0px 1px 3px 0px #0000001a;--servers-description-color:var(--text-tertiary);--servers-edit-config-json-background-color:var(--background-normal-element-light);--servers-edit-config-json-header-color:var(--text-secondary);--servers-edit-config-json-lang-color:var(--text-tertiary);--servers-edit-config-json-editor-border-color:var(--border-divider);--servers-edit-config-json-editor-background-color:var(--background-normal);--servers-edit-config-buttons-border-color:var(--border-divider);--servers-available-tools-border-color:var(--border-divider);--servers-available-tools-header-color:var(--text-normal);--servers-available-tools-item-name-color:var(--text-normal);--servers-available-tools-sub-header-color:var(--text-tertiary);--servers-available-tools-current-tool-color:var(--text-normal);--servers-available-tools-item-background-color:var(--background-normal-element-light);--servers-available-tools-item-hover-background-color:var(--highlight-button-hover);--servers-available-tools-item-active-background-color:var(--highlight-button-pressed);--servers-logs-dialog-border-color:var(--border-divider);--servers-logs-dialog-log-color:var(--text-normal);--chat-welcome-color:var(--text-normal);--chat-welcome-description-color:var(--text-secondary);--chat-composer-background-color:var(--background-normal-element-light);--chat-composer-border-color:var(--border-divider);--chat-composer-hover-border-color:var(--highlight-button-hover);--chat-composer-active-border-color:var(--background-accent-button);--chat-composer-text-color:var(--text-normal);--chat-composer-placeholder-color:var(--text-secondary);--chat-composer-action-send-color:var(--text-contrast-background);--chat-composer-action-send-background-color:var(--background-accent-button);--chat-composer-action-send-background-hover-color:var(--highlight-accent-button-hover);--chat-composer-action-send-background-pressed-color:var(--highlight-accent-button-pressed);--chat-user-message-background:var(--highlight-button-hover);--chat-user-message-color:var(--text-normal);--chat-message-color:var(--text-normal);--chat-message-blockquote-color:var(--border-control-focus);--chat-message-link-color:var(--text-link);--chat-message-divider-color:var(--border-divider);--chat-message-th-color:var(--text-normal);--chat-message-td-color:var(--text-normal);--chat-message-code-block-background-color:var(--background-normal-element-light);--chat-message-code-block-border-color:var(--border-divider);--chat-message-code-block-header-color:var(--text-secondary);--chat-message-code-block-pre-background-color:var(--background-normal);--chat-message-error-color:var(--text-negative);--chat-message-error-border-color:var(--border-error);--chat-message-tool-call-header-color:var(--text-normal);--chat-message-tool-call-name-color:var(--text-normal);--chat-message-tool-call-name-background-color:var(--background-normal-element);--chat-message-tool-call-body-background-color:var(--background-normal-element-light);--chat-message-tool-call-body-color:var(--text-secondary);--chat-message-tool-call-pre-border-color:var(--border-divider);--chat-message-tool-call-pre-background-color:var(--background-normal);--chat-message-tool-call-pre-color:var(--text-normal);--chat-message-analyze-color:var(--text-normal)}:root{font-family:Arial,Segoe UI,system-ui,Avenir,Helvetica,sans-serif}::-webkit-scrollbar-track{background-color:var(--background-normal-element)!important}::-webkit-scrollbar-thumb{background-color:var(--background-scroll-thumb)!important}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@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-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{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-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-leading{syntax:"*";inherits:false}@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:"";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:"";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:"";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:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.js b/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.js index 40086220..9dfcd986 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.js +++ b/ChromiumBasedEditors/plugins/ai-agent/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}/index.js @@ -1,78 +1,78 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["angular-html.js","html.js","javascript.js","css.js","angular-ts.js","scss.js","apl.js","xml.js","java.js","json.js","astro.js","typescript.js","postcss.js","tsx.js","blade.js","html-derivative.js","sql.js","bsl.js","sdbl.js","cairo.js","python.js","cobol.js","coffee.js","cpp.js","regexp.js","glsl.js","c.js","crystal.js","shellscript.js","edge.js","elixir.js","elm.js","erb.js","ruby.js","haml.js","graphql.js","jsx.js","lua.js","yaml.js","erlang.js","markdown.js","fortran-fixed-form.js","fortran-free-form.js","fsharp.js","gdresource.js","gdshader.js","gdscript.js","git-commit.js","diff.js","git-rebase.js","glimmer-js.js","glimmer-ts.js","hack.js","handlebars.js","http.js","hurl.js","csv.js","hxml.js","haxe.js","jinja.js","jison.js","julia.js","r.js","latex.js","tex.js","liquid.js","marko.js","less.js","mdc.js","nginx.js","nim.js","perl.js","php.js","pug.js","qml.js","razor.js","csharp.js","rst.js","cmake.js","sas.js","shaderlab.js","hlsl.js","shellsession.js","soy.js","sparql.js","turtle.js","stata.js","svelte.js","templ.js","go.js","ts-tags.js","twig.js","vue.js","vue-html.js","vue-vine.js","stylus.js","xsl.js"])))=>i.map(i=>d[i]); -function NJ(t,e){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var $A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cx={exports:{}},kf={};var dN;function OJ(){if(dN)return kf;dN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var o=null;if(s!==void 0&&(o=""+s),r.key!==void 0&&(o=""+r.key),"key"in r){s={};for(var a in r)a!=="key"&&(s[a]=r[a])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:s}}return kf.Fragment=e,kf.jsx=n,kf.jsxs=n,kf}var hN;function BJ(){return hN||(hN=1,cx.exports=OJ()),cx.exports}var _=BJ(),ux={exports:{}},Ye={};var fN;function LJ(){if(fN)return Ye;fN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(z,te,U){this.props=z,this.context=te,this.refs=C,this.updater=U||v}E.prototype.isReactComponent={},E.prototype.setState=function(z,te){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,te,"setState")},E.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function k(){}k.prototype=E.prototype;function R(z,te,U){this.props=z,this.context=te,this.refs=C,this.updater=U||v}var M=R.prototype=new k;M.constructor=R,S(M,E.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function P(){}var N={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function G(z,te,U){var pe=U.ref;return{$$typeof:t,type:z,key:te,ref:pe!==void 0?pe:null,props:U}}function V(z,te){return G(z.type,te,z.props)}function $(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function K(z){var te={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(U){return te[U]})}var X=/\/+/g;function J(z,te){return typeof z=="object"&&z!==null&&z.key!=null?K(""+z.key):te.toString(36)}function Z(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function(te){z.status==="pending"&&(z.status="fulfilled",z.value=te)},function(te){z.status==="pending"&&(z.status="rejected",z.reason=te)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function Q(z,te,U,pe,xe){var Ce=typeof z;(Ce==="undefined"||Ce==="boolean")&&(z=null);var ve=!1;if(z===null)ve=!0;else switch(Ce){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(z.$$typeof){case t:case e:ve=!0;break;case d:return ve=z._init,Q(ve(z._payload),te,U,pe,xe)}}if(ve)return xe=xe(z),ve=pe===""?"."+J(z,0):pe,D(xe)?(U="",ve!=null&&(U=ve.replace(X,"$&/")+"/"),Q(xe,te,U,"",function(jt){return jt})):xe!=null&&($(xe)&&(xe=V(xe,U+(xe.key==null||z&&z.key===xe.key?"":(""+xe.key).replace(X,"$&/")+"/")+ve)),te.push(xe)),1;ve=0;var tt=pe===""?".":pe+":";if(D(z))for(var it=0;it>>1,L=Q[oe];if(0>>1;oer(U,j))per(xe,U)?(Q[oe]=xe,Q[pe]=j,oe=pe):(Q[oe]=U,Q[te]=j,oe=te);else if(per(xe,j))Q[oe]=xe,Q[pe]=j,oe=pe;else break e}}return q}function r(Q,q){var j=Q.sortIndex-q.sortIndex;return j!==0?j:Q.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,f=null,g=3,m=!1,v=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(Q){for(var q=n(u);q!==null;){if(q.callback===null)i(u);else if(q.startTime<=Q)i(u),q.sortIndex=q.expirationTime,e(l,q);else break;q=n(u)}}function D(Q){if(S=!1,M(Q),!v)if(n(l)!==null)v=!0,P||(P=!0,K());else{var q=n(u);q!==null&&Z(D,q.startTime-Q)}}var P=!1,N=-1,B=5,G=-1;function V(){return C?!0:!(t.unstable_now()-GQ&&V());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,g=f.priorityLevel;var L=oe(f.expirationTime<=Q);if(Q=t.unstable_now(),typeof L=="function"){f.callback=L,M(Q),q=!0;break t}f===n(l)&&i(l),M(Q)}else i(l);f=n(l)}if(f!==null)q=!0;else{var z=n(u);z!==null&&Z(D,z.startTime-Q),q=!1}}break e}finally{f=null,g=j,m=!1}q=void 0}}finally{q?K():P=!1}}}var K;if(typeof R=="function")K=function(){R($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,J=X.port2;X.port1.onmessage=$,K=function(){J.postMessage(null)}}else K=function(){E($,0)};function Z(Q,q){N=E(function(){Q(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Q){Q.callback=null},t.unstable_forceFrameRate=function(Q){0>Q||125oe?(Q.sortIndex=j,e(u,Q),n(l)===null&&Q===n(u)&&(S?(k(N),N=-1):S=!0,Z(D,j-oe))):(Q.sortIndex=L,e(l,Q),v||m||(v=!0,P||(P=!0,K()))),Q},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(Q){var q=g;return function(){var j=g;g=q;try{return Q.apply(this,arguments)}finally{g=j}}}})(fx)),fx}var mN;function VJ(){return mN||(mN=1,hx.exports=UJ()),hx.exports}var px={exports:{}},ui={};var AN;function FJ(){if(AN)return ui;AN=1;var t=fT();function e(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),px.exports=FJ(),px.exports}var vN;function HJ(){if(vN)return If;vN=1;var t=VJ(),e=fT(),n=o6();function i(c){var h="https://react.dev/errors/"+c;if(1L||(c.current=oe[L],oe[L]=null,L--)}function U(c,h){L++,oe[L]=c.current,c.current=h}var pe=z(null),xe=z(null),Ce=z(null),ve=z(null);function tt(c,h){switch(U(Ce,h),U(xe,c),U(pe,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?NP(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=NP(h),c=OP(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}te(pe),U(pe,c)}function it(){te(pe),te(xe),te(Ce)}function jt(c){c.memoizedState!==null&&U(ve,c);var h=pe.current,p=OP(h,c.type);h!==p&&(U(xe,c),U(pe,p))}function en(c){xe.current===c&&(te(pe),te(xe)),ve.current===c&&(te(ve),Ef._currentValue=j)}var oi,wi;function Wn(c){if(oi===void 0)try{throw Error()}catch(p){var h=p.stack.trim().match(/\n( *(at )?)/);oi=h&&h[1]||"",wi=-1)":-1w||W[A]!==ie[w]){var ce=` -`+W[A].replace(" at new "," at ");return c.displayName&&ce.includes("")&&(ce=ce.replace("",c.displayName)),ce}while(1<=A&&0<=w);break}}}finally{ss=!1,Error.prepareStackTrace=p}return(p=c?c.displayName||c.name:"")?Wn(p):""}function Ul(c,h){switch(c.tag){case 26:case 27:case 5:return Wn(c.type);case 16:return Wn("Lazy");case 13:return c.child!==h&&h!==null?Wn("Suspense Fallback"):Wn("Suspense");case 19:return Wn("SuspenseList");case 0:case 15:return ir(c.type,!1);case 11:return ir(c.type.render,!1);case 1:return ir(c.type,!0);case 31:return Wn("Activity");default:return""}}function Xc(c){try{var h="",p=null;do h+=Ul(c,p),p=c,c=c.return;while(c);return h}catch(A){return` -Error generating stack: `+A.message+` -`+A.stack}}var Sa=Object.prototype.hasOwnProperty,os=t.unstable_scheduleCallback,ko=t.unstable_cancelCallback,Zc=t.unstable_shouldYield,eu=t.unstable_requestPaint,Kt=t.unstable_now,Ca=t.unstable_getCurrentPriorityLevel,ue=t.unstable_ImmediatePriority,be=t.unstable_UserBlockingPriority,ze=t.unstable_NormalPriority,nt=t.unstable_LowPriority,yt=t.unstable_IdlePriority,Si=t.log,as=t.unstable_setDisableYieldValue,jn=null,tn=null;function ai(c){if(typeof Si=="function"&&as(c),tn&&typeof tn.setStrictMode=="function")try{tn.setStrictMode(jn,c)}catch{}}var Tt=Math.clz32?Math.clz32:Dh,Rr=Math.log,Kn=Math.LN2;function Dh(c){return c>>>=0,c===0?32:31-(Rr(c)/Kn|0)|0}var xa=256,Ea=262144,Ls=4194304;function Io(c){var h=c&42;if(h!==0)return h;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function tu(c,h,p){var A=c.pendingLanes;if(A===0)return 0;var w=0,x=c.suspendedLanes,I=c.pingedLanes;c=c.warmLanes;var O=A&134217727;return O!==0?(A=O&~x,A!==0?w=Io(A):(I&=O,I!==0?w=Io(I):p||(p=O&~c,p!==0&&(w=Io(p))))):(O=A&~x,O!==0?w=Io(O):I!==0?w=Io(I):p||(p=A&~c,p!==0&&(w=Io(p)))),w===0?0:h!==0&&h!==w&&(h&x)===0&&(x=w&-w,p=h&-h,x>=p||x===32&&(p&4194048)!==0)?h:w}function Vl(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function rS(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rm(){var c=Ls;return Ls<<=1,(Ls&62914560)===0&&(Ls=4194304),c}function nu(c){for(var h=[],p=0;31>p;p++)h.push(c);return h}function _a(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Mo(c,h,p,A,w,x){var I=c.pendingLanes;c.pendingLanes=p,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=p,c.entangledLanes&=p,c.errorRecoveryDisabledLanes&=p,c.shellSuspendCounter=0;var O=c.entanglements,W=c.expirationTimes,ie=c.hiddenUpdates;for(p=I&~p;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var uS=/[\n"\\]/g;function Fi(c){return c.replace(uS,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lh(c,h,p,A,w,x,I,O){c.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?c.type=I:c.removeAttribute("type"),h!=null?I==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Vi(h)):c.value!==""+Vi(h)&&(c.value=""+Vi(h)):I!=="submit"&&I!=="reset"||c.removeAttribute("value"),h!=null?Vh(c,I,Vi(h)):p!=null?Vh(c,I,Vi(p)):A!=null&&c.removeAttribute("value"),w==null&&x!=null&&(c.defaultChecked=!!x),w!=null&&(c.checked=w&&typeof w!="function"&&typeof w!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?c.name=""+Vi(O):c.removeAttribute("name")}function Uh(c,h,p,A,w,x,I,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(c.type=x),h!=null||p!=null){if(!(x!=="submit"&&x!=="reset"||h!=null)){Bh(c);return}p=p!=null?""+Vi(p):"",h=h!=null?""+Vi(h):p,O||h===c.value||(c.value=h),c.defaultValue=h}A=A??w,A=typeof A!="function"&&typeof A!="symbol"&&!!A,c.checked=O?c.checked:!!A,c.defaultChecked=!!A,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(c.name=I),Bh(c)}function Vh(c,h,p){h==="number"&&au(c.ownerDocument)===c||c.defaultValue===""+p||(c.defaultValue=""+p)}function Ia(c,h,p,A){if(c=c.options,h){h={};for(var w=0;w"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zh=!1;if(Mr)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){zh=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{zh=!1}var zs=null,Gl=null,du=null;function Hm(){if(du)return du;var c,h=Gl,p=h.length,A,w="value"in zs?zs.value:zs.textContent,x=w.length;for(c=0;c=$h),HI=" ",zI=!1;function QI(c,h){switch(c){case"keyup":return nq.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GI(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var pu=!1;function rq(c,h){switch(c){case"compositionend":return GI(h);case"keypress":return h.which!==32?null:(zI=!0,HI);case"textInput":return c=h.data,c===HI&&zI?null:c;default:return null}}function sq(c,h){if(pu)return c==="compositionend"||!gS&&QI(c,h)?(c=Hm(),du=Gl=zs=null,pu=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:p,offset:h-c};c=A}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=XI(p)}}function eM(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?eM(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function tM(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=au(c.document);h instanceof c.HTMLIFrameElement;){try{var p=typeof h.contentWindow.location.href=="string"}catch{p=!1}if(p)c=h.contentWindow;else break;h=au(c.document)}return h}function yS(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var fq=Mr&&"documentMode"in document&&11>=document.documentMode,gu=null,vS=null,Yh=null,bS=!1;function nM(c,h,p){var A=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;bS||gu==null||gu!==au(A)||(A=gu,"selectionStart"in A&&yS(A)?A={start:A.selectionStart,end:A.selectionEnd}:(A=(A.ownerDocument&&A.ownerDocument.defaultView||window).getSelection(),A={anchorNode:A.anchorNode,anchorOffset:A.anchorOffset,focusNode:A.focusNode,focusOffset:A.focusOffset}),Yh&&Kh(Yh,A)||(Yh=A,A=IA(vS,"onSelect"),0>=I,w-=I,Gs=1<<32-Tt(h)+w|p<Xe?(ft=Be,Be=null):ft=Be.sibling;var bt=ae(ee,Be,ne[Xe],de);if(bt===null){Be===null&&(Be=ft);break}c&&Be&&bt.alternate===null&&h(ee,Be),Y=x(bt,Y,Xe),vt===null?Le=bt:vt.sibling=bt,vt=bt,Be=ft}if(Xe===ne.length)return p(ee,Be),pt&&Lo(ee,Xe),Le;if(Be===null){for(;XeXe?(ft=Be,Be=null):ft=Be.sibling;var el=ae(ee,Be,bt.value,de);if(el===null){Be===null&&(Be=ft);break}c&&Be&&el.alternate===null&&h(ee,Be),Y=x(el,Y,Xe),vt===null?Le=el:vt.sibling=el,vt=el,Be=ft}if(bt.done)return p(ee,Be),pt&&Lo(ee,Xe),Le;if(Be===null){for(;!bt.done;Xe++,bt=ne.next())bt=he(ee,bt.value,de),bt!==null&&(Y=x(bt,Y,Xe),vt===null?Le=bt:vt.sibling=bt,vt=bt);return pt&&Lo(ee,Xe),Le}for(Be=A(Be);!bt.done;Xe++,bt=ne.next())bt=le(Be,ee,Xe,bt.value,de),bt!==null&&(c&&bt.alternate!==null&&Be.delete(bt.key===null?Xe:bt.key),Y=x(bt,Y,Xe),vt===null?Le=bt:vt.sibling=bt,vt=bt);return c&&Be.forEach(function(PJ){return h(ee,PJ)}),pt&&Lo(ee,Xe),Le}function Pt(ee,Y,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===S&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case m:e:{for(var Le=ne.key;Y!==null;){if(Y.key===Le){if(Le=ne.type,Le===S){if(Y.tag===7){p(ee,Y.sibling),de=w(Y,ne.props.children),de.return=ee,ee=de;break e}}else if(Y.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===B&&ec(Le)===Y.type){p(ee,Y.sibling),de=w(Y,ne.props),tf(de,ne),de.return=ee,ee=de;break e}p(ee,Y);break}else h(ee,Y);Y=Y.sibling}ne.type===S?(de=Yl(ne.props.children,ee.mode,de,ne.key),de.return=ee,ee=de):(de=jm(ne.type,ne.key,ne.props,null,ee.mode,de),tf(de,ne),de.return=ee,ee=de)}return I(ee);case v:e:{for(Le=ne.key;Y!==null;){if(Y.key===Le)if(Y.tag===4&&Y.stateNode.containerInfo===ne.containerInfo&&Y.stateNode.implementation===ne.implementation){p(ee,Y.sibling),de=w(Y,ne.children||[]),de.return=ee,ee=de;break e}else{p(ee,Y);break}else h(ee,Y);Y=Y.sibling}de=TS(ne,ee.mode,de),de.return=ee,ee=de}return I(ee);case B:return ne=ec(ne),Pt(ee,Y,ne,de)}if(Z(ne))return Pe(ee,Y,ne,de);if(K(ne)){if(Le=K(ne),typeof Le!="function")throw Error(i(150));return ne=Le.call(ne),Qe(ee,Y,ne,de)}if(typeof ne.then=="function")return Pt(ee,Y,eA(ne),de);if(ne.$$typeof===R)return Pt(ee,Y,qm(ee,ne),de);tA(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Y!==null&&Y.tag===6?(p(ee,Y.sibling),de=w(Y,ne),de.return=ee,ee=de):(p(ee,Y),de=_S(ne,ee.mode,de),de.return=ee,ee=de),I(ee)):p(ee,Y)}return function(ee,Y,ne,de){try{ef=0;var Le=Pt(ee,Y,ne,de);return _u=null,Le}catch(Be){if(Be===Eu||Be===Xm)throw Be;var vt=or(29,Be,null,ee.mode);return vt.lanes=de,vt.return=ee,vt}}}var nc=EM(!0),_M=EM(!1),La=!1;function VS(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function FS(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Ua(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function Va(c,h,p){var A=c.updateQueue;if(A===null)return null;if(A=A.shared,(xt&2)!==0){var w=A.pending;return w===null?h.next=h:(h.next=w.next,w.next=h),A.pending=h,h=Wm(c),cM(c,null,p),h}return $m(c,A,h,p),Wm(c)}function nf(c,h,p){if(h=h.updateQueue,h!==null&&(h=h.shared,(p&4194048)!==0)){var A=h.lanes;A&=c.pendingLanes,p|=A,h.lanes=p,Im(c,p)}}function HS(c,h){var p=c.updateQueue,A=c.alternate;if(A!==null&&(A=A.updateQueue,p===A)){var w=null,x=null;if(p=p.firstBaseUpdate,p!==null){do{var I={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};x===null?w=x=I:x=x.next=I,p=p.next}while(p!==null);x===null?w=x=h:x=x.next=h}else w=x=h;p={baseState:A.baseState,firstBaseUpdate:w,lastBaseUpdate:x,shared:A.shared,callbacks:A.callbacks},c.updateQueue=p;return}c=p.lastBaseUpdate,c===null?p.firstBaseUpdate=h:c.next=h,p.lastBaseUpdate=h}var zS=!1;function rf(){if(zS){var c=xu;if(c!==null)throw c}}function sf(c,h,p,A){zS=!1;var w=c.updateQueue;La=!1;var x=w.firstBaseUpdate,I=w.lastBaseUpdate,O=w.shared.pending;if(O!==null){w.shared.pending=null;var W=O,ie=W.next;W.next=null,I===null?x=ie:I.next=ie,I=W;var ce=c.alternate;ce!==null&&(ce=ce.updateQueue,O=ce.lastBaseUpdate,O!==I&&(O===null?ce.firstBaseUpdate=ie:O.next=ie,ce.lastBaseUpdate=W))}if(x!==null){var he=w.baseState;I=0,ce=ie=W=null,O=x;do{var ae=O.lane&-536870913,le=ae!==O.lane;if(le?(ht&ae)===ae:(A&ae)===ae){ae!==0&&ae===Cu&&(zS=!0),ce!==null&&(ce=ce.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Pe=c,Qe=O;ae=h;var Pt=p;switch(Qe.tag){case 1:if(Pe=Qe.payload,typeof Pe=="function"){he=Pe.call(Pt,he,ae);break e}he=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Qe.payload,ae=typeof Pe=="function"?Pe.call(Pt,he,ae):Pe,ae==null)break e;he=f({},he,ae);break e;case 2:La=!0}}ae=O.callback,ae!==null&&(c.flags|=64,le&&(c.flags|=8192),le=w.callbacks,le===null?w.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ce===null?(ie=ce=le,W=he):ce=ce.next=le,I|=ae;if(O=O.next,O===null){if(O=w.shared.pending,O===null)break;le=O,O=le.next,le.next=null,w.lastBaseUpdate=le,w.shared.pending=null}}while(!0);ce===null&&(W=he),w.baseState=W,w.firstBaseUpdate=ie,w.lastBaseUpdate=ce,x===null&&(w.shared.lanes=0),Ga|=I,c.lanes=I,c.memoizedState=he}}function TM(c,h){if(typeof c!="function")throw Error(i(191,c));c.call(h)}function RM(c,h){var p=c.callbacks;if(p!==null)for(c.callbacks=null,c=0;cx?x:8;var I=Q.T,O={};Q.T=O,aC(c,!1,h,p);try{var W=w(),ie=Q.S;if(ie!==null&&ie(O,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ce=Sq(W,A);lf(c,h,ce,dr(c))}else lf(c,h,A,dr(c))}catch(he){lf(c,h,{then:function(){},status:"rejected",reason:he},dr())}finally{q.p=x,I!==null&&O.types!==null&&(I.types=O.types),Q.T=I}}function Rq(){}function sC(c,h,p,A){if(c.tag!==5)throw Error(i(476));var w=oD(c).queue;sD(c,w,h,j,p===null?Rq:function(){return aD(c),p(A)})}function oD(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:j},next:null};var p={};return h.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:p},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function aD(c){var h=oD(c);h.next===null&&(h=c.alternate.memoizedState),lf(c,h.next.queue,{},dr())}function oC(){return qn(Ef)}function lD(){return un().memoizedState}function cD(){return un().memoizedState}function kq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var p=dr();c=Ua(p);var A=Va(h,c,p);A!==null&&($i(A,h,p),nf(A,h,p)),h={cache:OS()},c.payload=h;return}h=h.return}}function Iq(c,h,p){var A=dr();p={lane:A,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},dA(c)?dD(h,p):(p=xS(c,h,p,A),p!==null&&($i(p,c,A),hD(p,h,A)))}function uD(c,h,p){var A=dr();lf(c,h,p,A)}function lf(c,h,p,A){var w={lane:A,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(dA(c))dD(h,w);else{var x=c.alternate;if(c.lanes===0&&(x===null||x.lanes===0)&&(x=h.lastRenderedReducer,x!==null))try{var I=h.lastRenderedState,O=x(I,p);if(w.hasEagerState=!0,w.eagerState=O,sr(O,I))return $m(c,h,w,0),Nt===null&&Gm(),!1}catch{}if(p=xS(c,h,w,A),p!==null)return $i(p,c,A),hD(p,h,A),!0}return!1}function aC(c,h,p,A){if(A={lane:2,revertLane:VC(),gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null},dA(c)){if(h)throw Error(i(479))}else h=xS(c,p,A,2),h!==null&&$i(h,c,2)}function dA(c){var h=c.alternate;return c===Je||h!==null&&h===Je}function dD(c,h){Ru=rA=!0;var p=c.pending;p===null?h.next=h:(h.next=p.next,p.next=h),c.pending=h}function hD(c,h,p){if((p&4194048)!==0){var A=h.lanes;A&=c.pendingLanes,p|=A,h.lanes=p,Im(c,p)}}var cf={readContext:qn,use:aA,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};cf.useEffectEvent=nn;var fD={readContext:qn,use:aA,useCallback:function(c,h){return xi().memoizedState=[c,h===void 0?null:h],c},useContext:qn,useEffect:qM,useImperativeHandle:function(c,h,p){p=p!=null?p.concat([c]):null,cA(4194308,4,eD.bind(null,h,c),p)},useLayoutEffect:function(c,h){return cA(4194308,4,c,h)},useInsertionEffect:function(c,h){cA(4,2,c,h)},useMemo:function(c,h){var p=xi();h=h===void 0?null:h;var A=c();if(ic){ai(!0);try{c()}finally{ai(!1)}}return p.memoizedState=[A,h],A},useReducer:function(c,h,p){var A=xi();if(p!==void 0){var w=p(h);if(ic){ai(!0);try{p(h)}finally{ai(!1)}}}else w=h;return A.memoizedState=A.baseState=w,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:w},A.queue=c,c=c.dispatch=Iq.bind(null,Je,c),[A.memoizedState,c]},useRef:function(c){var h=xi();return c={current:c},h.memoizedState=c},useState:function(c){c=eC(c);var h=c.queue,p=uD.bind(null,Je,h);return h.dispatch=p,[c.memoizedState,p]},useDebugValue:iC,useDeferredValue:function(c,h){var p=xi();return rC(p,c,h)},useTransition:function(){var c=eC(!1);return c=sD.bind(null,Je,c.queue,!0,!1),xi().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,p){var A=Je,w=xi();if(pt){if(p===void 0)throw Error(i(407));p=p()}else{if(p=h(),Nt===null)throw Error(i(349));(ht&127)!==0||NM(A,h,p)}w.memoizedState=p;var x={value:p,getSnapshot:h};return w.queue=x,qM(BM.bind(null,A,x,c),[c]),A.flags|=2048,Iu(9,{destroy:void 0},OM.bind(null,A,x,p,h),null),p},useId:function(){var c=xi(),h=Nt.identifierPrefix;if(pt){var p=$s,A=Gs;p=(A&~(1<<32-Tt(A)-1)).toString(32)+p,h="_"+h+"R_"+p,p=sA++,0<\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof A.is=="string"?I.createElement("select",{is:A.is}):I.createElement("select"),A.multiple?x.multiple=!0:A.size&&(x.size=A.size);break;default:x=typeof A.is=="string"?I.createElement(w,{is:A.is}):I.createElement(w)}}x[Tn]=h,x[li]=A;e:for(I=h.child;I!==null;){if(I.tag===5||I.tag===6)x.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===h)break e;for(;I.sibling===null;){if(I.return===null||I.return===h)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}h.stateNode=x;e:switch(Xn(x,w,A),w){case"button":case"input":case"select":case"textarea":A=!!A.autoFocus;break e;case"img":A=!0;break e;default:A=!1}A&&Qo(h)}}return Qt(h),wC(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,p),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==A&&Qo(h);else{if(typeof A!="string"&&h.stateNode===null)throw Error(i(166));if(c=Ce.current,wu(h)){if(c=h.stateNode,p=h.memoizedProps,A=null,w=Yn,w!==null)switch(w.tag){case 27:case 5:A=w.memoizedProps}c[Tn]=h,c=!!(c.nodeValue===p||A!==null&&A.suppressHydrationWarning===!0||DP(c.nodeValue,p)),c||Oa(h,!0)}else c=MA(c).createTextNode(A),c[Tn]=h,h.stateNode=c}return Qt(h),null;case 31:if(p=h.memoizedState,c===null||c.memoizedState!==null){if(A=wu(h),p!==null){if(c===null){if(!A)throw Error(i(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(557));c[Tn]=h}else ql(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Qt(h),c=!1}else p=MS(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=p),c=!0;if(!c)return h.flags&256?(lr(h),h):(lr(h),null);if((h.flags&128)!==0)throw Error(i(558))}return Qt(h),null;case 13:if(A=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(w=wu(h),A!==null&&A.dehydrated!==null){if(c===null){if(!w)throw Error(i(318));if(w=h.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(i(317));w[Tn]=h}else ql(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Qt(h),w=!1}else w=MS(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=w),w=!0;if(!w)return h.flags&256?(lr(h),h):(lr(h),null)}return lr(h),(h.flags&128)!==0?(h.lanes=p,h):(p=A!==null,c=c!==null&&c.memoizedState!==null,p&&(A=h.child,w=null,A.alternate!==null&&A.alternate.memoizedState!==null&&A.alternate.memoizedState.cachePool!==null&&(w=A.alternate.memoizedState.cachePool.pool),x=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(x=A.memoizedState.cachePool.pool),x!==w&&(A.flags|=2048)),p!==c&&p&&(h.child.flags|=8192),mA(h,h.updateQueue),Qt(h),null);case 4:return it(),c===null&&QC(h.stateNode.containerInfo),Qt(h),null;case 10:return Vo(h.type),Qt(h),null;case 19:if(te(cn),A=h.memoizedState,A===null)return Qt(h),null;if(w=(h.flags&128)!==0,x=A.rendering,x===null)if(w)df(A,!1);else{if(rn!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(x=iA(c),x!==null){for(h.flags|=128,df(A,!1),c=x.updateQueue,h.updateQueue=c,mA(h,c),h.subtreeFlags=0,c=p,p=h.child;p!==null;)uM(p,c),p=p.sibling;return U(cn,cn.current&1|2),pt&&Lo(h,A.treeForkCount),h.child}c=c.sibling}A.tail!==null&&Kt()>wA&&(h.flags|=128,w=!0,df(A,!1),h.lanes=4194304)}else{if(!w)if(c=iA(x),c!==null){if(h.flags|=128,w=!0,c=c.updateQueue,h.updateQueue=c,mA(h,c),df(A,!0),A.tail===null&&A.tailMode==="hidden"&&!x.alternate&&!pt)return Qt(h),null}else 2*Kt()-A.renderingStartTime>wA&&p!==536870912&&(h.flags|=128,w=!0,df(A,!1),h.lanes=4194304);A.isBackwards?(x.sibling=h.child,h.child=x):(c=A.last,c!==null?c.sibling=x:h.child=x,A.last=x)}return A.tail!==null?(c=A.tail,A.rendering=c,A.tail=c.sibling,A.renderingStartTime=Kt(),c.sibling=null,p=cn.current,U(cn,w?p&1|2:p&1),pt&&Lo(h,A.treeForkCount),c):(Qt(h),null);case 22:case 23:return lr(h),GS(),A=h.memoizedState!==null,c!==null?c.memoizedState!==null!==A&&(h.flags|=8192):A&&(h.flags|=8192),A?(p&536870912)!==0&&(h.flags&128)===0&&(Qt(h),h.subtreeFlags&6&&(h.flags|=8192)):Qt(h),p=h.updateQueue,p!==null&&mA(h,p.retryQueue),p=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),A=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(A=h.memoizedState.cachePool.pool),A!==p&&(h.flags|=2048),c!==null&&te(Zl),null;case 24:return p=null,c!==null&&(p=c.memoizedState.cache),h.memoizedState.cache!==p&&(h.flags|=2048),Vo(gn),Qt(h),null;case 25:return null;case 30:return null}throw Error(i(156,h.tag))}function Oq(c,h){switch(kS(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return Vo(gn),it(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return en(h),null;case 31:if(h.memoizedState!==null){if(lr(h),h.alternate===null)throw Error(i(340));ql()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(lr(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(i(340));ql()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return te(cn),null;case 4:return it(),null;case 10:return Vo(h.type),null;case 22:case 23:return lr(h),GS(),c!==null&&te(Zl),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return Vo(gn),null;case 25:return null;default:return null}}function LD(c,h){switch(kS(h),h.tag){case 3:Vo(gn),it();break;case 26:case 27:case 5:en(h);break;case 4:it();break;case 31:h.memoizedState!==null&&lr(h);break;case 13:lr(h);break;case 19:te(cn);break;case 10:Vo(h.type);break;case 22:case 23:lr(h),GS(),c!==null&&te(Zl);break;case 24:Vo(gn)}}function hf(c,h){try{var p=h.updateQueue,A=p!==null?p.lastEffect:null;if(A!==null){var w=A.next;p=w;do{if((p.tag&c)===c){A=void 0;var x=p.create,I=p.inst;A=x(),I.destroy=A}p=p.next}while(p!==w)}}catch(O){kt(h,h.return,O)}}function za(c,h,p){try{var A=h.updateQueue,w=A!==null?A.lastEffect:null;if(w!==null){var x=w.next;A=x;do{if((A.tag&c)===c){var I=A.inst,O=I.destroy;if(O!==void 0){I.destroy=void 0,w=h;var W=p,ie=O;try{ie()}catch(ce){kt(w,W,ce)}}}A=A.next}while(A!==x)}}catch(ce){kt(h,h.return,ce)}}function UD(c){var h=c.updateQueue;if(h!==null){var p=c.stateNode;try{RM(h,p)}catch(A){kt(c,c.return,A)}}}function VD(c,h,p){p.props=rc(c.type,c.memoizedProps),p.state=c.memoizedState;try{p.componentWillUnmount()}catch(A){kt(c,h,A)}}function ff(c,h){try{var p=c.ref;if(p!==null){switch(c.tag){case 26:case 27:case 5:var A=c.stateNode;break;case 30:A=c.stateNode;break;default:A=c.stateNode}typeof p=="function"?c.refCleanup=p(A):p.current=A}}catch(w){kt(c,h,w)}}function Ws(c,h){var p=c.ref,A=c.refCleanup;if(p!==null)if(typeof A=="function")try{A()}catch(w){kt(c,h,w)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(w){kt(c,h,w)}else p.current=null}function FD(c){var h=c.type,p=c.memoizedProps,A=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":p.autoFocus&&A.focus();break e;case"img":p.src?A.src=p.src:p.srcSet&&(A.srcset=p.srcSet)}}catch(w){kt(c,c.return,w)}}function SC(c,h,p){try{var A=c.stateNode;iJ(A,c.type,p,h),A[li]=h}catch(w){kt(c,c.return,w)}}function HD(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ya(c.type)||c.tag===4}function CC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||HD(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ya(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function xC(c,h,p){var A=c.tag;if(A===5||A===6)c=c.stateNode,h?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(c,h):(h=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,h.appendChild(c),p=p._reactRootContainer,p!=null||h.onclick!==null||(h.onclick=Ir));else if(A!==4&&(A===27&&Ya(c.type)&&(p=c.stateNode,h=null),c=c.child,c!==null))for(xC(c,h,p),c=c.sibling;c!==null;)xC(c,h,p),c=c.sibling}function AA(c,h,p){var A=c.tag;if(A===5||A===6)c=c.stateNode,h?p.insertBefore(c,h):p.appendChild(c);else if(A!==4&&(A===27&&Ya(c.type)&&(p=c.stateNode),c=c.child,c!==null))for(AA(c,h,p),c=c.sibling;c!==null;)AA(c,h,p),c=c.sibling}function zD(c){var h=c.stateNode,p=c.memoizedProps;try{for(var A=c.type,w=h.attributes;w.length;)h.removeAttributeNode(w[0]);Xn(h,A,p),h[Tn]=c,h[li]=p}catch(x){kt(c,c.return,x)}}var Go=!1,yn=!1,EC=!1,QD=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function Bq(c,h){if(c=c.containerInfo,WC=UA,c=tM(c),yS(c)){if("selectionStart"in c)var p={start:c.selectionStart,end:c.selectionEnd};else e:{p=(p=c.ownerDocument)&&p.defaultView||window;var A=p.getSelection&&p.getSelection();if(A&&A.rangeCount!==0){p=A.anchorNode;var w=A.anchorOffset,x=A.focusNode;A=A.focusOffset;try{p.nodeType,x.nodeType}catch{p=null;break e}var I=0,O=-1,W=-1,ie=0,ce=0,he=c,ae=null;t:for(;;){for(var le;he!==p||w!==0&&he.nodeType!==3||(O=I+w),he!==x||A!==0&&he.nodeType!==3||(W=I+A),he.nodeType===3&&(I+=he.nodeValue.length),(le=he.firstChild)!==null;)ae=he,he=le;for(;;){if(he===c)break t;if(ae===p&&++ie===w&&(O=I),ae===x&&++ce===A&&(W=I),(le=he.nextSibling)!==null)break;he=ae,ae=he.parentNode}he=le}p=O===-1||W===-1?null:{start:O,end:W}}else p=null}p=p||{start:0,end:0}}else p=null;for(jC={focusedElem:c,selectionRange:p},UA=!1,Fn=h;Fn!==null;)if(h=Fn,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,Fn=c;else for(;Fn!==null;){switch(h=Fn,x=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(p=0;p title"))),Xn(x,A,p),x[Tn]=c,pn(x),A=x;break e;case"link":var I=YP("link","href",w).get(A+(p.href||""));if(I){for(var O=0;OPt&&(I=Pt,Pt=Qe,Qe=I);var ee=ZI(O,Qe),Y=ZI(O,Pt);if(ee&&Y&&(le.rangeCount!==1||le.anchorNode!==ee.node||le.anchorOffset!==ee.offset||le.focusNode!==Y.node||le.focusOffset!==Y.offset)){var ne=he.createRange();ne.setStart(ee.node,ee.offset),le.removeAllRanges(),Qe>Pt?(le.addRange(ne),le.extend(Y.node,Y.offset)):(ne.setEnd(Y.node,Y.offset),le.addRange(ne))}}}}for(he=[],le=O;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;Op?32:p,Q.T=null,p=DC,DC=null;var x=Wa,I=Yo;if(kn=0,Ou=Wa=null,Yo=0,(xt&6)!==0)throw Error(i(331));var O=xt;if(xt|=4,eP(x.current),JD(x,x.current,I,p),xt=O,vf(0,!1),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(jn,x)}catch{}return!0}finally{q.p=w,Q.T=A,yP(c,h)}}function bP(c,h,p){h=Pr(p,h),h=dC(c.stateNode,h,2),c=Va(c,h,2),c!==null&&(_a(c,2),js(c))}function kt(c,h,p){if(c.tag===3)bP(c,c,p);else for(;h!==null;){if(h.tag===3){bP(h,c,p);break}else if(h.tag===1){var A=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof A.componentDidCatch=="function"&&($a===null||!$a.has(A))){c=Pr(p,c),p=wD(2),A=Va(h,p,2),A!==null&&(SD(p,A,h,c),_a(A,2),js(A));break}}h=h.return}}function BC(c,h,p){var A=c.pingCache;if(A===null){A=c.pingCache=new Vq;var w=new Set;A.set(h,w)}else w=A.get(h),w===void 0&&(w=new Set,A.set(h,w));w.has(p)||(RC=!0,w.add(p),c=Gq.bind(null,c,h,p),h.then(c,c))}function Gq(c,h,p){var A=c.pingCache;A!==null&&A.delete(h),c.pingedLanes|=c.suspendedLanes&p,c.warmLanes&=~p,Nt===c&&(ht&p)===p&&(rn===4||rn===3&&(ht&62914560)===ht&&300>Kt()-bA?(xt&2)===0&&Bu(c,0):kC|=p,Nu===ht&&(Nu=0)),js(c)}function wP(c,h){h===0&&(h=Rm()),c=Kl(c,h),c!==null&&(_a(c,h),js(c))}function $q(c){var h=c.memoizedState,p=0;h!==null&&(p=h.retryLane),wP(c,p)}function Wq(c,h){var p=0;switch(c.tag){case 31:case 13:var A=c.stateNode,w=c.memoizedState;w!==null&&(p=w.retryLane);break;case 19:A=c.stateNode;break;case 22:A=c.stateNode._retryCache;break;default:throw Error(i(314))}A!==null&&A.delete(h),wP(c,p)}function jq(c,h){return os(c,h)}var TA=null,Uu=null,LC=!1,RA=!1,UC=!1,Ka=0;function js(c){c!==Uu&&c.next===null&&(Uu===null?TA=Uu=c:Uu=Uu.next=c),RA=!0,LC||(LC=!0,Yq())}function vf(c,h){if(!UC&&RA){UC=!0;do for(var p=!1,A=TA;A!==null;){if(c!==0){var w=A.pendingLanes;if(w===0)var x=0;else{var I=A.suspendedLanes,O=A.pingedLanes;x=(1<<31-Tt(42|c)+1)-1,x&=w&~(I&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(p=!0,EP(A,x))}else x=ht,x=tu(A,A===Nt?x:0,A.cancelPendingCommit!==null||A.timeoutHandle!==-1),(x&3)===0||Vl(A,x)||(p=!0,EP(A,x));A=A.next}while(p);UC=!1}}function Kq(){SP()}function SP(){RA=LC=!1;var c=0;Ka!==0&&sJ()&&(c=Ka);for(var h=Kt(),p=null,A=TA;A!==null;){var w=A.next,x=CP(A,h);x===0?(A.next=null,p===null?TA=w:p.next=w,w===null&&(Uu=p)):(p=A,(c!==0||(x&3)!==0)&&(RA=!0)),A=w}kn!==0&&kn!==5||vf(c),Ka!==0&&(Ka=0)}function CP(c,h){for(var p=c.suspendedLanes,A=c.pingedLanes,w=c.expirationTimes,x=c.pendingLanes&-62914561;0O)break;var ce=W.transferSize,he=W.initiatorType;ce&&PP(he)&&(W=W.responseEnd,I+=ce*(W"u"?null:document;function $P(c,h,p){var A=Vu;if(A&&typeof h=="string"&&h){var w=Fi(h);w='link[rel="'+c+'"][href="'+w+'"]',typeof p=="string"&&(w+='[crossorigin="'+p+'"]'),GP.has(w)||(GP.add(w),c={rel:c,crossOrigin:p,href:h},A.querySelector(w)===null&&(h=A.createElement("link"),Xn(h,"link",c),pn(h),A.head.appendChild(h)))}}function pJ(c){qo.D(c),$P("dns-prefetch",c,null)}function gJ(c,h){qo.C(c,h),$P("preconnect",c,h)}function mJ(c,h,p){qo.L(c,h,p);var A=Vu;if(A&&c&&h){var w='link[rel="preload"][as="'+Fi(h)+'"]';h==="image"&&p&&p.imageSrcSet?(w+='[imagesrcset="'+Fi(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(w+='[imagesizes="'+Fi(p.imageSizes)+'"]')):w+='[href="'+Fi(c)+'"]';var x=w;switch(h){case"style":x=Fu(c);break;case"script":x=Hu(c)}Vr.has(x)||(c=f({rel:"preload",href:h==="image"&&p&&p.imageSrcSet?void 0:c,as:h},p),Vr.set(x,c),A.querySelector(w)!==null||h==="style"&&A.querySelector(Cf(x))||h==="script"&&A.querySelector(xf(x))||(h=A.createElement("link"),Xn(h,"link",c),pn(h),A.head.appendChild(h)))}}function AJ(c,h){qo.m(c,h);var p=Vu;if(p&&c){var A=h&&typeof h.as=="string"?h.as:"script",w='link[rel="modulepreload"][as="'+Fi(A)+'"][href="'+Fi(c)+'"]',x=w;switch(A){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Hu(c)}if(!Vr.has(x)&&(c=f({rel:"modulepreload",href:c},h),Vr.set(x,c),p.querySelector(w)===null)){switch(A){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(xf(x)))return}A=p.createElement("link"),Xn(A,"link",c),pn(A),p.head.appendChild(A)}}}function yJ(c,h,p){qo.S(c,h,p);var A=Vu;if(A&&c){var w=ka(A).hoistableStyles,x=Fu(c);h=h||"default";var I=w.get(x);if(!I){var O={loading:0,preload:null};if(I=A.querySelector(Cf(x)))O.loading=5;else{c=f({rel:"stylesheet",href:c,"data-precedence":h},p),(p=Vr.get(x))&&ex(c,p);var W=I=A.createElement("link");pn(W),Xn(W,"link",c),W._p=new Promise(function(ie,ce){W.onload=ie,W.onerror=ce}),W.addEventListener("load",function(){O.loading|=1}),W.addEventListener("error",function(){O.loading|=2}),O.loading|=4,PA(I,h,A)}I={type:"stylesheet",instance:I,count:1,state:O},w.set(x,I)}}}function vJ(c,h){qo.X(c,h);var p=Vu;if(p&&c){var A=ka(p).hoistableScripts,w=Hu(c),x=A.get(w);x||(x=p.querySelector(xf(w)),x||(c=f({src:c,async:!0},h),(h=Vr.get(w))&&tx(c,h),x=p.createElement("script"),pn(x),Xn(x,"link",c),p.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},A.set(w,x))}}function bJ(c,h){qo.M(c,h);var p=Vu;if(p&&c){var A=ka(p).hoistableScripts,w=Hu(c),x=A.get(w);x||(x=p.querySelector(xf(w)),x||(c=f({src:c,async:!0,type:"module"},h),(h=Vr.get(w))&&tx(c,h),x=p.createElement("script"),pn(x),Xn(x,"link",c),p.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},A.set(w,x))}}function WP(c,h,p,A){var w=(w=Ce.current)?DA(w):null;if(!w)throw Error(i(446));switch(c){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(h=Fu(p.href),p=ka(w).hoistableStyles,A=p.get(h),A||(A={type:"style",instance:null,count:0,state:null},p.set(h,A)),A):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){c=Fu(p.href);var x=ka(w).hoistableStyles,I=x.get(c);if(I||(w=w.ownerDocument||w,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(c,I),(x=w.querySelector(Cf(c)))&&!x._p&&(I.instance=x,I.state.loading=5),Vr.has(c)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Vr.set(c,p),x||wJ(w,c,p,I.state))),h&&A===null)throw Error(i(528,""));return I}if(h&&A!==null)throw Error(i(529,""));return null;case"script":return h=p.async,p=p.src,typeof p=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Hu(p),p=ka(w).hoistableScripts,A=p.get(h),A||(A={type:"script",instance:null,count:0,state:null},p.set(h,A)),A):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,c))}}function Fu(c){return'href="'+Fi(c)+'"'}function Cf(c){return'link[rel="stylesheet"]['+c+"]"}function jP(c){return f({},c,{"data-precedence":c.precedence,precedence:null})}function wJ(c,h,p,A){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?A.loading=1:(h=c.createElement("link"),A.preload=h,h.addEventListener("load",function(){return A.loading|=1}),h.addEventListener("error",function(){return A.loading|=2}),Xn(h,"link",p),pn(h),c.head.appendChild(h))}function Hu(c){return'[src="'+Fi(c)+'"]'}function xf(c){return"script[async]"+c}function KP(c,h,p){if(h.count++,h.instance===null)switch(h.type){case"style":var A=c.querySelector('style[data-href~="'+Fi(p.href)+'"]');if(A)return h.instance=A,pn(A),A;var w=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return A=(c.ownerDocument||c).createElement("style"),pn(A),Xn(A,"style",w),PA(A,p.precedence,c),h.instance=A;case"stylesheet":w=Fu(p.href);var x=c.querySelector(Cf(w));if(x)return h.state.loading|=4,h.instance=x,pn(x),x;A=jP(p),(w=Vr.get(w))&&ex(A,w),x=(c.ownerDocument||c).createElement("link"),pn(x);var I=x;return I._p=new Promise(function(O,W){I.onload=O,I.onerror=W}),Xn(x,"link",A),h.state.loading|=4,PA(x,p.precedence,c),h.instance=x;case"script":return x=Hu(p.src),(w=c.querySelector(xf(x)))?(h.instance=w,pn(w),w):(A=p,(w=Vr.get(x))&&(A=f({},p),tx(A,w)),c=c.ownerDocument||c,w=c.createElement("script"),pn(w),Xn(w,"link",A),c.head.appendChild(w),h.instance=w);case"void":return null;default:throw Error(i(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(A=h.instance,h.state.loading|=4,PA(A,p.precedence,c));return h.instance}function PA(c,h,p){for(var A=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=A.length?A[A.length-1]:null,x=w,I=0;I title"):null)}function SJ(c,h,p){if(p===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;return h.rel==="stylesheet"?(c=h.disabled,typeof h.precedence=="string"&&c==null):!0;case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function JP(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function CJ(c,h,p,A){if(p.type==="stylesheet"&&(typeof A.media!="string"||matchMedia(A.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var w=Fu(A.href),x=h.querySelector(Cf(w));if(x){h=x._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=OA.bind(c),h.then(c,c)),p.state.loading|=4,p.instance=x,pn(x);return}x=h.ownerDocument||h,A=jP(A),(w=Vr.get(w))&&ex(A,w),x=x.createElement("link"),pn(x);var I=x;I._p=new Promise(function(O,W){I.onload=O,I.onerror=W}),Xn(x,"link",A),p.instance=x}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(p,h),(h=p.state.preload)&&(p.state.loading&3)===0&&(c.count++,p=OA.bind(c),h.addEventListener("load",p),h.addEventListener("error",p))}}var nx=0;function xJ(c,h){return c.stylesheets&&c.count===0&&LA(c,c.stylesheets),0nx?50:800)+h);return c.unsuspend=p,function(){c.unsuspend=null,clearTimeout(A),clearTimeout(w)}}:null}function OA(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)LA(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var BA=null;function LA(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,BA=new Map,h.forEach(EJ,c),BA=null,OA.call(c))}function EJ(c,h){if(!(h.state.loading&4)){var p=BA.get(c);if(p)var A=p.get(null);else{p=new Map,BA.set(c,p);for(var w=c.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),dx.exports=HJ(),dx.exports}var QJ=zJ();const GJ=t=>Array.from(t).map(n=>n.getModelContext()).sort((n,i)=>(i.priority??0)-(n.priority??0)).reduce((n,i)=>{if(i.system&&(n.system?n.system+=` +function Yge(e,t){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var _O=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eD={exports:{}},Y_={};var JJ;function Xge(){if(JJ)return Y_;JJ=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return Y_.Fragment=t,Y_.jsx=n,Y_.jsxs=n,Y_}var VJ;function Zge(){return VJ||(VJ=1,eD.exports=Xge()),eD.exports}var F=Zge(),tD={exports:{}},vt={};var HJ;function ebe(){if(HJ)return vt;HJ=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),d=Symbol.iterator;function f(X){return X===null||typeof X!="object"?null:(X=d&&X[d]||X["@@iterator"],typeof X=="function"?X:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(X,ce,W){this.props=X,this.context=ce,this.refs=g,this.updater=W||h}y.prototype.isReactComponent={},y.prototype.setState=function(X,ce){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,ce,"setState")},y.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function _(){}_.prototype=y.prototype;function S(X,ce,W){this.props=X,this.context=ce,this.refs=g,this.updater=W||h}var w=S.prototype=new _;w.constructor=S,m(w,y.prototype),w.isPureReactComponent=!0;var R=Array.isArray;function E(){}var T={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function B(X,ce,W){var _e=W.ref;return{$$typeof:e,type:X,key:ce,ref:_e!==void 0?_e:null,props:W}}function N(X,ce){return B(X.type,ce,X.props)}function L(X){return typeof X=="object"&&X!==null&&X.$$typeof===e}function q(X){var ce={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(W){return ce[W]})}var I=/\/+/g;function U(X,ce){return typeof X=="object"&&X!==null&&X.key!=null?q(""+X.key):ce.toString(36)}function J(X){switch(X.status){case"fulfilled":return X.value;case"rejected":throw X.reason;default:switch(typeof X.status=="string"?X.then(E,E):(X.status="pending",X.then(function(ce){X.status==="pending"&&(X.status="fulfilled",X.value=ce)},function(ce){X.status==="pending"&&(X.status="rejected",X.reason=ce)})),X.status){case"fulfilled":return X.value;case"rejected":throw X.reason}}throw X}function V(X,ce,W,_e,Ne){var Ie=typeof X;(Ie==="undefined"||Ie==="boolean")&&(X=null);var Me=!1;if(X===null)Me=!0;else switch(Ie){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(X.$$typeof){case e:case t:Me=!0;break;case u:return Me=X._init,V(Me(X._payload),ce,W,_e,Ne)}}if(Me)return Ne=Ne(X),Me=_e===""?"."+U(X,0):_e,R(Ne)?(W="",Me!=null&&(W=Me.replace(I,"$&/")+"/"),V(Ne,ce,W,"",function(Pt){return Pt})):Ne!=null&&(L(Ne)&&(Ne=N(Ne,W+(Ne.key==null||X&&X.key===Ne.key?"":(""+Ne.key).replace(I,"$&/")+"/")+Me)),ce.push(Ne)),1;Me=0;var Ye=_e===""?".":_e+":";if(R(X))for(var ct=0;ct>>1,K=V[le];if(0>>1;ler(W,Q))_er(Ne,W)?(V[le]=Ne,V[_e]=Q,le=_e):(V[le]=W,V[ce]=Q,le=ce);else if(_er(Ne,Q))V[le]=Ne,V[_e]=Q,le=_e;else break e}}return G}function r(V,G){var Q=V.sortIndex-G.sortIndex;return Q!==0?Q:V.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],p=[],u=1,l=null,d=3,f=!1,h=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function w(V){for(var G=n(p);G!==null;){if(G.callback===null)o(p);else if(G.startTime<=V)o(p),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(p)}}function R(V){if(m=!1,w(V),!h)if(n(c)!==null)h=!0,E||(E=!0,q());else{var G=n(p);G!==null&&J(R,G.startTime-V)}}var E=!1,T=-1,D=5,B=-1;function N(){return g?!0:!(e.unstable_now()-BV&&N());){var le=l.callback;if(typeof le=="function"){l.callback=null,d=l.priorityLevel;var K=le(l.expirationTime<=V);if(V=e.unstable_now(),typeof K=="function"){l.callback=K,w(V),G=!0;break t}l===n(c)&&o(c),w(V)}else o(c);l=n(c)}if(l!==null)G=!0;else{var X=n(p);X!==null&&J(R,X.startTime-V),G=!1}}break e}finally{l=null,d=Q,f=!1}G=void 0}}finally{G?q():E=!1}}}var q;if(typeof S=="function")q=function(){S(L)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,U=I.port2;I.port1.onmessage=L,q=function(){U.postMessage(null)}}else q=function(){y(L,0)};function J(V,G){T=y(function(){V(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125le?(V.sortIndex=Q,t(p,V),n(c)===null&&V===n(p)&&(m?(_(T),T=-1):m=!0,J(R,Q-le))):(V.sortIndex=K,t(c,V),h||f||(h=!0,E||(E=!0,q()))),V},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(V){var G=d;return function(){var Q=d;d=G;try{return V.apply(this,arguments)}finally{d=Q}}}})(oD)),oD}var KJ;function nbe(){return KJ||(KJ=1,rD.exports=tbe()),rD.exports}var iD={exports:{}},Wr={};var QJ;function rbe(){if(QJ)return Wr;QJ=1;var e=pF();function t(c){var p="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),iD.exports=rbe(),iD.exports}var WJ;function obe(){if(WJ)return X_;WJ=1;var e=nbe(),t=pF(),n=TZ();function o(b){var A="https://react.dev/errors/"+b;if(1K||(b.current=le[K],le[K]=null,K--)}function W(b,A){K++,le[K]=b.current,b.current=A}var _e=X(null),Ne=X(null),Ie=X(null),Me=X(null);function Ye(b,A){switch(W(Ie,A),W(Ne,b),W(_e,null),A.nodeType){case 9:case 11:b=(b=A.documentElement)&&(b=b.namespaceURI)?dJ(b):0;break;default:if(b=A.tagName,A=A.namespaceURI)A=dJ(A),b=fJ(A,b);else switch(b){case"svg":b=1;break;case"math":b=2;break;default:b=0}}ce(_e),W(_e,b)}function ct(){ce(_e),ce(Ne),ce(Ie)}function Pt(b){b.memoizedState!==null&&W(Me,b);var A=_e.current,v=fJ(A,b.type);A!==v&&(W(Ne,b),W(_e,v))}function tn(b){Ne.current===b&&(ce(_e),ce(Ne)),Me.current===b&&(ce(Me),K_._currentValue=Q)}var Mt,kn;function un(b){if(Mt===void 0)try{throw Error()}catch(v){var A=v.stack.trim().match(/\n( *(at )?)/);Mt=A&&A[1]||"",kn=-1)":-1P||se[C]!==pe[P]){var ve=` +`+se[C].replace(" at new "," at ");return b.displayName&&ve.includes("")&&(ve=ve.replace("",b.displayName)),ve}while(1<=C&&0<=P);break}}}finally{zr=!1,Error.prepareStackTrace=v}return(v=b?b.displayName||b.name:"")?un(v):""}function Ho(b,A){switch(b.tag){case 26:case 27:case 5:return un(b.type);case 16:return un("Lazy");case 13:return b.child!==A&&A!==null?un("Suspense Fallback"):un("Suspense");case 19:return un("SuspenseList");case 0:case 15:return Pr(b.type,!1);case 11:return Pr(b.type.render,!1);case 1:return Pr(b.type,!0);case 31:return un("Activity");default:return""}}function Ir(b){try{var A="",v=null;do A+=Ho(b,v),v=b,b=b.return;while(b);return A}catch(C){return` +Error generating stack: `+C.message+` +`+C.stack}}var To=Object.prototype.hasOwnProperty,Kr=e.unstable_scheduleCallback,jr=e.unstable_cancelCallback,Go=e.unstable_shouldYield,bi=e.unstable_requestPaint,Xt=e.unstable_now,Zi=e.unstable_getCurrentPriorityLevel,Ae=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,ot=e.unstable_NormalPriority,dt=e.unstable_LowPriority,Ct=e.unstable_IdlePriority,On=e.log,Dr=e.unstable_setDisableYieldValue,Mn=null,cn=null;function zn(b){if(typeof On=="function"&&Dr(b),cn&&typeof cn.setStrictMode=="function")try{cn.setStrictMode(Mn,b)}catch{}}var qt=Math.clz32?Math.clz32:vp,Sr=Math.log,Kn=Math.LN2;function vp(b){return b>>>=0,b===0?32:31-(Sr(b)/Kn|0)|0}var it=256,Fs=262144,zo=4194304;function yi(b){var A=b&42;if(A!==0)return A;switch(b&-b){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return b&261888;case 262144:case 524288:case 1048576:case 2097152:return b&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return b&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return b}}function Sp(b,A,v){var C=b.pendingLanes;if(C===0)return 0;var P=0,j=b.suspendedLanes,H=b.pingedLanes;b=b.warmLanes;var $=C&134217727;return $!==0?(C=$&~j,C!==0?P=yi(C):(H&=$,H!==0?P=yi(H):v||(v=$&~b,v!==0&&(P=yi(v))))):($=C&~j,$!==0?P=yi($):H!==0?P=yi(H):v||(v=C&~b,v!==0&&(P=yi(v)))),P===0?0:A!==0&&A!==P&&(A&j)===0&&(j=P&-P,v=A&-A,j>=v||j===32&&(v&4194048)!==0)?A:P}function Gl(b,A){return(b.pendingLanes&~(b.suspendedLanes&~b.pingedLanes)&A)===0}function bb(b,A){switch(b){case 1:case 2:case 4:case 8:case 64:return A+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return A+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yb(){var b=zo;return zo<<=1,(zo&62914560)===0&&(zo=4194304),b}function Cp(b){for(var A=[],v=0;31>v;v++)A.push(b);return A}function xs(b,A){b.pendingLanes|=A,A!==268435456&&(b.suspendedLanes=0,b.pingedLanes=0,b.warmLanes=0)}function es(b,A,v,C,P,j){var H=b.pendingLanes;b.pendingLanes=v,b.suspendedLanes=0,b.pingedLanes=0,b.warmLanes=0,b.expiredLanes&=v,b.entangledLanes&=v,b.errorRecoveryDisabledLanes&=v,b.shellSuspendCounter=0;var $=b.entanglements,se=b.expirationTimes,pe=b.hiddenUpdates;for(v=H&~v;0"u")return null;try{return b.activeElement||b.body}catch{return b.body}}var Qr=/[\n"\\]/g;function Nr(b){return b.replace(Qr,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Ql(b,A,v,C,P,j,H,$){b.name="",H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?b.type=H:b.removeAttribute("type"),A!=null?H==="number"?(A===0&&b.value===""||b.value!=A)&&(b.value=""+ie(A)):b.value!==""+ie(A)&&(b.value=""+ie(A)):H!=="submit"&&H!=="reset"||b.removeAttribute("value"),A!=null?l_(b,H,ie(A)):v!=null?l_(b,H,ie(v)):C!=null&&b.removeAttribute("value"),P==null&&j!=null&&(b.defaultChecked=!!j),P!=null&&(b.checked=P&&typeof P!="function"&&typeof P!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?b.name=""+ie($):b.removeAttribute("name")}function a_(b,A,v,C,P,j,H,$){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(b.type=j),A!=null||v!=null){if(!(j!=="submit"&&j!=="reset"||A!=null)){Xe(b);return}v=v!=null?""+ie(v):"",A=A!=null?""+ie(A):v,$||A===b.value||(b.value=A),b.defaultValue=A}C=C??P,C=typeof C!="function"&&typeof C!="symbol"&&!!C,b.checked=$?b.checked:!!C,b.defaultChecked=!!C,H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"&&(b.name=H),Xe(b)}function l_(b,A,v){A==="number"&&wt(b.ownerDocument)===b||b.defaultValue===""+v||(b.defaultValue=""+v)}function Op(b,A,v,C){if(b=b.options,A){A={};for(var P=0;P"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d_=!1;if(Ci)try{var Us={};Object.defineProperty(Us,"passive",{get:function(){d_=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{d_=!1}var qs=null,Vm=null,Mb=null;function gw(){if(Mb)return Mb;var b,A=Vm,v=A.length,C,P="value"in qs?qs.value:qs.textContent,j=P.length;for(b=0;b=p_),yU=" ",AU=!1;function _U(b,A){switch(b){case"keyup":return Ame.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vU(b){return b=b.detail,typeof b=="object"&&"data"in b?b.data:null}var jb=!1;function vme(b,A){switch(b){case"compositionend":return vU(A);case"keypress":return A.which!==32?null:(AU=!0,yU);case"textInput":return b=A.data,b===yU&&AU?null:b;default:return null}}function Sme(b,A){if(jb)return b==="compositionend"||!sI&&_U(b,A)?(b=gw(),Mb=Vm=qs=null,jb=!1,b):null;switch(b){case"paste":return null;case"keypress":if(!(A.ctrlKey||A.altKey||A.metaKey)||A.ctrlKey&&A.altKey){if(A.char&&1=A)return{node:v,offset:A-b};b=C}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=MU(v)}}function IU(b,A){return b&&A?b===A?!0:b&&b.nodeType===3?!1:A&&A.nodeType===3?IU(b,A.parentNode):"contains"in b?b.contains(A):b.compareDocumentPosition?!!(b.compareDocumentPosition(A)&16):!1:!1}function jU(b){b=b!=null&&b.ownerDocument!=null&&b.ownerDocument.defaultView!=null?b.ownerDocument.defaultView:window;for(var A=wt(b.document);A instanceof b.HTMLIFrameElement;){try{var v=typeof A.contentWindow.location.href=="string"}catch{v=!1}if(v)b=A.contentWindow;else break;A=wt(b.document)}return A}function uI(b){var A=b&&b.nodeName&&b.nodeName.toLowerCase();return A&&(A==="input"&&(b.type==="text"||b.type==="search"||b.type==="tel"||b.type==="url"||b.type==="password")||A==="textarea"||b.contentEditable==="true")}var Pme=Ci&&"documentMode"in document&&11>=document.documentMode,Db=null,cI=null,y_=null,dI=!1;function DU(b,A,v){var C=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;dI||Db==null||Db!==wt(C)||(C=Db,"selectionStart"in C&&uI(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),y_&&b_(y_,C)||(y_=C,C=iO(cI,"onSelect"),0>=H,P-=H,Vs=1<<32-qt(A)+P|v<Tt?(Ut=rt,rt=null):Ut=rt.sibling;var Kt=be(de,rt,he[Tt],Se);if(Kt===null){rt===null&&(rt=Ut);break}b&&rt&&Kt.alternate===null&&A(de,rt),ue=j(Kt,ue,Tt),zt===null?st=Kt:zt.sibling=Kt,zt=Kt,rt=Ut}if(Tt===he.length)return v(de,rt),Jt&&eu(de,Tt),st;if(rt===null){for(;TtTt?(Ut=rt,rt=null):Ut=rt.sibling;var $p=be(de,rt,Kt.value,Se);if($p===null){rt===null&&(rt=Ut);break}b&&rt&&$p.alternate===null&&A(de,rt),ue=j($p,ue,Tt),zt===null?st=$p:zt.sibling=$p,zt=$p,rt=Ut}if(Kt.done)return v(de,rt),Jt&&eu(de,Tt),st;if(rt===null){for(;!Kt.done;Tt++,Kt=he.next())Kt=we(de,Kt.value,Se),Kt!==null&&(ue=j(Kt,ue,Tt),zt===null?st=Kt:zt.sibling=Kt,zt=Kt);return Jt&&eu(de,Tt),st}for(rt=C(rt);!Kt.done;Tt++,Kt=he.next())Kt=ye(rt,de,Tt,Kt.value,Se),Kt!==null&&(b&&Kt.alternate!==null&&rt.delete(Kt.key===null?Tt:Kt.key),ue=j(Kt,ue,Tt),zt===null?st=Kt:zt.sibling=Kt,zt=Kt);return b&&rt.forEach(function(Wge){return A(de,Wge)}),Jt&&eu(de,Tt),st}function ln(de,ue,he,Se){if(typeof he=="object"&&he!==null&&he.type===m&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case f:e:{for(var st=he.key;ue!==null;){if(ue.key===st){if(st=he.type,st===m){if(ue.tag===7){v(de,ue.sibling),Se=P(ue,he.props.children),Se.return=de,de=Se;break e}}else if(ue.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===D&&Zm(st)===ue.type){v(de,ue.sibling),Se=P(ue,he.props),w_(Se,he),Se.return=de,de=Se;break e}v(de,ue);break}else A(de,ue);ue=ue.sibling}he.type===m?(Se=Qm(he.props.children,de.mode,Se,he.key),Se.return=de,de=Se):(Se=Sw(he.type,he.key,he.props,null,de.mode,Se),w_(Se,he),Se.return=de,de=Se)}return H(de);case h:e:{for(st=he.key;ue!==null;){if(ue.key===st)if(ue.tag===4&&ue.stateNode.containerInfo===he.containerInfo&&ue.stateNode.implementation===he.implementation){v(de,ue.sibling),Se=P(ue,he.children||[]),Se.return=de,de=Se;break e}else{v(de,ue);break}else A(de,ue);ue=ue.sibling}Se=yI(he,de.mode,Se),Se.return=de,de=Se}return H(de);case D:return he=Zm(he),ln(de,ue,he,Se)}if(J(he))return Ze(de,ue,he,Se);if(q(he)){if(st=q(he),typeof st!="function")throw Error(o(150));return he=st.call(he),ht(de,ue,he,Se)}if(typeof he.then=="function")return ln(de,ue,Mw(he),Se);if(he.$$typeof===S)return ln(de,ue,Ow(de,he),Se);Pw(de,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,ue!==null&&ue.tag===6?(v(de,ue.sibling),Se=P(ue,he),Se.return=de,de=Se):(v(de,ue),Se=bI(he,de.mode,Se),Se.return=de,de=Se),H(de)):v(de,ue)}return function(de,ue,he,Se){try{C_=0;var st=ln(de,ue,he,Se);return Hb=null,st}catch(rt){if(rt===Vb||rt===Rw)throw rt;var zt=$o(29,rt,null,de.mode);return zt.lanes=Se,zt.return=de,zt}}}var tg=nq(!0),rq=nq(!1),jp=!1;function PI(b){b.updateQueue={baseState:b.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function II(b,A){b=b.updateQueue,A.updateQueue===b&&(A.updateQueue={baseState:b.baseState,firstBaseUpdate:b.firstBaseUpdate,lastBaseUpdate:b.lastBaseUpdate,shared:b.shared,callbacks:null})}function Dp(b){return{lane:b,tag:0,payload:null,callback:null,next:null}}function Np(b,A,v){var C=b.updateQueue;if(C===null)return null;if(C=C.shared,(Yt&2)!==0){var P=C.pending;return P===null?A.next=A:(A.next=P.next,P.next=A),C.pending=A,A=vw(b),UU(b,null,v),A}return _w(b,C,A,v),vw(b)}function O_(b,A,v){if(A=A.updateQueue,A!==null&&(A=A.shared,(v&4194048)!==0)){var C=A.lanes;C&=b.pendingLanes,v|=C,A.lanes=v,_b(b,v)}}function jI(b,A){var v=b.updateQueue,C=b.alternate;if(C!==null&&(C=C.updateQueue,v===C)){var P=null,j=null;if(v=v.firstBaseUpdate,v!==null){do{var H={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};j===null?P=j=H:j=j.next=H,v=v.next}while(v!==null);j===null?P=j=A:j=j.next=A}else P=j=A;v={baseState:C.baseState,firstBaseUpdate:P,lastBaseUpdate:j,shared:C.shared,callbacks:C.callbacks},b.updateQueue=v;return}b=v.lastBaseUpdate,b===null?v.firstBaseUpdate=A:b.next=A,v.lastBaseUpdate=A}var DI=!1;function T_(){if(DI){var b=Jb;if(b!==null)throw b}}function R_(b,A,v,C){DI=!1;var P=b.updateQueue;jp=!1;var j=P.firstBaseUpdate,H=P.lastBaseUpdate,$=P.shared.pending;if($!==null){P.shared.pending=null;var se=$,pe=se.next;se.next=null,H===null?j=pe:H.next=pe,H=se;var ve=b.alternate;ve!==null&&(ve=ve.updateQueue,$=ve.lastBaseUpdate,$!==H&&($===null?ve.firstBaseUpdate=pe:$.next=pe,ve.lastBaseUpdate=se))}if(j!==null){var we=P.baseState;H=0,ve=pe=se=null,$=j;do{var be=$.lane&-536870913,ye=be!==$.lane;if(ye?(kt&be)===be:(C&be)===be){be!==0&&be===qb&&(DI=!0),ve!==null&&(ve=ve.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ze=b,ht=$;be=A;var ln=v;switch(ht.tag){case 1:if(Ze=ht.payload,typeof Ze=="function"){we=Ze.call(ln,we,be);break e}we=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=ht.payload,be=typeof Ze=="function"?Ze.call(ln,we,be):Ze,be==null)break e;we=l({},we,be);break e;case 2:jp=!0}}be=$.callback,be!==null&&(b.flags|=64,ye&&(b.flags|=8192),ye=P.callbacks,ye===null?P.callbacks=[be]:ye.push(be))}else ye={lane:be,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ve===null?(pe=ve=ye,se=we):ve=ve.next=ye,H|=be;if($=$.next,$===null){if($=P.shared.pending,$===null)break;ye=$,$=ye.next,ye.next=null,P.lastBaseUpdate=ye,P.shared.pending=null}}while(!0);ve===null&&(se=we),P.baseState=se,P.firstBaseUpdate=pe,P.lastBaseUpdate=ve,j===null&&(P.shared.lanes=0),kp|=H,b.lanes=H,b.memoizedState=we}}function oq(b,A){if(typeof b!="function")throw Error(o(191,b));b.call(A)}function iq(b,A){var v=b.callbacks;if(v!==null)for(b.callbacks=null,b=0;bj?j:8;var H=V.T,$={};V.T=$,XI(b,!1,A,v);try{var se=P(),pe=V.S;if(pe!==null&&pe($,se),se!==null&&typeof se=="object"&&typeof se.then=="function"){var ve=kme(se,C);P_(b,A,ve,ei(b))}else P_(b,A,C,ei(b))}catch(we){P_(b,A,{then:function(){},status:"rejected",reason:we},ei())}finally{G.p=j,H!==null&&$.types!==null&&(H.types=$.types),V.T=H}}function Gme(){}function WI(b,A,v,C){if(b.tag!==5)throw Error(o(476));var P=xq(b).queue;Fq(b,P,A,Q,v===null?Gme:function(){return Bq(b),v(C)})}function xq(b){var A=b.memoizedState;if(A!==null)return A;A={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ou,lastRenderedState:Q},next:null};var v={};return A.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ou,lastRenderedState:v},next:null},b.memoizedState=A,b=b.alternate,b!==null&&(b.memoizedState=A),A}function Bq(b){var A=xq(b);A.next===null&&(A=b.alternate.memoizedState),P_(b,A.next.queue,{},ei())}function YI(){return Fr(K_)}function kq(){return Jn().memoizedState}function Uq(){return Jn().memoizedState}function zme(b){for(var A=b.return;A!==null;){switch(A.tag){case 24:case 3:var v=ei();b=Dp(v);var C=Np(A,b,v);C!==null&&(jo(C,A,v),O_(C,A,v)),A={cache:TI()},b.payload=A;return}A=A.return}}function Kme(b,A,v){var C=ei();v={lane:C,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Uw(b)?Jq(A,v):(v=mI(b,A,v,C),v!==null&&(jo(v,b,C),Vq(v,A,C)))}function qq(b,A,v){var C=ei();P_(b,A,v,C)}function P_(b,A,v,C){var P={lane:C,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(Uw(b))Jq(A,P);else{var j=b.alternate;if(b.lanes===0&&(j===null||j.lanes===0)&&(j=A.lastRenderedReducer,j!==null))try{var H=A.lastRenderedState,$=j(H,v);if(P.hasEagerState=!0,P.eagerState=$,Qo($,H))return _w(b,A,P,0),dn===null&&Aw(),!1}catch{}if(v=mI(b,A,P,C),v!==null)return jo(v,b,C),Vq(v,A,C),!0}return!1}function XI(b,A,v,C){if(C={lane:2,revertLane:Pj(),gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},Uw(b)){if(A)throw Error(o(479))}else A=mI(b,v,C,2),A!==null&&jo(A,b,2)}function Uw(b){var A=b.alternate;return b===Ot||A!==null&&A===Ot}function Jq(b,A){zb=Dw=!0;var v=b.pending;v===null?A.next=A:(A.next=v.next,v.next=A),b.pending=A}function Vq(b,A,v){if((v&4194048)!==0){var C=A.lanes;C&=b.pendingLanes,v|=C,A.lanes=v,_b(b,v)}}var I_={readContext:Fr,use:Fw,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};I_.useEffectEvent=Dn;var Hq={readContext:Fr,use:Fw,useCallback:function(b,A){return uo().memoizedState=[b,A===void 0?null:A],b},useContext:Fr,useEffect:Rq,useImperativeHandle:function(b,A,v){v=v!=null?v.concat([b]):null,Bw(4194308,4,Iq.bind(null,A,b),v)},useLayoutEffect:function(b,A){return Bw(4194308,4,b,A)},useInsertionEffect:function(b,A){Bw(4,2,b,A)},useMemo:function(b,A){var v=uo();A=A===void 0?null:A;var C=b();if(ng){zn(!0);try{b()}finally{zn(!1)}}return v.memoizedState=[C,A],C},useReducer:function(b,A,v){var C=uo();if(v!==void 0){var P=v(A);if(ng){zn(!0);try{v(A)}finally{zn(!1)}}}else P=A;return C.memoizedState=C.baseState=P,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:b,lastRenderedState:P},C.queue=b,b=b.dispatch=Kme.bind(null,Ot,b),[C.memoizedState,b]},useRef:function(b){var A=uo();return b={current:b},A.memoizedState=b},useState:function(b){b=GI(b);var A=b.queue,v=qq.bind(null,Ot,A);return A.dispatch=v,[b.memoizedState,v]},useDebugValue:QI,useDeferredValue:function(b,A){var v=uo();return $I(v,b,A)},useTransition:function(){var b=GI(!1);return b=Fq.bind(null,Ot,b.queue,!0,!1),uo().memoizedState=b,[!1,b]},useSyncExternalStore:function(b,A,v){var C=Ot,P=uo();if(Jt){if(v===void 0)throw Error(o(407));v=v()}else{if(v=A(),dn===null)throw Error(o(349));(kt&127)!==0||dq(C,A,v)}P.memoizedState=v;var j={value:v,getSnapshot:A};return P.queue=j,Rq(hq.bind(null,C,j,b),[b]),C.flags|=2048,Qb(9,{destroy:void 0},fq.bind(null,C,j,v,A),null),v},useId:function(){var b=uo(),A=dn.identifierPrefix;if(Jt){var v=Hs,C=Vs;v=(C&~(1<<32-qt(C)-1)).toString(32)+v,A="_"+A+"R_"+v,v=Nw++,0<\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof C.is=="string"?H.createElement("select",{is:C.is}):H.createElement("select"),C.multiple?j.multiple=!0:C.size&&(j.size=C.size);break;default:j=typeof C.is=="string"?H.createElement(P,{is:C.is}):H.createElement(P)}}j[Un]=A,j[Cr]=C;e:for(H=A.child;H!==null;){if(H.tag===5||H.tag===6)j.appendChild(H.stateNode);else if(H.tag!==4&&H.tag!==27&&H.child!==null){H.child.return=H,H=H.child;continue}if(H===A)break e;for(;H.sibling===null;){if(H.return===null||H.return===A)break e;H=H.return}H.sibling.return=H.return,H=H.sibling}A.stateNode=j;e:switch(Br(j,P,C),P){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}C&&su(A)}}return vn(A),fj(A,A.type,b===null?null:b.memoizedProps,A.pendingProps,v),null;case 6:if(b&&A.stateNode!=null)b.memoizedProps!==C&&su(A);else{if(typeof C!="string"&&A.stateNode===null)throw Error(o(166));if(b=Ie.current,kb(A)){if(b=A.stateNode,v=A.memoizedProps,C=null,P=Lr,P!==null)switch(P.tag){case 27:case 5:C=P.memoizedProps}b[Un]=A,b=!!(b.nodeValue===v||C!==null&&C.suppressHydrationWarning===!0||uJ(b.nodeValue,v)),b||Pp(A,!0)}else b=sO(b).createTextNode(C),b[Un]=A,A.stateNode=b}return vn(A),null;case 31:if(v=A.memoizedState,b===null||b.memoizedState!==null){if(C=kb(A),v!==null){if(b===null){if(!C)throw Error(o(318));if(b=A.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(o(557));b[Un]=A}else $m(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;vn(A),b=!1}else v=SI(),b!==null&&b.memoizedState!==null&&(b.memoizedState.hydrationErrors=v),b=!0;if(!b)return A.flags&256?(Yo(A),A):(Yo(A),null);if((A.flags&128)!==0)throw Error(o(558))}return vn(A),null;case 13:if(C=A.memoizedState,b===null||b.memoizedState!==null&&b.memoizedState.dehydrated!==null){if(P=kb(A),C!==null&&C.dehydrated!==null){if(b===null){if(!P)throw Error(o(318));if(P=A.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(o(317));P[Un]=A}else $m(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;vn(A),P=!1}else P=SI(),b!==null&&b.memoizedState!==null&&(b.memoizedState.hydrationErrors=P),P=!0;if(!P)return A.flags&256?(Yo(A),A):(Yo(A),null)}return Yo(A),(A.flags&128)!==0?(A.lanes=v,A):(v=C!==null,b=b!==null&&b.memoizedState!==null,v&&(C=A.child,P=null,C.alternate!==null&&C.alternate.memoizedState!==null&&C.alternate.memoizedState.cachePool!==null&&(P=C.alternate.memoizedState.cachePool.pool),j=null,C.memoizedState!==null&&C.memoizedState.cachePool!==null&&(j=C.memoizedState.cachePool.pool),j!==P&&(C.flags|=2048)),v!==b&&v&&(A.child.flags|=8192),Gw(A,A.updateQueue),vn(A),null);case 4:return ct(),b===null&&Nj(A.stateNode.containerInfo),vn(A),null;case 10:return nu(A.type),vn(A),null;case 19:if(ce(qn),C=A.memoizedState,C===null)return vn(A),null;if(P=(A.flags&128)!==0,j=C.rendering,j===null)if(P)D_(C,!1);else{if(Nn!==0||b!==null&&(b.flags&128)!==0)for(b=A.child;b!==null;){if(j=jw(b),j!==null){for(A.flags|=128,D_(C,!1),b=j.updateQueue,A.updateQueue=b,Gw(A,b),A.subtreeFlags=0,b=v,v=A.child;v!==null;)qU(v,b),v=v.sibling;return W(qn,qn.current&1|2),Jt&&eu(A,C.treeForkCount),A.child}b=b.sibling}C.tail!==null&&Xt()>Ww&&(A.flags|=128,P=!0,D_(C,!1),A.lanes=4194304)}else{if(!P)if(b=jw(j),b!==null){if(A.flags|=128,P=!0,b=b.updateQueue,A.updateQueue=b,Gw(A,b),D_(C,!0),C.tail===null&&C.tailMode==="hidden"&&!j.alternate&&!Jt)return vn(A),null}else 2*Xt()-C.renderingStartTime>Ww&&v!==536870912&&(A.flags|=128,P=!0,D_(C,!1),A.lanes=4194304);C.isBackwards?(j.sibling=A.child,A.child=j):(b=C.last,b!==null?b.sibling=j:A.child=j,C.last=j)}return C.tail!==null?(b=C.tail,C.rendering=b,C.tail=b.sibling,C.renderingStartTime=Xt(),b.sibling=null,v=qn.current,W(qn,P?v&1|2:v&1),Jt&&eu(A,C.treeForkCount),b):(vn(A),null);case 22:case 23:return Yo(A),LI(),C=A.memoizedState!==null,b!==null?b.memoizedState!==null!==C&&(A.flags|=8192):C&&(A.flags|=8192),C?(v&536870912)!==0&&(A.flags&128)===0&&(vn(A),A.subtreeFlags&6&&(A.flags|=8192)):vn(A),v=A.updateQueue,v!==null&&Gw(A,v.retryQueue),v=null,b!==null&&b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(v=b.memoizedState.cachePool.pool),C=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(C=A.memoizedState.cachePool.pool),C!==v&&(A.flags|=2048),b!==null&&ce(Xm),null;case 24:return v=null,b!==null&&(v=b.memoizedState.cache),A.memoizedState.cache!==v&&(A.flags|=2048),nu(Qn),vn(A),null;case 25:return null;case 30:return null}throw Error(o(156,A.tag))}function Xme(b,A){switch(_I(A),A.tag){case 1:return b=A.flags,b&65536?(A.flags=b&-65537|128,A):null;case 3:return nu(Qn),ct(),b=A.flags,(b&65536)!==0&&(b&128)===0?(A.flags=b&-65537|128,A):null;case 26:case 27:case 5:return tn(A),null;case 31:if(A.memoizedState!==null){if(Yo(A),A.alternate===null)throw Error(o(340));$m()}return b=A.flags,b&65536?(A.flags=b&-65537|128,A):null;case 13:if(Yo(A),b=A.memoizedState,b!==null&&b.dehydrated!==null){if(A.alternate===null)throw Error(o(340));$m()}return b=A.flags,b&65536?(A.flags=b&-65537|128,A):null;case 19:return ce(qn),null;case 4:return ct(),null;case 10:return nu(A.type),null;case 22:case 23:return Yo(A),LI(),b!==null&&ce(Xm),b=A.flags,b&65536?(A.flags=b&-65537|128,A):null;case 24:return nu(Qn),null;case 25:return null;default:return null}}function p4(b,A){switch(_I(A),A.tag){case 3:nu(Qn),ct();break;case 26:case 27:case 5:tn(A);break;case 4:ct();break;case 31:A.memoizedState!==null&&Yo(A);break;case 13:Yo(A);break;case 19:ce(qn);break;case 10:nu(A.type);break;case 22:case 23:Yo(A),LI(),b!==null&&ce(Xm);break;case 24:nu(Qn)}}function N_(b,A){try{var v=A.updateQueue,C=v!==null?v.lastEffect:null;if(C!==null){var P=C.next;v=P;do{if((v.tag&b)===b){C=void 0;var j=v.create,H=v.inst;C=j(),H.destroy=C}v=v.next}while(v!==P)}}catch($){rn(A,A.return,$)}}function xp(b,A,v){try{var C=A.updateQueue,P=C!==null?C.lastEffect:null;if(P!==null){var j=P.next;C=j;do{if((C.tag&b)===b){var H=C.inst,$=H.destroy;if($!==void 0){H.destroy=void 0,P=A;var se=v,pe=$;try{pe()}catch(ve){rn(P,se,ve)}}}C=C.next}while(C!==j)}}catch(ve){rn(A,A.return,ve)}}function m4(b){var A=b.updateQueue;if(A!==null){var v=b.stateNode;try{iq(A,v)}catch(C){rn(b,b.return,C)}}}function g4(b,A,v){v.props=rg(b.type,b.memoizedProps),v.state=b.memoizedState;try{v.componentWillUnmount()}catch(C){rn(b,A,C)}}function L_(b,A){try{var v=b.ref;if(v!==null){switch(b.tag){case 26:case 27:case 5:var C=b.stateNode;break;case 30:C=b.stateNode;break;default:C=b.stateNode}typeof v=="function"?b.refCleanup=v(C):v.current=C}}catch(P){rn(b,A,P)}}function Gs(b,A){var v=b.ref,C=b.refCleanup;if(v!==null)if(typeof C=="function")try{C()}catch(P){rn(b,A,P)}finally{b.refCleanup=null,b=b.alternate,b!=null&&(b.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(P){rn(b,A,P)}else v.current=null}function b4(b){var A=b.type,v=b.memoizedProps,C=b.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":v.autoFocus&&C.focus();break e;case"img":v.src?C.src=v.src:v.srcSet&&(C.srcset=v.srcSet)}}catch(P){rn(b,b.return,P)}}function hj(b,A,v){try{var C=b.stateNode;_ge(C,b.type,v,A),C[Cr]=A}catch(P){rn(b,b.return,P)}}function y4(b){return b.tag===5||b.tag===3||b.tag===26||b.tag===27&&Hp(b.type)||b.tag===4}function pj(b){e:for(;;){for(;b.sibling===null;){if(b.return===null||y4(b.return))return null;b=b.return}for(b.sibling.return=b.return,b=b.sibling;b.tag!==5&&b.tag!==6&&b.tag!==18;){if(b.tag===27&&Hp(b.type)||b.flags&2||b.child===null||b.tag===4)continue e;b.child.return=b,b=b.child}if(!(b.flags&2))return b.stateNode}}function mj(b,A,v){var C=b.tag;if(C===5||C===6)b=b.stateNode,A?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(b,A):(A=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,A.appendChild(b),v=v._reactRootContainer,v!=null||A.onclick!==null||(A.onclick=Si));else if(C!==4&&(C===27&&Hp(b.type)&&(v=b.stateNode,A=null),b=b.child,b!==null))for(mj(b,A,v),b=b.sibling;b!==null;)mj(b,A,v),b=b.sibling}function zw(b,A,v){var C=b.tag;if(C===5||C===6)b=b.stateNode,A?v.insertBefore(b,A):v.appendChild(b);else if(C!==4&&(C===27&&Hp(b.type)&&(v=b.stateNode),b=b.child,b!==null))for(zw(b,A,v),b=b.sibling;b!==null;)zw(b,A,v),b=b.sibling}function A4(b){var A=b.stateNode,v=b.memoizedProps;try{for(var C=b.type,P=A.attributes;P.length;)A.removeAttributeNode(P[0]);Br(A,C,v),A[Un]=b,A[Cr]=v}catch(j){rn(b,b.return,j)}}var au=!1,Yn=!1,gj=!1,_4=typeof WeakSet=="function"?WeakSet:Set,wr=null;function Zme(b,A){if(b=b.containerInfo,xj=hO,b=jU(b),uI(b)){if("selectionStart"in b)var v={start:b.selectionStart,end:b.selectionEnd};else e:{v=(v=b.ownerDocument)&&v.defaultView||window;var C=v.getSelection&&v.getSelection();if(C&&C.rangeCount!==0){v=C.anchorNode;var P=C.anchorOffset,j=C.focusNode;C=C.focusOffset;try{v.nodeType,j.nodeType}catch{v=null;break e}var H=0,$=-1,se=-1,pe=0,ve=0,we=b,be=null;t:for(;;){for(var ye;we!==v||P!==0&&we.nodeType!==3||($=H+P),we!==j||C!==0&&we.nodeType!==3||(se=H+C),we.nodeType===3&&(H+=we.nodeValue.length),(ye=we.firstChild)!==null;)be=we,we=ye;for(;;){if(we===b)break t;if(be===v&&++pe===P&&($=H),be===j&&++ve===C&&(se=H),(ye=we.nextSibling)!==null)break;we=be,be=we.parentNode}we=ye}v=$===-1||se===-1?null:{start:$,end:se}}else v=null}v=v||{start:0,end:0}}else v=null;for(Bj={focusedElem:b,selectionRange:v},hO=!1,wr=A;wr!==null;)if(A=wr,b=A.child,(A.subtreeFlags&1028)!==0&&b!==null)b.return=A,wr=b;else for(;wr!==null;){switch(A=wr,j=A.alternate,b=A.flags,A.tag){case 0:if((b&4)!==0&&(b=A.updateQueue,b=b!==null?b.events:null,b!==null))for(v=0;v title"))),Br(j,C,v),j[Un]=b,jn(j),C=j;break e;case"link":var H=TJ("link","href",P).get(C+(v.href||""));if(H){for(var $=0;$ln&&(H=ln,ln=ht,ht=H);var de=PU($,ht),ue=PU($,ln);if(de&&ue&&(ye.rangeCount!==1||ye.anchorNode!==de.node||ye.anchorOffset!==de.offset||ye.focusNode!==ue.node||ye.focusOffset!==ue.offset)){var he=we.createRange();he.setStart(de.node,de.offset),ye.removeAllRanges(),ht>ln?(ye.addRange(he),ye.extend(ue.node,ue.offset)):(he.setEnd(ue.node,ue.offset),ye.addRange(he))}}}}for(we=[],ye=$;ye=ye.parentNode;)ye.nodeType===1&&we.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$v?32:v,V.T=null,v=Cj,Cj=null;var j=qp,H=fu;if(lr=0,Zb=qp=null,fu=0,(Yt&6)!==0)throw Error(o(331));var $=Yt;if(Yt|=4,I4(j.current),E4(j,j.current,H,v),Yt=$,q_(0,!1),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot(Mn,j)}catch{}return!0}finally{G.p=P,V.T=C,$4(b,A)}}function Y4(b,A,v){A=Oi(v,A),A=nj(b.stateNode,A,2),b=Np(b,A,2),b!==null&&(xs(b,2),zs(b))}function rn(b,A,v){if(b.tag===3)Y4(b,b,v);else for(;A!==null;){if(A.tag===3){Y4(A,b,v);break}else if(A.tag===1){var C=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(Up===null||!Up.has(C))){b=Oi(v,b),v=Xq(2),C=Np(A,v,2),C!==null&&(Zq(v,C,A,b),xs(C,2),zs(C));break}}A=A.return}}function Rj(b,A,v){var C=b.pingCache;if(C===null){C=b.pingCache=new nge;var P=new Set;C.set(A,P)}else P=C.get(A),P===void 0&&(P=new Set,C.set(A,P));P.has(v)||(Aj=!0,P.add(v),b=age.bind(null,b,A,v),A.then(b,b))}function age(b,A,v){var C=b.pingCache;C!==null&&C.delete(A),b.pingedLanes|=b.suspendedLanes&v,b.warmLanes&=~v,dn===b&&(kt&v)===v&&(Nn===4||Nn===3&&(kt&62914560)===kt&&300>Xt()-$w?(Yt&2)===0&&ey(b,0):_j|=v,Xb===kt&&(Xb=0)),zs(b)}function X4(b,A){A===0&&(A=yb()),b=Km(b,A),b!==null&&(xs(b,A),zs(b))}function lge(b){var A=b.memoizedState,v=0;A!==null&&(v=A.retryLane),X4(b,v)}function uge(b,A){var v=0;switch(b.tag){case 31:case 13:var C=b.stateNode,P=b.memoizedState;P!==null&&(v=P.retryLane);break;case 19:C=b.stateNode;break;case 22:C=b.stateNode._retryCache;break;default:throw Error(o(314))}C!==null&&C.delete(A),X4(b,v)}function cge(b,A){return Kr(b,A)}var nO=null,ny=null,Ej=!1,rO=!1,Mj=!1,Vp=0;function zs(b){b!==ny&&b.next===null&&(ny===null?nO=ny=b:ny=ny.next=b),rO=!0,Ej||(Ej=!0,fge())}function q_(b,A){if(!Mj&&rO){Mj=!0;do for(var v=!1,C=nO;C!==null;){if(b!==0){var P=C.pendingLanes;if(P===0)var j=0;else{var H=C.suspendedLanes,$=C.pingedLanes;j=(1<<31-qt(42|b)+1)-1,j&=P&~(H&~$),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(v=!0,nJ(C,j))}else j=kt,j=Sp(C,C===dn?j:0,C.cancelPendingCommit!==null||C.timeoutHandle!==-1),(j&3)===0||Gl(C,j)||(v=!0,nJ(C,j));C=C.next}while(v);Mj=!1}}function dge(){Z4()}function Z4(){rO=Ej=!1;var b=0;Vp!==0&&Sge()&&(b=Vp);for(var A=Xt(),v=null,C=nO;C!==null;){var P=C.next,j=eJ(C,A);j===0?(C.next=null,v===null?nO=P:v.next=P,P===null&&(ny=v)):(v=C,(b!==0||(j&3)!==0)&&(rO=!0)),C=P}lr!==0&&lr!==5||q_(b),Vp!==0&&(Vp=0)}function eJ(b,A){for(var v=b.suspendedLanes,C=b.pingedLanes,P=b.expirationTimes,j=b.pendingLanes&-62914561;0$)break;var ve=se.transferSize,we=se.initiatorType;ve&&cJ(we)&&(se=se.responseEnd,H+=ve*(se<$?1:($-pe)/(se-pe)))}if(--C,A+=8*(j+H)/(P.duration/1e3),b++,10"u"?null:document;function SJ(b,A,v){var C=ry;if(C&&typeof A=="string"&&A){var P=Nr(A);P='link[rel="'+b+'"][href="'+P+'"]',typeof v=="string"&&(P+='[crossorigin="'+v+'"]'),vJ.has(P)||(vJ.add(P),b={rel:b,crossOrigin:v,href:A},C.querySelector(P)===null&&(A=C.createElement("link"),Br(A,"link",b),jn(A),C.head.appendChild(A)))}}function Ige(b){hu.D(b),SJ("dns-prefetch",b,null)}function jge(b,A){hu.C(b,A),SJ("preconnect",b,A)}function Dge(b,A,v){hu.L(b,A,v);var C=ry;if(C&&b&&A){var P='link[rel="preload"][as="'+Nr(A)+'"]';A==="image"&&v&&v.imageSrcSet?(P+='[imagesrcset="'+Nr(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(P+='[imagesizes="'+Nr(v.imageSizes)+'"]')):P+='[href="'+Nr(b)+'"]';var j=P;switch(A){case"style":j=oy(b);break;case"script":j=iy(b)}Ii.has(j)||(b=l({rel:"preload",href:A==="image"&&v&&v.imageSrcSet?void 0:b,as:A},v),Ii.set(j,b),C.querySelector(P)!==null||A==="style"&&C.querySelector(G_(j))||A==="script"&&C.querySelector(z_(j))||(A=C.createElement("link"),Br(A,"link",b),jn(A),C.head.appendChild(A)))}}function Nge(b,A){hu.m(b,A);var v=ry;if(v&&b){var C=A&&typeof A.as=="string"?A.as:"script",P='link[rel="modulepreload"][as="'+Nr(C)+'"][href="'+Nr(b)+'"]',j=P;switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=iy(b)}if(!Ii.has(j)&&(b=l({rel:"modulepreload",href:b},A),Ii.set(j,b),v.querySelector(P)===null)){switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(z_(j)))return}C=v.createElement("link"),Br(C,"link",b),jn(C),v.head.appendChild(C)}}}function Lge(b,A,v){hu.S(b,A,v);var C=ry;if(C&&b){var P=ts(C).hoistableStyles,j=oy(b);A=A||"default";var H=P.get(j);if(!H){var $={loading:0,preload:null};if(H=C.querySelector(G_(j)))$.loading=5;else{b=l({rel:"stylesheet",href:b,"data-precedence":A},v),(v=Ii.get(j))&&Gj(b,v);var se=H=C.createElement("link");jn(se),Br(se,"link",b),se._p=new Promise(function(pe,ve){se.onload=pe,se.onerror=ve}),se.addEventListener("load",function(){$.loading|=1}),se.addEventListener("error",function(){$.loading|=2}),$.loading|=4,lO(H,A,C)}H={type:"stylesheet",instance:H,count:1,state:$},P.set(j,H)}}}function Fge(b,A){hu.X(b,A);var v=ry;if(v&&b){var C=ts(v).hoistableScripts,P=iy(b),j=C.get(P);j||(j=v.querySelector(z_(P)),j||(b=l({src:b,async:!0},A),(A=Ii.get(P))&&zj(b,A),j=v.createElement("script"),jn(j),Br(j,"link",b),v.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},C.set(P,j))}}function xge(b,A){hu.M(b,A);var v=ry;if(v&&b){var C=ts(v).hoistableScripts,P=iy(b),j=C.get(P);j||(j=v.querySelector(z_(P)),j||(b=l({src:b,async:!0,type:"module"},A),(A=Ii.get(P))&&zj(b,A),j=v.createElement("script"),jn(j),Br(j,"link",b),v.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},C.set(P,j))}}function CJ(b,A,v,C){var P=(P=Ie.current)?aO(P):null;if(!P)throw Error(o(446));switch(b){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(A=oy(v.href),v=ts(P).hoistableStyles,C=v.get(A),C||(C={type:"style",instance:null,count:0,state:null},v.set(A,C)),C):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){b=oy(v.href);var j=ts(P).hoistableStyles,H=j.get(b);if(H||(P=P.ownerDocument||P,H={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(b,H),(j=P.querySelector(G_(b)))&&!j._p&&(H.instance=j,H.state.loading=5),Ii.has(b)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},Ii.set(b,v),j||Bge(P,b,v,H.state))),A&&C===null)throw Error(o(528,""));return H}if(A&&C!==null)throw Error(o(529,""));return null;case"script":return A=v.async,v=v.src,typeof v=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=iy(v),v=ts(P).hoistableScripts,C=v.get(A),C||(C={type:"script",instance:null,count:0,state:null},v.set(A,C)),C):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,b))}}function oy(b){return'href="'+Nr(b)+'"'}function G_(b){return'link[rel="stylesheet"]['+b+"]"}function wJ(b){return l({},b,{"data-precedence":b.precedence,precedence:null})}function Bge(b,A,v,C){b.querySelector('link[rel="preload"][as="style"]['+A+"]")?C.loading=1:(A=b.createElement("link"),C.preload=A,A.addEventListener("load",function(){return C.loading|=1}),A.addEventListener("error",function(){return C.loading|=2}),Br(A,"link",v),jn(A),b.head.appendChild(A))}function iy(b){return'[src="'+Nr(b)+'"]'}function z_(b){return"script[async]"+b}function OJ(b,A,v){if(A.count++,A.instance===null)switch(A.type){case"style":var C=b.querySelector('style[data-href~="'+Nr(v.href)+'"]');if(C)return A.instance=C,jn(C),C;var P=l({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return C=(b.ownerDocument||b).createElement("style"),jn(C),Br(C,"style",P),lO(C,v.precedence,b),A.instance=C;case"stylesheet":P=oy(v.href);var j=b.querySelector(G_(P));if(j)return A.state.loading|=4,A.instance=j,jn(j),j;C=wJ(v),(P=Ii.get(P))&&Gj(C,P),j=(b.ownerDocument||b).createElement("link"),jn(j);var H=j;return H._p=new Promise(function($,se){H.onload=$,H.onerror=se}),Br(j,"link",C),A.state.loading|=4,lO(j,v.precedence,b),A.instance=j;case"script":return j=iy(v.src),(P=b.querySelector(z_(j)))?(A.instance=P,jn(P),P):(C=v,(P=Ii.get(j))&&(C=l({},v),zj(C,P)),b=b.ownerDocument||b,P=b.createElement("script"),jn(P),Br(P,"link",C),b.head.appendChild(P),A.instance=P);case"void":return null;default:throw Error(o(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(C=A.instance,A.state.loading|=4,lO(C,v.precedence,b));return A.instance}function lO(b,A,v){for(var C=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),P=C.length?C[C.length-1]:null,j=P,H=0;H title"):null)}function kge(b,A,v){if(v===1||A.itemProp!=null)return!1;switch(b){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;return A.rel==="stylesheet"?(b=A.disabled,typeof A.precedence=="string"&&b==null):!0;case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function EJ(b){return!(b.type==="stylesheet"&&(b.state.loading&3)===0)}function Uge(b,A,v,C){if(v.type==="stylesheet"&&(typeof C.media!="string"||matchMedia(C.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var P=oy(C.href),j=A.querySelector(G_(P));if(j){A=j._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(b.count++,b=cO.bind(b),A.then(b,b)),v.state.loading|=4,v.instance=j,jn(j);return}j=A.ownerDocument||A,C=wJ(C),(P=Ii.get(P))&&Gj(C,P),j=j.createElement("link"),jn(j);var H=j;H._p=new Promise(function($,se){H.onload=$,H.onerror=se}),Br(j,"link",C),v.instance=j}b.stylesheets===null&&(b.stylesheets=new Map),b.stylesheets.set(v,A),(A=v.state.preload)&&(v.state.loading&3)===0&&(b.count++,v=cO.bind(b),A.addEventListener("load",v),A.addEventListener("error",v))}}var Kj=0;function qge(b,A){return b.stylesheets&&b.count===0&&fO(b,b.stylesheets),0Kj?50:800)+A);return b.unsuspend=v,function(){b.unsuspend=null,clearTimeout(C),clearTimeout(P)}}:null}function cO(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fO(this,this.stylesheets);else if(this.unsuspend){var b=this.unsuspend;this.unsuspend=null,b()}}}var dO=null;function fO(b,A){b.stylesheets=null,b.unsuspend!==null&&(b.count++,dO=new Map,A.forEach(Jge,b),dO=null,cO.call(b))}function Jge(b,A){if(!(A.state.loading&4)){var v=dO.get(b);if(v)var C=v.get(null);else{v=new Map,dO.set(b,v);for(var P=b.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nD.exports=obe(),nD.exports}var sbe=ibe();const abe=e=>Array.from(e).map(n=>n.getModelContext()).sort((n,o)=>(o.priority??0)-(n.priority??0)).reduce((n,o)=>{if(o.system&&(n.system?n.system+=` -${i.system}`:n.system=i.system),i.tools)for(const[r,s]of Object.entries(i.tools)){const o=n.tools?.[r];if(o&&o!==s)throw new Error(`You tried to define a tool with the name ${r}, but it already exists.`);n.tools||(n.tools={}),n.tools[r]=s}return i.config&&(n.config={...n.config,...i.config}),i.callSettings&&(n.callSettings={...n.callSettings,...i.callSettings}),n},{});class gT{_providers=new Set;getModelContext(){return GJ(this._providers)}registerModelContextProvider(e){this._providers.add(e);const n=e.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(e),n?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(const e of this._subscribers)e()}subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}}class a6{_contextProvider=new gT;registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}}class $J{_subscribers=new Set;subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}waitForUpdate(){return new Promise(e=>{const n=this.subscribe(()=>{n(),e()})})}_notifySubscribers(){const e=[];for(const n of this._subscribers)try{n()}catch(i){e.push(i)}if(e.length>0)throw e.length===1?e[0]:new AggregateError(e)}}const WJ=t=>t.status.type==="complete";class l6 extends $J{isEditing=!0;get attachmentAccept(){return this.getAttachmentAdapter()?.accept??"*"}_attachments=[];get attachments(){return this._attachments}setAttachments(e){this._attachments=e,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text="";get text(){return this._text}_role="user";get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}setText(e){this._text!==e&&(this._text=e,this._notifySubscribers())}setRole(e){this._role!==e&&(this._role=e,this._notifySubscribers())}setRunConfig(e){this._runConfig!==e&&(this._runConfig=e,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const e=this.getAttachmentAdapter();e&&await Promise.all(this._attachments.map(n=>e.remove(n)))}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0)return;this._role="user",this._runConfig={};const e=this._onClearAttachments();this._emptyTextAndAttachments(),await e}async clearAttachments(){const e=this._onClearAttachments();this.setAttachments([]),await e}async send(){const e=this.getAttachmentAdapter(),n=e&&this.attachments.length>0?Promise.all(this.attachments.map(async s=>WJ(s)?s:await e.send(s))):[],i=this.text;this._emptyTextAndAttachments();const r={createdAt:new Date,role:this.role,content:i?[{type:"text",text:i}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{}}};this.handleSend(r),this._notifyEventSubscribers("send")}cancel(){this.handleCancel()}async addAttachment(e){const n=this.getAttachmentAdapter();if(!n)throw new Error("Attachments are not supported");const i=s=>{const o=this._attachments.findIndex(a=>a.id===s.id);o!==-1?this._attachments=[...this._attachments.slice(0,o),s,...this._attachments.slice(o+1)]:this._attachments=[...this._attachments,s],this._notifySubscribers()},r=n.add({file:e});if(Symbol.asyncIterator in r)for await(const s of r)i(s);else i(await r);this._notifyEventSubscribers("attachment-add"),this._notifySubscribers()}async removeAttachment(e){const n=this.getAttachmentAdapter();if(!n)throw new Error("Attachments are not supported");const i=this._attachments.findIndex(s=>s.id===e);if(i===-1)throw new Error("Attachment not found");const r=this._attachments[i];await n.remove(r),this._attachments=[...this._attachments.slice(0,i),...this._attachments.slice(i+1)],this._notifySubscribers()}_eventSubscribers=new Map;_notifyEventSubscribers(e){const n=this._eventSubscribers.get(e);if(n)for(const i of n)i()}unstable_on(e,n){const i=this._eventSubscribers.get(e);return i?i.add(n):this._eventSubscribers.set(e,new Set([n])),()=>{const r=this._eventSubscribers.get(e);r&&r.delete(n)}}}class c6 extends l6{runtime;_canCancel=!1;get canCancel(){return this._canCancel}get attachments(){return super.attachments}getAttachmentAdapter(){return this.runtime.adapters?.attachments}constructor(e){super(),this.runtime=e,this.connect()}connect(){return this.runtime.subscribe(()=>{this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,this._notifySubscribers())})}async handleSend(e){this.runtime.append({...e,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null})}async handleCancel(){this.runtime.cancelRun()}}let u6=(t,e=21)=>(n=e)=>{let i="",r=n|0;for(;r--;)i+=t[Math.random()*t.length|0];return i};const zb=u6("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),jJ="__optimistic__",KJ=()=>`${jJ}${zb()}`,lh=Symbol("autoStatus"),YJ=Object.freeze(Object.assign({type:"running"},{[lh]:!0})),qJ=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[lh]:!0})),JJ=Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[lh]:!0})),XJ=Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[lh]:!0})),ZJ=t=>t[lh]===!0,mT=(t,e,n,i,r)=>t&&r?Object.assign({type:"incomplete",reason:"error",error:r},{[lh]:!0}):t&&e?YJ:n?XJ:i?JJ:qJ;var ac={exports:{}},wN;function eX(){if(wN)return ac.exports;wN=1;const t=typeof Buffer<"u",e=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function i(a,l,u){u==null&&l!==null&&typeof l=="object"&&(u=l,l=void 0),t&&Buffer.isBuffer(a)&&(a=a.toString()),a&&a.charCodeAt(0)===65279&&(a=a.slice(1));const d=JSON.parse(a,l);if(d===null||typeof d!="object")return d;const f=u&&u.protoAction||"error",g=u&&u.constructorAction||"error";if(f==="ignore"&&g==="ignore")return d;if(f!=="ignore"&&g!=="ignore"){if(e.test(a)===!1&&n.test(a)===!1)return d}else if(f!=="ignore"&&g==="ignore"){if(e.test(a)===!1)return d}else if(n.test(a)===!1)return d;return r(d,{protoAction:f,constructorAction:g,safe:u&&u.safe})}function r(a,{protoAction:l="error",constructorAction:u="error",safe:d}={}){let f=[a];for(;f.length;){const g=f;f=[];for(const m of g){if(l!=="ignore"&&Object.prototype.hasOwnProperty.call(m,"__proto__")){if(d===!0)return null;if(l==="error")throw new SyntaxError("Object contains forbidden prototype property");delete m.__proto__}if(u!=="ignore"&&Object.prototype.hasOwnProperty.call(m,"constructor")&&m.constructor!==null&&typeof m.constructor=="object"&&Object.prototype.hasOwnProperty.call(m.constructor,"prototype")){if(d===!0)return null;if(u==="error")throw new SyntaxError("Object contains forbidden prototype property");delete m.constructor}for(const v in m){const S=m[v];S&&typeof S=="object"&&f.push(S)}}}return a}function s(a,l,u){const{stackTraceLimit:d}=Error;Error.stackTraceLimit=0;try{return i(a,l,u)}finally{Error.stackTraceLimit=d}}function o(a,l){const{stackTraceLimit:u}=Error;Error.stackTraceLimit=0;try{return i(a,l,{safe:!0})}catch{return}finally{Error.stackTraceLimit=u}}return ac.exports=s,ac.exports.default=s,ac.exports.parse=s,ac.exports.safeParse=o,ac.exports.scan=r,ac.exports}var tX=eX();const k1=Gc(tX);function nX(t){const e=["ROOT"];let n=-1,i=null;const r=[];let s;function o(){s!==void 0&&(r.push(JSON.parse(`"${s}"`)),s=void 0)}function a(f,g,m){switch(f){case'"':{n=g,e.pop(),e.push(m),e.push("INSIDE_STRING"),o();break}case"f":case"t":case"n":{n=g,i=g,e.pop(),e.push(m),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(m),e.push("INSIDE_NUMBER"),o();break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=g,e.pop(),e.push(m),e.push("INSIDE_NUMBER"),o();break}case"{":{n=g,e.pop(),e.push(m),e.push("INSIDE_OBJECT_START"),o();break}case"[":{n=g,e.pop(),e.push(m),e.push("INSIDE_ARRAY_START"),o();break}}}function l(f,g){switch(f){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=g,e.pop(),s=r.pop();break}}}function u(f,g){switch(f){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA"),s=(Number(s)+1).toString();break}case"]":{n=g,e.pop(),s=r.pop();break}}}for(let f=0;f=0;f--)switch(e[f]){case"INSIDE_STRING":{d+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{d+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{d+="]";break}case"INSIDE_LITERAL":{const m=t.substring(i,t.length);"true".startsWith(m)?d+="true".slice(m.length):"false".startsWith(m)?d+="false".slice(m.length):"null".startsWith(m)&&(d+="null".slice(m.length))}}return[d,r]}const _y=Symbol("aui.parse-partial-json-object.meta"),iX=t=>t?.[_y],I1=t=>{if(t.length===0)return{[_y]:{state:"partial",partialPath:[]}};try{const e=k1.parse(t);if(typeof e!="object"||e===null)throw new Error("argsText is expected to be an object");return e[_y]={state:"complete",partialPath:[]},e}catch{try{const[e,n]=nX(t),i=k1.parse(e);if(typeof i!="object"||i===null)throw new Error("argsText is expected to be an object");return i[_y]={state:"partial",partialPath:n},i}catch{return}}},d6=(t,e,n)=>{if(typeof t!="object"||t===null)return e.state;if(e.state==="complete")return"complete";if(n.length===0)return e.state;const[i,...r]=n;if(!Object.prototype.hasOwnProperty.call(t,i))return"partial";const[s,...o]=e.partialPath;if(i!==s)return"complete";const a=t[i];return d6(a,{state:"partial",partialPath:o},r)},Qd=(t,e)=>{const n=iX(t);if(!n)throw new Error("unable to determine object state");return d6(t,n,e.map(String))};async function*rX(){const t=this.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{t.releaseLock()}}function gx(t){return t[Symbol.asyncIterator]??=rX,t}const AT=function(){let t,e;const n=new Promise((i,r)=>{t=i,e=r});if(!t||!e)throw new Error("Failed to create promise");return{promise:n,resolve:t,reject:e}},sX=()=>{const t=[];let e=!1,n,i;const r=o=>{o.promise||(o.promise=o.reader.read().then(({done:a,value:l})=>{o.promise=void 0,a?(t.splice(t.indexOf(o),1),e&&t.length===0&&n.close()):n.enqueue(l),i?.resolve(),i=void 0}).catch(a=>{console.error(a),t.forEach(l=>{l.reader.cancel()}),t.length=0,n.error(a),i?.reject(a),i=void 0}))};return{readable:new ReadableStream({start(o){n=o},pull(){return i=AT(),t.forEach(o=>{r(o)}),i.promise},cancel(){t.forEach(o=>{o.reader.cancel()}),t.length=0}}),isSealed(){return e},seal(){e=!0,t.length===0&&n.close()},addStream(o){if(e)throw new Error("Cannot add streams after the run callback has settled.");const a={reader:o.getReader()};t.push(a),r(a)},enqueue(o){this.addStream(new ReadableStream({start(a){a.enqueue(o),a.close()}}))}}};class SN{_controller;_isClosed=!1;constructor(e){this._controller=e}append(e){return this._controller.enqueue({type:"text-delta",path:[],textDelta:e}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}const h6=t=>new ReadableStream({start(e){return t.start?.(new SN(e))},pull(e){return t.pull?.(new SN(e))},cancel(e){return t.cancel?.(e)}}),CN=()=>{let t;return[h6({start(n){t=n}}),t]};class xN{_controller;_isClosed=!1;_mergeTask;constructor(e){this._controller=e;const n=h6({start:r=>{this._argsTextController=r}});let i=!1;this._mergeTask=n.pipeTo(new WritableStream({write:r=>{switch(r.type){case"text-delta":i=!0,this._controller.enqueue(r);break;case"part-finish":i||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw new Error(`Unexpected chunk type: ${r.type}`)}}}))}get argsText(){return this._argsTextController}_argsTextController;async setResponse(e){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...e.artifact!==void 0?{artifact:e.artifact}:{},result:e.result,isError:e.isError??!1})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}const oX=t=>new ReadableStream({start(e){return t.start?.(new xN(e))},pull(e){return t.pull?.(new xN(e))},cancel(e){return t.cancel?.(e)}}),aX=()=>{let t;return[oX({start(n){t=n}}),t]};class f6{value=-1;up(){return++this.value}}class lX extends TransformStream{constructor(e){super({transform(n,i){i.enqueue({...n,path:[e,...n.path]})}})}}class nht extends TransformStream{constructor(e){super({transform(n,i){const{path:[r,...s]}=n;if(e!==r)throw new Error(`Path mismatch: expected ${e}, got ${r}`);i.enqueue({...n,path:s})}})}}class cX extends TransformStream{constructor(e){const n=new f6,i=new Map;super({transform(r,s){r.type==="part-start"&&r.path.length===0&&i.set(n.up(),e.up());const[o,...a]=r.path;if(o===void 0){s.enqueue(r);return}const l=i.get(o);if(l===void 0)throw new Error("Path not found");s.enqueue({...r,path:[l,...a]})}})}}class uX extends TransformStream{constructor(e){super();const n=e(super.readable);Object.defineProperty(this,"readable",{value:n,writable:!1})}}class p6 extends TransformStream{constructor(){const e=[];super({transform(n,i){if(n.type==="part-start"){if(n.path.length!==0){i.error(new Error("Nested parts are not supported"));return}e.push(n.part),i.enqueue(n);return}if(n.type==="text-delta"||n.type==="result"||n.type==="part-finish"||n.type==="tool-call-args-text-finish"){if(n.path.length!==1){i.error(new Error(`${n.type} chunks must have a path of length 1`));return}const r=n.path[0];if(r<0||r>=e.length){i.error(new Error(`Invalid path index: ${r}`));return}const s=e[r];i.enqueue({...n,meta:s});return}i.enqueue(n)}})}}const dX=u6("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);class yT{_state;_parentId;constructor(e){this._state=e||{merger:sX(),contentCounter:new f6}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(e){this._state.closeSubscriber=e}_addPart(e,n){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:e,path:[]}),this._state.merger.addStream(n.pipeThrough(new lX(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new cX(this._state.contentCounter)))}appendText(e){this._state.append?.kind!=="text"&&(this._state.append={kind:"text",controller:this.addTextPart()}),this._state.append.controller.append(e)}appendReasoning(e){this._state.append?.kind!=="reasoning"&&(this._state.append={kind:"reasoning",controller:this.addReasoningPart()}),this._state.append.controller.append(e)}addTextPart(){const[e,n]=CN();return this._addPart({type:"text"},e),n}addReasoningPart(){const[e,n]=CN();return this._addPart({type:"reasoning"},e),n}addToolCallPart(e){const n=typeof e=="string"?{toolName:e}:e,i=n.toolName,r=n.toolCallId??dX(),[s,o]=aX();return this._addPart({type:"tool-call",toolName:i,toolCallId:r,...this._parentId&&{parentId:this._parentId}},s),n.argsText!==void 0&&(o.argsText.append(n.argsText),o.argsText.close()),n.args!==void 0&&(o.argsText.append(JSON.stringify(n.args)),o.argsText.close()),n.response!==void 0&&o.setResponse(n.response),o}appendSource(e){this._addPart({...e,...this._parentId&&{parentId:this._parentId}},new ReadableStream({start(n){n.enqueue({type:"part-finish",path:[]}),n.close()}}))}appendFile(e){this._addPart(e,new ReadableStream({start(n){n.enqueue({type:"part-finish",path:[]}),n.close()}}))}enqueue(e){this._state.merger.enqueue(e),e.type==="part-start"&&e.path.length===0&&this._state.contentCounter.up()}withParentId(e){const n=new yT(this._state);return n._parentId=e,n}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}}function hX(t){const e=new yT;return(async()=>{try{await t(e)}catch(i){throw e.__internal_isClosed||e.enqueue({type:"error",path:[],error:String(i)}),i}finally{e.__internal_isClosed||e.close()}})(),e.__internal_getReadable()}function fX(){const{resolve:t,promise:e}=AT();let n;return[hX(r=>(n=r,n.__internal_subscribeToClose(t),e)),n]}const Qb=(t,e,n)=>{const{role:i,id:r,createdAt:s,attachments:o,status:a,metadata:l}=t,u={id:r??e,createdAt:s??new Date},d=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content,f=({image:g,...m})=>g.match(/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/)?{...m,image:g}:(console.warn("Invalid image data format detected"),null);if(i!=="user"&&o?.length)throw new Error("attachments are only supported for user messages");if(i!=="assistant"&&a)throw new Error("status is only supported for assistant messages");if(i!=="assistant"&&l?.steps)throw new Error("metadata.steps is only supported for assistant messages");switch(i){case"assistant":return{...u,role:i,content:d.map(g=>{const m=g.type;switch(m){case"text":case"reasoning":return g.text.trim().length===0?null:g;case"file":case"source":return g;case"image":return f(g);case"data":return g;case"tool-call":{const{parentId:v,messages:S,...C}=g,E={...C,toolCallId:g.toolCallId??`tool-${zb()}`,...v!==void 0&&{parentId:v},...S!==void 0&&{messages:S}};return g.args?{...E,args:g.args,argsText:g.argsText??JSON.stringify(g.args)}:{...E,args:I1(g.argsText??"")??{},argsText:g.argsText??""}}default:{const v=m;throw new Error(`Unsupported assistant message part type: ${v}`)}}}).filter(g=>!!g),status:a??n,metadata:{unstable_state:l?.unstable_state??null,unstable_annotations:l?.unstable_annotations??[],unstable_data:l?.unstable_data??[],custom:l?.custom??{},steps:l?.steps??[],...l?.submittedFeedback&&{submittedFeedback:l.submittedFeedback}}};case"user":return{...u,role:i,content:d.map(g=>{const m=g.type;switch(m){case"text":case"image":case"audio":case"file":return g;default:{const v=m;throw new Error(`Unsupported user message part type: ${v}`)}}}),attachments:o??[],metadata:{custom:l?.custom??{}}};case"system":if(d.length!==1||d[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...u,role:i,content:d,metadata:{custom:l?.custom??{}}};default:{const g=i;throw new Error(`Unknown message role: ${g}`)}}},vT={fromArray:t=>{const e=t.map(n=>Qb(n,zb(),mT(!1,!1,!1,!1,void 0)));return{messages:e.map((n,i)=>({parentId:i>0?e[i-1].id:null,message:n}))}}},Ty=t=>t.next?Ty(t.next):"current"in t?t:null;class pX{func;_value=null;constructor(e){this.func=e}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}}class bT{messages=new Map;head=null;root={children:[],next:null};updateLevels(e,n){e.level=n;for(const i of e.children){const r=this.messages.get(i);r&&this.updateLevels(r,n+1)}}performOp(e,n,i){const r=n.prev??this.root,s=e??this.root;if(!(i==="relink"&&r===s)){if(i!=="link"&&(r.children=r.children.filter(o=>o!==n.current.id),r.next===n)){const o=r.children.at(-1),a=o?this.messages.get(o):null;if(a===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");r.next=a}if(i!=="cut"){for(let a=e;a;a=a.prev)if(a.current.id===n.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");s.children=[...s.children,n.current.id],(Ty(n)===this.head||s.next===null)&&(s.next=n),n.prev=e;const o=e?e.level+1:0;this.updateLevels(n,o)}}}_messages=new pX(()=>{const e=new Array((this.head?.level??-1)+1);for(let n=this.head;n;n=n.prev)e[n.level]=n.current;return e});get headId(){return this.head?.current.id??null}getMessages(e){if(e===void 0||e===this.head?.current.id)return this._messages.value;const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");const i=new Array(n.level+1);for(let r=n;r;r=r.prev)i[r.level]=r.current;return i}addOrUpdateMessage(e,n){const i=this.messages.get(n.id),r=e?this.messages.get(e):null;if(r===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(i){i.current=n,this.performOp(r,i,"relink"),this._messages.dirty();return}const s={prev:r,current:n,next:null,children:[],level:r?r.level+1:0};this.messages.set(n.id,s),this.performOp(r,s,"link"),this.head===r&&(this.head=s),this._messages.dirty()}getMessage(e){const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:n.prev?.current.id??null,message:n.current,index:n.level}}appendOptimisticMessage(e,n){let i;do i=KJ();while(this.messages.has(i));return this.addOrUpdateMessage(e,Qb(n,i,{type:"running"})),i}deleteMessage(e,n){const i=this.messages.get(e);if(!i)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const r=n===void 0?i.prev:n===null?null:this.messages.get(n);if(r===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const s of i.children){const o=this.messages.get(s);if(!o)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(r,o,"relink")}this.performOp(null,i,"cut"),this.messages.delete(e),this.head===i&&(this.head=Ty(r??this.root)),this._messages.dirty()}getBranches(e){const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:i}=n.prev??this.root;return i}switchToBranch(e){const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const i=n.prev??this.root;i.next=n,this.head=Ty(n),this._messages.dirty()}resetHead(e){if(e===null){this.clear();return}const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");if(n.children.length>0){const i=r=>{for(const s of r.children){const o=this.messages.get(s);o&&(i(o),this.messages.delete(s))}};i(n),n.children=[],n.next=null}this.head=n;for(let i=n;i;i=i.prev)i.prev&&(i.prev.next=i);this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){const e=[];for(const[,n]of this.messages)e.push({message:n.current,parentId:n.prev?.current.id??null});return{headId:this.head?.current.id??null,messages:e}}import({headId:e,messages:n}){for(const{message:i,parentId:r}of n)this.addOrUpdateMessage(r,i);this.resetHead(e??n.at(-1)?.message.id??null)}}class Gb{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(){for(const e of this._subscriptions)e()}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(e){return this._subscriptions.add(e),this._updateConnection(),()=>{this._subscriptions.delete(e),this._updateConnection()}}}const Ts=Symbol("skip-update");class wT extends Gb{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){const e=this.binding.getState();e!==Ts&&(this._previousState=e),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState};_connect(){const e=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(e)}}class WA{_core;_threadListBinding;get path(){return this._core.path}constructor(e,n){this._core=e,this._threadListBinding=n,this.__internal_bindMethods()}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(){const e=this._core.getState();return this._threadListBinding.switchToThread(e.id)}rename(e){const n=this._core.getState();return this._threadListBinding.rename(n.id,e)}archive(){const e=this._core.getState();return this._threadListBinding.archive(e.id)}unarchive(){const e=this._core.getState();return this._threadListBinding.unarchive(e.id)}delete(){const e=this._core.getState();return this._threadListBinding.delete(e.id)}initialize(){const e=this._core.getState();return this._threadListBinding.initialize(e.id)}generateTitle(){const e=this._core.getState();return this._threadListBinding.generateTitle(e.id)}unstable_on(e,n){let i=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{const s=this._core.getState(),o=s.isMain,a=s.id;i===o&&r===a||(i=o,r=a,!(e==="switched-to"&&!o)&&(e==="switched-away"&&o||n()))})}subscribe(e){return this._core.subscribe(e)}detach(){const e=this._core.getState();this._threadListBinding.detach(e.id)}__internal_getRuntime(){return this}}function gX(t,e){if(t===void 0&&e===void 0)return!0;if(t===void 0||e===void 0)return!1;for(const n of Object.keys(t)){const i=t[n],r=e[n];if(!Object.is(i,r))return!1}return!0}class ys extends Gb{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e;const n=e.getState();if(n===Ts)throw new Error("Entry not available in the store");this._previousState=n}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){const e=this.binding.getState();return e===Ts||gX(e,this._previousState)?!1:(this._previousState=e,!0)}_connect(){const e=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(e)}}const Gd=Symbol("innerMessage"),mX=t=>t[Gd],tg=t=>t.content.filter(n=>n.type==="text").map(n=>n.text).join(` +${o.system}`:n.system=o.system),o.tools)for(const[r,i]of Object.entries(o.tools)){const s=n.tools?.[r];if(s&&s!==i)throw new Error(`You tried to define a tool with the name ${r}, but it already exists.`);n.tools||(n.tools={}),n.tools[r]=i}return o.config&&(n.config={...n.config,...o.config}),o.callSettings&&(n.callSettings={...n.callSettings,...o.callSettings}),n},{});class gF{_providers=new Set;getModelContext(){return abe(this._providers)}registerModelContextProvider(t){this._providers.add(t);const n=t.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(t),n?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(const t of this._subscribers)t()}subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}}class RZ{_contextProvider=new gF;registerModelContextProvider(t){return this._contextProvider.registerModelContextProvider(t)}getModelContextProvider(){return this._contextProvider}}class lbe{_subscribers=new Set;subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}waitForUpdate(){return new Promise(t=>{const n=this.subscribe(()=>{n(),t()})})}_notifySubscribers(){const t=[];for(const n of this._subscribers)try{n()}catch(o){t.push(o)}if(t.length>0)throw t.length===1?t[0]:new AggregateError(t)}}const ube=e=>e.status.type==="complete";class EZ extends lbe{isEditing=!0;get attachmentAccept(){return this.getAttachmentAdapter()?.accept??"*"}_attachments=[];get attachments(){return this._attachments}setAttachments(t){this._attachments=t,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text="";get text(){return this._text}_role="user";get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}setText(t){this._text!==t&&(this._text=t,this._notifySubscribers())}setRole(t){this._role!==t&&(this._role=t,this._notifySubscribers())}setRunConfig(t){this._runConfig!==t&&(this._runConfig=t,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const t=this.getAttachmentAdapter();t&&await Promise.all(this._attachments.map(n=>t.remove(n)))}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0)return;this._role="user",this._runConfig={};const t=this._onClearAttachments();this._emptyTextAndAttachments(),await t}async clearAttachments(){const t=this._onClearAttachments();this.setAttachments([]),await t}async send(){const t=this.getAttachmentAdapter(),n=t&&this.attachments.length>0?Promise.all(this.attachments.map(async i=>ube(i)?i:await t.send(i))):[],o=this.text;this._emptyTextAndAttachments();const r={createdAt:new Date,role:this.role,content:o?[{type:"text",text:o}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{}}};this.handleSend(r),this._notifyEventSubscribers("send")}cancel(){this.handleCancel()}async addAttachment(t){const n=this.getAttachmentAdapter();if(!n)throw new Error("Attachments are not supported");const o=i=>{const s=this._attachments.findIndex(a=>a.id===i.id);s!==-1?this._attachments=[...this._attachments.slice(0,s),i,...this._attachments.slice(s+1)]:this._attachments=[...this._attachments,i],this._notifySubscribers()},r=n.add({file:t});if(Symbol.asyncIterator in r)for await(const i of r)o(i);else o(await r);this._notifyEventSubscribers("attachment-add"),this._notifySubscribers()}async removeAttachment(t){const n=this.getAttachmentAdapter();if(!n)throw new Error("Attachments are not supported");const o=this._attachments.findIndex(i=>i.id===t);if(o===-1)throw new Error("Attachment not found");const r=this._attachments[o];await n.remove(r),this._attachments=[...this._attachments.slice(0,o),...this._attachments.slice(o+1)],this._notifySubscribers()}_eventSubscribers=new Map;_notifyEventSubscribers(t){const n=this._eventSubscribers.get(t);if(n)for(const o of n)o()}unstable_on(t,n){const o=this._eventSubscribers.get(t);return o?o.add(n):this._eventSubscribers.set(t,new Set([n])),()=>{const r=this._eventSubscribers.get(t);r&&r.delete(n)}}}class MZ extends EZ{runtime;_canCancel=!1;get canCancel(){return this._canCancel}get attachments(){return super.attachments}getAttachmentAdapter(){return this.runtime.adapters?.attachments}constructor(t){super(),this.runtime=t,this.connect()}connect(){return this.runtime.subscribe(()=>{this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,this._notifySubscribers())})}async handleSend(t){this.runtime.append({...t,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null})}async handleCancel(){this.runtime.cancelRun()}}let PZ=(e,t=21)=>(n=t)=>{let o="",r=n|0;for(;r--;)o+=e[Math.random()*e.length|0];return o};const OM=PZ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),cbe="__optimistic__",dbe=()=>`${cbe}${OM()}`,MA=Symbol("autoStatus"),fbe=Object.freeze(Object.assign({type:"running"},{[MA]:!0})),hbe=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[MA]:!0})),pbe=Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[MA]:!0})),mbe=Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[MA]:!0})),gbe=e=>e[MA]===!0,bF=(e,t,n,o,r)=>e&&r?Object.assign({type:"incomplete",reason:"error",error:r},{[MA]:!0}):e&&t?fbe:n?mbe:o?pbe:hbe;var sg={exports:{}},XJ;function bbe(){if(XJ)return sg.exports;XJ=1;const e=typeof Buffer<"u",t=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function o(a,c,p){p==null&&c!==null&&typeof c=="object"&&(p=c,c=void 0),e&&Buffer.isBuffer(a)&&(a=a.toString()),a&&a.charCodeAt(0)===65279&&(a=a.slice(1));const u=JSON.parse(a,c);if(u===null||typeof u!="object")return u;const l=p&&p.protoAction||"error",d=p&&p.constructorAction||"error";if(l==="ignore"&&d==="ignore")return u;if(l!=="ignore"&&d!=="ignore"){if(t.test(a)===!1&&n.test(a)===!1)return u}else if(l!=="ignore"&&d==="ignore"){if(t.test(a)===!1)return u}else if(n.test(a)===!1)return u;return r(u,{protoAction:l,constructorAction:d,safe:p&&p.safe})}function r(a,{protoAction:c="error",constructorAction:p="error",safe:u}={}){let l=[a];for(;l.length;){const d=l;l=[];for(const f of d){if(c!=="ignore"&&Object.prototype.hasOwnProperty.call(f,"__proto__")){if(u===!0)return null;if(c==="error")throw new SyntaxError("Object contains forbidden prototype property");delete f.__proto__}if(p!=="ignore"&&Object.prototype.hasOwnProperty.call(f,"constructor")&&f.constructor!==null&&typeof f.constructor=="object"&&Object.prototype.hasOwnProperty.call(f.constructor,"prototype")){if(u===!0)return null;if(p==="error")throw new SyntaxError("Object contains forbidden prototype property");delete f.constructor}for(const h in f){const m=f[h];m&&typeof m=="object"&&l.push(m)}}}return a}function i(a,c,p){const{stackTraceLimit:u}=Error;Error.stackTraceLimit=0;try{return o(a,c,p)}finally{Error.stackTraceLimit=u}}function s(a,c){const{stackTraceLimit:p}=Error;Error.stackTraceLimit=0;try{return o(a,c,{safe:!0})}catch{return}finally{Error.stackTraceLimit=p}}return sg.exports=i,sg.exports.default=i,sg.exports.parse=i,sg.exports.safeParse=s,sg.exports.scan=r,sg.exports}var ybe=bbe();const P2=Wg(ybe);function Abe(e){const t=["ROOT"];let n=-1,o=null;const r=[];let i;function s(){i!==void 0&&(r.push(JSON.parse(`"${i}"`)),i=void 0)}function a(l,d,f){switch(l){case'"':{n=d,t.pop(),t.push(f),t.push("INSIDE_STRING"),s();break}case"f":case"t":case"n":{n=d,o=d,t.pop(),t.push(f),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(f),t.push("INSIDE_NUMBER"),s();break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=d,t.pop(),t.push(f),t.push("INSIDE_NUMBER"),s();break}case"{":{n=d,t.pop(),t.push(f),t.push("INSIDE_OBJECT_START"),s();break}case"[":{n=d,t.pop(),t.push(f),t.push("INSIDE_ARRAY_START"),s();break}}}function c(l,d){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=d,t.pop(),i=r.pop();break}}}function p(l,d){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA"),i=(Number(i)+1).toString();break}case"]":{n=d,t.pop(),i=r.pop();break}}}for(let l=0;l=0;l--)switch(t[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const f=e.substring(o,e.length);"true".startsWith(f)?u+="true".slice(f.length):"false".startsWith(f)?u+="false".slice(f.length):"null".startsWith(f)&&(u+="null".slice(f.length))}}return[u,r]}const lR=Symbol("aui.parse-partial-json-object.meta"),_be=e=>e?.[lR],I2=e=>{if(e.length===0)return{[lR]:{state:"partial",partialPath:[]}};try{const t=P2.parse(e);if(typeof t!="object"||t===null)throw new Error("argsText is expected to be an object");return t[lR]={state:"complete",partialPath:[]},t}catch{try{const[t,n]=Abe(e),o=P2.parse(t);if(typeof o!="object"||o===null)throw new Error("argsText is expected to be an object");return o[lR]={state:"partial",partialPath:n},o}catch{return}}},IZ=(e,t,n)=>{if(typeof e!="object"||e===null)return t.state;if(t.state==="complete")return"complete";if(n.length===0)return t.state;const[o,...r]=n;if(!Object.prototype.hasOwnProperty.call(e,o))return"partial";const[i,...s]=t.partialPath;if(o!==i)return"complete";const a=e[o];return IZ(a,{state:"partial",partialPath:s},r)},cA=(e,t)=>{const n=_be(e);if(!n)throw new Error("unable to determine object state");return IZ(e,n,t.map(String))};async function*vbe(){const e=this.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{e.releaseLock()}}function sD(e){return e[Symbol.asyncIterator]??=vbe,e}const yF=function(){let e,t;const n=new Promise((o,r)=>{e=o,t=r});if(!e||!t)throw new Error("Failed to create promise");return{promise:n,resolve:e,reject:t}},Sbe=()=>{const e=[];let t=!1,n,o;const r=s=>{s.promise||(s.promise=s.reader.read().then(({done:a,value:c})=>{s.promise=void 0,a?(e.splice(e.indexOf(s),1),t&&e.length===0&&n.close()):n.enqueue(c),o?.resolve(),o=void 0}).catch(a=>{console.error(a),e.forEach(c=>{c.reader.cancel()}),e.length=0,n.error(a),o?.reject(a),o=void 0}))};return{readable:new ReadableStream({start(s){n=s},pull(){return o=yF(),e.forEach(s=>{r(s)}),o.promise},cancel(){e.forEach(s=>{s.reader.cancel()}),e.length=0}}),isSealed(){return t},seal(){t=!0,e.length===0&&n.close()},addStream(s){if(t)throw new Error("Cannot add streams after the run callback has settled.");const a={reader:s.getReader()};e.push(a),r(a)},enqueue(s){this.addStream(new ReadableStream({start(a){a.enqueue(s),a.close()}}))}}};class ZJ{_controller;_isClosed=!1;constructor(t){this._controller=t}append(t){return this._controller.enqueue({type:"text-delta",path:[],textDelta:t}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}const jZ=e=>new ReadableStream({start(t){return e.start?.(new ZJ(t))},pull(t){return e.pull?.(new ZJ(t))},cancel(t){return e.cancel?.(t)}}),eV=()=>{let e;return[jZ({start(n){e=n}}),e]};class tV{_controller;_isClosed=!1;_mergeTask;constructor(t){this._controller=t;const n=jZ({start:r=>{this._argsTextController=r}});let o=!1;this._mergeTask=n.pipeTo(new WritableStream({write:r=>{switch(r.type){case"text-delta":o=!0,this._controller.enqueue(r);break;case"part-finish":o||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw new Error(`Unexpected chunk type: ${r.type}`)}}}))}get argsText(){return this._argsTextController}_argsTextController;async setResponse(t){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...t.artifact!==void 0?{artifact:t.artifact}:{},result:t.result,isError:t.isError??!1})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}const Cbe=e=>new ReadableStream({start(t){return e.start?.(new tV(t))},pull(t){return e.pull?.(new tV(t))},cancel(t){return e.cancel?.(t)}}),wbe=()=>{let e;return[Cbe({start(n){e=n}}),e]};class DZ{value=-1;up(){return++this.value}}class Obe extends TransformStream{constructor(t){super({transform(n,o){o.enqueue({...n,path:[t,...n.path]})}})}}class LNt extends TransformStream{constructor(t){super({transform(n,o){const{path:[r,...i]}=n;if(t!==r)throw new Error(`Path mismatch: expected ${t}, got ${r}`);o.enqueue({...n,path:i})}})}}class Tbe extends TransformStream{constructor(t){const n=new DZ,o=new Map;super({transform(r,i){r.type==="part-start"&&r.path.length===0&&o.set(n.up(),t.up());const[s,...a]=r.path;if(s===void 0){i.enqueue(r);return}const c=o.get(s);if(c===void 0)throw new Error("Path not found");i.enqueue({...r,path:[c,...a]})}})}}class Rbe extends TransformStream{constructor(t){super();const n=t(super.readable);Object.defineProperty(this,"readable",{value:n,writable:!1})}}class NZ extends TransformStream{constructor(){const t=[];super({transform(n,o){if(n.type==="part-start"){if(n.path.length!==0){o.error(new Error("Nested parts are not supported"));return}t.push(n.part),o.enqueue(n);return}if(n.type==="text-delta"||n.type==="result"||n.type==="part-finish"||n.type==="tool-call-args-text-finish"){if(n.path.length!==1){o.error(new Error(`${n.type} chunks must have a path of length 1`));return}const r=n.path[0];if(r<0||r>=t.length){o.error(new Error(`Invalid path index: ${r}`));return}const i=t[r];o.enqueue({...n,meta:i});return}o.enqueue(n)}})}}const Ebe=PZ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);class AF{_state;_parentId;constructor(t){this._state=t||{merger:Sbe(),contentCounter:new DZ}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(t){this._state.closeSubscriber=t}_addPart(t,n){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:t,path:[]}),this._state.merger.addStream(n.pipeThrough(new Obe(this._state.contentCounter.value)))}merge(t){this._state.merger.addStream(t.pipeThrough(new Tbe(this._state.contentCounter)))}appendText(t){this._state.append?.kind!=="text"&&(this._state.append={kind:"text",controller:this.addTextPart()}),this._state.append.controller.append(t)}appendReasoning(t){this._state.append?.kind!=="reasoning"&&(this._state.append={kind:"reasoning",controller:this.addReasoningPart()}),this._state.append.controller.append(t)}addTextPart(){const[t,n]=eV();return this._addPart({type:"text"},t),n}addReasoningPart(){const[t,n]=eV();return this._addPart({type:"reasoning"},t),n}addToolCallPart(t){const n=typeof t=="string"?{toolName:t}:t,o=n.toolName,r=n.toolCallId??Ebe(),[i,s]=wbe();return this._addPart({type:"tool-call",toolName:o,toolCallId:r,...this._parentId&&{parentId:this._parentId}},i),n.argsText!==void 0&&(s.argsText.append(n.argsText),s.argsText.close()),n.args!==void 0&&(s.argsText.append(JSON.stringify(n.args)),s.argsText.close()),n.response!==void 0&&s.setResponse(n.response),s}appendSource(t){this._addPart({...t,...this._parentId&&{parentId:this._parentId}},new ReadableStream({start(n){n.enqueue({type:"part-finish",path:[]}),n.close()}}))}appendFile(t){this._addPart(t,new ReadableStream({start(n){n.enqueue({type:"part-finish",path:[]}),n.close()}}))}enqueue(t){this._state.merger.enqueue(t),t.type==="part-start"&&t.path.length===0&&this._state.contentCounter.up()}withParentId(t){const n=new AF(this._state);return n._parentId=t,n}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}}function Mbe(e){const t=new AF;return(async()=>{try{await e(t)}catch(o){throw t.__internal_isClosed||t.enqueue({type:"error",path:[],error:String(o)}),o}finally{t.__internal_isClosed||t.close()}})(),t.__internal_getReadable()}function Pbe(){const{resolve:e,promise:t}=yF();let n;return[Mbe(r=>(n=r,n.__internal_subscribeToClose(e),t)),n]}const TM=(e,t,n)=>{const{role:o,id:r,createdAt:i,attachments:s,status:a,metadata:c}=e,p={id:r??t,createdAt:i??new Date},u=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,l=({image:d,...f})=>d.match(/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/)?{...f,image:d}:(console.warn("Invalid image data format detected"),null);if(o!=="user"&&s?.length)throw new Error("attachments are only supported for user messages");if(o!=="assistant"&&a)throw new Error("status is only supported for assistant messages");if(o!=="assistant"&&c?.steps)throw new Error("metadata.steps is only supported for assistant messages");switch(o){case"assistant":return{...p,role:o,content:u.map(d=>{const f=d.type;switch(f){case"text":case"reasoning":return d.text.trim().length===0?null:d;case"file":case"source":return d;case"image":return l(d);case"data":return d;case"tool-call":{const{parentId:h,messages:m,...g}=d,y={...g,toolCallId:d.toolCallId??`tool-${OM()}`,...h!==void 0&&{parentId:h},...m!==void 0&&{messages:m}};return d.args?{...y,args:d.args,argsText:d.argsText??JSON.stringify(d.args)}:{...y,args:I2(d.argsText??"")??{},argsText:d.argsText??""}}default:{const h=f;throw new Error(`Unsupported assistant message part type: ${h}`)}}}).filter(d=>!!d),status:a??n,metadata:{unstable_state:c?.unstable_state??null,unstable_annotations:c?.unstable_annotations??[],unstable_data:c?.unstable_data??[],custom:c?.custom??{},steps:c?.steps??[],...c?.submittedFeedback&&{submittedFeedback:c.submittedFeedback}}};case"user":return{...p,role:o,content:u.map(d=>{const f=d.type;switch(f){case"text":case"image":case"audio":case"file":return d;default:{const h=f;throw new Error(`Unsupported user message part type: ${h}`)}}}),attachments:s??[],metadata:{custom:c?.custom??{}}};case"system":if(u.length!==1||u[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...p,role:o,content:u,metadata:{custom:c?.custom??{}}};default:{const d=o;throw new Error(`Unknown message role: ${d}`)}}},_F={fromArray:e=>{const t=e.map(n=>TM(n,OM(),bF(!1,!1,!1,!1,void 0)));return{messages:t.map((n,o)=>({parentId:o>0?t[o-1].id:null,message:n}))}}},uR=e=>e.next?uR(e.next):"current"in e?e:null;class Ibe{func;_value=null;constructor(t){this.func=t}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}}class vF{messages=new Map;head=null;root={children:[],next:null};updateLevels(t,n){t.level=n;for(const o of t.children){const r=this.messages.get(o);r&&this.updateLevels(r,n+1)}}performOp(t,n,o){const r=n.prev??this.root,i=t??this.root;if(!(o==="relink"&&r===i)){if(o!=="link"&&(r.children=r.children.filter(s=>s!==n.current.id),r.next===n)){const s=r.children.at(-1),a=s?this.messages.get(s):null;if(a===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");r.next=a}if(o!=="cut"){for(let a=t;a;a=a.prev)if(a.current.id===n.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");i.children=[...i.children,n.current.id],(uR(n)===this.head||i.next===null)&&(i.next=n),n.prev=t;const s=t?t.level+1:0;this.updateLevels(n,s)}}}_messages=new Ibe(()=>{const t=new Array((this.head?.level??-1)+1);for(let n=this.head;n;n=n.prev)t[n.level]=n.current;return t});get headId(){return this.head?.current.id??null}getMessages(t){if(t===void 0||t===this.head?.current.id)return this._messages.value;const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");const o=new Array(n.level+1);for(let r=n;r;r=r.prev)o[r.level]=r.current;return o}addOrUpdateMessage(t,n){const o=this.messages.get(n.id),r=t?this.messages.get(t):null;if(r===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(o){o.current=n,this.performOp(r,o,"relink"),this._messages.dirty();return}const i={prev:r,current:n,next:null,children:[],level:r?r.level+1:0};this.messages.set(n.id,i),this.performOp(r,i,"link"),this.head===r&&(this.head=i),this._messages.dirty()}getMessage(t){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:n.prev?.current.id??null,message:n.current,index:n.level}}appendOptimisticMessage(t,n){let o;do o=dbe();while(this.messages.has(o));return this.addOrUpdateMessage(t,TM(n,o,{type:"running"})),o}deleteMessage(t,n){const o=this.messages.get(t);if(!o)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const r=n===void 0?o.prev:n===null?null:this.messages.get(n);if(r===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const i of o.children){const s=this.messages.get(i);if(!s)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(r,s,"relink")}this.performOp(null,o,"cut"),this.messages.delete(t),this.head===o&&(this.head=uR(r??this.root)),this._messages.dirty()}getBranches(t){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:o}=n.prev??this.root;return o}switchToBranch(t){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const o=n.prev??this.root;o.next=n,this.head=uR(n),this._messages.dirty()}resetHead(t){if(t===null){this.clear();return}const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");if(n.children.length>0){const o=r=>{for(const i of r.children){const s=this.messages.get(i);s&&(o(s),this.messages.delete(i))}};o(n),n.children=[],n.next=null}this.head=n;for(let o=n;o;o=o.prev)o.prev&&(o.prev.next=o);this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){const t=[];for(const[,n]of this.messages)t.push({message:n.current,parentId:n.prev?.current.id??null});return{headId:this.head?.current.id??null,messages:t}}import({headId:t,messages:n}){for(const{message:o,parentId:r}of n)this.addOrUpdateMessage(r,o);this.resetHead(t??n.at(-1)?.message.id??null)}}class RM{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(){for(const t of this._subscriptions)t()}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(t){return this._subscriptions.add(t),this._updateConnection(),()=>{this._subscriptions.delete(t),this._updateConnection()}}}const ws=Symbol("skip-update");class SF extends RM{binding;get path(){return this.binding.path}constructor(t){super(),this.binding=t}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){const t=this.binding.getState();t!==ws&&(this._previousState=t),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState};_connect(){const t=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(t)}}class vO{_core;_threadListBinding;get path(){return this._core.path}constructor(t,n){this._core=t,this._threadListBinding=n,this.__internal_bindMethods()}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(){const t=this._core.getState();return this._threadListBinding.switchToThread(t.id)}rename(t){const n=this._core.getState();return this._threadListBinding.rename(n.id,t)}archive(){const t=this._core.getState();return this._threadListBinding.archive(t.id)}unarchive(){const t=this._core.getState();return this._threadListBinding.unarchive(t.id)}delete(){const t=this._core.getState();return this._threadListBinding.delete(t.id)}initialize(){const t=this._core.getState();return this._threadListBinding.initialize(t.id)}generateTitle(){const t=this._core.getState();return this._threadListBinding.generateTitle(t.id)}unstable_on(t,n){let o=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{const i=this._core.getState(),s=i.isMain,a=i.id;o===s&&r===a||(o=s,r=a,!(t==="switched-to"&&!s)&&(t==="switched-away"&&s||n()))})}subscribe(t){return this._core.subscribe(t)}detach(){const t=this._core.getState();this._threadListBinding.detach(t.id)}__internal_getRuntime(){return this}}function jbe(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;for(const n of Object.keys(e)){const o=e[n],r=t[n];if(!Object.is(o,r))return!1}return!0}class ms extends RM{binding;get path(){return this.binding.path}constructor(t){super(),this.binding=t;const n=t.getState();if(n===ws)throw new Error("Entry not available in the store");this._previousState=n}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){const t=this.binding.getState();return t===ws||jbe(t,this._previousState)?!1:(this._previousState=t,!0)}_connect(){const t=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(t)}}const dA=Symbol("innerMessage"),Dbe=e=>e[dA],j0=e=>e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);class g6{_core;get path(){return this._core.path}constructor(e){this._core=e,this.__internal_bindMethods()}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(e){return this._core.subscribe(e)}}class m6 extends g6{_composerApi;constructor(e,n){super(e),this._composerApi=n}remove(){const e=this._composerApi.getState();if(!e)throw new Error("Composer is not available");return e.removeAttachment(this.getState().id)}}class AX extends m6{get source(){return"thread-composer"}}class yX extends m6{get source(){return"edit-composer"}}class vX extends g6{get source(){return"message"}constructor(e){super(e)}remove(){throw new Error("Message attachments cannot be removed")}}class A6 extends Gb{config;constructor(e){super(),this.config=e}getState(){return this.config.binding.getState()}outerSubscribe(e){return this.config.binding.subscribe(e)}_connect(){const e=()=>{this.notifySubscribers()};let n=this.config.binding.getState(),i=n?.unstable_on(this.config.event,e);const r=()=>{const o=this.config.binding.getState();o!==n&&(n=o,i?.(),i=this.config.binding.getState()?.unstable_on(this.config.event,e))},s=this.outerSubscribe(r);return()=>{s?.(),i?.()}}}const y6=Object.freeze([]),v6=Object.freeze({}),bX=t=>Object.freeze({type:"thread",isEditing:t?.isEditing??!1,canCancel:t?.canCancel??!1,isEmpty:t?.isEmpty??!0,attachments:t?.attachments??y6,text:t?.text??"",role:t?.role??"user",runConfig:t?.runConfig??v6,attachmentAccept:t?.attachmentAccept??"",value:t?.text??""}),wX=t=>Object.freeze({type:"edit",isEditing:t?.isEditing??!1,canCancel:t?.canCancel??!1,isEmpty:t?.isEmpty??!0,text:t?.text??"",role:t?.role??"user",attachments:t?.attachments??y6,runConfig:t?.runConfig??v6,attachmentAccept:t?.attachmentAccept??"",value:t?.text??""});class b6{_core;get path(){return this._core.path}constructor(e){this._core=e}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(e){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setText(e)}setRunConfig(e){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRunConfig(e)}addAttachment(e){const n=this._core.getState();if(!n)throw new Error("Composer is not available");return n.addAttachment(e)}reset(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");return e.reset()}clearAttachments(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");return e.clearAttachments()}send(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.send()}cancel(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.cancel()}setRole(e){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRole(e)}subscribe(e){return this._core.subscribe(e)}_eventSubscriptionSubjects=new Map;unstable_on(e,n){let i=this._eventSubscriptionSubjects.get(e);return i||(i=new A6({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,i)),i.subscribe(n)}}class SX extends b6{get path(){return this._core.path}get type(){return"thread"}_getState;constructor(e){const n=new wT({path:e.path,getState:()=>bX(e.getState()),subscribe:i=>e.subscribe(i)});super({path:e.path,getState:()=>e.getState(),subscribe:i=>n.subscribe(i)}),this._getState=n.getState.bind(n),this.__internal_bindMethods()}getState(){return this._getState()}getAttachmentByIndex(e){return new AX(new ys({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:e},ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`},getState:()=>{const i=this.getState().attachments[e];return i?{...i,source:"thread-composer"}:Ts},subscribe:n=>this._core.subscribe(n)}),this._core)}}class CX extends b6{_beginEdit;get path(){return this._core.path}get type(){return"edit"}_getState;constructor(e,n){const i=new wT({path:e.path,getState:()=>wX(e.getState()),subscribe:r=>e.subscribe(r)});super({path:e.path,getState:()=>e.getState(),subscribe:r=>i.subscribe(r)}),this._beginEdit=n,this._getState=i.getState.bind(i),this.__internal_bindMethods()}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(e){return new yX(new ys({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:e},ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`},getState:()=>{const i=this.getState().attachments[e];return i?{...i,source:"edit-composer"}:Ts},subscribe:n=>this._core.subscribe(n)}),this._core)}}const EN=Symbol.for("aui.tool-response");class Ss{get[EN](){return!0}artifact;result;isError;constructor(e){e.artifact!==void 0&&(this.artifact=e.artifact),this.result=e.result,this.isError=e.isError??!1}static[Symbol.hasInstance](e){return typeof e=="object"&&e!==null&&EN in e}static toResponse(e){return e instanceof Ss?e:new Ss({result:e===void 0?"":e})}}function xX(t,e,n){try{const i=t();if(typeof i=="object"&&i!==null&&"then"in i)return i.then(e,n);e(i)}catch(i){n(i)}}function jg(t,e){let n=t;for(const i of e){if(n==null)return;n=n[i]}return n}class EX{resolve;reject;disposed=!1;fieldPath;constructor(e,n,i){this.resolve=e,this.reject=n,this.fieldPath=i}update(e){if(!this.disposed)try{if(Qd(e,this.fieldPath)==="complete"){const n=jg(e,this.fieldPath);n!==void 0&&(this.resolve(n),this.dispose())}}catch(n){this.reject(n),this.dispose()}}dispose(){this.disposed=!0}}class _N{controller;disposed=!1;fieldPath;constructor(e,n){this.controller=e,this.fieldPath=n}update(e){if(!this.disposed)try{const n=jg(e,this.fieldPath);n!==void 0&&this.controller.enqueue(n),Qd(e,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(n){this.controller.error(n),this.dispose()}}dispose(){this.disposed=!0}}class TN{controller;disposed=!1;fieldPath;lastValue=void 0;constructor(e,n){this.controller=e,this.fieldPath=n}update(e){if(!this.disposed)try{const n=jg(e,this.fieldPath);if(n!==void 0&&typeof n=="string"){const i=n.substring(this.lastValue?.length||0);this.lastValue=n,this.controller.enqueue(i)}Qd(e,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(n){this.controller.error(n),this.dispose()}}dispose(){this.disposed=!0}}class RN{controller;disposed=!1;fieldPath;processedIndexes=new Set;constructor(e,n){this.controller=e,this.fieldPath=n}update(e){if(!this.disposed)try{const n=jg(e,this.fieldPath);if(!Array.isArray(n))return;for(let i=0;i{const r=new EX(n,i,e);if(this.args&&Qd(this.args,e)==="complete"){const s=jg(this.args,e);if(s!==void 0){n(s);return}}this.handles.add(r),r.update(this.args)})}streamValues(...e){const n=e,i=new ReadableStream({start:r=>{const s=new _N(r,n);this.handles.add(s),s.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof _N){r.dispose(),this.handles.delete(r);break}}});return gx(i)}streamText(...e){const n=e,i=new ReadableStream({start:r=>{const s=new TN(r,n);this.handles.add(s),s.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof TN){r.dispose(),this.handles.delete(r);break}}});return gx(i)}forEach(...e){const n=e,i=new ReadableStream({start:r=>{const s=new RN(r,n);this.handles.add(s),s.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof RN){r.dispose(),this.handles.delete(r);break}}});return gx(i)}}class TX{promise;constructor(e){this.promise=e}get(){return this.promise}}class RX{args;response;writable;resolve;argsText="";constructor(){const e=new TransformStream;this.writable=e.writable,this.args=new _X(e.readable);const{promise:n,resolve:i}=AT();this.resolve=i,this.response=new TX(n)}async appendArgsTextDelta(e){const n=this.writable.getWriter();try{await n.write(e)}catch(i){console.warn(i)}finally{n.releaseLock()}this.argsText+=e}setResponse(e){this.resolve(e)}result={get:async()=>(await this.response.get()).result}}class kX extends uX{constructor(e){const n=new Map,i=new Map;super(r=>{const s=new TransformStream({transform(o,a){switch((o.type!=="part-finish"||o.meta.type!=="tool-call")&&a.enqueue(o),o.type){case"part-start":if(o.part.type==="tool-call"){const u=new RX;i.set(o.part.toolCallId,u),e.streamCall({reader:u,toolCallId:o.part.toolCallId,toolName:o.part.toolName})}break;case"text-delta":{if(o.meta.type==="tool-call"){const u=o.meta.toolCallId,d=i.get(u);if(!d)throw new Error("No controller found for tool call");d.appendArgsTextDelta(o.textDelta)}break}case"result":{if(o.meta.type!=="tool-call")break;const{toolCallId:u}=o.meta,d=i.get(u);if(!d)throw new Error("No controller found for tool call");d.setResponse(new Ss({result:o.result,artifact:o.artifact,isError:o.isError}));break}case"tool-call-args-text-finish":{if(o.meta.type!=="tool-call")break;const{toolCallId:u,toolName:d}=o.meta,f=i.get(u);if(!f)throw new Error("No controller found for tool call");let g=!1;const m=xX(()=>{let v;try{v=k1.parse(f.argsText)}catch(C){throw new Error(`Function parameter parsing failed. ${JSON.stringify(C.message)}`)}const S=e.execute({toolCallId:u,toolName:d,args:v});return S!==void 0&&(g=!0,e.onExecutionStart?.(u,d)),S},v=>{if(g&&e.onExecutionEnd?.(u,d),v===void 0)return;const S=new Ss({artifact:v.artifact,result:v.result,isError:v.isError});f.setResponse(S),a.enqueue({type:"result",path:o.path,...S})},v=>{g&&e.onExecutionEnd?.(u,d);const S=new Ss({result:String(v),isError:!0});f.setResponse(S),a.enqueue({type:"result",path:o.path,...S})});m&&n.set(u,m);break}case"part-finish":{if(o.meta.type!=="tool-call")break;const{toolCallId:u}=o.meta,d=n.get(u);d?d.then(()=>{n.delete(u),i.delete(u),a.enqueue(o)}):a.enqueue(o)}}},async flush(){await Promise.all(n.values())}});return r.pipeThrough(new p6).pipeThrough(s)})}}const IX=t=>typeof t=="object"&&t!==null&&"~standard"in t&&t["~standard"].version===1;function MX(t,e,n,i){const r=t?.[n.toolName];return!r||!r.execute?void 0:(async o=>{if(e.aborted)return new Ss({result:"Tool execution was cancelled.",isError:!0});let a=o;if(IX(r.parameters)){let d=r.parameters["~standard"].validate(n.args);d instanceof Promise&&(d=await d),d.issues&&(a=r.experimental_onSchemaValidationError??(()=>{throw new Error(`Function parameter validation failed. ${JSON.stringify(d.issues)}`)}))}const l=new Promise(d=>{const f=()=>{queueMicrotask(()=>{queueMicrotask(()=>{d(new Ss({result:"Tool execution was cancelled.",isError:!0}))})})};e.aborted?f():e.addEventListener("abort",f,{once:!0})}),u=(async()=>{const d=await a(n.args,{toolCallId:n.toolCallId,abortSignal:e,human:f=>i(n.toolCallId,f)});return Ss.toResponse(d)})();return Promise.race([u,l])})(r.execute)}function DX(t,e,n,i,r){t?.[i.toolName]?.streamCall?.(n,{toolCallId:i.toolCallId,abortSignal:e,human:s=>r(i.toolCallId,s)})}function PX(t,e,n,i){const r=typeof t=="function"?t:()=>t,s=typeof e=="function"?e:()=>e;return new kX({execute:o=>MX(r(),s(),o,n),streamCall:({reader:o,...a})=>DX(r(),s(),o,a,n),onExecutionStart:i?.onExecutionStart,onExecutionEnd:i?.onExecutionEnd})}class kN{contentBinding;messageApi;threadApi;get path(){return this.contentBinding.path}constructor(e,n,i){this.contentBinding=e,this.messageApi=n,this.threadApi=i,this.__internal_bindMethods()}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(e){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const i=this.messageApi.getState();if(!i)throw new Error("Message is not available");const r=n.toolName,s=n.toolCallId,o=Ss.toResponse(e);this.threadApi.getState().addToolResult({messageId:i.id,toolName:r,toolCallId:s,result:o.result,artifact:o.artifact,isError:o.isError})}resumeToolCall(e){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw new Error("Thread API is not available");const i=n.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:i,payload:e})}subscribe(e){return this.contentBinding.subscribe(e)}}class uv extends Gb{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}getState(){return this.binding.getState()}outerSubscribe(e){return this.binding.subscribe(e)}_connect(){const e=()=>{this.notifySubscribers()};let n=this.binding.getState(),i=n?.subscribe(e);const r=()=>{const o=this.binding.getState();o!==n&&(n=o,i?.(),i=this.binding.getState()?.subscribe(e),e())},s=this.outerSubscribe(r);return()=>{s?.(),i?.()}}}const jA=Object.freeze({type:"complete"}),NX=(t,e,n)=>{if(t.role!=="assistant")return jA;if(n.type==="tool-call")return n.result?jA:t.status;const i=e===Math.max(0,t.content.length-1);return t.status.type==="requires-action"?jA:i?t.status:jA},IN=(t,e)=>{const n=t.content[e];if(!n)return Ts;const i=NX(t,e,n);return Object.freeze({...n,[Gd]:n[Gd],status:i})};class OX{_core;_threadBinding;get path(){return this._core.path}constructor(e,n){this._core=e,this._threadBinding=n,this.composer=new CX(new uv({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:i=>this._threadBinding.subscribe(i)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}reload(e={}){const n=this._getEditComposerRuntimeCore(),i=n??this._threadBinding.getState().composer,r=n??i,{runConfig:s=r.runConfig}=e,o=this._core.getState();if(o.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:o.parentId,sourceId:o.id,runConfig:s})}speak(){const e=this._core.getState();return this._threadBinding.getState().speak(e.id)}stopSpeaking(){const e=this._core.getState();if(this._threadBinding.getState().speech?.messageId===e.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:e}){const n=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:n.id,type:e})}switchToBranch({position:e,branchId:n}){const i=this._core.getState();if(n&&e)throw new Error("May not specify both branchId and position");if(!n&&!e)throw new Error("Must specify either branchId or position");const s=this._threadBinding.getState().getBranches(i.id);let o=n;if(e==="previous"?o=s[i.branchNumber-2]:e==="next"&&(o=s[i.branchNumber]),!o)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(o)}unstable_getCopyText(){return tg(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw new Error("Message part index must be >= 0");return new kN(new ys({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:"index",index:e}},getState:()=>IN(this.getState(),e),subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new kN(new ys({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(e)}]`,messagePartSelector:{type:"toolCallId",toolCallId:e}},getState:()=>{const n=this._core.getState(),i=n.content.findIndex(r=>r.type==="tool-call"&&r.toolCallId===e);return i===-1?Ts:IN(n,i)},subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new vX(new ys({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:e}},getState:()=>{const i=this.getState().attachments?.[e];return i?{...i,source:"message"}:Ts},subscribe:n=>this._core.subscribe(n)}))}}const BX=t=>({parentId:t.parentId??null,sourceId:t.sourceId??null,runConfig:t.runConfig??{},...t.stream?{stream:t.stream}:{}}),LX=t=>({parentId:t.parentId??null,sourceId:t.sourceId??null,runConfig:t.runConfig??{}}),UX=(t,e)=>typeof e=="string"?{createdAt:new Date,parentId:t.at(-1)?.id??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:e}],attachments:[],metadata:{custom:{}}}:{createdAt:e.createdAt??new Date,parentId:e.parentId??t.at(-1)?.id??null,sourceId:e.sourceId??null,role:e.role??"user",content:e.content,attachments:e.attachments??[],metadata:e.metadata??{custom:{}},runConfig:e.runConfig??{},startRun:e.startRun},VX=(t,e)=>{const n=t.messages.at(-1);return Object.freeze({threadId:e.id,metadata:e,capabilities:t.capabilities,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:n?.role!=="assistant"?!1:n.status.type==="running",messages:t.messages,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech})};class w6{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(e,n){const i=new ys({path:e.path,getState:()=>VX(e.getState(),n.getState()),subscribe:r=>{const s=e.subscribe(r),o=n.subscribe(r);return()=>{s(),o()}}});this._threadBinding={path:e.path,getState:()=>e.getState(),getStateState:()=>i.getState(),outerSubscribe:r=>e.outerSubscribe(r),subscribe:r=>e.subscribe(r)},this.composer=new SX(new uv({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:r=>this._threadBinding.subscribe(r)})),this.__internal_bindMethods()}__internal_bindMethods(){this.append=this.append.bind(this),this.unstable_resumeRun=this.unstable_resumeRun.bind(this),this.unstable_loadExternalState=this.unstable_loadExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getModelConfig=this.getModelConfig.bind(this),this.getState=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(e){this._threadBinding.getState().append(UX(this._threadBinding.getState().messages,e))}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}getModelConfig(){return this.getModelContext()}startRun(e){const n=e===null||typeof e=="string"?{parentId:e}:e;return this._threadBinding.getState().startRun(LX(n))}unstable_resumeRun(e){return this._threadBinding.getState().resumeRun(BX(e))}unstable_loadExternalState(e){this._threadBinding.getState().unstable_loadExternalState(e)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}export(){return this._threadBinding.getState().export()}import(e){this._threadBinding.getState().import(e)}reset(e){this._threadBinding.getState().reset(e)}getMessageByIndex(e){if(e<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}${this.path.ref}.messages[${e}]`,messageSelector:{type:"index",index:e}},()=>{const n=this._threadBinding.getState().messages,i=n[e];if(i)return{message:i,parentId:n[e-1]?.id??null,index:e}})}getMessageById(e){return this._getMessageRuntime({...this.path,ref:this.path.ref+`${this.path.ref}.messages[messageId=${JSON.stringify(e)}]`,messageSelector:{type:"messageId",messageId:e}},()=>this._threadBinding.getState().getMessageById(e))}_getMessageRuntime(e,n){return new OX(new ys({path:e,getState:()=>{const{message:i,parentId:r,index:s}=n()??{},{messages:o,speech:a}=this._threadBinding.getState();if(!i||r===void 0||s===void 0)return Ts;const u=this._threadBinding.getState().getBranches(i.id),d=i.metadata.submittedFeedback;return{...i,[Gd]:i[Gd],index:s,isLast:o.at(-1)?.id===i.id,parentId:r,branchNumber:u.indexOf(i.id)+1,branchCount:u.length,speech:a?.messageId===i.id?a:void 0,submittedFeedback:d}},subscribe:i=>this._threadBinding.subscribe(i)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(e,n){let i=this._eventSubscriptionSubjects.get(e);return i||(i=new A6({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,i)),i.subscribe(n)}}const FX=t=>({mainThreadId:t.mainThreadId,newThread:t.newThreadId,threads:t.threadIds,archivedThreads:t.archivedThreadIds,isLoading:t.isLoading,threadItems:t.threadData}),KA=(t,e)=>{if(e===void 0)return Ts;const n=t.getItemById(e);return n?{id:n.id,threadId:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,isMain:n.id===t.mainThreadId}:Ts};class HX{_core;_runtimeFactory;_getState;constructor(e,n=w6){this._core=e,this._runtimeFactory=n;const i=new wT({path:{},getState:()=>FX(e),subscribe:r=>e.subscribe(r)});this._getState=i.getState.bind(i),this._mainThreadListItemRuntime=new WA(new ys({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>KA(this._core,this._core.mainThreadId),subscribe:r=>this._core.subscribe(r)}),this._core),this.main=new n(new uv({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>e.getMainThreadRuntimeCore(),subscribe:r=>e.subscribe(r)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(e){return this._core.switchToThread(e)}switchToNewThread(){return this._core.switchToNewThread()}getState(){return this._getState()}subscribe(e){return this._core.subscribe(e)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(e){return new this._runtimeFactory(new uv({path:{ref:`threads[threadId=${JSON.stringify(e)}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>this._core.getThreadRuntimeCore(e),subscribe:n=>this._core.subscribe(n)}),this.mainItem)}getItemByIndex(e){return new WA(new ys({path:{ref:`threadItems[${e}]`,threadSelector:{type:"index",index:e}},getState:()=>KA(this._core,this._core.threadIds[e]),subscribe:n=>this._core.subscribe(n)}),this._core)}getArchivedItemByIndex(e){return new WA(new ys({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:"archiveIndex",index:e}},getState:()=>KA(this._core,this._core.archivedThreadIds[e]),subscribe:n=>this._core.subscribe(n)}),this._core)}getItemById(e){return new WA(new ys({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>KA(this._core,e),subscribe:n=>this._core.subscribe(n)}),this._core)}}class zX{accept="image/*";async add(e){return{id:e.file.name,type:"image",name:e.file.name,contentType:e.file.type,file:e.file,status:{type:"requires-action",reason:"composer-send"}}}async send(e){return{...e,status:{type:"complete"},content:[{type:"image",image:await QX(e.file)}]}}async remove(){}}const QX=t=>new Promise((e,n)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r=>n(r),i.readAsDataURL(t)});class GX{accept="text/plain,text/html,text/markdown,text/csv,text/xml,text/json,text/css";async add(e){return{id:e.file.name,type:"document",name:e.file.name,contentType:e.file.type,file:e.file,status:{type:"requires-action",reason:"composer-send"}}}async send(e){return{...e,status:{type:"complete"},content:[{type:"text",text:` -${await $X(e.file)} -`}]}}async remove(){}}const $X=t=>new Promise((e,n)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r=>n(r),i.readAsText(t)});function mx(t,e){if(e==="*")return!0;const n=e.split(",").map(s=>s.trim().toLowerCase()),i=`.${t.name.split(".").pop().toLowerCase()}`,r=t.type.toLowerCase();for(const s of n){if(s.startsWith(".")&&s===i||s.includes("/")&&s===r)return!0;if((s==="image/*"||s==="video/*"||s==="audio/*")&&s.endsWith("/*")){const o=s.split("/")[0];if(r.startsWith(`${o}/`))return!0}}return!1}class WX{_adapters;accept;constructor(e){this._adapters=e;const n=e.findIndex(i=>i.accept==="*");if(n!==-1){if(n!==e.length-1)throw new Error("A wildcard adapter (handling all files) can only be specified as the last adapter.");this.accept="*"}else this.accept=e.map(i=>i.accept).join(",")}add(e){for(const n of this._adapters)if(mx(e.file,n.accept))return n.add(e);throw new Error("No matching adapter found for file")}async send(e){const n=this._adapters.slice();for(const i of n)if(mx(e.file,i.accept))return i.send(e);throw new Error("No matching adapter found for attachment")}async remove(e){const n=this._adapters.slice();for(const i of n)if(mx({name:e.name,type:e.contentType},i.accept))return i.remove(e);throw new Error("No matching adapter found for attachment")}}const jX=T.createContext(null),KX=()=>T.useContext(jX),lc=Object.freeze([]),Cc="DEFAULT_THREAD_ID",YX=Object.freeze([Cc]),S6=Object.freeze({id:Cc,remoteId:void 0,externalId:void 0,status:"regular"}),qX=Promise.resolve(),MN=Object.freeze({[Cc]:S6});class JX{adapter;threadFactory;_mainThreadId=Cc;_threads=YX;_archivedThreads=lc;_threadData=MN;get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadData(){return this._threadData}getLoadThreadsPromise(){return qX}_mainThread;get mainThreadId(){return this._mainThreadId}constructor(e={},n){this.adapter=e,this.threadFactory=n,this._mainThread=this.threadFactory(),this.__internal_setAdapter(e,!0)}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getItemById(e){for(const n of this.adapter.threads??[])if(n.id===e)return n;for(const n of this.adapter.archivedThreads??[])if(n.id===e)return n;if(e===Cc)return S6}__internal_setAdapter(e,n=!1){const i=this.adapter;this.adapter=e;const r=e.threadId??Cc,s=e.threads??lc,o=e.archivedThreads??lc,a=i.threadId??Cc,l=i.threads??lc,u=i.archivedThreads??lc;!n&&a===r&&l===s&&u===o||(this._threadData={...MN,...Object.fromEntries(e.threads?.map(d=>[d.id,{...d,remoteId:d.remoteId,externalId:d.externalId,status:"regular"}])??[]),...Object.fromEntries(e.archivedThreads?.map(d=>[d.id,{...d,remoteId:d.remoteId,externalId:d.externalId,status:"archived"}])??[])},l!==s&&(this._threads=this.adapter.threads?.map(d=>d.id)??lc),u!==o&&(this._archivedThreads=this.adapter.archivedThreads?.map(d=>d.id)??lc),a!==r&&(this._mainThreadId=r,this._mainThread=this.threadFactory()),this._notifySubscribers())}async switchToThread(e){if(this._mainThreadId===e)return;const n=this.adapter.onSwitchToThread;if(!n)throw new Error("External store adapter does not support switching to thread");n(e)}async switchToNewThread(){const e=this.adapter.onSwitchToNewThread;if(!e)throw new Error("External store adapter does not support switching to new thread");e()}async rename(e,n){const i=this.adapter.onRename;if(!i)throw new Error("External store adapter does not support renaming");i(e,n)}async detach(){}async archive(e){const n=this.adapter.onArchive;if(!n)throw new Error("External store adapter does not support archiving");n(e)}async unarchive(e){const n=this.adapter.onUnarchive;if(!n)throw new Error("External store adapter does not support unarchiving");n(e)}async delete(e){const n=this.adapter.onDelete;if(!n)throw new Error("External store adapter does not support deleting");n(e)}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){throw new Error("Method not implemented.")}_subscriptions=new Set;subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}_notifySubscribers(){for(const e of this._subscriptions)e()}}class DN{cache=new WeakMap;convertMessages(e,n){return e.map((i,r)=>{const s=this.cache.get(i),o=n(s,i,r);return this.cache.set(i,o),o})}}class XX extends l6{runtime;endEditCallback;get canCancel(){return!0}getAttachmentAdapter(){return this.runtime.adapters?.attachments}_nonTextParts;_previousText;_parentId;_sourceId;constructor(e,n,{parentId:i,message:r}){super(),this.runtime=e,this.endEditCallback=n,this._parentId=i,this._sourceId=r.id,this._previousText=tg(r),this.setText(this._previousText),this.setRole(r.role),this.setAttachments(r.attachments??[]),this._nonTextParts=r.content.filter(s=>s.type!=="text"),this.setRunConfig({...e.composer.runConfig})}async handleSend(e){tg(e)!==this._previousText&&this.runtime.append({...e,content:[...e.content,...this._nonTextParts],parentId:this._parentId,sourceId:this._sourceId}),this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}}class ZX{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new bT;get messages(){return this.repository.getMessages()}get state(){let e;for(const n of this.messages)if(n.role==="assistant"){e=n;break}return e?.metadata.unstable_state??null}composer=new c6(this);constructor(e){this._contextProvider=e}getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(e){return this._editComposers.get(e)}beginEdit(e){if(this._editComposers.has(e))throw new Error("Edit already in progress");this._editComposers.set(e,new XX(this,()=>this._editComposers.delete(e),this.repository.getMessage(e))),this._notifySubscribers()}getMessageById(e){try{return this.repository.getMessage(e)}catch{return}}getBranches(e){return this.repository.getBranches(e)}switchToBranch(e){this.repository.switchToBranch(e),this._notifySubscribers()}_notifySubscribers(){for(const e of this._subscriptions)e()}_notifyEventSubscribers(e){const n=this._eventSubscribers.get(e);if(n)for(const i of n)i()}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}submitFeedback({messageId:e,type:n}){const i=this.adapters?.feedback;if(!i)throw new Error("Feedback adapter not configured");const{message:r,parentId:s}=this.repository.getMessage(e);if(i.submit({message:r,type:n}),r.role==="assistant"){const o={...r,metadata:{...r.metadata,submittedFeedback:{type:n}}};this.repository.addOrUpdateMessage(s,o)}this._notifySubscribers()}_stopSpeaking;speech;speak(e){const n=this.adapters?.speech;if(!n)throw new Error("Speech adapter not configured");const{message:i}=this.repository.getMessage(e);this._stopSpeaking?.();const r=n.speak(tg(i)),s=r.subscribe(()=>{r.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:e,status:r.status},this._notifySubscribers()});this.speech={messageId:e,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),s(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize"))}export(){return this.repository.export()}import(e){this.ensureInitialized(),this.repository.clear(),this.repository.import(e),this._notifySubscribers()}reset(e){this.import(vT.fromArray(e??[]))}_eventSubscribers=new Map;unstable_on(e,n){if(e==="model-context-update")return this._contextProvider.subscribe?.(n)??(()=>{});const i=this._eventSubscribers.get(e);return i?i.add(n):this._eventSubscribers.set(e,new Set([n])),()=>{this._eventSubscribers.get(e).delete(n)}}}const eZ=Object.freeze([]),tZ=(t,e)=>t&&e[e.length-1]?.role!=="assistant";class nZ extends ZX{_assistantOptimisticId=null;_capabilities={switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,attachments:!1,feedback:!1};get capabilities(){return this._capabilities}_messages;isDisabled;get isLoading(){return this._store.isLoading??!1}get messages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}suggestions=[];extras=void 0;_converter=new DN;_store;beginEdit(e){if(!this._store.onEdit)throw new Error("Runtime does not support editing.");super.beginEdit(e)}constructor(e,n){super(e),this.__internal_setAdapter(n)}__internal_setAdapter(e){if(this._store===e)return;const n=e.isRunning??!1;this.isDisabled=e.isDisabled??!1;const i=this._store;this._store=e,this.extras=e.extras,this.suggestions=e.suggestions??eZ,this._capabilities={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:this._store.adapters?.speech!==void 0,unstable_copy:this._store.unstable_capabilities?.copy!==!1,attachments:!!this._store.adapters?.attachments,feedback:!!this._store.adapters?.feedback};let r;if(e.messageRepository){if(i&&i.isRunning===e.isRunning&&i.messageRepository===e.messageRepository){this._notifySubscribers();return}this.repository.clear(),this._assistantOptimisticId=null,this.repository.import(e.messageRepository),r=this.repository.getMessages()}else if(e.messages){if(i){if(i.convertMessage!==e.convertMessage)this._converter=new DN;else if(i.isRunning===e.isRunning&&i.messages===e.messages){this._notifySubscribers();return}}r=e.convertMessage?this._converter.convertMessages(e.messages,(s,o,a)=>{if(!e.convertMessage)return o;const l=a===e.messages.length-1,u=mT(l,n,!1,!1,void 0);if(s&&(s.role!=="assistant"||!ZJ(s.status)||s.status===u))return s;const d=e.convertMessage(o,a),f=Qb(d,a.toString(),u);return f[Gd]=o,f}):e.messages;for(let s=0;s0&&this.ensureInitialized(),(i?.isRunning??!1)!==(e.isRunning??!1)&&(e.isRunning?this._notifyEventSubscribers("run-start"):this._notifyEventSubscribers("run-end")),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null),tZ(n,r)&&(this._assistantOptimisticId=this.repository.appendOptimisticMessage(r.at(-1)?.id??null,{role:"assistant",content:[]})),this.repository.resetHead(this._assistantOptimisticId??r.at(-1)?.id??null),this._messages=this.repository.getMessages(),this._notifySubscribers()}switchToBranch(e){if(!this._store.setMessages)throw new Error("Runtime does not support switching branches.");this._store.isRunning||(this.repository.switchToBranch(e),this.updateMessages(this.repository.getMessages()))}async append(e){if(e.parentId!==(this.messages.at(-1)?.id??null)){if(!this._store.onEdit)throw new Error("Runtime does not support editing messages.");await this._store.onEdit(e)}else await this._store.onNew(e)}async startRun(e){if(!this._store.onReload)throw new Error("Runtime does not support reloading messages.");await this._store.onReload(e.parentId,e)}async resumeRun(e){if(!this._store.onResume)throw new Error("Runtime does not support resuming runs.");await this._store.onResume(e)}unstable_loadExternalState(e){if(!this._store.onLoadExternalState)throw new Error("Runtime does not support importing states.");this._store.onLoadExternalState(e)}cancelRun(){if(!this._store.onCancel)throw new Error("Runtime does not support cancelling runs.");this._store.onCancel(),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null);let e=this.repository.getMessages();const n=e[e.length-1];n?.role==="user"&&n.id===e.at(-1)?.id?(this.repository.deleteMessage(n.id),this.composer.text.trim()||this.composer.setText(tg(n)),e=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(e)},0)}addToolResult(e){if(!this._store.onAddToolResult&&!this._store.onAddToolResult)throw new Error("Runtime does not support tool results.");this._store.onAddToolResult?.(e)}resumeToolCall(e){if(!this._store.onResumeToolCall)throw new Error("Runtime does not support resuming tool calls.");this._store.onResumeToolCall(e)}reset(e){const n=new bT;n.import(vT.fromArray(e??[])),this.updateMessages(n.getMessages())}import(e){this._assistantOptimisticId=null,super.import(e),this._store.onImport&&this._store.onImport(this.repository.getMessages())}updateMessages=e=>{this._store.convertMessage!==void 0?this._store.setMessages?.(e.flatMap(mX).filter(i=>i!=null)):this._store.setMessages?.(e)}}const PN=t=>t.adapters?.threadList??{};class iZ extends a6{threads;constructor(e){super(),this.threads=new JX(PN(e),()=>new nZ(this._contextProvider,e))}setAdapter(e){this.threads.__internal_setAdapter(PN(e)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(e)}}const rZ=t=>{const[e]=T.useState(()=>new iZ(t));T.useEffect(()=>{e.setAdapter(t)});const{modelContext:n}=KX()??{};return T.useEffect(()=>{if(n)return e.registerModelContextProvider(n)},[n,e]),T.useMemo(()=>new z6(e),[e])},sZ=t=>{try{return JSON.parse(t),!0}catch{return!1}};function oZ({state:t,getTools:e,onResult:n,setToolStatuses:i}){const r=T.useRef({}),s=T.useRef(new Map),o=T.useRef(new AbortController),a=T.useRef(0),l=T.useRef([]),[u]=T.useState(()=>{const[m,v]=fX(),S=PX(e,()=>o.current?.signal??new AbortController().signal,(C,E)=>new Promise((k,R)=>{const M=s.current.get(C);M&&M.reject(new Error("Human input request was superseded by a new request")),s.current.set(C,{resolve:k,reject:R}),i(D=>({...D,[C]:{type:"interrupt",payload:{type:"human",payload:E}}}))}),{onExecutionStart:C=>{a.current++,i(E=>({...E,[C]:{type:"executing"}}))},onExecutionEnd:C=>{a.current--,i(E=>{const k={...E};return delete k[C],k}),a.current===0&&(l.current.forEach(E=>E()),l.current=[])}});return m.pipeThrough(S).pipeThrough(new p6).pipeTo(new WritableStream({write(C){if(C.type==="result"){if(r.current[C.meta.toolCallId]?.hasResult)return;n({type:"add-tool-result",toolCallId:C.meta.toolCallId,toolName:C.meta.toolName,result:C.result,isError:C.isError,...C.artifact&&{artifact:C.artifact}})}}})),v}),d=T.useRef(new Set),f=T.useRef(!0);T.useEffect(()=>{const m=v=>{v.forEach(S=>{S.content.forEach(C=>{if(C.type==="tool-call"){if(f.current)d.current.add(C.toolCallId);else{if(d.current.has(C.toolCallId))return;let E=r.current[C.toolCallId];if(E||(E={argsText:"",hasResult:!1,argsComplete:!1,controller:u.addToolCallPart({toolName:C.toolName,toolCallId:C.toolCallId})},r.current[C.toolCallId]=E),C.argsText!==E.argsText&&!E.argsComplete){if(!C.argsText.startsWith(E.argsText))throw new Error(`Tool call argsText can only be appended, not updated: ${C.argsText} does not start with ${E.argsText}`);const k=C.argsText.slice(E.argsText.length);E.controller.argsText.append(k);const R=sZ(C.argsText);R&&E.controller.argsText.close(),r.current[C.toolCallId]={argsText:C.argsText,hasResult:E.hasResult,argsComplete:R,controller:E.controller}}C.result!==void 0&&!E.hasResult&&(E.controller.setResponse(new Ss({result:C.result,artifact:C.artifact,isError:C.isError})),E.controller.close(),r.current[C.toolCallId]={hasResult:!0,argsComplete:!0,argsText:E.argsText,controller:E.controller})}C.messages&&m(C.messages)}})})};m(t.messages),f.current&&(f.current=!1)},[t,u,n]);const g=()=>(s.current.forEach(({reject:m})=>{m(new Error("Tool execution aborted"))}),s.current.clear(),o.current.abort(),o.current=new AbortController,a.current===0?Promise.resolve():new Promise(m=>{l.current.push(m)}));return{reset:()=>{g(),f.current=!0},abort:g,resume:(m,v)=>{const S=s.current.get(m);if(S)s.current.delete(m),i(C=>({...C,[m]:{type:"executing"}})),S.resolve(v);else throw new Error(`Tool call ${m} is not waiting for human input`)}}}function aZ(t,e){t.commitTasks.forEach(n=>{const i=n.cellIndex,r=e.cells[i];if(r.type!=="effect")throw new Error("Cannot find effect cell");let s=!0;if(r.deps!==void 0&&n.deps!==void 0&&(s=r.deps.length!==n.deps.length||r.deps.some((o,a)=>!Object.is(o,n.deps[a]))),s){if(r.mounted){if(typeof r.deps!=typeof n.deps)throw new Error("tapEffect called with and without dependencies across re-renders");try{r.mounted&&r.cleanup&&r.cleanup()}finally{r.mounted=!1}}const o=n.effect();if(o!==void 0&&typeof o!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof o}`);r.mounted=!0,r.cleanup=typeof o=="function"?o:void 0,r.deps=n.deps}})}function lZ(t){let e=null;for(let n=t.cells.length-1;n>=0;n--){const i=t.cells[n];if(i?.type==="effect"&&i.mounted&&i.cleanup)try{i.cleanup()}catch(r){e==null&&(e=r)}finally{i.mounted=!1}}if(e!=null)throw e}let Ip=null;function cZ(t,e){t.currentIndex=0;const n=Ip;Ip=t;try{if(e(),t.isFirstRender=!1,t.cells.length!==t.currentIndex)throw new Error(`Rendered ${t.currentIndex} hooks but expected ${t.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{Ip=n}}function ST(){if(!Ip)throw new Error("No resource fiber available");return Ip}function C6(t,e){const n=t[x6];if(!n)throw new Error("ResourceElement.type is not a valid Resource");return n(e)}const x6=Symbol("fnSymbol");function $b(t,e){return{resource:t,scheduleRerender:e,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function ng(t){t.isMounted=!1,lZ(t)}function ig(t,e){const n={commitTasks:[],props:e,state:void 0};return cZ(t,()=>{t.renderContext=n;try{n.state=C6(t.resource,e)}finally{t.renderContext=void 0}}),n}function rg(t,e){t.isMounted=!0,t.isNeverMounted=!1,aZ(e,t)}const uZ=globalThis.__ASSISTANT_UI_DISABLE_LAYOUT_EFFECT__===!0,NN=uZ?T.useEffect:T.useLayoutEffect;function CT(t){const[,e]=T.useState({}),n=T.useMemo(()=>$b(t.type,()=>e({})),[t.type]),i=ig(n,t.props);return NN(()=>()=>ng(n),[n]),NN(()=>{rg(n,i)}),i.state}const Wb=t=>typeof t=="string"?{scope:t.split(".")[0],event:t}:{scope:t.scope,event:t.event},Mp=(t,e,n)=>e===t;let Qu;const Ax=()=>{if(Qu)return Qu;const t=()=>({apis:new Map,nextId:0,listeners:new Set});if(typeof window>"u")return Qu=t(),Qu;const e=window.__ASSISTANT_UI_DEVTOOLS_HOOK__;if(e)return Qu=e,e;const n=t();return window.__ASSISTANT_UI_DEVTOOLS_HOOK__=n,Qu=n,n};class vc{static MAX_EVENT_LOGS_PER_API=200;static register(e){const n=Ax();for(const a of n.apis.values())if(a.api===e)return()=>{};const i=n.nextId++,r={api:e,logs:[]},s=e.on?.("*",a=>{const l=n.apis.get(i);l&&(l.logs.push({time:new Date,event:a.event,data:a.payload}),l.logs.length>vc.MAX_EVENT_LOGS_PER_API&&(l.logs=l.logs.slice(-200)),vc.notifyListeners(i))}),o=e.subscribe?.(()=>{vc.notifyListeners(i)});return n.apis.set(i,r),vc.notifyListeners(i),()=>{const a=Ax();a.apis.get(i)&&(s?.(),o?.(),a.apis.delete(i),vc.notifyListeners(i))}}static notifyListeners(e){Ax().listeners.forEach(i=>i(e))}}function Zt(t){const e=n=>({type:e,props:n});return e[x6]=t,e}const dZ=t=>{if(t.renderContext)throw new Error("Resource updated during render");if(t.isMounted)t.scheduleRerender();else if(t.isNeverMounted)throw new Error("Resource updated before mount")};function hZ(t){const e=ST(),n=e.currentIndex++;if(!e.isFirstRender&&n>=e.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");if(!e.cells[n]){const s={type:"state",value:typeof t=="function"?t():t,set:o=>{const a=s.value,l=typeof o=="function"?o(a):o;Object.is(a,l)||(s.value=l,dZ(e))}};e.cells[n]=s}const i=e.cells[n];if(i.type!=="state")throw new Error("Hook order changed between renders");return i}function vo(t){const e=hZ(t);return[e.value,e.set]}function fZ(){const t=ST(),e=t.currentIndex++;if(!t.isFirstRender&&e>=t.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");if(!t.cells[e]){const i={type:"effect",mounted:!1};t.cells[e]=i}if(t.cells[e].type!=="effect")throw new Error("Hook order changed between renders");return e}function Oi(t,e){const n=ST(),i=fZ();n.renderContext.commitTasks.push({effect:t,deps:e,cellIndex:i})}function $d(t){const[e]=vo(()=>({current:t}));return e}const pZ=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n{const n=$d();return n.current||(n.current={value:t(),deps:e}),pZ(n.current.deps,e)||(n.current.value=t(),n.current.deps=e),n.current.value},gZ=(t,e)=>Et(()=>t,e);function Dp(t,e){const[n,i]=vo({}),r=Et(()=>$b(t.type,()=>i({})),[t.type]),s=e?Et(()=>t.props,e):t.props,o=Et(()=>ig(r,s),[r,s,n]);return Oi(()=>()=>ng(r),[r]),Oi(()=>{rg(r,o)},[r,o]),o.state}function So(t){return C6(t.type,t.props)}function E6(t,e,n){const[i,r]=vo(0),s=gZ(()=>r(u=>u+1),[]),[o]=vo(()=>new Map),a=Et(()=>e,n),l=Et(()=>{const u={remove:[],add:[],commit:[],return:{}};for(const d in t){const f=t[d],g=a(f,d);let m=o.get(d);(!m||m.resource!==g.type)&&(m&&u.remove.push(d),m=$b(g.type,s),u.add.push([d,m]));const v=ig(m,g.props);u.commit.push([d,v]),u.return[d]=v.state}if(o.size>u.commit.length-u.add.length+u.remove.length)for(const d of o.keys())d in t||u.remove.push(d);return u},[t,a,i]);return Oi(()=>()=>{for(const u of o.keys())ng(o.get(u)),o.delete(u)},[]),Oi(()=>{for(const u of l.remove)ng(o.get(u)),o.delete(u);for(const[u,d]of l.add)o.set(u,d);for(const[u,d]of l.commit)rg(o.get(u),d)},[l]),l.return}const mZ=50;let lo={schedulers:new Set([]),isScheduled:!1};class AZ{_task;_isDirty=!1;constructor(e){this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,lo.schedulers.add(this),yZ()}runTask(){this._isDirty=!1,this._task()}}const yZ=()=>{lo.isScheduled||(lo.isScheduled=!0,queueMicrotask(_6))},_6=()=>{try{const t=[];let e=0;for(const n of lo.schedulers)if(lo.schedulers.delete(n),!!n.isDirty){if(e++,e>mZ)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside tapEffect.");try{n.runTask()}catch(i){t.push(i)}}if(t.length>0)throw t.length===1?t[0]:new AggregateError(t,"Errors occurred during flushSync")}finally{lo.schedulers.clear(),lo.isScheduled=!1}},M1=t=>{const e=lo;lo={schedulers:new Set([]),isScheduled:!0};try{const n=t();return _6(),n}finally{lo=e}},vZ=Zt(t=>{const[,e]=vo(t.element),n=Dp(t.element),i=$d(new Set).current,r=$d(n);return Oi(()=>{n!==r.current&&(r.current=n,i.forEach(o=>o()))}),Et(()=>({getState:()=>r.current,subscribe:o=>(i.add(o),()=>i.delete(o)),render:o=>{const a=t.element!==o;t.element=o,t.onRender(a)&&e(o)},unmount:t.onUnmount}),[])}),bZ=(t,{mount:e=!0}={})=>{let n=e,i;const r={element:t,onRender:a=>n?a:(n=!0,M1(()=>{a&&(i=ig(o,r)),!s.isDirty&&rg(o,i)}),!1),onUnmount:()=>{if(!n)throw new Error("Resource not mounted");n=!1,ng(o)}},s=new AZ(()=>{i=ig(o,r),!(s.isDirty||!n)&&rg(o,i)}),o=$b(vZ,()=>s.markDirty());return M1(()=>{s.markDirty()}),i.state},Pp=Symbol("tap.Context"),T6=t=>({[Pp]:t}),R6=(t,e,n)=>{const i=t[Pp];t[Pp]=e;try{return n()}finally{t[Pp]=i}},k6=t=>t[Pp],ON=t=>{let e;const n=new Set,i=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const g=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(m=>m(e,g))}},r=()=>e,a={setState:i,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=e=t(i,r,a);return a},wZ=(t=>t?ON(t):ON),SZ=t=>t;function CZ(t,e=SZ){const n=me.useSyncExternalStore(t.subscribe,me.useCallback(()=>e(t.getState()),[t,e]),me.useCallback(()=>e(t.getInitialState()),[t,e]));return me.useDebugValue(n),n}const BN=t=>{const e=wZ(t),n=i=>CZ(e,i);return Object.assign(n,e),n},Co=(t=>t?BN(t):BN);function LN(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Gn(...t){return e=>{let n=!1;const i=t.map(r=>{const s=LN(r,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r{const e=Et(()=>bZ(t,{mount:!1}),[t.type]);return Oi(()=>{e.render(t)}),e});class xZ{ref;constructor(e){this.ref=e}get(e,n){return this.ref.current[n]}ownKeys(){return Object.keys(this.ref.current)}has(e,n){return n in this.ref.current}getOwnPropertyDescriptor(e,n){return Object.getOwnPropertyDescriptor(this.ref.current,n)}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}}const Ms=(t,e)=>{const n=$d(t);Oi(()=>{n.current=t});const i=Et(()=>new Proxy({},new xZ(n)),[]),r=e?.key,s=t.getState();return Et(()=>({key:r,state:s,api:i}),[s,r])},dv=Zt(t=>{const e=$d(t.get);return Oi(()=>{e.current=t.get}),Et(()=>hi({source:t.source,query:t.query,get:()=>e.current()}),[t.source,JSON.stringify(t.query)])}),EZ=Zt(t=>{const e=Dp(t.scopeElement);return Et(()=>[t.fieldName,e],[t.fieldName,e])}),_Z=Zt(t=>{const{on:e,subscribe:n,...i}=t,r=$d({on:e,subscribe:n});Oi(()=>{r.current={on:e,subscribe:n}});const s=E6(i,(o,a)=>EZ({fieldName:a,scopeElement:o}),[]);return Et(()=>{const o=Object.fromEntries(Object.values(s)),{on:a,subscribe:l}=r.current;return a&&(o.on=(u,d)=>a(u,d)),l&&(o.subscribe=u=>l(u)),o},[s])}),M6=T6(null),TZ=(t,e)=>R6(M6,t,e),D6=()=>{const t=k6(M6);if(!t)throw new Error("Model context is not available in this context");return t},RZ=Zt(({toolkit:t})=>{const[e,n]=vo(()=>({tools:{}})),i=D6();Oi(()=>{if(!t)return;const s=[];for(const[l,u]of Object.entries(t))u.render&&s.push(r(l,u.render));const o=Object.entries(t).reduce((l,[u,d])=>{const{render:f,...g}=d;return l[u]=g,l},{}),a={getModelContext:()=>({tools:o})};return s.push(i.register(a)),()=>{s.forEach(l=>l())}},[t,i]);const r=(s,o)=>(n(a=>({...a,tools:{...a.tools,[s]:[...a.tools[s]??[],o]}})),()=>{n(a=>({...a,tools:{...a.tools,[s]:a.tools[s]?.filter(l=>l!==o)??[]}}))});return Ms({getState:()=>e,setToolUI:r})}),kZ=Zt(()=>Et(()=>{const e=new Map;return{on:(n,i)=>{e.has(n)||e.set(n,new Set);const r=e.get(n);return r.add(i),()=>{r.delete(i),r.size===0&&e.delete(n)}},emit:(n,i)=>{const r=e.get(n),s=e.get("*");!r&&!s||queueMicrotask(()=>{if(r)for(const o of r)o(i);if(s)for(const o of s)o({event:n,payload:i})})}}},[])),P6=T6(null),IZ=(t,e)=>R6(P6,t,e),xT=()=>{const t=k6(P6);if(!t)throw new Error("Events context is not available");return t},MZ=Zt(()=>{const[t]=vo(()=>({})),e=new gT;return Ms({getState:()=>t,getModelContext:()=>e.getModelContext(),subscribe:n=>e.subscribe(n),register:n=>e.registerModelContextProvider(n)})}),DZ=Zt(({threads:t,modelContext:e,tools:n})=>{const i=So(kZ()),{threads:r,tools:s,modelContext:o}=IZ(i,()=>{const l=Dp(e??MZ(),[e]);return TZ(l.api,()=>({modelContext:l,tools:Dp(n??RZ({}),[n]),threads:Dp(t,[t])}))}),a=Et(()=>({threads:r.state,tools:s.state,modelContext:o.state}),[r.state,s.state,o.state]);return Ms({getState:()=>a,threads:r.api,tools:s.api,modelContext:o.api,on:i.on})}),PZ=t=>{const e=()=>t.getState().api.threads.item("main");return{threads:hi({source:"root",query:{},get:()=>t.getState().api.threads}),tools:hi({source:"root",query:{},get:()=>t.getState().api.tools}),modelContext:hi({source:"root",query:{},get:()=>t.getState().api.modelContext}),thread:hi({source:"threads",query:{type:"main"},get:()=>t.getState().api.threads.thread("main")}),threadListItem:hi({source:"threads",query:{type:"main"},get:()=>e()}),composer:hi({source:"thread",query:{},get:()=>t.getState().api.threads.thread("main").composer}),on(n,i){const{event:r,scope:s}=Wb(n);if(s==="*")return t.getState().api.on(r,i);if(Mp("thread",s)||Mp("thread-list-item",s)||Mp("composer",s))return t.getState().api.on(r,o=>{o.threadId===e().getState().id&&i(o)});throw new Error(`Event scope is not available in this component: ${s}`)},subscribe:t.subscribe}},NZ=t=>{const e=ET(),n=CT(I6(DZ(t))),i=T.useMemo(()=>PZ(n),[n]);return T.useMemo(()=>O6(e,i),[e,i])},hi=t=>{const e=t.get;return e.source=t.source,e.query=t.query,e},hv=()=>()=>{},N6=T.createContext({threads:hi({source:null,query:{},get:()=>{throw new Error("Threads is only available inside ")}}),tools:hi({source:null,query:{},get:()=>{throw new Error("Tools is only available inside ")}}),modelContext:hi({source:null,query:{},get:()=>{throw new Error("ModelContext is only available inside ")}}),threadListItem:hi({source:null,query:{},get:()=>{throw new Error("ThreadListItem is only available inside ")}}),thread:hi({source:null,query:{},get:()=>{throw new Error("Thread is only available inside ")}}),composer:hi({source:null,query:{},get:()=>{throw new Error("Composer is only available inside ")}}),message:hi({source:null,query:{},get:()=>{throw new Error("Message is only available inside ")}}),part:hi({source:null,query:{},get:()=>{throw new Error("Part is only available inside ")}}),attachment:hi({source:null,query:{},get:()=>{throw new Error("Attachment is only available inside or ")}}),subscribe:hv,on:t=>{const{scope:e}=Wb(t);throw new Error(`Event scope is not available in this component: ${e}`)}}),ET=()=>T.useContext(N6),_T=t=>{const e=ET(),n=CT(_Z(t));return T.useMemo(()=>O6(e,n),[e,n])},OZ=t=>NZ(t);function Er(t){return t?OZ(t):ET()}const BZ=(t,e)=>t===hv?e:e===hv?t:(...n)=>{const i=t(...n),r=e(...n);return()=>{i(),r()}},O6=(t,e)=>{const n=e.subscribe;return{...t,...e,subscribe:BZ(t.subscribe,n??hv)}},jb=({api:t,children:e,devToolsVisible:n=!0})=>(T.useEffect(()=>{if(!(!n||!t.subscribe))return vc.register(t)},[t,n]),_.jsx(N6.Provider,{value:t,children:e}));class UN{#e;constructor(e){this.#e=e}get threads(){return this.#e.threads().getState()}get tools(){return this.#e.tools().getState()}get threadListItem(){return this.#e.threadListItem().getState()}get thread(){return this.#e.thread().getState()}get composer(){return this.#e.composer().getState()}get message(){return this.#e.message().getState()}get part(){return this.#e.part().getState()}get attachment(){return this.#e.attachment().getState()}}const _t=t=>{const e=Er(),n=T.useMemo(()=>new UN(e),[e]),i=T.useSyncExternalStore(e.subscribe,()=>t(n),()=>t(n));if(T.useDebugValue(i),i instanceof UN)throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return i},yx=(t,e)=>{const n=Er(),i=T.useRef(e);T.useEffect(()=>{i.current=e});const{scope:r,event:s}=Wb(t);T.useEffect(()=>n.on({scope:r,event:s},o=>i.current(o)),[n,r,s])};function LZ(t,e){function n(i){const r=T.useContext(t);if(!i?.optional&&!r)throw new Error(`This component must be used within ${e}.`);return r}return n}function B6(t,e){function n(r){const s=t(r);return s?s[e]:null}function i(r){let s=!1,o;typeof r=="function"?o=r:r&&typeof r=="object"&&(s=!!r.optional,o=r.selector);const a=n({optional:s});return a?o?a(o):a():null}return{[e]:i,[`${e}Store`]:n}}const L6=T.createContext(null),UZ=LZ(L6,"ThreadPrimitive.Viewport"),{useThreadViewport:fv,useThreadViewportStore:TT}=B6(UZ,"useThreadViewport"),VZ=t=>{const e=t;e.__isBound||(e.__internal_bindMethods?.(),e.__isBound=!0)};function FZ(t,e=HZ){VZ(t);const n=T.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getState()));return T.useDebugValue(n),n}const HZ=t=>t;function zZ(t){function e(n){let i=!1,r;typeof n=="function"?r=n:n&&(i=!!n.optional,r=n.selector);const s=t({optional:i});return s?FZ(s,r):null}return e}function QZ(t){const e=Er(),n=_t(()=>e.message.source?e.message().__internal_getRuntime?.()??null:null);if(!n&&!t?.optional)throw new Error("MessageRuntime is not available");return n}const U6=zZ(QZ),$c=t=>{const[,e]=vo(t.getState);return Oi(()=>(e(t.getState()),t.subscribe(()=>{e(t.getState())})),[t]),t.getState()},GZ=Zt(({runtime:t})=>{const e=$c(t),n=xT();return Oi(()=>{const i=[],r=["switched-to","switched-away"];for(const s of r){const o=t.unstable_on(s,()=>{n.emit(`thread-list-item.${s}`,{threadId:t.getState().id})});i.push(o)}return()=>{for(const s of i)s()}},[t,n]),Ms({getState:()=>e,switchTo:t.switchTo,rename:t.rename,archive:t.archive,unarchive:t.unarchive,delete:t.delete,generateTitle:t.generateTitle,initialize:t.initialize,detach:t.detach,__internal_getRuntime:()=>t},{key:e.id})}),sg=t=>{const e=Et(()=>Object.fromEntries(t),[t]),n=E6(e,s=>s,[]),i=Et(()=>Object.keys(n),[n]);return{state:Et(()=>{const s=new Array(i.length);for(let o=0;o{const o="index"in s?n[i[s.index]]?.api:n[s.key]?.api;if(!o)throw new Error(`tapLookupResources: Resource not found for lookup: ${JSON.stringify(s)}`);return o}}},V6=Zt(({runtime:t})=>{const e=$c(t);return Ms({getState:()=>e,remove:t.remove,__internal_getRuntime:()=>t},{key:e.id})}),$Z=Zt(({runtime:t,index:e})=>{const n=Et(()=>t.getAttachmentByIndex(e),[t,e]);return So(V6({runtime:n}))}),F6=Zt(({threadIdRef:t,messageIdRef:e,runtime:n})=>{const i=$c(n),r=xT();Oi(()=>{const a=[],l=["send","attachment-add"];for(const u of l){const d=n.unstable_on(u,()=>{r.emit(`composer.${u}`,{threadId:t.current,...e&&{messageId:e.current}})});a.push(d)}return()=>{for(const u of a)u()}},[n,r,t,e]);const s=sg(i.attachments.map((a,l)=>[a.id,$Z({runtime:n,index:l})])),o=Et(()=>({text:i.text,role:i.role,attachments:s.state,runConfig:i.runConfig,isEditing:i.isEditing,canCancel:i.canCancel,attachmentAccept:i.attachmentAccept,isEmpty:i.isEmpty,type:i.type??"thread"}),[i,s.state]);return Ms({getState:()=>o,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw new Error("beginEdit is not supported in this runtime")}),attachment:a=>"id"in a?s.api({key:a.id}):s.api(a),__internal_getRuntime:()=>n})}),WZ=Zt(({runtime:t})=>{const e=$c(t);return Ms({getState:()=>e,addToolResult:i=>t.addToolResult(i),resumeToolCall:i=>t.resumeToolCall(i),__internal_getRuntime:()=>t},{key:e.type==="tool-call"?`toolCallId-${e.toolCallId}`:void 0})}),jZ=Zt(({runtime:t,index:e})=>{const n=Et(()=>t.getAttachmentByIndex(e),[t,e]);return So(V6({runtime:n}))}),KZ=Zt(({runtime:t,index:e})=>{const n=Et(()=>t.getMessagePartByIndex(e),[t,e]);return So(WZ({runtime:n}))}),YZ=Zt(({runtime:t,threadIdRef:e})=>{const n=$c(t),[i,r]=vo(!1),[s,o]=vo(!1),a=Et(()=>({get current(){return t.getState().id}}),[t]),l=So(F6({runtime:t.composer,threadIdRef:e,messageIdRef:a})),u=sg(n.content.map((g,m)=>["toolCallId"in g&&g.toolCallId!=null?`toolCallId-${g.toolCallId}`:`index-${m}`,KZ({runtime:t,index:m})])),d=sg(n.attachments?.map((g,m)=>[g.id,jZ({runtime:t,index:m})])??[]),f=Et(()=>({...n,parts:u.state,composer:l.state,isCopied:i,isHovering:s}),[n,u.state,l.state,i,s]);return Ms({getState:()=>f,composer:l.api,reload:g=>t.reload(g),speak:()=>t.speak(),stopSpeaking:()=>t.stopSpeaking(),submitFeedback:g=>t.submitFeedback(g),switchToBranch:g=>t.switchToBranch(g),getCopyText:()=>t.unstable_getCopyText(),part:g=>"index"in g?u.api({index:g.index}):u.api({key:`toolCallId-${g.toolCallId}`}),attachment:g=>"id"in g?d.api({key:g.id}):d.api(g),setIsCopied:r,setIsHovering:o,__internal_getRuntime:()=>t},{key:n.id})}),qZ=Zt(({runtime:t,id:e,threadIdRef:n})=>{const i=Et(()=>t.getMessageById(e),[t,e]);return So(YZ({runtime:i,threadIdRef:n}))}),JZ=Zt(({runtime:t})=>{const e=$c(t),n=xT();Oi(()=>{const a=[],l=["run-start","run-end","initialize","model-context-update"];for(const u of l){const d=t.unstable_on(u,()=>{const f=t.getState()?.threadId||"unknown";n.emit(`thread.${u}`,{threadId:f})});a.push(d)}return()=>{for(const u of a)u()}},[t]);const i=Et(()=>({get current(){return t.getState().threadId}}),[t]),r=So(F6({runtime:t.composer,threadIdRef:i})),s=sg(e.messages.map(a=>[a.id,qZ({runtime:t,id:a.id,threadIdRef:i})])),o=Et(()=>({isEmpty:s.state.length===0&&!e.isLoading,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:e.isRunning,capabilities:e.capabilities,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech,composer:r.state,messages:s.state}),[e,s,r.state]);return Ms({getState:()=>o,composer:r.api,append:t.append,startRun:t.startRun,unstable_resumeRun:t.unstable_resumeRun,cancelRun:t.cancelRun,getModelContext:t.getModelContext,export:t.export,import:t.import,reset:t.reset,stopSpeaking:t.stopSpeaking,startVoice:async()=>{throw new Error("startVoice is not supported in this runtime")},stopVoice:async()=>{throw new Error("stopVoice is not supported in this runtime")},message:a=>"id"in a?s.api({key:a.id}):s.api(a),__internal_getRuntime:()=>t})}),XZ=Zt(({runtime:t,id:e})=>{const n=Et(()=>t.getItemById(e),[t,e]);return So(GZ({runtime:n}))}),ZZ=Zt(({runtime:t,__internal_assistantRuntime:e})=>{const n=$c(t),i=So(JZ({runtime:t.main})),r=sg(Object.keys(n.threadItems).map(o=>[o,XZ({runtime:t,id:o})])),s=Et(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThread??null,isLoading:n.isLoading,threadIds:n.threads,archivedThreadIds:n.archivedThreads,threadItems:r.state,main:i.state}),[n,r.state,i.state]);return Ms({getState:()=>s,thread:()=>i.api,item:o=>{if(o==="main")return r.api({key:s.mainThreadId});if("id"in o)return r.api({key:o.id});const{index:a,archived:l=!1}=o,u=l?s.archivedThreadIds[a]:s.threadIds[a];return r.api({key:u})},switchToThread:o=>{t.switchToThread(o)},switchToNewThread:()=>{t.switchToNewThread()},__internal_getAssistantRuntime:()=>e})}),eee=Zt(t=>{const e=D6();return Oi(()=>t.registerModelContextProvider(e),[t,e]),So(ZZ({runtime:t.threads,__internal_assistantRuntime:t}))}),vx=t=>{const e=new Map,n=()=>{let i=0;for(const r of e.values())i+=r;t(i)};return{register:()=>{const i=Symbol();return e.set(i,0),{setHeight:r=>{e.get(i)!==r&&(e.set(i,r),n())},unregister:()=>{e.delete(i),n()}}}}},tee=(t={})=>{const e=new Set,n=vx(o=>{s.setState({height:{...s.getState().height,viewport:o}})}),i=vx(o=>{s.setState({height:{...s.getState().height,inset:o}})}),r=vx(o=>{s.setState({height:{...s.getState().height,userMessage:o}})}),s=Co(()=>({isAtBottom:!0,scrollToBottom:({behavior:o="auto"}={})=>{for(const a of e)a({behavior:o})},onScrollToBottom:o=>(e.add(o),()=>{e.delete(o)}),turnAnchor:t.turnAnchor??"bottom",height:{viewport:0,inset:0,userMessage:0},registerViewport:n.register,registerContentInset:i.register,registerUserMessageHeight:r.register}));return s},og=t=>t,nee=t=>{const e=TT({optional:!0}),[n]=T.useState(()=>tee(t));return T.useEffect(()=>e?.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[e,n]),T.useEffect(()=>{if(e)return n.subscribe(i=>{e.getState().isAtBottom!==i.isAtBottom&&og(e).setState({isAtBottom:i.isAtBottom})})},[n,e]),T.useEffect(()=>{const i={turnAnchor:t.turnAnchor??"bottom"};n.getState().turnAnchor!==i.turnAnchor&&og(n).setState(i)},[n,t.turnAnchor]),n},H6=({children:t,options:e={}})=>{const n=nee(e),[i]=T.useState(()=>({useThreadViewport:n}));return _.jsx(L6.Provider,{value:i,children:t})},iee=t=>t._core?.RenderComponent,ree=({children:t,runtime:e})=>{const n=Er({threads:eee(e)}),i=iee(e);return _.jsxs(jb,{api:n,children:[i&&_.jsx(i,{}),_.jsx(H6,{children:t})]})},see=T.memo(ree),oee=({index:t,children:e})=>{const n=Er(),i=_T({message:dv({source:"thread",query:{type:"index",index:t},get:()=>n.thread().message({index:t})}),composer:dv({source:"message",query:{},get:()=>n.thread().message({index:t}).composer}),on(r,s){const o=()=>n.thread().message({index:t}),{event:a,scope:l}=Wb(r);return!Mp("composer",l)&&!Mp("message",l)?n.on(r,s):n.on({scope:"thread",event:a},u=>{u.messageId===o().getState().id&&s(u)})}});return _.jsx(jb,{api:i,children:e})},aee=({index:t,children:e})=>{const n=Er(),i=_T({part:dv({source:"message",query:{type:"index",index:t},get:()=>n.message().part({index:t})})});return _.jsx(jb,{api:i,children:e})},lee=Zt(({text:t,isRunning:e})=>{const n=Et(()=>({type:"text",text:t,status:e?{type:"running"}:{type:"complete"}}),[t,e]);return Ms({getState:()=>n,addToolResult:()=>{throw new Error("Not supported")},resumeToolCall:()=>{throw new Error("Not supported")}})}),cee=({text:t,isRunning:e=!1,children:n})=>{const i=CT(I6(lee({text:t,isRunning:e}))),r=_T({part:dv({source:"root",query:{},get:()=>i.getState().api}),subscribe:i.subscribe});return _.jsx(jb,{api:r,children:n})};class z6{_core;threads;get threadList(){return this.threads}_thread;constructor(e){this._core=e,this.threads=new HX(e.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.switchToNewThread=this.switchToNewThread.bind(this),this.switchToThread=this.switchToThread.bind(this),this.registerModelContextProvider=this.registerModelContextProvider.bind(this),this.registerModelConfigProvider=this.registerModelConfigProvider.bind(this),this.reset=this.reset.bind(this)}get thread(){return this._thread}switchToNewThread(){return this._core.threads.switchToNewThread()}switchToThread(e){return this._core.threads.switchToThread(e)}registerModelContextProvider(e){return this._core.registerModelContextProvider(e)}registerModelConfigProvider(e){return this.registerModelContextProvider(e)}reset({initialMessages:e}={}){return this._core.threads.getMainThreadRuntimeCore().import(vT.fromArray(e??[]))}}const uee=t=>{const{cloud:e,initialMessages:n,maxSteps:i,adapters:r,unstable_humanToolNames:s,...o}=t;return{localRuntimeOptions:{cloud:e,initialMessages:n,maxSteps:i,adapters:r,unstable_humanToolNames:s},otherOptions:o}};function Bi(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>(...n)=>e.current?.(...n),[])}const Q6=T.createContext(null),dee=t=>({useSmoothStatus:Co(()=>t)}),hee=({children:t})=>{const e=G6({optional:!0}),n=Er(),[i]=T.useState(()=>dee(n.part().getState().status));return e?t:_.jsx(Q6.Provider,{value:i,children:t})},fee=t=>{const e=T.forwardRef((n,i)=>_.jsx(hee,{children:_.jsx(t,{...n,ref:i})}));return e.displayName=t.displayName,e};function G6(t){const e=T.useContext(Q6);if(!t?.optional&&!e)throw new Error("This component must be used within a SmoothContextProvider.");return e}const{useSmoothStatus:pee,useSmoothStatusStore:gee}=B6(G6,"useSmoothStatus");class mee{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();targetText="";constructor(e,n){this.currentText=e,this.setText=n}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{const e=Date.now();let i=e-this.lastUpdateTime;const r=this.targetText.length-this.currentText.length,s=Math.min(5,250/r);let o=0;for(;i>=s&&o{const{text:n}=t,i=_t(({message:d})=>d.id),r=T.useRef(i),[s,o]=T.useState(n),a=gee({optional:!0}),l=Bi(d=>{if(o(d),a){const f=s!==d||t.status.type==="running"?bx:t.status;og(a).setState(f,!0)}});T.useEffect(()=>{if(a){const d=e&&(s!==n||t.status.type==="running")?bx:t.status;og(a).setState(d,!0)}},[a,e,n,s,t.status]);const[u]=T.useState(new mee(n,l));return T.useEffect(()=>{if(!e){u.stop();return}if(r.current!==i||!n.startsWith(u.targetText)){r.current=i,l(n),u.currentText=n,u.targetText=n,u.stop();return}u.targetText=n,u.start()},[l,u,i,e,n]),T.useEffect(()=>()=>{u.stop()},[u]),T.useMemo(()=>e?{type:"text",text:s,status:n===s?t.status:bx}:t,[e,s,t,n])},Aee=Object.freeze(Object.defineProperty({__proto__:null,AssistantRuntimeImpl:z6,BaseAssistantRuntimeCore:a6,CompositeContextProvider:gT,DefaultThreadComposerRuntimeCore:c6,MessageRepository:bT,ThreadRuntimeImpl:w6,fromThreadMessageLike:Qb,generateId:zb,getAutoStatus:mT,splitLocalRuntimeOptions:uee,useSmooth:$6,useSmoothStatus:pee,useToolInvocations:oZ,withSmoothContextProvider:fee},Symbol.toStringTag,{value:"Module"}));var Kb=o6();const yee=Gc(Kb);var vee=Symbol.for("react.lazy"),pv=pT[" use ".trim().toString()];function bee(t){return typeof t=="object"&&t!==null&&"then"in t}function W6(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===vee&&"_payload"in t&&bee(t._payload)}function j6(t){const e=wee(t),n=T.forwardRef((i,r)=>{let{children:s,...o}=i;W6(s)&&typeof pv=="function"&&(s=pv(s._payload));const a=T.Children.toArray(s),l=a.find(Cee);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}var RT=j6("Slot");function wee(t){const e=T.forwardRef((n,i)=>{let{children:r,...s}=n;if(W6(r)&&typeof pv=="function"&&(r=pv(r._payload)),T.isValidElement(r)){const o=Eee(r),a=xee(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var See=Symbol("radix.slottable");function Cee(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===See}function xee(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Eee(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var _ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xo=_ee.reduce((t,e)=>{const n=j6(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),ra;(function(t){t.Hidden="hidden",t.Floating="floating",t.Normal="normal"})(ra||(ra={}));const Tee=({hideWhenRunning:t,autohide:e,autohideFloat:n})=>_t(({thread:i,message:r})=>t&&i.isRunning?ra.Hidden:e==="always"||e==="not-last"&&!r.isLast?r.isHovering?n==="always"||n==="single-branch"&&r.branchCount<=1?ra.Floating:ra.Normal:ra.Hidden:ra.Normal),K6=T.forwardRef(({hideWhenRunning:t,autohide:e,autohideFloat:n,...i},r)=>{const s=Tee({hideWhenRunning:t,autohide:e,autohideFloat:n});return s===ra.Hidden?null:_.jsx(xo.div,{...s===ra.Floating?{"data-floating":"true"}:null,...i,ref:r})});K6.displayName="ActionBarPrimitive.Root";function Ve(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t?.(r),n===!1||!r.defaultPrevented)return e?.(r)}}const Ree=({copiedDuration:t=3e3}={})=>{const e=Er(),n=_t(({message:o})=>(o.role!=="assistant"||o.status?.type!=="running")&&o.parts.some(a=>a.type==="text"&&a.text.length>0)),i=_t(({composer:o})=>o.isEditing),r=_t(({composer:o})=>o.text),s=T.useCallback(()=>{const o=i?r:e.message().getCopyText();o&&navigator.clipboard.writeText(o).then(()=>{e.message().setIsCopied(!0),setTimeout(()=>e.message().setIsCopied(!1),t)})},[e,i,r,t]);return n?s:null},Y6=T.forwardRef(({copiedDuration:t,onClick:e,disabled:n,...i},r)=>{const s=_t(({message:a})=>a.isCopied),o=Ree({copiedDuration:t});return _.jsx(xo.button,{type:"button",...s?{"data-copied":"true"}:{},...i,ref:r,disabled:n||!o,onClick:Ve(e,()=>{o?.()})})});Y6.displayName="ActionBarPrimitive.Copy";const q6=(t,e,n=[])=>{const i=T.forwardRef((r,s)=>{const o={},a={};Object.keys(r).forEach(u=>{n.includes(u)?o[u]=r[u]:a[u]=r[u]});const l=e(o)??void 0;return _.jsx(xo.button,{type:"button",...a,ref:s,disabled:a.disabled||!l,onClick:Ve(a.onClick,l)})});return i.displayName=t,i};function J6(t,e=globalThis?.document){const n=Bi(t);T.useEffect(()=>{const i=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}function kee(t){const e=Iee(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Dee);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function Iee(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Nee(r),a=Pee(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Mee=Symbol("radix.slottable");function Dee(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Mee}function Pee(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Nee(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Oee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],X6=Oee.reduce((t,e)=>{const n=kee(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function Bee(t,e){t&&Kb.flushSync(()=>t.dispatchEvent(e))}var Lee="DismissableLayer",D1="dismissableLayer.update",Uee="dismissableLayer.pointerDownOutside",Vee="dismissableLayer.focusOutside",VN,Z6=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yb=T.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,u=T.useContext(Z6),[d,f]=T.useState(null),g=d?.ownerDocument??globalThis?.document,[,m]=T.useState({}),v=$t(e,N=>f(N)),S=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=d?S.indexOf(d):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,M=k>=E,D=zee(N=>{const B=N.target,G=[...u.branches].some(V=>V.contains(B));!M||G||(r?.(N),o?.(N),N.defaultPrevented||a?.())},g),P=Qee(N=>{const B=N.target;[...u.branches].some(V=>V.contains(B))||(s?.(N),o?.(N),N.defaultPrevented||a?.())},g);return J6(N=>{k===u.layers.size-1&&(i?.(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},g),T.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(VN=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),FN(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=VN)}},[d,g,n,u]),T.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),FN())},[d,u]),T.useEffect(()=>{const N=()=>m({});return document.addEventListener(D1,N),()=>document.removeEventListener(D1,N)},[]),_.jsx(X6.div,{...l,ref:v,style:{pointerEvents:R?M?"auto":"none":void 0,...t.style},onFocusCapture:Ve(t.onFocusCapture,P.onFocusCapture),onBlurCapture:Ve(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ve(t.onPointerDownCapture,D.onPointerDownCapture)})});Yb.displayName=Lee;var Fee="DismissableLayerBranch",Hee=T.forwardRef((t,e)=>{const n=T.useContext(Z6),i=T.useRef(null),r=$t(e,i);return T.useEffect(()=>{const s=i.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),_.jsx(X6.div,{...t,ref:r})});Hee.displayName=Fee;function zee(t,e=globalThis?.document){const n=Bi(t),i=T.useRef(!1),r=T.useRef(()=>{});return T.useEffect(()=>{const s=a=>{if(a.target&&!i.current){let l=function(){eF(Uee,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=l,e.addEventListener("click",r.current,{once:!0})):l()}else e.removeEventListener("click",r.current);i.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}function Qee(t,e=globalThis?.document){const n=Bi(t),i=T.useRef(!1);return T.useEffect(()=>{const r=s=>{s.target&&!i.current&&eF(Vee,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function FN(){const t=new CustomEvent(D1);document.dispatchEvent(t)}function eF(t,e,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?Bee(r,s):r.dispatchEvent(s)}var wx=0;function tF(){T.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??HN()),document.body.insertAdjacentElement("beforeend",t[1]??HN()),wx++,()=>{wx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),wx--}},[])}function HN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function Gee(t){const e=$ee(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(jee);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function $ee(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Yee(r),a=Kee(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Wee=Symbol("radix.slottable");function jee(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Wee}function Kee(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Yee(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var qee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jee=qee.reduce((t,e)=>{const n=Gee(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),Sx="focusScope.autoFocusOnMount",Cx="focusScope.autoFocusOnUnmount",zN={bubbles:!1,cancelable:!0},Xee="FocusScope",kT=T.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...o}=t,[a,l]=T.useState(null),u=Bi(r),d=Bi(s),f=T.useRef(null),g=$t(e,S=>l(S)),m=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(i){let S=function(R){if(m.paused||!a)return;const M=R.target;a.contains(M)?f.current=M:al(f.current,{select:!0})},C=function(R){if(m.paused||!a)return;const M=R.relatedTarget;M!==null&&(a.contains(M)||al(f.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const D of R)D.removedNodes.length>0&&al(a)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const k=new MutationObserver(E);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),k.disconnect()}}},[i,a,m.paused]),T.useEffect(()=>{if(a){GN.add(m);const S=document.activeElement;if(!a.contains(S)){const E=new CustomEvent(Sx,zN);a.addEventListener(Sx,u),a.dispatchEvent(E),E.defaultPrevented||(Zee(rte(nF(a)),{select:!0}),document.activeElement===S&&al(a))}return()=>{a.removeEventListener(Sx,u),setTimeout(()=>{const E=new CustomEvent(Cx,zN);a.addEventListener(Cx,d),a.dispatchEvent(E),E.defaultPrevented||al(S??document.body,{select:!0}),a.removeEventListener(Cx,d),GN.remove(m)},0)}}},[a,u,d,m]);const v=T.useCallback(S=>{if(!n&&!i||m.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(C&&E){const k=S.currentTarget,[R,M]=ete(k);R&&M?!S.shiftKey&&E===M?(S.preventDefault(),n&&al(R,{select:!0})):S.shiftKey&&E===R&&(S.preventDefault(),n&&al(M,{select:!0})):E===k&&S.preventDefault()}},[n,i,m.paused]);return _.jsx(Jee.div,{tabIndex:-1,...o,ref:g,onKeyDown:v})});kT.displayName=Xee;function Zee(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(al(i,{select:e}),document.activeElement!==n)return}function ete(t){const e=nF(t),n=QN(e,t),i=QN(e.reverse(),t);return[n,i]}function nF(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function QN(t,e){for(const n of t)if(!tte(n,{upTo:e}))return n}function tte(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function nte(t){return t instanceof HTMLInputElement&&"select"in t}function al(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&nte(t)&&e&&t.select()}}var GN=ite();function ite(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=$N(t,e),t.unshift(e)},remove(e){t=$N(t,e),t[0]?.resume()}}}function $N(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function rte(t){return t.filter(e=>e.tagName!=="A")}var wl=globalThis?.document?T.useLayoutEffect:()=>{},ste=pT[" useId ".trim().toString()]||(()=>{}),ote=0;function Al(t){const[e,n]=T.useState(ste());return wl(()=>{n(i=>i??String(ote++))},[t]),e?`radix-${e}`:""}const ate=["top","right","bottom","left"],Sl=Math.min,wr=Math.max,gv=Math.round,YA=Math.floor,go=t=>({x:t,y:t}),lte={left:"right",right:"left",bottom:"top",top:"bottom"},cte={start:"end",end:"start"};function P1(t,e,n){return wr(t,Sl(e,n))}function la(t,e){return typeof t=="function"?t(e):t}function ca(t){return t.split("-")[0]}function ch(t){return t.split("-")[1]}function IT(t){return t==="x"?"y":"x"}function MT(t){return t==="y"?"height":"width"}const ute=new Set(["top","bottom"]);function co(t){return ute.has(ca(t))?"y":"x"}function DT(t){return IT(co(t))}function dte(t,e,n){n===void 0&&(n=!1);const i=ch(t),r=DT(t),s=MT(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=mv(o)),[o,mv(o)]}function hte(t){const e=mv(t);return[N1(t),e,N1(e)]}function N1(t){return t.replace(/start|end/g,e=>cte[e])}const WN=["left","right"],jN=["right","left"],fte=["top","bottom"],pte=["bottom","top"];function gte(t,e,n){switch(t){case"top":case"bottom":return n?e?jN:WN:e?WN:jN;case"left":case"right":return e?fte:pte;default:return[]}}function mte(t,e,n,i){const r=ch(t);let s=gte(ca(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(N1)))),s}function mv(t){return t.replace(/left|right|bottom|top/g,e=>lte[e])}function Ate(t){return{top:0,right:0,bottom:0,left:0,...t}}function iF(t){return typeof t!="number"?Ate(t):{top:t,right:t,bottom:t,left:t}}function Av(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function KN(t,e,n){let{reference:i,floating:r}=t;const s=co(e),o=DT(e),a=MT(o),l=ca(e),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,g=i[a]/2-r[a]/2;let m;switch(l){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}switch(ch(e)){case"start":m[o]-=g*(n&&u?-1:1);break;case"end":m[o]+=g*(n&&u?-1:1);break}return m}const yte=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:f}=KN(u,i,l),g=i,m={},v=0;for(let S=0;S({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:d=0}=la(t,e)||{};if(u==null)return{};const f=iF(d),g={x:n,y:i},m=DT(r),v=MT(m),S=await o.getDimensions(u),C=m==="y",E=C?"top":"left",k=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=s.reference[v]+s.reference[m]-g[m]-s.floating[v],D=g[m]-s.reference[m],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=P?P[R]:0;(!N||!await(o.isElement==null?void 0:o.isElement(P)))&&(N=a.floating[R]||s.floating[v]);const B=M/2-D/2,G=N/2-S[v]/2-1,V=Sl(f[E],G),$=Sl(f[k],G),K=V,X=N-S[v]-$,J=N/2-S[v]/2+B,Z=P1(K,J,X),Q=!l.arrow&&ch(r)!=null&&J!==Z&&s.reference[v]/2-(JJ<=0)){var $,K;const J=((($=s.flip)==null?void 0:$.index)||0)+1,Z=N[J];if(Z&&(!(f==="alignment"?k!==co(Z):!1)||V.every(j=>co(j.placement)===k?j.overflows[0]>0:!0)))return{data:{index:J,overflows:V},reset:{placement:Z}};let Q=(K=V.filter(q=>q.overflows[0]<=0).sort((q,j)=>q.overflows[1]-j.overflows[1])[0])==null?void 0:K.placement;if(!Q)switch(m){case"bestFit":{var X;const q=(X=V.filter(j=>{if(P){const oe=co(j.placement);return oe===k||oe==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(oe=>oe>0).reduce((oe,L)=>oe+L,0)]).sort((j,oe)=>j[1]-oe[1])[0])==null?void 0:X[0];q&&(Q=q);break}case"initialPlacement":Q=a;break}if(r!==Q)return{reset:{placement:Q}}}return{}}}};function YN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function qN(t){return ate.some(e=>t[e]>=0)}const wte=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=la(t,e);switch(i){case"referenceHidden":{const s=await ag(e,{...r,elementContext:"reference"}),o=YN(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:qN(o)}}}case"escaped":{const s=await ag(e,{...r,altBoundary:!0}),o=YN(s,n.floating);return{data:{escapedOffsets:o,escaped:qN(o)}}}default:return{}}}}},rF=new Set(["left","top"]);async function Ste(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=ca(n),a=ch(n),l=co(n)==="y",u=rF.has(o)?-1:1,d=s&&l?-1:1,f=la(e,t);let{mainAxis:g,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*d,y:g*u}:{x:g*u,y:m*d}}const Cte=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await Ste(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},xte=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...l}=la(t,e),u={x:n,y:i},d=await ag(e,l),f=co(ca(r)),g=IT(f);let m=u[g],v=u[f];if(s){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",k=m+d[C],R=m-d[E];m=P1(k,m,R)}if(o){const C=f==="y"?"top":"left",E=f==="y"?"bottom":"right",k=v+d[C],R=v-d[E];v=P1(k,v,R)}const S=a.fn({...e,[g]:m,[f]:v});return{...S,data:{x:S.x-n,y:S.y-i,enabled:{[g]:s,[f]:o}}}}}},Ete=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=la(t,e),d={x:n,y:i},f=co(r),g=IT(f);let m=d[g],v=d[f];const S=la(a,e),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const R=g==="y"?"height":"width",M=s.reference[g]-s.floating[R]+C.mainAxis,D=s.reference[g]+s.reference[R]-C.mainAxis;mD&&(m=D)}if(u){var E,k;const R=g==="y"?"width":"height",M=rF.has(ca(r)),D=s.reference[f]-s.floating[R]+(M&&((E=o.offset)==null?void 0:E[f])||0)+(M?0:C.crossAxis),P=s.reference[f]+s.reference[R]+(M?0:((k=o.offset)==null?void 0:k[f])||0)-(M?C.crossAxis:0);vP&&(v=P)}return{[g]:m,[f]:v}}}},_te=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=la(t,e),d=await ag(e,u),f=ca(r),g=ch(r),m=co(r)==="y",{width:v,height:S}=s.floating;let C,E;f==="top"||f==="bottom"?(C=f,E=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,C=g==="end"?"top":"bottom");const k=S-d.top-d.bottom,R=v-d.left-d.right,M=Sl(S-d[C],k),D=Sl(v-d[E],R),P=!e.middlewareData.shift;let N=M,B=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=R),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(N=k),P&&!g){const V=wr(d.left,0),$=wr(d.right,0),K=wr(d.top,0),X=wr(d.bottom,0);m?B=v-2*(V!==0||$!==0?V+$:wr(d.left,d.right)):N=S-2*(K!==0||X!==0?K+X:wr(d.top,d.bottom))}await l({...e,availableWidth:B,availableHeight:N});const G=await o.getDimensions(a.floating);return v!==G.width||S!==G.height?{reset:{rects:!0}}:{}}}};function qb(){return typeof window<"u"}function uh(t){return sF(t)?(t.nodeName||"").toLowerCase():"#document"}function Cr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Eo(t){var e;return(e=(sF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function sF(t){return qb()?t instanceof Node||t instanceof Cr(t).Node:!1}function Rs(t){return qb()?t instanceof Element||t instanceof Cr(t).Element:!1}function bo(t){return qb()?t instanceof HTMLElement||t instanceof Cr(t).HTMLElement:!1}function JN(t){return!qb()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Cr(t).ShadowRoot}const Tte=new Set(["inline","contents"]);function Kg(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=ks(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Tte.has(r)}const Rte=new Set(["table","td","th"]);function kte(t){return Rte.has(uh(t))}const Ite=[":popover-open",":modal"];function Jb(t){return Ite.some(e=>{try{return t.matches(e)}catch{return!1}})}const Mte=["transform","translate","scale","rotate","perspective"],Dte=["transform","translate","scale","rotate","perspective","filter"],Pte=["paint","layout","strict","content"];function PT(t){const e=NT(),n=Rs(t)?ks(t):t;return Mte.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Dte.some(i=>(n.willChange||"").includes(i))||Pte.some(i=>(n.contain||"").includes(i))}function Nte(t){let e=Cl(t);for(;bo(e)&&!Wd(e);){if(PT(e))return e;if(Jb(e))return null;e=Cl(e)}return null}function NT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ote=new Set(["html","body","#document"]);function Wd(t){return Ote.has(uh(t))}function ks(t){return Cr(t).getComputedStyle(t)}function Xb(t){return Rs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Cl(t){if(uh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||JN(t)&&t.host||Eo(t);return JN(e)?e.host:e}function oF(t){const e=Cl(t);return Wd(e)?t.ownerDocument?t.ownerDocument.body:t.body:bo(e)&&Kg(e)?e:oF(e)}function lg(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=oF(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=Cr(r);if(s){const a=O1(o);return e.concat(o,o.visualViewport||[],Kg(r)?r:[],a&&n?lg(a):[])}return e.concat(r,lg(r,[],n))}function O1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function aF(t){const e=ks(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=bo(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=gv(n)!==s||gv(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function OT(t){return Rs(t)?t:t.contextElement}function Td(t){const e=OT(t);if(!bo(e))return go(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=aF(e);let o=(s?gv(n.width):n.width)/i,a=(s?gv(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Bte=go(0);function lF(t){const e=Cr(t);return!NT()||!e.visualViewport?Bte:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Lte(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Cr(t)?!1:e}function Bc(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=OT(t);let o=go(1);e&&(i?Rs(i)&&(o=Td(i)):o=Td(t));const a=Lte(s,n,i)?lF(s):go(0);let l=(r.left+a.x)/o.x,u=(r.top+a.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s){const g=Cr(s),m=i&&Rs(i)?Cr(i):i;let v=g,S=O1(v);for(;S&&i&&m!==v;){const C=Td(S),E=S.getBoundingClientRect(),k=ks(S),R=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,M=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;l*=C.x,u*=C.y,d*=C.x,f*=C.y,l+=R,u+=M,v=Cr(S),S=O1(v)}}return Av({width:d,height:f,x:l,y:u})}function Zb(t,e){const n=Xb(t).scrollLeft;return e?e.left+n:Bc(Eo(t)).left+n}function cF(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Zb(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function Ute(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=Eo(i),a=e?Jb(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=go(1);const d=go(0),f=bo(i);if((f||!f&&!s)&&((uh(i)!=="body"||Kg(o))&&(l=Xb(i)),bo(i))){const m=Bc(i);u=Td(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const g=o&&!f&&!s?cF(o,l):go(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-l.scrollTop*u.y+d.y+g.y}}function Vte(t){return Array.from(t.getClientRects())}function Fte(t){const e=Eo(t),n=Xb(t),i=t.ownerDocument.body,r=wr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=wr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Zb(t);const a=-n.scrollTop;return ks(i).direction==="rtl"&&(o+=wr(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const XN=25;function Hte(t,e){const n=Cr(t),i=Eo(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const d=NT();(!d||d&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=Zb(i);if(u<=0){const d=i.ownerDocument,f=d.body,g=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(i.clientWidth-f.clientWidth-m);v<=XN&&(s-=v)}else u<=XN&&(s+=u);return{width:s,height:o,x:a,y:l}}const zte=new Set(["absolute","fixed"]);function Qte(t,e){const n=Bc(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=bo(t)?Td(t):go(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,u=i*s.y;return{width:o,height:a,x:l,y:u}}function ZN(t,e,n){let i;if(e==="viewport")i=Hte(t,n);else if(e==="document")i=Fte(Eo(t));else if(Rs(e))i=Qte(e,n);else{const r=lF(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Av(i)}function uF(t,e){const n=Cl(t);return n===e||!Rs(n)||Wd(n)?!1:ks(n).position==="fixed"||uF(n,e)}function Gte(t,e){const n=e.get(t);if(n)return n;let i=lg(t,[],!1).filter(a=>Rs(a)&&uh(a)!=="body"),r=null;const s=ks(t).position==="fixed";let o=s?Cl(t):t;for(;Rs(o)&&!Wd(o);){const a=ks(o),l=PT(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&zte.has(r.position)||Kg(o)&&!l&&uF(t,o))?i=i.filter(d=>d!==o):r=a,o=Cl(o)}return e.set(t,i),i}function $te(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?Jb(e)?[]:Gte(e,this._c):[].concat(n),i],a=o[0],l=o.reduce((u,d)=>{const f=ZN(e,d,r);return u.top=wr(f.top,u.top),u.right=Sl(f.right,u.right),u.bottom=Sl(f.bottom,u.bottom),u.left=wr(f.left,u.left),u},ZN(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Wte(t){const{width:e,height:n}=aF(t);return{width:e,height:n}}function jte(t,e,n){const i=bo(e),r=Eo(e),s=n==="fixed",o=Bc(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=go(0);function u(){l.x=Zb(r)}if(i||!i&&!s)if((uh(e)!=="body"||Kg(r))&&(a=Xb(e)),i){const m=Bc(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else r&&u();s&&!i&&r&&u();const d=r&&!i&&!s?cF(r,a):go(0),f=o.left+a.scrollLeft-l.x-d.x,g=o.top+a.scrollTop-l.y-d.y;return{x:f,y:g,width:o.width,height:o.height}}function xx(t){return ks(t).position==="static"}function eO(t,e){if(!bo(t)||ks(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Eo(t)===n&&(n=n.ownerDocument.body),n}function dF(t,e){const n=Cr(t);if(Jb(t))return n;if(!bo(t)){let r=Cl(t);for(;r&&!Wd(r);){if(Rs(r)&&!xx(r))return r;r=Cl(r)}return n}let i=eO(t,e);for(;i&&kte(i)&&xx(i);)i=eO(i,e);return i&&Wd(i)&&xx(i)&&!PT(i)?n:i||Nte(t)||n}const Kte=async function(t){const e=this.getOffsetParent||dF,n=this.getDimensions,i=await n(t.floating);return{reference:jte(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Yte(t){return ks(t).direction==="rtl"}const qte={convertOffsetParentRelativeRectToViewportRelativeRect:Ute,getDocumentElement:Eo,getClippingRect:$te,getOffsetParent:dF,getElementRects:Kte,getClientRects:Vte,getDimensions:Wte,getScale:Td,isElement:Rs,isRTL:Yte};function hF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Jte(t,e){let n=null,i;const r=Eo(t);function s(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:g,height:m}=u;if(a||e(),!g||!m)return;const v=YA(f),S=YA(r.clientWidth-(d+g)),C=YA(r.clientHeight-(f+m)),E=YA(d),R={rootMargin:-v+"px "+-S+"px "+-C+"px "+-E+"px",threshold:wr(0,Sl(1,l))||1};let M=!0;function D(P){const N=P[0].intersectionRatio;if(N!==l){if(!M)return o();N?o(!1,N):i=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!hF(u,t.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(D,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(D,R)}n.observe(t)}return o(!0),s}function Xte(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=OT(t),d=r||s?[...u?lg(u):[],...lg(e)]:[];d.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=u&&a?Jte(u,n):null;let g=-1,m=null;o&&(m=new ResizeObserver(E=>{let[k]=E;k&&k.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=m)==null||R.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let v,S=l?Bc(t):null;l&&C();function C(){const E=Bc(t);S&&!hF(S,E)&&n(),S=E,v=requestAnimationFrame(C)}return n(),()=>{var E;d.forEach(k=>{r&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),f?.(),(E=m)==null||E.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const Zte=Cte,ene=xte,tne=bte,nne=_te,ine=wte,tO=vte,rne=Ete,sne=(t,e,n)=>{const i=new Map,r={platform:qte,...n},s={...r.platform,_c:i};return yte(t,e,{...r,platform:s})};var one=typeof document<"u",ane=function(){},Ry=one?T.useLayoutEffect:ane;function yv(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!yv(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&t.$$typeof)&&!yv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function fF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function nO(t,e){const n=fF(t);return Math.round(e*n)/n}function Ex(t){const e=T.useRef(t);return Ry(()=>{e.current=t}),e}function lne(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[d,f]=T.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,m]=T.useState(i);yv(g,i)||m(i);const[v,S]=T.useState(null),[C,E]=T.useState(null),k=T.useCallback(j=>{j!==P.current&&(P.current=j,S(j))},[]),R=T.useCallback(j=>{j!==N.current&&(N.current=j,E(j))},[]),M=s||v,D=o||C,P=T.useRef(null),N=T.useRef(null),B=T.useRef(d),G=l!=null,V=Ex(l),$=Ex(r),K=Ex(u),X=T.useCallback(()=>{if(!P.current||!N.current)return;const j={placement:e,strategy:n,middleware:g};$.current&&(j.platform=$.current),sne(P.current,N.current,j).then(oe=>{const L={...oe,isPositioned:K.current!==!1};J.current&&!yv(B.current,L)&&(B.current=L,Kb.flushSync(()=>{f(L)}))})},[g,e,n,$,K]);Ry(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,f(j=>({...j,isPositioned:!1})))},[u]);const J=T.useRef(!1);Ry(()=>(J.current=!0,()=>{J.current=!1}),[]),Ry(()=>{if(M&&(P.current=M),D&&(N.current=D),M&&D){if(V.current)return V.current(M,D,X);X()}},[M,D,X,V,G]);const Z=T.useMemo(()=>({reference:P,floating:N,setReference:k,setFloating:R}),[k,R]),Q=T.useMemo(()=>({reference:M,floating:D}),[M,D]),q=T.useMemo(()=>{const j={position:n,left:0,top:0};if(!Q.floating)return j;const oe=nO(Q.floating,d.x),L=nO(Q.floating,d.y);return a?{...j,transform:"translate("+oe+"px, "+L+"px)",...fF(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:L}},[n,a,Q.floating,d.x,d.y]);return T.useMemo(()=>({...d,update:X,refs:Z,elements:Q,floatingStyles:q}),[d,X,Z,Q,q])}const cne=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?tO({element:i.current,padding:r}).fn(n):{}:i?tO({element:i,padding:r}).fn(n):{}}}},une=(t,e)=>({...Zte(t),options:[t,e]}),dne=(t,e)=>({...ene(t),options:[t,e]}),hne=(t,e)=>({...rne(t),options:[t,e]}),fne=(t,e)=>({...tne(t),options:[t,e]}),pne=(t,e)=>({...nne(t),options:[t,e]}),gne=(t,e)=>({...ine(t),options:[t,e]}),mne=(t,e)=>({...cne(t),options:[t,e]});function Ane(t){const e=yne(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(bne);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function yne(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Sne(r),a=wne(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var vne=Symbol("radix.slottable");function bne(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vne}function wne(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Sne(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Cne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xne=Cne.reduce((t,e)=>{const n=Ane(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),Ene="Arrow",pF=T.forwardRef((t,e)=>{const{children:n,width:i=10,height:r=5,...s}=t;return _.jsx(xne.svg,{...s,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});pF.displayName=Ene;var _ne=pF;function Tne(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,Rne(r,...e)]}function Rne(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function kne(t){const e=Ine(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Dne);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function Ine(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Nne(r),a=Pne(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Mne=Symbol("radix.slottable");function Dne(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Mne}function Pne(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Nne(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var One=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gF=One.reduce((t,e)=>{const n=kne(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function mF(t){const[e,n]=T.useState(void 0);return wl(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else n(void 0)},[t]),e}var BT="Popper",[AF,ew]=Tne(BT),[Bne,yF]=AF(BT),vF=t=>{const{__scopePopper:e,children:n}=t,[i,r]=T.useState(null);return _.jsx(Bne,{scope:e,anchor:i,onAnchorChange:r,children:n})};vF.displayName=BT;var bF="PopperAnchor",wF=T.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...r}=t,s=yF(bF,n),o=T.useRef(null),a=$t(e,o),l=T.useRef(null);return T.useEffect(()=>{const u=l.current;l.current=i?.current||o.current,u!==l.current&&s.onAnchorChange(l.current)}),i?null:_.jsx(gF.div,{...r,ref:a})});wF.displayName=bF;var LT="PopperContent",[Lne,Une]=AF(LT),SF=T.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:v,...S}=t,C=yF(LT,n),[E,k]=T.useState(null),R=$t(e,ve=>k(ve)),[M,D]=T.useState(null),P=mF(M),N=P?.width??0,B=P?.height??0,G=i+(s!=="center"?"-"+s:""),V=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},$=Array.isArray(u)?u:[u],K=$.length>0,X={padding:V,boundary:$.filter(Fne),altBoundary:K},{refs:J,floatingStyles:Z,placement:Q,isPositioned:q,middlewareData:j}=lne({strategy:"fixed",placement:G,whileElementsMounted:(...ve)=>Xte(...ve,{animationFrame:m==="always"}),elements:{reference:C.anchor},middleware:[une({mainAxis:r+B,alignmentAxis:o}),l&&dne({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?hne():void 0,...X}),l&&fne({...X}),pne({...X,apply:({elements:ve,rects:tt,availableWidth:it,availableHeight:jt})=>{const{width:en,height:oi}=tt.reference,wi=ve.floating.style;wi.setProperty("--radix-popper-available-width",`${it}px`),wi.setProperty("--radix-popper-available-height",`${jt}px`),wi.setProperty("--radix-popper-anchor-width",`${en}px`),wi.setProperty("--radix-popper-anchor-height",`${oi}px`)}}),M&&mne({element:M,padding:a}),Hne({arrowWidth:N,arrowHeight:B}),g&&gne({strategy:"referenceHidden",...X})]}),[oe,L]=EF(Q),z=Bi(v);wl(()=>{q&&z?.()},[q,z]);const te=j.arrow?.x,U=j.arrow?.y,pe=j.arrow?.centerOffset!==0,[xe,Ce]=T.useState();return wl(()=>{E&&Ce(window.getComputedStyle(E).zIndex)},[E]),_.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:q?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:_.jsx(Lne,{scope:n,placedSide:oe,onArrowChange:D,arrowX:te,arrowY:U,shouldHideArrow:pe,children:_.jsx(gF.div,{"data-side":oe,"data-align":L,...S,ref:R,style:{...S.style,animation:q?void 0:"none"}})})})});SF.displayName=LT;var CF="PopperArrow",Vne={top:"bottom",right:"left",bottom:"top",left:"right"},xF=T.forwardRef(function(e,n){const{__scopePopper:i,...r}=e,s=Une(CF,i),o=Vne[s.placedSide];return _.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:_.jsx(_ne,{...r,ref:n,style:{...r.style,display:"block"}})})});xF.displayName=CF;function Fne(t){return t!==null}var Hne=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,d]=EF(n),f={start:"0%",center:"50%",end:"100%"}[d],g=(r.arrow?.x??0)+a/2,m=(r.arrow?.y??0)+l/2;let v="",S="";return u==="bottom"?(v=o?f:`${g}px`,S=`${-l}px`):u==="top"?(v=o?f:`${g}px`,S=`${i.floating.height+l}px`):u==="right"?(v=`${-l}px`,S=o?f:`${m}px`):u==="left"&&(v=`${i.floating.width+l}px`,S=o?f:`${m}px`),{data:{x:v,y:S}}}});function EF(t){const[e,n="center"]=t.split("-");return[e,n]}var _F=vF,TF=wF,RF=SF,kF=xF;function zne(t){const e=Qne(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find($ne);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function Qne(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=jne(r),a=Wne(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Gne=Symbol("radix.slottable");function $ne(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Gne}function Wne(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function jne(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Kne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yne=Kne.reduce((t,e)=>{const n=zne(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),qne="Portal",UT=T.forwardRef((t,e)=>{const{container:n,...i}=t,[r,s]=T.useState(!1);wl(()=>s(!0),[]);const o=n||r&&globalThis?.document?.body;return o?yee.createPortal(_.jsx(Yne.div,{...i,ref:e}),o):null});UT.displayName=qne;function Jne(t,e){return T.useReducer((n,i)=>e[n][i]??n,t)}var _o=t=>{const{present:e,children:n}=t,i=Xne(e),r=typeof n=="function"?n({present:i.isPresent}):T.Children.only(n),s=$t(i.ref,Zne(r));return typeof n=="function"||i.isPresent?T.cloneElement(r,{ref:s}):null};_o.displayName="Presence";function Xne(t){const[e,n]=T.useState(),i=T.useRef(null),r=T.useRef(t),s=T.useRef("none"),o=t?"mounted":"unmounted",[a,l]=Jne(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const u=qA(i.current);s.current=a==="mounted"?u:"none"},[a]),wl(()=>{const u=i.current,d=r.current;if(d!==t){const g=s.current,m=qA(u);t?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&g!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,l]),wl(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=m=>{const S=qA(i.current).includes(CSS.escape(m.animationName));if(m.target===e&&S&&(l("ANIMATION_END"),!r.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},g=m=>{m.target===e&&(s.current=qA(i.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:T.useCallback(u=>{i.current=u?getComputedStyle(u):null,n(u)},[])}}function qA(t){return t?.animationName||"none"}function Zne(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var eie=pT[" useInsertionEffect ".trim().toString()]||wl;function dh({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[r,s,o]=tie({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:r;{const d=T.useRef(t!==void 0);T.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${i} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,i])}const u=T.useCallback(d=>{if(a){const f=nie(d)?d(t):d;f!==t&&o.current?.(f)}else s(d)},[a,t,s,o]);return[l,u]}function tie({defaultProp:t,onChange:e}){const[n,i]=T.useState(t),r=T.useRef(n),s=T.useRef(e);return eie(()=>{s.current=e},[e]),T.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,i,s]}function nie(t){return typeof t=="function"}var iie=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Gu=new WeakMap,JA=new WeakMap,XA={},_x=0,IF=function(t){return t&&(t.host||IF(t.parentNode))},rie=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=IF(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},sie=function(t,e,n,i){var r=rie(e,Array.isArray(t)?t:[t]);XA[n]||(XA[n]=new WeakMap);var s=XA[n],o=[],a=new Set,l=new Set(r),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else try{var m=g.getAttribute(i),v=m!==null&&m!=="false",S=(Gu.get(g)||0)+1,C=(s.get(g)||0)+1;Gu.set(g,S),s.set(g,C),o.push(g),S===1&&v&&JA.set(g,!0),C===1&&g.setAttribute(n,"true"),v||g.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return d(e),a.clear(),_x++,function(){o.forEach(function(f){var g=Gu.get(f)-1,m=s.get(f)-1;Gu.set(f,g),s.set(f,m),g||(JA.has(f)||f.removeAttribute(i),JA.delete(f)),m||f.removeAttribute(n)}),_x--,_x||(Gu=new WeakMap,Gu=new WeakMap,JA=new WeakMap,XA={})}},MF=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=iie(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),sie(i,r,n,"aria-hidden")):function(){return null}},ro=function(){return ro=Object.assign||function(e){for(var n,i=1,r=arguments.length;i"u")return wie;var e=Sie(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},xie=OF(),Rd="data-scroll-locked",Eie=function(t,e,n,i){var r=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` - .`.concat(oie,` { - overflow: hidden `).concat(i,`; - padding-right: `).concat(a,"px ").concat(i,`; +`);class LZ{_core;get path(){return this._core.path}constructor(t){this._core=t,this.__internal_bindMethods()}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(t){return this._core.subscribe(t)}}class FZ extends LZ{_composerApi;constructor(t,n){super(t),this._composerApi=n}remove(){const t=this._composerApi.getState();if(!t)throw new Error("Composer is not available");return t.removeAttachment(this.getState().id)}}class Nbe extends FZ{get source(){return"thread-composer"}}class Lbe extends FZ{get source(){return"edit-composer"}}class Fbe extends LZ{get source(){return"message"}constructor(t){super(t)}remove(){throw new Error("Message attachments cannot be removed")}}class xZ extends RM{config;constructor(t){super(),this.config=t}getState(){return this.config.binding.getState()}outerSubscribe(t){return this.config.binding.subscribe(t)}_connect(){const t=()=>{this.notifySubscribers()};let n=this.config.binding.getState(),o=n?.unstable_on(this.config.event,t);const r=()=>{const s=this.config.binding.getState();s!==n&&(n=s,o?.(),o=this.config.binding.getState()?.unstable_on(this.config.event,t))},i=this.outerSubscribe(r);return()=>{i?.(),o?.()}}}const BZ=Object.freeze([]),kZ=Object.freeze({}),xbe=e=>Object.freeze({type:"thread",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??BZ,text:e?.text??"",role:e?.role??"user",runConfig:e?.runConfig??kZ,attachmentAccept:e?.attachmentAccept??"",value:e?.text??""}),Bbe=e=>Object.freeze({type:"edit",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,isEmpty:e?.isEmpty??!0,text:e?.text??"",role:e?.role??"user",attachments:e?.attachments??BZ,runConfig:e?.runConfig??kZ,attachmentAccept:e?.attachmentAccept??"",value:e?.text??""});class UZ{_core;get path(){return this._core.path}constructor(t){this._core=t}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setText(t)}setRunConfig(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRunConfig(t)}addAttachment(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");return n.addAttachment(t)}reset(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.reset()}clearAttachments(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.clearAttachments()}send(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.send()}cancel(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.cancel()}setRole(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRole(t)}subscribe(t){return this._core.subscribe(t)}_eventSubscriptionSubjects=new Map;unstable_on(t,n){let o=this._eventSubscriptionSubjects.get(t);return o||(o=new xZ({event:t,binding:this._core}),this._eventSubscriptionSubjects.set(t,o)),o.subscribe(n)}}class kbe extends UZ{get path(){return this._core.path}get type(){return"thread"}_getState;constructor(t){const n=new SF({path:t.path,getState:()=>xbe(t.getState()),subscribe:o=>t.subscribe(o)});super({path:t.path,getState:()=>t.getState(),subscribe:o=>n.subscribe(o)}),this._getState=n.getState.bind(n),this.__internal_bindMethods()}getState(){return this._getState()}getAttachmentByIndex(t){return new Nbe(new ms({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}${this.path.ref}.attachments[${t}]`},getState:()=>{const o=this.getState().attachments[t];return o?{...o,source:"thread-composer"}:ws},subscribe:n=>this._core.subscribe(n)}),this._core)}}class Ube extends UZ{_beginEdit;get path(){return this._core.path}get type(){return"edit"}_getState;constructor(t,n){const o=new SF({path:t.path,getState:()=>Bbe(t.getState()),subscribe:r=>t.subscribe(r)});super({path:t.path,getState:()=>t.getState(),subscribe:r=>o.subscribe(r)}),this._beginEdit=n,this._getState=o.getState.bind(o),this.__internal_bindMethods()}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(t){return new Lbe(new ms({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}${this.path.ref}.attachments[${t}]`},getState:()=>{const o=this.getState().attachments[t];return o?{...o,source:"edit-composer"}:ws},subscribe:n=>this._core.subscribe(n)}),this._core)}}const nV=Symbol.for("aui.tool-response");class As{get[nV](){return!0}artifact;result;isError;constructor(t){t.artifact!==void 0&&(this.artifact=t.artifact),this.result=t.result,this.isError=t.isError??!1}static[Symbol.hasInstance](t){return typeof t=="object"&&t!==null&&nV in t}static toResponse(t){return t instanceof As?t:new As({result:t===void 0?"":t})}}function qbe(e,t,n){try{const o=e();if(typeof o=="object"&&o!==null&&"then"in o)return o.then(t,n);t(o)}catch(o){n(o)}}function wC(e,t){let n=e;for(const o of t){if(n==null)return;n=n[o]}return n}class Jbe{resolve;reject;disposed=!1;fieldPath;constructor(t,n,o){this.resolve=t,this.reject=n,this.fieldPath=o}update(t){if(!this.disposed)try{if(cA(t,this.fieldPath)==="complete"){const n=wC(t,this.fieldPath);n!==void 0&&(this.resolve(n),this.dispose())}}catch(n){this.reject(n),this.dispose()}}dispose(){this.disposed=!0}}class rV{controller;disposed=!1;fieldPath;constructor(t,n){this.controller=t,this.fieldPath=n}update(t){if(!this.disposed)try{const n=wC(t,this.fieldPath);n!==void 0&&this.controller.enqueue(n),cA(t,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(n){this.controller.error(n),this.dispose()}}dispose(){this.disposed=!0}}class oV{controller;disposed=!1;fieldPath;lastValue=void 0;constructor(t,n){this.controller=t,this.fieldPath=n}update(t){if(!this.disposed)try{const n=wC(t,this.fieldPath);if(n!==void 0&&typeof n=="string"){const o=n.substring(this.lastValue?.length||0);this.lastValue=n,this.controller.enqueue(o)}cA(t,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(n){this.controller.error(n),this.dispose()}}dispose(){this.disposed=!0}}class iV{controller;disposed=!1;fieldPath;processedIndexes=new Set;constructor(t,n){this.controller=t,this.fieldPath=n}update(t){if(!this.disposed)try{const n=wC(t,this.fieldPath);if(!Array.isArray(n))return;for(let o=0;o{const r=new Jbe(n,o,t);if(this.args&&cA(this.args,t)==="complete"){const i=wC(this.args,t);if(i!==void 0){n(i);return}}this.handles.add(r),r.update(this.args)})}streamValues(...t){const n=t,o=new ReadableStream({start:r=>{const i=new rV(r,n);this.handles.add(i),i.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof rV){r.dispose(),this.handles.delete(r);break}}});return sD(o)}streamText(...t){const n=t,o=new ReadableStream({start:r=>{const i=new oV(r,n);this.handles.add(i),i.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof oV){r.dispose(),this.handles.delete(r);break}}});return sD(o)}forEach(...t){const n=t,o=new ReadableStream({start:r=>{const i=new iV(r,n);this.handles.add(i),i.update(this.args)},cancel:()=>{for(const r of this.handles)if(r instanceof iV){r.dispose(),this.handles.delete(r);break}}});return sD(o)}}class Hbe{promise;constructor(t){this.promise=t}get(){return this.promise}}class Gbe{args;response;writable;resolve;argsText="";constructor(){const t=new TransformStream;this.writable=t.writable,this.args=new Vbe(t.readable);const{promise:n,resolve:o}=yF();this.resolve=o,this.response=new Hbe(n)}async appendArgsTextDelta(t){const n=this.writable.getWriter();try{await n.write(t)}catch(o){console.warn(o)}finally{n.releaseLock()}this.argsText+=t}setResponse(t){this.resolve(t)}result={get:async()=>(await this.response.get()).result}}class zbe extends Rbe{constructor(t){const n=new Map,o=new Map;super(r=>{const i=new TransformStream({transform(s,a){switch((s.type!=="part-finish"||s.meta.type!=="tool-call")&&a.enqueue(s),s.type){case"part-start":if(s.part.type==="tool-call"){const p=new Gbe;o.set(s.part.toolCallId,p),t.streamCall({reader:p,toolCallId:s.part.toolCallId,toolName:s.part.toolName})}break;case"text-delta":{if(s.meta.type==="tool-call"){const p=s.meta.toolCallId,u=o.get(p);if(!u)throw new Error("No controller found for tool call");u.appendArgsTextDelta(s.textDelta)}break}case"result":{if(s.meta.type!=="tool-call")break;const{toolCallId:p}=s.meta,u=o.get(p);if(!u)throw new Error("No controller found for tool call");u.setResponse(new As({result:s.result,artifact:s.artifact,isError:s.isError}));break}case"tool-call-args-text-finish":{if(s.meta.type!=="tool-call")break;const{toolCallId:p,toolName:u}=s.meta,l=o.get(p);if(!l)throw new Error("No controller found for tool call");let d=!1;const f=qbe(()=>{let h;try{h=P2.parse(l.argsText)}catch(g){throw new Error(`Function parameter parsing failed. ${JSON.stringify(g.message)}`)}const m=t.execute({toolCallId:p,toolName:u,args:h});return m!==void 0&&(d=!0,t.onExecutionStart?.(p,u)),m},h=>{if(d&&t.onExecutionEnd?.(p,u),h===void 0)return;const m=new As({artifact:h.artifact,result:h.result,isError:h.isError});l.setResponse(m),a.enqueue({type:"result",path:s.path,...m})},h=>{d&&t.onExecutionEnd?.(p,u);const m=new As({result:String(h),isError:!0});l.setResponse(m),a.enqueue({type:"result",path:s.path,...m})});f&&n.set(p,f);break}case"part-finish":{if(s.meta.type!=="tool-call")break;const{toolCallId:p}=s.meta,u=n.get(p);u?u.then(()=>{n.delete(p),o.delete(p),a.enqueue(s)}):a.enqueue(s)}}},async flush(){await Promise.all(n.values())}});return r.pipeThrough(new NZ).pipeThrough(i)})}}const Kbe=e=>typeof e=="object"&&e!==null&&"~standard"in e&&e["~standard"].version===1;function Qbe(e,t,n,o){const r=e?.[n.toolName];return!r||!r.execute?void 0:(async s=>{if(t.aborted)return new As({result:"Tool execution was cancelled.",isError:!0});let a=s;if(Kbe(r.parameters)){let u=r.parameters["~standard"].validate(n.args);u instanceof Promise&&(u=await u),u.issues&&(a=r.experimental_onSchemaValidationError??(()=>{throw new Error(`Function parameter validation failed. ${JSON.stringify(u.issues)}`)}))}const c=new Promise(u=>{const l=()=>{queueMicrotask(()=>{queueMicrotask(()=>{u(new As({result:"Tool execution was cancelled.",isError:!0}))})})};t.aborted?l():t.addEventListener("abort",l,{once:!0})}),p=(async()=>{const u=await a(n.args,{toolCallId:n.toolCallId,abortSignal:t,human:l=>o(n.toolCallId,l)});return As.toResponse(u)})();return Promise.race([p,c])})(r.execute)}function $be(e,t,n,o,r){e?.[o.toolName]?.streamCall?.(n,{toolCallId:o.toolCallId,abortSignal:t,human:i=>r(o.toolCallId,i)})}function Wbe(e,t,n,o){const r=typeof e=="function"?e:()=>e,i=typeof t=="function"?t:()=>t;return new zbe({execute:s=>Qbe(r(),i(),s,n),streamCall:({reader:s,...a})=>$be(r(),i(),s,a,n),onExecutionStart:o?.onExecutionStart,onExecutionEnd:o?.onExecutionEnd})}class sV{contentBinding;messageApi;threadApi;get path(){return this.contentBinding.path}constructor(t,n,o){this.contentBinding=t,this.messageApi=n,this.threadApi=o,this.__internal_bindMethods()}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(t){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const o=this.messageApi.getState();if(!o)throw new Error("Message is not available");const r=n.toolName,i=n.toolCallId,s=As.toResponse(t);this.threadApi.getState().addToolResult({messageId:o.id,toolName:r,toolCallId:i,result:s.result,artifact:s.artifact,isError:s.isError})}resumeToolCall(t){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw new Error("Thread API is not available");const o=n.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:o,payload:t})}subscribe(t){return this.contentBinding.subscribe(t)}}class zR extends RM{binding;get path(){return this.binding.path}constructor(t){super(),this.binding=t}getState(){return this.binding.getState()}outerSubscribe(t){return this.binding.subscribe(t)}_connect(){const t=()=>{this.notifySubscribers()};let n=this.binding.getState(),o=n?.subscribe(t);const r=()=>{const s=this.binding.getState();s!==n&&(n=s,o?.(),o=this.binding.getState()?.subscribe(t),t())},i=this.outerSubscribe(r);return()=>{i?.(),o?.()}}}const SO=Object.freeze({type:"complete"}),Ybe=(e,t,n)=>{if(e.role!=="assistant")return SO;if(n.type==="tool-call")return n.result?SO:e.status;const o=t===Math.max(0,e.content.length-1);return e.status.type==="requires-action"?SO:o?e.status:SO},aV=(e,t)=>{const n=e.content[t];if(!n)return ws;const o=Ybe(e,t,n);return Object.freeze({...n,[dA]:n[dA],status:o})};class Xbe{_core;_threadBinding;get path(){return this._core.path}constructor(t,n){this._core=t,this._threadBinding=n,this.composer=new Ube(new zR({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:o=>this._threadBinding.subscribe(o)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}reload(t={}){const n=this._getEditComposerRuntimeCore(),o=n??this._threadBinding.getState().composer,r=n??o,{runConfig:i=r.runConfig}=t,s=this._core.getState();if(s.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:s.parentId,sourceId:s.id,runConfig:i})}speak(){const t=this._core.getState();return this._threadBinding.getState().speak(t.id)}stopSpeaking(){const t=this._core.getState();if(this._threadBinding.getState().speech?.messageId===t.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:t}){const n=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:n.id,type:t})}switchToBranch({position:t,branchId:n}){const o=this._core.getState();if(n&&t)throw new Error("May not specify both branchId and position");if(!n&&!t)throw new Error("Must specify either branchId or position");const i=this._threadBinding.getState().getBranches(o.id);let s=n;if(t==="previous"?s=i[o.branchNumber-2]:t==="next"&&(s=i[o.branchNumber]),!s)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(s)}unstable_getCopyText(){return j0(this.getState())}subscribe(t){return this._core.subscribe(t)}getMessagePartByIndex(t){if(t<0)throw new Error("Message part index must be >= 0");return new sV(new ms({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${t}]`,messagePartSelector:{type:"index",index:t}},getState:()=>aV(this.getState(),t),subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getMessagePartByToolCallId(t){return new sV(new ms({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(t)}]`,messagePartSelector:{type:"toolCallId",toolCallId:t}},getState:()=>{const n=this._core.getState(),o=n.content.findIndex(r=>r.type==="tool-call"&&r.toolCallId===t);return o===-1?ws:aV(n,o)},subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getAttachmentByIndex(t){return new Fbe(new ms({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${t}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:t}},getState:()=>{const o=this.getState().attachments?.[t];return o?{...o,source:"message"}:ws},subscribe:n=>this._core.subscribe(n)}))}}const Zbe=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),eye=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),tye=(e,t)=>typeof t=="string"?{createdAt:new Date,parentId:e.at(-1)?.id??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??e.at(-1)?.id??null,sourceId:t.sourceId??null,role:t.role??"user",content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun},nye=(e,t)=>{const n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:n?.role!=="assistant"?!1:n.status.type==="running",messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech})};class qZ{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(t,n){const o=new ms({path:t.path,getState:()=>nye(t.getState(),n.getState()),subscribe:r=>{const i=t.subscribe(r),s=n.subscribe(r);return()=>{i(),s()}}});this._threadBinding={path:t.path,getState:()=>t.getState(),getStateState:()=>o.getState(),outerSubscribe:r=>t.outerSubscribe(r),subscribe:r=>t.subscribe(r)},this.composer=new kbe(new zR({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:r=>this._threadBinding.subscribe(r)})),this.__internal_bindMethods()}__internal_bindMethods(){this.append=this.append.bind(this),this.unstable_resumeRun=this.unstable_resumeRun.bind(this),this.unstable_loadExternalState=this.unstable_loadExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getModelConfig=this.getModelConfig.bind(this),this.getState=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(t){this._threadBinding.getState().append(tye(this._threadBinding.getState().messages,t))}subscribe(t){return this._threadBinding.subscribe(t)}getModelContext(){return this._threadBinding.getState().getModelContext()}getModelConfig(){return this.getModelContext()}startRun(t){const n=t===null||typeof t=="string"?{parentId:t}:t;return this._threadBinding.getState().startRun(eye(n))}unstable_resumeRun(t){return this._threadBinding.getState().resumeRun(Zbe(t))}unstable_loadExternalState(t){this._threadBinding.getState().unstable_loadExternalState(t)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}export(){return this._threadBinding.getState().export()}import(t){this._threadBinding.getState().import(t)}reset(t){this._threadBinding.getState().reset(t)}getMessageByIndex(t){if(t<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}${this.path.ref}.messages[${t}]`,messageSelector:{type:"index",index:t}},()=>{const n=this._threadBinding.getState().messages,o=n[t];if(o)return{message:o,parentId:n[t-1]?.id??null,index:t}})}getMessageById(t){return this._getMessageRuntime({...this.path,ref:this.path.ref+`${this.path.ref}.messages[messageId=${JSON.stringify(t)}]`,messageSelector:{type:"messageId",messageId:t}},()=>this._threadBinding.getState().getMessageById(t))}_getMessageRuntime(t,n){return new Xbe(new ms({path:t,getState:()=>{const{message:o,parentId:r,index:i}=n()??{},{messages:s,speech:a}=this._threadBinding.getState();if(!o||r===void 0||i===void 0)return ws;const p=this._threadBinding.getState().getBranches(o.id),u=o.metadata.submittedFeedback;return{...o,[dA]:o[dA],index:i,isLast:s.at(-1)?.id===o.id,parentId:r,branchNumber:p.indexOf(o.id)+1,branchCount:p.length,speech:a?.messageId===o.id?a:void 0,submittedFeedback:u}},subscribe:o=>this._threadBinding.subscribe(o)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(t,n){let o=this._eventSubscriptionSubjects.get(t);return o||(o=new xZ({event:t,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(t,o)),o.subscribe(n)}}const rye=e=>({mainThreadId:e.mainThreadId,newThread:e.newThreadId,threads:e.threadIds,archivedThreads:e.archivedThreadIds,isLoading:e.isLoading,threadItems:e.threadData}),CO=(e,t)=>{if(t===void 0)return ws;const n=e.getItemById(t);return n?{id:n.id,threadId:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,isMain:n.id===e.mainThreadId}:ws};class oye{_core;_runtimeFactory;_getState;constructor(t,n=qZ){this._core=t,this._runtimeFactory=n;const o=new SF({path:{},getState:()=>rye(t),subscribe:r=>t.subscribe(r)});this._getState=o.getState.bind(o),this._mainThreadListItemRuntime=new vO(new ms({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>CO(this._core,this._core.mainThreadId),subscribe:r=>this._core.subscribe(r)}),this._core),this.main=new n(new zR({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>t.getMainThreadRuntimeCore(),subscribe:r=>t.subscribe(r)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(t){return this._core.switchToThread(t)}switchToNewThread(){return this._core.switchToNewThread()}getState(){return this._getState()}subscribe(t){return this._core.subscribe(t)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(t){return new this._runtimeFactory(new zR({path:{ref:`threads[threadId=${JSON.stringify(t)}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>this._core.getThreadRuntimeCore(t),subscribe:n=>this._core.subscribe(n)}),this.mainItem)}getItemByIndex(t){return new vO(new ms({path:{ref:`threadItems[${t}]`,threadSelector:{type:"index",index:t}},getState:()=>CO(this._core,this._core.threadIds[t]),subscribe:n=>this._core.subscribe(n)}),this._core)}getArchivedItemByIndex(t){return new vO(new ms({path:{ref:`archivedThreadItems[${t}]`,threadSelector:{type:"archiveIndex",index:t}},getState:()=>CO(this._core,this._core.archivedThreadIds[t]),subscribe:n=>this._core.subscribe(n)}),this._core)}getItemById(t){return new vO(new ms({path:{ref:`threadItems[threadId=${t}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>CO(this._core,t),subscribe:n=>this._core.subscribe(n)}),this._core)}}class iye{accept="image/*";async add(t){return{id:t.file.name,type:"image",name:t.file.name,contentType:t.file.type,file:t.file,status:{type:"requires-action",reason:"composer-send"}}}async send(t){return{...t,status:{type:"complete"},content:[{type:"image",image:await sye(t.file)}]}}async remove(){}}const sye=e=>new Promise((t,n)=>{const o=new FileReader;o.onload=()=>t(o.result),o.onerror=r=>n(r),o.readAsDataURL(e)});class aye{accept="text/plain,text/html,text/markdown,text/csv,text/xml,text/json,text/css";async add(t){return{id:t.file.name,type:"document",name:t.file.name,contentType:t.file.type,file:t.file,status:{type:"requires-action",reason:"composer-send"}}}async send(t){return{...t,status:{type:"complete"},content:[{type:"text",text:` +${await lye(t.file)} +`}]}}async remove(){}}const lye=e=>new Promise((t,n)=>{const o=new FileReader;o.onload=()=>t(o.result),o.onerror=r=>n(r),o.readAsText(e)});function aD(e,t){if(t==="*")return!0;const n=t.split(",").map(i=>i.trim().toLowerCase()),o=`.${e.name.split(".").pop().toLowerCase()}`,r=e.type.toLowerCase();for(const i of n){if(i.startsWith(".")&&i===o||i.includes("/")&&i===r)return!0;if((i==="image/*"||i==="video/*"||i==="audio/*")&&i.endsWith("/*")){const s=i.split("/")[0];if(r.startsWith(`${s}/`))return!0}}return!1}class uye{_adapters;accept;constructor(t){this._adapters=t;const n=t.findIndex(o=>o.accept==="*");if(n!==-1){if(n!==t.length-1)throw new Error("A wildcard adapter (handling all files) can only be specified as the last adapter.");this.accept="*"}else this.accept=t.map(o=>o.accept).join(",")}add(t){for(const n of this._adapters)if(aD(t.file,n.accept))return n.add(t);throw new Error("No matching adapter found for file")}async send(t){const n=this._adapters.slice();for(const o of n)if(aD(t.file,o.accept))return o.send(t);throw new Error("No matching adapter found for attachment")}async remove(t){const n=this._adapters.slice();for(const o of n)if(aD({name:t.name,type:t.contentType},o.accept))return o.remove(t);throw new Error("No matching adapter found for attachment")}}const cye=x.createContext(null),dye=()=>x.useContext(cye),ag=Object.freeze([]),Mg="DEFAULT_THREAD_ID",fye=Object.freeze([Mg]),JZ=Object.freeze({id:Mg,remoteId:void 0,externalId:void 0,status:"regular"}),hye=Promise.resolve(),lV=Object.freeze({[Mg]:JZ});class pye{adapter;threadFactory;_mainThreadId=Mg;_threads=fye;_archivedThreads=ag;_threadData=lV;get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadData(){return this._threadData}getLoadThreadsPromise(){return hye}_mainThread;get mainThreadId(){return this._mainThreadId}constructor(t={},n){this.adapter=t,this.threadFactory=n,this._mainThread=this.threadFactory(),this.__internal_setAdapter(t,!0)}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getItemById(t){for(const n of this.adapter.threads??[])if(n.id===t)return n;for(const n of this.adapter.archivedThreads??[])if(n.id===t)return n;if(t===Mg)return JZ}__internal_setAdapter(t,n=!1){const o=this.adapter;this.adapter=t;const r=t.threadId??Mg,i=t.threads??ag,s=t.archivedThreads??ag,a=o.threadId??Mg,c=o.threads??ag,p=o.archivedThreads??ag;!n&&a===r&&c===i&&p===s||(this._threadData={...lV,...Object.fromEntries(t.threads?.map(u=>[u.id,{...u,remoteId:u.remoteId,externalId:u.externalId,status:"regular"}])??[]),...Object.fromEntries(t.archivedThreads?.map(u=>[u.id,{...u,remoteId:u.remoteId,externalId:u.externalId,status:"archived"}])??[])},c!==i&&(this._threads=this.adapter.threads?.map(u=>u.id)??ag),p!==s&&(this._archivedThreads=this.adapter.archivedThreads?.map(u=>u.id)??ag),a!==r&&(this._mainThreadId=r,this._mainThread=this.threadFactory()),this._notifySubscribers())}async switchToThread(t){if(this._mainThreadId===t)return;const n=this.adapter.onSwitchToThread;if(!n)throw new Error("External store adapter does not support switching to thread");n(t)}async switchToNewThread(){const t=this.adapter.onSwitchToNewThread;if(!t)throw new Error("External store adapter does not support switching to new thread");t()}async rename(t,n){const o=this.adapter.onRename;if(!o)throw new Error("External store adapter does not support renaming");o(t,n)}async detach(){}async archive(t){const n=this.adapter.onArchive;if(!n)throw new Error("External store adapter does not support archiving");n(t)}async unarchive(t){const n=this.adapter.onUnarchive;if(!n)throw new Error("External store adapter does not support unarchiving");n(t)}async delete(t){const n=this.adapter.onDelete;if(!n)throw new Error("External store adapter does not support deleting");n(t)}initialize(t){return Promise.resolve({remoteId:t,externalId:void 0})}generateTitle(){throw new Error("Method not implemented.")}_subscriptions=new Set;subscribe(t){return this._subscriptions.add(t),()=>this._subscriptions.delete(t)}_notifySubscribers(){for(const t of this._subscriptions)t()}}class uV{cache=new WeakMap;convertMessages(t,n){return t.map((o,r)=>{const i=this.cache.get(o),s=n(i,o,r);return this.cache.set(o,s),s})}}class mye extends EZ{runtime;endEditCallback;get canCancel(){return!0}getAttachmentAdapter(){return this.runtime.adapters?.attachments}_nonTextParts;_previousText;_parentId;_sourceId;constructor(t,n,{parentId:o,message:r}){super(),this.runtime=t,this.endEditCallback=n,this._parentId=o,this._sourceId=r.id,this._previousText=j0(r),this.setText(this._previousText),this.setRole(r.role),this.setAttachments(r.attachments??[]),this._nonTextParts=r.content.filter(i=>i.type!=="text"),this.setRunConfig({...t.composer.runConfig})}async handleSend(t){j0(t)!==this._previousText&&this.runtime.append({...t,content:[...t.content,...this._nonTextParts],parentId:this._parentId,sourceId:this._sourceId}),this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}}class gye{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new vF;get messages(){return this.repository.getMessages()}get state(){let t;for(const n of this.messages)if(n.role==="assistant"){t=n;break}return t?.metadata.unstable_state??null}composer=new MZ(this);constructor(t){this._contextProvider=t}getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(t){return this._editComposers.get(t)}beginEdit(t){if(this._editComposers.has(t))throw new Error("Edit already in progress");this._editComposers.set(t,new mye(this,()=>this._editComposers.delete(t),this.repository.getMessage(t))),this._notifySubscribers()}getMessageById(t){try{return this.repository.getMessage(t)}catch{return}}getBranches(t){return this.repository.getBranches(t)}switchToBranch(t){this.repository.switchToBranch(t),this._notifySubscribers()}_notifySubscribers(){for(const t of this._subscriptions)t()}_notifyEventSubscribers(t){const n=this._eventSubscribers.get(t);if(n)for(const o of n)o()}subscribe(t){return this._subscriptions.add(t),()=>this._subscriptions.delete(t)}submitFeedback({messageId:t,type:n}){const o=this.adapters?.feedback;if(!o)throw new Error("Feedback adapter not configured");const{message:r,parentId:i}=this.repository.getMessage(t);if(o.submit({message:r,type:n}),r.role==="assistant"){const s={...r,metadata:{...r.metadata,submittedFeedback:{type:n}}};this.repository.addOrUpdateMessage(i,s)}this._notifySubscribers()}_stopSpeaking;speech;speak(t){const n=this.adapters?.speech;if(!n)throw new Error("Speech adapter not configured");const{message:o}=this.repository.getMessage(t);this._stopSpeaking?.();const r=n.speak(j0(o)),i=r.subscribe(()=>{r.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:t,status:r.status},this._notifySubscribers()});this.speech={messageId:t,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),i(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize"))}export(){return this.repository.export()}import(t){this.ensureInitialized(),this.repository.clear(),this.repository.import(t),this._notifySubscribers()}reset(t){this.import(_F.fromArray(t??[]))}_eventSubscribers=new Map;unstable_on(t,n){if(t==="model-context-update")return this._contextProvider.subscribe?.(n)??(()=>{});const o=this._eventSubscribers.get(t);return o?o.add(n):this._eventSubscribers.set(t,new Set([n])),()=>{this._eventSubscribers.get(t).delete(n)}}}const bye=Object.freeze([]),yye=(e,t)=>e&&t[t.length-1]?.role!=="assistant";class Aye extends gye{_assistantOptimisticId=null;_capabilities={switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,attachments:!1,feedback:!1};get capabilities(){return this._capabilities}_messages;isDisabled;get isLoading(){return this._store.isLoading??!1}get messages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}suggestions=[];extras=void 0;_converter=new uV;_store;beginEdit(t){if(!this._store.onEdit)throw new Error("Runtime does not support editing.");super.beginEdit(t)}constructor(t,n){super(t),this.__internal_setAdapter(n)}__internal_setAdapter(t){if(this._store===t)return;const n=t.isRunning??!1;this.isDisabled=t.isDisabled??!1;const o=this._store;this._store=t,this.extras=t.extras,this.suggestions=t.suggestions??bye,this._capabilities={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:this._store.adapters?.speech!==void 0,unstable_copy:this._store.unstable_capabilities?.copy!==!1,attachments:!!this._store.adapters?.attachments,feedback:!!this._store.adapters?.feedback};let r;if(t.messageRepository){if(o&&o.isRunning===t.isRunning&&o.messageRepository===t.messageRepository){this._notifySubscribers();return}this.repository.clear(),this._assistantOptimisticId=null,this.repository.import(t.messageRepository),r=this.repository.getMessages()}else if(t.messages){if(o){if(o.convertMessage!==t.convertMessage)this._converter=new uV;else if(o.isRunning===t.isRunning&&o.messages===t.messages){this._notifySubscribers();return}}r=t.convertMessage?this._converter.convertMessages(t.messages,(i,s,a)=>{if(!t.convertMessage)return s;const c=a===t.messages.length-1,p=bF(c,n,!1,!1,void 0);if(i&&(i.role!=="assistant"||!gbe(i.status)||i.status===p))return i;const u=t.convertMessage(s,a),l=TM(u,a.toString(),p);return l[dA]=s,l}):t.messages;for(let i=0;i0&&this.ensureInitialized(),(o?.isRunning??!1)!==(t.isRunning??!1)&&(t.isRunning?this._notifyEventSubscribers("run-start"):this._notifyEventSubscribers("run-end")),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null),yye(n,r)&&(this._assistantOptimisticId=this.repository.appendOptimisticMessage(r.at(-1)?.id??null,{role:"assistant",content:[]})),this.repository.resetHead(this._assistantOptimisticId??r.at(-1)?.id??null),this._messages=this.repository.getMessages(),this._notifySubscribers()}switchToBranch(t){if(!this._store.setMessages)throw new Error("Runtime does not support switching branches.");this._store.isRunning||(this.repository.switchToBranch(t),this.updateMessages(this.repository.getMessages()))}async append(t){if(t.parentId!==(this.messages.at(-1)?.id??null)){if(!this._store.onEdit)throw new Error("Runtime does not support editing messages.");await this._store.onEdit(t)}else await this._store.onNew(t)}async startRun(t){if(!this._store.onReload)throw new Error("Runtime does not support reloading messages.");await this._store.onReload(t.parentId,t)}async resumeRun(t){if(!this._store.onResume)throw new Error("Runtime does not support resuming runs.");await this._store.onResume(t)}unstable_loadExternalState(t){if(!this._store.onLoadExternalState)throw new Error("Runtime does not support importing states.");this._store.onLoadExternalState(t)}cancelRun(){if(!this._store.onCancel)throw new Error("Runtime does not support cancelling runs.");this._store.onCancel(),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null);let t=this.repository.getMessages();const n=t[t.length-1];n?.role==="user"&&n.id===t.at(-1)?.id?(this.repository.deleteMessage(n.id),this.composer.text.trim()||this.composer.setText(j0(n)),t=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(t)},0)}addToolResult(t){if(!this._store.onAddToolResult&&!this._store.onAddToolResult)throw new Error("Runtime does not support tool results.");this._store.onAddToolResult?.(t)}resumeToolCall(t){if(!this._store.onResumeToolCall)throw new Error("Runtime does not support resuming tool calls.");this._store.onResumeToolCall(t)}reset(t){const n=new vF;n.import(_F.fromArray(t??[])),this.updateMessages(n.getMessages())}import(t){this._assistantOptimisticId=null,super.import(t),this._store.onImport&&this._store.onImport(this.repository.getMessages())}updateMessages=t=>{this._store.convertMessage!==void 0?this._store.setMessages?.(t.flatMap(Dbe).filter(o=>o!=null)):this._store.setMessages?.(t)}}const cV=e=>e.adapters?.threadList??{};class _ye extends RZ{threads;constructor(t){super(),this.threads=new pye(cV(t),()=>new Aye(this._contextProvider,t))}setAdapter(t){this.threads.__internal_setAdapter(cV(t)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(t)}}const vye=e=>{const[t]=x.useState(()=>new _ye(e));x.useEffect(()=>{t.setAdapter(e)});const{modelContext:n}=dye()??{};return x.useEffect(()=>{if(n)return t.registerModelContextProvider(n)},[n,t]),x.useMemo(()=>new lee(t),[t])},Sye=e=>{try{return JSON.parse(e),!0}catch{return!1}};function Cye({state:e,getTools:t,onResult:n,setToolStatuses:o}){const r=x.useRef({}),i=x.useRef(new Map),s=x.useRef(new AbortController),a=x.useRef(0),c=x.useRef([]),[p]=x.useState(()=>{const[f,h]=Pbe(),m=Wbe(t,()=>s.current?.signal??new AbortController().signal,(g,y)=>new Promise((_,S)=>{const w=i.current.get(g);w&&w.reject(new Error("Human input request was superseded by a new request")),i.current.set(g,{resolve:_,reject:S}),o(R=>({...R,[g]:{type:"interrupt",payload:{type:"human",payload:y}}}))}),{onExecutionStart:g=>{a.current++,o(y=>({...y,[g]:{type:"executing"}}))},onExecutionEnd:g=>{a.current--,o(y=>{const _={...y};return delete _[g],_}),a.current===0&&(c.current.forEach(y=>y()),c.current=[])}});return f.pipeThrough(m).pipeThrough(new NZ).pipeTo(new WritableStream({write(g){if(g.type==="result"){if(r.current[g.meta.toolCallId]?.hasResult)return;n({type:"add-tool-result",toolCallId:g.meta.toolCallId,toolName:g.meta.toolName,result:g.result,isError:g.isError,...g.artifact&&{artifact:g.artifact}})}}})),h}),u=x.useRef(new Set),l=x.useRef(!0);x.useEffect(()=>{const f=h=>{h.forEach(m=>{m.content.forEach(g=>{if(g.type==="tool-call"){if(l.current)u.current.add(g.toolCallId);else{if(u.current.has(g.toolCallId))return;let y=r.current[g.toolCallId];if(y||(y={argsText:"",hasResult:!1,argsComplete:!1,controller:p.addToolCallPart({toolName:g.toolName,toolCallId:g.toolCallId})},r.current[g.toolCallId]=y),g.argsText!==y.argsText&&!y.argsComplete){if(!g.argsText.startsWith(y.argsText))throw new Error(`Tool call argsText can only be appended, not updated: ${g.argsText} does not start with ${y.argsText}`);const _=g.argsText.slice(y.argsText.length);y.controller.argsText.append(_);const S=Sye(g.argsText);S&&y.controller.argsText.close(),r.current[g.toolCallId]={argsText:g.argsText,hasResult:y.hasResult,argsComplete:S,controller:y.controller}}g.result!==void 0&&!y.hasResult&&(y.controller.setResponse(new As({result:g.result,artifact:g.artifact,isError:g.isError})),y.controller.close(),r.current[g.toolCallId]={hasResult:!0,argsComplete:!0,argsText:y.argsText,controller:y.controller})}g.messages&&f(g.messages)}})})};f(e.messages),l.current&&(l.current=!1)},[e,p,n]);const d=()=>(i.current.forEach(({reject:f})=>{f(new Error("Tool execution aborted"))}),i.current.clear(),s.current.abort(),s.current=new AbortController,a.current===0?Promise.resolve():new Promise(f=>{c.current.push(f)}));return{reset:()=>{d(),l.current=!0},abort:d,resume:(f,h)=>{const m=i.current.get(f);if(m)i.current.delete(f),o(g=>({...g,[f]:{type:"executing"}})),m.resolve(h);else throw new Error(`Tool call ${f} is not waiting for human input`)}}}function wye(e,t){e.commitTasks.forEach(n=>{const o=n.cellIndex,r=t.cells[o];if(r.type!=="effect")throw new Error("Cannot find effect cell");let i=!0;if(r.deps!==void 0&&n.deps!==void 0&&(i=r.deps.length!==n.deps.length||r.deps.some((s,a)=>!Object.is(s,n.deps[a]))),i){if(r.mounted){if(typeof r.deps!=typeof n.deps)throw new Error("tapEffect called with and without dependencies across re-renders");try{r.mounted&&r.cleanup&&r.cleanup()}finally{r.mounted=!1}}const s=n.effect();if(s!==void 0&&typeof s!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof s}`);r.mounted=!0,r.cleanup=typeof s=="function"?s:void 0,r.deps=n.deps}})}function Oye(e){let t=null;for(let n=e.cells.length-1;n>=0;n--){const o=e.cells[n];if(o?.type==="effect"&&o.mounted&&o.cleanup)try{o.cleanup()}catch(r){t==null&&(t=r)}finally{o.mounted=!1}}if(t!=null)throw t}let a0=null;function Tye(e,t){e.currentIndex=0;const n=a0;a0=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw new Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{a0=n}}function CF(){if(!a0)throw new Error("No resource fiber available");return a0}function VZ(e,t){const n=e[HZ];if(!n)throw new Error("ResourceElement.type is not a valid Resource");return n(t)}const HZ=Symbol("fnSymbol");function EM(e,t){return{resource:e,scheduleRerender:t,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function D0(e){e.isMounted=!1,Oye(e)}function N0(e,t){const n={commitTasks:[],props:t,state:void 0};return Tye(e,()=>{e.renderContext=n;try{n.state=VZ(e.resource,t)}finally{e.renderContext=void 0}}),n}function L0(e,t){e.isMounted=!0,e.isNeverMounted=!1,wye(t,e)}const Rye=globalThis.__ASSISTANT_UI_DISABLE_LAYOUT_EFFECT__===!0,dV=Rye?x.useEffect:x.useLayoutEffect;function wF(e){const[,t]=x.useState({}),n=x.useMemo(()=>EM(e.type,()=>t({})),[e.type]),o=N0(n,e.props);return dV(()=>()=>D0(n),[n]),dV(()=>{L0(n,o)}),o.state}const MM=e=>typeof e=="string"?{scope:e.split(".")[0],event:e}:{scope:e.scope,event:e.event},l0=(e,t,n)=>t===e;let ay;const lD=()=>{if(ay)return ay;const e=()=>({apis:new Map,nextId:0,listeners:new Set});if(typeof window>"u")return ay=e(),ay;const t=window.__ASSISTANT_UI_DEVTOOLS_HOOK__;if(t)return ay=t,t;const n=e();return window.__ASSISTANT_UI_DEVTOOLS_HOOK__=n,ay=n,n};class Og{static MAX_EVENT_LOGS_PER_API=200;static register(t){const n=lD();for(const a of n.apis.values())if(a.api===t)return()=>{};const o=n.nextId++,r={api:t,logs:[]},i=t.on?.("*",a=>{const c=n.apis.get(o);c&&(c.logs.push({time:new Date,event:a.event,data:a.payload}),c.logs.length>Og.MAX_EVENT_LOGS_PER_API&&(c.logs=c.logs.slice(-200)),Og.notifyListeners(o))}),s=t.subscribe?.(()=>{Og.notifyListeners(o)});return n.apis.set(o,r),Og.notifyListeners(o),()=>{const a=lD();a.apis.get(o)&&(i?.(),s?.(),a.apis.delete(o),Og.notifyListeners(o))}}static notifyListeners(t){lD().listeners.forEach(o=>o(t))}}function In(e){const t=n=>({type:t,props:n});return t[HZ]=e,t}const Eye=e=>{if(e.renderContext)throw new Error("Resource updated during render");if(e.isMounted)e.scheduleRerender();else if(e.isNeverMounted)throw new Error("Resource updated before mount")};function Mye(e){const t=CF(),n=t.currentIndex++;if(!t.isFirstRender&&n>=t.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");if(!t.cells[n]){const i={type:"state",value:typeof e=="function"?e():e,set:s=>{const a=i.value,c=typeof s=="function"?s(a):s;Object.is(a,c)||(i.value=c,Eye(t))}};t.cells[n]=i}const o=t.cells[n];if(o.type!=="state")throw new Error("Hook order changed between renders");return o}function Nl(e){const t=Mye(e);return[t.value,t.set]}function Pye(){const e=CF(),t=e.currentIndex++;if(!e.isFirstRender&&t>=e.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");if(!e.cells[t]){const o={type:"effect",mounted:!1};e.cells[t]=o}if(e.cells[t].type!=="effect")throw new Error("Hook order changed between renders");return t}function So(e,t){const n=CF(),o=Pye();n.renderContext.commitTasks.push({effect:e,deps:t,cellIndex:o})}function fA(e){const[t]=Nl(()=>({current:e}));return t}const Iye=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n{const n=fA();return n.current||(n.current={value:e(),deps:t}),Iye(n.current.deps,t)||(n.current.value=e(),n.current.deps=t),n.current.value},jye=(e,t)=>Zt(()=>e,t);function u0(e,t){const[n,o]=Nl({}),r=Zt(()=>EM(e.type,()=>o({})),[e.type]),i=t?Zt(()=>e.props,t):e.props,s=Zt(()=>N0(r,i),[r,i,n]);return So(()=>()=>D0(r),[r]),So(()=>{L0(r,s)},[r,s]),s.state}function xl(e){return VZ(e.type,e.props)}function GZ(e,t,n){const[o,r]=Nl(0),i=jye(()=>r(p=>p+1),[]),[s]=Nl(()=>new Map),a=Zt(()=>t,n),c=Zt(()=>{const p={remove:[],add:[],commit:[],return:{}};for(const u in e){const l=e[u],d=a(l,u);let f=s.get(u);(!f||f.resource!==d.type)&&(f&&p.remove.push(u),f=EM(d.type,i),p.add.push([u,f]));const h=N0(f,d.props);p.commit.push([u,h]),p.return[u]=h.state}if(s.size>p.commit.length-p.add.length+p.remove.length)for(const u of s.keys())u in e||p.remove.push(u);return p},[e,a,o]);return So(()=>()=>{for(const p of s.keys())D0(s.get(p)),s.delete(p)},[]),So(()=>{for(const p of c.remove)D0(s.get(p)),s.delete(p);for(const[p,u]of c.add)s.set(p,u);for(const[p,u]of c.commit)L0(s.get(p),u)},[c]),c.return}const Dye=50;let wl={schedulers:new Set([]),isScheduled:!1};class Nye{_task;_isDirty=!1;constructor(t){this._task=t}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,wl.schedulers.add(this),Lye()}runTask(){this._isDirty=!1,this._task()}}const Lye=()=>{wl.isScheduled||(wl.isScheduled=!0,queueMicrotask(zZ))},zZ=()=>{try{const e=[];let t=0;for(const n of wl.schedulers)if(wl.schedulers.delete(n),!!n.isDirty){if(t++,t>Dye)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside tapEffect.");try{n.runTask()}catch(o){e.push(o)}}if(e.length>0)throw e.length===1?e[0]:new AggregateError(e,"Errors occurred during flushSync")}finally{wl.schedulers.clear(),wl.isScheduled=!1}},j2=e=>{const t=wl;wl={schedulers:new Set([]),isScheduled:!0};try{const n=e();return zZ(),n}finally{wl=t}},Fye=In(e=>{const[,t]=Nl(e.element),n=u0(e.element),o=fA(new Set).current,r=fA(n);return So(()=>{n!==r.current&&(r.current=n,o.forEach(s=>s()))}),Zt(()=>({getState:()=>r.current,subscribe:s=>(o.add(s),()=>o.delete(s)),render:s=>{const a=e.element!==s;e.element=s,e.onRender(a)&&t(s)},unmount:e.onUnmount}),[])}),xye=(e,{mount:t=!0}={})=>{let n=t,o;const r={element:e,onRender:a=>n?a:(n=!0,j2(()=>{a&&(o=N0(s,r)),!i.isDirty&&L0(s,o)}),!1),onUnmount:()=>{if(!n)throw new Error("Resource not mounted");n=!1,D0(s)}},i=new Nye(()=>{o=N0(s,r),!(i.isDirty||!n)&&L0(s,o)}),s=EM(Fye,()=>i.markDirty());return j2(()=>{i.markDirty()}),o.state},c0=Symbol("tap.Context"),KZ=e=>({[c0]:e}),QZ=(e,t,n)=>{const o=e[c0];e[c0]=t;try{return n()}finally{e[c0]=o}},$Z=e=>e[c0],fV=e=>{let t;const n=new Set,o=(p,u)=>{const l=typeof p=="function"?p(t):p;if(!Object.is(l,t)){const d=t;t=u??(typeof l!="object"||l===null)?l:Object.assign({},t,l),n.forEach(f=>f(t,d))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>c,subscribe:p=>(n.add(p),()=>n.delete(p))},c=t=e(o,r,a);return a},Bye=(e=>e?fV(e):fV),kye=e=>e;function Uye(e,t=kye){const n=Re.useSyncExternalStore(e.subscribe,Re.useCallback(()=>t(e.getState()),[e,t]),Re.useCallback(()=>t(e.getInitialState()),[e,t]));return Re.useDebugValue(n),n}const hV=e=>{const t=Bye(e),n=o=>Uye(t,o);return Object.assign(n,t),n},Bl=(e=>e?hV(e):hV);function pV(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Er(...e){return t=>{let n=!1;const o=e.map(r=>{const i=pV(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const t=Zt(()=>xye(e,{mount:!1}),[e.type]);return So(()=>{t.render(e)}),t});class qye{ref;constructor(t){this.ref=t}get(t,n){return this.ref.current[n]}ownKeys(){return Object.keys(this.ref.current)}has(t,n){return n in this.ref.current}getOwnPropertyDescriptor(t,n){return Object.getOwnPropertyDescriptor(this.ref.current,n)}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}}const Es=(e,t)=>{const n=fA(e);So(()=>{n.current=e});const o=Zt(()=>new Proxy({},new qye(n)),[]),r=t?.key,i=e.getState();return Zt(()=>({key:r,state:i,api:o}),[i,r])},KR=In(e=>{const t=fA(e.get);return So(()=>{t.current=e.get}),Zt(()=>Xr({source:e.source,query:e.query,get:()=>t.current()}),[e.source,JSON.stringify(e.query)])}),Jye=In(e=>{const t=u0(e.scopeElement);return Zt(()=>[e.fieldName,t],[e.fieldName,t])}),Vye=In(e=>{const{on:t,subscribe:n,...o}=e,r=fA({on:t,subscribe:n});So(()=>{r.current={on:t,subscribe:n}});const i=GZ(o,(s,a)=>Jye({fieldName:a,scopeElement:s}),[]);return Zt(()=>{const s=Object.fromEntries(Object.values(i)),{on:a,subscribe:c}=r.current;return a&&(s.on=(p,u)=>a(p,u)),c&&(s.subscribe=p=>c(p)),s},[i])}),YZ=KZ(null),Hye=(e,t)=>QZ(YZ,e,t),XZ=()=>{const e=$Z(YZ);if(!e)throw new Error("Model context is not available in this context");return e},Gye=In(({toolkit:e})=>{const[t,n]=Nl(()=>({tools:{}})),o=XZ();So(()=>{if(!e)return;const i=[];for(const[c,p]of Object.entries(e))p.render&&i.push(r(c,p.render));const s=Object.entries(e).reduce((c,[p,u])=>{const{render:l,...d}=u;return c[p]=d,c},{}),a={getModelContext:()=>({tools:s})};return i.push(o.register(a)),()=>{i.forEach(c=>c())}},[e,o]);const r=(i,s)=>(n(a=>({...a,tools:{...a.tools,[i]:[...a.tools[i]??[],s]}})),()=>{n(a=>({...a,tools:{...a.tools,[i]:a.tools[i]?.filter(c=>c!==s)??[]}}))});return Es({getState:()=>t,setToolUI:r})}),zye=In(()=>Zt(()=>{const t=new Map;return{on:(n,o)=>{t.has(n)||t.set(n,new Set);const r=t.get(n);return r.add(o),()=>{r.delete(o),r.size===0&&t.delete(n)}},emit:(n,o)=>{const r=t.get(n),i=t.get("*");!r&&!i||queueMicrotask(()=>{if(r)for(const s of r)s(o);if(i)for(const s of i)s({event:n,payload:o})})}}},[])),ZZ=KZ(null),Kye=(e,t)=>QZ(ZZ,e,t),OF=()=>{const e=$Z(ZZ);if(!e)throw new Error("Events context is not available");return e},Qye=In(()=>{const[e]=Nl(()=>({})),t=new gF;return Es({getState:()=>e,getModelContext:()=>t.getModelContext(),subscribe:n=>t.subscribe(n),register:n=>t.registerModelContextProvider(n)})}),$ye=In(({threads:e,modelContext:t,tools:n})=>{const o=xl(zye()),{threads:r,tools:i,modelContext:s}=Kye(o,()=>{const c=u0(t??Qye(),[t]);return Hye(c.api,()=>({modelContext:c,tools:u0(n??Gye({}),[n]),threads:u0(e,[e])}))}),a=Zt(()=>({threads:r.state,tools:i.state,modelContext:s.state}),[r.state,i.state,s.state]);return Es({getState:()=>a,threads:r.api,tools:i.api,modelContext:s.api,on:o.on})}),Wye=e=>{const t=()=>e.getState().api.threads.item("main");return{threads:Xr({source:"root",query:{},get:()=>e.getState().api.threads}),tools:Xr({source:"root",query:{},get:()=>e.getState().api.tools}),modelContext:Xr({source:"root",query:{},get:()=>e.getState().api.modelContext}),thread:Xr({source:"threads",query:{type:"main"},get:()=>e.getState().api.threads.thread("main")}),threadListItem:Xr({source:"threads",query:{type:"main"},get:()=>t()}),composer:Xr({source:"thread",query:{},get:()=>e.getState().api.threads.thread("main").composer}),on(n,o){const{event:r,scope:i}=MM(n);if(i==="*")return e.getState().api.on(r,o);if(l0("thread",i)||l0("thread-list-item",i)||l0("composer",i))return e.getState().api.on(r,s=>{s.threadId===t().getState().id&&o(s)});throw new Error(`Event scope is not available in this component: ${i}`)},subscribe:e.subscribe}},Yye=e=>{const t=TF(),n=wF(WZ($ye(e))),o=x.useMemo(()=>Wye(n),[n]);return x.useMemo(()=>tee(t,o),[t,o])},Xr=e=>{const t=e.get;return t.source=e.source,t.query=e.query,t},QR=()=>()=>{},eee=x.createContext({threads:Xr({source:null,query:{},get:()=>{throw new Error("Threads is only available inside ")}}),tools:Xr({source:null,query:{},get:()=>{throw new Error("Tools is only available inside ")}}),modelContext:Xr({source:null,query:{},get:()=>{throw new Error("ModelContext is only available inside ")}}),threadListItem:Xr({source:null,query:{},get:()=>{throw new Error("ThreadListItem is only available inside ")}}),thread:Xr({source:null,query:{},get:()=>{throw new Error("Thread is only available inside ")}}),composer:Xr({source:null,query:{},get:()=>{throw new Error("Composer is only available inside ")}}),message:Xr({source:null,query:{},get:()=>{throw new Error("Message is only available inside ")}}),part:Xr({source:null,query:{},get:()=>{throw new Error("Part is only available inside ")}}),attachment:Xr({source:null,query:{},get:()=>{throw new Error("Attachment is only available inside or ")}}),subscribe:QR,on:e=>{const{scope:t}=MM(e);throw new Error(`Event scope is not available in this component: ${t}`)}}),TF=()=>x.useContext(eee),RF=e=>{const t=TF(),n=wF(Vye(e));return x.useMemo(()=>tee(t,n),[t,n])},Xye=e=>Yye(e);function pi(e){return e?Xye(e):TF()}const Zye=(e,t)=>e===QR?t:t===QR?e:(...n)=>{const o=e(...n),r=t(...n);return()=>{o(),r()}},tee=(e,t)=>{const n=t.subscribe;return{...e,...t,subscribe:Zye(e.subscribe,n??QR)}},PM=({api:e,children:t,devToolsVisible:n=!0})=>(x.useEffect(()=>{if(!(!n||!e.subscribe))return Og.register(e)},[e,n]),F.jsx(eee.Provider,{value:e,children:t}));class mV{#e;constructor(t){this.#e=t}get threads(){return this.#e.threads().getState()}get tools(){return this.#e.tools().getState()}get threadListItem(){return this.#e.threadListItem().getState()}get thread(){return this.#e.thread().getState()}get composer(){return this.#e.composer().getState()}get message(){return this.#e.message().getState()}get part(){return this.#e.part().getState()}get attachment(){return this.#e.attachment().getState()}}const en=e=>{const t=pi(),n=x.useMemo(()=>new mV(t),[t]),o=x.useSyncExternalStore(t.subscribe,()=>e(n),()=>e(n));if(x.useDebugValue(o),o instanceof mV)throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return o},uD=(e,t)=>{const n=pi(),o=x.useRef(t);x.useEffect(()=>{o.current=t});const{scope:r,event:i}=MM(e);x.useEffect(()=>n.on({scope:r,event:i},s=>o.current(s)),[n,r,i])};function eAe(e,t){function n(o){const r=x.useContext(e);if(!o?.optional&&!r)throw new Error(`This component must be used within ${t}.`);return r}return n}function nee(e,t){function n(r){const i=e(r);return i?i[t]:null}function o(r){let i=!1,s;typeof r=="function"?s=r:r&&typeof r=="object"&&(i=!!r.optional,s=r.selector);const a=n({optional:i});return a?s?a(s):a():null}return{[t]:o,[`${t}Store`]:n}}const ree=x.createContext(null),tAe=eAe(ree,"ThreadPrimitive.Viewport"),{useThreadViewport:$R,useThreadViewportStore:EF}=nee(tAe,"useThreadViewport"),nAe=e=>{const t=e;t.__isBound||(t.__internal_bindMethods?.(),t.__isBound=!0)};function rAe(e,t=oAe){nAe(e);const n=x.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getState()));return x.useDebugValue(n),n}const oAe=e=>e;function iAe(e){function t(n){let o=!1,r;typeof n=="function"?r=n:n&&(o=!!n.optional,r=n.selector);const i=e({optional:o});return i?rAe(i,r):null}return t}function sAe(e){const t=pi(),n=en(()=>t.message.source?t.message().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw new Error("MessageRuntime is not available");return n}const oee=iAe(sAe),Yg=e=>{const[,t]=Nl(e.getState);return So(()=>(t(e.getState()),e.subscribe(()=>{t(e.getState())})),[e]),e.getState()},aAe=In(({runtime:e})=>{const t=Yg(e),n=OF();return So(()=>{const o=[],r=["switched-to","switched-away"];for(const i of r){const s=e.unstable_on(i,()=>{n.emit(`thread-list-item.${i}`,{threadId:e.getState().id})});o.push(s)}return()=>{for(const i of o)i()}},[e,n]),Es({getState:()=>t,switchTo:e.switchTo,rename:e.rename,archive:e.archive,unarchive:e.unarchive,delete:e.delete,generateTitle:e.generateTitle,initialize:e.initialize,detach:e.detach,__internal_getRuntime:()=>e},{key:t.id})}),F0=e=>{const t=Zt(()=>Object.fromEntries(e),[e]),n=GZ(t,i=>i,[]),o=Zt(()=>Object.keys(n),[n]);return{state:Zt(()=>{const i=new Array(o.length);for(let s=0;s{const s="index"in i?n[o[i.index]]?.api:n[i.key]?.api;if(!s)throw new Error(`tapLookupResources: Resource not found for lookup: ${JSON.stringify(i)}`);return s}}},iee=In(({runtime:e})=>{const t=Yg(e);return Es({getState:()=>t,remove:e.remove,__internal_getRuntime:()=>e},{key:t.id})}),lAe=In(({runtime:e,index:t})=>{const n=Zt(()=>e.getAttachmentByIndex(t),[e,t]);return xl(iee({runtime:n}))}),see=In(({threadIdRef:e,messageIdRef:t,runtime:n})=>{const o=Yg(n),r=OF();So(()=>{const a=[],c=["send","attachment-add"];for(const p of c){const u=n.unstable_on(p,()=>{r.emit(`composer.${p}`,{threadId:e.current,...t&&{messageId:t.current}})});a.push(u)}return()=>{for(const p of a)p()}},[n,r,e,t]);const i=F0(o.attachments.map((a,c)=>[a.id,lAe({runtime:n,index:c})])),s=Zt(()=>({text:o.text,role:o.role,attachments:i.state,runConfig:o.runConfig,isEditing:o.isEditing,canCancel:o.canCancel,attachmentAccept:o.attachmentAccept,isEmpty:o.isEmpty,type:o.type??"thread"}),[o,i.state]);return Es({getState:()=>s,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw new Error("beginEdit is not supported in this runtime")}),attachment:a=>"id"in a?i.api({key:a.id}):i.api(a),__internal_getRuntime:()=>n})}),uAe=In(({runtime:e})=>{const t=Yg(e);return Es({getState:()=>t,addToolResult:o=>e.addToolResult(o),resumeToolCall:o=>e.resumeToolCall(o),__internal_getRuntime:()=>e},{key:t.type==="tool-call"?`toolCallId-${t.toolCallId}`:void 0})}),cAe=In(({runtime:e,index:t})=>{const n=Zt(()=>e.getAttachmentByIndex(t),[e,t]);return xl(iee({runtime:n}))}),dAe=In(({runtime:e,index:t})=>{const n=Zt(()=>e.getMessagePartByIndex(t),[e,t]);return xl(uAe({runtime:n}))}),fAe=In(({runtime:e,threadIdRef:t})=>{const n=Yg(e),[o,r]=Nl(!1),[i,s]=Nl(!1),a=Zt(()=>({get current(){return e.getState().id}}),[e]),c=xl(see({runtime:e.composer,threadIdRef:t,messageIdRef:a})),p=F0(n.content.map((d,f)=>["toolCallId"in d&&d.toolCallId!=null?`toolCallId-${d.toolCallId}`:`index-${f}`,dAe({runtime:e,index:f})])),u=F0(n.attachments?.map((d,f)=>[d.id,cAe({runtime:e,index:f})])??[]),l=Zt(()=>({...n,parts:p.state,composer:c.state,isCopied:o,isHovering:i}),[n,p.state,c.state,o,i]);return Es({getState:()=>l,composer:c.api,reload:d=>e.reload(d),speak:()=>e.speak(),stopSpeaking:()=>e.stopSpeaking(),submitFeedback:d=>e.submitFeedback(d),switchToBranch:d=>e.switchToBranch(d),getCopyText:()=>e.unstable_getCopyText(),part:d=>"index"in d?p.api({index:d.index}):p.api({key:`toolCallId-${d.toolCallId}`}),attachment:d=>"id"in d?u.api({key:d.id}):u.api(d),setIsCopied:r,setIsHovering:s,__internal_getRuntime:()=>e},{key:n.id})}),hAe=In(({runtime:e,id:t,threadIdRef:n})=>{const o=Zt(()=>e.getMessageById(t),[e,t]);return xl(fAe({runtime:o,threadIdRef:n}))}),pAe=In(({runtime:e})=>{const t=Yg(e),n=OF();So(()=>{const a=[],c=["run-start","run-end","initialize","model-context-update"];for(const p of c){const u=e.unstable_on(p,()=>{const l=e.getState()?.threadId||"unknown";n.emit(`thread.${p}`,{threadId:l})});a.push(u)}return()=>{for(const p of a)p()}},[e]);const o=Zt(()=>({get current(){return e.getState().threadId}}),[e]),r=xl(see({runtime:e.composer,threadIdRef:o})),i=F0(t.messages.map(a=>[a.id,hAe({runtime:e,id:a.id,threadIdRef:o})])),s=Zt(()=>({isEmpty:i.state.length===0&&!t.isLoading,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning,capabilities:t.capabilities,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,composer:r.state,messages:i.state}),[t,i,r.state]);return Es({getState:()=>s,composer:r.api,append:e.append,startRun:e.startRun,unstable_resumeRun:e.unstable_resumeRun,cancelRun:e.cancelRun,getModelContext:e.getModelContext,export:e.export,import:e.import,reset:e.reset,stopSpeaking:e.stopSpeaking,startVoice:async()=>{throw new Error("startVoice is not supported in this runtime")},stopVoice:async()=>{throw new Error("stopVoice is not supported in this runtime")},message:a=>"id"in a?i.api({key:a.id}):i.api(a),__internal_getRuntime:()=>e})}),mAe=In(({runtime:e,id:t})=>{const n=Zt(()=>e.getItemById(t),[e,t]);return xl(aAe({runtime:n}))}),gAe=In(({runtime:e,__internal_assistantRuntime:t})=>{const n=Yg(e),o=xl(pAe({runtime:e.main})),r=F0(Object.keys(n.threadItems).map(s=>[s,mAe({runtime:e,id:s})])),i=Zt(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThread??null,isLoading:n.isLoading,threadIds:n.threads,archivedThreadIds:n.archivedThreads,threadItems:r.state,main:o.state}),[n,r.state,o.state]);return Es({getState:()=>i,thread:()=>o.api,item:s=>{if(s==="main")return r.api({key:i.mainThreadId});if("id"in s)return r.api({key:s.id});const{index:a,archived:c=!1}=s,p=c?i.archivedThreadIds[a]:i.threadIds[a];return r.api({key:p})},switchToThread:s=>{e.switchToThread(s)},switchToNewThread:()=>{e.switchToNewThread()},__internal_getAssistantRuntime:()=>t})}),bAe=In(e=>{const t=XZ();return So(()=>e.registerModelContextProvider(t),[e,t]),xl(gAe({runtime:e.threads,__internal_assistantRuntime:e}))}),cD=e=>{const t=new Map,n=()=>{let o=0;for(const r of t.values())o+=r;e(o)};return{register:()=>{const o=Symbol();return t.set(o,0),{setHeight:r=>{t.get(o)!==r&&(t.set(o,r),n())},unregister:()=>{t.delete(o),n()}}}}},yAe=(e={})=>{const t=new Set,n=cD(s=>{i.setState({height:{...i.getState().height,viewport:s}})}),o=cD(s=>{i.setState({height:{...i.getState().height,inset:s}})}),r=cD(s=>{i.setState({height:{...i.getState().height,userMessage:s}})}),i=Bl(()=>({isAtBottom:!0,scrollToBottom:({behavior:s="auto"}={})=>{for(const a of t)a({behavior:s})},onScrollToBottom:s=>(t.add(s),()=>{t.delete(s)}),turnAnchor:e.turnAnchor??"bottom",height:{viewport:0,inset:0,userMessage:0},registerViewport:n.register,registerContentInset:o.register,registerUserMessageHeight:r.register}));return i},x0=e=>e,AAe=e=>{const t=EF({optional:!0}),[n]=x.useState(()=>yAe(e));return x.useEffect(()=>t?.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[t,n]),x.useEffect(()=>{if(t)return n.subscribe(o=>{t.getState().isAtBottom!==o.isAtBottom&&x0(t).setState({isAtBottom:o.isAtBottom})})},[n,t]),x.useEffect(()=>{const o={turnAnchor:e.turnAnchor??"bottom"};n.getState().turnAnchor!==o.turnAnchor&&x0(n).setState(o)},[n,e.turnAnchor]),n},aee=({children:e,options:t={}})=>{const n=AAe(t),[o]=x.useState(()=>({useThreadViewport:n}));return F.jsx(ree.Provider,{value:o,children:e})},_Ae=e=>e._core?.RenderComponent,vAe=({children:e,runtime:t})=>{const n=pi({threads:bAe(t)}),o=_Ae(t);return F.jsxs(PM,{api:n,children:[o&&F.jsx(o,{}),F.jsx(aee,{children:e})]})},SAe=x.memo(vAe),CAe=({index:e,children:t})=>{const n=pi(),o=RF({message:KR({source:"thread",query:{type:"index",index:e},get:()=>n.thread().message({index:e})}),composer:KR({source:"message",query:{},get:()=>n.thread().message({index:e}).composer}),on(r,i){const s=()=>n.thread().message({index:e}),{event:a,scope:c}=MM(r);return!l0("composer",c)&&!l0("message",c)?n.on(r,i):n.on({scope:"thread",event:a},p=>{p.messageId===s().getState().id&&i(p)})}});return F.jsx(PM,{api:o,children:t})},wAe=({index:e,children:t})=>{const n=pi(),o=RF({part:KR({source:"message",query:{type:"index",index:e},get:()=>n.message().part({index:e})})});return F.jsx(PM,{api:o,children:t})},OAe=In(({text:e,isRunning:t})=>{const n=Zt(()=>({type:"text",text:e,status:t?{type:"running"}:{type:"complete"}}),[e,t]);return Es({getState:()=>n,addToolResult:()=>{throw new Error("Not supported")},resumeToolCall:()=>{throw new Error("Not supported")}})}),TAe=({text:e,isRunning:t=!1,children:n})=>{const o=wF(WZ(OAe({text:e,isRunning:t}))),r=RF({part:KR({source:"root",query:{},get:()=>o.getState().api}),subscribe:o.subscribe});return F.jsx(PM,{api:r,children:n})};class lee{_core;threads;get threadList(){return this.threads}_thread;constructor(t){this._core=t,this.threads=new oye(t.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.switchToNewThread=this.switchToNewThread.bind(this),this.switchToThread=this.switchToThread.bind(this),this.registerModelContextProvider=this.registerModelContextProvider.bind(this),this.registerModelConfigProvider=this.registerModelConfigProvider.bind(this),this.reset=this.reset.bind(this)}get thread(){return this._thread}switchToNewThread(){return this._core.threads.switchToNewThread()}switchToThread(t){return this._core.threads.switchToThread(t)}registerModelContextProvider(t){return this._core.registerModelContextProvider(t)}registerModelConfigProvider(t){return this.registerModelContextProvider(t)}reset({initialMessages:t}={}){return this._core.threads.getMainThreadRuntimeCore().import(_F.fromArray(t??[]))}}const RAe=e=>{const{cloud:t,initialMessages:n,maxSteps:o,adapters:r,unstable_humanToolNames:i,...s}=e;return{localRuntimeOptions:{cloud:t,initialMessages:n,maxSteps:o,adapters:r,unstable_humanToolNames:i},otherOptions:s}};function Co(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}const uee=x.createContext(null),EAe=e=>({useSmoothStatus:Bl(()=>e)}),MAe=({children:e})=>{const t=cee({optional:!0}),n=pi(),[o]=x.useState(()=>EAe(n.part().getState().status));return t?e:F.jsx(uee.Provider,{value:o,children:e})},PAe=e=>{const t=x.forwardRef((n,o)=>F.jsx(MAe,{children:F.jsx(e,{...n,ref:o})}));return t.displayName=e.displayName,t};function cee(e){const t=x.useContext(uee);if(!e?.optional&&!t)throw new Error("This component must be used within a SmoothContextProvider.");return t}const{useSmoothStatus:IAe,useSmoothStatusStore:jAe}=nee(cee,"useSmoothStatus");class DAe{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();targetText="";constructor(t,n){this.currentText=t,this.setText=n}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{const t=Date.now();let o=t-this.lastUpdateTime;const r=this.targetText.length-this.currentText.length,i=Math.min(5,250/r);let s=0;for(;o>=i&&s{const{text:n}=e,o=en(({message:u})=>u.id),r=x.useRef(o),[i,s]=x.useState(n),a=jAe({optional:!0}),c=Co(u=>{if(s(u),a){const l=i!==u||e.status.type==="running"?dD:e.status;x0(a).setState(l,!0)}});x.useEffect(()=>{if(a){const u=t&&(i!==n||e.status.type==="running")?dD:e.status;x0(a).setState(u,!0)}},[a,t,n,i,e.status]);const[p]=x.useState(new DAe(n,c));return x.useEffect(()=>{if(!t){p.stop();return}if(r.current!==o||!n.startsWith(p.targetText)){r.current=o,c(n),p.currentText=n,p.targetText=n,p.stop();return}p.targetText=n,p.start()},[c,p,o,t,n]),x.useEffect(()=>()=>{p.stop()},[p]),x.useMemo(()=>t?{type:"text",text:i,status:n===i?e.status:dD}:e,[t,i,e,n])},NAe=Object.freeze(Object.defineProperty({__proto__:null,AssistantRuntimeImpl:lee,BaseAssistantRuntimeCore:RZ,CompositeContextProvider:gF,DefaultThreadComposerRuntimeCore:MZ,MessageRepository:vF,ThreadRuntimeImpl:qZ,fromThreadMessageLike:TM,generateId:OM,getAutoStatus:bF,splitLocalRuntimeOptions:RAe,useSmooth:dee,useSmoothStatus:IAe,useToolInvocations:Cye,withSmoothContextProvider:PAe},Symbol.toStringTag,{value:"Module"}));var IM=TZ();const LAe=Wg(IM);var FAe=Symbol.for("react.lazy"),WR=mF[" use ".trim().toString()];function xAe(e){return typeof e=="object"&&e!==null&&"then"in e}function fee(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===FAe&&"_payload"in e&&xAe(e._payload)}function hee(e){const t=BAe(e),n=x.forwardRef((o,r)=>{let{children:i,...s}=o;fee(i)&&typeof WR=="function"&&(i=WR(i._payload));const a=x.Children.toArray(i),c=a.find(UAe);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var MF=hee("Slot");function BAe(e){const t=x.forwardRef((n,o)=>{let{children:r,...i}=n;if(fee(r)&&typeof WR=="function"&&(r=WR(r._payload)),x.isValidElement(r)){const s=JAe(r),a=qAe(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kAe=Symbol("radix.slottable");function UAe(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kAe}function qAe(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function JAe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var VAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kl=VAe.reduce((e,t)=>{const n=hee(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),np;(function(e){e.Hidden="hidden",e.Floating="floating",e.Normal="normal"})(np||(np={}));const HAe=({hideWhenRunning:e,autohide:t,autohideFloat:n})=>en(({thread:o,message:r})=>e&&o.isRunning?np.Hidden:t==="always"||t==="not-last"&&!r.isLast?r.isHovering?n==="always"||n==="single-branch"&&r.branchCount<=1?np.Floating:np.Normal:np.Hidden:np.Normal),pee=x.forwardRef(({hideWhenRunning:e,autohide:t,autohideFloat:n,...o},r)=>{const i=HAe({hideWhenRunning:e,autohide:t,autohideFloat:n});return i===np.Hidden?null:F.jsx(kl.div,{...i===np.Floating?{"data-floating":"true"}:null,...o,ref:r})});pee.displayName="ActionBarPrimitive.Root";function lt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}const GAe=({copiedDuration:e=3e3}={})=>{const t=pi(),n=en(({message:s})=>(s.role!=="assistant"||s.status?.type!=="running")&&s.parts.some(a=>a.type==="text"&&a.text.length>0)),o=en(({composer:s})=>s.isEditing),r=en(({composer:s})=>s.text),i=x.useCallback(()=>{const s=o?r:t.message().getCopyText();s&&navigator.clipboard.writeText(s).then(()=>{t.message().setIsCopied(!0),setTimeout(()=>t.message().setIsCopied(!1),e)})},[t,o,r,e]);return n?i:null},mee=x.forwardRef(({copiedDuration:e,onClick:t,disabled:n,...o},r)=>{const i=en(({message:a})=>a.isCopied),s=GAe({copiedDuration:e});return F.jsx(kl.button,{type:"button",...i?{"data-copied":"true"}:{},...o,ref:r,disabled:n||!s,onClick:lt(t,()=>{s?.()})})});mee.displayName="ActionBarPrimitive.Copy";const gee=(e,t,n=[])=>{const o=x.forwardRef((r,i)=>{const s={},a={};Object.keys(r).forEach(p=>{n.includes(p)?s[p]=r[p]:a[p]=r[p]});const c=t(s)??void 0;return F.jsx(kl.button,{type:"button",...a,ref:i,disabled:a.disabled||!c,onClick:lt(a.onClick,c)})});return o.displayName=e,o};function bee(e,t=globalThis?.document){const n=Co(e);x.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}function zAe(e){const t=KAe(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find($Ae);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function KAe(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=YAe(r),a=WAe(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QAe=Symbol("radix.slottable");function $Ae(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QAe}function WAe(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function YAe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yee=XAe.reduce((e,t)=>{const n=zAe(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function ZAe(e,t){e&&IM.flushSync(()=>e.dispatchEvent(t))}var e_e="DismissableLayer",D2="dismissableLayer.update",t_e="dismissableLayer.pointerDownOutside",n_e="dismissableLayer.focusOutside",gV,Aee=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jM=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...c}=e,p=x.useContext(Aee),[u,l]=x.useState(null),d=u?.ownerDocument??globalThis?.document,[,f]=x.useState({}),h=Cn(t,T=>l(T)),m=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),_=u?m.indexOf(u):-1,S=p.layersWithOutsidePointerEventsDisabled.size>0,w=_>=y,R=i_e(T=>{const D=T.target,B=[...p.branches].some(N=>N.contains(D));!w||B||(r?.(T),s?.(T),T.defaultPrevented||a?.())},d),E=s_e(T=>{const D=T.target;[...p.branches].some(N=>N.contains(D))||(i?.(T),s?.(T),T.defaultPrevented||a?.())},d);return bee(T=>{_===p.layers.size-1&&(o?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},d),x.useEffect(()=>{if(u)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(gV=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(u)),p.layers.add(u),bV(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=gV)}},[u,d,n,p]),x.useEffect(()=>()=>{u&&(p.layers.delete(u),p.layersWithOutsidePointerEventsDisabled.delete(u),bV())},[u,p]),x.useEffect(()=>{const T=()=>f({});return document.addEventListener(D2,T),()=>document.removeEventListener(D2,T)},[]),F.jsx(yee.div,{...c,ref:h,style:{pointerEvents:S?w?"auto":"none":void 0,...e.style},onFocusCapture:lt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:lt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:lt(e.onPointerDownCapture,R.onPointerDownCapture)})});jM.displayName=e_e;var r_e="DismissableLayerBranch",o_e=x.forwardRef((e,t)=>{const n=x.useContext(Aee),o=x.useRef(null),r=Cn(t,o);return x.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),F.jsx(yee.div,{...e,ref:r})});o_e.displayName=r_e;function i_e(e,t=globalThis?.document){const n=Co(e),o=x.useRef(!1),r=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let c=function(){_ee(t_e,n,p,{discrete:!0})};const p={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function s_e(e,t=globalThis?.document){const n=Co(e),o=x.useRef(!1);return x.useEffect(()=>{const r=i=>{i.target&&!o.current&&_ee(n_e,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function bV(){const e=new CustomEvent(D2);document.dispatchEvent(e)}function _ee(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?ZAe(r,i):r.dispatchEvent(i)}var fD=0;function vee(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yV()),document.body.insertAdjacentElement("beforeend",e[1]??yV()),fD++,()=>{fD===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fD--}},[])}function yV(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function a_e(e){const t=l_e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(c_e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function l_e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=f_e(r),a=d_e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u_e=Symbol("radix.slottable");function c_e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u_e}function d_e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function f_e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var h_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],p_e=h_e.reduce((e,t)=>{const n=a_e(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),hD="focusScope.autoFocusOnMount",pD="focusScope.autoFocusOnUnmount",AV={bubbles:!1,cancelable:!0},m_e="FocusScope",PF=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[a,c]=x.useState(null),p=Co(r),u=Co(i),l=x.useRef(null),d=Cn(t,m=>c(m)),f=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let m=function(S){if(f.paused||!a)return;const w=S.target;a.contains(w)?l.current=w:rm(l.current,{select:!0})},g=function(S){if(f.paused||!a)return;const w=S.relatedTarget;w!==null&&(a.contains(w)||rm(l.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const R of S)R.removedNodes.length>0&&rm(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const _=new MutationObserver(y);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),_.disconnect()}}},[o,a,f.paused]),x.useEffect(()=>{if(a){vV.add(f);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(hD,AV);a.addEventListener(hD,p),a.dispatchEvent(y),y.defaultPrevented||(g_e(v_e(See(a)),{select:!0}),document.activeElement===m&&rm(a))}return()=>{a.removeEventListener(hD,p),setTimeout(()=>{const y=new CustomEvent(pD,AV);a.addEventListener(pD,u),a.dispatchEvent(y),y.defaultPrevented||rm(m??document.body,{select:!0}),a.removeEventListener(pD,u),vV.remove(f)},0)}}},[a,p,u,f]);const h=x.useCallback(m=>{if(!n&&!o||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const _=m.currentTarget,[S,w]=b_e(_);S&&w?!m.shiftKey&&y===w?(m.preventDefault(),n&&rm(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&rm(w,{select:!0})):y===_&&m.preventDefault()}},[n,o,f.paused]);return F.jsx(p_e.div,{tabIndex:-1,...s,ref:d,onKeyDown:h})});PF.displayName=m_e;function g_e(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(rm(o,{select:t}),document.activeElement!==n)return}function b_e(e){const t=See(e),n=_V(t,e),o=_V(t.reverse(),e);return[n,o]}function See(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _V(e,t){for(const n of e)if(!y_e(n,{upTo:t}))return n}function y_e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function A_e(e){return e instanceof HTMLInputElement&&"select"in e}function rm(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A_e(e)&&t&&e.select()}}var vV=__e();function __e(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=SV(e,t),e.unshift(t)},remove(t){e=SV(e,t),e[0]?.resume()}}}function SV(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function v_e(e){return e.filter(t=>t.tagName!=="A")}var bm=globalThis?.document?x.useLayoutEffect:()=>{},S_e=mF[" useId ".trim().toString()]||(()=>{}),C_e=0;function hm(e){const[t,n]=x.useState(S_e());return bm(()=>{n(o=>o??String(C_e++))},[e]),t?`radix-${t}`:""}const w_e=["top","right","bottom","left"],ym=Math.min,ci=Math.max,YR=Math.round,wO=Math.floor,Pl=e=>({x:e,y:e}),O_e={left:"right",right:"left",bottom:"top",top:"bottom"},T_e={start:"end",end:"start"};function N2(e,t,n){return ci(e,ym(t,n))}function sp(e,t){return typeof e=="function"?e(t):e}function ap(e){return e.split("-")[0]}function PA(e){return e.split("-")[1]}function IF(e){return e==="x"?"y":"x"}function jF(e){return e==="y"?"height":"width"}const R_e=new Set(["top","bottom"]);function Ol(e){return R_e.has(ap(e))?"y":"x"}function DF(e){return IF(Ol(e))}function E_e(e,t,n){n===void 0&&(n=!1);const o=PA(e),r=DF(e),i=jF(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=XR(s)),[s,XR(s)]}function M_e(e){const t=XR(e);return[L2(e),t,L2(t)]}function L2(e){return e.replace(/start|end/g,t=>T_e[t])}const CV=["left","right"],wV=["right","left"],P_e=["top","bottom"],I_e=["bottom","top"];function j_e(e,t,n){switch(e){case"top":case"bottom":return n?t?wV:CV:t?CV:wV;case"left":case"right":return t?P_e:I_e;default:return[]}}function D_e(e,t,n,o){const r=PA(e);let i=j_e(ap(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(L2)))),i}function XR(e){return e.replace(/left|right|bottom|top/g,t=>O_e[t])}function N_e(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cee(e){return typeof e!="number"?N_e(e):{top:e,right:e,bottom:e,left:e}}function ZR(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function OV(e,t,n){let{reference:o,floating:r}=e;const i=Ol(t),s=DF(t),a=jF(s),c=ap(t),p=i==="y",u=o.x+o.width/2-r.width/2,l=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:l};break;case"left":f={x:o.x-r.width,y:l};break;default:f={x:o.x,y:o.y}}switch(PA(t)){case"start":f[s]-=d*(n&&p?-1:1);break;case"end":f[s]+=d*(n&&p?-1:1);break}return f}const L_e=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let p=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:l}=OV(p,o,c),d=o,f={},h=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:p,padding:u=0}=sp(e,t)||{};if(p==null)return{};const l=Cee(u),d={x:n,y:o},f=DF(r),h=jF(f),m=await s.getDimensions(p),g=f==="y",y=g?"top":"left",_=g?"bottom":"right",S=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-d[f]-i.floating[h],R=d[f]-i.reference[f],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(p));let T=E?E[S]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[S]||i.floating[h]);const D=w/2-R/2,B=T/2-m[h]/2-1,N=ym(l[y],B),L=ym(l[_],B),q=N,I=T-m[h]-L,U=T/2-m[h]/2+D,J=N2(q,U,I),V=!c.arrow&&PA(r)!=null&&U!==J&&i.reference[h]/2-(UU<=0)){var L,q;const U=(((L=i.flip)==null?void 0:L.index)||0)+1,J=T[U];if(J&&(!(l==="alignment"?_!==Ol(J):!1)||N.every(Q=>Ol(Q.placement)===_?Q.overflows[0]>0:!0)))return{data:{index:U,overflows:N},reset:{placement:J}};let V=(q=N.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(f){case"bestFit":{var I;const G=(I=N.filter(Q=>{if(E){const le=Ol(Q.placement);return le===_||le==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(le=>le>0).reduce((le,K)=>le+K,0)]).sort((Q,le)=>Q[1]-le[1])[0])==null?void 0:I[0];G&&(V=G);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function TV(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function RV(e){return w_e.some(t=>e[t]>=0)}const B_e=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=sp(e,t);switch(o){case"referenceHidden":{const i=await B0(t,{...r,elementContext:"reference"}),s=TV(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:RV(s)}}}case"escaped":{const i=await B0(t,{...r,altBoundary:!0}),s=TV(i,n.floating);return{data:{escapedOffsets:s,escaped:RV(s)}}}default:return{}}}}},wee=new Set(["left","top"]);async function k_e(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ap(n),a=PA(n),c=Ol(n)==="y",p=wee.has(s)?-1:1,u=i&&c?-1:1,l=sp(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return a&&typeof h=="number"&&(f=a==="end"?h*-1:h),c?{x:f*u,y:d*p}:{x:d*p,y:f*u}}const U_e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await k_e(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},q_e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:y,y:_}=g;return{x:y,y:_}}},...c}=sp(e,t),p={x:n,y:o},u=await B0(t,c),l=Ol(ap(r)),d=IF(l);let f=p[d],h=p[l];if(i){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=f+u[g],S=f-u[y];f=N2(_,f,S)}if(s){const g=l==="y"?"top":"left",y=l==="y"?"bottom":"right",_=h+u[g],S=h-u[y];h=N2(_,h,S)}const m=a.fn({...t,[d]:f,[l]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[d]:i,[l]:s}}}}}},J_e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:p=!0}=sp(e,t),u={x:n,y:o},l=Ol(r),d=IF(l);let f=u[d],h=u[l];const m=sp(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const S=d==="y"?"height":"width",w=i.reference[d]-i.floating[S]+g.mainAxis,R=i.reference[d]+i.reference[S]-g.mainAxis;fR&&(f=R)}if(p){var y,_;const S=d==="y"?"width":"height",w=wee.has(ap(r)),R=i.reference[l]-i.floating[S]+(w&&((y=s.offset)==null?void 0:y[l])||0)+(w?0:g.crossAxis),E=i.reference[l]+i.reference[S]+(w?0:((_=s.offset)==null?void 0:_[l])||0)-(w?g.crossAxis:0);hE&&(h=E)}return{[d]:f,[l]:h}}}},V_e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...p}=sp(e,t),u=await B0(t,p),l=ap(r),d=PA(r),f=Ol(r)==="y",{width:h,height:m}=i.floating;let g,y;l==="top"||l==="bottom"?(g=l,y=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=l,g=d==="end"?"top":"bottom");const _=m-u.top-u.bottom,S=h-u.left-u.right,w=ym(m-u[g],_),R=ym(h-u[y],S),E=!t.middlewareData.shift;let T=w,D=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=_),E&&!d){const N=ci(u.left,0),L=ci(u.right,0),q=ci(u.top,0),I=ci(u.bottom,0);f?D=h-2*(N!==0||L!==0?N+L:ci(u.left,u.right)):T=m-2*(q!==0||I!==0?q+I:ci(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:T});const B=await s.getDimensions(a.floating);return h!==B.width||m!==B.height?{reset:{rects:!0}}:{}}}};function DM(){return typeof window<"u"}function IA(e){return Oee(e)?(e.nodeName||"").toLowerCase():"#document"}function fi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ul(e){var t;return(t=(Oee(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Oee(e){return DM()?e instanceof Node||e instanceof fi(e).Node:!1}function Os(e){return DM()?e instanceof Element||e instanceof fi(e).Element:!1}function Ll(e){return DM()?e instanceof HTMLElement||e instanceof fi(e).HTMLElement:!1}function EV(e){return!DM()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fi(e).ShadowRoot}const H_e=new Set(["inline","contents"]);function OC(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!H_e.has(r)}const G_e=new Set(["table","td","th"]);function z_e(e){return G_e.has(IA(e))}const K_e=[":popover-open",":modal"];function NM(e){return K_e.some(t=>{try{return e.matches(t)}catch{return!1}})}const Q_e=["transform","translate","scale","rotate","perspective"],$_e=["transform","translate","scale","rotate","perspective","filter"],W_e=["paint","layout","strict","content"];function NF(e){const t=LF(),n=Os(e)?Ts(e):e;return Q_e.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$_e.some(o=>(n.willChange||"").includes(o))||W_e.some(o=>(n.contain||"").includes(o))}function Y_e(e){let t=Am(e);for(;Ll(t)&&!hA(t);){if(NF(t))return t;if(NM(t))return null;t=Am(t)}return null}function LF(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const X_e=new Set(["html","body","#document"]);function hA(e){return X_e.has(IA(e))}function Ts(e){return fi(e).getComputedStyle(e)}function LM(e){return Os(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Am(e){if(IA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||EV(e)&&e.host||Ul(e);return EV(t)?t.host:t}function Tee(e){const t=Am(e);return hA(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ll(t)&&OC(t)?t:Tee(t)}function k0(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Tee(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=fi(r);if(i){const a=F2(s);return t.concat(s,s.visualViewport||[],OC(r)?r:[],a&&n?k0(a):[])}return t.concat(r,k0(r,[],n))}function F2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ree(e){const t=Ts(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ll(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=YR(n)!==i||YR(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function FF(e){return Os(e)?e:e.contextElement}function Qy(e){const t=FF(e);if(!Ll(t))return Pl(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ree(t);let s=(i?YR(n.width):n.width)/o,a=(i?YR(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Z_e=Pl(0);function Eee(e){const t=fi(e);return!LF()||!t.visualViewport?Z_e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eve(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==fi(e)?!1:t}function Jg(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=FF(e);let s=Pl(1);t&&(o?Os(o)&&(s=Qy(o)):s=Qy(e));const a=eve(i,n,o)?Eee(i):Pl(0);let c=(r.left+a.x)/s.x,p=(r.top+a.y)/s.y,u=r.width/s.x,l=r.height/s.y;if(i){const d=fi(i),f=o&&Os(o)?fi(o):o;let h=d,m=F2(h);for(;m&&o&&f!==h;){const g=Qy(m),y=m.getBoundingClientRect(),_=Ts(m),S=y.left+(m.clientLeft+parseFloat(_.paddingLeft))*g.x,w=y.top+(m.clientTop+parseFloat(_.paddingTop))*g.y;c*=g.x,p*=g.y,u*=g.x,l*=g.y,c+=S,p+=w,h=fi(m),m=F2(h)}}return ZR({width:u,height:l,x:c,y:p})}function FM(e,t){const n=LM(e).scrollLeft;return t?t.left+n:Jg(Ul(e)).left+n}function Mee(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-FM(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function tve(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=Ul(o),a=t?NM(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},p=Pl(1);const u=Pl(0),l=Ll(o);if((l||!l&&!i)&&((IA(o)!=="body"||OC(s))&&(c=LM(o)),Ll(o))){const f=Jg(o);p=Qy(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const d=s&&!l&&!i?Mee(s,c):Pl(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-c.scrollLeft*p.x+u.x+d.x,y:n.y*p.y-c.scrollTop*p.y+u.y+d.y}}function nve(e){return Array.from(e.getClientRects())}function rve(e){const t=Ul(e),n=LM(e),o=e.ownerDocument.body,r=ci(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=ci(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+FM(e);const a=-n.scrollTop;return Ts(o).direction==="rtl"&&(s+=ci(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const MV=25;function ove(e,t){const n=fi(e),o=Ul(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const u=LF();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const p=FM(o);if(p<=0){const u=o.ownerDocument,l=u.body,d=getComputedStyle(l),f=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(o.clientWidth-l.clientWidth-f);h<=MV&&(i-=h)}else p<=MV&&(i+=p);return{width:i,height:s,x:a,y:c}}const ive=new Set(["absolute","fixed"]);function sve(e,t){const n=Jg(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Ll(e)?Qy(e):Pl(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,p=o*i.y;return{width:s,height:a,x:c,y:p}}function PV(e,t,n){let o;if(t==="viewport")o=ove(e,n);else if(t==="document")o=rve(Ul(e));else if(Os(t))o=sve(t,n);else{const r=Eee(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ZR(o)}function Pee(e,t){const n=Am(e);return n===t||!Os(n)||hA(n)?!1:Ts(n).position==="fixed"||Pee(n,t)}function ave(e,t){const n=t.get(e);if(n)return n;let o=k0(e,[],!1).filter(a=>Os(a)&&IA(a)!=="body"),r=null;const i=Ts(e).position==="fixed";let s=i?Am(e):e;for(;Os(s)&&!hA(s);){const a=Ts(s),c=NF(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&ive.has(r.position)||OC(s)&&!c&&Pee(e,s))?o=o.filter(u=>u!==s):r=a,s=Am(s)}return t.set(e,o),o}function lve(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?NM(t)?[]:ave(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((p,u)=>{const l=PV(t,u,r);return p.top=ci(l.top,p.top),p.right=ym(l.right,p.right),p.bottom=ym(l.bottom,p.bottom),p.left=ci(l.left,p.left),p},PV(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function uve(e){const{width:t,height:n}=Ree(e);return{width:t,height:n}}function cve(e,t,n){const o=Ll(t),r=Ul(t),i=n==="fixed",s=Jg(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Pl(0);function p(){c.x=FM(r)}if(o||!o&&!i)if((IA(t)!=="body"||OC(r))&&(a=LM(t)),o){const f=Jg(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&p();i&&!o&&r&&p();const u=r&&!o&&!i?Mee(r,a):Pl(0),l=s.left+a.scrollLeft-c.x-u.x,d=s.top+a.scrollTop-c.y-u.y;return{x:l,y:d,width:s.width,height:s.height}}function mD(e){return Ts(e).position==="static"}function IV(e,t){if(!Ll(e)||Ts(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ul(e)===n&&(n=n.ownerDocument.body),n}function Iee(e,t){const n=fi(e);if(NM(e))return n;if(!Ll(e)){let r=Am(e);for(;r&&!hA(r);){if(Os(r)&&!mD(r))return r;r=Am(r)}return n}let o=IV(e,t);for(;o&&z_e(o)&&mD(o);)o=IV(o,t);return o&&hA(o)&&mD(o)&&!NF(o)?n:o||Y_e(e)||n}const dve=async function(e){const t=this.getOffsetParent||Iee,n=this.getDimensions,o=await n(e.floating);return{reference:cve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function fve(e){return Ts(e).direction==="rtl"}const hve={convertOffsetParentRelativeRectToViewportRelativeRect:tve,getDocumentElement:Ul,getClippingRect:lve,getOffsetParent:Iee,getElementRects:dve,getClientRects:nve,getDimensions:uve,getScale:Qy,isElement:Os,isRTL:fve};function jee(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pve(e,t){let n=null,o;const r=Ul(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const p=e.getBoundingClientRect(),{left:u,top:l,width:d,height:f}=p;if(a||t(),!d||!f)return;const h=wO(l),m=wO(r.clientWidth-(u+d)),g=wO(r.clientHeight-(l+f)),y=wO(u),S={rootMargin:-h+"px "+-m+"px "+-g+"px "+-y+"px",threshold:ci(0,ym(1,c))||1};let w=!0;function R(E){const T=E[0].intersectionRatio;if(T!==c){if(!w)return s();T?s(!1,T):o=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!jee(p,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(R,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,S)}n.observe(e)}return s(!0),i}function mve(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,p=FF(e),u=r||i?[...p?k0(p):[],...k0(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const l=p&&a?pve(p,n):null;let d=-1,f=null;s&&(f=new ResizeObserver(y=>{let[_]=y;_&&_.target===p&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=f)==null||S.observe(t)})),n()}),p&&!c&&f.observe(p),f.observe(t));let h,m=c?Jg(e):null;c&&g();function g(){const y=Jg(e);m&&!jee(m,y)&&n(),m=y,h=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(_=>{r&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),l?.(),(y=f)==null||y.disconnect(),f=null,c&&cancelAnimationFrame(h)}}const gve=U_e,bve=q_e,yve=x_e,Ave=V_e,_ve=B_e,jV=F_e,vve=J_e,Sve=(e,t,n)=>{const o=new Map,r={platform:hve,...n},i={...r.platform,_c:o};return L_e(e,t,{...r,platform:i})};var Cve=typeof document<"u",wve=function(){},cR=Cve?x.useLayoutEffect:wve;function eE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!eE(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!eE(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Dee(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function DV(e,t){const n=Dee(e);return Math.round(t*n)/n}function gD(e){const t=x.useRef(e);return cR(()=>{t.current=e}),t}function Ove(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:p}=e,[u,l]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=x.useState(o);eE(d,o)||f(o);const[h,m]=x.useState(null),[g,y]=x.useState(null),_=x.useCallback(Q=>{Q!==E.current&&(E.current=Q,m(Q))},[]),S=x.useCallback(Q=>{Q!==T.current&&(T.current=Q,y(Q))},[]),w=i||h,R=s||g,E=x.useRef(null),T=x.useRef(null),D=x.useRef(u),B=c!=null,N=gD(c),L=gD(r),q=gD(p),I=x.useCallback(()=>{if(!E.current||!T.current)return;const Q={placement:t,strategy:n,middleware:d};L.current&&(Q.platform=L.current),Sve(E.current,T.current,Q).then(le=>{const K={...le,isPositioned:q.current!==!1};U.current&&!eE(D.current,K)&&(D.current=K,IM.flushSync(()=>{l(K)}))})},[d,t,n,L,q]);cR(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,l(Q=>({...Q,isPositioned:!1})))},[p]);const U=x.useRef(!1);cR(()=>(U.current=!0,()=>{U.current=!1}),[]),cR(()=>{if(w&&(E.current=w),R&&(T.current=R),w&&R){if(N.current)return N.current(w,R,I);I()}},[w,R,I,N,B]);const J=x.useMemo(()=>({reference:E,floating:T,setReference:_,setFloating:S}),[_,S]),V=x.useMemo(()=>({reference:w,floating:R}),[w,R]),G=x.useMemo(()=>{const Q={position:n,left:0,top:0};if(!V.floating)return Q;const le=DV(V.floating,u.x),K=DV(V.floating,u.y);return a?{...Q,transform:"translate("+le+"px, "+K+"px)",...Dee(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:le,top:K}},[n,a,V.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:I,refs:J,elements:V,floatingStyles:G}),[u,I,J,V,G])}const Tve=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?jV({element:o.current,padding:r}).fn(n):{}:o?jV({element:o,padding:r}).fn(n):{}}}},Rve=(e,t)=>({...gve(e),options:[e,t]}),Eve=(e,t)=>({...bve(e),options:[e,t]}),Mve=(e,t)=>({...vve(e),options:[e,t]}),Pve=(e,t)=>({...yve(e),options:[e,t]}),Ive=(e,t)=>({...Ave(e),options:[e,t]}),jve=(e,t)=>({..._ve(e),options:[e,t]}),Dve=(e,t)=>({...Tve(e),options:[e,t]});function Nve(e){const t=Lve(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(xve);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Lve(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=kve(r),a=Bve(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fve=Symbol("radix.slottable");function xve(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fve}function Bve(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function kve(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qve=Uve.reduce((e,t)=>{const n=Nve(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Jve="Arrow",Nee=x.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return F.jsx(qve.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:F.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nee.displayName=Jve;var Vve=Nee;function Hve(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,Gve(r,...t)]}function Gve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function zve(e){const t=Kve(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find($ve);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Kve(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=Yve(r),a=Wve(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qve=Symbol("radix.slottable");function $ve(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qve}function Wve(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Yve(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lee=Xve.reduce((e,t)=>{const n=zve(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Fee(e){const[t,n]=x.useState(void 0);return bm(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const c=i.borderBoxSize,p=Array.isArray(c)?c[0]:c;s=p.inlineSize,a=p.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var xF="Popper",[xee,xM]=Hve(xF),[Zve,Bee]=xee(xF),kee=e=>{const{__scopePopper:t,children:n}=e,[o,r]=x.useState(null);return F.jsx(Zve,{scope:t,anchor:o,onAnchorChange:r,children:n})};kee.displayName=xF;var Uee="PopperAnchor",qee=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Bee(Uee,n),s=x.useRef(null),a=Cn(t,s),c=x.useRef(null);return x.useEffect(()=>{const p=c.current;c.current=o?.current||s.current,p!==c.current&&i.onAnchorChange(c.current)}),o?null:F.jsx(Lee.div,{...r,ref:a})});qee.displayName=Uee;var BF="PopperContent",[eSe,tSe]=xee(BF),Jee=x.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:p=[],collisionPadding:u=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:f="optimized",onPlaced:h,...m}=e,g=Bee(BF,n),[y,_]=x.useState(null),S=Cn(t,Me=>_(Me)),[w,R]=x.useState(null),E=Fee(w),T=E?.width??0,D=E?.height??0,B=o+(i!=="center"?"-"+i:""),N=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(p)?p:[p],q=L.length>0,I={padding:N,boundary:L.filter(rSe),altBoundary:q},{refs:U,floatingStyles:J,placement:V,isPositioned:G,middlewareData:Q}=Ove({strategy:"fixed",placement:B,whileElementsMounted:(...Me)=>mve(...Me,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[Rve({mainAxis:r+D,alignmentAxis:s}),c&&Eve({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?Mve():void 0,...I}),c&&Pve({...I}),Ive({...I,apply:({elements:Me,rects:Ye,availableWidth:ct,availableHeight:Pt})=>{const{width:tn,height:Mt}=Ye.reference,kn=Me.floating.style;kn.setProperty("--radix-popper-available-width",`${ct}px`),kn.setProperty("--radix-popper-available-height",`${Pt}px`),kn.setProperty("--radix-popper-anchor-width",`${tn}px`),kn.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),w&&Dve({element:w,padding:a}),oSe({arrowWidth:T,arrowHeight:D}),d&&jve({strategy:"referenceHidden",...I})]}),[le,K]=Gee(V),X=Co(h);bm(()=>{G&&X?.()},[G,X]);const ce=Q.arrow?.x,W=Q.arrow?.y,_e=Q.arrow?.centerOffset!==0,[Ne,Ie]=x.useState();return bm(()=>{y&&Ie(window.getComputedStyle(y).zIndex)},[y]),F.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:G?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:F.jsx(eSe,{scope:n,placedSide:le,onArrowChange:R,arrowX:ce,arrowY:W,shouldHideArrow:_e,children:F.jsx(Lee.div,{"data-side":le,"data-align":K,...m,ref:S,style:{...m.style,animation:G?void 0:"none"}})})})});Jee.displayName=BF;var Vee="PopperArrow",nSe={top:"bottom",right:"left",bottom:"top",left:"right"},Hee=x.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=tSe(Vee,o),s=nSe[i.placedSide];return F.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:F.jsx(Vve,{...r,ref:n,style:{...r.style,display:"block"}})})});Hee.displayName=Vee;function rSe(e){return e!==null}var oSe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[p,u]=Gee(n),l={start:"0%",center:"50%",end:"100%"}[u],d=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+c/2;let h="",m="";return p==="bottom"?(h=s?l:`${d}px`,m=`${-c}px`):p==="top"?(h=s?l:`${d}px`,m=`${o.floating.height+c}px`):p==="right"?(h=`${-c}px`,m=s?l:`${f}px`):p==="left"&&(h=`${o.floating.width+c}px`,m=s?l:`${f}px`),{data:{x:h,y:m}}}});function Gee(e){const[t,n="center"]=e.split("-");return[t,n]}var zee=kee,Kee=qee,Qee=Jee,$ee=Hee;function iSe(e){const t=sSe(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(lSe);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function sSe(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=cSe(r),a=uSe(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aSe=Symbol("radix.slottable");function lSe(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aSe}function uSe(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function cSe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dSe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fSe=dSe.reduce((e,t)=>{const n=iSe(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),hSe="Portal",kF=x.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=x.useState(!1);bm(()=>i(!0),[]);const s=n||r&&globalThis?.document?.body;return s?LAe.createPortal(F.jsx(fSe.div,{...o,ref:t}),s):null});kF.displayName=hSe;function pSe(e,t){return x.useReducer((n,o)=>t[n][o]??n,e)}var ql=e=>{const{present:t,children:n}=e,o=mSe(t),r=typeof n=="function"?n({present:o.isPresent}):x.Children.only(n),i=Cn(o.ref,gSe(r));return typeof n=="function"||o.isPresent?x.cloneElement(r,{ref:i}):null};ql.displayName="Presence";function mSe(e){const[t,n]=x.useState(),o=x.useRef(null),r=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[a,c]=pSe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=OO(o.current);i.current=a==="mounted"?p:"none"},[a]),bm(()=>{const p=o.current,u=r.current;if(u!==e){const d=i.current,f=OO(p);e?c("MOUNT"):f==="none"||p?.display==="none"?c("UNMOUNT"):c(u&&d!==f?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),bm(()=>{if(t){let p;const u=t.ownerDocument.defaultView??window,l=f=>{const m=OO(o.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(c("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",p=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},d=f=>{f.target===t&&(i.current=OO(o.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{u.clearTimeout(p),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(p=>{o.current=p?getComputedStyle(p):null,n(p)},[])}}function OO(e){return e?.animationName||"none"}function gSe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bSe=mF[" useInsertionEffect ".trim().toString()]||bm;function jA({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=ySe({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:r;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const l=u.current;l!==a&&console.warn(`${o} is changing from ${l?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,o])}const p=x.useCallback(u=>{if(a){const l=ASe(u)?u(e):u;l!==e&&s.current?.(l)}else i(u)},[a,e,i,s]);return[c,p]}function ySe({defaultProp:e,onChange:t}){const[n,o]=x.useState(e),r=x.useRef(n),i=x.useRef(t);return bSe(()=>{i.current=t},[t]),x.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function ASe(e){return typeof e=="function"}var _Se=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ly=new WeakMap,TO=new WeakMap,RO={},bD=0,Wee=function(e){return e&&(e.host||Wee(e.parentNode))},vSe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Wee(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},SSe=function(e,t,n,o){var r=vSe(t,Array.isArray(e)?e:[e]);RO[n]||(RO[n]=new WeakMap);var i=RO[n],s=[],a=new Set,c=new Set(r),p=function(l){!l||a.has(l)||(a.add(l),p(l.parentNode))};r.forEach(p);var u=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(d){if(a.has(d))u(d);else try{var f=d.getAttribute(o),h=f!==null&&f!=="false",m=(ly.get(d)||0)+1,g=(i.get(d)||0)+1;ly.set(d,m),i.set(d,g),s.push(d),m===1&&h&&TO.set(d,!0),g===1&&d.setAttribute(n,"true"),h||d.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return u(t),a.clear(),bD++,function(){s.forEach(function(l){var d=ly.get(l)-1,f=i.get(l)-1;ly.set(l,d),i.set(l,f),d||(TO.has(l)||l.removeAttribute(o),TO.delete(l)),f||l.removeAttribute(n)}),bD--,bD||(ly=new WeakMap,ly=new WeakMap,TO=new WeakMap,RO={})}},Yee=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=_Se(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),SSe(o,r,n,"aria-hidden")):function(){return null}},_l=function(){return _l=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return BSe;var t=kSe(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},qSe=tte(),$y="data-scroll-locked",JSe=function(e,t,n,o){var r=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(CSe,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(a,"px ").concat(o,`; } - body[`).concat(Rd,`] { - overflow: hidden `).concat(i,`; + body[`).concat($y,`] { + overflow: hidden `).concat(o,`; overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&` + `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` padding-left: `.concat(r,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; margin-left:0; margin-top:0; - margin-right: `).concat(a,"px ").concat(i,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),` + margin-right: `).concat(a,"px ").concat(o,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),` } - .`).concat(Iy,` { - right: `).concat(a,"px ").concat(i,`; + .`).concat(fR,` { + right: `).concat(a,"px ").concat(o,`; } - .`).concat(My,` { - margin-right: `).concat(a,"px ").concat(i,`; + .`).concat(hR,` { + margin-right: `).concat(a,"px ").concat(o,`; } - .`).concat(Iy," .").concat(Iy,` { - right: 0 `).concat(i,`; + .`).concat(fR," .").concat(fR,` { + right: 0 `).concat(o,`; } - .`).concat(My," .").concat(My,` { - margin-right: 0 `).concat(i,`; + .`).concat(hR," .").concat(hR,` { + margin-right: 0 `).concat(o,`; } - body[`).concat(Rd,`] { - `).concat(aie,": ").concat(a,`px; + body[`).concat($y,`] { + `).concat(wSe,": ").concat(a,`px; } -`)},rO=function(){var t=parseInt(document.body.getAttribute(Rd)||"0",10);return isFinite(t)?t:0},_ie=function(){T.useEffect(function(){return document.body.setAttribute(Rd,(rO()+1).toString()),function(){var t=rO()-1;t<=0?document.body.removeAttribute(Rd):document.body.setAttribute(Rd,t.toString())}},[])},Tie=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;_ie();var s=T.useMemo(function(){return Cie(r)},[r]);return T.createElement(xie,{styles:Eie(s,!e,r,n?"":"!important")})},B1=!1;if(typeof window<"u")try{var ZA=Object.defineProperty({},"passive",{get:function(){return B1=!0,!0}});window.addEventListener("test",ZA,ZA),window.removeEventListener("test",ZA,ZA)}catch{B1=!1}var $u=B1?{passive:!1}:!1,Rie=function(t){return t.tagName==="TEXTAREA"},BF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rie(t)&&n[e]==="visible")},kie=function(t){return BF(t,"overflowY")},Iie=function(t){return BF(t,"overflowX")},sO=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=LF(t,i);if(r){var s=UF(t,i),o=s[1],a=s[2];if(o>a)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Mie=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},Die=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},LF=function(t,e){return t==="v"?kie(e):Iie(e)},UF=function(t,e){return t==="v"?Mie(e):Die(e)},Pie=function(t,e){return t==="h"&&e==="rtl"?-1:1},Nie=function(t,e,n,i,r){var s=Pie(t,window.getComputedStyle(e).direction),o=s*i,a=n.target,l=e.contains(a),u=!1,d=o>0,f=0,g=0;do{if(!a)break;var m=UF(t,a),v=m[0],S=m[1],C=m[2],E=S-C-s*v;(v||E)&&LF(t,a)&&(f+=E,g+=v);var k=a.parentNode;a=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(g)<1)&&(u=!0),u},e0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},oO=function(t){return[t.deltaX,t.deltaY]},aO=function(t){return t&&"current"in t?t.current:t},Oie=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Bie=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Lie=0,Wu=[];function Uie(t){var e=T.useRef([]),n=T.useRef([0,0]),i=T.useRef(),r=T.useState(Lie++)[0],s=T.useState(OF)[0],o=T.useRef(t);T.useEffect(function(){o.current=t},[t]),T.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var S=ky([t.lockRef.current],(t.shards||[]).map(aO),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var a=T.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!o.current.allowPinchZoom;var E=e0(S),k=n.current,R="deltaX"in S?S.deltaX:k[0]-E[0],M="deltaY"in S?S.deltaY:k[1]-E[1],D,P=S.target,N=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in S&&N==="h"&&P.type==="range")return!1;var B=window.getSelection(),G=B&&B.anchorNode,V=G?G===P||G.contains(P):!1;if(V)return!1;var $=sO(N,P);if(!$)return!0;if($?D=N:(D=N==="v"?"h":"v",$=sO(N,P)),!$)return!1;if(!i.current&&"changedTouches"in S&&(R||M)&&(i.current=D),!D)return!0;var K=i.current||D;return Nie(K,C,S,K==="h"?R:M)},[]),l=T.useCallback(function(S){var C=S;if(!(!Wu.length||Wu[Wu.length-1]!==s)){var E="deltaY"in C?oO(C):e0(C),k=e.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&Oie(D.delta,E)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var R=(o.current.shards||[]).map(aO).filter(Boolean).filter(function(D){return D.contains(C.target)}),M=R.length>0?a(C,R[0]):!o.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),u=T.useCallback(function(S,C,E,k){var R={name:S,delta:C,target:E,should:k,shadowParent:Vie(E)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(M){return M!==R})},1)},[]),d=T.useCallback(function(S){n.current=e0(S),i.current=void 0},[]),f=T.useCallback(function(S){u(S.type,oO(S),S.target,a(S,t.lockRef.current))},[]),g=T.useCallback(function(S){u(S.type,e0(S),S.target,a(S,t.lockRef.current))},[]);T.useEffect(function(){return Wu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,$u),document.addEventListener("touchmove",l,$u),document.addEventListener("touchstart",d,$u),function(){Wu=Wu.filter(function(S){return S!==s}),document.removeEventListener("wheel",l,$u),document.removeEventListener("touchmove",l,$u),document.removeEventListener("touchstart",d,$u)}},[]);var m=t.removeScrollBar,v=t.inert;return T.createElement(T.Fragment,null,v?T.createElement(s,{styles:Bie(r)}):null,m?T.createElement(Tie,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Vie(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Fie=pie(NF,Uie);var VT=T.forwardRef(function(t,e){return T.createElement(tw,ro({},t,{ref:e,sideCar:Fie}))});VT.classNames=tw.classNames;const Yg=t=>{const e=T.useRef(void 0);return T.useCallback(i=>{e.current&&e.current(),i&&(e.current=t(i))},[t])},VF=(t,e)=>{const n=T.useCallback(i=>{if(!t)return;const r=t(),s=()=>{const a=e?e(i):i.offsetHeight;r.setHeight(a)},o=new ResizeObserver(s);return o.observe(i),s(),()=>{o.disconnect(),r.unregister()}},[t,e]);return Yg(n)},lO=T.createContext(!1),cO=(t,e)=>{const n=t.match(/^([\d.]+)(em|px|rem)$/);if(!n)return 0;const i=parseFloat(n[1]),r=n[2];if(r==="px")return i;if(r==="em"){const s=parseFloat(getComputedStyle(e).fontSize)||16;return i*s}if(r==="rem"){const s=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return i*s}return 0},FF=({children:t,fillClampThreshold:e="10em",fillClampOffset:n="6em"})=>{const i=_t(({message:l})=>l.isLast&&l.index>=2),r=TT({optional:!0}),s=T.useContext(lO),o=T.useCallback(l=>{if(!r||s)return;const u=()=>{const d=r.getState();if(d.turnAnchor==="top"&&i){const{viewport:f,inset:g,userMessage:m}=d.height,v=cO(e,l),S=cO(n,l),C=m<=v?m:S,E=Math.max(0,f-g-C);l.style.minHeight=`${E}px`,l.style.flexShrink="0",l.style.transition="min-height 0s"}else l.style.minHeight="",l.style.flexShrink="",l.style.transition=""};return u(),r.subscribe(u)},[r,i,s,e,n]),a=Yg(o);return _.jsx(lO.Provider,{value:!0,children:_.jsx(RT,{ref:a,children:t})})};FF.displayName="ThreadPrimitive.ViewportSlack";const Hie=()=>{const t=Er(),e=_t(()=>t.message()),n=T.useCallback(i=>{const r=()=>{e.setIsHovering(!0)},s=()=>{e.setIsHovering(!1)};return i.addEventListener("mouseenter",r),i.addEventListener("mouseleave",s),i.matches(":hover")&&queueMicrotask(()=>e.setIsHovering(!0)),()=>{i.removeEventListener("mouseenter",r),i.removeEventListener("mouseleave",s),e.setIsHovering(!1)}},[e]);return Yg(n)},zie=()=>{const t=fv(r=>r.turnAnchor),e=fv(r=>r.registerUserMessageHeight),n=_t(({thread:r,message:s})=>t==="top"&&s.role==="user"&&s.index===r.messages.length-2&&r.messages.at(-1)?.role==="assistant"),i=T.useCallback(r=>r.offsetHeight,[]);return VF(n?e:null,i)},FT=T.forwardRef((t,e)=>{const n=Hie(),i=zie(),r=$t(e,n,i);return _.jsx(FF,{children:_.jsx(xo.div,{...t,ref:r})})});FT.displayName="MessagePrimitive.Root";const HF=()=>_t(({part:e})=>{if(e.type!=="text"&&e.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return e}),zF=T.forwardRef(({smooth:t=!0,component:e="span",...n},i)=>{const{text:r,status:s}=$6(HF(),t);return _.jsx(e,{"data-status":s.type,...n,ref:i,children:r})});zF.displayName="MessagePartPrimitive.Text";const Qie=()=>_t(({part:e})=>{if(e.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return e}),QF=T.forwardRef((t,e)=>{const{image:n}=Qie();return _.jsx(xo.img,{src:n,...t,ref:e})});QF.displayName="MessagePartPrimitive.Image";const GF=({children:t})=>_t(({part:n})=>n.status.type==="running")?t:null;GF.displayName="MessagePartPrimitive.InProgress";const uO=t=>Symbol.iterator in t,dO=t=>"entries"in t,hO=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),i=e instanceof Map?e:new Map(e.entries());if(n.size!==i.size)return!1;for(const[r,s]of n)if(!i.has(r)||!Object.is(s,i.get(r)))return!1;return!0},Gie=(t,e)=>{const n=t[Symbol.iterator](),i=e[Symbol.iterator]();let r=n.next(),s=i.next();for(;!r.done&&!s.done;){if(!Object.is(r.value,s.value))return!1;r=n.next(),s=i.next()}return!!r.done&&!!s.done};function $ie(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:uO(t)&&uO(e)?dO(t)&&dO(e)?hO(t,e):Gie(t,e):hO({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Wie(t){const e=me.useRef(void 0);return n=>{const i=t(n);return $ie(e.current,i)?e.current:e.current=i}}const fO=t=>{let e=-1;return{startGroup:n=>{e===-1&&(e=n)},endGroup:(n,i)=>{e!==-1&&(i.push({type:t,startIndex:e,endIndex:n}),e=-1)},finalize:(n,i)=>{e!==-1&&i.push({type:t,startIndex:e,endIndex:n})}}},jie=t=>{const e=[],n=fO("toolGroup"),i=fO("reasoningGroup");for(let r=0;r{const t=_t(Wie(e=>e.message.parts.map(n=>n.type)));return T.useMemo(()=>t.length===0?[]:jie(t),[t])},Yie=({Fallback:t,...e})=>{const n=_t(({tools:i})=>{const r=i.tools[e.toolName]??t;return Array.isArray(r)?r[0]??t:r});return n?_.jsx(n,{...e}):null},na={Text:()=>_.jsxs("p",{style:{whiteSpace:"pre-line"},children:[_.jsx(zF,{}),_.jsx(GF,{children:_.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>_.jsx(QF,{}),File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:t})=>t,ReasoningGroup:({children:t})=>t},qie=({components:{Text:t=na.Text,Reasoning:e=na.Reasoning,Image:n=na.Image,Source:i=na.Source,File:r=na.File,Unstable_Audio:s=na.Unstable_Audio,tools:o={}}={}})=>{const a=Er(),l=_t(({part:d})=>d),u=l.type;if(u==="tool-call"){const d=a.part().addToolResult,f=a.part().resumeToolCall;if("Override"in o)return _.jsx(o.Override,{...l,addResult:d,resume:f});const g=o.by_name?.[l.toolName]??o.Fallback;return _.jsx(Yie,{...l,Fallback:g,addResult:d,resume:f})}if(l.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(u){case"text":return _.jsx(t,{...l});case"reasoning":return _.jsx(e,{...l});case"source":return _.jsx(i,{...l});case"image":return _.jsx(n,{...l});case"file":return _.jsx(r,{...l});case"audio":return _.jsx(s,{...l});case"data":return null;default:const d=u;throw new Error(`Unknown message part type: ${d}`)}},Dy=T.memo(({index:t,components:e})=>_.jsx(aee,{index:t,children:_.jsx(qie,{components:e})}),(t,e)=>t.index===e.index&&t.components?.Text===e.components?.Text&&t.components?.Reasoning===e.components?.Reasoning&&t.components?.Source===e.components?.Source&&t.components?.Image===e.components?.Image&&t.components?.File===e.components?.File&&t.components?.Unstable_Audio===e.components?.Unstable_Audio&&t.components?.tools===e.components?.tools&&t.components?.ToolGroup===e.components?.ToolGroup&&t.components?.ReasoningGroup===e.components?.ReasoningGroup);Dy.displayName="MessagePrimitive.PartByIndex";const Jie=({status:t,component:e})=>_.jsx(cee,{text:"",isRunning:t.type==="running",children:_.jsx(e,{type:"text",text:"",status:t})}),Xie=Object.freeze({type:"complete"}),Zie=({components:t})=>{const e=_t(n=>n.message.status??Xie);return t?.Empty?_.jsx(t.Empty,{status:e}):_.jsx(Jie,{status:e,component:t?.Text??na.Text})},ere=T.memo(Zie,(t,e)=>t.components?.Empty===e.components?.Empty&&t.components?.Text===e.components?.Text),HT=({components:t})=>{const e=_t(({message:r})=>r.parts.length),n=Kie(),i=T.useMemo(()=>e===0?_.jsx(ere,{components:t}):n.map(r=>{if(r.type==="single")return _.jsx(Dy,{index:r.index,components:t},r.index);if(r.type==="toolGroup"){const s=t?.ToolGroup??na.ToolGroup;return _.jsx(s,{startIndex:r.startIndex,endIndex:r.endIndex,children:Array.from({length:r.endIndex-r.startIndex+1},(o,a)=>_.jsx(Dy,{index:r.startIndex+a,components:t},a))},`tool-${r.startIndex}`)}else{const s=t?.ReasoningGroup??na.ReasoningGroup;return _.jsx(s,{startIndex:r.startIndex,endIndex:r.endIndex,children:Array.from({length:r.endIndex-r.startIndex+1},(o,a)=>_.jsx(Dy,{index:r.startIndex+a,components:t},a))},`reasoning-${r.startIndex}`)}}),[n,t,e]);return _.jsx(_.Fragment,{children:i})};HT.displayName="MessagePrimitive.Parts";const tre=t=>_t(({message:e})=>{const{role:n,attachments:i,parts:r,branchCount:s,isLast:o,speech:a,isCopied:l,isHovering:u}=e;return!(t.hasBranches===!0&&s<2||t.user&&n!=="user"||t.assistant&&n!=="assistant"||t.system&&n!=="system"||t.lastOrHover===!0&&!u&&!o||t.last!==void 0&&t.last!==o||t.copied===!0&&!l||t.copied===!1&&l||t.speaking===!0&&a==null||t.speaking===!1&&a!=null||t.hasAttachments===!0&&(n!=="user"||!i?.length)||t.hasAttachments===!1&&n==="user"&&i?.length||t.hasContent===!0&&r.length===0||t.hasContent===!1&&r.length>0||t.submittedFeedback!==void 0&&(e.metadata.submittedFeedback?.type??null)!==t.submittedFeedback)}),L1=({children:t,...e})=>tre(e)?t:null;L1.displayName="MessagePrimitive.If";const $F=({children:t})=>_t(({message:n})=>n.status?.type==="incomplete"&&n.status.reason==="error")?t:null;$F.displayName="MessagePrimitive.Error";const WF=()=>{const t=Er(),e=_t(i=>i.thread.isRunning||!i.composer.isEditing||i.composer.isEmpty),n=T.useCallback(()=>{t.composer().send()},[t]);return e?null:n},nre=q6("ComposerPrimitive.Send",WF),jF=T.forwardRef(({onSubmit:t,...e},n)=>{const i=WF(),r=s=>{s.preventDefault(),i&&i()};return _.jsx(xo.form,{...e,ref:n,onSubmit:Ve(t,r)})});jF.displayName="ComposerPrimitive.Root";function cg(){return cg=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const e=Bi(t),n=fv(i=>i.onScrollToBottom);T.useEffect(()=>n(e),[n,e])},qF=T.forwardRef(({autoFocus:t=!1,asChild:e,disabled:n,onChange:i,onKeyDown:r,onPaste:s,submitOnEnter:o=!0,cancelOnEscape:a=!0,unstable_focusOnRunStart:l=!0,unstable_focusOnScrollToBottom:u=!0,unstable_focusOnThreadSwitched:d=!0,addAttachmentOnPaste:f=!0,...g},m)=>{const v=Er(),S=_t(({composer:B})=>B.isEditing?B.text:""),C=e?RT:yre,E=_t(({thread:B})=>B.isDisabled)||n,k=T.useRef(null),R=$t(m,k);J6(B=>{if(!a||!k.current?.contains(B.target))return;const G=v.composer();G.getState().canCancel&&(G.cancel(),B.preventDefault())});const M=B=>{E||!o||B.nativeEvent.isComposing||B.key==="Enter"&&B.shiftKey===!1&&(v.thread().getState().isRunning||(B.preventDefault(),k.current?.closest("form")?.requestSubmit()))},D=async B=>{if(!f)return;const G=v.thread().getState().capabilities,V=Array.from(B.clipboardData?.files||[]);if(G.attachments&&V.length>0)try{B.preventDefault(),await Promise.all(V.map($=>v.composer().addAttachment($)))}catch($){console.error("Error adding attachment:",$)}},P=t&&!E,N=T.useCallback(()=>{const B=k.current;!B||!P||(B.focus({preventScroll:!0}),B.setSelectionRange(B.value.length,B.value.length))},[P]);return T.useEffect(()=>N(),[N]),YF(()=>{v.composer().getState().type==="thread"&&u&&N()}),T.useEffect(()=>{if(!(v.composer().getState().type!=="thread"||!l))return v.on("thread.run-start",N)},[l,N,v]),T.useEffect(()=>{if(!(v.composer().getState().type!=="thread"||!d))return v.on("thread-list-item.switched-to",N)},[d,N,v]),_.jsx(C,{name:"input",value:S,...g,ref:R,disabled:E,onChange:Ve(i,B=>{v.composer().getState().isEditing&&M1(()=>{v.composer().setText(B.target.value)})}),onKeyDown:Ve(r,M),onPaste:Ve(s,D)})});qF.displayName="ComposerPrimitive.Input";const vre=()=>{const t=Er(),e=_t(({composer:i})=>!i.canCancel),n=T.useCallback(()=>{t.composer().cancel()},[t]);return e?null:n},bre=q6("ComposerPrimitive.Cancel",vre),JF=T.forwardRef((t,e)=>_.jsx(xo.div,{role:"alert",...t,ref:e}));JF.displayName="ErrorPrimitive.Root";const XF=T.forwardRef(({children:t,...e},n)=>{const i=_t(({message:r})=>r.status?.type==="incomplete"&&r.status.reason==="error"?r.status.error:void 0);return i===void 0?null:_.jsx(xo.span,{...e,ref:n,children:t??String(i)})});XF.displayName="ErrorPrimitive.Message";const ZF=T.forwardRef((t,e)=>_.jsx(xo.div,{...t,ref:e}));ZF.displayName="ThreadPrimitive.Root";const e8=({children:t})=>_t(({thread:n})=>n.messages.length===0&&!n.isLoading)?t:null;e8.displayName="ThreadPrimitive.Empty";const wre=t=>_t(({thread:e})=>!(t.empty===!0&&!e.isEmpty||t.empty===!1&&e.isEmpty||t.running===!0&&!e.isRunning||t.running===!1&&e.isRunning||t.disabled===!0&&!e.isDisabled||t.disabled===!1&&e.isDisabled)),vv=({children:t,...e})=>wre(e)?t:null;vv.displayName="ThreadPrimitive.If";const Sre=t=>{const e=Bi(t),n=T.useCallback(i=>{const r=new ResizeObserver(()=>{e()}),s=new MutationObserver(()=>{e()});return r.observe(i),s.observe(i,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{r.disconnect(),s.disconnect()}},[e]);return Yg(n)},Cre=({autoScroll:t,scrollToBottomOnRunStart:e=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:i=!0})=>{const r=T.useRef(null),s=TT();t===void 0&&(t=s.getState().turnAnchor!=="top");const o=T.useRef(0),a=T.useRef(null),l=T.useCallback(m=>{const v=r.current;v&&(a.current=m,v.scrollTo({top:v.scrollHeight,behavior:m}))},[]),u=()=>{const m=r.current;if(!m)return;const v=s.getState().isAtBottom,S=Math.abs(m.scrollHeight-m.scrollTop-m.clientHeight)<1||m.scrollHeight<=m.clientHeight;!S&&o.current{const m=a.current;m?l(m):t&&s.getState().isAtBottom&&l("instant"),u()}),f=Yg(m=>(m.addEventListener("scroll",u),()=>{m.removeEventListener("scroll",u)}));return YF(({behavior:m})=>{l(m)}),yx("thread.run-start",()=>{e&&(a.current="auto",requestAnimationFrame(()=>{l("auto")}))}),yx("thread.initialize",()=>{n&&(a.current="instant",requestAnimationFrame(()=>{l("instant")}))}),yx("thread-list-item.switched-to",()=>{i&&(a.current="instant",requestAnimationFrame(()=>{l("instant")}))}),$t(d,f,r)},xre=()=>{const t=fv(n=>n.registerViewport),e=T.useCallback(n=>n.clientHeight,[]);return VF(t,e)},t8=T.forwardRef(({autoScroll:t,scrollToBottomOnRunStart:e,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:i,children:r,...s},o)=>{const a=Cre({autoScroll:t,scrollToBottomOnRunStart:e,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:i}),l=xre(),u=$t(o,a,l);return _.jsx(xo.div,{...s,ref:u,children:r})});t8.displayName="ThreadPrimitive.ViewportScrollable";const U1=T.forwardRef(({turnAnchor:t,...e},n)=>_.jsx(H6,{options:{turnAnchor:t},children:_.jsx(t8,{...e,ref:n})}));U1.displayName="ThreadPrimitive.Viewport";const n8=(t,e)=>t.Message===e.Message&&t.EditComposer===e.EditComposer&&t.UserEditComposer===e.UserEditComposer&&t.AssistantEditComposer===e.AssistantEditComposer&&t.SystemEditComposer===e.SystemEditComposer&&t.UserMessage===e.UserMessage&&t.AssistantMessage===e.AssistantMessage&&t.SystemMessage===e.SystemMessage,Ere=()=>null,_re=(t,e,n)=>{switch(e){case"user":return n?t.UserEditComposer??t.EditComposer??t.UserMessage??t.Message:t.UserMessage??t.Message;case"assistant":return n?t.AssistantEditComposer??t.EditComposer??t.AssistantMessage??t.Message:t.AssistantMessage??t.Message;case"system":return n?t.SystemEditComposer??t.EditComposer??t.SystemMessage??t.Message:t.SystemMessage??Ere;default:const i=e;throw new Error(`Unknown message role: ${i}`)}},Tre=({components:t})=>{const e=_t(({message:r})=>r.role),n=_t(({message:r})=>r.composer.isEditing),i=_re(t,e,n);return _.jsx(i,{})},i8=T.memo(({index:t,components:e})=>_.jsx(oee,{index:t,children:_.jsx(Tre,{components:e})}),(t,e)=>t.index===e.index&&n8(t.components,e.components));i8.displayName="ThreadPrimitive.MessageByIndex";const r8=({components:t})=>{const e=_t(({thread:i})=>i.messages.length);return T.useMemo(()=>e===0?null:Array.from({length:e},(i,r)=>_.jsx(i8,{index:r,components:t},r)),[e,t])};r8.displayName="ThreadPrimitive.Messages";const Rre=T.memo(r8,(t,e)=>n8(t.components,e.components)),kre=(t,e,n,i)=>{const r=[n,{code:e,...i||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(r,"warn","react-i18next::",!0);Dc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...r):console?.warn&&console.warn(...r)},vO={},V1=(t,e,n,i)=>{Dc(n)&&vO[n]||(Dc(n)&&(vO[n]=new Date),kre(t,e,n,i))},s8=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},F1=(t,e,n)=>{t.loadNamespaces(e,s8(t,n))},bO=(t,e,n,i)=>{if(Dc(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return F1(t,n,i);n.forEach(r=>{t.options.ns.indexOf(r)<0&&t.options.ns.push(r)}),t.loadLanguages(e,s8(t,i))},Ire=(t,e,n={})=>!e.languages||!e.languages.length?(V1(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,t))return!1}}),Dc=t=>typeof t=="string",Mre=t=>typeof t=="object"&&t!==null,Dre=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pre={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Nre=t=>Pre[t],Ore=t=>t.replace(Dre,Nre);let H1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ore};const Bre=(t={})=>{H1={...H1,...t}},Lre=()=>H1;let o8;const Ure=t=>{o8=t},Vre=()=>o8,Fre={type:"3rdParty",init(t){Bre(t.options.react),Ure(t)}},Hre=T.createContext();class zre{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Qre=(t,e)=>{const n=T.useRef();return T.useEffect(()=>{n.current=t},[t,e]),n.current},a8=(t,e,n,i)=>t.getFixedT(e,n,i),Gre=(t,e,n,i)=>T.useCallback(a8(t,e,n,i),[t,e,n,i]),Ct=(t,e={})=>{const{i18n:n}=e,{i18n:i,defaultNS:r}=T.useContext(Hre)||{},s=n||i||Vre();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new zre),!s){V1(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const M=(P,N)=>Dc(N)?N:Mre(N)&&Dc(N.defaultValue)?N.defaultValue:Array.isArray(P)?P[P.length-1]:P,D=[M,{},!1];return D.t=M,D.i18n={},D.ready=!1,D}s.options.react?.wait&&V1(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...Lre(),...s.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let u=r||s.options?.defaultNS;u=Dc(u)?[u]:u||["translation"],s.reportNamespaces.addUsedNamespaces?.(u);const d=(s.isInitialized||s.initializedStoreOnce)&&u.every(M=>Ire(M,s,o)),f=Gre(s,e.lng||null,o.nsMode==="fallback"?u:u[0],l),g=()=>f,m=()=>a8(s,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[v,S]=T.useState(g);let C=u.join();e.lng&&(C=`${e.lng}${C}`);const E=Qre(C),k=T.useRef(!0);T.useEffect(()=>{const{bindI18n:M,bindI18nStore:D}=o;k.current=!0,!d&&!a&&(e.lng?bO(s,e.lng,u,()=>{k.current&&S(m)}):F1(s,u,()=>{k.current&&S(m)})),d&&E&&E!==C&&k.current&&S(m);const P=()=>{k.current&&S(m)};return M&&s?.on(M,P),D&&s?.store.on(D,P),()=>{k.current=!1,s&&M&&M?.split(" ").forEach(N=>s.off(N,P)),D&&s&&D.split(" ").forEach(N=>s.store.off(N,P))}},[s,C]),T.useEffect(()=>{k.current&&d&&S(g)},[s,l,d]);const R=[v,s,d];if(R.t=v,R.i18n=s,R.ready=d,d||!d&&!a)return R;throw new Promise(M=>{e.lng?bO(s,e.lng,u,()=>M()):F1(s,u,()=>M())})},$re=["ar-SA"],Wt=()=>{const{i18n:t}=Ct(),e=$re.includes(t.language);return{isRTL:e,direction:e?"rtl":"ltr"}},qg=Co(t=>({currentPage:"chat",setCurrentPage:e=>t({currentPage:e}),goToChat:()=>t({currentPage:"chat"}),goToSettings:()=>t({currentPage:"settings"})})),Wre=["theme-dark","theme-night","theme-contrast-dark"],wO=t=>Wre.some(e=>t.includes(e.replace("theme-","")))?"dark":"light",jre=()=>{if(typeof window>"u"||!window.RendererProcessVariable)return"theme-light";const{theme:t}=window.RendererProcessVariable;return t.id==="theme-system"?t.system==="dark"?"theme-night":"theme-white":t.id},Kre=()=>typeof window>"u"?1:window.devicePixelRatio||1,l8=Co(t=>{const e=jre();return{themeId:e,themeType:wO(e),scale:Kre(),setThemeId:n=>t({themeId:n,themeType:wO(n)}),setScale:n=>t({scale:n})}});function z1(t,e){return z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},z1(t,e)}function Yre(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,z1(t,e)}var t0={};var SO;function qre(){if(SO)return t0;SO=1;var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,i=/\\([\u000b\u0020-\u00ff])/g,r=/([\\"])/g,s=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;t0.format=o,t0.parse=a;function o(f){if(!f||typeof f!="object")throw new TypeError("argument obj is required");var g=f.parameters,m=f.type;if(!m||!s.test(m))throw new TypeError("invalid type");var v=m;if(g&&typeof g=="object")for(var S,C=Object.keys(g).sort(),E=0;E0&&!e.test(g))throw new TypeError("invalid parameter value");return'"'+g.replace(r,"\\$1")+'"'}function d(f){this.parameters=Object.create(null),this.type=f}return t0}var Jre=qre(),sd=new Map,c8=function(e){return e.cloneNode(!0)},CO=function(){return window.location.protocol==="file:"},u8=function(e,n,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&r.readyState===2){var s=r.getResponseHeader("Content-Type");if(!s)throw new Error("Content type not found");var o=Jre.parse(s).type;if(!(o==="image/svg+xml"||o==="text/plain"))throw new Error("Invalid content type: ".concat(o))}if(r.readyState===4){if(r.status===404||r.responseXML===null)throw new Error(CO()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(r.status===200||CO()&&r.status===0)i(null,r);else throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText)}}catch(a){if(r.abort(),a instanceof Error)i(a,r);else throw a}},r.open("GET",e),r.withCredentials=n,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},dl={},xO=function(e,n){dl[e]=dl[e]||[],dl[e].push(n)},Xre=function(e){for(var n=function(o,a){setTimeout(function(){if(Array.isArray(dl[e])){var l=sd.get(e),u=dl[e][o];l instanceof SVGSVGElement&&u(null,c8(l)),l instanceof Error&&u(l),o===dl[e].length-1&&delete dl[e]}},0)},i=0,r=dl[e].length;i0&&(n==="always"||n==="once"&&!EO[l])){for(var Z=0,Q=V.length;Z desc");B&&N.removeChild(B);var G=document.createElement("desc");G.innerHTML=o,N.prepend(G)}if(f){var V=N.querySelector(":scope > title");V&&N.removeChild(V);var $=document.createElement("title");$.innerHTML=f,N.prepend($)}try{v(N)}catch(K){R(K)}};rse(k,{afterEach:M,beforeEach:D,cacheRequests:g,evalScripts:a,httpRequestWithCredentials:l,renumerateIRIElements:u})}},n.removeSVG=function(){var r;(r=this.nonReactWrapper)!=null&&r.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(r){var s=this;cse(cg({},r),this.props)&&this.setState(function(){return s.initialState},function(){s.removeSVG(),s.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var r=this.props;r.afterInjection,r.beforeInjection,r.desc,r.evalScripts;var s=r.fallback;r.httpRequestWithCredentials;var o=r.loading;r.renumerateIRIElements,r.src,r.title,r.useRequestCache;var a=r.wrapper,l=KF(r,use),u=a;return T.createElement(u,cg({},l,{ref:this.refCallback},a==="svg"?{xmlns:n0,xmlnsXlink:IO}:{}),this.state.isLoading&&o&&T.createElement(o,null),this.state.hasError&&s&&T.createElement(s,null))},e})(T.Component);QT.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};QT.propTypes={afterInjection:In.func,beforeInjection:In.func,desc:In.string,evalScripts:In.oneOf(["always","once","never"]),fallback:In.oneOfType([In.func,In.object,In.string]),httpRequestWithCredentials:In.bool,loading:In.oneOfType([In.func,In.object,In.string]),onError:In.func,renumerateIRIElements:In.bool,src:In.string.isRequired,title:In.string,useRequestCache:In.bool,wrapper:In.oneOf(["div","span","svg"])};const dse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAAKUlEQVR42mMgE1jst1AAkgoW+2ECDRb3LRyAOAHIgQv9B3MRwEEAh3kAHWsJbGmU0Q4AAAAASUVORK5CYII=",hse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAM0lEQVR42mOgCnAQgNMwYGVg+d7KgIHBQsHiPpCGAYsEi/sWCebvLRJQDDA1AAo7UMUtABBwCm8iC97cAAAAAElFTkSuQmCC",fse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALUlEQVR42mMYBMDyvJUBhGVqYHkezIBxLe4DpcC0KZBGk7JIgAsjAEw1DdwJAAJ/DBgSmTFKAAAAAElFTkSuQmCC",pse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAP0lEQVR42mMYpMBCwbLfQQCNB+cusPhveR4oAJayuG/x3ywALAETgEhDWBYLQKIY0ggpLNJwKUxpoM4FNPc9ADL6HrGxdRV1AAAAAElFTkSuQmCC",gse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQUlEQVR42mMYXsA83zIfg48i8N7iv0U9jGdRD+TdR1FgagBRApM2f29qAGRiU4ImjakEIY1DCR5psP0KpgZ0DkAALkcf8ZPthkMAAAAASUVORK5CYII=",mse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAKUlEQVR42mOgAbA8b2WAVcLUwOI+6VIWCRb3cegwNSAsjHCVqQFl/gIAhmEMHd9OVc4AAAAASUVORK5CYII=",Ase="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAANElEQVR42mMYHMBiv2UBPmkFi/sW9ZQocBCwPG8xH7/0AnyGN+CQNDWwuI/H7UBjE+gakgDDfRA4lFiJoQAAAABJRU5ErkJggg==",yse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAPElEQVR42mMYFsAiwXK9gwBBZZYTLM9bKBA2rcHiPhHKLAss7lsZEGUaASWmBhb3TQ0GWglCkanBIIhTADuuEmjfkVflAAAAAElFTkSuQmCC",vse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAT0lEQVR42mMYEcBCwaLBQoEopUCF/y3uQxQTNvU+0YodBCz2W/y3fG/hQJQzLCdY/AcqLyDazUCYQIzSeohSYhU2DITCBJhC4pQ2DP0ECgC2TioxvmzU5wAAAABJRU5ErkJggg==",bse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbElEQVR42mMYBeQACwWLBgsFEjQAlf+3uE+CFgsFy/MW/y3fWwaQYIvlBIv/QFhPqsP+m/eTYkuA+Xug086T4hsHsMMaiA/e+yTYYGoAcZCDAAnut1hArGPiQW63nECs8gSYV0nR0DCap1AAAJ5iLr4u66zzAAAAAElFTkSuQmCC",wse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAQAAACxtDVnAAAARElEQVR42r2LsQ0AIAzDckpO7Wec0lPMFLogseGtdqqAWSyscHQD0PimJ43OR9JoA8wlKhuAMyxhCksJigkJ4XdoWm82zgd3SwpxHbYAAAAASUVORK5CYII=",Sse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAQAAACoAz4qAAAAW0lEQVR42t3LQQ3AMAwEQUMIBEMppEIpg0IJhEIwlKssa6XKyqPv7CvyXOybXFNTbtQwlIXGGunRWCC/GXR0Zc6goVkqF83iC4QZ6MznobsQrgFXglt7cCjsfy/4pJHeGBKbFQAAAABJRU5ErkJggg==",Cse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAQAAAAOAB1aAAAAUklEQVR42u3LsQ2AUAhFUUZh/yUchVGOlSGYryY2Nt7ukUOckzabjLukAiUfUcNrVKAarlFCrwsUAeOyQgdbwDlhvjc7ULOGFbPJup99wErFu3ZCkbYJrFeQSQAAAABJRU5ErkJggg==",xse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAQAAABO1swWAAAAaUlEQVR42u3RuxGAMAwDUI2WERjBI7BBvCmjiAqZXHSXVFSoyMd+58ZwYWPDTthJkn0TCq+gwR567OGlU9jDZOoWthBg6iVs4ZtOmFFwpAOOogk4qn88cwOw1PThaeWnX9JDi1yHwXOu3itNGcbz+v9BAAAAAElFTkSuQmCC",Ese="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAQAAADR77dlAAAAcElEQVR42u3SsRGAIBBE0SvJEuwEO7MES6KEK2ENlAH/3MyRGehGwPyXYdG0atehxeamorYynYNkOUiWZ4R5TpjnhPmGEwlzM90zA4nzEYREdcyfAMSvB+85AUht1yrvOQAajID7wdeBt6+WjV/tlZ0UIJnOEshoEAAAAABJRU5ErkJggg==",_se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAiElEQVR42t3TMRHDMAyF4UIwBLPwe5sgFEIgCIIYpAwCxRAMwRBCoVOqpXd5XvNvvvt8WqTXs+ObO3dsEkblQG/eHB0T9ZZjIn6v4JB4hg4TuBX6NQOh8HExfhACT4QJW+EHjiXOYeXfh42u8kznSZa4FZ4Sz9qJKvCMjolAR7ciLzWi+bMP9wt1RUgCFJB7LwAAAABJRU5ErkJggg==",Tse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAvklEQVR42u3UTRGDMBAF4EpAAhK4tHmvp0hAQhwUB10H4IA6iYRIiAQs9Nbtb2CncGNvyeSb3exscthj5fAVAgQCb6bu4iZECAcmZNQGiuszQEA+Nwspe6bXXGyRF1GMTL762I3w802KuD1Arfk5sJuhTByUIiuAQL4iPQx5X2nZp9ZMdV2k7EoU4Qc9Nm5CKNHCfZngS3Smz+WCt6Iaf1C2iHaqb2e0Ux3OCbWd6vxm9uytVMsV1/lq/4RXjjvhSVs0JHJtUgAAAABJRU5ErkJggg==",Rse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA2UlEQVR42u3VwQ2DIBTG8Y7gCI7gxfK92xvBDeoGdQPYoN1AN3AERnAERmCFJk2aZ8tB5PVk/N/w8INggMvZkeMKPRwcWIdYBDO/IY+AvpChBRNXnzFqBNgyxqXfaMgEZHZhJDBFFSPBg4uZ9SbTk4ZSZsQkIzg4BSPRfO2yGBpSZh0C6gwG/QZjMW4wbWPiFmPush4Fg1sGgwBWMAK1jZ5JT7z/C0OLgpHokTImts3+qyN+z02dMDsCw//+TWF2rkjFSPCwWkbOm4czs+xNcdTBmYGr8yk+bi9tz2sbjq4v1AAAAABJRU5ErkJggg==",kse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABD0lEQVR42u3WQa2DQBCAYSRUwkrg0uw/PY0EHPQ5aB0UB8UBdYAEJCBhJSBhXsIJ2AP0TZPmJfzc5vCRZTMJxdHRV0N5SEeip5Wq8Ken2GGLJ6EukkDC4iiNVAQ03kkTfHWSMhAW03pi1UXqqVglDUZyknkkDP0AmX2C9i3yXMYR4zUn423+ChSLwx/I+YwHhhFmJzHSJ8ifxToY/U4S3SBn9y/NPvKKYdRbJCG7fRc5JU9MBje5nsaRsEnG23vkudwkebjJPOn2k5hUe5dSN8h8ut0/JNVN5tFi1C4yTwbsUrrJHEXXpNwLT9Jg0mVL4YsQR4wWvZTynJG+pJpYw7KDeyLwopdBGvT45Tv6Yr/CveyBr6s1PQAAAABJRU5ErkJggg==",Ise="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA/ElEQVR42u3XwQ2DMAyF4Y6QETIClyrPPXkERmCEbgAjdAO6QUfICIzACBnBFRWtBb0h+4LycyJCn7lA4FKr1Y7H4daAObjQ6DFD1mPGiGjIU5vKAqdCE3Iq65DOiEf/ATP4t8J4ftZ6O37Yr9N9WafWhdcRVDiY8xoyhO7mvIYOgmzIc+CwPYdQMeOvTSr7+4VALHmhx/8AQx7P7ZW3BpImc17DCMHox0fMELATz4EmvX8vfkY8Oa+l4sJr1IJdeO08PKIbr49/ernw+n5E9OPjAjnxuke58bqRe/D6yMl3BFh5wzBAliMViPKmoUNeRwwcHD/W6w9LrXa8N0sDBgGKvl9BAAAAAElFTkSuQmCC",Mse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAv0lEQVR4AWPACkbB/4tC94H4PHUMuyScADTsPxQXUGbYeQkFsOsQBr7/f15BgALXCfXDDUPgBrJdBzMk0NsEiI3hhoLkyAm7+TADLCwswBjGB8rtpyQi/rs6mcEMRODLIg4kJhOE5kAfuJeR8X1iDctHj4iyDJ3/WXH6cD5yMiIhmSDw7BbV/7Nb1eB89GREMCJIwpdE+gklEwTGTDbY8XlRA0wDLwiuJ8tARDLCTCZkYkQyQniXcgNBZjAMCQAAySKxJKUJDoEAAAAASUVORK5CYII=",Dse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABC0lEQVR4AWOgGRgF/y8JB/y/KPT+/2WheppZArTgPhD/B+Pzoga0sKAeZDgcXxLeT10LzksogIIJagECXxZxoGZczAcbionPU9MX//HgAmrExXmYgVtmKP63sLD4v6JPGW4JOBjPKwhQEkwJyK5uKtQCWQKi0X3TQHGSheH+anWwJf1V6uiWvAcFKwVJFoFnt6iCLAHT6HJAX6+nKMmix8nBhXJgPrYkTXGSvblFEmzJ2dUycDH0DEpxkv18XOR/oLfJ/09AGpcaUGIhOslSgO/DkzThJIuJn+0TB0U6iCZkUQPRSZaU1IXAiAyKM8lS6hNE3Ij0o0W2gAAsyVITQ3xDOMIpTwCkglEAABosqY4+fsNPAAAAAElFTkSuQmCC",Pse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAABE0lEQVR4AWMYVGAUjIL/5yUU/l8Uug/CIDb9LL4kPB9o6X8QBrL309O3/1HwZREH2lt8QXA9usWgIKd1ECfALcPEDTSzGOQzPBa//39eQYAWltbDLHm2T/x/oLcJEBv//3RcBGH5JZF+miaos6tl/ltYWIDxwYVytEpoiOwDwze3SMItvrlVCiqOyF5U8q2AAXp8fj4uArMYFtQYvqZZgnJ1MvvvAsQ4Etp9UEKjSfaJCzUEYypnL0R5jMvgsgwdINb9T+XshUhQuPDsFtX/s1vV/uNTAzKDrOxDGUYkNJLLY8owInuRn6AwMazkItbyBJKzD+UWI7IXwfKYRrgBn8X/aYjf47N4Au0sFp7AMKLAKAAADGVMb+YtB7MAAAAASUVORK5CYII=",Nse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAMAAAApB0NrAAAAbFBMVEUAAAD/zyD/zxj/0xT/0hP/0RL/0RL/0RL/0RL/zxL/0hT/0hP/0BH/0hP/0RL/0RL/0RL/0RLzxxTyxxTmvhfmvRfZtBnNqxzBoR60mCG0lyCbhCWQeyiPeyeCcSp2aC1eVTFRTDRRSzQ4ODicBnJqAAAAEXRSTlMAECBAYG9wf4CAj5+vv8/f7/2ThQkAAACiSURBVHja5c+7EoJADEZhXFFQBPaAd8Vb3v8dHZYdCjPE2vFr0vxFTvIvMtbfJg6YJ7YCqO1JSi83NzU9PzMmCwLrbVcTOfPhTq5AaXVvRWRn9G+ARkRaoLK6n/IId2l03+Q+3Z8RdHIhyKe7T3Ik8E53M9jLgUGpu6Pm1RLo/gqt1N1aqrvjz2cA3Z/xuVH9zqPEftWtFeOGaeNmhaIe+jFvQxsaDFC9uPoAAAAASUVORK5CYII=",Ose="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAgVBMVEUAAAD/zyD/zxj/zxX/0xT/zxT/0hP/0hP/0RL/0RL/zxL/0RL/0RL/0hT/0hL/0hP/0hP/0RL/0RL/0RL/0RLmvhfmvRfZtRrZtBnNqxzBoR7AoR60mCG0mCC0lyCojiObhCWPeyeCcSp2aCxqXi9eVTFRSzRRSzNFQjZEQjY4ODhfPMFcAAAAFHRSTlMAECAwQEBQYG9wcH+Aj4+fv8/f7/5x3csAAADaSURBVHja7dLJEoIwEEVRiPNITJ7zPAH2/3+gCLSkKmC7tcqzfpu+1cFfoWtN55udMoANA9kImbG8U3ixShxGyGnxEpTawtCgNPu86+FtIKXBNk2WEBJNkbkT3ZCZSGl4CCWkufJQC5dciC6c6GOaM9EJOVO/66NwfA8xbkhT2BEdkGlKFKG0IVqjNKlLw1bOEC1vqMHmRAsw7aepxAmYn8iggQm9//f5iZRF5ZAmnMdLFMEREz3giNw0rpQoAWrvmcG1i9M9XLpKI+hJaRh/kf12OBSWdhj8hieb1jFTUa/J4wAAAABJRU5ErkJggg==",Bse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVUlEQVR42u2TMQoAMQgEfdI2C6f/733CfSXlQkhg7TOlzBSCxmNKdiE2iOy4QXx/YZ8QEUZi6UpsXYl0M5FuB4WBTmgXS9cutq7E0s0km8fTeE8zZQFD4innD9LkAgAAAABJRU5ErkJggg==",Lse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQUlEQVR42mOgGzA1sDLA4KMKWNwHCSF4piAephIMaUwlCGkcSiDSeBVY4dYP0g2xCKc0wi04pXEoARmNzqdbLAEA09Yf0pMCKkEAAAAASUVORK5CYII=",Use="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42tXSsQkAIAxEUUe65kCy/x6uYvlBJGdrys8rrsj46axS24hzlc5iykkjg0YGhQUKi7D0wCy2toytkUFbFqhl3dpPb7gBFw4nYG/pwkEAAAAASUVORK5CYII=",Vse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUklEQVR42uXTsQkAIBBDUUdKE5Dbfw9XsbT4SrTWMvwHNtc+f1bpZW9WH6XdagIQ5IEgTwR5JsgTQZ5B6SG3rEuy/r7IVQ4ScpCcZ2JZp/3zu5zXgS7u7NUk1QAAAABJRU5ErkJggg==",Fse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAAAVklEQVR42mMYBbQGFveBUAGrjAJIDp/G/1CtmNr+49OoANNKSJSwVkwRwloxeURrRdVGglYStSG0wrRRoJECp1IQOBREB2UJgPIkR3kiJ5ytRgseWgMATF9z6XfvbIwAAAAASUVORK5CYII=",Hse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAXklEQVR42u2UuQ0AMAgDMwpjeP9FPEpSpURXIBqEW3QnJTxnMzCyrEirIcskuLIixS8J4iu4wgrGSYE4KxBnBeCsAJwVgDcI4Antn8ht7B8kHuXyMpXXuXxQ9uwOzAM7WYQ9cx+9ZQAAAABJRU5ErkJggg==",zse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAXElEQVR42u3UoQ3AMAxE0Y50xFLt/blH6CoFBUdSRfk0OXjSk2xgXyd7Jrs06kPZUxy6n9KoDbczjqg5ouaImpsCbopwCdLQNzyi3h1Rc0AXuSng2fF7GOdt7JkX0ZIxdc7SQtYAAAAASUVORK5CYII=",Qse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAZ0lEQVR42u3UoQ3AMAwFUY9kYqnJ/twjdJXCY22lIwE+aumBDxzTdHird8ZLlavjT5XXDUVcKyMkBaMoGEXBCEowUJqBgpEUjIa2gdiGrRTDVpqBUoyiYBQFoygYSa2uz8c27386vAeBDUCR9tPLHQAAAABJRU5ErkJggg==",Gse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAaklEQVR42u3V0QkAIAiE4UZxjNt/EUepAQQj/gcJ7l6NDyLT5TjOp1EqFe2JUCpf0a1UtOR+RaOwlypgawWwVxKwmKxIJTnbkICtJGcBCVB6/YGHAi013Pz8m/KBMjj6+JDm68SL13E+zQEG7pSR0NaibAAAAABJRU5ErkJggg==",$se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAf0lEQVR42u2Wuw0AIQxDb5SMkf0XyShcReUiCEcyhV8HRHkSn4TPGGNeJisr4ygysrJuBGsr2vTrRhBbQURRCozgFf0qr+hXeAXOjipwZlSBo3EFpJ9WQPppBaSXC/gt0h8yf031D40vFfpix5drdcPhW6a66fPfFn/0jDEv8wM8pLU5jTCtSAAAAABJRU5ErkJggg==",Wse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAATElEQVR42mMY4cCi3uI/CqwnpOG/gwCC5yBg8Z+gBlQ+6RruE9RAqqf/k+Z9hAbC3kcoI8n7Fg1g6++TE14Dr4HyRNKAFg8NIzxfAgCNxkFFqjlEcwAAAABJRU5ErkJggg==",jse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYElEQVR42mMYBUMUmOebv7f4jwotC4jUDFSsgCaiYPmeaM14xOiv+T75mhGAsGYyQh6hmYyQR2igIPCADlUgW7NlAdR39ymKtpGp2fw9ZjyjaSYc8gho/t6yYLTMGygAAH8IUaHHlf3eAAAAAElFTkSuQmCC",Kse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAaklEQVR42u2VwQnAQAgEU4pduKnmrnNLsATzCoHkCCwohOD48zEP2cWtaSrAUEc8xjBYkUEWW9mdFQWx/4nIeFEOiKQwIJLCgOBOXy9Sh6SIMGHnSd9EXZjvitTXyaYqfIXhPuqY/ZSaCg4TTWFO3gW8PgAAAABJRU5ErkJggg==",Yse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAd0lEQVR42u3WwQnAIAxGYUfJGG9b3cRRHOXvrV4UQVOkkJf7R4sBTVEUfR1GRcPJ2C6a0XTqLiqEDf9A6ABNw36ENtoxuu4+6r63CLnvLULue4uQ64r1L/NG+7E0P9QoB+i6QC+j92+CiqaTd1GjTMiKxesjit4e1v7NQuaRc8YAAAAASUVORK5CYII=",qse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAiUlEQVR42u2WsQ3AIAwEPUq24D1d2CBsyAiM4Ehp3CRQICcR+vuS4hDiwUIIWRfsqcHuk1o6ZA49YINkmeHa/SYPYINpkxlgsNE6BR8LKmqQwPm/IKjdLghqtwuC2u2CqKsbL/DjCBQgw+CpAe3WkpoL+ABSQMFbo0yG9aNF5tDS+3CQOXATsi4nQF79P0iJRo0AAAAASUVORK5CYII=",Jse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAWUlEQVR42mMYzsDiPqka/o9qoKIGy/NWBggNpgaW5/EohiixuG9lANIAYZsC2URpsfiPUE6UFov/YOXEAiJNt7hPkjjIow4CmKIOAjiD2KLB4j9W2DC8si4AX8gxxHMz8CAAAAAASUVORK5CYII=",Xse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAZUlEQVR42mMYBVQFFvcp0fx/VPOoZuprtjxvZYCq2dTA8jxBbTClFvetDCCaYXxTIJ8k7SDNJGtFaLf4j9BKsnaL/2RpJcOvFvcpkDd/b6GAR6sC3ni3LLD4jxuav7csGC2aKQAAuIQ/E3fAGfYAAAAASUVORK5CYII=",Zse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAc0lEQVR42u3VzQnAIAwF4I7iCF7EZ6dxY0dwBEd4PUkohf4Ye5E8bxI+Qghks6wa1FkQDTLIoL+gVHZ/hYJP5SMUPGqnQPkLnR+hwDMzTIEqRihQGBUFqhnVbFBVNRJw0orGBvfAuHcdZVTw7sWGbEd6hRz7TEr5P7UkYwAAAABJRU5ErkJggg==",eoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAfklEQVR42u3WsQ3DMAxE0YxyY/xtk008Cke5tAFhILLPsBt+dQLxSomvaXooiroeNR500EEHDd4ltIciijqLmkIdRRQ+i+qXxbjfxizGnYxZjDuZs8adzFnjRuZsTFLUDlso+GExDuZuRtHfKR1DN7x43uuo+CyRG5qFcLqhL2LWstL/J6ZmAAAAAElFTkSuQmCC",toe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAlUlEQVR42u3XwQmAMBQDUEfpFk23cwQ37Agd4WsPEhAEg37wkPxjP3mH0kMXx3H0oKPnAoEwYMCAAQO/A9CPKXcAyjx/CwROggDr4y1QSBC4nnxEEBDqNeIEhHqVmIBSrxOBSKgnMYf1CURaPYmP6mdR0j4fVOZ+PlAHAkW4m2hDArAitGnboqVtdTwtrwOrvzaOc5cdHmfKcWKAGEwAAAAASUVORK5CYII=",noe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbElEQVR42u2OsQ3AIAwEGYURaBAP03gUNkg29AiM4Ag5oX6qSFHOhb84Wx++Tk71QNzQoejQlmg9J98tEXoZEM/o9WTKyPx850iXgXgm9AmkDFr3/JrulEHrDozW1wGveyUY7CkGha3R8LPFBXpRPcaBDWWgAAAAAElFTkSuQmCC",ioe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcklEQVR42u3UsQ2AIBQEUEZhBBri4TSOwghsyAiOgDGEnJb3KyUcBbni5fMb3MrXEgMyvJXWVFD3YKIx9Jtcos6RC/QJUkGWpvZ5o8MLlM/tXaJsMmWfjzLbKVMGzUSJdUqsU+6Mdp+xOw6016nrd/tlLvZ3TaZaudTUAAAAAElFTkSuQmCC",roe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAgUlEQVR42u3VsQ3AIAwEQEZgBEZwg3CoGIUNGYkRMgIpkPISVeRvUvgpEF+c7Irg8XxKi9o10UwWnWXorEIzWfZdhWZCAEUxeLdoYs4ZrqHdNM27DuhkXAoUOgMDimTQUAw6Z3ZYBtAiGUAkA4hkAHEMoKlrn3JnQXec6V+P59d5AHouXMm2XtoKAAAAAElFTkSuQmCC",soe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnElEQVR42u3WsQ2DMBSE4YziEeg4U7FpshEjvBE8wotE8wslSEg+GuRzY5+lr/Br/BoZeWqWSasVVKmbUqlQsZEK5dwUsA5yx9jZyOPJRtLUrZOsTeXYzk25TB3kvt5/+rVvPB9Y+u63hKXvJGGdJGzaSGZuJxWPJImRJEqlkQQ1kqBGEtRIghpJUBakgo67q2j8kufo+LKMjNybL+jK2Yh7MUteAAAAAElFTkSuQmCC",ooe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAmklEQVR42u3WsQ3DMAxE0YzgEbSFfunNNQpH0AhMeYgBIgjiA1zw1Fgs3gEGC706nc5/YZyHEWeRJIvh4YOce26SYFh4gqEvC3+5OXhNWAZe07lJxk18VXAe9/BR/SLT5uhm2RwDf5l4eE0tvObNN2/n65h4hSRNvApMvApMvApMvApMvAp0PnmCLE78sKYF/6WgH9OdTuepeQNOnQW06ZxtMAAAAABJRU5ErkJggg==",aoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJCSURBVHgB7VRLTgJBEJ0ePhsW4gnEkIA75ARg+IQdeALnBurSFXgCdeVSOIGwI4GE8QSOSzeINxgTWPHzPegxbc8g7thQSad7aqrfq3rV3Yaxt12b0B2VSiUxm82esTwVQoww26FQ6Lbb7Y7UuGKxmDdNs7pYLCx8xhmLuDM9ztQJAG4h2On3+4Ib4HqZz+eDUqn0RPJarRYH+B38zwD/QnyWsVh3uFfHC/tKEiLBrLmW2TQBbE+n0yusB5PJhDGdWCx23G633Z9MTdMBSU7H81WwXC4dyqP6SASAD/yLy5iRCk4DOCX93EoAI0FVdUCSOqarcDicpWwAupQ+Q6mg6lX+JwH0tJkhm+iBA9DyGsghSSyPxIvlXh3P1wMaCB4AUEdjM/hcgaMHOQC9wu9i3YhEImdsfqFQGLE6jNsgLGFsMIAN2HAvc5CxBwn520W2h/JIr0h7vd5xEI65iYDgbCqy9BobV/656pqSbsIJBTmRrWWsLxrLfkylUh2AvON7dbpwYm7S6bRLiSgnXCfJZFIMh0PnvxXUsfEaZTcxtwgEqWzKQGmi0agtwVv4vjfW+teDgHw94IlApk+qpvA14LuQN9tQwBtKzIBE+kkKqiCP0VEdBKIUbCgH1yo4Db43JFHTwXwE8qn4pSXfH0xHbKgcGZ6gX0Drp+JgKwFPBAFWpeTzCV6m8Xj8AZ/A+5PFHcjykaNM5XL5ziPCvgxIvnwJ6w5ukBpzI7NtYW6iJ05AXAPLHGP5AqNH5/pzvbfd2zfyzFdqevpDyQAAAABJRU5ErkJggg==",loe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK4SURBVHgB7VZLbuJAELX5bEBI3GAckNDshtwAxEfsQk4AOUHICWJOMLCa2SU5wTg7JEB4drML2SPiuYEXwILvvGd1jzyW3ROQsqOkUrery/Xq12Vr2pnO9EGkqw6r1WpJ13UD7KZSKduyLFel32w2s6vVqnQ4HLJgZzQa2VG68aiDWq3WBuDX/X7Px8Z6vf6ez+eNQqHwOpvN3IBuMZfLfdtsNiYAPxM4Fot1INPn8/mvMPuJKGC8fAvg6/F4PPWQGw1jt9uVwJN6vW4hA13KF4vFPXTb2PbT6fSNzIrI1gO2vaOA8VIWEfyNbDAYOFge4YANcHO5XL4IvWcAXgTLkEgkHOhFmddiWnTELl42gnLhwIuoo1fLsNpvt1u+654C/BNLKShHCu+xdODUJRkR3wpZkIrgqXYsMAxa4KsgKGTteDxeZuRk7ikLgtMhOP90NDCvAtPNJgkDlXph4LwR0kaU/cjmEtRlZ6KL79i5ErRSqbQg7/F+47qZkD2h6cqi41+hSwe6KsMx1aGI2oHxH/5IcUdNLGwsDpeejBzLNXUhnw6Hw8eTgQV5nSm61CN2s9wzarmHc67Qz/7PqBJYTC92J2v4wCEiwO7ADkGQXi+lYsBMkI0bPsveOIkA/CYbBYY6fJbgfqKMZ9AxJSh4orIdGbH0WNYK9e7xejAqP7iMlGfQMYWu7bcRRqqR2YKxvl9GwzCmCfAyZUFQHz3DRhOrHWZfNblCJw8B6BDm+AQNx9HZDwGl4zaWqyj7qsmVhWEnKOc3F8snNJHX0eAvYXWHY46/+98NTPJ/JAjIyYTP4BvAdHyRLlH/Cxj/zXTzzO9AMpk0ROeHBxZ1wC7mvMVAsMVfiMHBgLULwH9KIBqMJWjh0Rs6yEgpovZqYAHu/foA3M1kMu/69UFGisJJ5a/Pmc70YfQHAAu2TGqVhRgAAAAASUVORK5CYII=",coe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANMSURBVHgB7Va7bhpBFN0FLCHZkskPONj+gOAu6UB+yJ3XX2C7Sxe7S4epolR2unRAmQrcIUCw/gI2HRVevsBYAmSJx+YcMiNt1uzMOq250tXOzty598x9zRjGila0ojdGpk7g6OjIms/neQwzpmk6+Dqe55Wbzaat2ndwcJCNxWInkLXAae4FF+r1elW1L6ZaPD4+TgNMBcMrACD4C/A9FBcPDw8fCHYZEHAbwzz29ieTSY57MS7MZrMby7JSKptKD+3v71swfg6FLwwD0DmNgu14PF5IJpOD4XBYhHwGHrlY5kEArWD9rtFolMJsKj0El6eg/HHZGpWCt7Hex8nbAPMAY/319fW9sHBi/cnQUEK1CDcPoCRtqMkTxgYEX61WB6GCnvceH1elTOkhnNzGJxMWd4TgBkAshCxHZngxl1eozGxsbDjG/wKybZundRCOTHANOVSkAYQoV6vVXDISeA9zllj7h5iP1KXyoBYQCacuG3+TNwjGRK7k/AZ4gOl0muNaEBT0nAldans6gWw2m1pbW+vIymFIGCYkNL1hiBBdLk4Xi5XQZ664J5FIsPSr2FNg+2Diswh09uI6Add1n3d3d1kdX/BNAcxnhOlTt9t9Zg5h/is4SQbojzs7O2ar1aptbW39Ql795D+K4xv2fe/1eo7OntZDkkSzy+Dke8wXMceWEEz4AbzyjgN6BiHssAKjeIekzSFJEco/bB/bgRtVPhIg0ZWZvGz/bV8b+LEEwCJxKUNZgFnIwJuXRgSK6qE88uEUobjlxToajRag8H8tDA4kYIRmYZgy4hK+5Tx16O6xSETvBEsY/yVwJ8wA5Snjn2MORvGS1kM45RlP6p+DF87x+S09Jec5FslvChk/0UsnhoaUVSarRFZNkGD8mg2P1wb/kTN8qtzLsC2Rf8TVsa3q1koPAUwan9DeIXKozOQVCXwXBkaQPR6Ps4p1NSCWuqpkRbg2ISPD5mn0PflkXw9IRXwZIoc6GKYZBnHbb/MlKdrECwKYTfYllV5lDvFOgqEO7qhThMLBfxqdmre2TM5C8DHGWx3yN3Id7HAvD4Bxxd/pXw1IGsCp5CPfxb1ks/lFeeTzfQSvfJB7wVe6R/6KVrSiN0d/AH0Fx15/laFPAAAAAElFTkSuQmCC",uoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQiSURBVHgB7Vi9ThtBEB5sC6UA6XgBgqno4nSk4hA/orx0dDFdUoE7OttdUhk/AfAEcTrEjzieIE6PiN8gjgQo4c/5vvMsHMedb7FTUPiTlt1bz+58NzszO4fIEEMMMcSLxIitoOd5zuXlpXt3d9fO5XKtvb29lvQB13WnRkdHCxxnMpmm7T5WRBcXF8voKo8Wjoy00FWz2ayfpowveX5+vo41xU6nMxX5uXJ4eFiVQYmCpIvuWB8baA5aQft7ZWNjY/VGo9GWGIIYboTkKePrs6tz8yDrSw9kJAWwgMce1tjBZu/RuOkEN8fcriF6cXHxfWlpqWjWLS8veyD5U7on4Si5YK3ZB3vXVdxN45FLE4AfOdiQw5PwvFrAX1lZqdze3h7rkW6D7BzGDnzZU1HKVeMsRh/l3mivZVCiBlQeN6/+mYeL8HjLkCvqT20luJW2Jwj/lhTYHH1T+zcpcr+ebJ7JtKQ35rRvpsilE4Uf+tp7STI4bkb0DoYO+rr6Ho//q1o6ae/CfyN6cHDATXiMjmaAR2DqAjFzvFXIbxwdHZGcSTk1TW/RdS79mmlOdQxGVGGisxwlKQ/5tQR/NGPRsSFbiZIFwQ86TM2h1kRvbm5oMVrVNVblcRuSOOK1uKCJkl1YWAjIIVNMmaDjhSEWsL5CQbAiXYv6qtxcAlVjSbVa4JMIpJ39/f1SZC0t+RYkOfbo1zj2NRv9WbHE5ORkE8o/YjhDJWivIiRr6DZ1/hXIzE5PT4+cnZ35bPl8fgLEZvHbKlqBvglrrp2enrZt9Nv6qPi+H+RFfWT+a4R9EijGLFs3Aw0wXx6u0upzChtrogSs0Ak9OvJMYP39mqQLJAnWRBkAov4nGli4z2shkbo8JWZqAZPGCrqWKLNoEUtY+yh8rAZFLgMA7ROmVvkMPxT44EnID+nDf9C+wDU2DUnRDIHf30nXz2eurq7+cp2NfquopzWRolgJCYrmPH2LlRKIbqtIYk0Zk2u3QqVjG+VhPloexsHKorSmdCOVKSc4TliiyaiWbol2b9keJJkhPuvaFuS5ztqqtj7q8g8suBue7HX7xJCsRPY069bFAtYVvt7J+QQZBlkQWFqcSKjcKyWVeljHiosBNXiFL93PDsJPElAi82htElSSbSWQWI/ipb5FdPRP1JRiUP4jRS6uXu1JwLbWJawrfBCJjUx1DeZIV+XqKFLY0/dqLF5wVc7H3ULcUz9zUpFKlN/x2FCin7mGoGig0YfRSsgKDT6DYFNfIEhtkOd8PeKLQYVv8ynSz+eyKLnw528d+XArmg/xzwYHeXeDtWfoRSljinFP51KDyfYfEBWJFM20INNVHMEoeGHgS5UVPd0h6rdxqas/okbZ9fV1oARKm6imWtIH9JZj4eyMj4/7NrfSEEMMMcQLxj8MATI6ZUh1mQAAAABJRU5ErkJggg==",doe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVgSURBVHgB7Vm9TiNJEG4OkG4F0nmzS9AZkIiH8CIG8SOyM9Ftdr4nwDwB3iewyS7D+wSYDPEjhifAD4Bgwst2TgIJIcD3fXa1aQ/j6TLeDVbyJ42np3+qq6q7qqvaxowxxhhj/FAolUoFPuYb4710JzSdSPju7m4HxQoeO0mCpzUxMfFlcnIyOj4+js0QEJplFP/AE1i6oBfjFc3MzOw2m83ER8crACe6v7+/arfbRfPKuDGvghiZuAFBPvsEWV9fD/HawxOmmhKXJgWBEMs+IX4yHoD5GpkXzayenZ195DM1NTWP+m2uAPuhXH56errd2Ng42NraKqbpsA7MH6J44TAfYfzfs7OzH4UuPieWORfnxApVfPx5VwAM3ZIYGR6kXTL3/PxcRb+/pIpaq4Ohz0JjB21V09Uw2/bBdH2QdmWVKGhCwcx7BcDEASa+0hDKEkQ0GZtXjTehiF2NvVjFYVXnoyga2H8qjwgI2D3ZMgoIY2VMHmFsTeyGDzW9DSVERgkRnCtfxDse1C/XBjA45huaLJohgMl/M/1GzvKKGQ7WK+Uace4KPDw8JBDCXYlciMei5stStSuM0OtUsTJFrXs03ZUz6B/ndVIbMb3D6elpy8P8BfrSp/dtGRolxh8InRaYWs0TwtoebQhzzpsceN0ocMkfECwN6kDjlbMi4KRYtWV3v7OMM2JVjDpg3yxX6yCQd2Q88AqACRtSXBnEPDzPhT0ryGiWl2GdI0RnzCAhHHd8aUYVAG6M24bLHYp/7oHbRsN8jhCH6fhHhApl+zTMqALAB3cOHvncc9tkz79hnoLiucDzFU+bZezrcoYQAU7bQ5cmhLJzREYBjQ1wFeomtQp41+yeTzFPBmy4YLUbou+BtPUJwbbNzc0a66l968EYVylYM5OaTnEcPywsLHwQpoqLi4tkrEqhYLC/W+ZFy/UcUiHoXN7c3MTX19cJ6HCPfwLTrP8P7z/xTaU0Tk5OvhgFVCtAuKsgcQ3RF306xpeH3jakWwazu/Jpz49Eq31CLYDYgiVcwMT7cI9pbYfGj8D9oKGC8X2nan+Y3EItgOAXW5BwIQ3NCfvmVIcy2uadUAsg7s2Nz0swynS8rgn6IveDobbQtcLveA65PqgFEPfGrdNgEiLVtdTZ4N27NgEixOtUnbFNzuG4Ui9UAqTdmxwwltlDqzEJH/KEsGN7J7hx7Im5Ats4l3YVVAJYjVD71sAwYVW0WXDDAqnnCkUyPJEy09Gqy7wN7iBUZyuStl0htHvTyQ5Pmk6D0sowDAuooxYDTSiRwfybxN3NApF2zo+c1PNwkszqzdUJXSvOh1UUW74ALYt5CpxmUEL2CA/D85KPP80W6kShrvG9Rwht1Co44k9eCD+MAKG8B7pIR4imJOJXiG96k9NTsc5JaJbzthq2ZVOK3jQ01wZkj381ylsJYm1trQ4md+STBp2A8c6JzVUE8xVNSslIFq/CSLcSYD6QiWOjxPn5eQWTk8FOHgzmbRNdaNXoEeMJRrqVsAATmhDBRZQSOhlGCXaMppNvBWIsofpahYaK/oztS6L5SJo6+QA82orm/lSgugnxngN2L5ruQRRl9cm4ve5ErjZalTxhz14Q+y6CRRG3LPO+1OTAm9DYRAaThkxAkIz8a5mem5v7hPba4+PjP6brrX423evDbSQkx5YGxrSWlpaOIAAdAe0qeHl5qWBsAJof0JYwwRGFdVYLxV8pKMYe5fHnXQF6ounpafd6nei7ChdEpqv1KI9exkVwNmPKk10VSogQ3A4rqf8JeDYc4chvKG/behBBQhGk9weHUdxej4Tv9ReTpW3GGGOMMX4o/A8/d5fiwsx9TwAAAABJRU5ErkJggg==",hoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAX0lEQVR42mMYBaQCi3qL/2CYAGTfB9IQeB+3hv8OAqgipgYgjXg0YCoHYnwaMJWDRQlrQCgnoAFTOcj7RGkAKscPcFtukUCqhv+Ua8CMOARwEMCnocHiPxbYMJppSAUA/lg6pUbWw/gAAAAASUVORK5CYII=",foe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcklEQVR42mMYBUMUWNSbv7f4D4b3oSL3QTy4GD5ged7KALuMqQHIGLyagQoUcGkFYlI1I7QCZUnVjNBKsmaEVhI1I7QiZAlqxtSKACRpJlIrAV9RrtniPiWa/w9azQ4CuOQcBAhpbrD4jwc2jBZaQxQAACupT1v2lEWwAAAAAElFTkSuQmCC",poe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeElEQVR42u3VwQ2AIAyF4Y7AKF5M6o3NZENHYJSqF94Nap4kJvZvuJTkO5EgUTQj3dXa1Lat2OKmm1pO0m1dbtYBjZnrMBAYEQoCQ0FgKAgMBYGhIDDI9Y66DHoObQcYAkLfhrS+Bdm/oZxkUE4eqKg5psSnFM3oBEOXY2BCt6VVAAAAAElFTkSuQmCC",goe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoElEQVR42u3WsQ1DIQxFUY/ACGzBS8cmyQjZICNlhIziERjB6b6L1wCmSeTrEnQkJCSQLMuucG8DBh+9VhRG85pDFbaAmsw0txEVegJlUuMokzWMMikSRpkMo0weQZkUaQPWyy7KpN/cuoEy6eEDXT8+k9Q26uRR1MkAGiiKtjf0KOpXKtH/QduAzUwbK8/JAwqbhW9POVkvqL3kPyn71b4aE+4s3EDyNQAAAABJRU5ErkJggg==",moe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAi0lEQVR42u2WsQnEMBAErxR3oe3m3cmXeiWoBH2i4EGG9bE2GLNzmZBmEEoUxhjzZPBpHeNvcq4nxsF8o8Aq4oERVc4dwoZUA1yfWoDrNynA9RFSgOulANdLAa4XA0wvB4j+jsCqn6t5WWDqFfi1XxPQ36Cy1wEHVlrHKExGFezIs/rWsfujZ4x5Mj8CpOyFH0yCKAAAAABJRU5ErkJggg==",Aoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAkElEQVR42mMYTsDivsV/PPD+YHGmg0WDeYGFAnGKFSzPW+y3aLBYAPRdPT5P34fzGxBaLQsImG8ZYLEfwbMysHxPQAPQKQ2o9hPwiXmB5QQU/nsHARxKEY5AKLFIsNhP2NMNwFBSgCg3f28WwEAYWBZY3Dd/b/7eYj/QhvtWBkTGBsRhpgaW5wc+ed9nGLYAADQwTxdfB+DfAAAAAElFTkSuQmCC",yoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAl0lEQVR42mMYBWQDi/sW/4mA90dGaDgIWDhYOJATjAoW+83fW+y3PA8M0HriQvs+XOt9ywKEMRbzSYu+BGQ+0P4EYrU6WOzHFCFWc4NFA4bYf6I1W07A1EyBs83PEx/a9y0DMAKQWGBqgBpVQGMVSEwkFvdBicT8PSgAgWwFUlOZg6mBgwCITUg74TjYQIeS5P5oCTtYAAC7JmXu542gFAAAAABJRU5ErkJggg==",voe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAv0lEQVR42u3UOw3DMBCA4YNgCEbR/N4OQiGESc2gZZAwOQiGYAiBkFZpOkRJpdrKUsmf5cXT+V7SNCsyc8HJLWNb9Fg3Mb+u0UsdPIah6kTUhSsWEl7KhUSUDSL2e/nz51MhyU7FB7HL9eBVMSnTTepkR12YpAzzt/fiiPBHlSyPaCQe9tUgZdCwyxKejC8p/4K4bUB1IXV3qUEk0+OXWG7LmGR1tWMyrrM2oO8o1ckZwgOTczDS/83yb2u+qfIEGIZ7p7X9JJEAAAAASUVORK5CYII=",boe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA80lEQVR42u2VwRGCMBBFUwIlUEIumh9OKcESKIEOpAPpIHSAHVgCJaSElLCO4x5QcmEj4zjm58aSN5u/u4kqKvo9IYAEK+wCLeXIERw8Ox/shDYfWOO2LhLqPGQAmYj+iTlotI8vNjZ6e0txw5gJZGdXve0Y+Q8JFC59VFchgI4nJRE8yHapiOlA9iqC2hmU9g61eKZAIEHsG9AAgktFGg0ys8zTAWSHZOQCgt/WUmFRDmp0eiTgBFDOlTt1hfRKLp5832gGnk0ELfMUO/u6TOT8M2+q0c58P3k4NiCNlWtfbK/Up7E9atkTHYTDWN73on/RHWseH0rdX8tlAAAAAElFTkSuQmCC",woe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABDElEQVR42u2W4Q2CMBCFOwIjdAT+GF/9dSM4AiO4AWzgCLpJR2CEjsAIp7xEoyhoPEgM6deQkCvc612vl7rM/4AENYy0uEDeosy3SLE9IG476PWJqOHdnIR973owajcXqOkwooLvY4HgTMvp15OcnuYr2prBX8J0HecQSHT/wqbkt+JMcP2hHZlrmCYbiFBUY5UFDZ2z0Wdaiqn0GgsWCv0QnywYQWihu9IZmFwjPJTyFlgpcbzCEO09qHsfAzy3uDIftHCAhm5XvnV/sp5kcus88Pf6rxmXItFmBw0oHVrE24L4NqOEx/mhZUcIbWaJ1wYnm1KKwU4ktxiUyHejNdyuk1Eg36Azmcx6uQA5LzWzouf4jgAAAABJRU5ErkJggg==",Soe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGkSURBVHgB7VRNToNAFB6gSduVHqBpWHQvm6Y/G+kJWm/QnqDeoO0JqCcQd7pSTyArgju8AQkbl7qDQMDvNdNE6cAUN7rol5AZ3rx535v3x9gJfw1FpjAcDk1FUaZ5ns/wq+8uKYqPfx/bjed5wa8ITNM8j+N4lWXZHAZvILL3xvr9vqFpmoHtCkRP7XZ74zjOx9EE3PgLLr+1Wq3rsstcb43tZbPZnJTpHWA0Gln4tkU5eY6Q6UU5ZPZgMLBEtlSBsk7xhkfr4lmj0bjF2WNRTq/EMqd8SQmAFT5hTGH8CjlZFOWkS3nCN5MSQMlQVdVnAtAZklsWZxsOTKUEUDJc1z0goITibAmSrcg6rzBdSlAGHrINSM5YDYgIAlGlyDAejw3efNUECMEzljmrCSTfoA6XElBnQnFJMWdHguvuqk9KgGQ5WO6iKBI1TsBf+AM0UkgumkuVowLPdqrmDOmRI1S+ZaNCE10MgiDq9XoPIJikaWp1Op3PbrfLwjB8p3MqAsiWSZLco2deYXxRa9h9B6+oNby8oB7Z+0AhoXzxkJ7wj/EF1FfPKWTB7NAAAAAASUVORK5CYII=",Coe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH1SURBVHgB7VY9TgJBFJ5dTYAOSxJIJKEXK6ACTyCWVuAJwBPsUlkCR9gTqJ1WLN124gncAhI76VhCCH5fHBqyM7srsTH7JZMZ9r15P/NmvocQKVL8NxhJlFutVj4Igh6Xu92uahhGHvMS84wD67HneX4cW2YcJTpsNBrD1Wr1IYMd5HK5MpwYnPkbTs8wT2q12pD6UTYjM67X6+c0iIyeM5mM7bruMkLXxmhiXOmy1zqWR/uGpQMjtogJBEDdTjabvVQFeqIzUCgUHjB9wum9SID5fO6WSqXyZrNpLhaL1zAdZY15bKhbG8uBQt5F3b9U9WRZMHVVcqVj1LSPydXUyUVgT6qj5HfYGKNU/TD5qcKogNELociWkAHdCT1cDCtMYGocV3E5Zio5jnqCo34UGnA/sq4mckxy0D0dGL2Rd0AJ7odOshqTkXREoAtqD+5HAstEjkmBuBhVcQS4HwnMEjkGphgtcRw6SOBdJHGMGo6wqReHd8Mg6ZPNZJTIsayhg8ZgqXT4ToUaFvldxQNayqxUKt52ux0Vi8U8aHB6KMe3l7B9yJbBtnFqt77vB2E6sbuT+CGDga7jsCzr9dqSz+z33enAoA2D1zIAh+TAcsgOxtvfhLxvmqYT1T5jO96D2ZPDSaeH/0AgnvJCxnnfKVL8Kb4BW/D7C5HPNCIAAAAASUVORK5CYII=",xoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHqSURBVHgB7VbBccJADBSGB/xSgjuIPwzwwqkgSQU4FZAOMB2QCsAVECrAfIAnJbiD5Ad8IKuxmMlkMtadfa/EO6M5sOW7PZ20J6IaNWr8MzSoBMIwvDsej5HnecPr9RrgkS+vMrEElu73+4wsYUWIiZxOpzF+Ro1GY8WLgtDhtnC32w1arZaPZ0/4O4LFeDe1WMKcUL/f9zGsmUCn03lJ0/TTwD+GDWEPptEyInQjg6i87Xa7GVkA38aUR8uIlEdmWMMSWzIMkIh5IzwHHzlVBXY4gc0Vn2gwGHwULdjr9ZYSrUJ4ykI+5XmgJSYn93tRXnHeYRhVihLvXIuODRDFGey1yEfLodHlclmRO6SwsMhBI+RDVzLFhyO5xs6Xmh9LBuyeqhDabrcHxYfa7faziGEhpOx9qkDICJpI2kAjlEmlOYHMlVFZQhC0A5I6IEfAfEElQiCzaTabITkC8uyR8k6gHCGI2YIncSH5clwR5aVfjpAka3I+n12I4wQ21S5YtcpQ0jNuwjSFlQv0V/B9iCHki5YUWLUfsIVtw4VLdQyyvBmj9sO6QaM8B9TQS5s7l8py26D9IBZTng8LbmNh2U3NmbQQGIpyJ3zkNsJZqsmXaIWUd4I+fWvy+b7CuOEKdangNWrU+LP4Agiq2SmFep7zAAAAAElFTkSuQmCC",Eoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK4SURBVHgB7VfNjdpQEB4bCZC4UII7CByQ4ISpINvBshXsbgXZVLChAqCCsBXwuPB7CB3EJXBBQkhAvoGxggj4jY2Vy/qTHu8Zz4w/z5sZzyPKkCFDhgyfAg7dCd/3y5vN5gHLJl8eDoey4zjlo3HHWeJ6ieVoOp326A4kJioEn0HkJSRmQYDRA+HvlACJiNbrdQ/TEMOTvwwIf+z3e1MqlQJjzIpfZL1ee67r+hiPuF85I9wC4YBiIDbRWq1WwYOH4sUA4wkPNTa9RqPxALLvWHrQXWG0xuPxkpRwKQbYk2ck+8VisaohyZhMJgOWZz2OY4yh7IwKsTwKw7/ptN19EGxfk2HPYWqCSOfW9sJOD9MjRsDkOVTIArVHYfybkGTjL7fkeHslwX7ckhH9gO0hIW/aSkQUaPMPCLxGeQD3P2RpbsmI/pPIP3PikQWqrYc325i6XBNns1mVUgLscuXw6ZSQvShZrUebR2HX7VOK4JJ2bj8KKqLYnorMxibL3peEsiKXyxlZ+jZZFdGwWOfz+SBKTghyiPyUcIlEaE/zZYtVR21lpFAoGPqbRB4p7XFdtclqPXo0aMtOefCIlNBkewhtjB6Jbrdbj1JEaE86rEhot34kBn1KEbvdzueZ20GbrJao4R8Q/UopgrsqWVrDRUUUn7yBxKmPbPYpBUg3xdUk0DTVKqKcJNiejlx24yTBNbC+tHwM1UdEXZ7gVW4yAjo1Eu8RosHF/A9E36OTN99IgbhtngdP/JIC3QP5qw0Ky11r8eT4wiTbHEqwU9V2+nd3+Dh+vM7n84FNT2K7i8Evu4Jea7FYqDv8VM5MXF7w4D5/u/mzGJ6ZuE5yCcJ9rha+qAf0P85MF4Tf6NSpezZZ2eoOx7qmo7/E3ed6hjQg7LkvYQMjxJiQwRhxiUtCMEOGDBkypIM/zyxU9xl1WUkAAAAASUVORK5CYII=",_oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANESURBVHgB7VhLTiMxEK2EER+x4Qh9g8kskBAbOidgOAHNCWBOAJxghhOQnAA4Ac2GXxbD3KDnBuzykZLMe6E8akUoLneSZkE/ybLbbbtcVa5yuUQqVKhQocJnRk0WhDiOt3q93nc092q1WmM0GkWot/hvPB6/1uv1DPULPu/W19ev0zR9lQVgbgZ2dna40WNsOHEbNqKFcv74+JjJHCjMACXe7/dPIdWTXHeK7xswk25ubmZOyqqdBv41wOQ+u9wE9P3a2Ng4L6qRQgxQ6qhuUSLtakmANHX+GcqhdmUozSLaCGZge3u7sbKyciVvm8+Gw+FBp9N5kQKYEkQGOzm4v78PWqseMpgEc5tvwxi/Fd08QYlzDRyja66Jo3elTJlh1oCe498kRIJPT08HskBg4y15O1ITpqw28UWMoMGKqhpGd+Qb74yc7bW1Na+RYtMnENAeaXS7Xc77IQaYjhDVmvM2TYt0sPkzzmFh2zeea9Ke2IanOrEeJasNnGrdmtdvz4LaU5ttMmGZ42WARwFVop/nYgSOzRk2ccHCttjhxh4q7ZnwGjFUmaC6REkh/aaUANCka41RjkCzNWus5QjRsKjSGykJvM3ztGfB64UYmGFB0UDMDEjxUpt3PilOA3dNijuBNBu+sV4NMKpkDTdnZmB3d5eEEy2XYCaWAKyurmaTzdXrkW+slwEXYYYEWwwHMI8uMdWuSALgaEEDXiMOCiVC8PDwwPDgrywZXgb4GGFtcWmLgqMFLXq17mWALynWg8EgkpLAtwNr2F/mG2vRwB+tYykJzvtAA17HYbGBVBfdl5KgrzbizjfWywAf4GoHcWisXgRKI3a0feO9DNClwQ7a+nkqy8f/wNHiuk1ulA9vbSZ6SS0FKv1EP02Bo4kBhtCMKtnms8/qUp0bxByvJHXNW513YQ3bzReZhsQZSgQ39zNgTvP5+dl7lvEKY+wUkUZI+B2UlchnESClaxA6mjfDpm9tCiSRAumVudMqUjCf895aRVI0H5nYordJtCuTshJbDpp14MP9ONc9SS3yBmX4nU8tMhSBhOPp1KJ7cpaaWszjnTShF5qtbtM9f1hydxq59Dql/LWs9HqFChUqVPjc+Adem7wmngI0bwAAAABJRU5ErkJggg==",Toe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAHUlEQVR42mMY4cDivsV/NHh/1B+j/qCa20cBWQAACv4vmYxDnfcAAAAASUVORK5CYII=",Roe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAIUlEQVR42mMYBUMUWNy3+I8F3h8NmdFAGw220WAaBdQDAPaKOVEjGwheAAAAAElFTkSuQmCC",koe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAJ0lEQVR42mMYBaOAFsDivsV/HPD+aOiMxt0oGI270ZgajalRMOQBAAv+QwkAqGdtAAAAAElFTkSuQmCC",Ioe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAANklEQVR4Ae3UoQ0AIBRDQcb6+y/SUQCJryK5S+qr3gKAP81M7na5OAoogFRBSariaAGQoRcAHFaE5VXdndKhAAAAAElFTkSuQmCC",Moe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAANElEQVR42u3TQRUAQARAwY2lfxFRVgUXB96MAA78B1wVGb8xOb7AKdCDHtCDHvD3/h7YpQAOAMBhUzmUUAAAAABJRU5ErkJggg==",Doe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAk0lEQVR42u2Tuw3DMAxEPYJG8Ahugjyl4ijaxNpE2YQjaASOwgTpDP2AtAkrkrgHHHjg9q9NAieK47GSlnJ2DEUkvHvhibHPASNf5oxJGMsTpdkpeQjEijSAoEMA7x7BJ0DP7wzQnqV7HQO59UshzUIzzov8xNbBFeQDC4phj2OVdooVx1GyhNvRIKv6Con1x3/yBXoLN8OrFuoMAAAAAElFTkSuQmCC",Poe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAnUlEQVR42mMYBUMcWCRY7Dd/b/EfiPdbJJCiUcHyvMV+ywAHAQYGBwHLAKD2+xYKRGq1uG9ZgCpmWUCkdphWdO2W54nyK3YZPH5HKDELwC4D8jsBzebvQcGECcBB956Qzf/xyVFkM0V+pkloI2w4jy2ezfMt7pOawhBa/8O9Q1g7atq2PA8k71sZkJ2rTA3A2skElGu3PD9a1g0UAABrr0UWeGGzggAAAABJRU5ErkJggg==",Noe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAxUlEQVR42u2VwQ0CIRBFLYESKIHLho+nKYUO3A6gE7YTSrAESpgS1ujGRCWSwazGA+/IJC8fmIHDYPBNSCEgW8ZqGRke+iONPVlGApG6KQkLCny3BgFlMi9rGgWhT+NRto3UKjfLNfquqZmMY1LyPKlRXRClogxqVAlZKLLN8KQcSxOtgvo+iX59RojNW0vw4hmzfDTNHpPi5ned3T1viLVqMiiuyiqat6fpT5bdfJX1qzT8w3sUt6ZoquTsrnLn8YMM/pwLkr1QgRDjRCUAAAAASUVORK5CYII=",Ooe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABE0lEQVR42u2WTXHDMBCFF4IgCIIvHb3NaaEYQhg4DGIGLgNDMARBEARD2EZKpgdNWs3WneSip5vX/vzpd0Q9PT1PIy6ceUWCQpF4xXgYiCns0KqlA2D4h9+GEZ5u+RgwPp5NB5AcIXWFzxXWaPkp7mlVClas0AWKRFUq22T0LCaefknYja48Q7E0fnyB8mwx3doWp8E2AKVr4pprWHm3mCrU8NYbTTm2xxQCDdE6+5cGdLHOvuSuiWvtuNNAZFxU4drwXM17P+w/HxqYoLe6J2swQqFY6k/F8TVX+A61Y4ttwgIRl3GQfGgXy5Qrf8N6XqGo2wYPfwCbT3ueOd79OPIMoZIG1p6XYIn+H5v6Raan5ztfNN2z2B0wXg0AAAAASUVORK5CYII=",Boe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABKklEQVR42u1Wy43DIBClBEqghD0tb/ZECe5k6cB0sO4g24FLoBRKoISJyFwi5YMNiRQlvDmOpfcZMWM1MDDwGXAaMyISGGwzovUw6lGAQQRfqcNDSOyvzUU1LTTBCCFN+C8UlMn3qp9PoaxOX/oSEsxd6sHg2yoRpN+cfQkHQd0B+RJU4yxwKIOsulzBiE36weC6NqeLT6f35+9Ffx20SJA7gQj+njYRTE0hFeM/X5vDTPsdMLjh21ciSGCYrRFRfr0hI4Bp2fogybdcAKbsdNeDrIdEa+dCqS878rV1bnPz4SEvG//+OkdQ7UC4dRydtiv4VEm6zS5sFpLzk0l/ckgRkLop5DheqQhTuv0UMnCPKF6QEBGclk6Fog/vSaHUcynS+M0eGHhXHAExm9Ltn1jBRwAAAABJRU5ErkJggg==",Loe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJElEQVR42mMYBZQAUwOL+yQqNzUY9soRGqyAGkawltEMQi4AAFwQFdwZM6MgAAAAAElFTkSuQmCC",Uoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALUlEQVR42mMYBcMGmBpYnidbq8V9U4NRrYNOK0KzFVDzqPYhp93y/GjBNOQBAOCzHUzfY2AmAAAAAElFTkSuQmCC",Voe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAANUlEQVR42mMYBaOAnsDUwPI8VYyxuG9qMGrMqDF0NwZhkBXQoFGjRo0atEZZnh+tcEYBrQEASqwk2l2gzGcAAAAASUVORK5CYII=",Foe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAQklEQVR42u3WwQkAIAxDUUfpGNl/kYyix4IgeLAg5f8B3jUZRHSVQpbfk1MuIBWQkC3JLMnv0YCFhd3YkonmqhAdWsiNXXtYLn3IAAAAAElFTkSuQmCC",Hoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAU0lEQVR42u3WQQ3AMBADwUAwhGPR68/8SQRCILTPEohVRdoB4P16AECIZY2crp73soLz/fQMz3cxzzzz23zzxwaKBAkSPyasaOJa1kiyuJ8ANnoBQOJfe9XiSK8AAAAASUVORK5CYII=",zoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUElEQVR42mMYBWBgUW/xHwrridPw30EARDsIWPwnUgOCRUjpfYv/WOB9AqZjilBfg8V9OElYAzpJfw2U+wFThHCyQADCycOiASOeG0azIwMAiQRHZ8jZbIUAAAAASUVORK5CYII=",Qoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAVUlEQVR42mMYBQMPLOot/iPBetI0/3cQgLEdBCz+k6gZmUcPzRb3Lf7jgfdJsBVTdAhotrgPIcnT/B9CjhzNiAAbMvGMyI4kZ0uLBqyZomG0iBxYAAC/DF1FjBKJzwAAAABJRU5ErkJggg==",Goe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAW0lEQVR42mMYBaMAK7Cot/iPBuvJM+i/gwAy30HA4j+ZBqGLDHGDLO5b/CcC3ifTNZgyw8Agi/sQknKD/kPIUYPoaBDNon80iyAXsxQVtxYNOEuihtFqcRRgAAD+k3WRNfn+qgAAAABJRU5ErkJggg==",$oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAaklEQVR42mMYBaNg6AOLePP3Fv/R4H2LeMoMvY8wDAEt31NkKMgIbGLD2VBESBKG9wfWUIQ3CcsNa0PhYXwfTlNuKIIFo0cNHTV0hBhKOEeNllKkAPP3lJf5mK5JwF2tAC1MGG1qjYKhDQCwMAtwM2SlsgAAAABJRU5ErkJggg==",Woe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAhUlEQVR42u2W0QmAMAxEM4pb5Dqd3UA37AgZIYI/Ci0WJSLYe/cTSukrhYYIIWQcMKvBj6jpInGkBd5Ilij2209yAhM8mUQBh7fWBhegwG+kfCvoP01/DwXvC1BQqjpOUNcUUDCeoP5o7EWBgv64UhE2viDD+0mrPCetaleHqyFzsCbk/2xzkhpn1dsvJQAAAABJRU5ErkJggg==",joe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAPklEQVR42mMYBTQFFvUW//HAekwN/x0EcBnmIGDxH4sGIL4PNOs+Ni1YNcDIIauBsKcpD9YGvBHXMJq0aQoAXLpFORt9SKQAAAAASUVORK5CYII=",Koe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAUElEQVR42mMYBaOABGCeb/7e4j8haFmAVTNQSoGQBRYKlu9xaAaT94GG3Mej/T8OYQQ9qpmGmimPKvP3xCQSHJotCwgnTvP3lgWjGXkUkAAAdUpV3AveF88AAAAASUVORK5CYII=",Yoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAW0lEQVR42mMYBaNgFBANLOLN31v8JxLet4jHaRBQUoFoSxUs3+OW/E+S+/8TkLK4D3I4hQYh6FGD6GYQnaOf9gnS/D0pWQSPqy0SQN4iDgItTRgt5kbBKCAaAAB08GOtvYgHXwAAAABJRU5ErkJggg==",qoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAY0lEQVR42u2VuxGAMAxDNYrH0LZhE4+SUURHQZHgNMBFT02ql/OdPzDGGIDBpIppjLG0UQvJsVQUo1ibqKkURR5L2a/S+nel97elP5Bu2af1MX1hoSS1kDb79ygrk+HzZowBTmhq8jpu5gHwAAAAAElFTkSuQmCC",Joe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAc0lEQVR42u3WsQ3AIAwEQI/CFrynCxvAhozACI6UIkWaV4hQEunPDQXoocBgIiKyBrY8EPcrj1yN84p4UMWYY/fJJiAhfBiDQBjD1/JJ6Oex+/8CrmMFKODjAbrJC5rd6+26IObLm3HeZp9MFH04RETW2AFGsBEvMR2tyQAAAABJRU5ErkJggg==",Xoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAtklEQVR42t2TsQ3DMAwEM4JGyAhuAv674ggZwSNkg3gDaQN5I43AETSCgsCpZDqBizRWSfCfwP/pcsYHZYShobEg4/p1WQOjVMzr2m3ABJOowXc2DSxYNHQWicWVoDEyuVaLRFcA849rkArdjKWivUXujZnpWHJX2NGw238F4yBlM+Sdj13/CdlDou7FCnMRYUL2BGuhPklFYo8GcodGTw4M0zh80n9KZdLwq6SFZW2dCXrGL/wCN0FD1ENCiIcAAAAASUVORK5CYII=",Zoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA0klEQVR42u2UwQ2DMAxFGSEjMAKXyt89eQRGyAjdADaATdINGCEjeISMkBbaWyGhEVUv/CiHKHpW/G2nOnWAxMCygyIismcHuxvllgImWNTz6dLAkoNmAkAXdIBCPu5qKLoUHJ+7Yy9mPRX2NCRgWKiYhBPK7TasqJOJCYeN4BQQl6UJfIKtSgXL93K4hlblQvwPfG2gvzAsX4bNIRFDAVLsNbe59ky+jcfUYKDPWdKvdTgEyuMuR6GzMdfmnafFRIHbL0pCjv1rTMjRTcz5OR+gB66nVLaj9d+XAAAAAElFTkSuQmCC",eae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA4klEQVR42u2VwW0EIQxFp4QpgS78fKOEKSEdLB1AB9kOJp1QikugBKJISLlkghNxWK32I4EQ6CHA/t5eei7FnUzF6HRpVEmEzStsjIEqTe96EMY88oFxOmH0r15uGCXuP6wXbZqcIDJ2fS4BIztAcvvGXKM0zUFtYCaoyS5p9NHsV1ShLgoNaXFfgtI7ZQ3oWHQ5AratEf2xQARta0Bx1WOfmpaAJknCm+8cMqcvHSe7HKmtyWkjc1FmxubOMk3SyBflwP70W4Rh9ZFh/nrouzQq4R+xK4k6rM6olLi/ivRz6RONPGPZaiearwAAAABJRU5ErkJggg==",tae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAOVBMVEUAAAA4ODg5OTk5OTk3Nzc4ODg4ODg4ODg4ODg4ODg4ODhAQEA5OTk4ODg5OTk5OTk3Nzc3Nzc4ODjhY7mJAAAAE3RSTlMAQI/P7/+/YN8ggBCQX+9Qz49/zUwuWgAAAMZJREFUeAHt1DFuwzAMRuGfFl9MWUrc+P6H7VbUFlsIDbrlG4kHWANpvb3AluLgt8X0uzX4EqtSEZJqAd+sSs16QFQlQLo7YacvPPY83aE3fdM63LO0OpsuNh41SYOuQackKdE0aMGapAChCxtHQZ7KMU3a6JpkfGhS5aFZ8A9pm3+AcdOkTk8WNhVYPhqsxDibXhep8NRgITSqzqGLA6/5s3ieD2aBXandTwdtga/6QQ2IxZpU7XAo9YVfxon1m4OXbnr7u0+X4gX3FA5vDAAAAABJRU5ErkJggg==",nae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABSklEQVR42u1XwZHDIAykBEpwCXw8kvyiFHdw7uBKMB3gDlxCSnAJlEAJ3AyXOz2SSSQnPDLD8mTErmQh1qajo0MGb3HGSAdkLFgg04ERZ2/NO4ADrfXgeyvi8KJyWq9HXWAZnbfXfDwsePndgdXb09oxsc67+1vdT6o8MGHi4zGNTiAiTU5OULD8B27P0/cWds5CTpCwwG6EqKVK3ooJ8FsWwFlUQauUoC5dA46OY2QE0TDEZaIgJeCVFE1dKAvKiklHwKhXbzbtAAuXtgkmhwWOtjO3UDZtwA3SnOCTS4Re9pHbtyl8qa6L/qJB1o06HhVYRBOYwqlhFzlKpGVyWv2KvCmceXAoGE2ApkywsyCVZaFd8uhjVFoXpngeODo2Ny2MV2TjdRIU2Dqi/7OOk2PrSEFR+0cG8XZBpoDD++z7dmvf+49NR4cMP+/u/nHurjk1AAAAAElFTkSuQmCC",iae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAY0lEQVR42mMY4cCi3uI/BrxvZYBbw38HARAJ4UFYpgYgLTg1wLUBgYMAiA/Tgk9DA9w5DUAuWIvle9waCMjQXwNm4NZDZQiHEiyk8GrAlBxwDQ4CmBpgPsEEiDjGhA0jPF8CAH9kXj43Z9VeAAAAAElFTkSuQmCC",rae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAf0lEQVR42mMYBQMFzPPN31v8xwrvWxkQ0AxUpAChIXwE29QAv3aEJkzNCO2ENQMdrwAVUQCLEdaO0GxZAPOr+XvLAiR5B8v3+DUT8NioZhQpnCmtnjjNiJSGEFcwf+8gQLRmDJn7FgrDTTMiQ+DRjMgmmACRITAhIpuMFpkDBQDJY3qFC/iIhwAAAABJRU5ErkJggg==",sae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAiElEQVR42u3Vuw2AMAwE0IziEWiQDyo2IZt7BI8QGsQJCeWjdMiXJj+9IpKdFIk8wamOUhm2L32QQe5Z4S7X69KkeL0CkZqFSHVD6hDuQ2ApDVCEkGF8ZHXk171j8xbUGZSApqFqsRjOYYjFwkA2H4fK93lAP4bUIQ2I/akSdqHGUEeOrzLy5AKXfpk5k6Md9wAAAABJRU5ErkJggg==",oae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAkElEQVR42u3W0QnAIAwE0IxyY9y2dpOM0lEs9EfR0nifSi4/BcmjoAYtk9kxBJ01rEIoaGFdqltg3wa073nVjOAtsA36QwVWQAdWRvsmoq32rIb6176bDaxrKHgNpBNm47+voUISPQ0NJ1YhdDSeWB6i8TWdD7yIxg2JnowSMarNU2cVq8QoeEmkE/kEy+yYB+Q4U0WfEXbUAAAAAElFTkSuQmCC",aae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAtElEQVR42u2Wuw3DMAxEOUJG8BY6dtks2sDaIKNkFI+gEZjKEIwrqE8n8F1niHqwYZGSIAj2BZ9UYR354pBx9IR155pQpAq7y2AwaTye4cDVreANPIGjWBeQYlDAn6ttaVpFWDElQIZxtIiQ4jcouNHy/GVT1fJ+ifBbzQiGakIQAlrsdNZU07kq8DtrXhJwq+DDtSTgQl4XghDsJuDD5QvmJlqGjUeL+PAc9tPmdFy5g2BX/stocvY1lcqQAAAAAElFTkSuQmCC",lae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAZElEQVR42t2TwQnAQAgELSVdZK66u84swRKuFPMWA/oJhPMj+xjYAZUThx1TDXhMXwJcKD6MqwkMY4mw0CaAx10DyhRh3tZ2GIajrw5Zs66TNfv98QLImk0ga+J/uKUd04kv/ACuwTxjXxOzKAAAAABJRU5ErkJggg==",cae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaklEQVR42u2UsQ3AMAzDfEq/KHNd8llO8Ak5xZ0Kw2O1BCiixdDAQZBgO9ovVnXf4KhOhLmYRHMuAW7OMGMwBZh4rwJPuhn9dilzc4IpZU73ZzhnIcBlFmrHhADnLAQ4Z7GlqlXdeY/79QA1NEE/OOqwDwAAAABJRU5ErkJggg==",uae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAi0lEQVR42u2VsQ0EIQwEKYnkdWMiSqGDp1NKcCn+gOSTk3U4OsRGKwcjWYxwOtkp6M30aTBnuhPo+qKYDFoIREOpKX0yKj0AklHybFQ0AML+ewSk1NlKvkZktY6WPBejhV6NJgNDpb9ISEe9BZCjngty1YsbhC2AXPV8kKPeAshVDztfrX+OzqHeKT+HPV07KiBSvgAAAABJRU5ErkJggg==",dae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAp0lEQVR42u3WsQ3DIBCF4YzACLeFfzo2tTdwNmAUj8AIL4XTnZIid6KIeJRInxDoiXusrEwMF9eXnd+C0OedheahGB2hemJJKLYNdK86sBS0noijFYwD0VNQhO7ztYLqSEG3gVp5361QCkpH7Fgr7Kg+0x9qCzyUZ0+E6Ni/Nsr3Jo763sRR35s46nuTgvrexFHfmzjqexNGfW/WHzURzR971li4Mi0vWmHD5wlP56oAAAAASUVORK5CYII=",hae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAwElEQVR42u2XsQ3DMAwEM4K2yavjKNog3sDaTKN4BI/wAYLYMFLkC1KNwVcjQcUBFA+gHplMRgcbNnHnCwj+u0vAjQEwDBDEQJsAwApe1hoMQANBdCtW6vLZWyxggHU5Tx3EiAUQtHKcrIB1DwU8918AGF4i9BP3ii+RgWBdrFj59lOLbtMOXlafIVo7RHO0qLLV8bjCVgdA2OoCaFudAG2rE6BtdQK0rU6AttUJ0La6AMrWnCoSMG98zw9OJqPzBt0l7s1Mr/E2AAAAAElFTkSuQmCC",fae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAA0ElEQVR42t1TwQ3DIAzsCIzACHnV57wYIaNkE9gANskIjMAIjEDjqKiRHPLpL1gCZJ19Nj5eT1xw7FHQ0Dgjwt6CnWFPlTMK7G5FbuSdGcMzkjMC/3JVWA6cByHsOez7gq17sMHteyJ/AZcSJBMir91HK6IwU4XTARFtbBx0QXme5KTqzKmr2tk1Q+vnwPt/QIEdlTRPlHUPAe3G4pUkjtxI+lk7u+aIEnge3HvpAx1IgzysjOk3SkTOd2oKKGfxUeWg4EoiifPRaOEA98Qv/AE1UoTnN4Z2HAAAAABJRU5ErkJggg==",pae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA9UlEQVR42u2U0a3DIAxFM0JGYIrH8R8jdJRuEDYIG+Rt0BEYhREYgSqyIqpKLpXaqj8lPxaxORe4ZvqN748ws5B9pflKlhX3dKGsvkqiEaeJSPMXil/DPCzFUSTtC7DpjCQijn8KbkClEPcITVUldacSKQ/pB09O5D5L/jupBr8+lIzTNDn3eX+WpBp8NdmSaMMvWuRM0OhQ0BVpRCAbxV0U7W7Z1g/PIrce2X9eIn9iz8TxaUsyitVL9j3jTIt2D1kOY5M08vbSvXS7Y5aBtzWVDUc8fMymXaaSx/2cKP5CY9l5NO3vW+qAL6m/JMQw/17XN4wrEpijJzJiTjAAAAAASUVORK5CYII=",gae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAABOklEQVR42u2VwY3DIBBFtwSXkBJ8SXiTEyWkg3UHSwemhHSQdMB2QAkpgRJcAhsLIWTFwmQPOXmQAIH99AfG31977LEaulNGHIFIJOAZOPwDwkjAE7G6050YojyIjG9hOBCUm3sxeY2BcOy5E5p1ZQAjt8X6HfvsbTOKgE3j8oVzL9M8iiHobgNSdKDxL3sePY/KYbfTikmHXF8fxso1XcWmJgZiWxNTB/nTJc3kce7XriHN5CK/VVA5YOKreN3JVJB1UCyzrf3PgEpqalpLjZhraiM1cafLErksSfXIh42vgpQhNrahgsmlVi3IUrb1wIrb+kS4YRucKJuHms79WjkyEppthHHWVmyk6FA/bzoSt2NP4DutZIByGdMc2GSuYmarZSTiCdhFdTXrGvDZ/JVTT+T+S9xjNf4AJFfBRFljej0AAAAASUVORK5CYII=",mae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABfUlEQVR42u2W242DMBBFKYESKIGfrK/z5RIogQ5CB9AJ6YDtgBIogRIowSs/rnhFGGej/VgxliIM5MydGXtMctll/8FUKiq0GMUEDS0H2aFE9isgagvbj/ZNsHg4oNdYJYmsLHD0v2U0ErX9a4/MQhpzz2NHZHjap3UkkupQGsz8xLj4Kgw+CutB+pbb6x56GagwsN5c3XI6PmEmYL6sUqsnWxbP5FilTIacVHoG2prq+hwW1DUbepcAXqM5o1PHDGoN5jNyhPMqu2Vh5AB9z1/EMq4K1wagawyLsoXKaePi2Ew469nxOyqli89BOTsyBvxhKEYudrrg7HXA9xxaDCHok0tk62KP4RKU3wdALpHoUYY7/RQNDTdsNNzv4b0/94lTWtmllnubd7g+xMO17CCSLY37Cj0dsDDUDrXNZzgFPJeKfedH6VSy7UVi0bJl85hxAaOPRjJQnptONdXxjKWjSOOpuRwe27B474JL0cnBw0a0olLp9eV22Z/aD864midGg3cpAAAAAElFTkSuQmCC",Aae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAVFBMVEUAAABAQEA4ODg4ODg5OTk3Nzc4ODg4ODg5OTk5OTk4ODg3Nzc4ODg4ODg5OTk5OTk4ODg1NTU3Nzc6Ojo3Nzc5OTk4ODg5OTk3Nzc2NjY3Nzc4ODjGsI2cAAAAHHRSTlMAEGCfz+//II+QgI/fQHDvoDCvMHCvv1DPUG9/Uoi3OQAAAUNJREFUeAHtlId26zAMQ0HLAj3k7J3//8732lrnUKkVNd3zem8DIoGvyh9SudqTvnaV4Gm08TScoow0fKAV7UhPshcU0EC6wXOGO2acDwsyFD6yDAxLOLrxcEUHDQzrwvtXAiU1HpMCWV39hgSuAGzoENmyA7BgEORoxgs1B0QG7sYX9cgQf0U5t3OeAmBJKqZErXvu7NyOFe5YsM0oYIn5VEXFIlXmj2a4p2Zi+5oBMOeMxJyQClSG+OABRmoIQCKSHElqXYS0beHs7Q+88pfMnbzoISN6EW0Nl7YezNbXDpx4lhBMaMfPVpfFd7S6zJT3+rEhnmqFP6EdG2iXNtBhbKD2WotuAXTcXhbkikGuhsBWIGkIKMQxaClmFAturQfH5LktyE70g8sHmSEtSU+e1UITZXRBw7d6U9wvLO6/KH/8B7idD0gpKHb0AAAAAElFTkSuQmCC",yae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJUlEQVR42mMYBXBgcZ9UDf9HiAaL+xb/scL7o6GEK8RG8xMlAACVNB3g0sZyBQAAAABJRU5ErkJggg==",vae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAK0lEQVR42mMYBaOAgcHiPiWa/49qpqVmi/sW/3HC+6MBNng13x8tWYYFAADfeCK8SdnhwgAAAABJRU5ErkJggg==",bae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAL0lEQVR42mMYBaNgiAGL+9Qy6P+oQSPIIIv7Fv/xwvujYTRqEDnparRMHgUjFwAAC5wnmLn/vc4AAAAASUVORK5CYII=",wae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAO0lEQVR42u3VsQ0AIAzEwIzl/Rf5UcIGCCFoIl96Nym+JA1CSL1G00aNjo8S+vDyJeqjjBq9QYjzL20tTqZlDU48w/sAAAAASUVORK5CYII=",Sae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAQElEQVR42u3WMQ0AMAzEwMAyfyIPJV1KoEMqVfUFgIcsX5J+Q0hNomkDBgwY2Ah9eBkP+GQDBgxcC4Q4PyW9aAFuUHh99LjXQQAAAABJRU5ErkJggg==",Cae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42mMYBUMDmBpYnidJucV9U4MBVW553sqASOUIZVYGaMoJa7FIIMPtowlqcAMALLcTnJ44bUQAAAAASUVORK5CYII=",xae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaUlEQVR42mMYBaOAqsDUwPI82VrN35sakKXVQsHivkXCQGi1LCDf1gailFqetzIgVStCcwBQsQKM5yAA00qs9gKQdohWy/MWDaT6ssHivoMAQivJ2i3Pm6+3WMBAHrBYYLFgNEOOAooBAE/7IOBahtOxAAAAAElFTkSuQmCC",Eae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeklEQVR42mMYBaNgFNAAmBpYnqeCMRYKFvctA6hijEUCdYxpoNgYBwEqGWN5HmgM5cB8veUEkjRYnrcywCLab76e5FRicR/dKIt6y/MOAkAGZUZZ1FvchxhDplEIYywUQCyKjLKIhxlDkVEI11BslKnBaCE1CkYBxQAAih4mBvJZLiEAAAAASUVORK5CYII=",_ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnUlEQVR42u2VsQ2DMBBFMwIjMAIN8nPnTcII2QA2yAhkE0ZgBI/gEX5KC4mG+CKae6WL5+Lu6R6O4zhXoSeTTZWpizsylrIiMr2lcv6LMpRxMFYiJkvlEyEWQ+U4hPKjkkxO3flmVuV1qeKeulPlp6UVsR3f6ldt2vXQT/tm0oeCwtuynzrp2bgfEkJsxv0wodqPGfGFWPx6OI5zC1+THlNktNW3fwAAAABJRU5ErkJggg==",Tae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAUklEQVR42u3VMRUAQQgD0ZOCjPg3Eim3JQVb7SPdjIAfOj4iIqKdVLKc5X85zKvg4e/JjUSub2iZn1iAH+DktycGvz0R4nui+dSEVTwnIiJ66wCNNFVRYPT2bwAAAABJRU5ErkJggg==",Rae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42mMYpsDyvJUBMt/UwPI8nIMqYXEfpBTBMwXy8CglqAyhFKGMgFK4MsIKrQgphFgKcQBBZQi3ElRGQKnleVOMAB+maQsABGkiWYbfEDgAAAAASUVORK5CYII=",kae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAWElEQVR42u3TsQnAMAxE0Yx0jUBoGm2eUZLK1TecjVtfeeIhEOi5OUmoZFoO8y2xCxIiAo8IPALwKHuAxWTnl43abyltgBCuZwFP7gGQA8soFJq39/9O8gMKsCr3VlZvDAAAAABJRU5ErkJggg==",Iae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAXElEQVR42u3UoQ3AMAxE0Y50xFLt/blH6CoFBUdSRfk0OXjSk2xgXyd7Jrs06kPZUxy6n9KoDbczjqg5ouaImpsCbopwCdLQNzyi3h1Rc0AXuSng2fF7GOdt7JkX0ZIxdc7SQtYAAAAASUVORK5CYII=",Mae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAbklEQVR42u2Vyw3AMAhDOwpjeDw2ZZT00EMPlopkV7kE3wLRUz5grtHoDyGQCHHHKyQWCvEBKSxkf5p6QF1WAnFGAHFUAHFEAPFKBBFEAxFEAzUQGeNfav8T+x/ul5/fDH5r+kbh25ZvojNujtYN4yCOnT1/gdAAAAAASUVORK5CYII=",Dae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAaklEQVR42u3Vuw3AIAyE4YziMW7/RTwK6XNSLPgLmrsW9EkIP54kSU6jVqt+b5RavQOuD+nc2gHLyOEUkCM3k4AbSMAZgDknjaOkcZQEHAf5k/mn3C8bXti89fhwABwg0YDlKyDLMklO8wI/NJSRWelhdAAAAABJRU5ErkJggg==",Pae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbklEQVR42tWTwQkAIQwErxRLyCewXDV2Zmlp5Z4LDhzkJeanzIgD+lw1GW+0BC3NnlAaHXyoWrfW1Nr2iKsy9oIMlRXgKIACHAVQgLsACpdbAY6EggLgUFAAHIoLgFPJcIH3Drwijwt+hyVX/fQPLa059IZySykAAAAASUVORK5CYII=",Nae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAn0lEQVR42u3UMQ3EMAwFUEMohEDodPnuFAiFEAiFUgYpgzsGgVAIgVAKJ510iiovv5469E+xo5dkiCxP7pQ0oLmxzqhujILsxw3hEuh3TWPce4d76PZfx0XXX29DYWmvKpKI4RQNevSqc4KKIOtHhOJ2U9/I9nCSxwPBUoojoVpKcl11MZT9JLpP46nDBwFNvEFG8eP6mv24peEZhXfKF0shN3m6KmEvAAAAAElFTkSuQmCC",Oae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA5klEQVR42u2VwRGDIBBFLcESLMGL4a8nSqCD2EHsQDrQDkwHpgNLoARKsIVciCFwEDJ75N/YGd7MPhaoSkoSAsuDkdh5QJoWHtB+Uywgcci6+iddS8Y3JNyKTN9mYNDAkteKGLGe0i2aHMzoV2j7GsLgUCkY6NCQvxUa9tKYrMmEmL6FjYbBXKDEFs8LBqxhjZagFgZPMUe1FUMEmsV23doUgGx45JjIJFiC9VFo6AgxOed2P5tQ9Pqx+MicJMiPIX+mSDlM/hUh45Bu1bVphFj+UXGEFHYe0ALN9KBB8oBs+fZKEvIGIRtMyBWS310AAAAASUVORK5CYII=",Bae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAx0lEQVR42u2WwQ0CIRRELcESKIGL2WFPdiIl2AGWYAeWgJ1YAiVYAiZc5vBDzGQ5bDbMmbxkX14WTnNzxxsKymDk6lGHQxFRw3swNGRUxPFG6+r3ZhQJFdEaZQVwKvKG2qDGKEWI2ItvyEffKJyIhVu+RFqjIpaHw7PXqIjlwSX3G5Ww9BY+1/OfRg1WgFqjOpRGc9/oBqt4DTLKSltSyRrVkTb+ZIyqSOuQH2yNEikt3Ak1RvUfSq/ReTPt9WYitMxn1Nzx9gOX/6nFH0XZ7QAAAABJRU5ErkJggg==",Lae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAArElEQVR42u2XsRHAIAwDGYURUiqZJhsmG3kUp0hB+Rw+N5xVy1LxB5hWKm0rmazl6TrkqQW65efb8nQ+ct25BPw6ikA2AXWZbIaATKa+Eu+yGQK/U30hXh0IoJvjmQBXgBkIwBQYgQBMsokI8DQbmMB8AscPAlSBBUAAC8IEwhTCBNiEBOInAQnEzzISiN9GQIDiuWKGAMTDgwMExoNTu1DtQhsQ4AKrb1dpW32AOeVN3XfvJQAAAABJRU5ErkJggg==",Uae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAGUlEQVR42mMYBQMGLO5b3EeniVY4GnwDBgDyfg0V4LDU2gAAAABJRU5ErkJggg==",Vae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAHUlEQVR42mMYBaOAnsDivsV9bCwytIwG5iigAAAAU8YNFb0HgxAAAAAASUVORK5CYII=",Fae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALklEQVR42u3RIQEAMAzEwMmKu9b5T0E7NJZD4TmSnihCjb0jhIy9owk9tWek3y4xIxrUO3326gAAAABJRU5ErkJggg==",Hae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAL0lEQVR42u3RIQEAMAzEwMmKu9X5z8EeluRYcI4k7eESbqmOEFKqYwjzK49J2vMAOT8a1H/CHGIAAAAASUVORK5CYII=",zae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAP0lEQVR42u3SMRHAMAzAwLKKiiZhbgiG4ECw19zpN+36JEkvY68k2G1PERT1Z9tTKymKaHuKQ6zkdO0ckvSyC14fMJHqKpyOAAAAAElFTkSuQmCC",Qae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVR4AZ2QLWyDQBTH8Qqv6n3CsYzmvMIuK815MV6m5rrMTTFBxxw1E1PIyXd4Ua9wKyi8ur0Xshs5csvaS36C9//g3gW+o7ALM+yBUXhaBf89bM7avsj0MGa6N78MNWt/BSUZkc1+bJG8ILgAFX6lwQZPBx5cCNq9zysa6s18jRplWGIED1hILtq6D0jwjLTHZ7xJ39o4r1BMD1q1YlfqaNxrYZhXLfAJ79Ut9kCh41b33U+QNfZYbxsVwR6Foo/OCpb4yLdi3Q0y/NMSY7BrLIr8dOwN5seAlCZPGgOJYpH/7gb5Fh9NnJIHDKwLykxvQEEkzIzO3K3zz/crunrUVFrUHKTZjrTR8Tb092tpS9wiMhD1MkhAgpydr7Gi4cE1eoOe4ysaae8X1jwxbxFMyNDn+wZoU/gQWA1zdAAAAABJRU5ErkJggg==",Gae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABOklEQVR4AWKgKwCURoawDQJRGK5X9QqvcKXLSvCqeikX7MyKN8ybkqys8jDzfuYdZhavcAVq8Or2XlmTR47l1tsln+AP7+P+RwJtFKteIsMPEjPPUdQBon8BEjhvLZJmGUOXCtXXbNBGE0ObGCJR9RlVukNkiEV12V/XQQ+OEgOhunpB1h2cc/EPscB2O2hfqe2kPu3jHjG9S3s3RBKi5akKskKt6wKChMS2v/wMX1uaOarVUKhAniDwrjIWakZD4ie4+FilvNWaEWnOe7U6LN5gnfNwTkwNiHkRA10LOnTdIwQlhW6wyvyYYkeRTqOlfgkzvQ9rnW6SP4jl58eDP85sBkSiYxSzUDMaLqa9ETMiPSU84O0e82loivHrPuKZIgN5q+zhYEmhG6wyP6bYUeQgtoss4mHELvoGnVEJQO0l+0MAAAAASUVORK5CYII=",$ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABi0lEQVR4AWIYFADQOhmCNgxEYfi8qlf1qq5Z15T4mXqaEhgMZtbzptEzDaxtYSb1Zl691MyMMTM1c65pYHBe3d4Lo4HHg9y6HPwkyd37vuPlkkAZxcUJ4qKyeHV4zeldh2CCioEYyuSPUNOL4aSx2BDEM4ZEreD5oVo2bbgohhgJlP2uwUKqvBbxVnSZObIVWWZQ7rsFV3YGx4y1ikTHjKz/A5cptV3xkUPU2x2C5QaChE4EE7WCb+EzWx1uVlQvgtfF0G6KwP3GeIrgDt61VH8W0QPGCTkvnDU/XL1bur+H1ykHS/WKAIJEFD3DaLCDoO8BdjS/hit9bpWnqDUEfoIgpdYrPrioU7DTo4FbhOAWkw+no6hVxMDfaTilekyO9c35pwenwxwnHEu9UBaJYLFe4Y4Nn+QL33bjaA1DvS0C2BbDFwJ/PY4G0sZYrMJFiSwRdxRhpu5hsvRYb4jdtMpf1Bbr9LVW8iDROL1QZOtaTadIHuzDj7POwbIo3Ld8F0+wv8jiPdA7n9of+6Jh/abhp4AAAAAASUVORK5CYII=",Wae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABjklEQVR42s3TwW3CMBQGYI/ACBmhN4xUogxSUCYoOfYGG4AEKcewyQsTMIKPQC8ZwX0/alD01MSmiSue9AQx8f/FsVFPXSmdk1l5oVl5rfjT3r7TOR0cQijCgbS06Q2nZEbz43WJ1UjABQeA3DAyeAuirv2JBDRQX4sGDOjrBYMDAW4Yyw8Iya4U1Dc6H/4BI3YSVVcIeI7zIPewLgnP8ap7QJyxwolXXZUfx4tdOa7yUhcftE7wnwL8KMRzo/1RL/NycspJp0oWBhkx3FZ0sScdueDbb3TJaggPLXLMHW6BWmEGSB6EgpKRgNraqC1NNm4QPakQClj9lIScTXqlUAjZkT5g0Kc/S03YH0C+98NQoh6CfaEt6UQ6DjggZLNpahexsYtpYbMkErA3hLmcVXCOQWYXZEXfYYR5QzKnCfMFyRvaYITWMA5MAxrxA6/dOfGJV/e6qQd84fubAfQeL3m88pqfTQ/1xAgX/nB8ElvggogXJg+RP9wX+hXG3gaHZGES4ECQGw4LueHqL9A3pBTYzX9vLMsAAAAASUVORK5CYII=",jae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABsUlEQVR42tWV303DMBCHPUJG6Ai8NZVolUFolAloNmg3CBKkfQyb2JmgI9wLogkvGcHcAZYLtnR1pQNx0k9t2st9X5x/6l/WWp+qtRk0xn5F02+i0EpDVvbjFmHgwUGARITA4+RBbKDs3zaVPs1kwXwA9++SRKh53Q8NA04OJ0Lgwl1YcvEiPFg++kOEWWrpTKrSLzd/tQJ3uPrKFW1gnn8ZHL8LZETGLgYWFSnNOOGM3cXPgYPOZ/t+0bRmcWx1XnmR14fSDJAOhqzTRXbo8+2TmU+tyTtiRMH0J8b+CJyL0HOeRJLB4Vwv0mJT2BAXcTt9iozH72/DoWbAQfb9vFE0nBXwARoeW8YomA8oKjq6VBFMR/tR6LpJAVPvo853JK1cBSICCcG+GBE5sKSIv4suLVsXmb1fbe1mdaRP3J4xIizYz1xOmM7N9BU22bNAioh7gDEzKV4EmzaxJk5kb3Ltzi99x3NcMOAg1KdwuYFtjNvzq8gHFA2z9e3uOpFljalsvWoSwRMxSVq5CkQkEoLjRUflRKTBQiI8WFoE6PpgwCIiQD1KsrzIUjswbutrwe9FgoCoBGPNywAAAABJRU5ErkJggg==",Kae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAhklEQVR42s2S0Q1CIQxFGaUj8EM4dZnnCG4AG8gGuFlHYASMicbEwqfR89fm3pu2afgLEL3mwcToyF52YFTkYaBiHJs0LMV3nSK2TKVTPzpVW/B4P6IjeJjLnicPn4gFjzY3Y6Fvtj75rVdwxijPOxbsZVyn3jBmHtqQFJ10x7ekevn5t94BaZcz6PRuPUoAAAAASUVORK5CYII=",Yae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAqklEQVR42t3UsQ2DMBCFYUZgBI/gBvk3lTchG4QNuE3MBhnFI9wIjOAIUSXyQREpBa+yzvpc3JPc3TepZ0Gp1FjIuEvAhCKk/Tx41rjF+RSEJ/r5Lg5lMgEubAf4Rqm3SCY354IYJJbRN0lCDULtrm9+J0pqzUcfikUEsdZi9644Y/VWeDSrlO4scQ4b+Vg2iWUH6OhPEY41FioVRfbeB28gO/9F8XXH/+ENDulCjmLa46QAAAAASUVORK5CYII=",qae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAw0lEQVR42u2UwQ0DIQwEUwIlpAQ+Eet7uRRKSAe5DqADriNKcAmUQBSR1+kwKFE+0e3Tq9Fa8sLl1NcCU4CgolJGwnUaZEPBFawNuVl4iAts5tCMjc1uFilP4BQoHs2xuTBAcYUcJ7BxBazDCb7rrRRVmPJita305Kq7P4SlX4jFuqzCFLH2PHikUS1L71Rtq1F2Usozrue+yWyQUMFz7Y4Q+MW+r/twhSIY0ia6GrJRRkWFvMD2vhRc1x/gdD8/6o/1BPEZTa/n1H7vAAAAAElFTkSuQmCC",Jae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAA50lEQVR42u2VQQ3DMAxFA6EQCiGXyd89BUIhBEIZbAw6BoOQMSiEQDCEQMhU+TBpqppUkbpL3y1K9CzbsmMu/oLraOIAQUaGcIA3x+GREhZ49OvpZuEpQA6qeIbAmR/QQ3A3teDO0XXbiXKkuU7iISrZFkF4rNEI+t17x8l1JYnndzHQwpPZRxvbHIrjYIuaHlJ6kk0FyCdoin1SBkvxnBLThMW0h3IdJbimPik8Foahds752TyaCh5bHYOD4AUZbL3I68YbrNYDHgslHtcVpqIDKgocdYlSoEkT/YoauET1Ig7Xj34iH6cYY1qNKwMUAAAAAElFTkSuQmCC",Xae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAA+UlEQVR42u2WwW2EMBBFU4JLoAQukZ85TSkuwR1AR04HLmFLcAmUMDkEaaV4tfkiinJYxjcY3vyZgS/ernjlsBBLqnQcp9PITL+AscYdH856Csf0peuu6n0mx3ponc7hOvbozgkkHU83C49HkW443YKOW58/YIGOs+ntOv68JQxPu6iRjKePH7ManooGbDhZKysvZJmlwXQN6Lia90/APu54jGWWW05VXQpNAsaC07SyqmXtOCa9/Fqw6Z+eqFExBwGkmBRGHz1RR3qq5GU+rmTaARvKybP8fuLOZuGczd5VHU3GGosF2bn1uJB/g0xFSNWRqVy/ba8Xn6dCyRnIlnVOAAAAAElFTkSuQmCC",Zae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAkElEQVR42mMYTsDivsV/PPD+YHGmg0WDeYGFAnGKFSzPW+y3aLBYAPRdPT5P34fzGxBaLQsImG8ZYLEfwbMysHxPQAPQKQ2o9hPwiXmB5QQU/nsHARxKEY5AKLFIsNhP2NMNwFBSgCg3f28WwEAYWBZY3Dd/b/7eYj/QhvtWBkTGBsRhpgaW5wc+ed9nGLYAADQwTxdfB+DfAAAAAElFTkSuQmCC",ele="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAl0lEQVR42mMYBWQDi/sW/4mA90dGaDgIWDhYOJATjAoW+83fW+y3PA8M0HriQvs+XOt9ywKEMRbzSYu+BGQ+0P4EYrU6WOzHFCFWc4NFA4bYf6I1W07A1EyBs83PEx/a9y0DMAKQWGBqgBpVQGMVSEwkFvdBicT8PSgAgWwFUlOZg6mBgwCITUg74TjYQIeS5P5oCTtYAAC7JmXu542gFAAAAABJRU5ErkJggg==",tle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAv0lEQVR42u3UOw3DMBCA4YNgCEbR/N4OQiGESc2gZZAwOQiGYAiBkFZpOkRJpdrKUsmf5cXT+V7SNCsyc8HJLWNb9Fg3Mb+u0UsdPIah6kTUhSsWEl7KhUSUDSL2e/nz51MhyU7FB7HL9eBVMSnTTepkR12YpAzzt/fiiPBHlSyPaCQe9tUgZdCwyxKejC8p/4K4bUB1IXV3qUEk0+OXWG7LmGR1tWMyrrM2oO8o1ckZwgOTczDS/83yb2u+qfIEGIZ7p7X9JJEAAAAASUVORK5CYII=",nle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA80lEQVR42u2VwRGCMBBFUwIlUEIumh9OKcESKIEOpAPpIHSAHVgCJaSElLCO4x5QcmEj4zjm58aSN5u/u4kqKvo9IYAEK+wCLeXIERw8Ox/shDYfWOO2LhLqPGQAmYj+iTlotI8vNjZ6e0txw5gJZGdXve0Y+Q8JFC59VFchgI4nJRE8yHapiOlA9iqC2hmU9g61eKZAIEHsG9AAgktFGg0ys8zTAWSHZOQCgt/WUmFRDmp0eiTgBFDOlTt1hfRKLp5832gGnk0ELfMUO/u6TOT8M2+q0c58P3k4NiCNlWtfbK/Up7E9atkTHYTDWN73on/RHWseH0rdX8tlAAAAAElFTkSuQmCC",ile="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABCklEQVR42u2WwQ3CMAxFM0JHyAi9oP5w8giMkBHYoN2AEWCTjNARMkJGMKqlStBSQDi9IL9cKqfxjx3HijMMYw0yWDHy7gJ2RMa3UNOdkboC7goSenhXk3CaXC9G72qBXhwmRPgpFhBuYrn+epPz03wU27BYRZKuSw2BLO5XHFr5l5wORHAYN+YGSZMOJDDiVmWBQ3E6pkxT8y69yoIFgz/ERztGEEbwsXUK3u4RHizyGqRS0naFIel7UHkdA7wccVRftHAGh3JsX7q/am+yMHce+Dkq9BIXI4tNDwaIdBiR5g3JV0UJj9tDy04gsakl1g2ODi01i5PIbjdEwt5G//C6zkoBe0EbRm3uJPo1s3pgHBIAAAAASUVORK5CYII=",rle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuElEQVR42q1S2wnDMAzsCB2ho4TEgnxmg2aDdoN6E2cjj5DP5E+0/yHVgUEOqDWGCA4bxJ1edzk9eBiu7NyLiWZ5d0D+URC472//yV13FwKDZCHlnjaZ6GEQTHyk0IGM1qzK27oCZicYNa8erEopfnXiVcC5WCuAJecCe60AUBTYlgUoC+jNK0AU8w68JstXAN5EQQWaBu7jihFYXaljjBUj2G5Eomjlth0t7tGVRFPujbRkr+47Mb7WHqpqxDex2wAAAABJRU5ErkJggg==",sle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA80lEQVR42r2Uuw2DQAyGMwIjZBSkw4jyeho62pMYINQ0YQOyCSNkDOgcEqVE5IxAvGSOCISlX4DwffLj7MtphlJa6DgKhcj0M2/luncECNDzrv/BHOemhVoNIySfbVEBPOcATuRLZ1ggAzNC2TS5Q3VZtnpJyYHjCYyKzNWs8v2mM3rngDhJnTpHP3YASWoACpHuBVZCZOP65QdEmG8CUiPqoiDR90YgwMPgbBZAOo5QrTl/k4RkAgYD0LYt7tp8oqjp7R2GHBAX802X01DDtabE3LQcMnrz1A9ZDsv0zesrNnGW8w0QaKX9gu2WraKoTtv0P1tulH4sQuivAAAAAElFTkSuQmCC",ole="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAA+klEQVR4Ac2VQcqDMBCF/yP8R/EIQZN99hGaG1TwAM1VPFmXukttF11J+iIIQuxEMW0d+GDA5r1kJp38HSKsEBnQlnPj8TnI9olK+Q+xC7DALSLEFZz9b7eJc8784lCUMMKadeJFcSLESO5YG905cDthb2tOlaUvSzd03chNSrJciz3Bx4ra2aOu3RTIY6cwoQGcExrY8J7jQzoDAM25gf6AgZ7X36Q2AGaTgb85Q9uO9EptMJiVKCnQJJq8n2AYBkON+KMhj86mSXd1H55N46ZAHjtBFRowRo8KpYgmE6PiW8MuzY3Kc/3TByfsCZoVMbLA+Jof5dFPHy+sG7A1fUBUUgAAAABJRU5ErkJggg==",ale="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABJUlEQVR42s2VQQrCMBBFPYJH6BE8QhYd6LL7uugN7Dl6iepJegSP0KVuJHYhrkrMFAZEB/ttGnTgQ6Akjz/N5K/+vqwxiU1TM4poszwgz9f+8Mqr9bJeTlHr4WU4jGgnEEhEHYPnuSJqIIgObviMb2BH2RwAPUJQzBnudApWTh3Sb7duOJ9HXfMcAVefgN3UAbe6dlK8BoBWWou7w4G4S56liMBWA7qIQPvazk1koOMn8dmdiQ1kxg+BWZagG3n2htNpVF8UMPAtWeSRjiVgLCAFjUU1fsSfNl6j7Sy1JF8jbb0fDk6K10hGCmOOS74oX12ayUC+EO2X+ne9Gk96axcNYAwa4JT3AjA9kCUjQVktiuaBZU51SMsg3BVekiyGJQnw1/UACcPy88Smyt8AAAAASUVORK5CYII=",lle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAS1BMVEUAAADvSEjvRETvRkbvQ0PyQ0PvQ0PvRUXvQkLvRkbvRUXvQ0PvRETvRUXvRETvRUXvRET////+9PT+8/P96Oj95+f3oaH1iorvRETaY5dXAAAAEXRSTlMAIEBQUF9fYGCPkJC/z8/f73CfOZEAAAC6SURBVHjarZPbEsIgDEQtXmoRmsRe2P//UmeqA6GR0Yee191hwxJOh+KGyACHwX2Ve0KGeiN3ERXU1fqNsYPPWj8Dlqs6nwELlxRCJiVkYp5f6SLK0dsDVpEVGfr0g5YB78YebYPfDMEa6jG5beDNgLYBxaCvqcgRuigTMaJJqK9p8aao9Jx1hjNVzyITMmQfaxJZzGPpMdMylQj6Z2FKiKVayotd2vtu7QkVsfv9cSzOBwZ49O7QH/0Cd+M3hMdc2SgAAAAASUVORK5CYII=",cle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mP4H////X90cP9/PAOQwAbeM/zHAYacxHus4vcZ/idg8fv7/wkAPF4bstRgMMEAAAAASUVORK5CYII=",ule="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAALklEQVR42mP4H////X/s4P7/eAYggRu8Z/iPF4xKkyf9Ho/sfYb/CTgj5f3/BAA/6r0QPE487wAAAABJRU5ErkJggg==",dle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAALklEQVR42u3KMREAQAgDwTgF55EQCfcOoP9h6xVFmJgSZhPB7tL3KWwsGjMJ/QCYI4JZCBHS1gAAAABJRU5ErkJggg==",hle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAL0lEQVR42u3KMREAQAgDwTgF55EQCfcSoP0Ztl5RhJkpYXYi1q5e/auGHYvGzEI/H9prfp6fQCQAAAAASUVORK5CYII=",fle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42u3UMQEAQAjDwDoF50iohLyF78ZA9lsjCvPbUGJIsgg7cODAcmCSRnTwDdMP02R4fwy6rnsAAAAASUVORK5CYII=",ple="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/0lEQVR4AWOgOghouC/g1f68HojvA/F/MG57dt67/fn8gPbnCng1e7c9j/fuePEeqhETA+U8254VYNXs0/EiH6KQMAZZhKIZ5DSYzfhwztzXcJeAvIpwesfz+YQ0Lz38+T8I5EIMAeEGJAOencenuXzpW7Dm9ae/IovfhxuArHjW7o8g2+D8xGmv/r/88Of/CyAO7X+JYjBWA2YCDQACkCEgDTDNIINA8jgM6IDEOQwvgfr37svfIArkBWxReh7ZBQ1gQUxDQDSusJmPkvrg0YgZbRgYpNYDPVUCJRKITUg4U6M3UAJfgoLKJeDNDyCnebY/X4CcNqCB3ABOfdQGAJMR1l/SzUs5AAAAAElFTkSuQmCC",gle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABGElEQVR42r2UMQ6CQBBFPYpH8AiWIprQeAAvw6KFdhY2WOgN7CwoTLSktqJjgUaMhY0J7jdZwrowIjFM8kNYmJeZ2f3baS1GjPdNxt0h44FQ9pYd+lgz7NCqDbIY74okT0IIBfiXhA3nSc90oisBUSX+RU5lZQSMhJZWKmfVRBiRAhuLIf8CWB9ukLKGTcyBpsPdurDFPs0Q2+P985tbAIZ+Hdh0lWRx+swiobJdz4FliefLA8/iuoTJdU2VwMky1pJ3okUEWsY7DXR4QLQHmJwbdXz8HGgwvqFmhpBzI+QqvqU24qTNU5cxi1V/S/82VKA5ZdDQeshB7l8uB5O4HJRK0cJ3GPe0yqiAv7H7RRfheMGm0retxAvIf++k416vtQAAAABJRU5ErkJggg==",mle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAdVBMVEUAAABQgN9Qh+dIh+dKh+dLiehJhuZKh+dKh+dKiehMiOZKiOhKh+ZLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvR4fnH2ffG2fe70vavy/Wlw/Okw/Oau/GOtPCCre93pe1snethlupVj+lKh+d4loSdAAAAE3RSTlMAECAgYHBwf4Cvr6+wv7/f3+/vGLhWpgAAALFJREFUeNqFktkOgyAUBUGw2k2xdK+tXez5/0/sRcINShrn8UwyEIKYQ+ZrA5hKZ+O5aBAooj0ziDDZZE8N72ykcBRIKIcQRnQdgJ0koRHztg8QCxIVIvrDEY4NiRqOjxc32/vjSfjd3kE8KeQJAq3tOOTgFC725UOcWmHge9q3HMKWRM4XsmcENAnZBHPtWShBlH+eRMj0EYVHTYxRIjbpPj6nKaWIUXpbA/Uyl3Pf5getMTOwg0TeVAAAAABJRU5ErkJggg==",Ale="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAb1BMVEUAAABQgN9Qh+dIh+dMiOhLiehLhuZJhuZKh+dKh+dLiOdLh+dKh+dJh+dLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvH2fe70vawy/Wlw/Okw/Oau/GOtPCCre9snethlupVj+lKh+ell/5vAAAAFHRSTlMAECAgb3BwcH+An5+foL+/39/v7x2mWn4AAADGSURBVHjardLZDoMgEIVhlNpKF2nHqXZf7Hn/Z2wcCCK2d343JP6OIYKaQVbaA0C2yFUqtwg2SV4QIvUqbiUSZTSHiTCbEybq3Mc1frB+EGOfpu2XTGKBsTNLNBItRm7cdsN3CbEH8xu9g0SIpv30S8d8hxNHPvWtkTbEPeAeX9wrXh1vqDvy7SqbcSqJBs6bmY9d8gMzeE/mFwKthA31iWCrHE2YIK285b8jEwYJoyJLQoRkbqB3CCqtUrqoCNhXJpvhnn8BjaE647WzEYIAAAAASUVORK5CYII=",yle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAVFBMVEUAAABQh+dIh+dMh+dNhuZJhuZLhudKh+dLiOZKh+ZLiOdLh+dLiOZKiOhKhuZKh+dLiOhKiOj////p8Pzo8Py70valw/Okw/OCre9hlupVj+lKh+fHgVaqAAAAEnRSTlMAICBAUFBfYI+Qv7/Pz8/f7++YjQRgAAAA0ElEQVR42q3TSw6DMAwEUJeUUvohJtAPnfvfs9Ko4CQNEgveisXIHgtFduXOnQJ6PTspaTwWvpHcoUPCHyRxUmT6WiI1Ck7RfEVBb1s8irqlP1Y0qwM+w8hThBz+PAIDcAy0yD3DOPGjZeCKzDuEN+jOgCI1DeEFUM8AQMM4/QqGB2ZJgItZ8JMGFDQxYQVtxQ1RggUXl+RMJqygneni/iy4cEI+SrDgzG/8WVbT2ACqFAVaCa0uqSVyVGS0kUTlkeiq7Q/HuPaigN5at+uL/gLpuz1zBDpoxgAAAABJRU5ErkJggg==",vle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAYAAAAiYZ4HAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACeSURBVHgBlU/BDcIwDLQjBskYyY8R6AhM0lEYAbEB/PKjG9BNzFlKq6hy3PY+duxz7o6oIqX0ow7aXWjmkfqI1sEhXLwlrESUh/Y556+IDK4CMz9RPqUUBvm1HC+/iaEg2/dehjdIYyWPUJn2Du6wdatKV/QDN8F0MGkweJ63VjSH9sENZsEK5nGCFYwcBCsYHYFlpWfpFNqD2eGtuz+KS0lVhtaShQAAAABJRU5ErkJggg==",ble="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAUCAQAAAD4zq+ZAAAAX0lEQVR42rWSwQnAMAhFO0q26M90yWaO4AgZxXoMvBSk0Bzil3cQH17Fp7Vn4kA+YTWZorvaESeY2U0ZMCuxaeQ/bn+Z3V0hw2zknzFUEFOFoqYEKoCh4tNia8/FG3oA9u9BP/x2bmMAAAAASUVORK5CYII=",wle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAYCAQAAABdXGW6AAAAfklEQVR42sWTsQ3AIAwEGYkmypuKUbxB2NQjeBRHgnQfSymi5CsEJz2ccFmBFwrtIm6h+AzaDzhCDJpCUDh6KVuFy0ggsVavkw5PIAStGZplM63ultUNeKurDJq+DiqGmNd+TSZrY4i1EZRryw3lSlkbQ6yNIdZG0B/f99FInZ+KXTsZ1UQcAAAAAElFTkSuQmCC",Sle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAQAAAAkETzVAAAAmElEQVR42tWUwQ2FIBBELYEStguHG51+O+B3QCmWYAmrC4mXMRM9eHBJODAvSzYvMI3CinWiukzgcKLO5AsoDC2SXGEShc0bfKy8wQSaKxxLSTAscDSBxtnoVVL0FWhcX1JPLXKB9pF+sJKO3fP/5lgzjcVw7WiDvWBLOmGUnQiUnTCqnTDKTgTKThhVThhlJ998hpw8+Ih2l2bD55BOCFYAAAAASUVORK5CYII=",Cle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAQAAACiV3CzAAAAq0lEQVR42u2U0Q3CMAxEO4K34fLnUbIB3aDZLKN0hI5gREUj4JCvfEPyE+vyJMtP8nQcrFgnOkmGQIwiyX4CgKPfM3TUEwAWxNNdBIC6f2tubmXe354DHVHmUTUEeg4Ewu2o3BBlS4HL9g4gZEtoA7/qlhyBKLOb22NeVY21vYy1nRFXhzjPbLJUYZMAYZMBYZMBYZMBYZMBZZMBbZMBbZMBtvnfSx+yr9f9DT317s3RCEojAAAAAElFTkSuQmCC",xle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAAL0lEQVR42mMgE7za/16BgeG9wqv9UIGXDa/uv3Z4df95ApADF/oP5iLAfQEc5gEAJtUSZrejPioAAAAASUVORK5CYII=",Ele="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAM0lEQVR42mOgCngvAKdh4JXBq/evDIBCCq/uA2m4cMLL+68SXr9/ngDhI1Tff+1AFbcAAIjsFYm2dIGHAAAAAElFTkSuQmCC",_le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mMYBODV+VcGENZ7g1fnkSUMXt4HSoGEwTS6VAJMGE0KJEwDdwIASDIYtjjyldMAAAAASUVORK5CYII=",Tle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAQUlEQVR42mMYpOC9wqv+9wLYeQwvF7z6/+o8UAAidf/V/zcBcMnnQAGINETq5QKQKIY0QgqLNEIKU/r8ywU09z0AFEs5EhPPEBAAAAAASUVORK5CYII=",Rle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQ0lEQVR42mMYXuBV/qt8DD6KwPtX/1/Xw3iv61/9f3UfVYEBRAlM+vX7VwZAJjYlaNKYShDSOJSApXGD5wqvDOgcgABhSDqIzXGrGAAAAABJRU5ErkJggg==",kle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAKElEQVR42mOgAXh1/pUBdgmDl/fJkEp4dR+L8HuDV2AdhIURrqLMXwBPfxi2n7+e4QAAAABJRU5ErkJggg==",Ile="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAO0lEQVR42mMYHODV/hcFeKSfK7y6/7qeEgXvBV6dfzUfr/TLBbgkgYa/bMAlafDqPh63vzr/PIGuIQkAv6gfeXrCls8AAAAASUVORK5CYII=",Mle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAPUlEQVR42mMYFuBVwsv17wUIK5vw6vx7BYLKXja8uk+EshcFr+6/MiDKNAJK3huATBpgJYhQMnhlMAjiFABTzyYOQ14HUQAAAABJRU5ErkJggg==",Dle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAVklEQVR42mMYEeC9wsuG9wpEKX3Z8Or/q/tEKX6u8Oo+0YrfC7zaD1T8/rUDUc54NQGo+P+LAqLdDIQJRCh9XQ9RSqTClw0DoPBVAlwhYaUghUM/gQIAnrxLl782xCgAAAAASUVORK5CYII=",Ple="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAe0lEQVR42mMYBeSA9wovG94rkKDhZcOr/6/uk6DlucKr80At718GkGDLqwlALf9f15PkMLCWfhK0vAl49R6o6TwJvnntALLlZQPRwfvqPsiG5wrEKTd4DXbQfQHivBwAUv5yAbGBGg9y+4sJxCpPgHmVaA0g5aN5CgUAAKaOVEis65zCAAAAAElFTkSuQmCC",Nle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAQAAACxtDVnAAAARElEQVR42r2LsQ0AIAzDckpO7Wec0lPMFLogseGtdqqAWSyscHQD0PimJ43OR9JoA8wlKhuAMyxhCksJigkJ4XdoWm82zgd3SwpxHbYAAAAASUVORK5CYII=",Ole="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAQAAACoAz4qAAAAW0lEQVR42t3LQQ3AMAwEQUMIBEMppEIpg0IJhEIwlKssa6XKyqPv7CvyXOybXFNTbtQwlIXGGunRWCC/GXR0Zc6goVkqF83iC4QZ6MznobsQrgFXglt7cCjsfy/4pJHeGBKbFQAAAABJRU5ErkJggg==",Ble="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAQAAAAOAB1aAAAAUklEQVR42u3LsQ2AUAhFUUZh/yUchVGOlSGYryY2Nt7ukUOckzabjLukAiUfUcNrVKAarlFCrwsUAeOyQgdbwDlhvjc7ULOGFbPJup99wErFu3ZCkbYJrFeQSQAAAABJRU5ErkJggg==",Lle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAQAAABO1swWAAAAaUlEQVR42u3RuxGAMAwDUI2WERjBI7BBvCmjiAqZXHSXVFSoyMd+58ZwYWPDTthJkn0TCq+gwR567OGlU9jDZOoWthBg6iVs4ZtOmFFwpAOOogk4qn88cwOw1PThaeWnX9JDi1yHwXOu3itNGcbz+v9BAAAAAElFTkSuQmCC",Ule="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAQAAADR77dlAAAAcElEQVR42u3SsRGAIBBE0SvJEuwEO7MES6KEK2ENlAH/3MyRGehGwPyXYdG0atehxeamorYynYNkOUiWZ4R5TpjnhPmGEwlzM90zA4nzEYREdcyfAMSvB+85AUht1yrvOQAajID7wdeBt6+WjV/tlZ0UIJnOEshoEAAAAABJRU5ErkJggg==",Vle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAiUlEQVR42t3TMRHDMAyF4UAwBEMJhEIIBEEQg5ZBoAiCIWi1nnonCs2iqUPkNb8n3313WqTt2X1feF/vKOHoGBAnJwg0+j1X4/wZYxR5BvG9wKNNyhnGBY6RDB/jOr+C+r7CT5xrfGjb/sMxqcizRZ5kiUdDFHmGiF7i2SSoMQSirbzUxk7PPtwfpfKM+z4xWY8AAAAASUVORK5CYII=",Fle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAw0lEQVR42u3UwQ2DMAyF4Y7ACBmBERiBEbJB2aDZADagm2SEjOBj4hekrFBxwVKrBqzSG//Nkb5DrCi3q5MrDSw7drlTU9xzgWeXJgRQMQqaH6C4AVgmtEfpiLBSaelBhyhmBGo+Tn3u9pfk+blNRu6KKQ17NKRJKEjAuvcaNSB2b9MW/NKrqcxVmoYahf1G21yirdHKfRFyV6M7e67RaP9FpR/o0sMrqQSLWU/lcZZilFRiB8KIUaiqaNjlgZrrEz65F5/8tPgThvqaAAAAAElFTkSuQmCC",Hle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA3klEQVR42u3VwQ2DIBTG8Y7gCI7ACIzgBnWDsgFs0G5QN3AERnAEjsr3TFih8dC8WpIq0JPxf8PDTwLxeTk7cqFC6403JIsQ0nDULxAsHNpMBoPvXPVejzUc6TzGxM8mlcbUcMxwJBGKGA6WZDbzech4TCqXefqOV8sNFjAc9XOzi5lUxKyCG+sdzNj+ZkjjucUIClsMbryfEua6g4Ejmc1wEBDlTPyN2f8wQwHD0T1mKECkj46wfrdv0hgeEvb7NplJ3FEpw9NGFzI8l2G9oZ7PJru58YaUq85f8XF7AYq41A6c7tN/AAAAAElFTkSuQmCC",zle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABGUlEQVR42u3WwY2DMBCFYZeQElwCJbgEOsh2kHRAOggdkA4ogRIowUfjN0guYVa+7LDxwSRziCLxc4LDJ+OREebo6KORoy6O8JgwxNboSycawf8uT05HWngwpaVf22DJ0RU+w+tZSWIO1myKt8ySU5H+ZJ5CD4ZXkmXwslYVWWzB8BrZUALHx5bEBXP6uycHxvwGaTZRBwbLwIKVXdWRPyYnK512n50aKfNf+l0kzmBwvNXIZGX6SlKiu4xJTcpTSsHWyctrJJoqSZ2aLKNxPwne+UUNllyFLJ/W+0LSqckyDDIyJSnRDEajJkuU3DO5XI0m9OA4FodCV7BIYAzk0NBdSGVrm9l8FS+uW218YMK89OSOX76jD/YLwCSjzIWTKu0AAAAASUVORK5CYII=",Qle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA/0lEQVR42u3XwZGDMAyFYUpwCS6BElwCJVBCOoAStgPSwZbgEijBx+CnnVEJ2gnLRhNyy0iXjH9O+PCJizF0rVbr/Tigp8TBhaYJBXJcBQtHQ74OxHeYGCsy8TFkNOJp2sFM6bGS6nUfOJnxde5ObZd9ffDhdQRzMOc1ZMh2Mec1jBBkQ54Dh+d7CNiO74nPzwuBWPKyfb0OMOTr9cT3EKzmvIYFgsWN54gCoeTFB6wQLL58ucUP5zWwC6/9DJRceO2D+OjG6/anbxde34/KmPO3eIeceD2j3Hg9yB143XKQ/xGUlDeszpDjQ1GUNw0j8t+IOpfQeVVC+2Fptd7vF03+0vO+G3PwAAAAAElFTkSuQmCC",Gle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAv0lEQVR4AWPACkbB/4tC94H4PHUMuyScADTsPxQXUGbYeQkFsOsQBr7/f15BgALXCfXDDUPgBrJdBzMk0NsEiI3hhoLkyAm7+TADLCwswBjGB8rtpyQi/rs6mcEMRODLIg4kJhOE5kAfuJeR8X1iDctHj4iyDJ3/WXH6cD5yMiIhmSDw7BbV/7Nb1eB89GREMCJIwpdE+gklEwTGTDbY8XlRA0wDLwiuJ8tARDLCTCZkYkQyQniXcgNBZjAMCQAAySKxJKUJDoEAAAAASUVORK5CYII=",$le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABC0lEQVR4AWOgGRgF/y8JB/y/KPT+/2WheppZArTgPhD/B+Pzoga0sKAeZDgcXxLeT10LzksogIIJagECXxZxoGZczAcbionPU9MX//HgAmrExXmYgVtmKP63sLD4v6JPGW4JOBjPKwhQEkwJyK5uKtQCWQKi0X3TQHGSheH+anWwJf1V6uiWvAcFKwVJFoFnt6iCLAHT6HJAX6+nKMmix8nBhXJgPrYkTXGSvblFEmzJ2dUycDH0DEpxkv18XOR/oLfJ/09AGpcaUGIhOslSgO/DkzThJIuJn+0TB0U6iCZkUQPRSZaU1IXAiAyKM8lS6hNE3Ij0o0W2gAAsyVITQ3xDOMIpTwCkglEAABosqY4+fsNPAAAAAElFTkSuQmCC",Wle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAABE0lEQVR4AWMYVGAUjIL/5yUU/l8Uug/CIDb9LL4kPB9o6X8QBrL309O3/1HwZREH2lt8QXA9usWgIKd1ECfALcPEDTSzGOQzPBa//39eQYAWltbDLHm2T/x/oLcJEBv//3RcBGH5JZF+miaos6tl/ltYWIDxwYVytEpoiOwDwze3SMItvrlVCiqOyF5U8q2AAXp8fj4uArMYFtQYvqZZgnJ1MvvvAsQ4Etp9UEKjSfaJCzUEYypnL0R5jMvgsgwdINb9T+XshUhQuPDsFtX/s1vV/uNTAzKDrOxDGUYkNJLLY8owInuRn6AwMazkItbyBJKzD+UWI7IXwfKYRrgBn8X/aYjf47N4Au0sFp7AMKLAKAAADGVMb+YtB7MAAAAASUVORK5CYII=",jle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAMAAAApB0NrAAAAbFBMVEUAAAD/zyD/zxj/0xT/0hP/0RL/0RL/0RL/0RL/zxL/0hT/0hP/0BH/0hP/0RL/0RL/0RL/0RLzxxTyxxTmvhfmvRfZtBnNqxzBoR60mCG0lyCbhCWQeyiPeyeCcSp2aC1eVTFRTDRRSzQ4ODicBnJqAAAAEXRSTlMAECBAYG9wf4CAj5+vv8/f7/2ThQkAAACiSURBVHja5c+7EoJADEZhXFFQBPaAd8Vb3v8dHZYdCjPE2vFr0vxFTvIvMtbfJg6YJ7YCqO1JSi83NzU9PzMmCwLrbVcTOfPhTq5AaXVvRWRn9G+ARkRaoLK6n/IId2l03+Q+3Z8RdHIhyKe7T3Ik8E53M9jLgUGpu6Pm1RLo/gqt1N1aqrvjz2cA3Z/xuVH9zqPEftWtFeOGaeNmhaIe+jFvQxsaDFC9uPoAAAAASUVORK5CYII=",Kle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAgVBMVEUAAAD/zyD/zxj/zxX/0xT/zxT/0hP/0hP/0RL/0RL/zxL/0RL/0RL/0hT/0hL/0hP/0hP/0RL/0RL/0RL/0RLmvhfmvRfZtRrZtBnNqxzBoR7AoR60mCG0mCC0lyCojiObhCWPeyeCcSp2aCxqXi9eVTFRSzRRSzNFQjZEQjY4ODhfPMFcAAAAFHRSTlMAECAwQEBQYG9wcH+Aj4+fv8/f7/5x3csAAADaSURBVHja7dLJEoIwEEVRiPNITJ7zPAH2/3+gCLSkKmC7tcqzfpu+1cFfoWtN55udMoANA9kImbG8U3ixShxGyGnxEpTawtCgNPu86+FtIKXBNk2WEBJNkbkT3ZCZSGl4CCWkufJQC5dciC6c6GOaM9EJOVO/66NwfA8xbkhT2BEdkGlKFKG0IVqjNKlLw1bOEC1vqMHmRAsw7aepxAmYn8iggQm9//f5iZRF5ZAmnMdLFMEREz3giNw0rpQoAWrvmcG1i9M9XLpKI+hJaRh/kf12OBSWdhj8hieb1jFTUa/J4wAAAABJRU5ErkJggg==",Yle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVElEQVR42u2TwQkAMAgDO1L2X8IR+m4+XaHPgFCMf/OUOzCga9INg8izC8ZfwNlEwjUplRqXYuNShJtKieeqxxO0u7pYuLrYuBQbl9I6DYIxT9PNA4o8VtF3MgEsAAAAAElFTkSuQmCC",qle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQklEQVR42mOgG3hv8MoAH5/hlcHL+0AhhDSEh6kEQxpTCUIahxIc0gi7X2JXgLAbYhFOaYRbcErjUAIyGp1Pt1gCAJlgRF5JwRrRAAAAAElFTkSuQmCC",Jle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASUlEQVR42tXSsQ0AIAwDQUby/stQ44YVKF8CFNdJaV3xRUan27KKjbPWtC7G8tLIoJFBYYEGRtuqIW20lozWyKAlC9SyflunNzw6+VRa7YVjuAAAAABJRU5ErkJggg==",Xle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUElEQVR42uXTsQkAIBQDUUfK/stYm8YVHOCQw1rLz70m4Pj87TQv99Gs2TAvriCSkzBXgtwJciOSc5klAMs0QriMEAwJIjmI5k6a5nb//F8epURkVhYEprEAAAAASUVORK5CYII=",Zle="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAAAZElEQVR42u3UoQ0AIBBD0Rvl9l+qkuQMI4AkPyGEChz1z3zR+Hu9UqlnbNazVDrBUYuSjQNsSUrWMuKCWozUYqRkBgVzqMGYBJkMptI1ZcmVyWIsbDHSa2ZQsA09QTJS/eN5vQkSV9KpeTEwdAAAAABJRU5ErkJggg==",ece="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAb0lEQVR42u3UMQoAIQxEUY/i/S81pZDGI7hlCGH5MKWY/r9iBMe7Cy8U2nP83J6hEAEnkuj5AWDNSvR8dRwIyIGAnAnMmYCcCciZMPI6XW7h5QpZRE6Xc1p5fRErB4JyICg3iJ53goCad0Lv273wPk938O0H4XiSAAAAAElFTkSuQmCC",tce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42u3UoQ0AIAxEUUa6/ZfoCGjOsAICcYaE5Fs42eQlPdG2nzfjsk7zKdcda3TrQDO9c0TDEQ1HNDwUcEDTdXQLUmsvj2i6IxqOaDii4fgwLNd/G29mAaFvZs0tXJk5AAAAAElFTkSuQmCC",nce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAZ0lEQVR42u3UoQ3AQAwEwZTk/ptwCcF/JC1ECln2irTkgZdaGnDA1zQdXjq1uz+V/gfVulMb5rtKCkZRMIqCEZRgoDQDBSMpybDNchDbsJVi2EozUJqB0gyUZqA0A6UeG1R63v90eC8Q1obFqrJdhAAAAABJRU5ErkJggg==",ice="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAeUlEQVR42u3VsQkAIAxE0YyS/ZdKKaRxBK3lgyC5Rsgf4DU5iHVd92kZGdPt0vSMjFd05cmSXI/ocLIkh5sV2DJJVkKSlZBkSUpYkAoWpIIVkLw4liAgI6PMckQYWJ3EwDQk2DpJtkyWWZIi9iAv7CtKkmz04+26T9vQ9w9A6VN2wwAAAABJRU5ErkJggg==",rce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAjElEQVR42u3WsQnEQAwFUZWi/ptSaFCyJfiyWxwN7GBwoF/AvEwoZrPZ7Mvr6loZwVvZ1XUC3JuA/H0AXLkJzl8ZIQidZ4LzmsC8JzDvCcx7AvOegLwnIO8JyJutP7DyvXx1KYKPAhwQm8cD4vNA2DwQPs+EzzPh80z4vCeeeSZOgJ1noubRm81mX94P7VtLyANR15cAAAAASUVORK5CYII=",sce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUklEQVR42uWTIQ4AIAwDecJ+DD+dpog9oUggiKWOhFVVnLgmK5/fqOCeURMAdFstDEyBs+uA54B2oKgPivpgmKTfGwjC5b0eBSJf6dZf6e3zv5y2JmwtYMj/BQAAAABJRU5ErkJggg==",oce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYklEQVR42u2UsQ3AMAgEMwobho1dGr2LH4E0aZBSoFBYln10L13BI3EdFgX3IDyOaVb2LjHpAqblr2ya3ApyGniheXiheXihPJDyWzZ9t2uls20qkxITSlo2hccZND0/bxYPPLmGdf0FY6cAAAAASUVORK5CYII=",ace="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAa0lEQVR42u2VQQrAMAgE+xR/lvzcY2BT2CfYUyk0UBAUSnC87WEOsuJRFBmgTcKW0bN5RTpkTYeAXpE58k1E6hfFAAsqAyyoDDDn6vNFpMSIOvRe6ZeoDubHIlLWlOI64acM75kcvZ5SkcEFMgWf7L/2zCEAAAAASUVORK5CYII=",lce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAgElEQVR42u3WsQ2FMAyEYY9ym+dtklFSRu8aj3B0UBiaYISQ/Lv/mlwRq6rq6Rzs1Ok1h63FRl1eX0VFTVhogqJuoHbah9DBkY7G3kcTdhvRhN1GNGG3EU2fGEU5stHjWUYaOvH/JaKxQj+GOizkuIN26vKaLXXsNl6fqN9HVe1tjOFMm55q0PwAAAAASUVORK5CYII=",cce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAj0lEQVR42u2WMQ7EIAwEeQo/PX4QfkiZY134CXtlilxIYVmRop0tkZiGxS5CiPdiH3Pwf8xti16/gevMViLAwb2WC/YKwmMCgnfnEjwsGBhxQZDnBantBsHUdoNgartBMPXp5gsc9JoomA3EkZHQbnTzQ6APUAIJzu0+4/FVZjZwnW8vMdBXA2c2LdxCvJcfTx6WVC9+9nMAAAAASUVORK5CYII=",uce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAWElEQVR42mMYzuDVfVI1/B/VQEUNr86/MkBoeG/w6jwhDQYv7wO1ADWAlYPZRGl59R+hnDgt/2HKidNCpGPuk5gQge4WwBR9L4AziF82vPqPDb5sGF5ZFwD111dtBCPJzwAAAABJRU5ErkJggg==",dce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYklEQVR42u3UsQ3AMAgEwIziERjNm3oEWudT/AhESoNSOArCJU+FXlchcVS2BprBVrjwfowBeWMKxl8sp0IcU/DsQQ4LU+cwp3FuTsM8RKGJHmRbt2yfd58dtp6Ls9drTuQGTkBukoVMYJoAAAAASUVORK5CYII=",hce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAcklEQVR42u3VuwnAMAwEUI/iETSSN/YIKkMuhUa4QBpjAibxpzE6dUI8VAgUPLsGOguiQw45tApChrwhE+S/kJwKqSETPL1uCqyZbgocYgoFFmaMYmGGqE4GOmcmgJNOFGYxNGPx20YJCrbqsiP5k94hN8Pjg5CCX8/rAAAAAElFTkSuQmCC",fce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAiElEQVR42u3Wuw3DMAxFUY3CzZNNPApLIbfRCC9lBMaAPzTshletcBpBBFtVPRSOX48KFVpooYUm5tKwNXQYjp9F9WMRmkidRLvNLEIz2a21NItQJNMsQoHMswhFMs8KBTLPpkkc/2cDGe5d9nsQeh4d1jYadgxd0M7zOvDan/cuculWC2F1Q1+W+iqEPfPrPQAAAABJRU5ErkJggg==",pce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAmklEQVR42u3XMQqAMBBEUY+So3oEb5hSHYs9wsoWukgQEpJFi5mUhv9AsHDiOK59yMixgEIJECBAgMDvAGRkSW+AJHveC+hNOOB57QTWdBEOPPPrhfcTDhT5cYQBRX4kYUCRH0kYEJB3wo7nA4iwvBOD8hYKuu8fVNf97wGBSvW7lgSFNAH7DG072zK1DcshtfFD9pm/Nhz3thNcllF41PC9PAAAAABJRU5ErkJggg==",gce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaklEQVR42u2OsQ2AMAwEM0pGyEgeJRvAhi4hn8IjGMkW1J8KCXFuvji/vnwda9isrug6+lA0Vg8VjXqxNg2SefRzZ9olmiMflR8jkQk9gEyj9cyv6ck0Wk/gtJ7AaT2BweH3MCj8OS0/S1y60XjnRuV7GgAAAABJRU5ErkJggg==",mce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcUlEQVR42u3UsRHAIAwDwIzCCIyUURiBDSkTlMIjkHPBKSlFlXDIlYo/Q+Nt5WuxWJOFQYpy5loQh6gzRHKNelTu9AmQa5K2cp/3IwiUz2UXaOcyZZ+PMpfJlEEbocQ6JdYpsaH59L9jR3tNWdftl7kB3j6Y+KqwnCsAAAAASUVORK5CYII=",Ace="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAfUlEQVR42u3VsQ3AIAwEQI/ACIzgkdiQkSijmMIjkAJFL1FF/iaF390XJ5sGyWQ+xYs1rzyjNma/hynNmIqYgiIYEVAUA8pLiDl3mN1aaJv3HHRXDR4FCl2AAUUyoCgGXTI7LANokQwgkgFEMoBYBo+99kw3RXfMyK8n8+s8oO622gTIMwAAAAAASUVORK5CYII=",yce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnklEQVR42u3WsQnDUAwE0IzyR/AI3jTZyCOoNNEvNIKSmMAVRyBwcmN0113x4P9Kt07nqvFlrqVgDN8837UYdaR5znAjViPd9rEPYkXygIjVSbC+qWR8SbDh6YtAHr3zPlfp4c8HWOzyX4LFLpJgK0mwKZO0Rz1plySRShJoehaSQGtJoDrJqE4yqpOMoiA/PNX+RY3J32ifLJ3OuXkBncyAAuBmORMAAAAASUVORK5CYII=",vce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAApElEQVR42u3WsQnFMAwE0D9CRtD+S3gUlYZLcSPow+eHSxNCSA5S6NwYFe/AqPCn0+ncywwuNpyBgUJhMDx8olauRCEZFh45Y/5vDAf/Q1Vh4VWB4eBVQdSMp3g9iOZEcXmGTyRUofkwbY7mls2x8PsKE68KC695883b+POYeAWFMvEqMPEqMPEqMPEqMPEq0Nl4bdjByQtresCfFPRnutPpvDVfvzHRDtqTrQ8AAAAASUVORK5CYII=",bce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAZElEQVR42u2TsQ2AMAwEf4SM4pGyCdnUdZ4iIxiBaMCKIVLK3Ld3cmUsRtk32rUMUGn3FD1omvCgyRkGAbwuYeB1IAy8/hF4HaD+CCgUxPSPM48GNjNoCS9aCoJaaH61rKcZ5QC7imUvE/b3DAAAAABJRU5ErkJggg==",wce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAc0lEQVR42u3UsQ3AIAwEQEZghIzgDcOGGcFlxFN4BEeiiJtAYtEEif/ydYUbh5VJU/Yi0FoONWDoXe7jA/S8CIGhXQw+tyYlNzYaghsbdWOjTmzU1s/YqMWBQQ7auWocg0ew/hZLbG0SX3BO0HZzWk9r0lxWhYtbNp9UyAAAAABJRU5ErkJggg==",Sce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeElEQVR42u3VwQ2AIAyF4Y7AKGwoGzpCz9QDI9R40HeDmkpiQv/eSvKdSEpRNKNjE32G760wtnjpJsqJurV8sQbIwGQXBIbIBYFxQWBcEBgXBMYFgUGmf9Rl0HtIdjAOCP0bEv4K0rWhlmhQSwaoFtHx1BJHKZrRCQLDqH6QqDo7AAAAAElFTkSuQmCC",Cce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoklEQVR42u3WsQ0DIQyFYY/ACGyWjJANMlJGyCguiR6FR3C6sxQ3Dqa5k3+XoE9CQgKqquoItylQ2PCxwtDfmc8YytA4CqVIsY3SwTtRIzmNenL0NOpJojTqyTTqyS2oJ4kgUGmLqCft5o6+gHrSwhu8fHxPWsuokVtRIxNooiw6X+CtqF2pQi+ECjQyU/55Tu5gaBT+PGhn3EbnVv+k6qx9AYfqioiJfroGAAAAAElFTkSuQmCC",xce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAi0lEQVR42u2WMQrAIBAE7yn5WfKTPPXKwFn4BNNcEbDYyEaQsHOd6AxiowkhxMrEXmq0x3iue7R+ymmjpAgHcmyUd4fqFs4GsN6pANZfGxXAejMqgPVUAOupANaTAaSnA0A/I9Drc9U/C6SeAV/7D4EJb4D2KqBAT9RoA+PjgSP8rb7U69BHTwixMjehJoDDoS1ZfQAAAABJRU5ErkJggg==",Ece="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAlklEQVR42t3SQQ3DMAwFUEMohEAIhEEohEIIgwXCIIxJIASCj4m/KxnCdugmZRe3t1V9uSSSFftLpisB4+UcpnPQm2RNFugIC6gokuUJ1rsXmr9vydutBdSeyLfOKMNnEUY+yZJ/+zc/SU/9QQOYTeRBHEuwoOyGloxqYStXW2fa1xNYTQ0FizAiHdECT58R6//Xm+my3tIEisWmhZRlAAAAAElFTkSuQmCC",_ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAApElEQVR42mMYBWSDV/df/ScC3h8ZofFe4LXDawdyNCq82v/6/av9r86/uv+6nrjQvg/Xev9FAYT9XAFoxHzSoi8BhX8eyicMXju82o9DhDB42fCyAcMt/4nW/GICpmZKnH2eiNCGib0MQA9A4kPb4CUwqhAx/ur/ewXidCJi9z4okbx+DwrAV/dB2kkyAOhXg/sCIDYh7YTjYAMdSpL7oyXsYAEASCuxsboove4AAAAASUVORK5CYII=",Tce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAwUlEQVR42u3UwQ2DMAwF0D9CRsgojMAIbNJs0G4Am3gERvAR5RvJI9ALqoSgUhNxqZSXW06xv2M0zY7KreBo69gRB4o5N3MKB9TxSKFYpwHQsPYUzh5RjnNOOMiJ8nv8+ilqxklFgZS1x4l1FJShe8CJBzrKcPt6X4a+xMskHWXylNPlXI0oY925Sx6pSyyMH8jpOIAeONsTNXKicvAILNEe5hSqB9RYYp72vzZat78y4A58UXCPPHHAf6C2Nd9UeQOQkNdOJZ4y6QAAAABJRU5ErkJggg==",Rce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA+UlEQVR42u2V0Q3CMAxEMwIjZISM0BEYgRHYADaADcIGsAEjdAR/prkgZQQjUX+0akGq20og8vIZ6XQ9+xpTKPweILDi0CqiZRxzSBW8JE/xip2ZS7a4D4eU7TxJAqccj+ElA4fdy3OGm75SJB9+BaOmjekRL7o9JcmSQcEO/G9A4MfWaIAHN3szQrMHNzfd1GvweHbBqjsFBn+6+yJRAqdq9MaBUetEz+DmPJr2CQw/baWoMw6Ge1OJSiEqXqWUfUnxqUWa7+Fa7+mQMrjrU51s/6Qs/ucQbLygboOBT1WwIJFdklVl49EsS7Dyl1U80aQsY3nfC//CE0HU3brcVJnTAAAAAElFTkSuQmCC",kce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABD0lEQVR42u2WUY3DMAyGDaEQAiEQAuEgFMIYdAwOwsYkEAohj738fjAEn85SNe3WVdOcvkz58lKlUX7bsS1Tp9N5BAXqWOVwgf5EnVeRgU/ILFAWZJ4kUEvqFwv0fvFEreDJrswYl0BUBk71ajuXdyu53P0fodB6/ieaIFD+biFQ7PoHEC1QiXyY/TNtUs8WJh/IUIzPMgsK8QoIVIa98C7BJ6DQff84HegBz1BEcrBrowSoyXuwTMk7GZbdPQiy7YMEq6DRXWg/JygEcfP6i7eSjbXzSFi94okFdtL2DPdL2JqRV4Psq53EEur11rKROf3ttZQwEDkhloGMmwQdhkn02egTpuviFOgTdKfTml+iqgQxu12OPAAAAABJRU5ErkJggg==",Ice="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGWSURBVHgB7VS7ccJAED0JiA0BzJBBBVYHtioAd4ArsDsQqsB2B7gCiwrAFWBXgDL9AkEgJfr5LbrAlk4SikzAm9m5m729/b47xq74b0hNBp7n3WdZNsN2Dplw9RdJr9fTB4OBWXdfrjrwfb8P5y/YfiDAMUkSdTQaSSTQPUI+oyjakA3ZsjYV0AW6DMffYRg+T6fTQ43dEts7VKOimgM7B5SVbduvAocKZFLUO46z4tU2gxy4rrsH+oLAO5ztBHf60Ps0r+JZaQYoWcOii9oSx/EDy/v/B9QatPMNc5o3BpAkSWE5S0qQZVlBr4V9TtN0hfMZawJKzUR6zqoNZmO0uVtJ0yI4Q3RkecNaQBTAtCxrwloC2QtbKwqwRpYL1h7nBcCQDchT3essgttqYJHeGGA4HG6xvIOupYfT7XZNsGVd1IO+GunH47FZPKv9KlDJFk71qi+A21EiShAEqujtCFlEDulvweOR4IBe74IP8QQiASirIfM9Mj9WOa+s4DfIGYa+RDW3LB8k4dSqTqdj8JZeccH4AX5f9o7yWO0LAAAAAElFTkSuQmCC",Mce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAG4SURBVHgB7VbLbcJAEN214I4vSNxwBYEO3EnSQeiApIJABUkqSFJBSAdOBebG72BHAg587LwnrS/Iu+vFyiXyk9ACM/NmZzwfC9GgwX+DdFFOkqRzOp3u8zwPpZQDnB2cKc4I4qjdbk99359X4fKqKNHhZrN5gtM4yzL4ko/b7TbodruSJ3/DuX88Hj+pR31RFyDpr9freLlcTuI4NhIuFov+arV6oT7tRA2nHZKA7MHFjvrK+XWRM20geBZXAHYT2gtXFClm+jTEd/gkuqhUtrRybXGhUEY4Zr1eb14mP5/PMxzvqOK0TM7/UXDTw+EwEi7AbVmhoagB2pOnTGZqp0Gr1YqE4WIoojeDvVD2A+ECEOcmOVvLpmPiMUWcmtohCIJUWKDsU1fHESaVW5ouoOwjJ8eoyC+Mx1DUADhuwfHtZGTrQ8L0jG1zQBux6s9XpGus00E0U50Mc2AM+YduDhhRzGr049jFjvq0sy0VI5gqknBm2zZOsT5NKS5g3cdMFRb8EF9/uG95AU6k4tkrZyGj5L7GKJW73W5oS7HTGwijwNIfeZ53c/kGwi7Y7/eTKv3doMGf4hfzsWz2FxjyIQAAAABJRU5ErkJggg==",Dce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHlSURBVHgB7ZbLccIwEIbXBu5wYYabqSB0gFMBSQXQQdIBSQekAuwKGCoIVBA6sG68hnEODAdezr+JOOSAZcnKJfib8Qis9fqXvNpdooKCghvDIQPiOK4ej8fe+XxuO47Twi1PTgl5hZVKZVKr1QRp4uoYs5D1et0/HA4fp9PJK5VKIcb7er3u8AWTR9d135Ik8WETsS39FRDjrVYrfskoiqKqyn4+n3vL5TLgZ/hZsslFzGKxeCZNIOrFuih2yI7JEF6IFKXcWSUcB3A2TLPBfA9XnPZC/tR5FvWN/FQJx0OaHc+rRLNYCMq3S3LlQ7IEfA1Ucag69l0c4zFZAr4mGPxUG0rHQ/ITChte+Ts+x0hlh9w0g6g7MoXjJ4sd56Wstio7rUx9jWaz+UmWUAkSqhOmg/QlyFQQCucMRbJFlpC+BJkKAlNUdZ8sgQPSwRCSqaByuRxglzo2Ur6sZT10BxMyFYR+hoM13O/3uZMjjnwfbclro9EQlAfenSyVHvODa3OyHkZkC1mrjBquzWbzxM/aPK2/RHFty9LbyO5ypCtGu6fmFgKBzjsVICbG+C3Qvs4uolEaWrjXxt8HzIe73W6gkziNmnx+MfppHz+79NPge3JKcO7CON1ut4HNDF5QUPBv+QI+a1B3e6jnTgAAAABJRU5ErkJggg==",Pce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALPSURBVHgB7VfLjeJAEC0YwYULSHzEzUSwMxGsiWDJADaCYSLY2QiYiWAggmUiwESwZIBviI8EF5D473umkXzAdtt4T+Mntbox1eXn6qrqKpEECRIkSPAlkJI7sVwu8/v9voHldwwzlUrlz+dzXv09UmNYLpe7cgciEyXBw+HwjGXbRcwPNj6iWyqVfksERCIKkgasOMDSUI8skPgEYWu9Xtu1Wm01Ho/zuVzOwHMTz5uQebwSzmQy9UKhYEsIhCYKko+w5EBZkVb6CStZQfsWi0XjdDp15PJxK4w63GEkmkhLCNCSV5IYPVjvSYckUSwW+7DkE/fhJz9yQH3yPzCbzcYY5+l02vWSwX8NyHT8SHA/9VAffV00oG3R+Xz+Sy7HZm82m7aXHFyBx9vebrdvXjLZbJb7berb7XaeuiIRxZG11PzCYPER/VSz5SWAQFrRt7nG/Kxr1UDgiFrqqP5KjIC+gdLbCpLVtSiTuSBqexIjmNLc+v2gRRQKnRyYTqetIFlahwElGmDeVUszSFaLKBQ6RJFebD855kpMH/iwPzrH6dIX6KOh8iiDwO//h4cHS1QQ4eMM0dcXG1FHYVB08sUgOBRNhIn2UERxvxsSI1z6Aq9SXR91rISoNyVGsGBRy3iIQqHlCKfTPyReNNUc6C5aRBGdfbkcv4mr1JQYwAyhsomtU1RrEVVB8s415o97rzzuVyWfqGoqENrpCYUEiwwbg0Vzx0sObmK751tQ+w3qq1QqrxI3JpOJgUS+VPezp2Upd+s55bmP++FCSy+5Wwhd4eMl9Cu2IU6FjwB7YVEctI++TbfBku0JXSlUhR+pZ6IlcAu5e6YRXt7j3c1rkT6tutNrz8RsYSpZ+3g81qvVqi0hcFe7jOLjFUSaLsLeL4IVEUDvKLrfAurZ2/slBrAAgdXY038T1W2q4yUhC2OI/qofhWCCBAkSJIgH/wCcA5YCjfohpQAAAABJRU5ErkJggg==",Nce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANoSURBVHgB7VhLbuJAEG07JJtkkUhRJHbmBENOMOYESU4wzgmSGwycIOQEISeAnAC4AXMCPCt+C1iAEOI3r0w5sqIRXW0bNvGTWi5Mt+vb1dWlVIYMGTJk+M6wVEoYj8eXy+XyHuRPjKJlWc52u70MmFjWBLQPsoPRPj09bVxdXU1UCkisAAR3IPgThPRCgYWoQZEKFPFVAsRWgCy+Wq1+Q+jnyOsWFPnAu9ZsNvMLhUJg5W63e3lxcVEEWcR/d3i6nwJYVjWXy1XieiSWAmz1JkiHX9XW63Uln8/7kvW9Xs+xbbsM4X/xKx/eKMXxhrECEL4I4etqJ7yP8XBzc9NRMUCKnJycNJN8yzaZzJYPhEcovCNMbuMKTyCPwfK38ERD7ZSoEw91CFDMD4fDLsZ2NBrVVcoYDAY1+jbxIF7SdWIP0IZV7OrpdPqom88Kv9CQCHR2dkbJwCcezCs9kFvZOluKW8kazK2Ga/r9flW4phiukYaSyAOI+9AiNWmmiQPaT7S3iF4sFs+SNdosxCfsmGikyoJUAVoHIcpEz+fzcngm6MCZqQtygg1eSHxiw50eu7WpjgTixTw93VxJCFFtozabzYc6Eug0j/Leh5zgY3T8K7jVKN/Dem9MthHbNYOlikoRJou6uVoP4GMOPVGviBWgbIKHx+MN54arDIDY95l0dHMlIRTkcJPNRNkEtc4DyBb9Do0gRYSX9vwwKiVMcH193YDgf9WBIVEgsIbJ8Z4UEV5ar2sVwCb26YmzwFFHAkqJcPP6urlaBZA+//DTVcdDqIA2cUg80Aom2vadOhL41kZo6+ZqFaALuNrFonuwWj0C5uFGeO+FVgFOaUGBFSnqDoZo4ShJ3aI0iiIuLIc9PqQOAra+xzwrkjUiBbgCfeWfdWlKpX5QwMS2tZbkqjcoGJEwXqVVr/ggQzyWFd+YwOhFugZKlOhQ081F6qTaySEeVH4rIYy6EtEuAjJFA9fAx6T1OlueDOJh+Aidksmlybitwnvgs60St59DSKNFE6ux9aWfQzBqE3J7hrKNx6+MLR8iUWsRQpRBPkVet/gy0qHyOwwvnuvgP/dra5E2rMmVMzUFQvynTahniuwEi79DmWrSJkFq7XVq4J6fn99DKBcC/tjXXkdHrxHX4hkyZMiQIUMU/wA9rQm9Lp6NEQAAAABJRU5ErkJggg==",Oce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAHUlEQVR42mMY4eDV/Vf/0eD9UX+M+oNqbh8FZAEAw7xLaQ7uEpwAAAAASUVORK5CYII=",Bce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAIklEQVR42mMYBUMUvLr/6j8WeH80ZEYDbTTYRoNpFFAPAABpElqxRvEQ7QAAAABJRU5ErkJggg==",Lce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAJ0lEQVR42mMYBaOAFuDV/Vf/ccD7o6EzGnejYDTuRmNqNKZGwZAHAM75afleRk+rAAAAAElFTkSuQmCC",Uce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAANklEQVR4Ae3UoQ0AIBRDQfZf8vsuAUh8FcldUl/1FgD8Kcnc7XLjKKAAUgUlqRpHC4AMvQDgAJAMCXsuG62CAAAAAElFTkSuQmCC",Vce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAM0lEQVR42u3TsREAQAQAwe+/SbkmXgsSAbOrAAH3gKsy8jcmxhc4BXrQA3rQA/7e3wO7FDcxL7DbvMEfAAAAAElFTkSuQmCC",Fce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAnElEQVR42u2TQQ0DMQwEAyEQDsJBCJQwuTC5MgmEQPCz8vhxEFKpr1ZJXKnfdn+2PNbKK4e/whXtoNLpNPLn8Q2hWpIYgiW9IdfmAoiW11oLcsX1eOYcelXLErBmaegl6hKgz45Ad4CZXw+oU0ttCWgZ/XKSndAQO972H0jwdN8QTkvPxBMVUWEPvsg0Op2qRSL7BPH1FUL78Z98ADZJalfAtE3zAAAAAElFTkSuQmCC",Hce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAoElEQVR42u2UywnDMBAFXwlbgktwKSrBHdgdbgkqYY+xXgxbghMfEghRWBEdQsADOolBjH44+XM4Ua/O/T6UE9rxgZm6JRPAZEtUmg+tqq0LXliXRv2hvum5qRVVGtqPVlQ52iPZXVDFhR7JezDXsXJPc99uRzDXzpkzDTGXyg3jzP2ZE+vUklwAl5KozCUV4/j1q+L4WY/p15nPv+5X3ABsg4N940OAkgAAAABJRU5ErkJggg==",zce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA0ElEQVR42u2VwQ3DIAxFGYERGIERGIUNmg2STcgmGaEj+JjwffAIqZRDq4oWmSqteuBdkZ4+xjam0/kmYnnEwoKdBQuiuI80uLAgcSBrDFkOeQYhNmt4BMGbJ1YH4rEtTQStx0VK1TaoNeLumgJ4iFh9nmTekuc8aUULh0r1AhalqB5eLEQr2hXn5yT6dY3yVHs1JET1jEHgqz2mZRtA4l5pmuctT6VKPKjIqps3JA5ij4USkFi2AT5Ts2p1iI99lCc6mqKq0nO6Ctf+g3T+nBuGoJ4tdAkq7QAAAABJRU5ErkJggg==",Qce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABFUlEQVR42u2WzW2EMBCFXYJLcAmU4FIoYTtgO1g6IB1QAiW4BB+N3xymhEliNjnsD9aAlFz8+cZDn57swcI0Go2XsKVLnhEhEMQ8oz8vHIghDyueELO791vQJ2e+QId+e0bDGWUg/5isl017UJk/on2Vki9ab3RggiC+z0vbqO0pkOTMDmBlV4wQTGaXfIWso0a61FugU24AGMK2NsMQsEYqEMVb/9iUQn1Py6wG5enna22SladfWjDb6kfcGaMdqtt+zzwbHcmB318aNECIkzNa0EMgmNg93bG3kvCW6LUMQcREnm3R+e3SJkb8Tg5pk6MZ8rSW5JI7qi2gW0eEe7+wjj/zW9Hq+ROtqaLXxvYj02j88gk61D7h0pPLFwAAAABJRU5ErkJggg==",Gce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABNElEQVR42u1WwW3EIBC8EiiBElKKO4k7sDuIO3A6cAmUwhMza2lLmChGySNyDh+clOiO4bkjZndW7HJpaGh4DqiRAQ4eBEXhpFd7v8stHHhw5ruI4FUUFF2nrQv7hcFuXXzfJXTtL3WQAQRl8eZnJNgkIkNV9iD4e5ZxTPFi70XBOF7jrD0ILewFZhBz1sQFhCvKHwSDzfIMFFRzGMwWP59hYkpG3gg4cOvOMLeuyCQoiJczzGBB+NsFCFZx/17Ag8Getkj/X5PjCK7TuQdZNC7UgFA1VQ8yb1JcagZKvnmaK14GUDSTf2ZcUIZr4zw7JvKtPl6OamQB9+NTtLwKTSLxe2XGDm9pkcYRvloiLceD44L9jFZLJBHp4USTJXBx/NrSGYk6PKZEhlYt4ds3u6HhUfEBV5d0xwdwyS0AAAAASUVORK5CYII=",$ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJklEQVR42mMYBZSA9wav7pOo/JXBsFaOAK8MXoI1jGAtoxmEXAAAp98twX6fJ7MAAAAASUVORK5CYII=",Wce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALklEQVR42mMYBcMGvDd4dZ58rfdfGYxqHVRaEeCVwUuw5lHtQ077q/OjBdOQBwATzD2eNxLDjAAAAABJRU5ErkJggg==",jce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAANklEQVR42mMYBaOAnuC9wavz1DHm/iuDUWNGjaGrMQjwyuAl2KBRo0aNGrRGvTo/WuGMAloDAIMXTZpz3WOYAAAAAElFTkSuQmCC",Kce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAR0lEQVR42u3WsQkAIAwF0T9K9l8qZSBNRtBSEASL2MjdAK8+EdFVZenp/eRIf0CGQUJ+TUqLbEerFw2DhYXdWKmfdVaF6NAELLyrhahhw6cAAAAASUVORK5CYII=",Yce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAUUlEQVR42u3WMRHAMBADQUMQhOdP6kvPfApBSMoQsMbNLQBdqwUAIZaVnK/psZWcf6fD87uYZ575Y/75aMC5wC4SJEjcTCiaeGytpBb3E8BBH0aosZBAsIJvAAAAAElFTkSuQmCC",qce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVUlEQVR42mMYBWDwuv7Vfwh8XU+Uhlf/7wuA6PcCr/4TqQHBIqT0PtAhmPA+XtMJiVCuAeI0BElYAyY58BoQfqBNKL0XgLGJSh4vG9Dj+WXDaHZkAADCV3PL+8oLtwAAAABJRU5ErkJggg==",Jce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42mMYBQMPXte/+o+Ar+tJ0vzq/30BGPu9wKv/JGpG5tFD86v7r/7jgfdJsBVTdFBrhvkfQpKn+T+EHDmaEQE2ZOL5PTw7kpwtXzZgyxQvG0aLyIEFAAv/li1Dlap7AAAAAElFTkSuQmCC",Xce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAY0lEQVR42u2VMQrAIAxFc4TcWG+a2e/gEX4Hl5Y4lDiUSt6HLOJDkCSSJEt6AZ/pRSKApnJjKCgR/LWfi2Dgi1jwNf7kABFs1n0RZ03R96L9788WAYeKIzBuWwXXaTXXYuK4AIRevGHyWEq0AAAAAElFTkSuQmCC",Zce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAa0lEQVR42u2WQQqAMAwE/Wn78xyFrZAnrKciSKVKBKnd2UOghYEemmQRYnyQioOn2JZiUgMb8ZiUYOvs11IYeDP2rfR4Zv9uAikMVut7UoK1SirpJNL+j1KXegI81PPbIF+PleJr1qolxmYH/PanM9H1rBAAAAAASUVORK5CYII=",eue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAiUlEQVR42u2WQQrDMAwE9RT/tP5B8kMfU68OesL22IIhpq2TQLyzF2GMBgwWMiHEPPjDA3zHw5eR7RewTc02CgS4JftgSyBinIBg52xGAQr4Rcq1gv7T9O9IcLwABaWpxwnaWgIJ5hO0H02z6CRBgJFsh/hvfakZ7Oe52u9g9dhr7lGzFmsh7s8LKhnBT4jVRcEAAAAASUVORK5CYII=",tue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAARUlEQVR42mMYBTQFr+tf/ccNX9djaHj1/74ALsPeC7z6j0UDEN8HmnYfmxasGmDkENJAuaffkxasLxvwRdzLhtGkTVMAAHKFcDmi5NIKAAAAAElFTkSuQmCC",nue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAVElEQVR42mMYBaOABPAq//X7V/8JwRcF2DX/f65AyILnCq/e49AMJu8Dzb+Px33/cQgj6FHNtNRMeVS9f08wkbxXwKH5RQHhxPn6/YuC0Yw8CkgAAMj8irS13s91AAAAAElFTkSuQmCC",iue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAXklEQVR42u2UMQoAMQgE8xR/lvzcUtgc+ASvvCp3e6RIs2NhIQwLik0IQYM+E0WWX30t8rBGEoZci+pX/voYwVHwTdHTJTokOr/+/YPMtEaS9pIaA47iamYMvTkhaG5ExaDkYZF4PAAAAABJRU5ErkJggg==",rue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAbElEQVR42u2Vqw3AMAxEbxRvnm7iUQKjHskILisoSOqQVOq9I0ZPsuQPhBAC6EZnJFO6YQQLYyE+lgajGRI0YzCmUiR5LWW9W6vflT5rSX8m3T+n+9a0W+5YzqXOWEiZHLLzSCu9md6bEAK4APQkgvBre5ljAAAAAElFTkSuQmCC",sue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAeElEQVR42u3WMQ6AIAwF0B6Fm8oN9IaMyO/QI9TNwaXahKjJf10YID8MlAoREc2hixr8eanpKjFd4fkaVSIweC+S0AscJhE4XCLx2XgT2nnx9r+A65oBDPh4AF/yC83O4FYkwe6161Hh+do3iWHLfpmjcuAgIprjAAlLsocKDtBfAAAAAElFTkSuQmCC",oue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAuUlEQVR42t2TQRHDMAwEDUEQAiEQAqEQAqEMGgY2A4eRIOgZ+/QQBHcmeXTaKO30kU/u7dWNdOdwRemACEFDAyNbF77JSKNanZb1GXqMEI1GwRPECFxnofcRSGAXQdNYUnBUZ40uABHX3Aimwx6wdVFxPSbX+1hLBwn/Ce1cAD14v9it3A+BEdmrhNnRWWXxKoKE7AFboP4k/myOETLYC/TVHMGIfru+PtRKEvoRUp3BW+ol6XDFL/wE4pOB22W1a28AAAAASUVORK5CYII=",aue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA10lEQVR42u2UQRHCMBBFIyESKqESKqESVgIOwAE4CQ4qIRL+EfKXmZVQMsCJoQt0ynDpy/kd9u/fhJUFsEgpieBYXy6J8rFaejUOlFMTKmwpmgiKKxGhontCu/DEqSF068ljVbfMiBOjZN07MoVAdJJA6adl1DkdtKNZfC0bx9uDM9pACXOhnI/zzEfqYT4c/yOzJX4R2Ps1aKJMNci081Tzsr70hHn19G+LB2abPIyyCz5lR1jzotU4Hz5KlCiJwvbRKeGgVvovVqKJ+X4mmnSDuH7OC3AF4oufbNe6vZAAAAAASUVORK5CYII=",lue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA9ElEQVR42u2VwY0DIQxFKWFKcClTwpSwHYQOoINNB7OdUIqPhu9ILoGVkolyiDKQiEMU5SMhceBZGH/bffVZskkDEhgVVQ1JvZHrFXiDEJJaPp4WOV8W0rn8gbF2wlDP+wFcIk/uTiXCsu8EaQDLw7hCYA0dIByumD1U9k2Q2obZRRVu5AqGui12OyoRaVBpwGwagsKxxCGg0zLocUJgN0ao7wUSgg0B6Two2VizHwJqOBI/fXE0YO2xY0NGHdbOHg2UNdvIzdlstIfpdln2MA0PxgE/9VtCl1avs9B2XvCrhiT0Qu2qR1K7tDmkEnn6DunP0j+k871JjO4WeQAAAABJRU5ErkJggg==",cue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABNElEQVR42u2W0YnDMAyGPYJH8CgeIRu0m7QbJBt1hIygxyS/ChrhP+LAPRzXWuZygUK+PBiE+JEjyVI4OTkYzegxqoGgGh7oNYe/gCsE/OUTXFtkBBIKljBu0S13zVNabRI1zwNkE7bkFSVYzku5sGh+cwNbugbRpVvPeZAYXmARAwg+L05RS2rgcg8VljsIs+QShaxRBgcl2tEnSojE4MAiBKxWws/SqVexwwvSIFqAgc3t4EnXPOzexiVZ+zIlEBb2BgQ/QdQiCPuPRD3CvmBwlBQE0iQqoOY2p/psIMTpZm0PSh2MoPbBgfYgxNsjBuqtKnkD1abU8qeovb0ZJyVKLl3w8+xgr0exZkiJ8tr+UAhYhHvNFjebZr2pFfs4pSOXiTplfXh8rz3jPGg+l8GTg/kCddt6na27gZgAAAAASUVORK5CYII=",uue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABX0lEQVR42u2X0W2EMBBEXYJLcAmUcKXQQa6DlAAdQAeUcCVQwn4Csx9bApF9F60UIbJLgqJIPH9y3hmPsdkLFxcXNiSiRoeRBStWFozoUEv8neIJTS68OTpJP3TOzavUg++oqHimyDe+4/F8wo3E497p6XPa9DmlpS/PybUOEEjLg1CFHSb9lZXs6bP80lM0xDjoKswCuTwPwUiJiiSaBfg9T6BofxmKocYqUMaUggNUeY4ku0AXFHNMc2sV0EHByJSwQgz7APIJKOXo1eE85vuBaN0bPZ57566QcBJ6SM8W+M8R8U03+W9fU7y5jov/oEH02rIjqVx30SLQHjmR6MyzpuIFlc+/XvHWNZA4PzhzGzwTPDHx4PoCarewDBINZnL6pPE4JL7vFqTaaFs8EnsNoqTsXd0fAq22jnyT+Aql0tZxbh3Z7zSIG4Nlbg3eLVBEvfRf23eK1x+biwsbHyudwUFO4xi/AAAAAElFTkSuQmCC",due="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaUlEQVR42uXTwQlAIQgGYEdwlDbMTTv7d3AEH/GKDmXXDiUYJh+EID1+aoYvUZBCAC/c8qyJkDQm8D8bt9u41ZOEQGV8R6W/J1gMgs41sA635iOYwyUakzqCtXkdGO+AcQBU4PtQeXwvP58SnJykGn8aAAAAAElFTkSuQmCC",hue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAgklEQVR42u3UwQnAIAwF0I7QETJCR+hGdYOO2qM2OfwRLCjFQiR6E4oJqCS8QyC4zBgVfAg4VvPirYWjp3x/a+ncbpMXpLDiJgYov0CppriBg3tnFQRX+rIzbNwYbGLVqm2anF24bFoJTwys3Vh1Lk8/xQBZGGTg4DhaKQhufpmj4gEfVs3uTpQRmgAAAABJRU5ErkJggg==",fue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAh0lEQVR42u3Vuw2AMAwEUEbxCIzAJrC5y4gL0o0QGsRRoCQoHfKlyU+viGRnikTuYM1EqQzH3Ad5smtWtKs15r1F6XoFEjUKieqHSNM+Da6VqB5og+uRM9M2PZIXsAV1BiWgYahaLH6snyEVi5IM/A6V9/OA/gyR1oTUn96jLlQb6k/xVUbunMg5/LUK8KN9AAAAAElFTkSuQmCC",pue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAm0lEQVR42u3WsQkDMQwFUI2izZ1NNMqVImo0glKk8HEO+f7lHfpqDEYPg42wdDp3TGpYFKyRSqAxorbqINioKNe5XndFXOMg2An9QwmWQAEL0XNT6ncXsAC1X/cucmGNQl3frwtprnKKz7NDlEijT0PhxBqpPIonltHoOrHWB0+iuKHRJ6Opu2jqHmpRZA1ALtMel7n2F6xzx3wAgJAmGhrKVWQAAAAASUVORK5CYII=",gue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuUlEQVR42u3WwQ3DIAwFUI/QEdi0bBA26CgdhWPgc/AI7qVSRJHqYG7I37co5l0SG/J4PPumPRtDoNeLg+X4A3K7soEAQ85vGwRCV7pnZ0A2ENcBCqAT64BO6ABD+mYOEDDRSJiAGiFjlUQ0EG8TQITUf7KNS8oPoh9CwBZgqscBB/qX9cnauB2LgD5Za1wAxsn65+eyAHojBOKAA7sB/R6eAXhuo9UIma+SSMuwh9Xq97RfuT2eXfMBD6tXB0TAJI0AAAAASUVORK5CYII=",mue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaElEQVR42t3TsQ1AIQhFUUZxU92MERjB0vgoHIFfEwpofmK0MRSnuEboxYPppxyYn/4Ep4FhkNOKQGUPoj3ARQDzdw5YO5F2SBGsBoGBV2yImckrxcwUxMwcxMwcxEzYDX9p+unFFf4A5oVnhQcOYRcAAAAASUVORK5CYII=",Aue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAbUlEQVR42u3UsQ0AIQwDwIzCprBZRsgIlAhTMEK+ekUp3w3SCzfIxVWxkJvzQc/tG/bcSLwLFA7bhcDLZhOZDUpg+PsyWFcVWRVG4FFgcOgoBI72ZxyzIHCaBXtjOIFjFgSOWRw5Vc/tfo/n8wB9+W8ptkfZNwAAAABJRU5ErkJggg==",yue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAiElEQVR42u2VsQ0EIQwEKYkSKIUOnk4pwSkaivAHf8Enp9Xh6BAbrRyMhBjZ6WSnYDfTp8HFdCcQHwynU0MgKjZLSmRstABodvLVChYA4f89ArJZrpbpAdBoGPn3MGrs1yodx0Z7kZBCvQWQUE+CpHpxg/AFkFRPg4R6CyCpHn5WrT5H51DvlC84a6FPMEe8gwAAAABJRU5ErkJggg==",vue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAArUlEQVR42u3WsQkEIRAF0CvBEqbz3Q72OrAUQ89v8EuYA5FLhk1uBoPFb+bAQ5CPvnZ2FgYF5X7yL6rQ+8lG41AKMhTaLkoQSumEzkVKCNovaDtLqtJOKLIfnXt1nI8JCsaghDINVMY8BM1QHBQmHNDPOwStgt9FdVbxo5Pt10Bzlac2yvbGj9re+FHbGz9qexOC2t74UdsbP2p740Ztb/YbtRCN//bsb+HOsnwBU7dJVA4m+Q4AAAAASUVORK5CYII=",bue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAw0lEQVR42u2XsQ0DIQxFMwIj3ShskNvg2IxRaI9PwQiOLgqhiJRf2DQnfyrLxZMwTzIPj8fDg4JCerpAIP96DrgxoG3IVw8ZcQGgHZB52mEMQIRAaiqhhHN/IzZbQIac+6hqgiDbAgTSw6h6gKDbAvoPQMyvqKZv9TS/orZBrin00MPnPUUzwBzsPDUtEA1xiKZ4osxWxXCJrQoAsVUF4LYqAdxWJYDbqgRwW5UAbqsSwG1VAZitvlU4YN367h8cj4fnBc/8j7AfGI+wAAAAAElFTkSuQmCC",wue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAA2klEQVR42t1TyxGEIAylBEpICZZgCZZiJ9ABdmIJlJCj+OJMSnAXXWacQbzsTXJIJpOXlx/mjU96ODD2r0QEpcdgteJEEcELLQTOlji1zXDEdWKbw39cqgSP2ICIS96YbcBcPJilN2adxN3lJzBbYxDSWHxpRDiYVfoKgIC9LcnXBUV0WUPVXrrSrPMAaoa96Ib3fwAv1CoJHWIN8NgfJNycxJl7neqxFvaaI2TgdXHbUBbaOA1xSmVNSmC1CIj8cE3+PDklpWyJJl/CG2+hdUI8GuXkpX/jF/4Af5Pw4QXt/0wAAAAASUVORK5CYII=",Sue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAABAElEQVR42u2U0W3DMAxENYJG0CgZIaNkA2sDcQN3g4ygUfhp6RiAI6iAWpdFAVkFkiA/Of8YFA7vSNNyb71e6mVBFkUTRUbS8H9jEi2EVqNzNaLJFSxJ/dwawIXYS8LqukA1bqF+gDVMqOAau4W38FNT9T0DH9J33u2MbFXk2/krg6SDyDsPVC5WL5dClmFgBqHNnhpH5iwn56zjXVsAuy45IQ/MFgrtz0mz4Y3Mzd7GJ3eRn9FzjfNpFxrvl6offGfbg5FAkg42bC002W1ZLMPO6/0uYPYDow0Hq4Yae4ZvnnpJFvmYTmC5osnSeQ39//5NnfAL2U1SI/v37foAfQJWySmJl2YmZgAAAABJRU5ErkJggg==",Cue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAABRUlEQVR42u2V0XHDIAyGOwIjeASPkBGyQb1B2cCMkA2cDegGjOAR9Bj0y3eMQOsQH43jM7QPfbK4M5zk++4XCPF22GGbFpRotiBERBAcutD8BdKDxCGyIUXKa0SMiNL/DtOAxN4akNeLDx0ILV9B1brCAyA9hp9+vrL5/ppqFIhNmm/Nk79FmGevQUEVIFmHnODWMTg53WOWTTmtmHTg8vozG39JR8ElTegQ64bX+yA3ndNKRrTr6HyOaTWd/ecuKG8w4qv4oBAych8U86oU/ydQTi1sphaXmiqkJnY6PyNXJTkumw23C/IasXJ0O5hcaoWCTGW7b2zYlq4IBjYVnWhpHgho113hcRupAMnFJv2sLbeRrAMf6RiqURhCC5rek2cBiK3G5L1KzdXroO6NN8KB2JCqZ2RdHdzS/MWKJnU8iYdt2heuC19OkjsOZAAAAABJRU5ErkJggg==",xue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABf0lEQVR42u2W7Y2EIBCGLcESKGFLuBIsgQ7WDrQTtgOvA0uwBH4qg8mUwB1fjgk5EW9zPy6+JAZwfZhhhmGrW7f+g7DWLQiQGsF8t0kNwJH9Dtg5WNrERTA8PdA/l7aqltYBZXjyYqTu3KfjzCxE9XYuYOXM1Mst1xUio3XALYbe2CXWxuKLsAFk4OH6IxhyNMBG9+YRFj4jZCDjj7G2H85sHzxAMFhvC6DtZwXCRtf318bZRQq2rw31VX/GTlPY8rYCL4bm91UP+8DoKQaMNLOQDxQ4cQBMMSEoKRSTJY5k3flhlM7G/MB3Qml0IHL4zVC5T3ZAGqUOb+dqykDVy6dIukSKiSm4fGagNkWKG88WZsAypPMlJ9XTec+dfaoTp2ylKkVnO87E/ICnL9lZJO0r1dP92QYebdcfyX7mt8DD1iat/MC9lVT2irAgtpJN14xEBmMhkhyN96a3OloX71g7c0H+1kybRtVLCt4VMHA9wBRslCB0K+v7n9utP9UXmiS2zjUbidQAAAAASUVORK5CYII=",Eue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAB0ElEQVR42u1X3XGEIBCmBEqwhCvBEq4EO8h1kOtAO9AOLOFKsAQelY+b2RLIAGGQwxjUZO7FjxcQ3Z9vF3ZlJ06cyANxVGgxKIKGVoQBLSrifyO8QG0EL46WioOWq3oucGoEHwt5N3OvVNXE99sunJ2qNOKmm9+ZbtAgVcrO7otdftDFihe4MIbWqGEzqN49GQv/1i7rVS+4nWvoMbJytM+IWxr7zV4Qd+I9IcH+2Ad5d3NLldgQCxtaIfj3aoBWZfJOCY1HZFDNshAoCStiCwBBe6txMd9k0hSH9Hl1lqbAAxoVY4GmqcnjX+8elBEHVNAHRpVBkD9SIcRJlgfehV+FbFtFmjMQ8zOQnAXxonBg6wi54WEcZwmW9ohH+ZbzUb6CsP53Be+lKGTNniCrMivIsovTFGI1TYckTd9+0IiD9ivIurLRzF1FtXbZPa/JFbmOUK1w+S03QPGl7leZPoQKhcePBWeYF5yp2VgyZe9W8m7ma5ei6ucVMJMmp8KV9bRaBUqIW/ZFBj1JlgvfLcjO+xCHNGputmOcNV6IGi98QCtSpVGzzfo0Fg10aBTVJxVL7SQ7grEwBC0NRVNjbT8OwVHJ7rV9F/z8sTlxIg9fzJhlLbg/lAgAAAAASUVORK5CYII=",_ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJUlEQVR42mMYBXDw6j6pGv6PEA2v7r/6jxXeHw0lXCE2mp8oAQBIti9CQvtAyAAAAABJRU5ErkJggg==",Tue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAK0lEQVR42mMYBaOAgeHVfUo0/x/VTEvNr+6/+o8T3h8NsMGr+f5oyTIsAACEmjbmH2XjhwAAAABJRU5ErkJggg==",Rue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAL0lEQVR42mMYBaNgiIFX96ll0P9Rg0aQQa/uv/qPF94fDaNRg8hJV6Nl8igYuQAAQMM+ivTgbfAAAAAASUVORK5CYII=",kue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAO0lEQVR42u3VsQ0AIAzEwOy/5PdeImyAEIIm8qV3k+JL0iCE1Gs0bdTo+CihDy9foj7KqNEbhDj/0tYC6FefdeTyx04AAAAASUVORK5CYII=",Iue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAP0lEQVR42u3WsQ0AIAzEwOy/5PdeIjQsQBEkhC8DuEjzJek3hNQkmjZgwICBjdCHl/GATzZgwMC1QIjzU9KLFugJvgVy4hSxAAAAAElFTkSuQmCC",Mue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAANUlEQVR42mMYBUMDvDd4dZ405fdfGQyo8lfngUpIMf2VwUugMnTlhLUkkOT2V2DTRxPU4AYA0joovsOdMlEAAAAASUVORK5CYII=",Due="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaklEQVR42mMYBaOAquC9wavzZGt9/f6VAXlaFV7df54wEFpfFJCt9WUDUUpfnX9lQKJWBHgT8Or+ewW4VgGwVuLBiwKQdqjW80CtpIGXDUDtAgitpGs//3r9ywUM5IGXC14uGM2Qo4BiAAA650DuiyuE1wAAAABJRU5ErkJggg==",Pue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeUlEQVR42u3UMQ2AMBCF4ZNQCZVQKTgAJ+AAnFRKJdxY+jpggZAOTQhLc8d2v4Avb3pkWdYPXQFJg/HgMqkwedFZs8kZp8Wkxgir8TxoJCSED2avkcZCKPym6orEjkhCNYYbI6Aakz09SSjMnRFQfY2QAiPYSVmWuBstj0wlsh7hywAAAABJRU5ErkJggg==",Nue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoUlEQVR42u3VMRHDMAyFYUEwBEMwhDJpIJRByqAQUiaBYAge3T4PgqCevPWapY5yWfQD+Ca9E3me5/0bRxQUWzIgQ4xRLErWSHa1+RCyMZIxCakT2YWrku872cWp8SCJgsJh+zIHyY4KModN8klj1djZ9ZdELoFoH7t87Wf3ZSrLkPYw3g9SZ2fj/bQLBILVeD+YIMb70V43vUz/Hp7nndIHj7uVXiDrZZEAAAAASUVORK5CYII=",Oue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAW0lEQVR42u3VoQ3AQAwEwZTi/ps6aMnEJSQgwLIUFP2xnQL2Xk98AQBwRkep5M3fJXM+gzz5b6VSh/H1b6jD9jkZM2HI7wlLfk/svGHClJ+JybsmlMFxAgD88wDwDpxbIr1PUQAAAABJRU5ErkJggg==",Bue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42mMYpuDV+VcGyPz3Bq/OY1do8PI+UClCGZiHRylBZQilCGUElBJUBrP0JWGFEEshDiCoDOFWgsoQSokKcKATzg/TtAUAiPVG1dZzQhAAAAAASUVORK5CYII=",Lue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAVklEQVR42u3TsQ3AIBBD0YzkkW5z6rjJCKGkMNIH0eLS0mss+bk5ySdrqR2x3mYFGB2gAIQSMErAqAIAKv+uvbGbK9YDoFgPQU7OIBCBZWRZ8/b+7yQd06xba2rjM1cAAAAASUVORK5CYII=",Uue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42u3UoQ0AIAxEUUa6/ZfoCGjOsAICcYaE5Fs42eQlPdG2nzfjsk7zKdcda3TrQDO9c0TDEQ1HNDwUcEDTdXQLUmsvj2i6IxqOaDii4fgwLNd/G29mAaFvZs0tXJk5AAAAAElFTkSuQmCC",Vue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAfUlEQVR42u3VMQoDMQwFUR9FR9VNVS5S4yNsyhCGhDDtemrxmg/2Op2QaEfnDnnxrnPuqR3fkam5O9fvrpj6hIhMXbGWgogIiIiAiAiIiISAOAiIgxTCdbCaQmpKQJwY8xsE81sEkEEICURARDTUCQTQX89WJxFenO/m0b0ATmsJSOo8lM0AAAAASUVORK5CYII=",Fue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAd0lEQVR42u3VsQ0AIQwEQZfi/ptyiOSEEvjYvxISHKG3gEkuOOu67raMjOm2aXpGxgm4fiS5dQAOJ0luuJlAChxIlSMpcyTJySQ4lQSnkiLHZbG4yEWGTNZly+I6Vxd/woHUOJISp5HkdLJwG/IEJEcy+iy77rYP93wPQHQTKiYAAAAASUVORK5CYII=",Hue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAcElEQVR42tWTsQnAMAwEM0pG+JG8mUdTGfJNVkh5EIGMqmB3NndGB/ax1XpktQRPj54Q19kZ6HS0pvbwTCUJD+tbYN1hrXAKUGqcApQCpyAreUtBdSUKBQWOQsECR6GgwFEsCjj74RWxKOgIsrb66S9xVXpwrJmxQAAAAABJRU5ErkJggg==",zue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAoklEQVR42u3UwQ2EIBAFUEqwBEqwBEuwBEqwFDvADnY7oARL4Ch+TKaFjYd1YuYyjhcP/gvDkEdCArg3Two1yGa89UhmjIhgx3nx10A4qhYzdzQ0rtO/LkMZ93GdELWUZ6l2zjG/QMmD9pG5gvLZy9c5FZeL9YMgN1dy0OIlVfHaIUmq5BjLIKj2ktQZ7amjD/kbrwkB0Y7T1ttxpub9Cp+UH/eiaXD4TucxAAAAAElFTkSuQmCC",Que="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA7ElEQVR42u2VwRGDIBBFLcESLMESLIEOYgexA+1AOzAdmA4sgRL2qPx1hhZyQhEOYIYj77bM+NS/CxSZTASgJBpusCYRqWGfkoiwHiKNSOuy+AddQ9oJmQoS9RNNBVLiqvcO86kkXT3Q7N2tZ8uVEFqjivmawU1oq+wOgoKJ6RLS09QgdxggAype/HlBi9lbm5w1F/Xh0XtoRuu9cOQl+GvcOyJyW849JEWkRNzfwteehraYvm0V6HiZ6hD7t7DA22giVdyYhOyZUsJoIsG5RVgaZWCLBBPTRQoOkehAw6SGNKKVmzQiytdeJoIfUnyWYZoo+CEAAAAASUVORK5CYII=",Gue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA0ElEQVR42u3WsQ2DMBCF4YzACIzARmGEbEBGyAYZwdkkI7jEPBc3gqPQvOJk5LNcIOSr0Yfu10lw69PnegMP35qckNqjM1L4NEajQ8LcvmjCdLaiceGquig8vIxGEnekHVVFGcLIyvQnt2e+6DoaWRmjkNRFK1jZHw6v3I0aWZLR5W/UxrLb1w9lN0q2AJWh9EYlh+o3b+6oqCZXrn/E4p0paia5qiDFRRetJFmQLItWk2zIhXVRkqYJD6IsStRI5m60f5nO+mUi6vtvVJ/rzQ8hES89oNhX9wAAAABJRU5ErkJggg==",$ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuUlEQVR42u2XsQ0CMRRDGSUj3Ei3IWzk8pApMkIQlStwsJQm+h7gPUWv+bnVatuOIFbiD461gpPj+VgoeN05eK4tMHhUgdUFeiOImQIE0VuCH4QpICF6C/BXmylwNSkCvClgFAZvChhFhFcBo8jwKmAUKV4FIoXHq4BT/BDI/q3ATMPggSoQNfQKFYjwXqECAd4rVCDCe4UKBHijMAUM3ilmCvyPlwIzBYgPvm6huoU2LiAB6ttV23ZvAWic8AoiqewAAAAASUVORK5CYII=",Wue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAGklEQVR42mMYBQMGXt1/dR+dJlrhaPANGAAAVGwVbUC5QkQAAAAASUVORK5CYII=",jue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAHUlEQVR42mMYBaOAnuDV/Vf3sbHI0DIamKOAAgAAU9YVbVeOXo0AAAAASUVORK5CYII=",Kue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAMUlEQVR42mMYBaNgFBAEr+tf/X9dj5ONH7z6D4I42fjBy4ZX/1824GKPxswoGAW0BgCqfC2agz99+AAAAABJRU5ErkJggg==",Yue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAMklEQVR42u3RsREAMAjDwGwO6wJDOJcF4pJG70q1DwDsmWhNmPJab6a8ylblr3gMwJ4LaUotmgCbpe4AAAAASUVORK5CYII=",que="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAQklEQVR42u3SsQnAMAwF0Wxqb64ycA5oBAe8gNQa7nVX/O4/kqSbMVYS3yi7i2CzybK7yDOIsruYxMp3Vu05JOlmP+3rUfo5krGLAAAAAElFTkSuQmCC",Jue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVR4AZ2QLWyDQBTH8Qqv6n3CsYzmvMIuK815MV6m5rrMTTFBxxw1E1PIyXd4Ua9wKyi8ur0Xshs5csvaS36C9//g3gW+o7ALM+yBUXhaBf89bM7avsj0MGa6N78MNWt/BSUZkc1+bJG8ILgAFX6lwQZPBx5cCNq9zysa6s18jRplWGIED1hILtq6D0jwjLTHZ7xJ39o4r1BMD1q1YlfqaNxrYZhXLfAJ79Ut9kCh41b33U+QNfZYbxsVwR6Foo/OCpb4yLdi3Q0y/NMSY7BrLIr8dOwN5seAlCZPGgOJYpH/7gb5Fh9NnJIHDKwLykxvQEEkzIzO3K3zz/crunrUVFrUHKTZjrTR8Tb092tpS9wiMhD1MkhAgpydr7Gi4cE1eoOe4ysaae8X1jwxbxFMyNDn+wZoU/gQWA1zdAAAAABJRU5ErkJggg==",Xue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABOklEQVR4AWKgKwCURoawDQJRGK5X9QqvcKXLSvCqeikX7MyKN8ybkqys8jDzfuYdZhavcAVq8Or2XlmTR47l1tsln+AP7+P+RwJtFKteIsMPEjPPUdQBon8BEjhvLZJmGUOXCtXXbNBGE0ObGCJR9RlVukNkiEV12V/XQQ+OEgOhunpB1h2cc/EPscB2O2hfqe2kPu3jHjG9S3s3RBKi5akKskKt6wKChMS2v/wMX1uaOarVUKhAniDwrjIWakZD4ie4+FilvNWaEWnOe7U6LN5gnfNwTkwNiHkRA10LOnTdIwQlhW6wyvyYYkeRTqOlfgkzvQ9rnW6SP4jl58eDP85sBkSiYxSzUDMaLqa9ETMiPSU84O0e82loivHrPuKZIgN5q+zhYEmhG6wyP6bYUeQgtoss4mHELvoGnVEJQO0l+0MAAAAASUVORK5CYII=",Zue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABi0lEQVR4AWIYFADQOhmCNgxEYfi8qlf1qq5Z15T4mXqaEhgMZtbzptEzDaxtYSb1Zl691MyMMTM1c65pYHBe3d4Lo4HHg9y6HPwkyd37vuPlkkAZxcUJ4qKyeHV4zeldh2CCioEYyuSPUNOL4aSx2BDEM4ZEreD5oVo2bbgohhgJlP2uwUKqvBbxVnSZObIVWWZQ7rsFV3YGx4y1ikTHjKz/A5cptV3xkUPU2x2C5QaChE4EE7WCb+EzWx1uVlQvgtfF0G6KwP3GeIrgDt61VH8W0QPGCTkvnDU/XL1bur+H1ykHS/WKAIJEFD3DaLCDoO8BdjS/hit9bpWnqDUEfoIgpdYrPrioU7DTo4FbhOAWkw+no6hVxMDfaTilekyO9c35pwenwxwnHEu9UBaJYLFe4Y4Nn+QL33bjaA1DvS0C2BbDFwJ/PY4G0sZYrMJFiSwRdxRhpu5hsvRYb4jdtMpf1Bbr9LVW8iDROL1QZOtaTadIHuzDj7POwbIo3Ld8F0+wv8jiPdA7n9of+6Jh/abhp4AAAAAASUVORK5CYII=",ede="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABjklEQVR42s3TwW3CMBQGYI/ACBmhN4xUogxSUCYoOfYGG4AEKcewyQsTMIKPQC8ZwX0/alD01MSmiSue9AQx8f/FsVFPXSmdk1l5oVl5rfjT3r7TOR0cQijCgbS06Q2nZEbz43WJ1UjABQeA3DAyeAuirv2JBDRQX4sGDOjrBYMDAW4Yyw8Iya4U1Dc6H/4BI3YSVVcIeI7zIPewLgnP8ap7QJyxwolXXZUfx4tdOa7yUhcftE7wnwL8KMRzo/1RL/NycspJp0oWBhkx3FZ0sScdueDbb3TJaggPLXLMHW6BWmEGSB6EgpKRgNraqC1NNm4QPakQClj9lIScTXqlUAjZkT5g0Kc/S03YH0C+98NQoh6CfaEt6UQ6DjggZLNpahexsYtpYbMkErA3hLmcVXCOQWYXZEXfYYR5QzKnCfMFyRvaYITWMA5MAxrxA6/dOfGJV/e6qQd84fubAfQeL3m88pqfTQ/1xAgX/nB8ElvggogXJg+RP9wX+hXG3gaHZGES4ECQGw4LueHqL9A3pBTYzX9vLMsAAAAASUVORK5CYII=",tde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABsUlEQVR42tWV303DMBCHPUJG6Ai8NZVolUFolAloNmg3CBKkfQyb2JmgI9wLogkvGcHcAZYLtnR1pQNx0k9t2st9X5x/6l/WWp+qtRk0xn5F02+i0EpDVvbjFmHgwUGARITA4+RBbKDs3zaVPs1kwXwA9++SRKh53Q8NA04OJ0Lgwl1YcvEiPFg++kOEWWrpTKrSLzd/tQJ3uPrKFW1gnn8ZHL8LZETGLgYWFSnNOOGM3cXPgYPOZ/t+0bRmcWx1XnmR14fSDJAOhqzTRXbo8+2TmU+tyTtiRMH0J8b+CJyL0HOeRJLB4Vwv0mJT2BAXcTt9iozH72/DoWbAQfb9vFE0nBXwARoeW8YomA8oKjq6VBFMR/tR6LpJAVPvo853JK1cBSICCcG+GBE5sKSIv4suLVsXmb1fbe1mdaRP3J4xIizYz1xOmM7N9BU22bNAioh7gDEzKV4EmzaxJk5kb3Ltzi99x3NcMOAg1KdwuYFtjNvzq8gHFA2z9e3uOpFljalsvWoSwRMxSVq5CkQkEoLjRUflRKTBQiI8WFoE6PpgwCIiQD1KsrzIUjswbutrwe9FgoCoBGPNywAAAABJRU5ErkJggg==",nde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAkElEQVR42s2S0Q3CMAxEO4pHyEZlBDZINiAbhM386fiC5BGCVAmJlusngvu03p3Olpe/UAhuIzChaCGnGFaoF5NlMfHi+ljP0hTpzZZcaSqal/3ES68MVDv4TRAMnGzGwDD5bM3Aeuw4MhoBTXy3daStNRMuriPHdseRoS8jT71DMUf0aoJEUK5vof368299Ar0gZfgYbBxmAAAAAElFTkSuQmCC",ide="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAtElEQVR42t2UzQ3DIAyFM0JGYARGyCbpBs0GySZkg47CCD4mfq7kEahoD6iIn0OlHvIuoAcfyM+Sh+tKR1lBCAjwcGq6AGYQbzK995Z36Lm0gTvo+Hr3MKDnXAXUiCYgQUw6VhA4uJLPG28VRDxs0Z9AFQRh6J/8jpBMRd/Cx7VVZj+W1HcmNZ3oc+GGDFIDin83dC5QONhPuLJGgCkLv9DtHR4BIV6nMZafQX39F5LHFefDC0vAgFf3ioAyAAAAAElFTkSuQmCC",rde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAx0lEQVR42u2UwQ3DIAxFOwIjMAIjZBRG6AbNBrAB2YgRfAx8HzwCVcktKhCl6iXKP/rryRb++HHrZ/EEB0JBQUQQfRgUxY4lz2tFYGBB7EQdQhHzQmpX84gHcHbJf6vnhd2orwaRakwkPHVhBNiWl+fkuzBHmJa3alAXRum7f4Rp1U3PIPZhn+emZxFGsRRprapONeiN0AnPOJ77JItCQGlHZJ9kgoXZtssvluR5ygQzpiuSF8T6JekDbq9d8TO6AJ6e96E+rTc+qZhiC675hAAAAABJRU5ErkJggg==",sde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAA7UlEQVR42u2VwQ2DMAxFPQIjMEJGYARGyAhs0G7QbtAR0g0YISP4CPmu5BGoIjhVCAch0QvvlstzEuc7dPEXtJIuBTAmTOAU4Gk/qRVFDz/UeQUHLwG8UyUPsDT0w1CD5VYuuSFytX5QRHlQCfDgRbIu4tSSDXioaQNpoFqZexnfZIB+7GgbyY09XkoiHBnkjlmVJioA0xkau08ZOMRzrnjs0NPxUlpBpaENNPfJ5tOCdSMMxTnHE1HtaNqkO1jrlTQxXonhqBT4eeLBLe/WoxfN2YZbROUqCYjzEJUg3TI+bJHNJSoXSbh+9BP5AjcQwCGOJwAvAAAAAElFTkSuQmCC",ode="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAABCElEQVR42u2Wy62EMAxFXwkpISVQAqWkhHQAHeV1kBIowUuS60VK8EgEaSQyHytoNIvhZgfO8Q9b/F36ZRXDPgcQBAJChCv2DGziAjkenvpwdo8rwq1bVBjgONRYi+3DEY/HN6sFdSC3SwuZx6XAsiGNGscTBFRxT5AEybM+XYGs9qXLEYKijBEOkv7fWkVI8jpghMDp3OobMryzWi0EpAMKRGv3JSC1PW6FQZ0yB21TEFXA5Ktpv9t2DgqER9XHr1Oe66yeGr32ApbycjkoQJolxSOo3Yl6pOQAh2F/4hArrHGnr+XxcMkzmb41e49qT5IDezJNUc7rQn4GmbzCVI9M/vpt+z3dADr0Z00wLm4rAAAAAElFTkSuQmCC",ade="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAlklEQVR42t3SQQ3DMAwFUEMohEAIhEEohEIIgwXCIIxJIASCj4m/KxnCdugmZRe3t1V9uSSSFftLpisB4+UcpnPQm2RNFugIC6gokuUJ1rsXmr9vydutBdSeyLfOKMNnEUY+yZJ/+zc/SU/9QQOYTeRBHEuwoOyGloxqYStXW2fa1xNYTQ0FizAiHdECT58R6//Xm+my3tIEisWmhZRlAAAAAElFTkSuQmCC",lde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAApElEQVR42mMYBWSDV/df/ScC3h8ZofFe4LXDawdyNCq82v/6/av9r86/uv+6nrjQvg/Xev9FAYT9XAFoxHzSoi8BhX8eyicMXju82o9DhDB42fCyAcMt/4nW/GICpmZKnH2eiNCGib0MQA9A4kPb4CUwqhAx/ur/ewXidCJi9z4okbx+DwrAV/dB2kkyAOhXg/sCIDYh7YTjYAMdSpL7oyXsYAEASCuxsboove4AAAAASUVORK5CYII=",cde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAwUlEQVR42u3UwQ2DMAwF0D9CRsgojMAIbNJs0G4Am3gERvAR5RvJI9ALqoSgUhNxqZSXW06xv2M0zY7KreBo69gRB4o5N3MKB9TxSKFYpwHQsPYUzh5RjnNOOMiJ8nv8+ilqxklFgZS1x4l1FJShe8CJBzrKcPt6X4a+xMskHWXylNPlXI0oY925Sx6pSyyMH8jpOIAeONsTNXKicvAILNEe5hSqB9RYYp72vzZat78y4A58UXCPPHHAf6C2Nd9UeQOQkNdOJZ4y6QAAAABJRU5ErkJggg==",ude="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA+UlEQVR42u2V0Q3CMAxEMwIjZISM0BEYgRHYADaADcIGsAEjdAR/prkgZQQjUX+0akGq20og8vIZ6XQ9+xpTKPweILDi0CqiZRxzSBW8JE/xip2ZS7a4D4eU7TxJAqccj+ElA4fdy3OGm75SJB9+BaOmjekRL7o9JcmSQcEO/G9A4MfWaIAHN3szQrMHNzfd1GvweHbBqjsFBn+6+yJRAqdq9MaBUetEz+DmPJr2CQw/baWoMw6Ge1OJSiEqXqWUfUnxqUWa7+Fa7+mQMrjrU51s/6Qs/ucQbLygboOBT1WwIJFdklVl49EsS7Dyl1U80aQsY3nfC//CE0HU3brcVJnTAAAAAElFTkSuQmCC",dde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABD0lEQVR42u2WUY3DMAyGDaEQAiEQAuEgFMIYdAwOwsYkEAohj738fjAEn85SNe3WVdOcvkz58lKlUX7bsS1Tp9N5BAXqWOVwgf5EnVeRgU/ILFAWZJ4kUEvqFwv0fvFEreDJrswYl0BUBk71ajuXdyu53P0fodB6/ieaIFD+biFQ7PoHEC1QiXyY/TNtUs8WJh/IUIzPMgsK8QoIVIa98C7BJ6DQff84HegBz1BEcrBrowSoyXuwTMk7GZbdPQiy7YMEq6DRXWg/JygEcfP6i7eSjbXzSFi94okFdtL2DPdL2JqRV4Psq53EEur11rKROf3ttZQwEDkhloGMmwQdhkn02egTpuviFOgTdKfTml+iqgQxu12OPAAAAABJRU5ErkJggg==",hde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuElEQVR42q1S2wnDMAzsCB2ho4TEgnxmg2aDdoN6E2cjj5DP5E+0/yHVgUEOqDWGCA4bxJ1edzk9eBiu7NyLiWZ5d0D+URC472//yV13FwKDZCHlnjaZ6GEQTHyk0IGM1qzK27oCZicYNa8erEopfnXiVcC5WCuAJecCe60AUBTYlgUoC+jNK0AU8w68JstXAN5EQQWaBu7jihFYXaljjBUj2G5Eomjlth0t7tGVRFPujbRkr+47Mb7WHqpqxDex2wAAAABJRU5ErkJggg==",fde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA80lEQVR42r2Uuw2DQAyGMwIjZBSkw4jyeho62pMYINQ0YQOyCSNkDOgcEqVE5IxAvGSOCISlX4DwffLj7MtphlJa6DgKhcj0M2/luncECNDzrv/BHOemhVoNIySfbVEBPOcATuRLZ1ggAzNC2TS5Q3VZtnpJyYHjCYyKzNWs8v2mM3rngDhJnTpHP3YASWoACpHuBVZCZOP65QdEmG8CUiPqoiDR90YgwMPgbBZAOo5QrTl/k4RkAgYD0LYt7tp8oqjp7R2GHBAX802X01DDtabE3LQcMnrz1A9ZDsv0zesrNnGW8w0QaKX9gu2WraKoTtv0P1tulH4sQuivAAAAAElFTkSuQmCC",pde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAA+klEQVR4Ac2VQcqDMBCF/yP8R/EIQZN99hGaG1TwAM1VPFmXukttF11J+iIIQuxEMW0d+GDA5r1kJp38HSKsEBnQlnPj8TnI9olK+Q+xC7DALSLEFZz9b7eJc8784lCUMMKadeJFcSLESO5YG905cDthb2tOlaUvSzd03chNSrJciz3Bx4ra2aOu3RTIY6cwoQGcExrY8J7jQzoDAM25gf6AgZ7X36Q2AGaTgb85Q9uO9EptMJiVKCnQJJq8n2AYBkON+KMhj86mSXd1H55N46ZAHjtBFRowRo8KpYgmE6PiW8MuzY3Kc/3TByfsCZoVMbLA+Jof5dFPHy+sG7A1fUBUUgAAAABJRU5ErkJggg==",gde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABJUlEQVR42s2VQQrCMBBFPYJH6BE8QhYd6LL7uugN7Dl6iepJegSP0KVuJHYhrkrMFAZEB/ttGnTgQ6Akjz/N5K/+vqwxiU1TM4poszwgz9f+8Mqr9bJeTlHr4WU4jGgnEEhEHYPnuSJqIIgObviMb2BH2RwAPUJQzBnudApWTh3Sb7duOJ9HXfMcAVefgN3UAbe6dlK8BoBWWou7w4G4S56liMBWA7qIQPvazk1koOMn8dmdiQ1kxg+BWZagG3n2htNpVF8UMPAtWeSRjiVgLCAFjUU1fsSfNl6j7Sy1JF8jbb0fDk6K10hGCmOOS74oX12ayUC+EO2X+ne9Gk96axcNYAwa4JT3AjA9kCUjQVktiuaBZU51SMsg3BVekiyGJQnw1/UACcPy88Smyt8AAAAASUVORK5CYII=",mde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAS1BMVEUAAADvSEjvRETvRkbvQ0PyQ0PvQ0PvRUXvQkLvRkbvRUXvQ0PvRETvRUXvRETvRUXvRET////+9PT+8/P96Oj95+f3oaH1iorvRETaY5dXAAAAEXRSTlMAIEBQUF9fYGCPkJC/z8/f73CfOZEAAAC6SURBVHjarZPbEsIgDEQtXmoRmsRe2P//UmeqA6GR0Yee191hwxJOh+KGyACHwX2Ve0KGeiN3ERXU1fqNsYPPWj8Dlqs6nwELlxRCJiVkYp5f6SLK0dsDVpEVGfr0g5YB78YebYPfDMEa6jG5beDNgLYBxaCvqcgRuigTMaJJqK9p8aao9Jx1hjNVzyITMmQfaxJZzGPpMdMylQj6Z2FKiKVayotd2vtu7QkVsfv9cSzOBwZ49O7QH/0Cd+M3hMdc2SgAAAAASUVORK5CYII=",Ade="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mP4H////X90cP9/PAOQwAbeM/zHAYacxHus4vcZ/idg8fv7/wkAPF4bstRgMMEAAAAASUVORK5CYII=",yde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAALklEQVR42mP4H////X/s4P7/eAYggRu8Z/iPF4xKkyf9Ho/sfYb/CTgj5f3/BAA/6r0QPE487wAAAABJRU5ErkJggg==",vde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAALklEQVR42u3KMREAQAgDwTgF55EQCfcOoP9h6xVFmJgSZhPB7tL3KWwsGjMJ/QCYI4JZCBHS1gAAAABJRU5ErkJggg==",bde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAL0lEQVR42u3KMREAQAgDwTgF55EQCfcSoP0Ztl5RhJkpYXYi1q5e/auGHYvGzEI/H9prfp6fQCQAAAAASUVORK5CYII=",wde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42u3UMQEAQAjDwDoF50iohLyF78ZA9lsjCvPbUGJIsgg7cODAcmCSRnTwDdMP02R4fwy6rnsAAAAASUVORK5CYII=",Sde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/0lEQVR4AWOgOghouC/g1f68HojvA/F/MG57dt67/fn8gPbnCng1e7c9j/fuePEeqhETA+U8254VYNXs0/EiH6KQMAZZhKIZ5DSYzfhwztzXcJeAvIpwesfz+YQ0Lz38+T8I5EIMAeEGJAOencenuXzpW7Dm9ae/IovfhxuArHjW7o8g2+D8xGmv/r/88Of/CyAO7X+JYjBWA2YCDQACkCEgDTDNIINA8jgM6IDEOQwvgfr37svfIArkBWxReh7ZBQ1gQUxDQDSusJmPkvrg0YgZbRgYpNYDPVUCJRKITUg4U6M3UAJfgoLKJeDNDyCnebY/X4CcNqCB3ABOfdQGAJMR1l/SzUs5AAAAAElFTkSuQmCC",Cde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABGElEQVR42r2UMQ6CQBBFPYpH8AiWIprQeAAvw6KFdhY2WOgN7CwoTLSktqJjgUaMhY0J7jdZwrowIjFM8kNYmJeZ2f3baS1GjPdNxt0h44FQ9pYd+lgz7NCqDbIY74okT0IIBfiXhA3nSc90oisBUSX+RU5lZQSMhJZWKmfVRBiRAhuLIf8CWB9ukLKGTcyBpsPdurDFPs0Q2+P985tbAIZ+Hdh0lWRx+swiobJdz4FliefLA8/iuoTJdU2VwMky1pJ3okUEWsY7DXR4QLQHmJwbdXz8HGgwvqFmhpBzI+QqvqU24qTNU5cxi1V/S/82VKA5ZdDQeshB7l8uB5O4HJRK0cJ3GPe0yqiAv7H7RRfheMGm0retxAvIf++k416vtQAAAABJRU5ErkJggg==",xde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAdVBMVEUAAABQgN9Qh+dIh+dKh+dLiehJhuZKh+dKh+dKiehMiOZKiOhKh+ZLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvR4fnH2ffG2fe70vavy/Wlw/Okw/Oau/GOtPCCre93pe1snethlupVj+lKh+d4loSdAAAAE3RSTlMAECAgYHBwf4Cvr6+wv7/f3+/vGLhWpgAAALFJREFUeNqFktkOgyAUBUGw2k2xdK+tXez5/0/sRcINShrn8UwyEIKYQ+ZrA5hKZ+O5aBAooj0ziDDZZE8N72ykcBRIKIcQRnQdgJ0koRHztg8QCxIVIvrDEY4NiRqOjxc32/vjSfjd3kE8KeQJAq3tOOTgFC725UOcWmHge9q3HMKWRM4XsmcENAnZBHPtWShBlH+eRMj0EYVHTYxRIjbpPj6nKaWIUXpbA/Uyl3Pf5getMTOwg0TeVAAAAABJRU5ErkJggg==",Ede="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAb1BMVEUAAABQgN9Qh+dIh+dMiOhLiehLhuZJhuZKh+dKh+dLiOdLh+dKh+dJh+dLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvH2fe70vawy/Wlw/Okw/Oau/GOtPCCre9snethlupVj+lKh+ell/5vAAAAFHRSTlMAECAgb3BwcH+An5+foL+/39/v7x2mWn4AAADFSURBVHjardFbE4IgEIZhlCzpILlu2vlg3///jY2LCmFd1XPDjC+rjKg/SHJbAmSzdJJSi9EqyjNCoFqELUckD+YwMc6mhIlq+O4SH9h+EO+eddMticQsigeWaCRavDlz0/r3EkJX5gc6pUSIunl2S8t8gRNG3netlubjFnCPj8MWUYUHand8PslhnEKigfNg5l0b/cAEvRvzHSOthB3rzbe1cjRhgrTqzb9dmTCIGBWYEwIkc57e+FZoFdNZQcC2MIn63QuNoTrjXNIamQAAAABJRU5ErkJggg==",_de="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAVFBMVEUAAABQh+dIh+dMh+dNhuZJhuZLhudKh+dLiOZKh+ZLiOdLh+dLiOZKiOhKhuZKh+dLiOhKiOj////p8Pzo8Py70valw/Okw/OCre9hlupVj+lKh+fHgVaqAAAAEnRSTlMAICBAUFBfYI+Qv7/Pz8/f7++YjQRgAAAA0ElEQVR42q3TSw6DMAwEUJeUUvohJtAPnfvfs9Ko4CQNEgveisXIHgtFduXOnQJ6PTspaTwWvpHcoUPCHyRxUmT6WiI1Ck7RfEVBb1s8irqlP1Y0qwM+w8hThBz+PAIDcAy0yD3DOPGjZeCKzDuEN+jOgCI1DeEFUM8AQMM4/QqGB2ZJgItZ8JMGFDQxYQVtxQ1RggUXl+RMJqygneni/iy4cEI+SrDgzG/8WVbT2ACqFAVaCa0uqSVyVGS0kUTlkeiq7Q/HuPaigN5at+uL/gLpuz1zBDpoxgAAAABJRU5ErkJggg==",Tde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAQAAACIaFaMAAAAX0lEQVR42p2QsQ3AMAgEGYVN7c0YgRFSWn4Kj0AUpUB+KUVMg9AhDr08hUve4gm5gfwDlsKQ8KUEwmcXmR1GAFl9BxZNJBqcwFA4EjaUdLVGOrrPD5CuAOkKnGX1GfsN8GpnheGO5BcAAAAASUVORK5CYII=",Rde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAUCAQAAAD4zq+ZAAAAYUlEQVR42rXSsQlAIQyE4YySTXWzjJARLMWzcIS8VrgU4YE2HnyVP0rxYNybOWhnfBSGgB9NefvqIqvDiPlmtt1EdoOnPBWOgE0lpv2UKQUzp0DUklAKYkrx62Hj3sU/9AGxCm8pYVxqRAAAAABJRU5ErkJggg==",kde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAYCAQAAABdXGW6AAAAeklEQVR42sXTsQnAIBBGYUdyBEdxg7jpjXCtPIe4FLH7c5AiJFaHfCA+tFwLL7Jkl7hF8RniwAmMniI6vlopVHyOBC2j7qnhCSJ0VuSr7aliCZoDp16H0fPbdYzA53gvpmZTpNkE5dnyQnlSzaZIsynSbIL+eL6PvtQJ4UChTyXPK9AAAAAASUVORK5CYII=",Ide="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAQAAAAkETzVAAAAnElEQVR42tXUwQ3DIBQD0IzACH/zZIN0g4ySI8UcPMKvoFUurixV6iVww09IXxYs74UT5yLra4JEirqSO1AGjpG0nWEpoxP52WQY2ndk285So21IHIaOszrvYkGCjhLJMmmM3NA50spgwYp8PgytgWuszhqGDtz3SY8a/2/Ld6JUOzFUO1HqO1GqnRiqnSh1nSjVTu75DDX54SN6AZhSSVQMW05AAAAAAElFTkSuQmCC",Mde="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAQAAACiV3CzAAAArUlEQVR42u2UsQ0DIQxFbwRGYhQ2CBscmzEKLXwKRnBEFELxI/tS5+zKtp5keJKPFSgoB4Uyg0B2xbO/ArpHnjNkhAtAPyE7+2kACLPbUnHF1fhCvA5kSI2ragmCrAMCGW5Vw0EwdGAQIOZKLX2qh7lS97Nb43DDvf8rKMB66M6WLohDWOK612yyVN0mA4ZNBgybDBg2GTBsMmDZZMC2yYBtkwG2ed+lL7Ofz/0TFpaPsFvoSukAAAAASUVORK5CYII=",Dde="data:image/svg+xml,%3csvg%20width='8'%20height='8'%20viewBox='0%200%208%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203.66699L4.5%205.66699L6.5%203.66699'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Pde="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.5%209.5L7.5%206.5L4.5%203.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Nde="data:image/svg+xml,%3csvg%20width='12'%20height='14'%20viewBox='0%200%2012%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.00092%2012.6467C5.00092%2013.1989%205.44863%2013.6467%206.00092%2013.6467C6.5532%2013.6467%207.00092%2013.1989%207.00092%2012.6467H6.00092H5.00092ZM9.52911%206.29494C9.91963%206.68546%2010.5528%206.68546%2010.9433%206.29494C11.3338%205.90442%2011.3338%205.27125%2010.9433%204.88073L10.2362%205.58783L9.52911%206.29494ZM1.05852%204.88073C0.667994%205.27125%200.667994%205.90442%201.05852%206.29494C1.44904%206.68546%202.08221%206.68546%202.47273%206.29494L1.76562%205.58783L1.05852%204.88073ZM6.25049%201.60211L6.95759%200.894999L6.25049%201.60211ZM5.75135%201.60211L5.04425%200.894999L5.75135%201.60211ZM6.25049%201.60211L5.54338%202.30921L9.52911%206.29494L10.2362%205.58783L10.9433%204.88073L6.95759%200.894999L6.25049%201.60211ZM5.75135%201.60211L5.04425%200.894999L1.05852%204.88073L1.76562%205.58783L2.47273%206.29494L6.45846%202.30921L5.75135%201.60211ZM6.00092%202.05842H5.00092V12.6467H6.00092H7.00092V2.05842H6.00092ZM6.25049%201.60211L6.95759%200.894999C6.42924%200.366643%205.5726%200.366643%205.04425%200.894999L5.75135%201.60211L6.45846%202.30921C6.20577%202.56191%205.79607%202.56191%205.54338%202.30921L6.25049%201.60211Z'%20fill='white'/%3e%3c/svg%3e",Ode="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.01953%2013.2344L12.1596%206.09434C12.5297%205.71639%2012.9711%205.41559%2013.4582%205.20932C13.9453%205.00305%2014.4684%204.89541%2014.9974%204.89263C15.5264%204.88986%2016.0506%204.99199%2016.5399%205.19314C17.0291%205.39428%2017.4736%205.69044%2017.8476%206.06448C18.2217%206.43852%2018.5178%206.88301%2018.719%207.37224C18.9201%207.86148%2019.0223%208.38574%2019.0195%208.9147C19.0167%209.44366%2018.9091%209.96683%2018.7028%2010.4539C18.4965%2010.941%2018.1957%2011.3824%2017.8178%2011.7525L11.1485%2018.4202C10.7353%2018.82%2010.1816%2019.0414%209.60671%2019.0367C9.03182%2019.0319%208.48182%2018.8014%208.07531%2018.3949C7.66879%2017.9884%207.43831%2017.4384%207.43358%2016.8635C7.42884%2016.2886%207.65022%2015.7349%208.04999%2015.3218L14.4487%208.92226'%20stroke='%23444444'%20stroke-width='1.14645'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Bde="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.62623%2016.5952L9.18302%203.47138C9.54492%202.84288%2010.4551%202.84287%2010.817%203.47138L18.3738%2016.5952C18.7339%2017.2206%2018.2806%2018%2017.5568%2018H2.44321C1.7194%2018%201.26612%2017.2206%201.62623%2016.5952Z'%20fill='%23FFD112'/%3e%3cpath%20d='M11%2014.5V16.5H9V14.5H11ZM11%207V10L10.5%2013.5H9.5L9%2010V7H11Z'%20fill='black'%20fill-opacity='0.8'/%3e%3c/svg%3e",Lde="data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.38672%205.07617L6.4082%206.0918L8.33008%208.00098L6.41016%209.91016L5.3877%2010.9258L4.87695%2011.4346L5.15918%2011.7178L5.44141%2012.002L5.95215%2011.4932L6.97461%2010.4775L8.89746%208.56543L11.7627%2011.4131L12.3135%2011.9619L12.5957%2011.6777L12.8779%2011.3945L12.3262%2010.8457L11.2227%209.74902L9.46484%208.00098L11.2246%206.25293L12.3281%205.15625L12.8799%204.6084L12.3154%204.04004L11.7637%204.58887L10.6611%205.68555L8.89746%207.4375L6.97266%205.52441L5.9502%204.50879L5.43945%204L4.875%204.56836L5.38672%205.07617Z'%20fill='%23444444'/%3e%3c/svg%3e",Ude="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1475%206.14844C17.3428%205.95347%2017.6593%205.95325%2017.8545%206.14844C18.0495%206.34361%2018.0494%206.66023%2017.8545%206.85547L12.707%2012.001L17.8545%2017.1465C18.0495%2017.3417%2018.0494%2017.6583%2017.8545%2017.8535C17.6593%2018.0488%2017.3428%2018.0486%2017.1475%2017.8535L12%2012.708L6.85352%2017.8535C6.65826%2018.0487%206.34173%2018.0487%206.14648%2017.8535C5.95128%2017.6583%205.95129%2017.3417%206.14648%2017.1465L11.293%2012.001L6.14648%206.85645C5.9512%206.66121%205.95125%206.34372%206.14648%206.14844C6.34167%205.95358%206.65832%205.95357%206.85352%206.14844L12%2011.2939L17.1475%206.14844Z'%20fill='%23383838'/%3e%3c/svg%3e",Vde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5%2010.0078C18.3284%2010.0078%2019%2010.6794%2019%2011.5078V17.5039C18.9999%2018.3323%2018.3284%2019.0039%2017.5%2019.0039H11.5C10.6716%2019.0039%2010.0001%2018.3323%2010%2017.5039V11.5078C10%2010.6794%2010.6716%2010.0078%2011.5%2010.0078H17.5ZM11.5%2011.0078C11.2239%2011.0078%2011%2011.2317%2011%2011.5078V17.5039C11.0001%2017.78%2011.2239%2018.0039%2011.5%2018.0039H17.5C17.7761%2018.0039%2017.9999%2017.78%2018%2017.5039V11.5078C18%2011.2317%2017.7761%2011.0078%2017.5%2011.0078H11.5ZM12.5%205.00781C13.3284%205.00781%2014%205.67939%2014%206.50781V8.50391C13.9999%208.77999%2013.7761%209.00391%2013.5%209.00391C13.2239%209.00391%2013.0001%208.77999%2013%208.50391V6.50781C13%206.23167%2012.7761%206.00781%2012.5%206.00781H6.5C6.22386%206.00781%206%206.23167%206%206.50781V12.5039C6.00006%2012.78%206.22389%2013.0039%206.5%2013.0039H8.5C8.77614%2013.0039%209%2013.2278%209%2013.5039C8.99993%2013.78%208.7761%2014.0039%208.5%2014.0039H6.5C5.67161%2014.0039%205.00006%2013.3323%205%2012.5039V6.50781C5%205.67939%205.67157%205.00781%206.5%205.00781H12.5Z'%20fill='%23383838'/%3e%3c/svg%3e",Fde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.5%2017.5V18.5C6.5%2019.0523%206.94772%2019.5%207.5%2019.5L17.5%2019.5C18.0523%2019.5%2018.5%2019.0523%2018.5%2018.5V17.5M12.5%2016.5L16.5%2012.5M12.5%2016.5L8.5%2012.5M12.5%2016.5L12.5%204.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Hde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%207.49985L5.5%2014.4998V17.4998H8.5L15.5%2010.4998M12.5%207.49985L14.7929%205.20696C15.1834%204.81643%2015.8166%204.81643%2016.2071%205.20696L17.7929%206.79274C18.1834%207.18327%2018.1834%207.81643%2017.7929%208.20696L15.5%2010.4998M12.5%207.49985L15.5%2010.4998M12.5%2017.4998H18.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",zde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%206.40134C15.0517%204.15279%2017.8188%203.31941%2019%204.49997C20.1895%205.69001%2019.6231%208.7789%2017.4746%2011.9961C19.6357%2015.2148%2020.2216%2018.3051%2019.0312%2019.4961C17.8483%2020.6787%2015.0742%2019.8415%2012.0166%2017.5849C9.084%2019.7502%206.41259%2020.612%205.1543%2019.6367L5%2019.5C3.80767%2018.3069%204.37927%2015.2052%206.54102%2011.9795C4.48008%208.90048%203.86233%205.94191%204.8623%204.65622L5%204.49997C6.18113%203.31937%208.94821%204.15291%2012%206.40134ZM7.16309%2012.8535C6.56467%2013.7917%206.11514%2014.7037%205.81836%2015.5371C5.50467%2016.418%205.3752%2017.1716%205.38965%2017.7509C5.40443%2018.3376%205.56136%2018.647%205.70703%2018.7929C5.83884%2018.9245%206.09299%2019.054%206.60352%2019.0332C7.12139%2019.0119%207.80829%2018.8352%208.63672%2018.4619C9.42136%2018.1083%2010.2866%2017.5978%2011.1934%2016.9472C10.6041%2016.4707%2010.0084%2015.9452%209.41602%2015.374L9.03125%2014.9961C8.33184%2014.2966%207.70854%2013.5757%207.16309%2012.8535ZM16.8535%2012.8711C16.3122%2013.5885%2015.6946%2014.3053%2015%2015L14.6152%2015.3779C14.0243%2015.9477%2013.4297%2016.4716%2012.8418%2016.9472C13.747%2017.5963%2014.6111%2018.1049%2015.3945%2018.458C16.223%2018.8313%2016.9098%2019.009%2017.4277%2019.0302C17.9385%2019.0511%2018.1924%2018.9207%2018.3242%2018.789C18.4684%2018.6447%2018.6252%2018.3386%2018.6377%2017.7529C18.65%2017.1742%2018.5167%2016.4203%2018.1992%2015.539C17.9006%2014.7102%2017.45%2013.804%2016.8535%2012.8711ZM12%207.65915C11.2473%208.25368%2010.4755%208.93856%209.70703%209.707C8.96255%2010.4515%208.31335%2011.2181%207.75977%2011.9785C8.32145%2012.7516%208.98101%2013.5317%209.73828%2014.289C10.502%2015.0527%2011.2693%2015.7341%2012.0176%2016.3261C12.7646%2015.7349%2013.5307%2015.0552%2014.293%2014.2929C15.0451%2013.5408%2015.6996%2012.7661%2016.2568%2011.998C15.6983%2011.2314%2015.0438%2010.4578%2014.293%209.707C13.5245%208.93855%2012.7527%208.25369%2012%207.65915ZM12%209.99997C13.1046%209.99997%2014%2010.8954%2014%2012C14%2013.1045%2013.1046%2014%2012%2014C10.8955%2013.9999%2010%2013.1045%2010%2012C10%2010.8954%2010.8955%2010%2012%209.99997ZM17.3965%204.96677C16.8786%204.988%2016.1917%205.16473%2015.3633%205.53806C14.5841%205.88923%2013.7251%206.39497%2012.8252%207.03903C13.5463%207.62135%2014.2771%208.27708%2015%208.99997C15.6926%209.69257%2016.3099%2010.4069%2016.8516%2011.122C17.4423%2010.1923%2017.8874%209.28909%2018.1816%208.46286C18.4954%207.5816%2018.6259%206.82743%2018.6113%206.24802C18.5965%205.66136%2018.4387%205.35286%2018.293%205.207C18.1612%205.07538%2017.9071%204.9459%2017.3965%204.96677ZM6.60449%204.96677C6.09321%204.94582%205.83879%205.07622%205.70703%205.20798C5.5629%205.35246%205.40697%205.65839%205.39453%206.24411C5.38232%206.82279%205.51549%207.57579%205.83301%208.457C6.12933%209.27934%206.57453%2010.1782%207.16406%2011.1035C7.7009%2010.3943%208.31333%209.68665%209%208.99997C9.72289%208.27709%2010.4537%207.62137%2011.1748%207.03903C10.2749%206.39499%209.41591%205.8892%208.63672%205.53806C7.80857%205.1649%207.12231%204.98808%206.60449%204.96677Z'%20fill='%23444444'/%3e%3c/svg%3e",Qde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10%205C10.2761%205%2010.5%205.22386%2010.5%205.5C10.5%205.77614%2010.2761%206%2010%206H6.5C6.22386%206%206%206.22386%206%206.5V17.5C6%2017.7761%206.22386%2018%206.5%2018H17.5C17.7761%2018%2018%2017.7761%2018%2017.5V14C18%2013.7239%2018.2239%2013.5%2018.5%2013.5C18.7761%2013.5%2019%2013.7239%2019%2014V17.5C19%2018.3284%2018.3284%2019%2017.5%2019H6.5C5.67157%2019%205%2018.3284%205%2017.5V6.5C5%205.67157%205.67157%205%206.5%205H10ZM18%205C18.5523%205%2019%205.44772%2019%206V10.5C19%2010.7761%2018.7761%2011%2018.5%2011C18.2239%2011%2018%2010.7761%2018%2010.5V6.70703L11.8535%2012.8535C11.6583%2013.0488%2011.3417%2013.0488%2011.1465%2012.8535C10.9512%2012.6583%2010.9512%2012.3417%2011.1465%2012.1465L17.293%206H13.5C13.2239%206%2013%205.77614%2013%205.5C13%205.22386%2013.2239%205%2013.5%205H18Z'%20fill='%23383838'/%3e%3c/svg%3e",Gde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%2019a.5.5%200%200%201%200%201h-8a.5.5%200%200%201%200-1zm3.308-11.5a4.308%204.308%200%200%201%203.378%206.979l1.668%201.668a.5.5%200%201%201-.707.707l-1.668-1.668a4.308%204.308%200%201%201-2.67-7.685m0%201a3.308%203.308%200%201%200%200%206.615%203.308%203.308%200%200%200%200-6.615M8.5%2014a.5.5%200%200%201%200%201h-4a.5.5%200%200%201%200-1zm0-5a.5.5%200%200%201%200%201h-4a.5.5%200%200%201%200-1zm11-5a.5.5%200%200%201%200%201h-15a.5.5%200%200%201%200-1z'%20fill='%23444'/%3e%3c/svg%3e",$de="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9934%208.5H12.0009'%20stroke='%23383838'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.2018%2016.1667V12.0001C12.2018%2011.6072%2012.2018%2011.4108%2012.0798%2011.2887C11.9578%2011.1667%2011.7613%2011.1667%2011.3685%2011.1667M19.5%2012C19.5%2016.1421%2016.1421%2019.5%2012%2019.5C7.85786%2019.5%204.5%2016.1421%204.5%2012C4.5%207.85786%207.85786%204.5%2012%204.5C16.1421%204.5%2019.5%207.85786%2019.5%2012Z'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Wde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.5%2017.5H14.5M7.5%209.5H16.5M5.5%205.5H14.5M9.5%2013.5H18.5'%20stroke='%23383838'%20stroke-miterlimit='1.41421'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",jde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5%205C15.0389%205%2017.9999%207.86724%2018%2011.4229C18%2013.0282%2017.3923%2014.5291%2016.3984%2015.6914L19.8535%2019.1465C20.0488%2019.3417%2020.0488%2019.6583%2019.8535%2019.8535C19.6583%2020.0488%2019.3417%2020.0488%2019.1465%2019.8535L15.6943%2016.4014C14.5572%2017.3902%2013.0906%2018%2011.5%2018C7.95263%2018%205%2015.0474%205%2011.5C5%207.95262%207.95263%205%2011.5%205ZM11.5%206C8.50492%206%206%208.50491%206%2011.5C6%2014.4951%208.50492%2017%2011.5%2017C14.4869%2017%2017%2014.4262%2017%2011.4229C16.9999%208.43621%2014.5034%206%2011.5%206Z'%20fill='%23383838'/%3e%3cpath%20d='M11.5%205.5C12.0158%205.5%2012.6412%205.97409%2013.167%207.11328C13.6732%208.21012%2014%209.76059%2014%2011.5C14%2013.2394%2013.6732%2014.7899%2013.167%2015.8867C12.6412%2017.0259%2012.0158%2017.5%2011.5%2017.5C10.9842%2017.5%2010.3588%2017.0259%209.83301%2015.8867C9.32677%2014.7899%209%2013.2394%209%2011.5C9%209.76059%209.32677%208.21012%209.83301%207.11328C10.3588%205.97409%2010.9842%205.5%2011.5%205.5Z'%20stroke='%23383838'/%3e%3cpath%20d='M6%2011.5L17.5%2011.5'%20stroke='%23383838'/%3e%3c/svg%3e",Kde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.57%206.42969L8%2011.9995L13.57%2017.5694'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Yde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5%205C14.3284%205%2015%205.67157%2015%206.5V8H17.5C17.7761%208%2018%208.22386%2018%208.5C18%208.77614%2017.7761%209%2017.5%209H17V17.5C17%2018.3284%2016.3284%2019%2015.5%2019H8.5C7.67157%2019%207%2018.3284%207%2017.5V9H6.5C6.22386%209%206%208.77614%206%208.5C6%208.22386%206.22386%208%206.5%208H9V6.5C9%205.67157%209.67157%205%2010.5%205H13.5ZM8%2017.5C8%2017.7761%208.22386%2018%208.5%2018H15.5C15.7761%2018%2016%2017.7761%2016%2017.5V9H8V17.5ZM10.5%2011C10.7761%2011%2011%2011.2239%2011%2011.5V15.5C11%2015.7761%2010.7761%2016%2010.5%2016C10.2239%2016%2010%2015.7761%2010%2015.5V11.5C10%2011.2239%2010.2239%2011%2010.5%2011ZM13.5%2011C13.7761%2011%2014%2011.2239%2014%2011.5V15.5C14%2015.7761%2013.7761%2016%2013.5%2016C13.2239%2016%2013%2015.7761%2013%2015.5V11.5C13%2011.2239%2013.2239%2011%2013.5%2011ZM10.5%206C10.2239%206%2010%206.22386%2010%206.5V8H14V6.5C14%206.22386%2013.7761%206%2013.5%206H10.5Z'%20fill='%23383838'/%3e%3c/svg%3e",qde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.5%207C19.3284%207%2020%207.67157%2020%208.5V15.5C20%2016.3284%2019.3284%2017%2018.5%2017H5.5C4.67157%2017%204%2016.3284%204%2015.5V8.5C4%207.67157%204.67157%207%205.5%207H18.5ZM5.5%208C5.22386%208%205%208.22386%205%208.5V15.5C5%2015.7761%205.22386%2016%205.5%2016H18.5C18.7761%2016%2019%2015.7761%2019%2015.5V8.5C19%208.22386%2018.7761%208%2018.5%208H5.5Z'%20fill='%23383838'/%3e%3cpath%20d='M8.5%209C8.77614%209%209%209.22386%209%209.5C9%209.77614%208.77614%2010%208.5%2010H8V14H8.5C8.77614%2014%209%2014.2239%209%2014.5C9%2014.7761%208.77614%2015%208.5%2015H6.5C6.22386%2015%206%2014.7761%206%2014.5C6%2014.2239%206.22386%2014%206.5%2014H7V10H6.5C6.22386%2010%206%209.77614%206%209.5C6%209.22386%206.22386%209%206.5%209H8.5Z'%20fill='%23446ECA'/%3e%3c/svg%3e",Jde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%209.3018C6.08346%206.49281%208.80901%204.5%2012%204.5C16.1421%204.5%2019.5%207.85786%2019.5%2012C19.5%2016.1421%2016.1421%2019.5%2012%2019.5C8.80901%2019.5%206.08346%2017.5072%205%2014.6982M7.5%209.5H4.5V6.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Xde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.5017%205.50391H6.50366C5.95138%205.50391%205.50366%205.95162%205.50366%206.50391V17.5039C5.50366%2018.0562%205.95138%2018.5039%206.50366%2018.5039H8.5017M8.5017%205.50391V7.50192C8.5017%208.0542%208.94942%208.50192%209.5017%208.50192H12.5045C13.0568%208.50192%2013.5045%208.0542%2013.5045%207.50192V5.50391M8.5017%205.50391H13.5045M13.5045%205.50391H15.0863C15.3512%205.50391%2015.6053%205.609%2015.7928%205.79613L18.2101%208.20891C18.398%208.3965%2018.5037%208.65114%2018.5037%208.91668V17.5039C18.5037%2018.0562%2018.0559%2018.5039%2017.5037%2018.5039H15.5M8.5017%2018.5039V13.5042C8.5017%2012.9519%208.94942%2012.5042%209.5017%2012.5042H14.5C15.0523%2012.5042%2015.5%2012.9519%2015.5%2013.5042V18.5039M8.5017%2018.5039H15.5'%20stroke='black'%20stroke-opacity='0.8'%20stroke-linejoin='round'/%3e%3c/svg%3e",Zde="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.5%2015.5C16.5%2014.3954%2015.6046%2013.5%2014.5%2013.5C13.3954%2013.5%2012.5%2014.3954%2012.5%2015.5M16.5%2015.5C16.5%2016.6046%2015.6046%2017.5%2014.5%2017.5C13.3954%2017.5%2012.5%2016.6046%2012.5%2015.5M16.5%2015.5L19.5%2015.5M12.5%2015.5L4.5%2015.5M11.5%208.5C11.5%207.39543%2010.6046%206.5%209.5%206.5C8.39543%206.5%207.5%207.39543%207.5%208.5M11.5%208.5C11.5%209.60457%2010.6046%2010.5%209.5%2010.5C8.39543%2010.5%207.5%209.60457%207.5%208.5M11.5%208.5L19.5%208.5M7.5%208.5H4.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ehe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%204a8%208%200%200%201%207.545%205.334A8%208%200%200%201%2020%2012a8%208%200%200%201-.455%202.667%208.003%208.003%200%200%201-15.09%200A8%208%200%200%201%204%2012c0-.934.16-1.832.455-2.666A8%208%200%200%201%2012%204M9.3%2015c.167.79.399%201.497.676%202.092C10.592%2018.409%2011.342%2019%2012%2019s1.409-.59%202.024-1.908A9.8%209.8%200%200%200%2014.7%2015zm-3.625%200a7.02%207.02%200%200%200%204.038%203.616%206.6%206.6%200%200%201-.643-1.1c-.338-.723-.607-1.577-.791-2.516zm10.046%200c-.184.94-.453%201.793-.79%202.515a6.6%206.6%200%200%201-.645%201.101A7.02%207.02%200%200%200%2018.326%2015zm-10.43-5a7%207%200%200%200-.001%204h2.829c-.08-.64-.122-1.311-.122-2s.042-1.36.122-2zm3.837%200a15%2015%200%200%200-.131%202c0%20.696.046%201.367.13%202h5.745c.084-.633.13-1.304.13-2%200-.697-.046-1.368-.13-2zm6.753%200a16.4%2016.4%200%200%201%200%204h2.829a7%207%200%200%200%200-4zM9.714%205.383A7.02%207.02%200%200%200%205.674%209H8.28c.184-.94.454-1.792.791-2.515.186-.399.402-.772.644-1.102M12%205c-.658%200-1.408.59-2.024%201.908A9.8%209.8%200%200%200%209.301%209h5.398a9.8%209.8%200%200%200-.675-2.092C13.41%205.59%2012.658%205%2012%205m2.285.382c.242.33.459.704.645%201.103.338.723.607%201.575.791%202.515h2.605a7.02%207.02%200%200%200-4.041-3.618'%20fill='%23444444'/%3e%3c/svg%3e",the="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5%205.5V11.5M11.5%2011.5V17.5M11.5%2011.5H17.5M11.5%2011.5H5.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",nhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5%208.5L10.5%2015.5L7.5%2012.5'%20stroke='%23444444'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ihe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%206L14%2014M14%206L6%2014'%20stroke='%23383838'/%3e%3c/svg%3e",rhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208L3%2012L7%2016M17%208L21%2012L17%2016M14%204L10%2020'%20stroke='%23444444'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",she="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14.9998'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3ccircle%20cx='4.99975'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3ccircle%20cx='9.99975'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3c/svg%3e",ohe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.02215%2014.8161L0.421696%2011.728C-0.140565%2011.4584%20-0.140565%2011.0417%200.421696%2010.7967L2.71963%209.71826L6.99771%2011.728C7.55997%2011.9976%208.46448%2011.9976%209.00229%2011.728L13.2804%209.71826L15.5783%2010.7967C16.1406%2011.0663%2016.1406%2011.4829%2015.5783%2011.728L8.97785%2014.8161C8.46448%2015.0612%207.55997%2015.0612%207.02215%2014.8161Z'%20fill='%23FF6F3D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.00076%2010.9948L0.420411%207.90306C-0.140137%207.63315%20-0.140137%207.21601%200.420411%206.97064L2.6626%205.91553L7.00076%207.95214C7.56131%208.22205%208.46306%208.22205%208.99924%207.95214L13.3374%205.91553L15.5796%206.97064C16.1401%207.24055%2016.1401%207.65769%2015.5796%207.90306L8.99924%2010.9948C8.43869%2011.2647%207.53694%2011.2647%207.00076%2010.9948Z'%20fill='%2395C038'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.00076%207.21299L0.420411%204.16576C-0.140137%203.89973%20-0.140137%203.48859%200.420411%203.24675L7.00076%200.199521C7.56131%20-0.066507%208.46306%20-0.066507%208.99924%200.199521L15.5796%203.24675C16.1401%203.51278%2016.1401%203.92391%2015.5796%204.16576L8.99924%207.21299C8.43869%207.45483%207.53694%207.45483%207.00076%207.21299Z'%20fill='%235DC0E8'/%3e%3c/svg%3e",ahe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5002%2017.5002L13.881%2013.881M13.881%2013.881C14.5001%2013.2619%2014.9912%2012.527%2015.3262%2011.7181C15.6612%2010.9093%2015.8337%2010.0423%2015.8337%209.16684C15.8337%208.29134%2015.6612%207.42441%2015.3262%206.61555C14.9912%205.80669%2014.5001%205.07174%2013.881%204.45267C13.2619%203.8336%2012.527%203.34252%2011.7181%203.00748C10.9093%202.67244%2010.0423%202.5%209.16684%202.5C8.29134%202.5%207.42441%202.67244%206.61555%203.00748C5.80669%203.34252%205.07174%203.8336%204.45267%204.45267C3.2024%205.70295%202.5%207.39868%202.5%209.16684C2.5%2010.935%203.2024%2012.6307%204.45267%2013.881C5.70295%2015.1313%207.39868%2015.8337%209.16684%2015.8337C10.935%2015.8337%2012.6307%2015.1313%2013.881%2013.881Z'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",lhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.0315%2016.6276C18.2814%2017.3778%2017.264%2017.7992%2016.2031%2017.7992C15.1422%2017.7992%2014.1248%2017.3778%2013.3747%2016.6276C12.6245%2015.8775%2012.2031%2014.8601%2012.2031%2013.7992C12.2031%2012.7384%2012.6245%2011.7209%2013.3747%2010.9708C14.1248%2010.2206%2015.1422%209.79922%2016.2031%209.79922C17.264%209.79922%2018.2814%2010.2206%2019.0315%2010.9708C19.7817%2011.7209%2020.2031%2012.7384%2020.2031%2013.7992C20.2031%2014.8601%2019.7817%2015.8775%2019.0315%2016.6276ZM19.0315%2016.6276L22.2031%2019.7992M4.20312%204.19922H19.8029M4.20312%208.99922H9.0029M4.20312%2013.7992H9.00313M4.20312%2018.5992H9.00313'%20stroke='%23383838'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",che="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='7'%20fill='%23EF4444'/%3e%3cpath%20d='M7%2011C7%2010.4477%207.44772%2010%208%2010C8.55228%2010%209%2010.4477%209%2011C9%2011.5523%208.55228%2012%208%2012C7.44772%2012%207%2011.5523%207%2011Z'%20fill='white'/%3e%3cpath%20d='M8%204.5C8.27614%204.5%208.5%204.72386%208.5%205V8C8.5%208.27614%208.27614%208.5%208%208.5C7.72386%208.5%207.5%208.27614%207.5%208V5C7.5%204.72386%207.72386%204.5%208%204.5Z'%20fill='white'%20stroke='white'/%3e%3c/svg%3e",uhe="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='12'%20height='12'%20rx='4'%20fill='white'/%3e%3c/svg%3e",dhe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='7'%20fill='%234A87E7'/%3e%3cpath%20d='M11.5%205.5L7.5%2010.5L5%208'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",hhe="data:image/svg+xml,%3csvg%20width='12'%20height='16'%20viewBox='0%200%2012%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%200C2.77614%201.40922e-07%203%200.223858%203%200.5V8C3%208.01656%202.99669%208.03268%202.99512%208.04883C4.13869%208.27856%205%209.28878%205%2010.5C5%2011.7112%204.13859%2012.7204%202.99512%2012.9502C2.99675%2012.9667%203%2012.9831%203%2013V15.5C3%2015.7761%202.77614%2016%202.5%2016C2.22386%2016%202%2015.7761%202%2015.5V13C2%2012.9831%202.00228%2012.9666%202.00391%2012.9502C0.860897%2012.72%20-2.86384e-08%2011.7108%200%2010.5C1.05859e-07%209.28911%200.860803%208.27892%202.00391%208.04883C2.00234%208.03271%202%208.01653%202%208V0.5C2%200.223858%202.22386%201.76916e-07%202.5%200ZM9.5%200C9.77614%202.41411e-08%2010%200.223858%2010%200.5V3C10%203.01656%209.99669%203.03268%209.99512%203.04883C11.1387%203.27856%2012%204.28878%2012%205.5C12%206.71115%2011.1386%207.72039%209.99512%207.9502C9.99675%207.96665%2010%207.98311%2010%208V15.5C10%2015.7761%209.77614%2016%209.5%2016C9.22386%2016%209%2015.7761%209%2015.5V8C9%207.98314%209.00228%207.96662%209.00391%207.9502C7.8609%207.72003%207%206.71082%207%205.5C7%204.28911%207.8608%203.27892%209.00391%203.04883C9.00234%203.03271%209%203.01653%209%203V0.5C9%200.223858%209.22386%20-5.17733e-10%209.5%200ZM2.5%209C1.67157%209%201%209.67157%201%2010.5C1%2011.3284%201.67157%2012%202.5%2012C3.32843%2012%204%2011.3284%204%2010.5C4%209.67157%203.32843%209%202.5%209ZM9.5%204C8.67157%204%208%204.67157%208%205.5C8%206.32843%208.67157%207%209.5%207C10.3284%207%2011%206.32843%2011%205.5C11%204.67157%2010.3284%204%209.5%204Z'%20fill='%23383838'/%3e%3c/svg%3e",fhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZEtDoNAFITnbSqqGnRVT1BdV9tb1PQC7QnoBRoOUMMtcFg0J0ChCQoBLCA2IWT5C0v4/dR7O8nM7g6wdEgM15/95BxGPmoYhkfEdPdzN4uFidPcXFdgXnDhPDXEwsoC1KHJAkZh9IBDnWC9bjifjuiCH0Z4/B2pNt0L6m7Ul72DVjbaQdOfV9k7mFdAAEUQwZMFvMvCAPMgifHFasgAjIwsM/J7FVgAAAAASUVORK5CYII=",phe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC3SURBVHgB7ZJBCsIwEEX/hB6gR+gJ3LvyKK5d6gnqBaQ7157EpXtPkCP0AGpsC4EKNYNjRgvJg8BMhuEF8oHUIF8sDue1c2i6soQOlsjU193q1DfG33bSWlHaUzn3aHxjxgPoU06Jf8rfxEVouFlWw5FwvNjhvMNwYincblAcejEHt1twy9/IQ+RUv5BT/Qk51bMRR0m15EuipFqS/iiplgQwpzotcQtliGCnxNvxQEHa3m/YI1meArZGr61SULYAAAAASUVORK5CYII=",ghe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADtSURBVHgB7Zc9CsIwGIbfBg/gETyAuDv2JLo6qRRndRdqJ1c9SUd39QAeoRewMRTFpihfJD+08D0QaJqQPE36Dh/AdIyo+WKU5mtZYqEe+/BLodrxmsRL/BJSMulLJhhKYHtJ4s27L+qDSmaKwEhgXu+Lxrjva/qGtqdAy2AhitYJ9UwmzcaDqtlwON+rRmF0QrYy/6xhJGTyZa7WMLoy0+N2AaeMglNGwSmj4JRROE+Z7fU6T5ltIp2nzPbn55RRsBBFU6hAeLQ9NSFV1mYIjJQ4QXfQGe7yvRCYqIleq9goQlE+kN1Wn7qe6SRPOzRTtiriQgMAAAAASUVORK5CYII=",mhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFISURBVHgB7ZivbkIxFMa/lmWb2BbkMoWYmmJ2jhdY9gqzU8NsDzGBG5JXgCcAhQWFQqAIkoCBhH/tJZAWUc5NWm4J56due89Nfren+cQBmAtFHG4UK83Cco0a1iiqZR6np56TKHfLpYG5aYkmkit0kI2gyVjJvpqy0nyrJCvIXlKTT7pqIA8KPhAL26u3RyJerM7GLGrBor45G9ErauH7yyN+S8+4vyF/4mQ4maHaHqDRG5HqySf69VbwJql5erjFj/pxKmTRu2t/kjum8wW5liz61+on7fKFlvxXradCPiZ9l6j3KQQcT77heDoGxxPHExGOJ98Ejae0EeQiaDyljSAXweMpTQS5CBpPaSPIBceTb1jUN2crOkak2KICXcRDw1xYojmBT0RwqkIkg9xvc88S1RNePelVj3VkgBZUXW1JYU+bmYtmA3mPe4AD8x5bAAAAAElFTkSuQmCC",Ahe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFYSURBVHgB7dmrbgJBFAbgf4amrWgbZFOFqKqito4XaPoKtVXFtA9RgWtlXwGeABQWFAqBIkgCBhJuM0tIYGZhOZtlZzacT8FekvPvnMwRAzB23kTYxWKlXpgv8Y8liupvHu5VcxLldrnUM29YAYLiF2jBj8K3DVWIZzOENJ9SxVfgX/FaPugKgwx58A2+Wrf0DolssTojawEsHMA1DuDaBYhen+7xXXrE7RX51YP6own+mj3UOgPSe+QV+HgpJF689nB3jS/1YajIAW4uky9+YzydgYoc4KfRDZY7abr4X9VCVOTPqXuU2qenxNuoazwHksJz4Fg8B/bgOZBVHMC11OZA3H0+SmpzIO4+HyXVORBnn4+S2hyIu89H4TngGgdwjQO4FhZgiAyxAwi04a+aecEKkBN4h4erIERwyPdpXrcC6FNAfRqoflbhAV246oqGFPYJJWMMWAE7m3uIhCIgGgAAAABJRU5ErkJggg==",yhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEKSURBVHgB3ZU7C8IwFIVP6gt8gCA4+zfcfIziJLiKi6Cbq5Muzk4KLuIquOkouvk3nAVB8AFqNSZBS2ltobSl1G/pTW65J7knJIDfId/g3KzUqIwBm0nCBqzgDgF046P5lI8lJfNE125xDgUy9MkW+kFSJ+AcSZ2AW7guEDRLhstVhAolEcvbDW6ziYij/SGkVFr573XY49ppWROIVOsIFUvKmMf0esF9MYMVDAWC2bxujotwAaPV/sI7Dx6rhfBAjbxdi68jHvBWkGiMtSr3EVxa7j9HuSpOjQqFgyTGc1HbOw+0fTbDzAPvdmDlrJvh/8tOLXCEQxDCXjWtAJVoW52wwRGE9vA3vAG0rE29KUs4wAAAAABJRU5ErkJggg==",vhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF6SURBVHgB7ZYxS8NAGIbfpLHUqlAQnBQ6ufgL7NSKmzoVXLsJ4iT9A+k/cFAEJzsqdNKOWqd2cPIfOAtCQY2lSTxznyaU5i6tqQmF9IFwl/vuy3tf8uYSIGkobuf9sFxhFk6ckRwiwBF6Rgr64nmjzs9VL2JDj0qUw4A8s53CflEHA4ienE84bmbCsaGNmpBa30B6b59aZnzAfnpE/+YaX68vFM9UjqAVSr48q9NC7/JMet3AirXNIuarNRLlKNkFGstUderTHIHoT24p6NLBwrxSYdLyCua2dqhvtR+Ec6yOeNxbmCzAq+QCMtS1PLW9+inAjz8irZh9GgjCvdVhkVbMHPMww3AEssK42W5R++/m4g7u314JY9zR7jMMa67A18m8a9IC0tu7UFfz1Odj5n3Tm8PNpRWKvtxR5vI+i28HZYYYWLpokOZ07lwy44zDZDtXSFHKnWTnku1K4zAz1zDJFu4iYhTF+bceFmYqOx4MREAXCqshsXwDBZx7lxVVCpYAAAAASUVORK5CYII=",bhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHOSURBVHgB7Zc9TwJBEIbfO5H4RWJiYqWJNjYWVhZaES3RRhJbbaSwEUNnA/wAo7ZU2OJHI5QqlfwCGysLKyIJCREjIOfORgh33nFDgBOSe5q7ndnbfXdm5zYLuAwZitFQCu1EoSlh4ZlGP9FQVBQtOZW4PYaVICHmTJjCcBQl7ktcxxot1eDch+NoR60tg6A+p8kc3ZwqBgxXkB0DJ8jD7ahMTGJ0MwDPmh/qzCzqhTxquSyq9xlo5Q/Zh+xjkZh8GqmkU6jcpWznYUWIxIxH4vBu7TYnoye1yU5+ubpfsWZQXw4sQRQZdW7BfABhH90IyHeKGEXODE50CFbKaOVt/et+mRISUz45RDewImSVBq6/E1iC6u/59v5Ce38nsFJGe8O7bb0pa0/Z5jtt8pGlZZ2fqvDrKin6PcIOVoSqDxnU315NfWQnvxxsfvGPGIKq0LOyCg4sQbTCz9OorJRGeuhJbbI3/kOasH2/PJt+X8vZR0eKb22UQkEN/4AvcdPU4Z5ldrCqjCqM++u3oqdnWbdiOhmDJYh7DvViDFbKZLjT3Yvi4FaZHQMvqAjn0c1pvLlewGkUXOqbBkoHwXNh3UP/b7FFCkDrvd5lKPkBKNOVoQdsMjcAAAAASUVORK5CYII=",whe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIfSURBVHgB7Zi9LwRBGMaf2fvKHQWRqEiuUtDQ6vQkGlfTSTTEP0CjE42IykUnpzlBiasoFCgoKFxCJSTX+LrbDzMjGzvr7M1tdu1y+0smuZt5d/a5d2aemRsgokUh9orX6fGsasTy0DFIWzvw2xAU4yQxl17fKovVFrhILXYWiECRSlxJDFnFKtZW1UishEAko0M1anlrhSAUhj6OsGDQqWdBQXgRRjbMQgUioV7zZ4TG0SSxvgEkx3JQerIgmTbo92XUjo9QO9j/3vnwCFITkzzOjv70gOreNlT6rAxNZZQJTM8vcrHmy5ngVG4KmaU1KF3dYvzoRF2R/Dkay36ELNJCWcfJ0Zxje2pyRqgj6XY4Ybw+Q/r9soFJmrVGsEyzYvJe2OBDXA/j5RnV3W3IIj1HrQKcUHqz0K4v+Wf1pMSLF0hnlGQycnHpNviBtFD98UEu7u4WfiA99GwI2ap3gs1H7ebqq/Mg7Kl2uP/jwjCp7hb4IjEJxJ6YgLflBZqBUt2290L+28Lx0p6a2plYRt82V6HQXSjW1/+5M7HhvjgVMmnC7InvYraNgIv0y54Ewfe3vDQiEHsKmv93enKyGjf4Zk9OVuMG3+ypkdW4wZfTk9NJyA2+2ZOXVuOGyJ68JhLqNXahFYQUUSjBOUKCQbBj/S7ejxKN/dUMQ1YrGknMWisEoZ3rxbKqaEO0uohgqICQkkpvmzttV+MRLcsHyhXUF5w0o8cAAAAASUVORK5CYII=",She="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAILSURBVHgB7Zm7T8JAHMd/VygGHwlEw+TA5OIio066Y0JiYNbFOOpf4kocZDUQE4zsMumoi4uLDEwmJiQGiND27K8JWFqwvQt9YO+TdLlH+vve/R53OQCBINqQaY39s0JWobEKaLCjj0hB0BCox4l8kSzftOxdFgzj1dhzKAyfpBOX5JxVhGQdpVD5MoTGIymFDivWRpsAoFoBwgrVXdqCBIuFzTMWTYANISBohICgiQMnsa1tSByWQNrMAlleGberb68wfHwA5ak5+aO9A1gqHk+MNaN9fsCgUQNFn8sClwA0PJEvTe1DYfgNNjIwuK/+zskXZxqPSOsZQyCrAGYXiu/uzzTeDI5BISNIctVxDu13gRVmAbLuCm7BnRrxXb023GQWtNfVd6wGrDC7kHlVncD4GIExYY2LeeBpFvrL5+dF9OoA7fUgTDDHgNZ+dx0HWBPGP/KoDjDvgDm3OzE0GeO2DrDCLABX1Y0IHGPOOl7VAa5KPGhUjS3HmmB2J8zlWrtlGG92HwTrgHH00Fd6Grx1wHap/zo9ohBi1q5uJ2wWx+mgid59wCmf8+JbHXDK57z4Vgfc5HNefLkPOJ3refHtPuDVuZ4XkUaDRggImn8poAMLhF0AgRcIKZTAnbXN/kZG1BMI5y50VCKfWxttAtLlekuR1JzeVYdw0AFCmor+Qpme8swqEESdH7s2v3Q8t4opAAAAAElFTkSuQmCC",Che="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF7SURBVHgB3VUxSMNAFH0Xk9qCShylDp0ERyepW0cXhc5Ci6s4OAtSBQcHQZSuouDs4OCi6ChOjhUXHRQdQ5WmhjTn3VlrEnuXmraDvuG4u3f33v/3cxfgr4N8dd7WJgqUejugMNEFCCEPrCkNbdwd8rHWYigtdSv+KUMz1GOBNqH5CfQO5g+DfkHHL0GSI0gtnQB2Fc7VAdybY+X6jjLgogOZ6WZ/GJqZhjY2iWR+C4Ozq8q9epRwIrcMY6YoxrXtHGtpYA3nGi8VaSbKDFKLRy1xFYypvJSTGuhsEz+GMGj9FZ71GJgjo2lIdWREIltsO0/rVdjleXF8/jkZpBm0i97IFliBxwPiPBuVgTQDvskvJAxYPcI1qZXn4LEiSwOVEd6zfFMAiuiVBs7lHqLAP03PekIsg8b9tdKEZ/h+uokoKC+ac7ELt3ImbisvOq8JF3ZvzwXXCSLfIi5o7y8gLvr+mn4bEFjoEcRfLWxAQVb8RHx1Eeg6/g0+ANF4ezn6+U3RAAAAAElFTkSuQmCC",xhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGpSURBVHgB7Za9S8NAGId/l4aa+lEyKjq0i9BRBzsr+A/UTQRBJxUFcXAQpAoObuLgJiiUjh1c3HQTFMSx4GIHRcdiRaPWnHlPLf3MXW3jEh9IL727vM+9711LAL/Bfm6e1genObd3wGHCAxhjOecj2b15fUjftdII50mvpF/heYTbTmLfaOUD8B6zRvzX/Iubxkhso2vtUrSaOaD8XMtiLToCZoShDyXQuXIq2raKKXhwdBGhmZRoG0GZB6JxaTwlsdYXQ2jhCMGxJRFUH55wnd/hyFsW075RlprZD1VorixrqdiYTYkyN+SlULebSRaquw0GInFpplZ6zjlgtdkVrzL4tZj2th7M6Cnd2/k72BJJ0+JyQWV/GMbkHuz7bEU/LaKouAhXMbcKjR+MjQN0VfHsLMZ+yEKG6+FSCVCD9ag0zVX8cXMuLlWozFTulsXE6/GWU3J5Fnb+Fm8nu1BFKqYDZKXnRWA3qbU/pZwtoatMonJTYPrL1HpjpZ+Z2IrcBd7PDpSq0rSYoGyszCrahZ/fQBjy8Bjxbl0t5mDL5QPtt4rENuBbPgHagIuKgS7sOwAAAABJRU5ErkJggg==",Ehe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHpSURBVHgB7Zg9SEJRFMf/7/n6MCocCxqKHLKtSWhLcmhtDpKaK6OhoaIi9z7cy8DZsSl0S5ra0kFoKXKUGjI17Z0HL3zix7k3fSj4A5F3Pe+d/z0f13sf0KfHUGoHPg/dx/poEBW40EkU5HTnkdGzzK51uFrMkftcFxKEvZyOhTIn5oVa82MA9rNTfWEV1Ok01cfiU0WX0XWCNLSRwaUtaB4/ytkUCvEwyrlXiNJeQb5t41ud9EBbWEXxIYJCIoxK/oP9DKmUOaa9GFo5wMhewohKIwYWA3BuRKEMj4OLkCB6MAlxbkYNZ6pr6i8qDR3o0WomWloQiaHZkhBR6B7HjJdlyxZEs6TZyqLNLbPsWIIoNTKRqcYx72fZsQQN+ng1QB3ViNJTDBxYba9O8FJViF8Zn//AS1mL2hHpola0ZWGk1m/U/kbUmqSyFlaEZP4CTDQPr7tMWIJ+nu8hSzmbFrJnCSql5QWJFjkvQi+PKCZvIUoxGdHT/SZ0D3ulppmW31Ncc8OWtiCisAXRFuLreo0VKYoM2YpsO0yE2p4cfN+F9H3OjdHmtGCaaxR1IhU/1RulWBapdYjqIh/bRyfob/JbYRWkH29hPxaftQfFS9hOxdK2dV42zF5AUdbteNlAAag+1/fpSX4BtHKWwOUwEkwAAAAASUVORK5CYII=",_he="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJcSURBVHgB7Zg/aBNRHMe/SV80WSQdRQfdzNZMopugs5pRClYdRdDJtYOCToKim7ZC51Id6qCok0WXusXNDkrHhnZI0tzl+r6vBN4dafN7L9fmSvOBkPvz3t2H3+/9uweMOabkkheasxfOBUEwp+9MIUIZh8+SUupRafbPmn0xJmokw2B1RII2DS1btWXz9l0t+SIDkqRssmoRE9WSN5AdpuyTPLJLLLNZFo1xZEQVDoh8+SxO1p6Z4+56HZ2V9+g2/sGXAxNV1ZuYOH/RHPO/cHkGnR/z2P72ClFrE64cauopW7r/0UTblaFEc8VTOHHlAUp3F8yP5wNfWD6D4q03orI2XqnvCTJCsYfpdLMtDiJ/umLqtz89hRTniDJtjF5SkrhEifVdyjuJ8sHFewsmImlQuHRbXNZJlOliG0uL3qggQSzKlPdL916Ea7+QJuLO5JImEv79idbi4z0zELW2EKwuQopY1KdduogMfL+4oEA0rU7WD3FEJUOJqlxDsfYc3Y3+czrTHda/eM35YlHOzyLZam3f+2HlKprvpuGKOPVcAY0SsSh7cRoE9c/wQSwqmcMlsI36IBZlGx1WtrMyrzvSf/jgNIVuf33pvUpnvfayfLWUxEmUUW29nXaWZUdkvWFwXuYxdc3X18XNgOnmcOSb8h5eC2dGtr38RH8Dzek1wIyZkfjjOMt7jCAXJfxG8vk+Sk20B6PkskofhvEGRNrERXNoIKMkd/N+IyNEET7Y5/H9UaXuZCKq2iEsqIf2pZjopN7hDSZUVRdcwijYDdJ3OkwmtsbHHFt2ANfV1DEbDQ1VAAAAAElFTkSuQmCC",The="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKaSURBVHgB7Zk/bNNAFMa/xOf8GajSDQRD2AhTs1DBRCsYYAF1RJUAMaIimLt0gIGhQgLBBhSJtdAusCBgoqIDYSrd2oGqIxFD0yZ23HuuIkW22/rdnRKn9W+JdY6t9z1/d+/ZB6SkHG8yUYONmXNlx3HeyrMj8FBC/1kQQjwqzqyuB0+EBPjBu04tIYF3U5ciqkER2eC/ZPDPEhg8UfJdESAkQAZ/E8llJDiQxWARcsagCQiRCug3Aj0if20a9qU7aG/+QXNpDu21ZbTrf6FLTwRkT533g987rqAw8RTe9n+0fsyh+e0FdOiJhTL5E+GxwhBy4w9QuPXKP1bFmAAKwiqPIjc2BVG5Evs6UbmK/PVpqKJtIQrcvnjbt0h3JhtvJuGu/Yx1D1GdgL25gtbSO3DREpAtnUHh3nv5ezp0LhMxdhBkJ6f20Z8brBigCAVfvL8YGbwKnSfJjgMKdDKvM/misM6OgouSgNz4FCvzXsz1vicCKPs06Ti06xuxJmhLFjgu7Ems4lNi59NjtGrz+9rO+7ehVJnZAqiSqkJthGn4FoopwDqpLpQD+wnEXXn8wlYcgnNAMTPR0LEFUKGJK4Im+2ETnlOxo2BbiFspD8MqX4AObAHuyheYRHdiswU4q+YEkP9178d/AtKvOp7thpo3XZRaiZ3PT6ALZb/59Tl0URJAvtURQQvB9utJmEC5nVZ9n6XM09JJ/ZEJtF4pyQJbs5djFyOn9gGNlzeMthTar5SUya3ZMb8VtmXRysoWotNukFUoWHd9Gc6veWNZ78bYZxWTqxOH9NNivzmCAjKoY4CI2qH5jYTieVgMjoX3yIS4m8inIGNybfEwOBwSMCx3AR1LVOUFC0gCe8n8TjENR2yzpqQcd3YBRU/rPUoeZ3EAAAAASUVORK5CYII=",Rhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADRSURBVHgB3ZXBCcIwFIb/FC/eCtaj4Axu4FEdQcEVdIO6QVcQ7Ajq0Q2cQfRoBU96S4yBtiE1UWyqpN8leXmP/0/ICwFch6ST8bY1JZREDPBRCnKAR8N4cFk+Iy9bZ15YXlwIdcE3mkaSAU/Ywy8aVETlBg1dIurvETQ7WTzZtMW4Gp4Ltcn9hNmu91JHewJZ/B2mWvfvIH9o64DBIvEoEdr/6yK1W0xdJOdV3L9krUFyO+JTTLXud9FPDa6wBv/VVAMGMgfJE19L840y0AVqwwMBYDUlmAgqYAAAAABJRU5ErkJggg==",khe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADWSURBVHgB7ZYxCsIwFIb/VzxAQd0cPIFHcFcvICi4uTl4g3oDwc1NsOAF1N0jeAIHNxU8QWJaaGujbVVMKCTflOT18fGgfwhgGhQtBvvqiBjNOeBCCXSCwzy/c1sFOyc+546nThoKmhCDRbsnsSiox30Va8aKtVHJK45bC7Qb/dTZcFeP1+vuJbP3cN5geZxk1nMnlqXfUNRrfy5tJHf1tsahAb93DZ02xyne5fTTHMvfytg4lUMc3Le/UtRrc2yW+A7liLe1LOagKSgp/F0pBuNgMxjLA7JlNTWPgZgTAAAAAElFTkSuQmCC",Ihe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEXSURBVHgB7ZixrgFBFIb/mXuLm1vd5K5HUOo9A9EorYQ3QEF01BR4AxKUGkHrHZQegUKl3DEKsrOsM4pdJOdLJpk5czLnnzmTM8kAzIchgobCymlJD1UF/CFCdOCDEmI4yexqfvuXf+AunZ5QaOruD6LnHCOdcn/FZnpcX4zScFEoI2b0SVX8YxmYjzRNIRgxJd4MFkTxdoK+bZzyyYZu9Rt7cZm49seZ3cM1ZtuObl1QWJ3QPTHPct6UDXyHKFgQhfHauwtH4QVMsvurDk4ZhVVhDCt6zxTGoH8YnDIKFkRhJcjmlabX6Fj5cWGkYEEUQUEHxI8R0xCkb9YAMaM8MYKpwaQ4/+9DilIcnw3wMBjn9m0wn8wJS2o8dIGwrBAAAAAASUVORK5CYII=",Mhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFZSURBVHgB7ZgtTwNBEIbfvWwRFVABCbIGBAr+BR+G1FIBCgumBiQOgceAKEkVKYIPyT8AhcFUkoC4mpouXfYM2T0KmcCE27bzuN2dyz3ZudvZDCBMKCo/sX07X+1bc6Ysli1QwT9jFdpTSu+fr710/PlANJM0A/NQhGCOtJToFV828VeNNScRSGZUsqz6E4GotdhELLhPzx8miJcgszGLBogoNyMjqqmBq9Vd1BYbKOvpL2v1m7lg3Fx/BYXm0wHuOqekWPKO1peOhkr+hdpCgxxbaOrLpRlyrPxM3IgoN8E1b+t61iIiLjbePv0k9dyMXwn9qSz+toQOe/Y7JPXciCg3ZNGe6aJIyKKXz8fgpNfvuovzITleSig3IsrNyIqmiJRAVCk8IhLc8XPlj8P+qNI7iGBX3ZmUDhK9588Foi3X4X13nV63s20UQCbo3n1vnEMr1xoXJpYPq/pXd/q9L+kAAAAASUVORK5CYII=",Dhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFESURBVHgB7dk/bsIwFAbwz5FbqRsDlbpU6hHa3qBj26V7O7Q3oCdpbwADSIwwACOcADgCggWJDJlgwGCcETv8CQg9R3m/jReI3ic/IkcGGMs3kVT87tw9LLUqC41HDRRATAs0roX8rbxOR/Y1J0DcvFqrgQ+NW6KrQD7ZIQL7W0qrPw+bjxXiqbCLTgCt8QFfmZG2SwGyxZmMrAVwcABqHICaREr/L30Ub+53Xv9q3259rr7NcKxwMUGp+4w0Uq/AvubPdcq9+T9AjQNQ4wDUnBeaz1ZRw2O193CrZx4havnbCx3a25yzF0r6/SE8QtQ4ADUOQC11gHA+xqWccm/eC1HjANQ4ALWkABEyxAkgBIbwlHm+N+2ae0Ym5A88XAXz8I/WgSzZdSdA3ZwCrsxpoFmJBjwQN2566SnTUz3hmJWxvNsA5h5Re3YMRlUAAAAASUVORK5CYII=",Phe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACPSURBVHgB7ZVNCoAgEEbH8QIdoYMJLQV33aBu0Epw2c06QgdQLANDqEU/06LygeA48D0X4gC8HRY3xpjKWtsxxgq4x8A5b6SUfSgwnjrnGoLwQDlndbHAtAF0FHuCR8iCvwuEEMs6Wp8WULB+FVprD4QopZbs/IqygFDgvR+BjmEjQMQ6bVwlXHSejC18hglC+iWVen37xwAAAABJRU5ErkJggg==",Nhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC8SURBVHgB7ZY9CsMgFICfpmsgR+iW4+QIHQW33iC9QSbBsUfwOG45QsFVsXmCJVAJVGqgjR8I7wf8fIMowNEgMZBSXqy1EyGkgzLMTdOMjLE7JjRWnXNjQSlyXhxTTOi6AeXpUuJdqeIqruLfF5+2mm3bwjAMIVZKgTEmq55ic+K+78NmuDDOrX8s1lqHU+PCOLee4vUsCiE87ADnPDjrdariKv4jsff+AeWZ38SU0uu68W1wsOXffoPD8gQQEVUrCMAXEwAAAABJRU5ErkJggg==",Ohe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD+SURBVHgB7ZhBDkNAFIZ/0rCS9BgOYOUy7ZpF9QRtT9BaYNsexooDOEYTKxZ0NKkwiYwEU5L3bcbzJnmfJ5J5AGJjKPyNKIouVVV5iqLssSB1Xb9ZjafjOGcMCYVheGeLB4kwsZvrutdfrHLJIyTDunTqxiqXXPQ1DdCrqWJlkJAIEhJBQiJISMRuzCbTNGHbNsqyRJqmyLJscm6IUR2yLAu6rsMwjG+BOXKThDRNa6+bp50jN0kojmPkeY6iKJAkySy5IfjzUI0/wA5prQd99iJISAQJiSAhEesWasZbyKdXk++QD8mw4fTVi/kNQRA82HKQ8bOBLX53ric2yQejwnMtKEIIqwAAAABJRU5ErkJggg==",Bhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE7SURBVHgB7ZjBCoJAEEDHJfAaePOUPyAF3vyJfqGjnupLuumxX6g/6OLJQ4E/4MmTh65etFmJ2DXIoqEWmgeLuzPCPmZF2AFg/hRrGEjTdIaPXdu2c8uypvBlhBD7rus2URSValwTlZIoePqF4IALOixUWaFmMbk1QFIiHXZqQBPFai7BEPD45+pagLloJ2uyqAaLUsOi1LAoNSxKDYtSM3nnZd/3IQiCfl4UBeR5Tpp/xssV9TwPwjAE27b7ITd0XZcsTybqOM5DTN3o0/wYL4tWVfUQq+uaLD/GW6Lym2qaph9ZlkFZlmT5MbQ7U5IkHRhEHMd3P/6PUsOi1LAoNSxKDYtSo4liY+oChqKJYhP1DIaA7c+Duh4e/cqEqt4c1mpME5UdXqzqAqd7+AFSECt5lA7D1jjzt1wBWrmTQE3GHEwAAAAASUVORK5CYII=",Lhe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAENSURBVHgB7dktDoNAEAXgYWmC7RHqUOBQHKaSBNcbtDdAkSB7GBwKh+MItSQQylYQYBHlJ5klvE/RmRXzyJAmQARwbsa0kCTJva7ryDCMK+mlNE3zGQTBe1gU01NN0zw1HF66dbNF06KYO0j6Um6soINDAG4IwA0BuCEANwTghgDcDh/gQit5nkeO4/yui6KgNE137f9rVQDf98l13f63vK6qirIs26W/xKoVsm1bqQ0H2tpf4pwPcZ7nSk3u8V79JVY9A3JXLcvqV0EONNzfrf0llNcqcRy3pLEwDEcz44+MGwJwQwBuCMANAbghADcE4KYEaNv2Q/oqpwUlgBDiMXeQm7yx3dfTFwHAyBeK8W/f4tA1jQAAAABJRU5ErkJggg==",Uhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%232D8DBF'/%3e%3cmask%20id='path-2-inside-1_2778_34643'%20fill='white'%3e%3cpath%20d='M6%208C6%207.44772%206.44772%207%207%207H17C17.5523%207%2018%207.44772%2018%208C18%208.55228%2017.5523%209%2017%209H7C6.44772%209%206%208.55228%206%208Z'/%3e%3c/mask%3e%3cpath%20d='M17%209V7H7V9V11H17V9ZM7%207V9H17V7V5H7V7ZM17%207V9C16.4477%209%2016%208.55228%2016%208H18H20C20%206.34315%2018.6569%205%2017%205V7ZM7%209V7C7.55229%207%208%207.44772%208%208H6H4C4%209.65685%205.34314%2011%207%2011V9ZM17%209V11C18.6569%2011%2020%209.65685%2020%208H18H16C16%207.44772%2016.4477%207%2017%207V9ZM6%208H8C8%208.55228%207.55228%209%207%209V7V5C5.34315%205%204%206.34315%204%208H6Z'%20fill='white'%20mask='url(%23path-2-inside-1_2778_34643)'/%3e%3cmask%20id='path-4-inside-2_2778_34643'%20fill='white'%3e%3cpath%20d='M6%2016C6%2015.4477%206.44772%2015%207%2015H13C13.5523%2015%2014%2015.4477%2014%2016C14%2016.5523%2013.5523%2017%2013%2017H7C6.44772%2017%206%2016.5523%206%2016Z'/%3e%3c/mask%3e%3cpath%20d='M13%2017V15H7V17V19H13V17ZM7%2015V17H13V15V13H7V15ZM13%2015V17C12.4477%2017%2012%2016.5523%2012%2016H14H16C16%2014.3431%2014.6569%2013%2013%2013V15ZM7%2017V15C7.55228%2015%208%2015.4477%208%2016H6H4C4%2017.6569%205.34315%2019%207%2019V17ZM13%2017V19C14.6569%2019%2016%2017.6569%2016%2016H14H12C12%2015.4477%2012.4477%2015%2013%2015V17ZM6%2016H8C8%2016.5523%207.55228%2017%207%2017V15V13C5.34315%2013%204%2014.3431%204%2016H6Z'%20fill='white'%20mask='url(%23path-4-inside-2_2778_34643)'/%3e%3cmask%20id='path-6-inside-3_2778_34643'%20fill='white'%3e%3cpath%20d='M6%2012C6%2011.4477%206.44772%2011%207%2011H17C17.5523%2011%2018%2011.4477%2018%2012C18%2012.5523%2017.5523%2013%2017%2013H7C6.44772%2013%206%2012.5523%206%2012Z'/%3e%3c/mask%3e%3cpath%20d='M17%2013V11H7V13V15H17V13ZM7%2011V13H17V11V9H7V11ZM17%2011V13C16.4477%2013%2016%2012.5523%2016%2012H18H20C20%2010.3431%2018.6569%209%2017%209V11ZM7%2013V11C7.55229%2011%208%2011.4477%208%2012H6H4C4%2013.6569%205.34314%2015%207%2015V13ZM17%2013V15C18.6569%2015%2020%2013.6569%2020%2012H18H16C16%2011.4477%2016.4477%2011%2017%2011V13ZM6%2012H8C8%2012.5523%207.55228%2013%207%2013V11V9C5.34315%209%204%2010.3431%204%2012H6Z'%20fill='white'%20mask='url(%23path-6-inside-3_2778_34643)'/%3e%3c/svg%3e",Vhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23F36653'/%3e%3cpath%20d='M13%208C13%207.44772%2013.4477%207%2014%207H17C17.5523%207%2018%207.44772%2018%208C18%208.55228%2017.5523%209%2017%209H14C13.4477%209%2013%208.55228%2013%208Z'%20fill='white'/%3e%3cpath%20d='M6%2016C6%2015.4477%206.44772%2015%207%2015H17C17.5523%2015%2018%2015.4477%2018%2016C18%2016.5523%2017.5523%2017%2017%2017H7C6.44772%2017%206%2016.5523%206%2016Z'%20fill='white'/%3e%3cpath%20d='M13%2012C13%2011.4477%2013.4477%2011%2014%2011H17C17.5523%2011%2018%2011.4477%2018%2012C18%2012.5523%2017.5523%2013%2017%2013H14C13.4477%2013%2013%2012.5523%2013%2012Z'%20fill='white'/%3e%3cpath%20d='M6%2010C6%208.34315%207.34315%207%209%207C10.6569%207%2012%208.34315%2012%2010C12%2011.6569%2010.6569%2013%209%2013C7.34315%2013%206%2011.6569%206%2010Z'%20fill='white'/%3e%3c/svg%3e",Fhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23F37C24'/%3e%3cpath%20d='M17.6878%209.11453C17.8191%209.43169%2017.9183%209.76034%2017.9843%2010.0955C18.0918%2010.6411%2017.6311%2011.096%2017.0751%2011.096H13.9108C13.3547%2011.096%2012.904%2010.6453%2012.904%2010.0892V6.92491C12.904%206.36886%2013.3589%205.90822%2013.9045%206.01567C14.2397%206.08168%2014.5683%206.18086%2014.8855%206.31224C15.5137%206.57245%2016.0845%206.95386%2016.5653%207.43468C17.0461%207.91549%2017.4275%208.48631%2017.6878%209.11453Z'%20fill='white'/%3e%3cpath%20d='M8.30124%208.51672C8.87211%208.13527%209.51023%207.87306%2010.1774%207.74166C10.723%207.63421%2011.1779%208.09485%2011.1779%208.6509L11.178%2011.8152C11.178%2012.3713%2011.6287%2012.822%2012.1848%2012.822L15.3491%2012.822C15.9051%2012.822%2016.3658%2013.277%2016.2583%2013.8225C16.1269%2014.4898%2015.8647%2015.1279%2015.4833%2015.6988C14.9143%2016.5503%2014.1056%2017.2139%2013.1595%2017.6058C12.2133%2017.9978%2011.1722%2018.1003%2010.1678%2017.9005C9.16336%2017.7007%208.24074%2017.2076%207.51659%2016.4834C6.79244%2015.7593%206.29929%2014.8366%206.0995%2013.8322C5.8997%2012.8278%206.00224%2011.7867%206.39415%2010.8405C6.78606%209.89437%207.44973%209.08568%208.30124%208.51672Z'%20fill='white'/%3e%3c/svg%3e",Hhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%235BB514'/%3e%3cpath%20d='M9%2014V16H7V14H9ZM17%2014V16H13V14H17ZM17%208V10H13V8H17ZM9%208V10H7V8H9Z'%20fill='white'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",zhe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23969696'/%3e%3cpath%20d='M7%2012C7%2011.4477%207.44772%2011%208%2011C8.55228%2011%209%2011.4477%209%2012C9%2012.5523%208.55228%2013%208%2013C7.44772%2013%207%2012.5523%207%2012Z'%20fill='white'/%3e%3cpath%20d='M11%2012C11%2011.4477%2011.4477%2011%2012%2011C12.5523%2011%2013%2011.4477%2013%2012C13%2012.5523%2012.5523%2013%2012%2013C11.4477%2013%2011%2012.5523%2011%2012Z'%20fill='white'/%3e%3cpath%20d='M15%2012C15%2011.4477%2015.4477%2011%2016%2011C16.5523%2011%2017%2011.4477%2017%2012C17%2012.5523%2016.5523%2013%2016%2013C15.4477%2013%2015%2012.5523%2015%2012Z'%20fill='white'/%3e%3c/svg%3e",d8=2.5,Qhe=/\/([^/@]+?)(?:@([\d.]+)x)?\.(png|svg)(?:\?url)?$/,Ghe=t=>{const e=t.match(Qhe);if(!e)return null;const[,n,i,r]=e;return{name:n,scale:r==="svg"?d8:i?Number(i):1}},h8=t=>{const e={};for(const[n,i]of Object.entries(t)){const r=Ghe(n);r&&(e[r.name]||(e[r.name]=[]),e[r.name].push({scale:r.scale,src:i}))}for(const n of Object.values(e))n.sort((i,r)=>i.scale-r.scale);return e},$he=Object.assign({"../assets/light/arrow.bottom.png":dse,"../assets/light/arrow.bottom@1.25x.png":hse,"../assets/light/arrow.bottom@1.5x.png":fse,"../assets/light/arrow.bottom@1.75x.png":pse,"../assets/light/arrow.bottom@2x.png":gse,"../assets/light/arrow.right.png":mse,"../assets/light/arrow.right@1.25x.png":Ase,"../assets/light/arrow.right@1.5x.png":yse,"../assets/light/arrow.right@1.75x.png":vse,"../assets/light/arrow.right@2x.png":bse,"../assets/light/arrow.top.png":wse,"../assets/light/arrow.top@1.25x.png":Sse,"../assets/light/arrow.top@1.5x.png":Cse,"../assets/light/arrow.top@1.75x.png":xse,"../assets/light/arrow.top@2x.png":Ese,"../assets/light/attachment.png":_se,"../assets/light/attachment@1.25x.png":Tse,"../assets/light/attachment@1.5x.png":Rse,"../assets/light/attachment@1.75x.png":kse,"../assets/light/attachment@2x.png":Ise,"../assets/light/attention.png":Mse,"../assets/light/attention@1.25x.png":Dse,"../assets/light/attention@1.5x.png":Pse,"../assets/light/attention@1.75x.png":Nse,"../assets/light/attention@2x.png":Ose,"../assets/light/btn-close.png":Bse,"../assets/light/btn-close.small.png":Lse,"../assets/light/btn-close.small@1.25x.png":Use,"../assets/light/btn-close.small@1.5x.png":Vse,"../assets/light/btn-close.small@1.75x.png":Fse,"../assets/light/btn-close.small@2x.png":Hse,"../assets/light/btn-close@1.25x.png":zse,"../assets/light/btn-close@1.5x.png":Qse,"../assets/light/btn-close@1.75x.png":Gse,"../assets/light/btn-close@2x.png":$se,"../assets/light/btn-copy.png":Wse,"../assets/light/btn-copy@1.25x.png":jse,"../assets/light/btn-copy@1.5x.png":Kse,"../assets/light/btn-copy@1.75x.png":Yse,"../assets/light/btn-copy@2x.png":qse,"../assets/light/btn-download.png":Jse,"../assets/light/btn-download@1.25x.png":Xse,"../assets/light/btn-download@1.5x.png":Zse,"../assets/light/btn-download@1.75x.png":eoe,"../assets/light/btn-download@2x.png":toe,"../assets/light/btn-edit.png":noe,"../assets/light/btn-edit@1.25x.png":ioe,"../assets/light/btn-edit@1.5x.png":roe,"../assets/light/btn-edit@1.75x.png":soe,"../assets/light/btn-edit@2x.png":ooe,"../assets/light/btn-extended-thinking.png":aoe,"../assets/light/btn-extended-thinking@1.25.png":loe,"../assets/light/btn-extended-thinking@1.5.png":coe,"../assets/light/btn-extended-thinking@1.75.png":uoe,"../assets/light/btn-extended-thinking@2.png":doe,"../assets/light/btn-external.png":hoe,"../assets/light/btn-external@1.25x.png":foe,"../assets/light/btn-external@1.5x.png":poe,"../assets/light/btn-external@1.75x.png":goe,"../assets/light/btn-external@2x.png":moe,"../assets/light/btn-list-search.png":Aoe,"../assets/light/btn-list-search@1.25x.png":yoe,"../assets/light/btn-list-search@1.5x.png":voe,"../assets/light/btn-list-search@1.75x.png":boe,"../assets/light/btn-list-search@2x.png":woe,"../assets/light/btn-menu-about.png":Soe,"../assets/light/btn-menu-about@1.25x.png":Coe,"../assets/light/btn-menu-about@1.5x.png":xoe,"../assets/light/btn-menu-about@1.75x.png":Eoe,"../assets/light/btn-menu-about@2x.png":_oe,"../assets/light/btn-menu-navigation.png":Toe,"../assets/light/btn-menu-navigation@1.25x.png":Roe,"../assets/light/btn-menu-navigation@1.5x.png":koe,"../assets/light/btn-menu-navigation@1.75x.png":Ioe,"../assets/light/btn-menu-navigation@2x.png":Moe,"../assets/light/btn-menu-search.png":Doe,"../assets/light/btn-menu-search@1.25x.png":Poe,"../assets/light/btn-menu-search@1.5x.png":Noe,"../assets/light/btn-menu-search@1.75x.png":Ooe,"../assets/light/btn-menu-search@2x.png":Boe,"../assets/light/btn-previtem.png":Loe,"../assets/light/btn-previtem@1.25x.png":Uoe,"../assets/light/btn-previtem@1.5x.png":Voe,"../assets/light/btn-previtem@1.75x.png":Foe,"../assets/light/btn-previtem@2x.png":Hoe,"../assets/light/btn-remove.png":zoe,"../assets/light/btn-remove@1.25x.png":Qoe,"../assets/light/btn-remove@1.5x.png":Goe,"../assets/light/btn-remove@1.75x.png":$oe,"../assets/light/btn-remove@2x.png":Woe,"../assets/light/btn-rename.png":joe,"../assets/light/btn-rename@1.25x.png":Koe,"../assets/light/btn-rename@1.5x.png":Yoe,"../assets/light/btn-rename@1.75x.png":qoe,"../assets/light/btn-rename@2x.png":Joe,"../assets/light/btn-reset.png":Xoe,"../assets/light/btn-reset@1.25x.png":Zoe,"../assets/light/btn-reset@1.5x.png":eae,"../assets/light/btn-reset@1.75x.png":tae,"../assets/light/btn-reset@2x.png":nae,"../assets/light/btn-save.png":iae,"../assets/light/btn-save@1.25x.png":rae,"../assets/light/btn-save@1.5x.png":sae,"../assets/light/btn-save@1.75x.png":oae,"../assets/light/btn-save@2x.png":aae,"../assets/light/btn-settings.png":lae,"../assets/light/btn-settings@1.25x.png":cae,"../assets/light/btn-settings@1.5x.png":uae,"../assets/light/btn-settings@1.75x.png":dae,"../assets/light/btn-settings@2x.png":hae,"../assets/light/btn-web-search.png":fae,"../assets/light/btn-web-search@1.25x.png":pae,"../assets/light/btn-web-search@1.5x.png":gae,"../assets/light/btn-web-search@1.75x.png":mae,"../assets/light/btn-web-search@2x.png":Aae,"../assets/light/btn-zoomup.png":yae,"../assets/light/btn-zoomup@1.25x.png":vae,"../assets/light/btn-zoomup@1.5x.png":bae,"../assets/light/btn-zoomup@1.75x.png":wae,"../assets/light/btn-zoomup@2x.png":Sae,"../assets/light/checked.png":Cae,"../assets/light/checked@1.25x.png":xae,"../assets/light/checked@1.5x.png":Eae,"../assets/light/checked@1.75x.png":_ae,"../assets/light/checked@2x.png":Tae,"../assets/light/clear.search.png":Rae,"../assets/light/clear.search@1.25x.png":kae,"../assets/light/clear.search@1.5x.png":Iae,"../assets/light/clear.search@1.75x.png":Mae,"../assets/light/clear.search@2x.png":Dae,"../assets/light/code.png":Pae,"../assets/light/code@1.25x.png":Nae,"../assets/light/code@1.5x.png":Oae,"../assets/light/code@1.75x.png":Bae,"../assets/light/code@2x.png":Lae,"../assets/light/more.png":Uae,"../assets/light/more@1.25x.png":Vae,"../assets/light/more@1.5x.png":Fae,"../assets/light/more@1.75x.png":Hae,"../assets/light/more@2x.png":zae,"../assets/light/onlyoffice.png":Qae,"../assets/light/onlyoffice@1.25x.png":Gae,"../assets/light/onlyoffice@1.5x.png":$ae,"../assets/light/onlyoffice@1.75x.png":Wae,"../assets/light/onlyoffice@2x.png":jae,"../assets/light/search.png":Kae,"../assets/light/search@1.25x.png":Yae,"../assets/light/search@1.5x.png":qae,"../assets/light/search@1.75x.png":Jae,"../assets/light/search@2x.png":Xae,"../assets/light/show-chat.png":Zae,"../assets/light/show-chat@1.25x.png":ele,"../assets/light/show-chat@1.5x.png":tle,"../assets/light/show-chat@1.75x.png":nle,"../assets/light/show-chat@2x.png":ile,"../assets/light/status.error.png":rle,"../assets/light/status.error@1.25x.png":sle,"../assets/light/status.error@1.5x.png":ole,"../assets/light/status.error@1.75x.png":ale,"../assets/light/status.error@2x.png":lle,"../assets/light/stop.png":cle,"../assets/light/stop@1.25x.png":ule,"../assets/light/stop@1.5x.png":dle,"../assets/light/stop@1.75x.png":hle,"../assets/light/stop@2x.png":fle,"../assets/light/tool.called.png":ple,"../assets/light/tool.called@1.25x.png":gle,"../assets/light/tool.called@1.5x.png":mle,"../assets/light/tool.called@1.75x.png":Ale,"../assets/light/tool.called@2x.png":yle,"../assets/light/tools.png":vle,"../assets/light/tools@1.25x.png":ble,"../assets/light/tools@1.5x.png":wle,"../assets/light/tools@1.75x.png":Sle,"../assets/light/tools@2x.png":Cle}),Whe=Object.assign({"../assets/dark/arrow.bottom.png":xle,"../assets/dark/arrow.bottom@1.25x.png":Ele,"../assets/dark/arrow.bottom@1.5x.png":_le,"../assets/dark/arrow.bottom@1.75x.png":Tle,"../assets/dark/arrow.bottom@2x.png":Rle,"../assets/dark/arrow.right.png":kle,"../assets/dark/arrow.right@1.25x.png":Ile,"../assets/dark/arrow.right@1.5x.png":Mle,"../assets/dark/arrow.right@1.75x.png":Dle,"../assets/dark/arrow.right@2x.png":Ple,"../assets/dark/arrow.top.png":Nle,"../assets/dark/arrow.top@1.25x.png":Ole,"../assets/dark/arrow.top@1.5x.png":Ble,"../assets/dark/arrow.top@1.75x.png":Lle,"../assets/dark/arrow.top@2x.png":Ule,"../assets/dark/attachment.png":Vle,"../assets/dark/attachment@1.25x.png":Fle,"../assets/dark/attachment@1.5x.png":Hle,"../assets/dark/attachment@1.75x.png":zle,"../assets/dark/attachment@2x.png":Qle,"../assets/dark/attention.png":Gle,"../assets/dark/attention@1.25x.png":$le,"../assets/dark/attention@1.5x.png":Wle,"../assets/dark/attention@1.75x.png":jle,"../assets/dark/attention@2x.png":Kle,"../assets/dark/btn-close.png":Yle,"../assets/dark/btn-close.small.png":qle,"../assets/dark/btn-close.small@1.25x.png":Jle,"../assets/dark/btn-close.small@1.5x.png":Xle,"../assets/dark/btn-close.small@1.75x.png":Zle,"../assets/dark/btn-close.small@2x.png":ece,"../assets/dark/btn-close@1.25x.png":tce,"../assets/dark/btn-close@1.5x.png":nce,"../assets/dark/btn-close@1.75x.png":ice,"../assets/dark/btn-close@2x.png":rce,"../assets/dark/btn-copy.png":sce,"../assets/dark/btn-copy@1.25x.png":oce,"../assets/dark/btn-copy@1.5x.png":ace,"../assets/dark/btn-copy@1.75x.png":lce,"../assets/dark/btn-copy@2x.png":cce,"../assets/dark/btn-download.png":uce,"../assets/dark/btn-download@1.25x.png":dce,"../assets/dark/btn-download@1.5x.png":hce,"../assets/dark/btn-download@1.75x.png":fce,"../assets/dark/btn-download@2x.png":pce,"../assets/dark/btn-edit.png":gce,"../assets/dark/btn-edit@1.25x.png":mce,"../assets/dark/btn-edit@1.5x.png":Ace,"../assets/dark/btn-edit@1.75x.png":yce,"../assets/dark/btn-edit@2x.png":vce,"../assets/dark/btn-external.png":bce,"../assets/dark/btn-external@1.25x.png":wce,"../assets/dark/btn-external@1.5x.png":Sce,"../assets/dark/btn-external@1.75x.png":Cce,"../assets/dark/btn-external@2x.png":xce,"../assets/dark/btn-list-search.png":Ece,"../assets/dark/btn-list-search@1.25x.png":_ce,"../assets/dark/btn-list-search@1.5x.png":Tce,"../assets/dark/btn-list-search@1.75x.png":Rce,"../assets/dark/btn-list-search@2x.png":kce,"../assets/dark/btn-menu-about.png":Ice,"../assets/dark/btn-menu-about@1.25x.png":Mce,"../assets/dark/btn-menu-about@1.5x.png":Dce,"../assets/dark/btn-menu-about@1.75x.png":Pce,"../assets/dark/btn-menu-about@2x.png":Nce,"../assets/dark/btn-menu-navigation.png":Oce,"../assets/dark/btn-menu-navigation@1.25x.png":Bce,"../assets/dark/btn-menu-navigation@1.5x.png":Lce,"../assets/dark/btn-menu-navigation@1.75x.png":Uce,"../assets/dark/btn-menu-navigation@2x.png":Vce,"../assets/dark/btn-menu-search.png":Fce,"../assets/dark/btn-menu-search@1.25x.png":Hce,"../assets/dark/btn-menu-search@1.5x.png":zce,"../assets/dark/btn-menu-search@1.75x.png":Qce,"../assets/dark/btn-menu-search@2x.png":Gce,"../assets/dark/btn-previtem.png":$ce,"../assets/dark/btn-previtem@1.25x.png":Wce,"../assets/dark/btn-previtem@1.5x.png":jce,"../assets/dark/btn-previtem@1.75x.png":Kce,"../assets/dark/btn-previtem@2x.png":Yce,"../assets/dark/btn-remove.png":qce,"../assets/dark/btn-remove@1.25x.png":Jce,"../assets/dark/btn-remove@1.5x.png":Xce,"../assets/dark/btn-remove@1.75x.png":Zce,"../assets/dark/btn-remove@2x.png":eue,"../assets/dark/btn-rename.png":tue,"../assets/dark/btn-rename@1.25x.png":nue,"../assets/dark/btn-rename@1.5x.png":iue,"../assets/dark/btn-rename@1.75x.png":rue,"../assets/dark/btn-rename@2x.png":sue,"../assets/dark/btn-reset.png":oue,"../assets/dark/btn-reset@1.25x.png":aue,"../assets/dark/btn-reset@1.5x.png":lue,"../assets/dark/btn-reset@1.75x.png":cue,"../assets/dark/btn-reset@2x.png":uue,"../assets/dark/btn-save.png":due,"../assets/dark/btn-save@1.25x.png":hue,"../assets/dark/btn-save@1.5x.png":fue,"../assets/dark/btn-save@1.75x.png":pue,"../assets/dark/btn-save@2x.png":gue,"../assets/dark/btn-settings.png":mue,"../assets/dark/btn-settings@1.25x.png":Aue,"../assets/dark/btn-settings@1.5x.png":yue,"../assets/dark/btn-settings@1.75x.png":vue,"../assets/dark/btn-settings@2x.png":bue,"../assets/dark/btn-web-search.png":wue,"../assets/dark/btn-web-search@1.25x.png":Sue,"../assets/dark/btn-web-search@1.5x.png":Cue,"../assets/dark/btn-web-search@1.75x.png":xue,"../assets/dark/btn-web-search@2x.png":Eue,"../assets/dark/btn-zoomup.png":_ue,"../assets/dark/btn-zoomup@1.25x.png":Tue,"../assets/dark/btn-zoomup@1.5x.png":Rue,"../assets/dark/btn-zoomup@1.75x.png":kue,"../assets/dark/btn-zoomup@2x.png":Iue,"../assets/dark/checked.png":Mue,"../assets/dark/checked@1.25x.png":Due,"../assets/dark/checked@1.5x.png":Pue,"../assets/dark/checked@1.75x.png":Nue,"../assets/dark/checked@2x.png":Oue,"../assets/dark/clear.search.png":Bue,"../assets/dark/clear.search@1.25x.png":Lue,"../assets/dark/clear.search@1.5x.png":Uue,"../assets/dark/clear.search@1.75x.png":Vue,"../assets/dark/clear.search@2x.png":Fue,"../assets/dark/code.png":Hue,"../assets/dark/code@1.25x.png":zue,"../assets/dark/code@1.5x.png":Que,"../assets/dark/code@1.75x.png":Gue,"../assets/dark/code@2x.png":$ue,"../assets/dark/more.png":Wue,"../assets/dark/more@1.25x.png":jue,"../assets/dark/more@1.5x.png":Kue,"../assets/dark/more@1.75x.png":Yue,"../assets/dark/more@2x.png":que,"../assets/dark/onlyoffice.png":Jue,"../assets/dark/onlyoffice@1.25x.png":Xue,"../assets/dark/onlyoffice@1.5x.png":Zue,"../assets/dark/onlyoffice@1.75x.png":ede,"../assets/dark/onlyoffice@2x.png":tde,"../assets/dark/search.png":nde,"../assets/dark/search@1.25x.png":ide,"../assets/dark/search@1.5x.png":rde,"../assets/dark/search@1.75x.png":sde,"../assets/dark/search@2x.png":ode,"../assets/dark/show-chat.png":ade,"../assets/dark/show-chat@1.25x.png":lde,"../assets/dark/show-chat@1.5x.png":cde,"../assets/dark/show-chat@1.75x.png":ude,"../assets/dark/show-chat@2x.png":dde,"../assets/dark/status.error.png":hde,"../assets/dark/status.error@1.25x.png":fde,"../assets/dark/status.error@1.5x.png":pde,"../assets/dark/status.error@1.75x.png":gde,"../assets/dark/status.error@2x.png":mde,"../assets/dark/stop.png":Ade,"../assets/dark/stop@1.25x.png":yde,"../assets/dark/stop@1.5x.png":vde,"../assets/dark/stop@1.75x.png":bde,"../assets/dark/stop@2x.png":wde,"../assets/dark/tool.called.png":Sde,"../assets/dark/tool.called@1.25x.png":Cde,"../assets/dark/tool.called@1.5x.png":xde,"../assets/dark/tool.called@1.75x.png":Ede,"../assets/dark/tool.called@2x.png":_de,"../assets/dark/tools.png":Tde,"../assets/dark/tools@1.25x.png":Rde,"../assets/dark/tools@1.5x.png":kde,"../assets/dark/tools@1.75x.png":Ide,"../assets/dark/tools@2x.png":Mde}),f8=Object.assign({"../assets/arrow.bottom.svg":Dde,"../assets/arrow.right.svg":Pde,"../assets/arrow.top.svg":Nde,"../assets/attachment.svg":Ode,"../assets/attention.svg":Bde,"../assets/btn-close.small.svg":Lde,"../assets/btn-close.svg":Ude,"../assets/btn-copy.svg":Vde,"../assets/btn-download.svg":Fde,"../assets/btn-edit.svg":Hde,"../assets/btn-extended-thinking.svg":zde,"../assets/btn-external.svg":Qde,"../assets/btn-list-search.svg":Gde,"../assets/btn-menu-about.svg":$de,"../assets/btn-menu-navigation.svg":Wde,"../assets/btn-menu-search.svg":jde,"../assets/btn-previtem.svg":Kde,"../assets/btn-remove.svg":Yde,"../assets/btn-rename.svg":qde,"../assets/btn-reset.svg":Jde,"../assets/btn-save.svg":Xde,"../assets/btn-settings.svg":Zde,"../assets/btn-web-search.svg":ehe,"../assets/btn-zoomup.svg":the,"../assets/checked.svg":nhe,"../assets/clear.search.svg":ihe,"../assets/code.svg":rhe,"../assets/more.svg":she,"../assets/onlyoffice.svg":ohe,"../assets/search.svg":ahe,"../assets/show-chat.svg":lhe,"../assets/status.error.svg":che,"../assets/stop.svg":uhe,"../assets/tool.called.svg":dhe,"../assets/tools.svg":hhe}),p8=Object.assign({"../assets/formats/documents.png":fhe,"../assets/formats/documents@1.25x.png":phe,"../assets/formats/documents@1.5x.png":ghe,"../assets/formats/documents@1.75.png":mhe,"../assets/formats/documents@2.png":Ahe,"../assets/formats/pdf.png":yhe,"../assets/formats/pdf@1.25x.png":vhe,"../assets/formats/pdf@1.5x.png":bhe,"../assets/formats/pdf@1.75x.png":whe,"../assets/formats/pdf@2x.png":She,"../assets/formats/presentations.png":Che,"../assets/formats/presentations@1.25x.png":xhe,"../assets/formats/presentations@1.5x.png":Ehe,"../assets/formats/presentations@1.75x.png":_he,"../assets/formats/presentations@2x.png":The,"../assets/formats/spreadsheets.png":Rhe,"../assets/formats/spreadsheets@1.25x.png":khe,"../assets/formats/spreadsheets@1.5x.png":Ihe,"../assets/formats/spreadsheets@1.75x.png":Mhe,"../assets/formats/spreadsheets@2x.png":Dhe,"../assets/formats/unknown-format.png":Phe,"../assets/formats/unknown-format@1.25x.png":Nhe,"../assets/formats/unknown-format@1.5x.png":Ohe,"../assets/formats/unknown-format@1.75x.png":Bhe,"../assets/formats/unknown-format@2x.png":Lhe}),g8=Object.assign({"../assets/formats/documents.svg":Uhe,"../assets/formats/pdf.svg":Vhe,"../assets/formats/presentations.svg":Fhe,"../assets/formats/spreadsheets.svg":Hhe,"../assets/formats/unknown-format.svg":zhe}),jhe=h8({...$he,...f8,...p8,...g8}),Khe=h8({...Whe,...f8,...p8,...g8}),Yhe=(t,e,n)=>{const r=(e==="dark"?Khe:jhe)[t];if(!r||r.length===0)return null;const s=r.find(o=>o.scale>=n)||r[r.length-1];return{src:s.src,isSvg:s.scale===d8}},wn=({name:t,size:e,width:n,height:i,isStroke:r,color:s,noColor:o,className:a,isTransform:l})=>{const u=n??e,d=i??e,{themeType:f,scale:g}=l8(),m=Yhe(t,f,g);if(!m)return null;const v=S=>{if(o)return;const C=s||"var(--icon-button-color)";S.querySelectorAll("path").forEach(R=>{r?R.setAttribute("stroke",C):R.setAttribute("fill",C)}),S.querySelectorAll("circle").forEach(R=>{r?R.setAttribute("stroke",C):R.setAttribute("fill",C)})};return m.isSvg?_.jsx(QT,{src:m.src,className:`flex items-center justify-center ${l?"rotate-90":""} ${a||""}`,beforeInjection:v,style:{width:u,height:d}}):_.jsx("img",{src:m.src,alt:t,className:`${l?"rotate-90":""} ${a||""}`,style:{width:u,height:d}})};function m8(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e{const n=new Array(t.length+e.length);for(let i=0;i({classGroupId:t,validator:e}),A8=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),wv="-",MO=[],Xhe="arbitrary..",Zhe=t=>{const e=tfe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return efe(o);const a=o.split(wv),l=a[0]===""&&a.length>1?1:0;return y8(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],u=n[o];return l?u?qhe(u,l):l:u||MO}return n[o]||MO}}},y8=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const u=y8(t,e+1,s);if(u)return u}const o=n.validators;if(o===null)return;const a=e===0?t.join(wv):t.slice(e).join(wv),l=o.length;for(let u=0;ut.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?Xhe+i:void 0})(),tfe=t=>{const{theme:e,classGroups:n}=t;return nfe(n,e)},nfe=(t,e)=>{const n=A8();for(const i in t){const r=t[i];GT(r,n,i,e)}return n},GT=(t,e,n,i)=>{const r=t.length;for(let s=0;s{if(typeof t=="string"){rfe(t,e,n);return}if(typeof t=="function"){sfe(t,e,n,i);return}ofe(t,e,n,i)},rfe=(t,e,n)=>{const i=t===""?e:v8(e,t);i.classGroupId=n},sfe=(t,e,n,i)=>{if(afe(t)){GT(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(Jhe(n,t))},ofe=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o{let n=t;const i=e.split(wv),r=i.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,lfe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},Q1="!",DO=":",cfe=[],PO=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),ufe=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,a=0,l=0,u;const d=r.length;for(let S=0;Sl?u-l:void 0;return PO(s,m,g,v)};if(e){const r=e+DO,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):PO(cfe,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},dfe=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},hfe=t=>({cache:lfe(t.cacheSize),parseClassName:ufe(t),sortModifiers:dfe(t),...Zhe(t)}),ffe=/\s+/,pfe=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=t.trim().split(ffe);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:g,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:S}=n(d);if(f){l=d+(l.length>0?" "+l:l);continue}let C=!!S,E=i(C?v.substring(0,S):v);if(!E){if(!C){l=d+(l.length>0?" "+l:l);continue}if(E=i(v),!E){l=d+(l.length>0?" "+l:l);continue}C=!1}const k=g.length===0?"":g.length===1?g[0]:s(g).join(":"),R=m?k+Q1:k,M=R+E;if(o.indexOf(M)>-1)continue;o.push(M);const D=r(E,C);for(let P=0;P0?" "+l:l)}return l},gfe=(...t)=>{let e=0,n,i,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const u=e.reduce((d,f)=>f(d),t());return n=hfe(u),i=n.cache.get,r=n.cache.set,s=a,a(l)},a=l=>{const u=i(l);if(u)return u;const d=pfe(l,n);return r(l,d),d};return s=o,(...l)=>s(gfe(...l))},Afe=[],Mn=t=>{const e=n=>n[t]||Afe;return e.isThemeGetter=!0,e},w8=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,S8=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yfe=/^\d+\/\d+$/,vfe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bfe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wfe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sfe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Cfe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ju=t=>yfe.test(t),rt=t=>!!t&&!Number.isNaN(Number(t)),tl=t=>!!t&&Number.isInteger(Number(t)),Nx=t=>t.endsWith("%")&&rt(t.slice(0,-1)),Jo=t=>vfe.test(t),xfe=()=>!0,Efe=t=>bfe.test(t)&&!wfe.test(t),C8=()=>!1,_fe=t=>Sfe.test(t),Tfe=t=>Cfe.test(t),Rfe=t=>!Ne(t)&&!Oe(t),kfe=t=>hh(t,_8,C8),Ne=t=>w8.test(t),cc=t=>hh(t,T8,Efe),Ox=t=>hh(t,Nfe,rt),NO=t=>hh(t,x8,C8),Ife=t=>hh(t,E8,Tfe),i0=t=>hh(t,R8,_fe),Oe=t=>S8.test(t),Mf=t=>fh(t,T8),Mfe=t=>fh(t,Ofe),OO=t=>fh(t,x8),Dfe=t=>fh(t,_8),Pfe=t=>fh(t,E8),r0=t=>fh(t,R8,!0),hh=(t,e,n)=>{const i=w8.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},fh=(t,e,n=!1)=>{const i=S8.exec(t);return i?i[1]?e(i[1]):n:!1},x8=t=>t==="position"||t==="percentage",E8=t=>t==="image"||t==="url",_8=t=>t==="length"||t==="size"||t==="bg-size",T8=t=>t==="length",Nfe=t=>t==="number",Ofe=t=>t==="family-name",R8=t=>t==="shadow",Bfe=()=>{const t=Mn("color"),e=Mn("font"),n=Mn("text"),i=Mn("font-weight"),r=Mn("tracking"),s=Mn("leading"),o=Mn("breakpoint"),a=Mn("container"),l=Mn("spacing"),u=Mn("radius"),d=Mn("shadow"),f=Mn("inset-shadow"),g=Mn("text-shadow"),m=Mn("drop-shadow"),v=Mn("blur"),S=Mn("perspective"),C=Mn("aspect"),E=Mn("ease"),k=Mn("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),Oe,Ne],P=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],B=()=>[Oe,Ne,l],G=()=>[ju,"full","auto",...B()],V=()=>[tl,"none","subgrid",Oe,Ne],$=()=>["auto",{span:["full",tl,Oe,Ne]},tl,Oe,Ne],K=()=>[tl,"auto",Oe,Ne],X=()=>["auto","min","max","fr",Oe,Ne],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...B()],q=()=>[ju,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],j=()=>[t,Oe,Ne],oe=()=>[...M(),OO,NO,{position:[Oe,Ne]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",Dfe,kfe,{size:[Oe,Ne]}],te=()=>[Nx,Mf,cc],U=()=>["","none","full",u,Oe,Ne],pe=()=>["",rt,Mf,cc],xe=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[rt,Nx,OO,NO],tt=()=>["","none",v,Oe,Ne],it=()=>["none",rt,Oe,Ne],jt=()=>["none",rt,Oe,Ne],en=()=>[rt,Oe,Ne],oi=()=>[ju,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[xfe],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[Rfe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",rt],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ju,Ne,Oe,C]}],container:["container"],columns:[{columns:[rt,Ne,Oe,a]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[tl,"auto",Oe,Ne]}],basis:[{basis:[ju,"full","auto",a,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,ju,"auto","initial","none",Ne]}],grow:[{grow:["",rt,Oe,Ne]}],shrink:[{shrink:["",rt,Oe,Ne]}],order:[{order:[tl,"first","last","none",Oe,Ne]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Mf,cc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Oe,Ox]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nx,Ne]}],"font-family":[{font:[Mfe,Ne,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Oe,Ne]}],"line-clamp":[{"line-clamp":[rt,"none",Oe,Ox]}],leading:[{leading:[s,...B()]}],"list-image":[{"list-image":["none",Oe,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Oe,cc]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[rt,"auto",Oe,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tl,Oe,Ne],radial:["",Oe,Ne],conic:[tl,Oe,Ne]},Pfe,Ife]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Oe,Ne]}],"outline-w":[{outline:["",rt,Mf,cc]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,r0,i0]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",f,r0,i0]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[rt,cc]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",g,r0,i0]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[rt,Oe,Ne]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Oe,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Ne]}],filter:[{filter:["","none",Oe,Ne]}],blur:[{blur:tt()}],brightness:[{brightness:[rt,Oe,Ne]}],contrast:[{contrast:[rt,Oe,Ne]}],"drop-shadow":[{"drop-shadow":["","none",m,r0,i0]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",rt,Oe,Ne]}],"hue-rotate":[{"hue-rotate":[rt,Oe,Ne]}],invert:[{invert:["",rt,Oe,Ne]}],saturate:[{saturate:[rt,Oe,Ne]}],sepia:[{sepia:["",rt,Oe,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Ne]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Oe,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Oe,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Oe,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Oe,Ne]}],"backdrop-invert":[{"backdrop-invert":["",rt,Oe,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Oe,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Oe,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Oe,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Oe,Ne]}],ease:[{ease:["linear","initial",E,Oe,Ne]}],delay:[{delay:[rt,Oe,Ne]}],animate:[{animate:["none",k,Oe,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Oe,Ne]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:it()}],"rotate-x":[{"rotate-x":it()}],"rotate-y":[{"rotate-y":it()}],"rotate-z":[{"rotate-z":it()}],scale:[{scale:jt()}],"scale-x":[{"scale-x":jt()}],"scale-y":[{"scale-y":jt()}],"scale-z":[{"scale-z":jt()}],"scale-3d":["scale-3d"],skew:[{skew:en()}],"skew-x":[{"skew-x":en()}],"skew-y":[{"skew-y":en()}],transform:[{transform:[Oe,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oi()}],"translate-x":[{"translate-x":oi()}],"translate-y":[{"translate-y":oi()}],"translate-z":[{"translate-z":oi()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,Ne]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[rt,Mf,cc,Ox]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lfe=mfe(Bfe),_e=(...t)=>Lfe(bv(t)),k8=t=>{let e="";return t.forEach(n=>{Array.isArray(n.content)?n.content.forEach(i=>{if(typeof i=="string"){e+=n.role==="user"?`## ${i} +`)},LV=function(){var e=parseInt(document.body.getAttribute($y)||"0",10);return isFinite(e)?e:0},VSe=function(){x.useEffect(function(){return document.body.setAttribute($y,(LV()+1).toString()),function(){var e=LV()-1;e<=0?document.body.removeAttribute($y):document.body.setAttribute($y,e.toString())}},[])},HSe=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;VSe();var i=x.useMemo(function(){return USe(r)},[r]);return x.createElement(qSe,{styles:JSe(i,!t,r,n?"":"!important")})},x2=!1;if(typeof window<"u")try{var EO=Object.defineProperty({},"passive",{get:function(){return x2=!0,!0}});window.addEventListener("test",EO,EO),window.removeEventListener("test",EO,EO)}catch{x2=!1}var uy=x2?{passive:!1}:!1,GSe=function(e){return e.tagName==="TEXTAREA"},nte=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!GSe(e)&&n[t]==="visible")},zSe=function(e){return nte(e,"overflowY")},KSe=function(e){return nte(e,"overflowX")},FV=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=rte(e,o);if(r){var i=ote(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},QSe=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},$Se=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},rte=function(e,t){return e==="v"?zSe(t):KSe(t)},ote=function(e,t){return e==="v"?QSe(t):$Se(t)},WSe=function(e,t){return e==="h"&&t==="rtl"?-1:1},YSe=function(e,t,n,o,r){var i=WSe(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,c=t.contains(a),p=!1,u=s>0,l=0,d=0;do{if(!a)break;var f=ote(e,a),h=f[0],m=f[1],g=f[2],y=m-g-i*h;(h||y)&&rte(e,a)&&(l+=y,d+=h);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(p=!0),p},MO=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xV=function(e){return[e.deltaX,e.deltaY]},BV=function(e){return e&&"current"in e?e.current:e},XSe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZSe=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},e0e=0,cy=[];function t0e(e){var t=x.useRef([]),n=x.useRef([0,0]),o=x.useRef(),r=x.useState(e0e++)[0],i=x.useState(tte)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=dR([e.lockRef.current],(e.shards||[]).map(BV),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=x.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=MO(m),_=n.current,S="deltaX"in m?m.deltaX:_[0]-y[0],w="deltaY"in m?m.deltaY:_[1]-y[1],R,E=m.target,T=Math.abs(S)>Math.abs(w)?"h":"v";if("touches"in m&&T==="h"&&E.type==="range")return!1;var D=window.getSelection(),B=D&&D.anchorNode,N=B?B===E||B.contains(E):!1;if(N)return!1;var L=FV(T,E);if(!L)return!0;if(L?R=T:(R=T==="v"?"h":"v",L=FV(T,E)),!L)return!1;if(!o.current&&"changedTouches"in m&&(S||w)&&(o.current=R),!R)return!0;var q=o.current||R;return YSe(q,g,m,q==="h"?S:w)},[]),c=x.useCallback(function(m){var g=m;if(!(!cy.length||cy[cy.length-1]!==i)){var y="deltaY"in g?xV(g):MO(g),_=t.current.filter(function(R){return R.name===g.type&&(R.target===g.target||g.target===R.shadowParent)&&XSe(R.delta,y)})[0];if(_&&_.should){g.cancelable&&g.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(BV).filter(Boolean).filter(function(R){return R.contains(g.target)}),w=S.length>0?a(g,S[0]):!s.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),p=x.useCallback(function(m,g,y,_){var S={name:m,delta:g,target:y,should:_,shadowParent:n0e(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(w){return w!==S})},1)},[]),u=x.useCallback(function(m){n.current=MO(m),o.current=void 0},[]),l=x.useCallback(function(m){p(m.type,xV(m),m.target,a(m,e.lockRef.current))},[]),d=x.useCallback(function(m){p(m.type,MO(m),m.target,a(m,e.lockRef.current))},[]);x.useEffect(function(){return cy.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,uy),document.addEventListener("touchmove",c,uy),document.addEventListener("touchstart",u,uy),function(){cy=cy.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,uy),document.removeEventListener("touchmove",c,uy),document.removeEventListener("touchstart",u,uy)}},[]);var f=e.removeScrollBar,h=e.inert;return x.createElement(x.Fragment,null,h?x.createElement(i,{styles:ZSe(r)}):null,f?x.createElement(HSe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function n0e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r0e=ISe(ete,t0e);var UF=x.forwardRef(function(e,t){return x.createElement(BM,_l({},e,{ref:t,sideCar:r0e}))});UF.classNames=BM.classNames;const TC=e=>{const t=x.useRef(void 0);return x.useCallback(o=>{t.current&&t.current(),o&&(t.current=e(o))},[e])},ite=(e,t)=>{const n=x.useCallback(o=>{if(!e)return;const r=e(),i=()=>{const a=t?t(o):o.offsetHeight;r.setHeight(a)},s=new ResizeObserver(i);return s.observe(o),i(),()=>{s.disconnect(),r.unregister()}},[e,t]);return TC(n)},kV=x.createContext(!1),UV=(e,t)=>{const n=e.match(/^([\d.]+)(em|px|rem)$/);if(!n)return 0;const o=parseFloat(n[1]),r=n[2];if(r==="px")return o;if(r==="em"){const i=parseFloat(getComputedStyle(t).fontSize)||16;return o*i}if(r==="rem"){const i=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return o*i}return 0},ste=({children:e,fillClampThreshold:t="10em",fillClampOffset:n="6em"})=>{const o=en(({message:c})=>c.isLast&&c.index>=2),r=EF({optional:!0}),i=x.useContext(kV),s=x.useCallback(c=>{if(!r||i)return;const p=()=>{const u=r.getState();if(u.turnAnchor==="top"&&o){const{viewport:l,inset:d,userMessage:f}=u.height,h=UV(t,c),m=UV(n,c),g=f<=h?f:m,y=Math.max(0,l-d-g);c.style.minHeight=`${y}px`,c.style.flexShrink="0",c.style.transition="min-height 0s"}else c.style.minHeight="",c.style.flexShrink="",c.style.transition=""};return p(),r.subscribe(p)},[r,o,i,t,n]),a=TC(s);return F.jsx(kV.Provider,{value:!0,children:F.jsx(MF,{ref:a,children:e})})};ste.displayName="ThreadPrimitive.ViewportSlack";const o0e=()=>{const e=pi(),t=en(()=>e.message()),n=x.useCallback(o=>{const r=()=>{t.setIsHovering(!0)},i=()=>{t.setIsHovering(!1)};return o.addEventListener("mouseenter",r),o.addEventListener("mouseleave",i),o.matches(":hover")&&queueMicrotask(()=>t.setIsHovering(!0)),()=>{o.removeEventListener("mouseenter",r),o.removeEventListener("mouseleave",i),t.setIsHovering(!1)}},[t]);return TC(n)},i0e=()=>{const e=$R(r=>r.turnAnchor),t=$R(r=>r.registerUserMessageHeight),n=en(({thread:r,message:i})=>e==="top"&&i.role==="user"&&i.index===r.messages.length-2&&r.messages.at(-1)?.role==="assistant"),o=x.useCallback(r=>r.offsetHeight,[]);return ite(n?t:null,o)},qF=x.forwardRef((e,t)=>{const n=o0e(),o=i0e(),r=Cn(t,n,o);return F.jsx(ste,{children:F.jsx(kl.div,{...e,ref:r})})});qF.displayName="MessagePrimitive.Root";const ate=()=>en(({part:t})=>{if(t.type!=="text"&&t.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return t}),lte=x.forwardRef(({smooth:e=!0,component:t="span",...n},o)=>{const{text:r,status:i}=dee(ate(),e);return F.jsx(t,{"data-status":i.type,...n,ref:o,children:r})});lte.displayName="MessagePartPrimitive.Text";const s0e=()=>en(({part:t})=>{if(t.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return t}),ute=x.forwardRef((e,t)=>{const{image:n}=s0e();return F.jsx(kl.img,{src:n,...e,ref:t})});ute.displayName="MessagePartPrimitive.Image";const cte=({children:e})=>en(({part:n})=>n.status.type==="running")?e:null;cte.displayName="MessagePartPrimitive.InProgress";const qV=e=>Symbol.iterator in e,JV=e=>"entries"in e,VV=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),o=t instanceof Map?t:new Map(t.entries());if(n.size!==o.size)return!1;for(const[r,i]of n)if(!o.has(r)||!Object.is(i,o.get(r)))return!1;return!0},a0e=(e,t)=>{const n=e[Symbol.iterator](),o=t[Symbol.iterator]();let r=n.next(),i=o.next();for(;!r.done&&!i.done;){if(!Object.is(r.value,i.value))return!1;r=n.next(),i=o.next()}return!!r.done&&!!i.done};function l0e(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:qV(e)&&qV(t)?JV(e)&&JV(t)?VV(e,t):a0e(e,t):VV({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function u0e(e){const t=Re.useRef(void 0);return n=>{const o=e(n);return l0e(t.current,o)?t.current:t.current=o}}const HV=e=>{let t=-1;return{startGroup:n=>{t===-1&&(t=n)},endGroup:(n,o)=>{t!==-1&&(o.push({type:e,startIndex:t,endIndex:n}),t=-1)},finalize:(n,o)=>{t!==-1&&o.push({type:e,startIndex:t,endIndex:n})}}},c0e=e=>{const t=[],n=HV("toolGroup"),o=HV("reasoningGroup");for(let r=0;r{const e=en(u0e(t=>t.message.parts.map(n=>n.type)));return x.useMemo(()=>e.length===0?[]:c0e(e),[e])},f0e=({Fallback:e,...t})=>{const n=en(({tools:o})=>{const r=o.tools[t.toolName]??e;return Array.isArray(r)?r[0]??e:r});return n?F.jsx(n,{...t}):null},ep={Text:()=>F.jsxs("p",{style:{whiteSpace:"pre-line"},children:[F.jsx(lte,{}),F.jsx(cte,{children:F.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>F.jsx(ute,{}),File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},h0e=({components:{Text:e=ep.Text,Reasoning:t=ep.Reasoning,Image:n=ep.Image,Source:o=ep.Source,File:r=ep.File,Unstable_Audio:i=ep.Unstable_Audio,tools:s={}}={}})=>{const a=pi(),c=en(({part:u})=>u),p=c.type;if(p==="tool-call"){const u=a.part().addToolResult,l=a.part().resumeToolCall;if("Override"in s)return F.jsx(s.Override,{...c,addResult:u,resume:l});const d=s.by_name?.[c.toolName]??s.Fallback;return F.jsx(f0e,{...c,Fallback:d,addResult:u,resume:l})}if(c.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(p){case"text":return F.jsx(e,{...c});case"reasoning":return F.jsx(t,{...c});case"source":return F.jsx(o,{...c});case"image":return F.jsx(n,{...c});case"file":return F.jsx(r,{...c});case"audio":return F.jsx(i,{...c});case"data":return null;default:const u=p;throw new Error(`Unknown message part type: ${u}`)}},pR=x.memo(({index:e,components:t})=>F.jsx(wAe,{index:e,children:F.jsx(h0e,{components:t})}),(e,t)=>e.index===t.index&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.ToolGroup===t.components?.ToolGroup&&e.components?.ReasoningGroup===t.components?.ReasoningGroup);pR.displayName="MessagePrimitive.PartByIndex";const p0e=({status:e,component:t})=>F.jsx(TAe,{text:"",isRunning:e.type==="running",children:F.jsx(t,{type:"text",text:"",status:e})}),m0e=Object.freeze({type:"complete"}),g0e=({components:e})=>{const t=en(n=>n.message.status??m0e);return e?.Empty?F.jsx(e.Empty,{status:t}):F.jsx(p0e,{status:t,component:e?.Text??ep.Text})},b0e=x.memo(g0e,(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),JF=({components:e})=>{const t=en(({message:r})=>r.parts.length),n=d0e(),o=x.useMemo(()=>t===0?F.jsx(b0e,{components:e}):n.map(r=>{if(r.type==="single")return F.jsx(pR,{index:r.index,components:e},r.index);if(r.type==="toolGroup"){const i=e?.ToolGroup??ep.ToolGroup;return F.jsx(i,{startIndex:r.startIndex,endIndex:r.endIndex,children:Array.from({length:r.endIndex-r.startIndex+1},(s,a)=>F.jsx(pR,{index:r.startIndex+a,components:e},a))},`tool-${r.startIndex}`)}else{const i=e?.ReasoningGroup??ep.ReasoningGroup;return F.jsx(i,{startIndex:r.startIndex,endIndex:r.endIndex,children:Array.from({length:r.endIndex-r.startIndex+1},(s,a)=>F.jsx(pR,{index:r.startIndex+a,components:e},a))},`reasoning-${r.startIndex}`)}}),[n,e,t]);return F.jsx(F.Fragment,{children:o})};JF.displayName="MessagePrimitive.Parts";const y0e=e=>en(({message:t})=>{const{role:n,attachments:o,parts:r,branchCount:i,isLast:s,speech:a,isCopied:c,isHovering:p}=t;return!(e.hasBranches===!0&&i<2||e.user&&n!=="user"||e.assistant&&n!=="assistant"||e.system&&n!=="system"||e.lastOrHover===!0&&!p&&!s||e.last!==void 0&&e.last!==s||e.copied===!0&&!c||e.copied===!1&&c||e.speaking===!0&&a==null||e.speaking===!1&&a!=null||e.hasAttachments===!0&&(n!=="user"||!o?.length)||e.hasAttachments===!1&&n==="user"&&o?.length||e.hasContent===!0&&r.length===0||e.hasContent===!1&&r.length>0||e.submittedFeedback!==void 0&&(t.metadata.submittedFeedback?.type??null)!==e.submittedFeedback)}),B2=({children:e,...t})=>y0e(t)?e:null;B2.displayName="MessagePrimitive.If";const dte=({children:e})=>en(({message:n})=>n.status?.type==="incomplete"&&n.status.reason==="error")?e:null;dte.displayName="MessagePrimitive.Error";const fte=()=>{const e=pi(),t=en(o=>o.thread.isRunning||!o.composer.isEditing||o.composer.isEmpty),n=x.useCallback(()=>{e.composer().send()},[e]);return t?null:n},A0e=gee("ComposerPrimitive.Send",fte),hte=x.forwardRef(({onSubmit:e,...t},n)=>{const o=fte(),r=i=>{i.preventDefault(),o&&o()};return F.jsx(kl.form,{...t,ref:n,onSubmit:lt(e,r)})});hte.displayName="ComposerPrimitive.Root";function U0(){return U0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Co(e),n=$R(o=>o.onScrollToBottom);x.useEffect(()=>n(t),[n,t])},gte=x.forwardRef(({autoFocus:e=!1,asChild:t,disabled:n,onChange:o,onKeyDown:r,onPaste:i,submitOnEnter:s=!0,cancelOnEscape:a=!0,unstable_focusOnRunStart:c=!0,unstable_focusOnScrollToBottom:p=!0,unstable_focusOnThreadSwitched:u=!0,addAttachmentOnPaste:l=!0,...d},f)=>{const h=pi(),m=en(({composer:D})=>D.isEditing?D.text:""),g=t?MF:L0e,y=en(({thread:D})=>D.isDisabled)||n,_=x.useRef(null),S=Cn(f,_);bee(D=>{if(!a||!_.current?.contains(D.target))return;const B=h.composer();B.getState().canCancel&&(B.cancel(),D.preventDefault())});const w=D=>{y||!s||D.nativeEvent.isComposing||D.key==="Enter"&&D.shiftKey===!1&&(h.thread().getState().isRunning||(D.preventDefault(),_.current?.closest("form")?.requestSubmit()))},R=async D=>{if(!l)return;const B=h.thread().getState().capabilities,N=Array.from(D.clipboardData?.files||[]);if(B.attachments&&N.length>0)try{D.preventDefault(),await Promise.all(N.map(L=>h.composer().addAttachment(L)))}catch(L){console.error("Error adding attachment:",L)}},E=e&&!y,T=x.useCallback(()=>{const D=_.current;!D||!E||(D.focus({preventScroll:!0}),D.setSelectionRange(D.value.length,D.value.length))},[E]);return x.useEffect(()=>T(),[T]),mte(()=>{h.composer().getState().type==="thread"&&p&&T()}),x.useEffect(()=>{if(!(h.composer().getState().type!=="thread"||!c))return h.on("thread.run-start",T)},[c,T,h]),x.useEffect(()=>{if(!(h.composer().getState().type!=="thread"||!u))return h.on("thread-list-item.switched-to",T)},[u,T,h]),F.jsx(g,{name:"input",value:m,...d,ref:S,disabled:y,onChange:lt(o,D=>{h.composer().getState().isEditing&&j2(()=>{h.composer().setText(D.target.value)})}),onKeyDown:lt(r,w),onPaste:lt(i,R)})});gte.displayName="ComposerPrimitive.Input";const F0e=()=>{const e=pi(),t=en(({composer:o})=>!o.canCancel),n=x.useCallback(()=>{e.composer().cancel()},[e]);return t?null:n},x0e=gee("ComposerPrimitive.Cancel",F0e),bte=x.forwardRef((e,t)=>F.jsx(kl.div,{role:"alert",...e,ref:t}));bte.displayName="ErrorPrimitive.Root";const yte=x.forwardRef(({children:e,...t},n)=>{const o=en(({message:r})=>r.status?.type==="incomplete"&&r.status.reason==="error"?r.status.error:void 0);return o===void 0?null:F.jsx(kl.span,{...t,ref:n,children:e??String(o)})});yte.displayName="ErrorPrimitive.Message";const Ate=x.forwardRef((e,t)=>F.jsx(kl.div,{...e,ref:t}));Ate.displayName="ThreadPrimitive.Root";const _te=({children:e})=>en(({thread:n})=>n.messages.length===0&&!n.isLoading)?e:null;_te.displayName="ThreadPrimitive.Empty";const B0e=e=>en(({thread:t})=>!(e.empty===!0&&!t.isEmpty||e.empty===!1&&t.isEmpty||e.running===!0&&!t.isRunning||e.running===!1&&t.isRunning||e.disabled===!0&&!t.isDisabled||e.disabled===!1&&t.isDisabled)),tE=({children:e,...t})=>B0e(t)?e:null;tE.displayName="ThreadPrimitive.If";const k0e=e=>{const t=Co(e),n=x.useCallback(o=>{const r=new ResizeObserver(()=>{t()}),i=new MutationObserver(()=>{t()});return r.observe(o),i.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{r.disconnect(),i.disconnect()}},[t]);return TC(n)},U0e=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:o=!0})=>{const r=x.useRef(null),i=EF();e===void 0&&(e=i.getState().turnAnchor!=="top");const s=x.useRef(0),a=x.useRef(null),c=x.useCallback(f=>{const h=r.current;h&&(a.current=f,h.scrollTo({top:h.scrollHeight,behavior:f}))},[]),p=()=>{const f=r.current;if(!f)return;const h=i.getState().isAtBottom,m=Math.abs(f.scrollHeight-f.scrollTop-f.clientHeight)<1||f.scrollHeight<=f.clientHeight;!m&&s.current{const f=a.current;f?c(f):e&&i.getState().isAtBottom&&c("instant"),p()}),l=TC(f=>(f.addEventListener("scroll",p),()=>{f.removeEventListener("scroll",p)}));return mte(({behavior:f})=>{c(f)}),uD("thread.run-start",()=>{t&&(a.current="auto",requestAnimationFrame(()=>{c("auto")}))}),uD("thread.initialize",()=>{n&&(a.current="instant",requestAnimationFrame(()=>{c("instant")}))}),uD("thread-list-item.switched-to",()=>{o&&(a.current="instant",requestAnimationFrame(()=>{c("instant")}))}),Cn(u,l,r)},q0e=()=>{const e=$R(n=>n.registerViewport),t=x.useCallback(n=>n.clientHeight,[]);return ite(e,t)},vte=x.forwardRef(({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:o,children:r,...i},s)=>{const a=U0e({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:o}),c=q0e(),p=Cn(s,a,c);return F.jsx(kl.div,{...i,ref:p,children:r})});vte.displayName="ThreadPrimitive.ViewportScrollable";const k2=x.forwardRef(({turnAnchor:e,...t},n)=>F.jsx(aee,{options:{turnAnchor:e},children:F.jsx(vte,{...t,ref:n})}));k2.displayName="ThreadPrimitive.Viewport";const Ste=(e,t)=>e.Message===t.Message&&e.EditComposer===t.EditComposer&&e.UserEditComposer===t.UserEditComposer&&e.AssistantEditComposer===t.AssistantEditComposer&&e.SystemEditComposer===t.SystemEditComposer&&e.UserMessage===t.UserMessage&&e.AssistantMessage===t.AssistantMessage&&e.SystemMessage===t.SystemMessage,J0e=()=>null,V0e=(e,t,n)=>{switch(t){case"user":return n?e.UserEditComposer??e.EditComposer??e.UserMessage??e.Message:e.UserMessage??e.Message;case"assistant":return n?e.AssistantEditComposer??e.EditComposer??e.AssistantMessage??e.Message:e.AssistantMessage??e.Message;case"system":return n?e.SystemEditComposer??e.EditComposer??e.SystemMessage??e.Message:e.SystemMessage??J0e;default:const o=t;throw new Error(`Unknown message role: ${o}`)}},H0e=({components:e})=>{const t=en(({message:r})=>r.role),n=en(({message:r})=>r.composer.isEditing),o=V0e(e,t,n);return F.jsx(o,{})},Cte=x.memo(({index:e,components:t})=>F.jsx(CAe,{index:e,children:F.jsx(H0e,{components:t})}),(e,t)=>e.index===t.index&&Ste(e.components,t.components));Cte.displayName="ThreadPrimitive.MessageByIndex";const wte=({components:e})=>{const t=en(({thread:o})=>o.messages.length);return x.useMemo(()=>t===0?null:Array.from({length:t},(o,r)=>F.jsx(Cte,{index:r,components:e},r)),[t,e])};wte.displayName="ThreadPrimitive.Messages";const G0e=x.memo(wte,(e,t)=>Ste(e.components,t.components)),z0e=(e,t,n,o)=>{const r=[n,{code:t,...o||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Bg(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...r):console?.warn&&console.warn(...r)},WV={},U2=(e,t,n,o)=>{Bg(n)&&WV[n]||(Bg(n)&&(WV[n]=new Date),z0e(e,t,n,o))},Ote=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},q2=(e,t,n)=>{e.loadNamespaces(t,Ote(e,n))},YV=(e,t,n,o)=>{if(Bg(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return q2(e,n,o);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Ote(e,o))},K0e=(e,t,n={})=>!t.languages||!t.languages.length?(U2(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(o,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!r(o.isLanguageChangingTo,e))return!1}}),Bg=e=>typeof e=="string",Q0e=e=>typeof e=="object"&&e!==null,$0e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,W0e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Y0e=e=>W0e[e],X0e=e=>e.replace($0e,Y0e);let J2={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:X0e};const Z0e=(e={})=>{J2={...J2,...e}},eCe=()=>J2;let Tte;const tCe=e=>{Tte=e},nCe=()=>Tte,rCe={type:"3rdParty",init(e){Z0e(e.options.react),tCe(e)}},oCe=x.createContext();class iCe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const sCe=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=e},[e,t]),n.current},Rte=(e,t,n,o)=>e.getFixedT(t,n,o),aCe=(e,t,n,o)=>x.useCallback(Rte(e,t,n,o),[e,t,n,o]),Wt=(e,t={})=>{const{i18n:n}=t,{i18n:o,defaultNS:r}=x.useContext(oCe)||{},i=n||o||nCe();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new iCe),!i){U2(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const w=(E,T)=>Bg(T)?T:Q0e(T)&&Bg(T.defaultValue)?T.defaultValue:Array.isArray(E)?E[E.length-1]:E,R=[w,{},!1];return R.t=w,R.i18n={},R.ready=!1,R}i.options.react?.wait&&U2(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...eCe(),...i.options.react,...t},{useSuspense:a,keyPrefix:c}=s;let p=r||i.options?.defaultNS;p=Bg(p)?[p]:p||["translation"],i.reportNamespaces.addUsedNamespaces?.(p);const u=(i.isInitialized||i.initializedStoreOnce)&&p.every(w=>K0e(w,i,s)),l=aCe(i,t.lng||null,s.nsMode==="fallback"?p:p[0],c),d=()=>l,f=()=>Rte(i,t.lng||null,s.nsMode==="fallback"?p:p[0],c),[h,m]=x.useState(d);let g=p.join();t.lng&&(g=`${t.lng}${g}`);const y=sCe(g),_=x.useRef(!0);x.useEffect(()=>{const{bindI18n:w,bindI18nStore:R}=s;_.current=!0,!u&&!a&&(t.lng?YV(i,t.lng,p,()=>{_.current&&m(f)}):q2(i,p,()=>{_.current&&m(f)})),u&&y&&y!==g&&_.current&&m(f);const E=()=>{_.current&&m(f)};return w&&i?.on(w,E),R&&i?.store.on(R,E),()=>{_.current=!1,i&&w&&w?.split(" ").forEach(T=>i.off(T,E)),R&&i&&R.split(" ").forEach(T=>i.store.off(T,E))}},[i,g]),x.useEffect(()=>{_.current&&u&&m(d)},[i,c,u]);const S=[h,i,u];if(S.t=h,S.i18n=i,S.ready=u,u||!u&&!a)return S;throw new Promise(w=>{t.lng?YV(i,t.lng,p,()=>w()):q2(i,p,()=>w())})},lCe=["ar-SA"],wn=()=>{const{i18n:e}=Wt(),t=lCe.includes(e.language);return{isRTL:t,direction:t?"rtl":"ltr"}},RC=Bl(e=>({currentPage:"chat",setCurrentPage:t=>e({currentPage:t}),goToChat:()=>e({currentPage:"chat"}),goToSettings:()=>e({currentPage:"settings"})})),uCe=["theme-dark","theme-night","theme-contrast-dark"],XV=e=>uCe.some(t=>e.includes(t.replace("theme-","")))?"dark":"light",cCe=()=>{if(typeof window>"u"||!window.RendererProcessVariable)return"theme-light";const{theme:e}=window.RendererProcessVariable;return e.id==="theme-system"?e.system==="dark"?"theme-night":"theme-white":e.id},dCe=()=>typeof window>"u"?1:window.devicePixelRatio||1,Ete=Bl(e=>{const t=cCe();return{themeId:t,themeType:XV(t),scale:dCe(),setThemeId:n=>e({themeId:n,themeType:XV(n)}),setScale:n=>e({scale:n})}});function V2(e,t){return V2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},V2(e,t)}function fCe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V2(e,t)}var PO={};var ZV;function hCe(){if(ZV)return PO;ZV=1;var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,o=/\\([\u000b\u0020-\u00ff])/g,r=/([\\"])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;PO.format=s,PO.parse=a;function s(l){if(!l||typeof l!="object")throw new TypeError("argument obj is required");var d=l.parameters,f=l.type;if(!f||!i.test(f))throw new TypeError("invalid type");var h=f;if(d&&typeof d=="object")for(var m,g=Object.keys(d).sort(),y=0;y0&&!t.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(r,"\\$1")+'"'}function u(l){this.parameters=Object.create(null),this.type=l}return PO}var pCe=hCe(),Ty=new Map,Mte=function(t){return t.cloneNode(!0)},e5=function(){return window.location.protocol==="file:"},Pte=function(t,n,o){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&r.readyState===2){var i=r.getResponseHeader("Content-Type");if(!i)throw new Error("Content type not found");var s=pCe.parse(i).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(r.readyState===4){if(r.status===404||r.responseXML===null)throw new Error(e5()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(r.status===200||e5()&&r.status===0)o(null,r);else throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText)}}catch(a){if(r.abort(),a instanceof Error)o(a,r);else throw a}},r.open("GET",t),r.withCredentials=n,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},am={},t5=function(t,n){am[t]=am[t]||[],am[t].push(n)},mCe=function(t){for(var n=function(s,a){setTimeout(function(){if(Array.isArray(am[t])){var c=Ty.get(t),p=am[t][s];c instanceof SVGSVGElement&&p(null,Mte(c)),c instanceof Error&&p(c),s===am[t].length-1&&delete am[t]}},0)},o=0,r=am[t].length;o0&&(n==="always"||n==="once"&&!n5[c])){for(var J=0,V=N.length;J desc");D&&T.removeChild(D);var B=document.createElement("desc");B.innerHTML=s,T.prepend(B)}if(l){var N=T.querySelector(":scope > title");N&&T.removeChild(N);var L=document.createElement("title");L.innerHTML=l,T.prepend(L)}try{h(T)}catch(q){S(q)}};vCe(_,{afterEach:w,beforeEach:R,cacheRequests:d,evalScripts:a,httpRequestWithCredentials:c,renumerateIRIElements:p})}},n.removeSVG=function(){var r;(r=this.nonReactWrapper)!=null&&r.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(r){var i=this;TCe(U0({},r),this.props)&&this.setState(function(){return i.initialState},function(){i.removeSVG(),i.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var r=this.props;r.afterInjection,r.beforeInjection,r.desc,r.evalScripts;var i=r.fallback;r.httpRequestWithCredentials;var s=r.loading;r.renumerateIRIElements,r.src,r.title,r.useRequestCache;var a=r.wrapper,c=pte(r,RCe),p=a;return x.createElement(p,U0({},c,{ref:this.refCallback},a==="svg"?{xmlns:IO,xmlnsXlink:a5}:{}),this.state.isLoading&&s&&x.createElement(s,null),this.state.hasError&&i&&x.createElement(i,null))},t})(x.Component);HF.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};HF.propTypes={afterInjection:ur.func,beforeInjection:ur.func,desc:ur.string,evalScripts:ur.oneOf(["always","once","never"]),fallback:ur.oneOfType([ur.func,ur.object,ur.string]),httpRequestWithCredentials:ur.bool,loading:ur.oneOfType([ur.func,ur.object,ur.string]),onError:ur.func,renumerateIRIElements:ur.bool,src:ur.string.isRequired,title:ur.string,useRequestCache:ur.bool,wrapper:ur.oneOf(["div","span","svg"])};const ECe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAAKUlEQVR42mMgE1jst1AAkgoW+2ECDRb3LRyAOAHIgQv9B3MRwEEAh3kAHWsJbGmU0Q4AAAAASUVORK5CYII=",MCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAM0lEQVR42mOgCnAQgNMwYGVg+d7KgIHBQsHiPpCGAYsEi/sWCebvLRJQDDA1AAo7UMUtABBwCm8iC97cAAAAAElFTkSuQmCC",PCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALUlEQVR42mMYBMDyvJUBhGVqYHkezIBxLe4DpcC0KZBGk7JIgAsjAEw1DdwJAAJ/DBgSmTFKAAAAAElFTkSuQmCC",ICe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAP0lEQVR42mMYpMBCwbLfQQCNB+cusPhveR4oAJayuG/x3ywALAETgEhDWBYLQKIY0ggpLNJwKUxpoM4FNPc9ADL6HrGxdRV1AAAAAElFTkSuQmCC",jCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQUlEQVR42mMYXsA83zIfg48i8N7iv0U9jGdRD+TdR1FgagBRApM2f29qAGRiU4ImjakEIY1DCR5psP0KpgZ0DkAALkcf8ZPthkMAAAAASUVORK5CYII=",DCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAKUlEQVR42mOgAbA8b2WAVcLUwOI+6VIWCRb3cegwNSAsjHCVqQFl/gIAhmEMHd9OVc4AAAAASUVORK5CYII=",NCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAANElEQVR42mMYHMBiv2UBPmkFi/sW9ZQocBCwPG8xH7/0AnyGN+CQNDWwuI/H7UBjE+gakgDDfRA4lFiJoQAAAABJRU5ErkJggg==",LCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAPElEQVR42mMYFsAiwXK9gwBBZZYTLM9bKBA2rcHiPhHKLAss7lsZEGUaASWmBhb3TQ0GWglCkanBIIhTADuuEmjfkVflAAAAAElFTkSuQmCC",FCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAT0lEQVR42mMYEcBCwaLBQoEopUCF/y3uQxQTNvU+0YodBCz2W/y3fG/hQJQzLCdY/AcqLyDazUCYQIzSeohSYhU2DITCBJhC4pQ2DP0ECgC2TioxvmzU5wAAAABJRU5ErkJggg==",xCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbElEQVR42mMYBeQACwWLBgsFEjQAlf+3uE+CFgsFy/MW/y3fWwaQYIvlBIv/QFhPqsP+m/eTYkuA+Xug086T4hsHsMMaiA/e+yTYYGoAcZCDAAnut1hArGPiQW63nECs8gSYV0nR0DCap1AAAJ5iLr4u66zzAAAAAElFTkSuQmCC",BCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAQAAACxtDVnAAAARElEQVR42r2LsQ0AIAzDckpO7Wec0lPMFLogseGtdqqAWSyscHQD0PimJ43OR9JoA8wlKhuAMyxhCksJigkJ4XdoWm82zgd3SwpxHbYAAAAASUVORK5CYII=",kCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAQAAACoAz4qAAAAW0lEQVR42t3LQQ3AMAwEQUMIBEMppEIpg0IJhEIwlKssa6XKyqPv7CvyXOybXFNTbtQwlIXGGunRWCC/GXR0Zc6goVkqF83iC4QZ6MznobsQrgFXglt7cCjsfy/4pJHeGBKbFQAAAABJRU5ErkJggg==",UCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAQAAAAOAB1aAAAAUklEQVR42u3LsQ2AUAhFUUZh/yUchVGOlSGYryY2Nt7ukUOckzabjLukAiUfUcNrVKAarlFCrwsUAeOyQgdbwDlhvjc7ULOGFbPJup99wErFu3ZCkbYJrFeQSQAAAABJRU5ErkJggg==",qCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAQAAABO1swWAAAAaUlEQVR42u3RuxGAMAwDUI2WERjBI7BBvCmjiAqZXHSXVFSoyMd+58ZwYWPDTthJkn0TCq+gwR567OGlU9jDZOoWthBg6iVs4ZtOmFFwpAOOogk4qn88cwOw1PThaeWnX9JDi1yHwXOu3itNGcbz+v9BAAAAAElFTkSuQmCC",JCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAQAAADR77dlAAAAcElEQVR42u3SsRGAIBBE0SvJEuwEO7MES6KEK2ENlAH/3MyRGehGwPyXYdG0atehxeamorYynYNkOUiWZ4R5TpjnhPmGEwlzM90zA4nzEYREdcyfAMSvB+85AUht1yrvOQAajID7wdeBt6+WjV/tlZ0UIJnOEshoEAAAAABJRU5ErkJggg==",VCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAiElEQVR42t3TMRHDMAyF4UIwBLPwe5sgFEIgCIIYpAwCxRAMwRBCoVOqpXd5XvNvvvt8WqTXs+ObO3dsEkblQG/eHB0T9ZZjIn6v4JB4hg4TuBX6NQOh8HExfhACT4QJW+EHjiXOYeXfh42u8kznSZa4FZ4Sz9qJKvCMjolAR7ciLzWi+bMP9wt1RUgCFJB7LwAAAABJRU5ErkJggg==",HCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAvklEQVR42u3UTRGDMBAF4EpAAhK4tHmvp0hAQhwUB10H4IA6iYRIiAQs9Nbtb2CncGNvyeSb3exscthj5fAVAgQCb6bu4iZECAcmZNQGiuszQEA+Nwspe6bXXGyRF1GMTL762I3w802KuD1Arfk5sJuhTByUIiuAQL4iPQx5X2nZp9ZMdV2k7EoU4Qc9Nm5CKNHCfZngS3Smz+WCt6Iaf1C2iHaqb2e0Ux3OCbWd6vxm9uytVMsV1/lq/4RXjjvhSVs0JHJtUgAAAABJRU5ErkJggg==",GCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA2UlEQVR42u3VwQ2DIBTG8Y7gCI7gxfK92xvBDeoGdQPYoN1AN3AERnAERmCFJk2aZ8tB5PVk/N/w8INggMvZkeMKPRwcWIdYBDO/IY+AvpChBRNXnzFqBNgyxqXfaMgEZHZhJDBFFSPBg4uZ9SbTk4ZSZsQkIzg4BSPRfO2yGBpSZh0C6gwG/QZjMW4wbWPiFmPush4Fg1sGgwBWMAK1jZ5JT7z/C0OLgpHokTImts3+qyN+z02dMDsCw//+TWF2rkjFSPCwWkbOm4czs+xNcdTBmYGr8yk+bi9tz2sbjq4v1AAAAABJRU5ErkJggg==",zCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABD0lEQVR42u3WQa2DQBCAYSRUwkrg0uw/PY0EHPQ5aB0UB8UBdYAEJCBhJSBhXsIJ2AP0TZPmJfzc5vCRZTMJxdHRV0N5SEeip5Wq8Ken2GGLJ6EukkDC4iiNVAQ03kkTfHWSMhAW03pi1UXqqVglDUZyknkkDP0AmX2C9i3yXMYR4zUn423+ChSLwx/I+YwHhhFmJzHSJ8ifxToY/U4S3SBn9y/NPvKKYdRbJCG7fRc5JU9MBje5nsaRsEnG23vkudwkebjJPOn2k5hUe5dSN8h8ut0/JNVN5tFi1C4yTwbsUrrJHEXXpNwLT9Jg0mVL4YsQR4wWvZTynJG+pJpYw7KDeyLwopdBGvT45Tv6Yr/CveyBr6s1PQAAAABJRU5ErkJggg==",KCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA/ElEQVR42u3XwQ2DMAyF4Y6QETIClyrPPXkERmCEbgAjdAO6QUfICIzACBnBFRWtBb0h+4LycyJCn7lA4FKr1Y7H4daAObjQ6DFD1mPGiGjIU5vKAqdCE3Iq65DOiEf/ATP4t8J4ftZ6O37Yr9N9WafWhdcRVDiY8xoyhO7mvIYOgmzIc+CwPYdQMeOvTSr7+4VALHmhx/8AQx7P7ZW3BpImc17DCMHox0fMELATz4EmvX8vfkY8Oa+l4sJr1IJdeO08PKIbr49/ernw+n5E9OPjAjnxuke58bqRe/D6yMl3BFh5wzBAliMViPKmoUNeRwwcHD/W6w9LrXa8N0sDBgGKvl9BAAAAAElFTkSuQmCC",QCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAv0lEQVR4AWPACkbB/4tC94H4PHUMuyScADTsPxQXUGbYeQkFsOsQBr7/f15BgALXCfXDDUPgBrJdBzMk0NsEiI3hhoLkyAm7+TADLCwswBjGB8rtpyQi/rs6mcEMRODLIg4kJhOE5kAfuJeR8X1iDctHj4iyDJ3/WXH6cD5yMiIhmSDw7BbV/7Nb1eB89GREMCJIwpdE+gklEwTGTDbY8XlRA0wDLwiuJ8tARDLCTCZkYkQyQniXcgNBZjAMCQAAySKxJKUJDoEAAAAASUVORK5CYII=",$Ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABC0lEQVR4AWOgGRgF/y8JB/y/KPT+/2WheppZArTgPhD/B+Pzoga0sKAeZDgcXxLeT10LzksogIIJagECXxZxoGZczAcbionPU9MX//HgAmrExXmYgVtmKP63sLD4v6JPGW4JOBjPKwhQEkwJyK5uKtQCWQKi0X3TQHGSheH+anWwJf1V6uiWvAcFKwVJFoFnt6iCLAHT6HJAX6+nKMmix8nBhXJgPrYkTXGSvblFEmzJ2dUycDH0DEpxkv18XOR/oLfJ/09AGpcaUGIhOslSgO/DkzThJIuJn+0TB0U6iCZkUQPRSZaU1IXAiAyKM8lS6hNE3Ij0o0W2gAAsyVITQ3xDOMIpTwCkglEAABosqY4+fsNPAAAAAElFTkSuQmCC",WCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAABE0lEQVR4AWMYVGAUjIL/5yUU/l8Uug/CIDb9LL4kPB9o6X8QBrL309O3/1HwZREH2lt8QXA9usWgIKd1ECfALcPEDTSzGOQzPBa//39eQYAWltbDLHm2T/x/oLcJEBv//3RcBGH5JZF+miaos6tl/ltYWIDxwYVytEpoiOwDwze3SMItvrlVCiqOyF5U8q2AAXp8fj4uArMYFtQYvqZZgnJ1MvvvAsQ4Etp9UEKjSfaJCzUEYypnL0R5jMvgsgwdINb9T+XshUhQuPDsFtX/s1vV/uNTAzKDrOxDGUYkNJLLY8owInuRn6AwMazkItbyBJKzD+UWI7IXwfKYRrgBn8X/aYjf47N4Au0sFp7AMKLAKAAADGVMb+YtB7MAAAAASUVORK5CYII=",YCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAMAAAApB0NrAAAAbFBMVEUAAAD/zyD/zxj/0xT/0hP/0RL/0RL/0RL/0RL/zxL/0hT/0hP/0BH/0hP/0RL/0RL/0RL/0RLzxxTyxxTmvhfmvRfZtBnNqxzBoR60mCG0lyCbhCWQeyiPeyeCcSp2aC1eVTFRTDRRSzQ4ODicBnJqAAAAEXRSTlMAECBAYG9wf4CAj5+vv8/f7/2ThQkAAACiSURBVHja5c+7EoJADEZhXFFQBPaAd8Vb3v8dHZYdCjPE2vFr0vxFTvIvMtbfJg6YJ7YCqO1JSi83NzU9PzMmCwLrbVcTOfPhTq5AaXVvRWRn9G+ARkRaoLK6n/IId2l03+Q+3Z8RdHIhyKe7T3Ik8E53M9jLgUGpu6Pm1RLo/gqt1N1aqrvjz2cA3Z/xuVH9zqPEftWtFeOGaeNmhaIe+jFvQxsaDFC9uPoAAAAASUVORK5CYII=",XCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAgVBMVEUAAAD/zyD/zxj/zxX/0xT/zxT/0hP/0hP/0RL/0RL/zxL/0RL/0RL/0hT/0hL/0hP/0hP/0RL/0RL/0RL/0RLmvhfmvRfZtRrZtBnNqxzBoR7AoR60mCG0mCC0lyCojiObhCWPeyeCcSp2aCxqXi9eVTFRSzRRSzNFQjZEQjY4ODhfPMFcAAAAFHRSTlMAECAwQEBQYG9wcH+Aj4+fv8/f7/5x3csAAADaSURBVHja7dLJEoIwEEVRiPNITJ7zPAH2/3+gCLSkKmC7tcqzfpu+1cFfoWtN55udMoANA9kImbG8U3ixShxGyGnxEpTawtCgNPu86+FtIKXBNk2WEBJNkbkT3ZCZSGl4CCWkufJQC5dciC6c6GOaM9EJOVO/66NwfA8xbkhT2BEdkGlKFKG0IVqjNKlLw1bOEC1vqMHmRAsw7aepxAmYn8iggQm9//f5iZRF5ZAmnMdLFMEREz3giNw0rpQoAWrvmcG1i9M9XLpKI+hJaRh/kf12OBSWdhj8hieb1jFTUa/J4wAAAABJRU5ErkJggg==",ZCe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVUlEQVR42u2TMQoAMQgEfdI2C6f/733CfSXlQkhg7TOlzBSCxmNKdiE2iOy4QXx/YZ8QEUZi6UpsXYl0M5FuB4WBTmgXS9cutq7E0s0km8fTeE8zZQFD4innD9LkAgAAAABJRU5ErkJggg==",ewe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQUlEQVR42mOgGzA1sDLA4KMKWNwHCSF4piAephIMaUwlCGkcSiDSeBVY4dYP0g2xCKc0wi04pXEoARmNzqdbLAEA09Yf0pMCKkEAAAAASUVORK5CYII=",twe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42tXSsQkAIAxEUUe65kCy/x6uYvlBJGdrys8rrsj46axS24hzlc5iykkjg0YGhQUKi7D0wCy2toytkUFbFqhl3dpPb7gBFw4nYG/pwkEAAAAASUVORK5CYII=",nwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUklEQVR42uXTsQkAIBBDUUdKE5Dbfw9XsbT4SrTWMvwHNtc+f1bpZW9WH6XdagIQ5IEgTwR5JsgTQZ5B6SG3rEuy/r7IVQ4ScpCcZ2JZp/3zu5zXgS7u7NUk1QAAAABJRU5ErkJggg==",rwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAAAVklEQVR42mMYBbQGFveBUAGrjAJIDp/G/1CtmNr+49OoANNKSJSwVkwRwloxeURrRdVGglYStSG0wrRRoJECp1IQOBREB2UJgPIkR3kiJ5ytRgseWgMATF9z6XfvbIwAAAAASUVORK5CYII=",owe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAXklEQVR42u2UuQ0AMAgDMwpjeP9FPEpSpURXIBqEW3QnJTxnMzCyrEirIcskuLIixS8J4iu4wgrGSYE4KxBnBeCsAJwVgDcI4Antn8ht7B8kHuXyMpXXuXxQ9uwOzAM7WYQ9cx+9ZQAAAABJRU5ErkJggg==",iwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAXElEQVR42u3UoQ3AMAxE0Y50xFLt/blH6CoFBUdSRfk0OXjSk2xgXyd7Jrs06kPZUxy6n9KoDbczjqg5ouaImpsCbopwCdLQNzyi3h1Rc0AXuSng2fF7GOdt7JkX0ZIxdc7SQtYAAAAASUVORK5CYII=",swe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAZ0lEQVR42u3UoQ3AMAwFUY9kYqnJ/twjdJXCY22lIwE+aumBDxzTdHird8ZLlavjT5XXDUVcKyMkBaMoGEXBCEowUJqBgpEUjIa2gdiGrRTDVpqBUoyiYBQFoygYSa2uz8c27386vAeBDUCR9tPLHQAAAABJRU5ErkJggg==",awe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAaklEQVR42u3V0QkAIAiE4UZxjNt/EUepAQQj/gcJ7l6NDyLT5TjOp1EqFe2JUCpf0a1UtOR+RaOwlypgawWwVxKwmKxIJTnbkICtJGcBCVB6/YGHAi013Pz8m/KBMjj6+JDm68SL13E+zQEG7pSR0NaibAAAAABJRU5ErkJggg==",lwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAf0lEQVR42u2Wuw0AIQxDb5SMkf0XyShcReUiCEcyhV8HRHkSn4TPGGNeJisr4ygysrJuBGsr2vTrRhBbQURRCozgFf0qr+hXeAXOjipwZlSBo3EFpJ9WQPppBaSXC/gt0h8yf031D40vFfpix5drdcPhW6a66fPfFn/0jDEv8wM8pLU5jTCtSAAAAABJRU5ErkJggg==",uwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAATElEQVR42mMY4cCi3uI/CqwnpOG/gwCC5yBg8Z+gBlQ+6RruE9RAqqf/k+Z9hAbC3kcoI8n7Fg1g6++TE14Dr4HyRNKAFg8NIzxfAgCNxkFFqjlEcwAAAABJRU5ErkJggg==",cwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYElEQVR42mMYBUMUmOebv7f4jwotC4jUDFSsgCaiYPmeaM14xOiv+T75mhGAsGYyQh6hmYyQR2igIPCADlUgW7NlAdR39ymKtpGp2fw9ZjyjaSYc8gho/t6yYLTMGygAAH8IUaHHlf3eAAAAAElFTkSuQmCC",dwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAaklEQVR42u2VwQnAQAgEU4pduKnmrnNLsATzCoHkCCwohOD48zEP2cWtaSrAUEc8xjBYkUEWW9mdFQWx/4nIeFEOiKQwIJLCgOBOXy9Sh6SIMGHnSd9EXZjvitTXyaYqfIXhPuqY/ZSaCg4TTWFO3gW8PgAAAABJRU5ErkJggg==",fwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAd0lEQVR42u3WwQnAIAxGYUfJGG9b3cRRHOXvrV4UQVOkkJf7R4sBTVEUfR1GRcPJ2C6a0XTqLiqEDf9A6ABNw36ENtoxuu4+6r63CLnvLULue4uQ64r1L/NG+7E0P9QoB+i6QC+j92+CiqaTd1GjTMiKxesjit4e1v7NQuaRc8YAAAAASUVORK5CYII=",hwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAiUlEQVR42u2WsQ3AIAwEPUq24D1d2CBsyAiM4Ehp3CRQICcR+vuS4hDiwUIIWRfsqcHuk1o6ZA49YINkmeHa/SYPYINpkxlgsNE6BR8LKmqQwPm/IKjdLghqtwuC2u2CqKsbL/DjCBQgw+CpAe3WkpoL+ABSQMFbo0yG9aNF5tDS+3CQOXATsi4nQF79P0iJRo0AAAAASUVORK5CYII=",pwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAWUlEQVR42mMYzsDiPqka/o9qoKIGy/NWBggNpgaW5/EohiixuG9lANIAYZsC2URpsfiPUE6UFov/YOXEAiJNt7hPkjjIow4CmKIOAjiD2KLB4j9W2DC8si4AX8gxxHMz8CAAAAAASUVORK5CYII=",mwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAZUlEQVR42mMYBVQFFvcp0fx/VPOoZuprtjxvZYCq2dTA8jxBbTClFvetDCCaYXxTIJ8k7SDNJGtFaLf4j9BKsnaL/2RpJcOvFvcpkDd/b6GAR6sC3ni3LLD4jxuav7csGC2aKQAAuIQ/E3fAGfYAAAAASUVORK5CYII=",gwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAc0lEQVR42u3VzQnAIAwF4I7iCF7EZ6dxY0dwBEd4PUkohf4Ye5E8bxI+Qghks6wa1FkQDTLIoL+gVHZ/hYJP5SMUPGqnQPkLnR+hwDMzTIEqRihQGBUFqhnVbFBVNRJw0orGBvfAuHcdZVTw7sWGbEd6hRz7TEr5P7UkYwAAAABJRU5ErkJggg==",bwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAfklEQVR42u3WsQ3DMAxE0YxyY/xtk008Cke5tAFhILLPsBt+dQLxSomvaXooiroeNR500EEHDd4ltIciijqLmkIdRRQ+i+qXxbjfxizGnYxZjDuZs8adzFnjRuZsTFLUDlso+GExDuZuRtHfKR1DN7x43uuo+CyRG5qFcLqhL2LWstL/J6ZmAAAAAElFTkSuQmCC",ywe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAlUlEQVR42u3XwQmAMBQDUEfpFk23cwQ37Agd4WsPEhAEg37wkPxjP3mH0kMXx3H0oKPnAoEwYMCAAQO/A9CPKXcAyjx/CwROggDr4y1QSBC4nnxEEBDqNeIEhHqVmIBSrxOBSKgnMYf1CURaPYmP6mdR0j4fVOZ+PlAHAkW4m2hDArAitGnboqVtdTwtrwOrvzaOc5cdHmfKcWKAGEwAAAAASUVORK5CYII=",Awe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbElEQVR42u2OsQ3AIAwEGYURaBAP03gUNkg29AiM4Ag5oX6qSFHOhb84Wx++Tk71QNzQoejQlmg9J98tEXoZEM/o9WTKyPx850iXgXgm9AmkDFr3/JrulEHrDozW1wGveyUY7CkGha3R8LPFBXpRPcaBDWWgAAAAAElFTkSuQmCC",_we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcklEQVR42u3UsQ2AIBQEUEZhBBri4TSOwghsyAiOgDGEnJb3KyUcBbni5fMb3MrXEgMyvJXWVFD3YKIx9Jtcos6RC/QJUkGWpvZ5o8MLlM/tXaJsMmWfjzLbKVMGzUSJdUqsU+6Mdp+xOw6016nrd/tlLvZ3TaZaudTUAAAAAElFTkSuQmCC",vwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAgUlEQVR42u3VsQ3AIAwEQEZgBEZwg3CoGIUNGYkRMgIpkPISVeRvUvgpEF+c7Irg8XxKi9o10UwWnWXorEIzWfZdhWZCAEUxeLdoYs4ZrqHdNM27DuhkXAoUOgMDimTQUAw6Z3ZYBtAiGUAkA4hkAHEMoKlrn3JnQXec6V+P59d5AHouXMm2XtoKAAAAAElFTkSuQmCC",Swe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnElEQVR42u3WsQ2DMBSE4YziEeg4U7FpshEjvBE8wotE8wslSEg+GuRzY5+lr/Br/BoZeWqWSasVVKmbUqlQsZEK5dwUsA5yx9jZyOPJRtLUrZOsTeXYzk25TB3kvt5/+rVvPB9Y+u63hKXvJGGdJGzaSGZuJxWPJImRJEqlkQQ1kqBGEtRIghpJUBakgo67q2j8kufo+LKMjNybL+jK2Yh7MUteAAAAAElFTkSuQmCC",Cwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAmklEQVR42u3WsQ3DMAxE0YzgEbSFfunNNQpH0AhMeYgBIgjiA1zw1Fgs3gEGC706nc5/YZyHEWeRJIvh4YOce26SYFh4gqEvC3+5OXhNWAZe07lJxk18VXAe9/BR/SLT5uhm2RwDf5l4eE0tvObNN2/n65h4hSRNvApMvApMvApMvApMvAp0PnmCLE78sKYF/6WgH9OdTuepeQNOnQW06ZxtMAAAAABJRU5ErkJggg==",wwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJCSURBVHgB7VRLTgJBEJ0ePhsW4gnEkIA75ARg+IQdeALnBurSFXgCdeVSOIGwI4GE8QSOSzeINxgTWPHzPegxbc8g7thQSad7aqrfq3rV3Yaxt12b0B2VSiUxm82esTwVQoww26FQ6Lbb7Y7UuGKxmDdNs7pYLCx8xhmLuDM9ztQJAG4h2On3+4Ib4HqZz+eDUqn0RPJarRYH+B38zwD/QnyWsVh3uFfHC/tKEiLBrLmW2TQBbE+n0yusB5PJhDGdWCx23G633Z9MTdMBSU7H81WwXC4dyqP6SASAD/yLy5iRCk4DOCX93EoAI0FVdUCSOqarcDicpWwAupQ+Q6mg6lX+JwH0tJkhm+iBA9DyGsghSSyPxIvlXh3P1wMaCB4AUEdjM/hcgaMHOQC9wu9i3YhEImdsfqFQGLE6jNsgLGFsMIAN2HAvc5CxBwn520W2h/JIr0h7vd5xEI65iYDgbCqy9BobV/656pqSbsIJBTmRrWWsLxrLfkylUh2AvON7dbpwYm7S6bRLiSgnXCfJZFIMh0PnvxXUsfEaZTcxtwgEqWzKQGmi0agtwVv4vjfW+teDgHw94IlApk+qpvA14LuQN9tQwBtKzIBE+kkKqiCP0VEdBKIUbCgH1yo4Db43JFHTwXwE8qn4pSXfH0xHbKgcGZ6gX0Drp+JgKwFPBAFWpeTzCV6m8Xj8AZ/A+5PFHcjykaNM5XL5ziPCvgxIvnwJ6w5ukBpzI7NtYW6iJ05AXAPLHGP5AqNH5/pzvbfd2zfyzFdqevpDyQAAAABJRU5ErkJggg==",Owe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK4SURBVHgB7VZLbuJAELX5bEBI3GAckNDshtwAxEfsQk4AOUHICWJOMLCa2SU5wTg7JEB4drML2SPiuYEXwILvvGd1jzyW3ROQsqOkUrery/Xq12Vr2pnO9EGkqw6r1WpJ13UD7KZSKduyLFel32w2s6vVqnQ4HLJgZzQa2VG68aiDWq3WBuDX/X7Px8Z6vf6ez+eNQqHwOpvN3IBuMZfLfdtsNiYAPxM4Fot1INPn8/mvMPuJKGC8fAvg6/F4PPWQGw1jt9uVwJN6vW4hA13KF4vFPXTb2PbT6fSNzIrI1gO2vaOA8VIWEfyNbDAYOFge4YANcHO5XL4IvWcAXgTLkEgkHOhFmddiWnTELl42gnLhwIuoo1fLsNpvt1u+654C/BNLKShHCu+xdODUJRkR3wpZkIrgqXYsMAxa4KsgKGTteDxeZuRk7ikLgtMhOP90NDCvAtPNJgkDlXph4LwR0kaU/cjmEtRlZ6KL79i5ErRSqbQg7/F+47qZkD2h6cqi41+hSwe6KsMx1aGI2oHxH/5IcUdNLGwsDpeejBzLNXUhnw6Hw8eTgQV5nSm61CN2s9wzarmHc67Qz/7PqBJYTC92J2v4wCEiwO7ADkGQXi+lYsBMkI0bPsveOIkA/CYbBYY6fJbgfqKMZ9AxJSh4orIdGbH0WNYK9e7xejAqP7iMlGfQMYWu7bcRRqqR2YKxvl9GwzCmCfAyZUFQHz3DRhOrHWZfNblCJw8B6BDm+AQNx9HZDwGl4zaWqyj7qsmVhWEnKOc3F8snNJHX0eAvYXWHY46/+98NTPJ/JAjIyYTP4BvAdHyRLlH/Cxj/zXTzzO9AMpk0ROeHBxZ1wC7mvMVAsMVfiMHBgLULwH9KIBqMJWjh0Rs6yEgpovZqYAHu/foA3M1kMu/69UFGisJJ5a/Pmc70YfQHAAu2TGqVhRgAAAAASUVORK5CYII=",Twe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANMSURBVHgB7Va7bhpBFN0FLCHZkskPONj+gOAu6UB+yJ3XX2C7Sxe7S4epolR2unRAmQrcIUCw/gI2HRVevsBYAmSJx+YcMiNt1uzMOq250tXOzty598x9zRjGila0ojdGpk7g6OjIms/neQwzpmk6+Dqe55Wbzaat2ndwcJCNxWInkLXAae4FF+r1elW1L6ZaPD4+TgNMBcMrACD4C/A9FBcPDw8fCHYZEHAbwzz29ieTSY57MS7MZrMby7JSKptKD+3v71swfg6FLwwD0DmNgu14PF5IJpOD4XBYhHwGHrlY5kEArWD9rtFolMJsKj0El6eg/HHZGpWCt7Hex8nbAPMAY/319fW9sHBi/cnQUEK1CDcPoCRtqMkTxgYEX61WB6GCnvceH1elTOkhnNzGJxMWd4TgBkAshCxHZngxl1eozGxsbDjG/wKybZundRCOTHANOVSkAYQoV6vVXDISeA9zllj7h5iP1KXyoBYQCacuG3+TNwjGRK7k/AZ4gOl0muNaEBT0nAldans6gWw2m1pbW+vIymFIGCYkNL1hiBBdLk4Xi5XQZ664J5FIsPSr2FNg+2Diswh09uI6Add1n3d3d1kdX/BNAcxnhOlTt9t9Zg5h/is4SQbojzs7O2ar1aptbW39Ql795D+K4xv2fe/1eo7OntZDkkSzy+Dke8wXMceWEEz4AbzyjgN6BiHssAKjeIekzSFJEco/bB/bgRtVPhIg0ZWZvGz/bV8b+LEEwCJxKUNZgFnIwJuXRgSK6qE88uEUobjlxToajRag8H8tDA4kYIRmYZgy4hK+5Tx16O6xSETvBEsY/yVwJ8wA5Snjn2MORvGS1kM45RlP6p+DF87x+S09Jec5FslvChk/0UsnhoaUVSarRFZNkGD8mg2P1wb/kTN8qtzLsC2Rf8TVsa3q1koPAUwan9DeIXKozOQVCXwXBkaQPR6Ps4p1NSCWuqpkRbg2ISPD5mn0PflkXw9IRXwZIoc6GKYZBnHbb/MlKdrECwKYTfYllV5lDvFOgqEO7qhThMLBfxqdmre2TM5C8DHGWx3yN3Id7HAvD4Bxxd/pXw1IGsCp5CPfxb1ks/lFeeTzfQSvfJB7wVe6R/6KVrSiN0d/AH0Fx15/laFPAAAAAElFTkSuQmCC",Rwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQiSURBVHgB7Vi9ThtBEB5sC6UA6XgBgqno4nSk4hA/orx0dDFdUoE7OttdUhk/AfAEcTrEjzieIE6PiN8gjgQo4c/5vvMsHMedb7FTUPiTlt1bz+58NzszO4fIEEMMMcSLxIitoOd5zuXlpXt3d9fO5XKtvb29lvQB13WnRkdHCxxnMpmm7T5WRBcXF8voKo8Wjoy00FWz2ayfpowveX5+vo41xU6nMxX5uXJ4eFiVQYmCpIvuWB8baA5aQft7ZWNjY/VGo9GWGIIYboTkKePrs6tz8yDrSw9kJAWwgMce1tjBZu/RuOkEN8fcriF6cXHxfWlpqWjWLS8veyD5U7on4Si5YK3ZB3vXVdxN45FLE4AfOdiQw5PwvFrAX1lZqdze3h7rkW6D7BzGDnzZU1HKVeMsRh/l3mivZVCiBlQeN6/+mYeL8HjLkCvqT20luJW2Jwj/lhTYHH1T+zcpcr+ebJ7JtKQ35rRvpsilE4Uf+tp7STI4bkb0DoYO+rr6Ho//q1o6ae/CfyN6cHDATXiMjmaAR2DqAjFzvFXIbxwdHZGcSTk1TW/RdS79mmlOdQxGVGGisxwlKQ/5tQR/NGPRsSFbiZIFwQ86TM2h1kRvbm5oMVrVNVblcRuSOOK1uKCJkl1YWAjIIVNMmaDjhSEWsL5CQbAiXYv6qtxcAlVjSbVa4JMIpJ39/f1SZC0t+RYkOfbo1zj2NRv9WbHE5ORkE8o/YjhDJWivIiRr6DZ1/hXIzE5PT4+cnZ35bPl8fgLEZvHbKlqBvglrrp2enrZt9Nv6qPi+H+RFfWT+a4R9EijGLFs3Aw0wXx6u0upzChtrogSs0Ak9OvJMYP39mqQLJAnWRBkAov4nGli4z2shkbo8JWZqAZPGCrqWKLNoEUtY+yh8rAZFLgMA7ROmVvkMPxT44EnID+nDf9C+wDU2DUnRDIHf30nXz2eurq7+cp2NfquopzWRolgJCYrmPH2LlRKIbqtIYk0Zk2u3QqVjG+VhPloexsHKorSmdCOVKSc4TliiyaiWbol2b9keJJkhPuvaFuS5ztqqtj7q8g8suBue7HX7xJCsRPY069bFAtYVvt7J+QQZBlkQWFqcSKjcKyWVeljHiosBNXiFL93PDsJPElAi82htElSSbSWQWI/ipb5FdPRP1JRiUP4jRS6uXu1JwLbWJawrfBCJjUx1DeZIV+XqKFLY0/dqLF5wVc7H3ULcUz9zUpFKlN/x2FCin7mGoGig0YfRSsgKDT6DYFNfIEhtkOd8PeKLQYVv8ynSz+eyKLnw528d+XArmg/xzwYHeXeDtWfoRSljinFP51KDyfYfEBWJFM20INNVHMEoeGHgS5UVPd0h6rdxqas/okbZ9fV1oARKm6imWtIH9JZj4eyMj4/7NrfSEEMMMcQLxj8MATI6ZUh1mQAAAABJRU5ErkJggg==",Ewe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVgSURBVHgB7Vm9TiNJEG4OkG4F0nmzS9AZkIiH8CIG8SOyM9Ftdr4nwDwB3iewyS7D+wSYDPEjhifAD4Bgwst2TgIJIcD3fXa1aQ/j6TLeDVbyJ42np3+qq6q7qqvaxowxxhhj/FAolUoFPuYb4710JzSdSPju7m4HxQoeO0mCpzUxMfFlcnIyOj4+js0QEJplFP/AE1i6oBfjFc3MzOw2m83ER8crACe6v7+/arfbRfPKuDGvghiZuAFBPvsEWV9fD/HawxOmmhKXJgWBEMs+IX4yHoD5GpkXzayenZ195DM1NTWP+m2uAPuhXH56errd2Ng42NraKqbpsA7MH6J44TAfYfzfs7OzH4UuPieWORfnxApVfPx5VwAM3ZIYGR6kXTL3/PxcRb+/pIpaq4Ohz0JjB21V09Uw2/bBdH2QdmWVKGhCwcx7BcDEASa+0hDKEkQ0GZtXjTehiF2NvVjFYVXnoyga2H8qjwgI2D3ZMgoIY2VMHmFsTeyGDzW9DSVERgkRnCtfxDse1C/XBjA45huaLJohgMl/M/1GzvKKGQ7WK+Uace4KPDw8JBDCXYlciMei5stStSuM0OtUsTJFrXs03ZUz6B/ndVIbMb3D6elpy8P8BfrSp/dtGRolxh8InRaYWs0TwtoebQhzzpsceN0ocMkfECwN6kDjlbMi4KRYtWV3v7OMM2JVjDpg3yxX6yCQd2Q88AqACRtSXBnEPDzPhT0ryGiWl2GdI0RnzCAhHHd8aUYVAG6M24bLHYp/7oHbRsN8jhCH6fhHhApl+zTMqALAB3cOHvncc9tkz79hnoLiucDzFU+bZezrcoYQAU7bQ5cmhLJzREYBjQ1wFeomtQp41+yeTzFPBmy4YLUbou+BtPUJwbbNzc0a66l968EYVylYM5OaTnEcPywsLHwQpoqLi4tkrEqhYLC/W+ZFy/UcUiHoXN7c3MTX19cJ6HCPfwLTrP8P7z/xTaU0Tk5OvhgFVCtAuKsgcQ3RF306xpeH3jakWwazu/Jpz49Eq31CLYDYgiVcwMT7cI9pbYfGj8D9oKGC8X2nan+Y3EItgOAXW5BwIQ3NCfvmVIcy2uadUAsg7s2Nz0swynS8rgn6IveDobbQtcLveA65PqgFEPfGrdNgEiLVtdTZ4N27NgEixOtUnbFNzuG4Ui9UAqTdmxwwltlDqzEJH/KEsGN7J7hx7Im5Ats4l3YVVAJYjVD71sAwYVW0WXDDAqnnCkUyPJEy09Gqy7wN7iBUZyuStl0htHvTyQ5Pmk6D0sowDAuooxYDTSiRwfybxN3NApF2zo+c1PNwkszqzdUJXSvOh1UUW74ALYt5CpxmUEL2CA/D85KPP80W6kShrvG9Rwht1Co44k9eCD+MAKG8B7pIR4imJOJXiG96k9NTsc5JaJbzthq2ZVOK3jQ01wZkj381ylsJYm1trQ4md+STBp2A8c6JzVUE8xVNSslIFq/CSLcSYD6QiWOjxPn5eQWTk8FOHgzmbRNdaNXoEeMJRrqVsAATmhDBRZQSOhlGCXaMppNvBWIsofpahYaK/oztS6L5SJo6+QA82orm/lSgugnxngN2L5ruQRRl9cm4ve5ErjZalTxhz14Q+y6CRRG3LPO+1OTAm9DYRAaThkxAkIz8a5mem5v7hPba4+PjP6brrX423evDbSQkx5YGxrSWlpaOIAAdAe0qeHl5qWBsAJof0JYwwRGFdVYLxV8pKMYe5fHnXQF6ounpafd6nei7ChdEpqv1KI9exkVwNmPKk10VSogQ3A4rqf8JeDYc4chvKG/behBBQhGk9weHUdxej4Tv9ReTpW3GGGOMMX4o/A8/d5fiwsx9TwAAAABJRU5ErkJggg==",Mwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAX0lEQVR42mMYBaQCi3qL/2CYAGTfB9IQeB+3hv8OAqgipgYgjXg0YCoHYnwaMJWDRQlrQCgnoAFTOcj7RGkAKscPcFtukUCqhv+Ua8CMOARwEMCnocHiPxbYMJppSAUA/lg6pUbWw/gAAAAASUVORK5CYII=",Pwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcklEQVR42mMYBUMUWNSbv7f4D4b3oSL3QTy4GD5ged7KALuMqQHIGLyagQoUcGkFYlI1I7QCZUnVjNBKsmaEVhI1I7QiZAlqxtSKACRpJlIrAV9RrtniPiWa/w9azQ4CuOQcBAhpbrD4jwc2jBZaQxQAACupT1v2lEWwAAAAAElFTkSuQmCC",Iwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeElEQVR42u3VwQ2AIAyF4Y7AKF5M6o3NZENHYJSqF94Nap4kJvZvuJTkO5EgUTQj3dXa1Lat2OKmm1pO0m1dbtYBjZnrMBAYEQoCQ0FgKAgMBYGhIDDI9Y66DHoObQcYAkLfhrS+Bdm/oZxkUE4eqKg5psSnFM3oBEOXY2BCt6VVAAAAAElFTkSuQmCC",jwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoElEQVR42u3WsQ1DIQxFUY/ACGzBS8cmyQjZICNlhIziERjB6b6L1wCmSeTrEnQkJCSQLMuucG8DBh+9VhRG85pDFbaAmsw0txEVegJlUuMokzWMMikSRpkMo0weQZkUaQPWyy7KpN/cuoEy6eEDXT8+k9Q26uRR1MkAGiiKtjf0KOpXKtH/QduAzUwbK8/JAwqbhW9POVkvqL3kPyn71b4aE+4s3EDyNQAAAABJRU5ErkJggg==",Dwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAi0lEQVR42u2WsQnEMBAErxR3oe3m3cmXeiWoBH2i4EGG9bE2GLNzmZBmEEoUxhjzZPBpHeNvcq4nxsF8o8Aq4oERVc4dwoZUA1yfWoDrNynA9RFSgOulANdLAa4XA0wvB4j+jsCqn6t5WWDqFfi1XxPQ36Cy1wEHVlrHKExGFezIs/rWsfujZ4x5Mj8CpOyFH0yCKAAAAABJRU5ErkJggg==",Nwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAkElEQVR42mMYTsDivsV/PPD+YHGmg0WDeYGFAnGKFSzPW+y3aLBYAPRdPT5P34fzGxBaLQsImG8ZYLEfwbMysHxPQAPQKQ2o9hPwiXmB5QQU/nsHARxKEY5AKLFIsNhP2NMNwFBSgCg3f28WwEAYWBZY3Dd/b/7eYj/QhvtWBkTGBsRhpgaW5wc+ed9nGLYAADQwTxdfB+DfAAAAAElFTkSuQmCC",Lwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAl0lEQVR42mMYBWQDi/sW/4mA90dGaDgIWDhYOJATjAoW+83fW+y3PA8M0HriQvs+XOt9ywKEMRbzSYu+BGQ+0P4EYrU6WOzHFCFWc4NFA4bYf6I1W07A1EyBs83PEx/a9y0DMAKQWGBqgBpVQGMVSEwkFvdBicT8PSgAgWwFUlOZg6mBgwCITUg74TjYQIeS5P5oCTtYAAC7JmXu542gFAAAAABJRU5ErkJggg==",Fwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAv0lEQVR42u3UOw3DMBCA4YNgCEbR/N4OQiGESc2gZZAwOQiGYAiBkFZpOkRJpdrKUsmf5cXT+V7SNCsyc8HJLWNb9Fg3Mb+u0UsdPIah6kTUhSsWEl7KhUSUDSL2e/nz51MhyU7FB7HL9eBVMSnTTepkR12YpAzzt/fiiPBHlSyPaCQe9tUgZdCwyxKejC8p/4K4bUB1IXV3qUEk0+OXWG7LmGR1tWMyrrM2oO8o1ckZwgOTczDS/83yb2u+qfIEGIZ7p7X9JJEAAAAASUVORK5CYII=",xwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA80lEQVR42u2VwRGCMBBFUwIlUEIumh9OKcESKIEOpAPpIHSAHVgCJaSElLCO4x5QcmEj4zjm58aSN5u/u4kqKvo9IYAEK+wCLeXIERw8Ox/shDYfWOO2LhLqPGQAmYj+iTlotI8vNjZ6e0txw5gJZGdXve0Y+Q8JFC59VFchgI4nJRE8yHapiOlA9iqC2hmU9g61eKZAIEHsG9AAgktFGg0ys8zTAWSHZOQCgt/WUmFRDmp0eiTgBFDOlTt1hfRKLp5832gGnk0ELfMUO/u6TOT8M2+q0c58P3k4NiCNlWtfbK/Up7E9atkTHYTDWN73on/RHWseH0rdX8tlAAAAAElFTkSuQmCC",Bwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABDElEQVR42u2W4Q2CMBCFOwIjdAT+GF/9dSM4AiO4AWzgCLpJR2CEjsAIp7xEoyhoPEgM6deQkCvc612vl7rM/4AENYy0uEDeosy3SLE9IG476PWJqOHdnIR973owajcXqOkwooLvY4HgTMvp15OcnuYr2prBX8J0HecQSHT/wqbkt+JMcP2hHZlrmCYbiFBUY5UFDZ2z0Wdaiqn0GgsWCv0QnywYQWihu9IZmFwjPJTyFlgpcbzCEO09qHsfAzy3uDIftHCAhm5XvnV/sp5kcus88Pf6rxmXItFmBw0oHVrE24L4NqOEx/mhZUcIbWaJ1wYnm1KKwU4ktxiUyHejNdyuk1Eg36Azmcx6uQA5LzWzouf4jgAAAABJRU5ErkJggg==",kwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGkSURBVHgB7VRNToNAFB6gSduVHqBpWHQvm6Y/G+kJWm/QnqDeoO0JqCcQd7pSTyArgju8AQkbl7qDQMDvNdNE6cAUN7rol5AZ3rx535v3x9gJfw1FpjAcDk1FUaZ5ns/wq+8uKYqPfx/bjed5wa8ITNM8j+N4lWXZHAZvILL3xvr9vqFpmoHtCkRP7XZ74zjOx9EE3PgLLr+1Wq3rsstcb43tZbPZnJTpHWA0Gln4tkU5eY6Q6UU5ZPZgMLBEtlSBsk7xhkfr4lmj0bjF2WNRTq/EMqd8SQmAFT5hTGH8CjlZFOWkS3nCN5MSQMlQVdVnAtAZklsWZxsOTKUEUDJc1z0goITibAmSrcg6rzBdSlAGHrINSM5YDYgIAlGlyDAejw3efNUECMEzljmrCSTfoA6XElBnQnFJMWdHguvuqk9KgGQ5WO6iKBI1TsBf+AM0UkgumkuVowLPdqrmDOmRI1S+ZaNCE10MgiDq9XoPIJikaWp1Op3PbrfLwjB8p3MqAsiWSZLco2deYXxRa9h9B6+oNby8oB7Z+0AhoXzxkJ7wj/EF1FfPKWTB7NAAAAAASUVORK5CYII=",Uwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH1SURBVHgB7VY9TgJBFJ5dTYAOSxJIJKEXK6ACTyCWVuAJwBPsUlkCR9gTqJ1WLN124gncAhI76VhCCH5fHBqyM7srsTH7JZMZ9r15P/NmvocQKVL8NxhJlFutVj4Igh6Xu92uahhGHvMS84wD67HneX4cW2YcJTpsNBrD1Wr1IYMd5HK5MpwYnPkbTs8wT2q12pD6UTYjM67X6+c0iIyeM5mM7bruMkLXxmhiXOmy1zqWR/uGpQMjtogJBEDdTjabvVQFeqIzUCgUHjB9wum9SID5fO6WSqXyZrNpLhaL1zAdZY15bKhbG8uBQt5F3b9U9WRZMHVVcqVj1LSPydXUyUVgT6qj5HfYGKNU/TD5qcKogNELociWkAHdCT1cDCtMYGocV3E5Zio5jnqCo34UGnA/sq4mckxy0D0dGL2Rd0AJ7odOshqTkXREoAtqD+5HAstEjkmBuBhVcQS4HwnMEjkGphgtcRw6SOBdJHGMGo6wqReHd8Mg6ZPNZJTIsayhg8ZgqXT4ToUaFvldxQNayqxUKt52ux0Vi8U8aHB6KMe3l7B9yJbBtnFqt77vB2E6sbuT+CGDga7jsCzr9dqSz+z33enAoA2D1zIAh+TAcsgOxtvfhLxvmqYT1T5jO96D2ZPDSaeH/0AgnvJCxnnfKVL8Kb4BW/D7C5HPNCIAAAAASUVORK5CYII=",qwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHqSURBVHgB7VbBccJADBSGB/xSgjuIPwzwwqkgSQU4FZAOMB2QCsAVECrAfIAnJbiD5Ad8IKuxmMlkMtadfa/EO6M5sOW7PZ20J6IaNWr8MzSoBMIwvDsej5HnecPr9RrgkS+vMrEElu73+4wsYUWIiZxOpzF+Ro1GY8WLgtDhtnC32w1arZaPZ0/4O4LFeDe1WMKcUL/f9zGsmUCn03lJ0/TTwD+GDWEPptEyInQjg6i87Xa7GVkA38aUR8uIlEdmWMMSWzIMkIh5IzwHHzlVBXY4gc0Vn2gwGHwULdjr9ZYSrUJ4ykI+5XmgJSYn93tRXnHeYRhVihLvXIuODRDFGey1yEfLodHlclmRO6SwsMhBI+RDVzLFhyO5xs6Xmh9LBuyeqhDabrcHxYfa7faziGEhpOx9qkDICJpI2kAjlEmlOYHMlVFZQhC0A5I6IEfAfEElQiCzaTabITkC8uyR8k6gHCGI2YIncSH5clwR5aVfjpAka3I+n12I4wQ21S5YtcpQ0jNuwjSFlQv0V/B9iCHki5YUWLUfsIVtw4VLdQyyvBmj9sO6QaM8B9TQS5s7l8py26D9IBZTng8LbmNh2U3NmbQQGIpyJ3zkNsJZqsmXaIWUd4I+fWvy+b7CuOEKdangNWrU+LP4Agiq2SmFep7zAAAAAElFTkSuQmCC",Jwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK4SURBVHgB7VfNjdpQEB4bCZC4UII7CByQ4ISpINvBshXsbgXZVLChAqCCsBXwuPB7CB3EJXBBQkhAvoGxggj4jY2Vy/qTHu8Zz4w/z5sZzyPKkCFDhgyfAg7dCd/3y5vN5gHLJl8eDoey4zjlo3HHWeJ6ieVoOp326A4kJioEn0HkJSRmQYDRA+HvlACJiNbrdQ/TEMOTvwwIf+z3e1MqlQJjzIpfZL1ee67r+hiPuF85I9wC4YBiIDbRWq1WwYOH4sUA4wkPNTa9RqPxALLvWHrQXWG0xuPxkpRwKQbYk2ck+8VisaohyZhMJgOWZz2OY4yh7IwKsTwKw7/ptN19EGxfk2HPYWqCSOfW9sJOD9MjRsDkOVTIArVHYfybkGTjL7fkeHslwX7ckhH9gO0hIW/aSkQUaPMPCLxGeQD3P2RpbsmI/pPIP3PikQWqrYc325i6XBNns1mVUgLscuXw6ZSQvShZrUebR2HX7VOK4JJ2bj8KKqLYnorMxibL3peEsiKXyxlZ+jZZFdGwWOfz+SBKTghyiPyUcIlEaE/zZYtVR21lpFAoGPqbRB4p7XFdtclqPXo0aMtOefCIlNBkewhtjB6Jbrdbj1JEaE86rEhot34kBn1KEbvdzueZ20GbrJao4R8Q/UopgrsqWVrDRUUUn7yBxKmPbPYpBUg3xdUk0DTVKqKcJNiejlx24yTBNbC+tHwM1UdEXZ7gVW4yAjo1Eu8RosHF/A9E36OTN99IgbhtngdP/JIC3QP5qw0Ky11r8eT4wiTbHEqwU9V2+nd3+Dh+vM7n84FNT2K7i8Evu4Jea7FYqDv8VM5MXF7w4D5/u/mzGJ6ZuE5yCcJ9rha+qAf0P85MF4Tf6NSpezZZ2eoOx7qmo7/E3ed6hjQg7LkvYQMjxJiQwRhxiUtCMEOGDBkypIM/zyxU9xl1WUkAAAAASUVORK5CYII=",Vwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANESURBVHgB7VhLTiMxEK2EER+x4Qh9g8kskBAbOidgOAHNCWBOAJxghhOQnAA4Ac2GXxbD3KDnBuzykZLMe6E8akUoLneSZkE/ybLbbbtcVa5yuUQqVKhQocJnRk0WhDiOt3q93nc092q1WmM0GkWot/hvPB6/1uv1DPULPu/W19ev0zR9lQVgbgZ2dna40WNsOHEbNqKFcv74+JjJHCjMACXe7/dPIdWTXHeK7xswk25ubmZOyqqdBv41wOQ+u9wE9P3a2Ng4L6qRQgxQ6qhuUSLtakmANHX+GcqhdmUozSLaCGZge3u7sbKyciVvm8+Gw+FBp9N5kQKYEkQGOzm4v78PWqseMpgEc5tvwxi/Fd08QYlzDRyja66Jo3elTJlh1oCe498kRIJPT08HskBg4y15O1ITpqw28UWMoMGKqhpGd+Qb74yc7bW1Na+RYtMnENAeaXS7Xc77IQaYjhDVmvM2TYt0sPkzzmFh2zeea9Ke2IanOrEeJasNnGrdmtdvz4LaU5ttMmGZ42WARwFVop/nYgSOzRk2ccHCttjhxh4q7ZnwGjFUmaC6REkh/aaUANCka41RjkCzNWus5QjRsKjSGykJvM3ztGfB64UYmGFB0UDMDEjxUpt3PilOA3dNijuBNBu+sV4NMKpkDTdnZmB3d5eEEy2XYCaWAKyurmaTzdXrkW+slwEXYYYEWwwHMI8uMdWuSALgaEEDXiMOCiVC8PDwwPDgrywZXgb4GGFtcWmLgqMFLXq17mWALynWg8EgkpLAtwNr2F/mG2vRwB+tYykJzvtAA17HYbGBVBfdl5KgrzbizjfWywAf4GoHcWisXgRKI3a0feO9DNClwQ7a+nkqy8f/wNHiuk1ulA9vbSZ6SS0FKv1EP02Bo4kBhtCMKtnms8/qUp0bxByvJHXNW513YQ3bzReZhsQZSgQ39zNgTvP5+dl7lvEKY+wUkUZI+B2UlchnESClaxA6mjfDpm9tCiSRAumVudMqUjCf895aRVI0H5nYordJtCuTshJbDpp14MP9ONc9SS3yBmX4nU8tMhSBhOPp1KJ7cpaaWszjnTShF5qtbtM9f1hydxq59Dql/LWs9HqFChUqVPjc+Adem7wmngI0bwAAAABJRU5ErkJggg==",Hwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAHUlEQVR42mMY4cDivsV/NHh/1B+j/qCa20cBWQAACv4vmYxDnfcAAAAASUVORK5CYII=",Gwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAIUlEQVR42mMYBUMUWNy3+I8F3h8NmdFAGw220WAaBdQDAPaKOVEjGwheAAAAAElFTkSuQmCC",zwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAJ0lEQVR42mMYBaOAFsDivsV/HPD+aOiMxt0oGI270ZgajalRMOQBAAv+QwkAqGdtAAAAAElFTkSuQmCC",Kwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAANklEQVR4Ae3UoQ0AIBRDQcb6+y/SUQCJryK5S+qr3gKAP81M7na5OAoogFRBSariaAGQoRcAHFaE5VXdndKhAAAAAElFTkSuQmCC",Qwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAANElEQVR42u3TQRUAQARAwY2lfxFRVgUXB96MAA78B1wVGb8xOb7AKdCDHtCDHvD3/h7YpQAOAMBhUzmUUAAAAABJRU5ErkJggg==",$we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAk0lEQVR42u2Tuw3DMAxEPYJG8Ahugjyl4ijaxNpE2YQjaASOwgTpDP2AtAkrkrgHHHjg9q9NAieK47GSlnJ2DEUkvHvhibHPASNf5oxJGMsTpdkpeQjEijSAoEMA7x7BJ0DP7wzQnqV7HQO59UshzUIzzov8xNbBFeQDC4phj2OVdooVx1GyhNvRIKv6Con1x3/yBXoLN8OrFuoMAAAAAElFTkSuQmCC",Wwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAnUlEQVR42mMYBUMcWCRY7Dd/b/EfiPdbJJCiUcHyvMV+ywAHAQYGBwHLAKD2+xYKRGq1uG9ZgCpmWUCkdphWdO2W54nyK3YZPH5HKDELwC4D8jsBzebvQcGECcBB956Qzf/xyVFkM0V+pkloI2w4jy2ezfMt7pOawhBa/8O9Q1g7atq2PA8k71sZkJ2rTA3A2skElGu3PD9a1g0UAABrr0UWeGGzggAAAABJRU5ErkJggg==",Ywe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAxUlEQVR42u2VwQ0CIRBFLYESKIHLho+nKYUO3A6gE7YTSrAESpgS1ujGRCWSwazGA+/IJC8fmIHDYPBNSCEgW8ZqGRke+iONPVlGApG6KQkLCny3BgFlMi9rGgWhT+NRto3UKjfLNfquqZmMY1LyPKlRXRClogxqVAlZKLLN8KQcSxOtgvo+iX59RojNW0vw4hmzfDTNHpPi5ned3T1viLVqMiiuyiqat6fpT5bdfJX1qzT8w3sUt6ZoquTsrnLn8YMM/pwLkr1QgRDjRCUAAAAASUVORK5CYII=",Xwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABE0lEQVR42u2WTXHDMBCFF4IgCIIvHb3NaaEYQhg4DGIGLgNDMARBEARD2EZKpgdNWs3WneSip5vX/vzpd0Q9PT1PIy6ceUWCQpF4xXgYiCns0KqlA2D4h9+GEZ5u+RgwPp5NB5AcIXWFzxXWaPkp7mlVClas0AWKRFUq22T0LCaefknYja48Q7E0fnyB8mwx3doWp8E2AKVr4pprWHm3mCrU8NYbTTm2xxQCDdE6+5cGdLHOvuSuiWvtuNNAZFxU4drwXM17P+w/HxqYoLe6J2swQqFY6k/F8TVX+A61Y4ttwgIRl3GQfGgXy5Qrf8N6XqGo2wYPfwCbT3ueOd79OPIMoZIG1p6XYIn+H5v6Raan5ztfNN2z2B0wXg0AAAAASUVORK5CYII=",Zwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABKklEQVR42u1Wy43DIBClBEqghD0tb/ZECe5k6cB0sO4g24FLoBRKoISJyFwi5YMNiRQlvDmOpfcZMWM1MDDwGXAaMyISGGwzovUw6lGAQQRfqcNDSOyvzUU1LTTBCCFN+C8UlMn3qp9PoaxOX/oSEsxd6sHg2yoRpN+cfQkHQd0B+RJU4yxwKIOsulzBiE36weC6NqeLT6f35+9Ffx20SJA7gQj+njYRTE0hFeM/X5vDTPsdMLjh21ciSGCYrRFRfr0hI4Bp2fogybdcAKbsdNeDrIdEa+dCqS878rV1bnPz4SEvG//+OkdQ7UC4dRydtiv4VEm6zS5sFpLzk0l/ckgRkLop5DheqQhTuv0UMnCPKF6QEBGclk6Fog/vSaHUcynS+M0eGHhXHAExm9Ltn1jBRwAAAABJRU5ErkJggg==",eOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJElEQVR42mMYBZQAUwOL+yQqNzUY9soRGqyAGkawltEMQi4AAFwQFdwZM6MgAAAAAElFTkSuQmCC",tOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALUlEQVR42mMYBcMGmBpYnidbq8V9U4NRrYNOK0KzFVDzqPYhp93y/GjBNOQBAOCzHUzfY2AmAAAAAElFTkSuQmCC",nOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAANUlEQVR42mMYBaOAnsDUwPI8VYyxuG9qMGrMqDF0NwZhkBXQoFGjRo0atEZZnh+tcEYBrQEASqwk2l2gzGcAAAAASUVORK5CYII=",rOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAQklEQVR42u3WwQkAIAxDUUfpGNl/kYyix4IgeLAg5f8B3jUZRHSVQpbfk1MuIBWQkC3JLMnv0YCFhd3YkonmqhAdWsiNXXtYLn3IAAAAAElFTkSuQmCC",oOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAU0lEQVR42u3WQQ3AMBADwUAwhGPR68/8SQRCILTPEohVRdoB4P16AECIZY2crp73soLz/fQMz3cxzzzz23zzxwaKBAkSPyasaOJa1kiyuJ8ANnoBQOJfe9XiSK8AAAAASUVORK5CYII=",iOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUElEQVR42mMYBWBgUW/xHwrridPw30EARDsIWPwnUgOCRUjpfYv/WOB9AqZjilBfg8V9OElYAzpJfw2U+wFThHCyQADCycOiASOeG0azIwMAiQRHZ8jZbIUAAAAASUVORK5CYII=",sOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAVUlEQVR42mMYBQMPLOot/iPBetI0/3cQgLEdBCz+k6gZmUcPzRb3Lf7jgfdJsBVTdAhotrgPIcnT/B9CjhzNiAAbMvGMyI4kZ0uLBqyZomG0iBxYAAC/DF1FjBKJzwAAAABJRU5ErkJggg==",aOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAW0lEQVR42mMYBaMAK7Cot/iPBuvJM+i/gwAy30HA4j+ZBqGLDHGDLO5b/CcC3ifTNZgyw8Agi/sQknKD/kPIUYPoaBDNon80iyAXsxQVtxYNOEuihtFqcRRgAAD+k3WRNfn+qgAAAABJRU5ErkJggg==",lOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAaklEQVR42mMYBaNg6AOLePP3Fv/R4H2LeMoMvY8wDAEt31NkKMgIbGLD2VBESBKG9wfWUIQ3CcsNa0PhYXwfTlNuKIIFo0cNHTV0hBhKOEeNllKkAPP3lJf5mK5JwF2tAC1MGG1qjYKhDQCwMAtwM2SlsgAAAABJRU5ErkJggg==",uOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAhUlEQVR42u2W0QmAMAxEM4pb5Dqd3UA37AgZIYI/Ci0WJSLYe/cTSukrhYYIIWQcMKvBj6jpInGkBd5Ilij2209yAhM8mUQBh7fWBhegwG+kfCvoP01/DwXvC1BQqjpOUNcUUDCeoP5o7EWBgv64UhE2viDD+0mrPCetaleHqyFzsCbk/2xzkhpn1dsvJQAAAABJRU5ErkJggg==",cOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAPklEQVR42mMYBTQFFvUW//HAekwN/x0EcBnmIGDxH4sGIL4PNOs+Ni1YNcDIIauBsKcpD9YGvBHXMJq0aQoAXLpFORt9SKQAAAAASUVORK5CYII=",dOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAUElEQVR42mMYBaOABGCeb/7e4j8haFmAVTNQSoGQBRYKlu9xaAaT94GG3Mej/T8OYQQ9qpmGmimPKvP3xCQSHJotCwgnTvP3lgWjGXkUkAAAdUpV3AveF88AAAAASUVORK5CYII=",fOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAW0lEQVR42mMYBaNgFBANLOLN31v8JxLet4jHaRBQUoFoSxUs3+OW/E+S+/8TkLK4D3I4hQYh6FGD6GYQnaOf9gnS/D0pWQSPqy0SQN4iDgItTRgt5kbBKCAaAAB08GOtvYgHXwAAAABJRU5ErkJggg==",hOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAY0lEQVR42u2VuxGAMAxDNYrH0LZhE4+SUURHQZHgNMBFT02ql/OdPzDGGIDBpIppjLG0UQvJsVQUo1ibqKkURR5L2a/S+nel97elP5Bu2af1MX1hoSS1kDb79ygrk+HzZowBTmhq8jpu5gHwAAAAAElFTkSuQmCC",pOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAc0lEQVR42u3WsQ3AIAwEQI/CFrynCxvAhozACI6UIkWaV4hQEunPDQXoocBgIiKyBrY8EPcrj1yN84p4UMWYY/fJJiAhfBiDQBjD1/JJ6Oex+/8CrmMFKODjAbrJC5rd6+26IObLm3HeZp9MFH04RETW2AFGsBEvMR2tyQAAAABJRU5ErkJggg==",mOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAtklEQVR42t2TsQ3DMAwEM4JGyAhuAv674ggZwSNkg3gDaQN5I43AETSCgsCpZDqBizRWSfCfwP/pcsYHZYShobEg4/p1WQOjVMzr2m3ABJOowXc2DSxYNHQWicWVoDEyuVaLRFcA849rkArdjKWivUXujZnpWHJX2NGw238F4yBlM+Sdj13/CdlDou7FCnMRYUL2BGuhPklFYo8GcodGTw4M0zh80n9KZdLwq6SFZW2dCXrGL/wCN0FD1ENCiIcAAAAASUVORK5CYII=",gOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA0klEQVR42u2UwQ2DMAxFGSEjMAKXyt89eQRGyAjdADaATdINGCEjeISMkBbaWyGhEVUv/CiHKHpW/G2nOnWAxMCygyIismcHuxvllgImWNTz6dLAkoNmAkAXdIBCPu5qKLoUHJ+7Yy9mPRX2NCRgWKiYhBPK7TasqJOJCYeN4BQQl6UJfIKtSgXL93K4hlblQvwPfG2gvzAsX4bNIRFDAVLsNbe59ky+jcfUYKDPWdKvdTgEyuMuR6GzMdfmnafFRIHbL0pCjv1rTMjRTcz5OR+gB66nVLaj9d+XAAAAAElFTkSuQmCC",bOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA4klEQVR42u2VwW0EIQxFp4QpgS78fKOEKSEdLB1AB9kOJp1QikugBKJISLlkghNxWK32I4EQ6CHA/t5eei7FnUzF6HRpVEmEzStsjIEqTe96EMY88oFxOmH0r15uGCXuP6wXbZqcIDJ2fS4BIztAcvvGXKM0zUFtYCaoyS5p9NHsV1ShLgoNaXFfgtI7ZQ3oWHQ5AratEf2xQARta0Bx1WOfmpaAJknCm+8cMqcvHSe7HKmtyWkjc1FmxubOMk3SyBflwP70W4Rh9ZFh/nrouzQq4R+xK4k6rM6olLi/ivRz6RONPGPZaiearwAAAABJRU5ErkJggg==",yOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAOVBMVEUAAAA4ODg5OTk5OTk3Nzc4ODg4ODg4ODg4ODg4ODg4ODhAQEA5OTk4ODg5OTk5OTk3Nzc3Nzc4ODjhY7mJAAAAE3RSTlMAQI/P7/+/YN8ggBCQX+9Qz49/zUwuWgAAAMZJREFUeAHt1DFuwzAMRuGfFl9MWUrc+P6H7VbUFlsIDbrlG4kHWANpvb3AluLgt8X0uzX4EqtSEZJqAd+sSs16QFQlQLo7YacvPPY83aE3fdM63LO0OpsuNh41SYOuQackKdE0aMGapAChCxtHQZ7KMU3a6JpkfGhS5aFZ8A9pm3+AcdOkTk8WNhVYPhqsxDibXhep8NRgITSqzqGLA6/5s3ieD2aBXandTwdtga/6QQ2IxZpU7XAo9YVfxon1m4OXbnr7u0+X4gX3FA5vDAAAAABJRU5ErkJggg==",AOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABSklEQVR42u1XwZHDIAykBEpwCXw8kvyiFHdw7uBKMB3gDlxCSnAJlEAJ3AyXOz2SSSQnPDLD8mTErmQh1qajo0MGb3HGSAdkLFgg04ERZ2/NO4ADrfXgeyvi8KJyWq9HXWAZnbfXfDwsePndgdXb09oxsc67+1vdT6o8MGHi4zGNTiAiTU5OULD8B27P0/cWds5CTpCwwG6EqKVK3ooJ8FsWwFlUQauUoC5dA46OY2QE0TDEZaIgJeCVFE1dKAvKiklHwKhXbzbtAAuXtgkmhwWOtjO3UDZtwA3SnOCTS4Re9pHbtyl8qa6L/qJB1o06HhVYRBOYwqlhFzlKpGVyWv2KvCmceXAoGE2ApkywsyCVZaFd8uhjVFoXpngeODo2Ny2MV2TjdRIU2Dqi/7OOk2PrSEFR+0cG8XZBpoDD++z7dmvf+49NR4cMP+/u/nHurjk1AAAAAElFTkSuQmCC",_Oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAY0lEQVR42mMY4cCi3uI/BrxvZYBbw38HARAJ4UFYpgYgLTg1wLUBgYMAiA/Tgk9DA9w5DUAuWIvle9waCMjQXwNm4NZDZQiHEiyk8GrAlBxwDQ4CmBpgPsEEiDjGhA0jPF8CAH9kXj43Z9VeAAAAAElFTkSuQmCC",vOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAf0lEQVR42mMYBQMFzPPN31v8xwrvWxkQ0AxUpAChIXwE29QAv3aEJkzNCO2ENQMdrwAVUQCLEdaO0GxZAPOr+XvLAiR5B8v3+DUT8NioZhQpnCmtnjjNiJSGEFcwf+8gQLRmDJn7FgrDTTMiQ+DRjMgmmACRITAhIpuMFpkDBQDJY3qFC/iIhwAAAABJRU5ErkJggg==",SOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAiElEQVR42u3Vuw2AMAwE0IziEWiQDyo2IZt7BI8QGsQJCeWjdMiXJj+9IpKdFIk8wamOUhm2L32QQe5Z4S7X69KkeL0CkZqFSHVD6hDuQ2ApDVCEkGF8ZHXk171j8xbUGZSApqFqsRjOYYjFwkA2H4fK93lAP4bUIQ2I/akSdqHGUEeOrzLy5AKXfpk5k6Md9wAAAABJRU5ErkJggg==",COe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAkElEQVR42u3W0QnAIAwE0IxyY9y2dpOM0lEs9EfR0nifSi4/BcmjoAYtk9kxBJ01rEIoaGFdqltg3wa073nVjOAtsA36QwVWQAdWRvsmoq32rIb6176bDaxrKHgNpBNm47+voUISPQ0NJ1YhdDSeWB6i8TWdD7yIxg2JnowSMarNU2cVq8QoeEmkE/kEy+yYB+Q4U0WfEXbUAAAAAElFTkSuQmCC",wOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAtElEQVR42u2Wuw3DMAxEOUJG8BY6dtks2sDaIKNkFI+gEZjKEIwrqE8n8F1niHqwYZGSIAj2BZ9UYR354pBx9IR155pQpAq7y2AwaTye4cDVreANPIGjWBeQYlDAn6ttaVpFWDElQIZxtIiQ4jcouNHy/GVT1fJ+ifBbzQiGakIQAlrsdNZU07kq8DtrXhJwq+DDtSTgQl4XghDsJuDD5QvmJlqGjUeL+PAc9tPmdFy5g2BX/stocvY1lcqQAAAAAElFTkSuQmCC",OOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAZElEQVR42t2TwQnAQAgELSVdZK66u84swRKuFPMWA/oJhPMj+xjYAZUThx1TDXhMXwJcKD6MqwkMY4mw0CaAx10DyhRh3tZ2GIajrw5Zs66TNfv98QLImk0ga+J/uKUd04kv/ACuwTxjXxOzKAAAAABJRU5ErkJggg==",TOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaklEQVR42u2UsQ3AMAzDfEq/KHNd8llO8Ak5xZ0Kw2O1BCiixdDAQZBgO9ovVnXf4KhOhLmYRHMuAW7OMGMwBZh4rwJPuhn9dilzc4IpZU73ZzhnIcBlFmrHhADnLAQ4Z7GlqlXdeY/79QA1NEE/OOqwDwAAAABJRU5ErkJggg==",ROe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAi0lEQVR42u2VsQ0EIQwEKYnkdWMiSqGDp1NKcCn+gOSTk3U4OsRGKwcjWYxwOtkp6M30aTBnuhPo+qKYDFoIREOpKX0yKj0AklHybFQ0AML+ewSk1NlKvkZktY6WPBejhV6NJgNDpb9ISEe9BZCjngty1YsbhC2AXPV8kKPeAshVDztfrX+OzqHeKT+HPV07KiBSvgAAAABJRU5ErkJggg==",EOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAp0lEQVR42u3WsQ3DIBCF4YzACLeFfzo2tTdwNmAUj8AIL4XTnZIid6KIeJRInxDoiXusrEwMF9eXnd+C0OedheahGB2hemJJKLYNdK86sBS0noijFYwD0VNQhO7ztYLqSEG3gVp5361QCkpH7Fgr7Kg+0x9qCzyUZ0+E6Ni/Nsr3Jo763sRR35s46nuTgvrexFHfmzjqexNGfW/WHzURzR971li4Mi0vWmHD5wlP56oAAAAASUVORK5CYII=",MOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAwElEQVR42u2XsQ3DMAwEM4K2yavjKNog3sDaTKN4BI/wAYLYMFLkC1KNwVcjQcUBFA+gHplMRgcbNnHnCwj+u0vAjQEwDBDEQJsAwApe1hoMQANBdCtW6vLZWyxggHU5Tx3EiAUQtHKcrIB1DwU8918AGF4i9BP3ii+RgWBdrFj59lOLbtMOXlafIVo7RHO0qLLV8bjCVgdA2OoCaFudAG2rE6BtdQK0rU6AttUJ0La6AMrWnCoSMG98zw9OJqPzBt0l7s1Mr/E2AAAAAElFTkSuQmCC",POe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAA0ElEQVR42t1TwQ3DIAzsCIzACHnV57wYIaNkE9gANskIjMAIjEDjqKiRHPLpL1gCZJ19Nj5eT1xw7FHQ0Dgjwt6CnWFPlTMK7G5FbuSdGcMzkjMC/3JVWA6cByHsOez7gq17sMHteyJ/AZcSJBMir91HK6IwU4XTARFtbBx0QXme5KTqzKmr2tk1Q+vnwPt/QIEdlTRPlHUPAe3G4pUkjtxI+lk7u+aIEnge3HvpAx1IgzysjOk3SkTOd2oKKGfxUeWg4EoiifPRaOEA98Qv/AE1UoTnN4Z2HAAAAABJRU5ErkJggg==",IOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA9UlEQVR42u2U0a3DIAxFM0JGYIrH8R8jdJRuEDYIG+Rt0BEYhREYgSqyIqpKLpXaqj8lPxaxORe4ZvqN748ws5B9pflKlhX3dKGsvkqiEaeJSPMXil/DPCzFUSTtC7DpjCQijn8KbkClEPcITVUldacSKQ/pB09O5D5L/jupBr8+lIzTNDn3eX+WpBp8NdmSaMMvWuRM0OhQ0BVpRCAbxV0U7W7Z1g/PIrce2X9eIn9iz8TxaUsyitVL9j3jTIt2D1kOY5M08vbSvXS7Y5aBtzWVDUc8fMymXaaSx/2cKP5CY9l5NO3vW+qAL6m/JMQw/17XN4wrEpijJzJiTjAAAAAASUVORK5CYII=",jOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAABOklEQVR42u2VwY3DIBBFtwSXkBJ8SXiTEyWkg3UHSwemhHSQdMB2QAkpgRJcAhsLIWTFwmQPOXmQAIH99AfG31977LEaulNGHIFIJOAZOPwDwkjAE7G6050YojyIjG9hOBCUm3sxeY2BcOy5E5p1ZQAjt8X6HfvsbTOKgE3j8oVzL9M8iiHobgNSdKDxL3sePY/KYbfTikmHXF8fxso1XcWmJgZiWxNTB/nTJc3kce7XriHN5CK/VVA5YOKreN3JVJB1UCyzrf3PgEpqalpLjZhraiM1cafLErksSfXIh42vgpQhNrahgsmlVi3IUrb1wIrb+kS4YRucKJuHms79WjkyEppthHHWVmyk6FA/bzoSt2NP4DutZIByGdMc2GSuYmarZSTiCdhFdTXrGvDZ/JVTT+T+S9xjNf4AJFfBRFljej0AAAAASUVORK5CYII=",DOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABfUlEQVR42u2W242DMBBFKYESKIGfrK/z5RIogQ5CB9AJ6YDtgBIogRIowSs/rnhFGGej/VgxliIM5MydGXtMctll/8FUKiq0GMUEDS0H2aFE9isgagvbj/ZNsHg4oNdYJYmsLHD0v2U0ErX9a4/MQhpzz2NHZHjap3UkkupQGsz8xLj4Kgw+CutB+pbb6x56GagwsN5c3XI6PmEmYL6sUqsnWxbP5FilTIacVHoG2prq+hwW1DUbepcAXqM5o1PHDGoN5jNyhPMqu2Vh5AB9z1/EMq4K1wagawyLsoXKaePi2Ew469nxOyqli89BOTsyBvxhKEYudrrg7HXA9xxaDCHok0tk62KP4RKU3wdALpHoUYY7/RQNDTdsNNzv4b0/94lTWtmllnubd7g+xMO17CCSLY37Cj0dsDDUDrXNZzgFPJeKfedH6VSy7UVi0bJl85hxAaOPRjJQnptONdXxjKWjSOOpuRwe27B474JL0cnBw0a0olLp9eV22Z/aD864midGg3cpAAAAAElFTkSuQmCC",NOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAVFBMVEUAAABAQEA4ODg4ODg5OTk3Nzc4ODg4ODg5OTk5OTk4ODg3Nzc4ODg4ODg5OTk5OTk4ODg1NTU3Nzc6Ojo3Nzc5OTk4ODg5OTk3Nzc2NjY3Nzc4ODjGsI2cAAAAHHRSTlMAEGCfz+//II+QgI/fQHDvoDCvMHCvv1DPUG9/Uoi3OQAAAUNJREFUeAHtlId26zAMQ0HLAj3k7J3//8732lrnUKkVNd3zem8DIoGvyh9SudqTvnaV4Gm08TScoow0fKAV7UhPshcU0EC6wXOGO2acDwsyFD6yDAxLOLrxcEUHDQzrwvtXAiU1HpMCWV39hgSuAGzoENmyA7BgEORoxgs1B0QG7sYX9cgQf0U5t3OeAmBJKqZErXvu7NyOFe5YsM0oYIn5VEXFIlXmj2a4p2Zi+5oBMOeMxJyQClSG+OABRmoIQCKSHElqXYS0beHs7Q+88pfMnbzoISN6EW0Nl7YezNbXDpx4lhBMaMfPVpfFd7S6zJT3+rEhnmqFP6EdG2iXNtBhbKD2WotuAXTcXhbkikGuhsBWIGkIKMQxaClmFAturQfH5LktyE70g8sHmSEtSU+e1UITZXRBw7d6U9wvLO6/KH/8B7idD0gpKHb0AAAAAElFTkSuQmCC",LOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJUlEQVR42mMYBXBgcZ9UDf9HiAaL+xb/scL7o6GEK8RG8xMlAACVNB3g0sZyBQAAAABJRU5ErkJggg==",FOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAK0lEQVR42mMYBaOAgcHiPiWa/49qpqVmi/sW/3HC+6MBNng13x8tWYYFAADfeCK8SdnhwgAAAABJRU5ErkJggg==",xOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAL0lEQVR42mMYBaNgiAGL+9Qy6P+oQSPIIIv7Fv/xwvujYTRqEDnparRMHgUjFwAAC5wnmLn/vc4AAAAASUVORK5CYII=",BOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAO0lEQVR42u3VsQ0AIAzEwIzl/Rf5UcIGCCFoIl96Nym+JA1CSL1G00aNjo8S+vDyJeqjjBq9QYjzL20tTqZlDU48w/sAAAAASUVORK5CYII=",kOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAQElEQVR42u3WMQ0AMAzEwMAyfyIPJV1KoEMqVfUFgIcsX5J+Q0hNomkDBgwY2Ah9eBkP+GQDBgxcC4Q4PyW9aAFuUHh99LjXQQAAAABJRU5ErkJggg==",UOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42mMYBUMDmBpYnidJucV9U4MBVW553sqASOUIZVYGaMoJa7FIIMPtowlqcAMALLcTnJ44bUQAAAAASUVORK5CYII=",qOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaUlEQVR42mMYBaOAqsDUwPI82VrN35sakKXVQsHivkXCQGi1LCDf1gailFqetzIgVStCcwBQsQKM5yAA00qs9gKQdohWy/MWDaT6ssHivoMAQivJ2i3Pm6+3WMBAHrBYYLFgNEOOAooBAE/7IOBahtOxAAAAAElFTkSuQmCC",JOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeklEQVR42mMYBaNgFNAAmBpYnqeCMRYKFvctA6hijEUCdYxpoNgYBwEqGWN5HmgM5cB8veUEkjRYnrcywCLab76e5FRicR/dKIt6y/MOAkAGZUZZ1FvchxhDplEIYywUQCyKjLKIhxlDkVEI11BslKnBaCE1CkYBxQAAih4mBvJZLiEAAAAASUVORK5CYII=",VOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnUlEQVR42u2VsQ2DMBBFMwIjMAIN8nPnTcII2QA2yAhkE0ZgBI/gEX5KC4mG+CKae6WL5+Lu6R6O4zhXoSeTTZWpizsylrIiMr2lcv6LMpRxMFYiJkvlEyEWQ+U4hPKjkkxO3flmVuV1qeKeulPlp6UVsR3f6ldt2vXQT/tm0oeCwtuynzrp2bgfEkJsxv0wodqPGfGFWPx6OI5zC1+THlNktNW3fwAAAABJRU5ErkJggg==",HOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAUklEQVR42u3VMRUAQQgD0ZOCjPg3Eim3JQVb7SPdjIAfOj4iIqKdVLKc5X85zKvg4e/JjUSub2iZn1iAH+DktycGvz0R4nui+dSEVTwnIiJ66wCNNFVRYPT2bwAAAABJRU5ErkJggg==",GOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42mMYpsDyvJUBMt/UwPI8nIMqYXEfpBTBMwXy8CglqAyhFKGMgFK4MsIKrQgphFgKcQBBZQi3ElRGQKnleVOMAB+maQsABGkiWYbfEDgAAAAASUVORK5CYII=",zOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAWElEQVR42u3TsQnAMAxE0Yx0jUBoGm2eUZLK1TecjVtfeeIhEOi5OUmoZFoO8y2xCxIiAo8IPALwKHuAxWTnl43abyltgBCuZwFP7gGQA8soFJq39/9O8gMKsCr3VlZvDAAAAABJRU5ErkJggg==",KOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAXElEQVR42u3UoQ3AMAxE0Y50xFLt/blH6CoFBUdSRfk0OXjSk2xgXyd7Jrs06kPZUxy6n9KoDbczjqg5ouaImpsCbopwCdLQNzyi3h1Rc0AXuSng2fF7GOdt7JkX0ZIxdc7SQtYAAAAASUVORK5CYII=",QOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAbklEQVR42u2Vyw3AMAhDOwpjeDw2ZZT00EMPlopkV7kE3wLRUz5grtHoDyGQCHHHKyQWCvEBKSxkf5p6QF1WAnFGAHFUAHFEAPFKBBFEAxFEAzUQGeNfav8T+x/ul5/fDH5r+kbh25ZvojNujtYN4yCOnT1/gdAAAAAASUVORK5CYII=",$Oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAaklEQVR42u3Vuw3AIAyE4YziMW7/RTwK6XNSLPgLmrsW9EkIP54kSU6jVqt+b5RavQOuD+nc2gHLyOEUkCM3k4AbSMAZgDknjaOkcZQEHAf5k/mn3C8bXti89fhwABwg0YDlKyDLMklO8wI/NJSRWelhdAAAAABJRU5ErkJggg==",WOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAbklEQVR42tWTwQkAIQwErxRLyCewXDV2Zmlp5Z4LDhzkJeanzIgD+lw1GW+0BC3NnlAaHXyoWrfW1Nr2iKsy9oIMlRXgKIACHAVQgLsACpdbAY6EggLgUFAAHIoLgFPJcIH3Drwijwt+hyVX/fQPLa059IZySykAAAAASUVORK5CYII=",YOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAn0lEQVR42u3UMQ3EMAwFUEMohEDodPnuFAiFEAiFUgYpgzsGgVAIgVAKJ510iiovv5469E+xo5dkiCxP7pQ0oLmxzqhujILsxw3hEuh3TWPce4d76PZfx0XXX29DYWmvKpKI4RQNevSqc4KKIOtHhOJ2U9/I9nCSxwPBUoojoVpKcl11MZT9JLpP46nDBwFNvEFG8eP6mv24peEZhXfKF0shN3m6KmEvAAAAAElFTkSuQmCC",XOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA5klEQVR42u2VwRGDIBBFLcESLMGL4a8nSqCD2EHsQDrQDkwHpgNLoARKsIVciCFwEDJ75N/YGd7MPhaoSkoSAsuDkdh5QJoWHtB+Uywgcci6+iddS8Y3JNyKTN9mYNDAkteKGLGe0i2aHMzoV2j7GsLgUCkY6NCQvxUa9tKYrMmEmL6FjYbBXKDEFs8LBqxhjZagFgZPMUe1FUMEmsV23doUgGx45JjIJFiC9VFo6AgxOed2P5tQ9Pqx+MicJMiPIX+mSDlM/hUh45Bu1bVphFj+UXGEFHYe0ALN9KBB8oBs+fZKEvIGIRtMyBWS310AAAAASUVORK5CYII=",ZOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAx0lEQVR42u2WwQ0CIRRELcESKIGL2WFPdiIl2AGWYAeWgJ1YAiVYAiZc5vBDzGQ5bDbMmbxkX14WTnNzxxsKymDk6lGHQxFRw3swNGRUxPFG6+r3ZhQJFdEaZQVwKvKG2qDGKEWI2ItvyEffKJyIhVu+RFqjIpaHw7PXqIjlwSX3G5Ww9BY+1/OfRg1WgFqjOpRGc9/oBqt4DTLKSltSyRrVkTb+ZIyqSOuQH2yNEikt3Ak1RvUfSq/ReTPt9WYitMxn1Nzx9gOX/6nFH0XZ7QAAAABJRU5ErkJggg==",eTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAArElEQVR42u2XsRHAIAwDGYURUiqZJhsmG3kUp0hB+Rw+N5xVy1LxB5hWKm0rmazl6TrkqQW65efb8nQ+ct25BPw6ikA2AXWZbIaATKa+Eu+yGQK/U30hXh0IoJvjmQBXgBkIwBQYgQBMsokI8DQbmMB8AscPAlSBBUAAC8IEwhTCBNiEBOInAQnEzzISiN9GQIDiuWKGAMTDgwMExoNTu1DtQhsQ4AKrb1dpW32AOeVN3XfvJQAAAABJRU5ErkJggg==",tTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAGUlEQVR42mMYBQMGLO5b3EeniVY4GnwDBgDyfg0V4LDU2gAAAABJRU5ErkJggg==",nTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAHUlEQVR42mMYBaOAnsDivsV9bCwytIwG5iigAAAAU8YNFb0HgxAAAAAASUVORK5CYII=",rTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALklEQVR42u3RIQEAMAzEwMmKu9b5T0E7NJZD4TmSnihCjb0jhIy9owk9tWek3y4xIxrUO3326gAAAABJRU5ErkJggg==",oTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAL0lEQVR42u3RIQEAMAzEwMmKu9X5z8EeluRYcI4k7eESbqmOEFKqYwjzK49J2vMAOT8a1H/CHGIAAAAASUVORK5CYII=",iTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAP0lEQVR42u3SMRHAMAzAwLKKiiZhbgiG4ECw19zpN+36JEkvY68k2G1PERT1Z9tTKymKaHuKQ6zkdO0ckvSyC14fMJHqKpyOAAAAAElFTkSuQmCC",sTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVR4AZ2QLWyDQBTH8Qqv6n3CsYzmvMIuK815MV6m5rrMTTFBxxw1E1PIyXd4Ua9wKyi8ur0Xshs5csvaS36C9//g3gW+o7ALM+yBUXhaBf89bM7avsj0MGa6N78MNWt/BSUZkc1+bJG8ILgAFX6lwQZPBx5cCNq9zysa6s18jRplWGIED1hILtq6D0jwjLTHZ7xJ39o4r1BMD1q1YlfqaNxrYZhXLfAJ79Ut9kCh41b33U+QNfZYbxsVwR6Foo/OCpb4yLdi3Q0y/NMSY7BrLIr8dOwN5seAlCZPGgOJYpH/7gb5Fh9NnJIHDKwLykxvQEEkzIzO3K3zz/crunrUVFrUHKTZjrTR8Tb092tpS9wiMhD1MkhAgpydr7Gi4cE1eoOe4ysaae8X1jwxbxFMyNDn+wZoU/gQWA1zdAAAAABJRU5ErkJggg==",aTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABOklEQVR4AWKgKwCURoawDQJRGK5X9QqvcKXLSvCqeikX7MyKN8ybkqys8jDzfuYdZhavcAVq8Or2XlmTR47l1tsln+AP7+P+RwJtFKteIsMPEjPPUdQBon8BEjhvLZJmGUOXCtXXbNBGE0ObGCJR9RlVukNkiEV12V/XQQ+OEgOhunpB1h2cc/EPscB2O2hfqe2kPu3jHjG9S3s3RBKi5akKskKt6wKChMS2v/wMX1uaOarVUKhAniDwrjIWakZD4ie4+FilvNWaEWnOe7U6LN5gnfNwTkwNiHkRA10LOnTdIwQlhW6wyvyYYkeRTqOlfgkzvQ9rnW6SP4jl58eDP85sBkSiYxSzUDMaLqa9ETMiPSU84O0e82loivHrPuKZIgN5q+zhYEmhG6wyP6bYUeQgtoss4mHELvoGnVEJQO0l+0MAAAAASUVORK5CYII=",lTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABi0lEQVR4AWIYFADQOhmCNgxEYfi8qlf1qq5Z15T4mXqaEhgMZtbzptEzDaxtYSb1Zl691MyMMTM1c65pYHBe3d4Lo4HHg9y6HPwkyd37vuPlkkAZxcUJ4qKyeHV4zeldh2CCioEYyuSPUNOL4aSx2BDEM4ZEreD5oVo2bbgohhgJlP2uwUKqvBbxVnSZObIVWWZQ7rsFV3YGx4y1ikTHjKz/A5cptV3xkUPU2x2C5QaChE4EE7WCb+EzWx1uVlQvgtfF0G6KwP3GeIrgDt61VH8W0QPGCTkvnDU/XL1bur+H1ykHS/WKAIJEFD3DaLCDoO8BdjS/hit9bpWnqDUEfoIgpdYrPrioU7DTo4FbhOAWkw+no6hVxMDfaTilekyO9c35pwenwxwnHEu9UBaJYLFe4Y4Nn+QL33bjaA1DvS0C2BbDFwJ/PY4G0sZYrMJFiSwRdxRhpu5hsvRYb4jdtMpf1Bbr9LVW8iDROL1QZOtaTadIHuzDj7POwbIo3Ld8F0+wv8jiPdA7n9of+6Jh/abhp4AAAAAASUVORK5CYII=",uTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABjklEQVR42s3TwW3CMBQGYI/ACBmhN4xUogxSUCYoOfYGG4AEKcewyQsTMIKPQC8ZwX0/alD01MSmiSue9AQx8f/FsVFPXSmdk1l5oVl5rfjT3r7TOR0cQijCgbS06Q2nZEbz43WJ1UjABQeA3DAyeAuirv2JBDRQX4sGDOjrBYMDAW4Yyw8Iya4U1Dc6H/4BI3YSVVcIeI7zIPewLgnP8ap7QJyxwolXXZUfx4tdOa7yUhcftE7wnwL8KMRzo/1RL/NycspJp0oWBhkx3FZ0sScdueDbb3TJaggPLXLMHW6BWmEGSB6EgpKRgNraqC1NNm4QPakQClj9lIScTXqlUAjZkT5g0Kc/S03YH0C+98NQoh6CfaEt6UQ6DjggZLNpahexsYtpYbMkErA3hLmcVXCOQWYXZEXfYYR5QzKnCfMFyRvaYITWMA5MAxrxA6/dOfGJV/e6qQd84fubAfQeL3m88pqfTQ/1xAgX/nB8ElvggogXJg+RP9wX+hXG3gaHZGES4ECQGw4LueHqL9A3pBTYzX9vLMsAAAAASUVORK5CYII=",cTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABsUlEQVR42tWV303DMBCHPUJG6Ai8NZVolUFolAloNmg3CBKkfQyb2JmgI9wLogkvGcHcAZYLtnR1pQNx0k9t2st9X5x/6l/WWp+qtRk0xn5F02+i0EpDVvbjFmHgwUGARITA4+RBbKDs3zaVPs1kwXwA9++SRKh53Q8NA04OJ0Lgwl1YcvEiPFg++kOEWWrpTKrSLzd/tQJ3uPrKFW1gnn8ZHL8LZETGLgYWFSnNOOGM3cXPgYPOZ/t+0bRmcWx1XnmR14fSDJAOhqzTRXbo8+2TmU+tyTtiRMH0J8b+CJyL0HOeRJLB4Vwv0mJT2BAXcTt9iozH72/DoWbAQfb9vFE0nBXwARoeW8YomA8oKjq6VBFMR/tR6LpJAVPvo853JK1cBSICCcG+GBE5sKSIv4suLVsXmb1fbe1mdaRP3J4xIizYz1xOmM7N9BU22bNAioh7gDEzKV4EmzaxJk5kb3Ltzi99x3NcMOAg1KdwuYFtjNvzq8gHFA2z9e3uOpFljalsvWoSwRMxSVq5CkQkEoLjRUflRKTBQiI8WFoE6PpgwCIiQD1KsrzIUjswbutrwe9FgoCoBGPNywAAAABJRU5ErkJggg==",dTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAhklEQVR42s2S0Q1CIQxFGaUj8EM4dZnnCG4AG8gGuFlHYASMicbEwqfR89fm3pu2afgLEL3mwcToyF52YFTkYaBiHJs0LMV3nSK2TKVTPzpVW/B4P6IjeJjLnicPn4gFjzY3Y6Fvtj75rVdwxijPOxbsZVyn3jBmHtqQFJ10x7ekevn5t94BaZcz6PRuPUoAAAAASUVORK5CYII=",fTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAqklEQVR42t3UsQ2DMBCFYUZgBI/gBvk3lTchG4QNuE3MBhnFI9wIjOAIUSXyQREpBa+yzvpc3JPc3TepZ0Gp1FjIuEvAhCKk/Tx41rjF+RSEJ/r5Lg5lMgEubAf4Rqm3SCY354IYJJbRN0lCDULtrm9+J0pqzUcfikUEsdZi9644Y/VWeDSrlO4scQ4b+Vg2iWUH6OhPEY41FioVRfbeB28gO/9F8XXH/+ENDulCjmLa46QAAAAASUVORK5CYII=",hTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAw0lEQVR42u2UwQ0DIQwEUwIlpAQ+Eet7uRRKSAe5DqADriNKcAmUQBSR1+kwKFE+0e3Tq9Fa8sLl1NcCU4CgolJGwnUaZEPBFawNuVl4iAts5tCMjc1uFilP4BQoHs2xuTBAcYUcJ7BxBazDCb7rrRRVmPJita305Kq7P4SlX4jFuqzCFLH2PHikUS1L71Rtq1F2Usozrue+yWyQUMFz7Y4Q+MW+r/twhSIY0ia6GrJRRkWFvMD2vhRc1x/gdD8/6o/1BPEZTa/n1H7vAAAAAElFTkSuQmCC",pTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAA50lEQVR42u2VQQ3DMAxFA6EQCiGXyd89BUIhBEIZbAw6BoOQMSiEQDCEQMhU+TBpqppUkbpL3y1K9CzbsmMu/oLraOIAQUaGcIA3x+GREhZ49OvpZuEpQA6qeIbAmR/QQ3A3teDO0XXbiXKkuU7iISrZFkF4rNEI+t17x8l1JYnndzHQwpPZRxvbHIrjYIuaHlJ6kk0FyCdoin1SBkvxnBLThMW0h3IdJbimPik8Foahds752TyaCh5bHYOD4AUZbL3I68YbrNYDHgslHtcVpqIDKgocdYlSoEkT/YoauET1Ig7Xj34iH6cYY1qNKwMUAAAAAElFTkSuQmCC",mTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAA+UlEQVR42u2WwW2EMBBFU4JLoAQukZ85TSkuwR1AR04HLmFLcAmUMDkEaaV4tfkiinJYxjcY3vyZgS/ernjlsBBLqnQcp9PITL+AscYdH856Csf0peuu6n0mx3ponc7hOvbozgkkHU83C49HkW443YKOW58/YIGOs+ntOv68JQxPu6iRjKePH7ManooGbDhZKysvZJmlwXQN6Lia90/APu54jGWWW05VXQpNAsaC07SyqmXtOCa9/Fqw6Z+eqFExBwGkmBRGHz1RR3qq5GU+rmTaARvKybP8fuLOZuGczd5VHU3GGosF2bn1uJB/g0xFSNWRqVy/ba8Xn6dCyRnIlnVOAAAAAElFTkSuQmCC",gTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAkElEQVR42mMYTsDivsV/PPD+YHGmg0WDeYGFAnGKFSzPW+y3aLBYAPRdPT5P34fzGxBaLQsImG8ZYLEfwbMysHxPQAPQKQ2o9hPwiXmB5QQU/nsHARxKEY5AKLFIsNhP2NMNwFBSgCg3f28WwEAYWBZY3Dd/b/7eYj/QhvtWBkTGBsRhpgaW5wc+ed9nGLYAADQwTxdfB+DfAAAAAElFTkSuQmCC",bTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAl0lEQVR42mMYBWQDi/sW/4mA90dGaDgIWDhYOJATjAoW+83fW+y3PA8M0HriQvs+XOt9ywKEMRbzSYu+BGQ+0P4EYrU6WOzHFCFWc4NFA4bYf6I1W07A1EyBs83PEx/a9y0DMAKQWGBqgBpVQGMVSEwkFvdBicT8PSgAgWwFUlOZg6mBgwCITUg74TjYQIeS5P5oCTtYAAC7JmXu542gFAAAAABJRU5ErkJggg==",yTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAv0lEQVR42u3UOw3DMBCA4YNgCEbR/N4OQiGESc2gZZAwOQiGYAiBkFZpOkRJpdrKUsmf5cXT+V7SNCsyc8HJLWNb9Fg3Mb+u0UsdPIah6kTUhSsWEl7KhUSUDSL2e/nz51MhyU7FB7HL9eBVMSnTTepkR12YpAzzt/fiiPBHlSyPaCQe9tUgZdCwyxKejC8p/4K4bUB1IXV3qUEk0+OXWG7LmGR1tWMyrrM2oO8o1ckZwgOTczDS/83yb2u+qfIEGIZ7p7X9JJEAAAAASUVORK5CYII=",ATe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA80lEQVR42u2VwRGCMBBFUwIlUEIumh9OKcESKIEOpAPpIHSAHVgCJaSElLCO4x5QcmEj4zjm58aSN5u/u4kqKvo9IYAEK+wCLeXIERw8Ox/shDYfWOO2LhLqPGQAmYj+iTlotI8vNjZ6e0txw5gJZGdXve0Y+Q8JFC59VFchgI4nJRE8yHapiOlA9iqC2hmU9g61eKZAIEHsG9AAgktFGg0ys8zTAWSHZOQCgt/WUmFRDmp0eiTgBFDOlTt1hfRKLp5832gGnk0ELfMUO/u6TOT8M2+q0c58P3k4NiCNlWtfbK/Up7E9atkTHYTDWN73on/RHWseH0rdX8tlAAAAAElFTkSuQmCC",_Te="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABCklEQVR42u2WwQ3CMAxFM0JHyAi9oP5w8giMkBHYoN2AEWCTjNARMkJGMKqlStBSQDi9IL9cKqfxjx3HijMMYw0yWDHy7gJ2RMa3UNOdkboC7goSenhXk3CaXC9G72qBXhwmRPgpFhBuYrn+epPz03wU27BYRZKuSw2BLO5XHFr5l5wORHAYN+YGSZMOJDDiVmWBQ3E6pkxT8y69yoIFgz/ERztGEEbwsXUK3u4RHizyGqRS0naFIel7UHkdA7wccVRftHAGh3JsX7q/am+yMHce+Dkq9BIXI4tNDwaIdBiR5g3JV0UJj9tDy04gsakl1g2ODi01i5PIbjdEwt5G//C6zkoBe0EbRm3uJPo1s3pgHBIAAAAASUVORK5CYII=",vTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuElEQVR42q1S2wnDMAzsCB2ho4TEgnxmg2aDdoN6E2cjj5DP5E+0/yHVgUEOqDWGCA4bxJ1edzk9eBiu7NyLiWZ5d0D+URC472//yV13FwKDZCHlnjaZ6GEQTHyk0IGM1qzK27oCZicYNa8erEopfnXiVcC5WCuAJecCe60AUBTYlgUoC+jNK0AU8w68JstXAN5EQQWaBu7jihFYXaljjBUj2G5Eomjlth0t7tGVRFPujbRkr+47Mb7WHqpqxDex2wAAAABJRU5ErkJggg==",STe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA80lEQVR42r2Uuw2DQAyGMwIjZBSkw4jyeho62pMYINQ0YQOyCSNkDOgcEqVE5IxAvGSOCISlX4DwffLj7MtphlJa6DgKhcj0M2/luncECNDzrv/BHOemhVoNIySfbVEBPOcATuRLZ1ggAzNC2TS5Q3VZtnpJyYHjCYyKzNWs8v2mM3rngDhJnTpHP3YASWoACpHuBVZCZOP65QdEmG8CUiPqoiDR90YgwMPgbBZAOo5QrTl/k4RkAgYD0LYt7tp8oqjp7R2GHBAX802X01DDtabE3LQcMnrz1A9ZDsv0zesrNnGW8w0QaKX9gu2WraKoTtv0P1tulH4sQuivAAAAAElFTkSuQmCC",CTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAA+klEQVR4Ac2VQcqDMBCF/yP8R/EIQZN99hGaG1TwAM1VPFmXukttF11J+iIIQuxEMW0d+GDA5r1kJp38HSKsEBnQlnPj8TnI9olK+Q+xC7DALSLEFZz9b7eJc8784lCUMMKadeJFcSLESO5YG905cDthb2tOlaUvSzd03chNSrJciz3Bx4ra2aOu3RTIY6cwoQGcExrY8J7jQzoDAM25gf6AgZ7X36Q2AGaTgb85Q9uO9EptMJiVKCnQJJq8n2AYBkON+KMhj86mSXd1H55N46ZAHjtBFRowRo8KpYgmE6PiW8MuzY3Kc/3TByfsCZoVMbLA+Jof5dFPHy+sG7A1fUBUUgAAAABJRU5ErkJggg==",wTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABJUlEQVR42s2VQQrCMBBFPYJH6BE8QhYd6LL7uugN7Dl6iepJegSP0KVuJHYhrkrMFAZEB/ttGnTgQ6Akjz/N5K/+vqwxiU1TM4poszwgz9f+8Mqr9bJeTlHr4WU4jGgnEEhEHYPnuSJqIIgObviMb2BH2RwAPUJQzBnudApWTh3Sb7duOJ9HXfMcAVefgN3UAbe6dlK8BoBWWou7w4G4S56liMBWA7qIQPvazk1koOMn8dmdiQ1kxg+BWZagG3n2htNpVF8UMPAtWeSRjiVgLCAFjUU1fsSfNl6j7Sy1JF8jbb0fDk6K10hGCmOOS74oX12ayUC+EO2X+ne9Gk96axcNYAwa4JT3AjA9kCUjQVktiuaBZU51SMsg3BVekiyGJQnw1/UACcPy88Smyt8AAAAASUVORK5CYII=",OTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAS1BMVEUAAADvSEjvRETvRkbvQ0PyQ0PvQ0PvRUXvQkLvRkbvRUXvQ0PvRETvRUXvRETvRUXvRET////+9PT+8/P96Oj95+f3oaH1iorvRETaY5dXAAAAEXRSTlMAIEBQUF9fYGCPkJC/z8/f73CfOZEAAAC6SURBVHjarZPbEsIgDEQtXmoRmsRe2P//UmeqA6GR0Yee191hwxJOh+KGyACHwX2Ve0KGeiN3ERXU1fqNsYPPWj8Dlqs6nwELlxRCJiVkYp5f6SLK0dsDVpEVGfr0g5YB78YebYPfDMEa6jG5beDNgLYBxaCvqcgRuigTMaJJqK9p8aao9Jx1hjNVzyITMmQfaxJZzGPpMdMylQj6Z2FKiKVayotd2vtu7QkVsfv9cSzOBwZ49O7QH/0Cd+M3hMdc2SgAAAAASUVORK5CYII=",TTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mP4H////X90cP9/PAOQwAbeM/zHAYacxHus4vcZ/idg8fv7/wkAPF4bstRgMMEAAAAASUVORK5CYII=",RTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAALklEQVR42mP4H////X/s4P7/eAYggRu8Z/iPF4xKkyf9Ho/sfYb/CTgj5f3/BAA/6r0QPE487wAAAABJRU5ErkJggg==",ETe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAALklEQVR42u3KMREAQAgDwTgF55EQCfcOoP9h6xVFmJgSZhPB7tL3KWwsGjMJ/QCYI4JZCBHS1gAAAABJRU5ErkJggg==",MTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAL0lEQVR42u3KMREAQAgDwTgF55EQCfcSoP0Ztl5RhJkpYXYi1q5e/auGHYvGzEI/H9prfp6fQCQAAAAASUVORK5CYII=",PTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42u3UMQEAQAjDwDoF50iohLyF78ZA9lsjCvPbUGJIsgg7cODAcmCSRnTwDdMP02R4fwy6rnsAAAAASUVORK5CYII=",ITe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/0lEQVR4AWOgOghouC/g1f68HojvA/F/MG57dt67/fn8gPbnCng1e7c9j/fuePEeqhETA+U8254VYNXs0/EiH6KQMAZZhKIZ5DSYzfhwztzXcJeAvIpwesfz+YQ0Lz38+T8I5EIMAeEGJAOencenuXzpW7Dm9ae/IovfhxuArHjW7o8g2+D8xGmv/r/88Of/CyAO7X+JYjBWA2YCDQACkCEgDTDNIINA8jgM6IDEOQwvgfr37svfIArkBWxReh7ZBQ1gQUxDQDSusJmPkvrg0YgZbRgYpNYDPVUCJRKITUg4U6M3UAJfgoLKJeDNDyCnebY/X4CcNqCB3ABOfdQGAJMR1l/SzUs5AAAAAElFTkSuQmCC",jTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABGElEQVR42r2UMQ6CQBBFPYpH8AiWIprQeAAvw6KFdhY2WOgN7CwoTLSktqJjgUaMhY0J7jdZwrowIjFM8kNYmJeZ2f3baS1GjPdNxt0h44FQ9pYd+lgz7NCqDbIY74okT0IIBfiXhA3nSc90oisBUSX+RU5lZQSMhJZWKmfVRBiRAhuLIf8CWB9ukLKGTcyBpsPdurDFPs0Q2+P985tbAIZ+Hdh0lWRx+swiobJdz4FliefLA8/iuoTJdU2VwMky1pJ3okUEWsY7DXR4QLQHmJwbdXz8HGgwvqFmhpBzI+QqvqU24qTNU5cxi1V/S/82VKA5ZdDQeshB7l8uB5O4HJRK0cJ3GPe0yqiAv7H7RRfheMGm0retxAvIf++k416vtQAAAABJRU5ErkJggg==",DTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAdVBMVEUAAABQgN9Qh+dIh+dKh+dLiehJhuZKh+dKh+dKiehMiOZKiOhKh+ZLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvR4fnH2ffG2fe70vavy/Wlw/Okw/Oau/GOtPCCre93pe1snethlupVj+lKh+d4loSdAAAAE3RSTlMAECAgYHBwf4Cvr6+wv7/f3+/vGLhWpgAAALFJREFUeNqFktkOgyAUBUGw2k2xdK+tXez5/0/sRcINShrn8UwyEIKYQ+ZrA5hKZ+O5aBAooj0ziDDZZE8N72ykcBRIKIcQRnQdgJ0koRHztg8QCxIVIvrDEY4NiRqOjxc32/vjSfjd3kE8KeQJAq3tOOTgFC725UOcWmHge9q3HMKWRM4XsmcENAnZBHPtWShBlH+eRMj0EYVHTYxRIjbpPj6nKaWIUXpbA/Uyl3Pf5getMTOwg0TeVAAAAABJRU5ErkJggg==",NTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAb1BMVEUAAABQgN9Qh+dIh+dMiOhLiehLhuZJhuZKh+dKh+dLiOdLh+dKh+dJh+dLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvH2fe70vawy/Wlw/Okw/Oau/GOtPCCre9snethlupVj+lKh+ell/5vAAAAFHRSTlMAECAgb3BwcH+An5+foL+/39/v7x2mWn4AAADGSURBVHjardLZDoMgEIVhlNpKF2nHqXZf7Hn/Z2wcCCK2d343JP6OIYKaQVbaA0C2yFUqtwg2SV4QIvUqbiUSZTSHiTCbEybq3Mc1frB+EGOfpu2XTGKBsTNLNBItRm7cdsN3CbEH8xu9g0SIpv30S8d8hxNHPvWtkTbEPeAeX9wrXh1vqDvy7SqbcSqJBs6bmY9d8gMzeE/mFwKthA31iWCrHE2YIK285b8jEwYJoyJLQoRkbqB3CCqtUrqoCNhXJpvhnn8BjaE647WzEYIAAAAASUVORK5CYII=",LTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAVFBMVEUAAABQh+dIh+dMh+dNhuZJhuZLhudKh+dLiOZKh+ZLiOdLh+dLiOZKiOhKhuZKh+dLiOhKiOj////p8Pzo8Py70valw/Okw/OCre9hlupVj+lKh+fHgVaqAAAAEnRSTlMAICBAUFBfYI+Qv7/Pz8/f7++YjQRgAAAA0ElEQVR42q3TSw6DMAwEUJeUUvohJtAPnfvfs9Ko4CQNEgveisXIHgtFduXOnQJ6PTspaTwWvpHcoUPCHyRxUmT6WiI1Ck7RfEVBb1s8irqlP1Y0qwM+w8hThBz+PAIDcAy0yD3DOPGjZeCKzDuEN+jOgCI1DeEFUM8AQMM4/QqGB2ZJgItZ8JMGFDQxYQVtxQ1RggUXl+RMJqygneni/iy4cEI+SrDgzG/8WVbT2ACqFAVaCa0uqSVyVGS0kUTlkeiq7Q/HuPaigN5at+uL/gLpuz1zBDpoxgAAAABJRU5ErkJggg==",FTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAYAAAAiYZ4HAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACeSURBVHgBlU/BDcIwDLQjBskYyY8R6AhM0lEYAbEB/PKjG9BNzFlKq6hy3PY+duxz7o6oIqX0ow7aXWjmkfqI1sEhXLwlrESUh/Y556+IDK4CMz9RPqUUBvm1HC+/iaEg2/dehjdIYyWPUJn2Du6wdatKV/QDN8F0MGkweJ63VjSH9sENZsEK5nGCFYwcBCsYHYFlpWfpFNqD2eGtuz+KS0lVhtaShQAAAABJRU5ErkJggg==",xTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAUCAQAAAD4zq+ZAAAAX0lEQVR42rWSwQnAMAhFO0q26M90yWaO4AgZxXoMvBSk0Bzil3cQH17Fp7Vn4kA+YTWZorvaESeY2U0ZMCuxaeQ/bn+Z3V0hw2zknzFUEFOFoqYEKoCh4tNia8/FG3oA9u9BP/x2bmMAAAAASUVORK5CYII=",BTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAYCAQAAABdXGW6AAAAfklEQVR42sWTsQ3AIAwEGYkmypuKUbxB2NQjeBRHgnQfSymi5CsEJz2ccFmBFwrtIm6h+AzaDzhCDJpCUDh6KVuFy0ggsVavkw5PIAStGZplM63ultUNeKurDJq+DiqGmNd+TSZrY4i1EZRryw3lSlkbQ6yNIdZG0B/f99FInZ+KXTsZ1UQcAAAAAElFTkSuQmCC",kTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAQAAAAkETzVAAAAmElEQVR42tWUwQ2FIBBELYEStguHG51+O+B3QCmWYAmrC4mXMRM9eHBJODAvSzYvMI3CinWiukzgcKLO5AsoDC2SXGEShc0bfKy8wQSaKxxLSTAscDSBxtnoVVL0FWhcX1JPLXKB9pF+sJKO3fP/5lgzjcVw7WiDvWBLOmGUnQiUnTCqnTDKTgTKThhVThhlJ998hpw8+Ih2l2bD55BOCFYAAAAASUVORK5CYII=",UTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAQAAACiV3CzAAAAq0lEQVR42u2U0Q3CMAxEO4K34fLnUbIB3aDZLKN0hI5gREUj4JCvfEPyE+vyJMtP8nQcrFgnOkmGQIwiyX4CgKPfM3TUEwAWxNNdBIC6f2tubmXe354DHVHmUTUEeg4Ewu2o3BBlS4HL9g4gZEtoA7/qlhyBKLOb22NeVY21vYy1nRFXhzjPbLJUYZMAYZMBYZMBYZMBYZMBZZMBbZMBbZMBtvnfSx+yr9f9DT317s3RCEojAAAAAElFTkSuQmCC",qTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAAL0lEQVR42mMgE7za/16BgeG9wqv9UIGXDa/uv3Z4df95ApADF/oP5iLAfQEc5gEAJtUSZrejPioAAAAASUVORK5CYII=",JTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAM0lEQVR42mOgCngvAKdh4JXBq/evDIBCCq/uA2m4cMLL+68SXr9/ngDhI1Tff+1AFbcAAIjsFYm2dIGHAAAAAElFTkSuQmCC",VTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mMYBODV+VcGENZ7g1fnkSUMXt4HSoGEwTS6VAJMGE0KJEwDdwIASDIYtjjyldMAAAAASUVORK5CYII=",HTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAQUlEQVR42mMYpOC9wqv+9wLYeQwvF7z6/+o8UAAidf/V/zcBcMnnQAGINETq5QKQKIY0QgqLNEIKU/r8ywU09z0AFEs5EhPPEBAAAAAASUVORK5CYII=",GTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQ0lEQVR42mMYXuBV/qt8DD6KwPtX/1/Xw3iv61/9f3UfVYEBRAlM+vX7VwZAJjYlaNKYShDSOJSApXGD5wqvDOgcgABhSDqIzXGrGAAAAABJRU5ErkJggg==",zTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAKElEQVR42mOgAXh1/pUBdgmDl/fJkEp4dR+L8HuDV2AdhIURrqLMXwBPfxi2n7+e4QAAAABJRU5ErkJggg==",KTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAO0lEQVR42mMYHODV/hcFeKSfK7y6/7qeEgXvBV6dfzUfr/TLBbgkgYa/bMAlafDqPh63vzr/PIGuIQkAv6gfeXrCls8AAAAASUVORK5CYII=",QTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAAPUlEQVR42mMYFuBVwsv17wUIK5vw6vx7BYLKXja8uk+EshcFr+6/MiDKNAJK3huATBpgJYhQMnhlMAjiFABTzyYOQ14HUQAAAABJRU5ErkJggg==",$Te="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAVklEQVR42mMYEeC9wsuG9wpEKX3Z8Or/q/tEKX6u8Oo+0YrfC7zaD1T8/rUDUc54NQGo+P+LAqLdDIQJRCh9XQ9RSqTClw0DoPBVAlwhYaUghUM/gQIAnrxLl782xCgAAAAASUVORK5CYII=",WTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAe0lEQVR42mMYBeSA9wovG94rkKDhZcOr/6/uk6DlucKr80At718GkGDLqwlALf9f15PkMLCWfhK0vAl49R6o6TwJvnntALLlZQPRwfvqPsiG5wrEKTd4DXbQfQHivBwAUv5yAbGBGg9y+4sJxCpPgHmVaA0g5aN5CgUAAKaOVEis65zCAAAAAElFTkSuQmCC",YTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAQAAACxtDVnAAAARElEQVR42r2LsQ0AIAzDckpO7Wec0lPMFLogseGtdqqAWSyscHQD0PimJ43OR9JoA8wlKhuAMyxhCksJigkJ4XdoWm82zgd3SwpxHbYAAAAASUVORK5CYII=",XTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAQAAACoAz4qAAAAW0lEQVR42t3LQQ3AMAwEQUMIBEMppEIpg0IJhEIwlKssa6XKyqPv7CvyXOybXFNTbtQwlIXGGunRWCC/GXR0Zc6goVkqF83iC4QZ6MznobsQrgFXglt7cCjsfy/4pJHeGBKbFQAAAABJRU5ErkJggg==",ZTe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAQAAAAOAB1aAAAAUklEQVR42u3LsQ2AUAhFUUZh/yUchVGOlSGYryY2Nt7ukUOckzabjLukAiUfUcNrVKAarlFCrwsUAeOyQgdbwDlhvjc7ULOGFbPJup99wErFu3ZCkbYJrFeQSQAAAABJRU5ErkJggg==",eRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAQAAABO1swWAAAAaUlEQVR42u3RuxGAMAwDUI2WERjBI7BBvCmjiAqZXHSXVFSoyMd+58ZwYWPDTthJkn0TCq+gwR567OGlU9jDZOoWthBg6iVs4ZtOmFFwpAOOogk4qn88cwOw1PThaeWnX9JDi1yHwXOu3itNGcbz+v9BAAAAAElFTkSuQmCC",tRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAQAAADR77dlAAAAcElEQVR42u3SsRGAIBBE0SvJEuwEO7MES6KEK2ENlAH/3MyRGehGwPyXYdG0atehxeamorYynYNkOUiWZ4R5TpjnhPmGEwlzM90zA4nzEYREdcyfAMSvB+85AUht1yrvOQAajID7wdeBt6+WjV/tlZ0UIJnOEshoEAAAAABJRU5ErkJggg==",nRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAiUlEQVR42t3TMRHDMAyF4UAwBEMJhEIIBEEQg5ZBoAiCIWi1nnonCs2iqUPkNb8n3313WqTt2X1feF/vKOHoGBAnJwg0+j1X4/wZYxR5BvG9wKNNyhnGBY6RDB/jOr+C+r7CT5xrfGjb/sMxqcizRZ5kiUdDFHmGiF7i2SSoMQSirbzUxk7PPtwfpfKM+z4xWY8AAAAASUVORK5CYII=",rRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAw0lEQVR42u3UwQ2DMAyF4Y7ACBmBERiBEbJB2aDZADagm2SEjOBj4hekrFBxwVKrBqzSG//Nkb5DrCi3q5MrDSw7drlTU9xzgWeXJgRQMQqaH6C4AVgmtEfpiLBSaelBhyhmBGo+Tn3u9pfk+blNRu6KKQ17NKRJKEjAuvcaNSB2b9MW/NKrqcxVmoYahf1G21yirdHKfRFyV6M7e67RaP9FpR/o0sMrqQSLWU/lcZZilFRiB8KIUaiqaNjlgZrrEz65F5/8tPgThvqaAAAAAElFTkSuQmCC",oRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA3klEQVR42u3VwQ2DIBTG8Y7gCI7ACIzgBnWDsgFs0G5QN3AERnAEjsr3TFih8dC8WpIq0JPxf8PDTwLxeTk7cqFC6403JIsQ0nDULxAsHNpMBoPvXPVejzUc6TzGxM8mlcbUcMxwJBGKGA6WZDbzech4TCqXefqOV8sNFjAc9XOzi5lUxKyCG+sdzNj+ZkjjucUIClsMbryfEua6g4Ejmc1wEBDlTPyN2f8wQwHD0T1mKECkj46wfrdv0hgeEvb7NplJ3FEpw9NGFzI8l2G9oZ7PJru58YaUq85f8XF7AYq41A6c7tN/AAAAAElFTkSuQmCC",iRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABGUlEQVR42u3WwY2DMBCFYZeQElwCJbgEOsh2kHRAOggdkA4ogRIowUfjN0guYVa+7LDxwSRziCLxc4LDJ+OREebo6KORoy6O8JgwxNboSycawf8uT05HWngwpaVf22DJ0RU+w+tZSWIO1myKt8ySU5H+ZJ5CD4ZXkmXwslYVWWzB8BrZUALHx5bEBXP6uycHxvwGaTZRBwbLwIKVXdWRPyYnK512n50aKfNf+l0kzmBwvNXIZGX6SlKiu4xJTcpTSsHWyctrJJoqSZ2aLKNxPwne+UUNllyFLJ/W+0LSqckyDDIyJSnRDEajJkuU3DO5XI0m9OA4FodCV7BIYAzk0NBdSGVrm9l8FS+uW218YMK89OSOX76jD/YLwCSjzIWTKu0AAAAASUVORK5CYII=",sRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA/0lEQVR42u3XwZGDMAyFYUpwCS6BElwCJVBCOoAStgPSwZbgEijBx+CnnVEJ2gnLRhNyy0iXjH9O+PCJizF0rVbr/Tigp8TBhaYJBXJcBQtHQ74OxHeYGCsy8TFkNOJp2sFM6bGS6nUfOJnxde5ObZd9ffDhdQRzMOc1ZMh2Mec1jBBkQ54Dh+d7CNiO74nPzwuBWPKyfb0OMOTr9cT3EKzmvIYFgsWN54gCoeTFB6wQLL58ucUP5zWwC6/9DJRceO2D+OjG6/anbxde34/KmPO3eIeceD2j3Hg9yB143XKQ/xGUlDeszpDjQ1GUNw0j8t+IOpfQeVVC+2Fptd7vF03+0vO+G3PwAAAAAElFTkSuQmCC",aRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAv0lEQVR4AWPACkbB/4tC94H4PHUMuyScADTsPxQXUGbYeQkFsOsQBr7/f15BgALXCfXDDUPgBrJdBzMk0NsEiI3hhoLkyAm7+TADLCwswBjGB8rtpyQi/rs6mcEMRODLIg4kJhOE5kAfuJeR8X1iDctHj4iyDJ3/WXH6cD5yMiIhmSDw7BbV/7Nb1eB89GREMCJIwpdE+gklEwTGTDbY8XlRA0wDLwiuJ8tARDLCTCZkYkQyQniXcgNBZjAMCQAAySKxJKUJDoEAAAAASUVORK5CYII=",lRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABC0lEQVR4AWOgGRgF/y8JB/y/KPT+/2WheppZArTgPhD/B+Pzoga0sKAeZDgcXxLeT10LzksogIIJagECXxZxoGZczAcbionPU9MX//HgAmrExXmYgVtmKP63sLD4v6JPGW4JOBjPKwhQEkwJyK5uKtQCWQKi0X3TQHGSheH+anWwJf1V6uiWvAcFKwVJFoFnt6iCLAHT6HJAX6+nKMmix8nBhXJgPrYkTXGSvblFEmzJ2dUycDH0DEpxkv18XOR/oLfJ/09AGpcaUGIhOslSgO/DkzThJIuJn+0TB0U6iCZkUQPRSZaU1IXAiAyKM8lS6hNE3Ij0o0W2gAAsyVITQ3xDOMIpTwCkglEAABosqY4+fsNPAAAAAElFTkSuQmCC",uRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAABE0lEQVR4AWMYVGAUjIL/5yUU/l8Uug/CIDb9LL4kPB9o6X8QBrL309O3/1HwZREH2lt8QXA9usWgIKd1ECfALcPEDTSzGOQzPBa//39eQYAWltbDLHm2T/x/oLcJEBv//3RcBGH5JZF+miaos6tl/ltYWIDxwYVytEpoiOwDwze3SMItvrlVCiqOyF5U8q2AAXp8fj4uArMYFtQYvqZZgnJ1MvvvAsQ4Etp9UEKjSfaJCzUEYypnL0R5jMvgsgwdINb9T+XshUhQuPDsFtX/s1vV/uNTAzKDrOxDGUYkNJLLY8owInuRn6AwMazkItbyBJKzD+UWI7IXwfKYRrgBn8X/aYjf47N4Au0sFp7AMKLAKAAADGVMb+YtB7MAAAAASUVORK5CYII=",cRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAMAAAApB0NrAAAAbFBMVEUAAAD/zyD/zxj/0xT/0hP/0RL/0RL/0RL/0RL/zxL/0hT/0hP/0BH/0hP/0RL/0RL/0RL/0RLzxxTyxxTmvhfmvRfZtBnNqxzBoR60mCG0lyCbhCWQeyiPeyeCcSp2aC1eVTFRTDRRSzQ4ODicBnJqAAAAEXRSTlMAECBAYG9wf4CAj5+vv8/f7/2ThQkAAACiSURBVHja5c+7EoJADEZhXFFQBPaAd8Vb3v8dHZYdCjPE2vFr0vxFTvIvMtbfJg6YJ7YCqO1JSi83NzU9PzMmCwLrbVcTOfPhTq5AaXVvRWRn9G+ARkRaoLK6n/IId2l03+Q+3Z8RdHIhyKe7T3Ik8E53M9jLgUGpu6Pm1RLo/gqt1N1aqrvjz2cA3Z/xuVH9zqPEftWtFeOGaeNmhaIe+jFvQxsaDFC9uPoAAAAASUVORK5CYII=",dRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAgVBMVEUAAAD/zyD/zxj/zxX/0xT/zxT/0hP/0hP/0RL/0RL/zxL/0RL/0RL/0hT/0hL/0hP/0hP/0RL/0RL/0RL/0RLmvhfmvRfZtRrZtBnNqxzBoR7AoR60mCG0mCC0lyCojiObhCWPeyeCcSp2aCxqXi9eVTFRSzRRSzNFQjZEQjY4ODhfPMFcAAAAFHRSTlMAECAwQEBQYG9wcH+Aj4+fv8/f7/5x3csAAADaSURBVHja7dLJEoIwEEVRiPNITJ7zPAH2/3+gCLSkKmC7tcqzfpu+1cFfoWtN55udMoANA9kImbG8U3ixShxGyGnxEpTawtCgNPu86+FtIKXBNk2WEBJNkbkT3ZCZSGl4CCWkufJQC5dciC6c6GOaM9EJOVO/66NwfA8xbkhT2BEdkGlKFKG0IVqjNKlLw1bOEC1vqMHmRAsw7aepxAmYn8iggQm9//f5iZRF5ZAmnMdLFMEREz3giNw0rpQoAWrvmcG1i9M9XLpKI+hJaRh/kf12OBSWdhj8hieb1jFTUa/J4wAAAABJRU5ErkJggg==",fRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVElEQVR42u2TwQkAMAgDO1L2X8IR+m4+XaHPgFCMf/OUOzCga9INg8izC8ZfwNlEwjUplRqXYuNShJtKieeqxxO0u7pYuLrYuBQbl9I6DYIxT9PNA4o8VtF3MgEsAAAAAElFTkSuQmCC",hRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAQklEQVR42mOgG3hv8MoAH5/hlcHL+0AhhDSEh6kEQxpTCUIahxIc0gi7X2JXgLAbYhFOaYRbcErjUAIyGp1Pt1gCAJlgRF5JwRrRAAAAAElFTkSuQmCC",pRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASUlEQVR42tXSsQ0AIAwDQUby/stQ44YVKF8CFNdJaV3xRUan27KKjbPWtC7G8tLIoJFBYYEGRtuqIW20lozWyKAlC9SyflunNzw6+VRa7YVjuAAAAABJRU5ErkJggg==",mRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUElEQVR42uXTsQkAIBQDUUfK/stYm8YVHOCQw1rLz70m4Pj87TQv99Gs2TAvriCSkzBXgtwJciOSc5klAMs0QriMEAwJIjmI5k6a5nb//F8epURkVhYEprEAAAAASUVORK5CYII=",gRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAAAZElEQVR42u3UoQ0AIBBD0Rvl9l+qkuQMI4AkPyGEChz1z3zR+Hu9UqlnbNazVDrBUYuSjQNsSUrWMuKCWozUYqRkBgVzqMGYBJkMptI1ZcmVyWIsbDHSa2ZQsA09QTJS/eN5vQkSV9KpeTEwdAAAAABJRU5ErkJggg==",bRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAb0lEQVR42u3UMQoAIQxEUY/i/S81pZDGI7hlCGH5MKWY/r9iBMe7Cy8U2nP83J6hEAEnkuj5AWDNSvR8dRwIyIGAnAnMmYCcCciZMPI6XW7h5QpZRE6Xc1p5fRErB4JyICg3iJ53goCad0Lv273wPk938O0H4XiSAAAAAElFTkSuQmCC",yRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42u3UoQ0AIAxEUUa6/ZfoCGjOsAICcYaE5Fs42eQlPdG2nzfjsk7zKdcda3TrQDO9c0TDEQ1HNDwUcEDTdXQLUmsvj2i6IxqOaDii4fgwLNd/G29mAaFvZs0tXJk5AAAAAElFTkSuQmCC",ARe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAZ0lEQVR42u3UoQ3AQAwEwZTk/ptwCcF/JC1ECln2irTkgZdaGnDA1zQdXjq1uz+V/gfVulMb5rtKCkZRMIqCEZRgoDQDBSMpybDNchDbsJVi2EozUJqB0gyUZqA0A6UeG1R63v90eC8Q1obFqrJdhAAAAABJRU5ErkJggg==",_Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAeUlEQVR42u3VsQkAIAxE0YyS/ZdKKaRxBK3lgyC5Rsgf4DU5iHVd92kZGdPt0vSMjFd05cmSXI/ocLIkh5sV2DJJVkKSlZBkSUpYkAoWpIIVkLw4liAgI6PMckQYWJ3EwDQk2DpJtkyWWZIi9iAv7CtKkmz04+26T9vQ9w9A6VN2wwAAAABJRU5ErkJggg==",vRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAjElEQVR42u3WsQnEQAwFUZWi/ptSaFCyJfiyWxwN7GBwoF/AvEwoZrPZ7Mvr6loZwVvZ1XUC3JuA/H0AXLkJzl8ZIQidZ4LzmsC8JzDvCcx7AvOegLwnIO8JyJutP7DyvXx1KYKPAhwQm8cD4vNA2DwQPs+EzzPh80z4vCeeeSZOgJ1noubRm81mX94P7VtLyANR15cAAAAASUVORK5CYII=",SRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAUklEQVR42uWTIQ4AIAwDecJ+DD+dpog9oUggiKWOhFVVnLgmK5/fqOCeURMAdFstDEyBs+uA54B2oKgPivpgmKTfGwjC5b0eBSJf6dZf6e3zv5y2JmwtYMj/BQAAAABJRU5ErkJggg==",CRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYklEQVR42u2UsQ3AMAgEMwobho1dGr2LH4E0aZBSoFBYln10L13BI3EdFgX3IDyOaVb2LjHpAqblr2ya3ApyGniheXiheXihPJDyWzZ9t2uls20qkxITSlo2hccZND0/bxYPPLmGdf0FY6cAAAAASUVORK5CYII=",wRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAa0lEQVR42u2VQQrAMAgE+xR/lvzcY2BT2CfYUyk0UBAUSnC87WEOsuJRFBmgTcKW0bN5RTpkTYeAXpE58k1E6hfFAAsqAyyoDDDn6vNFpMSIOvRe6ZeoDubHIlLWlOI64acM75kcvZ5SkcEFMgWf7L/2zCEAAAAASUVORK5CYII=",ORe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAgElEQVR42u3WsQ2FMAyEYY9ym+dtklFSRu8aj3B0UBiaYISQ/Lv/mlwRq6rq6Rzs1Ok1h63FRl1eX0VFTVhogqJuoHbah9DBkY7G3kcTdhvRhN1GNGG3EU2fGEU5stHjWUYaOvH/JaKxQj+GOizkuIN26vKaLXXsNl6fqN9HVe1tjOFMm55q0PwAAAAASUVORK5CYII=",TRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAj0lEQVR42u2WMQ7EIAwEeQo/PX4QfkiZY134CXtlilxIYVmRop0tkZiGxS5CiPdiH3Pwf8xti16/gevMViLAwb2WC/YKwmMCgnfnEjwsGBhxQZDnBantBsHUdoNgartBMPXp5gsc9JoomA3EkZHQbnTzQ6APUAIJzu0+4/FVZjZwnW8vMdBXA2c2LdxCvJcfTx6WVC9+9nMAAAAASUVORK5CYII=",RRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAWElEQVR42mMYzuDVfVI1/B/VQEUNr86/MkBoeG/w6jwhDQYv7wO1ADWAlYPZRGl59R+hnDgt/2HKidNCpGPuk5gQge4WwBR9L4AziF82vPqPDb5sGF5ZFwD111dtBCPJzwAAAABJRU5ErkJggg==",ERe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAYklEQVR42u3UsQ3AMAgEwIziERjNm3oEWudT/AhESoNSOArCJU+FXlchcVS2BprBVrjwfowBeWMKxl8sp0IcU/DsQQ4LU+cwp3FuTsM8RKGJHmRbt2yfd58dtp6Ls9drTuQGTkBukoVMYJoAAAAASUVORK5CYII=",MRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAcklEQVR42u3VuwnAMAwEUI/iETSSN/YIKkMuhUa4QBpjAibxpzE6dUI8VAgUPLsGOguiQw45tApChrwhE+S/kJwKqSETPL1uCqyZbgocYgoFFmaMYmGGqE4GOmcmgJNOFGYxNGPx20YJCrbqsiP5k94hN8Pjg5CCX8/rAAAAAElFTkSuQmCC",PRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAiElEQVR42u3Wuw3DMAxFUY3CzZNNPApLIbfRCC9lBMaAPzTshletcBpBBFtVPRSOX48KFVpooYUm5tKwNXQYjp9F9WMRmkidRLvNLEIz2a21NItQJNMsQoHMswhFMs8KBTLPpkkc/2cDGe5d9nsQeh4d1jYadgxd0M7zOvDan/cuculWC2F1Q1+W+iqEPfPrPQAAAABJRU5ErkJggg==",IRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAmklEQVR42u3XMQqAMBBEUY+So3oEb5hSHYs9wsoWukgQEpJFi5mUhv9AsHDiOK59yMixgEIJECBAgMDvAGRkSW+AJHveC+hNOOB57QTWdBEOPPPrhfcTDhT5cYQBRX4kYUCRH0kYEJB3wo7nA4iwvBOD8hYKuu8fVNf97wGBSvW7lgSFNAH7DG072zK1DcshtfFD9pm/Nhz3thNcllF41PC9PAAAAABJRU5ErkJggg==",jRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaklEQVR42u2OsQ2AMAwEM0pGyEgeJRvAhi4hn8IjGMkW1J8KCXFuvji/vnwda9isrug6+lA0Vg8VjXqxNg2SefRzZ9olmiMflR8jkQk9gEyj9cyv6ck0Wk/gtJ7AaT2BweH3MCj8OS0/S1y60XjnRuV7GgAAAABJRU5ErkJggg==",DRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAcUlEQVR42u3UsRHAIAwDwIzCCIyUURiBDSkTlMIjkHPBKSlFlXDIlYo/Q+Nt5WuxWJOFQYpy5loQh6gzRHKNelTu9AmQa5K2cp/3IwiUz2UXaOcyZZ+PMpfJlEEbocQ6JdYpsaH59L9jR3tNWdftl7kB3j6Y+KqwnCsAAAAASUVORK5CYII=",NRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAfUlEQVR42u3VsQ3AIAwEQI/ACIzgkdiQkSijmMIjkAJFL1FF/iaF390XJ5sGyWQ+xYs1rzyjNma/hynNmIqYgiIYEVAUA8pLiDl3mN1aaJv3HHRXDR4FCl2AAUUyoCgGXTI7LANokQwgkgFEMoBYBo+99kw3RXfMyK8n8+s8oO622gTIMwAAAAAASUVORK5CYII=",LRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAnklEQVR42u3WsQnDUAwE0IzyR/AI3jTZyCOoNNEvNIKSmMAVRyBwcmN0113x4P9Kt07nqvFlrqVgDN8837UYdaR5znAjViPd9rEPYkXygIjVSbC+qWR8SbDh6YtAHr3zPlfp4c8HWOzyX4LFLpJgK0mwKZO0Rz1plySRShJoehaSQGtJoDrJqE4yqpOMoiA/PNX+RY3J32ifLJ3OuXkBncyAAuBmORMAAAAASUVORK5CYII=",FRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAApElEQVR42u3WsQnFMAwE0D9CRtD+S3gUlYZLcSPow+eHSxNCSA5S6NwYFe/AqPCn0+ncywwuNpyBgUJhMDx8olauRCEZFh45Y/5vDAf/Q1Vh4VWB4eBVQdSMp3g9iOZEcXmGTyRUofkwbY7mls2x8PsKE68KC695883b+POYeAWFMvEqMPEqMPEqMPEqMPEq0Nl4bdjByQtresCfFPRnutPpvDVfvzHRDtqTrQ8AAAAASUVORK5CYII=",xRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAZElEQVR42u2TsQ2AMAwEf4SM4pGyCdnUdZ4iIxiBaMCKIVLK3Ld3cmUsRtk32rUMUGn3FD1omvCgyRkGAbwuYeB1IAy8/hF4HaD+CCgUxPSPM48GNjNoCS9aCoJaaH61rKcZ5QC7imUvE/b3DAAAAABJRU5ErkJggg==",BRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAc0lEQVR42u3UsQ3AIAwEQEZghIzgDcOGGcFlxFN4BEeiiJtAYtEEif/ydYUbh5VJU/Yi0FoONWDoXe7jA/S8CIGhXQw+tyYlNzYaghsbdWOjTmzU1s/YqMWBQQ7auWocg0ew/hZLbG0SX3BO0HZzWk9r0lxWhYtbNp9UyAAAAABJRU5ErkJggg==",kRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeElEQVR42u3VwQ2AIAyF4Y7AKGwoGzpCz9QDI9R40HeDmkpiQv/eSvKdSEpRNKNjE32G760wtnjpJsqJurV8sQbIwGQXBIbIBYFxQWBcEBgXBMYFgUGmf9Rl0HtIdjAOCP0bEv4K0rWhlmhQSwaoFtHx1BJHKZrRCQLDqH6QqDo7AAAAAElFTkSuQmCC",URe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoklEQVR42u3WsQ0DIQyFYY/ACGyWjJANMlJGyCguiR6FR3C6sxQ3Dqa5k3+XoE9CQgKqquoItylQ2PCxwtDfmc8YytA4CqVIsY3SwTtRIzmNenL0NOpJojTqyTTqyS2oJ4kgUGmLqCft5o6+gHrSwhu8fHxPWsuokVtRIxNooiw6X+CtqF2pQi+ECjQyU/55Tu5gaBT+PGhn3EbnVv+k6qx9AYfqioiJfroGAAAAAElFTkSuQmCC",qRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAi0lEQVR42u2WMQrAIBAE7yn5WfKTPPXKwFn4BNNcEbDYyEaQsHOd6AxiowkhxMrEXmq0x3iue7R+ymmjpAgHcmyUd4fqFs4GsN6pANZfGxXAejMqgPVUAOupANaTAaSnA0A/I9Drc9U/C6SeAV/7D4EJb4D2KqBAT9RoA+PjgSP8rb7U69BHTwixMjehJoDDoS1ZfQAAAABJRU5ErkJggg==",JRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAlklEQVR42t3SQQ3DMAwFUEMohEAIhEEohEIIgwXCIIxJIASCj4m/KxnCdugmZRe3t1V9uSSSFftLpisB4+UcpnPQm2RNFugIC6gokuUJ1rsXmr9vydutBdSeyLfOKMNnEUY+yZJ/+zc/SU/9QQOYTeRBHEuwoOyGloxqYStXW2fa1xNYTQ0FizAiHdECT58R6//Xm+my3tIEisWmhZRlAAAAAElFTkSuQmCC",VRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAApElEQVR42mMYBWSDV/df/ScC3h8ZofFe4LXDawdyNCq82v/6/av9r86/uv+6nrjQvg/Xev9FAYT9XAFoxHzSoi8BhX8eyicMXju82o9DhDB42fCyAcMt/4nW/GICpmZKnH2eiNCGib0MQA9A4kPb4CUwqhAx/ur/ewXidCJi9z4okbx+DwrAV/dB2kkyAOhXg/sCIDYh7YTjYAMdSpL7oyXsYAEASCuxsboove4AAAAASUVORK5CYII=",HRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAwUlEQVR42u3UwQ2DMAwF0D9CRsgojMAIbNJs0G4Am3gERvAR5RvJI9ALqoSgUhNxqZSXW06xv2M0zY7KreBo69gRB4o5N3MKB9TxSKFYpwHQsPYUzh5RjnNOOMiJ8nv8+ilqxklFgZS1x4l1FJShe8CJBzrKcPt6X4a+xMskHWXylNPlXI0oY925Sx6pSyyMH8jpOIAeONsTNXKicvAILNEe5hSqB9RYYp72vzZat78y4A58UXCPPHHAf6C2Nd9UeQOQkNdOJZ4y6QAAAABJRU5ErkJggg==",GRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA+UlEQVR42u2V0Q3CMAxEMwIjZISM0BEYgRHYADaADcIGsAEjdAR/prkgZQQjUX+0akGq20og8vIZ6XQ9+xpTKPweILDi0CqiZRxzSBW8JE/xip2ZS7a4D4eU7TxJAqccj+ElA4fdy3OGm75SJB9+BaOmjekRL7o9JcmSQcEO/G9A4MfWaIAHN3szQrMHNzfd1GvweHbBqjsFBn+6+yJRAqdq9MaBUetEz+DmPJr2CQw/baWoMw6Ge1OJSiEqXqWUfUnxqUWa7+Fa7+mQMrjrU51s/6Qs/ucQbLygboOBT1WwIJFdklVl49EsS7Dyl1U80aQsY3nfC//CE0HU3brcVJnTAAAAAElFTkSuQmCC",zRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABD0lEQVR42u2WUY3DMAyGDaEQAiEQAuEgFMIYdAwOwsYkEAohj738fjAEn85SNe3WVdOcvkz58lKlUX7bsS1Tp9N5BAXqWOVwgf5EnVeRgU/ILFAWZJ4kUEvqFwv0fvFEreDJrswYl0BUBk71ajuXdyu53P0fodB6/ieaIFD+biFQ7PoHEC1QiXyY/TNtUs8WJh/IUIzPMgsK8QoIVIa98C7BJ6DQff84HegBz1BEcrBrowSoyXuwTMk7GZbdPQiy7YMEq6DRXWg/JygEcfP6i7eSjbXzSFi94okFdtL2DPdL2JqRV4Psq53EEur11rKROf3ttZQwEDkhloGMmwQdhkn02egTpuviFOgTdKfTml+iqgQxu12OPAAAAABJRU5ErkJggg==",KRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGWSURBVHgB7VS7ccJAED0JiA0BzJBBBVYHtioAd4ArsDsQqsB2B7gCiwrAFWBXgDL9AkEgJfr5LbrAlk4SikzAm9m5m729/b47xq74b0hNBp7n3WdZNsN2Dplw9RdJr9fTB4OBWXdfrjrwfb8P5y/YfiDAMUkSdTQaSSTQPUI+oyjakA3ZsjYV0AW6DMffYRg+T6fTQ43dEts7VKOimgM7B5SVbduvAocKZFLUO46z4tU2gxy4rrsH+oLAO5ztBHf60Ps0r+JZaQYoWcOii9oSx/EDy/v/B9QatPMNc5o3BpAkSWE5S0qQZVlBr4V9TtN0hfMZawJKzUR6zqoNZmO0uVtJ0yI4Q3RkecNaQBTAtCxrwloC2QtbKwqwRpYL1h7nBcCQDchT3essgttqYJHeGGA4HG6xvIOupYfT7XZNsGVd1IO+GunH47FZPKv9KlDJFk71qi+A21EiShAEqujtCFlEDulvweOR4IBe74IP8QQiASirIfM9Mj9WOa+s4DfIGYa+RDW3LB8k4dSqTqdj8JZeccH4AX5f9o7yWO0LAAAAAElFTkSuQmCC",QRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAG4SURBVHgB7VbLbcJAEN214I4vSNxwBYEO3EnSQeiApIJABUkqSFJBSAdOBebG72BHAg587LwnrS/Iu+vFyiXyk9ACM/NmZzwfC9GgwX+DdFFOkqRzOp3u8zwPpZQDnB2cKc4I4qjdbk99359X4fKqKNHhZrN5gtM4yzL4ko/b7TbodruSJ3/DuX88Hj+pR31RFyDpr9freLlcTuI4NhIuFov+arV6oT7tRA2nHZKA7MHFjvrK+XWRM20geBZXAHYT2gtXFClm+jTEd/gkuqhUtrRybXGhUEY4Zr1eb14mP5/PMxzvqOK0TM7/UXDTw+EwEi7AbVmhoagB2pOnTGZqp0Gr1YqE4WIoojeDvVD2A+ECEOcmOVvLpmPiMUWcmtohCIJUWKDsU1fHESaVW5ouoOwjJ8eoyC+Mx1DUADhuwfHtZGTrQ8L0jG1zQBux6s9XpGus00E0U50Mc2AM+YduDhhRzGr049jFjvq0sy0VI5gqknBm2zZOsT5NKS5g3cdMFRb8EF9/uG95AU6k4tkrZyGj5L7GKJW73W5oS7HTGwijwNIfeZ53c/kGwi7Y7/eTKv3doMGf4hfzsWz2FxjyIQAAAABJRU5ErkJggg==",$Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHlSURBVHgB7ZbLccIwEIbXBu5wYYabqSB0gFMBSQXQQdIBSQekAuwKGCoIVBA6sG68hnEODAdezr+JOOSAZcnKJfib8Qis9fqXvNpdooKCghvDIQPiOK4ej8fe+XxuO47Twi1PTgl5hZVKZVKr1QRp4uoYs5D1et0/HA4fp9PJK5VKIcb7er3u8AWTR9d135Ik8WETsS39FRDjrVYrfskoiqKqyn4+n3vL5TLgZ/hZsslFzGKxeCZNIOrFuih2yI7JEF6IFKXcWSUcB3A2TLPBfA9XnPZC/tR5FvWN/FQJx0OaHc+rRLNYCMq3S3LlQ7IEfA1Ucag69l0c4zFZAr4mGPxUG0rHQ/ITChte+Ts+x0hlh9w0g6g7MoXjJ4sd56Wstio7rUx9jWaz+UmWUAkSqhOmg/QlyFQQCucMRbJFlpC+BJkKAlNUdZ8sgQPSwRCSqaByuRxglzo2Ur6sZT10BxMyFYR+hoM13O/3uZMjjnwfbclro9EQlAfenSyVHvODa3OyHkZkC1mrjBquzWbzxM/aPK2/RHFty9LbyO5ypCtGu6fmFgKBzjsVICbG+C3Qvs4uolEaWrjXxt8HzIe73W6gkziNmnx+MfppHz+79NPge3JKcO7CON1ut4HNDF5QUPBv+QI+a1B3e6jnTgAAAABJRU5ErkJggg==",WRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALPSURBVHgB7VfLjeJAEC0YwYULSHzEzUSwMxGsiWDJADaCYSLY2QiYiWAggmUiwESwZIBviI8EF5D473umkXzAdtt4T+Mntbox1eXn6qrqKpEECRIkSPAlkJI7sVwu8/v9voHldwwzlUrlz+dzXv09UmNYLpe7cgciEyXBw+HwjGXbRcwPNj6iWyqVfksERCIKkgasOMDSUI8skPgEYWu9Xtu1Wm01Ho/zuVzOwHMTz5uQebwSzmQy9UKhYEsIhCYKko+w5EBZkVb6CStZQfsWi0XjdDp15PJxK4w63GEkmkhLCNCSV5IYPVjvSYckUSwW+7DkE/fhJz9yQH3yPzCbzcYY5+l02vWSwX8NyHT8SHA/9VAffV00oG3R+Xz+Sy7HZm82m7aXHFyBx9vebrdvXjLZbJb7berb7XaeuiIRxZG11PzCYPER/VSz5SWAQFrRt7nG/Kxr1UDgiFrqqP5KjIC+gdLbCpLVtSiTuSBqexIjmNLc+v2gRRQKnRyYTqetIFlahwElGmDeVUszSFaLKBQ6RJFebD855kpMH/iwPzrH6dIX6KOh8iiDwO//h4cHS1QQ4eMM0dcXG1FHYVB08sUgOBRNhIn2UERxvxsSI1z6Aq9SXR91rISoNyVGsGBRy3iIQqHlCKfTPyReNNUc6C5aRBGdfbkcv4mr1JQYwAyhsomtU1RrEVVB8s415o97rzzuVyWfqGoqENrpCYUEiwwbg0Vzx0sObmK751tQ+w3qq1QqrxI3JpOJgUS+VPezp2Upd+s55bmP++FCSy+5Wwhd4eMl9Cu2IU6FjwB7YVEctI++TbfBku0JXSlUhR+pZ6IlcAu5e6YRXt7j3c1rkT6tutNrz8RsYSpZ+3g81qvVqi0hcFe7jOLjFUSaLsLeL4IVEUDvKLrfAurZ2/slBrAAgdXY038T1W2q4yUhC2OI/qofhWCCBAkSJIgH/wCcA5YCjfohpQAAAABJRU5ErkJggg==",YRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANoSURBVHgB7VhLbuJAEG07JJtkkUhRJHbmBENOMOYESU4wzgmSGwycIOQEISeAnAC4AXMCPCt+C1iAEOI3r0w5sqIRXW0bNvGTWi5Mt+vb1dWlVIYMGTJk+M6wVEoYj8eXy+XyHuRPjKJlWc52u70MmFjWBLQPsoPRPj09bVxdXU1UCkisAAR3IPgThPRCgYWoQZEKFPFVAsRWgCy+Wq1+Q+jnyOsWFPnAu9ZsNvMLhUJg5W63e3lxcVEEWcR/d3i6nwJYVjWXy1XieiSWAmz1JkiHX9XW63Uln8/7kvW9Xs+xbbsM4X/xKx/eKMXxhrECEL4I4etqJ7yP8XBzc9NRMUCKnJycNJN8yzaZzJYPhEcovCNMbuMKTyCPwfK38ERD7ZSoEw91CFDMD4fDLsZ2NBrVVcoYDAY1+jbxIF7SdWIP0IZV7OrpdPqom88Kv9CQCHR2dkbJwCcezCs9kFvZOluKW8kazK2Ga/r9flW4phiukYaSyAOI+9AiNWmmiQPaT7S3iF4sFs+SNdosxCfsmGikyoJUAVoHIcpEz+fzcngm6MCZqQtygg1eSHxiw50eu7WpjgTixTw93VxJCFFtozabzYc6Eug0j/Leh5zgY3T8K7jVKN/Dem9MthHbNYOlikoRJou6uVoP4GMOPVGviBWgbIKHx+MN54arDIDY95l0dHMlIRTkcJPNRNkEtc4DyBb9Do0gRYSX9vwwKiVMcH193YDgf9WBIVEgsIbJ8Z4UEV5ar2sVwCb26YmzwFFHAkqJcPP6urlaBZA+//DTVcdDqIA2cUg80Aom2vadOhL41kZo6+ZqFaALuNrFonuwWj0C5uFGeO+FVgFOaUGBFSnqDoZo4ShJ3aI0iiIuLIc9PqQOAra+xzwrkjUiBbgCfeWfdWlKpX5QwMS2tZbkqjcoGJEwXqVVr/ggQzyWFd+YwOhFugZKlOhQ081F6qTaySEeVH4rIYy6EtEuAjJFA9fAx6T1OlueDOJh+Aidksmlybitwnvgs60St59DSKNFE6ux9aWfQzBqE3J7hrKNx6+MLR8iUWsRQpRBPkVet/gy0qHyOwwvnuvgP/dra5E2rMmVMzUFQvynTahniuwEi79DmWrSJkFq7XVq4J6fn99DKBcC/tjXXkdHrxHX4hkyZMiQIUMU/wA9rQm9Lp6NEQAAAABJRU5ErkJggg==",XRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAHUlEQVR42mMY4eDV/Vf/0eD9UX+M+oNqbh8FZAEAw7xLaQ7uEpwAAAAASUVORK5CYII=",ZRe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAIklEQVR42mMYBUMUvLr/6j8WeH80ZEYDbTTYRoNpFFAPAABpElqxRvEQ7QAAAABJRU5ErkJggg==",eEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAJ0lEQVR42mMYBaOAFuDV/Vf/ccD7o6EzGnejYDTuRmNqNKZGwZAHAM75afleRk+rAAAAAElFTkSuQmCC",tEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAANklEQVR4Ae3UoQ0AIBRDQfZf8vsuAUh8FcldUl/1FgD8Kcnc7XLjKKAAUgUlqRpHC4AMvQDgAJAMCXsuG62CAAAAAElFTkSuQmCC",nEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAM0lEQVR42u3TsREAQAQAwe+/SbkmXgsSAbOrAAH3gKsy8jcmxhc4BXrQA3rQA/7e3wO7FDcxL7DbvMEfAAAAAElFTkSuQmCC",rEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAnElEQVR42u2TQQ0DMQwEAyEQDsJBCJQwuTC5MgmEQPCz8vhxEFKpr1ZJXKnfdn+2PNbKK4e/whXtoNLpNPLn8Q2hWpIYgiW9IdfmAoiW11oLcsX1eOYcelXLErBmaegl6hKgz45Ad4CZXw+oU0ttCWgZ/XKSndAQO972H0jwdN8QTkvPxBMVUWEPvsg0Op2qRSL7BPH1FUL78Z98ADZJalfAtE3zAAAAAElFTkSuQmCC",oEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAoElEQVR42u2UywnDMBAFXwlbgktwKSrBHdgdbgkqYY+xXgxbghMfEghRWBEdQsADOolBjH44+XM4Ua/O/T6UE9rxgZm6JRPAZEtUmg+tqq0LXliXRv2hvum5qRVVGtqPVlQ52iPZXVDFhR7JezDXsXJPc99uRzDXzpkzDTGXyg3jzP2ZE+vUklwAl5KozCUV4/j1q+L4WY/p15nPv+5X3ABsg4N940OAkgAAAABJRU5ErkJggg==",iEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA0ElEQVR42u2VwQ3DIAxFGYERGIERGIUNmg2STcgmGaEj+JjwffAIqZRDq4oWmSqteuBdkZ4+xjam0/kmYnnEwoKdBQuiuI80uLAgcSBrDFkOeQYhNmt4BMGbJ1YH4rEtTQStx0VK1TaoNeLumgJ4iFh9nmTekuc8aUULh0r1AhalqB5eLEQr2hXn5yT6dY3yVHs1JET1jEHgqz2mZRtA4l5pmuctT6VKPKjIqps3JA5ij4USkFi2AT5Ts2p1iI99lCc6mqKq0nO6Ctf+g3T+nBuGoJ4tdAkq7QAAAABJRU5ErkJggg==",sEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABFUlEQVR42u2WzW2EMBCFXYJLcAmU4FIoYTtgO1g6IB1QAiW4BB+N3xymhEliNjnsD9aAlFz8+cZDn57swcI0Go2XsKVLnhEhEMQ8oz8vHIghDyueELO791vQJ2e+QId+e0bDGWUg/5isl017UJk/on2Vki9ab3RggiC+z0vbqO0pkOTMDmBlV4wQTGaXfIWso0a61FugU24AGMK2NsMQsEYqEMVb/9iUQn1Py6wG5enna22SladfWjDb6kfcGaMdqtt+zzwbHcmB318aNECIkzNa0EMgmNg93bG3kvCW6LUMQcREnm3R+e3SJkb8Tg5pk6MZ8rSW5JI7qi2gW0eEe7+wjj/zW9Hq+ROtqaLXxvYj02j88gk61D7h0pPLFwAAAABJRU5ErkJggg==",aEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABNElEQVR42u1WwW3EIBC8EiiBElKKO4k7sDuIO3A6cAmUwhMza2lLmChGySNyDh+clOiO4bkjZndW7HJpaGh4DqiRAQ4eBEXhpFd7v8stHHhw5ruI4FUUFF2nrQv7hcFuXXzfJXTtL3WQAQRl8eZnJNgkIkNV9iD4e5ZxTPFi70XBOF7jrD0ILewFZhBz1sQFhCvKHwSDzfIMFFRzGMwWP59hYkpG3gg4cOvOMLeuyCQoiJczzGBB+NsFCFZx/17Ag8Getkj/X5PjCK7TuQdZNC7UgFA1VQ8yb1JcagZKvnmaK14GUDSTf2ZcUIZr4zw7JvKtPl6OamQB9+NTtLwKTSLxe2XGDm9pkcYRvloiLceD44L9jFZLJBHp4USTJXBx/NrSGYk6PKZEhlYt4ds3u6HhUfEBV5d0xwdwyS0AAAAASUVORK5CYII=",lEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJklEQVR42mMYBZSA9wav7pOo/JXBsFaOAK8MXoI1jGAtoxmEXAAAp98twX6fJ7MAAAAASUVORK5CYII=",uEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAALklEQVR42mMYBcMGvDd4dZ58rfdfGYxqHVRaEeCVwUuw5lHtQ077q/OjBdOQBwATzD2eNxLDjAAAAABJRU5ErkJggg==",cEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAANklEQVR42mMYBaOAnuC9wavz1DHm/iuDUWNGjaGrMQjwyuAl2KBRo0aNGrRGvTo/WuGMAloDAIMXTZpz3WOYAAAAAElFTkSuQmCC",dEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAR0lEQVR42u3WsQkAIAwF0T9K9l8qZSBNRtBSEASL2MjdAK8+EdFVZenp/eRIf0CGQUJ+TUqLbEerFw2DhYXdWKmfdVaF6NAELLyrhahhw6cAAAAASUVORK5CYII=",fEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAUUlEQVR42u3WMRHAMBADQUMQhOdP6kvPfApBSMoQsMbNLQBdqwUAIZaVnK/psZWcf6fD87uYZ575Y/75aMC5wC4SJEjcTCiaeGytpBb3E8BBH0aosZBAsIJvAAAAAElFTkSuQmCC",hEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAVUlEQVR42mMYBWDwuv7Vfwh8XU+Uhlf/7wuA6PcCr/4TqQHBIqT0PtAhmPA+XtMJiVCuAeI0BElYAyY58BoQfqBNKL0XgLGJSh4vG9Dj+WXDaHZkAADCV3PL+8oLtwAAAABJRU5ErkJggg==",pEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42mMYBQMPXte/+o+Ar+tJ0vzq/30BGPu9wKv/JGpG5tFD86v7r/7jgfdJsBVTdFBrhvkfQpKn+T+EHDmaEQE2ZOL5PTw7kpwtXzZgyxQvG0aLyIEFAAv/li1Dlap7AAAAAElFTkSuQmCC",mEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAY0lEQVR42u2VMQrAIAxFc4TcWG+a2e/gEX4Hl5Y4lDiUSt6HLOJDkCSSJEt6AZ/pRSKApnJjKCgR/LWfi2Dgi1jwNf7kABFs1n0RZ03R96L9788WAYeKIzBuWwXXaTXXYuK4AIRevGHyWEq0AAAAAElFTkSuQmCC",gEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAa0lEQVR42u2WQQqAMAwE/Wn78xyFrZAnrKciSKVKBKnd2UOghYEemmQRYnyQioOn2JZiUgMb8ZiUYOvs11IYeDP2rfR4Zv9uAikMVut7UoK1SirpJNL+j1KXegI81PPbIF+PleJr1qolxmYH/PanM9H1rBAAAAAASUVORK5CYII=",bEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAiUlEQVR42u2WQQrDMAwE9RT/tP5B8kMfU68OesL22IIhpq2TQLyzF2GMBgwWMiHEPPjDA3zHw5eR7RewTc02CgS4JftgSyBinIBg52xGAQr4Rcq1gv7T9O9IcLwABaWpxwnaWgIJ5hO0H02z6CRBgJFsh/hvfakZ7Oe52u9g9dhr7lGzFmsh7s8LKhnBT4jVRcEAAAAASUVORK5CYII=",yEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAARUlEQVR42mMYBTQFr+tf/ccNX9djaHj1/74ALsPeC7z6j0UDEN8HmnYfmxasGmDkENJAuaffkxasLxvwRdzLhtGkTVMAAHKFcDmi5NIKAAAAAElFTkSuQmCC",AEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAVElEQVR42mMYBaOABPAq//X7V/8JwRcF2DX/f65AyILnCq/e49AMJu8Dzb+Px33/cQgj6FHNtNRMeVS9f08wkbxXwKH5RQHhxPn6/YuC0Yw8CkgAAMj8irS13s91AAAAAElFTkSuQmCC",_Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAXklEQVR42u2UMQoAMQgE8xR/lvzcUtgc+ASvvCp3e6RIs2NhIQwLik0IQYM+E0WWX30t8rBGEoZci+pX/voYwVHwTdHTJTokOr/+/YPMtEaS9pIaA47iamYMvTkhaG5ExaDkYZF4PAAAAABJRU5ErkJggg==",vEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAbElEQVR42u2Vqw3AMAxEbxRvnm7iUQKjHskILisoSOqQVOq9I0ZPsuQPhBAC6EZnJFO6YQQLYyE+lgajGRI0YzCmUiR5LWW9W6vflT5rSX8m3T+n+9a0W+5YzqXOWEiZHLLzSCu9md6bEAK4APQkgvBre5ljAAAAAElFTkSuQmCC",SEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAeElEQVR42u3WMQ6AIAwF0B6Fm8oN9IaMyO/QI9TNwaXahKjJf10YID8MlAoREc2hixr8eanpKjFd4fkaVSIweC+S0AscJhE4XCLx2XgT2nnx9r+A65oBDPh4AF/yC83O4FYkwe6161Hh+do3iWHLfpmjcuAgIprjAAlLsocKDtBfAAAAAElFTkSuQmCC",CEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAuUlEQVR42t2TQRHDMAwEDUEQAiEQAqEQAqEMGgY2A4eRIOgZ+/QQBHcmeXTaKO30kU/u7dWNdOdwRemACEFDAyNbF77JSKNanZb1GXqMEI1GwRPECFxnofcRSGAXQdNYUnBUZ40uABHX3Aimwx6wdVFxPSbX+1hLBwn/Ce1cAD14v9it3A+BEdmrhNnRWWXxKoKE7AFboP4k/myOETLYC/TVHMGIfru+PtRKEvoRUp3BW+ol6XDFL/wE4pOB22W1a28AAAAASUVORK5CYII=",wEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAA10lEQVR42u2UQRHCMBBFIyESKqESKqESVgIOwAE4CQ4qIRL+EfKXmZVQMsCJoQt0ynDpy/kd9u/fhJUFsEgpieBYXy6J8rFaejUOlFMTKmwpmgiKKxGhontCu/DEqSF068ljVbfMiBOjZN07MoVAdJJA6adl1DkdtKNZfC0bx9uDM9pACXOhnI/zzEfqYT4c/yOzJX4R2Ps1aKJMNci081Tzsr70hHn19G+LB2abPIyyCz5lR1jzotU4Hz5KlCiJwvbRKeGgVvovVqKJ+X4mmnSDuH7OC3AF4oufbNe6vZAAAAAASUVORK5CYII=",OEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA9ElEQVR42u2VwY0DIQxFKWFKcClTwpSwHYQOoINNB7OdUIqPhu9ILoGVkolyiDKQiEMU5SMhceBZGH/bffVZskkDEhgVVQ1JvZHrFXiDEJJaPp4WOV8W0rn8gbF2wlDP+wFcIk/uTiXCsu8EaQDLw7hCYA0dIByumD1U9k2Q2obZRRVu5AqGui12OyoRaVBpwGwagsKxxCGg0zLocUJgN0ao7wUSgg0B6Two2VizHwJqOBI/fXE0YO2xY0NGHdbOHg2UNdvIzdlstIfpdln2MA0PxgE/9VtCl1avs9B2XvCrhiT0Qu2qR1K7tDmkEnn6DunP0j+k871JjO4WeQAAAABJRU5ErkJggg==",TEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABNElEQVR42u2W0YnDMAyGPYJH8CgeIRu0m7QbJBt1hIygxyS/ChrhP+LAPRzXWuZygUK+PBiE+JEjyVI4OTkYzegxqoGgGh7oNYe/gCsE/OUTXFtkBBIKljBu0S13zVNabRI1zwNkE7bkFSVYzku5sGh+cwNbugbRpVvPeZAYXmARAwg+L05RS2rgcg8VljsIs+QShaxRBgcl2tEnSojE4MAiBKxWws/SqVexwwvSIFqAgc3t4EnXPOzexiVZ+zIlEBb2BgQ/QdQiCPuPRD3CvmBwlBQE0iQqoOY2p/psIMTpZm0PSh2MoPbBgfYgxNsjBuqtKnkD1abU8qeovb0ZJyVKLl3w8+xgr0exZkiJ8tr+UAhYhHvNFjebZr2pFfs4pSOXiTplfXh8rz3jPGg+l8GTg/kCddt6na27gZgAAAAASUVORK5CYII=",REe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABX0lEQVR42u2X0W2EMBBEXYJLcAmUcKXQQa6DlAAdQAeUcCVQwn4Csx9bApF9F60UIbJLgqJIPH9y3hmPsdkLFxcXNiSiRoeRBStWFozoUEv8neIJTS68OTpJP3TOzavUg++oqHimyDe+4/F8wo3E497p6XPa9DmlpS/PybUOEEjLg1CFHSb9lZXs6bP80lM0xDjoKswCuTwPwUiJiiSaBfg9T6BofxmKocYqUMaUggNUeY4ku0AXFHNMc2sV0EHByJSwQgz7APIJKOXo1eE85vuBaN0bPZ57566QcBJ6SM8W+M8R8U03+W9fU7y5jov/oEH02rIjqVx30SLQHjmR6MyzpuIFlc+/XvHWNZA4PzhzGzwTPDHx4PoCarewDBINZnL6pPE4JL7vFqTaaFs8EnsNoqTsXd0fAq22jnyT+Aql0tZxbh3Z7zSIG4Nlbg3eLVBEvfRf23eK1x+biwsbHyudwUFO4xi/AAAAAElFTkSuQmCC",EEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaUlEQVR42uXTwQlAIQgGYEdwlDbMTTv7d3AEH/GKDmXXDiUYJh+EID1+aoYvUZBCAC/c8qyJkDQm8D8bt9u41ZOEQGV8R6W/J1gMgs41sA635iOYwyUakzqCtXkdGO+AcQBU4PtQeXwvP58SnJykGn8aAAAAAElFTkSuQmCC",MEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAgklEQVR42u3UwQnAIAwF0I7QETJCR+hGdYOO2qM2OfwRLCjFQiR6E4oJqCS8QyC4zBgVfAg4VvPirYWjp3x/a+ncbpMXpLDiJgYov0CppriBg3tnFQRX+rIzbNwYbGLVqm2anF24bFoJTwys3Vh1Lk8/xQBZGGTg4DhaKQhufpmj4gEfVs3uTpQRmgAAAABJRU5ErkJggg==",PEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAh0lEQVR42u3Vuw2AMAwEUEbxCIzAJrC5y4gL0o0QGsRRoCQoHfKlyU+viGRnikTuYM1EqQzH3Ad5smtWtKs15r1F6XoFEjUKieqHSNM+Da6VqB5og+uRM9M2PZIXsAV1BiWgYahaLH6snyEVi5IM/A6V9/OA/gyR1oTUn96jLlQb6k/xVUbunMg5/LUK8KN9AAAAAElFTkSuQmCC",IEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAm0lEQVR42u3WsQkDMQwFUI2izZ1NNMqVImo0glKk8HEO+f7lHfpqDEYPg42wdDp3TGpYFKyRSqAxorbqINioKNe5XndFXOMg2An9QwmWQAEL0XNT6ncXsAC1X/cucmGNQl3frwtprnKKz7NDlEijT0PhxBqpPIonltHoOrHWB0+iuKHRJ6Opu2jqHmpRZA1ALtMel7n2F6xzx3wAgJAmGhrKVWQAAAAASUVORK5CYII=",jEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuUlEQVR42u3WwQ3DIAwFUI/QEdi0bBA26CgdhWPgc/AI7qVSRJHqYG7I37co5l0SG/J4PPumPRtDoNeLg+X4A3K7soEAQ85vGwRCV7pnZ0A2ENcBCqAT64BO6ABD+mYOEDDRSJiAGiFjlUQ0EG8TQITUf7KNS8oPoh9CwBZgqscBB/qX9cnauB2LgD5Za1wAxsn65+eyAHojBOKAA7sB/R6eAXhuo9UIma+SSMuwh9Xq97RfuT2eXfMBD6tXB0TAJI0AAAAASUVORK5CYII=",DEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAaElEQVR42t3TsQ1AIQhFUUZxU92MERjB0vgoHIFfEwpofmK0MRSnuEboxYPppxyYn/4Ep4FhkNOKQGUPoj3ARQDzdw5YO5F2SBGsBoGBV2yImckrxcwUxMwcxMwcxEzYDX9p+unFFf4A5oVnhQcOYRcAAAAASUVORK5CYII=",NEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAbUlEQVR42u3UsQ0AIQwDwIzCprBZRsgIlAhTMEK+ekUp3w3SCzfIxVWxkJvzQc/tG/bcSLwLFA7bhcDLZhOZDUpg+PsyWFcVWRVG4FFgcOgoBI72ZxyzIHCaBXtjOIFjFgSOWRw5Vc/tfo/n8wB9+W8ptkfZNwAAAABJRU5ErkJggg==",LEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAiElEQVR42u2VsQ0EIQwEKYkSKIUOnk4pwSkaivAHf8Enp9Xh6BAbrRyMhBjZ6WSnYDfTp8HFdCcQHwynU0MgKjZLSmRstABodvLVChYA4f89ArJZrpbpAdBoGPn3MGrs1yodx0Z7kZBCvQWQUE+CpHpxg/AFkFRPg4R6CyCpHn5WrT5H51DvlC84a6FPMEe8gwAAAABJRU5ErkJggg==",FEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAArUlEQVR42u3WsQkEIRAF0CvBEqbz3Q72OrAUQ89v8EuYA5FLhk1uBoPFb+bAQ5CPvnZ2FgYF5X7yL6rQ+8lG41AKMhTaLkoQSumEzkVKCNovaDtLqtJOKLIfnXt1nI8JCsaghDINVMY8BM1QHBQmHNDPOwStgt9FdVbxo5Pt10Bzlac2yvbGj9re+FHbGz9qexOC2t74UdsbP2p740Ztb/YbtRCN//bsb+HOsnwBU7dJVA4m+Q4AAAAASUVORK5CYII=",xEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAw0lEQVR42u2XsQ0DIQxFMwIj3ShskNvg2IxRaI9PwQiOLgqhiJRf2DQnfyrLxZMwTzIPj8fDg4JCerpAIP96DrgxoG3IVw8ZcQGgHZB52mEMQIRAaiqhhHN/IzZbQIac+6hqgiDbAgTSw6h6gKDbAvoPQMyvqKZv9TS/orZBrin00MPnPUUzwBzsPDUtEA1xiKZ4osxWxXCJrQoAsVUF4LYqAdxWJYDbqgRwW5UAbqsSwG1VAZitvlU4YN367h8cj4fnBc/8j7AfGI+wAAAAAElFTkSuQmCC",BEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAA2klEQVR42t1TyxGEIAylBEpICZZgCZZiJ9ABdmIJlJCj+OJMSnAXXWacQbzsTXJIJpOXlx/mjU96ODD2r0QEpcdgteJEEcELLQTOlji1zXDEdWKbw39cqgSP2ICIS96YbcBcPJilN2adxN3lJzBbYxDSWHxpRDiYVfoKgIC9LcnXBUV0WUPVXrrSrPMAaoa96Ib3fwAv1CoJHWIN8NgfJNycxJl7neqxFvaaI2TgdXHbUBbaOA1xSmVNSmC1CIj8cE3+PDklpWyJJl/CG2+hdUI8GuXkpX/jF/4Af5Pw4QXt/0wAAAAASUVORK5CYII=",kEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAABAElEQVR42u2U0W3DMAxENYJG0CgZIaNkA2sDcQN3g4ygUfhp6RiAI6iAWpdFAVkFkiA/Of8YFA7vSNNyb71e6mVBFkUTRUbS8H9jEi2EVqNzNaLJFSxJ/dwawIXYS8LqukA1bqF+gDVMqOAau4W38FNT9T0DH9J33u2MbFXk2/krg6SDyDsPVC5WL5dClmFgBqHNnhpH5iwn56zjXVsAuy45IQ/MFgrtz0mz4Y3Mzd7GJ3eRn9FzjfNpFxrvl6offGfbg5FAkg42bC002W1ZLMPO6/0uYPYDow0Hq4Yae4ZvnnpJFvmYTmC5osnSeQ39//5NnfAL2U1SI/v37foAfQJWySmJl2YmZgAAAABJRU5ErkJggg==",UEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAABRUlEQVR42u2V0XHDIAyGOwIjeASPkBGyQb1B2cCMkA2cDegGjOAR9Bj0y3eMQOsQH43jM7QPfbK4M5zk++4XCPF22GGbFpRotiBERBAcutD8BdKDxCGyIUXKa0SMiNL/DtOAxN4akNeLDx0ILV9B1brCAyA9hp9+vrL5/ppqFIhNmm/Nk79FmGevQUEVIFmHnODWMTg53WOWTTmtmHTg8vozG39JR8ElTegQ64bX+yA3ndNKRrTr6HyOaTWd/ecuKG8w4qv4oBAych8U86oU/ydQTi1sphaXmiqkJnY6PyNXJTkumw23C/IasXJ0O5hcaoWCTGW7b2zYlq4IBjYVnWhpHgho113hcRupAMnFJv2sLbeRrAMf6RiqURhCC5rek2cBiK3G5L1KzdXroO6NN8KB2JCqZ2RdHdzS/MWKJnU8iYdt2heuC19OkjsOZAAAAABJRU5ErkJggg==",qEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABf0lEQVR42u2W7Y2EIBCGLcESKGFLuBIsgQ7WDrQTtgOvA0uwBH4qg8mUwB1fjgk5EW9zPy6+JAZwfZhhhmGrW7f+g7DWLQiQGsF8t0kNwJH9Dtg5WNrERTA8PdA/l7aqltYBZXjyYqTu3KfjzCxE9XYuYOXM1Mst1xUio3XALYbe2CXWxuKLsAFk4OH6IxhyNMBG9+YRFj4jZCDjj7G2H85sHzxAMFhvC6DtZwXCRtf318bZRQq2rw31VX/GTlPY8rYCL4bm91UP+8DoKQaMNLOQDxQ4cQBMMSEoKRSTJY5k3flhlM7G/MB3Qml0IHL4zVC5T3ZAGqUOb+dqykDVy6dIukSKiSm4fGagNkWKG88WZsAypPMlJ9XTec+dfaoTp2ylKkVnO87E/ICnL9lZJO0r1dP92QYebdcfyX7mt8DD1iat/MC9lVT2irAgtpJN14xEBmMhkhyN96a3OloX71g7c0H+1kybRtVLCt4VMHA9wBRslCB0K+v7n9utP9UXmiS2zjUbidQAAAAASUVORK5CYII=",JEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAB0ElEQVR42u1X3XGEIBCmBEqwhCvBEq4EO8h1kOtAO9AOLOFKsAQelY+b2RLIAGGQwxjUZO7FjxcQ3Z9vF3ZlJ06cyANxVGgxKIKGVoQBLSrifyO8QG0EL46WioOWq3oucGoEHwt5N3OvVNXE99sunJ2qNOKmm9+ZbtAgVcrO7otdftDFihe4MIbWqGEzqN49GQv/1i7rVS+4nWvoMbJytM+IWxr7zV4Qd+I9IcH+2Ad5d3NLldgQCxtaIfj3aoBWZfJOCY1HZFDNshAoCStiCwBBe6txMd9k0hSH9Hl1lqbAAxoVY4GmqcnjX+8elBEHVNAHRpVBkD9SIcRJlgfehV+FbFtFmjMQ8zOQnAXxonBg6wi54WEcZwmW9ohH+ZbzUb6CsP53Be+lKGTNniCrMivIsovTFGI1TYckTd9+0IiD9ivIurLRzF1FtXbZPa/JFbmOUK1w+S03QPGl7leZPoQKhcePBWeYF5yp2VgyZe9W8m7ma5ei6ucVMJMmp8KV9bRaBUqIW/ZFBj1JlgvfLcjO+xCHNGputmOcNV6IGi98QCtSpVGzzfo0Fg10aBTVJxVL7SQ7grEwBC0NRVNjbT8OwVHJ7rV9F/z8sTlxIg9fzJhlLbg/lAgAAAAASUVORK5CYII=",VEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAJUlEQVR42mMYBXDw6j6pGv6PEA2v7r/6jxXeHw0lXCE2mp8oAQBIti9CQvtAyAAAAABJRU5ErkJggg==",HEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAK0lEQVR42mMYBaOAgeHVfUo0/x/VTEvNr+6/+o8T3h8NsMGr+f5oyTIsAACEmjbmH2XjhwAAAABJRU5ErkJggg==",GEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAL0lEQVR42mMYBaNgiIFX96ll0P9Rg0aQQa/uv/qPF94fDaNRg8hJV6Nl8igYuQAAQMM+ivTgbfAAAAAASUVORK5CYII=",zEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAO0lEQVR42u3VsQ0AIAzEwOy/5PdeImyAEIIm8qV3k+JL0iCE1Gs0bdTo+CihDy9foj7KqNEbhDj/0tYC6FefdeTyx04AAAAASUVORK5CYII=",KEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAP0lEQVR42u3WsQ0AIAzEwOy/5PdeIjQsQBEkhC8DuEjzJek3hNQkmjZgwICBjdCHl/GATzZgwMC1QIjzU9KLFugJvgVy4hSxAAAAAElFTkSuQmCC",QEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAANUlEQVR42mMYBUMDvDd4dZ405fdfGQyo8lfngUpIMf2VwUugMnTlhLUkkOT2V2DTRxPU4AYA0joovsOdMlEAAAAASUVORK5CYII=",$Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAaklEQVR42mMYBaOAquC9wavzZGt9/f6VAXlaFV7df54wEFpfFJCt9WUDUUpfnX9lQKJWBHgT8Or+ewW4VgGwVuLBiwKQdqjW80CtpIGXDUDtAgitpGs//3r9ywUM5IGXC14uGM2Qo4BiAAA650DuiyuE1wAAAABJRU5ErkJggg==",WEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAeUlEQVR42u3UMQ2AMBCF4ZNQCZVQKTgAJ+AAnFRKJdxY+jpggZAOTQhLc8d2v4Avb3pkWdYPXQFJg/HgMqkwedFZs8kZp8Wkxgir8TxoJCSED2avkcZCKPym6orEjkhCNYYbI6Aakz09SSjMnRFQfY2QAiPYSVmWuBstj0wlsh7hywAAAABJRU5ErkJggg==",YEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAAoUlEQVR42u3VMRHDMAyFYUEwBEMwhDJpIJRByqAQUiaBYAge3T4PgqCevPWapY5yWfQD+Ca9E3me5/0bRxQUWzIgQ4xRLErWSHa1+RCyMZIxCakT2YWrku872cWp8SCJgsJh+zIHyY4KModN8klj1djZ9ZdELoFoH7t87Wf3ZSrLkPYw3g9SZ2fj/bQLBILVeD+YIMb70V43vUz/Hp7nndIHj7uVXiDrZZEAAAAASUVORK5CYII=",XEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAW0lEQVR42u3VoQ3AQAwEwZTi/ps6aMnEJSQgwLIUFP2xnQL2Xk98AQBwRkep5M3fJXM+gzz5b6VSh/H1b6jD9jkZM2HI7wlLfk/svGHClJ+JybsmlMFxAgD88wDwDpxbIr1PUQAAAABJRU5ErkJggg==",ZEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAASklEQVR42mMYpuDV+VcGyPz3Bq/OY1do8PI+UClCGZiHRylBZQilCGUElBJUBrP0JWGFEEshDiCoDOFWgsoQSokKcKATzg/TtAUAiPVG1dZzQhAAAAAASUVORK5CYII=",eMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAVklEQVR42u3TsQ3AIBBD0YzkkW5z6rjJCKGkMNIH0eLS0mss+bk5ySdrqR2x3mYFGB2gAIQSMErAqAIAKv+uvbGbK9YDoFgPQU7OIBCBZWRZ8/b+7yQd06xba2rjM1cAAAAASUVORK5CYII=",tMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAWklEQVR42u3UoQ0AIAxEUUa6/ZfoCGjOsAICcYaE5Fs42eQlPdG2nzfjsk7zKdcda3TrQDO9c0TDEQ1HNDwUcEDTdXQLUmsvj2i6IxqOaDii4fgwLNd/G29mAaFvZs0tXJk5AAAAAElFTkSuQmCC",nMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAfUlEQVR42u3VMQoDMQwFUR9FR9VNVS5S4yNsyhCGhDDtemrxmg/2Op2QaEfnDnnxrnPuqR3fkam5O9fvrpj6hIhMXbGWgogIiIiAiAiIiISAOAiIgxTCdbCaQmpKQJwY8xsE81sEkEEICURARDTUCQTQX89WJxFenO/m0b0ATmsJSOo8lM0AAAAASUVORK5CYII=",rMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAd0lEQVR42u3VsQ0AIQwEQZfi/ptyiOSEEvjYvxISHKG3gEkuOOu67raMjOm2aXpGxgm4fiS5dQAOJ0luuJlAChxIlSMpcyTJySQ4lQSnkiLHZbG4yEWGTNZly+I6Vxd/woHUOJISp5HkdLJwG/IEJEcy+iy77rYP93wPQHQTKiYAAAAASUVORK5CYII=",oMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAcElEQVR42tWTsQnAMAwEM0pG+JG8mUdTGfJNVkh5EIGMqmB3NndGB/ax1XpktQRPj54Q19kZ6HS0pvbwTCUJD+tbYN1hrXAKUGqcApQCpyAreUtBdSUKBQWOQsECR6GgwFEsCjj74RWxKOgIsrb66S9xVXpwrJmxQAAAAABJRU5ErkJggg==",iMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAoklEQVR42u3UwQ2EIBAFUEqwBEqwBEuwBEqwFDvADnY7oARL4Ch+TKaFjYd1YuYyjhcP/gvDkEdCArg3Two1yGa89UhmjIhgx3nx10A4qhYzdzQ0rtO/LkMZ93GdELWUZ6l2zjG/QMmD9pG5gvLZy9c5FZeL9YMgN1dy0OIlVfHaIUmq5BjLIKj2ktQZ7amjD/kbrwkB0Y7T1ttxpub9Cp+UH/eiaXD4TucxAAAAAElFTkSuQmCC",sMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAA7ElEQVR42u2VwRGDIBBFLcESLMESLIEOYgexA+1AOzAdmA4sgRL2qPx1hhZyQhEOYIYj77bM+NS/CxSZTASgJBpusCYRqWGfkoiwHiKNSOuy+AddQ9oJmQoS9RNNBVLiqvcO86kkXT3Q7N2tZ8uVEFqjivmawU1oq+wOgoKJ6RLS09QgdxggAype/HlBi9lbm5w1F/Xh0XtoRuu9cOQl+GvcOyJyW849JEWkRNzfwteehraYvm0V6HiZ6hD7t7DA22giVdyYhOyZUsJoIsG5RVgaZWCLBBPTRQoOkehAw6SGNKKVmzQiytdeJoIfUnyWYZoo+CEAAAAASUVORK5CYII=",aMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA0ElEQVR42u3WsQ2DMBCF4YzACIzARmGEbEBGyAYZwdkkI7jEPBc3gqPQvOJk5LNcIOSr0Yfu10lw69PnegMP35qckNqjM1L4NEajQ8LcvmjCdLaiceGquig8vIxGEnekHVVFGcLIyvQnt2e+6DoaWRmjkNRFK1jZHw6v3I0aWZLR5W/UxrLb1w9lN0q2AJWh9EYlh+o3b+6oqCZXrn/E4p0paia5qiDFRRetJFmQLItWk2zIhXVRkqYJD6IsStRI5m60f5nO+mUi6vtvVJ/rzQ8hES89oNhX9wAAAABJRU5ErkJggg==",lMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuUlEQVR42u2XsQ0CMRRDGSUj3Ei3IWzk8pApMkIQlStwsJQm+h7gPUWv+bnVatuOIFbiD461gpPj+VgoeN05eK4tMHhUgdUFeiOImQIE0VuCH4QpICF6C/BXmylwNSkCvClgFAZvChhFhFcBo8jwKmAUKV4FIoXHq4BT/BDI/q3ATMPggSoQNfQKFYjwXqECAd4rVCDCe4UKBHijMAUM3ilmCvyPlwIzBYgPvm6huoU2LiAB6ttV23ZvAWic8AoiqewAAAAASUVORK5CYII=",uMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAGklEQVR42mMYBQMGXt1/dR+dJlrhaPANGAAAVGwVbUC5QkQAAAAASUVORK5CYII=",cMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAHUlEQVR42mMYBaOAnuDV/Vf3sbHI0DIamKOAAgAAU9YVbVeOXo0AAAAASUVORK5CYII=",dMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAMUlEQVR42mMYBaNgFBAEr+tf/X9dj5ONH7z6D4I42fjBy4ZX/1824GKPxswoGAW0BgCqfC2agz99+AAAAABJRU5ErkJggg==",fMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAAMklEQVR42u3RsREAMAjDwGwO6wJDOJcF4pJG70q1DwDsmWhNmPJab6a8ylblr3gMwJ4LaUotmgCbpe4AAAAASUVORK5CYII=",hMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAAQklEQVR42u3SsQnAMAwF0Wxqb64ycA5oBAe8gNQa7nVX/O4/kqSbMVYS3yi7i2CzybK7yDOIsruYxMp3Vu05JOlmP+3rUfo5krGLAAAAAElFTkSuQmCC",pMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVR4AZ2QLWyDQBTH8Qqv6n3CsYzmvMIuK815MV6m5rrMTTFBxxw1E1PIyXd4Ua9wKyi8ur0Xshs5csvaS36C9//g3gW+o7ALM+yBUXhaBf89bM7avsj0MGa6N78MNWt/BSUZkc1+bJG8ILgAFX6lwQZPBx5cCNq9zysa6s18jRplWGIED1hILtq6D0jwjLTHZ7xJ39o4r1BMD1q1YlfqaNxrYZhXLfAJ79Ut9kCh41b33U+QNfZYbxsVwR6Foo/OCpb4yLdi3Q0y/NMSY7BrLIr8dOwN5seAlCZPGgOJYpH/7gb5Fh9NnJIHDKwLykxvQEEkzIzO3K3zz/crunrUVFrUHKTZjrTR8Tb092tpS9wiMhD1MkhAgpydr7Gi4cE1eoOe4ysaae8X1jwxbxFMyNDn+wZoU/gQWA1zdAAAAABJRU5ErkJggg==",mMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABOklEQVR4AWKgKwCURoawDQJRGK5X9QqvcKXLSvCqeikX7MyKN8ybkqys8jDzfuYdZhavcAVq8Or2XlmTR47l1tsln+AP7+P+RwJtFKteIsMPEjPPUdQBon8BEjhvLZJmGUOXCtXXbNBGE0ObGCJR9RlVukNkiEV12V/XQQ+OEgOhunpB1h2cc/EPscB2O2hfqe2kPu3jHjG9S3s3RBKi5akKskKt6wKChMS2v/wMX1uaOarVUKhAniDwrjIWakZD4ie4+FilvNWaEWnOe7U6LN5gnfNwTkwNiHkRA10LOnTdIwQlhW6wyvyYYkeRTqOlfgkzvQ9rnW6SP4jl58eDP85sBkSiYxSzUDMaLqa9ETMiPSU84O0e82loivHrPuKZIgN5q+zhYEmhG6wyP6bYUeQgtoss4mHELvoGnVEJQO0l+0MAAAAASUVORK5CYII=",gMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABi0lEQVR4AWIYFADQOhmCNgxEYfi8qlf1qq5Z15T4mXqaEhgMZtbzptEzDaxtYSb1Zl691MyMMTM1c65pYHBe3d4Lo4HHg9y6HPwkyd37vuPlkkAZxcUJ4qKyeHV4zeldh2CCioEYyuSPUNOL4aSx2BDEM4ZEreD5oVo2bbgohhgJlP2uwUKqvBbxVnSZObIVWWZQ7rsFV3YGx4y1ikTHjKz/A5cptV3xkUPU2x2C5QaChE4EE7WCb+EzWx1uVlQvgtfF0G6KwP3GeIrgDt61VH8W0QPGCTkvnDU/XL1bur+H1ykHS/WKAIJEFD3DaLCDoO8BdjS/hit9bpWnqDUEfoIgpdYrPrioU7DTo4FbhOAWkw+no6hVxMDfaTilekyO9c35pwenwxwnHEu9UBaJYLFe4Y4Nn+QL33bjaA1DvS0C2BbDFwJ/PY4G0sZYrMJFiSwRdxRhpu5hsvRYb4jdtMpf1Bbr9LVW8iDROL1QZOtaTadIHuzDj7POwbIo3Ld8F0+wv8jiPdA7n9of+6Jh/abhp4AAAAAASUVORK5CYII=",bMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABjklEQVR42s3TwW3CMBQGYI/ACBmhN4xUogxSUCYoOfYGG4AEKcewyQsTMIKPQC8ZwX0/alD01MSmiSue9AQx8f/FsVFPXSmdk1l5oVl5rfjT3r7TOR0cQijCgbS06Q2nZEbz43WJ1UjABQeA3DAyeAuirv2JBDRQX4sGDOjrBYMDAW4Yyw8Iya4U1Dc6H/4BI3YSVVcIeI7zIPewLgnP8ap7QJyxwolXXZUfx4tdOa7yUhcftE7wnwL8KMRzo/1RL/NycspJp0oWBhkx3FZ0sScdueDbb3TJaggPLXLMHW6BWmEGSB6EgpKRgNraqC1NNm4QPakQClj9lIScTXqlUAjZkT5g0Kc/S03YH0C+98NQoh6CfaEt6UQ6DjggZLNpahexsYtpYbMkErA3hLmcVXCOQWYXZEXfYYR5QzKnCfMFyRvaYITWMA5MAxrxA6/dOfGJV/e6qQd84fubAfQeL3m88pqfTQ/1xAgX/nB8ElvggogXJg+RP9wX+hXG3gaHZGES4ECQGw4LueHqL9A3pBTYzX9vLMsAAAAASUVORK5CYII=",yMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABsUlEQVR42tWV303DMBCHPUJG6Ai8NZVolUFolAloNmg3CBKkfQyb2JmgI9wLogkvGcHcAZYLtnR1pQNx0k9t2st9X5x/6l/WWp+qtRk0xn5F02+i0EpDVvbjFmHgwUGARITA4+RBbKDs3zaVPs1kwXwA9++SRKh53Q8NA04OJ0Lgwl1YcvEiPFg++kOEWWrpTKrSLzd/tQJ3uPrKFW1gnn8ZHL8LZETGLgYWFSnNOOGM3cXPgYPOZ/t+0bRmcWx1XnmR14fSDJAOhqzTRXbo8+2TmU+tyTtiRMH0J8b+CJyL0HOeRJLB4Vwv0mJT2BAXcTt9iozH72/DoWbAQfb9vFE0nBXwARoeW8YomA8oKjq6VBFMR/tR6LpJAVPvo853JK1cBSICCcG+GBE5sKSIv4suLVsXmb1fbe1mdaRP3J4xIizYz1xOmM7N9BU22bNAioh7gDEzKV4EmzaxJk5kb3Ltzi99x3NcMOAg1KdwuYFtjNvzq8gHFA2z9e3uOpFljalsvWoSwRMxSVq5CkQkEoLjRUflRKTBQiI8WFoE6PpgwCIiQD1KsrzIUjswbutrwe9FgoCoBGPNywAAAABJRU5ErkJggg==",AMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAkElEQVR42s2S0Q3CMAxEO4pHyEZlBDZINiAbhM386fiC5BGCVAmJlusngvu03p3Olpe/UAhuIzChaCGnGFaoF5NlMfHi+ljP0hTpzZZcaSqal/3ES68MVDv4TRAMnGzGwDD5bM3Aeuw4MhoBTXy3daStNRMuriPHdseRoS8jT71DMUf0aoJEUK5vof368299Ar0gZfgYbBxmAAAAAElFTkSuQmCC",_Me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAQAAABu4E3oAAAAtElEQVR42t2UzQ3DIAyFM0JGYARGyCbpBs0GySZkg47CCD4mfq7kEahoD6iIn0OlHvIuoAcfyM+Sh+tKR1lBCAjwcGq6AGYQbzK995Z36Lm0gTvo+Hr3MKDnXAXUiCYgQUw6VhA4uJLPG28VRDxs0Z9AFQRh6J/8jpBMRd/Cx7VVZj+W1HcmNZ3oc+GGDFIDin83dC5QONhPuLJGgCkLv9DtHR4BIV6nMZafQX39F5LHFefDC0vAgFf3ioAyAAAAAElFTkSuQmCC",vMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAAx0lEQVR42u2UwQ3DIAxFOwIjMAIjZBRG6AbNBrAB2YgRfAx8HzwCVcktKhCl6iXKP/rryRb++HHrZ/EEB0JBQUQQfRgUxY4lz2tFYGBB7EQdQhHzQmpX84gHcHbJf6vnhd2orwaRakwkPHVhBNiWl+fkuzBHmJa3alAXRum7f4Rp1U3PIPZhn+emZxFGsRRprapONeiN0AnPOJ77JItCQGlHZJ9kgoXZtssvluR5ygQzpiuSF8T6JekDbq9d8TO6AJ6e96E+rTc+qZhiC675hAAAAABJRU5ErkJggg==",SMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAQAAAC00HvSAAAA7UlEQVR42u2VwQ2DMAxFPQIjMEJGYARGyAhs0G7QbtAR0g0YISP4CPmu5BGoIjhVCAch0QvvlstzEuc7dPEXtJIuBTAmTOAU4Gk/qRVFDz/UeQUHLwG8UyUPsDT0w1CD5VYuuSFytX5QRHlQCfDgRbIu4tSSDXioaQNpoFqZexnfZIB+7GgbyY09XkoiHBnkjlmVJioA0xkau08ZOMRzrnjs0NPxUlpBpaENNPfJ5tOCdSMMxTnHE1HtaNqkO1jrlTQxXonhqBT4eeLBLe/WoxfN2YZbROUqCYjzEJUg3TI+bJHNJSoXSbh+9BP5AjcQwCGOJwAvAAAAAElFTkSuQmCC",CMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAABCElEQVR42u2Wy62EMAxFXwkpISVQAqWkhHQAHeV1kBIowUuS60VK8EgEaSQyHytoNIvhZgfO8Q9b/F36ZRXDPgcQBAJChCv2DGziAjkenvpwdo8rwq1bVBjgONRYi+3DEY/HN6sFdSC3SwuZx6XAsiGNGscTBFRxT5AEybM+XYGs9qXLEYKijBEOkv7fWkVI8jpghMDp3OobMryzWi0EpAMKRGv3JSC1PW6FQZ0yB21TEFXA5Ktpv9t2DgqER9XHr1Oe66yeGr32ApbycjkoQJolxSOo3Yl6pOQAh2F/4hArrHGnr+XxcMkzmb41e49qT5IDezJNUc7rQn4GmbzCVI9M/vpt+z3dADr0Z00wLm4rAAAAAElFTkSuQmCC",wMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAlklEQVR42t3SQQ3DMAwFUEMohEAIhEEohEIIgwXCIIxJIASCj4m/KxnCdugmZRe3t1V9uSSSFftLpisB4+UcpnPQm2RNFugIC6gokuUJ1rsXmr9vydutBdSeyLfOKMNnEUY+yZJ/+zc/SU/9QQOYTeRBHEuwoOyGloxqYStXW2fa1xNYTQ0FizAiHdECT58R6//Xm+my3tIEisWmhZRlAAAAAElFTkSuQmCC",OMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAApElEQVR42mMYBWSDV/df/ScC3h8ZofFe4LXDawdyNCq82v/6/av9r86/uv+6nrjQvg/Xev9FAYT9XAFoxHzSoi8BhX8eyicMXju82o9DhDB42fCyAcMt/4nW/GICpmZKnH2eiNCGib0MQA9A4kPb4CUwqhAx/ur/ewXidCJi9z4okbx+DwrAV/dB2kkyAOhXg/sCIDYh7YTjYAMdSpL7oyXsYAEASCuxsboove4AAAAASUVORK5CYII=",TMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAAwUlEQVR42u3UwQ2DMAwF0D9CRsgojMAIbNJs0G4Am3gERvAR5RvJI9ALqoSgUhNxqZSXW06xv2M0zY7KreBo69gRB4o5N3MKB9TxSKFYpwHQsPYUzh5RjnNOOMiJ8nv8+ilqxklFgZS1x4l1FJShe8CJBzrKcPt6X4a+xMskHWXylNPlXI0oY925Sx6pSyyMH8jpOIAeONsTNXKicvAILNEe5hSqB9RYYp72vzZat78y4A58UXCPPHHAf6C2Nd9UeQOQkNdOJZ4y6QAAAABJRU5ErkJggg==",RMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAAA+UlEQVR42u2V0Q3CMAxEMwIjZISM0BEYgRHYADaADcIGsAEjdAR/prkgZQQjUX+0akGq20og8vIZ6XQ9+xpTKPweILDi0CqiZRxzSBW8JE/xip2ZS7a4D4eU7TxJAqccj+ElA4fdy3OGm75SJB9+BaOmjekRL7o9JcmSQcEO/G9A4MfWaIAHN3szQrMHNzfd1GvweHbBqjsFBn+6+yJRAqdq9MaBUetEz+DmPJr2CQw/baWoMw6Ge1OJSiEqXqWUfUnxqUWa7+Fa7+mQMrjrU51s/6Qs/ucQbLygboOBT1WwIJFdklVl49EsS7Dyl1U80aQsY3nfC//CE0HU3brcVJnTAAAAAElFTkSuQmCC",EMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABD0lEQVR42u2WUY3DMAyGDaEQAiEQAuEgFMIYdAwOwsYkEAohj738fjAEn85SNe3WVdOcvkz58lKlUX7bsS1Tp9N5BAXqWOVwgf5EnVeRgU/ILFAWZJ4kUEvqFwv0fvFEreDJrswYl0BUBk71ajuXdyu53P0fodB6/ieaIFD+biFQ7PoHEC1QiXyY/TNtUs8WJh/IUIzPMgsK8QoIVIa98C7BJ6DQff84HegBz1BEcrBrowSoyXuwTMk7GZbdPQiy7YMEq6DRXWg/JygEcfP6i7eSjbXzSFi94okFdtL2DPdL2JqRV4Psq53EEur11rKROf3ttZQwEDkhloGMmwQdhkn02egTpuviFOgTdKfTml+iqgQxu12OPAAAAABJRU5ErkJggg==",MMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuElEQVR42q1S2wnDMAzsCB2ho4TEgnxmg2aDdoN6E2cjj5DP5E+0/yHVgUEOqDWGCA4bxJ1edzk9eBiu7NyLiWZ5d0D+URC472//yV13FwKDZCHlnjaZ6GEQTHyk0IGM1qzK27oCZicYNa8erEopfnXiVcC5WCuAJecCe60AUBTYlgUoC+jNK0AU8w68JstXAN5EQQWaBu7jihFYXaljjBUj2G5Eomjlth0t7tGVRFPujbRkr+47Mb7WHqpqxDex2wAAAABJRU5ErkJggg==",PMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA80lEQVR42r2Uuw2DQAyGMwIjZBSkw4jyeho62pMYINQ0YQOyCSNkDOgcEqVE5IxAvGSOCISlX4DwffLj7MtphlJa6DgKhcj0M2/luncECNDzrv/BHOemhVoNIySfbVEBPOcATuRLZ1ggAzNC2TS5Q3VZtnpJyYHjCYyKzNWs8v2mM3rngDhJnTpHP3YASWoACpHuBVZCZOP65QdEmG8CUiPqoiDR90YgwMPgbBZAOo5QrTl/k4RkAgYD0LYt7tp8oqjp7R2GHBAX802X01DDtabE3LQcMnrz1A9ZDsv0zesrNnGW8w0QaKX9gu2WraKoTtv0P1tulH4sQuivAAAAAElFTkSuQmCC",IMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAA+klEQVR4Ac2VQcqDMBCF/yP8R/EIQZN99hGaG1TwAM1VPFmXukttF11J+iIIQuxEMW0d+GDA5r1kJp38HSKsEBnQlnPj8TnI9olK+Q+xC7DALSLEFZz9b7eJc8784lCUMMKadeJFcSLESO5YG905cDthb2tOlaUvSzd03chNSrJciz3Bx4ra2aOu3RTIY6cwoQGcExrY8J7jQzoDAM25gf6AgZ7X36Q2AGaTgb85Q9uO9EptMJiVKCnQJJq8n2AYBkON+KMhj86mSXd1H55N46ZAHjtBFRowRo8KpYgmE6PiW8MuzY3Kc/3TByfsCZoVMbLA+Jof5dFPHy+sG7A1fUBUUgAAAABJRU5ErkJggg==",jMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABJUlEQVR42s2VQQrCMBBFPYJH6BE8QhYd6LL7uugN7Dl6iepJegSP0KVuJHYhrkrMFAZEB/ttGnTgQ6Akjz/N5K/+vqwxiU1TM4poszwgz9f+8Mqr9bJeTlHr4WU4jGgnEEhEHYPnuSJqIIgObviMb2BH2RwAPUJQzBnudApWTh3Sb7duOJ9HXfMcAVefgN3UAbe6dlK8BoBWWou7w4G4S56liMBWA7qIQPvazk1koOMn8dmdiQ1kxg+BWZagG3n2htNpVF8UMPAtWeSRjiVgLCAFjUU1fsSfNl6j7Sy1JF8jbb0fDk6K10hGCmOOS74oX12ayUC+EO2X+ne9Gk96axcNYAwa4JT3AjA9kCUjQVktiuaBZU51SMsg3BVekiyGJQnw1/UACcPy88Smyt8AAAAASUVORK5CYII=",DMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAS1BMVEUAAADvSEjvRETvRkbvQ0PyQ0PvQ0PvRUXvQkLvRkbvRUXvQ0PvRETvRUXvRETvRUXvRET////+9PT+8/P96Oj95+f3oaH1iorvRETaY5dXAAAAEXRSTlMAIEBQUF9fYGCPkJC/z8/f73CfOZEAAAC6SURBVHjarZPbEsIgDEQtXmoRmsRe2P//UmeqA6GR0Yee191hwxJOh+KGyACHwX2Ve0KGeiN3ERXU1fqNsYPPWj8Dlqs6nwELlxRCJiVkYp5f6SLK0dsDVpEVGfr0g5YB78YebYPfDMEa6jG5beDNgLYBxaCvqcgRuigTMaJJqK9p8aao9Jx1hjNVzyITMmQfaxJZzGPpMdMylQj6Z2FKiKVayotd2vtu7QkVsfv9cSzOBwZ49O7QH/0Cd+M3hMdc2SgAAAAASUVORK5CYII=",NMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAALElEQVR42mP4H////X90cP9/PAOQwAbeM/zHAYacxHus4vcZ/idg8fv7/wkAPF4bstRgMMEAAAAASUVORK5CYII=",LMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAALklEQVR42mP4H////X/s4P7/eAYggRu8Z/iPF4xKkyf9Ho/sfYb/CTgj5f3/BAA/6r0QPE487wAAAABJRU5ErkJggg==",FMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAQAAAD8x0bcAAAALklEQVR42u3KMREAQAgDwTgF55EQCfcOoP9h6xVFmJgSZhPB7tL3KWwsGjMJ/QCYI4JZCBHS1gAAAABJRU5ErkJggg==",xMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAQAAAADHm0dAAAAL0lEQVR42u3KMREAQAgDwTgF55EQCfcSoP0Ztl5RhJkpYXYi1q5e/auGHYvGzEI/H9prfp6fQCQAAAAASUVORK5CYII=",BMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAMklEQVR42u3UMQEAQAjDwDoF50iohLyF78ZA9lsjCvPbUGJIsgg7cODAcmCSRnTwDdMP02R4fwy6rnsAAAAASUVORK5CYII=",kMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/0lEQVR4AWOgOghouC/g1f68HojvA/F/MG57dt67/fn8gPbnCng1e7c9j/fuePEeqhETA+U8254VYNXs0/EiH6KQMAZZhKIZ5DSYzfhwztzXcJeAvIpwesfz+YQ0Lz38+T8I5EIMAeEGJAOencenuXzpW7Dm9ae/IovfhxuArHjW7o8g2+D8xGmv/r/88Of/CyAO7X+JYjBWA2YCDQACkCEgDTDNIINA8jgM6IDEOQwvgfr37svfIArkBWxReh7ZBQ1gQUxDQDSusJmPkvrg0YgZbRgYpNYDPVUCJRKITUg4U6M3UAJfgoLKJeDNDyCnebY/X4CcNqCB3ABOfdQGAJMR1l/SzUs5AAAAAElFTkSuQmCC",UMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABGElEQVR42r2UMQ6CQBBFPYpH8AiWIprQeAAvw6KFdhY2WOgN7CwoTLSktqJjgUaMhY0J7jdZwrowIjFM8kNYmJeZ2f3baS1GjPdNxt0h44FQ9pYd+lgz7NCqDbIY74okT0IIBfiXhA3nSc90oisBUSX+RU5lZQSMhJZWKmfVRBiRAhuLIf8CWB9ukLKGTcyBpsPdurDFPs0Q2+P985tbAIZ+Hdh0lWRx+swiobJdz4FliefLA8/iuoTJdU2VwMky1pJ3okUEWsY7DXR4QLQHmJwbdXz8HGgwvqFmhpBzI+QqvqU24qTNU5cxi1V/S/82VKA5ZdDQeshB7l8uB5O4HJRK0cJ3GPe0yqiAv7H7RRfheMGm0retxAvIf++k416vtQAAAABJRU5ErkJggg==",qMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAdVBMVEUAAABQgN9Qh+dIh+dKh+dLiehJhuZKh+dKh+dKiehMiOZKiOhKh+ZLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvR4fnH2ffG2fe70vavy/Wlw/Okw/Oau/GOtPCCre93pe1snethlupVj+lKh+d4loSdAAAAE3RSTlMAECAgYHBwf4Cvr6+wv7/f3+/vGLhWpgAAALFJREFUeNqFktkOgyAUBUGw2k2xdK+tXez5/0/sRcINShrn8UwyEIKYQ+ZrA5hKZ+O5aBAooj0ziDDZZE8N72ykcBRIKIcQRnQdgJ0koRHztg8QCxIVIvrDEY4NiRqOjxc32/vjSfjd3kE8KeQJAq3tOOTgFC725UOcWmHge9q3HMKWRM4XsmcENAnZBHPtWShBlH+eRMj0EYVHTYxRIjbpPj6nKaWIUXpbA/Uyl3Pf5getMTOwg0TeVAAAAABJRU5ErkJggg==",JMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAb1BMVEUAAABQgN9Qh+dIh+dMiOhLiehLhuZJhuZKh+dKh+dLiOdLh+dKh+dJh+dLiOdLh+dKiOdKh+dLiOhKiOj////09/3p8Pzo8Pzd6fvH2fe70vawy/Wlw/Okw/Oau/GOtPCCre9snethlupVj+lKh+ell/5vAAAAFHRSTlMAECAgb3BwcH+An5+foL+/39/v7x2mWn4AAADFSURBVHjardFbE4IgEIZhlCzpILlu2vlg3///jY2LCmFd1XPDjC+rjKg/SHJbAmSzdJJSi9EqyjNCoFqELUckD+YwMc6mhIlq+O4SH9h+EO+eddMticQsigeWaCRavDlz0/r3EkJX5gc6pUSIunl2S8t8gRNG3netlubjFnCPj8MWUYUHand8PslhnEKigfNg5l0b/cAEvRvzHSOthB3rzbe1cjRhgrTqzb9dmTCIGBWYEwIkc57e+FZoFdNZQcC2MIn63QuNoTrjXNIamQAAAABJRU5ErkJggg==",VMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAVFBMVEUAAABQh+dIh+dMh+dNhuZJhuZLhudKh+dLiOZKh+ZLiOdLh+dLiOZKiOhKhuZKh+dLiOhKiOj////p8Pzo8Py70valw/Okw/OCre9hlupVj+lKh+fHgVaqAAAAEnRSTlMAICBAUFBfYI+Qv7/Pz8/f7++YjQRgAAAA0ElEQVR42q3TSw6DMAwEUJeUUvohJtAPnfvfs9Ko4CQNEgveisXIHgtFduXOnQJ6PTspaTwWvpHcoUPCHyRxUmT6WiI1Ck7RfEVBb1s8irqlP1Y0qwM+w8hThBz+PAIDcAy0yD3DOPGjZeCKzDuEN+jOgCI1DeEFUM8AQMM4/QqGB2ZJgItZ8JMGFDQxYQVtxQ1RggUXl+RMJqygneni/iy4cEI+SrDgzG/8WVbT2ACqFAVaCa0uqSVyVGS0kUTlkeiq7Q/HuPaigN5at+uL/gLpuz1zBDpoxgAAAABJRU5ErkJggg==",HMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAQAAACIaFaMAAAAX0lEQVR42p2QsQ3AMAgEGYVN7c0YgRFSWn4Kj0AUpUB+KUVMg9AhDr08hUve4gm5gfwDlsKQ8KUEwmcXmR1GAFl9BxZNJBqcwFA4EjaUdLVGOrrPD5CuAOkKnGX1GfsN8GpnheGO5BcAAAAASUVORK5CYII=",GMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAUCAQAAAD4zq+ZAAAAYUlEQVR42rXSsQlAIQyE4YySTXWzjJARLMWzcIS8VrgU4YE2HnyVP0rxYNybOWhnfBSGgB9NefvqIqvDiPlmtt1EdoOnPBWOgE0lpv2UKQUzp0DUklAKYkrx62Hj3sU/9AGxCm8pYVxqRAAAAABJRU5ErkJggg==",zMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAYCAQAAABdXGW6AAAAeklEQVR42sXTsQnAIBBGYUdyBEdxg7jpjXCtPIe4FLH7c5AiJFaHfCA+tFwLL7Jkl7hF8RniwAmMniI6vlopVHyOBC2j7qnhCSJ0VuSr7aliCZoDp16H0fPbdYzA53gvpmZTpNkE5dnyQnlSzaZIsynSbIL+eL6PvtQJ4UChTyXPK9AAAAAASUVORK5CYII=",KMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAQAAAAkETzVAAAAnElEQVR42tXUwQ3DIBQD0IzACH/zZIN0g4ySI8UcPMKvoFUurixV6iVww09IXxYs74UT5yLra4JEirqSO1AGjpG0nWEpoxP52WQY2ndk285So21IHIaOszrvYkGCjhLJMmmM3NA50spgwYp8PgytgWuszhqGDtz3SY8a/2/Ld6JUOzFUO1HqO1GqnRiqnSh1nSjVTu75DDX54SN6AZhSSVQMW05AAAAAAElFTkSuQmCC",QMe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAQAAACiV3CzAAAArUlEQVR42u2UsQ0DIQxFbwRGYhQ2CBscmzEKLXwKRnBEFELxI/tS5+zKtp5keJKPFSgoB4Uyg0B2xbO/ArpHnjNkhAtAPyE7+2kACLPbUnHF1fhCvA5kSI2ragmCrAMCGW5Vw0EwdGAQIOZKLX2qh7lS97Nb43DDvf8rKMB66M6WLohDWOK612yyVN0mA4ZNBgybDBg2GTBsMmDZZMC2yYBtkwG2ed+lL7Ofz/0TFpaPsFvoSukAAAAASUVORK5CYII=",$Me="data:image/svg+xml,%3csvg%20width='8'%20height='8'%20viewBox='0%200%208%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203.66699L4.5%205.66699L6.5%203.66699'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",WMe="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.5%209.5L7.5%206.5L4.5%203.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",YMe="data:image/svg+xml,%3csvg%20width='12'%20height='14'%20viewBox='0%200%2012%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.00092%2012.6467C5.00092%2013.1989%205.44863%2013.6467%206.00092%2013.6467C6.5532%2013.6467%207.00092%2013.1989%207.00092%2012.6467H6.00092H5.00092ZM9.52911%206.29494C9.91963%206.68546%2010.5528%206.68546%2010.9433%206.29494C11.3338%205.90442%2011.3338%205.27125%2010.9433%204.88073L10.2362%205.58783L9.52911%206.29494ZM1.05852%204.88073C0.667994%205.27125%200.667994%205.90442%201.05852%206.29494C1.44904%206.68546%202.08221%206.68546%202.47273%206.29494L1.76562%205.58783L1.05852%204.88073ZM6.25049%201.60211L6.95759%200.894999L6.25049%201.60211ZM5.75135%201.60211L5.04425%200.894999L5.75135%201.60211ZM6.25049%201.60211L5.54338%202.30921L9.52911%206.29494L10.2362%205.58783L10.9433%204.88073L6.95759%200.894999L6.25049%201.60211ZM5.75135%201.60211L5.04425%200.894999L1.05852%204.88073L1.76562%205.58783L2.47273%206.29494L6.45846%202.30921L5.75135%201.60211ZM6.00092%202.05842H5.00092V12.6467H6.00092H7.00092V2.05842H6.00092ZM6.25049%201.60211L6.95759%200.894999C6.42924%200.366643%205.5726%200.366643%205.04425%200.894999L5.75135%201.60211L6.45846%202.30921C6.20577%202.56191%205.79607%202.56191%205.54338%202.30921L6.25049%201.60211Z'%20fill='white'/%3e%3c/svg%3e",XMe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.01953%2013.2344L12.1596%206.09434C12.5297%205.71639%2012.9711%205.41559%2013.4582%205.20932C13.9453%205.00305%2014.4684%204.89541%2014.9974%204.89263C15.5264%204.88986%2016.0506%204.99199%2016.5399%205.19314C17.0291%205.39428%2017.4736%205.69044%2017.8476%206.06448C18.2217%206.43852%2018.5178%206.88301%2018.719%207.37224C18.9201%207.86148%2019.0223%208.38574%2019.0195%208.9147C19.0167%209.44366%2018.9091%209.96683%2018.7028%2010.4539C18.4965%2010.941%2018.1957%2011.3824%2017.8178%2011.7525L11.1485%2018.4202C10.7353%2018.82%2010.1816%2019.0414%209.60671%2019.0367C9.03182%2019.0319%208.48182%2018.8014%208.07531%2018.3949C7.66879%2017.9884%207.43831%2017.4384%207.43358%2016.8635C7.42884%2016.2886%207.65022%2015.7349%208.04999%2015.3218L14.4487%208.92226'%20stroke='%23444444'%20stroke-width='1.14645'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ZMe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.62623%2016.5952L9.18302%203.47138C9.54492%202.84288%2010.4551%202.84287%2010.817%203.47138L18.3738%2016.5952C18.7339%2017.2206%2018.2806%2018%2017.5568%2018H2.44321C1.7194%2018%201.26612%2017.2206%201.62623%2016.5952Z'%20fill='%23FFD112'/%3e%3cpath%20d='M11%2014.5V16.5H9V14.5H11ZM11%207V10L10.5%2013.5H9.5L9%2010V7H11Z'%20fill='black'%20fill-opacity='0.8'/%3e%3c/svg%3e",ePe="data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.38672%205.07617L6.4082%206.0918L8.33008%208.00098L6.41016%209.91016L5.3877%2010.9258L4.87695%2011.4346L5.15918%2011.7178L5.44141%2012.002L5.95215%2011.4932L6.97461%2010.4775L8.89746%208.56543L11.7627%2011.4131L12.3135%2011.9619L12.5957%2011.6777L12.8779%2011.3945L12.3262%2010.8457L11.2227%209.74902L9.46484%208.00098L11.2246%206.25293L12.3281%205.15625L12.8799%204.6084L12.3154%204.04004L11.7637%204.58887L10.6611%205.68555L8.89746%207.4375L6.97266%205.52441L5.9502%204.50879L5.43945%204L4.875%204.56836L5.38672%205.07617Z'%20fill='%23444444'/%3e%3c/svg%3e",tPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1475%206.14844C17.3428%205.95347%2017.6593%205.95325%2017.8545%206.14844C18.0495%206.34361%2018.0494%206.66023%2017.8545%206.85547L12.707%2012.001L17.8545%2017.1465C18.0495%2017.3417%2018.0494%2017.6583%2017.8545%2017.8535C17.6593%2018.0488%2017.3428%2018.0486%2017.1475%2017.8535L12%2012.708L6.85352%2017.8535C6.65826%2018.0487%206.34173%2018.0487%206.14648%2017.8535C5.95128%2017.6583%205.95129%2017.3417%206.14648%2017.1465L11.293%2012.001L6.14648%206.85645C5.9512%206.66121%205.95125%206.34372%206.14648%206.14844C6.34167%205.95358%206.65832%205.95357%206.85352%206.14844L12%2011.2939L17.1475%206.14844Z'%20fill='%23383838'/%3e%3c/svg%3e",nPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5%2010.0078C18.3284%2010.0078%2019%2010.6794%2019%2011.5078V17.5039C18.9999%2018.3323%2018.3284%2019.0039%2017.5%2019.0039H11.5C10.6716%2019.0039%2010.0001%2018.3323%2010%2017.5039V11.5078C10%2010.6794%2010.6716%2010.0078%2011.5%2010.0078H17.5ZM11.5%2011.0078C11.2239%2011.0078%2011%2011.2317%2011%2011.5078V17.5039C11.0001%2017.78%2011.2239%2018.0039%2011.5%2018.0039H17.5C17.7761%2018.0039%2017.9999%2017.78%2018%2017.5039V11.5078C18%2011.2317%2017.7761%2011.0078%2017.5%2011.0078H11.5ZM12.5%205.00781C13.3284%205.00781%2014%205.67939%2014%206.50781V8.50391C13.9999%208.77999%2013.7761%209.00391%2013.5%209.00391C13.2239%209.00391%2013.0001%208.77999%2013%208.50391V6.50781C13%206.23167%2012.7761%206.00781%2012.5%206.00781H6.5C6.22386%206.00781%206%206.23167%206%206.50781V12.5039C6.00006%2012.78%206.22389%2013.0039%206.5%2013.0039H8.5C8.77614%2013.0039%209%2013.2278%209%2013.5039C8.99993%2013.78%208.7761%2014.0039%208.5%2014.0039H6.5C5.67161%2014.0039%205.00006%2013.3323%205%2012.5039V6.50781C5%205.67939%205.67157%205.00781%206.5%205.00781H12.5Z'%20fill='%23383838'/%3e%3c/svg%3e",rPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.5%2017.5V18.5C6.5%2019.0523%206.94772%2019.5%207.5%2019.5L17.5%2019.5C18.0523%2019.5%2018.5%2019.0523%2018.5%2018.5V17.5M12.5%2016.5L16.5%2012.5M12.5%2016.5L8.5%2012.5M12.5%2016.5L12.5%204.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",oPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%207.49985L5.5%2014.4998V17.4998H8.5L15.5%2010.4998M12.5%207.49985L14.7929%205.20696C15.1834%204.81643%2015.8166%204.81643%2016.2071%205.20696L17.7929%206.79274C18.1834%207.18327%2018.1834%207.81643%2017.7929%208.20696L15.5%2010.4998M12.5%207.49985L15.5%2010.4998M12.5%2017.4998H18.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",iPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%206.40134C15.0517%204.15279%2017.8188%203.31941%2019%204.49997C20.1895%205.69001%2019.6231%208.7789%2017.4746%2011.9961C19.6357%2015.2148%2020.2216%2018.3051%2019.0312%2019.4961C17.8483%2020.6787%2015.0742%2019.8415%2012.0166%2017.5849C9.084%2019.7502%206.41259%2020.612%205.1543%2019.6367L5%2019.5C3.80767%2018.3069%204.37927%2015.2052%206.54102%2011.9795C4.48008%208.90048%203.86233%205.94191%204.8623%204.65622L5%204.49997C6.18113%203.31937%208.94821%204.15291%2012%206.40134ZM7.16309%2012.8535C6.56467%2013.7917%206.11514%2014.7037%205.81836%2015.5371C5.50467%2016.418%205.3752%2017.1716%205.38965%2017.7509C5.40443%2018.3376%205.56136%2018.647%205.70703%2018.7929C5.83884%2018.9245%206.09299%2019.054%206.60352%2019.0332C7.12139%2019.0119%207.80829%2018.8352%208.63672%2018.4619C9.42136%2018.1083%2010.2866%2017.5978%2011.1934%2016.9472C10.6041%2016.4707%2010.0084%2015.9452%209.41602%2015.374L9.03125%2014.9961C8.33184%2014.2966%207.70854%2013.5757%207.16309%2012.8535ZM16.8535%2012.8711C16.3122%2013.5885%2015.6946%2014.3053%2015%2015L14.6152%2015.3779C14.0243%2015.9477%2013.4297%2016.4716%2012.8418%2016.9472C13.747%2017.5963%2014.6111%2018.1049%2015.3945%2018.458C16.223%2018.8313%2016.9098%2019.009%2017.4277%2019.0302C17.9385%2019.0511%2018.1924%2018.9207%2018.3242%2018.789C18.4684%2018.6447%2018.6252%2018.3386%2018.6377%2017.7529C18.65%2017.1742%2018.5167%2016.4203%2018.1992%2015.539C17.9006%2014.7102%2017.45%2013.804%2016.8535%2012.8711ZM12%207.65915C11.2473%208.25368%2010.4755%208.93856%209.70703%209.707C8.96255%2010.4515%208.31335%2011.2181%207.75977%2011.9785C8.32145%2012.7516%208.98101%2013.5317%209.73828%2014.289C10.502%2015.0527%2011.2693%2015.7341%2012.0176%2016.3261C12.7646%2015.7349%2013.5307%2015.0552%2014.293%2014.2929C15.0451%2013.5408%2015.6996%2012.7661%2016.2568%2011.998C15.6983%2011.2314%2015.0438%2010.4578%2014.293%209.707C13.5245%208.93855%2012.7527%208.25369%2012%207.65915ZM12%209.99997C13.1046%209.99997%2014%2010.8954%2014%2012C14%2013.1045%2013.1046%2014%2012%2014C10.8955%2013.9999%2010%2013.1045%2010%2012C10%2010.8954%2010.8955%2010%2012%209.99997ZM17.3965%204.96677C16.8786%204.988%2016.1917%205.16473%2015.3633%205.53806C14.5841%205.88923%2013.7251%206.39497%2012.8252%207.03903C13.5463%207.62135%2014.2771%208.27708%2015%208.99997C15.6926%209.69257%2016.3099%2010.4069%2016.8516%2011.122C17.4423%2010.1923%2017.8874%209.28909%2018.1816%208.46286C18.4954%207.5816%2018.6259%206.82743%2018.6113%206.24802C18.5965%205.66136%2018.4387%205.35286%2018.293%205.207C18.1612%205.07538%2017.9071%204.9459%2017.3965%204.96677ZM6.60449%204.96677C6.09321%204.94582%205.83879%205.07622%205.70703%205.20798C5.5629%205.35246%205.40697%205.65839%205.39453%206.24411C5.38232%206.82279%205.51549%207.57579%205.83301%208.457C6.12933%209.27934%206.57453%2010.1782%207.16406%2011.1035C7.7009%2010.3943%208.31333%209.68665%209%208.99997C9.72289%208.27709%2010.4537%207.62137%2011.1748%207.03903C10.2749%206.39499%209.41591%205.8892%208.63672%205.53806C7.80857%205.1649%207.12231%204.98808%206.60449%204.96677Z'%20fill='%23444444'/%3e%3c/svg%3e",sPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10%205C10.2761%205%2010.5%205.22386%2010.5%205.5C10.5%205.77614%2010.2761%206%2010%206H6.5C6.22386%206%206%206.22386%206%206.5V17.5C6%2017.7761%206.22386%2018%206.5%2018H17.5C17.7761%2018%2018%2017.7761%2018%2017.5V14C18%2013.7239%2018.2239%2013.5%2018.5%2013.5C18.7761%2013.5%2019%2013.7239%2019%2014V17.5C19%2018.3284%2018.3284%2019%2017.5%2019H6.5C5.67157%2019%205%2018.3284%205%2017.5V6.5C5%205.67157%205.67157%205%206.5%205H10ZM18%205C18.5523%205%2019%205.44772%2019%206V10.5C19%2010.7761%2018.7761%2011%2018.5%2011C18.2239%2011%2018%2010.7761%2018%2010.5V6.70703L11.8535%2012.8535C11.6583%2013.0488%2011.3417%2013.0488%2011.1465%2012.8535C10.9512%2012.6583%2010.9512%2012.3417%2011.1465%2012.1465L17.293%206H13.5C13.2239%206%2013%205.77614%2013%205.5C13%205.22386%2013.2239%205%2013.5%205H18Z'%20fill='%23383838'/%3e%3c/svg%3e",aPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%2019a.5.5%200%200%201%200%201h-8a.5.5%200%200%201%200-1zm3.308-11.5a4.308%204.308%200%200%201%203.378%206.979l1.668%201.668a.5.5%200%201%201-.707.707l-1.668-1.668a4.308%204.308%200%201%201-2.67-7.685m0%201a3.308%203.308%200%201%200%200%206.615%203.308%203.308%200%200%200%200-6.615M8.5%2014a.5.5%200%200%201%200%201h-4a.5.5%200%200%201%200-1zm0-5a.5.5%200%200%201%200%201h-4a.5.5%200%200%201%200-1zm11-5a.5.5%200%200%201%200%201h-15a.5.5%200%200%201%200-1z'%20fill='%23444'/%3e%3c/svg%3e",lPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9934%208.5H12.0009'%20stroke='%23383838'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.2018%2016.1667V12.0001C12.2018%2011.6072%2012.2018%2011.4108%2012.0798%2011.2887C11.9578%2011.1667%2011.7613%2011.1667%2011.3685%2011.1667M19.5%2012C19.5%2016.1421%2016.1421%2019.5%2012%2019.5C7.85786%2019.5%204.5%2016.1421%204.5%2012C4.5%207.85786%207.85786%204.5%2012%204.5C16.1421%204.5%2019.5%207.85786%2019.5%2012Z'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",uPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.5%2017.5H14.5M7.5%209.5H16.5M5.5%205.5H14.5M9.5%2013.5H18.5'%20stroke='%23383838'%20stroke-miterlimit='1.41421'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",cPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5%205C15.0389%205%2017.9999%207.86724%2018%2011.4229C18%2013.0282%2017.3923%2014.5291%2016.3984%2015.6914L19.8535%2019.1465C20.0488%2019.3417%2020.0488%2019.6583%2019.8535%2019.8535C19.6583%2020.0488%2019.3417%2020.0488%2019.1465%2019.8535L15.6943%2016.4014C14.5572%2017.3902%2013.0906%2018%2011.5%2018C7.95263%2018%205%2015.0474%205%2011.5C5%207.95262%207.95263%205%2011.5%205ZM11.5%206C8.50492%206%206%208.50491%206%2011.5C6%2014.4951%208.50492%2017%2011.5%2017C14.4869%2017%2017%2014.4262%2017%2011.4229C16.9999%208.43621%2014.5034%206%2011.5%206Z'%20fill='%23383838'/%3e%3cpath%20d='M11.5%205.5C12.0158%205.5%2012.6412%205.97409%2013.167%207.11328C13.6732%208.21012%2014%209.76059%2014%2011.5C14%2013.2394%2013.6732%2014.7899%2013.167%2015.8867C12.6412%2017.0259%2012.0158%2017.5%2011.5%2017.5C10.9842%2017.5%2010.3588%2017.0259%209.83301%2015.8867C9.32677%2014.7899%209%2013.2394%209%2011.5C9%209.76059%209.32677%208.21012%209.83301%207.11328C10.3588%205.97409%2010.9842%205.5%2011.5%205.5Z'%20stroke='%23383838'/%3e%3cpath%20d='M6%2011.5L17.5%2011.5'%20stroke='%23383838'/%3e%3c/svg%3e",dPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.57%206.42969L8%2011.9995L13.57%2017.5694'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",fPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5%205C14.3284%205%2015%205.67157%2015%206.5V8H17.5C17.7761%208%2018%208.22386%2018%208.5C18%208.77614%2017.7761%209%2017.5%209H17V17.5C17%2018.3284%2016.3284%2019%2015.5%2019H8.5C7.67157%2019%207%2018.3284%207%2017.5V9H6.5C6.22386%209%206%208.77614%206%208.5C6%208.22386%206.22386%208%206.5%208H9V6.5C9%205.67157%209.67157%205%2010.5%205H13.5ZM8%2017.5C8%2017.7761%208.22386%2018%208.5%2018H15.5C15.7761%2018%2016%2017.7761%2016%2017.5V9H8V17.5ZM10.5%2011C10.7761%2011%2011%2011.2239%2011%2011.5V15.5C11%2015.7761%2010.7761%2016%2010.5%2016C10.2239%2016%2010%2015.7761%2010%2015.5V11.5C10%2011.2239%2010.2239%2011%2010.5%2011ZM13.5%2011C13.7761%2011%2014%2011.2239%2014%2011.5V15.5C14%2015.7761%2013.7761%2016%2013.5%2016C13.2239%2016%2013%2015.7761%2013%2015.5V11.5C13%2011.2239%2013.2239%2011%2013.5%2011ZM10.5%206C10.2239%206%2010%206.22386%2010%206.5V8H14V6.5C14%206.22386%2013.7761%206%2013.5%206H10.5Z'%20fill='%23383838'/%3e%3c/svg%3e",hPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.5%207C19.3284%207%2020%207.67157%2020%208.5V15.5C20%2016.3284%2019.3284%2017%2018.5%2017H5.5C4.67157%2017%204%2016.3284%204%2015.5V8.5C4%207.67157%204.67157%207%205.5%207H18.5ZM5.5%208C5.22386%208%205%208.22386%205%208.5V15.5C5%2015.7761%205.22386%2016%205.5%2016H18.5C18.7761%2016%2019%2015.7761%2019%2015.5V8.5C19%208.22386%2018.7761%208%2018.5%208H5.5Z'%20fill='%23383838'/%3e%3cpath%20d='M8.5%209C8.77614%209%209%209.22386%209%209.5C9%209.77614%208.77614%2010%208.5%2010H8V14H8.5C8.77614%2014%209%2014.2239%209%2014.5C9%2014.7761%208.77614%2015%208.5%2015H6.5C6.22386%2015%206%2014.7761%206%2014.5C6%2014.2239%206.22386%2014%206.5%2014H7V10H6.5C6.22386%2010%206%209.77614%206%209.5C6%209.22386%206.22386%209%206.5%209H8.5Z'%20fill='%23446ECA'/%3e%3c/svg%3e",pPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%209.3018C6.08346%206.49281%208.80901%204.5%2012%204.5C16.1421%204.5%2019.5%207.85786%2019.5%2012C19.5%2016.1421%2016.1421%2019.5%2012%2019.5C8.80901%2019.5%206.08346%2017.5072%205%2014.6982M7.5%209.5H4.5V6.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",mPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.5017%205.50391H6.50366C5.95138%205.50391%205.50366%205.95162%205.50366%206.50391V17.5039C5.50366%2018.0562%205.95138%2018.5039%206.50366%2018.5039H8.5017M8.5017%205.50391V7.50192C8.5017%208.0542%208.94942%208.50192%209.5017%208.50192H12.5045C13.0568%208.50192%2013.5045%208.0542%2013.5045%207.50192V5.50391M8.5017%205.50391H13.5045M13.5045%205.50391H15.0863C15.3512%205.50391%2015.6053%205.609%2015.7928%205.79613L18.2101%208.20891C18.398%208.3965%2018.5037%208.65114%2018.5037%208.91668V17.5039C18.5037%2018.0562%2018.0559%2018.5039%2017.5037%2018.5039H15.5M8.5017%2018.5039V13.5042C8.5017%2012.9519%208.94942%2012.5042%209.5017%2012.5042H14.5C15.0523%2012.5042%2015.5%2012.9519%2015.5%2013.5042V18.5039M8.5017%2018.5039H15.5'%20stroke='black'%20stroke-opacity='0.8'%20stroke-linejoin='round'/%3e%3c/svg%3e",gPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.5%2015.5C16.5%2014.3954%2015.6046%2013.5%2014.5%2013.5C13.3954%2013.5%2012.5%2014.3954%2012.5%2015.5M16.5%2015.5C16.5%2016.6046%2015.6046%2017.5%2014.5%2017.5C13.3954%2017.5%2012.5%2016.6046%2012.5%2015.5M16.5%2015.5L19.5%2015.5M12.5%2015.5L4.5%2015.5M11.5%208.5C11.5%207.39543%2010.6046%206.5%209.5%206.5C8.39543%206.5%207.5%207.39543%207.5%208.5M11.5%208.5C11.5%209.60457%2010.6046%2010.5%209.5%2010.5C8.39543%2010.5%207.5%209.60457%207.5%208.5M11.5%208.5L19.5%208.5M7.5%208.5H4.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",bPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%204a8%208%200%200%201%207.545%205.334A8%208%200%200%201%2020%2012a8%208%200%200%201-.455%202.667%208.003%208.003%200%200%201-15.09%200A8%208%200%200%201%204%2012c0-.934.16-1.832.455-2.666A8%208%200%200%201%2012%204M9.3%2015c.167.79.399%201.497.676%202.092C10.592%2018.409%2011.342%2019%2012%2019s1.409-.59%202.024-1.908A9.8%209.8%200%200%200%2014.7%2015zm-3.625%200a7.02%207.02%200%200%200%204.038%203.616%206.6%206.6%200%200%201-.643-1.1c-.338-.723-.607-1.577-.791-2.516zm10.046%200c-.184.94-.453%201.793-.79%202.515a6.6%206.6%200%200%201-.645%201.101A7.02%207.02%200%200%200%2018.326%2015zm-10.43-5a7%207%200%200%200-.001%204h2.829c-.08-.64-.122-1.311-.122-2s.042-1.36.122-2zm3.837%200a15%2015%200%200%200-.131%202c0%20.696.046%201.367.13%202h5.745c.084-.633.13-1.304.13-2%200-.697-.046-1.368-.13-2zm6.753%200a16.4%2016.4%200%200%201%200%204h2.829a7%207%200%200%200%200-4zM9.714%205.383A7.02%207.02%200%200%200%205.674%209H8.28c.184-.94.454-1.792.791-2.515.186-.399.402-.772.644-1.102M12%205c-.658%200-1.408.59-2.024%201.908A9.8%209.8%200%200%200%209.301%209h5.398a9.8%209.8%200%200%200-.675-2.092C13.41%205.59%2012.658%205%2012%205m2.285.382c.242.33.459.704.645%201.103.338.723.607%201.575.791%202.515h2.605a7.02%207.02%200%200%200-4.041-3.618'%20fill='%23444444'/%3e%3c/svg%3e",yPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5%205.5V11.5M11.5%2011.5V17.5M11.5%2011.5H17.5M11.5%2011.5H5.5'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",APe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5%208.5L10.5%2015.5L7.5%2012.5'%20stroke='%23444444'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",_Pe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%206L14%2014M14%206L6%2014'%20stroke='%23383838'/%3e%3c/svg%3e",vPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208L3%2012L7%2016M17%208L21%2012L17%2016M14%204L10%2020'%20stroke='%23444444'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",SPe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14.9998'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3ccircle%20cx='4.99975'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3ccircle%20cx='9.99975'%20cy='9.99975'%20r='0.999754'%20fill='%231C1B1F'/%3e%3c/svg%3e",CPe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.02215%2014.8161L0.421696%2011.728C-0.140565%2011.4584%20-0.140565%2011.0417%200.421696%2010.7967L2.71963%209.71826L6.99771%2011.728C7.55997%2011.9976%208.46448%2011.9976%209.00229%2011.728L13.2804%209.71826L15.5783%2010.7967C16.1406%2011.0663%2016.1406%2011.4829%2015.5783%2011.728L8.97785%2014.8161C8.46448%2015.0612%207.55997%2015.0612%207.02215%2014.8161Z'%20fill='%23FF6F3D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.00076%2010.9948L0.420411%207.90306C-0.140137%207.63315%20-0.140137%207.21601%200.420411%206.97064L2.6626%205.91553L7.00076%207.95214C7.56131%208.22205%208.46306%208.22205%208.99924%207.95214L13.3374%205.91553L15.5796%206.97064C16.1401%207.24055%2016.1401%207.65769%2015.5796%207.90306L8.99924%2010.9948C8.43869%2011.2647%207.53694%2011.2647%207.00076%2010.9948Z'%20fill='%2395C038'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.00076%207.21299L0.420411%204.16576C-0.140137%203.89973%20-0.140137%203.48859%200.420411%203.24675L7.00076%200.199521C7.56131%20-0.066507%208.46306%20-0.066507%208.99924%200.199521L15.5796%203.24675C16.1401%203.51278%2016.1401%203.92391%2015.5796%204.16576L8.99924%207.21299C8.43869%207.45483%207.53694%207.45483%207.00076%207.21299Z'%20fill='%235DC0E8'/%3e%3c/svg%3e",wPe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5002%2017.5002L13.881%2013.881M13.881%2013.881C14.5001%2013.2619%2014.9912%2012.527%2015.3262%2011.7181C15.6612%2010.9093%2015.8337%2010.0423%2015.8337%209.16684C15.8337%208.29134%2015.6612%207.42441%2015.3262%206.61555C14.9912%205.80669%2014.5001%205.07174%2013.881%204.45267C13.2619%203.8336%2012.527%203.34252%2011.7181%203.00748C10.9093%202.67244%2010.0423%202.5%209.16684%202.5C8.29134%202.5%207.42441%202.67244%206.61555%203.00748C5.80669%203.34252%205.07174%203.8336%204.45267%204.45267C3.2024%205.70295%202.5%207.39868%202.5%209.16684C2.5%2010.935%203.2024%2012.6307%204.45267%2013.881C5.70295%2015.1313%207.39868%2015.8337%209.16684%2015.8337C10.935%2015.8337%2012.6307%2015.1313%2013.881%2013.881Z'%20stroke='%23383838'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",OPe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.0315%2016.6276C18.2814%2017.3778%2017.264%2017.7992%2016.2031%2017.7992C15.1422%2017.7992%2014.1248%2017.3778%2013.3747%2016.6276C12.6245%2015.8775%2012.2031%2014.8601%2012.2031%2013.7992C12.2031%2012.7384%2012.6245%2011.7209%2013.3747%2010.9708C14.1248%2010.2206%2015.1422%209.79922%2016.2031%209.79922C17.264%209.79922%2018.2814%2010.2206%2019.0315%2010.9708C19.7817%2011.7209%2020.2031%2012.7384%2020.2031%2013.7992C20.2031%2014.8601%2019.7817%2015.8775%2019.0315%2016.6276ZM19.0315%2016.6276L22.2031%2019.7992M4.20312%204.19922H19.8029M4.20312%208.99922H9.0029M4.20312%2013.7992H9.00313M4.20312%2018.5992H9.00313'%20stroke='%23383838'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",TPe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='7'%20fill='%23EF4444'/%3e%3cpath%20d='M7%2011C7%2010.4477%207.44772%2010%208%2010C8.55228%2010%209%2010.4477%209%2011C9%2011.5523%208.55228%2012%208%2012C7.44772%2012%207%2011.5523%207%2011Z'%20fill='white'/%3e%3cpath%20d='M8%204.5C8.27614%204.5%208.5%204.72386%208.5%205V8C8.5%208.27614%208.27614%208.5%208%208.5C7.72386%208.5%207.5%208.27614%207.5%208V5C7.5%204.72386%207.72386%204.5%208%204.5Z'%20fill='white'%20stroke='white'/%3e%3c/svg%3e",RPe="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='12'%20height='12'%20rx='4'%20fill='white'/%3e%3c/svg%3e",EPe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='7'%20fill='%234A87E7'/%3e%3cpath%20d='M11.5%205.5L7.5%2010.5L5%208'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",MPe="data:image/svg+xml,%3csvg%20width='12'%20height='16'%20viewBox='0%200%2012%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%200C2.77614%201.40922e-07%203%200.223858%203%200.5V8C3%208.01656%202.99669%208.03268%202.99512%208.04883C4.13869%208.27856%205%209.28878%205%2010.5C5%2011.7112%204.13859%2012.7204%202.99512%2012.9502C2.99675%2012.9667%203%2012.9831%203%2013V15.5C3%2015.7761%202.77614%2016%202.5%2016C2.22386%2016%202%2015.7761%202%2015.5V13C2%2012.9831%202.00228%2012.9666%202.00391%2012.9502C0.860897%2012.72%20-2.86384e-08%2011.7108%200%2010.5C1.05859e-07%209.28911%200.860803%208.27892%202.00391%208.04883C2.00234%208.03271%202%208.01653%202%208V0.5C2%200.223858%202.22386%201.76916e-07%202.5%200ZM9.5%200C9.77614%202.41411e-08%2010%200.223858%2010%200.5V3C10%203.01656%209.99669%203.03268%209.99512%203.04883C11.1387%203.27856%2012%204.28878%2012%205.5C12%206.71115%2011.1386%207.72039%209.99512%207.9502C9.99675%207.96665%2010%207.98311%2010%208V15.5C10%2015.7761%209.77614%2016%209.5%2016C9.22386%2016%209%2015.7761%209%2015.5V8C9%207.98314%209.00228%207.96662%209.00391%207.9502C7.8609%207.72003%207%206.71082%207%205.5C7%204.28911%207.8608%203.27892%209.00391%203.04883C9.00234%203.03271%209%203.01653%209%203V0.5C9%200.223858%209.22386%20-5.17733e-10%209.5%200ZM2.5%209C1.67157%209%201%209.67157%201%2010.5C1%2011.3284%201.67157%2012%202.5%2012C3.32843%2012%204%2011.3284%204%2010.5C4%209.67157%203.32843%209%202.5%209ZM9.5%204C8.67157%204%208%204.67157%208%205.5C8%206.32843%208.67157%207%209.5%207C10.3284%207%2011%206.32843%2011%205.5C11%204.67157%2010.3284%204%209.5%204Z'%20fill='%23383838'/%3e%3c/svg%3e",PPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZEtDoNAFITnbSqqGnRVT1BdV9tb1PQC7QnoBRoOUMMtcFg0J0ChCQoBLCA2IWT5C0v4/dR7O8nM7g6wdEgM15/95BxGPmoYhkfEdPdzN4uFidPcXFdgXnDhPDXEwsoC1KHJAkZh9IBDnWC9bjifjuiCH0Z4/B2pNt0L6m7Ul72DVjbaQdOfV9k7mFdAAEUQwZMFvMvCAPMgifHFasgAjIwsM/J7FVgAAAAASUVORK5CYII=",IPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC3SURBVHgB7ZJBCsIwEEX/hB6gR+gJ3LvyKK5d6gnqBaQ7157EpXtPkCP0AGpsC4EKNYNjRgvJg8BMhuEF8oHUIF8sDue1c2i6soQOlsjU193q1DfG33bSWlHaUzn3aHxjxgPoU06Jf8rfxEVouFlWw5FwvNjhvMNwYincblAcejEHt1twy9/IQ+RUv5BT/Qk51bMRR0m15EuipFqS/iiplgQwpzotcQtliGCnxNvxQEHa3m/YI1meArZGr61SULYAAAAASUVORK5CYII=",jPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADtSURBVHgB7Zc9CsIwGIbfBg/gETyAuDv2JLo6qRRndRdqJ1c9SUd39QAeoRewMRTFpihfJD+08D0QaJqQPE36Dh/AdIyo+WKU5mtZYqEe+/BLodrxmsRL/BJSMulLJhhKYHtJ4s27L+qDSmaKwEhgXu+Lxrjva/qGtqdAy2AhitYJ9UwmzcaDqtlwON+rRmF0QrYy/6xhJGTyZa7WMLoy0+N2AaeMglNGwSmj4JRROE+Z7fU6T5ltIp2nzPbn55RRsBBFU6hAeLQ9NSFV1mYIjJQ4QXfQGe7yvRCYqIleq9goQlE+kN1Wn7qe6SRPOzRTtiriQgMAAAAASUVORK5CYII=",DPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFISURBVHgB7ZivbkIxFMa/lmWb2BbkMoWYmmJ2jhdY9gqzU8NsDzGBG5JXgCcAhQWFQqAIkoCBhH/tJZAWUc5NWm4J56due89Nfren+cQBmAtFHG4UK83Cco0a1iiqZR6np56TKHfLpYG5aYkmkit0kI2gyVjJvpqy0nyrJCvIXlKTT7pqIA8KPhAL26u3RyJerM7GLGrBor45G9ErauH7yyN+S8+4vyF/4mQ4maHaHqDRG5HqySf69VbwJql5erjFj/pxKmTRu2t/kjum8wW5liz61+on7fKFlvxXradCPiZ9l6j3KQQcT77heDoGxxPHExGOJ98Ejae0EeQiaDyljSAXweMpTQS5CBpPaSPIBceTb1jUN2crOkak2KICXcRDw1xYojmBT0RwqkIkg9xvc88S1RNePelVj3VkgBZUXW1JYU+bmYtmA3mPe4AD8x5bAAAAAElFTkSuQmCC",NPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFYSURBVHgB7dmrbgJBFAbgf4amrWgbZFOFqKqito4XaPoKtVXFtA9RgWtlXwGeABQWFAqBIkgCBhJuM0tIYGZhOZtlZzacT8FekvPvnMwRAzB23kTYxWKlXpgv8Y8liupvHu5VcxLldrnUM29YAYLiF2jBj8K3DVWIZzOENJ9SxVfgX/FaPugKgwx58A2+Wrf0DolssTojawEsHMA1DuDaBYhen+7xXXrE7RX51YP6own+mj3UOgPSe+QV+HgpJF689nB3jS/1YajIAW4uky9+YzydgYoc4KfRDZY7abr4X9VCVOTPqXuU2qenxNuoazwHksJz4Fg8B/bgOZBVHMC11OZA3H0+SmpzIO4+HyXVORBnn4+S2hyIu89H4TngGgdwjQO4FhZgiAyxAwi04a+aecEKkBN4h4erIERwyPdpXrcC6FNAfRqoflbhAV246oqGFPYJJWMMWAE7m3uIhCIgGgAAAABJRU5ErkJggg==",LPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEKSURBVHgB3ZU7C8IwFIVP6gt8gCA4+zfcfIziJLiKi6Cbq5Muzk4KLuIquOkouvk3nAVB8AFqNSZBS2ltobSl1G/pTW65J7knJIDfId/g3KzUqIwBm0nCBqzgDgF046P5lI8lJfNE125xDgUy9MkW+kFSJ+AcSZ2AW7guEDRLhstVhAolEcvbDW6ziYij/SGkVFr573XY49ppWROIVOsIFUvKmMf0esF9MYMVDAWC2bxujotwAaPV/sI7Dx6rhfBAjbxdi68jHvBWkGiMtSr3EVxa7j9HuSpOjQqFgyTGc1HbOw+0fTbDzAPvdmDlrJvh/8tOLXCEQxDCXjWtAJVoW52wwRGE9vA3vAG0rE29KUs4wAAAAABJRU5ErkJggg==",FPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF6SURBVHgB7ZYxS8NAGIbfpLHUqlAQnBQ6ufgL7NSKmzoVXLsJ4iT9A+k/cFAEJzsqdNKOWqd2cPIfOAtCQY2lSTxznyaU5i6tqQmF9IFwl/vuy3tf8uYSIGkobuf9sFxhFk6ckRwiwBF6Rgr64nmjzs9VL2JDj0qUw4A8s53CflEHA4ienE84bmbCsaGNmpBa30B6b59aZnzAfnpE/+YaX68vFM9UjqAVSr48q9NC7/JMet3AirXNIuarNRLlKNkFGstUderTHIHoT24p6NLBwrxSYdLyCua2dqhvtR+Ec6yOeNxbmCzAq+QCMtS1PLW9+inAjz8irZh9GgjCvdVhkVbMHPMww3AEssK42W5R++/m4g7u314JY9zR7jMMa67A18m8a9IC0tu7UFfz1Odj5n3Tm8PNpRWKvtxR5vI+i28HZYYYWLpokOZ07lwy44zDZDtXSFHKnWTnku1K4zAz1zDJFu4iYhTF+bceFmYqOx4MREAXCqshsXwDBZx7lxVVCpYAAAAASUVORK5CYII=",xPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHOSURBVHgB7Zc9TwJBEIbfO5H4RWJiYqWJNjYWVhZaES3RRhJbbaSwEUNnA/wAo7ZU2OJHI5QqlfwCGysLKyIJCREjIOfORgh33nFDgBOSe5q7ndnbfXdm5zYLuAwZitFQCu1EoSlh4ZlGP9FQVBQtOZW4PYaVICHmTJjCcBQl7ktcxxot1eDch+NoR60tg6A+p8kc3ZwqBgxXkB0DJ8jD7ahMTGJ0MwDPmh/qzCzqhTxquSyq9xlo5Q/Zh+xjkZh8GqmkU6jcpWznYUWIxIxH4vBu7TYnoye1yU5+ubpfsWZQXw4sQRQZdW7BfABhH90IyHeKGEXODE50CFbKaOVt/et+mRISUz45RDewImSVBq6/E1iC6u/59v5Ce38nsFJGe8O7bb0pa0/Z5jtt8pGlZZ2fqvDrKin6PcIOVoSqDxnU315NfWQnvxxsfvGPGIKq0LOyCg4sQbTCz9OorJRGeuhJbbI3/kOasH2/PJt+X8vZR0eKb22UQkEN/4AvcdPU4Z5ldrCqjCqM++u3oqdnWbdiOhmDJYh7DvViDFbKZLjT3Yvi4FaZHQMvqAjn0c1pvLlewGkUXOqbBkoHwXNh3UP/b7FFCkDrvd5lKPkBKNOVoQdsMjcAAAAASUVORK5CYII=",BPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIfSURBVHgB7Zi9LwRBGMaf2fvKHQWRqEiuUtDQ6vQkGlfTSTTEP0CjE42IykUnpzlBiasoFCgoKFxCJSTX+LrbDzMjGzvr7M1tdu1y+0smuZt5d/a5d2aemRsgokUh9orX6fGsasTy0DFIWzvw2xAU4yQxl17fKovVFrhILXYWiECRSlxJDFnFKtZW1UishEAko0M1anlrhSAUhj6OsGDQqWdBQXgRRjbMQgUioV7zZ4TG0SSxvgEkx3JQerIgmTbo92XUjo9QO9j/3vnwCFITkzzOjv70gOreNlT6rAxNZZQJTM8vcrHmy5ngVG4KmaU1KF3dYvzoRF2R/Dkay36ELNJCWcfJ0Zxje2pyRqgj6XY4Ybw+Q/r9soFJmrVGsEyzYvJe2OBDXA/j5RnV3W3IIj1HrQKcUHqz0K4v+Wf1pMSLF0hnlGQycnHpNviBtFD98UEu7u4WfiA99GwI2ap3gs1H7ebqq/Mg7Kl2uP/jwjCp7hb4IjEJxJ6YgLflBZqBUt2290L+28Lx0p6a2plYRt82V6HQXSjW1/+5M7HhvjgVMmnC7InvYraNgIv0y54Ewfe3vDQiEHsKmv93enKyGjf4Zk9OVuMG3+ypkdW4wZfTk9NJyA2+2ZOXVuOGyJ68JhLqNXahFYQUUSjBOUKCQbBj/S7ejxKN/dUMQ1YrGknMWisEoZ3rxbKqaEO0uohgqICQkkpvmzttV+MRLcsHyhXUF5w0o8cAAAAASUVORK5CYII=",kPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAILSURBVHgB7Zm7T8JAHMd/VygGHwlEw+TA5OIio066Y0JiYNbFOOpf4kocZDUQE4zsMumoi4uLDEwmJiQGiND27K8JWFqwvQt9YO+TdLlH+vve/R53OQCBINqQaY39s0JWobEKaLCjj0hB0BCox4l8kSzftOxdFgzj1dhzKAyfpBOX5JxVhGQdpVD5MoTGIymFDivWRpsAoFoBwgrVXdqCBIuFzTMWTYANISBohICgiQMnsa1tSByWQNrMAlleGberb68wfHwA5ak5+aO9A1gqHk+MNaN9fsCgUQNFn8sClwA0PJEvTe1DYfgNNjIwuK/+zskXZxqPSOsZQyCrAGYXiu/uzzTeDI5BISNIctVxDu13gRVmAbLuCm7BnRrxXb023GQWtNfVd6wGrDC7kHlVncD4GIExYY2LeeBpFvrL5+dF9OoA7fUgTDDHgNZ+dx0HWBPGP/KoDjDvgDm3OzE0GeO2DrDCLABX1Y0IHGPOOl7VAa5KPGhUjS3HmmB2J8zlWrtlGG92HwTrgHH00Fd6Grx1wHap/zo9ohBi1q5uJ2wWx+mgid59wCmf8+JbHXDK57z4Vgfc5HNefLkPOJ3refHtPuDVuZ4XkUaDRggImn8poAMLhF0AgRcIKZTAnbXN/kZG1BMI5y50VCKfWxttAtLlekuR1JzeVYdw0AFCmor+Qpme8swqEESdH7s2v3Q8t4opAAAAAElFTkSuQmCC",UPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF7SURBVHgB3VUxSMNAFH0Xk9qCShylDp0ERyepW0cXhc5Ci6s4OAtSBQcHQZSuouDs4OCi6ChOjhUXHRQdQ5WmhjTn3VlrEnuXmraDvuG4u3f33v/3cxfgr4N8dd7WJgqUejugMNEFCCEPrCkNbdwd8rHWYigtdSv+KUMz1GOBNqH5CfQO5g+DfkHHL0GSI0gtnQB2Fc7VAdybY+X6jjLgogOZ6WZ/GJqZhjY2iWR+C4Ozq8q9epRwIrcMY6YoxrXtHGtpYA3nGi8VaSbKDFKLRy1xFYypvJSTGuhsEz+GMGj9FZ71GJgjo2lIdWREIltsO0/rVdjleXF8/jkZpBm0i97IFliBxwPiPBuVgTQDvskvJAxYPcI1qZXn4LEiSwOVEd6zfFMAiuiVBs7lHqLAP03PekIsg8b9tdKEZ/h+uokoKC+ac7ELt3ImbisvOq8JF3ZvzwXXCSLfIi5o7y8gLvr+mn4bEFjoEcRfLWxAQVb8RHx1Eeg6/g0+ANF4ezn6+U3RAAAAAElFTkSuQmCC",qPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGpSURBVHgB7Za9S8NAGId/l4aa+lEyKjq0i9BRBzsr+A/UTQRBJxUFcXAQpAoObuLgJiiUjh1c3HQTFMSx4GIHRcdiRaPWnHlPLf3MXW3jEh9IL727vM+9711LAL/Bfm6e1genObd3wGHCAxhjOecj2b15fUjftdII50mvpF/heYTbTmLfaOUD8B6zRvzX/Iubxkhso2vtUrSaOaD8XMtiLToCZoShDyXQuXIq2raKKXhwdBGhmZRoG0GZB6JxaTwlsdYXQ2jhCMGxJRFUH55wnd/hyFsW075RlprZD1VorixrqdiYTYkyN+SlULebSRaquw0GInFpplZ6zjlgtdkVrzL4tZj2th7M6Cnd2/k72BJJ0+JyQWV/GMbkHuz7bEU/LaKouAhXMbcKjR+MjQN0VfHsLMZ+yEKG6+FSCVCD9ag0zVX8cXMuLlWozFTulsXE6/GWU3J5Fnb+Fm8nu1BFKqYDZKXnRWA3qbU/pZwtoatMonJTYPrL1HpjpZ+Z2IrcBd7PDpSq0rSYoGyszCrahZ/fQBjy8Bjxbl0t5mDL5QPtt4rENuBbPgHagIuKgS7sOwAAAABJRU5ErkJggg==",JPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHpSURBVHgB7Zg9SEJRFMf/7/n6MCocCxqKHLKtSWhLcmhtDpKaK6OhoaIi9z7cy8DZsSl0S5ra0kFoKXKUGjI17Z0HL3zix7k3fSj4A5F3Pe+d/z0f13sf0KfHUGoHPg/dx/poEBW40EkU5HTnkdGzzK51uFrMkftcFxKEvZyOhTIn5oVa82MA9rNTfWEV1Ok01cfiU0WX0XWCNLSRwaUtaB4/ytkUCvEwyrlXiNJeQb5t41ud9EBbWEXxIYJCIoxK/oP9DKmUOaa9GFo5wMhewohKIwYWA3BuRKEMj4OLkCB6MAlxbkYNZ6pr6i8qDR3o0WomWloQiaHZkhBR6B7HjJdlyxZEs6TZyqLNLbPsWIIoNTKRqcYx72fZsQQN+ng1QB3ViNJTDBxYba9O8FJViF8Zn//AS1mL2hHpola0ZWGk1m/U/kbUmqSyFlaEZP4CTDQPr7tMWIJ+nu8hSzmbFrJnCSql5QWJFjkvQi+PKCZvIUoxGdHT/SZ0D3ulppmW31Ncc8OWtiCisAXRFuLreo0VKYoM2YpsO0yE2p4cfN+F9H3OjdHmtGCaaxR1IhU/1RulWBapdYjqIh/bRyfob/JbYRWkH29hPxaftQfFS9hOxdK2dV42zF5AUdbteNlAAag+1/fpSX4BtHKWwOUwEkwAAAAASUVORK5CYII=",VPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJcSURBVHgB7Zg/aBNRHMe/SV80WSQdRQfdzNZMopugs5pRClYdRdDJtYOCToKim7ZC51Id6qCok0WXusXNDkrHhnZI0tzl+r6vBN4dafN7L9fmSvOBkPvz3t2H3+/9uweMOabkkheasxfOBUEwp+9MIUIZh8+SUupRafbPmn0xJmokw2B1RII2DS1btWXz9l0t+SIDkqRssmoRE9WSN5AdpuyTPLJLLLNZFo1xZEQVDoh8+SxO1p6Z4+56HZ2V9+g2/sGXAxNV1ZuYOH/RHPO/cHkGnR/z2P72ClFrE64cauopW7r/0UTblaFEc8VTOHHlAUp3F8yP5wNfWD6D4q03orI2XqnvCTJCsYfpdLMtDiJ/umLqtz89hRTniDJtjF5SkrhEifVdyjuJ8sHFewsmImlQuHRbXNZJlOliG0uL3qggQSzKlPdL916Ea7+QJuLO5JImEv79idbi4z0zELW2EKwuQopY1KdduogMfL+4oEA0rU7WD3FEJUOJqlxDsfYc3Y3+czrTHda/eM35YlHOzyLZam3f+2HlKprvpuGKOPVcAY0SsSh7cRoE9c/wQSwqmcMlsI36IBZlGx1WtrMyrzvSf/jgNIVuf33pvUpnvfayfLWUxEmUUW29nXaWZUdkvWFwXuYxdc3X18XNgOnmcOSb8h5eC2dGtr38RH8Dzek1wIyZkfjjOMt7jCAXJfxG8vk+Sk20B6PkskofhvEGRNrERXNoIKMkd/N+IyNEET7Y5/H9UaXuZCKq2iEsqIf2pZjopN7hDSZUVRdcwijYDdJ3OkwmtsbHHFt2ANfV1DEbDQ1VAAAAAElFTkSuQmCC",HPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKaSURBVHgB7Zk/bNNAFMa/xOf8GajSDQRD2AhTs1DBRCsYYAF1RJUAMaIimLt0gIGhQgLBBhSJtdAusCBgoqIDYSrd2oGqIxFD0yZ23HuuIkW22/rdnRKn9W+JdY6t9z1/d+/ZB6SkHG8yUYONmXNlx3HeyrMj8FBC/1kQQjwqzqyuB0+EBPjBu04tIYF3U5ciqkER2eC/ZPDPEhg8UfJdESAkQAZ/E8llJDiQxWARcsagCQiRCug3Aj0if20a9qU7aG/+QXNpDu21ZbTrf6FLTwRkT533g987rqAw8RTe9n+0fsyh+e0FdOiJhTL5E+GxwhBy4w9QuPXKP1bFmAAKwiqPIjc2BVG5Evs6UbmK/PVpqKJtIQrcvnjbt0h3JhtvJuGu/Yx1D1GdgL25gtbSO3DREpAtnUHh3nv5ezp0LhMxdhBkJ6f20Z8brBigCAVfvL8YGbwKnSfJjgMKdDKvM/misM6OgouSgNz4FCvzXsz1vicCKPs06Ti06xuxJmhLFjgu7Ems4lNi59NjtGrz+9rO+7ehVJnZAqiSqkJthGn4FoopwDqpLpQD+wnEXXn8wlYcgnNAMTPR0LEFUKGJK4Im+2ETnlOxo2BbiFspD8MqX4AObAHuyheYRHdiswU4q+YEkP9178d/AtKvOp7thpo3XZRaiZ3PT6ALZb/59Tl0URJAvtURQQvB9utJmEC5nVZ9n6XM09JJ/ZEJtF4pyQJbs5djFyOn9gGNlzeMthTar5SUya3ZMb8VtmXRysoWotNukFUoWHd9Gc6veWNZ78bYZxWTqxOH9NNivzmCAjKoY4CI2qH5jYTieVgMjoX3yIS4m8inIGNybfEwOBwSMCx3AR1LVOUFC0gCe8n8TjENR2yzpqQcd3YBRU/rPUoeZ3EAAAAASUVORK5CYII=",GPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADRSURBVHgB3ZXBCcIwFIb/FC/eCtaj4Axu4FEdQcEVdIO6QVcQ7Ajq0Q2cQfRoBU96S4yBtiE1UWyqpN8leXmP/0/ICwFch6ST8bY1JZREDPBRCnKAR8N4cFk+Iy9bZ15YXlwIdcE3mkaSAU/Ywy8aVETlBg1dIurvETQ7WTzZtMW4Gp4Ltcn9hNmu91JHewJZ/B2mWvfvIH9o64DBIvEoEdr/6yK1W0xdJOdV3L9krUFyO+JTTLXud9FPDa6wBv/VVAMGMgfJE19L840y0AVqwwMBYDUlmAgqYAAAAABJRU5ErkJggg==",zPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADWSURBVHgB7ZYxCsIwFIb/VzxAQd0cPIFHcFcvICi4uTl4g3oDwc1NsOAF1N0jeAIHNxU8QWJaaGujbVVMKCTflOT18fGgfwhgGhQtBvvqiBjNOeBCCXSCwzy/c1sFOyc+546nThoKmhCDRbsnsSiox30Va8aKtVHJK45bC7Qb/dTZcFeP1+vuJbP3cN5geZxk1nMnlqXfUNRrfy5tJHf1tsahAb93DZ02xyne5fTTHMvfytg4lUMc3Le/UtRrc2yW+A7liLe1LOagKSgp/F0pBuNgMxjLA7JlNTWPgZgTAAAAAElFTkSuQmCC",KPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEXSURBVHgB7ZixrgFBFIb/mXuLm1vd5K5HUOo9A9EorYQ3QEF01BR4AxKUGkHrHZQegUKl3DEKsrOsM4pdJOdLJpk5czLnnzmTM8kAzIchgobCymlJD1UF/CFCdOCDEmI4yexqfvuXf+AunZ5QaOruD6LnHCOdcn/FZnpcX4zScFEoI2b0SVX8YxmYjzRNIRgxJd4MFkTxdoK+bZzyyYZu9Rt7cZm49seZ3cM1ZtuObl1QWJ3QPTHPct6UDXyHKFgQhfHauwtH4QVMsvurDk4ZhVVhDCt6zxTGoH8YnDIKFkRhJcjmlabX6Fj5cWGkYEEUQUEHxI8R0xCkb9YAMaM8MYKpwaQ4/+9DilIcnw3wMBjn9m0wn8wJS2o8dIGwrBAAAAAASUVORK5CYII=",QPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFZSURBVHgB7ZgtTwNBEIbfvWwRFVABCbIGBAr+BR+G1FIBCgumBiQOgceAKEkVKYIPyT8AhcFUkoC4mpouXfYM2T0KmcCE27bzuN2dyz3ZudvZDCBMKCo/sX07X+1bc6Ysli1QwT9jFdpTSu+fr710/PlANJM0A/NQhGCOtJToFV828VeNNScRSGZUsqz6E4GotdhELLhPzx8miJcgszGLBogoNyMjqqmBq9Vd1BYbKOvpL2v1m7lg3Fx/BYXm0wHuOqekWPKO1peOhkr+hdpCgxxbaOrLpRlyrPxM3IgoN8E1b+t61iIiLjbePv0k9dyMXwn9qSz+toQOe/Y7JPXciCg3ZNGe6aJIyKKXz8fgpNfvuovzITleSig3IsrNyIqmiJRAVCk8IhLc8XPlj8P+qNI7iGBX3ZmUDhK9588Foi3X4X13nV63s20UQCbo3n1vnEMr1xoXJpYPq/pXd/q9L+kAAAAASUVORK5CYII=",$Pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFESURBVHgB7dk/bsIwFAbwz5FbqRsDlbpU6hHa3qBj26V7O7Q3oCdpbwADSIwwACOcADgCggWJDJlgwGCcETv8CQg9R3m/jReI3ic/IkcGGMs3kVT87tw9LLUqC41HDRRATAs0roX8rbxOR/Y1J0DcvFqrgQ+NW6KrQD7ZIQL7W0qrPw+bjxXiqbCLTgCt8QFfmZG2SwGyxZmMrAVwcABqHICaREr/L30Ub+53Xv9q3259rr7NcKxwMUGp+4w0Uq/AvubPdcq9+T9AjQNQ4wDUnBeaz1ZRw2O193CrZx4havnbCx3a25yzF0r6/SE8QtQ4ADUOQC11gHA+xqWccm/eC1HjANQ4ALWkABEyxAkgBIbwlHm+N+2ae0Ym5A88XAXz8I/WgSzZdSdA3ZwCrsxpoFmJBjwQN2566SnTUz3hmJWxvNsA5h5Re3YMRlUAAAAASUVORK5CYII=",WPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACPSURBVHgB7ZVNCoAgEEbH8QIdoYMJLQV33aBu0Epw2c06QgdQLANDqEU/06LygeA48D0X4gC8HRY3xpjKWtsxxgq4x8A5b6SUfSgwnjrnGoLwQDlndbHAtAF0FHuCR8iCvwuEEMs6Wp8WULB+FVprD4QopZbs/IqygFDgvR+BjmEjQMQ6bVwlXHSejC18hglC+iWVen37xwAAAABJRU5ErkJggg==",YPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC8SURBVHgB7ZY9CsMgFICfpmsgR+iW4+QIHQW33iC9QSbBsUfwOG45QsFVsXmCJVAJVGqgjR8I7wf8fIMowNEgMZBSXqy1EyGkgzLMTdOMjLE7JjRWnXNjQSlyXhxTTOi6AeXpUuJdqeIqruLfF5+2mm3bwjAMIVZKgTEmq55ic+K+78NmuDDOrX8s1lqHU+PCOLee4vUsCiE87ADnPDjrdariKv4jsff+AeWZ38SU0uu68W1wsOXffoPD8gQQEVUrCMAXEwAAAABJRU5ErkJggg==",XPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD+SURBVHgB7ZhBDkNAFIZ/0rCS9BgOYOUy7ZpF9QRtT9BaYNsexooDOEYTKxZ0NKkwiYwEU5L3bcbzJnmfJ5J5AGJjKPyNKIouVVV5iqLssSB1Xb9ZjafjOGcMCYVheGeLB4kwsZvrutdfrHLJIyTDunTqxiqXXPQ1DdCrqWJlkJAIEhJBQiJISMRuzCbTNGHbNsqyRJqmyLJscm6IUR2yLAu6rsMwjG+BOXKThDRNa6+bp50jN0kojmPkeY6iKJAkySy5IfjzUI0/wA5prQd99iJISAQJiSAhEesWasZbyKdXk++QD8mw4fTVi/kNQRA82HKQ8bOBLX53ric2yQejwnMtKEIIqwAAAABJRU5ErkJggg==",ZPe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE7SURBVHgB7ZjBCoJAEEDHJfAaePOUPyAF3vyJfqGjnupLuumxX6g/6OLJQ4E/4MmTh65etFmJ2DXIoqEWmgeLuzPCPmZF2AFg/hRrGEjTdIaPXdu2c8uypvBlhBD7rus2URSValwTlZIoePqF4IALOixUWaFmMbk1QFIiHXZqQBPFai7BEPD45+pagLloJ2uyqAaLUsOi1LAoNSxKDYtSM3nnZd/3IQiCfl4UBeR5Tpp/xssV9TwPwjAE27b7ITd0XZcsTybqOM5DTN3o0/wYL4tWVfUQq+uaLD/GW6Lym2qaph9ZlkFZlmT5MbQ7U5IkHRhEHMd3P/6PUsOi1LAoNSxKDYtSo4liY+oChqKJYhP1DIaA7c+Duh4e/cqEqt4c1mpME5UdXqzqAqd7+AFSECt5lA7D1jjzt1wBWrmTQE3GHEwAAAAASUVORK5CYII=",eIe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAENSURBVHgB7dktDoNAEAXgYWmC7RHqUOBQHKaSBNcbtDdAkSB7GBwKh+MItSQQylYQYBHlJ5klvE/RmRXzyJAmQARwbsa0kCTJva7ryDCMK+mlNE3zGQTBe1gU01NN0zw1HF66dbNF06KYO0j6Um6soINDAG4IwA0BuCEANwTghgDcDh/gQit5nkeO4/yui6KgNE137f9rVQDf98l13f63vK6qirIs26W/xKoVsm1bqQ0H2tpf4pwPcZ7nSk3u8V79JVY9A3JXLcvqV0EONNzfrf0llNcqcRy3pLEwDEcz44+MGwJwQwBuCMANAbghADcE4KYEaNv2Q/oqpwUlgBDiMXeQm7yx3dfTFwHAyBeK8W/f4tA1jQAAAABJRU5ErkJggg==",tIe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%232D8DBF'/%3e%3cmask%20id='path-2-inside-1_2778_34643'%20fill='white'%3e%3cpath%20d='M6%208C6%207.44772%206.44772%207%207%207H17C17.5523%207%2018%207.44772%2018%208C18%208.55228%2017.5523%209%2017%209H7C6.44772%209%206%208.55228%206%208Z'/%3e%3c/mask%3e%3cpath%20d='M17%209V7H7V9V11H17V9ZM7%207V9H17V7V5H7V7ZM17%207V9C16.4477%209%2016%208.55228%2016%208H18H20C20%206.34315%2018.6569%205%2017%205V7ZM7%209V7C7.55229%207%208%207.44772%208%208H6H4C4%209.65685%205.34314%2011%207%2011V9ZM17%209V11C18.6569%2011%2020%209.65685%2020%208H18H16C16%207.44772%2016.4477%207%2017%207V9ZM6%208H8C8%208.55228%207.55228%209%207%209V7V5C5.34315%205%204%206.34315%204%208H6Z'%20fill='white'%20mask='url(%23path-2-inside-1_2778_34643)'/%3e%3cmask%20id='path-4-inside-2_2778_34643'%20fill='white'%3e%3cpath%20d='M6%2016C6%2015.4477%206.44772%2015%207%2015H13C13.5523%2015%2014%2015.4477%2014%2016C14%2016.5523%2013.5523%2017%2013%2017H7C6.44772%2017%206%2016.5523%206%2016Z'/%3e%3c/mask%3e%3cpath%20d='M13%2017V15H7V17V19H13V17ZM7%2015V17H13V15V13H7V15ZM13%2015V17C12.4477%2017%2012%2016.5523%2012%2016H14H16C16%2014.3431%2014.6569%2013%2013%2013V15ZM7%2017V15C7.55228%2015%208%2015.4477%208%2016H6H4C4%2017.6569%205.34315%2019%207%2019V17ZM13%2017V19C14.6569%2019%2016%2017.6569%2016%2016H14H12C12%2015.4477%2012.4477%2015%2013%2015V17ZM6%2016H8C8%2016.5523%207.55228%2017%207%2017V15V13C5.34315%2013%204%2014.3431%204%2016H6Z'%20fill='white'%20mask='url(%23path-4-inside-2_2778_34643)'/%3e%3cmask%20id='path-6-inside-3_2778_34643'%20fill='white'%3e%3cpath%20d='M6%2012C6%2011.4477%206.44772%2011%207%2011H17C17.5523%2011%2018%2011.4477%2018%2012C18%2012.5523%2017.5523%2013%2017%2013H7C6.44772%2013%206%2012.5523%206%2012Z'/%3e%3c/mask%3e%3cpath%20d='M17%2013V11H7V13V15H17V13ZM7%2011V13H17V11V9H7V11ZM17%2011V13C16.4477%2013%2016%2012.5523%2016%2012H18H20C20%2010.3431%2018.6569%209%2017%209V11ZM7%2013V11C7.55229%2011%208%2011.4477%208%2012H6H4C4%2013.6569%205.34314%2015%207%2015V13ZM17%2013V15C18.6569%2015%2020%2013.6569%2020%2012H18H16C16%2011.4477%2016.4477%2011%2017%2011V13ZM6%2012H8C8%2012.5523%207.55228%2013%207%2013V11V9C5.34315%209%204%2010.3431%204%2012H6Z'%20fill='white'%20mask='url(%23path-6-inside-3_2778_34643)'/%3e%3c/svg%3e",nIe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23F36653'/%3e%3cpath%20d='M13%208C13%207.44772%2013.4477%207%2014%207H17C17.5523%207%2018%207.44772%2018%208C18%208.55228%2017.5523%209%2017%209H14C13.4477%209%2013%208.55228%2013%208Z'%20fill='white'/%3e%3cpath%20d='M6%2016C6%2015.4477%206.44772%2015%207%2015H17C17.5523%2015%2018%2015.4477%2018%2016C18%2016.5523%2017.5523%2017%2017%2017H7C6.44772%2017%206%2016.5523%206%2016Z'%20fill='white'/%3e%3cpath%20d='M13%2012C13%2011.4477%2013.4477%2011%2014%2011H17C17.5523%2011%2018%2011.4477%2018%2012C18%2012.5523%2017.5523%2013%2017%2013H14C13.4477%2013%2013%2012.5523%2013%2012Z'%20fill='white'/%3e%3cpath%20d='M6%2010C6%208.34315%207.34315%207%209%207C10.6569%207%2012%208.34315%2012%2010C12%2011.6569%2010.6569%2013%209%2013C7.34315%2013%206%2011.6569%206%2010Z'%20fill='white'/%3e%3c/svg%3e",rIe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23F37C24'/%3e%3cpath%20d='M17.6878%209.11453C17.8191%209.43169%2017.9183%209.76034%2017.9843%2010.0955C18.0918%2010.6411%2017.6311%2011.096%2017.0751%2011.096H13.9108C13.3547%2011.096%2012.904%2010.6453%2012.904%2010.0892V6.92491C12.904%206.36886%2013.3589%205.90822%2013.9045%206.01567C14.2397%206.08168%2014.5683%206.18086%2014.8855%206.31224C15.5137%206.57245%2016.0845%206.95386%2016.5653%207.43468C17.0461%207.91549%2017.4275%208.48631%2017.6878%209.11453Z'%20fill='white'/%3e%3cpath%20d='M8.30124%208.51672C8.87211%208.13527%209.51023%207.87306%2010.1774%207.74166C10.723%207.63421%2011.1779%208.09485%2011.1779%208.6509L11.178%2011.8152C11.178%2012.3713%2011.6287%2012.822%2012.1848%2012.822L15.3491%2012.822C15.9051%2012.822%2016.3658%2013.277%2016.2583%2013.8225C16.1269%2014.4898%2015.8647%2015.1279%2015.4833%2015.6988C14.9143%2016.5503%2014.1056%2017.2139%2013.1595%2017.6058C12.2133%2017.9978%2011.1722%2018.1003%2010.1678%2017.9005C9.16336%2017.7007%208.24074%2017.2076%207.51659%2016.4834C6.79244%2015.7593%206.29929%2014.8366%206.0995%2013.8322C5.8997%2012.8278%206.00224%2011.7867%206.39415%2010.8405C6.78606%209.89437%207.44973%209.08568%208.30124%208.51672Z'%20fill='white'/%3e%3c/svg%3e",oIe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%235BB514'/%3e%3cpath%20d='M9%2014V16H7V14H9ZM17%2014V16H13V14H17ZM17%208V10H13V8H17ZM9%208V10H7V8H9Z'%20fill='white'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",iIe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%204C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V20C22%2021.1046%2021.1046%2022%2020%2022H4C2.89543%2022%202%2021.1046%202%2020V4Z'%20fill='%23969696'/%3e%3cpath%20d='M7%2012C7%2011.4477%207.44772%2011%208%2011C8.55228%2011%209%2011.4477%209%2012C9%2012.5523%208.55228%2013%208%2013C7.44772%2013%207%2012.5523%207%2012Z'%20fill='white'/%3e%3cpath%20d='M11%2012C11%2011.4477%2011.4477%2011%2012%2011C12.5523%2011%2013%2011.4477%2013%2012C13%2012.5523%2012.5523%2013%2012%2013C11.4477%2013%2011%2012.5523%2011%2012Z'%20fill='white'/%3e%3cpath%20d='M15%2012C15%2011.4477%2015.4477%2011%2016%2011C16.5523%2011%2017%2011.4477%2017%2012C17%2012.5523%2016.5523%2013%2016%2013C15.4477%2013%2015%2012.5523%2015%2012Z'%20fill='white'/%3e%3c/svg%3e",Ite=2.5,sIe=/\/([^/@]+?)(?:@([\d.]+)x)?\.(png|svg)(?:\?url)?$/,aIe=e=>{const t=e.match(sIe);if(!t)return null;const[,n,o,r]=t;return{name:n,scale:r==="svg"?Ite:o?Number(o):1}},jte=e=>{const t={};for(const[n,o]of Object.entries(e)){const r=aIe(n);r&&(t[r.name]||(t[r.name]=[]),t[r.name].push({scale:r.scale,src:o}))}for(const n of Object.values(t))n.sort((o,r)=>o.scale-r.scale);return t},lIe=Object.assign({"../assets/light/arrow.bottom.png":ECe,"../assets/light/arrow.bottom@1.25x.png":MCe,"../assets/light/arrow.bottom@1.5x.png":PCe,"../assets/light/arrow.bottom@1.75x.png":ICe,"../assets/light/arrow.bottom@2x.png":jCe,"../assets/light/arrow.right.png":DCe,"../assets/light/arrow.right@1.25x.png":NCe,"../assets/light/arrow.right@1.5x.png":LCe,"../assets/light/arrow.right@1.75x.png":FCe,"../assets/light/arrow.right@2x.png":xCe,"../assets/light/arrow.top.png":BCe,"../assets/light/arrow.top@1.25x.png":kCe,"../assets/light/arrow.top@1.5x.png":UCe,"../assets/light/arrow.top@1.75x.png":qCe,"../assets/light/arrow.top@2x.png":JCe,"../assets/light/attachment.png":VCe,"../assets/light/attachment@1.25x.png":HCe,"../assets/light/attachment@1.5x.png":GCe,"../assets/light/attachment@1.75x.png":zCe,"../assets/light/attachment@2x.png":KCe,"../assets/light/attention.png":QCe,"../assets/light/attention@1.25x.png":$Ce,"../assets/light/attention@1.5x.png":WCe,"../assets/light/attention@1.75x.png":YCe,"../assets/light/attention@2x.png":XCe,"../assets/light/btn-close.png":ZCe,"../assets/light/btn-close.small.png":ewe,"../assets/light/btn-close.small@1.25x.png":twe,"../assets/light/btn-close.small@1.5x.png":nwe,"../assets/light/btn-close.small@1.75x.png":rwe,"../assets/light/btn-close.small@2x.png":owe,"../assets/light/btn-close@1.25x.png":iwe,"../assets/light/btn-close@1.5x.png":swe,"../assets/light/btn-close@1.75x.png":awe,"../assets/light/btn-close@2x.png":lwe,"../assets/light/btn-copy.png":uwe,"../assets/light/btn-copy@1.25x.png":cwe,"../assets/light/btn-copy@1.5x.png":dwe,"../assets/light/btn-copy@1.75x.png":fwe,"../assets/light/btn-copy@2x.png":hwe,"../assets/light/btn-download.png":pwe,"../assets/light/btn-download@1.25x.png":mwe,"../assets/light/btn-download@1.5x.png":gwe,"../assets/light/btn-download@1.75x.png":bwe,"../assets/light/btn-download@2x.png":ywe,"../assets/light/btn-edit.png":Awe,"../assets/light/btn-edit@1.25x.png":_we,"../assets/light/btn-edit@1.5x.png":vwe,"../assets/light/btn-edit@1.75x.png":Swe,"../assets/light/btn-edit@2x.png":Cwe,"../assets/light/btn-extended-thinking.png":wwe,"../assets/light/btn-extended-thinking@1.25.png":Owe,"../assets/light/btn-extended-thinking@1.5.png":Twe,"../assets/light/btn-extended-thinking@1.75.png":Rwe,"../assets/light/btn-extended-thinking@2.png":Ewe,"../assets/light/btn-external.png":Mwe,"../assets/light/btn-external@1.25x.png":Pwe,"../assets/light/btn-external@1.5x.png":Iwe,"../assets/light/btn-external@1.75x.png":jwe,"../assets/light/btn-external@2x.png":Dwe,"../assets/light/btn-list-search.png":Nwe,"../assets/light/btn-list-search@1.25x.png":Lwe,"../assets/light/btn-list-search@1.5x.png":Fwe,"../assets/light/btn-list-search@1.75x.png":xwe,"../assets/light/btn-list-search@2x.png":Bwe,"../assets/light/btn-menu-about.png":kwe,"../assets/light/btn-menu-about@1.25x.png":Uwe,"../assets/light/btn-menu-about@1.5x.png":qwe,"../assets/light/btn-menu-about@1.75x.png":Jwe,"../assets/light/btn-menu-about@2x.png":Vwe,"../assets/light/btn-menu-navigation.png":Hwe,"../assets/light/btn-menu-navigation@1.25x.png":Gwe,"../assets/light/btn-menu-navigation@1.5x.png":zwe,"../assets/light/btn-menu-navigation@1.75x.png":Kwe,"../assets/light/btn-menu-navigation@2x.png":Qwe,"../assets/light/btn-menu-search.png":$we,"../assets/light/btn-menu-search@1.25x.png":Wwe,"../assets/light/btn-menu-search@1.5x.png":Ywe,"../assets/light/btn-menu-search@1.75x.png":Xwe,"../assets/light/btn-menu-search@2x.png":Zwe,"../assets/light/btn-previtem.png":eOe,"../assets/light/btn-previtem@1.25x.png":tOe,"../assets/light/btn-previtem@1.5x.png":nOe,"../assets/light/btn-previtem@1.75x.png":rOe,"../assets/light/btn-previtem@2x.png":oOe,"../assets/light/btn-remove.png":iOe,"../assets/light/btn-remove@1.25x.png":sOe,"../assets/light/btn-remove@1.5x.png":aOe,"../assets/light/btn-remove@1.75x.png":lOe,"../assets/light/btn-remove@2x.png":uOe,"../assets/light/btn-rename.png":cOe,"../assets/light/btn-rename@1.25x.png":dOe,"../assets/light/btn-rename@1.5x.png":fOe,"../assets/light/btn-rename@1.75x.png":hOe,"../assets/light/btn-rename@2x.png":pOe,"../assets/light/btn-reset.png":mOe,"../assets/light/btn-reset@1.25x.png":gOe,"../assets/light/btn-reset@1.5x.png":bOe,"../assets/light/btn-reset@1.75x.png":yOe,"../assets/light/btn-reset@2x.png":AOe,"../assets/light/btn-save.png":_Oe,"../assets/light/btn-save@1.25x.png":vOe,"../assets/light/btn-save@1.5x.png":SOe,"../assets/light/btn-save@1.75x.png":COe,"../assets/light/btn-save@2x.png":wOe,"../assets/light/btn-settings.png":OOe,"../assets/light/btn-settings@1.25x.png":TOe,"../assets/light/btn-settings@1.5x.png":ROe,"../assets/light/btn-settings@1.75x.png":EOe,"../assets/light/btn-settings@2x.png":MOe,"../assets/light/btn-web-search.png":POe,"../assets/light/btn-web-search@1.25x.png":IOe,"../assets/light/btn-web-search@1.5x.png":jOe,"../assets/light/btn-web-search@1.75x.png":DOe,"../assets/light/btn-web-search@2x.png":NOe,"../assets/light/btn-zoomup.png":LOe,"../assets/light/btn-zoomup@1.25x.png":FOe,"../assets/light/btn-zoomup@1.5x.png":xOe,"../assets/light/btn-zoomup@1.75x.png":BOe,"../assets/light/btn-zoomup@2x.png":kOe,"../assets/light/checked.png":UOe,"../assets/light/checked@1.25x.png":qOe,"../assets/light/checked@1.5x.png":JOe,"../assets/light/checked@1.75x.png":VOe,"../assets/light/checked@2x.png":HOe,"../assets/light/clear.search.png":GOe,"../assets/light/clear.search@1.25x.png":zOe,"../assets/light/clear.search@1.5x.png":KOe,"../assets/light/clear.search@1.75x.png":QOe,"../assets/light/clear.search@2x.png":$Oe,"../assets/light/code.png":WOe,"../assets/light/code@1.25x.png":YOe,"../assets/light/code@1.5x.png":XOe,"../assets/light/code@1.75x.png":ZOe,"../assets/light/code@2x.png":eTe,"../assets/light/more.png":tTe,"../assets/light/more@1.25x.png":nTe,"../assets/light/more@1.5x.png":rTe,"../assets/light/more@1.75x.png":oTe,"../assets/light/more@2x.png":iTe,"../assets/light/onlyoffice.png":sTe,"../assets/light/onlyoffice@1.25x.png":aTe,"../assets/light/onlyoffice@1.5x.png":lTe,"../assets/light/onlyoffice@1.75x.png":uTe,"../assets/light/onlyoffice@2x.png":cTe,"../assets/light/search.png":dTe,"../assets/light/search@1.25x.png":fTe,"../assets/light/search@1.5x.png":hTe,"../assets/light/search@1.75x.png":pTe,"../assets/light/search@2x.png":mTe,"../assets/light/show-chat.png":gTe,"../assets/light/show-chat@1.25x.png":bTe,"../assets/light/show-chat@1.5x.png":yTe,"../assets/light/show-chat@1.75x.png":ATe,"../assets/light/show-chat@2x.png":_Te,"../assets/light/status.error.png":vTe,"../assets/light/status.error@1.25x.png":STe,"../assets/light/status.error@1.5x.png":CTe,"../assets/light/status.error@1.75x.png":wTe,"../assets/light/status.error@2x.png":OTe,"../assets/light/stop.png":TTe,"../assets/light/stop@1.25x.png":RTe,"../assets/light/stop@1.5x.png":ETe,"../assets/light/stop@1.75x.png":MTe,"../assets/light/stop@2x.png":PTe,"../assets/light/tool.called.png":ITe,"../assets/light/tool.called@1.25x.png":jTe,"../assets/light/tool.called@1.5x.png":DTe,"../assets/light/tool.called@1.75x.png":NTe,"../assets/light/tool.called@2x.png":LTe,"../assets/light/tools.png":FTe,"../assets/light/tools@1.25x.png":xTe,"../assets/light/tools@1.5x.png":BTe,"../assets/light/tools@1.75x.png":kTe,"../assets/light/tools@2x.png":UTe}),uIe=Object.assign({"../assets/dark/arrow.bottom.png":qTe,"../assets/dark/arrow.bottom@1.25x.png":JTe,"../assets/dark/arrow.bottom@1.5x.png":VTe,"../assets/dark/arrow.bottom@1.75x.png":HTe,"../assets/dark/arrow.bottom@2x.png":GTe,"../assets/dark/arrow.right.png":zTe,"../assets/dark/arrow.right@1.25x.png":KTe,"../assets/dark/arrow.right@1.5x.png":QTe,"../assets/dark/arrow.right@1.75x.png":$Te,"../assets/dark/arrow.right@2x.png":WTe,"../assets/dark/arrow.top.png":YTe,"../assets/dark/arrow.top@1.25x.png":XTe,"../assets/dark/arrow.top@1.5x.png":ZTe,"../assets/dark/arrow.top@1.75x.png":eRe,"../assets/dark/arrow.top@2x.png":tRe,"../assets/dark/attachment.png":nRe,"../assets/dark/attachment@1.25x.png":rRe,"../assets/dark/attachment@1.5x.png":oRe,"../assets/dark/attachment@1.75x.png":iRe,"../assets/dark/attachment@2x.png":sRe,"../assets/dark/attention.png":aRe,"../assets/dark/attention@1.25x.png":lRe,"../assets/dark/attention@1.5x.png":uRe,"../assets/dark/attention@1.75x.png":cRe,"../assets/dark/attention@2x.png":dRe,"../assets/dark/btn-close.png":fRe,"../assets/dark/btn-close.small.png":hRe,"../assets/dark/btn-close.small@1.25x.png":pRe,"../assets/dark/btn-close.small@1.5x.png":mRe,"../assets/dark/btn-close.small@1.75x.png":gRe,"../assets/dark/btn-close.small@2x.png":bRe,"../assets/dark/btn-close@1.25x.png":yRe,"../assets/dark/btn-close@1.5x.png":ARe,"../assets/dark/btn-close@1.75x.png":_Re,"../assets/dark/btn-close@2x.png":vRe,"../assets/dark/btn-copy.png":SRe,"../assets/dark/btn-copy@1.25x.png":CRe,"../assets/dark/btn-copy@1.5x.png":wRe,"../assets/dark/btn-copy@1.75x.png":ORe,"../assets/dark/btn-copy@2x.png":TRe,"../assets/dark/btn-download.png":RRe,"../assets/dark/btn-download@1.25x.png":ERe,"../assets/dark/btn-download@1.5x.png":MRe,"../assets/dark/btn-download@1.75x.png":PRe,"../assets/dark/btn-download@2x.png":IRe,"../assets/dark/btn-edit.png":jRe,"../assets/dark/btn-edit@1.25x.png":DRe,"../assets/dark/btn-edit@1.5x.png":NRe,"../assets/dark/btn-edit@1.75x.png":LRe,"../assets/dark/btn-edit@2x.png":FRe,"../assets/dark/btn-external.png":xRe,"../assets/dark/btn-external@1.25x.png":BRe,"../assets/dark/btn-external@1.5x.png":kRe,"../assets/dark/btn-external@1.75x.png":URe,"../assets/dark/btn-external@2x.png":qRe,"../assets/dark/btn-list-search.png":JRe,"../assets/dark/btn-list-search@1.25x.png":VRe,"../assets/dark/btn-list-search@1.5x.png":HRe,"../assets/dark/btn-list-search@1.75x.png":GRe,"../assets/dark/btn-list-search@2x.png":zRe,"../assets/dark/btn-menu-about.png":KRe,"../assets/dark/btn-menu-about@1.25x.png":QRe,"../assets/dark/btn-menu-about@1.5x.png":$Re,"../assets/dark/btn-menu-about@1.75x.png":WRe,"../assets/dark/btn-menu-about@2x.png":YRe,"../assets/dark/btn-menu-navigation.png":XRe,"../assets/dark/btn-menu-navigation@1.25x.png":ZRe,"../assets/dark/btn-menu-navigation@1.5x.png":eEe,"../assets/dark/btn-menu-navigation@1.75x.png":tEe,"../assets/dark/btn-menu-navigation@2x.png":nEe,"../assets/dark/btn-menu-search.png":rEe,"../assets/dark/btn-menu-search@1.25x.png":oEe,"../assets/dark/btn-menu-search@1.5x.png":iEe,"../assets/dark/btn-menu-search@1.75x.png":sEe,"../assets/dark/btn-menu-search@2x.png":aEe,"../assets/dark/btn-previtem.png":lEe,"../assets/dark/btn-previtem@1.25x.png":uEe,"../assets/dark/btn-previtem@1.5x.png":cEe,"../assets/dark/btn-previtem@1.75x.png":dEe,"../assets/dark/btn-previtem@2x.png":fEe,"../assets/dark/btn-remove.png":hEe,"../assets/dark/btn-remove@1.25x.png":pEe,"../assets/dark/btn-remove@1.5x.png":mEe,"../assets/dark/btn-remove@1.75x.png":gEe,"../assets/dark/btn-remove@2x.png":bEe,"../assets/dark/btn-rename.png":yEe,"../assets/dark/btn-rename@1.25x.png":AEe,"../assets/dark/btn-rename@1.5x.png":_Ee,"../assets/dark/btn-rename@1.75x.png":vEe,"../assets/dark/btn-rename@2x.png":SEe,"../assets/dark/btn-reset.png":CEe,"../assets/dark/btn-reset@1.25x.png":wEe,"../assets/dark/btn-reset@1.5x.png":OEe,"../assets/dark/btn-reset@1.75x.png":TEe,"../assets/dark/btn-reset@2x.png":REe,"../assets/dark/btn-save.png":EEe,"../assets/dark/btn-save@1.25x.png":MEe,"../assets/dark/btn-save@1.5x.png":PEe,"../assets/dark/btn-save@1.75x.png":IEe,"../assets/dark/btn-save@2x.png":jEe,"../assets/dark/btn-settings.png":DEe,"../assets/dark/btn-settings@1.25x.png":NEe,"../assets/dark/btn-settings@1.5x.png":LEe,"../assets/dark/btn-settings@1.75x.png":FEe,"../assets/dark/btn-settings@2x.png":xEe,"../assets/dark/btn-web-search.png":BEe,"../assets/dark/btn-web-search@1.25x.png":kEe,"../assets/dark/btn-web-search@1.5x.png":UEe,"../assets/dark/btn-web-search@1.75x.png":qEe,"../assets/dark/btn-web-search@2x.png":JEe,"../assets/dark/btn-zoomup.png":VEe,"../assets/dark/btn-zoomup@1.25x.png":HEe,"../assets/dark/btn-zoomup@1.5x.png":GEe,"../assets/dark/btn-zoomup@1.75x.png":zEe,"../assets/dark/btn-zoomup@2x.png":KEe,"../assets/dark/checked.png":QEe,"../assets/dark/checked@1.25x.png":$Ee,"../assets/dark/checked@1.5x.png":WEe,"../assets/dark/checked@1.75x.png":YEe,"../assets/dark/checked@2x.png":XEe,"../assets/dark/clear.search.png":ZEe,"../assets/dark/clear.search@1.25x.png":eMe,"../assets/dark/clear.search@1.5x.png":tMe,"../assets/dark/clear.search@1.75x.png":nMe,"../assets/dark/clear.search@2x.png":rMe,"../assets/dark/code.png":oMe,"../assets/dark/code@1.25x.png":iMe,"../assets/dark/code@1.5x.png":sMe,"../assets/dark/code@1.75x.png":aMe,"../assets/dark/code@2x.png":lMe,"../assets/dark/more.png":uMe,"../assets/dark/more@1.25x.png":cMe,"../assets/dark/more@1.5x.png":dMe,"../assets/dark/more@1.75x.png":fMe,"../assets/dark/more@2x.png":hMe,"../assets/dark/onlyoffice.png":pMe,"../assets/dark/onlyoffice@1.25x.png":mMe,"../assets/dark/onlyoffice@1.5x.png":gMe,"../assets/dark/onlyoffice@1.75x.png":bMe,"../assets/dark/onlyoffice@2x.png":yMe,"../assets/dark/search.png":AMe,"../assets/dark/search@1.25x.png":_Me,"../assets/dark/search@1.5x.png":vMe,"../assets/dark/search@1.75x.png":SMe,"../assets/dark/search@2x.png":CMe,"../assets/dark/show-chat.png":wMe,"../assets/dark/show-chat@1.25x.png":OMe,"../assets/dark/show-chat@1.5x.png":TMe,"../assets/dark/show-chat@1.75x.png":RMe,"../assets/dark/show-chat@2x.png":EMe,"../assets/dark/status.error.png":MMe,"../assets/dark/status.error@1.25x.png":PMe,"../assets/dark/status.error@1.5x.png":IMe,"../assets/dark/status.error@1.75x.png":jMe,"../assets/dark/status.error@2x.png":DMe,"../assets/dark/stop.png":NMe,"../assets/dark/stop@1.25x.png":LMe,"../assets/dark/stop@1.5x.png":FMe,"../assets/dark/stop@1.75x.png":xMe,"../assets/dark/stop@2x.png":BMe,"../assets/dark/tool.called.png":kMe,"../assets/dark/tool.called@1.25x.png":UMe,"../assets/dark/tool.called@1.5x.png":qMe,"../assets/dark/tool.called@1.75x.png":JMe,"../assets/dark/tool.called@2x.png":VMe,"../assets/dark/tools.png":HMe,"../assets/dark/tools@1.25x.png":GMe,"../assets/dark/tools@1.5x.png":zMe,"../assets/dark/tools@1.75x.png":KMe,"../assets/dark/tools@2x.png":QMe}),Dte=Object.assign({"../assets/arrow.bottom.svg":$Me,"../assets/arrow.right.svg":WMe,"../assets/arrow.top.svg":YMe,"../assets/attachment.svg":XMe,"../assets/attention.svg":ZMe,"../assets/btn-close.small.svg":ePe,"../assets/btn-close.svg":tPe,"../assets/btn-copy.svg":nPe,"../assets/btn-download.svg":rPe,"../assets/btn-edit.svg":oPe,"../assets/btn-extended-thinking.svg":iPe,"../assets/btn-external.svg":sPe,"../assets/btn-list-search.svg":aPe,"../assets/btn-menu-about.svg":lPe,"../assets/btn-menu-navigation.svg":uPe,"../assets/btn-menu-search.svg":cPe,"../assets/btn-previtem.svg":dPe,"../assets/btn-remove.svg":fPe,"../assets/btn-rename.svg":hPe,"../assets/btn-reset.svg":pPe,"../assets/btn-save.svg":mPe,"../assets/btn-settings.svg":gPe,"../assets/btn-web-search.svg":bPe,"../assets/btn-zoomup.svg":yPe,"../assets/checked.svg":APe,"../assets/clear.search.svg":_Pe,"../assets/code.svg":vPe,"../assets/more.svg":SPe,"../assets/onlyoffice.svg":CPe,"../assets/search.svg":wPe,"../assets/show-chat.svg":OPe,"../assets/status.error.svg":TPe,"../assets/stop.svg":RPe,"../assets/tool.called.svg":EPe,"../assets/tools.svg":MPe}),Nte=Object.assign({"../assets/formats/documents.png":PPe,"../assets/formats/documents@1.25x.png":IPe,"../assets/formats/documents@1.5x.png":jPe,"../assets/formats/documents@1.75.png":DPe,"../assets/formats/documents@2.png":NPe,"../assets/formats/pdf.png":LPe,"../assets/formats/pdf@1.25x.png":FPe,"../assets/formats/pdf@1.5x.png":xPe,"../assets/formats/pdf@1.75x.png":BPe,"../assets/formats/pdf@2x.png":kPe,"../assets/formats/presentations.png":UPe,"../assets/formats/presentations@1.25x.png":qPe,"../assets/formats/presentations@1.5x.png":JPe,"../assets/formats/presentations@1.75x.png":VPe,"../assets/formats/presentations@2x.png":HPe,"../assets/formats/spreadsheets.png":GPe,"../assets/formats/spreadsheets@1.25x.png":zPe,"../assets/formats/spreadsheets@1.5x.png":KPe,"../assets/formats/spreadsheets@1.75x.png":QPe,"../assets/formats/spreadsheets@2x.png":$Pe,"../assets/formats/unknown-format.png":WPe,"../assets/formats/unknown-format@1.25x.png":YPe,"../assets/formats/unknown-format@1.5x.png":XPe,"../assets/formats/unknown-format@1.75x.png":ZPe,"../assets/formats/unknown-format@2x.png":eIe}),Lte=Object.assign({"../assets/formats/documents.svg":tIe,"../assets/formats/pdf.svg":nIe,"../assets/formats/presentations.svg":rIe,"../assets/formats/spreadsheets.svg":oIe,"../assets/formats/unknown-format.svg":iIe}),cIe=jte({...lIe,...Dte,...Nte,...Lte}),dIe=jte({...uIe,...Dte,...Nte,...Lte}),fIe=(e,t,n)=>{const r=(t==="dark"?dIe:cIe)[e];if(!r||r.length===0)return null;const i=r.find(s=>s.scale>=n)||r[r.length-1];return{src:i.src,isSvg:i.scale===Ite}},tr=({name:e,size:t,width:n,height:o,isStroke:r,color:i,noColor:s,className:a,isTransform:c})=>{const p=n??t,u=o??t,{themeType:l,scale:d}=Ete(),f=fIe(e,l,d);if(!f)return null;const h=m=>{if(s)return;const g=i||"var(--icon-button-color)";m.querySelectorAll("path").forEach(S=>{r?S.setAttribute("stroke",g):S.setAttribute("fill",g)}),m.querySelectorAll("circle").forEach(S=>{r?S.setAttribute("stroke",g):S.setAttribute("fill",g)})};return f.isSvg?F.jsx(HF,{src:f.src,className:`flex items-center justify-center ${c?"rotate-90":""} ${a||""}`,beforeInjection:h,style:{width:p,height:u}}):F.jsx("img",{src:f.src,alt:e,className:`${c?"rotate-90":""} ${a||""}`,style:{width:p,height:u}})};function Fte(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let o=0;o({classGroupId:e,validator:t}),xte=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rE="-",l5=[],mIe="arbitrary..",gIe=e=>{const t=yIe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return bIe(s);const a=s.split(rE),c=a[0]===""&&a.length>1?1:0;return Bte(a,c,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const c=o[s],p=n[s];return c?p?hIe(p,c):c:p||l5}return n[s]||l5}}},Bte=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const p=Bte(e,t+1,i);if(p)return p}const s=n.validators;if(s===null)return;const a=t===0?e.join(rE):e.slice(t).join(rE),c=s.length;for(let p=0;pe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?mIe+o:void 0})(),yIe=e=>{const{theme:t,classGroups:n}=e;return AIe(n,t)},AIe=(e,t)=>{const n=xte();for(const o in e){const r=e[o];GF(r,n,o,t)}return n},GF=(e,t,n,o)=>{const r=e.length;for(let i=0;i{if(typeof e=="string"){vIe(e,t,n);return}if(typeof e=="function"){SIe(e,t,n,o);return}CIe(e,t,n,o)},vIe=(e,t,n)=>{const o=e===""?t:kte(t,e);o.classGroupId=n},SIe=(e,t,n,o)=>{if(wIe(e)){GF(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(pIe(n,e))},CIe=(e,t,n,o)=>{const r=Object.entries(e),i=r.length;for(let s=0;s{let n=e;const o=t.split(rE),r=o.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,OIe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const r=(i,s)=>{n[i]=s,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=o[i])!==void 0)return r(i,s),s},set(i,s){i in n?n[i]=s:r(i,s)}}},H2="!",u5=":",TIe=[],c5=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),RIe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const i=[];let s=0,a=0,c=0,p;const u=r.length;for(let m=0;mc?p-c:void 0;return c5(i,f,d,h)};if(t){const r=t+u5,i=o;o=s=>s.startsWith(r)?i(s.slice(r.length)):c5(TIe,!1,s,void 0,!0)}if(n){const r=o;o=i=>n({className:i,parseClassName:r})}return o},EIe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let r=[];for(let i=0;i0&&(r.sort(),o.push(...r),r=[]),o.push(s)):r.push(s)}return r.length>0&&(r.sort(),o.push(...r)),o}},MIe=e=>({cache:OIe(e.cacheSize),parseClassName:RIe(e),sortModifiers:EIe(e),...gIe(e)}),PIe=/\s+/,IIe=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:i}=t,s=[],a=e.trim().split(PIe);let c="";for(let p=a.length-1;p>=0;p-=1){const u=a[p],{isExternal:l,modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(u);if(l){c=u+(c.length>0?" "+c:c);continue}let g=!!m,y=o(g?h.substring(0,m):h);if(!y){if(!g){c=u+(c.length>0?" "+c:c);continue}if(y=o(h),!y){c=u+(c.length>0?" "+c:c);continue}g=!1}const _=d.length===0?"":d.length===1?d[0]:i(d).join(":"),S=f?_+H2:_,w=S+y;if(s.indexOf(w)>-1)continue;s.push(w);const R=r(y,g);for(let E=0;E0?" "+c:c)}return c},jIe=(...e)=>{let t=0,n,o,r="";for(;t{if(typeof e=="string")return e;let t,n="";for(let o=0;o{let n,o,r,i;const s=c=>{const p=t.reduce((u,l)=>l(u),e());return n=MIe(p),o=n.cache.get,r=n.cache.set,i=a,a(c)},a=c=>{const p=o(c);if(p)return p;const u=IIe(c,n);return r(c,u),u};return i=s,(...c)=>i(jIe(...c))},NIe=[],cr=e=>{const t=n=>n[e]||NIe;return t.isThemeGetter=!0,t},qte=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jte=/^\((?:(\w[\w-]*):)?(.+)\)$/i,LIe=/^\d+\/\d+$/,FIe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xIe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,BIe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kIe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UIe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dy=e=>LIe.test(e),It=e=>!!e&&!Number.isNaN(Number(e)),Wp=e=>!!e&&Number.isInteger(Number(e)),OD=e=>e.endsWith("%")&&It(e.slice(0,-1)),pu=e=>FIe.test(e),qIe=()=>!0,JIe=e=>xIe.test(e)&&!BIe.test(e),Vte=()=>!1,VIe=e=>kIe.test(e),HIe=e=>UIe.test(e),GIe=e=>!et(e)&&!tt(e),zIe=e=>DA(e,zte,Vte),et=e=>qte.test(e),lg=e=>DA(e,Kte,JIe),TD=e=>DA(e,YIe,It),d5=e=>DA(e,Hte,Vte),KIe=e=>DA(e,Gte,HIe),jO=e=>DA(e,Qte,VIe),tt=e=>Jte.test(e),Z_=e=>NA(e,Kte),QIe=e=>NA(e,XIe),f5=e=>NA(e,Hte),$Ie=e=>NA(e,zte),WIe=e=>NA(e,Gte),DO=e=>NA(e,Qte,!0),DA=(e,t,n)=>{const o=qte.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},NA=(e,t,n=!1)=>{const o=Jte.exec(e);return o?o[1]?t(o[1]):n:!1},Hte=e=>e==="position"||e==="percentage",Gte=e=>e==="image"||e==="url",zte=e=>e==="length"||e==="size"||e==="bg-size",Kte=e=>e==="length",YIe=e=>e==="number",XIe=e=>e==="family-name",Qte=e=>e==="shadow",ZIe=()=>{const e=cr("color"),t=cr("font"),n=cr("text"),o=cr("font-weight"),r=cr("tracking"),i=cr("leading"),s=cr("breakpoint"),a=cr("container"),c=cr("spacing"),p=cr("radius"),u=cr("shadow"),l=cr("inset-shadow"),d=cr("text-shadow"),f=cr("drop-shadow"),h=cr("blur"),m=cr("perspective"),g=cr("aspect"),y=cr("ease"),_=cr("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...w(),tt,et],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],D=()=>[tt,et,c],B=()=>[dy,"full","auto",...D()],N=()=>[Wp,"none","subgrid",tt,et],L=()=>["auto",{span:["full",Wp,tt,et]},Wp,tt,et],q=()=>[Wp,"auto",tt,et],I=()=>["auto","min","max","fr",tt,et],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...D()],G=()=>[dy,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],Q=()=>[e,tt,et],le=()=>[...w(),f5,d5,{position:[tt,et]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",$Ie,zIe,{size:[tt,et]}],ce=()=>[OD,Z_,lg],W=()=>["","none","full",p,tt,et],_e=()=>["",It,Z_,lg],Ne=()=>["solid","dashed","dotted","double"],Ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>[It,OD,f5,d5],Ye=()=>["","none",h,tt,et],ct=()=>["none",It,tt,et],Pt=()=>["none",It,tt,et],tn=()=>[It,tt,et],Mt=()=>[dy,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pu],breakpoint:[pu],color:[qIe],container:[pu],"drop-shadow":[pu],ease:["in","out","in-out"],font:[GIe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pu],shadow:[pu],spacing:["px",It],text:[pu],"text-shadow":[pu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dy,et,tt,g]}],container:["container"],columns:[{columns:[It,et,tt,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Wp,"auto",tt,et]}],basis:[{basis:[dy,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[It,dy,"auto","initial","none",et]}],grow:[{grow:["",It,tt,et]}],shrink:[{shrink:["",It,tt,et]}],order:[{order:[Wp,"first","last","none",tt,et]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Z_,lg]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,tt,TD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",OD,et]}],"font-family":[{font:[QIe,et,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,tt,et]}],"line-clamp":[{"line-clamp":[It,"none",tt,TD]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",tt,et]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,et]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[It,"from-font","auto",tt,lg]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[It,"auto",tt,et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt,et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wp,tt,et],radial:["",tt,et],conic:[Wp,tt,et]},WIe,KIe]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[It,tt,et]}],"outline-w":[{outline:["",It,Z_,lg]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",u,DO,jO]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",l,DO,jO]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[It,lg]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",d,DO,jO]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[It,tt,et]}],"mix-blend":[{"mix-blend":[...Ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[It]}],"mask-image-linear-from-pos":[{"mask-linear-from":Me()}],"mask-image-linear-to-pos":[{"mask-linear-to":Me()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":Me()}],"mask-image-t-to-pos":[{"mask-t-to":Me()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":Me()}],"mask-image-r-to-pos":[{"mask-r-to":Me()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":Me()}],"mask-image-b-to-pos":[{"mask-b-to":Me()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":Me()}],"mask-image-l-to-pos":[{"mask-l-to":Me()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":Me()}],"mask-image-x-to-pos":[{"mask-x-to":Me()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":Me()}],"mask-image-y-to-pos":[{"mask-y-to":Me()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[tt,et]}],"mask-image-radial-from-pos":[{"mask-radial-from":Me()}],"mask-image-radial-to-pos":[{"mask-radial-to":Me()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[It]}],"mask-image-conic-from-pos":[{"mask-conic-from":Me()}],"mask-image-conic-to-pos":[{"mask-conic-to":Me()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,et]}],filter:[{filter:["","none",tt,et]}],blur:[{blur:Ye()}],brightness:[{brightness:[It,tt,et]}],contrast:[{contrast:[It,tt,et]}],"drop-shadow":[{"drop-shadow":["","none",f,DO,jO]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",It,tt,et]}],"hue-rotate":[{"hue-rotate":[It,tt,et]}],invert:[{invert:["",It,tt,et]}],saturate:[{saturate:[It,tt,et]}],sepia:[{sepia:["",It,tt,et]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,et]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[It,tt,et]}],"backdrop-contrast":[{"backdrop-contrast":[It,tt,et]}],"backdrop-grayscale":[{"backdrop-grayscale":["",It,tt,et]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[It,tt,et]}],"backdrop-invert":[{"backdrop-invert":["",It,tt,et]}],"backdrop-opacity":[{"backdrop-opacity":[It,tt,et]}],"backdrop-saturate":[{"backdrop-saturate":[It,tt,et]}],"backdrop-sepia":[{"backdrop-sepia":["",It,tt,et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,et]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[It,"initial",tt,et]}],ease:[{ease:["linear","initial",y,tt,et]}],delay:[{delay:[It,tt,et]}],animate:[{animate:["none",_,tt,et]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,tt,et]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:Pt()}],"scale-x":[{"scale-x":Pt()}],"scale-y":[{"scale-y":Pt()}],"scale-z":[{"scale-z":Pt()}],"scale-3d":["scale-3d"],skew:[{skew:tn()}],"skew-x":[{"skew-x":tn()}],"skew-y":[{"skew-y":tn()}],transform:[{transform:[tt,et,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Mt()}],"translate-x":[{"translate-x":Mt()}],"translate-y":[{"translate-y":Mt()}],"translate-z":[{"translate-z":Mt()}],"translate-none":["translate-none"],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt,et]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt,et]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[It,Z_,lg,TD]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},eje=DIe(ZIe),ke=(...e)=>eje(nE(e)),$te=e=>{let t="";return e.forEach(n=>{Array.isArray(n.content)?n.content.forEach(o=>{if(typeof o=="string"){t+=n.role==="user"?`## ${o} -`:`${i} +`:`${o} -`;return}if(!(!i||typeof i!="object"||!("type"in i))){if(i.type==="text"&&"text"in i)e+=n.role==="user"?`## ${i.text} +`;return}if(!(!o||typeof o!="object"||!("type"in o))){if(o.type==="text"&&"text"in o)t+=n.role==="user"?`## ${o.text} -`:`${i.text} +`:`${o.text} -`;else if(i.type==="tool-call"&&"toolName"in i)return}}):typeof n.content=="string"&&(e+=n.role==="user"?`## ${n.content} +`;else if(o.type==="tool-call"&&"toolName"in o)return}}):typeof n.content=="string"&&(t+=n.role==="user"?`## ${n.content} `:`${n.content} -`)}),e},$T=t=>t.replace(/[\\/:*"<>|?]/g,""),I8=t=>$T(t),Ufe=t=>{const n=t.split(` -`)[0].replace("## ","");return $T(n).substring(0,30)},M8=t=>!!(t&64),D8=t=>!!(t&128),Sv=t=>!!(t&256),P8=t=>t===513||t===521,gt=({iconName:t,size:e,isStroke:n,isTransform:i,isActive:r,className:s,insideElement:o,disableHover:a,color:l,noColor:u,width:d,height:f,...g})=>{const m=a?void 0:o?"hover:enabled:bg-[var(--icon-button-hover-on-active-background-color)]":"hover:enabled:bg-[var(--icon-button-hover-background-color)]",v=a?void 0:"active:enabled:bg-[var(--icon-button-pressed-background-color)]";return _.jsx("button",{className:_e("border-none cursor-pointer rounded-[4px] bg-none p-0 m-0","flex items-center justify-center",m,v,"disabled:cursor-not-allowed disabled:opacity-[0.5]","outline-none focus:outline-none focus-visible:outline-none",s),style:{width:`${e}px`,height:`${e}px`,...r?{backgroundColor:"var(--icon-button-pressed-background-color)"}:{}},...g,children:_.jsx(wn,{name:t,size:e,isStroke:n,isTransform:i,color:l,noColor:u,width:d,height:f})})},BO="var(--input-color)",mo=me.forwardRef(({className:t,isError:e,icon:n,onClear:i,...r},s)=>{const{isRTL:o}=Wt();return _.jsxs("div",{className:`relative ${t}`,children:[n&&_.jsx("div",{className:_e("absolute top-[50%] translate-y-[-50%] w-[20px] h-[20px] flex items-center justify-center",o?"right-[10px]":"left-[10px]"),children:_.jsx(wn,{name:n,size:20,color:BO,isStroke:!0})}),_.jsx("input",{ref:s,type:r.type??"text",dir:o?"rtl":"ltr",className:_e("h-[32px] rounded-[4px] box-border border border-[var(--input-border-color)]","bg-[var(--input-background-color)]",r.disabled?"":"hover:bg-[var(--input-hover-background-color)] hover:border-[var(--input-hover-border-color)]","focus:bg-[var(--input-active-background-color)] focus:border focus:border-[var(--input-active-border-color)]","outline-none","placeholder:text-[var(--input-placeholder-color)] text-[var(--input-color)]","[&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden",n?"ps-[40px]":"ps-[12px]",r.type==="search"&&r.value?"pe-[40px]":"pe-[2px]",t),style:{border:e?"1px solid var(--input-error-color)":""},value:r.value,spellCheck:!1,...r}),r.type==="search"&&r.value&&_.jsx("button",{type:"button",onClick:i,className:_e("absolute top-[50%] translate-y-[-50%] w-[20px] h-[20px] flex items-center justify-center cursor-pointer",o?"left-[10px]":"right-[10px]"),children:_.jsx(wn,{name:"clear.search",size:20,color:BO,isStroke:!0})})]})});mo.displayName="Input";function Vfe(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,Ffe(r,...e)]}function Ffe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Hfe(t){const e=zfe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Gfe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function zfe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Wfe(r),a=$fe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var N8=Symbol("radix.slottable");function Qfe(t){const e=({children:n})=>_.jsx(_.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=N8,e}function Gfe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===N8}function $fe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Wfe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var jfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kfe=jfe.reduce((t,e)=>{const n=Hfe(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function Yfe(t){const e=qfe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Xfe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function qfe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=epe(r),a=Zfe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Jfe=Symbol("radix.slottable");function Xfe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Jfe}function Zfe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function epe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var tpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],npe=tpe.reduce((t,e)=>{const n=Yfe(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),ipe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rpe="VisuallyHidden",O8=T.forwardRef((t,e)=>_.jsx(npe.span,{...t,ref:e,style:{...ipe,...t.style}}));O8.displayName=rpe;var spe=O8,[nw]=Vfe("Tooltip",[ew]),iw=ew(),B8="TooltipProvider",ope=700,G1="tooltip.open",[ape,WT]=nw(B8),L8=t=>{const{__scopeTooltip:e,delayDuration:n=ope,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=t,o=T.useRef(!0),a=T.useRef(!1),l=T.useRef(0);return T.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),_.jsx(ape,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:T.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:s})};L8.displayName=B8;var ug="Tooltip",[lpe,Jg]=nw(ug),U8=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,l=WT(ug,t.__scopeTooltip),u=iw(e),[d,f]=T.useState(null),g=Al(),m=T.useRef(0),v=o??l.disableHoverableContent,S=a??l.delayDuration,C=T.useRef(!1),[E,k]=dh({prop:i,defaultProp:r??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(G1))):l.onClose(),s?.(N)},caller:ug}),R=T.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),M=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,C.current=!1,k(!0)},[k]),D=T.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),P=T.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{C.current=!0,k(!0),m.current=0},S)},[S,k]);return T.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),_.jsx(_F,{...u,children:_.jsx(lpe,{scope:e,contentId:g,open:E,stateAttribute:R,trigger:d,onTriggerChange:f,onTriggerEnter:T.useCallback(()=>{l.isOpenDelayedRef.current?P():M()},[l.isOpenDelayedRef,P,M]),onTriggerLeave:T.useCallback(()=>{v?D():(window.clearTimeout(m.current),m.current=0)},[D,v]),onOpen:M,onClose:D,disableHoverableContent:v,children:n})})};U8.displayName=ug;var $1="TooltipTrigger",V8=T.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,r=Jg($1,n),s=WT($1,n),o=iw(n),a=T.useRef(null),l=$t(e,a,r.onTriggerChange),u=T.useRef(!1),d=T.useRef(!1),f=T.useCallback(()=>u.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),_.jsx(TF,{asChild:!0,...o,children:_.jsx(Kfe.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...i,ref:l,onPointerMove:Ve(t.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ve(t.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:Ve(t.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ve(t.onFocus,()=>{u.current||r.onOpen()}),onBlur:Ve(t.onBlur,r.onClose),onClick:Ve(t.onClick,r.onClose)})})});V8.displayName=$1;var jT="TooltipPortal",[cpe,upe]=nw(jT,{forceMount:void 0}),F8=t=>{const{__scopeTooltip:e,forceMount:n,children:i,container:r}=t,s=Jg(jT,e);return _.jsx(cpe,{scope:e,forceMount:n,children:_.jsx(_o,{present:n||s.open,children:_.jsx(UT,{asChild:!0,container:r,children:i})})})};F8.displayName=jT;var jd="TooltipContent",H8=T.forwardRef((t,e)=>{const n=upe(jd,t.__scopeTooltip),{forceMount:i=n.forceMount,side:r="top",...s}=t,o=Jg(jd,t.__scopeTooltip);return _.jsx(_o,{present:i||o.open,children:o.disableHoverableContent?_.jsx(z8,{side:r,...s,ref:e}):_.jsx(dpe,{side:r,...s,ref:e})})}),dpe=T.forwardRef((t,e)=>{const n=Jg(jd,t.__scopeTooltip),i=WT(jd,t.__scopeTooltip),r=T.useRef(null),s=$t(e,r),[o,a]=T.useState(null),{trigger:l,onClose:u}=n,d=r.current,{onPointerInTransitChange:f}=i,g=T.useCallback(()=>{a(null),f(!1)},[f]),m=T.useCallback((v,S)=>{const C=v.currentTarget,E={x:v.clientX,y:v.clientY},k=gpe(E,C.getBoundingClientRect()),R=mpe(E,k),M=Ape(S.getBoundingClientRect()),D=vpe([...R,...M]);a(D),f(!0)},[f]);return T.useEffect(()=>()=>g(),[g]),T.useEffect(()=>{if(l&&d){const v=C=>m(C,d),S=C=>m(C,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",S),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",S)}}},[l,d,m,g]),T.useEffect(()=>{if(o){const v=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=l?.contains(C)||d?.contains(C),R=!ype(E,o);k?g():R&&(g(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,o,u,g]),_.jsx(z8,{...t,ref:s})}),[hpe,fpe]=nw(ug,{isInside:!1}),ppe=Qfe("TooltipContent"),z8=T.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=Jg(jd,n),u=iw(n),{onClose:d}=l;return T.useEffect(()=>(document.addEventListener(G1,d),()=>document.removeEventListener(G1,d)),[d]),T.useEffect(()=>{if(l.trigger){const f=g=>{g.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),_.jsx(Yb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:_.jsxs(RF,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[_.jsx(ppe,{children:i}),_.jsx(hpe,{scope:n,isInside:!0,children:_.jsx(spe,{id:l.contentId,role:"tooltip",children:r||i})})]})})});H8.displayName=jd;var Q8="TooltipArrow",G8=T.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,r=iw(n);return fpe(Q8,n).isInside?null:_.jsx(kF,{...r,...i,ref:e})});G8.displayName=Q8;function gpe(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function mpe(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function Ape(t){const{top:e,right:n,bottom:i,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:i},{x:r,y:i}]}function ype(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=g>i&&n<(f-u)*(i-d)/(g-d)+u&&(r=!r)}return r}function vpe(t){const e=t.slice();return e.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),bpe(e)}function bpe(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const r=t[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var wpe=L8,Spe=U8,Cpe=V8,xpe=F8,Epe=H8,_pe=G8;const Tpe=({delayDuration:t=0,...e})=>_.jsx(wpe,{"data-slot":"tooltip-provider",delayDuration:t,...e}),Kd=({...t})=>_.jsx(Tpe,{children:_.jsx(Spe,{"data-slot":"tooltip",...t})}),Yd=({className:t,sideOffset:e=0,children:n,isAbout:i,...r})=>_.jsx(xpe,{container:document.getElementById("app"),children:_.jsxs(Epe,{"data-slot":"tooltip-content",sideOffset:e,className:_e("mt-[4px] z-[9999]","bg-[var(--tooltip-background-color)] text-[var(--tooltip-text-color)] border border-[var(--tooltip-border-color)] p-[4px] rounded-[4px] text-[12px] font-[400] leading-[16px]","whitespace-pre-line",i?"max-w-[272px]":"",t),...r,children:[n,i?_.jsx(_pe,{className:"tooltip-arrow"}):null]})}),qd=({...t})=>_.jsx(Cpe,{"data-slot":"tooltip-trigger",...t}),ua=T.forwardRef(({children:t,tooltip:e,side:n="bottom",visible:i=!0,className:r,...s},o)=>_.jsxs(Kd,{children:[_.jsx(qd,{asChild:!0,children:_.jsx("div",{className:_e("flex items-center gap-2",r),ref:o,...s,children:t})}),_.jsx(Yd,{className:i?"":"hidden",side:n,children:e})]}));ua.displayName="TooltipIconButton";class Rpe{dbName="ChatHistory";version=1;db=null;async init(){return new Promise((e,n)=>{const i=indexedDB.open(this.dbName,this.version);i.onerror=()=>n(i.error),i.onsuccess=()=>{this.db=i.result,e()},i.onupgradeneeded=r=>{const s=r.target.result;if(s.objectStoreNames.contains("threads")||s.createObjectStore("threads",{keyPath:"threadId"}).createIndex("updatedAt","updatedAt",{unique:!1}),!s.objectStoreNames.contains("messages")){const o=s.createObjectStore("messages",{keyPath:"id"});o.createIndex("threadId","threadId",{unique:!1}),o.createIndex("timestamp","timestamp",{unique:!1})}}})}getDB(){if(!this.db)throw new Error("Database not initialized");return this.db}async close(){this.db&&(this.db.close(),this.db=null)}}const is=new Rpe,kpe=()=>is.init(),s0=async(t,e,n)=>{const i=is.getDB(),r={id:e,threadId:t,message:n,timestamp:Date.now()};return new Promise((s,o)=>{const u=i.transaction(["messages"],"readwrite").objectStore("messages").put(r);u.onerror=()=>o(u.error),u.onsuccess=()=>s()})},$8=async(t,e)=>{const n=is.getDB();return new Promise((i,r)=>{const l=n.transaction(["messages"],"readonly").objectStore("messages").index("threadId").getAll(IDBKeyRange.only(t));l.onerror=()=>r(l.error),l.onsuccess=()=>{let u=l.result.sort((d,f)=>d.timestamp-f.timestamp).map(d=>d.message);i(u)}})},LO=async(t,e)=>{const n=is.getDB();return new Promise((i,r)=>{const o=n.transaction(["messages"],"readwrite").objectStore("messages"),a=o.get(t);a.onerror=()=>r(a.error),a.onsuccess=()=>{const l=a.result;if(!l){r(new Error("Message not found"));return}const u={...l,message:e,timestamp:Date.now()},d=o.put(u);d.onerror=()=>r(d.error),d.onsuccess=()=>i()}})},Ipe=async t=>{const e=is.getDB();return new Promise((n,i)=>{const a=e.transaction(["messages"],"readwrite").objectStore("messages").index("threadId").openCursor(IDBKeyRange.only(t));a.onsuccess=l=>{const u=l.target.result;u?(u.delete(),u.continue()):n()},a.onerror=()=>i(a.error)})},Mpe=async(t,e,n,i)=>{const r=is.getDB(),s={threadId:t,title:e,lastEditDate:Date.now(),provider:n,model:i};return new Promise((o,a)=>{const d=r.transaction(["threads"],"readwrite").objectStore("threads").put(s);d.onerror=()=>a(d.error),d.onsuccess=()=>o()})},Dpe=async()=>{const t=is.getDB();return new Promise((e,n)=>{const s=t.transaction(["threads"],"readonly").objectStore("threads").getAll();s.onerror=()=>n(s.error),s.onsuccess=()=>{const o=s.result.sort((a,l)=>l.lastEditDate-a.lastEditDate);e(o)}})},Ppe=async(t,e)=>{const n=is.getDB();return new Promise((i,r)=>{const o=n.transaction(["threads"],"readwrite").objectStore("threads"),a=o.get(t);a.onerror=()=>r(a.error),a.onsuccess=()=>{const l=a.result;if(!l){r(new Error("Thread not found"));return}const u={...l,...e&&{title:e},lastEditDate:Date.now()},d=o.put(u);d.onerror=()=>r(d.error),d.onsuccess=()=>i()}})},Npe=async(t,e)=>{const n=is.getDB();return new Promise((i,r)=>{const o=n.transaction(["threads"],"readwrite").objectStore("threads"),a=o.get(t);a.onerror=()=>r(a.error),a.onsuccess=()=>{const l=a.result;if(!l){r(new Error("Thread not found"));return}const u={...l,...e&&"provider"in e?{provider:e.provider??void 0}:{},...e&&"model"in e?{model:e.model??void 0}:{},lastEditDate:Date.now()},d=o.put(u);d.onerror=()=>r(d.error),d.onsuccess=()=>i()}})},Ope=async t=>{await Ipe(t);const e=is.getDB();return new Promise((n,i)=>{const o=e.transaction(["threads"],"readwrite").objectStore("threads").delete(t);o.onerror=()=>i(o.error),o.onsuccess=()=>n()})},o0="providers",a0="current-provider",op="current-model",UO="deep-mode",kd=100,Py=kd+2,Bpe=`You are an AI assistant with access to a set of MCP tools. +`)}),t},zF=e=>e.replace(/[\\/:*"<>|?]/g,""),Wte=e=>zF(e),tje=e=>{const n=e.split(` +`)[0].replace("## ","");return zF(n).substring(0,30)},Yte=e=>!!(e&64),Xte=e=>!!(e&128),oE=e=>!!(e&256),Zte=e=>e===513||e===521,Vt=({iconName:e,size:t,isStroke:n,isTransform:o,isActive:r,className:i,insideElement:s,disableHover:a,color:c,noColor:p,width:u,height:l,...d})=>{const f=a?void 0:s?"hover:enabled:bg-[var(--icon-button-hover-on-active-background-color)]":"hover:enabled:bg-[var(--icon-button-hover-background-color)]",h=a?void 0:"active:enabled:bg-[var(--icon-button-pressed-background-color)]";return F.jsx("button",{className:ke("border-none cursor-pointer rounded-[4px] bg-none p-0 m-0","flex items-center justify-center",f,h,"disabled:cursor-not-allowed disabled:opacity-[0.5]","outline-none focus:outline-none focus-visible:outline-none",i),style:{width:`${t}px`,height:`${t}px`,...r?{backgroundColor:"var(--icon-button-pressed-background-color)"}:{}},...d,children:F.jsx(tr,{name:e,size:t,isStroke:n,isTransform:o,color:c,noColor:p,width:u,height:l})})},h5="var(--input-color)",Il=Re.forwardRef(({className:e,isError:t,icon:n,onClear:o,...r},i)=>{const{isRTL:s}=wn();return F.jsxs("div",{className:`relative ${e}`,children:[n&&F.jsx("div",{className:ke("absolute top-[50%] translate-y-[-50%] w-[20px] h-[20px] flex items-center justify-center",s?"right-[10px]":"left-[10px]"),children:F.jsx(tr,{name:n,size:20,color:h5,isStroke:!0})}),F.jsx("input",{ref:i,type:r.type??"text",dir:s?"rtl":"ltr",className:ke("h-[32px] rounded-[4px] box-border border border-[var(--input-border-color)]","bg-[var(--input-background-color)]",r.disabled?"":"hover:bg-[var(--input-hover-background-color)] hover:border-[var(--input-hover-border-color)]","focus:bg-[var(--input-active-background-color)] focus:border focus:border-[var(--input-active-border-color)]","outline-none","placeholder:text-[var(--input-placeholder-color)] text-[var(--input-color)]","[&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden",n?"ps-[40px]":"ps-[12px]",r.type==="search"&&r.value?"pe-[40px]":"pe-[2px]",e),style:{border:t?"1px solid var(--input-error-color)":""},value:r.value,spellCheck:!1,...r}),r.type==="search"&&r.value&&F.jsx("button",{type:"button",onClick:o,className:ke("absolute top-[50%] translate-y-[-50%] w-[20px] h-[20px] flex items-center justify-center cursor-pointer",s?"left-[10px]":"right-[10px]"),children:F.jsx(tr,{name:"clear.search",size:20,color:h5,isStroke:!0})})]})});Il.displayName="Input";function nje(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,rje(r,...t)]}function rje(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function oje(e){const t=ije(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(aje);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function ije(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=uje(r),a=lje(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ene=Symbol("radix.slottable");function sje(e){const t=({children:n})=>F.jsx(F.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ene,t}function aje(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ene}function lje(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function uje(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dje=cje.reduce((e,t)=>{const n=oje(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function fje(e){const t=hje(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(mje);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function hje(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=bje(r),a=gje(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pje=Symbol("radix.slottable");function mje(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pje}function gje(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function bje(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Aje=yje.reduce((e,t)=>{const n=fje(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),_je=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),vje="VisuallyHidden",tne=x.forwardRef((e,t)=>F.jsx(Aje.span,{...e,ref:t,style:{..._je,...e.style}}));tne.displayName=vje;var Sje=tne,[kM]=nje("Tooltip",[xM]),UM=xM(),nne="TooltipProvider",Cje=700,G2="tooltip.open",[wje,KF]=kM(nne),rne=e=>{const{__scopeTooltip:t,delayDuration:n=Cje,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=x.useRef(!0),a=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const p=c.current;return()=>window.clearTimeout(p)},[]),F.jsx(wje,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:x.useCallback(p=>{a.current=p},[]),disableHoverableContent:r,children:i})};rne.displayName=nne;var q0="Tooltip",[Oje,EC]=kM(q0),one=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,c=KF(q0,e.__scopeTooltip),p=UM(t),[u,l]=x.useState(null),d=hm(),f=x.useRef(0),h=s??c.disableHoverableContent,m=a??c.delayDuration,g=x.useRef(!1),[y,_]=jA({prop:o,defaultProp:r??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(G2))):c.onClose(),i?.(T)},caller:q0}),S=x.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),w=x.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,_(!0)},[_]),R=x.useCallback(()=>{window.clearTimeout(f.current),f.current=0,_(!1)},[_]),E=x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,_(!0),f.current=0},m)},[m,_]);return x.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),F.jsx(zee,{...p,children:F.jsx(Oje,{scope:t,contentId:d,open:y,stateAttribute:S,trigger:u,onTriggerChange:l,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:x.useCallback(()=>{h?R():(window.clearTimeout(f.current),f.current=0)},[R,h]),onOpen:w,onClose:R,disableHoverableContent:h,children:n})})};one.displayName=q0;var z2="TooltipTrigger",ine=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=EC(z2,n),i=KF(z2,n),s=UM(n),a=x.useRef(null),c=Cn(t,a,r.onTriggerChange),p=x.useRef(!1),u=x.useRef(!1),l=x.useCallback(()=>p.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),F.jsx(Kee,{asChild:!0,...s,children:F.jsx(dje.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:c,onPointerMove:lt(e.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:lt(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:lt(e.onPointerDown,()=>{r.open&&r.onClose(),p.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:lt(e.onFocus,()=>{p.current||r.onOpen()}),onBlur:lt(e.onBlur,r.onClose),onClick:lt(e.onClick,r.onClose)})})});ine.displayName=z2;var QF="TooltipPortal",[Tje,Rje]=kM(QF,{forceMount:void 0}),sne=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=EC(QF,t);return F.jsx(Tje,{scope:t,forceMount:n,children:F.jsx(ql,{present:n||i.open,children:F.jsx(kF,{asChild:!0,container:r,children:o})})})};sne.displayName=QF;var pA="TooltipContent",ane=x.forwardRef((e,t)=>{const n=Rje(pA,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=EC(pA,e.__scopeTooltip);return F.jsx(ql,{present:o||s.open,children:s.disableHoverableContent?F.jsx(lne,{side:r,...i,ref:t}):F.jsx(Eje,{side:r,...i,ref:t})})}),Eje=x.forwardRef((e,t)=>{const n=EC(pA,e.__scopeTooltip),o=KF(pA,e.__scopeTooltip),r=x.useRef(null),i=Cn(t,r),[s,a]=x.useState(null),{trigger:c,onClose:p}=n,u=r.current,{onPointerInTransitChange:l}=o,d=x.useCallback(()=>{a(null),l(!1)},[l]),f=x.useCallback((h,m)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},_=jje(y,g.getBoundingClientRect()),S=Dje(y,_),w=Nje(m.getBoundingClientRect()),R=Fje([...S,...w]);a(R),l(!0)},[l]);return x.useEffect(()=>()=>d(),[d]),x.useEffect(()=>{if(c&&u){const h=g=>f(g,u),m=g=>f(g,c);return c.addEventListener("pointerleave",h),u.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",m)}}},[c,u,f,d]),x.useEffect(()=>{if(s){const h=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},_=c?.contains(g)||u?.contains(g),S=!Lje(y,s);_?d():S&&(d(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,u,s,p,d]),F.jsx(lne,{...e,ref:i})}),[Mje,Pje]=kM(q0,{isInside:!1}),Ije=sje("TooltipContent"),lne=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,c=EC(pA,n),p=UM(n),{onClose:u}=c;return x.useEffect(()=>(document.addEventListener(G2,u),()=>document.removeEventListener(G2,u)),[u]),x.useEffect(()=>{if(c.trigger){const l=d=>{d.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,u]),F.jsx(jM,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l=>l.preventDefault(),onDismiss:u,children:F.jsxs(Qee,{"data-state":c.stateAttribute,...p,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[F.jsx(Ije,{children:o}),F.jsx(Mje,{scope:n,isInside:!0,children:F.jsx(Sje,{id:c.contentId,role:"tooltip",children:r||o})})]})})});ane.displayName=pA;var une="TooltipArrow",cne=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=UM(n);return Pje(une,n).isInside?null:F.jsx($ee,{...r,...o,ref:t})});cne.displayName=une;function jje(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Dje(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Nje(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Lje(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;io!=d>o&&n<(l-p)*(o-u)/(d-u)+p&&(r=!r)}return r}function Fje(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),xje(t)}function xje(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Bje=rne,kje=one,Uje=ine,qje=sne,Jje=ane,Vje=cne;const Hje=({delayDuration:e=0,...t})=>F.jsx(Bje,{"data-slot":"tooltip-provider",delayDuration:e,...t}),mA=({...e})=>F.jsx(Hje,{children:F.jsx(kje,{"data-slot":"tooltip",...e})}),gA=({className:e,sideOffset:t=0,children:n,isAbout:o,...r})=>F.jsx(qje,{container:document.getElementById("app"),children:F.jsxs(Jje,{"data-slot":"tooltip-content",sideOffset:t,className:ke("mt-[4px] z-[9999]","bg-[var(--tooltip-background-color)] text-[var(--tooltip-text-color)] border border-[var(--tooltip-border-color)] p-[4px] rounded-[4px] text-[12px] font-[400] leading-[16px]","whitespace-pre-line",o?"max-w-[272px]":"",e),...r,children:[n,o?F.jsx(Vje,{className:"tooltip-arrow"}):null]})}),bA=({...e})=>F.jsx(Uje,{"data-slot":"tooltip-trigger",...e}),lp=x.forwardRef(({children:e,tooltip:t,side:n="bottom",visible:o=!0,className:r,...i},s)=>F.jsxs(mA,{children:[F.jsx(bA,{asChild:!0,children:F.jsx("div",{className:ke("flex items-center gap-2",r),ref:s,...i,children:e})}),F.jsx(gA,{className:o?"":"hidden",side:n,children:t})]}));lp.displayName="TooltipIconButton";class Gje{dbName="ChatHistory";version=1;db=null;async init(){return new Promise((t,n)=>{const o=indexedDB.open(this.dbName,this.version);o.onerror=()=>n(o.error),o.onsuccess=()=>{this.db=o.result,t()},o.onupgradeneeded=r=>{const i=r.target.result;if(i.objectStoreNames.contains("threads")||i.createObjectStore("threads",{keyPath:"threadId"}).createIndex("updatedAt","updatedAt",{unique:!1}),!i.objectStoreNames.contains("messages")){const s=i.createObjectStore("messages",{keyPath:"id"});s.createIndex("threadId","threadId",{unique:!1}),s.createIndex("timestamp","timestamp",{unique:!1})}}})}getDB(){if(!this.db)throw new Error("Database not initialized");return this.db}async close(){this.db&&(this.db.close(),this.db=null)}}const Yi=new Gje,zje=()=>Yi.init(),NO=async(e,t,n)=>{const o=Yi.getDB(),r={id:t,threadId:e,message:n,timestamp:Date.now()};return new Promise((i,s)=>{const p=o.transaction(["messages"],"readwrite").objectStore("messages").put(r);p.onerror=()=>s(p.error),p.onsuccess=()=>i()})},dne=async(e,t)=>{const n=Yi.getDB();return new Promise((o,r)=>{const c=n.transaction(["messages"],"readonly").objectStore("messages").index("threadId").getAll(IDBKeyRange.only(e));c.onerror=()=>r(c.error),c.onsuccess=()=>{let p=c.result.sort((u,l)=>u.timestamp-l.timestamp).map(u=>u.message);o(p)}})},p5=async(e,t)=>{const n=Yi.getDB();return new Promise((o,r)=>{const s=n.transaction(["messages"],"readwrite").objectStore("messages"),a=s.get(e);a.onerror=()=>r(a.error),a.onsuccess=()=>{const c=a.result;if(!c){r(new Error("Message not found"));return}const p={...c,message:t,timestamp:Date.now()},u=s.put(p);u.onerror=()=>r(u.error),u.onsuccess=()=>o()}})},Kje=async e=>{const t=Yi.getDB();return new Promise((n,o)=>{const a=t.transaction(["messages"],"readwrite").objectStore("messages").index("threadId").openCursor(IDBKeyRange.only(e));a.onsuccess=c=>{const p=c.target.result;p?(p.delete(),p.continue()):n()},a.onerror=()=>o(a.error)})},Qje=async(e,t,n,o)=>{const r=Yi.getDB(),i={threadId:e,title:t,lastEditDate:Date.now(),provider:n,model:o};return new Promise((s,a)=>{const u=r.transaction(["threads"],"readwrite").objectStore("threads").put(i);u.onerror=()=>a(u.error),u.onsuccess=()=>s()})},$je=async()=>{const e=Yi.getDB();return new Promise((t,n)=>{const i=e.transaction(["threads"],"readonly").objectStore("threads").getAll();i.onerror=()=>n(i.error),i.onsuccess=()=>{const s=i.result.sort((a,c)=>c.lastEditDate-a.lastEditDate);t(s)}})},Wje=async(e,t)=>{const n=Yi.getDB();return new Promise((o,r)=>{const s=n.transaction(["threads"],"readwrite").objectStore("threads"),a=s.get(e);a.onerror=()=>r(a.error),a.onsuccess=()=>{const c=a.result;if(!c){r(new Error("Thread not found"));return}const p={...c,...t&&{title:t},lastEditDate:Date.now()},u=s.put(p);u.onerror=()=>r(u.error),u.onsuccess=()=>o()}})},Yje=async(e,t)=>{const n=Yi.getDB();return new Promise((o,r)=>{const s=n.transaction(["threads"],"readwrite").objectStore("threads"),a=s.get(e);a.onerror=()=>r(a.error),a.onsuccess=()=>{const c=a.result;if(!c){r(new Error("Thread not found"));return}const p={...c,...t&&"provider"in t?{provider:t.provider??void 0}:{},...t&&"model"in t?{model:t.model??void 0}:{},lastEditDate:Date.now()},u=s.put(p);u.onerror=()=>r(u.error),u.onsuccess=()=>o()}})},Xje=async e=>{await Kje(e);const t=Yi.getDB();return new Promise((n,o)=>{const s=t.transaction(["threads"],"readwrite").objectStore("threads").delete(e);s.onerror=()=>o(s.error),s.onsuccess=()=>n()})},LO="providers",FO="current-provider",xS="current-model",m5="deep-mode",Wy=100,mR=Wy+2,Zje=`You are an AI assistant with access to a set of MCP tools. Your default behavior is to act as a helpful, conversational LLM assistant: answer questions, explain concepts, brainstorm, or chat naturally. Only call a tool when the user’s request clearly indicates the need for it (e.g., "search", "open URL", "analyze file", "plot data", etc.). If the user’s intent is ambiguous, respond conversationally instead of calling a tool. Do not push the user toward tools unnecessarily. When you do use a tool, explain in natural language what you’re doing if appropriate. -Otherwise, behave as if you are a standalone LLM chat without tools`,KT=`You are an assistant that generates short, clear chat titles. +Otherwise, behave as if you are a standalone LLM chat without tools`,qM=`You are an assistant that generates short, clear chat titles. Instructions: @@ -96,44 +96,44 @@ User: How do I fix TypeScript errors in VSCode? Assistant: Fixing TypeScript errors in VSCode User: write me a poem about a dragon in a cave -Assistant: Poem about a dragon`;class YT{modelKey="";systemPrompt="";apiKey;url;provider;client;tools=[];prevMessages=[];stopFlag=!1;setModelKey=e=>{this.modelKey=e};setSystemPrompt=e=>{this.systemPrompt=e};stopMessage=()=>{this.stopFlag=!0};setApiKey(e){this.apiKey=e;const n=this.client;n&&"apiKey"in n&&(n.apiKey=e)}setUrl(e){this.url=e;const n=this.client;n&&"baseURL"in n&&(n.baseURL=e)}}const hn={invalidKey:(t="Invalid API key")=>({field:"key",message:t}),emptyKey:()=>({field:"key",message:"Empty key"}),invalidUrl:(t="Invalid URL")=>({field:"url",message:t}),connectionFailed:(t="Failed to connect")=>({field:"url",message:t})},Lpe=t=>{if(!(typeof t!="object"||!t)){if("error"in t&&typeof t.error=="object"&&t.error&&"error"in t.error&&typeof t.error.error=="object"&&t.error.error&&"message"in t.error.error)return t.error.error.message;if("message"in t&&typeof t.message=="string")return t.message}},Upe=t=>{if(!(typeof t!="object"||!t)&&"status"in t&&typeof t.status=="number")return t.status},Vpe=t=>{if(!(typeof t!="object"||!t)){if("message"in t&&t.message==="Connection error.")return 404;if("code"in t&&typeof t.code=="string")return t.code}},W8=t=>({...t,content:Array.isArray(t.content)?[...t.content]:t.content}),j8=t=>Array.isArray(t.content)?t.content:null,Xg=t=>t[t.length-1],qT=t=>({type:"text",text:t}),Fpe=(t,e)=>({type:"tool-call",toolCallId:t,toolName:e,args:{},argsText:""}),Hpe=(t,e)=>{e.push(qT(t.text))},zpe=(t,e)=>{e.push({type:"reasoning",text:t.thinking})},Qpe=(t,e)=>{e.push(Fpe(t.id,t.name))},Gpe=(t,e)=>{const n=Xg(e);n?.type==="text"&&(e[e.length-1]=qT(n.text+t.text))},$pe=(t,e)=>{const n=Xg(e);n?.type==="reasoning"&&(e[e.length-1]={...n,text:n.text+t.thinking})},Wpe=(t,e)=>{const n=Xg(e);n?.type==="reasoning"&&(e[e.length-1]={...n,parentId:t.signature})},jpe=t=>{if(!t.trim().endsWith("}"))return{};try{return JSON.parse(t)}catch{return{}}},Kpe=(t,e)=>{const n=Xg(e);if(n?.type!=="tool-call")return;const i=n.argsText+t.partial_json;e[e.length-1]={...n,args:jpe(i),argsText:i}},Ype=t=>({role:t.message.role,content:[]}),qpe=(t,e)=>{const n=W8(e),i=j8(n);if(!i)return n;const{content_block:r}=t,s=Xg(i);return s?.type==="text"&&s.text.startsWith("")&&!s.text.includes("")&&(i[i.length-1]=qT(`${s.text} +Assistant: Poem about a dragon`;class JM{modelKey="";systemPrompt="";apiKey;url;provider;client;tools=[];prevMessages=[];stopFlag=!1;setModelKey=t=>{this.modelKey=t};setSystemPrompt=t=>{this.systemPrompt=t};stopMessage=()=>{this.stopFlag=!0};setApiKey(t){this.apiKey=t;const n=this.client;n&&"apiKey"in n&&(n.apiKey=t)}setUrl(t){this.url=t;const n=this.client;n&&"baseURL"in n&&(n.baseURL=t)}}const yn={invalidKey:(e="Invalid API key")=>({field:"key",message:e}),emptyKey:()=>({field:"key",message:"Empty key"}),invalidUrl:(e="Invalid URL")=>({field:"url",message:e}),connectionFailed:(e="Failed to connect")=>({field:"url",message:e})},fne=e=>{if(!(typeof e!="object"||!e)){if("error"in e&&typeof e.error=="object"&&e.error&&"error"in e.error&&typeof e.error.error=="object"&&e.error.error&&"message"in e.error.error)return e.error.error.message;if("message"in e&&typeof e.message=="string")return e.message}},hne=e=>{if(!(typeof e!="object"||!e)&&"status"in e&&typeof e.status=="number")return e.status},eDe=e=>{if(!(typeof e!="object"||!e)){if("message"in e&&e.message==="Connection error.")return 404;if("code"in e&&typeof e.code=="string")return e.code}},pne=e=>({...e,content:Array.isArray(e.content)?[...e.content]:e.content}),mne=e=>Array.isArray(e.content)?e.content:null,MC=e=>e[e.length-1],$F=e=>({type:"text",text:e}),tDe=(e,t)=>({type:"tool-call",toolCallId:e,toolName:t,args:{},argsText:""}),nDe=(e,t)=>{t.push($F(e.text))},rDe=(e,t)=>{t.push({type:"reasoning",text:e.thinking})},oDe=(e,t)=>{t.push(tDe(e.id,e.name))},iDe=(e,t)=>{const n=MC(t);n?.type==="text"&&(t[t.length-1]=$F(n.text+e.text))},sDe=(e,t)=>{const n=MC(t);n?.type==="reasoning"&&(t[t.length-1]={...n,text:n.text+e.thinking})},aDe=(e,t)=>{const n=MC(t);n?.type==="reasoning"&&(t[t.length-1]={...n,parentId:e.signature})},lDe=e=>{if(!e.trim().endsWith("}"))return{};try{return JSON.parse(e)}catch{return{}}},uDe=(e,t)=>{const n=MC(t);if(n?.type!=="tool-call")return;const o=n.argsText+e.partial_json;t[t.length-1]={...n,args:lDe(o),argsText:o}},cDe=e=>({role:e.message.role,content:[]}),dDe=(e,t)=>{const n=pne(t),o=mne(n);if(!o)return n;const{content_block:r}=e,i=MC(o);return i?.type==="text"&&i.text.startsWith("")&&!i.text.includes("")&&(o[o.length-1]=$F(`${i.text} -`)),r.type==="text"?Hpe(r,i):r.type==="tool_use"?Qpe(r,i):r.type==="thinking"&&zpe(r,i),n},Jpe=(t,e)=>{const n=W8(e),i=j8(n);if(!i)return n;const{delta:r}=t;return r.type==="text_delta"?Gpe(r,i):r.type==="input_json_delta"?Kpe(r,i):r.type==="thinking_delta"?$pe(r,i):r.type==="signature_delta"&&Wpe(r,i),n};function qe(t,e,n,i,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}function Ae(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}let K8=function(){const{crypto:t}=globalThis;if(t?.randomUUID)return K8=t.randomUUID.bind(t),t.randomUUID();const e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))};function dg(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}const W1=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){const e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};class st extends Error{}let _r=class j1 extends st{constructor(e,n,i,r){super(`${j1.makeMessage(e,n,i)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=n}static makeMessage(e,n,i){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,n,i,r){if(!e||!r)return new rw({message:i,cause:W1(n)});const s=n;return e===400?new q8(e,s,i,r):e===401?new J8(e,s,i,r):e===403?new X8(e,s,i,r):e===404?new Z8(e,s,i,r):e===409?new e9(e,s,i,r):e===422?new t9(e,s,i,r):e===429?new n9(e,s,i,r):e>=500?new i9(e,s,i,r):new j1(e,s,i,r)}},vs=class extends _r{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},rw=class extends _r{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},Y8=class extends rw{constructor({message:e}={}){super({message:e??"Request timed out."})}},q8=class extends _r{},J8=class extends _r{},X8=class extends _r{},Z8=class extends _r{},e9=class extends _r{},t9=class extends _r{},n9=class extends _r{},i9=class extends _r{};const Xpe=/^[a-z][a-z0-9+.-]*:/i,Zpe=t=>Xpe.test(t);let K1=t=>(K1=Array.isArray,K1(t)),VO=K1;function FO(t){return typeof t!="object"?{}:t??{}}function ege(t){if(!t)return!0;for(const e in t)return!1;return!0}function tge(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const nge=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new st(`${t} must be an integer`);if(e<0)throw new st(`${t} must be a positive integer`);return e},r9=t=>{try{return JSON.parse(t)}catch{return}},ige=t=>new Promise(e=>setTimeout(e,t)),od="0.60.0",rge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function sge(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const oge=()=>{const t=sge();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":od,"X-Stainless-OS":zO(Deno.build.os),"X-Stainless-Arch":HO(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":od,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":od,"X-Stainless-OS":zO(globalThis.process.platform??"unknown"),"X-Stainless-Arch":HO(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const e=age();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":od,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":od,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function age(){if(typeof navigator>"u"||!navigator)return null;const t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:e,pattern:n}of t){const i=n.exec(navigator.userAgent);if(i){const r=i[1]||0,s=i[2]||0,o=i[3]||0;return{browser:e,version:`${r}.${s}.${o}`}}}return null}const HO=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",zO=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown");let QO;const lge=()=>QO??(QO=oge());function cge(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function s9(...t){const e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function o9(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return s9({start(){},async pull(n){const{done:i,value:r}=await e.next();i?n.close():n.enqueue(r)},async cancel(){await e.return?.()}})}function JT(t){if(t[Symbol.asyncIterator])return t;const e=t.getReader();return{async next(){try{const n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){const n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function uge(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}const e=t.getReader(),n=e.cancel();e.releaseLock(),await n}const dge=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});function hge(t){let e=0;for(const r of t)e+=r.length;const n=new Uint8Array(e);let i=0;for(const r of t)n.set(r,i),i+=r.length;return n}let GO;function XT(t){let e;return(GO??(e=new globalThis.TextEncoder,GO=e.encode.bind(e)))(t)}let $O;function WO(t){let e;return($O??(e=new globalThis.TextDecoder,$O=e.decode.bind(e)))(t)}var pr,gr;let Zg=class{constructor(){pr.set(this,void 0),gr.set(this,void 0),qe(this,pr,new Uint8Array),qe(this,gr,null)}decode(e){if(e==null)return[];const n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?XT(e):e;qe(this,pr,hge([Ae(this,pr,"f"),n]));const i=[];let r;for(;(r=fge(Ae(this,pr,"f"),Ae(this,gr,"f")))!=null;){if(r.carriage&&Ae(this,gr,"f")==null){qe(this,gr,r.index);continue}if(Ae(this,gr,"f")!=null&&(r.index!==Ae(this,gr,"f")+1||r.carriage)){i.push(WO(Ae(this,pr,"f").subarray(0,Ae(this,gr,"f")-1))),qe(this,pr,Ae(this,pr,"f").subarray(Ae(this,gr,"f"))),qe(this,gr,null);continue}const s=Ae(this,gr,"f")!==null?r.preceding-1:r.preceding,o=WO(Ae(this,pr,"f").subarray(0,s));i.push(o),qe(this,pr,Ae(this,pr,"f").subarray(r.index)),qe(this,gr,null)}return i}flush(){return Ae(this,pr,"f").length?this.decode(` -`):[]}};pr=new WeakMap,gr=new WeakMap;Zg.NEWLINE_CHARS=new Set([` -`,"\r"]);Zg.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function fge(t,e){for(let r=e??0;r{if(t){if(tge(Cv,t))return t;Ti(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Cv))}`)}};function ap(){}function l0(t,e,n){return!e||Cv[t]>Cv[n]?ap:e[t].bind(e)}const gge={error:ap,warn:ap,info:ap,debug:ap};let KO=new WeakMap;function Ti(t){const e=t.logger,n=t.logLevel??"off";if(!e)return gge;const i=KO.get(e);if(i&&i[0]===n)return i[1];const r={error:l0("error",e,n),warn:l0("warn",e,n),info:l0("info",e,n),debug:l0("debug",e,n)};return KO.set(e,[n,r]),r}const fc=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);var Df;let hg=class lp{constructor(e,n,i){this.iterator=e,Df.set(this,void 0),this.controller=n,qe(this,Df,i)}static fromSSEResponse(e,n,i){let r=!1;const s=i?Ti(i):console;async function*o(){if(r)throw new st("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const l of mge(e,n)){if(l.event==="completion")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event==="message_start"||l.event==="message_delta"||l.event==="message_stop"||l.event==="content_block_start"||l.event==="content_block_delta"||l.event==="content_block_stop")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event!=="ping"&&l.event==="error")throw new _r(void 0,r9(l.data)??l.data,void 0,e.headers)}a=!0}catch(l){if(dg(l))return;throw l}finally{a||n.abort()}}return new lp(o,n,i)}static fromReadableStream(e,n,i){let r=!1;async function*s(){const a=new Zg,l=JT(e);for await(const u of l)for(const d of a.decode(u))yield d;for(const u of a.flush())yield u}async function*o(){if(r)throw new st("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const l of s())a||l&&(yield JSON.parse(l));a=!0}catch(l){if(dg(l))return;throw l}finally{a||n.abort()}}return new lp(o,n,i)}[(Df=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const e=[],n=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const o=i.next();e.push(o),n.push(o)}return s.shift()}});return[new lp(()=>r(e),this.controller,Ae(this,Df,"f")),new lp(()=>r(n),this.controller,Ae(this,Df,"f"))]}toReadableStream(){const e=this;let n;return s9({async start(){n=e[Symbol.asyncIterator]()},async pull(i){try{const{value:r,done:s}=await n.next();if(s)return i.close();const o=XT(JSON.stringify(r)+` -`);i.enqueue(o)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};async function*mge(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new st("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new st("Attempted to iterate over a response with no body");const n=new yge,i=new Zg,r=JT(t.body);for await(const s of Age(r))for(const o of i.decode(s)){const a=n.decode(o);a&&(yield a)}for(const s of i.flush()){const o=n.decode(s);o&&(yield o)}}async function*Age(t){let e=new Uint8Array;for await(const n of t){if(n==null)continue;const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?XT(n):n;let r=new Uint8Array(e.length+i.length);r.set(e),r.set(i,e.length),e=r;let s;for(;(s=pge(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}let yge=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,i,r]=vge(e,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}};function vge(t,e){const n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}async function a9(t,e){const{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:s}=e,o=await(async()=>{if(e.options.stream)return Ti(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller):hg.fromSSEResponse(n,e.controller);if(n.status===204)return null;if(e.options.__binaryResponse)return n;const l=n.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){const f=await n.json();return l9(f,n)}return await n.text()})();return Ti(t).debug(`[${i}] response parsed`,fc({retryOfRequestLogID:r,url:n.url,status:n.status,body:o,durationMs:Date.now()-s})),o}function l9(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var cp;let c9=class u9 extends Promise{constructor(e,n,i=a9){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,cp.set(this,void 0),qe(this,cp,e)}_thenUnwrap(e){return new u9(Ae(this,cp,"f"),this.responsePromise,async(n,i)=>l9(e(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ae(this,cp,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};cp=new WeakMap;var c0;let bge=class{constructor(e,n,i,r){c0.set(this,void 0),qe(this,c0,e),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const e=this.nextPageRequestOptions();if(!e)throw new st("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ae(this,c0,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(c0=new WeakMap,Symbol.asyncIterator)](){for await(const e of this.iterPages())for(const n of e.getPaginatedItems())yield n}},wge=class extends c9{constructor(e,n,i){super(e,n,async(r,s)=>new i(r,s.response,await a9(r,s),s.options))}async*[Symbol.asyncIterator](){const e=await this;for await(const n of e)yield n}},em=class extends bge{constructor(e,n,i,r){super(e,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const n=this.first_id;return n?{...this.options,query:{...FO(this.options.query),before_id:n}}:null}const e=this.last_id;return e?{...this.options,query:{...FO(this.options.query),after_id:e}}:null}};const d9=()=>{if(typeof File>"u"){const{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Id(t,e,n){return d9(),new File(t,e??"unknown_file",n)}function Ny(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}const h9=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",Sge=async(t,e)=>({...t,body:await xge(t.body,e)}),YO=new WeakMap;function Cge(t){const e=typeof t=="function"?t:t.fetch,n=YO.get(e);if(n)return n;const i=(async()=>{try{const r="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new r(s).text()}catch{return!0}})();return YO.set(e,i),i}const xge=async(t,e)=>{if(!await Cge(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(t||{}).map(([i,r])=>Y1(n,i,r))),n},Ege=t=>t instanceof Blob&&"name"in t,Y1=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response){let i={};const r=n.headers.get("Content-Type");r&&(i={type:r}),t.append(e,Id([await n.blob()],Ny(n),i))}else if(h9(n))t.append(e,Id([await new Response(o9(n)).blob()],Ny(n)));else if(Ege(n))t.append(e,Id([n],Ny(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(i=>Y1(t,e+"[]",i)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([i,r])=>Y1(t,`${e}[${i}]`,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},f9=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",_ge=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&f9(t),Tge=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function";async function Rge(t,e,n){if(d9(),t=await t,e||(e=Ny(t)),_ge(t))return t instanceof File&&e==null&&n==null?t:Id([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...n});if(Tge(t)){const r=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Id(await q1(r),e,n)}const i=await q1(t);if(!n?.type){const r=i.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof r=="string"&&(n={...n,type:r})}return Id(i,e,n)}async function q1(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(f9(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(h9(t))for await(const n of t)e.push(...await q1(n));else{const n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${kge(t)}`)}return e}function kge(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}let ma=class{constructor(e){this._client=e}};const p9=Symbol.for("brand.privateNullableHeaders");function*Ige(t){if(!t)return;if(p9 in t){const{values:i,nulls:r}=t;yield*i.entries();for(const s of r)yield[s,null];return}let e=!1,n;t instanceof Headers?n=t.entries():VO(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let i of n){const r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const s=VO(i[1])?i[1]:[i[1]];let o=!1;for(const a of s)a!==void 0&&(e&&!o&&(o=!0,yield[r,null]),yield[r,a])}}const qt=t=>{const e=new Headers,n=new Set;for(const i of t){const r=new Set;for(const[s,o]of Ige(i)){const a=s.toLowerCase();r.has(a)||(e.delete(s),r.add(a)),o===null?(e.delete(s),n.add(a)):(e.append(s,o),n.delete(a))}}return{[p9]:!0,values:e,nulls:n}};function g9(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const qO=Object.freeze(Object.create(null)),Mge=(t=g9)=>function(n,...i){if(n.length===1)return n[0];let r=!1;const s=[],o=n.reduce((d,f,g)=>{/[?#]/.test(f)&&(r=!0);const m=i[g];let v=(r?encodeURIComponent:t)(""+m);return g!==i.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??qO)??qO)?.toString)&&(v=m+"",s.push({start:d.length+f.length,length:v.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(g===i.length?"":v)},""),a=o.split(/[?#]/,1)[0],l=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=l.exec(a))!==null;)s.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(s.sort((d,f)=>d.start-f.start),s.length>0){let d=0;const f=s.reduce((g,m)=>{const v=" ".repeat(m.start-d),S="^".repeat(m.length);return d=m.start+m.length,g+v+S},"");throw new st(`Path parameters result in path with invalid segments: -${s.map(g=>g.error).join(` +`)),r.type==="text"?nDe(r,o):r.type==="tool_use"?oDe(r,o):r.type==="thinking"&&rDe(r,o),n},fDe=(e,t)=>{const n=pne(t),o=mne(n);if(!o)return n;const{delta:r}=e;return r.type==="text_delta"?iDe(r,o):r.type==="input_json_delta"?uDe(r,o):r.type==="thinking_delta"?sDe(r,o):r.type==="signature_delta"&&aDe(r,o),n};function St(e,t,n,o,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}function Ee(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)}let gne=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return gne=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^n()&15>>+o/4).toString(16))};function J0(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const K2=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class jt extends Error{}let mi=class Q2 extends jt{constructor(t,n,o,r){super(`${Q2.makeMessage(t,n,o)}`),this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.error=n}static makeMessage(t,n,o){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):o;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,o,r){if(!t||!r)return new VM({message:o,cause:K2(n)});const i=n;return t===400?new yne(t,i,o,r):t===401?new Ane(t,i,o,r):t===403?new _ne(t,i,o,r):t===404?new vne(t,i,o,r):t===409?new Sne(t,i,o,r):t===422?new Cne(t,i,o,r):t===429?new wne(t,i,o,r):t>=500?new One(t,i,o,r):new Q2(t,i,o,r)}},gs=class extends mi{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},VM=class extends mi{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},bne=class extends VM{constructor({message:t}={}){super({message:t??"Request timed out."})}},yne=class extends mi{},Ane=class extends mi{},_ne=class extends mi{},vne=class extends mi{},Sne=class extends mi{},Cne=class extends mi{},wne=class extends mi{},One=class extends mi{};const hDe=/^[a-z][a-z0-9+.-]*:/i,pDe=e=>hDe.test(e);let $2=e=>($2=Array.isArray,$2(e)),g5=$2;function b5(e){return typeof e!="object"?{}:e??{}}function mDe(e){if(!e)return!0;for(const t in e)return!1;return!0}function gDe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const bDe=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new jt(`${e} must be an integer`);if(t<0)throw new jt(`${e} must be a positive integer`);return t},Tne=e=>{try{return JSON.parse(e)}catch{return}},yDe=e=>new Promise(t=>setTimeout(t,e)),Ry="0.60.0",ADe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function _De(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const vDe=()=>{const e=_De();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ry,"X-Stainless-OS":A5(Deno.build.os),"X-Stainless-Arch":y5(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ry,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ry,"X-Stainless-OS":A5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":y5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const t=SDe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ry,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ry,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function SDe(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:n}of e){const o=n.exec(navigator.userAgent);if(o){const r=o[1]||0,i=o[2]||0,s=o[3]||0;return{browser:t,version:`${r}.${i}.${s}`}}}return null}const y5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",A5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let _5;const CDe=()=>_5??(_5=vDe());function wDe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Rne(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Ene(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Rne({start(){},async pull(n){const{done:o,value:r}=await t.next();o?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function WF(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function ODe(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const t=e.getReader(),n=t.cancel();t.releaseLock(),await n}const TDe=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function RDe(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let o=0;for(const r of e)n.set(r,o),o+=r.length;return n}let v5;function YF(e){let t;return(v5??(t=new globalThis.TextEncoder,v5=t.encode.bind(t)))(e)}let S5;function C5(e){let t;return(S5??(t=new globalThis.TextDecoder,S5=t.decode.bind(t)))(e)}var ri,oi;let PC=class{constructor(){ri.set(this,void 0),oi.set(this,void 0),St(this,ri,new Uint8Array),St(this,oi,null)}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?YF(t):t;St(this,ri,RDe([Ee(this,ri,"f"),n]));const o=[];let r;for(;(r=EDe(Ee(this,ri,"f"),Ee(this,oi,"f")))!=null;){if(r.carriage&&Ee(this,oi,"f")==null){St(this,oi,r.index);continue}if(Ee(this,oi,"f")!=null&&(r.index!==Ee(this,oi,"f")+1||r.carriage)){o.push(C5(Ee(this,ri,"f").subarray(0,Ee(this,oi,"f")-1))),St(this,ri,Ee(this,ri,"f").subarray(Ee(this,oi,"f"))),St(this,oi,null);continue}const i=Ee(this,oi,"f")!==null?r.preceding-1:r.preceding,s=C5(Ee(this,ri,"f").subarray(0,i));o.push(s),St(this,ri,Ee(this,ri,"f").subarray(r.index)),St(this,oi,null)}return o}flush(){return Ee(this,ri,"f").length?this.decode(` +`):[]}};ri=new WeakMap,oi=new WeakMap;PC.NEWLINE_CHARS=new Set([` +`,"\r"]);PC.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function EDe(e,t){for(let r=t??0;r{if(e){if(gDe(iE,e))return e;po(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(iE))}`)}};function BS(){}function xO(e,t,n){return!t||iE[e]>iE[n]?BS:t[e].bind(t)}const PDe={error:BS,warn:BS,info:BS,debug:BS};let O5=new WeakMap;function po(e){const t=e.logger,n=e.logLevel??"off";if(!t)return PDe;const o=O5.get(t);if(o&&o[0]===n)return o[1];const r={error:xO("error",t,n),warn:xO("warn",t,n),info:xO("info",t,n),debug:xO("debug",t,n)};return O5.set(t,[n,r]),r}const Ag=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var ev;let V0=class kS{constructor(t,n,o){this.iterator=t,ev.set(this,void 0),this.controller=n,St(this,ev,o)}static fromSSEResponse(t,n,o){let r=!1;const i=o?po(o):console;async function*s(){if(r)throw new jt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const c of IDe(t,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(p){throw i.error("Could not parse message into JSON:",c.data),i.error("From chunk:",c.raw),p}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop")try{yield JSON.parse(c.data)}catch(p){throw i.error("Could not parse message into JSON:",c.data),i.error("From chunk:",c.raw),p}if(c.event!=="ping"&&c.event==="error")throw new mi(void 0,Tne(c.data)??c.data,void 0,t.headers)}a=!0}catch(c){if(J0(c))return;throw c}finally{a||n.abort()}}return new kS(s,n,o)}static fromReadableStream(t,n,o){let r=!1;async function*i(){const a=new PC,c=WF(t);for await(const p of c)for(const u of a.decode(p))yield u;for(const p of a.flush())yield p}async function*s(){if(r)throw new jt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const c of i())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(J0(c))return;throw c}finally{a||n.abort()}}return new kS(s,n,o)}[(ev=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const t=[],n=[],o=this.iterator(),r=i=>({next:()=>{if(i.length===0){const s=o.next();t.push(s),n.push(s)}return i.shift()}});return[new kS(()=>r(t),this.controller,Ee(this,ev,"f")),new kS(()=>r(n),this.controller,Ee(this,ev,"f"))]}toReadableStream(){const t=this;let n;return Rne({async start(){n=t[Symbol.asyncIterator]()},async pull(o){try{const{value:r,done:i}=await n.next();if(i)return o.close();const s=YF(JSON.stringify(r)+` +`);o.enqueue(s)}catch(r){o.error(r)}},async cancel(){await n.return?.()}})}};async function*IDe(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new jt("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new jt("Attempted to iterate over a response with no body");const n=new DDe,o=new PC,r=WF(e.body);for await(const i of jDe(r))for(const s of o.decode(i)){const a=n.decode(s);a&&(yield a)}for(const i of o.flush()){const s=n.decode(i);s&&(yield s)}}async function*jDe(e){let t=new Uint8Array;for await(const n of e){if(n==null)continue;const o=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?YF(n):n;let r=new Uint8Array(t.length+o.length);r.set(t),r.set(o,t.length),t=r;let i;for(;(i=MDe(t))!==-1;)yield t.slice(0,i),t=t.slice(i)}t.length>0&&(yield t)}let DDe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const i={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,o,r]=NDe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}};function NDe(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function Mne(e,t){const{response:n,requestLogID:o,retryOfRequestLogID:r,startTime:i}=t,s=await(async()=>{if(t.options.stream)return po(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller):V0.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){const l=await n.json();return Pne(l,n)}return await n.text()})();return po(e).debug(`[${o}] response parsed`,Ag({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-i})),s}function Pne(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var US;let Ine=class jne extends Promise{constructor(t,n,o=Mne){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=o,US.set(this,void 0),St(this,US,t)}_thenUnwrap(t){return new jne(Ee(this,US,"f"),this.responsePromise,async(n,o)=>Pne(t(await this.parseResponse(n,o),o),o.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(Ee(this,US,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};US=new WeakMap;var BO;let LDe=class{constructor(t,n,o,r){BO.set(this,void 0),St(this,BO,t),this.options=r,this.response=n,this.body=o}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const t=this.nextPageRequestOptions();if(!t)throw new jt("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ee(this,BO,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(BO=new WeakMap,Symbol.asyncIterator)](){for await(const t of this.iterPages())for(const n of t.getPaginatedItems())yield n}},FDe=class extends Ine{constructor(t,n,o){super(t,n,async(r,i)=>new o(r,i.response,await Mne(r,i),i.options))}async*[Symbol.asyncIterator](){const t=await this;for await(const n of t)yield n}},IC=class extends LDe{constructor(t,n,o,r){super(t,n,o,r),this.data=o.data||[],this.has_more=o.has_more||!1,this.first_id=o.first_id||null,this.last_id=o.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const n=this.first_id;return n?{...this.options,query:{...b5(this.options.query),before_id:n}}:null}const t=this.last_id;return t?{...this.options,query:{...b5(this.options.query),after_id:t}}:null}};const Dne=()=>{if(typeof File>"u"){const{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Yy(e,t,n){return Dne(),new File(e,t??"unknown_file",n)}function gR(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const Nne=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",xDe=async(e,t)=>({...e,body:await kDe(e.body,t)}),T5=new WeakMap;function BDe(e){const t=typeof e=="function"?e:e.fetch,n=T5.get(t);if(n)return n;const o=(async()=>{try{const r="Response"in t?t.Response:(await t("data:,")).constructor,i=new FormData;return i.toString()!==await new r(i).text()}catch{return!0}})();return T5.set(t,o),o}const kDe=async(e,t)=>{if(!await BDe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(e||{}).map(([o,r])=>W2(n,o,r))),n},UDe=e=>e instanceof Blob&&"name"in e,W2=async(e,t,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let o={};const r=n.headers.get("Content-Type");r&&(o={type:r}),e.append(t,Yy([await n.blob()],gR(n),o))}else if(Nne(n))e.append(t,Yy([await new Response(Ene(n)).blob()],gR(n)));else if(UDe(n))e.append(t,Yy([n],gR(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(o=>W2(e,t+"[]",o)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([o,r])=>W2(e,`${t}[${o}]`,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},Lne=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",qDe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&Lne(e),JDe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function VDe(e,t,n){if(Dne(),e=await e,t||(t=gR(e)),qDe(e))return e instanceof File&&t==null&&n==null?e:Yy([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(JDe(e)){const r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),Yy(await Y2(r),t,n)}const o=await Y2(e);if(!n?.type){const r=o.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof r=="string"&&(n={...n,type:r})}return Yy(o,t,n)}async function Y2(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(Lne(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(Nne(e))for await(const n of e)t.push(...await Y2(n));else{const n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${HDe(e)}`)}return t}function HDe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}let pp=class{constructor(t){this._client=t}};const Fne=Symbol.for("brand.privateNullableHeaders");function*GDe(e){if(!e)return;if(Fne in e){const{values:o,nulls:r}=e;yield*o.entries();for(const i of r)yield[i,null];return}let t=!1,n;e instanceof Headers?n=e.entries():g5(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let o of n){const r=o[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const i=g5(o[1])?o[1]:[o[1]];let s=!1;for(const a of i)a!==void 0&&(t&&!s&&(s=!0,yield[r,null]),yield[r,a])}}const Rn=e=>{const t=new Headers,n=new Set;for(const o of e){const r=new Set;for(const[i,s]of GDe(o)){const a=i.toLowerCase();r.has(a)||(t.delete(i),r.add(a)),s===null?(t.delete(i),n.add(a)):(t.append(i,s),n.delete(a))}}return{[Fne]:!0,values:t,nulls:n}};function xne(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const R5=Object.freeze(Object.create(null)),zDe=(e=xne)=>function(n,...o){if(n.length===1)return n[0];let r=!1;const i=[],s=n.reduce((u,l,d)=>{/[?#]/.test(l)&&(r=!0);const f=o[d];let h=(r?encodeURIComponent:e)(""+f);return d!==o.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??R5)??R5)?.toString)&&(h=f+"",i.push({start:u.length+l.length,length:h.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+l+(d===o.length?"":h)},""),a=s.split(/[?#]/,1)[0],c=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let p;for(;(p=c.exec(a))!==null;)i.push({start:p.index,length:p[0].length,error:`Value "${p[0]}" can't be safely passed as a path parameter`});if(i.sort((u,l)=>u.start-l.start),i.length>0){let u=0;const l=i.reduce((d,f)=>{const h=" ".repeat(f.start-u),m="^".repeat(f.length);return u=f.start+f.length,d+h+m},"");throw new jt(`Path parameters result in path with invalid segments: +${i.map(d=>d.error).join(` `)} -${o} -${f}`)}return o},Cs=Mge(g9);let m9=class extends ma{list(e={},n){const{betas:i,...r}=e??{};return this._client.getAPIList("/v1/files",em,{query:r,...n,headers:qt([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}delete(e,n={},i){const{betas:r}=n??{};return this._client.delete(Cs`/v1/files/${e}`,{...i,headers:qt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},i?.headers])})}download(e,n={},i){const{betas:r}=n??{};return this._client.get(Cs`/v1/files/${e}/content`,{...i,headers:qt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},i?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n={},i){const{betas:r}=n??{};return this._client.get(Cs`/v1/files/${e}`,{...i,headers:qt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},i?.headers])})}upload(e,n){const{betas:i,...r}=e;return this._client.post("/v1/files",Sge({body:r,...n,headers:qt([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}},A9=class extends ma{retrieve(e,n={},i){const{betas:r}=n??{};return this._client.get(Cs`/v1/models/${e}?beta=true`,{...i,headers:qt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(e={},n){const{betas:i,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",em,{query:r,...n,headers:qt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}};class sw{constructor(e,n){this.iterator=e,this.controller=n}async*decoder(){const e=new Zg;for await(const n of this.iterator)for(const i of e.decode(n))yield JSON.parse(i);for(const n of e.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new st("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new st("Attempted to iterate over a response with no body");return new sw(JT(e.body),n)}}let y9=class extends ma{create(e,n){const{betas:i,...r}=e;return this._client.post("/v1/messages/batches?beta=true",{body:r,...n,headers:qt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}retrieve(e,n={},i){const{betas:r}=n??{};return this._client.get(Cs`/v1/messages/batches/${e}?beta=true`,{...i,headers:qt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},i?.headers])})}list(e={},n){const{betas:i,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",em,{query:r,...n,headers:qt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(e,n={},i){const{betas:r}=n??{};return this._client.delete(Cs`/v1/messages/batches/${e}?beta=true`,{...i,headers:qt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},i?.headers])})}cancel(e,n={},i){const{betas:r}=n??{};return this._client.post(Cs`/v1/messages/batches/${e}/cancel?beta=true`,{...i,headers:qt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},i?.headers])})}async results(e,n={},i){const r=await this.retrieve(e);if(!r.results_url)throw new st(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);const{betas:s}=n??{};return this._client.get(r.results_url,{...i,headers:qt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,a)=>sw.fromResponse(a.response,a.controller))}};const Dge=t=>{let e=0,n=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),ad(t);case"number":let n=e.value[e.value.length-1];if(n==="."||n==="-")return t=t.slice(0,t.length-1),ad(t);case"string":let i=t[t.length-2];if(i?.type==="delimiter")return t=t.slice(0,t.length-1),ad(t);if(i?.type==="brace"&&i.value==="{")return t=t.slice(0,t.length-1),ad(t);break;case"delimiter":return t=t.slice(0,t.length-1),ad(t)}return t},Pge=t=>{let e=[];return t.map(n=>{n.type==="brace"&&(n.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(n=>{n==="}"?t.push({type:"brace",value:"}"}):n==="]"&&t.push({type:"paren",value:"]"})}),t},Nge=t=>{let e="";return t.map(n=>{n.type==="string"?e+='"'+n.value+'"':e+=n.value}),e},v9=t=>JSON.parse(Nge(Pge(ad(Dge(t)))));var Fr,nl,Pf,u0,Nf,Of,d0,Bf,Xo,Lf,h0,f0,Ku,p0,g0,Bx,JO,m0,Lx,Ux,Vx,XO;const ZO="__json_buf";function eB(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}class xv{constructor(){Fr.add(this),this.messages=[],this.receivedMessages=[],nl.set(this,void 0),this.controller=new AbortController,Pf.set(this,void 0),u0.set(this,()=>{}),Nf.set(this,()=>{}),Of.set(this,void 0),d0.set(this,()=>{}),Bf.set(this,()=>{}),Xo.set(this,{}),Lf.set(this,!1),h0.set(this,!1),f0.set(this,!1),Ku.set(this,!1),p0.set(this,void 0),g0.set(this,void 0),m0.set(this,e=>{if(qe(this,h0,!0),dg(e)&&(e=new vs),e instanceof vs)return qe(this,f0,!0),this._emit("abort",e);if(e instanceof st)return this._emit("error",e);if(e instanceof Error){const n=new st(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new st(String(e)))}),qe(this,Pf,new Promise((e,n)=>{qe(this,u0,e,"f"),qe(this,Nf,n,"f")})),qe(this,Of,new Promise((e,n)=>{qe(this,d0,e,"f"),qe(this,Bf,n,"f")})),Ae(this,Pf,"f").catch(()=>{}),Ae(this,Of,"f").catch(()=>{})}get response(){return Ae(this,p0,"f")}get request_id(){return Ae(this,g0,"f")}async withResponse(){const e=await Ae(this,Pf,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){const n=new xv;return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,i){const r=new xv;for(const s of n.messages)r._addMessageParam(s);return r._run(()=>r._createMessage(e,{...n,stream:!0},{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ae(this,m0,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,i){const r=i?.signal;let s;r&&(r.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),r.addEventListener("abort",s));try{Ae(this,Fr,"m",Lx).call(this);const{response:o,data:a}=await e.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(o);for await(const l of a)Ae(this,Fr,"m",Ux).call(this,l);if(a.controller.signal?.aborted)throw new vs;Ae(this,Fr,"m",Vx).call(this)}finally{r&&s&&r.removeEventListener("abort",s)}}_connected(e){this.ended||(qe(this,p0,e),qe(this,g0,e?.headers.get("request-id")),Ae(this,u0,"f").call(this,e),this._emit("connect"))}get ended(){return Ae(this,Lf,"f")}get errored(){return Ae(this,h0,"f")}get aborted(){return Ae(this,f0,"f")}abort(){this.controller.abort()}on(e,n){return(Ae(this,Xo,"f")[e]||(Ae(this,Xo,"f")[e]=[])).push({listener:n}),this}off(e,n){const i=Ae(this,Xo,"f")[e];if(!i)return this;const r=i.findIndex(s=>s.listener===n);return r>=0&&i.splice(r,1),this}once(e,n){return(Ae(this,Xo,"f")[e]||(Ae(this,Xo,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,i)=>{qe(this,Ku,!0),e!=="error"&&this.once("error",i),this.once(e,n)})}async done(){qe(this,Ku,!0),await Ae(this,Of,"f")}get currentMessage(){return Ae(this,nl,"f")}async finalMessage(){return await this.done(),Ae(this,Fr,"m",Bx).call(this)}async finalText(){return await this.done(),Ae(this,Fr,"m",JO).call(this)}_emit(e,...n){if(Ae(this,Lf,"f"))return;e==="end"&&(qe(this,Lf,!0),Ae(this,d0,"f").call(this));const i=Ae(this,Xo,"f")[e];if(i&&(Ae(this,Xo,"f")[e]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),e==="abort"){const r=n[0];!Ae(this,Ku,"f")&&!i?.length&&Promise.reject(r),Ae(this,Nf,"f").call(this,r),Ae(this,Bf,"f").call(this,r),this._emit("end");return}if(e==="error"){const r=n[0];!Ae(this,Ku,"f")&&!i?.length&&Promise.reject(r),Ae(this,Nf,"f").call(this,r),Ae(this,Bf,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ae(this,Fr,"m",Bx).call(this))}async _fromReadableStream(e,n){const i=n?.signal;let r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{Ae(this,Fr,"m",Lx).call(this),this._connected(null);const s=hg.fromReadableStream(e,this.controller);for await(const o of s)Ae(this,Fr,"m",Ux).call(this,o);if(s.controller.signal?.aborted)throw new vs;Ae(this,Fr,"m",Vx).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(nl=new WeakMap,Pf=new WeakMap,u0=new WeakMap,Nf=new WeakMap,Of=new WeakMap,d0=new WeakMap,Bf=new WeakMap,Xo=new WeakMap,Lf=new WeakMap,h0=new WeakMap,f0=new WeakMap,Ku=new WeakMap,p0=new WeakMap,g0=new WeakMap,m0=new WeakMap,Fr=new WeakSet,Bx=function(){if(this.receivedMessages.length===0)throw new st("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},JO=function(){if(this.receivedMessages.length===0)throw new st("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new st("stream ended without producing a content block with type=text");return n.join(" ")},Lx=function(){this.ended||qe(this,nl,void 0)},Ux=function(n){if(this.ended)return;const i=Ae(this,Fr,"m",XO).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{const r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{eB(r)&&r.input&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(i,!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{qe(this,nl,i);break}}},Vx=function(){if(this.ended)throw new st("stream has ended, this shouldn't happen");const n=Ae(this,nl,"f");if(!n)throw new st("request ended without sending any chunks");return qe(this,nl,void 0),n},XO=function(n){let i=Ae(this,nl,"f");if(n.type==="message_start"){if(i)throw new st(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new st(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.container=n.delta.container,i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),i;case"content_block_start":return i.content.push(n.content_block),i;case"content_block_delta":{const r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&eB(r)){let s=r[ZO]||"";s+=n.delta.partial_json;const o={...r};if(Object.defineProperty(o,ZO,{value:s,enumerable:!1,writable:!0}),s)try{o.input=v9(s)}catch(a){const l=new st(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${s}`);Ae(this,m0,"f").call(this,l)}i.content[n.index]=o}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":return i}},Symbol.asyncIterator)](){const e=[],n=[];let i=!1;return this.on("streamEvent",r=>{const s=n.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new hg(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const b9={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192},tB={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-5-sonnet-20241022":"October 22, 2025","claude-3-5-sonnet-20240620":"October 22, 2025"};let ZT=class extends ma{constructor(){super(...arguments),this.batches=new y9(this._client)}create(e,n){const{betas:i,...r}=e;r.model in tB&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${tB[r.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let s=this._client._options.timeout;if(!r.stream&&s==null){const o=b9[r.model]??void 0;s=this._client.calculateNonstreamingTimeout(r.max_tokens,o)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:s??6e5,...n,headers:qt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers]),stream:e.stream??!1})}stream(e,n){return xv.createMessage(this,e,n)}countTokens(e,n){const{betas:i,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...n,headers:qt([{"anthropic-beta":[...i??[],"token-counting-2024-11-01"].toString()},n?.headers])})}};ZT.Batches=y9;let tm=class extends ma{constructor(){super(...arguments),this.models=new A9(this._client),this.messages=new ZT(this._client),this.files=new m9(this._client)}};tm.Models=A9;tm.Messages=ZT;tm.Files=m9;let w9=class extends ma{create(e,n){const{betas:i,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...n,headers:qt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers]),stream:e.stream??!1})}};var Hr,il,Uf,A0,Vf,Ff,y0,Hf,Zo,zf,v0,b0,Yu,w0,S0,Fx,nB,Hx,zx,Qx,Gx,iB;const rB="__json_buf";function sB(t){return t.type==="tool_use"||t.type==="server_tool_use"}class Ev{constructor(){Hr.add(this),this.messages=[],this.receivedMessages=[],il.set(this,void 0),this.controller=new AbortController,Uf.set(this,void 0),A0.set(this,()=>{}),Vf.set(this,()=>{}),Ff.set(this,void 0),y0.set(this,()=>{}),Hf.set(this,()=>{}),Zo.set(this,{}),zf.set(this,!1),v0.set(this,!1),b0.set(this,!1),Yu.set(this,!1),w0.set(this,void 0),S0.set(this,void 0),Hx.set(this,e=>{if(qe(this,v0,!0),dg(e)&&(e=new vs),e instanceof vs)return qe(this,b0,!0),this._emit("abort",e);if(e instanceof st)return this._emit("error",e);if(e instanceof Error){const n=new st(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new st(String(e)))}),qe(this,Uf,new Promise((e,n)=>{qe(this,A0,e,"f"),qe(this,Vf,n,"f")})),qe(this,Ff,new Promise((e,n)=>{qe(this,y0,e,"f"),qe(this,Hf,n,"f")})),Ae(this,Uf,"f").catch(()=>{}),Ae(this,Ff,"f").catch(()=>{})}get response(){return Ae(this,w0,"f")}get request_id(){return Ae(this,S0,"f")}async withResponse(){const e=await Ae(this,Uf,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){const n=new Ev;return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,i){const r=new Ev;for(const s of n.messages)r._addMessageParam(s);return r._run(()=>r._createMessage(e,{...n,stream:!0},{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Ae(this,Hx,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,i){const r=i?.signal;let s;r&&(r.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),r.addEventListener("abort",s));try{Ae(this,Hr,"m",zx).call(this);const{response:o,data:a}=await e.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(o);for await(const l of a)Ae(this,Hr,"m",Qx).call(this,l);if(a.controller.signal?.aborted)throw new vs;Ae(this,Hr,"m",Gx).call(this)}finally{r&&s&&r.removeEventListener("abort",s)}}_connected(e){this.ended||(qe(this,w0,e),qe(this,S0,e?.headers.get("request-id")),Ae(this,A0,"f").call(this,e),this._emit("connect"))}get ended(){return Ae(this,zf,"f")}get errored(){return Ae(this,v0,"f")}get aborted(){return Ae(this,b0,"f")}abort(){this.controller.abort()}on(e,n){return(Ae(this,Zo,"f")[e]||(Ae(this,Zo,"f")[e]=[])).push({listener:n}),this}off(e,n){const i=Ae(this,Zo,"f")[e];if(!i)return this;const r=i.findIndex(s=>s.listener===n);return r>=0&&i.splice(r,1),this}once(e,n){return(Ae(this,Zo,"f")[e]||(Ae(this,Zo,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,i)=>{qe(this,Yu,!0),e!=="error"&&this.once("error",i),this.once(e,n)})}async done(){qe(this,Yu,!0),await Ae(this,Ff,"f")}get currentMessage(){return Ae(this,il,"f")}async finalMessage(){return await this.done(),Ae(this,Hr,"m",Fx).call(this)}async finalText(){return await this.done(),Ae(this,Hr,"m",nB).call(this)}_emit(e,...n){if(Ae(this,zf,"f"))return;e==="end"&&(qe(this,zf,!0),Ae(this,y0,"f").call(this));const i=Ae(this,Zo,"f")[e];if(i&&(Ae(this,Zo,"f")[e]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),e==="abort"){const r=n[0];!Ae(this,Yu,"f")&&!i?.length&&Promise.reject(r),Ae(this,Vf,"f").call(this,r),Ae(this,Hf,"f").call(this,r),this._emit("end");return}if(e==="error"){const r=n[0];!Ae(this,Yu,"f")&&!i?.length&&Promise.reject(r),Ae(this,Vf,"f").call(this,r),Ae(this,Hf,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ae(this,Hr,"m",Fx).call(this))}async _fromReadableStream(e,n){const i=n?.signal;let r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{Ae(this,Hr,"m",zx).call(this),this._connected(null);const s=hg.fromReadableStream(e,this.controller);for await(const o of s)Ae(this,Hr,"m",Qx).call(this,o);if(s.controller.signal?.aborted)throw new vs;Ae(this,Hr,"m",Gx).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(il=new WeakMap,Uf=new WeakMap,A0=new WeakMap,Vf=new WeakMap,Ff=new WeakMap,y0=new WeakMap,Hf=new WeakMap,Zo=new WeakMap,zf=new WeakMap,v0=new WeakMap,b0=new WeakMap,Yu=new WeakMap,w0=new WeakMap,S0=new WeakMap,Hx=new WeakMap,Hr=new WeakSet,Fx=function(){if(this.receivedMessages.length===0)throw new st("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},nB=function(){if(this.receivedMessages.length===0)throw new st("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new st("stream ended without producing a content block with type=text");return n.join(" ")},zx=function(){this.ended||qe(this,il,void 0)},Qx=function(n){if(this.ended)return;const i=Ae(this,Hr,"m",iB).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{const r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{sB(r)&&r.input&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(i,!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{qe(this,il,i);break}}},Gx=function(){if(this.ended)throw new st("stream has ended, this shouldn't happen");const n=Ae(this,il,"f");if(!n)throw new st("request ended without sending any chunks");return qe(this,il,void 0),n},iB=function(n){let i=Ae(this,il,"f");if(n.type==="message_start"){if(i)throw new st(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new st(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),i;case"content_block_start":return i.content.push({...n.content_block}),i;case"content_block_delta":{const r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&sB(r)){let s=r[rB]||"";s+=n.delta.partial_json;const o={...r};Object.defineProperty(o,rB,{value:s,enumerable:!1,writable:!0}),s&&(o.input=v9(s)),i.content[n.index]=o}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":return i}},Symbol.asyncIterator)](){const e=[],n=[];let i=!1;return this.on("streamEvent",r=>{const s=n.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new hg(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let S9=class extends ma{create(e,n){return this._client.post("/v1/messages/batches",{body:e,...n})}retrieve(e,n){return this._client.get(Cs`/v1/messages/batches/${e}`,n)}list(e={},n){return this._client.getAPIList("/v1/messages/batches",em,{query:e,...n})}delete(e,n){return this._client.delete(Cs`/v1/messages/batches/${e}`,n)}cancel(e,n){return this._client.post(Cs`/v1/messages/batches/${e}/cancel`,n)}async results(e,n){const i=await this.retrieve(e);if(!i.results_url)throw new st(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);return this._client.get(i.results_url,{...n,headers:qt([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,s)=>sw.fromResponse(s.response,s.controller))}},eR=class extends ma{constructor(){super(...arguments),this.batches=new S9(this._client)}create(e,n){e.model in oB&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${oB[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let i=this._client._options.timeout;if(!e.stream&&i==null){const r=b9[e.model]??void 0;i=this._client.calculateNonstreamingTimeout(e.max_tokens,r)}return this._client.post("/v1/messages",{body:e,timeout:i??6e5,...n,stream:e.stream??!1})}stream(e,n){return Ev.createMessage(this,e,n)}countTokens(e,n){return this._client.post("/v1/messages/count_tokens",{body:e,...n})}};const oB={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-5-sonnet-20241022":"October 22, 2025","claude-3-5-sonnet-20240620":"October 22, 2025"};eR.Batches=S9;let C9=class extends ma{retrieve(e,n={},i){const{betas:r}=n??{};return this._client.get(Cs`/v1/models/${e}`,{...i,headers:qt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(e={},n){const{betas:i,...r}=e??{};return this._client.getAPIList("/v1/models",em,{query:r,...n,headers:qt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}};var Oge={};const C0=t=>{if(typeof globalThis.process<"u")return Oge?.[t]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()};var J1,tR,Oy,x9;class _n{constructor({baseURL:e=C0("ANTHROPIC_BASE_URL"),apiKey:n=C0("ANTHROPIC_API_KEY")??null,authToken:i=C0("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){J1.add(this),Oy.set(this,void 0);const s={apiKey:n,authToken:i,...r,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&rge())throw new st(`It looks like you're running in a browser-like environment. +${s} +${l}`)}return s},_s=zDe(xne);let Bne=class extends pp{list(t={},n){const{betas:o,...r}=t??{};return this._client.getAPIList("/v1/files",IC,{query:r,...n,headers:Rn([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}delete(t,n={},o){const{betas:r}=n??{};return this._client.delete(_s`/v1/files/${t}`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},o?.headers])})}download(t,n={},o){const{betas:r}=n??{};return this._client.get(_s`/v1/files/${t}/content`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},o?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},o){const{betas:r}=n??{};return this._client.get(_s`/v1/files/${t}`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},o?.headers])})}upload(t,n){const{betas:o,...r}=t;return this._client.post("/v1/files",xDe({body:r,...n,headers:Rn([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}},kne=class extends pp{retrieve(t,n={},o){const{betas:r}=n??{};return this._client.get(_s`/v1/models/${t}?beta=true`,{...o,headers:Rn([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},o?.headers])})}list(t={},n){const{betas:o,...r}=t??{};return this._client.getAPIList("/v1/models?beta=true",IC,{query:r,...n,headers:Rn([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}};class HM{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){const t=new PC;for await(const n of this.iterator)for(const o of t.decode(n))yield JSON.parse(o);for(const n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new jt("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new jt("Attempted to iterate over a response with no body");return new HM(WF(t.body),n)}}let Une=class extends pp{create(t,n){const{betas:o,...r}=t;return this._client.post("/v1/messages/batches?beta=true",{body:r,...n,headers:Rn([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}retrieve(t,n={},o){const{betas:r}=n??{};return this._client.get(_s`/v1/messages/batches/${t}?beta=true`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},o?.headers])})}list(t={},n){const{betas:o,...r}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",IC,{query:r,...n,headers:Rn([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(t,n={},o){const{betas:r}=n??{};return this._client.delete(_s`/v1/messages/batches/${t}?beta=true`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},o?.headers])})}cancel(t,n={},o){const{betas:r}=n??{};return this._client.post(_s`/v1/messages/batches/${t}/cancel?beta=true`,{...o,headers:Rn([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},o?.headers])})}async results(t,n={},o){const r=await this.retrieve(t);if(!r.results_url)throw new jt(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);const{betas:i}=n??{};return this._client.get(r.results_url,{...o,headers:Rn([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},o?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>HM.fromResponse(a.response,a.controller))}};const KDe=e=>{let t=0,n=[];for(;t{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Ey(e);case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-")return e=e.slice(0,e.length-1),Ey(e);case"string":let o=e[e.length-2];if(o?.type==="delimiter")return e=e.slice(0,e.length-1),Ey(e);if(o?.type==="brace"&&o.value==="{")return e=e.slice(0,e.length-1),Ey(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ey(e)}return e},QDe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},$De=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},qne=e=>JSON.parse($De(QDe(Ey(KDe(e)))));var ji,Yp,tv,kO,nv,rv,UO,ov,mu,iv,qO,JO,fy,VO,HO,RD,E5,GO,ED,MD,PD,M5;const P5="__json_buf";function I5(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class sE{constructor(){ji.add(this),this.messages=[],this.receivedMessages=[],Yp.set(this,void 0),this.controller=new AbortController,tv.set(this,void 0),kO.set(this,()=>{}),nv.set(this,()=>{}),rv.set(this,void 0),UO.set(this,()=>{}),ov.set(this,()=>{}),mu.set(this,{}),iv.set(this,!1),qO.set(this,!1),JO.set(this,!1),fy.set(this,!1),VO.set(this,void 0),HO.set(this,void 0),GO.set(this,t=>{if(St(this,qO,!0),J0(t)&&(t=new gs),t instanceof gs)return St(this,JO,!0),this._emit("abort",t);if(t instanceof jt)return this._emit("error",t);if(t instanceof Error){const n=new jt(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new jt(String(t)))}),St(this,tv,new Promise((t,n)=>{St(this,kO,t,"f"),St(this,nv,n,"f")})),St(this,rv,new Promise((t,n)=>{St(this,UO,t,"f"),St(this,ov,n,"f")})),Ee(this,tv,"f").catch(()=>{}),Ee(this,rv,"f").catch(()=>{})}get response(){return Ee(this,VO,"f")}get request_id(){return Ee(this,HO,"f")}async withResponse(){const t=await Ee(this,tv,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new sE;return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,o){const r=new sE;for(const i of n.messages)r._addMessageParam(i);return r._run(()=>r._createMessage(t,{...n,stream:!0},{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},Ee(this,GO,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,o){const r=o?.signal;let i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i));try{Ee(this,ji,"m",ED).call(this);const{response:s,data:a}=await t.create({...n,stream:!0},{...o,signal:this.controller.signal}).withResponse();this._connected(s);for await(const c of a)Ee(this,ji,"m",MD).call(this,c);if(a.controller.signal?.aborted)throw new gs;Ee(this,ji,"m",PD).call(this)}finally{r&&i&&r.removeEventListener("abort",i)}}_connected(t){this.ended||(St(this,VO,t),St(this,HO,t?.headers.get("request-id")),Ee(this,kO,"f").call(this,t),this._emit("connect"))}get ended(){return Ee(this,iv,"f")}get errored(){return Ee(this,qO,"f")}get aborted(){return Ee(this,JO,"f")}abort(){this.controller.abort()}on(t,n){return(Ee(this,mu,"f")[t]||(Ee(this,mu,"f")[t]=[])).push({listener:n}),this}off(t,n){const o=Ee(this,mu,"f")[t];if(!o)return this;const r=o.findIndex(i=>i.listener===n);return r>=0&&o.splice(r,1),this}once(t,n){return(Ee(this,mu,"f")[t]||(Ee(this,mu,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,o)=>{St(this,fy,!0),t!=="error"&&this.once("error",o),this.once(t,n)})}async done(){St(this,fy,!0),await Ee(this,rv,"f")}get currentMessage(){return Ee(this,Yp,"f")}async finalMessage(){return await this.done(),Ee(this,ji,"m",RD).call(this)}async finalText(){return await this.done(),Ee(this,ji,"m",E5).call(this)}_emit(t,...n){if(Ee(this,iv,"f"))return;t==="end"&&(St(this,iv,!0),Ee(this,UO,"f").call(this));const o=Ee(this,mu,"f")[t];if(o&&(Ee(this,mu,"f")[t]=o.filter(r=>!r.once),o.forEach(({listener:r})=>r(...n))),t==="abort"){const r=n[0];!Ee(this,fy,"f")&&!o?.length&&Promise.reject(r),Ee(this,nv,"f").call(this,r),Ee(this,ov,"f").call(this,r),this._emit("end");return}if(t==="error"){const r=n[0];!Ee(this,fy,"f")&&!o?.length&&Promise.reject(r),Ee(this,nv,"f").call(this,r),Ee(this,ov,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ee(this,ji,"m",RD).call(this))}async _fromReadableStream(t,n){const o=n?.signal;let r;o&&(o.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),o.addEventListener("abort",r));try{Ee(this,ji,"m",ED).call(this),this._connected(null);const i=V0.fromReadableStream(t,this.controller);for await(const s of i)Ee(this,ji,"m",MD).call(this,s);if(i.controller.signal?.aborted)throw new gs;Ee(this,ji,"m",PD).call(this)}finally{o&&r&&o.removeEventListener("abort",r)}}[(Yp=new WeakMap,tv=new WeakMap,kO=new WeakMap,nv=new WeakMap,rv=new WeakMap,UO=new WeakMap,ov=new WeakMap,mu=new WeakMap,iv=new WeakMap,qO=new WeakMap,JO=new WeakMap,fy=new WeakMap,VO=new WeakMap,HO=new WeakMap,GO=new WeakMap,ji=new WeakSet,RD=function(){if(this.receivedMessages.length===0)throw new jt("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},E5=function(){if(this.receivedMessages.length===0)throw new jt("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(o=>o.type==="text").map(o=>o.text);if(n.length===0)throw new jt("stream ended without producing a content block with type=text");return n.join(" ")},ED=function(){this.ended||St(this,Yp,void 0)},MD=function(n){if(this.ended)return;const o=Ee(this,ji,"m",M5).call(this,n);switch(this._emit("streamEvent",n,o),n.type){case"content_block_delta":{const r=o.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{I5(r)&&r.input&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(o),this._addMessage(o,!0);break}case"content_block_stop":{this._emit("contentBlock",o.content.at(-1));break}case"message_start":{St(this,Yp,o);break}}},PD=function(){if(this.ended)throw new jt("stream has ended, this shouldn't happen");const n=Ee(this,Yp,"f");if(!n)throw new jt("request ended without sending any chunks");return St(this,Yp,void 0),n},M5=function(n){let o=Ee(this,Yp,"f");if(n.type==="message_start"){if(o)throw new jt(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!o)throw new jt(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return o;case"message_delta":return o.container=n.delta.container,o.stop_reason=n.delta.stop_reason,o.stop_sequence=n.delta.stop_sequence,o.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(o.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(o.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(o.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(o.usage.server_tool_use=n.usage.server_tool_use),o;case"content_block_start":return o.content.push(n.content_block),o;case"content_block_delta":{const r=o.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(o.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(o.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&I5(r)){let i=r[P5]||"";i+=n.delta.partial_json;const s={...r};if(Object.defineProperty(s,P5,{value:i,enumerable:!1,writable:!0}),i)try{s.input=qne(i)}catch(a){const c=new jt(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${i}`);Ee(this,GO,"f").call(this,c)}o.content[n.index]=s}break}case"thinking_delta":{r?.type==="thinking"&&(o.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(o.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return o}case"content_block_stop":return o}},Symbol.asyncIterator)](){const t=[],n=[];let o=!1;return this.on("streamEvent",r=>{const i=n.shift();i?i.resolve(r):t.push(r)}),this.on("end",()=>{o=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),this.on("error",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:o?{value:void 0,done:!0}:new Promise((i,s)=>n.push({resolve:i,reject:s})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new V0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const Jne={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192},j5={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-5-sonnet-20241022":"October 22, 2025","claude-3-5-sonnet-20240620":"October 22, 2025"};let XF=class extends pp{constructor(){super(...arguments),this.batches=new Une(this._client)}create(t,n){const{betas:o,...r}=t;r.model in j5&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${j5[r.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let i=this._client._options.timeout;if(!r.stream&&i==null){const s=Jne[r.model]??void 0;i=this._client.calculateNonstreamingTimeout(r.max_tokens,s)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:i??6e5,...n,headers:Rn([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}stream(t,n){return sE.createMessage(this,t,n)}countTokens(t,n){const{betas:o,...r}=t;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...n,headers:Rn([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},n?.headers])})}};XF.Batches=Une;let jC=class extends pp{constructor(){super(...arguments),this.models=new kne(this._client),this.messages=new XF(this._client),this.files=new Bne(this._client)}};jC.Models=kne;jC.Messages=XF;jC.Files=Bne;let Vne=class extends pp{create(t,n){const{betas:o,...r}=t;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...n,headers:Rn([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}};var Di,Xp,sv,zO,av,lv,KO,uv,gu,cv,QO,$O,hy,WO,YO,ID,D5,jD,DD,ND,LD,N5;const L5="__json_buf";function F5(e){return e.type==="tool_use"||e.type==="server_tool_use"}class aE{constructor(){Di.add(this),this.messages=[],this.receivedMessages=[],Xp.set(this,void 0),this.controller=new AbortController,sv.set(this,void 0),zO.set(this,()=>{}),av.set(this,()=>{}),lv.set(this,void 0),KO.set(this,()=>{}),uv.set(this,()=>{}),gu.set(this,{}),cv.set(this,!1),QO.set(this,!1),$O.set(this,!1),hy.set(this,!1),WO.set(this,void 0),YO.set(this,void 0),jD.set(this,t=>{if(St(this,QO,!0),J0(t)&&(t=new gs),t instanceof gs)return St(this,$O,!0),this._emit("abort",t);if(t instanceof jt)return this._emit("error",t);if(t instanceof Error){const n=new jt(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new jt(String(t)))}),St(this,sv,new Promise((t,n)=>{St(this,zO,t,"f"),St(this,av,n,"f")})),St(this,lv,new Promise((t,n)=>{St(this,KO,t,"f"),St(this,uv,n,"f")})),Ee(this,sv,"f").catch(()=>{}),Ee(this,lv,"f").catch(()=>{})}get response(){return Ee(this,WO,"f")}get request_id(){return Ee(this,YO,"f")}async withResponse(){const t=await Ee(this,sv,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new aE;return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,o){const r=new aE;for(const i of n.messages)r._addMessageParam(i);return r._run(()=>r._createMessage(t,{...n,stream:!0},{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},Ee(this,jD,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,o){const r=o?.signal;let i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i));try{Ee(this,Di,"m",DD).call(this);const{response:s,data:a}=await t.create({...n,stream:!0},{...o,signal:this.controller.signal}).withResponse();this._connected(s);for await(const c of a)Ee(this,Di,"m",ND).call(this,c);if(a.controller.signal?.aborted)throw new gs;Ee(this,Di,"m",LD).call(this)}finally{r&&i&&r.removeEventListener("abort",i)}}_connected(t){this.ended||(St(this,WO,t),St(this,YO,t?.headers.get("request-id")),Ee(this,zO,"f").call(this,t),this._emit("connect"))}get ended(){return Ee(this,cv,"f")}get errored(){return Ee(this,QO,"f")}get aborted(){return Ee(this,$O,"f")}abort(){this.controller.abort()}on(t,n){return(Ee(this,gu,"f")[t]||(Ee(this,gu,"f")[t]=[])).push({listener:n}),this}off(t,n){const o=Ee(this,gu,"f")[t];if(!o)return this;const r=o.findIndex(i=>i.listener===n);return r>=0&&o.splice(r,1),this}once(t,n){return(Ee(this,gu,"f")[t]||(Ee(this,gu,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,o)=>{St(this,hy,!0),t!=="error"&&this.once("error",o),this.once(t,n)})}async done(){St(this,hy,!0),await Ee(this,lv,"f")}get currentMessage(){return Ee(this,Xp,"f")}async finalMessage(){return await this.done(),Ee(this,Di,"m",ID).call(this)}async finalText(){return await this.done(),Ee(this,Di,"m",D5).call(this)}_emit(t,...n){if(Ee(this,cv,"f"))return;t==="end"&&(St(this,cv,!0),Ee(this,KO,"f").call(this));const o=Ee(this,gu,"f")[t];if(o&&(Ee(this,gu,"f")[t]=o.filter(r=>!r.once),o.forEach(({listener:r})=>r(...n))),t==="abort"){const r=n[0];!Ee(this,hy,"f")&&!o?.length&&Promise.reject(r),Ee(this,av,"f").call(this,r),Ee(this,uv,"f").call(this,r),this._emit("end");return}if(t==="error"){const r=n[0];!Ee(this,hy,"f")&&!o?.length&&Promise.reject(r),Ee(this,av,"f").call(this,r),Ee(this,uv,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Ee(this,Di,"m",ID).call(this))}async _fromReadableStream(t,n){const o=n?.signal;let r;o&&(o.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),o.addEventListener("abort",r));try{Ee(this,Di,"m",DD).call(this),this._connected(null);const i=V0.fromReadableStream(t,this.controller);for await(const s of i)Ee(this,Di,"m",ND).call(this,s);if(i.controller.signal?.aborted)throw new gs;Ee(this,Di,"m",LD).call(this)}finally{o&&r&&o.removeEventListener("abort",r)}}[(Xp=new WeakMap,sv=new WeakMap,zO=new WeakMap,av=new WeakMap,lv=new WeakMap,KO=new WeakMap,uv=new WeakMap,gu=new WeakMap,cv=new WeakMap,QO=new WeakMap,$O=new WeakMap,hy=new WeakMap,WO=new WeakMap,YO=new WeakMap,jD=new WeakMap,Di=new WeakSet,ID=function(){if(this.receivedMessages.length===0)throw new jt("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},D5=function(){if(this.receivedMessages.length===0)throw new jt("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(o=>o.type==="text").map(o=>o.text);if(n.length===0)throw new jt("stream ended without producing a content block with type=text");return n.join(" ")},DD=function(){this.ended||St(this,Xp,void 0)},ND=function(n){if(this.ended)return;const o=Ee(this,Di,"m",N5).call(this,n);switch(this._emit("streamEvent",n,o),n.type){case"content_block_delta":{const r=o.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{F5(r)&&r.input&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(o),this._addMessage(o,!0);break}case"content_block_stop":{this._emit("contentBlock",o.content.at(-1));break}case"message_start":{St(this,Xp,o);break}}},LD=function(){if(this.ended)throw new jt("stream has ended, this shouldn't happen");const n=Ee(this,Xp,"f");if(!n)throw new jt("request ended without sending any chunks");return St(this,Xp,void 0),n},N5=function(n){let o=Ee(this,Xp,"f");if(n.type==="message_start"){if(o)throw new jt(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!o)throw new jt(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return o;case"message_delta":return o.stop_reason=n.delta.stop_reason,o.stop_sequence=n.delta.stop_sequence,o.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(o.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(o.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(o.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(o.usage.server_tool_use=n.usage.server_tool_use),o;case"content_block_start":return o.content.push({...n.content_block}),o;case"content_block_delta":{const r=o.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(o.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(o.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&F5(r)){let i=r[L5]||"";i+=n.delta.partial_json;const s={...r};Object.defineProperty(s,L5,{value:i,enumerable:!1,writable:!0}),i&&(s.input=qne(i)),o.content[n.index]=s}break}case"thinking_delta":{r?.type==="thinking"&&(o.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(o.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return o}case"content_block_stop":return o}},Symbol.asyncIterator)](){const t=[],n=[];let o=!1;return this.on("streamEvent",r=>{const i=n.shift();i?i.resolve(r):t.push(r)}),this.on("end",()=>{o=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),this.on("error",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:o?{value:void 0,done:!0}:new Promise((i,s)=>n.push({resolve:i,reject:s})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new V0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let Hne=class extends pp{create(t,n){return this._client.post("/v1/messages/batches",{body:t,...n})}retrieve(t,n){return this._client.get(_s`/v1/messages/batches/${t}`,n)}list(t={},n){return this._client.getAPIList("/v1/messages/batches",IC,{query:t,...n})}delete(t,n){return this._client.delete(_s`/v1/messages/batches/${t}`,n)}cancel(t,n){return this._client.post(_s`/v1/messages/batches/${t}/cancel`,n)}async results(t,n){const o=await this.retrieve(t);if(!o.results_url)throw new jt(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);return this._client.get(o.results_url,{...n,headers:Rn([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,i)=>HM.fromResponse(i.response,i.controller))}},ZF=class extends pp{constructor(){super(...arguments),this.batches=new Hne(this._client)}create(t,n){t.model in x5&&console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${x5[t.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!t.stream&&o==null){const r=Jne[t.model]??void 0;o=this._client.calculateNonstreamingTimeout(t.max_tokens,r)}return this._client.post("/v1/messages",{body:t,timeout:o??6e5,...n,stream:t.stream??!1})}stream(t,n){return aE.createMessage(this,t,n)}countTokens(t,n){return this._client.post("/v1/messages/count_tokens",{body:t,...n})}};const x5={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-5-sonnet-20241022":"October 22, 2025","claude-3-5-sonnet-20240620":"October 22, 2025"};ZF.Batches=Hne;let Gne=class extends pp{retrieve(t,n={},o){const{betas:r}=n??{};return this._client.get(_s`/v1/models/${t}`,{...o,headers:Rn([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},o?.headers])})}list(t={},n){const{betas:o,...r}=t??{};return this._client.getAPIList("/v1/models",IC,{query:r,...n,headers:Rn([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}};var WDe={};const XO=e=>{if(typeof globalThis.process<"u")return WDe?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var X2,ex,bR,zne;class sr{constructor({baseURL:t=XO("ANTHROPIC_BASE_URL"),apiKey:n=XO("ANTHROPIC_API_KEY")??null,authToken:o=XO("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){X2.add(this),bR.set(this,void 0);const i={apiKey:n,authToken:o,...r,baseURL:t||"https://api.anthropic.com"};if(!i.dangerouslyAllowBrowser&&ADe())throw new jt(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this.timeout=s.timeout??tR.DEFAULT_TIMEOUT,this.logger=s.logger??console;const o="warn";this.logLevel=o,this.logLevel=jO(s.logLevel,"ClientOptions.logLevel",this)??jO(C0("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??o,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??cge(),qe(this,Oy,dge),this._options=s,this.apiKey=n,this.authToken=i}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(this.apiKey&&e.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(e){return qt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey!=null)return qt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return qt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([n,i])=>typeof i<"u").map(([n,i])=>{if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(i)}`;if(i===null)return`${encodeURIComponent(n)}=`;throw new st(`Cannot stringify type ${typeof i}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${od}`}defaultIdempotencyKey(){return`stainless-node-retry-${K8()}`}makeStatusError(e,n,i,r){return _r.generate(e,n,i,r)}buildURL(e,n,i){const r=!Ae(this,J1,"m",x9).call(this)&&i||this.baseURL,s=Zpe(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery();return ege(o)||(n={...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(s.search=this.stringifyQuery(n)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new st("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:n,options:i}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,i){return this.request(Promise.resolve(i).then(r=>({method:e,path:n,...r})))}request(e,n=null){return new c9(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,i){const r=await e,s=r.maxRetries??this.maxRetries;n==null&&(n=s),await this.prepareOptions(r);const{req:o,url:a,timeout:l}=await this.buildRequest(r,{retryCount:s-n});await this.prepareRequest(o,{url:a,options:r});const u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),d=i===void 0?"":`, retryOf: ${i}`,f=Date.now();if(Ti(this).debug(`[${u}] sending request`,fc({retryOfRequestLogID:i,method:r.method,url:a,options:r,headers:o.headers})),r.signal?.aborted)throw new vs;const g=new AbortController,m=await this.fetchWithTimeout(a,o,l,g).catch(W1),v=Date.now();if(m instanceof Error){const E=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new vs;const k=dg(m)||/timed? ?out/i.test(String(m)+("cause"in m?String(m.cause):""));if(n)return Ti(this).info(`[${u}] connection ${k?"timed out":"failed"} - ${E}`),Ti(this).debug(`[${u}] connection ${k?"timed out":"failed"} (${E})`,fc({retryOfRequestLogID:i,url:a,durationMs:v-f,message:m.message})),this.retryRequest(r,n,i??u);throw Ti(this).info(`[${u}] connection ${k?"timed out":"failed"} - error; no more retries left`),Ti(this).debug(`[${u}] connection ${k?"timed out":"failed"} (error; no more retries left)`,fc({retryOfRequestLogID:i,url:a,durationMs:v-f,message:m.message})),k?new Y8:new rw({cause:m})}const S=[...m.headers.entries()].filter(([E])=>E==="request-id").map(([E,k])=>", "+E+": "+JSON.stringify(k)).join(""),C=`[${u}${d}${S}] ${o.method} ${a} ${m.ok?"succeeded":"failed"} with status ${m.status} in ${v-f}ms`;if(!m.ok){const E=await this.shouldRetry(m);if(n&&E){const N=`retrying, ${n} attempts remaining`;return await uge(m.body),Ti(this).info(`${C} - ${N}`),Ti(this).debug(`[${u}] response error (${N})`,fc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:v-f})),this.retryRequest(r,n,i??u,m.headers)}const k=E?"error; no more retries left":"error; not retryable";Ti(this).info(`${C} - ${k}`);const R=await m.text().catch(N=>W1(N).message),M=r9(R),D=M?void 0:R;throw Ti(this).debug(`[${u}] response error (${k})`,fc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,message:D,durationMs:Date.now()-f})),this.makeStatusError(m.status,M,D,m.headers)}return Ti(this).info(C),Ti(this).debug(`[${u}] response start`,fc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:v-f})),{response:m,options:r,controller:g,requestLogID:u,retryOfRequestLogID:i,startTime:f}}getAPIList(e,n,i){return this.requestAPIList(n,{method:"get",path:e,...i})}requestAPIList(e,n){const i=this.makeRequest(n,null,void 0);return new wge(this,i,e)}async fetchWithTimeout(e,n,i,r){const{signal:s,method:o,...a}=n||{};s&&s.addEventListener("abort",()=>r.abort());const l=setTimeout(()=>r.abort(),i),u=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:r.signal,...u?{duplex:"half"}:{},method:"GET",...a};o&&(d.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(l)}}async shouldRetry(e){const n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,i,r){let s;const o=r?.get("retry-after-ms");if(o){const l=parseFloat(o);Number.isNaN(l)||(s=l)}const a=r?.get("retry-after");if(a&&!s){const l=parseFloat(a);Number.isNaN(l)?s=Date.parse(a)-Date.now():s=l*1e3}if(!(s&&0<=s&&s<60*1e3)){const l=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,l)}return await ige(s),this.makeRequest(e,n-1,i)}calculateDefaultRetryTimeoutMillis(e,n){const s=n-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}calculateNonstreamingTimeout(e,n){if(36e5*e/128e3>6e5||n!=null&&e>n)throw new st("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:n=0}={}){const i={...e},{method:r,path:s,query:o,defaultBaseURL:a}=i,l=this.buildURL(s,o,a);"timeout"in i&&nge("timeout",i.timeout),i.timeout=i.timeout??this.timeout;const{bodyHeaders:u,body:d}=this.buildBody({options:i}),f=await this.buildHeaders({options:e,method:r,bodyHeaders:u,retryCount:n});return{req:{method:r,headers:f,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&d instanceof globalThis.ReadableStream&&{duplex:"half"},...d&&{body:d},...this.fetchOptions??{},...i.fetchOptions??{}},url:l,timeout:i.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:i,retryCount:r}){let s={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);const o=qt([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...lge(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,i,e.headers]);return this.validateHeaders(o),o.values}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};const i=qt([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&i.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:o9(e)}:Ae(this,Oy,"f").call(this,{body:e,headers:i})}}tR=_n,Oy=new WeakMap,J1=new WeakSet,x9=function(){return this.baseURL!=="https://api.anthropic.com"};_n.Anthropic=tR;_n.HUMAN_PROMPT=` +`);this.baseURL=i.baseURL,this.timeout=i.timeout??ex.DEFAULT_TIMEOUT,this.logger=i.logger??console;const s="warn";this.logLevel=s,this.logLevel=w5(i.logLevel,"ClientOptions.logLevel",this)??w5(XO("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??s,this.fetchOptions=i.fetchOptions,this.maxRetries=i.maxRetries??2,this.fetch=i.fetch??wDe(),St(this,bR,TDe),this._options=i,this.apiKey=n,this.authToken=o}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(t){return Rn([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey!=null)return Rn([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return Rn([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return Object.entries(t).filter(([n,o])=>typeof o<"u").map(([n,o])=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(o)}`;if(o===null)return`${encodeURIComponent(n)}=`;throw new jt(`Cannot stringify type ${typeof o}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Ry}`}defaultIdempotencyKey(){return`stainless-node-retry-${gne()}`}makeStatusError(t,n,o,r){return mi.generate(t,n,o,r)}buildURL(t,n,o){const r=!Ee(this,X2,"m",zne).call(this)&&o||this.baseURL,i=pDe(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery();return mDe(s)||(n={...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new jt("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:o}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,o){return this.request(Promise.resolve(o).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new Ine(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,o){const r=await t,i=r.maxRetries??this.maxRetries;n==null&&(n=i),await this.prepareOptions(r);const{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:i-n});await this.prepareRequest(s,{url:a,options:r});const p="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=o===void 0?"":`, retryOf: ${o}`,l=Date.now();if(po(this).debug(`[${p}] sending request`,Ag({retryOfRequestLogID:o,method:r.method,url:a,options:r,headers:s.headers})),r.signal?.aborted)throw new gs;const d=new AbortController,f=await this.fetchWithTimeout(a,s,c,d).catch(K2),h=Date.now();if(f instanceof Error){const y=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new gs;const _=J0(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(n)return po(this).info(`[${p}] connection ${_?"timed out":"failed"} - ${y}`),po(this).debug(`[${p}] connection ${_?"timed out":"failed"} (${y})`,Ag({retryOfRequestLogID:o,url:a,durationMs:h-l,message:f.message})),this.retryRequest(r,n,o??p);throw po(this).info(`[${p}] connection ${_?"timed out":"failed"} - error; no more retries left`),po(this).debug(`[${p}] connection ${_?"timed out":"failed"} (error; no more retries left)`,Ag({retryOfRequestLogID:o,url:a,durationMs:h-l,message:f.message})),_?new bne:new VM({cause:f})}const m=[...f.headers.entries()].filter(([y])=>y==="request-id").map(([y,_])=>", "+y+": "+JSON.stringify(_)).join(""),g=`[${p}${u}${m}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${h-l}ms`;if(!f.ok){const y=await this.shouldRetry(f);if(n&&y){const T=`retrying, ${n} attempts remaining`;return await ODe(f.body),po(this).info(`${g} - ${T}`),po(this).debug(`[${p}] response error (${T})`,Ag({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,durationMs:h-l})),this.retryRequest(r,n,o??p,f.headers)}const _=y?"error; no more retries left":"error; not retryable";po(this).info(`${g} - ${_}`);const S=await f.text().catch(T=>K2(T).message),w=Tne(S),R=w?void 0:S;throw po(this).debug(`[${p}] response error (${_})`,Ag({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,message:R,durationMs:Date.now()-l})),this.makeStatusError(f.status,w,R,f.headers)}return po(this).info(g),po(this).debug(`[${p}] response start`,Ag({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,durationMs:h-l})),{response:f,options:r,controller:d,requestLogID:p,retryOfRequestLogID:o,startTime:l}}getAPIList(t,n,o){return this.requestAPIList(n,{method:"get",path:t,...o})}requestAPIList(t,n){const o=this.makeRequest(n,null,void 0);return new FDe(this,o,t)}async fetchWithTimeout(t,n,o,r){const{signal:i,method:s,...a}=n||{};i&&i.addEventListener("abort",()=>r.abort());const c=setTimeout(()=>r.abort(),o),p=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,u={signal:r.signal,...p?{duplex:"half"}:{},method:"GET",...a};s&&(u.method=s.toUpperCase());try{return await this.fetch.call(void 0,t,u)}finally{clearTimeout(c)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,o,r){let i;const s=r?.get("retry-after-ms");if(s){const c=parseFloat(s);Number.isNaN(c)||(i=c)}const a=r?.get("retry-after");if(a&&!i){const c=parseFloat(a);Number.isNaN(c)?i=Date.parse(a)-Date.now():i=c*1e3}if(!(i&&0<=i&&i<60*1e3)){const c=t.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(n,c)}return await yDe(i),this.makeRequest(t,n-1,o)}calculateDefaultRetryTimeoutMillis(t,n){const i=n-t,s=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return s*a*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new jt("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){const o={...t},{method:r,path:i,query:s,defaultBaseURL:a}=o,c=this.buildURL(i,s,a);"timeout"in o&&bDe("timeout",o.timeout),o.timeout=o.timeout??this.timeout;const{bodyHeaders:p,body:u}=this.buildBody({options:o}),l=await this.buildHeaders({options:t,method:r,bodyHeaders:p,retryCount:n});return{req:{method:r,headers:l,...o.signal&&{signal:o.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...o.fetchOptions??{}},url:c,timeout:o.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:o,retryCount:r}){let i={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const s=Rn([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...CDe(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,o,t.headers]);return this.validateHeaders(s),s.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const o=Rn([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&o.values.has("content-type")||t instanceof Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:Ene(t)}:Ee(this,bR,"f").call(this,{body:t,headers:o})}}ex=sr,bR=new WeakMap,X2=new WeakSet,zne=function(){return this.baseURL!=="https://api.anthropic.com"};sr.Anthropic=ex;sr.HUMAN_PROMPT=` -Human:`;_n.AI_PROMPT=` +Human:`;sr.AI_PROMPT=` -Assistant:`;_n.DEFAULT_TIMEOUT=6e5;_n.AnthropicError=st;_n.APIError=_r;_n.APIConnectionError=rw;_n.APIConnectionTimeoutError=Y8;_n.APIUserAbortError=vs;_n.NotFoundError=Z8;_n.ConflictError=e9;_n.RateLimitError=n9;_n.BadRequestError=q8;_n.AuthenticationError=J8;_n.InternalServerError=i9;_n.PermissionDeniedError=X8;_n.UnprocessableEntityError=t9;_n.toFile=Rge;class ph extends _n{constructor(){super(...arguments),this.completions=new w9(this),this.messages=new eR(this),this.models=new C9(this),this.beta=new tm(this)}}ph.Completions=w9;ph.Messages=eR;ph.Models=C9;ph.Beta=tm;const{HUMAN_PROMPT:kht,AI_PROMPT:Iht}=ph;var up={exports:{}};up.exports;var aB;function Bge(){return aB||(aB=1,(function(t,e){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",f="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",S="[object Promise]",C="[object RegExp]",E="[object Set]",k="[object String]",R="[object Symbol]",M="[object WeakMap]",D="[object ArrayBuffer]",P="[object DataView]",N="[object Float32Array]",B="[object Float64Array]",G="[object Int8Array]",V="[object Int16Array]",$="[object Int32Array]",K="[object Uint8Array]",X="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,q=/\w*$/,j=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,L={};L[s]=L[o]=L[D]=L[P]=L[a]=L[l]=L[N]=L[B]=L[G]=L[V]=L[$]=L[g]=L[m]=L[v]=L[C]=L[E]=L[k]=L[R]=L[K]=L[X]=L[J]=L[Z]=!0,L[u]=L[d]=L[M]=!1;var z=typeof $A=="object"&&$A&&$A.Object===Object&&$A,te=typeof self=="object"&&self&&self.Object===Object&&self,U=z||te||Function("return this")(),pe=e&&!e.nodeType&&e,xe=pe&&!0&&t&&!t.nodeType&&t,Ce=xe&&xe.exports===pe;function ve(F,re){return F.set(re[0],re[1]),F}function tt(F,re){return F.add(re),F}function it(F,re){for(var ge=-1,Te=F?F.length:0;++ge-1}function Ta(F,re){var ge=this.__data__,Te=ls(ge,F);return Te<0?ge.push([F,re]):ge[Te][1]=re,this}kr.prototype.clear=Dm,kr.prototype.delete=Us,kr.prototype.get=Tn,kr.prototype.has=li,kr.prototype.set=Ta;function Vs(F){var re=-1,ge=F?F.length:0;for(this.clear();++re-1&&F%1==0&&F-1&&F%1==0&&F<=r}function Hs(F){var re=typeof F;return!!F&&(re=="object"||re=="function")}function zs(F){return!!F&&typeof F=="object"}function Gl(F){return uu(F)?Om(F):cs(F)}function du(){return[]}function Hm(){return!1}t.exports=Hh})(up,up.exports)),up.exports}var Lge=Bge();const nR=Gc(Lge),$x=(t,e)=>new ph({apiKey:t,baseURL:e,dangerouslyAllowBrowser:!0}),lB=t=>({isEnd:!0,responseMessage:t}),Uge=t=>({isEnd:!0,responseMessage:{role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:t}}}),Vge=(t,e)=>t&&e?nR(e):{role:"assistant",content:[]},Fge=t=>typeof t.content=="string"?null:t.content.filter(e=>e.type==="tool-call").at(-1)??null,Qf={name:"Anthropic",baseUrl:"https://api.anthropic.com",modelFilters:["claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-5"],modelNames:{},thinkingModels:["claude-sonnet-4-5","claude-opus-4-5"]},Hge={"image/jpeg":"image/jpeg","image/jpg":"image/jpeg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp"},zge="image/jpeg",Qge=t=>({base64:t.split(",")[1],mimeType:t.split(";")[0].split(":")[1]}),Gge=t=>Hge[t]??zge,$ge=t=>{const{base64:e,mimeType:n}=Qge(t);return{type:"image",source:{type:"base64",media_type:Gge(n),data:e}}},Wge=t=>t.map(e=>({name:e.name,description:e.description,input_schema:{type:"object",...e.inputSchema}})),jge=t=>t.type==="text"?{type:"text",text:t.text}:{type:"text",text:""},Kge=t=>t.type!=="file"?{type:"text",text:""}:{type:"document",source:{type:"text",media_type:"text/plain",data:t.data},context:JSON.parse(t.mimeType).path},Yge=t=>t.type!=="image"?{type:"text",text:""}:$ge(t.image),qge=t=>t.type==="text"?{type:"text",text:t.text}:t.type==="file"?Kge(t):t.type==="image"?Yge(t):{type:"text",text:""},Jge=t=>[{role:"user",content:typeof t.content=="string"?t.content:t.content.map(qge)}],Xge=t=>[{role:"user",content:typeof t.content=="string"?t.content:t.content.map(jge)}],Zge=t=>{const e=[];if(typeof t.content=="string")return[{role:"assistant",content:t.content||[]}];let n=[],i=[];for(const r of t.content){if(r.type==="reasoning"){n.push({type:"thinking",thinking:r.text,signature:r.parentId??""});continue}if(r.type==="text"){n.push({type:"text",text:r.text});continue}r.type==="tool-call"&&(r.result&&i.push({type:"tool_result",content:r.result,tool_use_id:r.toolCallId??""}),n.push({type:"tool_use",id:r.toolCallId??"",name:r.toolName,input:r.args||{}}),e.push({role:"assistant",content:n}),i.length&&(e.push({role:"user",content:i}),i=[]),n=[])}return n.length&&e.push({role:"assistant",content:n}),e},Wx=t=>t.flatMap(e=>e.role==="user"?Jge(e):e.role==="system"?Xge(e):Zge(e));class eme extends YT{setProvider=e=>{this.provider=e,this.client=$x(e.key,e.baseUrl),e.key&&this.setApiKey(e.key),e.baseUrl&&this.setUrl(e.baseUrl)};setPrevMessages=e=>{this.prevMessages=Wx(e)};setTools=e=>{this.tools=Wge(e)};pushToHistory=e=>{const n=Wx([e]);this.prevMessages.push(...n)};pushToHistorySliced=(e,n)=>{if(typeof e.content=="string"||typeof n.content=="string")return;const i=e.content.slice(n.content.length);this.pushToHistory({...e,content:i})};isThinkingMode=()=>Qf.thinkingModels.some(e=>this.modelKey.includes(e));async createChatName(e){if(!this.client)return"";try{return(await this.client.messages.create({messages:[{role:"user",content:e}],model:this.modelKey,system:KT,max_tokens:2048,stream:!1})).content.find(r=>r.type==="text")?.text??e.substring(0,25)}catch{return""}}async*sendMessage(e,n,i,r){if(this.client)try{const s=Wx(e);this.prevMessages.push(...s);const o=r?this.isThinkingMode():!1,a=await this.client.messages.create({messages:[...this.prevMessages],model:this.modelKey,system:this.systemPrompt,tools:this.tools.length>0?this.tools:void 0,stream:!0,max_tokens:o?16e3:3e4,...this.tools.length>0&&{tool_choice:{disable_parallel_tool_use:!0,type:"auto"}},...o&&{thinking:{type:"enabled",budget_tokens:1e4}}});let l=Vge(n,i);for await(const u of a){if(this.stopFlag){this.stopFlag=!1,this.pushToHistory(l),a.controller.abort(),yield lB(l);return}switch(u.type){case"message_start":n&&i?yield i:l=Ype(u);break;case"content_block_start":l=qpe(u,l);break;case"content_block_delta":l=Jpe(u,l);break;case"message_stop":n&&i?this.pushToHistorySliced(l,i):this.pushToHistory(l),yield lB(l);return;default:break}yield l}}catch(s){yield Uge(s)}}async*sendMessageAfterToolCall(e,n){const i=Fge(e);if(!i)return e;const r={type:"tool_result",content:i.result,tool_use_id:i.toolCallId??""};this.prevMessages.push({role:"user",content:[r]}),yield*this.sendMessage([],!0,e,n)}getBaseUrl=()=>Qf.baseUrl;getName=()=>Qf.name;checkProvider=async e=>{const n=$x(e.apiKey,e.url);try{return await n.models.list(),!0}catch(i){const r=Upe(i);return r===0||i&&typeof i=="object"&&"cause"in i?hn.invalidUrl():r===401?hn.invalidKey(Lpe(i)):r===404?hn.invalidUrl():e.apiKey?hn.invalidKey():hn.emptyKey()}};getProviderModels=async e=>{const n=$x(e.apiKey,e.url);try{const{data:i}=await n.models.list(),r=[];for(const s of i){if(!Qf.modelFilters.some(l=>s.id.includes(l)))continue;const a=Qf.modelNames[s.id]||s.display_name;r.push({id:s.id,name:a,provider:"anthropic"})}return r}catch{return[]}}}const tme=new eme;function We(t,e,n,i,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}function se(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}let E9=function(){const{crypto:t}=globalThis;if(t?.randomUUID)return E9=t.randomUUID.bind(t),t.randomUUID();const e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))};function X1(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}const Z1=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){const e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};class Ue extends Error{}let Zi=class e_ extends Ue{constructor(e,n,i,r){super(`${e_.makeMessage(e,n,i)}`),this.status=e,this.headers=r,this.requestID=r?.get("x-request-id"),this.error=n;const s=n;this.code=s?.code,this.param=s?.param,this.type=s?.type}static makeMessage(e,n,i){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,n,i,r){if(!e||!r)return new ow({message:i,cause:Z1(n)});const s=n?.error;return e===400?new _9(e,s,i,r):e===401?new T9(e,s,i,r):e===403?new R9(e,s,i,r):e===404?new k9(e,s,i,r):e===409?new I9(e,s,i,r):e===422?new M9(e,s,i,r):e===429?new D9(e,s,i,r):e>=500?new P9(e,s,i,r):new e_(e,s,i,r)}},Wr=class extends Zi{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},ow=class extends Zi{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},iR=class extends ow{constructor({message:e}={}){super({message:e??"Request timed out."})}},_9=class extends Zi{},T9=class extends Zi{},R9=class extends Zi{},k9=class extends Zi{},I9=class extends Zi{},M9=class extends Zi{},D9=class extends Zi{},P9=class extends Zi{};class N9 extends Ue{constructor(){super("Could not parse response content as the length limit was reached")}}class O9 extends Ue{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class dp extends Error{constructor(e){super(e)}}const nme=/^[a-z][a-z0-9+.-]*:/i,ime=t=>nme.test(t);let ji=t=>(ji=Array.isArray,ji(t)),cB=ji;function B9(t){return typeof t!="object"?{}:t??{}}function rme(t){if(!t)return!0;for(const e in t)return!1;return!0}function sme(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function jx(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}const ome=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ue(`${t} must be an integer`);if(e<0)throw new Ue(`${t} must be a positive integer`);return e},ame=t=>{try{return JSON.parse(t)}catch{return}},nm=t=>new Promise(e=>setTimeout(e,t)),ld="5.23.2",lme=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function cme(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const ume=()=>{const t=cme();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ld,"X-Stainless-OS":dB(Deno.build.os),"X-Stainless-Arch":uB(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ld,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ld,"X-Stainless-OS":dB(globalThis.process.platform??"unknown"),"X-Stainless-Arch":uB(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const e=dme();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ld,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ld,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function dme(){if(typeof navigator>"u"||!navigator)return null;const t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:e,pattern:n}of t){const i=n.exec(navigator.userAgent);if(i){const r=i[1]||0,s=i[2]||0,o=i[3]||0;return{browser:e,version:`${r}.${s}.${o}`}}}return null}const uB=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",dB=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown");let hB;const hme=()=>hB??(hB=ume());function fme(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function L9(...t){const e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function U9(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return L9({start(){},async pull(n){const{done:i,value:r}=await e.next();i?n.close():n.enqueue(r)},async cancel(){await e.return?.()}})}function V9(t){if(t[Symbol.asyncIterator])return t;const e=t.getReader();return{async next(){try{const n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){const n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function pme(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}const e=t.getReader(),n=e.cancel();e.releaseLock(),await n}const gme=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),F9="RFC3986",H9=t=>String(t),fB={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:H9},mme="RFC1738";let t_=(t,e)=>(t_=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),t_(t,e));const Ys=(()=>{const t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),Kx=1024,Ame=(t,e,n,i,r)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let o="";for(let a=0;a=Kx?s.slice(a,a+Kx):s,u=[];for(let d=0;d=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||r===mme&&(f===40||f===41)){u[u.length]=l.charAt(d);continue}if(f<128){u[u.length]=Ys[f];continue}if(f<2048){u[u.length]=Ys[192|f>>6]+Ys[128|f&63];continue}if(f<55296||f>=57344){u[u.length]=Ys[224|f>>12]+Ys[128|f>>6&63]+Ys[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|l.charCodeAt(d)&1023),u[u.length]=Ys[240|f>>18]+Ys[128|f>>12&63]+Ys[128|f>>6&63]+Ys[128|f&63]}o+=u.join("")}return o};function yme(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function pB(t,e){if(ji(t)){const n=[];for(let i=0;i"u"&&(M=0)}if(typeof u=="function"?k=u(e,k):k instanceof Date?k=g?.(k):n==="comma"&&ji(k)&&(k=pB(k,function(V){return V instanceof Date?g?.(V):V})),k===null){if(s)return l&&!S?l(e,Pn.encoder,C,"key",m):e;k=""}if(vme(k)||yme(k)){if(l){const V=S?e:l(e,Pn.encoder,C,"key",m);return[v?.(V)+"="+v?.(l(k,Pn.encoder,C,"value",m))]}return[v?.(e)+"="+v?.(String(k))]}const P=[];if(typeof k>"u")return P;let N;if(n==="comma"&&ji(k))S&&l&&(k=pB(k,l)),N=[{value:k.length>0?k.join(",")||null:void 0}];else if(ji(u))N=u;else{const V=Object.keys(k);N=d?V.sort(d):V}const B=a?String(e).replace(/\./g,"%2E"):String(e),G=i&&ji(k)&&k.length===1?B+"[]":B;if(r&&ji(k)&&k.length===0)return G+"[]";for(let V=0;V"u"?t.encodeDotInKeys?!0:Pn.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Pn.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Pn.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Pn.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Pn.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Pn.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Pn.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Pn.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Pn.encodeValuesOnly,filter:r,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Pn.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Pn.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Pn.strictNullHandling}}function wme(t,e={}){let n=t;const i=bme(e);let r,s;typeof i.filter=="function"?(s=i.filter,n=s("",n)):ji(i.filter)&&(s=i.filter,r=s);const o=[];if(typeof n!="object"||n===null)return"";const a=z9[i.arrayFormat],l=a==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);const u=new WeakMap;for(let g=0;g0?f+d:""}function Sme(t){let e=0;for(const r of t)e+=r.length;const n=new Uint8Array(e);let i=0;for(const r of t)n.set(r,i),i+=r.length;return n}let mB;function rR(t){let e;return(mB??(e=new globalThis.TextEncoder,mB=e.encode.bind(e)))(t)}let AB;function yB(t){let e;return(AB??(e=new globalThis.TextDecoder,AB=e.decode.bind(e)))(t)}var mr,Ar;let aw=class{constructor(){mr.set(this,void 0),Ar.set(this,void 0),We(this,mr,new Uint8Array),We(this,Ar,null)}decode(e){if(e==null)return[];const n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?rR(e):e;We(this,mr,Sme([se(this,mr,"f"),n]));const i=[];let r;for(;(r=Cme(se(this,mr,"f"),se(this,Ar,"f")))!=null;){if(r.carriage&&se(this,Ar,"f")==null){We(this,Ar,r.index);continue}if(se(this,Ar,"f")!=null&&(r.index!==se(this,Ar,"f")+1||r.carriage)){i.push(yB(se(this,mr,"f").subarray(0,se(this,Ar,"f")-1))),We(this,mr,se(this,mr,"f").subarray(se(this,Ar,"f"))),We(this,Ar,null);continue}const s=se(this,Ar,"f")!==null?r.preceding-1:r.preceding,o=yB(se(this,mr,"f").subarray(0,s));i.push(o),We(this,mr,se(this,mr,"f").subarray(r.index)),We(this,Ar,null)}return i}flush(){return se(this,mr,"f").length?this.decode(` -`):[]}};mr=new WeakMap,Ar=new WeakMap;aw.NEWLINE_CHARS=new Set([` -`,"\r"]);aw.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Cme(t,e){for(let r=e??0;r{if(t){if(sme(_v,t))return t;Zn(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(_v))}`)}};function hp(){}function x0(t,e,n){return!e||_v[t]>_v[n]?hp:e[t].bind(e)}const Eme={error:hp,warn:hp,info:hp,debug:hp};let bB=new WeakMap;function Zn(t){const e=t.logger,n=t.logLevel??"off";if(!e)return Eme;const i=bB.get(e);if(i&&i[0]===n)return i[1];const r={error:x0("error",e,n),warn:x0("warn",e,n),info:x0("info",e,n),debug:x0("debug",e,n)};return bB.set(e,[n,r]),r}const pc=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);var Gf;let fg=class fp{constructor(e,n,i){this.iterator=e,Gf.set(this,void 0),this.controller=n,We(this,Gf,i)}static fromSSEResponse(e,n,i){let r=!1;const s=i?Zn(i):console;async function*o(){if(r)throw new Ue("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const l of _me(e,n))if(!a){if(l.data.startsWith("[DONE]")){a=!0;continue}if(l.event===null||!l.event.startsWith("thread.")){let u;try{u=JSON.parse(l.data)}catch(d){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),d}if(u&&u.error)throw new Zi(void 0,u.error,void 0,e.headers);yield u}else{let u;try{u=JSON.parse(l.data)}catch(d){throw console.error("Could not parse message into JSON:",l.data),console.error("From chunk:",l.raw),d}if(l.event=="error")throw new Zi(void 0,u.error,u.message,void 0);yield{event:l.event,data:u}}}a=!0}catch(l){if(X1(l))return;throw l}finally{a||n.abort()}}return new fp(o,n,i)}static fromReadableStream(e,n,i){let r=!1;async function*s(){const a=new aw,l=V9(e);for await(const u of l)for(const d of a.decode(u))yield d;for(const u of a.flush())yield u}async function*o(){if(r)throw new Ue("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const l of s())a||l&&(yield JSON.parse(l));a=!0}catch(l){if(X1(l))return;throw l}finally{a||n.abort()}}return new fp(o,n,i)}[(Gf=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const e=[],n=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const o=i.next();e.push(o),n.push(o)}return s.shift()}});return[new fp(()=>r(e),this.controller,se(this,Gf,"f")),new fp(()=>r(n),this.controller,se(this,Gf,"f"))]}toReadableStream(){const e=this;let n;return L9({async start(){n=e[Symbol.asyncIterator]()},async pull(i){try{const{value:r,done:s}=await n.next();if(s)return i.close();const o=rR(JSON.stringify(r)+` -`);i.enqueue(o)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};async function*_me(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ue("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ue("Attempted to iterate over a response with no body");const n=new Rme,i=new aw,r=V9(t.body);for await(const s of Tme(r))for(const o of i.decode(s)){const a=n.decode(o);a&&(yield a)}for(const s of i.flush()){const o=n.decode(s);o&&(yield o)}}async function*Tme(t){let e=new Uint8Array;for await(const n of t){if(n==null)continue;const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?rR(n):n;let r=new Uint8Array(e.length+i.length);r.set(e),r.set(i,e.length),e=r;let s;for(;(s=xme(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}let Rme=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,i,r]=kme(e,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}};function kme(t,e){const n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}async function $9(t,e){const{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:s}=e,o=await(async()=>{if(e.options.stream)return Zn(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t):fg.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;const l=n.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){const f=await n.json();return W9(f,n)}return await n.text()})();return Zn(t).debug(`[${i}] response parsed`,pc({retryOfRequestLogID:r,url:n.url,status:n.status,body:o,durationMs:Date.now()-s})),o}function W9(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("x-request-id"),enumerable:!1})}var pp;let j9=class K9 extends Promise{constructor(e,n,i=$9){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,pp.set(this,void 0),We(this,pp,e)}_thenUnwrap(e){return new K9(se(this,pp,"f"),this.responsePromise,async(n,i)=>W9(e(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(se(this,pp,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};pp=new WeakMap;var E0;class sR{constructor(e,n,i,r){E0.set(this,void 0),We(this,E0,e),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const e=this.nextPageRequestOptions();if(!e)throw new Ue("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await se(this,E0,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(E0=new WeakMap,Symbol.asyncIterator)](){for await(const e of this.iterPages())for(const n of e.getPaginatedItems())yield n}}class Ime extends j9{constructor(e,n,i){super(e,n,async(r,s)=>new i(r,s.response,await $9(r,s),s.options))}async*[Symbol.asyncIterator](){const e=await this;for await(const n of e)yield n}}class lw extends sR{constructor(e,n,i,r){super(e,n,i,r),this.data=i.data||[],this.object=i.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class xn extends sR{constructor(e,n,i,r){super(e,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const e=this.getPaginatedItems(),n=e[e.length-1]?.id;return n?{...this.options,query:{...B9(this.options.query),after:n}}:null}}class Mme extends sR{constructor(e,n,i,r){super(e,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.last_id=i.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const e=this.last_id;return e?{...this.options,query:{...B9(this.options.query),after:e}}:null}}const Y9=()=>{if(typeof File>"u"){const{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Np(t,e,n){return Y9(),new File(t,e??"unknown_file",n)}function By(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}const q9=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",Lc=async(t,e)=>({...t,body:await Pme(t.body,e)}),wB=new WeakMap;function Dme(t){const e=typeof t=="function"?t:t.fetch,n=wB.get(e);if(n)return n;const i=(async()=>{try{const r="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new r(s).text()}catch{return!0}})();return wB.set(e,i),i}const Pme=async(t,e)=>{if(!await Dme(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(t||{}).map(([i,r])=>n_(n,i,r))),n},Nme=t=>t instanceof Blob&&"name"in t,n_=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response)t.append(e,Np([await n.blob()],By(n)));else if(q9(n))t.append(e,Np([await new Response(U9(n)).blob()],By(n)));else if(Nme(n))t.append(e,n,By(n));else if(Array.isArray(n))await Promise.all(n.map(i=>n_(t,e+"[]",i)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([i,r])=>n_(t,`${e}[${i}]`,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},J9=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",Ome=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&J9(t),Bme=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function";async function Lme(t,e,n){if(Y9(),t=await t,Ome(t))return t instanceof File?t:Np([await t.arrayBuffer()],t.name);if(Bme(t)){const r=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Np(await i_(r),e,n)}const i=await i_(t);if(e||(e=By(t)),!n?.type){const r=i.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof r=="string"&&(n={...n,type:r})}return Np(i,e,n)}async function i_(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(J9(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(q9(t))for await(const n of t)e.push(...await i_(n));else{const n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${Ume(t)}`)}return e}function Ume(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}let Ge=class{constructor(e){this._client=e}};function X9(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const SB=Object.freeze(Object.create(null)),Vme=(t=X9)=>function(n,...i){if(n.length===1)return n[0];let r=!1;const s=[],o=n.reduce((d,f,g)=>{/[?#]/.test(f)&&(r=!0);const m=i[g];let v=(r?encodeURIComponent:t)(""+m);return g!==i.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??SB)??SB)?.toString)&&(v=m+"",s.push({start:d.length+f.length,length:v.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(g===i.length?"":v)},""),a=o.split(/[?#]/,1)[0],l=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=l.exec(a))!==null;)s.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(s.sort((d,f)=>d.start-f.start),s.length>0){let d=0;const f=s.reduce((g,m)=>{const v=" ".repeat(m.start-d),S="^".repeat(m.length);return d=m.start+m.length,g+v+S},"");throw new Ue(`Path parameters result in path with invalid segments: -${s.map(g=>g.error).join(` +Assistant:`;sr.DEFAULT_TIMEOUT=6e5;sr.AnthropicError=jt;sr.APIError=mi;sr.APIConnectionError=VM;sr.APIConnectionTimeoutError=bne;sr.APIUserAbortError=gs;sr.NotFoundError=vne;sr.ConflictError=Sne;sr.RateLimitError=wne;sr.BadRequestError=yne;sr.AuthenticationError=Ane;sr.InternalServerError=One;sr.PermissionDeniedError=_ne;sr.UnprocessableEntityError=Cne;sr.toFile=VDe;class LA extends sr{constructor(){super(...arguments),this.completions=new Vne(this),this.messages=new ZF(this),this.models=new Gne(this),this.beta=new jC(this)}}LA.Completions=Vne;LA.Messages=ZF;LA.Models=Gne;LA.Beta=jC;const{HUMAN_PROMPT:l2t,AI_PROMPT:u2t}=LA;var qS={exports:{}};qS.exports;var B5;function YDe(){return B5||(B5=1,(function(e,t){var n=200,o="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",s="[object Array]",a="[object Boolean]",c="[object Date]",p="[object Error]",u="[object Function]",l="[object GeneratorFunction]",d="[object Map]",f="[object Number]",h="[object Object]",m="[object Promise]",g="[object RegExp]",y="[object Set]",_="[object String]",S="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",E="[object DataView]",T="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",q="[object Uint8Array]",I="[object Uint8ClampedArray]",U="[object Uint16Array]",J="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,Q=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,K={};K[i]=K[s]=K[R]=K[E]=K[a]=K[c]=K[T]=K[D]=K[B]=K[N]=K[L]=K[d]=K[f]=K[h]=K[g]=K[y]=K[_]=K[S]=K[q]=K[I]=K[U]=K[J]=!0,K[p]=K[u]=K[w]=!1;var X=typeof _O=="object"&&_O&&_O.Object===Object&&_O,ce=typeof self=="object"&&self&&self.Object===Object&&self,W=X||ce||Function("return this")(),_e=t&&!t.nodeType&&t,Ne=_e&&!0&&e&&!e.nodeType&&e,Ie=Ne&&Ne.exports===_e;function Me(Z,me){return Z.set(me[0],me[1]),Z}function Ye(Z,me){return Z.add(me),Z}function ct(Z,me){for(var Te=-1,Ue=Z?Z.length:0;++Te-1}function Bs(Z,me){var Te=this.__data__,Ue=Ko(Te,Z);return Ue<0?Te.push([Z,me]):Te[Ue][1]=me,this}Ro.prototype.clear=Sb,Ro.prototype.delete=Ai,Ro.prototype.get=Un,Ro.prototype.has=Cr,Ro.prototype.set=Bs;function _i(Z){var me=-1,Te=Z?Z.length:0;for(this.clear();++me-1&&Z%1==0&&Z-1&&Z%1==0&&Z<=r}function Us(Z){var me=typeof Z;return!!Z&&(me=="object"||me=="function")}function qs(Z){return!!Z&&typeof Z=="object"}function Vm(Z){return Eb(Z)?Ob(Z):re(Z)}function Mb(){return[]}function gw(){return!1}e.exports=c_})(qS,qS.exports)),qS.exports}var XDe=YDe();const GM=Wg(XDe),FD=(e,t)=>new LA({apiKey:e,baseURL:t,dangerouslyAllowBrowser:!0}),k5=e=>({isEnd:!0,responseMessage:e}),ZDe=e=>({isEnd:!0,responseMessage:{role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:e}}}),eNe=(e,t)=>e&&t?GM(t):{role:"assistant",content:[]},tNe=e=>typeof e.content=="string"?null:e.content.filter(t=>t.type==="tool-call").at(-1)??null,dv={name:"Anthropic",baseUrl:"https://api.anthropic.com",modelFilters:["claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-5"],modelNames:{},thinkingModels:["claude-sonnet-4-5","claude-opus-4-5"]},nNe={"image/jpeg":"image/jpeg","image/jpg":"image/jpeg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp"},rNe="image/jpeg",oNe=e=>({base64:e.split(",")[1],mimeType:e.split(";")[0].split(":")[1]}),iNe=e=>nNe[e]??rNe,sNe=e=>{const{base64:t,mimeType:n}=oNe(e);return{type:"image",source:{type:"base64",media_type:iNe(n),data:t}}},aNe=e=>e.map(t=>({name:t.name,description:t.description,input_schema:{type:"object",...t.inputSchema}})),lNe=e=>e.type==="text"?{type:"text",text:e.text}:{type:"text",text:""},uNe=e=>e.type!=="file"?{type:"text",text:""}:{type:"document",source:{type:"text",media_type:"text/plain",data:e.data},context:JSON.parse(e.mimeType).path},cNe=e=>e.type!=="image"?{type:"text",text:""}:sNe(e.image),dNe=e=>e.type==="text"?{type:"text",text:e.text}:e.type==="file"?uNe(e):e.type==="image"?cNe(e):{type:"text",text:""},fNe=e=>[{role:"user",content:typeof e.content=="string"?e.content:e.content.map(dNe)}],hNe=e=>[{role:"user",content:typeof e.content=="string"?e.content:e.content.map(lNe)}],pNe=e=>{const t=[];if(typeof e.content=="string")return[{role:"assistant",content:e.content||[]}];let n=[],o=[];for(const r of e.content){if(r.type==="reasoning"){n.push({type:"thinking",thinking:r.text,signature:r.parentId??""});continue}if(r.type==="text"){n.push({type:"text",text:r.text});continue}r.type==="tool-call"&&(r.result&&o.push({type:"tool_result",content:r.result,tool_use_id:r.toolCallId??""}),n.push({type:"tool_use",id:r.toolCallId??"",name:r.toolName,input:r.args||{}}),t.push({role:"assistant",content:n}),o.length&&(t.push({role:"user",content:o}),o=[]),n=[])}return n.length&&t.push({role:"assistant",content:n}),t},xD=e=>e.flatMap(t=>t.role==="user"?fNe(t):t.role==="system"?hNe(t):pNe(t));class mNe extends JM{setProvider=t=>{this.provider=t,this.client=FD(t.key,t.baseUrl),t.key&&this.setApiKey(t.key),t.baseUrl&&this.setUrl(t.baseUrl)};setPrevMessages=t=>{this.prevMessages=xD(t)};setTools=t=>{this.tools=aNe(t)};pushToHistory=t=>{const n=xD([t]);this.prevMessages.push(...n)};pushToHistorySliced=(t,n)=>{if(typeof t.content=="string"||typeof n.content=="string")return;const o=t.content.slice(n.content.length);this.pushToHistory({...t,content:o})};isThinkingMode=()=>dv.thinkingModels.some(t=>this.modelKey.includes(t));async createChatName(t){if(!this.client)return"";try{return(await this.client.messages.create({messages:[{role:"user",content:t}],model:this.modelKey,system:qM,max_tokens:2048,stream:!1})).content.find(r=>r.type==="text")?.text??t.substring(0,25)}catch{return""}}async*sendMessage(t,n,o,r){if(this.client)try{const i=xD(t);this.prevMessages.push(...i);const s=r?this.isThinkingMode():!1,a=await this.client.messages.create({messages:[...this.prevMessages],model:this.modelKey,system:this.systemPrompt,tools:this.tools.length>0?this.tools:void 0,stream:!0,max_tokens:s?16e3:3e4,...this.tools.length>0&&{tool_choice:{disable_parallel_tool_use:!0,type:"auto"}},...s&&{thinking:{type:"enabled",budget_tokens:1e4}}});let c=eNe(n,o);for await(const p of a){if(this.stopFlag){this.stopFlag=!1,this.pushToHistory(c),a.controller.abort(),yield k5(c);return}switch(p.type){case"message_start":n&&o?yield o:c=cDe(p);break;case"content_block_start":c=dDe(p,c);break;case"content_block_delta":c=fDe(p,c);break;case"message_stop":n&&o?this.pushToHistorySliced(c,o):this.pushToHistory(c),yield k5(c);return;default:break}yield c}}catch(i){yield ZDe(i)}}async*sendMessageAfterToolCall(t,n){const o=tNe(t);if(!o)return t;const r={type:"tool_result",content:o.result,tool_use_id:o.toolCallId??""};this.prevMessages.push({role:"user",content:[r]}),yield*this.sendMessage([],!0,t,n)}getBaseUrl=()=>dv.baseUrl;getName=()=>dv.name;checkProvider=async t=>{const n=FD(t.apiKey,t.url);try{return await n.models.list(),!0}catch(o){const r=hne(o);return r===0||o&&typeof o=="object"&&"cause"in o?yn.invalidUrl():r===401?yn.invalidKey(fne(o)):r===404?yn.invalidUrl():t.apiKey?yn.invalidKey():yn.emptyKey()}};getProviderModels=async t=>{const n=FD(t.apiKey,t.url);try{const{data:o}=await n.models.list(),r=[];for(const i of o){if(!dv.modelFilters.some(c=>i.id.includes(c)))continue;const a=dv.modelNames[i.id]||i.display_name;r.push({id:i.id,name:a,provider:"anthropic"})}return r}catch{return[]}}}const gNe=new mNe;function bt(e,t,n,o,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}function ge(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)}let Kne=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return Kne=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^n()&15>>+o/4).toString(16))};function Z2(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const e1=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class at extends Error{}let Uo=class t1 extends at{constructor(t,n,o,r){super(`${t1.makeMessage(t,n,o)}`),this.status=t,this.headers=r,this.requestID=r?.get("x-request-id"),this.error=n;const i=n;this.code=i?.code,this.param=i?.param,this.type=i?.type}static makeMessage(t,n,o){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):o;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,o,r){if(!t||!r)return new zM({message:o,cause:e1(n)});const i=n?.error;return t===400?new Qne(t,i,o,r):t===401?new $ne(t,i,o,r):t===403?new Wne(t,i,o,r):t===404?new Yne(t,i,o,r):t===409?new Xne(t,i,o,r):t===422?new Zne(t,i,o,r):t===429?new ere(t,i,o,r):t>=500?new tre(t,i,o,r):new t1(t,i,o,r)}},Ui=class extends Uo{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},zM=class extends Uo{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},tx=class extends zM{constructor({message:t}={}){super({message:t??"Request timed out."})}},Qne=class extends Uo{},$ne=class extends Uo{},Wne=class extends Uo{},Yne=class extends Uo{},Xne=class extends Uo{},Zne=class extends Uo{},ere=class extends Uo{},tre=class extends Uo{};class nre extends at{constructor(){super("Could not parse response content as the length limit was reached")}}class rre extends at{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class JS extends Error{constructor(t){super(t)}}const bNe=/^[a-z][a-z0-9+.-]*:/i,yNe=e=>bNe.test(e);let No=e=>(No=Array.isArray,No(e)),U5=No;function ore(e){return typeof e!="object"?{}:e??{}}function ANe(e){if(!e)return!0;for(const t in e)return!1;return!0}function _Ne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BD(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}const vNe=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new at(`${e} must be an integer`);if(t<0)throw new at(`${e} must be a positive integer`);return t},SNe=e=>{try{return JSON.parse(e)}catch{return}},DC=e=>new Promise(t=>setTimeout(t,e)),My="5.23.2",CNe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function wNe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const ONe=()=>{const e=wNe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":My,"X-Stainless-OS":J5(Deno.build.os),"X-Stainless-Arch":q5(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":My,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":My,"X-Stainless-OS":J5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":q5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const t=TNe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":My,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":My,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function TNe(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:n}of e){const o=n.exec(navigator.userAgent);if(o){const r=o[1]||0,i=o[2]||0,s=o[3]||0;return{browser:t,version:`${r}.${i}.${s}`}}}return null}const q5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",J5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let V5;const RNe=()=>V5??(V5=ONe());function ENe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ire(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function sre(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ire({start(){},async pull(n){const{done:o,value:r}=await t.next();o?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function are(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function MNe(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const t=e.getReader(),n=t.cancel();t.releaseLock(),await n}const PNe=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)}),lre="RFC3986",ure=e=>String(e),H5={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:ure},INe="RFC1738";let n1=(e,t)=>(n1=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),n1(e,t));const Qs=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),kD=1024,jNe=(e,t,n,o,r)=>{if(e.length===0)return e;let i=e;if(typeof e=="symbol"?i=Symbol.prototype.toString.call(e):typeof e!="string"&&(i=String(e)),n==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=kD?i.slice(a,a+kD):i,p=[];for(let u=0;u=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||r===INe&&(l===40||l===41)){p[p.length]=c.charAt(u);continue}if(l<128){p[p.length]=Qs[l];continue}if(l<2048){p[p.length]=Qs[192|l>>6]+Qs[128|l&63];continue}if(l<55296||l>=57344){p[p.length]=Qs[224|l>>12]+Qs[128|l>>6&63]+Qs[128|l&63];continue}u+=1,l=65536+((l&1023)<<10|c.charCodeAt(u)&1023),p[p.length]=Qs[240|l>>18]+Qs[128|l>>12&63]+Qs[128|l>>6&63]+Qs[128|l&63]}s+=p.join("")}return s};function DNe(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function G5(e,t){if(No(e)){const n=[];for(let o=0;o"u"&&(w=0)}if(typeof p=="function"?_=p(t,_):_ instanceof Date?_=d?.(_):n==="comma"&&No(_)&&(_=G5(_,function(N){return N instanceof Date?d?.(N):N})),_===null){if(i)return c&&!m?c(t,hr.encoder,g,"key",f):t;_=""}if(NNe(_)||DNe(_)){if(c){const N=m?t:c(t,hr.encoder,g,"key",f);return[h?.(N)+"="+h?.(c(_,hr.encoder,g,"value",f))]}return[h?.(t)+"="+h?.(String(_))]}const E=[];if(typeof _>"u")return E;let T;if(n==="comma"&&No(_))m&&c&&(_=G5(_,c)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if(No(p))T=p;else{const N=Object.keys(_);T=u?N.sort(u):N}const D=a?String(t).replace(/\./g,"%2E"):String(t),B=o&&No(_)&&_.length===1?D+"[]":D;if(r&&No(_)&&_.length===0)return B+"[]";for(let N=0;N"u"?e.encodeDotInKeys?!0:hr.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:hr.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:hr.allowEmptyArrays,arrayFormat:i,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:hr.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?hr.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:hr.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:hr.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:hr.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:hr.encodeValuesOnly,filter:r,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:hr.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:hr.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:hr.strictNullHandling}}function FNe(e,t={}){let n=e;const o=LNe(t);let r,i;typeof o.filter=="function"?(i=o.filter,n=i("",n)):No(o.filter)&&(i=o.filter,r=i);const s=[];if(typeof n!="object"||n===null)return"";const a=cre[o.arrayFormat],c=a==="comma"&&o.commaRoundTrip;r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);const p=new WeakMap;for(let d=0;d0?l+u:""}function xNe(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let o=0;for(const r of e)n.set(r,o),o+=r.length;return n}let K5;function nx(e){let t;return(K5??(t=new globalThis.TextEncoder,K5=t.encode.bind(t)))(e)}let Q5;function $5(e){let t;return(Q5??(t=new globalThis.TextDecoder,Q5=t.decode.bind(t)))(e)}var ii,si;let KM=class{constructor(){ii.set(this,void 0),si.set(this,void 0),bt(this,ii,new Uint8Array),bt(this,si,null)}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?nx(t):t;bt(this,ii,xNe([ge(this,ii,"f"),n]));const o=[];let r;for(;(r=BNe(ge(this,ii,"f"),ge(this,si,"f")))!=null;){if(r.carriage&&ge(this,si,"f")==null){bt(this,si,r.index);continue}if(ge(this,si,"f")!=null&&(r.index!==ge(this,si,"f")+1||r.carriage)){o.push($5(ge(this,ii,"f").subarray(0,ge(this,si,"f")-1))),bt(this,ii,ge(this,ii,"f").subarray(ge(this,si,"f"))),bt(this,si,null);continue}const i=ge(this,si,"f")!==null?r.preceding-1:r.preceding,s=$5(ge(this,ii,"f").subarray(0,i));o.push(s),bt(this,ii,ge(this,ii,"f").subarray(r.index)),bt(this,si,null)}return o}flush(){return ge(this,ii,"f").length?this.decode(` +`):[]}};ii=new WeakMap,si=new WeakMap;KM.NEWLINE_CHARS=new Set([` +`,"\r"]);KM.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function BNe(e,t){for(let r=t??0;r{if(e){if(_Ne(lE,e))return e;kr(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(lE))}`)}};function VS(){}function ZO(e,t,n){return!t||lE[e]>lE[n]?VS:t[e].bind(t)}const UNe={error:VS,warn:VS,info:VS,debug:VS};let Y5=new WeakMap;function kr(e){const t=e.logger,n=e.logLevel??"off";if(!t)return UNe;const o=Y5.get(t);if(o&&o[0]===n)return o[1];const r={error:ZO("error",t,n),warn:ZO("warn",t,n),info:ZO("info",t,n),debug:ZO("debug",t,n)};return Y5.set(t,[n,r]),r}const _g=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var fv;let H0=class HS{constructor(t,n,o){this.iterator=t,fv.set(this,void 0),this.controller=n,bt(this,fv,o)}static fromSSEResponse(t,n,o){let r=!1;const i=o?kr(o):console;async function*s(){if(r)throw new at("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const c of qNe(t,n))if(!a){if(c.data.startsWith("[DONE]")){a=!0;continue}if(c.event===null||!c.event.startsWith("thread.")){let p;try{p=JSON.parse(c.data)}catch(u){throw i.error("Could not parse message into JSON:",c.data),i.error("From chunk:",c.raw),u}if(p&&p.error)throw new Uo(void 0,p.error,void 0,t.headers);yield p}else{let p;try{p=JSON.parse(c.data)}catch(u){throw console.error("Could not parse message into JSON:",c.data),console.error("From chunk:",c.raw),u}if(c.event=="error")throw new Uo(void 0,p.error,p.message,void 0);yield{event:c.event,data:p}}}a=!0}catch(c){if(Z2(c))return;throw c}finally{a||n.abort()}}return new HS(s,n,o)}static fromReadableStream(t,n,o){let r=!1;async function*i(){const a=new KM,c=are(t);for await(const p of c)for(const u of a.decode(p))yield u;for(const p of a.flush())yield p}async function*s(){if(r)throw new at("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(const c of i())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Z2(c))return;throw c}finally{a||n.abort()}}return new HS(s,n,o)}[(fv=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const t=[],n=[],o=this.iterator(),r=i=>({next:()=>{if(i.length===0){const s=o.next();t.push(s),n.push(s)}return i.shift()}});return[new HS(()=>r(t),this.controller,ge(this,fv,"f")),new HS(()=>r(n),this.controller,ge(this,fv,"f"))]}toReadableStream(){const t=this;let n;return ire({async start(){n=t[Symbol.asyncIterator]()},async pull(o){try{const{value:r,done:i}=await n.next();if(i)return o.close();const s=nx(JSON.stringify(r)+` +`);o.enqueue(s)}catch(r){o.error(r)}},async cancel(){await n.return?.()}})}};async function*qNe(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new at("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new at("Attempted to iterate over a response with no body");const n=new VNe,o=new KM,r=are(e.body);for await(const i of JNe(r))for(const s of o.decode(i)){const a=n.decode(s);a&&(yield a)}for(const i of o.flush()){const s=n.decode(i);s&&(yield s)}}async function*JNe(e){let t=new Uint8Array;for await(const n of e){if(n==null)continue;const o=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?nx(n):n;let r=new Uint8Array(t.length+o.length);r.set(t),r.set(o,t.length),t=r;let i;for(;(i=kNe(t))!==-1;)yield t.slice(0,i),t=t.slice(i)}t.length>0&&(yield t)}let VNe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const i={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,o,r]=HNe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}};function HNe(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function hre(e,t){const{response:n,requestLogID:o,retryOfRequestLogID:r,startTime:i}=t,s=await(async()=>{if(t.options.stream)return kr(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e):H0.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){const l=await n.json();return pre(l,n)}return await n.text()})();return kr(e).debug(`[${o}] response parsed`,_g({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-i})),s}function pre(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}var GS;let mre=class gre extends Promise{constructor(t,n,o=hre){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=o,GS.set(this,void 0),bt(this,GS,t)}_thenUnwrap(t){return new gre(ge(this,GS,"f"),this.responsePromise,async(n,o)=>pre(t(await this.parseResponse(n,o),o),o.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(ge(this,GS,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};GS=new WeakMap;var eT;class rx{constructor(t,n,o,r){eT.set(this,void 0),bt(this,eT,t),this.options=r,this.response=n,this.body=o}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const t=this.nextPageRequestOptions();if(!t)throw new at("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ge(this,eT,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(eT=new WeakMap,Symbol.asyncIterator)](){for await(const t of this.iterPages())for(const n of t.getPaginatedItems())yield n}}class GNe extends mre{constructor(t,n,o){super(t,n,async(r,i)=>new o(r,i.response,await hre(r,i),i.options))}async*[Symbol.asyncIterator](){const t=await this;for await(const n of t)yield n}}class QM extends rx{constructor(t,n,o,r){super(t,n,o,r),this.data=o.data||[],this.object=o.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class or extends rx{constructor(t,n,o,r){super(t,n,o,r),this.data=o.data||[],this.has_more=o.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const t=this.getPaginatedItems(),n=t[t.length-1]?.id;return n?{...this.options,query:{...ore(this.options.query),after:n}}:null}}class zNe extends rx{constructor(t,n,o,r){super(t,n,o,r),this.data=o.data||[],this.has_more=o.has_more||!1,this.last_id=o.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const t=this.last_id;return t?{...this.options,query:{...ore(this.options.query),after:t}}:null}}const bre=()=>{if(typeof File>"u"){const{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function d0(e,t,n){return bre(),new File(e,t??"unknown_file",n)}function yR(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const yre=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Vg=async(e,t)=>({...e,body:await QNe(e.body,t)}),X5=new WeakMap;function KNe(e){const t=typeof e=="function"?e:e.fetch,n=X5.get(t);if(n)return n;const o=(async()=>{try{const r="Response"in t?t.Response:(await t("data:,")).constructor,i=new FormData;return i.toString()!==await new r(i).text()}catch{return!0}})();return X5.set(t,o),o}const QNe=async(e,t)=>{if(!await KNe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(e||{}).map(([o,r])=>r1(n,o,r))),n},$Ne=e=>e instanceof Blob&&"name"in e,r1=async(e,t,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response)e.append(t,d0([await n.blob()],yR(n)));else if(yre(n))e.append(t,d0([await new Response(sre(n)).blob()],yR(n)));else if($Ne(n))e.append(t,n,yR(n));else if(Array.isArray(n))await Promise.all(n.map(o=>r1(e,t+"[]",o)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([o,r])=>r1(e,`${t}[${o}]`,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},Are=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",WNe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&Are(e),YNe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function XNe(e,t,n){if(bre(),e=await e,WNe(e))return e instanceof File?e:d0([await e.arrayBuffer()],e.name);if(YNe(e)){const r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),d0(await o1(r),t,n)}const o=await o1(e);if(t||(t=yR(e)),!n?.type){const r=o.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof r=="string"&&(n={...n,type:r})}return d0(o,t,n)}async function o1(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(Are(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(yre(e))for await(const n of e)t.push(...await o1(n));else{const n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${ZNe(e)}`)}return t}function ZNe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}let pt=class{constructor(t){this._client=t}};function _re(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const Z5=Object.freeze(Object.create(null)),e2e=(e=_re)=>function(n,...o){if(n.length===1)return n[0];let r=!1;const i=[],s=n.reduce((u,l,d)=>{/[?#]/.test(l)&&(r=!0);const f=o[d];let h=(r?encodeURIComponent:e)(""+f);return d!==o.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??Z5)??Z5)?.toString)&&(h=f+"",i.push({start:u.length+l.length,length:h.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+l+(d===o.length?"":h)},""),a=s.split(/[?#]/,1)[0],c=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let p;for(;(p=c.exec(a))!==null;)i.push({start:p.index,length:p[0].length,error:`Value "${p[0]}" can't be safely passed as a path parameter`});if(i.sort((u,l)=>u.start-l.start),i.length>0){let u=0;const l=i.reduce((d,f)=>{const h=" ".repeat(f.start-u),m="^".repeat(f.length);return u=f.start+f.length,d+h+m},"");throw new at(`Path parameters result in path with invalid segments: +${i.map(d=>d.error).join(` `)} -${o} -${f}`)}return o},we=Vme(X9);let Z9=class extends Ge{list(e,n={},i){return this._client.getAPIList(we`/chat/completions/${e}/messages`,xn,{query:n,...i})}};function Tv(t){return t!==void 0&&"function"in t&&t.function!==void 0}function oR(t){return t?.$brand==="auto-parseable-response-format"}function im(t){return t?.$brand==="auto-parseable-tool"}function Fme(t,e){return!e||!eH(e)?{...t,choices:t.choices.map(n=>(tH(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:aR(t,e)}function aR(t,e){const n=t.choices.map(i=>{if(i.finish_reason==="length")throw new N9;if(i.finish_reason==="content_filter")throw new O9;return tH(i.message.tool_calls),{...i,message:{...i.message,...i.message.tool_calls?{tool_calls:i.message.tool_calls?.map(r=>zme(e,r))??void 0}:void 0,parsed:i.message.content&&!i.message.refusal?Hme(e,i.message.content):null}}});return{...t,choices:n}}function Hme(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function zme(t,e){const n=t.tools?.find(i=>Tv(i)&&i.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:im(n)?n.$parseRaw(e.function.arguments):n?.function.strict?JSON.parse(e.function.arguments):null}}}function Qme(t,e){if(!t||!("tools"in t)||!t.tools)return!1;const n=t.tools?.find(i=>Tv(i)&&i.function?.name===e.function.name);return Tv(n)&&(im(n)||n?.function.strict||!1)}function eH(t){return oR(t.response_format)?!0:t.tools?.some(e=>im(e)||e.type==="function"&&e.function.strict===!0)??!1}function tH(t){for(const e of t||[])if(e.type!=="function")throw new Ue(`Currently only \`function\` tool calls are supported; Received \`${e.type}\``)}function Gme(t){for(const e of t??[]){if(e.type!=="function")throw new Ue(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new Ue(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}const Rv=t=>t?.role==="assistant",nH=t=>t?.role==="tool";var r_,Ly,Uy,gp,mp,Vy,Ap,ta,yp,kv,Iv,cd,iH;class lR{constructor(){r_.add(this),this.controller=new AbortController,Ly.set(this,void 0),Uy.set(this,()=>{}),gp.set(this,()=>{}),mp.set(this,void 0),Vy.set(this,()=>{}),Ap.set(this,()=>{}),ta.set(this,{}),yp.set(this,!1),kv.set(this,!1),Iv.set(this,!1),cd.set(this,!1),We(this,Ly,new Promise((e,n)=>{We(this,Uy,e,"f"),We(this,gp,n,"f")})),We(this,mp,new Promise((e,n)=>{We(this,Vy,e,"f"),We(this,Ap,n,"f")})),se(this,Ly,"f").catch(()=>{}),se(this,mp,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},se(this,r_,"m",iH).bind(this))},0)}_connected(){this.ended||(se(this,Uy,"f").call(this),this._emit("connect"))}get ended(){return se(this,yp,"f")}get errored(){return se(this,kv,"f")}get aborted(){return se(this,Iv,"f")}abort(){this.controller.abort()}on(e,n){return(se(this,ta,"f")[e]||(se(this,ta,"f")[e]=[])).push({listener:n}),this}off(e,n){const i=se(this,ta,"f")[e];if(!i)return this;const r=i.findIndex(s=>s.listener===n);return r>=0&&i.splice(r,1),this}once(e,n){return(se(this,ta,"f")[e]||(se(this,ta,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,i)=>{We(this,cd,!0),e!=="error"&&this.once("error",i),this.once(e,n)})}async done(){We(this,cd,!0),await se(this,mp,"f")}_emit(e,...n){if(se(this,yp,"f"))return;e==="end"&&(We(this,yp,!0),se(this,Vy,"f").call(this));const i=se(this,ta,"f")[e];if(i&&(se(this,ta,"f")[e]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),e==="abort"){const r=n[0];!se(this,cd,"f")&&!i?.length&&Promise.reject(r),se(this,gp,"f").call(this,r),se(this,Ap,"f").call(this,r),this._emit("end");return}if(e==="error"){const r=n[0];!se(this,cd,"f")&&!i?.length&&Promise.reject(r),se(this,gp,"f").call(this,r),se(this,Ap,"f").call(this,r),this._emit("end")}}_emitFinal(){}}Ly=new WeakMap,Uy=new WeakMap,gp=new WeakMap,mp=new WeakMap,Vy=new WeakMap,Ap=new WeakMap,ta=new WeakMap,yp=new WeakMap,kv=new WeakMap,Iv=new WeakMap,cd=new WeakMap,r_=new WeakSet,iH=function(e){if(We(this,kv,!0),e instanceof Error&&e.name==="AbortError"&&(e=new Wr),e instanceof Wr)return We(this,Iv,!0),this._emit("abort",e);if(e instanceof Ue)return this._emit("error",e);if(e instanceof Error){const n=new Ue(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new Ue(String(e)))};function $me(t){return typeof t.parse=="function"}var _i,s_,Mv,o_,a_,l_,rH,sH;const Wme=10;class oH extends lR{constructor(){super(...arguments),_i.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);const n=e.choices[0]?.message;return n&&this._addMessage(n),e}_addMessage(e,n=!0){if("content"in e||(e.content=null),this.messages.push(e),n){if(this._emit("message",e),nH(e)&&e.content)this._emit("functionToolCallResult",e.content);else if(Rv(e)&&e.tool_calls)for(const i of e.tool_calls)i.type==="function"&&this._emit("functionToolCall",i.function)}}async finalChatCompletion(){await this.done();const e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new Ue("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),se(this,_i,"m",s_).call(this)}async finalMessage(){return await this.done(),se(this,_i,"m",Mv).call(this)}async finalFunctionToolCall(){return await this.done(),se(this,_i,"m",o_).call(this)}async finalFunctionToolCallResult(){return await this.done(),se(this,_i,"m",a_).call(this)}async totalUsage(){return await this.done(),se(this,_i,"m",l_).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);const n=se(this,_i,"m",Mv).call(this);n&&this._emit("finalMessage",n);const i=se(this,_i,"m",s_).call(this);i&&this._emit("finalContent",i);const r=se(this,_i,"m",o_).call(this);r&&this._emit("finalFunctionToolCall",r);const s=se(this,_i,"m",a_).call(this);s!=null&&this._emit("finalFunctionToolCallResult",s),this._chatCompletions.some(o=>o.usage)&&this._emit("totalUsage",se(this,_i,"m",l_).call(this))}async _createChatCompletion(e,n,i){const r=i?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),se(this,_i,"m",rH).call(this,n);const s=await e.chat.completions.create({...n,stream:!1},{...i,signal:this.controller.signal});return this._connected(),this._addChatCompletion(aR(s,n))}async _runChatCompletion(e,n,i){for(const r of n.messages)this._addMessage(r,!1);return await this._createChatCompletion(e,n,i)}async _runTools(e,n,i){const r="tool",{tool_choice:s="auto",stream:o,...a}=n,l=typeof s!="string"&&s.type==="function"&&s?.function?.name,{maxChatCompletions:u=Wme}=i||{},d=n.tools.map(m=>{if(im(m)){if(!m.$callback)throw new Ue("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:m.$callback,name:m.function.name,description:m.function.description||"",parameters:m.function.parameters,parse:m.$parseRaw,strict:!0}}}return m}),f={};for(const m of d)m.type==="function"&&(f[m.function.name||m.function.function.name]=m.function);const g="tools"in n?d.map(m=>m.type==="function"?{type:"function",function:{name:m.function.name||m.function.function.name,parameters:m.function.parameters,description:m.function.description,strict:m.function.strict}}:m):void 0;for(const m of n.messages)this._addMessage(m,!1);for(let m=0;mJSON.stringify(G)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:E,content:B});continue}let D;try{D=$me(M)?await M.parse(R):R}catch(B){const G=B instanceof Error?B.message:String(B);this._addMessage({role:r,tool_call_id:E,content:G});continue}const P=await M.function(D,this),N=se(this,_i,"m",sH).call(this,P);if(this._addMessage({role:r,tool_call_id:E,content:N}),l)return}}}}_i=new WeakSet,s_=function(){return se(this,_i,"m",Mv).call(this).content??null},Mv=function(){let e=this.messages.length;for(;e-- >0;){const n=this.messages[e];if(Rv(n))return{...n,content:n.content??null,refusal:n.refusal??null}}throw new Ue("stream ended without producing a ChatCompletionMessage with role=assistant")},o_=function(){for(let e=this.messages.length-1;e>=0;e--){const n=this.messages[e];if(Rv(n)&&n?.tool_calls?.length)return n.tool_calls.filter(i=>i.type==="function").at(-1)?.function}},a_=function(){for(let e=this.messages.length-1;e>=0;e--){const n=this.messages[e];if(nH(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(i=>i.role==="assistant"&&i.tool_calls?.some(r=>r.type==="function"&&r.id===n.tool_call_id)))return n.content}},l_=function(){const e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:n}of this._chatCompletions)n&&(e.completion_tokens+=n.completion_tokens,e.prompt_tokens+=n.prompt_tokens,e.total_tokens+=n.total_tokens);return e},rH=function(e){if(e.n!=null&&e.n>1)throw new Ue("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},sH=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)};class cR extends oH{static runTools(e,n,i){const r=new cR,s={...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,n,s)),r}_addMessage(e,n=!0){super._addMessage(e,n),Rv(e)&&e.content&&this._emit("content",e.content)}}const aH=1,lH=2,cH=4,uH=8,dH=16,hH=32,fH=64,pH=128,gH=256,mH=pH|gH,AH=dH|hH|mH|fH,yH=aH|lH|AH,vH=cH|uH,jme=yH|vH,Hn={STR:aH,NUM:lH,ARR:cH,OBJ:uH,NULL:dH,BOOL:hH,NAN:fH,INFINITY:pH,MINUS_INFINITY:gH,INF:mH,SPECIAL:AH,ATOM:yH,COLLECTION:vH,ALL:jme};class Kme extends Error{}class Yme extends Error{}function qme(t,e=Hn.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return Jme(t.trim(),e)}const Jme=(t,e)=>{const n=t.length;let i=0;const r=g=>{throw new Kme(`${g} at position ${i}`)},s=g=>{throw new Yme(`${g} at position ${i}`)},o=()=>(f(),i>=n&&r("Unexpected end of input"),t[i]==='"'?a():t[i]==="{"?l():t[i]==="["?u():t.substring(i,i+4)==="null"||Hn.NULL&e&&n-i<4&&"null".startsWith(t.substring(i))?(i+=4,null):t.substring(i,i+4)==="true"||Hn.BOOL&e&&n-i<4&&"true".startsWith(t.substring(i))?(i+=4,!0):t.substring(i,i+5)==="false"||Hn.BOOL&e&&n-i<5&&"false".startsWith(t.substring(i))?(i+=5,!1):t.substring(i,i+8)==="Infinity"||Hn.INFINITY&e&&n-i<8&&"Infinity".startsWith(t.substring(i))?(i+=8,1/0):t.substring(i,i+9)==="-Infinity"||Hn.MINUS_INFINITY&e&&1{const g=i;let m=!1;for(i++;i{i++,f();const g={};try{for(;t[i]!=="}";){if(f(),i>=n&&Hn.OBJ&e)return g;const m=a();f(),i++;try{const v=o();Object.defineProperty(g,m,{value:v,writable:!0,enumerable:!0,configurable:!0})}catch(v){if(Hn.OBJ&e)return g;throw v}f(),t[i]===","&&i++}}catch{if(Hn.OBJ&e)return g;r("Expected '}' at end of object")}return i++,g},u=()=>{i++;const g=[];try{for(;t[i]!=="]";)g.push(o()),f(),t[i]===","&&i++}catch{if(Hn.ARR&e)return g;r("Expected ']' at end of array")}return i++,g},d=()=>{if(i===0){t==="-"&&Hn.NUM&e&&r("Not sure what '-' is");try{return JSON.parse(t)}catch(m){if(Hn.NUM&e)try{return t[t.length-1]==="."?JSON.parse(t.substring(0,t.lastIndexOf("."))):JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}s(String(m))}}const g=i;for(t[i]==="-"&&i++;t[i]&&!",]}".includes(t[i]);)i++;i==n&&!(Hn.NUM&e)&&r("Unterminated number literal");try{return JSON.parse(t.substring(g,i))}catch{t.substring(g,i)==="-"&&Hn.NUM&e&&r("Not sure what '-' is");try{return JSON.parse(t.substring(g,t.lastIndexOf("e")))}catch(v){s(String(v))}}},f=()=>{for(;iqme(t,Hn.ALL^Hn.NUM);var Dn,ea,qu,rl,qx,_0,Jx,Xx,Zx,T0,eE,xB;class pg extends oH{constructor(e){super(),Dn.add(this),ea.set(this,void 0),qu.set(this,void 0),rl.set(this,void 0),We(this,ea,e),We(this,qu,[])}get currentChatCompletionSnapshot(){return se(this,rl,"f")}static fromReadableStream(e){const n=new pg(null);return n._run(()=>n._fromReadableStream(e)),n}static createChatCompletion(e,n,i){const r=new pg(n);return r._run(()=>r._runChatCompletion(e,{...n,stream:!0},{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,n,i){super._createChatCompletion;const r=i?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),se(this,Dn,"m",qx).call(this);const s=await e.chat.completions.create({...n,stream:!0},{...i,signal:this.controller.signal});this._connected();for await(const o of s)se(this,Dn,"m",Jx).call(this,o);if(s.controller.signal?.aborted)throw new Wr;return this._addChatCompletion(se(this,Dn,"m",T0).call(this))}async _fromReadableStream(e,n){const i=n?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),se(this,Dn,"m",qx).call(this),this._connected();const r=fg.fromReadableStream(e,this.controller);let s;for await(const o of r)s&&s!==o.id&&this._addChatCompletion(se(this,Dn,"m",T0).call(this)),se(this,Dn,"m",Jx).call(this,o),s=o.id;if(r.controller.signal?.aborted)throw new Wr;return this._addChatCompletion(se(this,Dn,"m",T0).call(this))}[(ea=new WeakMap,qu=new WeakMap,rl=new WeakMap,Dn=new WeakSet,qx=function(){this.ended||We(this,rl,void 0)},_0=function(n){let i=se(this,qu,"f")[n.index];return i||(i={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},se(this,qu,"f")[n.index]=i,i)},Jx=function(n){if(this.ended)return;const i=se(this,Dn,"m",xB).call(this,n);this._emit("chunk",n,i);for(const r of n.choices){const s=i.choices[r.index];r.delta.content!=null&&s.message?.role==="assistant"&&s.message?.content&&(this._emit("content",r.delta.content,s.message.content),this._emit("content.delta",{delta:r.delta.content,snapshot:s.message.content,parsed:s.message.parsed})),r.delta.refusal!=null&&s.message?.role==="assistant"&&s.message?.refusal&&this._emit("refusal.delta",{delta:r.delta.refusal,snapshot:s.message.refusal}),r.logprobs?.content!=null&&s.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:r.logprobs?.content,snapshot:s.logprobs?.content??[]}),r.logprobs?.refusal!=null&&s.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:r.logprobs?.refusal,snapshot:s.logprobs?.refusal??[]});const o=se(this,Dn,"m",_0).call(this,s);s.finish_reason&&(se(this,Dn,"m",Zx).call(this,s),o.current_tool_call_index!=null&&se(this,Dn,"m",Xx).call(this,s,o.current_tool_call_index));for(const a of r.delta.tool_calls??[])o.current_tool_call_index!==a.index&&(se(this,Dn,"m",Zx).call(this,s),o.current_tool_call_index!=null&&se(this,Dn,"m",Xx).call(this,s,o.current_tool_call_index)),o.current_tool_call_index=a.index;for(const a of r.delta.tool_calls??[]){const l=s.message.tool_calls?.[a.index];l?.type&&(l?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:l.function?.name,index:a.index,arguments:l.function.arguments,parsed_arguments:l.function.parsed_arguments,arguments_delta:a.function?.arguments??""}):(l?.type,void 0))}}},Xx=function(n,i){if(se(this,Dn,"m",_0).call(this,n).done_tool_calls.has(i))return;const s=n.message.tool_calls?.[i];if(!s)throw new Error("no tool call snapshot");if(!s.type)throw new Error("tool call snapshot missing `type`");if(s.type==="function"){const o=se(this,ea,"f")?.tools?.find(a=>Tv(a)&&a.function.name===s.function.name);this._emit("tool_calls.function.arguments.done",{name:s.function.name,index:i,arguments:s.function.arguments,parsed_arguments:im(o)?o.$parseRaw(s.function.arguments):o?.function.strict?JSON.parse(s.function.arguments):null})}else s.type},Zx=function(n){const i=se(this,Dn,"m",_0).call(this,n);if(n.message.content&&!i.content_done){i.content_done=!0;const r=se(this,Dn,"m",eE).call(this);this._emit("content.done",{content:n.message.content,parsed:r?r.$parseRaw(n.message.content):null})}n.message.refusal&&!i.refusal_done&&(i.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!i.logprobs_content_done&&(i.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!i.logprobs_refusal_done&&(i.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},T0=function(){if(this.ended)throw new Ue("stream has ended, this shouldn't happen");const n=se(this,rl,"f");if(!n)throw new Ue("request ended without sending any chunks");return We(this,rl,void 0),We(this,qu,[]),Xme(n,se(this,ea,"f"))},eE=function(){const n=se(this,ea,"f")?.response_format;return oR(n)?n:null},xB=function(n){var i,r,s,o;let a=se(this,rl,"f");const{choices:l,...u}=n;a?Object.assign(a,u):a=We(this,rl,{...u,choices:[]});for(const{delta:d,finish_reason:f,index:g,logprobs:m=null,...v}of n.choices){let S=a.choices[g];if(S||(S=a.choices[g]={finish_reason:f,index:g,message:{},logprobs:m,...v}),m)if(!S.logprobs)S.logprobs=Object.assign({},m);else{const{content:P,refusal:N,...B}=m;Object.assign(S.logprobs,B),P&&((i=S.logprobs).content??(i.content=[]),S.logprobs.content.push(...P)),N&&((r=S.logprobs).refusal??(r.refusal=[]),S.logprobs.refusal.push(...N))}if(f&&(S.finish_reason=f,se(this,ea,"f")&&eH(se(this,ea,"f")))){if(f==="length")throw new N9;if(f==="content_filter")throw new O9}if(Object.assign(S,v),!d)continue;const{content:C,refusal:E,function_call:k,role:R,tool_calls:M,...D}=d;if(Object.assign(S.message,D),E&&(S.message.refusal=(S.message.refusal||"")+E),R&&(S.message.role=R),k&&(S.message.function_call?(k.name&&(S.message.function_call.name=k.name),k.arguments&&((s=S.message.function_call).arguments??(s.arguments=""),S.message.function_call.arguments+=k.arguments)):S.message.function_call=k),C&&(S.message.content=(S.message.content||"")+C,!S.message.refusal&&se(this,Dn,"m",eE).call(this)&&(S.message.parsed=CB(S.message.content))),M){S.message.tool_calls||(S.message.tool_calls=[]);for(const{index:P,id:N,type:B,function:G,...V}of M){const $=(o=S.message.tool_calls)[P]??(o[P]={});Object.assign($,V),N&&($.id=N),B&&($.type=B),G&&($.function??($.function={name:G.name??"",arguments:""})),G?.name&&($.function.name=G.name),G?.arguments&&($.function.arguments+=G.arguments,Qme(se(this,ea,"f"),$)&&($.function.parsed_arguments=CB($.function.arguments)))}}}return a},Symbol.asyncIterator)](){const e=[],n=[];let i=!1;return this.on("chunk",r=>{const s=n.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new fg(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function Xme(t,e){const{id:n,choices:i,created:r,model:s,system_fingerprint:o,...a}=t,l={...a,id:n,choices:i.map(({message:u,finish_reason:d,index:f,logprobs:g,...m})=>{if(!d)throw new Ue(`missing finish_reason for choice ${f}`);const{content:v=null,function_call:S,tool_calls:C,...E}=u,k=u.role;if(!k)throw new Ue(`missing role for choice ${f}`);if(S){const{arguments:R,name:M}=S;if(R==null)throw new Ue(`missing function_call.arguments for choice ${f}`);if(!M)throw new Ue(`missing function_call.name for choice ${f}`);return{...m,message:{content:v,function_call:{arguments:R,name:M},role:k,refusal:u.refusal??null},finish_reason:d,index:f,logprobs:g}}return C?{...m,index:f,finish_reason:d,logprobs:g,message:{...E,role:k,content:v,refusal:u.refusal??null,tool_calls:C.map((R,M)=>{const{function:D,type:P,id:N,...B}=R,{arguments:G,name:V,...$}=D||{};if(N==null)throw new Ue(`missing choices[${f}].tool_calls[${M}].id -${R0(t)}`);if(P==null)throw new Ue(`missing choices[${f}].tool_calls[${M}].type -${R0(t)}`);if(V==null)throw new Ue(`missing choices[${f}].tool_calls[${M}].function.name -${R0(t)}`);if(G==null)throw new Ue(`missing choices[${f}].tool_calls[${M}].function.arguments -${R0(t)}`);return{...B,id:N,type:P,function:{...$,name:V,arguments:G}}})}}:{...m,message:{...E,content:v,role:k,refusal:u.refusal??null},finish_reason:d,index:f,logprobs:g}}),created:r,model:s,object:"chat.completion",...o?{system_fingerprint:o}:{}};return Fme(l,e)}function R0(t){return JSON.stringify(t)}class Dv extends pg{static fromReadableStream(e){const n=new Dv(null);return n._run(()=>n._fromReadableStream(e)),n}static runTools(e,n,i){const r=new Dv(n),s={...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,n,s)),r}}let uR=class extends Ge{constructor(){super(...arguments),this.messages=new Z9(this._client)}create(e,n){return this._client.post("/chat/completions",{body:e,...n,stream:e.stream??!1})}retrieve(e,n){return this._client.get(we`/chat/completions/${e}`,n)}update(e,n,i){return this._client.post(we`/chat/completions/${e}`,{body:n,...i})}list(e={},n){return this._client.getAPIList("/chat/completions",xn,{query:e,...n})}delete(e,n){return this._client.delete(we`/chat/completions/${e}`,n)}parse(e,n){return Gme(e.tools),this._client.chat.completions.create(e,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(i=>aR(i,e))}runTools(e,n){return e.stream?Dv.runTools(this._client,e,n):cR.runTools(this._client,e,n)}stream(e,n){return pg.createChatCompletion(this._client,e,n)}};uR.Messages=Z9;let dR=class extends Ge{constructor(){super(...arguments),this.completions=new uR(this._client)}};dR.Completions=uR;const bH=Symbol("brand.privateNullableHeaders");function*Zme(t){if(!t)return;if(bH in t){const{values:i,nulls:r}=t;yield*i.entries();for(const s of r)yield[s,null];return}let e=!1,n;t instanceof Headers?n=t.entries():cB(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let i of n){const r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const s=cB(i[1])?i[1]:[i[1]];let o=!1;for(const a of s)a!==void 0&&(e&&!o&&(o=!0,yield[r,null]),yield[r,a])}}const Fe=t=>{const e=new Headers,n=new Set;for(const i of t){const r=new Set;for(const[s,o]of Zme(i)){const a=s.toLowerCase();r.has(a)||(e.delete(s),r.add(a)),o===null?(e.delete(s),n.add(a)):(e.append(s,o),n.delete(a))}}return{[bH]:!0,values:e,nulls:n}};class wH extends Ge{create(e,n){return this._client.post("/audio/speech",{body:e,...n,headers:Fe([{Accept:"application/octet-stream"},n?.headers]),__binaryResponse:!0})}}class SH extends Ge{create(e,n){return this._client.post("/audio/transcriptions",Lc({body:e,...n,stream:e.stream??!1,__metadata:{model:e.model}},this._client))}}class CH extends Ge{create(e,n){return this._client.post("/audio/translations",Lc({body:e,...n,__metadata:{model:e.model}},this._client))}}class rm extends Ge{constructor(){super(...arguments),this.transcriptions=new SH(this._client),this.translations=new CH(this._client),this.speech=new wH(this._client)}}rm.Transcriptions=SH;rm.Translations=CH;rm.Speech=wH;let xH=class extends Ge{create(e,n){return this._client.post("/batches",{body:e,...n})}retrieve(e,n){return this._client.get(we`/batches/${e}`,n)}list(e={},n){return this._client.getAPIList("/batches",xn,{query:e,...n})}cancel(e,n){return this._client.post(we`/batches/${e}/cancel`,n)}};class EH extends Ge{create(e,n){return this._client.post("/assistants",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,n){return this._client.get(we`/assistants/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,n,i){return this._client.post(we`/assistants/${e}`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e={},n){return this._client.getAPIList("/assistants",xn,{query:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(e,n){return this._client.delete(we`/assistants/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}class _H extends Ge{create(e,n){return this._client.post("/realtime/sessions",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}class TH extends Ge{create(e,n){return this._client.post("/realtime/transcription_sessions",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}let cw=class extends Ge{constructor(){super(...arguments),this.sessions=new _H(this._client),this.transcriptionSessions=new TH(this._client)}};cw.Sessions=_H;cw.TranscriptionSessions=TH;class RH extends Ge{create(e,n,i){return this._client.post(we`/threads/${e}/messages`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}retrieve(e,n,i){const{thread_id:r}=n;return this._client.get(we`/threads/${r}/messages/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}update(e,n,i){const{thread_id:r,...s}=n;return this._client.post(we`/threads/${r}/messages/${e}`,{body:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e,n={},i){return this._client.getAPIList(we`/threads/${e}/messages`,xn,{query:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}delete(e,n,i){const{thread_id:r}=n;return this._client.delete(we`/threads/${r}/messages/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}}class kH extends Ge{retrieve(e,n,i){const{thread_id:r,run_id:s,...o}=n;return this._client.get(we`/threads/${r}/runs/${s}/steps/${e}`,{query:o,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e,n,i){const{thread_id:r,...s}=n;return this._client.getAPIList(we`/threads/${r}/runs/${e}/steps`,xn,{query:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}}const eAe=t=>{if(typeof Buffer<"u"){const e=Buffer.from(t,"base64");return Array.from(new Float32Array(e.buffer,e.byteOffset,e.length/Float32Array.BYTES_PER_ELEMENT))}else{const e=atob(t),n=e.length,i=new Uint8Array(n);for(let r=0;r{if(typeof globalThis.process<"u")return tAe?.[t]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()};var ti,xc,c_,io,Fy,ms,Ec,gd,bc,Pv,vr,Hy,zy,Op,vp,bp,EB,_B,TB,RB,kB,IB,MB;class Bp extends lR{constructor(){super(...arguments),ti.add(this),c_.set(this,[]),io.set(this,{}),Fy.set(this,{}),ms.set(this,void 0),Ec.set(this,void 0),gd.set(this,void 0),bc.set(this,void 0),Pv.set(this,void 0),vr.set(this,void 0),Hy.set(this,void 0),zy.set(this,void 0),Op.set(this,void 0)}[(c_=new WeakMap,io=new WeakMap,Fy=new WeakMap,ms=new WeakMap,Ec=new WeakMap,gd=new WeakMap,bc=new WeakMap,Pv=new WeakMap,vr=new WeakMap,Hy=new WeakMap,zy=new WeakMap,Op=new WeakMap,ti=new WeakSet,Symbol.asyncIterator)](){const e=[],n=[];let i=!1;return this.on("event",r=>{const s=n.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){const n=new xc;return n._run(()=>n._fromReadableStream(e)),n}async _fromReadableStream(e,n){const i=n?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),this._connected();const r=fg.fromReadableStream(e,this.controller);for await(const s of r)se(this,ti,"m",vp).call(this,s);if(r.controller.signal?.aborted)throw new Wr;return this._addRun(se(this,ti,"m",bp).call(this))}toReadableStream(){return new fg(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,n,i,r){const s=new xc;return s._run(()=>s._runToolAssistantStream(e,n,i,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createToolAssistantStream(e,n,i,r){const s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));const o={...i,stream:!0},a=await e.submitToolOutputs(n,o,{...r,signal:this.controller.signal});this._connected();for await(const l of a)se(this,ti,"m",vp).call(this,l);if(a.controller.signal?.aborted)throw new Wr;return this._addRun(se(this,ti,"m",bp).call(this))}static createThreadAssistantStream(e,n,i){const r=new xc;return r._run(()=>r._threadAssistantStream(e,n,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),r}static createAssistantStream(e,n,i,r){const s=new xc;return s._run(()=>s._runAssistantStream(e,n,i,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}currentEvent(){return se(this,Hy,"f")}currentRun(){return se(this,zy,"f")}currentMessageSnapshot(){return se(this,ms,"f")}currentRunStepSnapshot(){return se(this,Op,"f")}async finalRunSteps(){return await this.done(),Object.values(se(this,io,"f"))}async finalMessages(){return await this.done(),Object.values(se(this,Fy,"f"))}async finalRun(){if(await this.done(),!se(this,Ec,"f"))throw Error("Final run was not received.");return se(this,Ec,"f")}async _createThreadAssistantStream(e,n,i){const r=i?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));const s={...n,stream:!0},o=await e.createAndRun(s,{...i,signal:this.controller.signal});this._connected();for await(const a of o)se(this,ti,"m",vp).call(this,a);if(o.controller.signal?.aborted)throw new Wr;return this._addRun(se(this,ti,"m",bp).call(this))}async _createAssistantStream(e,n,i,r){const s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));const o={...i,stream:!0},a=await e.create(n,o,{...r,signal:this.controller.signal});this._connected();for await(const l of a)se(this,ti,"m",vp).call(this,l);if(a.controller.signal?.aborted)throw new Wr;return this._addRun(se(this,ti,"m",bp).call(this))}static accumulateDelta(e,n){for(const[i,r]of Object.entries(n)){if(!e.hasOwnProperty(i)){e[i]=r;continue}let s=e[i];if(s==null){e[i]=r;continue}if(i==="index"||i==="type"){e[i]=r;continue}if(typeof s=="string"&&typeof r=="string")s+=r;else if(typeof s=="number"&&typeof r=="number")s+=r;else if(jx(s)&&jx(r))s=this.accumulateDelta(s,r);else if(Array.isArray(s)&&Array.isArray(r)){if(s.every(o=>typeof o=="string"||typeof o=="number")){s.push(...r);continue}for(const o of r){if(!jx(o))throw new Error(`Expected array delta entry to be an object but got: ${o}`);const a=o.index;if(a==null)throw console.error(o),new Error("Expected array delta entry to have an `index` property");if(typeof a!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${a}`);const l=s[a];l==null?s.push(o):s[a]=this.accumulateDelta(l,o)}continue}else throw Error(`Unhandled record type: ${i}, deltaValue: ${r}, accValue: ${s}`);e[i]=s}return e}_addRun(e){return e}async _threadAssistantStream(e,n,i){return await this._createThreadAssistantStream(n,e,i)}async _runAssistantStream(e,n,i,r){return await this._createAssistantStream(n,e,i,r)}async _runToolAssistantStream(e,n,i,r){return await this._createToolAssistantStream(n,e,i,r)}}xc=Bp,vp=function(e){if(!this.ended)switch(We(this,Hy,e),se(this,ti,"m",TB).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":se(this,ti,"m",MB).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":se(this,ti,"m",_B).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":se(this,ti,"m",EB).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},bp=function(){if(this.ended)throw new Ue("stream has ended, this shouldn't happen");if(!se(this,Ec,"f"))throw Error("Final run has not been received");return se(this,Ec,"f")},EB=function(e){const[n,i]=se(this,ti,"m",kB).call(this,e,se(this,ms,"f"));We(this,ms,n),se(this,Fy,"f")[n.id]=n;for(const r of i){const s=n.content[r.index];s?.type=="text"&&this._emit("textCreated",s.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,n),e.data.delta.content)for(const r of e.data.delta.content){if(r.type=="text"&&r.text){let s=r.text,o=n.content[r.index];if(o&&o.type=="text")this._emit("textDelta",s,o.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(r.index!=se(this,gd,"f")){if(se(this,bc,"f"))switch(se(this,bc,"f").type){case"text":this._emit("textDone",se(this,bc,"f").text,se(this,ms,"f"));break;case"image_file":this._emit("imageFileDone",se(this,bc,"f").image_file,se(this,ms,"f"));break}We(this,gd,r.index)}We(this,bc,n.content[r.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(se(this,gd,"f")!==void 0){const r=e.data.content[se(this,gd,"f")];if(r)switch(r.type){case"image_file":this._emit("imageFileDone",r.image_file,se(this,ms,"f"));break;case"text":this._emit("textDone",r.text,se(this,ms,"f"));break}}se(this,ms,"f")&&this._emit("messageDone",e.data),We(this,ms,void 0)}},_B=function(e){const n=se(this,ti,"m",RB).call(this,e);switch(We(this,Op,n),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":const i=e.data.delta;if(i.step_details&&i.step_details.type=="tool_calls"&&i.step_details.tool_calls&&n.step_details.type=="tool_calls")for(const s of i.step_details.tool_calls)s.index==se(this,Pv,"f")?this._emit("toolCallDelta",s,n.step_details.tool_calls[s.index]):(se(this,vr,"f")&&this._emit("toolCallDone",se(this,vr,"f")),We(this,Pv,s.index),We(this,vr,n.step_details.tool_calls[s.index]),se(this,vr,"f")&&this._emit("toolCallCreated",se(this,vr,"f")));this._emit("runStepDelta",e.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":We(this,Op,void 0),e.data.step_details.type=="tool_calls"&&se(this,vr,"f")&&(this._emit("toolCallDone",se(this,vr,"f")),We(this,vr,void 0)),this._emit("runStepDone",e.data,n);break}},TB=function(e){se(this,c_,"f").push(e),this._emit("event",e)},RB=function(e){switch(e.event){case"thread.run.step.created":return se(this,io,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let n=se(this,io,"f")[e.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let i=e.data;if(i.delta){const r=xc.accumulateDelta(n,i.delta);se(this,io,"f")[e.data.id]=r}return se(this,io,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":se(this,io,"f")[e.data.id]=e.data;break}if(se(this,io,"f")[e.data.id])return se(this,io,"f")[e.data.id];throw new Error("No snapshot available")},kB=function(e,n){let i=[];switch(e.event){case"thread.message.created":return[e.data,i];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let r=e.data;if(r.delta.content)for(const s of r.delta.content)if(s.index in n.content){let o=n.content[s.index];n.content[s.index]=se(this,ti,"m",IB).call(this,s,o)}else n.content[s.index]=s,i.push(s);return[n,i];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,i];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},IB=function(e,n){return xc.accumulateDelta(n,e)},MB=function(e){switch(We(this,zy,e.data),e.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":We(this,Ec,e.data),se(this,vr,"f")&&(this._emit("toolCallDone",se(this,vr,"f")),We(this,vr,void 0));break}};let hR=class extends Ge{constructor(){super(...arguments),this.steps=new kH(this._client)}create(e,n,i){const{include:r,...s}=n;return this._client.post(we`/threads/${e}/runs`,{query:{include:r},body:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers]),stream:n.stream??!1})}retrieve(e,n,i){const{thread_id:r}=n;return this._client.get(we`/threads/${r}/runs/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}update(e,n,i){const{thread_id:r,...s}=n;return this._client.post(we`/threads/${r}/runs/${e}`,{body:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e,n={},i){return this._client.getAPIList(we`/threads/${e}/runs`,xn,{query:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}cancel(e,n,i){const{thread_id:r}=n;return this._client.post(we`/threads/${r}/runs/${e}/cancel`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}async createAndPoll(e,n,i){const r=await this.create(e,n,i);return await this.poll(r.id,{thread_id:e},i)}createAndStream(e,n,i){return Bp.createAssistantStream(e,this._client.beta.threads.runs,n,i)}async poll(e,n,i){const r=Fe([i?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":i?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:s,response:o}=await this.retrieve(e,n,{...i,headers:{...i?.headers,...r}}).withResponse();switch(s.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(i?.pollIntervalMs)a=i.pollIntervalMs;else{const l=o.headers.get("openai-poll-after-ms");if(l){const u=parseInt(l);isNaN(u)||(a=u)}}await nm(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return s}}}stream(e,n,i){return Bp.createAssistantStream(e,this._client.beta.threads.runs,n,i)}submitToolOutputs(e,n,i){const{thread_id:r,...s}=n;return this._client.post(we`/threads/${r}/runs/${e}/submit_tool_outputs`,{body:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers]),stream:n.stream??!1})}async submitToolOutputsAndPoll(e,n,i){const r=await this.submitToolOutputs(e,n,i);return await this.poll(r.id,n,i)}submitToolOutputsStream(e,n,i){return Bp.createToolAssistantStream(e,this._client.beta.threads.runs,n,i)}};hR.Steps=kH;class uw extends Ge{constructor(){super(...arguments),this.runs=new hR(this._client),this.messages=new RH(this._client)}create(e={},n){return this._client.post("/threads",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,n){return this._client.get(we`/threads/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,n,i){return this._client.post(we`/threads/${e}`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}delete(e,n){return this._client.delete(we`/threads/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}createAndRun(e,n){return this._client.post("/threads/runs",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:e.stream??!1})}async createAndRunPoll(e,n){const i=await this.createAndRun(e,n);return await this.runs.poll(i.id,{thread_id:i.thread_id},n)}createAndRunStream(e,n){return Bp.createThreadAssistantStream(e,this._client.beta.threads,n)}}uw.Runs=hR;uw.Messages=RH;class sm extends Ge{constructor(){super(...arguments),this.realtime=new cw(this._client),this.assistants=new EH(this._client),this.threads=new uw(this._client)}}sm.Realtime=cw;sm.Assistants=EH;sm.Threads=uw;class IH extends Ge{create(e,n){return this._client.post("/completions",{body:e,...n,stream:e.stream??!1})}}let MH=class extends Ge{retrieve(e,n,i){const{container_id:r}=n;return this._client.get(we`/containers/${r}/files/${e}/content`,{...i,headers:Fe([{Accept:"application/binary"},i?.headers]),__binaryResponse:!0})}},fR=class extends Ge{constructor(){super(...arguments),this.content=new MH(this._client)}create(e,n,i){return this._client.post(we`/containers/${e}/files`,Lc({body:n,...i},this._client))}retrieve(e,n,i){const{container_id:r}=n;return this._client.get(we`/containers/${r}/files/${e}`,i)}list(e,n={},i){return this._client.getAPIList(we`/containers/${e}/files`,xn,{query:n,...i})}delete(e,n,i){const{container_id:r}=n;return this._client.delete(we`/containers/${r}/files/${e}`,{...i,headers:Fe([{Accept:"*/*"},i?.headers])})}};fR.Content=MH;class pR extends Ge{constructor(){super(...arguments),this.files=new fR(this._client)}create(e,n){return this._client.post("/containers",{body:e,...n})}retrieve(e,n){return this._client.get(we`/containers/${e}`,n)}list(e={},n){return this._client.getAPIList("/containers",xn,{query:e,...n})}delete(e,n){return this._client.delete(we`/containers/${e}`,{...n,headers:Fe([{Accept:"*/*"},n?.headers])})}}pR.Files=fR;class DH extends Ge{create(e,n,i){const{include:r,...s}=n;return this._client.post(we`/conversations/${e}/items`,{query:{include:r},body:s,...i})}retrieve(e,n,i){const{conversation_id:r,...s}=n;return this._client.get(we`/conversations/${r}/items/${e}`,{query:s,...i})}list(e,n={},i){return this._client.getAPIList(we`/conversations/${e}/items`,Mme,{query:n,...i})}delete(e,n,i){const{conversation_id:r}=n;return this._client.delete(we`/conversations/${r}/items/${e}`,i)}}class gR extends Ge{constructor(){super(...arguments),this.items=new DH(this._client)}create(e={},n){return this._client.post("/conversations",{body:e,...n})}retrieve(e,n){return this._client.get(we`/conversations/${e}`,n)}update(e,n,i){return this._client.post(we`/conversations/${e}`,{body:n,...i})}delete(e,n){return this._client.delete(we`/conversations/${e}`,n)}}gR.Items=DH;class PH extends Ge{create(e,n){const i=!!e.encoding_format;let r=i?e.encoding_format:"base64";i&&Zn(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);const s=this._client.post("/embeddings",{body:{...e,encoding_format:r},...n});return i?s:(Zn(this._client).debug("embeddings/decoding base64 embeddings from base64"),s._thenUnwrap(o=>(o&&o.data&&o.data.forEach(a=>{const l=a.embedding;a.embedding=eAe(l)}),o)))}}class NH extends Ge{retrieve(e,n,i){const{eval_id:r,run_id:s}=n;return this._client.get(we`/evals/${r}/runs/${s}/output_items/${e}`,i)}list(e,n,i){const{eval_id:r,...s}=n;return this._client.getAPIList(we`/evals/${r}/runs/${e}/output_items`,xn,{query:s,...i})}}class mR extends Ge{constructor(){super(...arguments),this.outputItems=new NH(this._client)}create(e,n,i){return this._client.post(we`/evals/${e}/runs`,{body:n,...i})}retrieve(e,n,i){const{eval_id:r}=n;return this._client.get(we`/evals/${r}/runs/${e}`,i)}list(e,n={},i){return this._client.getAPIList(we`/evals/${e}/runs`,xn,{query:n,...i})}delete(e,n,i){const{eval_id:r}=n;return this._client.delete(we`/evals/${r}/runs/${e}`,i)}cancel(e,n,i){const{eval_id:r}=n;return this._client.post(we`/evals/${r}/runs/${e}`,i)}}mR.OutputItems=NH;class AR extends Ge{constructor(){super(...arguments),this.runs=new mR(this._client)}create(e,n){return this._client.post("/evals",{body:e,...n})}retrieve(e,n){return this._client.get(we`/evals/${e}`,n)}update(e,n,i){return this._client.post(we`/evals/${e}`,{body:n,...i})}list(e={},n){return this._client.getAPIList("/evals",xn,{query:e,...n})}delete(e,n){return this._client.delete(we`/evals/${e}`,n)}}AR.Runs=mR;let OH=class extends Ge{create(e,n){return this._client.post("/files",Lc({body:e,...n},this._client))}retrieve(e,n){return this._client.get(we`/files/${e}`,n)}list(e={},n){return this._client.getAPIList("/files",xn,{query:e,...n})}delete(e,n){return this._client.delete(we`/files/${e}`,n)}content(e,n){return this._client.get(we`/files/${e}/content`,{...n,headers:Fe([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}async waitForProcessing(e,{pollInterval:n=5e3,maxWait:i=1800*1e3}={}){const r=new Set(["processed","error","deleted"]),s=Date.now();let o=await this.retrieve(e);for(;!o.status||!r.has(o.status);)if(await nm(n),o=await this.retrieve(e),Date.now()-s>i)throw new iR({message:`Giving up on waiting for file ${e} to finish processing after ${i} milliseconds.`});return o}};class BH extends Ge{}let LH=class extends Ge{run(e,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...n})}validate(e,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...n})}};class yR extends Ge{constructor(){super(...arguments),this.graders=new LH(this._client)}}yR.Graders=LH;class UH extends Ge{create(e,n,i){return this._client.getAPIList(we`/fine_tuning/checkpoints/${e}/permissions`,lw,{body:n,method:"post",...i})}retrieve(e,n={},i){return this._client.get(we`/fine_tuning/checkpoints/${e}/permissions`,{query:n,...i})}delete(e,n,i){const{fine_tuned_model_checkpoint:r}=n;return this._client.delete(we`/fine_tuning/checkpoints/${r}/permissions/${e}`,i)}}let vR=class extends Ge{constructor(){super(...arguments),this.permissions=new UH(this._client)}};vR.Permissions=UH;class VH extends Ge{list(e,n={},i){return this._client.getAPIList(we`/fine_tuning/jobs/${e}/checkpoints`,xn,{query:n,...i})}}class bR extends Ge{constructor(){super(...arguments),this.checkpoints=new VH(this._client)}create(e,n){return this._client.post("/fine_tuning/jobs",{body:e,...n})}retrieve(e,n){return this._client.get(we`/fine_tuning/jobs/${e}`,n)}list(e={},n){return this._client.getAPIList("/fine_tuning/jobs",xn,{query:e,...n})}cancel(e,n){return this._client.post(we`/fine_tuning/jobs/${e}/cancel`,n)}listEvents(e,n={},i){return this._client.getAPIList(we`/fine_tuning/jobs/${e}/events`,xn,{query:n,...i})}pause(e,n){return this._client.post(we`/fine_tuning/jobs/${e}/pause`,n)}resume(e,n){return this._client.post(we`/fine_tuning/jobs/${e}/resume`,n)}}bR.Checkpoints=VH;class gh extends Ge{constructor(){super(...arguments),this.methods=new BH(this._client),this.jobs=new bR(this._client),this.checkpoints=new vR(this._client),this.alpha=new yR(this._client)}}gh.Methods=BH;gh.Jobs=bR;gh.Checkpoints=vR;gh.Alpha=yR;class FH extends Ge{}class wR extends Ge{constructor(){super(...arguments),this.graderModels=new FH(this._client)}}wR.GraderModels=FH;class HH extends Ge{createVariation(e,n){return this._client.post("/images/variations",Lc({body:e,...n},this._client))}edit(e,n){return this._client.post("/images/edits",Lc({body:e,...n,stream:e.stream??!1},this._client))}generate(e,n){return this._client.post("/images/generations",{body:e,...n,stream:e.stream??!1})}}let zH=class extends Ge{retrieve(e,n){return this._client.get(we`/models/${e}`,n)}list(e){return this._client.getAPIList("/models",lw,e)}delete(e,n){return this._client.delete(we`/models/${e}`,n)}};class QH extends Ge{create(e,n){return this._client.post("/moderations",{body:e,...n})}}class GH extends Ge{create(e,n){return this._client.post("/realtime/client_secrets",{body:e,...n})}}class SR extends Ge{constructor(){super(...arguments),this.clientSecrets=new GH(this._client)}}SR.ClientSecrets=GH;function nAe(t,e){return!e||!rAe(e)?{...t,output_parsed:null,output:t.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(i=>({...i,parsed:null}))}:n)}:$H(t,e)}function $H(t,e){const n=t.output.map(r=>{if(r.type==="function_call")return{...r,parsed_arguments:aAe(e,r)};if(r.type==="message"){const s=r.content.map(o=>o.type==="output_text"?{...o,parsed:iAe(e,o.text)}:o);return{...r,content:s}}return r}),i=Object.assign({},t,{output:n});return Object.getOwnPropertyDescriptor(t,"output_text")||u_(i),Object.defineProperty(i,"output_parsed",{enumerable:!0,get(){for(const r of i.output)if(r.type==="message"){for(const s of r.content)if(s.type==="output_text"&&s.parsed!==null)return s.parsed}return null}}),i}function iAe(t,e){return t.text?.format?.type!=="json_schema"?null:"$parseRaw"in t.text?.format?(t.text?.format).$parseRaw(e):JSON.parse(e)}function rAe(t){return!!oR(t.text?.format)}function sAe(t){return t?.$brand==="auto-parseable-tool"}function oAe(t,e){return t.find(n=>n.type==="function"&&n.name===e)}function aAe(t,e){const n=oAe(t.tools??[],e.name);return{...e,...e,parsed_arguments:sAe(n)?n.$parseRaw(e.arguments):n?.strict?JSON.parse(e.arguments):null}}function u_(t){const e=[];for(const n of t.output)if(n.type==="message")for(const i of n.content)i.type==="output_text"&&e.push(i.text);t.output_text=e.join("")}var Xu,k0,sl,I0,DB,PB,NB,OB;class CR extends lR{constructor(e){super(),Xu.add(this),k0.set(this,void 0),sl.set(this,void 0),I0.set(this,void 0),We(this,k0,e)}static createResponse(e,n,i){const r=new CR(n);return r._run(()=>r._createOrRetrieveResponse(e,n,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createOrRetrieveResponse(e,n,i){const r=i?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),se(this,Xu,"m",DB).call(this);let s,o=null;"response_id"in n?(s=await e.responses.retrieve(n.response_id,{stream:!0},{...i,signal:this.controller.signal,stream:!0}),o=n.starting_after??null):s=await e.responses.create({...n,stream:!0},{...i,signal:this.controller.signal}),this._connected();for await(const a of s)se(this,Xu,"m",PB).call(this,a,o);if(s.controller.signal?.aborted)throw new Wr;return se(this,Xu,"m",NB).call(this)}[(k0=new WeakMap,sl=new WeakMap,I0=new WeakMap,Xu=new WeakSet,DB=function(){this.ended||We(this,sl,void 0)},PB=function(n,i){if(this.ended)return;const r=(o,a)=>{(i==null||a.sequence_number>i)&&this._emit(o,a)},s=se(this,Xu,"m",OB).call(this,n);switch(r("event",n),n.type){case"response.output_text.delta":{const o=s.output[n.output_index];if(!o)throw new Ue(`missing output at index ${n.output_index}`);if(o.type==="message"){const a=o.content[n.content_index];if(!a)throw new Ue(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new Ue(`expected content to be 'output_text', got ${a.type}`);r("response.output_text.delta",{...n,snapshot:a.text})}break}case"response.function_call_arguments.delta":{const o=s.output[n.output_index];if(!o)throw new Ue(`missing output at index ${n.output_index}`);o.type==="function_call"&&r("response.function_call_arguments.delta",{...n,snapshot:o.arguments});break}default:r(n.type,n);break}},NB=function(){if(this.ended)throw new Ue("stream has ended, this shouldn't happen");const n=se(this,sl,"f");if(!n)throw new Ue("request ended without sending any events");We(this,sl,void 0);const i=lAe(n,se(this,k0,"f"));return We(this,I0,i),i},OB=function(n){let i=se(this,sl,"f");if(!i){if(n.type!=="response.created")throw new Ue(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return i=We(this,sl,n.response),i}switch(n.type){case"response.output_item.added":{i.output.push(n.item);break}case"response.content_part.added":{const r=i.output[n.output_index];if(!r)throw new Ue(`missing output at index ${n.output_index}`);const s=r.type,o=n.part;s==="message"&&o.type!=="reasoning_text"?r.content.push(o):s==="reasoning"&&o.type==="reasoning_text"&&(r.content||(r.content=[]),r.content.push(o));break}case"response.output_text.delta":{const r=i.output[n.output_index];if(!r)throw new Ue(`missing output at index ${n.output_index}`);if(r.type==="message"){const s=r.content[n.content_index];if(!s)throw new Ue(`missing content at index ${n.content_index}`);if(s.type!=="output_text")throw new Ue(`expected content to be 'output_text', got ${s.type}`);s.text+=n.delta}break}case"response.function_call_arguments.delta":{const r=i.output[n.output_index];if(!r)throw new Ue(`missing output at index ${n.output_index}`);r.type==="function_call"&&(r.arguments+=n.delta);break}case"response.reasoning_text.delta":{const r=i.output[n.output_index];if(!r)throw new Ue(`missing output at index ${n.output_index}`);if(r.type==="reasoning"){const s=r.content?.[n.content_index];if(!s)throw new Ue(`missing content at index ${n.content_index}`);if(s.type!=="reasoning_text")throw new Ue(`expected content to be 'reasoning_text', got ${s.type}`);s.text+=n.delta}break}case"response.completed":{We(this,sl,n.response);break}}return i},Symbol.asyncIterator)](){const e=[],n=[];let i=!1;return this.on("event",r=>{const s=n.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(const s of n)s.reject(r);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>n.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const e=se(this,I0,"f");if(!e)throw new Ue("stream ended without producing a ChatCompletion");return e}}function lAe(t,e){return nAe(t,e)}class WH extends Ge{list(e,n={},i){return this._client.getAPIList(we`/responses/${e}/input_items`,xn,{query:n,...i})}}class xR extends Ge{constructor(){super(...arguments),this.inputItems=new WH(this._client)}create(e,n){return this._client.post("/responses",{body:e,...n,stream:e.stream??!1})._thenUnwrap(i=>("object"in i&&i.object==="response"&&u_(i),i))}retrieve(e,n={},i){return this._client.get(we`/responses/${e}`,{query:n,...i,stream:n?.stream??!1})._thenUnwrap(r=>("object"in r&&r.object==="response"&&u_(r),r))}delete(e,n){return this._client.delete(we`/responses/${e}`,{...n,headers:Fe([{Accept:"*/*"},n?.headers])})}parse(e,n){return this._client.responses.create(e,n)._thenUnwrap(i=>$H(i,e))}stream(e,n){return CR.createResponse(this._client,e,n)}cancel(e,n){return this._client.post(we`/responses/${e}/cancel`,n)}}xR.InputItems=WH;class jH extends Ge{create(e,n,i){return this._client.post(we`/uploads/${e}/parts`,Lc({body:n,...i},this._client))}}class ER extends Ge{constructor(){super(...arguments),this.parts=new jH(this._client)}create(e,n){return this._client.post("/uploads",{body:e,...n})}cancel(e,n){return this._client.post(we`/uploads/${e}/cancel`,n)}complete(e,n,i){return this._client.post(we`/uploads/${e}/complete`,{body:n,...i})}}ER.Parts=jH;const cAe=async t=>{const e=await Promise.allSettled(t),n=e.filter(r=>r.status==="rejected");if(n.length){for(const r of n)console.error(r.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}const i=[];for(const r of e)r.status==="fulfilled"&&i.push(r.value);return i};class KH extends Ge{create(e,n,i){return this._client.post(we`/vector_stores/${e}/file_batches`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}retrieve(e,n,i){const{vector_store_id:r}=n;return this._client.get(we`/vector_stores/${r}/file_batches/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}cancel(e,n,i){const{vector_store_id:r}=n;return this._client.post(we`/vector_stores/${r}/file_batches/${e}/cancel`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}async createAndPoll(e,n,i){const r=await this.create(e,n);return await this.poll(e,r.id,i)}listFiles(e,n,i){const{vector_store_id:r,...s}=n;return this._client.getAPIList(we`/vector_stores/${r}/file_batches/${e}/files`,xn,{query:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}async poll(e,n,i){const r=Fe([i?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":i?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:s,response:o}=await this.retrieve(n,{vector_store_id:e},{...i,headers:r}).withResponse();switch(s.status){case"in_progress":let a=5e3;if(i?.pollIntervalMs)a=i.pollIntervalMs;else{const l=o.headers.get("openai-poll-after-ms");if(l){const u=parseInt(l);isNaN(u)||(a=u)}}await nm(a);break;case"failed":case"cancelled":case"completed":return s}}}async uploadAndPoll(e,{files:n,fileIds:i=[]},r){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const s=r?.maxConcurrency??5,o=Math.min(s,n.length),a=this._client,l=n.values(),u=[...i];async function d(g){for(let m of g){const v=await a.files.create({file:m,purpose:"assistants"},r);u.push(v.id)}}const f=Array(o).fill(l).map(d);return await cAe(f),await this.createAndPoll(e,{file_ids:u})}}let YH=class extends Ge{create(e,n,i){return this._client.post(we`/vector_stores/${e}/files`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}retrieve(e,n,i){const{vector_store_id:r}=n;return this._client.get(we`/vector_stores/${r}/files/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}update(e,n,i){const{vector_store_id:r,...s}=n;return this._client.post(we`/vector_stores/${r}/files/${e}`,{body:s,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e,n={},i){return this._client.getAPIList(we`/vector_stores/${e}/files`,xn,{query:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}delete(e,n,i){const{vector_store_id:r}=n;return this._client.delete(we`/vector_stores/${r}/files/${e}`,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}async createAndPoll(e,n,i){const r=await this.create(e,n,i);return await this.poll(e,r.id,i)}async poll(e,n,i){const r=Fe([i?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":i?.pollIntervalMs?.toString()??void 0}]);for(;;){const s=await this.retrieve(n,{vector_store_id:e},{...i,headers:r}).withResponse(),o=s.data;switch(o.status){case"in_progress":let a=5e3;if(i?.pollIntervalMs)a=i.pollIntervalMs;else{const l=s.response.headers.get("openai-poll-after-ms");if(l){const u=parseInt(l);isNaN(u)||(a=u)}}await nm(a);break;case"failed":case"completed":return o}}}async upload(e,n,i){const r=await this._client.files.create({file:n,purpose:"assistants"},i);return this.create(e,{file_id:r.id},i)}async uploadAndPoll(e,n,i){const r=await this.upload(e,n,i);return await this.poll(e,r.id,i)}content(e,n,i){const{vector_store_id:r}=n;return this._client.getAPIList(we`/vector_stores/${r}/files/${e}/content`,lw,{...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}};class dw extends Ge{constructor(){super(...arguments),this.files=new YH(this._client),this.fileBatches=new KH(this._client)}create(e,n){return this._client.post("/vector_stores",{body:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,n){return this._client.get(we`/vector_stores/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,n,i){return this._client.post(we`/vector_stores/${e}`,{body:n,...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}list(e={},n){return this._client.getAPIList("/vector_stores",xn,{query:e,...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(e,n){return this._client.delete(we`/vector_stores/${e}`,{...n,headers:Fe([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}search(e,n,i){return this._client.getAPIList(we`/vector_stores/${e}/search`,lw,{body:n,method:"post",...i,headers:Fe([{"OpenAI-Beta":"assistants=v2"},i?.headers])})}}dw.Files=YH;dw.FileBatches=KH;var ud,qH,Qy;class JH extends Ge{constructor(){super(...arguments),ud.add(this)}async unwrap(e,n,i=this._client.webhookSecret,r=300){return await this.verifySignature(e,n,i,r),JSON.parse(e)}async verifySignature(e,n,i=this._client.webhookSecret,r=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");se(this,ud,"m",qH).call(this,i);const s=Fe([n]).values,o=se(this,ud,"m",Qy).call(this,s,"webhook-signature"),a=se(this,ud,"m",Qy).call(this,s,"webhook-timestamp"),l=se(this,ud,"m",Qy).call(this,s,"webhook-id"),u=parseInt(a,10);if(isNaN(u))throw new dp("Invalid webhook timestamp format");const d=Math.floor(Date.now()/1e3);if(d-u>r)throw new dp("Webhook timestamp is too old");if(u>d+r)throw new dp("Webhook timestamp is too new");const f=o.split(" ").map(S=>S.startsWith("v1,")?S.substring(3):S),g=i.startsWith("whsec_")?Buffer.from(i.replace("whsec_",""),"base64"):Buffer.from(i,"utf-8"),m=l?`${l}.${a}.${e}`:`${a}.${e}`,v=await crypto.subtle.importKey("raw",g,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(const S of f)try{const C=Buffer.from(S,"base64");if(await crypto.subtle.verify("HMAC",v,C,new TextEncoder().encode(m)))return}catch{continue}throw new dp("The given webhook signature does not match the expected signature")}}ud=new WeakSet,qH=function(e){if(typeof e!="string"||e.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},Qy=function(e,n){if(!e)throw new Error("Headers are required");const i=e.get(n);if(i==null)throw new Error(`Missing required header: ${n}`);return i};var d_,_R,Gy,XH;class ot{constructor({baseURL:e=Ju("OPENAI_BASE_URL"),apiKey:n=Ju("OPENAI_API_KEY"),organization:i=Ju("OPENAI_ORG_ID")??null,project:r=Ju("OPENAI_PROJECT_ID")??null,webhookSecret:s=Ju("OPENAI_WEBHOOK_SECRET")??null,...o}={}){if(d_.add(this),Gy.set(this,void 0),this.completions=new IH(this),this.chat=new dR(this),this.embeddings=new PH(this),this.files=new OH(this),this.images=new HH(this),this.audio=new rm(this),this.moderations=new QH(this),this.models=new zH(this),this.fineTuning=new gh(this),this.graders=new wR(this),this.vectorStores=new dw(this),this.webhooks=new JH(this),this.beta=new sm(this),this.batches=new xH(this),this.uploads=new ER(this),this.responses=new xR(this),this.realtime=new SR(this),this.conversations=new gR(this),this.evals=new AR(this),this.containers=new pR(this),n===void 0)throw new Ue("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const a={apiKey:n,organization:i,project:r,webhookSecret:s,...o,baseURL:e||"https://api.openai.com/v1"};if(!a.dangerouslyAllowBrowser&&lme())throw new Ue(`It looks like you're running in a browser-like environment. +${s} +${l}`)}return s},Le=e2e(_re);let vre=class extends pt{list(t,n={},o){return this._client.getAPIList(Le`/chat/completions/${t}/messages`,or,{query:n,...o})}};function uE(e){return e!==void 0&&"function"in e&&e.function!==void 0}function ox(e){return e?.$brand==="auto-parseable-response-format"}function NC(e){return e?.$brand==="auto-parseable-tool"}function t2e(e,t){return!t||!Sre(t)?{...e,choices:e.choices.map(n=>(Cre(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:ix(e,t)}function ix(e,t){const n=e.choices.map(o=>{if(o.finish_reason==="length")throw new nre;if(o.finish_reason==="content_filter")throw new rre;return Cre(o.message.tool_calls),{...o,message:{...o.message,...o.message.tool_calls?{tool_calls:o.message.tool_calls?.map(r=>r2e(t,r))??void 0}:void 0,parsed:o.message.content&&!o.message.refusal?n2e(t,o.message.content):null}}});return{...e,choices:n}}function n2e(e,t){return e.response_format?.type!=="json_schema"?null:e.response_format?.type==="json_schema"?"$parseRaw"in e.response_format?e.response_format.$parseRaw(t):JSON.parse(t):null}function r2e(e,t){const n=e.tools?.find(o=>uE(o)&&o.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:NC(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}}function o2e(e,t){if(!e||!("tools"in e)||!e.tools)return!1;const n=e.tools?.find(o=>uE(o)&&o.function?.name===t.function.name);return uE(n)&&(NC(n)||n?.function.strict||!1)}function Sre(e){return ox(e.response_format)?!0:e.tools?.some(t=>NC(t)||t.type==="function"&&t.function.strict===!0)??!1}function Cre(e){for(const t of e||[])if(t.type!=="function")throw new at(`Currently only \`function\` tool calls are supported; Received \`${t.type}\``)}function i2e(e){for(const t of e??[]){if(t.type!=="function")throw new at(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(t.function.strict!==!0)throw new at(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}const cE=e=>e?.role==="assistant",wre=e=>e?.role==="tool";var i1,AR,_R,zS,KS,vR,QS,Zh,$S,dE,fE,Py,Ore;class sx{constructor(){i1.add(this),this.controller=new AbortController,AR.set(this,void 0),_R.set(this,()=>{}),zS.set(this,()=>{}),KS.set(this,void 0),vR.set(this,()=>{}),QS.set(this,()=>{}),Zh.set(this,{}),$S.set(this,!1),dE.set(this,!1),fE.set(this,!1),Py.set(this,!1),bt(this,AR,new Promise((t,n)=>{bt(this,_R,t,"f"),bt(this,zS,n,"f")})),bt(this,KS,new Promise((t,n)=>{bt(this,vR,t,"f"),bt(this,QS,n,"f")})),ge(this,AR,"f").catch(()=>{}),ge(this,KS,"f").catch(()=>{})}_run(t){setTimeout(()=>{t().then(()=>{this._emitFinal(),this._emit("end")},ge(this,i1,"m",Ore).bind(this))},0)}_connected(){this.ended||(ge(this,_R,"f").call(this),this._emit("connect"))}get ended(){return ge(this,$S,"f")}get errored(){return ge(this,dE,"f")}get aborted(){return ge(this,fE,"f")}abort(){this.controller.abort()}on(t,n){return(ge(this,Zh,"f")[t]||(ge(this,Zh,"f")[t]=[])).push({listener:n}),this}off(t,n){const o=ge(this,Zh,"f")[t];if(!o)return this;const r=o.findIndex(i=>i.listener===n);return r>=0&&o.splice(r,1),this}once(t,n){return(ge(this,Zh,"f")[t]||(ge(this,Zh,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,o)=>{bt(this,Py,!0),t!=="error"&&this.once("error",o),this.once(t,n)})}async done(){bt(this,Py,!0),await ge(this,KS,"f")}_emit(t,...n){if(ge(this,$S,"f"))return;t==="end"&&(bt(this,$S,!0),ge(this,vR,"f").call(this));const o=ge(this,Zh,"f")[t];if(o&&(ge(this,Zh,"f")[t]=o.filter(r=>!r.once),o.forEach(({listener:r})=>r(...n))),t==="abort"){const r=n[0];!ge(this,Py,"f")&&!o?.length&&Promise.reject(r),ge(this,zS,"f").call(this,r),ge(this,QS,"f").call(this,r),this._emit("end");return}if(t==="error"){const r=n[0];!ge(this,Py,"f")&&!o?.length&&Promise.reject(r),ge(this,zS,"f").call(this,r),ge(this,QS,"f").call(this,r),this._emit("end")}}_emitFinal(){}}AR=new WeakMap,_R=new WeakMap,zS=new WeakMap,KS=new WeakMap,vR=new WeakMap,QS=new WeakMap,Zh=new WeakMap,$S=new WeakMap,dE=new WeakMap,fE=new WeakMap,Py=new WeakMap,i1=new WeakSet,Ore=function(t){if(bt(this,dE,!0),t instanceof Error&&t.name==="AbortError"&&(t=new Ui),t instanceof Ui)return bt(this,fE,!0),this._emit("abort",t);if(t instanceof at)return this._emit("error",t);if(t instanceof Error){const n=new at(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new at(String(t)))};function s2e(e){return typeof e.parse=="function"}var ho,s1,hE,a1,l1,u1,Tre,Rre;const a2e=10;class Ere extends sx{constructor(){super(...arguments),ho.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(t){this._chatCompletions.push(t),this._emit("chatCompletion",t);const n=t.choices[0]?.message;return n&&this._addMessage(n),t}_addMessage(t,n=!0){if("content"in t||(t.content=null),this.messages.push(t),n){if(this._emit("message",t),wre(t)&&t.content)this._emit("functionToolCallResult",t.content);else if(cE(t)&&t.tool_calls)for(const o of t.tool_calls)o.type==="function"&&this._emit("functionToolCall",o.function)}}async finalChatCompletion(){await this.done();const t=this._chatCompletions[this._chatCompletions.length-1];if(!t)throw new at("stream ended without producing a ChatCompletion");return t}async finalContent(){return await this.done(),ge(this,ho,"m",s1).call(this)}async finalMessage(){return await this.done(),ge(this,ho,"m",hE).call(this)}async finalFunctionToolCall(){return await this.done(),ge(this,ho,"m",a1).call(this)}async finalFunctionToolCallResult(){return await this.done(),ge(this,ho,"m",l1).call(this)}async totalUsage(){return await this.done(),ge(this,ho,"m",u1).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const t=this._chatCompletions[this._chatCompletions.length-1];t&&this._emit("finalChatCompletion",t);const n=ge(this,ho,"m",hE).call(this);n&&this._emit("finalMessage",n);const o=ge(this,ho,"m",s1).call(this);o&&this._emit("finalContent",o);const r=ge(this,ho,"m",a1).call(this);r&&this._emit("finalFunctionToolCall",r);const i=ge(this,ho,"m",l1).call(this);i!=null&&this._emit("finalFunctionToolCallResult",i),this._chatCompletions.some(s=>s.usage)&&this._emit("totalUsage",ge(this,ho,"m",u1).call(this))}async _createChatCompletion(t,n,o){const r=o?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),ge(this,ho,"m",Tre).call(this,n);const i=await t.chat.completions.create({...n,stream:!1},{...o,signal:this.controller.signal});return this._connected(),this._addChatCompletion(ix(i,n))}async _runChatCompletion(t,n,o){for(const r of n.messages)this._addMessage(r,!1);return await this._createChatCompletion(t,n,o)}async _runTools(t,n,o){const r="tool",{tool_choice:i="auto",stream:s,...a}=n,c=typeof i!="string"&&i.type==="function"&&i?.function?.name,{maxChatCompletions:p=a2e}=o||{},u=n.tools.map(f=>{if(NC(f)){if(!f.$callback)throw new at("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:f.$callback,name:f.function.name,description:f.function.description||"",parameters:f.function.parameters,parse:f.$parseRaw,strict:!0}}}return f}),l={};for(const f of u)f.type==="function"&&(l[f.function.name||f.function.function.name]=f.function);const d="tools"in n?u.map(f=>f.type==="function"?{type:"function",function:{name:f.function.name||f.function.function.name,parameters:f.function.parameters,description:f.function.description,strict:f.function.strict}}:f):void 0;for(const f of n.messages)this._addMessage(f,!1);for(let f=0;fJSON.stringify(B)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:y,content:D});continue}let R;try{R=s2e(w)?await w.parse(S):S}catch(D){const B=D instanceof Error?D.message:String(D);this._addMessage({role:r,tool_call_id:y,content:B});continue}const E=await w.function(R,this),T=ge(this,ho,"m",Rre).call(this,E);if(this._addMessage({role:r,tool_call_id:y,content:T}),c)return}}}}ho=new WeakSet,s1=function(){return ge(this,ho,"m",hE).call(this).content??null},hE=function(){let t=this.messages.length;for(;t-- >0;){const n=this.messages[t];if(cE(n))return{...n,content:n.content??null,refusal:n.refusal??null}}throw new at("stream ended without producing a ChatCompletionMessage with role=assistant")},a1=function(){for(let t=this.messages.length-1;t>=0;t--){const n=this.messages[t];if(cE(n)&&n?.tool_calls?.length)return n.tool_calls.filter(o=>o.type==="function").at(-1)?.function}},l1=function(){for(let t=this.messages.length-1;t>=0;t--){const n=this.messages[t];if(wre(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(o=>o.role==="assistant"&&o.tool_calls?.some(r=>r.type==="function"&&r.id===n.tool_call_id)))return n.content}},u1=function(){const t={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:n}of this._chatCompletions)n&&(t.completion_tokens+=n.completion_tokens,t.prompt_tokens+=n.prompt_tokens,t.total_tokens+=n.total_tokens);return t},Tre=function(t){if(t.n!=null&&t.n>1)throw new at("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},Rre=function(t){return typeof t=="string"?t:t===void 0?"undefined":JSON.stringify(t)};class ax extends Ere{static runTools(t,n,o){const r=new ax,i={...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(t,n,i)),r}_addMessage(t,n=!0){super._addMessage(t,n),cE(t)&&t.content&&this._emit("content",t.content)}}const Mre=1,Pre=2,Ire=4,jre=8,Dre=16,Nre=32,Lre=64,Fre=128,xre=256,Bre=Fre|xre,kre=Dre|Nre|Bre|Lre,Ure=Mre|Pre|kre,qre=Ire|jre,l2e=Ure|qre,Or={STR:Mre,NUM:Pre,ARR:Ire,OBJ:jre,NULL:Dre,BOOL:Nre,NAN:Lre,INFINITY:Fre,MINUS_INFINITY:xre,INF:Bre,SPECIAL:kre,ATOM:Ure,COLLECTION:qre,ALL:l2e};class u2e extends Error{}class c2e extends Error{}function d2e(e,t=Or.ALL){if(typeof e!="string")throw new TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw new Error(`${e} is empty`);return f2e(e.trim(),t)}const f2e=(e,t)=>{const n=e.length;let o=0;const r=d=>{throw new u2e(`${d} at position ${o}`)},i=d=>{throw new c2e(`${d} at position ${o}`)},s=()=>(l(),o>=n&&r("Unexpected end of input"),e[o]==='"'?a():e[o]==="{"?c():e[o]==="["?p():e.substring(o,o+4)==="null"||Or.NULL&t&&n-o<4&&"null".startsWith(e.substring(o))?(o+=4,null):e.substring(o,o+4)==="true"||Or.BOOL&t&&n-o<4&&"true".startsWith(e.substring(o))?(o+=4,!0):e.substring(o,o+5)==="false"||Or.BOOL&t&&n-o<5&&"false".startsWith(e.substring(o))?(o+=5,!1):e.substring(o,o+8)==="Infinity"||Or.INFINITY&t&&n-o<8&&"Infinity".startsWith(e.substring(o))?(o+=8,1/0):e.substring(o,o+9)==="-Infinity"||Or.MINUS_INFINITY&t&&1{const d=o;let f=!1;for(o++;o{o++,l();const d={};try{for(;e[o]!=="}";){if(l(),o>=n&&Or.OBJ&t)return d;const f=a();l(),o++;try{const h=s();Object.defineProperty(d,f,{value:h,writable:!0,enumerable:!0,configurable:!0})}catch(h){if(Or.OBJ&t)return d;throw h}l(),e[o]===","&&o++}}catch{if(Or.OBJ&t)return d;r("Expected '}' at end of object")}return o++,d},p=()=>{o++;const d=[];try{for(;e[o]!=="]";)d.push(s()),l(),e[o]===","&&o++}catch{if(Or.ARR&t)return d;r("Expected ']' at end of array")}return o++,d},u=()=>{if(o===0){e==="-"&&Or.NUM&t&&r("Not sure what '-' is");try{return JSON.parse(e)}catch(f){if(Or.NUM&t)try{return e[e.length-1]==="."?JSON.parse(e.substring(0,e.lastIndexOf("."))):JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch{}i(String(f))}}const d=o;for(e[o]==="-"&&o++;e[o]&&!",]}".includes(e[o]);)o++;o==n&&!(Or.NUM&t)&&r("Unterminated number literal");try{return JSON.parse(e.substring(d,o))}catch{e.substring(d,o)==="-"&&Or.NUM&t&&r("Not sure what '-' is");try{return JSON.parse(e.substring(d,e.lastIndexOf("e")))}catch(h){i(String(h))}}},l=()=>{for(;od2e(e,Or.ALL^Or.NUM);var dr,bu,py,Zp,qD,tT,JD,VD,HD,nT,GD,t3;class G0 extends Ere{constructor(t){super(),dr.add(this),bu.set(this,void 0),py.set(this,void 0),Zp.set(this,void 0),bt(this,bu,t),bt(this,py,[])}get currentChatCompletionSnapshot(){return ge(this,Zp,"f")}static fromReadableStream(t){const n=new G0(null);return n._run(()=>n._fromReadableStream(t)),n}static createChatCompletion(t,n,o){const r=new G0(n);return r._run(()=>r._runChatCompletion(t,{...n,stream:!0},{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(t,n,o){super._createChatCompletion;const r=o?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),ge(this,dr,"m",qD).call(this);const i=await t.chat.completions.create({...n,stream:!0},{...o,signal:this.controller.signal});this._connected();for await(const s of i)ge(this,dr,"m",JD).call(this,s);if(i.controller.signal?.aborted)throw new Ui;return this._addChatCompletion(ge(this,dr,"m",nT).call(this))}async _fromReadableStream(t,n){const o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort())),ge(this,dr,"m",qD).call(this),this._connected();const r=H0.fromReadableStream(t,this.controller);let i;for await(const s of r)i&&i!==s.id&&this._addChatCompletion(ge(this,dr,"m",nT).call(this)),ge(this,dr,"m",JD).call(this,s),i=s.id;if(r.controller.signal?.aborted)throw new Ui;return this._addChatCompletion(ge(this,dr,"m",nT).call(this))}[(bu=new WeakMap,py=new WeakMap,Zp=new WeakMap,dr=new WeakSet,qD=function(){this.ended||bt(this,Zp,void 0)},tT=function(n){let o=ge(this,py,"f")[n.index];return o||(o={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},ge(this,py,"f")[n.index]=o,o)},JD=function(n){if(this.ended)return;const o=ge(this,dr,"m",t3).call(this,n);this._emit("chunk",n,o);for(const r of n.choices){const i=o.choices[r.index];r.delta.content!=null&&i.message?.role==="assistant"&&i.message?.content&&(this._emit("content",r.delta.content,i.message.content),this._emit("content.delta",{delta:r.delta.content,snapshot:i.message.content,parsed:i.message.parsed})),r.delta.refusal!=null&&i.message?.role==="assistant"&&i.message?.refusal&&this._emit("refusal.delta",{delta:r.delta.refusal,snapshot:i.message.refusal}),r.logprobs?.content!=null&&i.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:r.logprobs?.content,snapshot:i.logprobs?.content??[]}),r.logprobs?.refusal!=null&&i.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:r.logprobs?.refusal,snapshot:i.logprobs?.refusal??[]});const s=ge(this,dr,"m",tT).call(this,i);i.finish_reason&&(ge(this,dr,"m",HD).call(this,i),s.current_tool_call_index!=null&&ge(this,dr,"m",VD).call(this,i,s.current_tool_call_index));for(const a of r.delta.tool_calls??[])s.current_tool_call_index!==a.index&&(ge(this,dr,"m",HD).call(this,i),s.current_tool_call_index!=null&&ge(this,dr,"m",VD).call(this,i,s.current_tool_call_index)),s.current_tool_call_index=a.index;for(const a of r.delta.tool_calls??[]){const c=i.message.tool_calls?.[a.index];c?.type&&(c?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:c.function?.name,index:a.index,arguments:c.function.arguments,parsed_arguments:c.function.parsed_arguments,arguments_delta:a.function?.arguments??""}):(c?.type,void 0))}}},VD=function(n,o){if(ge(this,dr,"m",tT).call(this,n).done_tool_calls.has(o))return;const i=n.message.tool_calls?.[o];if(!i)throw new Error("no tool call snapshot");if(!i.type)throw new Error("tool call snapshot missing `type`");if(i.type==="function"){const s=ge(this,bu,"f")?.tools?.find(a=>uE(a)&&a.function.name===i.function.name);this._emit("tool_calls.function.arguments.done",{name:i.function.name,index:o,arguments:i.function.arguments,parsed_arguments:NC(s)?s.$parseRaw(i.function.arguments):s?.function.strict?JSON.parse(i.function.arguments):null})}else i.type},HD=function(n){const o=ge(this,dr,"m",tT).call(this,n);if(n.message.content&&!o.content_done){o.content_done=!0;const r=ge(this,dr,"m",GD).call(this);this._emit("content.done",{content:n.message.content,parsed:r?r.$parseRaw(n.message.content):null})}n.message.refusal&&!o.refusal_done&&(o.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!o.logprobs_content_done&&(o.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!o.logprobs_refusal_done&&(o.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},nT=function(){if(this.ended)throw new at("stream has ended, this shouldn't happen");const n=ge(this,Zp,"f");if(!n)throw new at("request ended without sending any chunks");return bt(this,Zp,void 0),bt(this,py,[]),h2e(n,ge(this,bu,"f"))},GD=function(){const n=ge(this,bu,"f")?.response_format;return ox(n)?n:null},t3=function(n){var o,r,i,s;let a=ge(this,Zp,"f");const{choices:c,...p}=n;a?Object.assign(a,p):a=bt(this,Zp,{...p,choices:[]});for(const{delta:u,finish_reason:l,index:d,logprobs:f=null,...h}of n.choices){let m=a.choices[d];if(m||(m=a.choices[d]={finish_reason:l,index:d,message:{},logprobs:f,...h}),f)if(!m.logprobs)m.logprobs=Object.assign({},f);else{const{content:E,refusal:T,...D}=f;Object.assign(m.logprobs,D),E&&((o=m.logprobs).content??(o.content=[]),m.logprobs.content.push(...E)),T&&((r=m.logprobs).refusal??(r.refusal=[]),m.logprobs.refusal.push(...T))}if(l&&(m.finish_reason=l,ge(this,bu,"f")&&Sre(ge(this,bu,"f")))){if(l==="length")throw new nre;if(l==="content_filter")throw new rre}if(Object.assign(m,h),!u)continue;const{content:g,refusal:y,function_call:_,role:S,tool_calls:w,...R}=u;if(Object.assign(m.message,R),y&&(m.message.refusal=(m.message.refusal||"")+y),S&&(m.message.role=S),_&&(m.message.function_call?(_.name&&(m.message.function_call.name=_.name),_.arguments&&((i=m.message.function_call).arguments??(i.arguments=""),m.message.function_call.arguments+=_.arguments)):m.message.function_call=_),g&&(m.message.content=(m.message.content||"")+g,!m.message.refusal&&ge(this,dr,"m",GD).call(this)&&(m.message.parsed=e3(m.message.content))),w){m.message.tool_calls||(m.message.tool_calls=[]);for(const{index:E,id:T,type:D,function:B,...N}of w){const L=(s=m.message.tool_calls)[E]??(s[E]={});Object.assign(L,N),T&&(L.id=T),D&&(L.type=D),B&&(L.function??(L.function={name:B.name??"",arguments:""})),B?.name&&(L.function.name=B.name),B?.arguments&&(L.function.arguments+=B.arguments,o2e(ge(this,bu,"f"),L)&&(L.function.parsed_arguments=e3(L.function.arguments)))}}}return a},Symbol.asyncIterator)](){const t=[],n=[];let o=!1;return this.on("chunk",r=>{const i=n.shift();i?i.resolve(r):t.push(r)}),this.on("end",()=>{o=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),this.on("error",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:o?{value:void 0,done:!0}:new Promise((i,s)=>n.push({resolve:i,reject:s})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new H0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function h2e(e,t){const{id:n,choices:o,created:r,model:i,system_fingerprint:s,...a}=e,c={...a,id:n,choices:o.map(({message:p,finish_reason:u,index:l,logprobs:d,...f})=>{if(!u)throw new at(`missing finish_reason for choice ${l}`);const{content:h=null,function_call:m,tool_calls:g,...y}=p,_=p.role;if(!_)throw new at(`missing role for choice ${l}`);if(m){const{arguments:S,name:w}=m;if(S==null)throw new at(`missing function_call.arguments for choice ${l}`);if(!w)throw new at(`missing function_call.name for choice ${l}`);return{...f,message:{content:h,function_call:{arguments:S,name:w},role:_,refusal:p.refusal??null},finish_reason:u,index:l,logprobs:d}}return g?{...f,index:l,finish_reason:u,logprobs:d,message:{...y,role:_,content:h,refusal:p.refusal??null,tool_calls:g.map((S,w)=>{const{function:R,type:E,id:T,...D}=S,{arguments:B,name:N,...L}=R||{};if(T==null)throw new at(`missing choices[${l}].tool_calls[${w}].id +${rT(e)}`);if(E==null)throw new at(`missing choices[${l}].tool_calls[${w}].type +${rT(e)}`);if(N==null)throw new at(`missing choices[${l}].tool_calls[${w}].function.name +${rT(e)}`);if(B==null)throw new at(`missing choices[${l}].tool_calls[${w}].function.arguments +${rT(e)}`);return{...D,id:T,type:E,function:{...L,name:N,arguments:B}}})}}:{...f,message:{...y,content:h,role:_,refusal:p.refusal??null},finish_reason:u,index:l,logprobs:d}}),created:r,model:i,object:"chat.completion",...s?{system_fingerprint:s}:{}};return t2e(c,t)}function rT(e){return JSON.stringify(e)}class pE extends G0{static fromReadableStream(t){const n=new pE(null);return n._run(()=>n._fromReadableStream(t)),n}static runTools(t,n,o){const r=new pE(n),i={...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(t,n,i)),r}}let lx=class extends pt{constructor(){super(...arguments),this.messages=new vre(this._client)}create(t,n){return this._client.post("/chat/completions",{body:t,...n,stream:t.stream??!1})}retrieve(t,n){return this._client.get(Le`/chat/completions/${t}`,n)}update(t,n,o){return this._client.post(Le`/chat/completions/${t}`,{body:n,...o})}list(t={},n){return this._client.getAPIList("/chat/completions",or,{query:t,...n})}delete(t,n){return this._client.delete(Le`/chat/completions/${t}`,n)}parse(t,n){return i2e(t.tools),this._client.chat.completions.create(t,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(o=>ix(o,t))}runTools(t,n){return t.stream?pE.runTools(this._client,t,n):ax.runTools(this._client,t,n)}stream(t,n){return G0.createChatCompletion(this._client,t,n)}};lx.Messages=vre;let ux=class extends pt{constructor(){super(...arguments),this.completions=new lx(this._client)}};ux.Completions=lx;const Jre=Symbol("brand.privateNullableHeaders");function*p2e(e){if(!e)return;if(Jre in e){const{values:o,nulls:r}=e;yield*o.entries();for(const i of r)yield[i,null];return}let t=!1,n;e instanceof Headers?n=e.entries():U5(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let o of n){const r=o[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const i=U5(o[1])?o[1]:[o[1]];let s=!1;for(const a of i)a!==void 0&&(t&&!s&&(s=!0,yield[r,null]),yield[r,a])}}const ut=e=>{const t=new Headers,n=new Set;for(const o of e){const r=new Set;for(const[i,s]of p2e(o)){const a=i.toLowerCase();r.has(a)||(t.delete(i),r.add(a)),s===null?(t.delete(i),n.add(a)):(t.append(i,s),n.delete(a))}}return{[Jre]:!0,values:t,nulls:n}};class Vre extends pt{create(t,n){return this._client.post("/audio/speech",{body:t,...n,headers:ut([{Accept:"application/octet-stream"},n?.headers]),__binaryResponse:!0})}}class Hre extends pt{create(t,n){return this._client.post("/audio/transcriptions",Vg({body:t,...n,stream:t.stream??!1,__metadata:{model:t.model}},this._client))}}class Gre extends pt{create(t,n){return this._client.post("/audio/translations",Vg({body:t,...n,__metadata:{model:t.model}},this._client))}}class LC extends pt{constructor(){super(...arguments),this.transcriptions=new Hre(this._client),this.translations=new Gre(this._client),this.speech=new Vre(this._client)}}LC.Transcriptions=Hre;LC.Translations=Gre;LC.Speech=Vre;let zre=class extends pt{create(t,n){return this._client.post("/batches",{body:t,...n})}retrieve(t,n){return this._client.get(Le`/batches/${t}`,n)}list(t={},n){return this._client.getAPIList("/batches",or,{query:t,...n})}cancel(t,n){return this._client.post(Le`/batches/${t}/cancel`,n)}};class Kre extends pt{create(t,n){return this._client.post("/assistants",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(Le`/assistants/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,o){return this._client.post(Le`/assistants/${t}`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t={},n){return this._client.getAPIList("/assistants",or,{query:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(t,n){return this._client.delete(Le`/assistants/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}class Qre extends pt{create(t,n){return this._client.post("/realtime/sessions",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}class $re extends pt{create(t,n){return this._client.post("/realtime/transcription_sessions",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}let $M=class extends pt{constructor(){super(...arguments),this.sessions=new Qre(this._client),this.transcriptionSessions=new $re(this._client)}};$M.Sessions=Qre;$M.TranscriptionSessions=$re;class Wre extends pt{create(t,n,o){return this._client.post(Le`/threads/${t}/messages`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}retrieve(t,n,o){const{thread_id:r}=n;return this._client.get(Le`/threads/${r}/messages/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}update(t,n,o){const{thread_id:r,...i}=n;return this._client.post(Le`/threads/${r}/messages/${t}`,{body:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t,n={},o){return this._client.getAPIList(Le`/threads/${t}/messages`,or,{query:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}delete(t,n,o){const{thread_id:r}=n;return this._client.delete(Le`/threads/${r}/messages/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}}class Yre extends pt{retrieve(t,n,o){const{thread_id:r,run_id:i,...s}=n;return this._client.get(Le`/threads/${r}/runs/${i}/steps/${t}`,{query:s,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t,n,o){const{thread_id:r,...i}=n;return this._client.getAPIList(Le`/threads/${r}/runs/${t}/steps`,or,{query:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}}const m2e=e=>{if(typeof Buffer<"u"){const t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}else{const t=atob(e),n=t.length,o=new Uint8Array(n);for(let r=0;r{if(typeof globalThis.process<"u")return g2e?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var qr,Pg,c1,Al,SR,hs,Ig,Fy,Tg,mE,li,CR,wR,f0,WS,YS,n3,r3,o3,i3,s3,a3,l3;class h0 extends sx{constructor(){super(...arguments),qr.add(this),c1.set(this,[]),Al.set(this,{}),SR.set(this,{}),hs.set(this,void 0),Ig.set(this,void 0),Fy.set(this,void 0),Tg.set(this,void 0),mE.set(this,void 0),li.set(this,void 0),CR.set(this,void 0),wR.set(this,void 0),f0.set(this,void 0)}[(c1=new WeakMap,Al=new WeakMap,SR=new WeakMap,hs=new WeakMap,Ig=new WeakMap,Fy=new WeakMap,Tg=new WeakMap,mE=new WeakMap,li=new WeakMap,CR=new WeakMap,wR=new WeakMap,f0=new WeakMap,qr=new WeakSet,Symbol.asyncIterator)](){const t=[],n=[];let o=!1;return this.on("event",r=>{const i=n.shift();i?i.resolve(r):t.push(r)}),this.on("end",()=>{o=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),this.on("error",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:o?{value:void 0,done:!0}:new Promise((i,s)=>n.push({resolve:i,reject:s})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(t){const n=new Pg;return n._run(()=>n._fromReadableStream(t)),n}async _fromReadableStream(t,n){const o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort())),this._connected();const r=H0.fromReadableStream(t,this.controller);for await(const i of r)ge(this,qr,"m",WS).call(this,i);if(r.controller.signal?.aborted)throw new Ui;return this._addRun(ge(this,qr,"m",YS).call(this))}toReadableStream(){return new H0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(t,n,o,r){const i=new Pg;return i._run(()=>i._runToolAssistantStream(t,n,o,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createToolAssistantStream(t,n,o,r){const i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));const s={...o,stream:!0},a=await t.submitToolOutputs(n,s,{...r,signal:this.controller.signal});this._connected();for await(const c of a)ge(this,qr,"m",WS).call(this,c);if(a.controller.signal?.aborted)throw new Ui;return this._addRun(ge(this,qr,"m",YS).call(this))}static createThreadAssistantStream(t,n,o){const r=new Pg;return r._run(()=>r._threadAssistantStream(t,n,{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),r}static createAssistantStream(t,n,o,r){const i=new Pg;return i._run(()=>i._runAssistantStream(t,n,o,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}currentEvent(){return ge(this,CR,"f")}currentRun(){return ge(this,wR,"f")}currentMessageSnapshot(){return ge(this,hs,"f")}currentRunStepSnapshot(){return ge(this,f0,"f")}async finalRunSteps(){return await this.done(),Object.values(ge(this,Al,"f"))}async finalMessages(){return await this.done(),Object.values(ge(this,SR,"f"))}async finalRun(){if(await this.done(),!ge(this,Ig,"f"))throw Error("Final run was not received.");return ge(this,Ig,"f")}async _createThreadAssistantStream(t,n,o){const r=o?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));const i={...n,stream:!0},s=await t.createAndRun(i,{...o,signal:this.controller.signal});this._connected();for await(const a of s)ge(this,qr,"m",WS).call(this,a);if(s.controller.signal?.aborted)throw new Ui;return this._addRun(ge(this,qr,"m",YS).call(this))}async _createAssistantStream(t,n,o,r){const i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));const s={...o,stream:!0},a=await t.create(n,s,{...r,signal:this.controller.signal});this._connected();for await(const c of a)ge(this,qr,"m",WS).call(this,c);if(a.controller.signal?.aborted)throw new Ui;return this._addRun(ge(this,qr,"m",YS).call(this))}static accumulateDelta(t,n){for(const[o,r]of Object.entries(n)){if(!t.hasOwnProperty(o)){t[o]=r;continue}let i=t[o];if(i==null){t[o]=r;continue}if(o==="index"||o==="type"){t[o]=r;continue}if(typeof i=="string"&&typeof r=="string")i+=r;else if(typeof i=="number"&&typeof r=="number")i+=r;else if(BD(i)&&BD(r))i=this.accumulateDelta(i,r);else if(Array.isArray(i)&&Array.isArray(r)){if(i.every(s=>typeof s=="string"||typeof s=="number")){i.push(...r);continue}for(const s of r){if(!BD(s))throw new Error(`Expected array delta entry to be an object but got: ${s}`);const a=s.index;if(a==null)throw console.error(s),new Error("Expected array delta entry to have an `index` property");if(typeof a!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${a}`);const c=i[a];c==null?i.push(s):i[a]=this.accumulateDelta(c,s)}continue}else throw Error(`Unhandled record type: ${o}, deltaValue: ${r}, accValue: ${i}`);t[o]=i}return t}_addRun(t){return t}async _threadAssistantStream(t,n,o){return await this._createThreadAssistantStream(n,t,o)}async _runAssistantStream(t,n,o,r){return await this._createAssistantStream(n,t,o,r)}async _runToolAssistantStream(t,n,o,r){return await this._createToolAssistantStream(n,t,o,r)}}Pg=h0,WS=function(t){if(!this.ended)switch(bt(this,CR,t),ge(this,qr,"m",o3).call(this,t),t.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":ge(this,qr,"m",l3).call(this,t);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":ge(this,qr,"m",r3).call(this,t);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":ge(this,qr,"m",n3).call(this,t);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},YS=function(){if(this.ended)throw new at("stream has ended, this shouldn't happen");if(!ge(this,Ig,"f"))throw Error("Final run has not been received");return ge(this,Ig,"f")},n3=function(t){const[n,o]=ge(this,qr,"m",s3).call(this,t,ge(this,hs,"f"));bt(this,hs,n),ge(this,SR,"f")[n.id]=n;for(const r of o){const i=n.content[r.index];i?.type=="text"&&this._emit("textCreated",i.text)}switch(t.event){case"thread.message.created":this._emit("messageCreated",t.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",t.data.delta,n),t.data.delta.content)for(const r of t.data.delta.content){if(r.type=="text"&&r.text){let i=r.text,s=n.content[r.index];if(s&&s.type=="text")this._emit("textDelta",i,s.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(r.index!=ge(this,Fy,"f")){if(ge(this,Tg,"f"))switch(ge(this,Tg,"f").type){case"text":this._emit("textDone",ge(this,Tg,"f").text,ge(this,hs,"f"));break;case"image_file":this._emit("imageFileDone",ge(this,Tg,"f").image_file,ge(this,hs,"f"));break}bt(this,Fy,r.index)}bt(this,Tg,n.content[r.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(ge(this,Fy,"f")!==void 0){const r=t.data.content[ge(this,Fy,"f")];if(r)switch(r.type){case"image_file":this._emit("imageFileDone",r.image_file,ge(this,hs,"f"));break;case"text":this._emit("textDone",r.text,ge(this,hs,"f"));break}}ge(this,hs,"f")&&this._emit("messageDone",t.data),bt(this,hs,void 0)}},r3=function(t){const n=ge(this,qr,"m",i3).call(this,t);switch(bt(this,f0,n),t.event){case"thread.run.step.created":this._emit("runStepCreated",t.data);break;case"thread.run.step.delta":const o=t.data.delta;if(o.step_details&&o.step_details.type=="tool_calls"&&o.step_details.tool_calls&&n.step_details.type=="tool_calls")for(const i of o.step_details.tool_calls)i.index==ge(this,mE,"f")?this._emit("toolCallDelta",i,n.step_details.tool_calls[i.index]):(ge(this,li,"f")&&this._emit("toolCallDone",ge(this,li,"f")),bt(this,mE,i.index),bt(this,li,n.step_details.tool_calls[i.index]),ge(this,li,"f")&&this._emit("toolCallCreated",ge(this,li,"f")));this._emit("runStepDelta",t.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":bt(this,f0,void 0),t.data.step_details.type=="tool_calls"&&ge(this,li,"f")&&(this._emit("toolCallDone",ge(this,li,"f")),bt(this,li,void 0)),this._emit("runStepDone",t.data,n);break}},o3=function(t){ge(this,c1,"f").push(t),this._emit("event",t)},i3=function(t){switch(t.event){case"thread.run.step.created":return ge(this,Al,"f")[t.data.id]=t.data,t.data;case"thread.run.step.delta":let n=ge(this,Al,"f")[t.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let o=t.data;if(o.delta){const r=Pg.accumulateDelta(n,o.delta);ge(this,Al,"f")[t.data.id]=r}return ge(this,Al,"f")[t.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":ge(this,Al,"f")[t.data.id]=t.data;break}if(ge(this,Al,"f")[t.data.id])return ge(this,Al,"f")[t.data.id];throw new Error("No snapshot available")},s3=function(t,n){let o=[];switch(t.event){case"thread.message.created":return[t.data,o];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let r=t.data;if(r.delta.content)for(const i of r.delta.content)if(i.index in n.content){let s=n.content[i.index];n.content[i.index]=ge(this,qr,"m",a3).call(this,i,s)}else n.content[i.index]=i,o.push(i);return[n,o];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,o];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},a3=function(t,n){return Pg.accumulateDelta(n,t)},l3=function(t){switch(bt(this,wR,t.data),t.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":bt(this,Ig,t.data),ge(this,li,"f")&&(this._emit("toolCallDone",ge(this,li,"f")),bt(this,li,void 0));break}};let cx=class extends pt{constructor(){super(...arguments),this.steps=new Yre(this._client)}create(t,n,o){const{include:r,...i}=n;return this._client.post(Le`/threads/${t}/runs`,{query:{include:r},body:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers]),stream:n.stream??!1})}retrieve(t,n,o){const{thread_id:r}=n;return this._client.get(Le`/threads/${r}/runs/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}update(t,n,o){const{thread_id:r,...i}=n;return this._client.post(Le`/threads/${r}/runs/${t}`,{body:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t,n={},o){return this._client.getAPIList(Le`/threads/${t}/runs`,or,{query:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}cancel(t,n,o){const{thread_id:r}=n;return this._client.post(Le`/threads/${r}/runs/${t}/cancel`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}async createAndPoll(t,n,o){const r=await this.create(t,n,o);return await this.poll(r.id,{thread_id:t},o)}createAndStream(t,n,o){return h0.createAssistantStream(t,this._client.beta.threads.runs,n,o)}async poll(t,n,o){const r=ut([o?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":o?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:i,response:s}=await this.retrieve(t,n,{...o,headers:{...o?.headers,...r}}).withResponse();switch(i.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(o?.pollIntervalMs)a=o.pollIntervalMs;else{const c=s.headers.get("openai-poll-after-ms");if(c){const p=parseInt(c);isNaN(p)||(a=p)}}await DC(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return i}}}stream(t,n,o){return h0.createAssistantStream(t,this._client.beta.threads.runs,n,o)}submitToolOutputs(t,n,o){const{thread_id:r,...i}=n;return this._client.post(Le`/threads/${r}/runs/${t}/submit_tool_outputs`,{body:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers]),stream:n.stream??!1})}async submitToolOutputsAndPoll(t,n,o){const r=await this.submitToolOutputs(t,n,o);return await this.poll(r.id,n,o)}submitToolOutputsStream(t,n,o){return h0.createToolAssistantStream(t,this._client.beta.threads.runs,n,o)}};cx.Steps=Yre;class WM extends pt{constructor(){super(...arguments),this.runs=new cx(this._client),this.messages=new Wre(this._client)}create(t={},n){return this._client.post("/threads",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(Le`/threads/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,o){return this._client.post(Le`/threads/${t}`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}delete(t,n){return this._client.delete(Le`/threads/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}createAndRun(t,n){return this._client.post("/threads/runs",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:t.stream??!1})}async createAndRunPoll(t,n){const o=await this.createAndRun(t,n);return await this.runs.poll(o.id,{thread_id:o.thread_id},n)}createAndRunStream(t,n){return h0.createThreadAssistantStream(t,this._client.beta.threads,n)}}WM.Runs=cx;WM.Messages=Wre;class FC extends pt{constructor(){super(...arguments),this.realtime=new $M(this._client),this.assistants=new Kre(this._client),this.threads=new WM(this._client)}}FC.Realtime=$M;FC.Assistants=Kre;FC.Threads=WM;class Xre extends pt{create(t,n){return this._client.post("/completions",{body:t,...n,stream:t.stream??!1})}}let Zre=class extends pt{retrieve(t,n,o){const{container_id:r}=n;return this._client.get(Le`/containers/${r}/files/${t}/content`,{...o,headers:ut([{Accept:"application/binary"},o?.headers]),__binaryResponse:!0})}},dx=class extends pt{constructor(){super(...arguments),this.content=new Zre(this._client)}create(t,n,o){return this._client.post(Le`/containers/${t}/files`,Vg({body:n,...o},this._client))}retrieve(t,n,o){const{container_id:r}=n;return this._client.get(Le`/containers/${r}/files/${t}`,o)}list(t,n={},o){return this._client.getAPIList(Le`/containers/${t}/files`,or,{query:n,...o})}delete(t,n,o){const{container_id:r}=n;return this._client.delete(Le`/containers/${r}/files/${t}`,{...o,headers:ut([{Accept:"*/*"},o?.headers])})}};dx.Content=Zre;class fx extends pt{constructor(){super(...arguments),this.files=new dx(this._client)}create(t,n){return this._client.post("/containers",{body:t,...n})}retrieve(t,n){return this._client.get(Le`/containers/${t}`,n)}list(t={},n){return this._client.getAPIList("/containers",or,{query:t,...n})}delete(t,n){return this._client.delete(Le`/containers/${t}`,{...n,headers:ut([{Accept:"*/*"},n?.headers])})}}fx.Files=dx;class eoe extends pt{create(t,n,o){const{include:r,...i}=n;return this._client.post(Le`/conversations/${t}/items`,{query:{include:r},body:i,...o})}retrieve(t,n,o){const{conversation_id:r,...i}=n;return this._client.get(Le`/conversations/${r}/items/${t}`,{query:i,...o})}list(t,n={},o){return this._client.getAPIList(Le`/conversations/${t}/items`,zNe,{query:n,...o})}delete(t,n,o){const{conversation_id:r}=n;return this._client.delete(Le`/conversations/${r}/items/${t}`,o)}}class hx extends pt{constructor(){super(...arguments),this.items=new eoe(this._client)}create(t={},n){return this._client.post("/conversations",{body:t,...n})}retrieve(t,n){return this._client.get(Le`/conversations/${t}`,n)}update(t,n,o){return this._client.post(Le`/conversations/${t}`,{body:n,...o})}delete(t,n){return this._client.delete(Le`/conversations/${t}`,n)}}hx.Items=eoe;class toe extends pt{create(t,n){const o=!!t.encoding_format;let r=o?t.encoding_format:"base64";o&&kr(this._client).debug("embeddings/user defined encoding_format:",t.encoding_format);const i=this._client.post("/embeddings",{body:{...t,encoding_format:r},...n});return o?i:(kr(this._client).debug("embeddings/decoding base64 embeddings from base64"),i._thenUnwrap(s=>(s&&s.data&&s.data.forEach(a=>{const c=a.embedding;a.embedding=m2e(c)}),s)))}}class noe extends pt{retrieve(t,n,o){const{eval_id:r,run_id:i}=n;return this._client.get(Le`/evals/${r}/runs/${i}/output_items/${t}`,o)}list(t,n,o){const{eval_id:r,...i}=n;return this._client.getAPIList(Le`/evals/${r}/runs/${t}/output_items`,or,{query:i,...o})}}class px extends pt{constructor(){super(...arguments),this.outputItems=new noe(this._client)}create(t,n,o){return this._client.post(Le`/evals/${t}/runs`,{body:n,...o})}retrieve(t,n,o){const{eval_id:r}=n;return this._client.get(Le`/evals/${r}/runs/${t}`,o)}list(t,n={},o){return this._client.getAPIList(Le`/evals/${t}/runs`,or,{query:n,...o})}delete(t,n,o){const{eval_id:r}=n;return this._client.delete(Le`/evals/${r}/runs/${t}`,o)}cancel(t,n,o){const{eval_id:r}=n;return this._client.post(Le`/evals/${r}/runs/${t}`,o)}}px.OutputItems=noe;class mx extends pt{constructor(){super(...arguments),this.runs=new px(this._client)}create(t,n){return this._client.post("/evals",{body:t,...n})}retrieve(t,n){return this._client.get(Le`/evals/${t}`,n)}update(t,n,o){return this._client.post(Le`/evals/${t}`,{body:n,...o})}list(t={},n){return this._client.getAPIList("/evals",or,{query:t,...n})}delete(t,n){return this._client.delete(Le`/evals/${t}`,n)}}mx.Runs=px;let roe=class extends pt{create(t,n){return this._client.post("/files",Vg({body:t,...n},this._client))}retrieve(t,n){return this._client.get(Le`/files/${t}`,n)}list(t={},n){return this._client.getAPIList("/files",or,{query:t,...n})}delete(t,n){return this._client.delete(Le`/files/${t}`,n)}content(t,n){return this._client.get(Le`/files/${t}/content`,{...n,headers:ut([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}async waitForProcessing(t,{pollInterval:n=5e3,maxWait:o=1800*1e3}={}){const r=new Set(["processed","error","deleted"]),i=Date.now();let s=await this.retrieve(t);for(;!s.status||!r.has(s.status);)if(await DC(n),s=await this.retrieve(t),Date.now()-i>o)throw new tx({message:`Giving up on waiting for file ${t} to finish processing after ${o} milliseconds.`});return s}};class ooe extends pt{}let ioe=class extends pt{run(t,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:t,...n})}validate(t,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:t,...n})}};class gx extends pt{constructor(){super(...arguments),this.graders=new ioe(this._client)}}gx.Graders=ioe;class soe extends pt{create(t,n,o){return this._client.getAPIList(Le`/fine_tuning/checkpoints/${t}/permissions`,QM,{body:n,method:"post",...o})}retrieve(t,n={},o){return this._client.get(Le`/fine_tuning/checkpoints/${t}/permissions`,{query:n,...o})}delete(t,n,o){const{fine_tuned_model_checkpoint:r}=n;return this._client.delete(Le`/fine_tuning/checkpoints/${r}/permissions/${t}`,o)}}let bx=class extends pt{constructor(){super(...arguments),this.permissions=new soe(this._client)}};bx.Permissions=soe;class aoe extends pt{list(t,n={},o){return this._client.getAPIList(Le`/fine_tuning/jobs/${t}/checkpoints`,or,{query:n,...o})}}class yx extends pt{constructor(){super(...arguments),this.checkpoints=new aoe(this._client)}create(t,n){return this._client.post("/fine_tuning/jobs",{body:t,...n})}retrieve(t,n){return this._client.get(Le`/fine_tuning/jobs/${t}`,n)}list(t={},n){return this._client.getAPIList("/fine_tuning/jobs",or,{query:t,...n})}cancel(t,n){return this._client.post(Le`/fine_tuning/jobs/${t}/cancel`,n)}listEvents(t,n={},o){return this._client.getAPIList(Le`/fine_tuning/jobs/${t}/events`,or,{query:n,...o})}pause(t,n){return this._client.post(Le`/fine_tuning/jobs/${t}/pause`,n)}resume(t,n){return this._client.post(Le`/fine_tuning/jobs/${t}/resume`,n)}}yx.Checkpoints=aoe;class FA extends pt{constructor(){super(...arguments),this.methods=new ooe(this._client),this.jobs=new yx(this._client),this.checkpoints=new bx(this._client),this.alpha=new gx(this._client)}}FA.Methods=ooe;FA.Jobs=yx;FA.Checkpoints=bx;FA.Alpha=gx;class loe extends pt{}class Ax extends pt{constructor(){super(...arguments),this.graderModels=new loe(this._client)}}Ax.GraderModels=loe;class uoe extends pt{createVariation(t,n){return this._client.post("/images/variations",Vg({body:t,...n},this._client))}edit(t,n){return this._client.post("/images/edits",Vg({body:t,...n,stream:t.stream??!1},this._client))}generate(t,n){return this._client.post("/images/generations",{body:t,...n,stream:t.stream??!1})}}let coe=class extends pt{retrieve(t,n){return this._client.get(Le`/models/${t}`,n)}list(t){return this._client.getAPIList("/models",QM,t)}delete(t,n){return this._client.delete(Le`/models/${t}`,n)}};class doe extends pt{create(t,n){return this._client.post("/moderations",{body:t,...n})}}class foe extends pt{create(t,n){return this._client.post("/realtime/client_secrets",{body:t,...n})}}class _x extends pt{constructor(){super(...arguments),this.clientSecrets=new foe(this._client)}}_x.ClientSecrets=foe;function b2e(e,t){return!t||!A2e(t)?{...e,output_parsed:null,output:e.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(o=>({...o,parsed:null}))}:n)}:hoe(e,t)}function hoe(e,t){const n=e.output.map(r=>{if(r.type==="function_call")return{...r,parsed_arguments:S2e(t,r)};if(r.type==="message"){const i=r.content.map(s=>s.type==="output_text"?{...s,parsed:y2e(t,s.text)}:s);return{...r,content:i}}return r}),o=Object.assign({},e,{output:n});return Object.getOwnPropertyDescriptor(e,"output_text")||d1(o),Object.defineProperty(o,"output_parsed",{enumerable:!0,get(){for(const r of o.output)if(r.type==="message"){for(const i of r.content)if(i.type==="output_text"&&i.parsed!==null)return i.parsed}return null}}),o}function y2e(e,t){return e.text?.format?.type!=="json_schema"?null:"$parseRaw"in e.text?.format?(e.text?.format).$parseRaw(t):JSON.parse(t)}function A2e(e){return!!ox(e.text?.format)}function _2e(e){return e?.$brand==="auto-parseable-tool"}function v2e(e,t){return e.find(n=>n.type==="function"&&n.name===t)}function S2e(e,t){const n=v2e(e.tools??[],t.name);return{...t,...t,parsed_arguments:_2e(n)?n.$parseRaw(t.arguments):n?.strict?JSON.parse(t.arguments):null}}function d1(e){const t=[];for(const n of e.output)if(n.type==="message")for(const o of n.content)o.type==="output_text"&&t.push(o.text);e.output_text=t.join("")}var gy,oT,em,iT,u3,c3,d3,f3;class vx extends sx{constructor(t){super(),gy.add(this),oT.set(this,void 0),em.set(this,void 0),iT.set(this,void 0),bt(this,oT,t)}static createResponse(t,n,o){const r=new vx(n);return r._run(()=>r._createOrRetrieveResponse(t,n,{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createOrRetrieveResponse(t,n,o){const r=o?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),ge(this,gy,"m",u3).call(this);let i,s=null;"response_id"in n?(i=await t.responses.retrieve(n.response_id,{stream:!0},{...o,signal:this.controller.signal,stream:!0}),s=n.starting_after??null):i=await t.responses.create({...n,stream:!0},{...o,signal:this.controller.signal}),this._connected();for await(const a of i)ge(this,gy,"m",c3).call(this,a,s);if(i.controller.signal?.aborted)throw new Ui;return ge(this,gy,"m",d3).call(this)}[(oT=new WeakMap,em=new WeakMap,iT=new WeakMap,gy=new WeakSet,u3=function(){this.ended||bt(this,em,void 0)},c3=function(n,o){if(this.ended)return;const r=(s,a)=>{(o==null||a.sequence_number>o)&&this._emit(s,a)},i=ge(this,gy,"m",f3).call(this,n);switch(r("event",n),n.type){case"response.output_text.delta":{const s=i.output[n.output_index];if(!s)throw new at(`missing output at index ${n.output_index}`);if(s.type==="message"){const a=s.content[n.content_index];if(!a)throw new at(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new at(`expected content to be 'output_text', got ${a.type}`);r("response.output_text.delta",{...n,snapshot:a.text})}break}case"response.function_call_arguments.delta":{const s=i.output[n.output_index];if(!s)throw new at(`missing output at index ${n.output_index}`);s.type==="function_call"&&r("response.function_call_arguments.delta",{...n,snapshot:s.arguments});break}default:r(n.type,n);break}},d3=function(){if(this.ended)throw new at("stream has ended, this shouldn't happen");const n=ge(this,em,"f");if(!n)throw new at("request ended without sending any events");bt(this,em,void 0);const o=C2e(n,ge(this,oT,"f"));return bt(this,iT,o),o},f3=function(n){let o=ge(this,em,"f");if(!o){if(n.type!=="response.created")throw new at(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return o=bt(this,em,n.response),o}switch(n.type){case"response.output_item.added":{o.output.push(n.item);break}case"response.content_part.added":{const r=o.output[n.output_index];if(!r)throw new at(`missing output at index ${n.output_index}`);const i=r.type,s=n.part;i==="message"&&s.type!=="reasoning_text"?r.content.push(s):i==="reasoning"&&s.type==="reasoning_text"&&(r.content||(r.content=[]),r.content.push(s));break}case"response.output_text.delta":{const r=o.output[n.output_index];if(!r)throw new at(`missing output at index ${n.output_index}`);if(r.type==="message"){const i=r.content[n.content_index];if(!i)throw new at(`missing content at index ${n.content_index}`);if(i.type!=="output_text")throw new at(`expected content to be 'output_text', got ${i.type}`);i.text+=n.delta}break}case"response.function_call_arguments.delta":{const r=o.output[n.output_index];if(!r)throw new at(`missing output at index ${n.output_index}`);r.type==="function_call"&&(r.arguments+=n.delta);break}case"response.reasoning_text.delta":{const r=o.output[n.output_index];if(!r)throw new at(`missing output at index ${n.output_index}`);if(r.type==="reasoning"){const i=r.content?.[n.content_index];if(!i)throw new at(`missing content at index ${n.content_index}`);if(i.type!=="reasoning_text")throw new at(`expected content to be 'reasoning_text', got ${i.type}`);i.text+=n.delta}break}case"response.completed":{bt(this,em,n.response);break}}return o},Symbol.asyncIterator)](){const t=[],n=[];let o=!1;return this.on("event",r=>{const i=n.shift();i?i.resolve(r):t.push(r)}),this.on("end",()=>{o=!0;for(const r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),this.on("error",r=>{o=!0;for(const i of n)i.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:o?{value:void 0,done:!0}:new Promise((i,s)=>n.push({resolve:i,reject:s})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const t=ge(this,iT,"f");if(!t)throw new at("stream ended without producing a ChatCompletion");return t}}function C2e(e,t){return b2e(e,t)}class poe extends pt{list(t,n={},o){return this._client.getAPIList(Le`/responses/${t}/input_items`,or,{query:n,...o})}}class Sx extends pt{constructor(){super(...arguments),this.inputItems=new poe(this._client)}create(t,n){return this._client.post("/responses",{body:t,...n,stream:t.stream??!1})._thenUnwrap(o=>("object"in o&&o.object==="response"&&d1(o),o))}retrieve(t,n={},o){return this._client.get(Le`/responses/${t}`,{query:n,...o,stream:n?.stream??!1})._thenUnwrap(r=>("object"in r&&r.object==="response"&&d1(r),r))}delete(t,n){return this._client.delete(Le`/responses/${t}`,{...n,headers:ut([{Accept:"*/*"},n?.headers])})}parse(t,n){return this._client.responses.create(t,n)._thenUnwrap(o=>hoe(o,t))}stream(t,n){return vx.createResponse(this._client,t,n)}cancel(t,n){return this._client.post(Le`/responses/${t}/cancel`,n)}}Sx.InputItems=poe;class moe extends pt{create(t,n,o){return this._client.post(Le`/uploads/${t}/parts`,Vg({body:n,...o},this._client))}}class Cx extends pt{constructor(){super(...arguments),this.parts=new moe(this._client)}create(t,n){return this._client.post("/uploads",{body:t,...n})}cancel(t,n){return this._client.post(Le`/uploads/${t}/cancel`,n)}complete(t,n,o){return this._client.post(Le`/uploads/${t}/complete`,{body:n,...o})}}Cx.Parts=moe;const w2e=async e=>{const t=await Promise.allSettled(e),n=t.filter(r=>r.status==="rejected");if(n.length){for(const r of n)console.error(r.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}const o=[];for(const r of t)r.status==="fulfilled"&&o.push(r.value);return o};class goe extends pt{create(t,n,o){return this._client.post(Le`/vector_stores/${t}/file_batches`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}retrieve(t,n,o){const{vector_store_id:r}=n;return this._client.get(Le`/vector_stores/${r}/file_batches/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}cancel(t,n,o){const{vector_store_id:r}=n;return this._client.post(Le`/vector_stores/${r}/file_batches/${t}/cancel`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}async createAndPoll(t,n,o){const r=await this.create(t,n);return await this.poll(t,r.id,o)}listFiles(t,n,o){const{vector_store_id:r,...i}=n;return this._client.getAPIList(Le`/vector_stores/${r}/file_batches/${t}/files`,or,{query:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}async poll(t,n,o){const r=ut([o?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":o?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:i,response:s}=await this.retrieve(n,{vector_store_id:t},{...o,headers:r}).withResponse();switch(i.status){case"in_progress":let a=5e3;if(o?.pollIntervalMs)a=o.pollIntervalMs;else{const c=s.headers.get("openai-poll-after-ms");if(c){const p=parseInt(c);isNaN(p)||(a=p)}}await DC(a);break;case"failed":case"cancelled":case"completed":return i}}}async uploadAndPoll(t,{files:n,fileIds:o=[]},r){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const i=r?.maxConcurrency??5,s=Math.min(i,n.length),a=this._client,c=n.values(),p=[...o];async function u(d){for(let f of d){const h=await a.files.create({file:f,purpose:"assistants"},r);p.push(h.id)}}const l=Array(s).fill(c).map(u);return await w2e(l),await this.createAndPoll(t,{file_ids:p})}}let boe=class extends pt{create(t,n,o){return this._client.post(Le`/vector_stores/${t}/files`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}retrieve(t,n,o){const{vector_store_id:r}=n;return this._client.get(Le`/vector_stores/${r}/files/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}update(t,n,o){const{vector_store_id:r,...i}=n;return this._client.post(Le`/vector_stores/${r}/files/${t}`,{body:i,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t,n={},o){return this._client.getAPIList(Le`/vector_stores/${t}/files`,or,{query:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}delete(t,n,o){const{vector_store_id:r}=n;return this._client.delete(Le`/vector_stores/${r}/files/${t}`,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}async createAndPoll(t,n,o){const r=await this.create(t,n,o);return await this.poll(t,r.id,o)}async poll(t,n,o){const r=ut([o?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":o?.pollIntervalMs?.toString()??void 0}]);for(;;){const i=await this.retrieve(n,{vector_store_id:t},{...o,headers:r}).withResponse(),s=i.data;switch(s.status){case"in_progress":let a=5e3;if(o?.pollIntervalMs)a=o.pollIntervalMs;else{const c=i.response.headers.get("openai-poll-after-ms");if(c){const p=parseInt(c);isNaN(p)||(a=p)}}await DC(a);break;case"failed":case"completed":return s}}}async upload(t,n,o){const r=await this._client.files.create({file:n,purpose:"assistants"},o);return this.create(t,{file_id:r.id},o)}async uploadAndPoll(t,n,o){const r=await this.upload(t,n,o);return await this.poll(t,r.id,o)}content(t,n,o){const{vector_store_id:r}=n;return this._client.getAPIList(Le`/vector_stores/${r}/files/${t}/content`,QM,{...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}};class YM extends pt{constructor(){super(...arguments),this.files=new boe(this._client),this.fileBatches=new goe(this._client)}create(t,n){return this._client.post("/vector_stores",{body:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(Le`/vector_stores/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,o){return this._client.post(Le`/vector_stores/${t}`,{body:n,...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}list(t={},n){return this._client.getAPIList("/vector_stores",or,{query:t,...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(t,n){return this._client.delete(Le`/vector_stores/${t}`,{...n,headers:ut([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}search(t,n,o){return this._client.getAPIList(Le`/vector_stores/${t}/search`,QM,{body:n,method:"post",...o,headers:ut([{"OpenAI-Beta":"assistants=v2"},o?.headers])})}}YM.Files=boe;YM.FileBatches=goe;var Iy,yoe,OR;class Aoe extends pt{constructor(){super(...arguments),Iy.add(this)}async unwrap(t,n,o=this._client.webhookSecret,r=300){return await this.verifySignature(t,n,o,r),JSON.parse(t)}async verifySignature(t,n,o=this._client.webhookSecret,r=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");ge(this,Iy,"m",yoe).call(this,o);const i=ut([n]).values,s=ge(this,Iy,"m",OR).call(this,i,"webhook-signature"),a=ge(this,Iy,"m",OR).call(this,i,"webhook-timestamp"),c=ge(this,Iy,"m",OR).call(this,i,"webhook-id"),p=parseInt(a,10);if(isNaN(p))throw new JS("Invalid webhook timestamp format");const u=Math.floor(Date.now()/1e3);if(u-p>r)throw new JS("Webhook timestamp is too old");if(p>u+r)throw new JS("Webhook timestamp is too new");const l=s.split(" ").map(m=>m.startsWith("v1,")?m.substring(3):m),d=o.startsWith("whsec_")?Buffer.from(o.replace("whsec_",""),"base64"):Buffer.from(o,"utf-8"),f=c?`${c}.${a}.${t}`:`${a}.${t}`,h=await crypto.subtle.importKey("raw",d,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(const m of l)try{const g=Buffer.from(m,"base64");if(await crypto.subtle.verify("HMAC",h,g,new TextEncoder().encode(f)))return}catch{continue}throw new JS("The given webhook signature does not match the expected signature")}}Iy=new WeakSet,yoe=function(t){if(typeof t!="string"||t.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},OR=function(t,n){if(!t)throw new Error("Headers are required");const o=t.get(n);if(o==null)throw new Error(`Missing required header: ${n}`);return o};var f1,wx,TR,_oe;class Dt{constructor({baseURL:t=my("OPENAI_BASE_URL"),apiKey:n=my("OPENAI_API_KEY"),organization:o=my("OPENAI_ORG_ID")??null,project:r=my("OPENAI_PROJECT_ID")??null,webhookSecret:i=my("OPENAI_WEBHOOK_SECRET")??null,...s}={}){if(f1.add(this),TR.set(this,void 0),this.completions=new Xre(this),this.chat=new ux(this),this.embeddings=new toe(this),this.files=new roe(this),this.images=new uoe(this),this.audio=new LC(this),this.moderations=new doe(this),this.models=new coe(this),this.fineTuning=new FA(this),this.graders=new Ax(this),this.vectorStores=new YM(this),this.webhooks=new Aoe(this),this.beta=new FC(this),this.batches=new zre(this),this.uploads=new Cx(this),this.responses=new Sx(this),this.realtime=new _x(this),this.conversations=new hx(this),this.evals=new mx(this),this.containers=new fx(this),n===void 0)throw new at("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const a={apiKey:n,organization:o,project:r,webhookSecret:i,...s,baseURL:t||"https://api.openai.com/v1"};if(!a.dangerouslyAllowBrowser&&CNe())throw new at(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, @@ -142,68 +142,77 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety -`);this.baseURL=a.baseURL,this.timeout=a.timeout??_R.DEFAULT_TIMEOUT,this.logger=a.logger??console;const l="warn";this.logLevel=l,this.logLevel=vB(a.logLevel,"ClientOptions.logLevel",this)??vB(Ju("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??fme(),We(this,Gy,gme),this._options=a,this.apiKey=typeof n=="string"?n:"Missing Key",this.organization=i,this.project=r,this.webhookSecret=s}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){}async authHeaders(e){return Fe([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return wme(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${ld}`}defaultIdempotencyKey(){return`stainless-node-retry-${E9()}`}makeStatusError(e,n,i,r){return Zi.generate(e,n,i,r)}async _callApiKey(){const e=this._options.apiKey;if(typeof e!="function")return!1;let n;try{n=await e()}catch(i){throw i instanceof Ue?i:new Ue(`Failed to get token from 'apiKey' function: ${i.message}`,{cause:i})}if(typeof n!="string"||!n)throw new Ue(`Expected 'apiKey' function argument to return a string but it returned ${n}`);return this.apiKey=n,!0}buildURL(e,n,i){const r=!se(this,d_,"m",XH).call(this)&&i||this.baseURL,s=ime(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery();return rme(o)||(n={...o,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(s.search=this.stringifyQuery(n)),s.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:n,options:i}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,i){return this.request(Promise.resolve(i).then(r=>({method:e,path:n,...r})))}request(e,n=null){return new j9(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,i){const r=await e,s=r.maxRetries??this.maxRetries;n==null&&(n=s),await this.prepareOptions(r);const{req:o,url:a,timeout:l}=await this.buildRequest(r,{retryCount:s-n});await this.prepareRequest(o,{url:a,options:r});const u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),d=i===void 0?"":`, retryOf: ${i}`,f=Date.now();if(Zn(this).debug(`[${u}] sending request`,pc({retryOfRequestLogID:i,method:r.method,url:a,options:r,headers:o.headers})),r.signal?.aborted)throw new Wr;const g=new AbortController,m=await this.fetchWithTimeout(a,o,l,g).catch(Z1),v=Date.now();if(m instanceof globalThis.Error){const E=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new Wr;const k=X1(m)||/timed? ?out/i.test(String(m)+("cause"in m?String(m.cause):""));if(n)return Zn(this).info(`[${u}] connection ${k?"timed out":"failed"} - ${E}`),Zn(this).debug(`[${u}] connection ${k?"timed out":"failed"} (${E})`,pc({retryOfRequestLogID:i,url:a,durationMs:v-f,message:m.message})),this.retryRequest(r,n,i??u);throw Zn(this).info(`[${u}] connection ${k?"timed out":"failed"} - error; no more retries left`),Zn(this).debug(`[${u}] connection ${k?"timed out":"failed"} (error; no more retries left)`,pc({retryOfRequestLogID:i,url:a,durationMs:v-f,message:m.message})),k?new iR:new ow({cause:m})}const S=[...m.headers.entries()].filter(([E])=>E==="x-request-id").map(([E,k])=>", "+E+": "+JSON.stringify(k)).join(""),C=`[${u}${d}${S}] ${o.method} ${a} ${m.ok?"succeeded":"failed"} with status ${m.status} in ${v-f}ms`;if(!m.ok){const E=await this.shouldRetry(m);if(n&&E){const N=`retrying, ${n} attempts remaining`;return await pme(m.body),Zn(this).info(`${C} - ${N}`),Zn(this).debug(`[${u}] response error (${N})`,pc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:v-f})),this.retryRequest(r,n,i??u,m.headers)}const k=E?"error; no more retries left":"error; not retryable";Zn(this).info(`${C} - ${k}`);const R=await m.text().catch(N=>Z1(N).message),M=ame(R),D=M?void 0:R;throw Zn(this).debug(`[${u}] response error (${k})`,pc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,message:D,durationMs:Date.now()-f})),this.makeStatusError(m.status,M,D,m.headers)}return Zn(this).info(C),Zn(this).debug(`[${u}] response start`,pc({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:v-f})),{response:m,options:r,controller:g,requestLogID:u,retryOfRequestLogID:i,startTime:f}}getAPIList(e,n,i){return this.requestAPIList(n,{method:"get",path:e,...i})}requestAPIList(e,n){const i=this.makeRequest(n,null,void 0);return new Ime(this,i,e)}async fetchWithTimeout(e,n,i,r){const{signal:s,method:o,...a}=n||{};s&&s.addEventListener("abort",()=>r.abort());const l=setTimeout(()=>r.abort(),i),u=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:r.signal,...u?{duplex:"half"}:{},method:"GET",...a};o&&(d.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(l)}}async shouldRetry(e){const n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,i,r){let s;const o=r?.get("retry-after-ms");if(o){const l=parseFloat(o);Number.isNaN(l)||(s=l)}const a=r?.get("retry-after");if(a&&!s){const l=parseFloat(a);Number.isNaN(l)?s=Date.parse(a)-Date.now():s=l*1e3}if(!(s&&0<=s&&s<60*1e3)){const l=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,l)}return await nm(s),this.makeRequest(e,n-1,i)}calculateDefaultRetryTimeoutMillis(e,n){const s=n-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}async buildRequest(e,{retryCount:n=0}={}){const i={...e},{method:r,path:s,query:o,defaultBaseURL:a}=i,l=this.buildURL(s,o,a);"timeout"in i&&ome("timeout",i.timeout),i.timeout=i.timeout??this.timeout;const{bodyHeaders:u,body:d}=this.buildBody({options:i}),f=await this.buildHeaders({options:e,method:r,bodyHeaders:u,retryCount:n});return{req:{method:r,headers:f,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&d instanceof globalThis.ReadableStream&&{duplex:"half"},...d&&{body:d},...this.fetchOptions??{},...i.fetchOptions??{}},url:l,timeout:i.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:i,retryCount:r}){let s={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);const o=Fe([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...hme(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,i,e.headers]);return this.validateHeaders(o),o.values}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};const i=Fe([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&i.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:U9(e)}:se(this,Gy,"f").call(this,{body:e,headers:i})}}_R=ot,Gy=new WeakMap,d_=new WeakSet,XH=function(){return this.baseURL!=="https://api.openai.com/v1"};ot.OpenAI=_R;ot.DEFAULT_TIMEOUT=6e5;ot.OpenAIError=Ue;ot.APIError=Zi;ot.APIConnectionError=ow;ot.APIConnectionTimeoutError=iR;ot.APIUserAbortError=Wr;ot.NotFoundError=k9;ot.ConflictError=I9;ot.RateLimitError=D9;ot.BadRequestError=_9;ot.AuthenticationError=T9;ot.InternalServerError=P9;ot.PermissionDeniedError=R9;ot.UnprocessableEntityError=M9;ot.InvalidWebhookSignatureError=dp;ot.toFile=Lme;ot.Completions=IH;ot.Chat=dR;ot.Embeddings=PH;ot.Files=OH;ot.Images=HH;ot.Audio=rm;ot.Moderations=QH;ot.Models=zH;ot.FineTuning=gh;ot.Graders=wR;ot.VectorStores=dw;ot.Webhooks=JH;ot.Beta=sm;ot.Batches=xH;ot.Uploads=ER;ot.Responses=xR;ot.Realtime=SR;ot.Conversations=gR;ot.Evals=AR;ot.Containers=pR;const h_=()=>new Date().toISOString(),uAe=()=>({role:"assistant",content:[]}),dAe=t=>({role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:t}}),hAe=()=>`reasoning-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,fAe=(t,e)=>{if(!e||!Array.isArray(t.content))return t;const n=[...t.content],i=n[n.length-1];return!i||i.type!=="reasoning"?n.push({type:"reasoning",text:e}):n[n.length-1]={...i,text:i.text+e},{...t,content:n}},M0=(t,e=!1)=>{if(!Array.isArray(t.content))return t;const n=[...t.content];for(let i=0;i{const i=e.delta.content;if(!i||!Array.isArray(t.content))return t;const r=[...t.content],s=r[r.length-1];return s?s.type==="text"?r[r.length-1]={...s,text:s.text+i}:(s.type==="reasoning"||n)&&r.push({type:"text",text:i}):r.push({type:"text",text:i}),{...t,content:r}},gAe=t=>({type:"tool-call",args:{},argsText:t?.tool_calls?.[0]?.function?.arguments??"",toolName:t?.tool_calls?.[0]?.function?.name??"",toolCallId:t?.tool_calls?.[0]?.id??""}),mAe=(t,e)=>{const n=e?.tool_calls?.[0],i=t.argsText+(n?.function?.arguments??"");let r={};try{r=JSON.parse(i||"{}")}catch{}return{...t,args:r,argsText:i,toolName:t.toolName||n?.function?.name||"",toolCallId:t.toolCallId||n?.id||""}},AAe=(t,e)=>{if(!e.delta.tool_calls||!Array.isArray(t.content))return t;const i=[...t.content],r=i[i.length-1];return!r||r.type!=="tool-call"?i.push(gAe(e.delta)):i[i.length-1]=mAe(r,e.delta),{...t,content:i}},D0={name:"OpenAI",baseUrl:"https://api.openai.com/v1",modelFilters:["gpt-5.2-2025-12-11"],modelNames:{"gpt-5.2-2025-12-11":"GPT-5.2"}},yAe=t=>t.map(e=>({type:"function",function:{name:e.name,description:e.description,parameters:{...e.inputSchema}}})),vAe=t=>typeof t=="string"?t:t.map(e=>{if(e.type==="text")return{type:"text",text:e.text};if(e.type==="file"){const n=JSON.parse(e.mimeType);return{type:"text",text:JSON.stringify({file_data:e.data,filename:n.path,file_id:n.path})}}return e.type==="image"?{type:"image_url",image_url:{url:e.image}}:{type:"text",text:""}}),bAe=t=>{if(typeof t.content=="string")return{content:t.content,reasoningContent:null,toolCalls:[],toolResults:[]};const e=[],n=[],i=[];let r=null;for(const s of t.content){if(s.type==="text"){e.push({type:"text",text:s.text});continue}if(s.type==="reasoning"){r=s.text;continue}s.type==="tool-call"&&(s.result&&i.push({role:"tool",content:s.result,tool_call_id:s.toolCallId??h_()}),n.push({id:s.toolCallId??h_(),type:"function",function:{arguments:s.argsText??"",name:s.toolName}}))}return{content:e,reasoningContent:r,toolCalls:n,toolResults:i}},tE=t=>{const e=[];for(const n of t){if(n.role==="user"||n.role==="system"){const l=n.role==="system"?"user":n.role;e.push({role:l,content:vAe(n.content)});continue}const{content:i,reasoningContent:r,toolCalls:s,toolResults:o}=bAe(n),a={role:"assistant",content:i};r&&(a.reasoning_content=r),s.length>0&&(a.tool_calls=s),e.push(a),o.length>0&&e.push(...o)}return e};class Wc extends YT{createClient(e,n){return new ot({apiKey:e,baseURL:n,dangerouslyAllowBrowser:!0})}buildSystemMessage(e){return{role:"system",content:e}}createResponseShell(e,n){return e&&n?nR(n):uAe()}pushHistory(e){this.prevMessages.push(...e)}pushSingleMessage(e){const n=tE([e]);this.pushHistory(n)}filterAfterToolCallContent(e,n){const i=e.content;if(typeof i=="string"||!n||typeof n.content=="string")return e;const s=n.content.length,o=i.filter((a,l)=>a.type==="tool-call"?!0:l>=s);return{...e,content:o}}getLastToolCall(e){if(typeof e.content!="string")for(let n=e.content.length-1;n>=0;n-=1){const i=e.content[n];if(i.type==="tool-call")return i}}setProvider=e=>{this.provider=e,this.client=this.createClient(e.key,e.baseUrl),e.key&&this.setApiKey(e.key),e.baseUrl&&this.setUrl(e.baseUrl)};setPrevMessages=e=>{this.prevMessages=tE(e)};setTools=e=>{this.tools=yAe(e)};async createChatName(e){try{if(!this.client)return"";const i=this.modelKey.includes("-thinking")?this.modelKey.replace("-thinking",""):this.modelKey,r=this.buildSystemMessage(KT);return(await this.client.chat.completions.create({messages:[r,{role:"user",content:e}],model:i,stream:!1})).choices[0].message.content??e.substring(0,25)}catch{return""}}async getStream(e,n,i){if(!this.client)return;const r=this.modelKey.includes("-thinking"),s=r?this.modelKey.replace("-thinking",""):this.modelKey,o=i&&r?"medium":void 0;return await this.client.chat.completions.create({messages:[e,...this.prevMessages,...n],model:s,tools:this.tools,stream:!0,reasoning_effort:o})}async*sendMessage(e,n,i,r){if(this.client)try{const s=tE(e),o=this.buildSystemMessage(this.systemPrompt),a=await this.getStream(o,s,r);if(!a)return;this.pushHistory(s);let l=this.createResponseShell(n,i),u=!1,d=!1;for await(const f of a){for(const g of f.choices){if(u)break;const m=g.delta;if(g.finish_reason){d&&(l=M0(l,!0)),l=n?this.filterAfterToolCallContent(l,i):l,this.pushSingleMessage(l),u=!0;break}m.reasoning_content&&(d=!0,l=fAe(l,m.reasoning_content)),m.content&&(d&&(l=M0(l),d=!1),l=pAe(l,g,n)),m.tool_calls&&typeof l.content!="string"&&(d&&(l=M0(l),d=!1),l=AAe(l,g))}if(this.stopFlag){d&&(l=M0(l,!0)),this.pushSingleMessage(l),a.controller.abort(),this.stopFlag=!1,yield{isEnd:!0,responseMessage:l};continue}if(u){yield{isEnd:!0,responseMessage:l};return}yield l}}catch(s){console.error("OpenAI sendMessage error:",s),yield{isEnd:!0,responseMessage:dAe(s)}}}async*sendMessageAfterToolCall(e,n){if(typeof e.content=="string")return e;const i=this.getLastToolCall(e);if(!i)return e;const r={role:"tool",content:i.result,tool_call_id:i.toolCallId??h_()};return this.pushHistory([r]),yield*this.sendMessage([],!0,e,n),e}getName=()=>D0.name;getBaseUrl=()=>D0.baseUrl;checkProvider=async e=>{const n=this.createClient(e.apiKey,e.url);try{return await n.models.list(),!0}catch(i){const r=Vpe(i);return r==="invalid_api_key"?hn.invalidKey():r===404?hn.invalidUrl():e.apiKey?hn.invalidKey():hn.emptyKey()}};getProviderModels=async e=>(await this.createClient(e.apiKey,e.url).models.list()).data.filter(r=>D0.modelFilters.includes(r.id)).map(r=>{const s=D0.modelNames[r.id]||r.id.toUpperCase();return{id:`${r.id}-thinking`,name:s,provider:"openai"}})}const wAe=new Wc,Zu={name:"DeepSeek",baseUrl:"https://api.deepseek.com",modelFilters:["deepseek-chat","deepseek-reasoner"],modelNames:{"deepseek-chat":"DeepsSeek Chat","deepseek-reasoner":"DeepsSeek Reasoner"}};class SAe extends Wc{getName=()=>Zu.name;getBaseUrl=()=>Zu.baseUrl;getProviderModels=async e=>{const n=this.createClient(e.apiKey,e.url||Zu.baseUrl);try{const i=(await n.models.list()).data;return(Zu.modelFilters.length>0?i.filter(s=>Zu.modelFilters.includes(s.id)).map(s=>({id:s.id,name:Zu.modelNames[s.id]||s.id,provider:"deepseek"})):i.map(s=>({id:s.id,name:s.id,provider:"deepseek"}))).reverse()}catch{return[]}}}const CAe=new SAe;var xAe={};let EAe,_Ae;function TAe(){return{geminiUrl:EAe,vertexUrl:_Ae}}function RAe(t,e,n,i){var r,s;if(!t?.baseUrl){const o=TAe();return e?(r=o.vertexUrl)!==null&&r!==void 0?r:n:(s=o.geminiUrl)!==null&&s!==void 0?s:i}return t.baseUrl}class Aa{}function Re(t,e){const n=/\{([^}]+)\}/g;return t.replace(n,(i,r)=>{if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];return s!=null?String(s):""}else throw new Error(`Key '${r}' not found in valueMap.`)})}function b(t,e,n){for(let s=0;s({}));else throw new Error(`Value must be a list given an array path ${o}`);if(Array.isArray(t[a])){const l=t[a];if(Array.isArray(n))for(let u=0;uy(a,e.slice(i+1),n)):n}else return n}else t=t[r]}return t}catch(i){if(i instanceof TypeError)return n;throw i}}function kAe(t,e){for(const[n,i]of Object.entries(e)){const r=n.split("."),s=i.split("."),o=new Set;let a=-1;for(let l=0;la)for(let l=a;l=e.length||typeof t!="object"||t===null)return;const s=e[i];if(s.endsWith("[]")){const o=s.slice(0,-2),a=t;if(o in a&&Array.isArray(a[o]))for(const l of a[o])f_(l,e,n,i+1,r)}else if(s==="*"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){const o=t,a=Object.keys(o).filter(u=>!u.startsWith("_")&&!r.has(u)),l={};for(const u of a)l[u]=o[u];for(const[u,d]of Object.entries(l)){const f=[];for(const g of n.slice(i))g==="*"?f.push(u):f.push(g);b(o,f,d)}for(const u of a)delete o[u]}}else{const o=t;s in o&&f_(o[s],e,n,i+1,r)}}function TR(t){if(typeof t!="string")throw new Error("fromImageBytes must be a string");return t}function IAe(t){const e={},n=y(t,["operationName"]);n!=null&&b(e,["operationName"],n);const i=y(t,["resourceName"]);return i!=null&&b(e,["_url","resourceName"],i),e}function MAe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response","generateVideoResponse"]);return o!=null&&b(e,["response"],PAe(o)),e}function DAe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response"]);return o!=null&&b(e,["response"],NAe(o)),e}function PAe(t){const e={},n=y(t,["generatedSamples"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>OAe(o))),b(e,["generatedVideos"],s)}const i=y(t,["raiMediaFilteredCount"]);i!=null&&b(e,["raiMediaFilteredCount"],i);const r=y(t,["raiMediaFilteredReasons"]);return r!=null&&b(e,["raiMediaFilteredReasons"],r),e}function NAe(t){const e={},n=y(t,["videos"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>BAe(o))),b(e,["generatedVideos"],s)}const i=y(t,["raiMediaFilteredCount"]);i!=null&&b(e,["raiMediaFilteredCount"],i);const r=y(t,["raiMediaFilteredReasons"]);return r!=null&&b(e,["raiMediaFilteredReasons"],r),e}function OAe(t){const e={},n=y(t,["video"]);return n!=null&&b(e,["video"],zAe(n)),e}function BAe(t){const e={},n=y(t,["_self"]);return n!=null&&b(e,["video"],QAe(n)),e}function LAe(t){const e={},n=y(t,["operationName"]);return n!=null&&b(e,["_url","operationName"],n),e}function UAe(t){const e={},n=y(t,["operationName"]);return n!=null&&b(e,["_url","operationName"],n),e}function VAe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response"]);return o!=null&&b(e,["response"],FAe(o)),e}function FAe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["parent"]);i!=null&&b(e,["parent"],i);const r=y(t,["documentName"]);return r!=null&&b(e,["documentName"],r),e}function ZH(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response"]);return o!=null&&b(e,["response"],HAe(o)),e}function HAe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["parent"]);i!=null&&b(e,["parent"],i);const r=y(t,["documentName"]);return r!=null&&b(e,["documentName"],r),e}function zAe(t){const e={},n=y(t,["uri"]);n!=null&&b(e,["uri"],n);const i=y(t,["encodedVideo"]);i!=null&&b(e,["videoBytes"],TR(i));const r=y(t,["encoding"]);return r!=null&&b(e,["mimeType"],r),e}function QAe(t){const e={},n=y(t,["gcsUri"]);n!=null&&b(e,["uri"],n);const i=y(t,["bytesBase64Encoded"]);i!=null&&b(e,["videoBytes"],TR(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["mimeType"],r),e}var BB;(function(t){t.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",t.OUTCOME_OK="OUTCOME_OK",t.OUTCOME_FAILED="OUTCOME_FAILED",t.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(BB||(BB={}));var LB;(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(LB||(LB={}));var UB;(function(t){t.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",t.SILENT="SILENT",t.WHEN_IDLE="WHEN_IDLE",t.INTERRUPT="INTERRUPT"})(UB||(UB={}));var fl;(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.STRING="STRING",t.NUMBER="NUMBER",t.INTEGER="INTEGER",t.BOOLEAN="BOOLEAN",t.ARRAY="ARRAY",t.OBJECT="OBJECT",t.NULL="NULL"})(fl||(fl={}));var VB;(function(t){t.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",t.SIMPLE_SEARCH="SIMPLE_SEARCH",t.ELASTIC_SEARCH="ELASTIC_SEARCH"})(VB||(VB={}));var FB;(function(t){t.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",t.NO_AUTH="NO_AUTH",t.API_KEY_AUTH="API_KEY_AUTH",t.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",t.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",t.OAUTH="OAUTH",t.OIDC_AUTH="OIDC_AUTH"})(FB||(FB={}));var HB;(function(t){t.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",t.HTTP_IN_QUERY="HTTP_IN_QUERY",t.HTTP_IN_HEADER="HTTP_IN_HEADER",t.HTTP_IN_PATH="HTTP_IN_PATH",t.HTTP_IN_BODY="HTTP_IN_BODY",t.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(HB||(HB={}));var zB;(function(t){t.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",t.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",t.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",t.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(zB||(zB={}));var QB;(function(t){t.UNSPECIFIED="UNSPECIFIED",t.BLOCKING="BLOCKING",t.NON_BLOCKING="NON_BLOCKING"})(QB||(QB={}));var GB;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(GB||(GB={}));var $B;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE",t.VALIDATED="VALIDATED"})($B||($B={}));var p_;(function(t){t.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH",t.MINIMAL="MINIMAL"})(p_||(p_={}));var WB;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",t.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",t.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",t.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",t.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(WB||(WB={}));var jB;(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})(jB||(jB={}));var KB;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE",t.OFF="OFF"})(KB||(KB={}));var YB;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.IMAGE_SAFETY="IMAGE_SAFETY",t.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",t.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",t.NO_IMAGE="NO_IMAGE",t.IMAGE_RECITATION="IMAGE_RECITATION",t.IMAGE_OTHER="IMAGE_OTHER"})(YB||(YB={}));var qB;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(qB||(qB={}));var JB;(function(t){t.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(JB||(JB={}));var XB;(function(t){t.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",t.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",t.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",t.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",t.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(XB||(XB={}));var ZB;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.IMAGE_SAFETY="IMAGE_SAFETY",t.MODEL_ARMOR="MODEL_ARMOR",t.JAILBREAK="JAILBREAK"})(ZB||(ZB={}));var eL;(function(t){t.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",t.ON_DEMAND="ON_DEMAND",t.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(eL||(eL={}));var Nv;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO"})(Nv||(Nv={}));var tL;(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(tL||(tL={}));var nL;(function(t){t.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",t.TUNING_MODE_FULL="TUNING_MODE_FULL",t.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(nL||(nL={}));var iL;(function(t){t.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",t.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",t.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",t.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",t.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",t.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",t.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(iL||(iL={}));var g_;(function(t){t.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",t.JOB_STATE_QUEUED="JOB_STATE_QUEUED",t.JOB_STATE_PENDING="JOB_STATE_PENDING",t.JOB_STATE_RUNNING="JOB_STATE_RUNNING",t.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",t.JOB_STATE_FAILED="JOB_STATE_FAILED",t.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",t.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",t.JOB_STATE_PAUSED="JOB_STATE_PAUSED",t.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",t.JOB_STATE_UPDATING="JOB_STATE_UPDATING",t.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(g_||(g_={}));var rL;(function(t){t.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",t.TUNING_TASK_I2V="TUNING_TASK_I2V",t.TUNING_TASK_T2V="TUNING_TASK_T2V",t.TUNING_TASK_R2V="TUNING_TASK_R2V"})(rL||(rL={}));var sL;(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",t.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(sL||(sL={}));var oL;(function(t){t.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",t.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",t.BALANCED="BALANCED",t.PRIORITIZE_COST="PRIORITIZE_COST"})(oL||(oL={}));var aL;(function(t){t.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",t.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(aL||(aL={}));var lL;(function(t){t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(lL||(lL={}));var cL;(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(cL||(cL={}));var uL;(function(t){t.auto="auto",t.en="en",t.ja="ja",t.ko="ko",t.hi="hi",t.zh="zh",t.pt="pt",t.es="es"})(uL||(uL={}));var dL;(function(t){t.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",t.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",t.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",t.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",t.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(dL||(dL={}));var hL;(function(t){t.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",t.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",t.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",t.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(hL||(hL={}));var fL;(function(t){t.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",t.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",t.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",t.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(fL||(fL={}));var pL;(function(t){t.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",t.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",t.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",t.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",t.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",t.EDIT_MODE_STYLE="EDIT_MODE_STYLE",t.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",t.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(pL||(pL={}));var gL;(function(t){t.FOREGROUND="FOREGROUND",t.BACKGROUND="BACKGROUND",t.PROMPT="PROMPT",t.SEMANTIC="SEMANTIC",t.INTERACTIVE="INTERACTIVE"})(gL||(gL={}));var mL;(function(t){t.ASSET="ASSET",t.STYLE="STYLE"})(mL||(mL={}));var AL;(function(t){t.INSERT="INSERT",t.REMOVE="REMOVE",t.REMOVE_STATIC="REMOVE_STATIC",t.OUTPAINT="OUTPAINT"})(AL||(AL={}));var yL;(function(t){t.OPTIMIZED="OPTIMIZED",t.LOSSLESS="LOSSLESS"})(yL||(yL={}));var vL;(function(t){t.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",t.PREFERENCE_TUNING="PREFERENCE_TUNING"})(vL||(vL={}));var bL;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.STATE_PENDING="STATE_PENDING",t.STATE_ACTIVE="STATE_ACTIVE",t.STATE_FAILED="STATE_FAILED"})(bL||(bL={}));var wL;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(wL||(wL={}));var SL;(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED",t.REGISTERED="REGISTERED"})(SL||(SL={}));var CL;(function(t){t.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.RESPONSE_REJECTED="RESPONSE_REJECTED",t.NEED_MORE_INPUT="NEED_MORE_INPUT"})(CL||(CL={}));var xL;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(xL||(xL={}));var EL;(function(t){t.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",t.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",t.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(EL||(EL={}));var _L;(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(_L||(_L={}));var TL;(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(TL||(TL={}));var RL;(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(RL||(RL={}));var kL;(function(t){t.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",t.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",t.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(kL||(kL={}));var IL;(function(t){t.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",t.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",t.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",t.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",t.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",t.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",t.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",t.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",t.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",t.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",t.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",t.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",t.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(IL||(IL={}));var ML;(function(t){t.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",t.QUALITY="QUALITY",t.DIVERSITY="DIVERSITY",t.VOCALIZATION="VOCALIZATION"})(ML||(ML={}));var md;(function(t){t.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",t.PLAY="PLAY",t.PAUSE="PAUSE",t.STOP="STOP",t.RESET_CONTEXT="RESET_CONTEXT"})(md||(md={}));class m_{constructor(e){const n={};for(const i of e.headers.entries())n[i[0]]=i[1];this.headers=n,this.responseInternal=e}json(){return this.responseInternal.json()}}class $f{get text(){var e,n,i,r,s,o,a,l;if(((r=(i=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let u="",d=!1;const f=[];for(const g of(l=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&l!==void 0?l:[]){for(const[m,v]of Object.entries(g))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(v!==null||v!==void 0)&&f.push(m);if(typeof g.text=="string"){if(typeof g.thought=="boolean"&&g.thought)continue;d=!0,u+=g.text}}return f.length>0&&console.warn(`there are non-text parts ${f} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),d?u:void 0}get data(){var e,n,i,r,s,o,a,l;if(((r=(i=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let u="";const d=[];for(const f of(l=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)!==null&&l!==void 0?l:[]){for(const[g,m]of Object.entries(f))g!=="inlineData"&&(m!==null||m!==void 0)&&d.push(g);f.inlineData&&typeof f.inlineData.data=="string"&&(u+=atob(f.inlineData.data))}return d.length>0&&console.warn(`there are non-data parts ${d} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}get functionCalls(){var e,n,i,r,s,o,a,l;if(((r=(i=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const u=(l=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||l===void 0?void 0:l.filter(d=>d.functionCall).map(d=>d.functionCall).filter(d=>d!==void 0);if(u?.length!==0)return u}get executableCode(){var e,n,i,r,s,o,a,l,u;if(((r=(i=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const d=(l=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||l===void 0?void 0:l.filter(f=>f.executableCode).map(f=>f.executableCode).filter(f=>f!==void 0);if(d?.length!==0)return(u=d?.[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var e,n,i,r,s,o,a,l,u;if(((r=(i=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const d=(l=(a=(o=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||l===void 0?void 0:l.filter(f=>f.codeExecutionResult).map(f=>f.codeExecutionResult).filter(f=>f!==void 0);if(d?.length!==0)return(u=d?.[0])===null||u===void 0?void 0:u.output}}class DL{}class PL{}class GAe{}class $Ae{}class WAe{}class jAe{}class NL{}class OL{}class BL{}class KAe{}class Ov{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){const i=new Ov;let r;const s=e;return n?r=DAe(s):r=MAe(s),Object.assign(i,r),i}}class LL{}class UL{}class VL{}class FL{}class YAe{}class qAe{}class JAe{}class RR{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){const i=new RR,s=VAe(e);return Object.assign(i,s),i}}class XAe{}class ZAe{}class e0e{}class HL{}class t0e{get text(){var e,n,i;let r="",s=!1;const o=[];for(const a of(i=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&i!==void 0?i:[]){for(const[l,u]of Object.entries(a))l!=="text"&&l!=="thought"&&u!==null&&o.push(l);if(typeof a.text=="string"){if(typeof a.thought=="boolean"&&a.thought)continue;s=!0,r+=a.text}}return o.length>0&&console.warn(`there are non-text parts ${o} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),s?r:void 0}get data(){var e,n,i;let r="";const s=[];for(const o of(i=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&i!==void 0?i:[]){for(const[a,l]of Object.entries(o))a!=="inlineData"&&l!==null&&s.push(a);o.inlineData&&typeof o.inlineData.data=="string"&&(r+=atob(o.inlineData.data))}return s.length>0&&console.warn(`there are non-data parts ${s} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),r.length>0?btoa(r):void 0}}class n0e{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class kR{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){const i=new kR,s=ZH(e);return Object.assign(i,s),i}}function St(t,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(t.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const n=e.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function e7(t,e){const n=St(t,e);return n?n.startsWith("publishers/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}`:n.startsWith("models/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/publishers/google/${n}`:n:""}function t7(t){return Array.isArray(t)?t.map(e=>Bv(e)):[Bv(t)]}function Bv(t){if(typeof t=="object"&&t!==null)return t;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof t}`)}function n7(t){const e=Bv(t);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function i7(t){const e=Bv(t);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function zL(t){if(t==null)throw new Error("PartUnion is required");if(typeof t=="object")return t;if(typeof t=="string")return{text:t};throw new Error(`Unsupported part type: ${typeof t}`)}function r7(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("PartListUnion is required");return Array.isArray(t)?t.map(e=>zL(e)):[zL(t)]}function A_(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}function QL(t){return t!=null&&typeof t=="object"&&"functionCall"in t}function GL(t){return t!=null&&typeof t=="object"&&"functionResponse"in t}function gi(t){if(t==null)throw new Error("ContentUnion is required");return A_(t)?t:{role:"user",parts:r7(t)}}function IR(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{const i=gi(n);return i.parts&&i.parts.length>0&&i.parts[0].text!==void 0?[i.parts[0].text]:[]});if(t.isVertexAI()){const n=gi(e);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(e)?e.map(n=>gi(n)):[gi(e)]}function Jr(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("contents are required");if(!Array.isArray(t)){if(QL(t)||GL(t))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[gi(t)]}const e=[],n=[],i=A_(t[0]);for(const r of t){const s=A_(r);if(s!=i)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(s)e.push(r);else{if(QL(r)||GL(r))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");n.push(r)}}return i||e.push({role:"user",parts:r7(n)}),e}function i0e(t,e){t.includes("null")&&(e.nullable=!0);const n=t.filter(i=>i!=="null");if(n.length===1)e.type=Object.values(fl).includes(n[0].toUpperCase())?n[0].toUpperCase():fl.TYPE_UNSPECIFIED;else{e.anyOf=[];for(const i of n)e.anyOf.push({type:Object.values(fl).includes(i.toUpperCase())?i.toUpperCase():fl.TYPE_UNSPECIFIED})}}function Md(t){const e={},n=["items"],i=["anyOf"],r=["properties"];if(t.type&&t.anyOf)throw new Error("type and anyOf cannot be both populated.");const s=t.anyOf;s!=null&&s.length==2&&(s[0].type==="null"?(e.nullable=!0,t=s[1]):s[1].type==="null"&&(e.nullable=!0,t=s[0])),t.type instanceof Array&&i0e(t.type,e);for(const[o,a]of Object.entries(t))if(a!=null)if(o=="type"){if(a==="null")throw new Error("type: null can not be the only possible type for the field.");if(a instanceof Array)continue;e.type=Object.values(fl).includes(a.toUpperCase())?a.toUpperCase():fl.TYPE_UNSPECIFIED}else if(n.includes(o))e[o]=Md(a);else if(i.includes(o)){const l=[];for(const u of a){if(u.type=="null"){e.nullable=!0;continue}l.push(Md(u))}e[o]=l}else if(r.includes(o)){const l={};for(const[u,d]of Object.entries(a))l[u]=Md(d);e[o]=l}else{if(o==="additionalProperties")continue;e[o]=a}return e}function MR(t){return Md(t)}function DR(t){if(typeof t=="object")return t;if(typeof t=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:t}}};throw new Error(`Unsupported speechConfig type: ${typeof t}`)}function PR(t){if("multiSpeakerVoiceConfig"in t)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return t}function mh(t){if(t.functionDeclarations)for(const e of t.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=Md(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=Md(e.response));return t}function Ah(t){if(t==null)throw new Error("tools is required");if(!Array.isArray(t))throw new Error("tools is required and must be an array of Tools");const e=[];for(const n of t)e.push(n);return e}function r0e(t,e,n,i=1){const r=!e.startsWith(`${n}/`)&&e.split("/").length===i;return t.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${t.getProject()}/${e}`:e.startsWith(`${n}/`)?`projects/${t.getProject()}/locations/${t.getLocation()}/${e}`:r?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}/${e}`:e:r?`${n}/${e}`:e}function ya(t,e){if(typeof e!="string")throw new Error("name must be a string");return r0e(t,e,"cachedContents")}function s7(t){switch(t){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return t}}function Dl(t){return TR(t)}function s0e(t){return t!=null&&typeof t=="object"&&"name"in t}function o0e(t){return t!=null&&typeof t=="object"&&"video"in t}function a0e(t){return t!=null&&typeof t=="object"&&"uri"in t}function o7(t){var e;let n;if(s0e(t)&&(n=t.name),!(a0e(t)&&(n=t.uri,n===void 0))&&!(o0e(t)&&(n=(e=t.video)===null||e===void 0?void 0:e.uri,n===void 0))){if(typeof t=="string"&&(n=t),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){const r=n.split("files/")[1].match(/[a-z0-9]+/);if(r===null)throw new Error(`Could not extract file name from URI ${n}`);n=r[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}function a7(t,e){let n;return t.isVertexAI()?n=e?"publishers/google/models":"models":n=e?"models":"tunedModels",n}function l7(t){for(const e of["models","tunedModels","publisherModels"])if(l0e(t,e))return t[e];return[]}function l0e(t,e){return t!==null&&typeof t=="object"&&e in t}function c0e(t,e={}){const n=t,i={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(i.responseJsonSchema=n.outputSchema),e.behavior&&(i.behavior=e.behavior),{functionDeclarations:[i]}}function u0e(t,e={}){const n=[],i=new Set;for(const r of t){const s=r.name;if(i.has(s))throw new Error(`Duplicate function name ${s} found in MCP tools. Please ensure function names are unique.`);i.add(s);const o=c0e(r,e);o.functionDeclarations&&n.push(...o.functionDeclarations)}return{functionDeclarations:n}}function c7(t,e){let n;if(typeof e=="string")if(t.isVertexAI())if(e.startsWith("gs://"))n={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))n={format:"bigquery",bigqueryUri:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))n={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(t.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");n={inlinedRequests:e}}else n=e;const i=[n.gcsUri,n.bigqueryUri].filter(Boolean).length,r=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(t.isVertexAI()){if(r>0||i!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(i>0||r!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function d0e(t){if(typeof t!="string")return t;const e=t;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function u7(t){if(typeof t!="object"||t===null)return{};const e=t,n=e.inlinedResponses;if(typeof n!="object"||n===null)return t;const r=n.inlinedResponses;if(!Array.isArray(r)||r.length===0)return t;let s=!1;for(const o of r){if(typeof o!="object"||o===null)continue;const l=o.response;if(typeof l!="object"||l===null)continue;if(l.embedding!==void 0){s=!0;break}}return s&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),t}function yh(t,e){const n=e;if(!t.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}function d7(t){const e=t;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}function h0e(t){const e={},n=y(t,["responsesFile"]);n!=null&&b(e,["fileName"],n);const i=y(t,["inlinedResponses","inlinedResponses"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>W0e(o))),b(e,["inlinedResponses"],s)}const r=y(t,["inlinedEmbedContentResponses","inlinedResponses"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["inlinedEmbedContentResponses"],s)}return e}function f0e(t){const e={},n=y(t,["predictionsFormat"]);n!=null&&b(e,["format"],n);const i=y(t,["gcsDestination","outputUriPrefix"]);i!=null&&b(e,["gcsUri"],i);const r=y(t,["bigqueryDestination","outputUri"]);return r!=null&&b(e,["bigqueryUri"],r),e}function p0e(t){const e={},n=y(t,["format"]);n!=null&&b(e,["predictionsFormat"],n);const i=y(t,["gcsUri"]);i!=null&&b(e,["gcsDestination","outputUriPrefix"],i);const r=y(t,["bigqueryUri"]);if(r!=null&&b(e,["bigqueryDestination","outputUri"],r),y(t,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(y(t,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(y(t,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return e}function $y(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata","displayName"]);i!=null&&b(e,["displayName"],i);const r=y(t,["metadata","state"]);r!=null&&b(e,["state"],d7(r));const s=y(t,["metadata","createTime"]);s!=null&&b(e,["createTime"],s);const o=y(t,["metadata","endTime"]);o!=null&&b(e,["endTime"],o);const a=y(t,["metadata","updateTime"]);a!=null&&b(e,["updateTime"],a);const l=y(t,["metadata","model"]);l!=null&&b(e,["model"],l);const u=y(t,["metadata","output"]);return u!=null&&b(e,["dest"],h0e(u7(u))),e}function y_(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["displayName"]);i!=null&&b(e,["displayName"],i);const r=y(t,["state"]);r!=null&&b(e,["state"],d7(r));const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["createTime"]);o!=null&&b(e,["createTime"],o);const a=y(t,["startTime"]);a!=null&&b(e,["startTime"],a);const l=y(t,["endTime"]);l!=null&&b(e,["endTime"],l);const u=y(t,["updateTime"]);u!=null&&b(e,["updateTime"],u);const d=y(t,["model"]);d!=null&&b(e,["model"],d);const f=y(t,["inputConfig"]);f!=null&&b(e,["src"],g0e(f));const g=y(t,["outputConfig"]);g!=null&&b(e,["dest"],f0e(u7(g)));const m=y(t,["completionStats"]);return m!=null&&b(e,["completionStats"],m),e}function g0e(t){const e={},n=y(t,["instancesFormat"]);n!=null&&b(e,["format"],n);const i=y(t,["gcsSource","uris"]);i!=null&&b(e,["gcsUri"],i);const r=y(t,["bigquerySource","inputUri"]);return r!=null&&b(e,["bigqueryUri"],r),e}function m0e(t,e){const n={};if(y(e,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(y(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(y(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const i=y(e,["fileName"]);i!=null&&b(n,["fileName"],i);const r=y(e,["inlinedRequests"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>$0e(t,o))),b(n,["requests","requests"],s)}return n}function A0e(t){const e={},n=y(t,["format"]);n!=null&&b(e,["instancesFormat"],n);const i=y(t,["gcsUri"]);i!=null&&b(e,["gcsSource","uris"],i);const r=y(t,["bigqueryUri"]);if(r!=null&&b(e,["bigquerySource","inputUri"],r),y(t,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(y(t,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return e}function y0e(t){const e={},n=y(t,["data"]);if(n!=null&&b(e,["data"],n),y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function v0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function b0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function w0e(t){const e={},n=y(t,["content"]);n!=null&&b(e,["content"],n);const i=y(t,["citationMetadata"]);i!=null&&b(e,["citationMetadata"],S0e(i));const r=y(t,["tokenCount"]);r!=null&&b(e,["tokenCount"],r);const s=y(t,["finishReason"]);s!=null&&b(e,["finishReason"],s);const o=y(t,["avgLogprobs"]);o!=null&&b(e,["avgLogprobs"],o);const a=y(t,["groundingMetadata"]);a!=null&&b(e,["groundingMetadata"],a);const l=y(t,["index"]);l!=null&&b(e,["index"],l);const u=y(t,["logprobsResult"]);u!=null&&b(e,["logprobsResult"],u);const d=y(t,["safetyRatings"]);if(d!=null){let g=d;Array.isArray(g)&&(g=g.map(m=>m)),b(e,["safetyRatings"],g)}const f=y(t,["urlContextMetadata"]);return f!=null&&b(e,["urlContextMetadata"],f),e}function S0e(t){const e={},n=y(t,["citationSources"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(r=>r)),b(e,["citations"],i)}return e}function h7(t){const e={},n=y(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>Z0e(s))),b(e,["parts"],r)}const i=y(t,["role"]);return i!=null&&b(e,["role"],i),e}function C0e(t,e){const n={},i=y(t,["displayName"]);if(e!==void 0&&i!=null&&b(e,["batch","displayName"],i),y(t,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return n}function x0e(t,e){const n={},i=y(t,["displayName"]);e!==void 0&&i!=null&&b(e,["displayName"],i);const r=y(t,["dest"]);return e!==void 0&&r!=null&&b(e,["outputConfig"],p0e(d0e(r))),n}function $L(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["src"]);r!=null&&b(n,["batch","inputConfig"],m0e(t,c7(t,r)));const s=y(e,["config"]);return s!=null&&C0e(s,n),n}function E0e(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["model"],St(t,i));const r=y(e,["src"]);r!=null&&b(n,["inputConfig"],A0e(c7(t,r)));const s=y(e,["config"]);return s!=null&&x0e(s,n),n}function _0e(t,e){const n={},i=y(t,["displayName"]);return e!==void 0&&i!=null&&b(e,["batch","displayName"],i),n}function T0e(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["src"]);r!=null&&b(n,["batch","inputConfig"],N0e(t,r));const s=y(e,["config"]);return s!=null&&_0e(s,n),n}function R0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function k0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function I0e(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["name"]);i!=null&&b(e,["name"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);return s!=null&&b(e,["error"],s),e}function M0e(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["name"]);i!=null&&b(e,["name"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);return s!=null&&b(e,["error"],s),e}function D0e(t,e){const n={},i=y(e,["contents"]);if(i!=null){let s=IR(t,i);Array.isArray(s)&&(s=s.map(o=>o)),b(n,["requests[]","request","content"],s)}const r=y(e,["config"]);return r!=null&&(b(n,["_self"],P0e(r,n)),kAe(n,{"requests[].*":"requests[].request.*"})),n}function P0e(t,e){const n={},i=y(t,["taskType"]);e!==void 0&&i!=null&&b(e,["requests[]","taskType"],i);const r=y(t,["title"]);e!==void 0&&r!=null&&b(e,["requests[]","title"],r);const s=y(t,["outputDimensionality"]);if(e!==void 0&&s!=null&&b(e,["requests[]","outputDimensionality"],s),y(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(y(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function N0e(t,e){const n={},i=y(e,["fileName"]);i!=null&&b(n,["file_name"],i);const r=y(e,["inlinedRequests"]);return r!=null&&b(n,["requests"],D0e(t,r)),n}function O0e(t){const e={};if(y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=y(t,["fileUri"]);n!=null&&b(e,["fileUri"],n);const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function B0e(t){const e={},n=y(t,["id"]);n!=null&&b(e,["id"],n);const i=y(t,["args"]);i!=null&&b(e,["args"],i);const r=y(t,["name"]);if(r!=null&&b(e,["name"],r),y(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(y(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function L0e(t){const e={},n=y(t,["allowedFunctionNames"]);n!=null&&b(e,["allowedFunctionNames"],n);const i=y(t,["mode"]);if(i!=null&&b(e,["mode"],i),y(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function U0e(t,e,n){const i={},r=y(e,["systemInstruction"]);n!==void 0&&r!=null&&b(n,["systemInstruction"],h7(gi(r)));const s=y(e,["temperature"]);s!=null&&b(i,["temperature"],s);const o=y(e,["topP"]);o!=null&&b(i,["topP"],o);const a=y(e,["topK"]);a!=null&&b(i,["topK"],a);const l=y(e,["candidateCount"]);l!=null&&b(i,["candidateCount"],l);const u=y(e,["maxOutputTokens"]);u!=null&&b(i,["maxOutputTokens"],u);const d=y(e,["stopSequences"]);d!=null&&b(i,["stopSequences"],d);const f=y(e,["responseLogprobs"]);f!=null&&b(i,["responseLogprobs"],f);const g=y(e,["logprobs"]);g!=null&&b(i,["logprobs"],g);const m=y(e,["presencePenalty"]);m!=null&&b(i,["presencePenalty"],m);const v=y(e,["frequencyPenalty"]);v!=null&&b(i,["frequencyPenalty"],v);const S=y(e,["seed"]);S!=null&&b(i,["seed"],S);const C=y(e,["responseMimeType"]);C!=null&&b(i,["responseMimeType"],C);const E=y(e,["responseSchema"]);E!=null&&b(i,["responseSchema"],MR(E));const k=y(e,["responseJsonSchema"]);if(k!=null&&b(i,["responseJsonSchema"],k),y(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(y(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const R=y(e,["safetySettings"]);if(n!==void 0&&R!=null){let X=R;Array.isArray(X)&&(X=X.map(J=>eye(J))),b(n,["safetySettings"],X)}const M=y(e,["tools"]);if(n!==void 0&&M!=null){let X=Ah(M);Array.isArray(X)&&(X=X.map(J=>nye(mh(J)))),b(n,["tools"],X)}const D=y(e,["toolConfig"]);if(n!==void 0&&D!=null&&b(n,["toolConfig"],tye(D)),y(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const P=y(e,["cachedContent"]);n!==void 0&&P!=null&&b(n,["cachedContent"],ya(t,P));const N=y(e,["responseModalities"]);N!=null&&b(i,["responseModalities"],N);const B=y(e,["mediaResolution"]);B!=null&&b(i,["mediaResolution"],B);const G=y(e,["speechConfig"]);if(G!=null&&b(i,["speechConfig"],DR(G)),y(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const V=y(e,["thinkingConfig"]);V!=null&&b(i,["thinkingConfig"],V);const $=y(e,["imageConfig"]);$!=null&&b(i,["imageConfig"],G0e($));const K=y(e,["enableEnhancedCivicAnswers"]);return K!=null&&b(i,["enableEnhancedCivicAnswers"],K),i}function V0e(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["candidates"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>w0e(u))),b(e,["candidates"],l)}const r=y(t,["modelVersion"]);r!=null&&b(e,["modelVersion"],r);const s=y(t,["promptFeedback"]);s!=null&&b(e,["promptFeedback"],s);const o=y(t,["responseId"]);o!=null&&b(e,["responseId"],o);const a=y(t,["usageMetadata"]);return a!=null&&b(e,["usageMetadata"],a),e}function F0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function H0e(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],yh(t,i)),n}function z0e(t){const e={};if(y(t,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=y(t,["enableWidget"]);return n!=null&&b(e,["enableWidget"],n),e}function Q0e(t){const e={};if(y(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(y(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=y(t,["timeRangeFilter"]);return n!=null&&b(e,["timeRangeFilter"],n),e}function G0e(t){const e={},n=y(t,["aspectRatio"]);n!=null&&b(e,["aspectRatio"],n);const i=y(t,["imageSize"]);if(i!=null&&b(e,["imageSize"],i),y(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(y(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(y(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return e}function $0e(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["request","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let a=Jr(r);Array.isArray(a)&&(a=a.map(l=>h7(l))),b(n,["request","contents"],a)}const s=y(e,["metadata"]);s!=null&&b(n,["metadata"],s);const o=y(e,["config"]);return o!=null&&b(n,["request","generationConfig"],U0e(t,o,y(n,["request"],{}))),n}function W0e(t){const e={},n=y(t,["response"]);n!=null&&b(e,["response"],V0e(n));const i=y(t,["error"]);return i!=null&&b(e,["error"],i),e}function j0e(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);if(e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),y(t,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return n}function K0e(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);e!==void 0&&r!=null&&b(e,["_query","pageToken"],r);const s=y(t,["filter"]);return e!==void 0&&s!=null&&b(e,["_query","filter"],s),n}function Y0e(t){const e={},n=y(t,["config"]);return n!=null&&j0e(n,e),e}function q0e(t){const e={},n=y(t,["config"]);return n!=null&&K0e(n,e),e}function J0e(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["operations"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>$y(o))),b(e,["batchJobs"],s)}return e}function X0e(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["batchPredictionJobs"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>y_(o))),b(e,["batchJobs"],s)}return e}function Z0e(t){const e={},n=y(t,["mediaResolution"]);n!=null&&b(e,["mediaResolution"],n);const i=y(t,["codeExecutionResult"]);i!=null&&b(e,["codeExecutionResult"],i);const r=y(t,["executableCode"]);r!=null&&b(e,["executableCode"],r);const s=y(t,["fileData"]);s!=null&&b(e,["fileData"],O0e(s));const o=y(t,["functionCall"]);o!=null&&b(e,["functionCall"],B0e(o));const a=y(t,["functionResponse"]);a!=null&&b(e,["functionResponse"],a);const l=y(t,["inlineData"]);l!=null&&b(e,["inlineData"],y0e(l));const u=y(t,["text"]);u!=null&&b(e,["text"],u);const d=y(t,["thought"]);d!=null&&b(e,["thought"],d);const f=y(t,["thoughtSignature"]);f!=null&&b(e,["thoughtSignature"],f);const g=y(t,["videoMetadata"]);return g!=null&&b(e,["videoMetadata"],g),e}function eye(t){const e={},n=y(t,["category"]);if(n!=null&&b(e,["category"],n),y(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const i=y(t,["threshold"]);return i!=null&&b(e,["threshold"],i),e}function tye(t){const e={},n=y(t,["retrievalConfig"]);n!=null&&b(e,["retrievalConfig"],n);const i=y(t,["functionCallingConfig"]);return i!=null&&b(e,["functionCallingConfig"],L0e(i)),e}function nye(t){const e={};if(y(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=y(t,["computerUse"]);n!=null&&b(e,["computerUse"],n);const i=y(t,["fileSearch"]);i!=null&&b(e,["fileSearch"],i);const r=y(t,["codeExecution"]);if(r!=null&&b(e,["codeExecution"],r),y(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const s=y(t,["functionDeclarations"]);if(s!=null){let d=s;Array.isArray(d)&&(d=d.map(f=>f)),b(e,["functionDeclarations"],d)}const o=y(t,["googleMaps"]);o!=null&&b(e,["googleMaps"],z0e(o));const a=y(t,["googleSearch"]);a!=null&&b(e,["googleSearch"],Q0e(a));const l=y(t,["googleSearchRetrieval"]);l!=null&&b(e,["googleSearchRetrieval"],l);const u=y(t,["urlContext"]);return u!=null&&b(e,["urlContext"],u),e}var da;(function(t){t.PAGED_ITEM_BATCH_JOBS="batchJobs",t.PAGED_ITEM_MODELS="models",t.PAGED_ITEM_TUNING_JOBS="tuningJobs",t.PAGED_ITEM_FILES="files",t.PAGED_ITEM_CACHED_CONTENTS="cachedContents",t.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",t.PAGED_ITEM_DOCUMENTS="documents"})(da||(da={}));class jc{constructor(e,n,i,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(e,i,r)}init(e,n,i){var r,s;this.nameInternal=e,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n?.sdkHttpResponse,this.idxInternal=0;let o={config:{}};!i||Object.keys(i).length===0?o={config:{}}:typeof i=="object"?o=Object.assign({},i):o=i,o.config&&(o.config.pageToken=n.nextPageToken),this.paramsInternal=o,this.pageInternalSize=(s=(r=o.config)===null||r===void 0?void 0:r.pageSize)!==null&&s!==void 0?s:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}class iye extends Aa{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new jc(da.PAGED_ITEM_BATCH_JOBS,i=>this.listInternal(i),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(n)}}createInlinedGenerateContentRequest(e){const n=$L(this.apiClient,e),i=n._url,r=Re("{model}:batchGenerateContent",i),a=n.batch.inputConfig.requests,l=a.requests,u=[];for(const d of l){const f=Object.assign({},d);if(f.systemInstruction){const g=f.systemInstruction;delete f.systemInstruction;const m=f.request;m.systemInstruction=g,f.request=m}u.push(f)}return a.requests=u,delete n.config,delete n._url,delete n._query,{path:r,body:n}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,n){const i=n?Object.assign({},n):{},r=Date.now().toString();if(i.displayName||(i.displayName=`genaiBatchJob_${r}`),i.dest===void 0){const s=this.getGcsUri(e),o=this.getBigqueryUri(e);if(s)s.endsWith(".jsonl")?i.dest=`${s.slice(0,-6)}/dest`:i.dest=`${s}_dest_${r}`;else if(o)i.dest=`${o}_dest_${r}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return i}async createInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=E0e(this.apiClient,e);return a=Re("batchPredictionJobs",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>y_(d))}else{const u=$L(this.apiClient,e);return a=Re("{model}:batchGenerateContent",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>$y(d))}}async createEmbeddingsInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=T0e(this.apiClient,e);return s=Re("{model}:asyncBatchEmbedContent",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>$y(l))}}async get(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=H0e(this.apiClient,e);return a=Re("batchPredictionJobs/{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>y_(d))}else{const u=F0e(this.apiClient,e);return a=Re("batches/{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>$y(d))}}async cancel(e){var n,i,r,s;let o="",a={};if(this.apiClient.isVertexAI()){const l=b0e(this.apiClient,e);o=Re("batchPredictionJobs/{name}:cancel",l._url),a=l._query,delete l._url,delete l._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}else{const l=v0e(this.apiClient,e);o=Re("batches/{name}:cancel",l._url),a=l._query,delete l._url,delete l._query,await this.apiClient.request({path:o,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal})}}async listInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=q0e(e);return a=Re("batchPredictionJobs",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=X0e(d),g=new HL;return Object.assign(g,f),g})}else{const u=Y0e(e);return a=Re("batches",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=J0e(d),g=new HL;return Object.assign(g,f),g})}}async delete(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=k0e(this.apiClient,e);return a=Re("batchPredictionJobs/{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>M0e(d))}else{const u=R0e(this.apiClient,e);return a=Re("batches/{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>I0e(d))}}}function rye(t){const e={},n=y(t,["data"]);if(n!=null&&b(e,["data"],n),y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function WL(t){const e={},n=y(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>Tye(s))),b(e,["parts"],r)}const i=y(t,["role"]);return i!=null&&b(e,["role"],i),e}function sye(t,e){const n={},i=y(t,["ttl"]);e!==void 0&&i!=null&&b(e,["ttl"],i);const r=y(t,["expireTime"]);e!==void 0&&r!=null&&b(e,["expireTime"],r);const s=y(t,["displayName"]);e!==void 0&&s!=null&&b(e,["displayName"],s);const o=y(t,["contents"]);if(e!==void 0&&o!=null){let d=Jr(o);Array.isArray(d)&&(d=d.map(f=>WL(f))),b(e,["contents"],d)}const a=y(t,["systemInstruction"]);e!==void 0&&a!=null&&b(e,["systemInstruction"],WL(gi(a)));const l=y(t,["tools"]);if(e!==void 0&&l!=null){let d=l;Array.isArray(d)&&(d=d.map(f=>kye(f))),b(e,["tools"],d)}const u=y(t,["toolConfig"]);if(e!==void 0&&u!=null&&b(e,["toolConfig"],Rye(u)),y(t,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return n}function oye(t,e){const n={},i=y(t,["ttl"]);e!==void 0&&i!=null&&b(e,["ttl"],i);const r=y(t,["expireTime"]);e!==void 0&&r!=null&&b(e,["expireTime"],r);const s=y(t,["displayName"]);e!==void 0&&s!=null&&b(e,["displayName"],s);const o=y(t,["contents"]);if(e!==void 0&&o!=null){let f=Jr(o);Array.isArray(f)&&(f=f.map(g=>g)),b(e,["contents"],f)}const a=y(t,["systemInstruction"]);e!==void 0&&a!=null&&b(e,["systemInstruction"],gi(a));const l=y(t,["tools"]);if(e!==void 0&&l!=null){let f=l;Array.isArray(f)&&(f=f.map(g=>Iye(g))),b(e,["tools"],f)}const u=y(t,["toolConfig"]);e!==void 0&&u!=null&&b(e,["toolConfig"],u);const d=y(t,["kmsKeyName"]);return e!==void 0&&d!=null&&b(e,["encryption_spec","kmsKeyName"],d),n}function aye(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["model"],e7(t,i));const r=y(e,["config"]);return r!=null&&sye(r,n),n}function lye(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["model"],e7(t,i));const r=y(e,["config"]);return r!=null&&oye(r,n),n}function cye(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],ya(t,i)),n}function uye(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],ya(t,i)),n}function dye(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function hye(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function fye(t){const e={};if(y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=y(t,["fileUri"]);n!=null&&b(e,["fileUri"],n);const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function pye(t){const e={},n=y(t,["id"]);n!=null&&b(e,["id"],n);const i=y(t,["args"]);i!=null&&b(e,["args"],i);const r=y(t,["name"]);if(r!=null&&b(e,["name"],r),y(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(y(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function gye(t){const e={},n=y(t,["allowedFunctionNames"]);n!=null&&b(e,["allowedFunctionNames"],n);const i=y(t,["mode"]);if(i!=null&&b(e,["mode"],i),y(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function mye(t){const e={},n=y(t,["description"]);n!=null&&b(e,["description"],n);const i=y(t,["name"]);i!=null&&b(e,["name"],i);const r=y(t,["parameters"]);r!=null&&b(e,["parameters"],r);const s=y(t,["parametersJsonSchema"]);s!=null&&b(e,["parametersJsonSchema"],s);const o=y(t,["response"]);o!=null&&b(e,["response"],o);const a=y(t,["responseJsonSchema"]);if(a!=null&&b(e,["responseJsonSchema"],a),y(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return e}function Aye(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],ya(t,i)),n}function yye(t,e){const n={},i=y(e,["name"]);return i!=null&&b(n,["_url","name"],ya(t,i)),n}function vye(t){const e={};if(y(t,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=y(t,["enableWidget"]);return n!=null&&b(e,["enableWidget"],n),e}function bye(t){const e={};if(y(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(y(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=y(t,["timeRangeFilter"]);return n!=null&&b(e,["timeRangeFilter"],n),e}function wye(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);return e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),n}function Sye(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);return e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),n}function Cye(t){const e={},n=y(t,["config"]);return n!=null&&wye(n,e),e}function xye(t){const e={},n=y(t,["config"]);return n!=null&&Sye(n,e),e}function Eye(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["cachedContents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["cachedContents"],s)}return e}function _ye(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["cachedContents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["cachedContents"],s)}return e}function Tye(t){const e={},n=y(t,["mediaResolution"]);n!=null&&b(e,["mediaResolution"],n);const i=y(t,["codeExecutionResult"]);i!=null&&b(e,["codeExecutionResult"],i);const r=y(t,["executableCode"]);r!=null&&b(e,["executableCode"],r);const s=y(t,["fileData"]);s!=null&&b(e,["fileData"],fye(s));const o=y(t,["functionCall"]);o!=null&&b(e,["functionCall"],pye(o));const a=y(t,["functionResponse"]);a!=null&&b(e,["functionResponse"],a);const l=y(t,["inlineData"]);l!=null&&b(e,["inlineData"],rye(l));const u=y(t,["text"]);u!=null&&b(e,["text"],u);const d=y(t,["thought"]);d!=null&&b(e,["thought"],d);const f=y(t,["thoughtSignature"]);f!=null&&b(e,["thoughtSignature"],f);const g=y(t,["videoMetadata"]);return g!=null&&b(e,["videoMetadata"],g),e}function Rye(t){const e={},n=y(t,["retrievalConfig"]);n!=null&&b(e,["retrievalConfig"],n);const i=y(t,["functionCallingConfig"]);return i!=null&&b(e,["functionCallingConfig"],gye(i)),e}function kye(t){const e={};if(y(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=y(t,["computerUse"]);n!=null&&b(e,["computerUse"],n);const i=y(t,["fileSearch"]);i!=null&&b(e,["fileSearch"],i);const r=y(t,["codeExecution"]);if(r!=null&&b(e,["codeExecution"],r),y(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const s=y(t,["functionDeclarations"]);if(s!=null){let d=s;Array.isArray(d)&&(d=d.map(f=>f)),b(e,["functionDeclarations"],d)}const o=y(t,["googleMaps"]);o!=null&&b(e,["googleMaps"],vye(o));const a=y(t,["googleSearch"]);a!=null&&b(e,["googleSearch"],bye(a));const l=y(t,["googleSearchRetrieval"]);l!=null&&b(e,["googleSearchRetrieval"],l);const u=y(t,["urlContext"]);return u!=null&&b(e,["urlContext"],u),e}function Iye(t){const e={},n=y(t,["retrieval"]);n!=null&&b(e,["retrieval"],n);const i=y(t,["computerUse"]);if(i!=null&&b(e,["computerUse"],i),y(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=y(t,["codeExecution"]);r!=null&&b(e,["codeExecution"],r);const s=y(t,["enterpriseWebSearch"]);s!=null&&b(e,["enterpriseWebSearch"],s);const o=y(t,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(g=>mye(g))),b(e,["functionDeclarations"],f)}const a=y(t,["googleMaps"]);a!=null&&b(e,["googleMaps"],a);const l=y(t,["googleSearch"]);l!=null&&b(e,["googleSearch"],l);const u=y(t,["googleSearchRetrieval"]);u!=null&&b(e,["googleSearchRetrieval"],u);const d=y(t,["urlContext"]);return d!=null&&b(e,["urlContext"],d),e}function Mye(t,e){const n={},i=y(t,["ttl"]);e!==void 0&&i!=null&&b(e,["ttl"],i);const r=y(t,["expireTime"]);return e!==void 0&&r!=null&&b(e,["expireTime"],r),n}function Dye(t,e){const n={},i=y(t,["ttl"]);e!==void 0&&i!=null&&b(e,["ttl"],i);const r=y(t,["expireTime"]);return e!==void 0&&r!=null&&b(e,["expireTime"],r),n}function Pye(t,e){const n={},i=y(e,["name"]);i!=null&&b(n,["_url","name"],ya(t,i));const r=y(e,["config"]);return r!=null&&Mye(r,n),n}function Nye(t,e){const n={},i=y(e,["name"]);i!=null&&b(n,["_url","name"],ya(t,i));const r=y(e,["config"]);return r!=null&&Dye(r,n),n}class Oye extends Aa{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new jc(da.PAGED_ITEM_CACHED_CONTENTS,i=>this.listInternal(i),await this.listInternal(n),n)}async create(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=lye(this.apiClient,e);return a=Re("cachedContents",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>d)}else{const u=aye(this.apiClient,e);return a=Re("cachedContents",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>d)}}async get(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=yye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>d)}else{const u=Aye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>d)}}async delete(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=uye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=hye(d),g=new VL;return Object.assign(g,f),g})}else{const u=cye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=dye(d),g=new VL;return Object.assign(g,f),g})}}async update(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Nye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>d)}else{const u=Pye(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>d)}}async listInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=xye(e);return a=Re("cachedContents",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=_ye(d),g=new FL;return Object.assign(g,f),g})}else{const u=Cye(e);return a=Re("cachedContents",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Eye(d),g=new FL;return Object.assign(g,f),g})}}}function Lv(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ke(t){return this instanceof Ke?(this.v=t,this):new Ke(t)}function xs(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),r[Symbol.asyncIterator]=function(){return this},r;function o(m){return function(v){return Promise.resolve(v).then(m,f)}}function a(m,v){i[m]&&(r[m]=function(S){return new Promise(function(C,E){s.push([m,S,C,E])>1||l(m,S)})},v&&(r[m]=v(r[m])))}function l(m,v){try{u(i[m](v))}catch(S){g(s[0][3],S)}}function u(m){m.value instanceof Ke?Promise.resolve(m.value.v).then(d,f):g(s[0][2],m)}function d(m){l("next",m)}function f(m){l("throw",m)}function g(m,v){m(v),s.shift(),s.length&&l(s[0][0],s[0][1])}}function Es(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof jL=="function"?jL(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(s){n[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),r(a,l,o.done,o.value)})}}function r(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}function Bye(t){var e;if(t.candidates==null||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;return n===void 0?!1:f7(n)}function f7(t){if(t.parts===void 0||t.parts.length===0)return!1;for(const e of t.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function Lye(t){if(t.length!==0){for(const e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function KL(t){if(t===void 0||t.length===0)return[];const e=[],n=t.length;let i=0;for(;i{var s,o,a;const l=await r,u=(o=(s=l.candidates)===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.content,d=l.automaticFunctionCallingHistory,f=this.getHistory(!0).length;let g=[];d!=null&&(g=(a=d.slice(f))!==null&&a!==void 0?a:[]);const m=u?[u]:[];this.recordHistory(i,m,g)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),r}async sendMessageStream(e){var n;await this.sendPromise;const i=gi(e.message),r=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(i),config:(n=e.config)!==null&&n!==void 0?n:this.config});this.sendPromise=r.then(()=>{}).catch(()=>{});const s=await r;return this.processStreamResponse(s,i)}getHistory(e=!1){const n=e?KL(this.history):this.history;return structuredClone(n)}processStreamResponse(e,n){return xs(this,arguments,function*(){var r,s,o,a,l,u;const d=[];try{for(var f=!0,g=Es(e),m;m=yield Ke(g.next()),r=m.done,!r;f=!0){a=m.value,f=!1;const v=a;if(Bye(v)){const S=(u=(l=v.candidates)===null||l===void 0?void 0:l[0])===null||u===void 0?void 0:u.content;S!==void 0&&d.push(S)}yield yield Ke(v)}}catch(v){s={error:v}}finally{try{!f&&!r&&(o=g.return)&&(yield Ke(o.call(g)))}finally{if(s)throw s.error}}this.recordHistory(n,d)})}recordHistory(e,n,i){let r=[];n.length>0&&n.every(s=>s.role!==void 0)?r=n:r.push({role:"model",parts:[]}),i&&i.length>0?this.history.push(...KL(i)):this.history.push(e),this.history.push(...r)}}class hw extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,hw.prototype)}}function Fye(t){const e={},n=y(t,["file"]);return n!=null&&b(e,["file"],n),e}function Hye(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function zye(t){const e={},n=y(t,["name"]);return n!=null&&b(e,["_url","file"],o7(n)),e}function Qye(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function Gye(t){const e={},n=y(t,["name"]);return n!=null&&b(e,["_url","file"],o7(n)),e}function $ye(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);return e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),n}function Wye(t){const e={},n=y(t,["config"]);return n!=null&&$ye(n,e),e}function jye(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["files"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["files"],s)}return e}class Kye extends Aa{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new jc(da.PAGED_ITEM_FILES,i=>this.listInternal(i),await this.listInternal(n),n)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(n=>n)}async download(e){await this.apiClient.downloadFile(e)}async listInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=Wye(e);return s=Re("files",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>{const u=jye(l),d=new XAe;return Object.assign(d,u),d})}}async createInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=Fye(e);return s=Re("upload/v1beta/files",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=Hye(l),d=new ZAe;return Object.assign(d,u),d})}}async get(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=Gye(e);return s=Re("files/{file}",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=zye(e);return s=Re("files/{file}",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>{const u=Qye(l),d=new e0e;return Object.assign(d,u),d})}}}function Wy(t){const e={},n=y(t,["data"]);if(n!=null&&b(e,["data"],n),y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Yye(t){const e={},n=y(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>dve(s))),b(e,["parts"],r)}const i=y(t,["role"]);return i!=null&&b(e,["role"],i),e}function qye(t){const e={};if(y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=y(t,["fileUri"]);n!=null&&b(e,["fileUri"],n);const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Jye(t){const e={},n=y(t,["id"]);n!=null&&b(e,["id"],n);const i=y(t,["args"]);i!=null&&b(e,["args"],i);const r=y(t,["name"]);if(r!=null&&b(e,["name"],r),y(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(y(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function Xye(t){const e={},n=y(t,["description"]);n!=null&&b(e,["description"],n);const i=y(t,["name"]);i!=null&&b(e,["name"],i);const r=y(t,["parameters"]);r!=null&&b(e,["parameters"],r);const s=y(t,["parametersJsonSchema"]);s!=null&&b(e,["parametersJsonSchema"],s);const o=y(t,["response"]);o!=null&&b(e,["response"],o);const a=y(t,["responseJsonSchema"]);if(a!=null&&b(e,["responseJsonSchema"],a),y(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return e}function Zye(t){const e={},n=y(t,["modelSelectionConfig"]);n!=null&&b(e,["modelConfig"],n);const i=y(t,["responseJsonSchema"]);i!=null&&b(e,["responseJsonSchema"],i);const r=y(t,["audioTimestamp"]);r!=null&&b(e,["audioTimestamp"],r);const s=y(t,["candidateCount"]);s!=null&&b(e,["candidateCount"],s);const o=y(t,["enableAffectiveDialog"]);o!=null&&b(e,["enableAffectiveDialog"],o);const a=y(t,["frequencyPenalty"]);a!=null&&b(e,["frequencyPenalty"],a);const l=y(t,["logprobs"]);l!=null&&b(e,["logprobs"],l);const u=y(t,["maxOutputTokens"]);u!=null&&b(e,["maxOutputTokens"],u);const d=y(t,["mediaResolution"]);d!=null&&b(e,["mediaResolution"],d);const f=y(t,["presencePenalty"]);f!=null&&b(e,["presencePenalty"],f);const g=y(t,["responseLogprobs"]);g!=null&&b(e,["responseLogprobs"],g);const m=y(t,["responseMimeType"]);m!=null&&b(e,["responseMimeType"],m);const v=y(t,["responseModalities"]);v!=null&&b(e,["responseModalities"],v);const S=y(t,["responseSchema"]);S!=null&&b(e,["responseSchema"],S);const C=y(t,["routingConfig"]);C!=null&&b(e,["routingConfig"],C);const E=y(t,["seed"]);E!=null&&b(e,["seed"],E);const k=y(t,["speechConfig"]);k!=null&&b(e,["speechConfig"],k);const R=y(t,["stopSequences"]);R!=null&&b(e,["stopSequences"],R);const M=y(t,["temperature"]);M!=null&&b(e,["temperature"],M);const D=y(t,["thinkingConfig"]);D!=null&&b(e,["thinkingConfig"],D);const P=y(t,["topK"]);P!=null&&b(e,["topK"],P);const N=y(t,["topP"]);if(N!=null&&b(e,["topP"],N),y(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return e}function eve(t){const e={};if(y(t,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=y(t,["enableWidget"]);return n!=null&&b(e,["enableWidget"],n),e}function tve(t){const e={};if(y(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(y(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=y(t,["timeRangeFilter"]);return n!=null&&b(e,["timeRangeFilter"],n),e}function nve(t,e){const n={},i=y(t,["generationConfig"]);e!==void 0&&i!=null&&b(e,["setup","generationConfig"],i);const r=y(t,["responseModalities"]);e!==void 0&&r!=null&&b(e,["setup","generationConfig","responseModalities"],r);const s=y(t,["temperature"]);e!==void 0&&s!=null&&b(e,["setup","generationConfig","temperature"],s);const o=y(t,["topP"]);e!==void 0&&o!=null&&b(e,["setup","generationConfig","topP"],o);const a=y(t,["topK"]);e!==void 0&&a!=null&&b(e,["setup","generationConfig","topK"],a);const l=y(t,["maxOutputTokens"]);e!==void 0&&l!=null&&b(e,["setup","generationConfig","maxOutputTokens"],l);const u=y(t,["mediaResolution"]);e!==void 0&&u!=null&&b(e,["setup","generationConfig","mediaResolution"],u);const d=y(t,["seed"]);e!==void 0&&d!=null&&b(e,["setup","generationConfig","seed"],d);const f=y(t,["speechConfig"]);e!==void 0&&f!=null&&b(e,["setup","generationConfig","speechConfig"],PR(f));const g=y(t,["thinkingConfig"]);e!==void 0&&g!=null&&b(e,["setup","generationConfig","thinkingConfig"],g);const m=y(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&b(e,["setup","generationConfig","enableAffectiveDialog"],m);const v=y(t,["systemInstruction"]);e!==void 0&&v!=null&&b(e,["setup","systemInstruction"],Yye(gi(v)));const S=y(t,["tools"]);if(e!==void 0&&S!=null){let P=Ah(S);Array.isArray(P)&&(P=P.map(N=>fve(mh(N)))),b(e,["setup","tools"],P)}const C=y(t,["sessionResumption"]);e!==void 0&&C!=null&&b(e,["setup","sessionResumption"],hve(C));const E=y(t,["inputAudioTranscription"]);e!==void 0&&E!=null&&b(e,["setup","inputAudioTranscription"],E);const k=y(t,["outputAudioTranscription"]);e!==void 0&&k!=null&&b(e,["setup","outputAudioTranscription"],k);const R=y(t,["realtimeInputConfig"]);e!==void 0&&R!=null&&b(e,["setup","realtimeInputConfig"],R);const M=y(t,["contextWindowCompression"]);e!==void 0&&M!=null&&b(e,["setup","contextWindowCompression"],M);const D=y(t,["proactivity"]);if(e!==void 0&&D!=null&&b(e,["setup","proactivity"],D),y(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function ive(t,e){const n={},i=y(t,["generationConfig"]);e!==void 0&&i!=null&&b(e,["setup","generationConfig"],Zye(i));const r=y(t,["responseModalities"]);e!==void 0&&r!=null&&b(e,["setup","generationConfig","responseModalities"],r);const s=y(t,["temperature"]);e!==void 0&&s!=null&&b(e,["setup","generationConfig","temperature"],s);const o=y(t,["topP"]);e!==void 0&&o!=null&&b(e,["setup","generationConfig","topP"],o);const a=y(t,["topK"]);e!==void 0&&a!=null&&b(e,["setup","generationConfig","topK"],a);const l=y(t,["maxOutputTokens"]);e!==void 0&&l!=null&&b(e,["setup","generationConfig","maxOutputTokens"],l);const u=y(t,["mediaResolution"]);e!==void 0&&u!=null&&b(e,["setup","generationConfig","mediaResolution"],u);const d=y(t,["seed"]);e!==void 0&&d!=null&&b(e,["setup","generationConfig","seed"],d);const f=y(t,["speechConfig"]);e!==void 0&&f!=null&&b(e,["setup","generationConfig","speechConfig"],PR(f));const g=y(t,["thinkingConfig"]);e!==void 0&&g!=null&&b(e,["setup","generationConfig","thinkingConfig"],g);const m=y(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&b(e,["setup","generationConfig","enableAffectiveDialog"],m);const v=y(t,["systemInstruction"]);e!==void 0&&v!=null&&b(e,["setup","systemInstruction"],gi(v));const S=y(t,["tools"]);if(e!==void 0&&S!=null){let N=Ah(S);Array.isArray(N)&&(N=N.map(B=>pve(mh(B)))),b(e,["setup","tools"],N)}const C=y(t,["sessionResumption"]);e!==void 0&&C!=null&&b(e,["setup","sessionResumption"],C);const E=y(t,["inputAudioTranscription"]);e!==void 0&&E!=null&&b(e,["setup","inputAudioTranscription"],E);const k=y(t,["outputAudioTranscription"]);e!==void 0&&k!=null&&b(e,["setup","outputAudioTranscription"],k);const R=y(t,["realtimeInputConfig"]);e!==void 0&&R!=null&&b(e,["setup","realtimeInputConfig"],R);const M=y(t,["contextWindowCompression"]);e!==void 0&&M!=null&&b(e,["setup","contextWindowCompression"],M);const D=y(t,["proactivity"]);e!==void 0&&D!=null&&b(e,["setup","proactivity"],D);const P=y(t,["explicitVadSignal"]);return e!==void 0&&P!=null&&b(e,["setup","explicitVadSignal"],P),n}function rve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["setup","model"],St(t,i));const r=y(e,["config"]);return r!=null&&b(n,["config"],nve(r,n)),n}function sve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["setup","model"],St(t,i));const r=y(e,["config"]);return r!=null&&b(n,["config"],ive(r,n)),n}function ove(t){const e={},n=y(t,["musicGenerationConfig"]);return n!=null&&b(e,["musicGenerationConfig"],n),e}function ave(t){const e={},n=y(t,["weightedPrompts"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(r=>r)),b(e,["weightedPrompts"],i)}return e}function lve(t){const e={},n=y(t,["media"]);if(n!=null){let u=t7(n);Array.isArray(u)&&(u=u.map(d=>Wy(d))),b(e,["mediaChunks"],u)}const i=y(t,["audio"]);i!=null&&b(e,["audio"],Wy(i7(i)));const r=y(t,["audioStreamEnd"]);r!=null&&b(e,["audioStreamEnd"],r);const s=y(t,["video"]);s!=null&&b(e,["video"],Wy(n7(s)));const o=y(t,["text"]);o!=null&&b(e,["text"],o);const a=y(t,["activityStart"]);a!=null&&b(e,["activityStart"],a);const l=y(t,["activityEnd"]);return l!=null&&b(e,["activityEnd"],l),e}function cve(t){const e={},n=y(t,["media"]);if(n!=null){let u=t7(n);Array.isArray(u)&&(u=u.map(d=>d)),b(e,["mediaChunks"],u)}const i=y(t,["audio"]);i!=null&&b(e,["audio"],i7(i));const r=y(t,["audioStreamEnd"]);r!=null&&b(e,["audioStreamEnd"],r);const s=y(t,["video"]);s!=null&&b(e,["video"],n7(s));const o=y(t,["text"]);o!=null&&b(e,["text"],o);const a=y(t,["activityStart"]);a!=null&&b(e,["activityStart"],a);const l=y(t,["activityEnd"]);return l!=null&&b(e,["activityEnd"],l),e}function uve(t){const e={},n=y(t,["setupComplete"]);n!=null&&b(e,["setupComplete"],n);const i=y(t,["serverContent"]);i!=null&&b(e,["serverContent"],i);const r=y(t,["toolCall"]);r!=null&&b(e,["toolCall"],r);const s=y(t,["toolCallCancellation"]);s!=null&&b(e,["toolCallCancellation"],s);const o=y(t,["usageMetadata"]);o!=null&&b(e,["usageMetadata"],gve(o));const a=y(t,["goAway"]);a!=null&&b(e,["goAway"],a);const l=y(t,["sessionResumptionUpdate"]);l!=null&&b(e,["sessionResumptionUpdate"],l);const u=y(t,["voiceActivityDetectionSignal"]);return u!=null&&b(e,["voiceActivityDetectionSignal"],u),e}function dve(t){const e={},n=y(t,["mediaResolution"]);n!=null&&b(e,["mediaResolution"],n);const i=y(t,["codeExecutionResult"]);i!=null&&b(e,["codeExecutionResult"],i);const r=y(t,["executableCode"]);r!=null&&b(e,["executableCode"],r);const s=y(t,["fileData"]);s!=null&&b(e,["fileData"],qye(s));const o=y(t,["functionCall"]);o!=null&&b(e,["functionCall"],Jye(o));const a=y(t,["functionResponse"]);a!=null&&b(e,["functionResponse"],a);const l=y(t,["inlineData"]);l!=null&&b(e,["inlineData"],Wy(l));const u=y(t,["text"]);u!=null&&b(e,["text"],u);const d=y(t,["thought"]);d!=null&&b(e,["thought"],d);const f=y(t,["thoughtSignature"]);f!=null&&b(e,["thoughtSignature"],f);const g=y(t,["videoMetadata"]);return g!=null&&b(e,["videoMetadata"],g),e}function hve(t){const e={},n=y(t,["handle"]);if(n!=null&&b(e,["handle"],n),y(t,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function fve(t){const e={};if(y(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=y(t,["computerUse"]);n!=null&&b(e,["computerUse"],n);const i=y(t,["fileSearch"]);i!=null&&b(e,["fileSearch"],i);const r=y(t,["codeExecution"]);if(r!=null&&b(e,["codeExecution"],r),y(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const s=y(t,["functionDeclarations"]);if(s!=null){let d=s;Array.isArray(d)&&(d=d.map(f=>f)),b(e,["functionDeclarations"],d)}const o=y(t,["googleMaps"]);o!=null&&b(e,["googleMaps"],eve(o));const a=y(t,["googleSearch"]);a!=null&&b(e,["googleSearch"],tve(a));const l=y(t,["googleSearchRetrieval"]);l!=null&&b(e,["googleSearchRetrieval"],l);const u=y(t,["urlContext"]);return u!=null&&b(e,["urlContext"],u),e}function pve(t){const e={},n=y(t,["retrieval"]);n!=null&&b(e,["retrieval"],n);const i=y(t,["computerUse"]);if(i!=null&&b(e,["computerUse"],i),y(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=y(t,["codeExecution"]);r!=null&&b(e,["codeExecution"],r);const s=y(t,["enterpriseWebSearch"]);s!=null&&b(e,["enterpriseWebSearch"],s);const o=y(t,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(g=>Xye(g))),b(e,["functionDeclarations"],f)}const a=y(t,["googleMaps"]);a!=null&&b(e,["googleMaps"],a);const l=y(t,["googleSearch"]);l!=null&&b(e,["googleSearch"],l);const u=y(t,["googleSearchRetrieval"]);u!=null&&b(e,["googleSearchRetrieval"],u);const d=y(t,["urlContext"]);return d!=null&&b(e,["urlContext"],d),e}function gve(t){const e={},n=y(t,["promptTokenCount"]);n!=null&&b(e,["promptTokenCount"],n);const i=y(t,["cachedContentTokenCount"]);i!=null&&b(e,["cachedContentTokenCount"],i);const r=y(t,["candidatesTokenCount"]);r!=null&&b(e,["responseTokenCount"],r);const s=y(t,["toolUsePromptTokenCount"]);s!=null&&b(e,["toolUsePromptTokenCount"],s);const o=y(t,["thoughtsTokenCount"]);o!=null&&b(e,["thoughtsTokenCount"],o);const a=y(t,["totalTokenCount"]);a!=null&&b(e,["totalTokenCount"],a);const l=y(t,["promptTokensDetails"]);if(l!=null){let m=l;Array.isArray(m)&&(m=m.map(v=>v)),b(e,["promptTokensDetails"],m)}const u=y(t,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(v=>v)),b(e,["cacheTokensDetails"],m)}const d=y(t,["candidatesTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(v=>v)),b(e,["responseTokensDetails"],m)}const f=y(t,["toolUsePromptTokensDetails"]);if(f!=null){let m=f;Array.isArray(m)&&(m=m.map(v=>v)),b(e,["toolUsePromptTokensDetails"],m)}const g=y(t,["trafficType"]);return g!=null&&b(e,["trafficType"],g),e}function mve(t){const e={},n=y(t,["data"]);if(n!=null&&b(e,["data"],n),y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Ave(t){const e={},n=y(t,["content"]);n!=null&&b(e,["content"],n);const i=y(t,["citationMetadata"]);i!=null&&b(e,["citationMetadata"],yve(i));const r=y(t,["tokenCount"]);r!=null&&b(e,["tokenCount"],r);const s=y(t,["finishReason"]);s!=null&&b(e,["finishReason"],s);const o=y(t,["avgLogprobs"]);o!=null&&b(e,["avgLogprobs"],o);const a=y(t,["groundingMetadata"]);a!=null&&b(e,["groundingMetadata"],a);const l=y(t,["index"]);l!=null&&b(e,["index"],l);const u=y(t,["logprobsResult"]);u!=null&&b(e,["logprobsResult"],u);const d=y(t,["safetyRatings"]);if(d!=null){let g=d;Array.isArray(g)&&(g=g.map(m=>m)),b(e,["safetyRatings"],g)}const f=y(t,["urlContextMetadata"]);return f!=null&&b(e,["urlContextMetadata"],f),e}function yve(t){const e={},n=y(t,["citationSources"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(r=>r)),b(e,["citations"],i)}return e}function vve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let s=Jr(r);Array.isArray(s)&&(s=s.map(o=>o)),b(n,["contents"],s)}return n}function bve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["tokensInfo"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),b(e,["tokensInfo"],r)}return e}function wve(t){const e={},n=y(t,["values"]);n!=null&&b(e,["values"],n);const i=y(t,["statistics"]);return i!=null&&b(e,["statistics"],Sve(i)),e}function Sve(t){const e={},n=y(t,["truncated"]);n!=null&&b(e,["truncated"],n);const i=y(t,["token_count"]);return i!=null&&b(e,["tokenCount"],i),e}function fw(t){const e={},n=y(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>Mbe(s))),b(e,["parts"],r)}const i=y(t,["role"]);return i!=null&&b(e,["role"],i),e}function Cve(t){const e={},n=y(t,["controlType"]);n!=null&&b(e,["controlType"],n);const i=y(t,["enableControlImageComputation"]);return i!=null&&b(e,["computeControl"],i),e}function xve(t){const e={};if(y(t,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(y(t,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(y(t,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return e}function Eve(t,e){const n={},i=y(t,["systemInstruction"]);e!==void 0&&i!=null&&b(e,["systemInstruction"],gi(i));const r=y(t,["tools"]);if(e!==void 0&&r!=null){let o=r;Array.isArray(o)&&(o=o.map(a=>A7(a))),b(e,["tools"],o)}const s=y(t,["generationConfig"]);return e!==void 0&&s!=null&&b(e,["generationConfig"],mbe(s)),n}function _ve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let o=Jr(r);Array.isArray(o)&&(o=o.map(a=>fw(a))),b(n,["contents"],o)}const s=y(e,["config"]);return s!=null&&xve(s),n}function Tve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let o=Jr(r);Array.isArray(o)&&(o=o.map(a=>a)),b(n,["contents"],o)}const s=y(e,["config"]);return s!=null&&Eve(s,n),n}function Rve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["totalTokens"]);i!=null&&b(e,["totalTokens"],i);const r=y(t,["cachedContentTokenCount"]);return r!=null&&b(e,["cachedContentTokenCount"],r),e}function kve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["totalTokens"]);return i!=null&&b(e,["totalTokens"],i),e}function Ive(t,e){const n={},i=y(e,["model"]);return i!=null&&b(n,["_url","name"],St(t,i)),n}function Mve(t,e){const n={},i=y(e,["model"]);return i!=null&&b(n,["_url","name"],St(t,i)),n}function Dve(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function Pve(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}function Nve(t,e){const n={},i=y(t,["outputGcsUri"]);e!==void 0&&i!=null&&b(e,["parameters","storageUri"],i);const r=y(t,["negativePrompt"]);e!==void 0&&r!=null&&b(e,["parameters","negativePrompt"],r);const s=y(t,["numberOfImages"]);e!==void 0&&s!=null&&b(e,["parameters","sampleCount"],s);const o=y(t,["aspectRatio"]);e!==void 0&&o!=null&&b(e,["parameters","aspectRatio"],o);const a=y(t,["guidanceScale"]);e!==void 0&&a!=null&&b(e,["parameters","guidanceScale"],a);const l=y(t,["seed"]);e!==void 0&&l!=null&&b(e,["parameters","seed"],l);const u=y(t,["safetyFilterLevel"]);e!==void 0&&u!=null&&b(e,["parameters","safetySetting"],u);const d=y(t,["personGeneration"]);e!==void 0&&d!=null&&b(e,["parameters","personGeneration"],d);const f=y(t,["includeSafetyAttributes"]);e!==void 0&&f!=null&&b(e,["parameters","includeSafetyAttributes"],f);const g=y(t,["includeRaiReason"]);e!==void 0&&g!=null&&b(e,["parameters","includeRaiReason"],g);const m=y(t,["language"]);e!==void 0&&m!=null&&b(e,["parameters","language"],m);const v=y(t,["outputMimeType"]);e!==void 0&&v!=null&&b(e,["parameters","outputOptions","mimeType"],v);const S=y(t,["outputCompressionQuality"]);e!==void 0&&S!=null&&b(e,["parameters","outputOptions","compressionQuality"],S);const C=y(t,["addWatermark"]);e!==void 0&&C!=null&&b(e,["parameters","addWatermark"],C);const E=y(t,["labels"]);e!==void 0&&E!=null&&b(e,["labels"],E);const k=y(t,["editMode"]);e!==void 0&&k!=null&&b(e,["parameters","editMode"],k);const R=y(t,["baseSteps"]);return e!==void 0&&R!=null&&b(e,["parameters","editConfig","baseSteps"],R),n}function Ove(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["prompt"]);r!=null&&b(n,["instances[0]","prompt"],r);const s=y(e,["referenceImages"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(l=>Lbe(l))),b(n,["instances[0]","referenceImages"],a)}const o=y(e,["config"]);return o!=null&&Nve(o,n),n}function Bve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>pw(s))),b(e,["generatedImages"],r)}return e}function Lve(t,e){const n={},i=y(t,["taskType"]);e!==void 0&&i!=null&&b(e,["requests[]","taskType"],i);const r=y(t,["title"]);e!==void 0&&r!=null&&b(e,["requests[]","title"],r);const s=y(t,["outputDimensionality"]);if(e!==void 0&&s!=null&&b(e,["requests[]","outputDimensionality"],s),y(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(y(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function Uve(t,e){const n={},i=y(t,["taskType"]);e!==void 0&&i!=null&&b(e,["instances[]","task_type"],i);const r=y(t,["title"]);e!==void 0&&r!=null&&b(e,["instances[]","title"],r);const s=y(t,["outputDimensionality"]);e!==void 0&&s!=null&&b(e,["parameters","outputDimensionality"],s);const o=y(t,["mimeType"]);e!==void 0&&o!=null&&b(e,["instances[]","mimeType"],o);const a=y(t,["autoTruncate"]);return e!==void 0&&a!=null&&b(e,["parameters","autoTruncate"],a),n}function Vve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let a=IR(t,r);Array.isArray(a)&&(a=a.map(l=>l)),b(n,["requests[]","content"],a)}const s=y(e,["config"]);s!=null&&Lve(s,n);const o=y(e,["model"]);return o!==void 0&&b(n,["requests[]","model"],St(t,o)),n}function Fve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let o=IR(t,r);Array.isArray(o)&&(o=o.map(a=>a)),b(n,["instances[]","content"],o)}const s=y(e,["config"]);return s!=null&&Uve(s,n),n}function Hve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["embeddings"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["embeddings"],s)}const r=y(t,["metadata"]);return r!=null&&b(e,["metadata"],r),e}function zve(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["predictions[]","embeddings"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>wve(o))),b(e,["embeddings"],s)}const r=y(t,["metadata"]);return r!=null&&b(e,["metadata"],r),e}function Qve(t){const e={},n=y(t,["endpoint"]);n!=null&&b(e,["name"],n);const i=y(t,["deployedModelId"]);return i!=null&&b(e,["deployedModelId"],i),e}function Gve(t){const e={};if(y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=y(t,["fileUri"]);n!=null&&b(e,["fileUri"],n);const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function $ve(t){const e={},n=y(t,["id"]);n!=null&&b(e,["id"],n);const i=y(t,["args"]);i!=null&&b(e,["args"],i);const r=y(t,["name"]);if(r!=null&&b(e,["name"],r),y(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(y(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function Wve(t){const e={},n=y(t,["allowedFunctionNames"]);n!=null&&b(e,["allowedFunctionNames"],n);const i=y(t,["mode"]);if(i!=null&&b(e,["mode"],i),y(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function jve(t){const e={},n=y(t,["description"]);n!=null&&b(e,["description"],n);const i=y(t,["name"]);i!=null&&b(e,["name"],i);const r=y(t,["parameters"]);r!=null&&b(e,["parameters"],r);const s=y(t,["parametersJsonSchema"]);s!=null&&b(e,["parametersJsonSchema"],s);const o=y(t,["response"]);o!=null&&b(e,["response"],o);const a=y(t,["responseJsonSchema"]);if(a!=null&&b(e,["responseJsonSchema"],a),y(t,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return e}function Kve(t,e,n){const i={},r=y(e,["systemInstruction"]);n!==void 0&&r!=null&&b(n,["systemInstruction"],fw(gi(r)));const s=y(e,["temperature"]);s!=null&&b(i,["temperature"],s);const o=y(e,["topP"]);o!=null&&b(i,["topP"],o);const a=y(e,["topK"]);a!=null&&b(i,["topK"],a);const l=y(e,["candidateCount"]);l!=null&&b(i,["candidateCount"],l);const u=y(e,["maxOutputTokens"]);u!=null&&b(i,["maxOutputTokens"],u);const d=y(e,["stopSequences"]);d!=null&&b(i,["stopSequences"],d);const f=y(e,["responseLogprobs"]);f!=null&&b(i,["responseLogprobs"],f);const g=y(e,["logprobs"]);g!=null&&b(i,["logprobs"],g);const m=y(e,["presencePenalty"]);m!=null&&b(i,["presencePenalty"],m);const v=y(e,["frequencyPenalty"]);v!=null&&b(i,["frequencyPenalty"],v);const S=y(e,["seed"]);S!=null&&b(i,["seed"],S);const C=y(e,["responseMimeType"]);C!=null&&b(i,["responseMimeType"],C);const E=y(e,["responseSchema"]);E!=null&&b(i,["responseSchema"],MR(E));const k=y(e,["responseJsonSchema"]);if(k!=null&&b(i,["responseJsonSchema"],k),y(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(y(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const R=y(e,["safetySettings"]);if(n!==void 0&&R!=null){let X=R;Array.isArray(X)&&(X=X.map(J=>Ube(J))),b(n,["safetySettings"],X)}const M=y(e,["tools"]);if(n!==void 0&&M!=null){let X=Ah(M);Array.isArray(X)&&(X=X.map(J=>$be(mh(J)))),b(n,["tools"],X)}const D=y(e,["toolConfig"]);if(n!==void 0&&D!=null&&b(n,["toolConfig"],Gbe(D)),y(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const P=y(e,["cachedContent"]);n!==void 0&&P!=null&&b(n,["cachedContent"],ya(t,P));const N=y(e,["responseModalities"]);N!=null&&b(i,["responseModalities"],N);const B=y(e,["mediaResolution"]);B!=null&&b(i,["mediaResolution"],B);const G=y(e,["speechConfig"]);if(G!=null&&b(i,["speechConfig"],DR(G)),y(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const V=y(e,["thinkingConfig"]);V!=null&&b(i,["thinkingConfig"],V);const $=y(e,["imageConfig"]);$!=null&&b(i,["imageConfig"],wbe($));const K=y(e,["enableEnhancedCivicAnswers"]);return K!=null&&b(i,["enableEnhancedCivicAnswers"],K),i}function Yve(t,e,n){const i={},r=y(e,["systemInstruction"]);n!==void 0&&r!=null&&b(n,["systemInstruction"],gi(r));const s=y(e,["temperature"]);s!=null&&b(i,["temperature"],s);const o=y(e,["topP"]);o!=null&&b(i,["topP"],o);const a=y(e,["topK"]);a!=null&&b(i,["topK"],a);const l=y(e,["candidateCount"]);l!=null&&b(i,["candidateCount"],l);const u=y(e,["maxOutputTokens"]);u!=null&&b(i,["maxOutputTokens"],u);const d=y(e,["stopSequences"]);d!=null&&b(i,["stopSequences"],d);const f=y(e,["responseLogprobs"]);f!=null&&b(i,["responseLogprobs"],f);const g=y(e,["logprobs"]);g!=null&&b(i,["logprobs"],g);const m=y(e,["presencePenalty"]);m!=null&&b(i,["presencePenalty"],m);const v=y(e,["frequencyPenalty"]);v!=null&&b(i,["frequencyPenalty"],v);const S=y(e,["seed"]);S!=null&&b(i,["seed"],S);const C=y(e,["responseMimeType"]);C!=null&&b(i,["responseMimeType"],C);const E=y(e,["responseSchema"]);E!=null&&b(i,["responseSchema"],MR(E));const k=y(e,["responseJsonSchema"]);k!=null&&b(i,["responseJsonSchema"],k);const R=y(e,["routingConfig"]);R!=null&&b(i,["routingConfig"],R);const M=y(e,["modelSelectionConfig"]);M!=null&&b(i,["modelConfig"],M);const D=y(e,["safetySettings"]);if(n!==void 0&&D!=null){let Q=D;Array.isArray(Q)&&(Q=Q.map(q=>q)),b(n,["safetySettings"],Q)}const P=y(e,["tools"]);if(n!==void 0&&P!=null){let Q=Ah(P);Array.isArray(Q)&&(Q=Q.map(q=>A7(mh(q)))),b(n,["tools"],Q)}const N=y(e,["toolConfig"]);n!==void 0&&N!=null&&b(n,["toolConfig"],N);const B=y(e,["labels"]);n!==void 0&&B!=null&&b(n,["labels"],B);const G=y(e,["cachedContent"]);n!==void 0&&G!=null&&b(n,["cachedContent"],ya(t,G));const V=y(e,["responseModalities"]);V!=null&&b(i,["responseModalities"],V);const $=y(e,["mediaResolution"]);$!=null&&b(i,["mediaResolution"],$);const K=y(e,["speechConfig"]);K!=null&&b(i,["speechConfig"],DR(K));const X=y(e,["audioTimestamp"]);X!=null&&b(i,["audioTimestamp"],X);const J=y(e,["thinkingConfig"]);J!=null&&b(i,["thinkingConfig"],J);const Z=y(e,["imageConfig"]);if(Z!=null&&b(i,["imageConfig"],Sbe(Z)),y(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return i}function YL(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let o=Jr(r);Array.isArray(o)&&(o=o.map(a=>fw(a))),b(n,["contents"],o)}const s=y(e,["config"]);return s!=null&&b(n,["generationConfig"],Kve(t,s,n)),n}function qL(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["contents"]);if(r!=null){let o=Jr(r);Array.isArray(o)&&(o=o.map(a=>a)),b(n,["contents"],o)}const s=y(e,["config"]);return s!=null&&b(n,["generationConfig"],Yve(t,s,n)),n}function JL(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["candidates"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(u=>Ave(u))),b(e,["candidates"],l)}const r=y(t,["modelVersion"]);r!=null&&b(e,["modelVersion"],r);const s=y(t,["promptFeedback"]);s!=null&&b(e,["promptFeedback"],s);const o=y(t,["responseId"]);o!=null&&b(e,["responseId"],o);const a=y(t,["usageMetadata"]);return a!=null&&b(e,["usageMetadata"],a),e}function XL(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["candidates"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(d=>d)),b(e,["candidates"],u)}const r=y(t,["createTime"]);r!=null&&b(e,["createTime"],r);const s=y(t,["modelVersion"]);s!=null&&b(e,["modelVersion"],s);const o=y(t,["promptFeedback"]);o!=null&&b(e,["promptFeedback"],o);const a=y(t,["responseId"]);a!=null&&b(e,["responseId"],a);const l=y(t,["usageMetadata"]);return l!=null&&b(e,["usageMetadata"],l),e}function qve(t,e){const n={};if(y(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(y(t,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const i=y(t,["numberOfImages"]);e!==void 0&&i!=null&&b(e,["parameters","sampleCount"],i);const r=y(t,["aspectRatio"]);e!==void 0&&r!=null&&b(e,["parameters","aspectRatio"],r);const s=y(t,["guidanceScale"]);if(e!==void 0&&s!=null&&b(e,["parameters","guidanceScale"],s),y(t,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const o=y(t,["safetyFilterLevel"]);e!==void 0&&o!=null&&b(e,["parameters","safetySetting"],o);const a=y(t,["personGeneration"]);e!==void 0&&a!=null&&b(e,["parameters","personGeneration"],a);const l=y(t,["includeSafetyAttributes"]);e!==void 0&&l!=null&&b(e,["parameters","includeSafetyAttributes"],l);const u=y(t,["includeRaiReason"]);e!==void 0&&u!=null&&b(e,["parameters","includeRaiReason"],u);const d=y(t,["language"]);e!==void 0&&d!=null&&b(e,["parameters","language"],d);const f=y(t,["outputMimeType"]);e!==void 0&&f!=null&&b(e,["parameters","outputOptions","mimeType"],f);const g=y(t,["outputCompressionQuality"]);if(e!==void 0&&g!=null&&b(e,["parameters","outputOptions","compressionQuality"],g),y(t,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(y(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const m=y(t,["imageSize"]);if(e!==void 0&&m!=null&&b(e,["parameters","sampleImageSize"],m),y(t,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return n}function Jve(t,e){const n={},i=y(t,["outputGcsUri"]);e!==void 0&&i!=null&&b(e,["parameters","storageUri"],i);const r=y(t,["negativePrompt"]);e!==void 0&&r!=null&&b(e,["parameters","negativePrompt"],r);const s=y(t,["numberOfImages"]);e!==void 0&&s!=null&&b(e,["parameters","sampleCount"],s);const o=y(t,["aspectRatio"]);e!==void 0&&o!=null&&b(e,["parameters","aspectRatio"],o);const a=y(t,["guidanceScale"]);e!==void 0&&a!=null&&b(e,["parameters","guidanceScale"],a);const l=y(t,["seed"]);e!==void 0&&l!=null&&b(e,["parameters","seed"],l);const u=y(t,["safetyFilterLevel"]);e!==void 0&&u!=null&&b(e,["parameters","safetySetting"],u);const d=y(t,["personGeneration"]);e!==void 0&&d!=null&&b(e,["parameters","personGeneration"],d);const f=y(t,["includeSafetyAttributes"]);e!==void 0&&f!=null&&b(e,["parameters","includeSafetyAttributes"],f);const g=y(t,["includeRaiReason"]);e!==void 0&&g!=null&&b(e,["parameters","includeRaiReason"],g);const m=y(t,["language"]);e!==void 0&&m!=null&&b(e,["parameters","language"],m);const v=y(t,["outputMimeType"]);e!==void 0&&v!=null&&b(e,["parameters","outputOptions","mimeType"],v);const S=y(t,["outputCompressionQuality"]);e!==void 0&&S!=null&&b(e,["parameters","outputOptions","compressionQuality"],S);const C=y(t,["addWatermark"]);e!==void 0&&C!=null&&b(e,["parameters","addWatermark"],C);const E=y(t,["labels"]);e!==void 0&&E!=null&&b(e,["labels"],E);const k=y(t,["imageSize"]);e!==void 0&&k!=null&&b(e,["parameters","sampleImageSize"],k);const R=y(t,["enhancePrompt"]);return e!==void 0&&R!=null&&b(e,["parameters","enhancePrompt"],R),n}function Xve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["prompt"]);r!=null&&b(n,["instances[0]","prompt"],r);const s=y(e,["config"]);return s!=null&&qve(s,n),n}function Zve(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["prompt"]);r!=null&&b(n,["instances[0]","prompt"],r);const s=y(e,["config"]);return s!=null&&Jve(s,n),n}function ebe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["predictions"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>hbe(o))),b(e,["generatedImages"],s)}const r=y(t,["positivePromptSafetyAttributes"]);return r!=null&&b(e,["positivePromptSafetyAttributes"],g7(r)),e}function tbe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["predictions"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>pw(o))),b(e,["generatedImages"],s)}const r=y(t,["positivePromptSafetyAttributes"]);return r!=null&&b(e,["positivePromptSafetyAttributes"],m7(r)),e}function nbe(t,e){const n={},i=y(t,["numberOfVideos"]);if(e!==void 0&&i!=null&&b(e,["parameters","sampleCount"],i),y(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(y(t,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const r=y(t,["durationSeconds"]);if(e!==void 0&&r!=null&&b(e,["parameters","durationSeconds"],r),y(t,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const s=y(t,["aspectRatio"]);e!==void 0&&s!=null&&b(e,["parameters","aspectRatio"],s);const o=y(t,["resolution"]);e!==void 0&&o!=null&&b(e,["parameters","resolution"],o);const a=y(t,["personGeneration"]);if(e!==void 0&&a!=null&&b(e,["parameters","personGeneration"],a),y(t,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const l=y(t,["negativePrompt"]);e!==void 0&&l!=null&&b(e,["parameters","negativePrompt"],l);const u=y(t,["enhancePrompt"]);if(e!==void 0&&u!=null&&b(e,["parameters","enhancePrompt"],u),y(t,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const d=y(t,["lastFrame"]);e!==void 0&&d!=null&&b(e,["instances[0]","lastFrame"],gw(d));const f=y(t,["referenceImages"]);if(e!==void 0&&f!=null){let g=f;Array.isArray(g)&&(g=g.map(m=>rwe(m))),b(e,["instances[0]","referenceImages"],g)}if(y(t,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(y(t,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return n}function ibe(t,e){const n={},i=y(t,["numberOfVideos"]);e!==void 0&&i!=null&&b(e,["parameters","sampleCount"],i);const r=y(t,["outputGcsUri"]);e!==void 0&&r!=null&&b(e,["parameters","storageUri"],r);const s=y(t,["fps"]);e!==void 0&&s!=null&&b(e,["parameters","fps"],s);const o=y(t,["durationSeconds"]);e!==void 0&&o!=null&&b(e,["parameters","durationSeconds"],o);const a=y(t,["seed"]);e!==void 0&&a!=null&&b(e,["parameters","seed"],a);const l=y(t,["aspectRatio"]);e!==void 0&&l!=null&&b(e,["parameters","aspectRatio"],l);const u=y(t,["resolution"]);e!==void 0&&u!=null&&b(e,["parameters","resolution"],u);const d=y(t,["personGeneration"]);e!==void 0&&d!=null&&b(e,["parameters","personGeneration"],d);const f=y(t,["pubsubTopic"]);e!==void 0&&f!=null&&b(e,["parameters","pubsubTopic"],f);const g=y(t,["negativePrompt"]);e!==void 0&&g!=null&&b(e,["parameters","negativePrompt"],g);const m=y(t,["enhancePrompt"]);e!==void 0&&m!=null&&b(e,["parameters","enhancePrompt"],m);const v=y(t,["generateAudio"]);e!==void 0&&v!=null&&b(e,["parameters","generateAudio"],v);const S=y(t,["lastFrame"]);e!==void 0&&S!=null&&b(e,["instances[0]","lastFrame"],Ds(S));const C=y(t,["referenceImages"]);if(e!==void 0&&C!=null){let R=C;Array.isArray(R)&&(R=R.map(M=>swe(M))),b(e,["instances[0]","referenceImages"],R)}const E=y(t,["mask"]);e!==void 0&&E!=null&&b(e,["instances[0]","mask"],iwe(E));const k=y(t,["compressionQuality"]);return e!==void 0&&k!=null&&b(e,["parameters","compressionQuality"],k),n}function rbe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response","generateVideoResponse"]);return o!=null&&b(e,["response"],lbe(o)),e}function sbe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response"]);return o!=null&&b(e,["response"],cbe(o)),e}function obe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["prompt"]);r!=null&&b(n,["instances[0]","prompt"],r);const s=y(e,["image"]);s!=null&&b(n,["instances[0]","image"],gw(s));const o=y(e,["video"]);o!=null&&b(n,["instances[0]","video"],y7(o));const a=y(e,["source"]);a!=null&&ube(a,n);const l=y(e,["config"]);return l!=null&&nbe(l,n),n}function abe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["prompt"]);r!=null&&b(n,["instances[0]","prompt"],r);const s=y(e,["image"]);s!=null&&b(n,["instances[0]","image"],Ds(s));const o=y(e,["video"]);o!=null&&b(n,["instances[0]","video"],v7(o));const a=y(e,["source"]);a!=null&&dbe(a,n);const l=y(e,["config"]);return l!=null&&ibe(l,n),n}function lbe(t){const e={},n=y(t,["generatedSamples"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>pbe(o))),b(e,["generatedVideos"],s)}const i=y(t,["raiMediaFilteredCount"]);i!=null&&b(e,["raiMediaFilteredCount"],i);const r=y(t,["raiMediaFilteredReasons"]);return r!=null&&b(e,["raiMediaFilteredReasons"],r),e}function cbe(t){const e={},n=y(t,["videos"]);if(n!=null){let s=n;Array.isArray(s)&&(s=s.map(o=>gbe(o))),b(e,["generatedVideos"],s)}const i=y(t,["raiMediaFilteredCount"]);i!=null&&b(e,["raiMediaFilteredCount"],i);const r=y(t,["raiMediaFilteredReasons"]);return r!=null&&b(e,["raiMediaFilteredReasons"],r),e}function ube(t,e){const n={},i=y(t,["prompt"]);e!==void 0&&i!=null&&b(e,["instances[0]","prompt"],i);const r=y(t,["image"]);e!==void 0&&r!=null&&b(e,["instances[0]","image"],gw(r));const s=y(t,["video"]);return e!==void 0&&s!=null&&b(e,["instances[0]","video"],y7(s)),n}function dbe(t,e){const n={},i=y(t,["prompt"]);e!==void 0&&i!=null&&b(e,["instances[0]","prompt"],i);const r=y(t,["image"]);e!==void 0&&r!=null&&b(e,["instances[0]","image"],Ds(r));const s=y(t,["video"]);return e!==void 0&&s!=null&&b(e,["instances[0]","video"],v7(s)),n}function hbe(t){const e={},n=y(t,["_self"]);n!=null&&b(e,["image"],Cbe(n));const i=y(t,["raiFilteredReason"]);i!=null&&b(e,["raiFilteredReason"],i);const r=y(t,["_self"]);return r!=null&&b(e,["safetyAttributes"],g7(r)),e}function pw(t){const e={},n=y(t,["_self"]);n!=null&&b(e,["image"],p7(n));const i=y(t,["raiFilteredReason"]);i!=null&&b(e,["raiFilteredReason"],i);const r=y(t,["_self"]);r!=null&&b(e,["safetyAttributes"],m7(r));const s=y(t,["prompt"]);return s!=null&&b(e,["enhancedPrompt"],s),e}function fbe(t){const e={},n=y(t,["_self"]);n!=null&&b(e,["mask"],p7(n));const i=y(t,["labels"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),b(e,["labels"],r)}return e}function pbe(t){const e={},n=y(t,["video"]);return n!=null&&b(e,["video"],twe(n)),e}function gbe(t){const e={},n=y(t,["_self"]);return n!=null&&b(e,["video"],nwe(n)),e}function mbe(t){const e={},n=y(t,["modelSelectionConfig"]);n!=null&&b(e,["modelConfig"],n);const i=y(t,["responseJsonSchema"]);i!=null&&b(e,["responseJsonSchema"],i);const r=y(t,["audioTimestamp"]);r!=null&&b(e,["audioTimestamp"],r);const s=y(t,["candidateCount"]);s!=null&&b(e,["candidateCount"],s);const o=y(t,["enableAffectiveDialog"]);o!=null&&b(e,["enableAffectiveDialog"],o);const a=y(t,["frequencyPenalty"]);a!=null&&b(e,["frequencyPenalty"],a);const l=y(t,["logprobs"]);l!=null&&b(e,["logprobs"],l);const u=y(t,["maxOutputTokens"]);u!=null&&b(e,["maxOutputTokens"],u);const d=y(t,["mediaResolution"]);d!=null&&b(e,["mediaResolution"],d);const f=y(t,["presencePenalty"]);f!=null&&b(e,["presencePenalty"],f);const g=y(t,["responseLogprobs"]);g!=null&&b(e,["responseLogprobs"],g);const m=y(t,["responseMimeType"]);m!=null&&b(e,["responseMimeType"],m);const v=y(t,["responseModalities"]);v!=null&&b(e,["responseModalities"],v);const S=y(t,["responseSchema"]);S!=null&&b(e,["responseSchema"],S);const C=y(t,["routingConfig"]);C!=null&&b(e,["routingConfig"],C);const E=y(t,["seed"]);E!=null&&b(e,["seed"],E);const k=y(t,["speechConfig"]);k!=null&&b(e,["speechConfig"],k);const R=y(t,["stopSequences"]);R!=null&&b(e,["stopSequences"],R);const M=y(t,["temperature"]);M!=null&&b(e,["temperature"],M);const D=y(t,["thinkingConfig"]);D!=null&&b(e,["thinkingConfig"],D);const P=y(t,["topK"]);P!=null&&b(e,["topK"],P);const N=y(t,["topP"]);if(N!=null&&b(e,["topP"],N),y(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return e}function Abe(t,e){const n={},i=y(e,["model"]);return i!=null&&b(n,["_url","name"],St(t,i)),n}function ybe(t,e){const n={},i=y(e,["model"]);return i!=null&&b(n,["_url","name"],St(t,i)),n}function vbe(t){const e={};if(y(t,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=y(t,["enableWidget"]);return n!=null&&b(e,["enableWidget"],n),e}function bbe(t){const e={};if(y(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(y(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=y(t,["timeRangeFilter"]);return n!=null&&b(e,["timeRangeFilter"],n),e}function wbe(t){const e={},n=y(t,["aspectRatio"]);n!=null&&b(e,["aspectRatio"],n);const i=y(t,["imageSize"]);if(i!=null&&b(e,["imageSize"],i),y(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(y(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(y(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return e}function Sbe(t){const e={},n=y(t,["aspectRatio"]);n!=null&&b(e,["aspectRatio"],n);const i=y(t,["imageSize"]);i!=null&&b(e,["imageSize"],i);const r=y(t,["personGeneration"]);r!=null&&b(e,["personGeneration"],r);const s=y(t,["outputMimeType"]);s!=null&&b(e,["imageOutputOptions","mimeType"],s);const o=y(t,["outputCompressionQuality"]);return o!=null&&b(e,["imageOutputOptions","compressionQuality"],o),e}function Cbe(t){const e={},n=y(t,["bytesBase64Encoded"]);n!=null&&b(e,["imageBytes"],Dl(n));const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function p7(t){const e={},n=y(t,["gcsUri"]);n!=null&&b(e,["gcsUri"],n);const i=y(t,["bytesBase64Encoded"]);i!=null&&b(e,["imageBytes"],Dl(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["mimeType"],r),e}function gw(t){const e={};if(y(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const n=y(t,["imageBytes"]);n!=null&&b(e,["bytesBase64Encoded"],Dl(n));const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Ds(t){const e={},n=y(t,["gcsUri"]);n!=null&&b(e,["gcsUri"],n);const i=y(t,["imageBytes"]);i!=null&&b(e,["bytesBase64Encoded"],Dl(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["mimeType"],r),e}function xbe(t,e,n){const i={},r=y(e,["pageSize"]);n!==void 0&&r!=null&&b(n,["_query","pageSize"],r);const s=y(e,["pageToken"]);n!==void 0&&s!=null&&b(n,["_query","pageToken"],s);const o=y(e,["filter"]);n!==void 0&&o!=null&&b(n,["_query","filter"],o);const a=y(e,["queryBase"]);return n!==void 0&&a!=null&&b(n,["_url","models_url"],a7(t,a)),i}function Ebe(t,e,n){const i={},r=y(e,["pageSize"]);n!==void 0&&r!=null&&b(n,["_query","pageSize"],r);const s=y(e,["pageToken"]);n!==void 0&&s!=null&&b(n,["_query","pageToken"],s);const o=y(e,["filter"]);n!==void 0&&o!=null&&b(n,["_query","filter"],o);const a=y(e,["queryBase"]);return n!==void 0&&a!=null&&b(n,["_url","models_url"],a7(t,a)),i}function _be(t,e){const n={},i=y(e,["config"]);return i!=null&&xbe(t,i,n),n}function Tbe(t,e){const n={},i=y(e,["config"]);return i!=null&&Ebe(t,i,n),n}function Rbe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["_self"]);if(r!=null){let s=l7(r);Array.isArray(s)&&(s=s.map(o=>v_(o))),b(e,["models"],s)}return e}function kbe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["_self"]);if(r!=null){let s=l7(r);Array.isArray(s)&&(s=s.map(o=>b_(o))),b(e,["models"],s)}return e}function Ibe(t){const e={},n=y(t,["maskMode"]);n!=null&&b(e,["maskMode"],n);const i=y(t,["segmentationClasses"]);i!=null&&b(e,["maskClasses"],i);const r=y(t,["maskDilation"]);return r!=null&&b(e,["dilation"],r),e}function v_(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["displayName"]);i!=null&&b(e,["displayName"],i);const r=y(t,["description"]);r!=null&&b(e,["description"],r);const s=y(t,["version"]);s!=null&&b(e,["version"],s);const o=y(t,["_self"]);o!=null&&b(e,["tunedModelInfo"],Wbe(o));const a=y(t,["inputTokenLimit"]);a!=null&&b(e,["inputTokenLimit"],a);const l=y(t,["outputTokenLimit"]);l!=null&&b(e,["outputTokenLimit"],l);const u=y(t,["supportedGenerationMethods"]);u!=null&&b(e,["supportedActions"],u);const d=y(t,["temperature"]);d!=null&&b(e,["temperature"],d);const f=y(t,["maxTemperature"]);f!=null&&b(e,["maxTemperature"],f);const g=y(t,["topP"]);g!=null&&b(e,["topP"],g);const m=y(t,["topK"]);m!=null&&b(e,["topK"],m);const v=y(t,["thinking"]);return v!=null&&b(e,["thinking"],v),e}function b_(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["displayName"]);i!=null&&b(e,["displayName"],i);const r=y(t,["description"]);r!=null&&b(e,["description"],r);const s=y(t,["versionId"]);s!=null&&b(e,["version"],s);const o=y(t,["deployedModels"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(g=>Qve(g))),b(e,["endpoints"],f)}const a=y(t,["labels"]);a!=null&&b(e,["labels"],a);const l=y(t,["_self"]);l!=null&&b(e,["tunedModelInfo"],jbe(l));const u=y(t,["defaultCheckpointId"]);u!=null&&b(e,["defaultCheckpointId"],u);const d=y(t,["checkpoints"]);if(d!=null){let f=d;Array.isArray(f)&&(f=f.map(g=>g)),b(e,["checkpoints"],f)}return e}function Mbe(t){const e={},n=y(t,["mediaResolution"]);n!=null&&b(e,["mediaResolution"],n);const i=y(t,["codeExecutionResult"]);i!=null&&b(e,["codeExecutionResult"],i);const r=y(t,["executableCode"]);r!=null&&b(e,["executableCode"],r);const s=y(t,["fileData"]);s!=null&&b(e,["fileData"],Gve(s));const o=y(t,["functionCall"]);o!=null&&b(e,["functionCall"],$ve(o));const a=y(t,["functionResponse"]);a!=null&&b(e,["functionResponse"],a);const l=y(t,["inlineData"]);l!=null&&b(e,["inlineData"],mve(l));const u=y(t,["text"]);u!=null&&b(e,["text"],u);const d=y(t,["thought"]);d!=null&&b(e,["thought"],d);const f=y(t,["thoughtSignature"]);f!=null&&b(e,["thoughtSignature"],f);const g=y(t,["videoMetadata"]);return g!=null&&b(e,["videoMetadata"],g),e}function Dbe(t){const e={},n=y(t,["productImage"]);return n!=null&&b(e,["image"],Ds(n)),e}function Pbe(t,e){const n={},i=y(t,["numberOfImages"]);e!==void 0&&i!=null&&b(e,["parameters","sampleCount"],i);const r=y(t,["baseSteps"]);e!==void 0&&r!=null&&b(e,["parameters","baseSteps"],r);const s=y(t,["outputGcsUri"]);e!==void 0&&s!=null&&b(e,["parameters","storageUri"],s);const o=y(t,["seed"]);e!==void 0&&o!=null&&b(e,["parameters","seed"],o);const a=y(t,["safetyFilterLevel"]);e!==void 0&&a!=null&&b(e,["parameters","safetySetting"],a);const l=y(t,["personGeneration"]);e!==void 0&&l!=null&&b(e,["parameters","personGeneration"],l);const u=y(t,["addWatermark"]);e!==void 0&&u!=null&&b(e,["parameters","addWatermark"],u);const d=y(t,["outputMimeType"]);e!==void 0&&d!=null&&b(e,["parameters","outputOptions","mimeType"],d);const f=y(t,["outputCompressionQuality"]);e!==void 0&&f!=null&&b(e,["parameters","outputOptions","compressionQuality"],f);const g=y(t,["enhancePrompt"]);e!==void 0&&g!=null&&b(e,["parameters","enhancePrompt"],g);const m=y(t,["labels"]);return e!==void 0&&m!=null&&b(e,["labels"],m),n}function Nbe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["source"]);r!=null&&Bbe(r,n);const s=y(e,["config"]);return s!=null&&Pbe(s,n),n}function Obe(t){const e={},n=y(t,["predictions"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(r=>pw(r))),b(e,["generatedImages"],i)}return e}function Bbe(t,e){const n={},i=y(t,["prompt"]);e!==void 0&&i!=null&&b(e,["instances[0]","prompt"],i);const r=y(t,["personImage"]);e!==void 0&&r!=null&&b(e,["instances[0]","personImage","image"],Ds(r));const s=y(t,["productImages"]);if(e!==void 0&&s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>Dbe(a))),b(e,["instances[0]","productImages"],o)}return n}function Lbe(t){const e={},n=y(t,["referenceImage"]);n!=null&&b(e,["referenceImage"],Ds(n));const i=y(t,["referenceId"]);i!=null&&b(e,["referenceId"],i);const r=y(t,["referenceType"]);r!=null&&b(e,["referenceType"],r);const s=y(t,["maskImageConfig"]);s!=null&&b(e,["maskImageConfig"],Ibe(s));const o=y(t,["controlImageConfig"]);o!=null&&b(e,["controlImageConfig"],Cve(o));const a=y(t,["styleImageConfig"]);a!=null&&b(e,["styleImageConfig"],a);const l=y(t,["subjectImageConfig"]);return l!=null&&b(e,["subjectImageConfig"],l),e}function g7(t){const e={},n=y(t,["safetyAttributes","categories"]);n!=null&&b(e,["categories"],n);const i=y(t,["safetyAttributes","scores"]);i!=null&&b(e,["scores"],i);const r=y(t,["contentType"]);return r!=null&&b(e,["contentType"],r),e}function m7(t){const e={},n=y(t,["safetyAttributes","categories"]);n!=null&&b(e,["categories"],n);const i=y(t,["safetyAttributes","scores"]);i!=null&&b(e,["scores"],i);const r=y(t,["contentType"]);return r!=null&&b(e,["contentType"],r),e}function Ube(t){const e={},n=y(t,["category"]);if(n!=null&&b(e,["category"],n),y(t,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const i=y(t,["threshold"]);return i!=null&&b(e,["threshold"],i),e}function Vbe(t){const e={},n=y(t,["image"]);return n!=null&&b(e,["image"],Ds(n)),e}function Fbe(t,e){const n={},i=y(t,["mode"]);e!==void 0&&i!=null&&b(e,["parameters","mode"],i);const r=y(t,["maxPredictions"]);e!==void 0&&r!=null&&b(e,["parameters","maxPredictions"],r);const s=y(t,["confidenceThreshold"]);e!==void 0&&s!=null&&b(e,["parameters","confidenceThreshold"],s);const o=y(t,["maskDilation"]);e!==void 0&&o!=null&&b(e,["parameters","maskDilation"],o);const a=y(t,["binaryColorThreshold"]);e!==void 0&&a!=null&&b(e,["parameters","binaryColorThreshold"],a);const l=y(t,["labels"]);return e!==void 0&&l!=null&&b(e,["labels"],l),n}function Hbe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["source"]);r!=null&&Qbe(r,n);const s=y(e,["config"]);return s!=null&&Fbe(s,n),n}function zbe(t){const e={},n=y(t,["predictions"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(r=>fbe(r))),b(e,["generatedMasks"],i)}return e}function Qbe(t,e){const n={},i=y(t,["prompt"]);e!==void 0&&i!=null&&b(e,["instances[0]","prompt"],i);const r=y(t,["image"]);e!==void 0&&r!=null&&b(e,["instances[0]","image"],Ds(r));const s=y(t,["scribbleImage"]);return e!==void 0&&s!=null&&b(e,["instances[0]","scribble"],Vbe(s)),n}function Gbe(t){const e={},n=y(t,["retrievalConfig"]);n!=null&&b(e,["retrievalConfig"],n);const i=y(t,["functionCallingConfig"]);return i!=null&&b(e,["functionCallingConfig"],Wve(i)),e}function $be(t){const e={};if(y(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=y(t,["computerUse"]);n!=null&&b(e,["computerUse"],n);const i=y(t,["fileSearch"]);i!=null&&b(e,["fileSearch"],i);const r=y(t,["codeExecution"]);if(r!=null&&b(e,["codeExecution"],r),y(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const s=y(t,["functionDeclarations"]);if(s!=null){let d=s;Array.isArray(d)&&(d=d.map(f=>f)),b(e,["functionDeclarations"],d)}const o=y(t,["googleMaps"]);o!=null&&b(e,["googleMaps"],vbe(o));const a=y(t,["googleSearch"]);a!=null&&b(e,["googleSearch"],bbe(a));const l=y(t,["googleSearchRetrieval"]);l!=null&&b(e,["googleSearchRetrieval"],l);const u=y(t,["urlContext"]);return u!=null&&b(e,["urlContext"],u),e}function A7(t){const e={},n=y(t,["retrieval"]);n!=null&&b(e,["retrieval"],n);const i=y(t,["computerUse"]);if(i!=null&&b(e,["computerUse"],i),y(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=y(t,["codeExecution"]);r!=null&&b(e,["codeExecution"],r);const s=y(t,["enterpriseWebSearch"]);s!=null&&b(e,["enterpriseWebSearch"],s);const o=y(t,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(g=>jve(g))),b(e,["functionDeclarations"],f)}const a=y(t,["googleMaps"]);a!=null&&b(e,["googleMaps"],a);const l=y(t,["googleSearch"]);l!=null&&b(e,["googleSearch"],l);const u=y(t,["googleSearchRetrieval"]);u!=null&&b(e,["googleSearchRetrieval"],u);const d=y(t,["urlContext"]);return d!=null&&b(e,["urlContext"],d),e}function Wbe(t){const e={},n=y(t,["baseModel"]);n!=null&&b(e,["baseModel"],n);const i=y(t,["createTime"]);i!=null&&b(e,["createTime"],i);const r=y(t,["updateTime"]);return r!=null&&b(e,["updateTime"],r),e}function jbe(t){const e={},n=y(t,["labels","google-vertex-llm-tuning-base-model-id"]);n!=null&&b(e,["baseModel"],n);const i=y(t,["createTime"]);i!=null&&b(e,["createTime"],i);const r=y(t,["updateTime"]);return r!=null&&b(e,["updateTime"],r),e}function Kbe(t,e){const n={},i=y(t,["displayName"]);e!==void 0&&i!=null&&b(e,["displayName"],i);const r=y(t,["description"]);e!==void 0&&r!=null&&b(e,["description"],r);const s=y(t,["defaultCheckpointId"]);return e!==void 0&&s!=null&&b(e,["defaultCheckpointId"],s),n}function Ybe(t,e){const n={},i=y(t,["displayName"]);e!==void 0&&i!=null&&b(e,["displayName"],i);const r=y(t,["description"]);e!==void 0&&r!=null&&b(e,["description"],r);const s=y(t,["defaultCheckpointId"]);return e!==void 0&&s!=null&&b(e,["defaultCheckpointId"],s),n}function qbe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","name"],St(t,i));const r=y(e,["config"]);return r!=null&&Kbe(r,n),n}function Jbe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["config"]);return r!=null&&Ybe(r,n),n}function Xbe(t,e){const n={},i=y(t,["outputGcsUri"]);e!==void 0&&i!=null&&b(e,["parameters","storageUri"],i);const r=y(t,["safetyFilterLevel"]);e!==void 0&&r!=null&&b(e,["parameters","safetySetting"],r);const s=y(t,["personGeneration"]);e!==void 0&&s!=null&&b(e,["parameters","personGeneration"],s);const o=y(t,["includeRaiReason"]);e!==void 0&&o!=null&&b(e,["parameters","includeRaiReason"],o);const a=y(t,["outputMimeType"]);e!==void 0&&a!=null&&b(e,["parameters","outputOptions","mimeType"],a);const l=y(t,["outputCompressionQuality"]);e!==void 0&&l!=null&&b(e,["parameters","outputOptions","compressionQuality"],l);const u=y(t,["enhanceInputImage"]);e!==void 0&&u!=null&&b(e,["parameters","upscaleConfig","enhanceInputImage"],u);const d=y(t,["imagePreservationFactor"]);e!==void 0&&d!=null&&b(e,["parameters","upscaleConfig","imagePreservationFactor"],d);const f=y(t,["labels"]);e!==void 0&&f!=null&&b(e,["labels"],f);const g=y(t,["numberOfImages"]);e!==void 0&&g!=null&&b(e,["parameters","sampleCount"],g);const m=y(t,["mode"]);return e!==void 0&&m!=null&&b(e,["parameters","mode"],m),n}function Zbe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["_url","model"],St(t,i));const r=y(e,["image"]);r!=null&&b(n,["instances[0]","image"],Ds(r));const s=y(e,["upscaleFactor"]);s!=null&&b(n,["parameters","upscaleConfig","upscaleFactor"],s);const o=y(e,["config"]);return o!=null&&Xbe(o,n),n}function ewe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>pw(s))),b(e,["generatedImages"],r)}return e}function twe(t){const e={},n=y(t,["uri"]);n!=null&&b(e,["uri"],n);const i=y(t,["encodedVideo"]);i!=null&&b(e,["videoBytes"],Dl(i));const r=y(t,["encoding"]);return r!=null&&b(e,["mimeType"],r),e}function nwe(t){const e={},n=y(t,["gcsUri"]);n!=null&&b(e,["uri"],n);const i=y(t,["bytesBase64Encoded"]);i!=null&&b(e,["videoBytes"],Dl(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["mimeType"],r),e}function iwe(t){const e={},n=y(t,["image"]);n!=null&&b(e,["_self"],Ds(n));const i=y(t,["maskMode"]);return i!=null&&b(e,["maskMode"],i),e}function rwe(t){const e={},n=y(t,["image"]);n!=null&&b(e,["image"],gw(n));const i=y(t,["referenceType"]);return i!=null&&b(e,["referenceType"],i),e}function swe(t){const e={},n=y(t,["image"]);n!=null&&b(e,["image"],Ds(n));const i=y(t,["referenceType"]);return i!=null&&b(e,["referenceType"],i),e}function y7(t){const e={},n=y(t,["uri"]);n!=null&&b(e,["uri"],n);const i=y(t,["videoBytes"]);i!=null&&b(e,["encodedVideo"],Dl(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["encoding"],r),e}function v7(t){const e={},n=y(t,["uri"]);n!=null&&b(e,["gcsUri"],n);const i=y(t,["videoBytes"]);i!=null&&b(e,["bytesBase64Encoded"],Dl(i));const r=y(t,["mimeType"]);return r!=null&&b(e,["mimeType"],r),e}function owe(t,e){const n={},i=y(t,["displayName"]);return e!==void 0&&i!=null&&b(e,["displayName"],i),n}function awe(t){const e={},n=y(t,["config"]);return n!=null&&owe(n,e),e}function lwe(t,e){const n={},i=y(t,["force"]);return e!==void 0&&i!=null&&b(e,["_query","force"],i),n}function cwe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["_url","name"],n);const i=y(t,["config"]);return i!=null&&lwe(i,e),e}function uwe(t){const e={},n=y(t,["name"]);return n!=null&&b(e,["_url","name"],n),e}function dwe(t,e){const n={},i=y(t,["customMetadata"]);if(e!==void 0&&i!=null){let s=i;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["customMetadata"],s)}const r=y(t,["chunkingConfig"]);return e!==void 0&&r!=null&&b(e,["chunkingConfig"],r),n}function hwe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["name"],n);const i=y(t,["metadata"]);i!=null&&b(e,["metadata"],i);const r=y(t,["done"]);r!=null&&b(e,["done"],r);const s=y(t,["error"]);s!=null&&b(e,["error"],s);const o=y(t,["response"]);return o!=null&&b(e,["response"],pwe(o)),e}function fwe(t){const e={},n=y(t,["fileSearchStoreName"]);n!=null&&b(e,["_url","file_search_store_name"],n);const i=y(t,["fileName"]);i!=null&&b(e,["fileName"],i);const r=y(t,["config"]);return r!=null&&dwe(r,e),e}function pwe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["parent"]);i!=null&&b(e,["parent"],i);const r=y(t,["documentName"]);return r!=null&&b(e,["documentName"],r),e}function gwe(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);return e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),n}function mwe(t){const e={},n=y(t,["config"]);return n!=null&&gwe(n,e),e}function Awe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["fileSearchStores"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["fileSearchStores"],s)}return e}function b7(t,e){const n={},i=y(t,["mimeType"]);e!==void 0&&i!=null&&b(e,["mimeType"],i);const r=y(t,["displayName"]);e!==void 0&&r!=null&&b(e,["displayName"],r);const s=y(t,["customMetadata"]);if(e!==void 0&&s!=null){let a=s;Array.isArray(a)&&(a=a.map(l=>l)),b(e,["customMetadata"],a)}const o=y(t,["chunkingConfig"]);return e!==void 0&&o!=null&&b(e,["chunkingConfig"],o),n}function ywe(t){const e={},n=y(t,["fileSearchStoreName"]);n!=null&&b(e,["_url","file_search_store_name"],n);const i=y(t,["config"]);return i!=null&&b7(i,e),e}function vwe(t){const e={},n=y(t,["sdkHttpResponse"]);return n!=null&&b(e,["sdkHttpResponse"],n),e}const bwe="Content-Type",wwe="X-Server-Timeout",Swe="User-Agent",w_="x-goog-api-client",Cwe="1.35.0",xwe=`google-genai-sdk/${Cwe}`,Ewe="v1beta1",_we="v1beta";class Twe{constructor(e){var n,i;this.clientOptions=Object.assign(Object.assign({},e),{project:e.project,location:e.location,apiKey:e.apiKey,vertexai:e.vertexai});const r={};this.clientOptions.vertexai?(r.apiVersion=(n=this.clientOptions.apiVersion)!==null&&n!==void 0?n:Ewe,r.baseUrl=this.baseUrlFromProjectLocation(),this.normalizeAuthParameters()):(r.apiVersion=(i=this.clientOptions.apiVersion)!==null&&i!==void 0?i:_we,r.baseUrl="https://generativelanguage.googleapis.com/"),r.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=r,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(r,e.httpOptions))}baseUrlFromProjectLocation(){return this.clientOptions.project&&this.clientOptions.location&&this.clientOptions.location!=="global"?`https://${this.clientOptions.location}-aiplatform.googleapis.com/`:"https://aiplatform.googleapis.com/"}normalizeAuthParameters(){if(this.clientOptions.project&&this.clientOptions.location){this.clientOptions.apiKey=void 0;return}this.clientOptions.project=void 0,this.clientOptions.location=void 0}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}async getAuthHeaders(){const e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const i=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&i.push(e.apiVersion),i.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),n=new URL(e);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,n,i){const r=[this.getRequestUrlInternal(n)];return i&&r.push(this.getBaseResourcePath()),e!==""&&r.push(e),new URL(`${r.join("/")}`)}shouldPrependVertexProjectPath(e){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e),r=this.constructUrl(e.path,n,i);if(e.queryParams)for(const[o,a]of Object.entries(e.queryParams))r.searchParams.append(o,String(a));let s={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else s.body=e.body;return s=await this.includeExtraHttpOptionsToRequestInit(s,n,r.toString(),e.abortSignal),this.unaryApiCall(r,s,e.httpMethod)}patchHttpOptions(e,n){const i=JSON.parse(JSON.stringify(e));for(const[r,s]of Object.entries(n))typeof s=="object"?i[r]=Object.assign(Object.assign({},i[r]),s):s!==void 0&&(i[r]=s);return i}async requestStream(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e),r=this.constructUrl(e.path,n,i);(!r.searchParams.has("alt")||r.searchParams.get("alt")!=="sse")&&r.searchParams.set("alt","sse");let s={};return s.body=e.body,s=await this.includeExtraHttpOptionsToRequestInit(s,n,r.toString(),e.abortSignal),this.streamApiCall(r,s,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,n,i,r){if(n&&n.timeout||r){const s=new AbortController,o=s.signal;if(n.timeout&&n?.timeout>0){const a=setTimeout(()=>s.abort(),n.timeout);a&&typeof a.unref=="function"&&a.unref()}r&&r.addEventListener("abort",()=>{s.abort()}),e.signal=o}return n&&n.extraBody!==null&&Rwe(e,n.extraBody),e.headers=await this.getHeadersInternal(n,i),e}async unaryApiCall(e,n,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:i})).then(async r=>(await ZL(r),new m_(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}async streamApiCall(e,n,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:i})).then(async r=>(await ZL(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}processStreamResponse(e){return xs(this,arguments,function*(){var i;const r=(i=e?.body)===null||i===void 0?void 0:i.getReader(),s=new TextDecoder("utf-8");if(!r)throw new Error("Response body is empty");try{let o="";const a="data:",l=[` +`);this.baseURL=a.baseURL,this.timeout=a.timeout??wx.DEFAULT_TIMEOUT,this.logger=a.logger??console;const c="warn";this.logLevel=c,this.logLevel=W5(a.logLevel,"ClientOptions.logLevel",this)??W5(my("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??c,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??ENe(),bt(this,TR,PNe),this._options=a,this.apiKey=typeof n=="string"?n:"Missing Key",this.organization=o,this.project=r,this.webhookSecret=i}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){}async authHeaders(t){return ut([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(t){return FNe(t,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${My}`}defaultIdempotencyKey(){return`stainless-node-retry-${Kne()}`}makeStatusError(t,n,o,r){return Uo.generate(t,n,o,r)}async _callApiKey(){const t=this._options.apiKey;if(typeof t!="function")return!1;let n;try{n=await t()}catch(o){throw o instanceof at?o:new at(`Failed to get token from 'apiKey' function: ${o.message}`,{cause:o})}if(typeof n!="string"||!n)throw new at(`Expected 'apiKey' function argument to return a string but it returned ${n}`);return this.apiKey=n,!0}buildURL(t,n,o){const r=!ge(this,f1,"m",_oe).call(this)&&o||this.baseURL,i=yNe(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery();return ANe(s)||(n={...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}async prepareOptions(t){await this._callApiKey()}async prepareRequest(t,{url:n,options:o}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,o){return this.request(Promise.resolve(o).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new mre(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,o){const r=await t,i=r.maxRetries??this.maxRetries;n==null&&(n=i),await this.prepareOptions(r);const{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:i-n});await this.prepareRequest(s,{url:a,options:r});const p="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=o===void 0?"":`, retryOf: ${o}`,l=Date.now();if(kr(this).debug(`[${p}] sending request`,_g({retryOfRequestLogID:o,method:r.method,url:a,options:r,headers:s.headers})),r.signal?.aborted)throw new Ui;const d=new AbortController,f=await this.fetchWithTimeout(a,s,c,d).catch(e1),h=Date.now();if(f instanceof globalThis.Error){const y=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new Ui;const _=Z2(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(n)return kr(this).info(`[${p}] connection ${_?"timed out":"failed"} - ${y}`),kr(this).debug(`[${p}] connection ${_?"timed out":"failed"} (${y})`,_g({retryOfRequestLogID:o,url:a,durationMs:h-l,message:f.message})),this.retryRequest(r,n,o??p);throw kr(this).info(`[${p}] connection ${_?"timed out":"failed"} - error; no more retries left`),kr(this).debug(`[${p}] connection ${_?"timed out":"failed"} (error; no more retries left)`,_g({retryOfRequestLogID:o,url:a,durationMs:h-l,message:f.message})),_?new tx:new zM({cause:f})}const m=[...f.headers.entries()].filter(([y])=>y==="x-request-id").map(([y,_])=>", "+y+": "+JSON.stringify(_)).join(""),g=`[${p}${u}${m}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${h-l}ms`;if(!f.ok){const y=await this.shouldRetry(f);if(n&&y){const T=`retrying, ${n} attempts remaining`;return await MNe(f.body),kr(this).info(`${g} - ${T}`),kr(this).debug(`[${p}] response error (${T})`,_g({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,durationMs:h-l})),this.retryRequest(r,n,o??p,f.headers)}const _=y?"error; no more retries left":"error; not retryable";kr(this).info(`${g} - ${_}`);const S=await f.text().catch(T=>e1(T).message),w=SNe(S),R=w?void 0:S;throw kr(this).debug(`[${p}] response error (${_})`,_g({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,message:R,durationMs:Date.now()-l})),this.makeStatusError(f.status,w,R,f.headers)}return kr(this).info(g),kr(this).debug(`[${p}] response start`,_g({retryOfRequestLogID:o,url:f.url,status:f.status,headers:f.headers,durationMs:h-l})),{response:f,options:r,controller:d,requestLogID:p,retryOfRequestLogID:o,startTime:l}}getAPIList(t,n,o){return this.requestAPIList(n,{method:"get",path:t,...o})}requestAPIList(t,n){const o=this.makeRequest(n,null,void 0);return new GNe(this,o,t)}async fetchWithTimeout(t,n,o,r){const{signal:i,method:s,...a}=n||{};i&&i.addEventListener("abort",()=>r.abort());const c=setTimeout(()=>r.abort(),o),p=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,u={signal:r.signal,...p?{duplex:"half"}:{},method:"GET",...a};s&&(u.method=s.toUpperCase());try{return await this.fetch.call(void 0,t,u)}finally{clearTimeout(c)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,o,r){let i;const s=r?.get("retry-after-ms");if(s){const c=parseFloat(s);Number.isNaN(c)||(i=c)}const a=r?.get("retry-after");if(a&&!i){const c=parseFloat(a);Number.isNaN(c)?i=Date.parse(a)-Date.now():i=c*1e3}if(!(i&&0<=i&&i<60*1e3)){const c=t.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(n,c)}return await DC(i),this.makeRequest(t,n-1,o)}calculateDefaultRetryTimeoutMillis(t,n){const i=n-t,s=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return s*a*1e3}async buildRequest(t,{retryCount:n=0}={}){const o={...t},{method:r,path:i,query:s,defaultBaseURL:a}=o,c=this.buildURL(i,s,a);"timeout"in o&&vNe("timeout",o.timeout),o.timeout=o.timeout??this.timeout;const{bodyHeaders:p,body:u}=this.buildBody({options:o}),l=await this.buildHeaders({options:t,method:r,bodyHeaders:p,retryCount:n});return{req:{method:r,headers:l,...o.signal&&{signal:o.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...o.fetchOptions??{}},url:c,timeout:o.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:o,retryCount:r}){let i={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const s=ut([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...RNe(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(t),this._options.defaultHeaders,o,t.headers]);return this.validateHeaders(s),s.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const o=ut([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&o.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:sre(t)}:ge(this,TR,"f").call(this,{body:t,headers:o})}}wx=Dt,TR=new WeakMap,f1=new WeakSet,_oe=function(){return this.baseURL!=="https://api.openai.com/v1"};Dt.OpenAI=wx;Dt.DEFAULT_TIMEOUT=6e5;Dt.OpenAIError=at;Dt.APIError=Uo;Dt.APIConnectionError=zM;Dt.APIConnectionTimeoutError=tx;Dt.APIUserAbortError=Ui;Dt.NotFoundError=Yne;Dt.ConflictError=Xne;Dt.RateLimitError=ere;Dt.BadRequestError=Qne;Dt.AuthenticationError=$ne;Dt.InternalServerError=tre;Dt.PermissionDeniedError=Wne;Dt.UnprocessableEntityError=Zne;Dt.InvalidWebhookSignatureError=JS;Dt.toFile=XNe;Dt.Completions=Xre;Dt.Chat=ux;Dt.Embeddings=toe;Dt.Files=roe;Dt.Images=uoe;Dt.Audio=LC;Dt.Moderations=doe;Dt.Models=coe;Dt.FineTuning=FA;Dt.Graders=Ax;Dt.VectorStores=YM;Dt.Webhooks=Aoe;Dt.Beta=FC;Dt.Batches=zre;Dt.Uploads=Cx;Dt.Responses=Sx;Dt.Realtime=_x;Dt.Conversations=hx;Dt.Evals=mx;Dt.Containers=fx;const h1=()=>new Date().toISOString(),O2e=()=>({role:"assistant",content:[]}),T2e=e=>({role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:e}}),R2e=()=>`reasoning-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,E2e=(e,t)=>{if(!t||!Array.isArray(e.content))return e;const n=[...e.content],o=n[n.length-1];return!o||o.type!=="reasoning"?n.push({type:"reasoning",text:t}):n[n.length-1]={...o,text:o.text+t},{...e,content:n}},sT=(e,t=!1)=>{if(!Array.isArray(e.content))return e;const n=[...e.content];for(let o=0;o{const o=t.delta.content;if(!o||!Array.isArray(e.content))return e;const r=[...e.content],i=r[r.length-1];return i?i.type==="text"?r[r.length-1]={...i,text:i.text+o}:(i.type==="reasoning"||n)&&r.push({type:"text",text:o}):r.push({type:"text",text:o}),{...e,content:r}},P2e=e=>({type:"tool-call",args:{},argsText:e?.tool_calls?.[0]?.function?.arguments??"",toolName:e?.tool_calls?.[0]?.function?.name??"",toolCallId:e?.tool_calls?.[0]?.id??""}),I2e=(e,t)=>{const n=t?.tool_calls?.[0],o=e.argsText+(n?.function?.arguments??"");let r={};try{r=JSON.parse(o||"{}")}catch{}return{...e,args:r,argsText:o,toolName:e.toolName||n?.function?.name||"",toolCallId:e.toolCallId||n?.id||""}},j2e=(e,t)=>{if(!t.delta.tool_calls||!Array.isArray(e.content))return e;const o=[...e.content],r=o[o.length-1];return!r||r.type!=="tool-call"?o.push(P2e(t.delta)):o[o.length-1]=I2e(r,t.delta),{...e,content:o}},aT={name:"OpenAI",baseUrl:"https://api.openai.com/v1",modelFilters:["gpt-5.2-2025-12-11"],modelNames:{"gpt-5.2-2025-12-11":"GPT-5.2"}},D2e=e=>e.map(t=>({type:"function",function:{name:t.name,description:t.description,parameters:{...t.inputSchema}}})),N2e=e=>typeof e=="string"?e:e.map(t=>{if(t.type==="text")return{type:"text",text:t.text};if(t.type==="file"){const n=JSON.parse(t.mimeType);return{type:"text",text:JSON.stringify({file_data:t.data,filename:n.path,file_id:n.path})}}return t.type==="image"?{type:"image_url",image_url:{url:t.image}}:{type:"text",text:""}}),L2e=e=>{if(typeof e.content=="string")return{content:e.content,reasoningContent:null,toolCalls:[],toolResults:[]};const t=[],n=[],o=[];let r=null;for(const i of e.content){if(i.type==="text"){t.push({type:"text",text:i.text});continue}if(i.type==="reasoning"){r=i.text;continue}i.type==="tool-call"&&(i.result&&o.push({role:"tool",content:i.result,tool_call_id:i.toolCallId??h1()}),n.push({id:i.toolCallId??h1(),type:"function",function:{arguments:i.argsText??"",name:i.toolName}}))}return{content:t,reasoningContent:r,toolCalls:n,toolResults:o}},zD=e=>{const t=[];for(const n of e){if(n.role==="user"||n.role==="system"){const c=n.role==="system"?"user":n.role;t.push({role:c,content:N2e(n.content)});continue}const{content:o,reasoningContent:r,toolCalls:i,toolResults:s}=L2e(n),a={role:"assistant",content:o};r&&(a.reasoning_content=r),i.length>0&&(a.tool_calls=i),t.push(a),s.length>0&&t.push(...s)}return t};class Xg extends JM{createClient(t,n){return new Dt({apiKey:t,baseURL:n,dangerouslyAllowBrowser:!0})}buildSystemMessage(t){return{role:"system",content:t}}createResponseShell(t,n){return t&&n?GM(n):O2e()}pushHistory(t){this.prevMessages.push(...t)}pushSingleMessage(t){const n=zD([t]);this.pushHistory(n)}filterAfterToolCallContent(t,n){const o=t.content;if(typeof o=="string"||!n||typeof n.content=="string")return t;const i=n.content.length,s=o.filter((a,c)=>a.type==="tool-call"?!0:c>=i);return{...t,content:s}}getLastToolCall(t){if(typeof t.content!="string")for(let n=t.content.length-1;n>=0;n-=1){const o=t.content[n];if(o.type==="tool-call")return o}}setProvider=t=>{this.provider=t,this.client=this.createClient(t.key,t.baseUrl),t.key&&this.setApiKey(t.key),t.baseUrl&&this.setUrl(t.baseUrl)};setPrevMessages=t=>{this.prevMessages=zD(t)};setTools=t=>{this.tools=D2e(t)};async createChatName(t){try{if(!this.client)return"";const o=this.modelKey.includes("-thinking")?this.modelKey.replace("-thinking",""):this.modelKey,r=this.buildSystemMessage(qM);return(await this.client.chat.completions.create({messages:[r,{role:"user",content:t}],model:o,stream:!1})).choices[0].message.content??t.substring(0,25)}catch{return""}}async getStream(t,n,o){if(!this.client)return;const r=this.modelKey.includes("-thinking"),i=r?this.modelKey.replace("-thinking",""):this.modelKey,s=o&&r?"medium":void 0;return await this.client.chat.completions.create({messages:[t,...this.prevMessages,...n],model:i,tools:this.tools,stream:!0,reasoning_effort:s})}async*sendMessage(t,n,o,r){if(this.client)try{const i=zD(t),s=this.buildSystemMessage(this.systemPrompt),a=await this.getStream(s,i,r);if(!a)return;this.pushHistory(i);let c=this.createResponseShell(n,o),p=!1,u=!1;for await(const l of a){for(const d of l.choices){if(p)break;const f=d.delta;if(d.finish_reason){u&&(c=sT(c,!0)),c=n?this.filterAfterToolCallContent(c,o):c,this.pushSingleMessage(c),p=!0;break}f.reasoning_content&&(u=!0,c=E2e(c,f.reasoning_content)),f.content&&(u&&(c=sT(c),u=!1),c=M2e(c,d,n)),f.tool_calls&&typeof c.content!="string"&&(u&&(c=sT(c),u=!1),c=j2e(c,d))}if(this.stopFlag){u&&(c=sT(c,!0)),this.pushSingleMessage(c),a.controller.abort(),this.stopFlag=!1,yield{isEnd:!0,responseMessage:c};continue}if(p){yield{isEnd:!0,responseMessage:c};return}yield c}}catch(i){console.error("OpenAI sendMessage error:",i),yield{isEnd:!0,responseMessage:T2e(i)}}}async*sendMessageAfterToolCall(t,n){if(typeof t.content=="string")return t;const o=this.getLastToolCall(t);if(!o)return t;const r={role:"tool",content:o.result,tool_call_id:o.toolCallId??h1()};return this.pushHistory([r]),yield*this.sendMessage([],!0,t,n),t}getName=()=>aT.name;getBaseUrl=()=>aT.baseUrl;checkProvider=async t=>{const n=this.createClient(t.apiKey,t.url);try{return await n.models.list(),!0}catch(o){const r=eDe(o);return r==="invalid_api_key"?yn.invalidKey():r===404?yn.invalidUrl():t.apiKey?yn.invalidKey():yn.emptyKey()}};getProviderModels=async t=>(await this.createClient(t.apiKey,t.url).models.list()).data.filter(r=>aT.modelFilters.includes(r.id)).map(r=>{const i=aT.modelNames[r.id]||r.id.toUpperCase();return{id:`${r.id}-thinking`,name:i,provider:"openai"}})}const F2e=new Xg,by={name:"DeepSeek",baseUrl:"https://api.deepseek.com",modelFilters:["deepseek-chat","deepseek-reasoner"],modelNames:{"deepseek-chat":"DeepsSeek Chat","deepseek-reasoner":"DeepsSeek Reasoner"}};class x2e extends Xg{getName=()=>by.name;getBaseUrl=()=>by.baseUrl;getProviderModels=async t=>{const n=this.createClient(t.apiKey,t.url||by.baseUrl);try{const o=(await n.models.list()).data;return(by.modelFilters.length>0?o.filter(i=>by.modelFilters.includes(i.id)).map(i=>({id:i.id,name:by.modelNames[i.id]||i.id,provider:"deepseek"})):o.map(i=>({id:i.id,name:i.id,provider:"deepseek"}))).reverse()}catch{return[]}}}const B2e=new x2e;var k2e={};let U2e,q2e;function J2e(){return{geminiUrl:U2e,vertexUrl:q2e}}function V2e(e,t,n,o){var r,i;if(!e?.baseUrl){const s=J2e();return t?(r=s.vertexUrl)!==null&&r!==void 0?r:n:(i=s.geminiUrl)!==null&&i!==void 0?i:o}return e.baseUrl}class mp{}function qe(e,t){const n=/\{([^}]+)\}/g;return e.replace(n,(o,r)=>{if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];return i!=null?String(i):""}else throw new Error(`Key '${r}' not found in valueMap.`)})}function M(e,t,n){for(let i=0;i({}));else throw new Error(`Value must be a list given an array path ${s}`);if(Array.isArray(e[a])){const c=e[a];if(Array.isArray(n))for(let p=0;pO(a,t.slice(o+1),n)):n}else return n}else e=e[r]}return e}catch(o){if(o instanceof TypeError)return n;throw o}}function H2e(e,t){for(const[n,o]of Object.entries(t)){const r=n.split("."),i=o.split("."),s=new Set;let a=-1;for(let c=0;ca)for(let c=a;c=t.length||typeof e!="object"||e===null)return;const i=t[o];if(i.endsWith("[]")){const s=i.slice(0,-2),a=e;if(s in a&&Array.isArray(a[s]))for(const c of a[s])p1(c,t,n,o+1,r)}else if(i==="*"){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const s=e,a=Object.keys(s).filter(p=>!p.startsWith("_")&&!r.has(p)),c={};for(const p of a)c[p]=s[p];for(const[p,u]of Object.entries(c)){const l=[];for(const d of n.slice(o))d==="*"?l.push(p):l.push(d);M(s,l,u)}for(const p of a)delete s[p]}}else{const s=e;i in s&&p1(s[i],t,n,o+1,r)}}function Ox(e){if(typeof e!="string")throw new Error("fromImageBytes must be a string");return e}function G2e(e){const t={},n=O(e,["operationName"]);n!=null&&M(t,["operationName"],n);const o=O(e,["resourceName"]);return o!=null&&M(t,["_url","resourceName"],o),t}function z2e(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response","generateVideoResponse"]);return s!=null&&M(t,["response"],Q2e(s)),t}function K2e(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response"]);return s!=null&&M(t,["response"],$2e(s)),t}function Q2e(e){const t={},n=O(e,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>W2e(s))),M(t,["generatedVideos"],i)}const o=O(e,["raiMediaFilteredCount"]);o!=null&&M(t,["raiMediaFilteredCount"],o);const r=O(e,["raiMediaFilteredReasons"]);return r!=null&&M(t,["raiMediaFilteredReasons"],r),t}function $2e(e){const t={},n=O(e,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>Y2e(s))),M(t,["generatedVideos"],i)}const o=O(e,["raiMediaFilteredCount"]);o!=null&&M(t,["raiMediaFilteredCount"],o);const r=O(e,["raiMediaFilteredReasons"]);return r!=null&&M(t,["raiMediaFilteredReasons"],r),t}function W2e(e){const t={},n=O(e,["video"]);return n!=null&&M(t,["video"],r1e(n)),t}function Y2e(e){const t={},n=O(e,["_self"]);return n!=null&&M(t,["video"],o1e(n)),t}function X2e(e){const t={},n=O(e,["operationName"]);return n!=null&&M(t,["_url","operationName"],n),t}function Z2e(e){const t={},n=O(e,["operationName"]);return n!=null&&M(t,["_url","operationName"],n),t}function e1e(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response"]);return s!=null&&M(t,["response"],t1e(s)),t}function t1e(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["parent"]);o!=null&&M(t,["parent"],o);const r=O(e,["documentName"]);return r!=null&&M(t,["documentName"],r),t}function voe(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response"]);return s!=null&&M(t,["response"],n1e(s)),t}function n1e(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["parent"]);o!=null&&M(t,["parent"],o);const r=O(e,["documentName"]);return r!=null&&M(t,["documentName"],r),t}function r1e(e){const t={},n=O(e,["uri"]);n!=null&&M(t,["uri"],n);const o=O(e,["encodedVideo"]);o!=null&&M(t,["videoBytes"],Ox(o));const r=O(e,["encoding"]);return r!=null&&M(t,["mimeType"],r),t}function o1e(e){const t={},n=O(e,["gcsUri"]);n!=null&&M(t,["uri"],n);const o=O(e,["bytesBase64Encoded"]);o!=null&&M(t,["videoBytes"],Ox(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["mimeType"],r),t}var h3;(function(e){e.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",e.OUTCOME_OK="OUTCOME_OK",e.OUTCOME_FAILED="OUTCOME_FAILED",e.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(h3||(h3={}));var p3;(function(e){e.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",e.PYTHON="PYTHON"})(p3||(p3={}));var m3;(function(e){e.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",e.SILENT="SILENT",e.WHEN_IDLE="WHEN_IDLE",e.INTERRUPT="INTERRUPT"})(m3||(m3={}));var um;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.STRING="STRING",e.NUMBER="NUMBER",e.INTEGER="INTEGER",e.BOOLEAN="BOOLEAN",e.ARRAY="ARRAY",e.OBJECT="OBJECT",e.NULL="NULL"})(um||(um={}));var g3;(function(e){e.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",e.SIMPLE_SEARCH="SIMPLE_SEARCH",e.ELASTIC_SEARCH="ELASTIC_SEARCH"})(g3||(g3={}));var b3;(function(e){e.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",e.NO_AUTH="NO_AUTH",e.API_KEY_AUTH="API_KEY_AUTH",e.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",e.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",e.OAUTH="OAUTH",e.OIDC_AUTH="OIDC_AUTH"})(b3||(b3={}));var y3;(function(e){e.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",e.HTTP_IN_QUERY="HTTP_IN_QUERY",e.HTTP_IN_HEADER="HTTP_IN_HEADER",e.HTTP_IN_PATH="HTTP_IN_PATH",e.HTTP_IN_BODY="HTTP_IN_BODY",e.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(y3||(y3={}));var A3;(function(e){e.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",e.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",e.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",e.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(A3||(A3={}));var _3;(function(e){e.UNSPECIFIED="UNSPECIFIED",e.BLOCKING="BLOCKING",e.NON_BLOCKING="NON_BLOCKING"})(_3||(_3={}));var v3;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(v3||(v3={}));var S3;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE",e.VALIDATED="VALIDATED"})(S3||(S3={}));var m1;(function(e){e.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.MINIMAL="MINIMAL"})(m1||(m1={}));var C3;(function(e){e.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",e.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",e.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",e.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",e.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",e.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",e.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",e.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",e.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(C3||(C3={}));var w3;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",e.SEVERITY="SEVERITY",e.PROBABILITY="PROBABILITY"})(w3||(w3={}));var O3;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE",e.OFF="OFF"})(O3||(O3={}));var T3;(function(e){e.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",e.STOP="STOP",e.MAX_TOKENS="MAX_TOKENS",e.SAFETY="SAFETY",e.RECITATION="RECITATION",e.LANGUAGE="LANGUAGE",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.SPII="SPII",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.IMAGE_SAFETY="IMAGE_SAFETY",e.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",e.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",e.NO_IMAGE="NO_IMAGE",e.IMAGE_RECITATION="IMAGE_RECITATION",e.IMAGE_OTHER="IMAGE_OTHER"})(T3||(T3={}));var R3;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(R3||(R3={}));var E3;(function(e){e.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",e.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",e.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",e.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",e.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(E3||(E3={}));var M3;(function(e){e.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",e.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",e.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",e.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",e.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(M3||(M3={}));var P3;(function(e){e.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",e.SAFETY="SAFETY",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.IMAGE_SAFETY="IMAGE_SAFETY",e.MODEL_ARMOR="MODEL_ARMOR",e.JAILBREAK="JAILBREAK"})(P3||(P3={}));var I3;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",e.ON_DEMAND="ON_DEMAND",e.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(I3||(I3={}));var gE;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.AUDIO="AUDIO"})(gE||(gE={}));var j3;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(j3||(j3={}));var D3;(function(e){e.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",e.TUNING_MODE_FULL="TUNING_MODE_FULL",e.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(D3||(D3={}));var N3;(function(e){e.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",e.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",e.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",e.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",e.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",e.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",e.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(N3||(N3={}));var g1;(function(e){e.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",e.JOB_STATE_QUEUED="JOB_STATE_QUEUED",e.JOB_STATE_PENDING="JOB_STATE_PENDING",e.JOB_STATE_RUNNING="JOB_STATE_RUNNING",e.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",e.JOB_STATE_FAILED="JOB_STATE_FAILED",e.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",e.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",e.JOB_STATE_PAUSED="JOB_STATE_PAUSED",e.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",e.JOB_STATE_UPDATING="JOB_STATE_UPDATING",e.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(g1||(g1={}));var L3;(function(e){e.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",e.TUNING_TASK_I2V="TUNING_TASK_I2V",e.TUNING_TASK_T2V="TUNING_TASK_T2V",e.TUNING_TASK_R2V="TUNING_TASK_R2V"})(L3||(L3={}));var F3;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",e.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(F3||(F3={}));var x3;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",e.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",e.BALANCED="BALANCED",e.PRIORITIZE_COST="PRIORITIZE_COST"})(x3||(x3={}));var B3;(function(e){e.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",e.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(B3||(B3={}));var k3;(function(e){e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE"})(k3||(k3={}));var U3;(function(e){e.DONT_ALLOW="DONT_ALLOW",e.ALLOW_ADULT="ALLOW_ADULT",e.ALLOW_ALL="ALLOW_ALL"})(U3||(U3={}));var q3;(function(e){e.auto="auto",e.en="en",e.ja="ja",e.ko="ko",e.hi="hi",e.zh="zh",e.pt="pt",e.es="es"})(q3||(q3={}));var J3;(function(e){e.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",e.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",e.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",e.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",e.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(J3||(J3={}));var V3;(function(e){e.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",e.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",e.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",e.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(V3||(V3={}));var H3;(function(e){e.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",e.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",e.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",e.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(H3||(H3={}));var G3;(function(e){e.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",e.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",e.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",e.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",e.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",e.EDIT_MODE_STYLE="EDIT_MODE_STYLE",e.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",e.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(G3||(G3={}));var z3;(function(e){e.FOREGROUND="FOREGROUND",e.BACKGROUND="BACKGROUND",e.PROMPT="PROMPT",e.SEMANTIC="SEMANTIC",e.INTERACTIVE="INTERACTIVE"})(z3||(z3={}));var K3;(function(e){e.ASSET="ASSET",e.STYLE="STYLE"})(K3||(K3={}));var Q3;(function(e){e.INSERT="INSERT",e.REMOVE="REMOVE",e.REMOVE_STATIC="REMOVE_STATIC",e.OUTPAINT="OUTPAINT"})(Q3||(Q3={}));var $3;(function(e){e.OPTIMIZED="OPTIMIZED",e.LOSSLESS="LOSSLESS"})($3||($3={}));var W3;(function(e){e.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",e.PREFERENCE_TUNING="PREFERENCE_TUNING"})(W3||(W3={}));var Y3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.STATE_PENDING="STATE_PENDING",e.STATE_ACTIVE="STATE_ACTIVE",e.STATE_FAILED="STATE_FAILED"})(Y3||(Y3={}));var X3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.PROCESSING="PROCESSING",e.ACTIVE="ACTIVE",e.FAILED="FAILED"})(X3||(X3={}));var Z3;(function(e){e.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",e.UPLOADED="UPLOADED",e.GENERATED="GENERATED",e.REGISTERED="REGISTERED"})(Z3||(Z3={}));var e6;(function(e){e.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.RESPONSE_REJECTED="RESPONSE_REJECTED",e.NEED_MORE_INPUT="NEED_MORE_INPUT"})(e6||(e6={}));var t6;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.DOCUMENT="DOCUMENT"})(t6||(t6={}));var n6;(function(e){e.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",e.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",e.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(n6||(n6={}));var r6;(function(e){e.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",e.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",e.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(r6||(r6={}));var o6;(function(e){e.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",e.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",e.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(o6||(o6={}));var i6;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",e.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",e.NO_INTERRUPTION="NO_INTERRUPTION"})(i6||(i6={}));var s6;(function(e){e.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",e.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",e.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(s6||(s6={}));var a6;(function(e){e.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",e.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",e.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",e.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",e.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",e.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",e.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",e.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",e.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",e.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",e.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",e.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",e.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(a6||(a6={}));var l6;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",e.QUALITY="QUALITY",e.DIVERSITY="DIVERSITY",e.VOCALIZATION="VOCALIZATION"})(l6||(l6={}));var xy;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",e.PLAY="PLAY",e.PAUSE="PAUSE",e.STOP="STOP",e.RESET_CONTEXT="RESET_CONTEXT"})(xy||(xy={}));class b1{constructor(t){const n={};for(const o of t.headers.entries())n[o[0]]=o[1];this.headers=n,this.responseInternal=t}json(){return this.responseInternal.json()}}class hv{get text(){var t,n,o,r,i,s,a,c;if(((r=(o=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let p="",u=!1;const l=[];for(const d of(c=(a=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(const[f,h]of Object.entries(d))f!=="text"&&f!=="thought"&&f!=="thoughtSignature"&&(h!==null||h!==void 0)&&l.push(f);if(typeof d.text=="string"){if(typeof d.thought=="boolean"&&d.thought)continue;u=!0,p+=d.text}}return l.length>0&&console.warn(`there are non-text parts ${l} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),u?p:void 0}get data(){var t,n,o,r,i,s,a,c;if(((r=(o=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let p="";const u=[];for(const l of(c=(a=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||a===void 0?void 0:a.parts)!==null&&c!==void 0?c:[]){for(const[d,f]of Object.entries(l))d!=="inlineData"&&(f!==null||f!==void 0)&&u.push(d);l.inlineData&&typeof l.inlineData.data=="string"&&(p+=atob(l.inlineData.data))}return u.length>0&&console.warn(`there are non-data parts ${u} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),p.length>0?btoa(p):void 0}get functionCalls(){var t,n,o,r,i,s,a,c;if(((r=(o=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const p=(c=(a=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(u=>u.functionCall).map(u=>u.functionCall).filter(u=>u!==void 0);if(p?.length!==0)return p}get executableCode(){var t,n,o,r,i,s,a,c,p;if(((r=(o=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const u=(c=(a=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(l=>l.executableCode).map(l=>l.executableCode).filter(l=>l!==void 0);if(u?.length!==0)return(p=u?.[0])===null||p===void 0?void 0:p.code}get codeExecutionResult(){var t,n,o,r,i,s,a,c,p;if(((r=(o=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const u=(c=(a=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||a===void 0?void 0:a.parts)===null||c===void 0?void 0:c.filter(l=>l.codeExecutionResult).map(l=>l.codeExecutionResult).filter(l=>l!==void 0);if(u?.length!==0)return(p=u?.[0])===null||p===void 0?void 0:p.output}}class u6{}class c6{}class i1e{}class s1e{}class a1e{}class l1e{}class d6{}class f6{}class h6{}class u1e{}class bE{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const o=new bE;let r;const i=t;return n?r=K2e(i):r=z2e(i),Object.assign(o,r),o}}class p6{}class m6{}class g6{}class b6{}class c1e{}class d1e{}class f1e{}class Tx{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const o=new Tx,i=e1e(t);return Object.assign(o,i),o}}class h1e{}class p1e{}class m1e{}class y6{}class g1e{get text(){var t,n,o;let r="",i=!1;const s=[];for(const a of(o=(n=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&o!==void 0?o:[]){for(const[c,p]of Object.entries(a))c!=="text"&&c!=="thought"&&p!==null&&s.push(c);if(typeof a.text=="string"){if(typeof a.thought=="boolean"&&a.thought)continue;i=!0,r+=a.text}}return s.length>0&&console.warn(`there are non-text parts ${s} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?r:void 0}get data(){var t,n,o;let r="";const i=[];for(const s of(o=(n=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&o!==void 0?o:[]){for(const[a,c]of Object.entries(s))a!=="inlineData"&&c!==null&&i.push(a);s.inlineData&&typeof s.inlineData.data=="string"&&(r+=atob(s.inlineData.data))}return i.length>0&&console.warn(`there are non-data parts ${i} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),r.length>0?btoa(r):void 0}}class b1e{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class Rx{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const o=new Rx,i=voe(t);return Object.assign(o,i),o}}function $t(e,t){if(!t||typeof t!="string")throw new Error("model is required and must be a string");if(t.includes("..")||t.includes("?")||t.includes("&"))throw new Error("invalid model parameter");if(e.isVertexAI()){if(t.startsWith("publishers/")||t.startsWith("projects/")||t.startsWith("models/"))return t;if(t.indexOf("/")>=0){const n=t.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${t}`}else return t.startsWith("models/")||t.startsWith("tunedModels/")?t:`models/${t}`}function Soe(e,t){const n=$t(e,t);return n?n.startsWith("publishers/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}`:n.startsWith("models/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${n}`:n:""}function Coe(e){return Array.isArray(e)?e.map(t=>yE(t)):[yE(e)]}function yE(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function woe(e){const t=yE(e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function Ooe(e){const t=yE(e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function A6(e){if(e==null)throw new Error("PartUnion is required");if(typeof e=="object")return e;if(typeof e=="string")return{text:e};throw new Error(`Unsupported part type: ${typeof e}`)}function Toe(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>A6(t)):[A6(e)]}function y1(e){return e!=null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)}function _6(e){return e!=null&&typeof e=="object"&&"functionCall"in e}function v6(e){return e!=null&&typeof e=="object"&&"functionResponse"in e}function to(e){if(e==null)throw new Error("ContentUnion is required");return y1(e)?e:{role:"user",parts:Toe(e)}}function Ex(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(n=>{const o=to(n);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]});if(e.isVertexAI()){const n=to(t);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(t)?t.map(n=>to(n)):[to(t)]}function Gi(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(_6(e)||v6(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[to(e)]}const t=[],n=[],o=y1(e[0]);for(const r of e){const i=y1(r);if(i!=o)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(i)t.push(r);else{if(_6(r)||v6(r))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");n.push(r)}}return o||t.push({role:"user",parts:Toe(n)}),t}function y1e(e,t){e.includes("null")&&(t.nullable=!0);const n=e.filter(o=>o!=="null");if(n.length===1)t.type=Object.values(um).includes(n[0].toUpperCase())?n[0].toUpperCase():um.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const o of n)t.anyOf.push({type:Object.values(um).includes(o.toUpperCase())?o.toUpperCase():um.TYPE_UNSPECIFIED})}}function Xy(e){const t={},n=["items"],o=["anyOf"],r=["properties"];if(e.type&&e.anyOf)throw new Error("type and anyOf cannot be both populated.");const i=e.anyOf;i!=null&&i.length==2&&(i[0].type==="null"?(t.nullable=!0,e=i[1]):i[1].type==="null"&&(t.nullable=!0,e=i[0])),e.type instanceof Array&&y1e(e.type,t);for(const[s,a]of Object.entries(e))if(a!=null)if(s=="type"){if(a==="null")throw new Error("type: null can not be the only possible type for the field.");if(a instanceof Array)continue;t.type=Object.values(um).includes(a.toUpperCase())?a.toUpperCase():um.TYPE_UNSPECIFIED}else if(n.includes(s))t[s]=Xy(a);else if(o.includes(s)){const c=[];for(const p of a){if(p.type=="null"){t.nullable=!0;continue}c.push(Xy(p))}t[s]=c}else if(r.includes(s)){const c={};for(const[p,u]of Object.entries(a))c[p]=Xy(u);t[s]=c}else{if(s==="additionalProperties")continue;t[s]=a}return t}function Mx(e){return Xy(e)}function Px(e){if(typeof e=="object")return e;if(typeof e=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw new Error(`Unsupported speechConfig type: ${typeof e}`)}function Ix(e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function xA(e){if(e.functionDeclarations)for(const t of e.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes("$schema")?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=Xy(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=Xy(t.response));return e}function BA(e){if(e==null)throw new Error("tools is required");if(!Array.isArray(e))throw new Error("tools is required and must be an array of Tools");const t=[];for(const n of e)t.push(n);return t}function A1e(e,t,n,o=1){const r=!t.startsWith(`${n}/`)&&t.split("/").length===o;return e.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${e.getProject()}/${t}`:t.startsWith(`${n}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:r?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}/${t}`:t:r?`${n}/${t}`:t}function gp(e,t){if(typeof t!="string")throw new Error("name must be a string");return A1e(e,t,"cachedContents")}function Roe(e){switch(e){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return e}}function Em(e){return Ox(e)}function _1e(e){return e!=null&&typeof e=="object"&&"name"in e}function v1e(e){return e!=null&&typeof e=="object"&&"video"in e}function S1e(e){return e!=null&&typeof e=="object"&&"uri"in e}function Eoe(e){var t;let n;if(_1e(e)&&(n=e.name),!(S1e(e)&&(n=e.uri,n===void 0))&&!(v1e(e)&&(n=(t=e.video)===null||t===void 0?void 0:t.uri,n===void 0))){if(typeof e=="string"&&(n=e),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){const r=n.split("files/")[1].match(/[a-z0-9]+/);if(r===null)throw new Error(`Could not extract file name from URI ${n}`);n=r[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}function Moe(e,t){let n;return e.isVertexAI()?n=t?"publishers/google/models":"models":n=t?"models":"tunedModels",n}function Poe(e){for(const t of["models","tunedModels","publisherModels"])if(C1e(e,t))return e[t];return[]}function C1e(e,t){return e!==null&&typeof e=="object"&&t in e}function w1e(e,t={}){const n=e,o={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(o.responseJsonSchema=n.outputSchema),t.behavior&&(o.behavior=t.behavior),{functionDeclarations:[o]}}function O1e(e,t={}){const n=[],o=new Set;for(const r of e){const i=r.name;if(o.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);o.add(i);const s=w1e(r,t);s.functionDeclarations&&n.push(...s.functionDeclarations)}return{functionDeclarations:n}}function Ioe(e,t){let n;if(typeof t=="string")if(e.isVertexAI())if(t.startsWith("gs://"))n={format:"jsonl",gcsUri:[t]};else if(t.startsWith("bq://"))n={format:"bigquery",bigqueryUri:t};else throw new Error(`Unsupported string source for Vertex AI: ${t}`);else if(t.startsWith("files/"))n={fileName:t};else throw new Error(`Unsupported string source for Gemini API: ${t}`);else if(Array.isArray(t)){if(e.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");n={inlinedRequests:t}}else n=t;const o=[n.gcsUri,n.bigqueryUri].filter(Boolean).length,r=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(e.isVertexAI()){if(r>0||o!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(o>0||r!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function T1e(e){if(typeof e!="string")return e;const t=e;if(t.startsWith("gs://"))return{format:"jsonl",gcsUri:t};if(t.startsWith("bq://"))return{format:"bigquery",bigqueryUri:t};throw new Error(`Unsupported destination: ${t}`)}function joe(e){if(typeof e!="object"||e===null)return{};const t=e,n=t.inlinedResponses;if(typeof n!="object"||n===null)return e;const r=n.inlinedResponses;if(!Array.isArray(r)||r.length===0)return e;let i=!1;for(const s of r){if(typeof s!="object"||s===null)continue;const c=s.response;if(typeof c!="object"||c===null)continue;if(c.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function kA(e,t){const n=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}function Doe(e){const t=e;return t==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":t==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":t==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":t==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":t==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":t==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":t==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":t}function R1e(e){const t={},n=O(e,["responsesFile"]);n!=null&&M(t,["fileName"],n);const o=O(e,["inlinedResponses","inlinedResponses"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>aLe(s))),M(t,["inlinedResponses"],i)}const r=O(e,["inlinedEmbedContentResponses","inlinedResponses"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["inlinedEmbedContentResponses"],i)}return t}function E1e(e){const t={},n=O(e,["predictionsFormat"]);n!=null&&M(t,["format"],n);const o=O(e,["gcsDestination","outputUriPrefix"]);o!=null&&M(t,["gcsUri"],o);const r=O(e,["bigqueryDestination","outputUri"]);return r!=null&&M(t,["bigqueryUri"],r),t}function M1e(e){const t={},n=O(e,["format"]);n!=null&&M(t,["predictionsFormat"],n);const o=O(e,["gcsUri"]);o!=null&&M(t,["gcsDestination","outputUriPrefix"],o);const r=O(e,["bigqueryUri"]);if(r!=null&&M(t,["bigqueryDestination","outputUri"],r),O(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(O(e,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(O(e,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function RR(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata","displayName"]);o!=null&&M(t,["displayName"],o);const r=O(e,["metadata","state"]);r!=null&&M(t,["state"],Doe(r));const i=O(e,["metadata","createTime"]);i!=null&&M(t,["createTime"],i);const s=O(e,["metadata","endTime"]);s!=null&&M(t,["endTime"],s);const a=O(e,["metadata","updateTime"]);a!=null&&M(t,["updateTime"],a);const c=O(e,["metadata","model"]);c!=null&&M(t,["model"],c);const p=O(e,["metadata","output"]);return p!=null&&M(t,["dest"],R1e(joe(p))),t}function A1(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["displayName"]);o!=null&&M(t,["displayName"],o);const r=O(e,["state"]);r!=null&&M(t,["state"],Doe(r));const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["createTime"]);s!=null&&M(t,["createTime"],s);const a=O(e,["startTime"]);a!=null&&M(t,["startTime"],a);const c=O(e,["endTime"]);c!=null&&M(t,["endTime"],c);const p=O(e,["updateTime"]);p!=null&&M(t,["updateTime"],p);const u=O(e,["model"]);u!=null&&M(t,["model"],u);const l=O(e,["inputConfig"]);l!=null&&M(t,["src"],P1e(l));const d=O(e,["outputConfig"]);d!=null&&M(t,["dest"],E1e(joe(d)));const f=O(e,["completionStats"]);return f!=null&&M(t,["completionStats"],f),t}function P1e(e){const t={},n=O(e,["instancesFormat"]);n!=null&&M(t,["format"],n);const o=O(e,["gcsSource","uris"]);o!=null&&M(t,["gcsUri"],o);const r=O(e,["bigquerySource","inputUri"]);return r!=null&&M(t,["bigqueryUri"],r),t}function I1e(e,t){const n={};if(O(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(O(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(O(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const o=O(t,["fileName"]);o!=null&&M(n,["fileName"],o);const r=O(t,["inlinedRequests"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>sLe(e,s))),M(n,["requests","requests"],i)}return n}function j1e(e){const t={},n=O(e,["format"]);n!=null&&M(t,["instancesFormat"],n);const o=O(e,["gcsUri"]);o!=null&&M(t,["gcsSource","uris"],o);const r=O(e,["bigqueryUri"]);if(r!=null&&M(t,["bigquerySource","inputUri"],r),O(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(O(e,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function D1e(e){const t={},n=O(e,["data"]);if(n!=null&&M(t,["data"],n),O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function N1e(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function L1e(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function F1e(e){const t={},n=O(e,["content"]);n!=null&&M(t,["content"],n);const o=O(e,["citationMetadata"]);o!=null&&M(t,["citationMetadata"],x1e(o));const r=O(e,["tokenCount"]);r!=null&&M(t,["tokenCount"],r);const i=O(e,["finishReason"]);i!=null&&M(t,["finishReason"],i);const s=O(e,["avgLogprobs"]);s!=null&&M(t,["avgLogprobs"],s);const a=O(e,["groundingMetadata"]);a!=null&&M(t,["groundingMetadata"],a);const c=O(e,["index"]);c!=null&&M(t,["index"],c);const p=O(e,["logprobsResult"]);p!=null&&M(t,["logprobsResult"],p);const u=O(e,["safetyRatings"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(f=>f)),M(t,["safetyRatings"],d)}const l=O(e,["urlContextMetadata"]);return l!=null&&M(t,["urlContextMetadata"],l),t}function x1e(e){const t={},n=O(e,["citationSources"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>r)),M(t,["citations"],o)}return t}function Noe(e){const t={},n=O(e,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>pLe(i))),M(t,["parts"],r)}const o=O(e,["role"]);return o!=null&&M(t,["role"],o),t}function B1e(e,t){const n={},o=O(e,["displayName"]);if(t!==void 0&&o!=null&&M(t,["batch","displayName"],o),O(e,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return n}function k1e(e,t){const n={},o=O(e,["displayName"]);t!==void 0&&o!=null&&M(t,["displayName"],o);const r=O(e,["dest"]);return t!==void 0&&r!=null&&M(t,["outputConfig"],M1e(T1e(r))),n}function S6(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["src"]);r!=null&&M(n,["batch","inputConfig"],I1e(e,Ioe(e,r)));const i=O(t,["config"]);return i!=null&&B1e(i,n),n}function U1e(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["model"],$t(e,o));const r=O(t,["src"]);r!=null&&M(n,["inputConfig"],j1e(Ioe(e,r)));const i=O(t,["config"]);return i!=null&&k1e(i,n),n}function q1e(e,t){const n={},o=O(e,["displayName"]);return t!==void 0&&o!=null&&M(t,["batch","displayName"],o),n}function J1e(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["src"]);r!=null&&M(n,["batch","inputConfig"],$1e(e,r));const i=O(t,["config"]);return i!=null&&q1e(i,n),n}function V1e(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function H1e(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function G1e(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["name"]);o!=null&&M(t,["name"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);return i!=null&&M(t,["error"],i),t}function z1e(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["name"]);o!=null&&M(t,["name"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);return i!=null&&M(t,["error"],i),t}function K1e(e,t){const n={},o=O(t,["contents"]);if(o!=null){let i=Ex(e,o);Array.isArray(i)&&(i=i.map(s=>s)),M(n,["requests[]","request","content"],i)}const r=O(t,["config"]);return r!=null&&(M(n,["_self"],Q1e(r,n)),H2e(n,{"requests[].*":"requests[].request.*"})),n}function Q1e(e,t){const n={},o=O(e,["taskType"]);t!==void 0&&o!=null&&M(t,["requests[]","taskType"],o);const r=O(e,["title"]);t!==void 0&&r!=null&&M(t,["requests[]","title"],r);const i=O(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&M(t,["requests[]","outputDimensionality"],i),O(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(O(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function $1e(e,t){const n={},o=O(t,["fileName"]);o!=null&&M(n,["file_name"],o);const r=O(t,["inlinedRequests"]);return r!=null&&M(n,["requests"],K1e(e,r)),n}function W1e(e){const t={};if(O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=O(e,["fileUri"]);n!=null&&M(t,["fileUri"],n);const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function Y1e(e){const t={},n=O(e,["id"]);n!=null&&M(t,["id"],n);const o=O(e,["args"]);o!=null&&M(t,["args"],o);const r=O(e,["name"]);if(r!=null&&M(t,["name"],r),O(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(O(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function X1e(e){const t={},n=O(e,["allowedFunctionNames"]);n!=null&&M(t,["allowedFunctionNames"],n);const o=O(e,["mode"]);if(o!=null&&M(t,["mode"],o),O(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function Z1e(e,t,n){const o={},r=O(t,["systemInstruction"]);n!==void 0&&r!=null&&M(n,["systemInstruction"],Noe(to(r)));const i=O(t,["temperature"]);i!=null&&M(o,["temperature"],i);const s=O(t,["topP"]);s!=null&&M(o,["topP"],s);const a=O(t,["topK"]);a!=null&&M(o,["topK"],a);const c=O(t,["candidateCount"]);c!=null&&M(o,["candidateCount"],c);const p=O(t,["maxOutputTokens"]);p!=null&&M(o,["maxOutputTokens"],p);const u=O(t,["stopSequences"]);u!=null&&M(o,["stopSequences"],u);const l=O(t,["responseLogprobs"]);l!=null&&M(o,["responseLogprobs"],l);const d=O(t,["logprobs"]);d!=null&&M(o,["logprobs"],d);const f=O(t,["presencePenalty"]);f!=null&&M(o,["presencePenalty"],f);const h=O(t,["frequencyPenalty"]);h!=null&&M(o,["frequencyPenalty"],h);const m=O(t,["seed"]);m!=null&&M(o,["seed"],m);const g=O(t,["responseMimeType"]);g!=null&&M(o,["responseMimeType"],g);const y=O(t,["responseSchema"]);y!=null&&M(o,["responseSchema"],Mx(y));const _=O(t,["responseJsonSchema"]);if(_!=null&&M(o,["responseJsonSchema"],_),O(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(O(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const S=O(t,["safetySettings"]);if(n!==void 0&&S!=null){let I=S;Array.isArray(I)&&(I=I.map(U=>mLe(U))),M(n,["safetySettings"],I)}const w=O(t,["tools"]);if(n!==void 0&&w!=null){let I=BA(w);Array.isArray(I)&&(I=I.map(U=>bLe(xA(U)))),M(n,["tools"],I)}const R=O(t,["toolConfig"]);if(n!==void 0&&R!=null&&M(n,["toolConfig"],gLe(R)),O(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const E=O(t,["cachedContent"]);n!==void 0&&E!=null&&M(n,["cachedContent"],gp(e,E));const T=O(t,["responseModalities"]);T!=null&&M(o,["responseModalities"],T);const D=O(t,["mediaResolution"]);D!=null&&M(o,["mediaResolution"],D);const B=O(t,["speechConfig"]);if(B!=null&&M(o,["speechConfig"],Px(B)),O(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const N=O(t,["thinkingConfig"]);N!=null&&M(o,["thinkingConfig"],N);const L=O(t,["imageConfig"]);L!=null&&M(o,["imageConfig"],iLe(L));const q=O(t,["enableEnhancedCivicAnswers"]);return q!=null&&M(o,["enableEnhancedCivicAnswers"],q),o}function eLe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["candidates"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(p=>F1e(p))),M(t,["candidates"],c)}const r=O(e,["modelVersion"]);r!=null&&M(t,["modelVersion"],r);const i=O(e,["promptFeedback"]);i!=null&&M(t,["promptFeedback"],i);const s=O(e,["responseId"]);s!=null&&M(t,["responseId"],s);const a=O(e,["usageMetadata"]);return a!=null&&M(t,["usageMetadata"],a),t}function tLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function nLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],kA(e,o)),n}function rLe(e){const t={};if(O(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=O(e,["enableWidget"]);return n!=null&&M(t,["enableWidget"],n),t}function oLe(e){const t={};if(O(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(O(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=O(e,["timeRangeFilter"]);return n!=null&&M(t,["timeRangeFilter"],n),t}function iLe(e){const t={},n=O(e,["aspectRatio"]);n!=null&&M(t,["aspectRatio"],n);const o=O(e,["imageSize"]);if(o!=null&&M(t,["imageSize"],o),O(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(O(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(O(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function sLe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["request","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let a=Gi(r);Array.isArray(a)&&(a=a.map(c=>Noe(c))),M(n,["request","contents"],a)}const i=O(t,["metadata"]);i!=null&&M(n,["metadata"],i);const s=O(t,["config"]);return s!=null&&M(n,["request","generationConfig"],Z1e(e,s,O(n,["request"],{}))),n}function aLe(e){const t={},n=O(e,["response"]);n!=null&&M(t,["response"],eLe(n));const o=O(e,["error"]);return o!=null&&M(t,["error"],o),t}function lLe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);if(t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),O(e,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return n}function uLe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);t!==void 0&&r!=null&&M(t,["_query","pageToken"],r);const i=O(e,["filter"]);return t!==void 0&&i!=null&&M(t,["_query","filter"],i),n}function cLe(e){const t={},n=O(e,["config"]);return n!=null&&lLe(n,t),t}function dLe(e){const t={},n=O(e,["config"]);return n!=null&&uLe(n,t),t}function fLe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["operations"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>RR(s))),M(t,["batchJobs"],i)}return t}function hLe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["batchPredictionJobs"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>A1(s))),M(t,["batchJobs"],i)}return t}function pLe(e){const t={},n=O(e,["mediaResolution"]);n!=null&&M(t,["mediaResolution"],n);const o=O(e,["codeExecutionResult"]);o!=null&&M(t,["codeExecutionResult"],o);const r=O(e,["executableCode"]);r!=null&&M(t,["executableCode"],r);const i=O(e,["fileData"]);i!=null&&M(t,["fileData"],W1e(i));const s=O(e,["functionCall"]);s!=null&&M(t,["functionCall"],Y1e(s));const a=O(e,["functionResponse"]);a!=null&&M(t,["functionResponse"],a);const c=O(e,["inlineData"]);c!=null&&M(t,["inlineData"],D1e(c));const p=O(e,["text"]);p!=null&&M(t,["text"],p);const u=O(e,["thought"]);u!=null&&M(t,["thought"],u);const l=O(e,["thoughtSignature"]);l!=null&&M(t,["thoughtSignature"],l);const d=O(e,["videoMetadata"]);return d!=null&&M(t,["videoMetadata"],d),t}function mLe(e){const t={},n=O(e,["category"]);if(n!=null&&M(t,["category"],n),O(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=O(e,["threshold"]);return o!=null&&M(t,["threshold"],o),t}function gLe(e){const t={},n=O(e,["retrievalConfig"]);n!=null&&M(t,["retrievalConfig"],n);const o=O(e,["functionCallingConfig"]);return o!=null&&M(t,["functionCallingConfig"],X1e(o)),t}function bLe(e){const t={};if(O(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=O(e,["computerUse"]);n!=null&&M(t,["computerUse"],n);const o=O(e,["fileSearch"]);o!=null&&M(t,["fileSearch"],o);const r=O(e,["codeExecution"]);if(r!=null&&M(t,["codeExecution"],r),O(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=O(e,["functionDeclarations"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(l=>l)),M(t,["functionDeclarations"],u)}const s=O(e,["googleMaps"]);s!=null&&M(t,["googleMaps"],rLe(s));const a=O(e,["googleSearch"]);a!=null&&M(t,["googleSearch"],oLe(a));const c=O(e,["googleSearchRetrieval"]);c!=null&&M(t,["googleSearchRetrieval"],c);const p=O(e,["urlContext"]);return p!=null&&M(t,["urlContext"],p),t}var up;(function(e){e.PAGED_ITEM_BATCH_JOBS="batchJobs",e.PAGED_ITEM_MODELS="models",e.PAGED_ITEM_TUNING_JOBS="tuningJobs",e.PAGED_ITEM_FILES="files",e.PAGED_ITEM_CACHED_CONTENTS="cachedContents",e.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",e.PAGED_ITEM_DOCUMENTS="documents"})(up||(up={}));class Zg{constructor(t,n,o,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(t,o,r)}init(t,n,o){var r,i;this.nameInternal=t,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n?.sdkHttpResponse,this.idxInternal=0;let s={config:{}};!o||Object.keys(o).length===0?s={config:{}}:typeof o=="object"?s=Object.assign({},o):s=o,s.config&&(s.config.pageToken=n.nextPageToken),this.paramsInternal=s,this.pageInternalSize=(i=(r=s.config)===null||r===void 0?void 0:r.pageSize)!==null&&i!==void 0?i:this.pageInternal.length}initNextPage(t){this.init(this.nameInternal,t,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(t){return this.pageInternal[t]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const t=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:t,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const t=await this.requestInternal(this.params);return this.initNextPage(t),this.page}hasNextPage(){var t;return((t=this.params.config)===null||t===void 0?void 0:t.pageToken)!==void 0}}class yLe extends mp{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new Zg(up.PAGED_ITEM_BATCH_JOBS,o=>this.listInternal(o),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(n)}}createInlinedGenerateContentRequest(t){const n=S6(this.apiClient,t),o=n._url,r=qe("{model}:batchGenerateContent",o),a=n.batch.inputConfig.requests,c=a.requests,p=[];for(const u of c){const l=Object.assign({},u);if(l.systemInstruction){const d=l.systemInstruction;delete l.systemInstruction;const f=l.request;f.systemInstruction=d,l.request=f}p.push(l)}return a.requests=p,delete n.config,delete n._url,delete n._query,{path:r,body:n}}getGcsUri(t){if(typeof t=="string")return t.startsWith("gs://")?t:void 0;if(!Array.isArray(t)&&t.gcsUri&&t.gcsUri.length>0)return t.gcsUri[0]}getBigqueryUri(t){if(typeof t=="string")return t.startsWith("bq://")?t:void 0;if(!Array.isArray(t))return t.bigqueryUri}formatDestination(t,n){const o=n?Object.assign({},n):{},r=Date.now().toString();if(o.displayName||(o.displayName=`genaiBatchJob_${r}`),o.dest===void 0){const i=this.getGcsUri(t),s=this.getBigqueryUri(t);if(i)i.endsWith(".jsonl")?o.dest=`${i.slice(0,-6)}/dest`:o.dest=`${i}_dest_${r}`;else if(s)o.dest=`${s}_dest_${r}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return o}async createInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=U1e(this.apiClient,t);return a=qe("batchPredictionJobs",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>A1(u))}else{const p=S6(this.apiClient,t);return a=qe("{model}:batchGenerateContent",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>RR(u))}}async createEmbeddingsInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=J1e(this.apiClient,t);return i=qe("{model}:asyncBatchEmbedContent",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>RR(c))}}async get(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=nLe(this.apiClient,t);return a=qe("batchPredictionJobs/{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>A1(u))}else{const p=tLe(this.apiClient,t);return a=qe("batches/{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>RR(u))}}async cancel(t){var n,o,r,i;let s="",a={};if(this.apiClient.isVertexAI()){const c=L1e(this.apiClient,t);s=qe("batchPredictionJobs/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal})}else{const c=N1e(this.apiClient,t);s=qe("batches/{name}:cancel",c._url),a=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=dLe(t);return a=qe("batchPredictionJobs",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=hLe(u),d=new y6;return Object.assign(d,l),d})}else{const p=cLe(t);return a=qe("batches",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=fLe(u),d=new y6;return Object.assign(d,l),d})}}async delete(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=H1e(this.apiClient,t);return a=qe("batchPredictionJobs/{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>z1e(u))}else{const p=V1e(this.apiClient,t);return a=qe("batches/{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>G1e(u))}}}function ALe(e){const t={},n=O(e,["data"]);if(n!=null&&M(t,["data"],n),O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function C6(e){const t={},n=O(e,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>JLe(i))),M(t,["parts"],r)}const o=O(e,["role"]);return o!=null&&M(t,["role"],o),t}function _Le(e,t){const n={},o=O(e,["ttl"]);t!==void 0&&o!=null&&M(t,["ttl"],o);const r=O(e,["expireTime"]);t!==void 0&&r!=null&&M(t,["expireTime"],r);const i=O(e,["displayName"]);t!==void 0&&i!=null&&M(t,["displayName"],i);const s=O(e,["contents"]);if(t!==void 0&&s!=null){let u=Gi(s);Array.isArray(u)&&(u=u.map(l=>C6(l))),M(t,["contents"],u)}const a=O(e,["systemInstruction"]);t!==void 0&&a!=null&&M(t,["systemInstruction"],C6(to(a)));const c=O(e,["tools"]);if(t!==void 0&&c!=null){let u=c;Array.isArray(u)&&(u=u.map(l=>HLe(l))),M(t,["tools"],u)}const p=O(e,["toolConfig"]);if(t!==void 0&&p!=null&&M(t,["toolConfig"],VLe(p)),O(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return n}function vLe(e,t){const n={},o=O(e,["ttl"]);t!==void 0&&o!=null&&M(t,["ttl"],o);const r=O(e,["expireTime"]);t!==void 0&&r!=null&&M(t,["expireTime"],r);const i=O(e,["displayName"]);t!==void 0&&i!=null&&M(t,["displayName"],i);const s=O(e,["contents"]);if(t!==void 0&&s!=null){let l=Gi(s);Array.isArray(l)&&(l=l.map(d=>d)),M(t,["contents"],l)}const a=O(e,["systemInstruction"]);t!==void 0&&a!=null&&M(t,["systemInstruction"],to(a));const c=O(e,["tools"]);if(t!==void 0&&c!=null){let l=c;Array.isArray(l)&&(l=l.map(d=>GLe(d))),M(t,["tools"],l)}const p=O(e,["toolConfig"]);t!==void 0&&p!=null&&M(t,["toolConfig"],p);const u=O(e,["kmsKeyName"]);return t!==void 0&&u!=null&&M(t,["encryption_spec","kmsKeyName"],u),n}function SLe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["model"],Soe(e,o));const r=O(t,["config"]);return r!=null&&_Le(r,n),n}function CLe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["model"],Soe(e,o));const r=O(t,["config"]);return r!=null&&vLe(r,n),n}function wLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],gp(e,o)),n}function OLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],gp(e,o)),n}function TLe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function RLe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function ELe(e){const t={};if(O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=O(e,["fileUri"]);n!=null&&M(t,["fileUri"],n);const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function MLe(e){const t={},n=O(e,["id"]);n!=null&&M(t,["id"],n);const o=O(e,["args"]);o!=null&&M(t,["args"],o);const r=O(e,["name"]);if(r!=null&&M(t,["name"],r),O(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(O(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function PLe(e){const t={},n=O(e,["allowedFunctionNames"]);n!=null&&M(t,["allowedFunctionNames"],n);const o=O(e,["mode"]);if(o!=null&&M(t,["mode"],o),O(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function ILe(e){const t={},n=O(e,["description"]);n!=null&&M(t,["description"],n);const o=O(e,["name"]);o!=null&&M(t,["name"],o);const r=O(e,["parameters"]);r!=null&&M(t,["parameters"],r);const i=O(e,["parametersJsonSchema"]);i!=null&&M(t,["parametersJsonSchema"],i);const s=O(e,["response"]);s!=null&&M(t,["response"],s);const a=O(e,["responseJsonSchema"]);if(a!=null&&M(t,["responseJsonSchema"],a),O(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function jLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],gp(e,o)),n}function DLe(e,t){const n={},o=O(t,["name"]);return o!=null&&M(n,["_url","name"],gp(e,o)),n}function NLe(e){const t={};if(O(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=O(e,["enableWidget"]);return n!=null&&M(t,["enableWidget"],n),t}function LLe(e){const t={};if(O(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(O(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=O(e,["timeRangeFilter"]);return n!=null&&M(t,["timeRangeFilter"],n),t}function FLe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);return t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),n}function xLe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);return t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),n}function BLe(e){const t={},n=O(e,["config"]);return n!=null&&FLe(n,t),t}function kLe(e){const t={},n=O(e,["config"]);return n!=null&&xLe(n,t),t}function ULe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["cachedContents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["cachedContents"],i)}return t}function qLe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["cachedContents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["cachedContents"],i)}return t}function JLe(e){const t={},n=O(e,["mediaResolution"]);n!=null&&M(t,["mediaResolution"],n);const o=O(e,["codeExecutionResult"]);o!=null&&M(t,["codeExecutionResult"],o);const r=O(e,["executableCode"]);r!=null&&M(t,["executableCode"],r);const i=O(e,["fileData"]);i!=null&&M(t,["fileData"],ELe(i));const s=O(e,["functionCall"]);s!=null&&M(t,["functionCall"],MLe(s));const a=O(e,["functionResponse"]);a!=null&&M(t,["functionResponse"],a);const c=O(e,["inlineData"]);c!=null&&M(t,["inlineData"],ALe(c));const p=O(e,["text"]);p!=null&&M(t,["text"],p);const u=O(e,["thought"]);u!=null&&M(t,["thought"],u);const l=O(e,["thoughtSignature"]);l!=null&&M(t,["thoughtSignature"],l);const d=O(e,["videoMetadata"]);return d!=null&&M(t,["videoMetadata"],d),t}function VLe(e){const t={},n=O(e,["retrievalConfig"]);n!=null&&M(t,["retrievalConfig"],n);const o=O(e,["functionCallingConfig"]);return o!=null&&M(t,["functionCallingConfig"],PLe(o)),t}function HLe(e){const t={};if(O(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=O(e,["computerUse"]);n!=null&&M(t,["computerUse"],n);const o=O(e,["fileSearch"]);o!=null&&M(t,["fileSearch"],o);const r=O(e,["codeExecution"]);if(r!=null&&M(t,["codeExecution"],r),O(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=O(e,["functionDeclarations"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(l=>l)),M(t,["functionDeclarations"],u)}const s=O(e,["googleMaps"]);s!=null&&M(t,["googleMaps"],NLe(s));const a=O(e,["googleSearch"]);a!=null&&M(t,["googleSearch"],LLe(a));const c=O(e,["googleSearchRetrieval"]);c!=null&&M(t,["googleSearchRetrieval"],c);const p=O(e,["urlContext"]);return p!=null&&M(t,["urlContext"],p),t}function GLe(e){const t={},n=O(e,["retrieval"]);n!=null&&M(t,["retrieval"],n);const o=O(e,["computerUse"]);if(o!=null&&M(t,["computerUse"],o),O(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=O(e,["codeExecution"]);r!=null&&M(t,["codeExecution"],r);const i=O(e,["enterpriseWebSearch"]);i!=null&&M(t,["enterpriseWebSearch"],i);const s=O(e,["functionDeclarations"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>ILe(d))),M(t,["functionDeclarations"],l)}const a=O(e,["googleMaps"]);a!=null&&M(t,["googleMaps"],a);const c=O(e,["googleSearch"]);c!=null&&M(t,["googleSearch"],c);const p=O(e,["googleSearchRetrieval"]);p!=null&&M(t,["googleSearchRetrieval"],p);const u=O(e,["urlContext"]);return u!=null&&M(t,["urlContext"],u),t}function zLe(e,t){const n={},o=O(e,["ttl"]);t!==void 0&&o!=null&&M(t,["ttl"],o);const r=O(e,["expireTime"]);return t!==void 0&&r!=null&&M(t,["expireTime"],r),n}function KLe(e,t){const n={},o=O(e,["ttl"]);t!==void 0&&o!=null&&M(t,["ttl"],o);const r=O(e,["expireTime"]);return t!==void 0&&r!=null&&M(t,["expireTime"],r),n}function QLe(e,t){const n={},o=O(t,["name"]);o!=null&&M(n,["_url","name"],gp(e,o));const r=O(t,["config"]);return r!=null&&zLe(r,n),n}function $Le(e,t){const n={},o=O(t,["name"]);o!=null&&M(n,["_url","name"],gp(e,o));const r=O(t,["config"]);return r!=null&&KLe(r,n),n}class WLe extends mp{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new Zg(up.PAGED_ITEM_CACHED_CONTENTS,o=>this.listInternal(o),await this.listInternal(n),n)}async create(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=CLe(this.apiClient,t);return a=qe("cachedContents",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>u)}else{const p=SLe(this.apiClient,t);return a=qe("cachedContents",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>u)}}async get(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=DLe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>u)}else{const p=jLe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>u)}}async delete(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=OLe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=RLe(u),d=new g6;return Object.assign(d,l),d})}else{const p=wLe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=TLe(u),d=new g6;return Object.assign(d,l),d})}}async update(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=$Le(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>u)}else{const p=QLe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>u)}}async listInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=kLe(t);return a=qe("cachedContents",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=qLe(u),d=new b6;return Object.assign(d,l),d})}else{const p=BLe(t);return a=qe("cachedContents",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=ULe(u),d=new b6;return Object.assign(d,l),d})}}}function AE(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _t(e){return this instanceof _t?(this.v=e,this):new _t(e)}function vs(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n.apply(e,t||[]),r,i=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(f){return function(h){return Promise.resolve(h).then(f,l)}}function a(f,h){o[f]&&(r[f]=function(m){return new Promise(function(g,y){i.push([f,m,g,y])>1||c(f,m)})},h&&(r[f]=h(r[f])))}function c(f,h){try{p(o[f](h))}catch(m){d(i[0][3],m)}}function p(f){f.value instanceof _t?Promise.resolve(f.value.v).then(u,l):d(i[0][2],f)}function u(f){c("next",f)}function l(f){c("throw",f)}function d(f,h){f(h),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ss(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof w6=="function"?w6(e):e[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(i){n[i]=e[i]&&function(s){return new Promise(function(a,c){s=e[i](s),r(a,c,s.done,s.value)})}}function r(i,s,a,c){Promise.resolve(c).then(function(p){i({value:p,done:a})},s)}}function YLe(e){var t;if(e.candidates==null||e.candidates.length===0)return!1;const n=(t=e.candidates[0])===null||t===void 0?void 0:t.content;return n===void 0?!1:Loe(n)}function Loe(e){if(e.parts===void 0||e.parts.length===0)return!1;for(const t of e.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function XLe(e){if(e.length!==0){for(const t of e)if(t.role!=="user"&&t.role!=="model")throw new Error(`Role must be user or model, but got ${t.role}.`)}}function O6(e){if(e===void 0||e.length===0)return[];const t=[],n=e.length;let o=0;for(;o{var i,s,a;const c=await r,p=(s=(i=c.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content,u=c.automaticFunctionCallingHistory,l=this.getHistory(!0).length;let d=[];u!=null&&(d=(a=u.slice(l))!==null&&a!==void 0?a:[]);const f=p?[p]:[];this.recordHistory(o,f,d)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),r}async sendMessageStream(t){var n;await this.sendPromise;const o=to(t.message),r=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(o),config:(n=t.config)!==null&&n!==void 0?n:this.config});this.sendPromise=r.then(()=>{}).catch(()=>{});const i=await r;return this.processStreamResponse(i,o)}getHistory(t=!1){const n=t?O6(this.history):this.history;return structuredClone(n)}processStreamResponse(t,n){return vs(this,arguments,function*(){var r,i,s,a,c,p;const u=[];try{for(var l=!0,d=Ss(t),f;f=yield _t(d.next()),r=f.done,!r;l=!0){a=f.value,l=!1;const h=a;if(YLe(h)){const m=(p=(c=h.candidates)===null||c===void 0?void 0:c[0])===null||p===void 0?void 0:p.content;m!==void 0&&u.push(m)}yield yield _t(h)}}catch(h){i={error:h}}finally{try{!l&&!r&&(s=d.return)&&(yield _t(s.call(d)))}finally{if(i)throw i.error}}this.recordHistory(n,u)})}recordHistory(t,n,o){let r=[];n.length>0&&n.every(i=>i.role!==void 0)?r=n:r.push({role:"model",parts:[]}),o&&o.length>0?this.history.push(...O6(o)):this.history.push(t),this.history.push(...r)}}class XM extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,XM.prototype)}}function tFe(e){const t={},n=O(e,["file"]);return n!=null&&M(t,["file"],n),t}function nFe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function rFe(e){const t={},n=O(e,["name"]);return n!=null&&M(t,["_url","file"],Eoe(n)),t}function oFe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function iFe(e){const t={},n=O(e,["name"]);return n!=null&&M(t,["_url","file"],Eoe(n)),t}function sFe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);return t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),n}function aFe(e){const t={},n=O(e,["config"]);return n!=null&&sFe(n,t),t}function lFe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["files"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["files"],i)}return t}class uFe extends mp{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new Zg(up.PAGED_ITEM_FILES,o=>this.listInternal(o),await this.listInternal(n),n)}async upload(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(t.file,t.config).then(n=>n)}async download(t){await this.apiClient.downloadFile(t)}async listInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=aFe(t);return i=qe("files",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>{const p=lFe(c),u=new h1e;return Object.assign(u,p),u})}}async createInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=tFe(t);return i=qe("upload/v1beta/files",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=nFe(c),u=new p1e;return Object.assign(u,p),u})}}async get(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=iFe(t);return i=qe("files/{file}",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=rFe(t);return i=qe("files/{file}",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>{const p=oFe(c),u=new m1e;return Object.assign(u,p),u})}}}function ER(e){const t={},n=O(e,["data"]);if(n!=null&&M(t,["data"],n),O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function cFe(e){const t={},n=O(e,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>TFe(i))),M(t,["parts"],r)}const o=O(e,["role"]);return o!=null&&M(t,["role"],o),t}function dFe(e){const t={};if(O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=O(e,["fileUri"]);n!=null&&M(t,["fileUri"],n);const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function fFe(e){const t={},n=O(e,["id"]);n!=null&&M(t,["id"],n);const o=O(e,["args"]);o!=null&&M(t,["args"],o);const r=O(e,["name"]);if(r!=null&&M(t,["name"],r),O(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(O(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function hFe(e){const t={},n=O(e,["description"]);n!=null&&M(t,["description"],n);const o=O(e,["name"]);o!=null&&M(t,["name"],o);const r=O(e,["parameters"]);r!=null&&M(t,["parameters"],r);const i=O(e,["parametersJsonSchema"]);i!=null&&M(t,["parametersJsonSchema"],i);const s=O(e,["response"]);s!=null&&M(t,["response"],s);const a=O(e,["responseJsonSchema"]);if(a!=null&&M(t,["responseJsonSchema"],a),O(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function pFe(e){const t={},n=O(e,["modelSelectionConfig"]);n!=null&&M(t,["modelConfig"],n);const o=O(e,["responseJsonSchema"]);o!=null&&M(t,["responseJsonSchema"],o);const r=O(e,["audioTimestamp"]);r!=null&&M(t,["audioTimestamp"],r);const i=O(e,["candidateCount"]);i!=null&&M(t,["candidateCount"],i);const s=O(e,["enableAffectiveDialog"]);s!=null&&M(t,["enableAffectiveDialog"],s);const a=O(e,["frequencyPenalty"]);a!=null&&M(t,["frequencyPenalty"],a);const c=O(e,["logprobs"]);c!=null&&M(t,["logprobs"],c);const p=O(e,["maxOutputTokens"]);p!=null&&M(t,["maxOutputTokens"],p);const u=O(e,["mediaResolution"]);u!=null&&M(t,["mediaResolution"],u);const l=O(e,["presencePenalty"]);l!=null&&M(t,["presencePenalty"],l);const d=O(e,["responseLogprobs"]);d!=null&&M(t,["responseLogprobs"],d);const f=O(e,["responseMimeType"]);f!=null&&M(t,["responseMimeType"],f);const h=O(e,["responseModalities"]);h!=null&&M(t,["responseModalities"],h);const m=O(e,["responseSchema"]);m!=null&&M(t,["responseSchema"],m);const g=O(e,["routingConfig"]);g!=null&&M(t,["routingConfig"],g);const y=O(e,["seed"]);y!=null&&M(t,["seed"],y);const _=O(e,["speechConfig"]);_!=null&&M(t,["speechConfig"],_);const S=O(e,["stopSequences"]);S!=null&&M(t,["stopSequences"],S);const w=O(e,["temperature"]);w!=null&&M(t,["temperature"],w);const R=O(e,["thinkingConfig"]);R!=null&&M(t,["thinkingConfig"],R);const E=O(e,["topK"]);E!=null&&M(t,["topK"],E);const T=O(e,["topP"]);if(T!=null&&M(t,["topP"],T),O(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function mFe(e){const t={};if(O(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=O(e,["enableWidget"]);return n!=null&&M(t,["enableWidget"],n),t}function gFe(e){const t={};if(O(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(O(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=O(e,["timeRangeFilter"]);return n!=null&&M(t,["timeRangeFilter"],n),t}function bFe(e,t){const n={},o=O(e,["generationConfig"]);t!==void 0&&o!=null&&M(t,["setup","generationConfig"],o);const r=O(e,["responseModalities"]);t!==void 0&&r!=null&&M(t,["setup","generationConfig","responseModalities"],r);const i=O(e,["temperature"]);t!==void 0&&i!=null&&M(t,["setup","generationConfig","temperature"],i);const s=O(e,["topP"]);t!==void 0&&s!=null&&M(t,["setup","generationConfig","topP"],s);const a=O(e,["topK"]);t!==void 0&&a!=null&&M(t,["setup","generationConfig","topK"],a);const c=O(e,["maxOutputTokens"]);t!==void 0&&c!=null&&M(t,["setup","generationConfig","maxOutputTokens"],c);const p=O(e,["mediaResolution"]);t!==void 0&&p!=null&&M(t,["setup","generationConfig","mediaResolution"],p);const u=O(e,["seed"]);t!==void 0&&u!=null&&M(t,["setup","generationConfig","seed"],u);const l=O(e,["speechConfig"]);t!==void 0&&l!=null&&M(t,["setup","generationConfig","speechConfig"],Ix(l));const d=O(e,["thinkingConfig"]);t!==void 0&&d!=null&&M(t,["setup","generationConfig","thinkingConfig"],d);const f=O(e,["enableAffectiveDialog"]);t!==void 0&&f!=null&&M(t,["setup","generationConfig","enableAffectiveDialog"],f);const h=O(e,["systemInstruction"]);t!==void 0&&h!=null&&M(t,["setup","systemInstruction"],cFe(to(h)));const m=O(e,["tools"]);if(t!==void 0&&m!=null){let E=BA(m);Array.isArray(E)&&(E=E.map(T=>EFe(xA(T)))),M(t,["setup","tools"],E)}const g=O(e,["sessionResumption"]);t!==void 0&&g!=null&&M(t,["setup","sessionResumption"],RFe(g));const y=O(e,["inputAudioTranscription"]);t!==void 0&&y!=null&&M(t,["setup","inputAudioTranscription"],y);const _=O(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&M(t,["setup","outputAudioTranscription"],_);const S=O(e,["realtimeInputConfig"]);t!==void 0&&S!=null&&M(t,["setup","realtimeInputConfig"],S);const w=O(e,["contextWindowCompression"]);t!==void 0&&w!=null&&M(t,["setup","contextWindowCompression"],w);const R=O(e,["proactivity"]);if(t!==void 0&&R!=null&&M(t,["setup","proactivity"],R),O(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function yFe(e,t){const n={},o=O(e,["generationConfig"]);t!==void 0&&o!=null&&M(t,["setup","generationConfig"],pFe(o));const r=O(e,["responseModalities"]);t!==void 0&&r!=null&&M(t,["setup","generationConfig","responseModalities"],r);const i=O(e,["temperature"]);t!==void 0&&i!=null&&M(t,["setup","generationConfig","temperature"],i);const s=O(e,["topP"]);t!==void 0&&s!=null&&M(t,["setup","generationConfig","topP"],s);const a=O(e,["topK"]);t!==void 0&&a!=null&&M(t,["setup","generationConfig","topK"],a);const c=O(e,["maxOutputTokens"]);t!==void 0&&c!=null&&M(t,["setup","generationConfig","maxOutputTokens"],c);const p=O(e,["mediaResolution"]);t!==void 0&&p!=null&&M(t,["setup","generationConfig","mediaResolution"],p);const u=O(e,["seed"]);t!==void 0&&u!=null&&M(t,["setup","generationConfig","seed"],u);const l=O(e,["speechConfig"]);t!==void 0&&l!=null&&M(t,["setup","generationConfig","speechConfig"],Ix(l));const d=O(e,["thinkingConfig"]);t!==void 0&&d!=null&&M(t,["setup","generationConfig","thinkingConfig"],d);const f=O(e,["enableAffectiveDialog"]);t!==void 0&&f!=null&&M(t,["setup","generationConfig","enableAffectiveDialog"],f);const h=O(e,["systemInstruction"]);t!==void 0&&h!=null&&M(t,["setup","systemInstruction"],to(h));const m=O(e,["tools"]);if(t!==void 0&&m!=null){let T=BA(m);Array.isArray(T)&&(T=T.map(D=>MFe(xA(D)))),M(t,["setup","tools"],T)}const g=O(e,["sessionResumption"]);t!==void 0&&g!=null&&M(t,["setup","sessionResumption"],g);const y=O(e,["inputAudioTranscription"]);t!==void 0&&y!=null&&M(t,["setup","inputAudioTranscription"],y);const _=O(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&M(t,["setup","outputAudioTranscription"],_);const S=O(e,["realtimeInputConfig"]);t!==void 0&&S!=null&&M(t,["setup","realtimeInputConfig"],S);const w=O(e,["contextWindowCompression"]);t!==void 0&&w!=null&&M(t,["setup","contextWindowCompression"],w);const R=O(e,["proactivity"]);t!==void 0&&R!=null&&M(t,["setup","proactivity"],R);const E=O(e,["explicitVadSignal"]);return t!==void 0&&E!=null&&M(t,["setup","explicitVadSignal"],E),n}function AFe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["setup","model"],$t(e,o));const r=O(t,["config"]);return r!=null&&M(n,["config"],bFe(r,n)),n}function _Fe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["setup","model"],$t(e,o));const r=O(t,["config"]);return r!=null&&M(n,["config"],yFe(r,n)),n}function vFe(e){const t={},n=O(e,["musicGenerationConfig"]);return n!=null&&M(t,["musicGenerationConfig"],n),t}function SFe(e){const t={},n=O(e,["weightedPrompts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>r)),M(t,["weightedPrompts"],o)}return t}function CFe(e){const t={},n=O(e,["media"]);if(n!=null){let p=Coe(n);Array.isArray(p)&&(p=p.map(u=>ER(u))),M(t,["mediaChunks"],p)}const o=O(e,["audio"]);o!=null&&M(t,["audio"],ER(Ooe(o)));const r=O(e,["audioStreamEnd"]);r!=null&&M(t,["audioStreamEnd"],r);const i=O(e,["video"]);i!=null&&M(t,["video"],ER(woe(i)));const s=O(e,["text"]);s!=null&&M(t,["text"],s);const a=O(e,["activityStart"]);a!=null&&M(t,["activityStart"],a);const c=O(e,["activityEnd"]);return c!=null&&M(t,["activityEnd"],c),t}function wFe(e){const t={},n=O(e,["media"]);if(n!=null){let p=Coe(n);Array.isArray(p)&&(p=p.map(u=>u)),M(t,["mediaChunks"],p)}const o=O(e,["audio"]);o!=null&&M(t,["audio"],Ooe(o));const r=O(e,["audioStreamEnd"]);r!=null&&M(t,["audioStreamEnd"],r);const i=O(e,["video"]);i!=null&&M(t,["video"],woe(i));const s=O(e,["text"]);s!=null&&M(t,["text"],s);const a=O(e,["activityStart"]);a!=null&&M(t,["activityStart"],a);const c=O(e,["activityEnd"]);return c!=null&&M(t,["activityEnd"],c),t}function OFe(e){const t={},n=O(e,["setupComplete"]);n!=null&&M(t,["setupComplete"],n);const o=O(e,["serverContent"]);o!=null&&M(t,["serverContent"],o);const r=O(e,["toolCall"]);r!=null&&M(t,["toolCall"],r);const i=O(e,["toolCallCancellation"]);i!=null&&M(t,["toolCallCancellation"],i);const s=O(e,["usageMetadata"]);s!=null&&M(t,["usageMetadata"],PFe(s));const a=O(e,["goAway"]);a!=null&&M(t,["goAway"],a);const c=O(e,["sessionResumptionUpdate"]);c!=null&&M(t,["sessionResumptionUpdate"],c);const p=O(e,["voiceActivityDetectionSignal"]);return p!=null&&M(t,["voiceActivityDetectionSignal"],p),t}function TFe(e){const t={},n=O(e,["mediaResolution"]);n!=null&&M(t,["mediaResolution"],n);const o=O(e,["codeExecutionResult"]);o!=null&&M(t,["codeExecutionResult"],o);const r=O(e,["executableCode"]);r!=null&&M(t,["executableCode"],r);const i=O(e,["fileData"]);i!=null&&M(t,["fileData"],dFe(i));const s=O(e,["functionCall"]);s!=null&&M(t,["functionCall"],fFe(s));const a=O(e,["functionResponse"]);a!=null&&M(t,["functionResponse"],a);const c=O(e,["inlineData"]);c!=null&&M(t,["inlineData"],ER(c));const p=O(e,["text"]);p!=null&&M(t,["text"],p);const u=O(e,["thought"]);u!=null&&M(t,["thought"],u);const l=O(e,["thoughtSignature"]);l!=null&&M(t,["thoughtSignature"],l);const d=O(e,["videoMetadata"]);return d!=null&&M(t,["videoMetadata"],d),t}function RFe(e){const t={},n=O(e,["handle"]);if(n!=null&&M(t,["handle"],n),O(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function EFe(e){const t={};if(O(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=O(e,["computerUse"]);n!=null&&M(t,["computerUse"],n);const o=O(e,["fileSearch"]);o!=null&&M(t,["fileSearch"],o);const r=O(e,["codeExecution"]);if(r!=null&&M(t,["codeExecution"],r),O(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=O(e,["functionDeclarations"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(l=>l)),M(t,["functionDeclarations"],u)}const s=O(e,["googleMaps"]);s!=null&&M(t,["googleMaps"],mFe(s));const a=O(e,["googleSearch"]);a!=null&&M(t,["googleSearch"],gFe(a));const c=O(e,["googleSearchRetrieval"]);c!=null&&M(t,["googleSearchRetrieval"],c);const p=O(e,["urlContext"]);return p!=null&&M(t,["urlContext"],p),t}function MFe(e){const t={},n=O(e,["retrieval"]);n!=null&&M(t,["retrieval"],n);const o=O(e,["computerUse"]);if(o!=null&&M(t,["computerUse"],o),O(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=O(e,["codeExecution"]);r!=null&&M(t,["codeExecution"],r);const i=O(e,["enterpriseWebSearch"]);i!=null&&M(t,["enterpriseWebSearch"],i);const s=O(e,["functionDeclarations"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>hFe(d))),M(t,["functionDeclarations"],l)}const a=O(e,["googleMaps"]);a!=null&&M(t,["googleMaps"],a);const c=O(e,["googleSearch"]);c!=null&&M(t,["googleSearch"],c);const p=O(e,["googleSearchRetrieval"]);p!=null&&M(t,["googleSearchRetrieval"],p);const u=O(e,["urlContext"]);return u!=null&&M(t,["urlContext"],u),t}function PFe(e){const t={},n=O(e,["promptTokenCount"]);n!=null&&M(t,["promptTokenCount"],n);const o=O(e,["cachedContentTokenCount"]);o!=null&&M(t,["cachedContentTokenCount"],o);const r=O(e,["candidatesTokenCount"]);r!=null&&M(t,["responseTokenCount"],r);const i=O(e,["toolUsePromptTokenCount"]);i!=null&&M(t,["toolUsePromptTokenCount"],i);const s=O(e,["thoughtsTokenCount"]);s!=null&&M(t,["thoughtsTokenCount"],s);const a=O(e,["totalTokenCount"]);a!=null&&M(t,["totalTokenCount"],a);const c=O(e,["promptTokensDetails"]);if(c!=null){let f=c;Array.isArray(f)&&(f=f.map(h=>h)),M(t,["promptTokensDetails"],f)}const p=O(e,["cacheTokensDetails"]);if(p!=null){let f=p;Array.isArray(f)&&(f=f.map(h=>h)),M(t,["cacheTokensDetails"],f)}const u=O(e,["candidatesTokensDetails"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(h=>h)),M(t,["responseTokensDetails"],f)}const l=O(e,["toolUsePromptTokensDetails"]);if(l!=null){let f=l;Array.isArray(f)&&(f=f.map(h=>h)),M(t,["toolUsePromptTokensDetails"],f)}const d=O(e,["trafficType"]);return d!=null&&M(t,["trafficType"],d),t}function IFe(e){const t={},n=O(e,["data"]);if(n!=null&&M(t,["data"],n),O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function jFe(e){const t={},n=O(e,["content"]);n!=null&&M(t,["content"],n);const o=O(e,["citationMetadata"]);o!=null&&M(t,["citationMetadata"],DFe(o));const r=O(e,["tokenCount"]);r!=null&&M(t,["tokenCount"],r);const i=O(e,["finishReason"]);i!=null&&M(t,["finishReason"],i);const s=O(e,["avgLogprobs"]);s!=null&&M(t,["avgLogprobs"],s);const a=O(e,["groundingMetadata"]);a!=null&&M(t,["groundingMetadata"],a);const c=O(e,["index"]);c!=null&&M(t,["index"],c);const p=O(e,["logprobsResult"]);p!=null&&M(t,["logprobsResult"],p);const u=O(e,["safetyRatings"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(f=>f)),M(t,["safetyRatings"],d)}const l=O(e,["urlContextMetadata"]);return l!=null&&M(t,["urlContextMetadata"],l),t}function DFe(e){const t={},n=O(e,["citationSources"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>r)),M(t,["citations"],o)}return t}function NFe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let i=Gi(r);Array.isArray(i)&&(i=i.map(s=>s)),M(n,["contents"],i)}return n}function LFe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["tokensInfo"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),M(t,["tokensInfo"],r)}return t}function FFe(e){const t={},n=O(e,["values"]);n!=null&&M(t,["values"],n);const o=O(e,["statistics"]);return o!=null&&M(t,["statistics"],xFe(o)),t}function xFe(e){const t={},n=O(e,["truncated"]);n!=null&&M(t,["truncated"],n);const o=O(e,["token_count"]);return o!=null&&M(t,["tokenCount"],o),t}function ZM(e){const t={},n=O(e,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>zxe(i))),M(t,["parts"],r)}const o=O(e,["role"]);return o!=null&&M(t,["role"],o),t}function BFe(e){const t={},n=O(e,["controlType"]);n!=null&&M(t,["controlType"],n);const o=O(e,["enableControlImageComputation"]);return o!=null&&M(t,["computeControl"],o),t}function kFe(e){const t={};if(O(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(O(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(O(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return t}function UFe(e,t){const n={},o=O(e,["systemInstruction"]);t!==void 0&&o!=null&&M(t,["systemInstruction"],to(o));const r=O(e,["tools"]);if(t!==void 0&&r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>koe(a))),M(t,["tools"],s)}const i=O(e,["generationConfig"]);return t!==void 0&&i!=null&&M(t,["generationConfig"],Ixe(i)),n}function qFe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let s=Gi(r);Array.isArray(s)&&(s=s.map(a=>ZM(a))),M(n,["contents"],s)}const i=O(t,["config"]);return i!=null&&kFe(i),n}function JFe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let s=Gi(r);Array.isArray(s)&&(s=s.map(a=>a)),M(n,["contents"],s)}const i=O(t,["config"]);return i!=null&&UFe(i,n),n}function VFe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["totalTokens"]);o!=null&&M(t,["totalTokens"],o);const r=O(e,["cachedContentTokenCount"]);return r!=null&&M(t,["cachedContentTokenCount"],r),t}function HFe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["totalTokens"]);return o!=null&&M(t,["totalTokens"],o),t}function GFe(e,t){const n={},o=O(t,["model"]);return o!=null&&M(n,["_url","name"],$t(e,o)),n}function zFe(e,t){const n={},o=O(t,["model"]);return o!=null&&M(n,["_url","name"],$t(e,o)),n}function KFe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function QFe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}function $Fe(e,t){const n={},o=O(e,["outputGcsUri"]);t!==void 0&&o!=null&&M(t,["parameters","storageUri"],o);const r=O(e,["negativePrompt"]);t!==void 0&&r!=null&&M(t,["parameters","negativePrompt"],r);const i=O(e,["numberOfImages"]);t!==void 0&&i!=null&&M(t,["parameters","sampleCount"],i);const s=O(e,["aspectRatio"]);t!==void 0&&s!=null&&M(t,["parameters","aspectRatio"],s);const a=O(e,["guidanceScale"]);t!==void 0&&a!=null&&M(t,["parameters","guidanceScale"],a);const c=O(e,["seed"]);t!==void 0&&c!=null&&M(t,["parameters","seed"],c);const p=O(e,["safetyFilterLevel"]);t!==void 0&&p!=null&&M(t,["parameters","safetySetting"],p);const u=O(e,["personGeneration"]);t!==void 0&&u!=null&&M(t,["parameters","personGeneration"],u);const l=O(e,["includeSafetyAttributes"]);t!==void 0&&l!=null&&M(t,["parameters","includeSafetyAttributes"],l);const d=O(e,["includeRaiReason"]);t!==void 0&&d!=null&&M(t,["parameters","includeRaiReason"],d);const f=O(e,["language"]);t!==void 0&&f!=null&&M(t,["parameters","language"],f);const h=O(e,["outputMimeType"]);t!==void 0&&h!=null&&M(t,["parameters","outputOptions","mimeType"],h);const m=O(e,["outputCompressionQuality"]);t!==void 0&&m!=null&&M(t,["parameters","outputOptions","compressionQuality"],m);const g=O(e,["addWatermark"]);t!==void 0&&g!=null&&M(t,["parameters","addWatermark"],g);const y=O(e,["labels"]);t!==void 0&&y!=null&&M(t,["labels"],y);const _=O(e,["editMode"]);t!==void 0&&_!=null&&M(t,["parameters","editMode"],_);const S=O(e,["baseSteps"]);return t!==void 0&&S!=null&&M(t,["parameters","editConfig","baseSteps"],S),n}function WFe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["prompt"]);r!=null&&M(n,["instances[0]","prompt"],r);const i=O(t,["referenceImages"]);if(i!=null){let a=i;Array.isArray(a)&&(a=a.map(c=>Xxe(c))),M(n,["instances[0]","referenceImages"],a)}const s=O(t,["config"]);return s!=null&&$Fe(s,n),n}function YFe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>eP(i))),M(t,["generatedImages"],r)}return t}function XFe(e,t){const n={},o=O(e,["taskType"]);t!==void 0&&o!=null&&M(t,["requests[]","taskType"],o);const r=O(e,["title"]);t!==void 0&&r!=null&&M(t,["requests[]","title"],r);const i=O(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&M(t,["requests[]","outputDimensionality"],i),O(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(O(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function ZFe(e,t){const n={},o=O(e,["taskType"]);t!==void 0&&o!=null&&M(t,["instances[]","task_type"],o);const r=O(e,["title"]);t!==void 0&&r!=null&&M(t,["instances[]","title"],r);const i=O(e,["outputDimensionality"]);t!==void 0&&i!=null&&M(t,["parameters","outputDimensionality"],i);const s=O(e,["mimeType"]);t!==void 0&&s!=null&&M(t,["instances[]","mimeType"],s);const a=O(e,["autoTruncate"]);return t!==void 0&&a!=null&&M(t,["parameters","autoTruncate"],a),n}function exe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let a=Ex(e,r);Array.isArray(a)&&(a=a.map(c=>c)),M(n,["requests[]","content"],a)}const i=O(t,["config"]);i!=null&&XFe(i,n);const s=O(t,["model"]);return s!==void 0&&M(n,["requests[]","model"],$t(e,s)),n}function txe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let s=Ex(e,r);Array.isArray(s)&&(s=s.map(a=>a)),M(n,["instances[]","content"],s)}const i=O(t,["config"]);return i!=null&&ZFe(i,n),n}function nxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["embeddings"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["embeddings"],i)}const r=O(e,["metadata"]);return r!=null&&M(t,["metadata"],r),t}function rxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["predictions[]","embeddings"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>FFe(s))),M(t,["embeddings"],i)}const r=O(e,["metadata"]);return r!=null&&M(t,["metadata"],r),t}function oxe(e){const t={},n=O(e,["endpoint"]);n!=null&&M(t,["name"],n);const o=O(e,["deployedModelId"]);return o!=null&&M(t,["deployedModelId"],o),t}function ixe(e){const t={};if(O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=O(e,["fileUri"]);n!=null&&M(t,["fileUri"],n);const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function sxe(e){const t={},n=O(e,["id"]);n!=null&&M(t,["id"],n);const o=O(e,["args"]);o!=null&&M(t,["args"],o);const r=O(e,["name"]);if(r!=null&&M(t,["name"],r),O(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(O(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function axe(e){const t={},n=O(e,["allowedFunctionNames"]);n!=null&&M(t,["allowedFunctionNames"],n);const o=O(e,["mode"]);if(o!=null&&M(t,["mode"],o),O(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function lxe(e){const t={},n=O(e,["description"]);n!=null&&M(t,["description"],n);const o=O(e,["name"]);o!=null&&M(t,["name"],o);const r=O(e,["parameters"]);r!=null&&M(t,["parameters"],r);const i=O(e,["parametersJsonSchema"]);i!=null&&M(t,["parametersJsonSchema"],i);const s=O(e,["response"]);s!=null&&M(t,["response"],s);const a=O(e,["responseJsonSchema"]);if(a!=null&&M(t,["responseJsonSchema"],a),O(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function uxe(e,t,n){const o={},r=O(t,["systemInstruction"]);n!==void 0&&r!=null&&M(n,["systemInstruction"],ZM(to(r)));const i=O(t,["temperature"]);i!=null&&M(o,["temperature"],i);const s=O(t,["topP"]);s!=null&&M(o,["topP"],s);const a=O(t,["topK"]);a!=null&&M(o,["topK"],a);const c=O(t,["candidateCount"]);c!=null&&M(o,["candidateCount"],c);const p=O(t,["maxOutputTokens"]);p!=null&&M(o,["maxOutputTokens"],p);const u=O(t,["stopSequences"]);u!=null&&M(o,["stopSequences"],u);const l=O(t,["responseLogprobs"]);l!=null&&M(o,["responseLogprobs"],l);const d=O(t,["logprobs"]);d!=null&&M(o,["logprobs"],d);const f=O(t,["presencePenalty"]);f!=null&&M(o,["presencePenalty"],f);const h=O(t,["frequencyPenalty"]);h!=null&&M(o,["frequencyPenalty"],h);const m=O(t,["seed"]);m!=null&&M(o,["seed"],m);const g=O(t,["responseMimeType"]);g!=null&&M(o,["responseMimeType"],g);const y=O(t,["responseSchema"]);y!=null&&M(o,["responseSchema"],Mx(y));const _=O(t,["responseJsonSchema"]);if(_!=null&&M(o,["responseJsonSchema"],_),O(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(O(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const S=O(t,["safetySettings"]);if(n!==void 0&&S!=null){let I=S;Array.isArray(I)&&(I=I.map(U=>Zxe(U))),M(n,["safetySettings"],I)}const w=O(t,["tools"]);if(n!==void 0&&w!=null){let I=BA(w);Array.isArray(I)&&(I=I.map(U=>sBe(xA(U)))),M(n,["tools"],I)}const R=O(t,["toolConfig"]);if(n!==void 0&&R!=null&&M(n,["toolConfig"],iBe(R)),O(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const E=O(t,["cachedContent"]);n!==void 0&&E!=null&&M(n,["cachedContent"],gp(e,E));const T=O(t,["responseModalities"]);T!=null&&M(o,["responseModalities"],T);const D=O(t,["mediaResolution"]);D!=null&&M(o,["mediaResolution"],D);const B=O(t,["speechConfig"]);if(B!=null&&M(o,["speechConfig"],Px(B)),O(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const N=O(t,["thinkingConfig"]);N!=null&&M(o,["thinkingConfig"],N);const L=O(t,["imageConfig"]);L!=null&&M(o,["imageConfig"],Fxe(L));const q=O(t,["enableEnhancedCivicAnswers"]);return q!=null&&M(o,["enableEnhancedCivicAnswers"],q),o}function cxe(e,t,n){const o={},r=O(t,["systemInstruction"]);n!==void 0&&r!=null&&M(n,["systemInstruction"],to(r));const i=O(t,["temperature"]);i!=null&&M(o,["temperature"],i);const s=O(t,["topP"]);s!=null&&M(o,["topP"],s);const a=O(t,["topK"]);a!=null&&M(o,["topK"],a);const c=O(t,["candidateCount"]);c!=null&&M(o,["candidateCount"],c);const p=O(t,["maxOutputTokens"]);p!=null&&M(o,["maxOutputTokens"],p);const u=O(t,["stopSequences"]);u!=null&&M(o,["stopSequences"],u);const l=O(t,["responseLogprobs"]);l!=null&&M(o,["responseLogprobs"],l);const d=O(t,["logprobs"]);d!=null&&M(o,["logprobs"],d);const f=O(t,["presencePenalty"]);f!=null&&M(o,["presencePenalty"],f);const h=O(t,["frequencyPenalty"]);h!=null&&M(o,["frequencyPenalty"],h);const m=O(t,["seed"]);m!=null&&M(o,["seed"],m);const g=O(t,["responseMimeType"]);g!=null&&M(o,["responseMimeType"],g);const y=O(t,["responseSchema"]);y!=null&&M(o,["responseSchema"],Mx(y));const _=O(t,["responseJsonSchema"]);_!=null&&M(o,["responseJsonSchema"],_);const S=O(t,["routingConfig"]);S!=null&&M(o,["routingConfig"],S);const w=O(t,["modelSelectionConfig"]);w!=null&&M(o,["modelConfig"],w);const R=O(t,["safetySettings"]);if(n!==void 0&&R!=null){let V=R;Array.isArray(V)&&(V=V.map(G=>G)),M(n,["safetySettings"],V)}const E=O(t,["tools"]);if(n!==void 0&&E!=null){let V=BA(E);Array.isArray(V)&&(V=V.map(G=>koe(xA(G)))),M(n,["tools"],V)}const T=O(t,["toolConfig"]);n!==void 0&&T!=null&&M(n,["toolConfig"],T);const D=O(t,["labels"]);n!==void 0&&D!=null&&M(n,["labels"],D);const B=O(t,["cachedContent"]);n!==void 0&&B!=null&&M(n,["cachedContent"],gp(e,B));const N=O(t,["responseModalities"]);N!=null&&M(o,["responseModalities"],N);const L=O(t,["mediaResolution"]);L!=null&&M(o,["mediaResolution"],L);const q=O(t,["speechConfig"]);q!=null&&M(o,["speechConfig"],Px(q));const I=O(t,["audioTimestamp"]);I!=null&&M(o,["audioTimestamp"],I);const U=O(t,["thinkingConfig"]);U!=null&&M(o,["thinkingConfig"],U);const J=O(t,["imageConfig"]);if(J!=null&&M(o,["imageConfig"],xxe(J)),O(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return o}function T6(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let s=Gi(r);Array.isArray(s)&&(s=s.map(a=>ZM(a))),M(n,["contents"],s)}const i=O(t,["config"]);return i!=null&&M(n,["generationConfig"],uxe(e,i,n)),n}function R6(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["contents"]);if(r!=null){let s=Gi(r);Array.isArray(s)&&(s=s.map(a=>a)),M(n,["contents"],s)}const i=O(t,["config"]);return i!=null&&M(n,["generationConfig"],cxe(e,i,n)),n}function E6(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["candidates"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(p=>jFe(p))),M(t,["candidates"],c)}const r=O(e,["modelVersion"]);r!=null&&M(t,["modelVersion"],r);const i=O(e,["promptFeedback"]);i!=null&&M(t,["promptFeedback"],i);const s=O(e,["responseId"]);s!=null&&M(t,["responseId"],s);const a=O(e,["usageMetadata"]);return a!=null&&M(t,["usageMetadata"],a),t}function M6(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["candidates"]);if(o!=null){let p=o;Array.isArray(p)&&(p=p.map(u=>u)),M(t,["candidates"],p)}const r=O(e,["createTime"]);r!=null&&M(t,["createTime"],r);const i=O(e,["modelVersion"]);i!=null&&M(t,["modelVersion"],i);const s=O(e,["promptFeedback"]);s!=null&&M(t,["promptFeedback"],s);const a=O(e,["responseId"]);a!=null&&M(t,["responseId"],a);const c=O(e,["usageMetadata"]);return c!=null&&M(t,["usageMetadata"],c),t}function dxe(e,t){const n={};if(O(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(O(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const o=O(e,["numberOfImages"]);t!==void 0&&o!=null&&M(t,["parameters","sampleCount"],o);const r=O(e,["aspectRatio"]);t!==void 0&&r!=null&&M(t,["parameters","aspectRatio"],r);const i=O(e,["guidanceScale"]);if(t!==void 0&&i!=null&&M(t,["parameters","guidanceScale"],i),O(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const s=O(e,["safetyFilterLevel"]);t!==void 0&&s!=null&&M(t,["parameters","safetySetting"],s);const a=O(e,["personGeneration"]);t!==void 0&&a!=null&&M(t,["parameters","personGeneration"],a);const c=O(e,["includeSafetyAttributes"]);t!==void 0&&c!=null&&M(t,["parameters","includeSafetyAttributes"],c);const p=O(e,["includeRaiReason"]);t!==void 0&&p!=null&&M(t,["parameters","includeRaiReason"],p);const u=O(e,["language"]);t!==void 0&&u!=null&&M(t,["parameters","language"],u);const l=O(e,["outputMimeType"]);t!==void 0&&l!=null&&M(t,["parameters","outputOptions","mimeType"],l);const d=O(e,["outputCompressionQuality"]);if(t!==void 0&&d!=null&&M(t,["parameters","outputOptions","compressionQuality"],d),O(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(O(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const f=O(e,["imageSize"]);if(t!==void 0&&f!=null&&M(t,["parameters","sampleImageSize"],f),O(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return n}function fxe(e,t){const n={},o=O(e,["outputGcsUri"]);t!==void 0&&o!=null&&M(t,["parameters","storageUri"],o);const r=O(e,["negativePrompt"]);t!==void 0&&r!=null&&M(t,["parameters","negativePrompt"],r);const i=O(e,["numberOfImages"]);t!==void 0&&i!=null&&M(t,["parameters","sampleCount"],i);const s=O(e,["aspectRatio"]);t!==void 0&&s!=null&&M(t,["parameters","aspectRatio"],s);const a=O(e,["guidanceScale"]);t!==void 0&&a!=null&&M(t,["parameters","guidanceScale"],a);const c=O(e,["seed"]);t!==void 0&&c!=null&&M(t,["parameters","seed"],c);const p=O(e,["safetyFilterLevel"]);t!==void 0&&p!=null&&M(t,["parameters","safetySetting"],p);const u=O(e,["personGeneration"]);t!==void 0&&u!=null&&M(t,["parameters","personGeneration"],u);const l=O(e,["includeSafetyAttributes"]);t!==void 0&&l!=null&&M(t,["parameters","includeSafetyAttributes"],l);const d=O(e,["includeRaiReason"]);t!==void 0&&d!=null&&M(t,["parameters","includeRaiReason"],d);const f=O(e,["language"]);t!==void 0&&f!=null&&M(t,["parameters","language"],f);const h=O(e,["outputMimeType"]);t!==void 0&&h!=null&&M(t,["parameters","outputOptions","mimeType"],h);const m=O(e,["outputCompressionQuality"]);t!==void 0&&m!=null&&M(t,["parameters","outputOptions","compressionQuality"],m);const g=O(e,["addWatermark"]);t!==void 0&&g!=null&&M(t,["parameters","addWatermark"],g);const y=O(e,["labels"]);t!==void 0&&y!=null&&M(t,["labels"],y);const _=O(e,["imageSize"]);t!==void 0&&_!=null&&M(t,["parameters","sampleImageSize"],_);const S=O(e,["enhancePrompt"]);return t!==void 0&&S!=null&&M(t,["parameters","enhancePrompt"],S),n}function hxe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["prompt"]);r!=null&&M(n,["instances[0]","prompt"],r);const i=O(t,["config"]);return i!=null&&dxe(i,n),n}function pxe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["prompt"]);r!=null&&M(n,["instances[0]","prompt"],r);const i=O(t,["config"]);return i!=null&&fxe(i,n),n}function mxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["predictions"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>Rxe(s))),M(t,["generatedImages"],i)}const r=O(e,["positivePromptSafetyAttributes"]);return r!=null&&M(t,["positivePromptSafetyAttributes"],xoe(r)),t}function gxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["predictions"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>eP(s))),M(t,["generatedImages"],i)}const r=O(e,["positivePromptSafetyAttributes"]);return r!=null&&M(t,["positivePromptSafetyAttributes"],Boe(r)),t}function bxe(e,t){const n={},o=O(e,["numberOfVideos"]);if(t!==void 0&&o!=null&&M(t,["parameters","sampleCount"],o),O(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(O(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const r=O(e,["durationSeconds"]);if(t!==void 0&&r!=null&&M(t,["parameters","durationSeconds"],r),O(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const i=O(e,["aspectRatio"]);t!==void 0&&i!=null&&M(t,["parameters","aspectRatio"],i);const s=O(e,["resolution"]);t!==void 0&&s!=null&&M(t,["parameters","resolution"],s);const a=O(e,["personGeneration"]);if(t!==void 0&&a!=null&&M(t,["parameters","personGeneration"],a),O(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const c=O(e,["negativePrompt"]);t!==void 0&&c!=null&&M(t,["parameters","negativePrompt"],c);const p=O(e,["enhancePrompt"]);if(t!==void 0&&p!=null&&M(t,["parameters","enhancePrompt"],p),O(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const u=O(e,["lastFrame"]);t!==void 0&&u!=null&&M(t,["instances[0]","lastFrame"],tP(u));const l=O(e,["referenceImages"]);if(t!==void 0&&l!=null){let d=l;Array.isArray(d)&&(d=d.map(f=>ABe(f))),M(t,["instances[0]","referenceImages"],d)}if(O(e,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(O(e,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return n}function yxe(e,t){const n={},o=O(e,["numberOfVideos"]);t!==void 0&&o!=null&&M(t,["parameters","sampleCount"],o);const r=O(e,["outputGcsUri"]);t!==void 0&&r!=null&&M(t,["parameters","storageUri"],r);const i=O(e,["fps"]);t!==void 0&&i!=null&&M(t,["parameters","fps"],i);const s=O(e,["durationSeconds"]);t!==void 0&&s!=null&&M(t,["parameters","durationSeconds"],s);const a=O(e,["seed"]);t!==void 0&&a!=null&&M(t,["parameters","seed"],a);const c=O(e,["aspectRatio"]);t!==void 0&&c!=null&&M(t,["parameters","aspectRatio"],c);const p=O(e,["resolution"]);t!==void 0&&p!=null&&M(t,["parameters","resolution"],p);const u=O(e,["personGeneration"]);t!==void 0&&u!=null&&M(t,["parameters","personGeneration"],u);const l=O(e,["pubsubTopic"]);t!==void 0&&l!=null&&M(t,["parameters","pubsubTopic"],l);const d=O(e,["negativePrompt"]);t!==void 0&&d!=null&&M(t,["parameters","negativePrompt"],d);const f=O(e,["enhancePrompt"]);t!==void 0&&f!=null&&M(t,["parameters","enhancePrompt"],f);const h=O(e,["generateAudio"]);t!==void 0&&h!=null&&M(t,["parameters","generateAudio"],h);const m=O(e,["lastFrame"]);t!==void 0&&m!=null&&M(t,["instances[0]","lastFrame"],Ms(m));const g=O(e,["referenceImages"]);if(t!==void 0&&g!=null){let S=g;Array.isArray(S)&&(S=S.map(w=>_Be(w))),M(t,["instances[0]","referenceImages"],S)}const y=O(e,["mask"]);t!==void 0&&y!=null&&M(t,["instances[0]","mask"],yBe(y));const _=O(e,["compressionQuality"]);return t!==void 0&&_!=null&&M(t,["parameters","compressionQuality"],_),n}function Axe(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response","generateVideoResponse"]);return s!=null&&M(t,["response"],Cxe(s)),t}function _xe(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response"]);return s!=null&&M(t,["response"],wxe(s)),t}function vxe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["prompt"]);r!=null&&M(n,["instances[0]","prompt"],r);const i=O(t,["image"]);i!=null&&M(n,["instances[0]","image"],tP(i));const s=O(t,["video"]);s!=null&&M(n,["instances[0]","video"],Uoe(s));const a=O(t,["source"]);a!=null&&Oxe(a,n);const c=O(t,["config"]);return c!=null&&bxe(c,n),n}function Sxe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["prompt"]);r!=null&&M(n,["instances[0]","prompt"],r);const i=O(t,["image"]);i!=null&&M(n,["instances[0]","image"],Ms(i));const s=O(t,["video"]);s!=null&&M(n,["instances[0]","video"],qoe(s));const a=O(t,["source"]);a!=null&&Txe(a,n);const c=O(t,["config"]);return c!=null&&yxe(c,n),n}function Cxe(e){const t={},n=O(e,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>Mxe(s))),M(t,["generatedVideos"],i)}const o=O(e,["raiMediaFilteredCount"]);o!=null&&M(t,["raiMediaFilteredCount"],o);const r=O(e,["raiMediaFilteredReasons"]);return r!=null&&M(t,["raiMediaFilteredReasons"],r),t}function wxe(e){const t={},n=O(e,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>Pxe(s))),M(t,["generatedVideos"],i)}const o=O(e,["raiMediaFilteredCount"]);o!=null&&M(t,["raiMediaFilteredCount"],o);const r=O(e,["raiMediaFilteredReasons"]);return r!=null&&M(t,["raiMediaFilteredReasons"],r),t}function Oxe(e,t){const n={},o=O(e,["prompt"]);t!==void 0&&o!=null&&M(t,["instances[0]","prompt"],o);const r=O(e,["image"]);t!==void 0&&r!=null&&M(t,["instances[0]","image"],tP(r));const i=O(e,["video"]);return t!==void 0&&i!=null&&M(t,["instances[0]","video"],Uoe(i)),n}function Txe(e,t){const n={},o=O(e,["prompt"]);t!==void 0&&o!=null&&M(t,["instances[0]","prompt"],o);const r=O(e,["image"]);t!==void 0&&r!=null&&M(t,["instances[0]","image"],Ms(r));const i=O(e,["video"]);return t!==void 0&&i!=null&&M(t,["instances[0]","video"],qoe(i)),n}function Rxe(e){const t={},n=O(e,["_self"]);n!=null&&M(t,["image"],Bxe(n));const o=O(e,["raiFilteredReason"]);o!=null&&M(t,["raiFilteredReason"],o);const r=O(e,["_self"]);return r!=null&&M(t,["safetyAttributes"],xoe(r)),t}function eP(e){const t={},n=O(e,["_self"]);n!=null&&M(t,["image"],Foe(n));const o=O(e,["raiFilteredReason"]);o!=null&&M(t,["raiFilteredReason"],o);const r=O(e,["_self"]);r!=null&&M(t,["safetyAttributes"],Boe(r));const i=O(e,["prompt"]);return i!=null&&M(t,["enhancedPrompt"],i),t}function Exe(e){const t={},n=O(e,["_self"]);n!=null&&M(t,["mask"],Foe(n));const o=O(e,["labels"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),M(t,["labels"],r)}return t}function Mxe(e){const t={},n=O(e,["video"]);return n!=null&&M(t,["video"],gBe(n)),t}function Pxe(e){const t={},n=O(e,["_self"]);return n!=null&&M(t,["video"],bBe(n)),t}function Ixe(e){const t={},n=O(e,["modelSelectionConfig"]);n!=null&&M(t,["modelConfig"],n);const o=O(e,["responseJsonSchema"]);o!=null&&M(t,["responseJsonSchema"],o);const r=O(e,["audioTimestamp"]);r!=null&&M(t,["audioTimestamp"],r);const i=O(e,["candidateCount"]);i!=null&&M(t,["candidateCount"],i);const s=O(e,["enableAffectiveDialog"]);s!=null&&M(t,["enableAffectiveDialog"],s);const a=O(e,["frequencyPenalty"]);a!=null&&M(t,["frequencyPenalty"],a);const c=O(e,["logprobs"]);c!=null&&M(t,["logprobs"],c);const p=O(e,["maxOutputTokens"]);p!=null&&M(t,["maxOutputTokens"],p);const u=O(e,["mediaResolution"]);u!=null&&M(t,["mediaResolution"],u);const l=O(e,["presencePenalty"]);l!=null&&M(t,["presencePenalty"],l);const d=O(e,["responseLogprobs"]);d!=null&&M(t,["responseLogprobs"],d);const f=O(e,["responseMimeType"]);f!=null&&M(t,["responseMimeType"],f);const h=O(e,["responseModalities"]);h!=null&&M(t,["responseModalities"],h);const m=O(e,["responseSchema"]);m!=null&&M(t,["responseSchema"],m);const g=O(e,["routingConfig"]);g!=null&&M(t,["routingConfig"],g);const y=O(e,["seed"]);y!=null&&M(t,["seed"],y);const _=O(e,["speechConfig"]);_!=null&&M(t,["speechConfig"],_);const S=O(e,["stopSequences"]);S!=null&&M(t,["stopSequences"],S);const w=O(e,["temperature"]);w!=null&&M(t,["temperature"],w);const R=O(e,["thinkingConfig"]);R!=null&&M(t,["thinkingConfig"],R);const E=O(e,["topK"]);E!=null&&M(t,["topK"],E);const T=O(e,["topP"]);if(T!=null&&M(t,["topP"],T),O(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function jxe(e,t){const n={},o=O(t,["model"]);return o!=null&&M(n,["_url","name"],$t(e,o)),n}function Dxe(e,t){const n={},o=O(t,["model"]);return o!=null&&M(n,["_url","name"],$t(e,o)),n}function Nxe(e){const t={};if(O(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=O(e,["enableWidget"]);return n!=null&&M(t,["enableWidget"],n),t}function Lxe(e){const t={};if(O(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(O(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=O(e,["timeRangeFilter"]);return n!=null&&M(t,["timeRangeFilter"],n),t}function Fxe(e){const t={},n=O(e,["aspectRatio"]);n!=null&&M(t,["aspectRatio"],n);const o=O(e,["imageSize"]);if(o!=null&&M(t,["imageSize"],o),O(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(O(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(O(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function xxe(e){const t={},n=O(e,["aspectRatio"]);n!=null&&M(t,["aspectRatio"],n);const o=O(e,["imageSize"]);o!=null&&M(t,["imageSize"],o);const r=O(e,["personGeneration"]);r!=null&&M(t,["personGeneration"],r);const i=O(e,["outputMimeType"]);i!=null&&M(t,["imageOutputOptions","mimeType"],i);const s=O(e,["outputCompressionQuality"]);return s!=null&&M(t,["imageOutputOptions","compressionQuality"],s),t}function Bxe(e){const t={},n=O(e,["bytesBase64Encoded"]);n!=null&&M(t,["imageBytes"],Em(n));const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function Foe(e){const t={},n=O(e,["gcsUri"]);n!=null&&M(t,["gcsUri"],n);const o=O(e,["bytesBase64Encoded"]);o!=null&&M(t,["imageBytes"],Em(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["mimeType"],r),t}function tP(e){const t={};if(O(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const n=O(e,["imageBytes"]);n!=null&&M(t,["bytesBase64Encoded"],Em(n));const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function Ms(e){const t={},n=O(e,["gcsUri"]);n!=null&&M(t,["gcsUri"],n);const o=O(e,["imageBytes"]);o!=null&&M(t,["bytesBase64Encoded"],Em(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["mimeType"],r),t}function kxe(e,t,n){const o={},r=O(t,["pageSize"]);n!==void 0&&r!=null&&M(n,["_query","pageSize"],r);const i=O(t,["pageToken"]);n!==void 0&&i!=null&&M(n,["_query","pageToken"],i);const s=O(t,["filter"]);n!==void 0&&s!=null&&M(n,["_query","filter"],s);const a=O(t,["queryBase"]);return n!==void 0&&a!=null&&M(n,["_url","models_url"],Moe(e,a)),o}function Uxe(e,t,n){const o={},r=O(t,["pageSize"]);n!==void 0&&r!=null&&M(n,["_query","pageSize"],r);const i=O(t,["pageToken"]);n!==void 0&&i!=null&&M(n,["_query","pageToken"],i);const s=O(t,["filter"]);n!==void 0&&s!=null&&M(n,["_query","filter"],s);const a=O(t,["queryBase"]);return n!==void 0&&a!=null&&M(n,["_url","models_url"],Moe(e,a)),o}function qxe(e,t){const n={},o=O(t,["config"]);return o!=null&&kxe(e,o,n),n}function Jxe(e,t){const n={},o=O(t,["config"]);return o!=null&&Uxe(e,o,n),n}function Vxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["_self"]);if(r!=null){let i=Poe(r);Array.isArray(i)&&(i=i.map(s=>_1(s))),M(t,["models"],i)}return t}function Hxe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["_self"]);if(r!=null){let i=Poe(r);Array.isArray(i)&&(i=i.map(s=>v1(s))),M(t,["models"],i)}return t}function Gxe(e){const t={},n=O(e,["maskMode"]);n!=null&&M(t,["maskMode"],n);const o=O(e,["segmentationClasses"]);o!=null&&M(t,["maskClasses"],o);const r=O(e,["maskDilation"]);return r!=null&&M(t,["dilation"],r),t}function _1(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["displayName"]);o!=null&&M(t,["displayName"],o);const r=O(e,["description"]);r!=null&&M(t,["description"],r);const i=O(e,["version"]);i!=null&&M(t,["version"],i);const s=O(e,["_self"]);s!=null&&M(t,["tunedModelInfo"],aBe(s));const a=O(e,["inputTokenLimit"]);a!=null&&M(t,["inputTokenLimit"],a);const c=O(e,["outputTokenLimit"]);c!=null&&M(t,["outputTokenLimit"],c);const p=O(e,["supportedGenerationMethods"]);p!=null&&M(t,["supportedActions"],p);const u=O(e,["temperature"]);u!=null&&M(t,["temperature"],u);const l=O(e,["maxTemperature"]);l!=null&&M(t,["maxTemperature"],l);const d=O(e,["topP"]);d!=null&&M(t,["topP"],d);const f=O(e,["topK"]);f!=null&&M(t,["topK"],f);const h=O(e,["thinking"]);return h!=null&&M(t,["thinking"],h),t}function v1(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["displayName"]);o!=null&&M(t,["displayName"],o);const r=O(e,["description"]);r!=null&&M(t,["description"],r);const i=O(e,["versionId"]);i!=null&&M(t,["version"],i);const s=O(e,["deployedModels"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>oxe(d))),M(t,["endpoints"],l)}const a=O(e,["labels"]);a!=null&&M(t,["labels"],a);const c=O(e,["_self"]);c!=null&&M(t,["tunedModelInfo"],lBe(c));const p=O(e,["defaultCheckpointId"]);p!=null&&M(t,["defaultCheckpointId"],p);const u=O(e,["checkpoints"]);if(u!=null){let l=u;Array.isArray(l)&&(l=l.map(d=>d)),M(t,["checkpoints"],l)}return t}function zxe(e){const t={},n=O(e,["mediaResolution"]);n!=null&&M(t,["mediaResolution"],n);const o=O(e,["codeExecutionResult"]);o!=null&&M(t,["codeExecutionResult"],o);const r=O(e,["executableCode"]);r!=null&&M(t,["executableCode"],r);const i=O(e,["fileData"]);i!=null&&M(t,["fileData"],ixe(i));const s=O(e,["functionCall"]);s!=null&&M(t,["functionCall"],sxe(s));const a=O(e,["functionResponse"]);a!=null&&M(t,["functionResponse"],a);const c=O(e,["inlineData"]);c!=null&&M(t,["inlineData"],IFe(c));const p=O(e,["text"]);p!=null&&M(t,["text"],p);const u=O(e,["thought"]);u!=null&&M(t,["thought"],u);const l=O(e,["thoughtSignature"]);l!=null&&M(t,["thoughtSignature"],l);const d=O(e,["videoMetadata"]);return d!=null&&M(t,["videoMetadata"],d),t}function Kxe(e){const t={},n=O(e,["productImage"]);return n!=null&&M(t,["image"],Ms(n)),t}function Qxe(e,t){const n={},o=O(e,["numberOfImages"]);t!==void 0&&o!=null&&M(t,["parameters","sampleCount"],o);const r=O(e,["baseSteps"]);t!==void 0&&r!=null&&M(t,["parameters","baseSteps"],r);const i=O(e,["outputGcsUri"]);t!==void 0&&i!=null&&M(t,["parameters","storageUri"],i);const s=O(e,["seed"]);t!==void 0&&s!=null&&M(t,["parameters","seed"],s);const a=O(e,["safetyFilterLevel"]);t!==void 0&&a!=null&&M(t,["parameters","safetySetting"],a);const c=O(e,["personGeneration"]);t!==void 0&&c!=null&&M(t,["parameters","personGeneration"],c);const p=O(e,["addWatermark"]);t!==void 0&&p!=null&&M(t,["parameters","addWatermark"],p);const u=O(e,["outputMimeType"]);t!==void 0&&u!=null&&M(t,["parameters","outputOptions","mimeType"],u);const l=O(e,["outputCompressionQuality"]);t!==void 0&&l!=null&&M(t,["parameters","outputOptions","compressionQuality"],l);const d=O(e,["enhancePrompt"]);t!==void 0&&d!=null&&M(t,["parameters","enhancePrompt"],d);const f=O(e,["labels"]);return t!==void 0&&f!=null&&M(t,["labels"],f),n}function $xe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["source"]);r!=null&&Yxe(r,n);const i=O(t,["config"]);return i!=null&&Qxe(i,n),n}function Wxe(e){const t={},n=O(e,["predictions"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>eP(r))),M(t,["generatedImages"],o)}return t}function Yxe(e,t){const n={},o=O(e,["prompt"]);t!==void 0&&o!=null&&M(t,["instances[0]","prompt"],o);const r=O(e,["personImage"]);t!==void 0&&r!=null&&M(t,["instances[0]","personImage","image"],Ms(r));const i=O(e,["productImages"]);if(t!==void 0&&i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>Kxe(a))),M(t,["instances[0]","productImages"],s)}return n}function Xxe(e){const t={},n=O(e,["referenceImage"]);n!=null&&M(t,["referenceImage"],Ms(n));const o=O(e,["referenceId"]);o!=null&&M(t,["referenceId"],o);const r=O(e,["referenceType"]);r!=null&&M(t,["referenceType"],r);const i=O(e,["maskImageConfig"]);i!=null&&M(t,["maskImageConfig"],Gxe(i));const s=O(e,["controlImageConfig"]);s!=null&&M(t,["controlImageConfig"],BFe(s));const a=O(e,["styleImageConfig"]);a!=null&&M(t,["styleImageConfig"],a);const c=O(e,["subjectImageConfig"]);return c!=null&&M(t,["subjectImageConfig"],c),t}function xoe(e){const t={},n=O(e,["safetyAttributes","categories"]);n!=null&&M(t,["categories"],n);const o=O(e,["safetyAttributes","scores"]);o!=null&&M(t,["scores"],o);const r=O(e,["contentType"]);return r!=null&&M(t,["contentType"],r),t}function Boe(e){const t={},n=O(e,["safetyAttributes","categories"]);n!=null&&M(t,["categories"],n);const o=O(e,["safetyAttributes","scores"]);o!=null&&M(t,["scores"],o);const r=O(e,["contentType"]);return r!=null&&M(t,["contentType"],r),t}function Zxe(e){const t={},n=O(e,["category"]);if(n!=null&&M(t,["category"],n),O(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=O(e,["threshold"]);return o!=null&&M(t,["threshold"],o),t}function eBe(e){const t={},n=O(e,["image"]);return n!=null&&M(t,["image"],Ms(n)),t}function tBe(e,t){const n={},o=O(e,["mode"]);t!==void 0&&o!=null&&M(t,["parameters","mode"],o);const r=O(e,["maxPredictions"]);t!==void 0&&r!=null&&M(t,["parameters","maxPredictions"],r);const i=O(e,["confidenceThreshold"]);t!==void 0&&i!=null&&M(t,["parameters","confidenceThreshold"],i);const s=O(e,["maskDilation"]);t!==void 0&&s!=null&&M(t,["parameters","maskDilation"],s);const a=O(e,["binaryColorThreshold"]);t!==void 0&&a!=null&&M(t,["parameters","binaryColorThreshold"],a);const c=O(e,["labels"]);return t!==void 0&&c!=null&&M(t,["labels"],c),n}function nBe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["source"]);r!=null&&oBe(r,n);const i=O(t,["config"]);return i!=null&&tBe(i,n),n}function rBe(e){const t={},n=O(e,["predictions"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>Exe(r))),M(t,["generatedMasks"],o)}return t}function oBe(e,t){const n={},o=O(e,["prompt"]);t!==void 0&&o!=null&&M(t,["instances[0]","prompt"],o);const r=O(e,["image"]);t!==void 0&&r!=null&&M(t,["instances[0]","image"],Ms(r));const i=O(e,["scribbleImage"]);return t!==void 0&&i!=null&&M(t,["instances[0]","scribble"],eBe(i)),n}function iBe(e){const t={},n=O(e,["retrievalConfig"]);n!=null&&M(t,["retrievalConfig"],n);const o=O(e,["functionCallingConfig"]);return o!=null&&M(t,["functionCallingConfig"],axe(o)),t}function sBe(e){const t={};if(O(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=O(e,["computerUse"]);n!=null&&M(t,["computerUse"],n);const o=O(e,["fileSearch"]);o!=null&&M(t,["fileSearch"],o);const r=O(e,["codeExecution"]);if(r!=null&&M(t,["codeExecution"],r),O(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=O(e,["functionDeclarations"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(l=>l)),M(t,["functionDeclarations"],u)}const s=O(e,["googleMaps"]);s!=null&&M(t,["googleMaps"],Nxe(s));const a=O(e,["googleSearch"]);a!=null&&M(t,["googleSearch"],Lxe(a));const c=O(e,["googleSearchRetrieval"]);c!=null&&M(t,["googleSearchRetrieval"],c);const p=O(e,["urlContext"]);return p!=null&&M(t,["urlContext"],p),t}function koe(e){const t={},n=O(e,["retrieval"]);n!=null&&M(t,["retrieval"],n);const o=O(e,["computerUse"]);if(o!=null&&M(t,["computerUse"],o),O(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=O(e,["codeExecution"]);r!=null&&M(t,["codeExecution"],r);const i=O(e,["enterpriseWebSearch"]);i!=null&&M(t,["enterpriseWebSearch"],i);const s=O(e,["functionDeclarations"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(d=>lxe(d))),M(t,["functionDeclarations"],l)}const a=O(e,["googleMaps"]);a!=null&&M(t,["googleMaps"],a);const c=O(e,["googleSearch"]);c!=null&&M(t,["googleSearch"],c);const p=O(e,["googleSearchRetrieval"]);p!=null&&M(t,["googleSearchRetrieval"],p);const u=O(e,["urlContext"]);return u!=null&&M(t,["urlContext"],u),t}function aBe(e){const t={},n=O(e,["baseModel"]);n!=null&&M(t,["baseModel"],n);const o=O(e,["createTime"]);o!=null&&M(t,["createTime"],o);const r=O(e,["updateTime"]);return r!=null&&M(t,["updateTime"],r),t}function lBe(e){const t={},n=O(e,["labels","google-vertex-llm-tuning-base-model-id"]);n!=null&&M(t,["baseModel"],n);const o=O(e,["createTime"]);o!=null&&M(t,["createTime"],o);const r=O(e,["updateTime"]);return r!=null&&M(t,["updateTime"],r),t}function uBe(e,t){const n={},o=O(e,["displayName"]);t!==void 0&&o!=null&&M(t,["displayName"],o);const r=O(e,["description"]);t!==void 0&&r!=null&&M(t,["description"],r);const i=O(e,["defaultCheckpointId"]);return t!==void 0&&i!=null&&M(t,["defaultCheckpointId"],i),n}function cBe(e,t){const n={},o=O(e,["displayName"]);t!==void 0&&o!=null&&M(t,["displayName"],o);const r=O(e,["description"]);t!==void 0&&r!=null&&M(t,["description"],r);const i=O(e,["defaultCheckpointId"]);return t!==void 0&&i!=null&&M(t,["defaultCheckpointId"],i),n}function dBe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","name"],$t(e,o));const r=O(t,["config"]);return r!=null&&uBe(r,n),n}function fBe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["config"]);return r!=null&&cBe(r,n),n}function hBe(e,t){const n={},o=O(e,["outputGcsUri"]);t!==void 0&&o!=null&&M(t,["parameters","storageUri"],o);const r=O(e,["safetyFilterLevel"]);t!==void 0&&r!=null&&M(t,["parameters","safetySetting"],r);const i=O(e,["personGeneration"]);t!==void 0&&i!=null&&M(t,["parameters","personGeneration"],i);const s=O(e,["includeRaiReason"]);t!==void 0&&s!=null&&M(t,["parameters","includeRaiReason"],s);const a=O(e,["outputMimeType"]);t!==void 0&&a!=null&&M(t,["parameters","outputOptions","mimeType"],a);const c=O(e,["outputCompressionQuality"]);t!==void 0&&c!=null&&M(t,["parameters","outputOptions","compressionQuality"],c);const p=O(e,["enhanceInputImage"]);t!==void 0&&p!=null&&M(t,["parameters","upscaleConfig","enhanceInputImage"],p);const u=O(e,["imagePreservationFactor"]);t!==void 0&&u!=null&&M(t,["parameters","upscaleConfig","imagePreservationFactor"],u);const l=O(e,["labels"]);t!==void 0&&l!=null&&M(t,["labels"],l);const d=O(e,["numberOfImages"]);t!==void 0&&d!=null&&M(t,["parameters","sampleCount"],d);const f=O(e,["mode"]);return t!==void 0&&f!=null&&M(t,["parameters","mode"],f),n}function pBe(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["_url","model"],$t(e,o));const r=O(t,["image"]);r!=null&&M(n,["instances[0]","image"],Ms(r));const i=O(t,["upscaleFactor"]);i!=null&&M(n,["parameters","upscaleConfig","upscaleFactor"],i);const s=O(t,["config"]);return s!=null&&hBe(s,n),n}function mBe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>eP(i))),M(t,["generatedImages"],r)}return t}function gBe(e){const t={},n=O(e,["uri"]);n!=null&&M(t,["uri"],n);const o=O(e,["encodedVideo"]);o!=null&&M(t,["videoBytes"],Em(o));const r=O(e,["encoding"]);return r!=null&&M(t,["mimeType"],r),t}function bBe(e){const t={},n=O(e,["gcsUri"]);n!=null&&M(t,["uri"],n);const o=O(e,["bytesBase64Encoded"]);o!=null&&M(t,["videoBytes"],Em(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["mimeType"],r),t}function yBe(e){const t={},n=O(e,["image"]);n!=null&&M(t,["_self"],Ms(n));const o=O(e,["maskMode"]);return o!=null&&M(t,["maskMode"],o),t}function ABe(e){const t={},n=O(e,["image"]);n!=null&&M(t,["image"],tP(n));const o=O(e,["referenceType"]);return o!=null&&M(t,["referenceType"],o),t}function _Be(e){const t={},n=O(e,["image"]);n!=null&&M(t,["image"],Ms(n));const o=O(e,["referenceType"]);return o!=null&&M(t,["referenceType"],o),t}function Uoe(e){const t={},n=O(e,["uri"]);n!=null&&M(t,["uri"],n);const o=O(e,["videoBytes"]);o!=null&&M(t,["encodedVideo"],Em(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["encoding"],r),t}function qoe(e){const t={},n=O(e,["uri"]);n!=null&&M(t,["gcsUri"],n);const o=O(e,["videoBytes"]);o!=null&&M(t,["bytesBase64Encoded"],Em(o));const r=O(e,["mimeType"]);return r!=null&&M(t,["mimeType"],r),t}function vBe(e,t){const n={},o=O(e,["displayName"]);return t!==void 0&&o!=null&&M(t,["displayName"],o),n}function SBe(e){const t={},n=O(e,["config"]);return n!=null&&vBe(n,t),t}function CBe(e,t){const n={},o=O(e,["force"]);return t!==void 0&&o!=null&&M(t,["_query","force"],o),n}function wBe(e){const t={},n=O(e,["name"]);n!=null&&M(t,["_url","name"],n);const o=O(e,["config"]);return o!=null&&CBe(o,t),t}function OBe(e){const t={},n=O(e,["name"]);return n!=null&&M(t,["_url","name"],n),t}function TBe(e,t){const n={},o=O(e,["customMetadata"]);if(t!==void 0&&o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["customMetadata"],i)}const r=O(e,["chunkingConfig"]);return t!==void 0&&r!=null&&M(t,["chunkingConfig"],r),n}function RBe(e){const t={},n=O(e,["name"]);n!=null&&M(t,["name"],n);const o=O(e,["metadata"]);o!=null&&M(t,["metadata"],o);const r=O(e,["done"]);r!=null&&M(t,["done"],r);const i=O(e,["error"]);i!=null&&M(t,["error"],i);const s=O(e,["response"]);return s!=null&&M(t,["response"],MBe(s)),t}function EBe(e){const t={},n=O(e,["fileSearchStoreName"]);n!=null&&M(t,["_url","file_search_store_name"],n);const o=O(e,["fileName"]);o!=null&&M(t,["fileName"],o);const r=O(e,["config"]);return r!=null&&TBe(r,t),t}function MBe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["parent"]);o!=null&&M(t,["parent"],o);const r=O(e,["documentName"]);return r!=null&&M(t,["documentName"],r),t}function PBe(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);return t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),n}function IBe(e){const t={},n=O(e,["config"]);return n!=null&&PBe(n,t),t}function jBe(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["fileSearchStores"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["fileSearchStores"],i)}return t}function Joe(e,t){const n={},o=O(e,["mimeType"]);t!==void 0&&o!=null&&M(t,["mimeType"],o);const r=O(e,["displayName"]);t!==void 0&&r!=null&&M(t,["displayName"],r);const i=O(e,["customMetadata"]);if(t!==void 0&&i!=null){let a=i;Array.isArray(a)&&(a=a.map(c=>c)),M(t,["customMetadata"],a)}const s=O(e,["chunkingConfig"]);return t!==void 0&&s!=null&&M(t,["chunkingConfig"],s),n}function DBe(e){const t={},n=O(e,["fileSearchStoreName"]);n!=null&&M(t,["_url","file_search_store_name"],n);const o=O(e,["config"]);return o!=null&&Joe(o,t),t}function NBe(e){const t={},n=O(e,["sdkHttpResponse"]);return n!=null&&M(t,["sdkHttpResponse"],n),t}const LBe="Content-Type",FBe="X-Server-Timeout",xBe="User-Agent",S1="x-goog-api-client",BBe="1.35.0",kBe=`google-genai-sdk/${BBe}`,UBe="v1beta1",qBe="v1beta";class JBe{constructor(t){var n,o;this.clientOptions=Object.assign(Object.assign({},t),{project:t.project,location:t.location,apiKey:t.apiKey,vertexai:t.vertexai});const r={};this.clientOptions.vertexai?(r.apiVersion=(n=this.clientOptions.apiVersion)!==null&&n!==void 0?n:UBe,r.baseUrl=this.baseUrlFromProjectLocation(),this.normalizeAuthParameters()):(r.apiVersion=(o=this.clientOptions.apiVersion)!==null&&o!==void 0?o:qBe,r.baseUrl="https://generativelanguage.googleapis.com/"),r.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=r,t.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(r,t.httpOptions))}baseUrlFromProjectLocation(){return this.clientOptions.project&&this.clientOptions.location&&this.clientOptions.location!=="global"?`https://${this.clientOptions.location}-aiplatform.googleapis.com/`:"https://aiplatform.googleapis.com/"}normalizeAuthParameters(){if(this.clientOptions.project&&this.clientOptions.location){this.clientOptions.apiKey=void 0;return}this.clientOptions.project=void 0,this.clientOptions.location=void 0}isVertexAI(){var t;return(t=this.clientOptions.vertexai)!==null&&t!==void 0?t:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}async getAuthHeaders(){const t=new Headers;return await this.clientOptions.auth.addAuthHeaders(t),t}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(t){if(!t||t.baseUrl===void 0||t.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const o=[t.baseUrl.endsWith("/")?t.baseUrl.slice(0,-1):t.baseUrl];return t.apiVersion&&t.apiVersion!==""&&o.push(t.apiVersion),o.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const t=this.getBaseUrl(),n=new URL(t);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(t){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=t;else throw new Error("HTTP options are not correctly set.")}constructUrl(t,n,o){const r=[this.getRequestUrlInternal(n)];return o&&r.push(this.getBaseResourcePath()),t!==""&&r.push(t),new URL(`${r.join("/")}`)}shouldPrependVertexProjectPath(t){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||t.path.startsWith("projects/")||t.httpMethod==="GET"&&t.path.startsWith("publishers/google/models"))}async request(t){let n=this.clientOptions.httpOptions;t.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const o=this.shouldPrependVertexProjectPath(t),r=this.constructUrl(t.path,n,o);if(t.queryParams)for(const[s,a]of Object.entries(t.queryParams))r.searchParams.append(s,String(a));let i={};if(t.httpMethod==="GET"){if(t.body&&t.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else i.body=t.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,n,r.toString(),t.abortSignal),this.unaryApiCall(r,i,t.httpMethod)}patchHttpOptions(t,n){const o=JSON.parse(JSON.stringify(t));for(const[r,i]of Object.entries(n))typeof i=="object"?o[r]=Object.assign(Object.assign({},o[r]),i):i!==void 0&&(o[r]=i);return o}async requestStream(t){let n=this.clientOptions.httpOptions;t.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const o=this.shouldPrependVertexProjectPath(t),r=this.constructUrl(t.path,n,o);(!r.searchParams.has("alt")||r.searchParams.get("alt")!=="sse")&&r.searchParams.set("alt","sse");let i={};return i.body=t.body,i=await this.includeExtraHttpOptionsToRequestInit(i,n,r.toString(),t.abortSignal),this.streamApiCall(r,i,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,n,o,r){if(n&&n.timeout||r){const i=new AbortController,s=i.signal;if(n.timeout&&n?.timeout>0){const a=setTimeout(()=>i.abort(),n.timeout);a&&typeof a.unref=="function"&&a.unref()}r&&r.addEventListener("abort",()=>{i.abort()}),t.signal=s}return n&&n.extraBody!==null&&VBe(t,n.extraBody),t.headers=await this.getHeadersInternal(n,o),t}async unaryApiCall(t,n,o){return this.apiCall(t.toString(),Object.assign(Object.assign({},n),{method:o})).then(async r=>(await P6(r),new b1(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}async streamApiCall(t,n,o){return this.apiCall(t.toString(),Object.assign(Object.assign({},n),{method:o})).then(async r=>(await P6(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}processStreamResponse(t){return vs(this,arguments,function*(){var o;const r=(o=t?.body)===null||o===void 0?void 0:o.getReader(),i=new TextDecoder("utf-8");if(!r)throw new Error("Response body is empty");try{let s="";const a="data:",c=[` `,"\r\r",`\r \r -`];for(;;){const{done:u,value:d}=yield Ke(r.read());if(u){if(o.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const f=s.decode(d,{stream:!0});try{const v=JSON.parse(f);if("error"in v){const S=JSON.parse(JSON.stringify(v.error)),C=S.status,E=S.code,k=`got status: ${C}. ${JSON.stringify(v)}`;if(E>=400&&E<600)throw new hw({message:k,status:E})}}catch(v){if(v.name==="ApiError")throw v}o+=f;let g=-1,m=0;for(;;){g=-1,m=0;for(const C of l){const E=o.indexOf(C);E!==-1&&(g===-1||E{throw new Error(`exception ${i} sending request`)})}getDefaultHeaders(){const e={},n=xwe+" "+this.clientOptions.userAgentExtra;return e[Swe]=n,e[w_]=n,e[bwe]="application/json",e}async getHeadersInternal(e,n){const i=new Headers;if(e&&e.headers){for(const[r,s]of Object.entries(e.headers))i.append(r,s);e.timeout&&e.timeout>0&&i.append(wwe,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(i,n),i}getFileName(e){var n;let i="";return typeof e=="string"&&(i=e.replace(/[/\\]+$/,""),i=(n=i.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),i}async uploadFile(e,n){var i;const r={};n!=null&&(r.mimeType=n.mimeType,r.name=n.name,r.displayName=n.displayName),r.name&&!r.name.startsWith("files/")&&(r.name=`files/${r.name}`);const s=this.clientOptions.uploader,o=await s.stat(e);r.sizeBytes=String(o.size);const a=(i=n?.mimeType)!==null&&i!==void 0?i:o.type;if(a===void 0||a==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");r.mimeType=a;const l={file:r},u=this.getFileName(e),d=Re("upload/v1beta/files",l._url),f=await this.fetchUploadUrl(d,r.sizeBytes,r.mimeType,u,l,n?.httpOptions);return s.upload(e,f,this)}async uploadFileToFileSearchStore(e,n,i){var r;const s=this.clientOptions.uploader,o=await s.stat(n),a=String(o.size),l=(r=i?.mimeType)!==null&&r!==void 0?r:o.type;if(l===void 0||l==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const u=`upload/v1beta/${e}:uploadToFileSearchStore`,d=this.getFileName(n),f={};i!=null&&b7(i,f);const g=await this.fetchUploadUrl(u,a,l,d,f,i?.httpOptions);return s.uploadToFileSearchStore(n,g,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,n,i,r,s,o){var a;let l={};o?l=o:l={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${i}`},r?{"X-Goog-Upload-File-Name":r}:{})};const u=await this.request({path:e,body:JSON.stringify(s),httpMethod:"POST",httpOptions:l});if(!u||!u?.headers)throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const d=(a=u?.headers)===null||a===void 0?void 0:a["x-goog-upload-url"];if(d===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return d}}async function ZL(t){var e;if(t===void 0)throw new Error("response is undefined");if(!t.ok){const n=t.status;let i;!((e=t.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?i=await t.json():i={error:{message:await t.text(),code:t.status,status:t.statusText}};const r=JSON.stringify(i);throw n>=400&&n<600?new hw({message:r,status:n}):new Error(r)}}function Rwe(t,e){if(!e||Object.keys(e).length===0)return;if(t.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let n={};if(typeof t.body=="string"&&t.body.length>0)try{const s=JSON.parse(t.body);if(typeof s=="object"&&s!==null&&!Array.isArray(s))n=s;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function i(s,o){const a=Object.assign({},s);for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const u=o[l],d=a[l];u&&typeof u=="object"&&!Array.isArray(u)&&d&&typeof d=="object"&&!Array.isArray(d)?a[l]=i(d,u):(d&&u&&typeof d!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${l}". Original type: ${typeof d}, New type: ${typeof u}. Overwriting.`),a[l]=u)}return a}const r=i(n,e);t.body=JSON.stringify(r)}const kwe="mcp_used/unknown";let Iwe=!1;function w7(t){for(const e of t)if(Mwe(e)||typeof e=="object"&&"inputSchema"in e)return!0;return Iwe}function S7(t){var e;const n=(e=t[w_])!==null&&e!==void 0?e:"";t[w_]=(n+` ${kwe}`).trimStart()}function Mwe(t){return t!==null&&typeof t=="object"&&t instanceof NR}function Dwe(t){return xs(this,arguments,function*(n,i=100){let r,s=0;for(;s0)return;const s={},o=[];for(const d of this.mcpClients)try{for(var a=!0,l=(n=void 0,Es(Dwe(d))),u;u=await l.next(),e=u.done,!e;a=!0){r=u.value,a=!1;const f=r;o.push(f);const g=f.name;if(s[g])throw new Error(`Duplicate function name ${g} found in MCP tools. Please ensure function names are unique.`);s[g]=d}}catch(f){n={error:f}}finally{try{!a&&!e&&(i=l.return)&&await i.call(l)}finally{if(n)throw n.error}}this.mcpTools=o,this.functionNameToMcpClient=s}async tool(){return await this.initialize(),u0e(this.mcpTools,this.config)}async callTool(e){await this.initialize();const n=[];for(const i of e)if(i.name in this.functionNameToMcpClient){const r=this.functionNameToMcpClient[i.name];let s;this.config.timeout&&(s={timeout:this.config.timeout});const o=await r.callTool({name:i.name,arguments:i.args},void 0,s);n.push({functionResponse:{name:i.name,response:o.isError?{error:o}:o}})}return n}}async function Pwe(t,e,n){const i=new n0e;let r;n.data instanceof Blob?r=JSON.parse(await n.data.text()):r=JSON.parse(n.data),Object.assign(i,r),e(i)}class Nwe{constructor(e,n,i){this.apiClient=e,this.auth=n,this.webSocketFactory=i}async connect(e){var n,i;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const r=this.apiClient.getWebsocketBaseUrl(),s=this.apiClient.getApiVersion(),o=Lwe(this.apiClient.getDefaultHeaders()),a=this.apiClient.getApiKey(),l=`${r}/ws/google.ai.generativelanguage.${s}.GenerativeService.BidiGenerateMusic?key=${a}`;let u=()=>{};const d=new Promise(R=>{u=R}),f=e.callbacks,g=function(){u({})},m=this.apiClient,v={onopen:g,onmessage:R=>{Pwe(m,f.onmessage,R)},onerror:(n=f?.onerror)!==null&&n!==void 0?n:function(R){},onclose:(i=f?.onclose)!==null&&i!==void 0?i:function(R){}},S=this.webSocketFactory.create(l,Bwe(o),v);S.connect(),await d;const k={setup:{model:St(this.apiClient,e.model)}};return S.send(JSON.stringify(k)),new Owe(S,this.apiClient)}}class Owe{constructor(e,n){this.conn=e,this.apiClient=n}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const n=ave(e);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});const n=ove(e);this.conn.send(JSON.stringify(n))}sendPlaybackControl(e){const n={playbackControl:e};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(md.PLAY)}pause(){this.sendPlaybackControl(md.PAUSE)}stop(){this.sendPlaybackControl(md.STOP)}resetContext(){this.sendPlaybackControl(md.RESET_CONTEXT)}close(){this.conn.close()}}function Bwe(t){const e={};return t.forEach((n,i)=>{e[i]=n}),e}function Lwe(t){const e=new Headers;for(const[n,i]of Object.entries(t))e.append(n,i);return e}const Uwe="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function Vwe(t,e,n){const i=new t0e;let r;n.data instanceof Blob?r=await n.data.text():n.data instanceof ArrayBuffer?r=new TextDecoder().decode(n.data):r=n.data;const s=JSON.parse(r);if(t.isVertexAI()){const o=uve(s);Object.assign(i,o)}else Object.assign(i,s);e(i)}class Fwe{constructor(e,n,i){this.apiClient=e,this.auth=n,this.webSocketFactory=i,this.music=new Nwe(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var n,i,r,s,o,a;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const l=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion();let d;const f=this.apiClient.getHeaders();e.config&&e.config.tools&&w7(e.config.tools)&&S7(f);const g=Gwe(f);if(this.apiClient.isVertexAI())d=`${l}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(g,d);else{const G=this.apiClient.getApiKey();let V="BidiGenerateContent",$="key";G?.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),u!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),V="BidiGenerateContentConstrained",$="access_token"),d=`${l}/ws/google.ai.generativelanguage.${u}.GenerativeService.${V}?${$}=${G}`}let m=()=>{};const v=new Promise(G=>{m=G}),S=e.callbacks,C=function(){var G;(G=S?.onopen)===null||G===void 0||G.call(S),m({})},E=this.apiClient,k={onopen:C,onmessage:G=>{Vwe(E,S.onmessage,G)},onerror:(n=S?.onerror)!==null&&n!==void 0?n:function(G){},onclose:(i=S?.onclose)!==null&&i!==void 0?i:function(G){}},R=this.webSocketFactory.create(d,Qwe(g),k);R.connect(),await v;let M=St(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&M.startsWith("publishers/")){const G=this.apiClient.getProject(),V=this.apiClient.getLocation();M=`projects/${G}/locations/${V}/`+M}let D={};this.apiClient.isVertexAI()&&((r=e.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Nv.AUDIO]}:e.config.responseModalities=[Nv.AUDIO]),!((s=e.config)===null||s===void 0)&&s.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const P=(a=(o=e.config)===null||o===void 0?void 0:o.tools)!==null&&a!==void 0?a:[],N=[];for(const G of P)if(this.isCallableTool(G)){const V=G;N.push(await V.tool())}else N.push(G);N.length>0&&(e.config.tools=N);const B={model:M,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?D=sve(this.apiClient,B):D=rve(this.apiClient,B),delete D.config,R.send(JSON.stringify(D)),new zwe(R,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}}const Hwe={turnComplete:!0};class zwe{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let i=[];try{i=Jr(n.turns),e.isVertexAI()||(i=i.map(r=>fw(r)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:i,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(e,n){let i=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?i=n.functionResponses:i=[n.functionResponses],i.length===0)throw new Error("functionResponses is required.");for(const s of i){if(typeof s!="object"||s===null||!("name"in s)||!("response"in s))throw new Error(`Could not parse function response, type '${typeof s}'.`);if(!e.isVertexAI()&&!("id"in s))throw new Error(Uwe)}return{toolResponse:{functionResponses:i}}}sendClientContent(e){e=Object.assign(Object.assign({},Hwe),e);const n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){let n={};this.apiClient.isVertexAI()?n={realtimeInput:cve(e)}:n={realtimeInput:lve(e)},this.conn.send(JSON.stringify(n))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const n=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}}function Qwe(t){const e={};return t.forEach((n,i)=>{e[i]=n}),e}function Gwe(t){const e=new Headers;for(const[n,i]of Object.entries(t))e.append(n,i);return e}const e4=10;function t4(t){var e,n,i;if(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let r=!1;for(const o of(n=t?.tools)!==null&&n!==void 0?n:[])if(Dd(o)){r=!0;break}if(!r)return!0;const s=(i=t?.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls;return s&&(s<0||!Number.isInteger(s))||s==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",s),!0):!1}function Dd(t){return"callTool"in t&&typeof t.callTool=="function"}function $we(t){var e,n,i;return(i=(n=(e=t.config)===null||e===void 0?void 0:e.tools)===null||n===void 0?void 0:n.some(r=>Dd(r)))!==null&&i!==void 0?i:!1}function n4(t){var e;const n=[];return!((e=t?.config)===null||e===void 0)&&e.tools&&t.config.tools.forEach((i,r)=>{if(Dd(i))return;const s=i;s.functionDeclarations&&s.functionDeclarations.length>0&&n.push(r)}),n}function i4(t){var e;return!(!((e=t?.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}class Wwe extends Aa{constructor(e){super(),this.apiClient=e,this.generateContent=async n=>{var i,r,s,o,a;const l=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchem(n),!$we(n)||t4(n.config))return await this.generateContentInternal(l);const u=n4(n);if(u.length>0){const S=u.map(C=>`tools[${C}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${S}.`)}let d,f;const g=Jr(l.contents),m=(s=(r=(i=l.config)===null||i===void 0?void 0:i.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&s!==void 0?s:e4;let v=0;for(;v{var i,r,s,o,a;if(this.maybeMoveToResponseJsonSchem(n),t4(n.config)){const f=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(f)}const l=n4(n);if(l.length>0){const f=l.map(g=>`tools[${g}]`).join(", ");throw new Error(`Incompatible tools found at ${f}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const u=(s=(r=(i=n?.config)===null||i===void 0?void 0:i.toolConfig)===null||r===void 0?void 0:r.functionCallingConfig)===null||s===void 0?void 0:s.streamFunctionCallArguments,d=(a=(o=n?.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.disable;if(u&&!d)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(n)},this.generateImages=async n=>await this.generateImagesInternal(n).then(i=>{var r;let s;const o=[];if(i?.generatedImages)for(const l of i.generatedImages)l&&l?.safetyAttributes&&((r=l?.safetyAttributes)===null||r===void 0?void 0:r.contentType)==="Positive Prompt"?s=l?.safetyAttributes:o.push(l);let a;return s?a={generatedImages:o,positivePromptSafetyAttributes:s,sdkHttpResponse:i.sdkHttpResponse}:a={generatedImages:o,sdkHttpResponse:i.sdkHttpResponse},a}),this.list=async n=>{var i;const o={config:Object.assign(Object.assign({},{queryBase:!0}),n?.config)};if(this.apiClient.isVertexAI()&&!o.config.queryBase){if(!((i=o.config)===null||i===void 0)&&i.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");o.config.filter="labels.tune-type:*"}return new jc(da.PAGED_ITEM_MODELS,a=>this.listInternal(a),await this.listInternal(o),o)},this.editImage=async n=>{const i={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(i.referenceImages=n.referenceImages.map(r=>r.toReferenceImageAPI())),await this.editImageInternal(i)},this.upscaleImage=async n=>{let i={numberOfImages:1,mode:"upscale"};n.config&&(i=Object.assign(Object.assign({},i),n.config));const r={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:i};return await this.upscaleImageInternal(r)},this.generateVideos=async n=>{var i,r,s,o,a,l;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((i=n.video)===null||i===void 0)&&i.uri&&(!((r=n.video)===null||r===void 0)&&r.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((o=(s=n.source)===null||s===void 0?void 0:s.video)===null||o===void 0)&&o.uri&&(!((l=(a=n.source)===null||a===void 0?void 0:a.video)===null||l===void 0)&&l.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var n,i,r;const s=(n=e.config)===null||n===void 0?void 0:n.tools;if(!s)return e;const o=await Promise.all(s.map(async l=>Dd(l)?await l.tool():l)),a={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:o})};if(a.config.tools=o,e.config&&e.config.tools&&w7(e.config.tools)){const l=(r=(i=e.config.httpOptions)===null||i===void 0?void 0:i.headers)!==null&&r!==void 0?r:{};let u=Object.assign({},l);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),S7(u),a.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:u})}return a}async initAfcToolsMap(e){var n,i,r;const s=new Map;for(const o of(i=(n=e.config)===null||n===void 0?void 0:n.tools)!==null&&i!==void 0?i:[])if(Dd(o)){const a=o,l=await a.tool();for(const u of(r=l.functionDeclarations)!==null&&r!==void 0?r:[]){if(!u.name)throw new Error("Function declaration name is required.");if(s.has(u.name))throw new Error(`Duplicate tool declaration name: ${u.name}`);s.set(u.name,a)}}return s}async processAfcStream(e){var n,i,r;const s=(r=(i=(n=e.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls)!==null&&r!==void 0?r:e4;let o=!1,a=0;const l=await this.initAfcToolsMap(e);return(function(u,d,f){return xs(this,arguments,function*(){for(var g,m,v,S,C,E;a0){o=!0;const G=new $f;G.candidates=[{content:{role:"user",parts:N}}],yield yield Ke(G);const V=[];V.push(...B),V.push({role:"user",parts:N});const $=Jr(f.contents).concat(V);f.contents=$}else break}})})(this,l,e)}async generateContentInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=qL(this.apiClient,e);return a=Re("{model}:generateContent",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=XL(d),g=new $f;return Object.assign(g,f),g})}else{const u=YL(this.apiClient,e);return a=Re("{model}:generateContent",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=JL(d),g=new $f;return Object.assign(g,f),g})}}async generateContentStreamInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=qL(this.apiClient,e);return a=Re("{model}:streamGenerateContent?alt=sse",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}),o.then(function(f){return xs(this,arguments,function*(){var g,m,v,S;try{for(var C=!0,E=Es(f),k;k=yield Ke(E.next()),g=k.done,!g;C=!0){S=k.value,C=!1;const R=S,M=XL(yield Ke(R.json()));M.sdkHttpResponse={headers:R.headers};const D=new $f;Object.assign(D,M),yield yield Ke(D)}}catch(R){m={error:R}}finally{try{!C&&!g&&(v=E.return)&&(yield Ke(v.call(E)))}finally{if(m)throw m.error}}})})}else{const u=YL(this.apiClient,e);return a=Re("{model}:streamGenerateContent?alt=sse",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.requestStream({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}),o.then(function(f){return xs(this,arguments,function*(){var g,m,v,S;try{for(var C=!0,E=Es(f),k;k=yield Ke(E.next()),g=k.done,!g;C=!0){S=k.value,C=!1;const R=S,M=JL(yield Ke(R.json()));M.sdkHttpResponse={headers:R.headers};const D=new $f;Object.assign(D,M),yield yield Ke(D)}}catch(R){m={error:R}}finally{try{!C&&!g&&(v=E.return)&&(yield Ke(v.call(E)))}finally{if(m)throw m.error}}})})}}async embedContent(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Fve(this.apiClient,e);return a=Re("{model}:predict",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=zve(d),g=new DL;return Object.assign(g,f),g})}else{const u=Vve(this.apiClient,e);return a=Re("{model}:batchEmbedContents",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Hve(d),g=new DL;return Object.assign(g,f),g})}}async generateImagesInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Zve(this.apiClient,e);return a=Re("{model}:predict",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=tbe(d),g=new PL;return Object.assign(g,f),g})}else{const u=Xve(this.apiClient,e);return a=Re("{model}:predict",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=ebe(d),g=new PL;return Object.assign(g,f),g})}}async editImageInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=Ove(this.apiClient,e);return s=Re("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>{const u=Bve(l),d=new GAe;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=Zbe(this.apiClient,e);return s=Re("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>{const u=ewe(l),d=new $Ae;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=Nbe(this.apiClient,e);return s=Re("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=Obe(l),d=new WAe;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=Hbe(this.apiClient,e);return s=Re("{model}:predict",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=zbe(l),d=new jAe;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=ybe(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>b_(d))}else{const u=Abe(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>v_(d))}}async listInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Tbe(this.apiClient,e);return a=Re("{models_url}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=kbe(d),g=new NL;return Object.assign(g,f),g})}else{const u=_be(this.apiClient,e);return a=Re("{models_url}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Rbe(d),g=new NL;return Object.assign(g,f),g})}}async update(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Jbe(this.apiClient,e);return a=Re("{model}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>b_(d))}else{const u=qbe(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>v_(d))}}async delete(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Mve(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Pve(d),g=new OL;return Object.assign(g,f),g})}else{const u=Ive(this.apiClient,e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Dve(d),g=new OL;return Object.assign(g,f),g})}}async countTokens(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=Tve(this.apiClient,e);return a=Re("{model}:countTokens",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=kve(d),g=new BL;return Object.assign(g,f),g})}else{const u=_ve(this.apiClient,e);return a=Re("{model}:countTokens",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=Rve(d),g=new BL;return Object.assign(g,f),g})}}async computeTokens(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=vve(this.apiClient,e);return s=Re("{model}:computeTokens",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>{const u=bve(l),d=new KAe;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=abe(this.apiClient,e);return a=Re("{model}:predictLongRunning",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o.then(d=>{const f=sbe(d),g=new Ov;return Object.assign(g,f),g})}else{const u=obe(this.apiClient,e);return a=Re("{model}:predictLongRunning",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o.then(d=>{const f=rbe(d),g=new Ov;return Object.assign(g,f),g})}}}class jwe extends Aa{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const n=e.operation,i=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=n.name.split("/operations/")[0];let s;i&&"httpOptions"in i&&(s=i.httpOptions);const o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:s}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:n.name,config:i});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async get(e){const n=e.operation,i=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=n.name.split("/operations/")[0];let s;i&&"httpOptions"in i&&(s=i.httpOptions);const o=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:s}});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:n.name,config:i});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async getVideosOperationInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=UAe(e);return a=Re("{operationName}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),o}else{const u=LAe(e);return a=Re("{operationName}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json()),o}}async fetchPredictVideosOperationInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=IAe(e);return s=Re("{resourceName}:fetchPredictOperation",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r}else throw new Error("This method is only supported by the Vertex AI.")}}function Kwe(t){const e={},n=y(t,["data"]);if(n!=null&&b(e,["data"],n),y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Ywe(t){const e={},n=y(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(s=>rSe(s))),b(e,["parts"],r)}const i=y(t,["role"]);return i!=null&&b(e,["role"],i),e}function qwe(t,e,n){const i={},r=y(e,["expireTime"]);n!==void 0&&r!=null&&b(n,["expireTime"],r);const s=y(e,["newSessionExpireTime"]);n!==void 0&&s!=null&&b(n,["newSessionExpireTime"],s);const o=y(e,["uses"]);n!==void 0&&o!=null&&b(n,["uses"],o);const a=y(e,["liveConnectConstraints"]);n!==void 0&&a!=null&&b(n,["bidiGenerateContentSetup"],iSe(t,a));const l=y(e,["lockAdditionalFields"]);return n!==void 0&&l!=null&&b(n,["fieldMask"],l),i}function Jwe(t,e){const n={},i=y(e,["config"]);return i!=null&&b(n,["config"],qwe(t,i,n)),n}function Xwe(t){const e={};if(y(t,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=y(t,["fileUri"]);n!=null&&b(e,["fileUri"],n);const i=y(t,["mimeType"]);return i!=null&&b(e,["mimeType"],i),e}function Zwe(t){const e={},n=y(t,["id"]);n!=null&&b(e,["id"],n);const i=y(t,["args"]);i!=null&&b(e,["args"],i);const r=y(t,["name"]);if(r!=null&&b(e,["name"],r),y(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(y(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function eSe(t){const e={};if(y(t,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=y(t,["enableWidget"]);return n!=null&&b(e,["enableWidget"],n),e}function tSe(t){const e={};if(y(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(y(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=y(t,["timeRangeFilter"]);return n!=null&&b(e,["timeRangeFilter"],n),e}function nSe(t,e){const n={},i=y(t,["generationConfig"]);e!==void 0&&i!=null&&b(e,["setup","generationConfig"],i);const r=y(t,["responseModalities"]);e!==void 0&&r!=null&&b(e,["setup","generationConfig","responseModalities"],r);const s=y(t,["temperature"]);e!==void 0&&s!=null&&b(e,["setup","generationConfig","temperature"],s);const o=y(t,["topP"]);e!==void 0&&o!=null&&b(e,["setup","generationConfig","topP"],o);const a=y(t,["topK"]);e!==void 0&&a!=null&&b(e,["setup","generationConfig","topK"],a);const l=y(t,["maxOutputTokens"]);e!==void 0&&l!=null&&b(e,["setup","generationConfig","maxOutputTokens"],l);const u=y(t,["mediaResolution"]);e!==void 0&&u!=null&&b(e,["setup","generationConfig","mediaResolution"],u);const d=y(t,["seed"]);e!==void 0&&d!=null&&b(e,["setup","generationConfig","seed"],d);const f=y(t,["speechConfig"]);e!==void 0&&f!=null&&b(e,["setup","generationConfig","speechConfig"],PR(f));const g=y(t,["thinkingConfig"]);e!==void 0&&g!=null&&b(e,["setup","generationConfig","thinkingConfig"],g);const m=y(t,["enableAffectiveDialog"]);e!==void 0&&m!=null&&b(e,["setup","generationConfig","enableAffectiveDialog"],m);const v=y(t,["systemInstruction"]);e!==void 0&&v!=null&&b(e,["setup","systemInstruction"],Ywe(gi(v)));const S=y(t,["tools"]);if(e!==void 0&&S!=null){let P=Ah(S);Array.isArray(P)&&(P=P.map(N=>oSe(mh(N)))),b(e,["setup","tools"],P)}const C=y(t,["sessionResumption"]);e!==void 0&&C!=null&&b(e,["setup","sessionResumption"],sSe(C));const E=y(t,["inputAudioTranscription"]);e!==void 0&&E!=null&&b(e,["setup","inputAudioTranscription"],E);const k=y(t,["outputAudioTranscription"]);e!==void 0&&k!=null&&b(e,["setup","outputAudioTranscription"],k);const R=y(t,["realtimeInputConfig"]);e!==void 0&&R!=null&&b(e,["setup","realtimeInputConfig"],R);const M=y(t,["contextWindowCompression"]);e!==void 0&&M!=null&&b(e,["setup","contextWindowCompression"],M);const D=y(t,["proactivity"]);if(e!==void 0&&D!=null&&b(e,["setup","proactivity"],D),y(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function iSe(t,e){const n={},i=y(e,["model"]);i!=null&&b(n,["setup","model"],St(t,i));const r=y(e,["config"]);return r!=null&&b(n,["config"],nSe(r,n)),n}function rSe(t){const e={},n=y(t,["mediaResolution"]);n!=null&&b(e,["mediaResolution"],n);const i=y(t,["codeExecutionResult"]);i!=null&&b(e,["codeExecutionResult"],i);const r=y(t,["executableCode"]);r!=null&&b(e,["executableCode"],r);const s=y(t,["fileData"]);s!=null&&b(e,["fileData"],Xwe(s));const o=y(t,["functionCall"]);o!=null&&b(e,["functionCall"],Zwe(o));const a=y(t,["functionResponse"]);a!=null&&b(e,["functionResponse"],a);const l=y(t,["inlineData"]);l!=null&&b(e,["inlineData"],Kwe(l));const u=y(t,["text"]);u!=null&&b(e,["text"],u);const d=y(t,["thought"]);d!=null&&b(e,["thought"],d);const f=y(t,["thoughtSignature"]);f!=null&&b(e,["thoughtSignature"],f);const g=y(t,["videoMetadata"]);return g!=null&&b(e,["videoMetadata"],g),e}function sSe(t){const e={},n=y(t,["handle"]);if(n!=null&&b(e,["handle"],n),y(t,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function oSe(t){const e={};if(y(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=y(t,["computerUse"]);n!=null&&b(e,["computerUse"],n);const i=y(t,["fileSearch"]);i!=null&&b(e,["fileSearch"],i);const r=y(t,["codeExecution"]);if(r!=null&&b(e,["codeExecution"],r),y(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const s=y(t,["functionDeclarations"]);if(s!=null){let d=s;Array.isArray(d)&&(d=d.map(f=>f)),b(e,["functionDeclarations"],d)}const o=y(t,["googleMaps"]);o!=null&&b(e,["googleMaps"],eSe(o));const a=y(t,["googleSearch"]);a!=null&&b(e,["googleSearch"],tSe(a));const l=y(t,["googleSearchRetrieval"]);l!=null&&b(e,["googleSearchRetrieval"],l);const u=y(t,["urlContext"]);return u!=null&&b(e,["urlContext"],u),e}function aSe(t){const e=[];for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=t[n];if(typeof i=="object"&&i!=null&&Object.keys(i).length>0){const r=Object.keys(i).map(s=>`${n}.${s}`);e.push(...r)}else e.push(n)}return e.join(",")}function lSe(t,e){let n=null;const i=t.bidiGenerateContentSetup;if(typeof i=="object"&&i!==null&&"setup"in i){const s=i.setup;typeof s=="object"&&s!==null?(t.bidiGenerateContentSetup=s,n=s):delete t.bidiGenerateContentSetup}else i!==void 0&&delete t.bidiGenerateContentSetup;const r=t.fieldMask;if(n){const s=aSe(n);if(Array.isArray(e?.lockAdditionalFields)&&e?.lockAdditionalFields.length===0)s?t.fieldMask=s:delete t.fieldMask;else if(e?.lockAdditionalFields&&e.lockAdditionalFields.length>0&&r!==null&&Array.isArray(r)&&r.length>0){const o=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let a=[];r.length>0&&(a=r.map(u=>o.includes(u)?`generationConfig.${u}`:u));const l=[];s&&l.push(s),a.length>0&&l.push(...a),l.length>0?t.fieldMask=l.join(","):delete t.fieldMask}else delete t.fieldMask}else r!==null&&Array.isArray(r)&&r.length>0?t.fieldMask=r.join(","):delete t.fieldMask;return t}class cSe extends Aa{constructor(e){super(),this.apiClient=e}async create(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const a=Jwe(this.apiClient,e);s=Re("auth_tokens",a._url),o=a._query,delete a.config,delete a._url,delete a._query;const l=lSe(a,e.config);return r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),r.then(u=>u)}}}function uSe(t,e){const n={},i=y(t,["force"]);return e!==void 0&&i!=null&&b(e,["_query","force"],i),n}function dSe(t){const e={},n=y(t,["name"]);n!=null&&b(e,["_url","name"],n);const i=y(t,["config"]);return i!=null&&uSe(i,e),e}function hSe(t){const e={},n=y(t,["name"]);return n!=null&&b(e,["_url","name"],n),e}function fSe(t,e){const n={},i=y(t,["pageSize"]);e!==void 0&&i!=null&&b(e,["_query","pageSize"],i);const r=y(t,["pageToken"]);return e!==void 0&&r!=null&&b(e,["_query","pageToken"],r),n}function pSe(t){const e={},n=y(t,["parent"]);n!=null&&b(e,["_url","parent"],n);const i=y(t,["config"]);return i!=null&&fSe(i,e),e}function gSe(t){const e={},n=y(t,["sdkHttpResponse"]);n!=null&&b(e,["sdkHttpResponse"],n);const i=y(t,["nextPageToken"]);i!=null&&b(e,["nextPageToken"],i);const r=y(t,["documents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(o=>o)),b(e,["documents"],s)}return e}class mSe extends Aa{constructor(e){super(),this.apiClient=e,this.list=async n=>new jc(da.PAGED_ITEM_DOCUMENTS,i=>this.listInternal({parent:n.parent,config:i.config}),await this.listInternal(n),n)}async get(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=hSe(e);return s=Re("{name}",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var n,i;let r="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=dSe(e);r=Re("{name}",o._url),s=o._query,delete o._url,delete o._query,await this.apiClient.request({path:r,queryParams:s,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=pSe(e);return s=Re("{parent}/documents",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=gSe(l),d=new YAe;return Object.assign(d,u),d})}}}class ASe extends Aa{constructor(e,n=new mSe(e)){super(),this.apiClient=e,this.documents=n,this.list=async(i={})=>new jc(da.PAGED_ITEM_FILE_SEARCH_STORES,r=>this.listInternal(r),await this.listInternal(i),i)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async create(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=awe(e);return s=Re("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async get(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=uwe(e);return s=Re("{name}",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var n,i;let r="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=cwe(e);r=Re("{name}",o._url),s=o._query,delete o._url,delete o._query,await this.apiClient.request({path:r,queryParams:s,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=mwe(e);return s=Re("fileSearchStores",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=Awe(l),d=new qAe;return Object.assign(d,u),d})}}async uploadToFileSearchStoreInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=ywe(e);return s=Re("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=vwe(l),d=new JAe;return Object.assign(d,u),d})}}async importFile(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=fwe(e);return s=Re("{file_search_store_name}:importFile",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const u=hwe(l),d=new RR;return Object.assign(d,u),d})}}}let C7=function(){const{crypto:t}=globalThis;if(t?.randomUUID)return C7=t.randomUUID.bind(t),t.randomUUID();const e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))};const ySe=()=>C7();function S_(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}const C_=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){const e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};class ts extends Error{}class Li extends ts{constructor(e,n,i,r){super(`${Li.makeMessage(e,n,i)}`),this.status=e,this.headers=r,this.error=n}static makeMessage(e,n,i){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,n,i,r){if(!e||!r)return new mw({message:i,cause:C_(n)});const s=n;return e===400?new E7(e,s,i,r):e===401?new _7(e,s,i,r):e===403?new T7(e,s,i,r):e===404?new R7(e,s,i,r):e===409?new k7(e,s,i,r):e===422?new I7(e,s,i,r):e===429?new M7(e,s,i,r):e>=500?new D7(e,s,i,r):new Li(e,s,i,r)}}class x_ extends Li{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class mw extends Li{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}}class x7 extends mw{constructor({message:e}={}){super({message:e??"Request timed out."})}}class E7 extends Li{}class _7 extends Li{}class T7 extends Li{}class R7 extends Li{}class k7 extends Li{}class I7 extends Li{}class M7 extends Li{}class D7 extends Li{}const vSe=/^[a-z][a-z0-9+.-]*:/i,bSe=t=>vSe.test(t);let E_=t=>(E_=Array.isArray,E_(t));const wSe=E_;let SSe=wSe;const r4=SSe;function CSe(t){if(!t)return!0;for(const e in t)return!1;return!0}function xSe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const ESe=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new ts(`${t} must be an integer`);if(e<0)throw new ts(`${t} must be a positive integer`);return e},_Se=t=>{try{return JSON.parse(t)}catch{return}};const TSe=t=>new Promise(e=>setTimeout(e,t));const dd="0.0.1";function RSe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const kSe=()=>{var t,e,n,i,r;const s=RSe();if(s==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dd,"X-Stainless-OS":o4(Deno.build.os),"X-Stainless-Arch":s4(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(e=(t=Deno.version)===null||t===void 0?void 0:t.deno)!==null&&e!==void 0?e:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dd,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(s==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dd,"X-Stainless-OS":o4((n=globalThis.process.platform)!==null&&n!==void 0?n:"unknown"),"X-Stainless-Arch":s4((i=globalThis.process.arch)!==null&&i!==void 0?i:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(r=globalThis.process.version)!==null&&r!==void 0?r:"unknown"};const o=ISe();return o?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dd,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${o.browser}`,"X-Stainless-Runtime-Version":o.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":dd,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function ISe(){if(typeof navigator>"u"||!navigator)return null;const t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:e,pattern:n}of t){const i=n.exec(navigator.userAgent);if(i){const r=i[1]||0,s=i[2]||0,o=i[3]||0;return{browser:e,version:`${r}.${s}.${o}`}}}return null}const s4=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",o4=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown");let P0;const MSe=()=>P0??(P0=kSe());function DSe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function P7(...t){const e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function PSe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return P7({start(){},async pull(n){const{done:i,value:r}=await e.next();i?n.close():n.enqueue(r)},async cancel(){var n;await((n=e.return)===null||n===void 0?void 0:n.call(e))}})}function N7(t){if(t[Symbol.asyncIterator])return t;const e=t.getReader();return{async next(){try{const n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){const n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function NSe(t){var e,n;if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await((n=(e=t[Symbol.asyncIterator]()).return)===null||n===void 0?void 0:n.call(e));return}const i=t.getReader(),r=i.cancel();i.releaseLock(),await r}const OSe=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});const O7=()=>{var t;if(typeof File>"u"){const{process:e}=globalThis,n=typeof((t=e?.versions)===null||t===void 0?void 0:t.node)=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function nE(t,e,n){return O7(),new File(t,e??"unknown_file",n)}function BSe(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}const LSe=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function";const B7=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",USe=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&B7(t),VSe=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function";async function FSe(t,e,n){if(O7(),t=await t,USe(t))return t instanceof File?t:nE([await t.arrayBuffer()],t.name);if(VSe(t)){const r=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),nE(await __(r),e,n)}const i=await __(t);if(e||(e=BSe(t)),!n?.type){const r=i.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof r=="string"&&(n=Object.assign(Object.assign({},n),{type:r}))}return nE(i,e,n)}async function __(t){var e,n,i,r,s;let o=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)o.push(t);else if(B7(t))o.push(t instanceof Blob?t:await t.arrayBuffer());else if(LSe(t))try{for(var a=!0,l=Es(t),u;u=await l.next(),e=u.done,!e;a=!0){r=u.value,a=!1;const d=r;o.push(...await __(d))}}catch(d){n={error:d}}finally{try{!a&&!e&&(i=l.return)&&await i.call(l)}finally{if(n)throw n.error}}else{const d=(s=t?.constructor)===null||s===void 0?void 0:s.name;throw new Error(`Unexpected data type: ${typeof t}${d?`; constructor: ${d}`:""}${HSe(t)}`)}return o}function HSe(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}class L7{constructor(e){this._client=e}}L7._key=[];function U7(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const a4=Object.freeze(Object.create(null)),zSe=(t=U7)=>(function(n,...i){if(n.length===1)return n[0];let r=!1;const s=[],o=n.reduce((d,f,g)=>{var m,v,S;/[?#]/.test(f)&&(r=!0);const C=i[g];let E=(r?encodeURIComponent:t)(""+C);return g!==i.length&&(C==null||typeof C=="object"&&C.toString===((S=Object.getPrototypeOf((v=Object.getPrototypeOf((m=C.hasOwnProperty)!==null&&m!==void 0?m:a4))!==null&&v!==void 0?v:a4))===null||S===void 0?void 0:S.toString))&&(E=C+"",s.push({start:d.length+f.length,length:E.length,error:`Value of type ${Object.prototype.toString.call(C).slice(8,-1)} is not a valid path parameter`})),d+f+(g===i.length?"":E)},""),a=o.split(/[?#]/,1)[0],l=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=l.exec(a))!==null;)s.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(s.sort((d,f)=>d.start-f.start),s.length>0){let d=0;const f=s.reduce((g,m)=>{const v=" ".repeat(m.start-d),S="^".repeat(m.length);return d=m.start+m.length,g+v+S},"");throw new ts(`Path parameters result in path with invalid segments: -${s.map(g=>g.error).join(` +`];for(;;){const{done:p,value:u}=yield _t(r.read());if(p){if(s.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const l=i.decode(u,{stream:!0});try{const h=JSON.parse(l);if("error"in h){const m=JSON.parse(JSON.stringify(h.error)),g=m.status,y=m.code,_=`got status: ${g}. ${JSON.stringify(h)}`;if(y>=400&&y<600)throw new XM({message:_,status:y})}}catch(h){if(h.name==="ApiError")throw h}s+=l;let d=-1,f=0;for(;;){d=-1,f=0;for(const g of c){const y=s.indexOf(g);y!==-1&&(d===-1||y{throw new Error(`exception ${o} sending request`)})}getDefaultHeaders(){const t={},n=kBe+" "+this.clientOptions.userAgentExtra;return t[xBe]=n,t[S1]=n,t[LBe]="application/json",t}async getHeadersInternal(t,n){const o=new Headers;if(t&&t.headers){for(const[r,i]of Object.entries(t.headers))o.append(r,i);t.timeout&&t.timeout>0&&o.append(FBe,String(Math.ceil(t.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(o,n),o}getFileName(t){var n;let o="";return typeof t=="string"&&(o=t.replace(/[/\\]+$/,""),o=(n=o.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),o}async uploadFile(t,n){var o;const r={};n!=null&&(r.mimeType=n.mimeType,r.name=n.name,r.displayName=n.displayName),r.name&&!r.name.startsWith("files/")&&(r.name=`files/${r.name}`);const i=this.clientOptions.uploader,s=await i.stat(t);r.sizeBytes=String(s.size);const a=(o=n?.mimeType)!==null&&o!==void 0?o:s.type;if(a===void 0||a==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");r.mimeType=a;const c={file:r},p=this.getFileName(t),u=qe("upload/v1beta/files",c._url),l=await this.fetchUploadUrl(u,r.sizeBytes,r.mimeType,p,c,n?.httpOptions);return i.upload(t,l,this)}async uploadFileToFileSearchStore(t,n,o){var r;const i=this.clientOptions.uploader,s=await i.stat(n),a=String(s.size),c=(r=o?.mimeType)!==null&&r!==void 0?r:s.type;if(c===void 0||c==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const p=`upload/v1beta/${t}:uploadToFileSearchStore`,u=this.getFileName(n),l={};o!=null&&Joe(o,l);const d=await this.fetchUploadUrl(p,a,c,u,l,o?.httpOptions);return i.uploadToFileSearchStore(n,d,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,n,o,r,i,s){var a;let c={};s?c=s:c={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${o}`},r?{"X-Goog-Upload-File-Name":r}:{})};const p=await this.request({path:t,body:JSON.stringify(i),httpMethod:"POST",httpOptions:c});if(!p||!p?.headers)throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const u=(a=p?.headers)===null||a===void 0?void 0:a["x-goog-upload-url"];if(u===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return u}}async function P6(e){var t;if(e===void 0)throw new Error("response is undefined");if(!e.ok){const n=e.status;let o;!((t=e.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?o=await e.json():o={error:{message:await e.text(),code:e.status,status:e.statusText}};const r=JSON.stringify(o);throw n>=400&&n<600?new XM({message:r,status:n}):new Error(r)}}function VBe(e,t){if(!t||Object.keys(t).length===0)return;if(e.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let n={};if(typeof e.body=="string"&&e.body.length>0)try{const i=JSON.parse(e.body);if(typeof i=="object"&&i!==null&&!Array.isArray(i))n=i;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function o(i,s){const a=Object.assign({},i);for(const c in s)if(Object.prototype.hasOwnProperty.call(s,c)){const p=s[c],u=a[c];p&&typeof p=="object"&&!Array.isArray(p)&&u&&typeof u=="object"&&!Array.isArray(u)?a[c]=o(u,p):(u&&p&&typeof u!=typeof p&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${c}". Original type: ${typeof u}, New type: ${typeof p}. Overwriting.`),a[c]=p)}return a}const r=o(n,t);e.body=JSON.stringify(r)}const HBe="mcp_used/unknown";let GBe=!1;function Voe(e){for(const t of e)if(zBe(t)||typeof t=="object"&&"inputSchema"in t)return!0;return GBe}function Hoe(e){var t;const n=(t=e[S1])!==null&&t!==void 0?t:"";e[S1]=(n+` ${HBe}`).trimStart()}function zBe(e){return e!==null&&typeof e=="object"&&e instanceof jx}function KBe(e){return vs(this,arguments,function*(n,o=100){let r,i=0;for(;i0)return;const i={},s=[];for(const u of this.mcpClients)try{for(var a=!0,c=(n=void 0,Ss(KBe(u))),p;p=await c.next(),t=p.done,!t;a=!0){r=p.value,a=!1;const l=r;s.push(l);const d=l.name;if(i[d])throw new Error(`Duplicate function name ${d} found in MCP tools. Please ensure function names are unique.`);i[d]=u}}catch(l){n={error:l}}finally{try{!a&&!t&&(o=c.return)&&await o.call(c)}finally{if(n)throw n.error}}this.mcpTools=s,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),O1e(this.mcpTools,this.config)}async callTool(t){await this.initialize();const n=[];for(const o of t)if(o.name in this.functionNameToMcpClient){const r=this.functionNameToMcpClient[o.name];let i;this.config.timeout&&(i={timeout:this.config.timeout});const s=await r.callTool({name:o.name,arguments:o.args},void 0,i);n.push({functionResponse:{name:o.name,response:s.isError?{error:s}:s}})}return n}}async function QBe(e,t,n){const o=new b1e;let r;n.data instanceof Blob?r=JSON.parse(await n.data.text()):r=JSON.parse(n.data),Object.assign(o,r),t(o)}class $Be{constructor(t,n,o){this.apiClient=t,this.auth=n,this.webSocketFactory=o}async connect(t){var n,o;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const r=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),s=XBe(this.apiClient.getDefaultHeaders()),a=this.apiClient.getApiKey(),c=`${r}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${a}`;let p=()=>{};const u=new Promise(S=>{p=S}),l=t.callbacks,d=function(){p({})},f=this.apiClient,h={onopen:d,onmessage:S=>{QBe(f,l.onmessage,S)},onerror:(n=l?.onerror)!==null&&n!==void 0?n:function(S){},onclose:(o=l?.onclose)!==null&&o!==void 0?o:function(S){}},m=this.webSocketFactory.create(c,YBe(s),h);m.connect(),await u;const _={setup:{model:$t(this.apiClient,t.model)}};return m.send(JSON.stringify(_)),new WBe(m,this.apiClient)}}class WBe{constructor(t,n){this.conn=t,this.apiClient=n}async setWeightedPrompts(t){if(!t.weightedPrompts||Object.keys(t.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const n=SFe(t);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const n=vFe(t);this.conn.send(JSON.stringify(n))}sendPlaybackControl(t){const n={playbackControl:t};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(xy.PLAY)}pause(){this.sendPlaybackControl(xy.PAUSE)}stop(){this.sendPlaybackControl(xy.STOP)}resetContext(){this.sendPlaybackControl(xy.RESET_CONTEXT)}close(){this.conn.close()}}function YBe(e){const t={};return e.forEach((n,o)=>{t[o]=n}),t}function XBe(e){const t=new Headers;for(const[n,o]of Object.entries(e))t.append(n,o);return t}const ZBe="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function eke(e,t,n){const o=new g1e;let r;n.data instanceof Blob?r=await n.data.text():n.data instanceof ArrayBuffer?r=new TextDecoder().decode(n.data):r=n.data;const i=JSON.parse(r);if(e.isVertexAI()){const s=OFe(i);Object.assign(o,s)}else Object.assign(o,i);t(o)}class tke{constructor(t,n,o){this.apiClient=t,this.auth=n,this.webSocketFactory=o,this.music=new $Be(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var n,o,r,i,s,a;if(t.config&&t.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const c=this.apiClient.getWebsocketBaseUrl(),p=this.apiClient.getApiVersion();let u;const l=this.apiClient.getHeaders();t.config&&t.config.tools&&Voe(t.config.tools)&&Hoe(l);const d=ike(l);if(this.apiClient.isVertexAI())u=`${c}/ws/google.cloud.aiplatform.${p}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(d,u);else{const B=this.apiClient.getApiKey();let N="BidiGenerateContent",L="key";B?.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),p!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),N="BidiGenerateContentConstrained",L="access_token"),u=`${c}/ws/google.ai.generativelanguage.${p}.GenerativeService.${N}?${L}=${B}`}let f=()=>{};const h=new Promise(B=>{f=B}),m=t.callbacks,g=function(){var B;(B=m?.onopen)===null||B===void 0||B.call(m),f({})},y=this.apiClient,_={onopen:g,onmessage:B=>{eke(y,m.onmessage,B)},onerror:(n=m?.onerror)!==null&&n!==void 0?n:function(B){},onclose:(o=m?.onclose)!==null&&o!==void 0?o:function(B){}},S=this.webSocketFactory.create(u,oke(d),_);S.connect(),await h;let w=$t(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&w.startsWith("publishers/")){const B=this.apiClient.getProject(),N=this.apiClient.getLocation();w=`projects/${B}/locations/${N}/`+w}let R={};this.apiClient.isVertexAI()&&((r=t.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[gE.AUDIO]}:t.config.responseModalities=[gE.AUDIO]),!((i=t.config)===null||i===void 0)&&i.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const E=(a=(s=t.config)===null||s===void 0?void 0:s.tools)!==null&&a!==void 0?a:[],T=[];for(const B of E)if(this.isCallableTool(B)){const N=B;T.push(await N.tool())}else T.push(B);T.length>0&&(t.config.tools=T);const D={model:w,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?R=_Fe(this.apiClient,D):R=AFe(this.apiClient,D),delete R.config,S.send(JSON.stringify(R)),new rke(S,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const nke={turnComplete:!0};class rke{constructor(t,n){this.conn=t,this.apiClient=n}tLiveClientContent(t,n){if(n.turns!==null&&n.turns!==void 0){let o=[];try{o=Gi(n.turns),t.isVertexAI()||(o=o.map(r=>ZM(r)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:o,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(t,n){let o=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?o=n.functionResponses:o=[n.functionResponses],o.length===0)throw new Error("functionResponses is required.");for(const i of o){if(typeof i!="object"||i===null||!("name"in i)||!("response"in i))throw new Error(`Could not parse function response, type '${typeof i}'.`);if(!t.isVertexAI()&&!("id"in i))throw new Error(ZBe)}return{toolResponse:{functionResponses:o}}}sendClientContent(t){t=Object.assign(Object.assign({},nke),t);const n=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(n))}sendRealtimeInput(t){let n={};this.apiClient.isVertexAI()?n={realtimeInput:wFe(t)}:n={realtimeInput:CFe(t)},this.conn.send(JSON.stringify(n))}sendToolResponse(t){if(t.functionResponses==null)throw new Error("Tool response parameters are required.");const n=this.tLiveClienttToolResponse(this.apiClient,t);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}}function oke(e){const t={};return e.forEach((n,o)=>{t[o]=n}),t}function ike(e){const t=new Headers;for(const[n,o]of Object.entries(e))t.append(n,o);return t}const I6=10;function j6(e){var t,n,o;if(!((t=e?.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let r=!1;for(const s of(n=e?.tools)!==null&&n!==void 0?n:[])if(Zy(s)){r=!0;break}if(!r)return!0;const i=(o=e?.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls;return i&&(i<0||!Number.isInteger(i))||i==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",i),!0):!1}function Zy(e){return"callTool"in e&&typeof e.callTool=="function"}function ske(e){var t,n,o;return(o=(n=(t=e.config)===null||t===void 0?void 0:t.tools)===null||n===void 0?void 0:n.some(r=>Zy(r)))!==null&&o!==void 0?o:!1}function D6(e){var t;const n=[];return!((t=e?.config)===null||t===void 0)&&t.tools&&e.config.tools.forEach((o,r)=>{if(Zy(o))return;const i=o;i.functionDeclarations&&i.functionDeclarations.length>0&&n.push(r)}),n}function N6(e){var t;return!(!((t=e?.automaticFunctionCalling)===null||t===void 0)&&t.ignoreCallHistory)}class ake extends mp{constructor(t){super(),this.apiClient=t,this.generateContent=async n=>{var o,r,i,s,a;const c=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchem(n),!ske(n)||j6(n.config))return await this.generateContentInternal(c);const p=D6(n);if(p.length>0){const m=p.map(g=>`tools[${g}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${m}.`)}let u,l;const d=Gi(c.contents),f=(i=(r=(o=c.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&i!==void 0?i:I6;let h=0;for(;h{var o,r,i,s,a;if(this.maybeMoveToResponseJsonSchem(n),j6(n.config)){const l=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(l)}const c=D6(n);if(c.length>0){const l=c.map(d=>`tools[${d}]`).join(", ");throw new Error(`Incompatible tools found at ${l}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const p=(i=(r=(o=n?.config)===null||o===void 0?void 0:o.toolConfig)===null||r===void 0?void 0:r.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,u=(a=(s=n?.config)===null||s===void 0?void 0:s.automaticFunctionCalling)===null||a===void 0?void 0:a.disable;if(p&&!u)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(n)},this.generateImages=async n=>await this.generateImagesInternal(n).then(o=>{var r;let i;const s=[];if(o?.generatedImages)for(const c of o.generatedImages)c&&c?.safetyAttributes&&((r=c?.safetyAttributes)===null||r===void 0?void 0:r.contentType)==="Positive Prompt"?i=c?.safetyAttributes:s.push(c);let a;return i?a={generatedImages:s,positivePromptSafetyAttributes:i,sdkHttpResponse:o.sdkHttpResponse}:a={generatedImages:s,sdkHttpResponse:o.sdkHttpResponse},a}),this.list=async n=>{var o;const s={config:Object.assign(Object.assign({},{queryBase:!0}),n?.config)};if(this.apiClient.isVertexAI()&&!s.config.queryBase){if(!((o=s.config)===null||o===void 0)&&o.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");s.config.filter="labels.tune-type:*"}return new Zg(up.PAGED_ITEM_MODELS,a=>this.listInternal(a),await this.listInternal(s),s)},this.editImage=async n=>{const o={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(o.referenceImages=n.referenceImages.map(r=>r.toReferenceImageAPI())),await this.editImageInternal(o)},this.upscaleImage=async n=>{let o={numberOfImages:1,mode:"upscale"};n.config&&(o=Object.assign(Object.assign({},o),n.config));const r={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:o};return await this.upscaleImageInternal(r)},this.generateVideos=async n=>{var o,r,i,s,a,c;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((o=n.video)===null||o===void 0)&&o.uri&&(!((r=n.video)===null||r===void 0)&&r.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((s=(i=n.source)===null||i===void 0?void 0:i.video)===null||s===void 0)&&s.uri&&(!((c=(a=n.source)===null||a===void 0?void 0:a.video)===null||c===void 0)&&c.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}maybeMoveToResponseJsonSchem(t){t.config&&t.config.responseSchema&&(t.config.responseJsonSchema||Object.keys(t.config.responseSchema).includes("$schema")&&(t.config.responseJsonSchema=t.config.responseSchema,delete t.config.responseSchema))}async processParamsMaybeAddMcpUsage(t){var n,o,r;const i=(n=t.config)===null||n===void 0?void 0:n.tools;if(!i)return t;const s=await Promise.all(i.map(async c=>Zy(c)?await c.tool():c)),a={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:s})};if(a.config.tools=s,t.config&&t.config.tools&&Voe(t.config.tools)){const c=(r=(o=t.config.httpOptions)===null||o===void 0?void 0:o.headers)!==null&&r!==void 0?r:{};let p=Object.assign({},c);Object.keys(p).length===0&&(p=this.apiClient.getDefaultHeaders()),Hoe(p),a.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:p})}return a}async initAfcToolsMap(t){var n,o,r;const i=new Map;for(const s of(o=(n=t.config)===null||n===void 0?void 0:n.tools)!==null&&o!==void 0?o:[])if(Zy(s)){const a=s,c=await a.tool();for(const p of(r=c.functionDeclarations)!==null&&r!==void 0?r:[]){if(!p.name)throw new Error("Function declaration name is required.");if(i.has(p.name))throw new Error(`Duplicate tool declaration name: ${p.name}`);i.set(p.name,a)}}return i}async processAfcStream(t){var n,o,r;const i=(r=(o=(n=t.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls)!==null&&r!==void 0?r:I6;let s=!1,a=0;const c=await this.initAfcToolsMap(t);return(function(p,u,l){return vs(this,arguments,function*(){for(var d,f,h,m,g,y;a0){s=!0;const B=new hv;B.candidates=[{content:{role:"user",parts:T}}],yield yield _t(B);const N=[];N.push(...D),N.push({role:"user",parts:T});const L=Gi(l.contents).concat(N);l.contents=L}else break}})})(this,c,t)}async generateContentInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=R6(this.apiClient,t);return a=qe("{model}:generateContent",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=M6(u),d=new hv;return Object.assign(d,l),d})}else{const p=T6(this.apiClient,t);return a=qe("{model}:generateContent",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=E6(u),d=new hv;return Object.assign(d,l),d})}}async generateContentStreamInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=R6(this.apiClient,t);return a=qe("{model}:streamGenerateContent?alt=sse",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}),s.then(function(l){return vs(this,arguments,function*(){var d,f,h,m;try{for(var g=!0,y=Ss(l),_;_=yield _t(y.next()),d=_.done,!d;g=!0){m=_.value,g=!1;const S=m,w=M6(yield _t(S.json()));w.sdkHttpResponse={headers:S.headers};const R=new hv;Object.assign(R,w),yield yield _t(R)}}catch(S){f={error:S}}finally{try{!g&&!d&&(h=y.return)&&(yield _t(h.call(y)))}finally{if(f)throw f.error}}})})}else{const p=T6(this.apiClient,t);return a=qe("{model}:streamGenerateContent?alt=sse",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.requestStream({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}),s.then(function(l){return vs(this,arguments,function*(){var d,f,h,m;try{for(var g=!0,y=Ss(l),_;_=yield _t(y.next()),d=_.done,!d;g=!0){m=_.value,g=!1;const S=m,w=E6(yield _t(S.json()));w.sdkHttpResponse={headers:S.headers};const R=new hv;Object.assign(R,w),yield yield _t(R)}}catch(S){f={error:S}}finally{try{!g&&!d&&(h=y.return)&&(yield _t(h.call(y)))}finally{if(f)throw f.error}}})})}}async embedContent(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=txe(this.apiClient,t);return a=qe("{model}:predict",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=rxe(u),d=new u6;return Object.assign(d,l),d})}else{const p=exe(this.apiClient,t);return a=qe("{model}:batchEmbedContents",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=nxe(u),d=new u6;return Object.assign(d,l),d})}}async generateImagesInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=pxe(this.apiClient,t);return a=qe("{model}:predict",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=gxe(u),d=new c6;return Object.assign(d,l),d})}else{const p=hxe(this.apiClient,t);return a=qe("{model}:predict",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=mxe(u),d=new c6;return Object.assign(d,l),d})}}async editImageInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=WFe(this.apiClient,t);return i=qe("{model}:predict",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>{const p=YFe(c),u=new i1e;return Object.assign(u,p),u})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=pBe(this.apiClient,t);return i=qe("{model}:predict",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>{const p=mBe(c),u=new s1e;return Object.assign(u,p),u})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=$xe(this.apiClient,t);return i=qe("{model}:predict",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=Wxe(c),u=new a1e;return Object.assign(u,p),u})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=nBe(this.apiClient,t);return i=qe("{model}:predict",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=rBe(c),u=new l1e;return Object.assign(u,p),u})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=Dxe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>v1(u))}else{const p=jxe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>_1(u))}}async listInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=Jxe(this.apiClient,t);return a=qe("{models_url}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=Hxe(u),d=new d6;return Object.assign(d,l),d})}else{const p=qxe(this.apiClient,t);return a=qe("{models_url}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=Vxe(u),d=new d6;return Object.assign(d,l),d})}}async update(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=fBe(this.apiClient,t);return a=qe("{model}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>v1(u))}else{const p=dBe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>_1(u))}}async delete(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=zFe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=QFe(u),d=new f6;return Object.assign(d,l),d})}else{const p=GFe(this.apiClient,t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=KFe(u),d=new f6;return Object.assign(d,l),d})}}async countTokens(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=JFe(this.apiClient,t);return a=qe("{model}:countTokens",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=HFe(u),d=new h6;return Object.assign(d,l),d})}else{const p=qFe(this.apiClient,t);return a=qe("{model}:countTokens",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=VFe(u),d=new h6;return Object.assign(d,l),d})}}async computeTokens(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=NFe(this.apiClient,t);return i=qe("{model}:computeTokens",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>{const p=LFe(c),u=new u1e;return Object.assign(u,p),u})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=Sxe(this.apiClient,t);return a=qe("{model}:predictLongRunning",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s.then(u=>{const l=_xe(u),d=new bE;return Object.assign(d,l),d})}else{const p=vxe(this.apiClient,t);return a=qe("{model}:predictLongRunning",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s.then(u=>{const l=Axe(u),d=new bE;return Object.assign(d,l),d})}}}class lke extends mp{constructor(t){super(),this.apiClient=t}async getVideosOperation(t){const n=t.operation,o=t.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=n.name.split("/operations/")[0];let i;o&&"httpOptions"in o&&(i=o.httpOptions);const s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:n.name,config:o});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async get(t){const n=t.operation,o=t.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=n.name.split("/operations/")[0];let i;o&&"httpOptions"in o&&(i=o.httpOptions);const s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:n.name,config:o});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async getVideosOperationInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=Z2e(t);return a=qe("{operationName}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json()),s}else{const p=X2e(t);return a=qe("{operationName}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json()),s}}async fetchPredictVideosOperationInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=G2e(t);return i=qe("{resourceName}:fetchPredictOperation",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r}else throw new Error("This method is only supported by the Vertex AI.")}}function uke(e){const t={},n=O(e,["data"]);if(n!=null&&M(t,["data"],n),O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function cke(e){const t={},n=O(e,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>Ake(i))),M(t,["parts"],r)}const o=O(e,["role"]);return o!=null&&M(t,["role"],o),t}function dke(e,t,n){const o={},r=O(t,["expireTime"]);n!==void 0&&r!=null&&M(n,["expireTime"],r);const i=O(t,["newSessionExpireTime"]);n!==void 0&&i!=null&&M(n,["newSessionExpireTime"],i);const s=O(t,["uses"]);n!==void 0&&s!=null&&M(n,["uses"],s);const a=O(t,["liveConnectConstraints"]);n!==void 0&&a!=null&&M(n,["bidiGenerateContentSetup"],yke(e,a));const c=O(t,["lockAdditionalFields"]);return n!==void 0&&c!=null&&M(n,["fieldMask"],c),o}function fke(e,t){const n={},o=O(t,["config"]);return o!=null&&M(n,["config"],dke(e,o,n)),n}function hke(e){const t={};if(O(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=O(e,["fileUri"]);n!=null&&M(t,["fileUri"],n);const o=O(e,["mimeType"]);return o!=null&&M(t,["mimeType"],o),t}function pke(e){const t={},n=O(e,["id"]);n!=null&&M(t,["id"],n);const o=O(e,["args"]);o!=null&&M(t,["args"],o);const r=O(e,["name"]);if(r!=null&&M(t,["name"],r),O(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(O(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function mke(e){const t={};if(O(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=O(e,["enableWidget"]);return n!=null&&M(t,["enableWidget"],n),t}function gke(e){const t={};if(O(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(O(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=O(e,["timeRangeFilter"]);return n!=null&&M(t,["timeRangeFilter"],n),t}function bke(e,t){const n={},o=O(e,["generationConfig"]);t!==void 0&&o!=null&&M(t,["setup","generationConfig"],o);const r=O(e,["responseModalities"]);t!==void 0&&r!=null&&M(t,["setup","generationConfig","responseModalities"],r);const i=O(e,["temperature"]);t!==void 0&&i!=null&&M(t,["setup","generationConfig","temperature"],i);const s=O(e,["topP"]);t!==void 0&&s!=null&&M(t,["setup","generationConfig","topP"],s);const a=O(e,["topK"]);t!==void 0&&a!=null&&M(t,["setup","generationConfig","topK"],a);const c=O(e,["maxOutputTokens"]);t!==void 0&&c!=null&&M(t,["setup","generationConfig","maxOutputTokens"],c);const p=O(e,["mediaResolution"]);t!==void 0&&p!=null&&M(t,["setup","generationConfig","mediaResolution"],p);const u=O(e,["seed"]);t!==void 0&&u!=null&&M(t,["setup","generationConfig","seed"],u);const l=O(e,["speechConfig"]);t!==void 0&&l!=null&&M(t,["setup","generationConfig","speechConfig"],Ix(l));const d=O(e,["thinkingConfig"]);t!==void 0&&d!=null&&M(t,["setup","generationConfig","thinkingConfig"],d);const f=O(e,["enableAffectiveDialog"]);t!==void 0&&f!=null&&M(t,["setup","generationConfig","enableAffectiveDialog"],f);const h=O(e,["systemInstruction"]);t!==void 0&&h!=null&&M(t,["setup","systemInstruction"],cke(to(h)));const m=O(e,["tools"]);if(t!==void 0&&m!=null){let E=BA(m);Array.isArray(E)&&(E=E.map(T=>vke(xA(T)))),M(t,["setup","tools"],E)}const g=O(e,["sessionResumption"]);t!==void 0&&g!=null&&M(t,["setup","sessionResumption"],_ke(g));const y=O(e,["inputAudioTranscription"]);t!==void 0&&y!=null&&M(t,["setup","inputAudioTranscription"],y);const _=O(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&M(t,["setup","outputAudioTranscription"],_);const S=O(e,["realtimeInputConfig"]);t!==void 0&&S!=null&&M(t,["setup","realtimeInputConfig"],S);const w=O(e,["contextWindowCompression"]);t!==void 0&&w!=null&&M(t,["setup","contextWindowCompression"],w);const R=O(e,["proactivity"]);if(t!==void 0&&R!=null&&M(t,["setup","proactivity"],R),O(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function yke(e,t){const n={},o=O(t,["model"]);o!=null&&M(n,["setup","model"],$t(e,o));const r=O(t,["config"]);return r!=null&&M(n,["config"],bke(r,n)),n}function Ake(e){const t={},n=O(e,["mediaResolution"]);n!=null&&M(t,["mediaResolution"],n);const o=O(e,["codeExecutionResult"]);o!=null&&M(t,["codeExecutionResult"],o);const r=O(e,["executableCode"]);r!=null&&M(t,["executableCode"],r);const i=O(e,["fileData"]);i!=null&&M(t,["fileData"],hke(i));const s=O(e,["functionCall"]);s!=null&&M(t,["functionCall"],pke(s));const a=O(e,["functionResponse"]);a!=null&&M(t,["functionResponse"],a);const c=O(e,["inlineData"]);c!=null&&M(t,["inlineData"],uke(c));const p=O(e,["text"]);p!=null&&M(t,["text"],p);const u=O(e,["thought"]);u!=null&&M(t,["thought"],u);const l=O(e,["thoughtSignature"]);l!=null&&M(t,["thoughtSignature"],l);const d=O(e,["videoMetadata"]);return d!=null&&M(t,["videoMetadata"],d),t}function _ke(e){const t={},n=O(e,["handle"]);if(n!=null&&M(t,["handle"],n),O(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function vke(e){const t={};if(O(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=O(e,["computerUse"]);n!=null&&M(t,["computerUse"],n);const o=O(e,["fileSearch"]);o!=null&&M(t,["fileSearch"],o);const r=O(e,["codeExecution"]);if(r!=null&&M(t,["codeExecution"],r),O(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=O(e,["functionDeclarations"]);if(i!=null){let u=i;Array.isArray(u)&&(u=u.map(l=>l)),M(t,["functionDeclarations"],u)}const s=O(e,["googleMaps"]);s!=null&&M(t,["googleMaps"],mke(s));const a=O(e,["googleSearch"]);a!=null&&M(t,["googleSearch"],gke(a));const c=O(e,["googleSearchRetrieval"]);c!=null&&M(t,["googleSearchRetrieval"],c);const p=O(e,["urlContext"]);return p!=null&&M(t,["urlContext"],p),t}function Ske(e){const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];if(typeof o=="object"&&o!=null&&Object.keys(o).length>0){const r=Object.keys(o).map(i=>`${n}.${i}`);t.push(...r)}else t.push(n)}return t.join(",")}function Cke(e,t){let n=null;const o=e.bidiGenerateContentSetup;if(typeof o=="object"&&o!==null&&"setup"in o){const i=o.setup;typeof i=="object"&&i!==null?(e.bidiGenerateContentSetup=i,n=i):delete e.bidiGenerateContentSetup}else o!==void 0&&delete e.bidiGenerateContentSetup;const r=e.fieldMask;if(n){const i=Ske(n);if(Array.isArray(t?.lockAdditionalFields)&&t?.lockAdditionalFields.length===0)i?e.fieldMask=i:delete e.fieldMask;else if(t?.lockAdditionalFields&&t.lockAdditionalFields.length>0&&r!==null&&Array.isArray(r)&&r.length>0){const s=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let a=[];r.length>0&&(a=r.map(p=>s.includes(p)?`generationConfig.${p}`:p));const c=[];i&&c.push(i),a.length>0&&c.push(...a),c.length>0?e.fieldMask=c.join(","):delete e.fieldMask}else delete e.fieldMask}else r!==null&&Array.isArray(r)&&r.length>0?e.fieldMask=r.join(","):delete e.fieldMask;return e}class wke extends mp{constructor(t){super(),this.apiClient=t}async create(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const a=fke(this.apiClient,t);i=qe("auth_tokens",a._url),s=a._query,delete a.config,delete a._url,delete a._query;const c=Cke(a,t.config);return r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),r.then(p=>p)}}}function Oke(e,t){const n={},o=O(e,["force"]);return t!==void 0&&o!=null&&M(t,["_query","force"],o),n}function Tke(e){const t={},n=O(e,["name"]);n!=null&&M(t,["_url","name"],n);const o=O(e,["config"]);return o!=null&&Oke(o,t),t}function Rke(e){const t={},n=O(e,["name"]);return n!=null&&M(t,["_url","name"],n),t}function Eke(e,t){const n={},o=O(e,["pageSize"]);t!==void 0&&o!=null&&M(t,["_query","pageSize"],o);const r=O(e,["pageToken"]);return t!==void 0&&r!=null&&M(t,["_query","pageToken"],r),n}function Mke(e){const t={},n=O(e,["parent"]);n!=null&&M(t,["_url","parent"],n);const o=O(e,["config"]);return o!=null&&Eke(o,t),t}function Pke(e){const t={},n=O(e,["sdkHttpResponse"]);n!=null&&M(t,["sdkHttpResponse"],n);const o=O(e,["nextPageToken"]);o!=null&&M(t,["nextPageToken"],o);const r=O(e,["documents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),M(t,["documents"],i)}return t}class Ike extends mp{constructor(t){super(),this.apiClient=t,this.list=async n=>new Zg(up.PAGED_ITEM_DOCUMENTS,o=>this.listInternal({parent:n.parent,config:o.config}),await this.listInternal(n),n)}async get(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=Rke(t);return i=qe("{name}",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(t){var n,o;let r="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const s=Tke(t);r=qe("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:r,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=Mke(t);return i=qe("{parent}/documents",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=Pke(c),u=new c1e;return Object.assign(u,p),u})}}}class jke extends mp{constructor(t,n=new Ike(t)){super(),this.apiClient=t,this.documents=n,this.list=async(o={})=>new Zg(up.PAGED_ITEM_FILE_SEARCH_STORES,r=>this.listInternal(r),await this.listInternal(o),o)}async uploadToFileSearchStore(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(t.fileSearchStoreName,t.file,t.config)}async create(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=SBe(t);return i=qe("fileSearchStores",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async get(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=OBe(t);return i=qe("{name}",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(t){var n,o;let r="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const s=wBe(t);r=qe("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:r,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=IBe(t);return i=qe("fileSearchStores",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=jBe(c),u=new d1e;return Object.assign(u,p),u})}}async uploadToFileSearchStoreInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=DBe(t);return i=qe("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=NBe(c),u=new f1e;return Object.assign(u,p),u})}}async importFile(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=EBe(t);return i=qe("{file_search_store_name}:importFile",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{const p=RBe(c),u=new Tx;return Object.assign(u,p),u})}}}let Goe=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return Goe=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^n()&15>>+o/4).toString(16))};const Dke=()=>Goe();function C1(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const w1=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class $i extends Error{}class wo extends $i{constructor(t,n,o,r){super(`${wo.makeMessage(t,n,o)}`),this.status=t,this.headers=r,this.error=n}static makeMessage(t,n,o){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):o;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,o,r){if(!t||!r)return new nP({message:o,cause:w1(n)});const i=n;return t===400?new Koe(t,i,o,r):t===401?new Qoe(t,i,o,r):t===403?new $oe(t,i,o,r):t===404?new Woe(t,i,o,r):t===409?new Yoe(t,i,o,r):t===422?new Xoe(t,i,o,r):t===429?new Zoe(t,i,o,r):t>=500?new eie(t,i,o,r):new wo(t,i,o,r)}}class O1 extends wo{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class nP extends wo{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}}class zoe extends nP{constructor({message:t}={}){super({message:t??"Request timed out."})}}class Koe extends wo{}class Qoe extends wo{}class $oe extends wo{}class Woe extends wo{}class Yoe extends wo{}class Xoe extends wo{}class Zoe extends wo{}class eie extends wo{}const Nke=/^[a-z][a-z0-9+.-]*:/i,Lke=e=>Nke.test(e);let T1=e=>(T1=Array.isArray,T1(e));const Fke=T1;let xke=Fke;const L6=xke;function Bke(e){if(!e)return!0;for(const t in e)return!1;return!0}function kke(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const Uke=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new $i(`${e} must be an integer`);if(t<0)throw new $i(`${e} must be a positive integer`);return t},qke=e=>{try{return JSON.parse(e)}catch{return}};const Jke=e=>new Promise(t=>setTimeout(t,e));const jy="0.0.1";function Vke(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const Hke=()=>{var e,t,n,o,r;const i=Vke();if(i==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":jy,"X-Stainless-OS":x6(Deno.build.os),"X-Stainless-Arch":F6(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(t=(e=Deno.version)===null||e===void 0?void 0:e.deno)!==null&&t!==void 0?t:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":jy,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(i==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":jy,"X-Stainless-OS":x6((n=globalThis.process.platform)!==null&&n!==void 0?n:"unknown"),"X-Stainless-Arch":F6((o=globalThis.process.arch)!==null&&o!==void 0?o:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(r=globalThis.process.version)!==null&&r!==void 0?r:"unknown"};const s=Gke();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":jy,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":jy,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Gke(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:n}of e){const o=n.exec(navigator.userAgent);if(o){const r=o[1]||0,i=o[2]||0,s=o[3]||0;return{browser:t,version:`${r}.${i}.${s}`}}}return null}const F6=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",x6=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let lT;const zke=()=>lT??(lT=Hke());function Kke(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function tie(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Qke(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return tie({start(){},async pull(n){const{done:o,value:r}=await t.next();o?n.close():n.enqueue(r)},async cancel(){var n;await((n=t.return)===null||n===void 0?void 0:n.call(t))}})}function nie(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function $ke(e){var t,n;if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await((n=(t=e[Symbol.asyncIterator]()).return)===null||n===void 0?void 0:n.call(t));return}const o=e.getReader(),r=o.cancel();o.releaseLock(),await r}const Wke=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});const rie=()=>{var e;if(typeof File>"u"){const{process:t}=globalThis,n=typeof((e=t?.versions)===null||e===void 0?void 0:e.node)=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function KD(e,t,n){return rie(),new File(e,t??"unknown_file",n)}function Yke(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const Xke=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function";const oie=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",Zke=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&oie(e),eUe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function tUe(e,t,n){if(rie(),e=await e,Zke(e))return e instanceof File?e:KD([await e.arrayBuffer()],e.name);if(eUe(e)){const r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),KD(await R1(r),t,n)}const o=await R1(e);if(t||(t=Yke(e)),!n?.type){const r=o.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof r=="string"&&(n=Object.assign(Object.assign({},n),{type:r}))}return KD(o,t,n)}async function R1(e){var t,n,o,r,i;let s=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s.push(e);else if(oie(e))s.push(e instanceof Blob?e:await e.arrayBuffer());else if(Xke(e))try{for(var a=!0,c=Ss(e),p;p=await c.next(),t=p.done,!t;a=!0){r=p.value,a=!1;const u=r;s.push(...await R1(u))}}catch(u){n={error:u}}finally{try{!a&&!t&&(o=c.return)&&await o.call(c)}finally{if(n)throw n.error}}else{const u=(i=e?.constructor)===null||i===void 0?void 0:i.name;throw new Error(`Unexpected data type: ${typeof e}${u?`; constructor: ${u}`:""}${nUe(e)}`)}return s}function nUe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}class iie{constructor(t){this._client=t}}iie._key=[];function sie(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const B6=Object.freeze(Object.create(null)),rUe=(e=sie)=>(function(n,...o){if(n.length===1)return n[0];let r=!1;const i=[],s=n.reduce((u,l,d)=>{var f,h,m;/[?#]/.test(l)&&(r=!0);const g=o[d];let y=(r?encodeURIComponent:e)(""+g);return d!==o.length&&(g==null||typeof g=="object"&&g.toString===((m=Object.getPrototypeOf((h=Object.getPrototypeOf((f=g.hasOwnProperty)!==null&&f!==void 0?f:B6))!==null&&h!==void 0?h:B6))===null||m===void 0?void 0:m.toString))&&(y=g+"",i.push({start:u.length+l.length,length:y.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),u+l+(d===o.length?"":y)},""),a=s.split(/[?#]/,1)[0],c=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let p;for(;(p=c.exec(a))!==null;)i.push({start:p.index,length:p[0].length,error:`Value "${p[0]}" can't be safely passed as a path parameter`});if(i.sort((u,l)=>u.start-l.start),i.length>0){let u=0;const l=i.reduce((d,f)=>{const h=" ".repeat(f.start-u),m="^".repeat(f.length);return u=f.start+f.length,d+h+m},"");throw new $i(`Path parameters result in path with invalid segments: +${i.map(d=>d.error).join(` `)} -${o} -${f}`)}return o}),N0=zSe(U7);class V7 extends L7{create(e,n){var i;const{api_version:r=this._client.apiVersion}=e,s=Lv(e,["api_version"]);if("model"in s&&"agent_config"in s)throw new ts("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in s&&"generation_config"in s)throw new ts("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(N0`/${r}/interactions`,Object.assign(Object.assign({body:s},n),{stream:(i=e.stream)!==null&&i!==void 0?i:!1}))}delete(e,n={},i){const{api_version:r=this._client.apiVersion}=n??{};return this._client.delete(N0`/${r}/interactions/${e}`,i)}cancel(e,n={},i){const{api_version:r=this._client.apiVersion}=n??{};return this._client.post(N0`/${r}/interactions/${e}/cancel`,i)}get(e,n={},i){var r;const s=n??{},{api_version:o=this._client.apiVersion}=s,a=Lv(s,["api_version"]);return this._client.get(N0`/${o}/interactions/${e}`,Object.assign(Object.assign({query:a},i),{stream:(r=n?.stream)!==null&&r!==void 0?r:!1}))}}V7._key=Object.freeze(["interactions"]);class F7 extends V7{}function QSe(t){let e=0;for(const r of t)e+=r.length;const n=new Uint8Array(e);let i=0;for(const r of t)n.set(r,i),i+=r.length;return n}let O0;function OR(t){let e;return(O0??(e=new globalThis.TextEncoder,O0=e.encode.bind(e)))(t)}let B0;function l4(t){let e;return(B0??(e=new globalThis.TextDecoder,B0=e.decode.bind(e)))(t)}class Aw{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(e){if(e==null)return[];const n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?OR(e):e;this.buffer=QSe([this.buffer,n]);const i=[];let r;for(;(r=GSe(this.buffer,this.carriageReturnIndex))!=null;){if(r.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=r.index;continue}if(this.carriageReturnIndex!=null&&(r.index!==this.carriageReturnIndex+1||r.carriage)){i.push(l4(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const s=this.carriageReturnIndex!==null?r.preceding-1:r.preceding,o=l4(this.buffer.subarray(0,s));i.push(o),this.buffer=this.buffer.subarray(r.index),this.carriageReturnIndex=null}return i}flush(){return this.buffer.length?this.decode(` -`):[]}}Aw.NEWLINE_CHARS=new Set([` -`,"\r"]);Aw.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function GSe(t,e){for(let r=e??0;r{if(t){if(xSe(Uv,t))return t;Ri(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Uv))}`)}};function wp(){}function L0(t,e,n){return!e||Uv[t]>Uv[n]?wp:e[t].bind(e)}const WSe={error:wp,warn:wp,info:wp,debug:wp};let u4=new WeakMap;function Ri(t){var e;const n=t.logger,i=(e=t.logLevel)!==null&&e!==void 0?e:"off";if(!n)return WSe;const r=u4.get(n);if(r&&r[0]===i)return r[1];const s={error:L0("error",n,i),warn:L0("warn",n,i),info:L0("info",n,i),debug:L0("debug",n,i)};return u4.set(n,[i,s]),s}const gc=t=>(t.options&&(t.options=Object.assign({},t.options),delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);class Ad{constructor(e,n,i){this.iterator=e,this.controller=n,this.client=i}static fromSSEResponse(e,n,i){let r=!1;const s=i?Ri(i):console;function o(){return xs(this,arguments,function*(){var l,u,d,f;if(r)throw new ts("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let g=!1;try{try{for(var m=!0,v=Es(jSe(e,n)),S;S=yield Ke(v.next()),l=S.done,!l;m=!0){f=S.value,m=!1;const C=f;if(!g)if(C.data.startsWith("[DONE]")){g=!0;continue}else try{yield yield Ke(JSON.parse(C.data))}catch(E){throw s.error("Could not parse message into JSON:",C.data),s.error("From chunk:",C.raw),E}}}catch(C){u={error:C}}finally{try{!m&&!l&&(d=v.return)&&(yield Ke(d.call(v)))}finally{if(u)throw u.error}}g=!0}catch(C){if(S_(C))return yield Ke(void 0);throw C}finally{g||n.abort()}})}return new Ad(o,n,i)}static fromReadableStream(e,n,i){let r=!1;function s(){return xs(this,arguments,function*(){var l,u,d,f;const g=new Aw,m=N7(e);try{for(var v=!0,S=Es(m),C;C=yield Ke(S.next()),l=C.done,!l;v=!0){f=C.value,v=!1;const E=f;for(const k of g.decode(E))yield yield Ke(k)}}catch(E){u={error:E}}finally{try{!v&&!l&&(d=S.return)&&(yield Ke(d.call(S)))}finally{if(u)throw u.error}}for(const E of g.flush())yield yield Ke(E)})}function o(){return xs(this,arguments,function*(){var l,u,d,f;if(r)throw new ts("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let g=!1;try{try{for(var m=!0,v=Es(s()),S;S=yield Ke(v.next()),l=S.done,!l;m=!0){f=S.value,m=!1;const C=f;g||C&&(yield yield Ke(JSON.parse(C)))}}catch(C){u={error:C}}finally{try{!m&&!l&&(d=v.return)&&(yield Ke(d.call(v)))}finally{if(u)throw u.error}}g=!0}catch(C){if(S_(C))return yield Ke(void 0);throw C}finally{g||n.abort()}})}return new Ad(o,n,i)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],n=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const o=i.next();e.push(o),n.push(o)}return s.shift()}});return[new Ad(()=>r(e),this.controller,this.client),new Ad(()=>r(n),this.controller,this.client)]}toReadableStream(){const e=this;let n;return P7({async start(){n=e[Symbol.asyncIterator]()},async pull(i){try{const{value:r,done:s}=await n.next();if(s)return i.close();const o=OR(JSON.stringify(r)+` -`);i.enqueue(o)}catch(r){i.error(r)}},async cancel(){var i;await((i=n.return)===null||i===void 0?void 0:i.call(n))}})}}function jSe(t,e){return xs(this,arguments,function*(){var i,r,s,o;if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ts("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ts("Attempted to iterate over a response with no body");const a=new YSe,l=new Aw,u=N7(t.body);try{for(var d=!0,f=Es(KSe(u)),g;g=yield Ke(f.next()),i=g.done,!i;d=!0){o=g.value,d=!1;const m=o;for(const v of l.decode(m)){const S=a.decode(v);S&&(yield yield Ke(S))}}}catch(m){r={error:m}}finally{try{!d&&!i&&(s=f.return)&&(yield Ke(s.call(f)))}finally{if(r)throw r.error}}for(const m of l.flush()){const v=a.decode(m);v&&(yield yield Ke(v))}})}function KSe(t){return xs(this,arguments,function*(){var n,i,r,s;let o=new Uint8Array;try{for(var a=!0,l=Es(t),u;u=yield Ke(l.next()),n=u.done,!n;a=!0){s=u.value,a=!1;const d=s;if(d==null)continue;const f=d instanceof ArrayBuffer?new Uint8Array(d):typeof d=="string"?OR(d):d;let g=new Uint8Array(o.length+f.length);g.set(o),g.set(f,o.length),o=g;let m;for(;(m=$Se(o))!==-1;)yield yield Ke(o.slice(0,m)),o=o.slice(m)}}catch(d){i={error:d}}finally{try{!a&&!n&&(r=l.return)&&(yield Ke(r.call(l)))}finally{if(i)throw i.error}}o.length>0&&(yield yield Ke(o))})}class YSe{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,i,r]=qSe(e,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}function qSe(t,e){const n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}async function JSe(t,e){const{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:s}=e,o=await(async()=>{var a;if(e.options.stream)return Ri(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t):Ad.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;const l=n.headers.get("content-type"),u=(a=l?.split(";")[0])===null||a===void 0?void 0:a.trim();return u?.includes("application/json")||u?.endsWith("+json")?await n.json():await n.text()})();return Ri(t).debug(`[${i}] response parsed`,gc({retryOfRequestLogID:r,url:n.url,status:n.status,body:o,durationMs:Date.now()-s})),o}class BR extends Promise{constructor(e,n,i=JSe){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,this.client=e}_thenUnwrap(e){return new BR(this.client,this.responsePromise,async(n,i)=>e(await this.parseResponse(n,i),i))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}const H7=Symbol("brand.privateNullableHeaders");function*XSe(t){if(!t)return;if(H7 in t){const{values:i,nulls:r}=t;yield*i.entries();for(const s of r)yield[s,null];return}let e=!1,n;t instanceof Headers?n=t.entries():r4(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let i of n){const r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const s=r4(i[1])?i[1]:[i[1]];let o=!1;for(const a of s)a!==void 0&&(e&&!o&&(o=!0,yield[r,null]),yield[r,a])}}const Wf=t=>{const e=new Headers,n=new Set;for(const i of t){const r=new Set;for(const[s,o]of XSe(i)){const a=s.toLowerCase();r.has(a)||(e.delete(s),r.add(a)),o===null?(e.delete(s),n.add(a)):(e.append(s,o),n.delete(a))}}return{[H7]:!0,values:e,nulls:n}};const iE=t=>{var e,n,i,r,s,o;if(typeof globalThis.process<"u")return(i=(n=(e=xAe)===null||e===void 0?void 0:e[t])===null||n===void 0?void 0:n.trim())!==null&&i!==void 0?i:void 0;if(typeof globalThis.Deno<"u")return(o=(s=(r=globalThis.Deno.env)===null||r===void 0?void 0:r.get)===null||s===void 0?void 0:s.call(r,t))===null||o===void 0?void 0:o.trim()};var z7;class yw{constructor(e){var n,i,r,s,o,a,l,{baseURL:u=iE("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(n=iE("GEMINI_API_KEY"))!==null&&n!==void 0?n:null,apiVersion:f="v1beta"}=e,g=Lv(e,["baseURL","apiKey","apiVersion"]);const m=Object.assign(Object.assign({apiKey:d,apiVersion:f},g),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(i=m.timeout)!==null&&i!==void 0?i:yw.DEFAULT_TIMEOUT,this.logger=(r=m.logger)!==null&&r!==void 0?r:console;const v="warn";this.logLevel=v,this.logLevel=(o=(s=c4(m.logLevel,"ClientOptions.logLevel",this))!==null&&s!==void 0?s:c4(iE("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&o!==void 0?o:v,this.fetchOptions=m.fetchOptions,this.maxRetries=(a=m.maxRetries)!==null&&a!==void 0?a:2,this.fetch=(l=m.fetch)!==null&&l!==void 0?l:DSe(),this.encoder=OSe,this._options=m,this.apiKey=d,this.apiVersion=f,this.clientAdapter=m.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!n.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){const n=Wf([e.headers]);if(!(n.values.has("authorization")||n.values.has("x-goog-api-key"))){if(this.apiKey)return Wf([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Wf([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([n,i])=>typeof i<"u").map(([n,i])=>{if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(i)}`;if(i===null)return`${encodeURIComponent(n)}=`;throw new ts(`Cannot stringify type ${typeof i}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${dd}`}defaultIdempotencyKey(){return`stainless-node-retry-${ySe()}`}makeStatusError(e,n,i,r){return Li.generate(e,n,i,r)}buildURL(e,n,i){const r=!this.baseURLOverridden()&&i||this.baseURL,s=bSe(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery();return CSe(o)||(n=Object.assign(Object.assign({},o),n)),typeof n=="object"&&n&&!Array.isArray(n)&&(s.search=this.stringifyQuery(n)),s.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){const n=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${n}`}}async prepareRequest(e,{url:n,options:i}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,i){return this.request(Promise.resolve(i).then(r=>Object.assign({method:e,path:n},r)))}request(e,n=null){return new BR(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,i){var r,s,o;const a=await e,l=(r=a.maxRetries)!==null&&r!==void 0?r:this.maxRetries;n==null&&(n=l),await this.prepareOptions(a);const{req:u,url:d,timeout:f}=await this.buildRequest(a,{retryCount:l-n});await this.prepareRequest(u,{url:d,options:a});const g="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=i===void 0?"":`, retryOf: ${i}`,v=Date.now();if(Ri(this).debug(`[${g}] sending request`,gc({retryOfRequestLogID:i,method:a.method,url:d,options:a,headers:u.headers})),!((s=a.signal)===null||s===void 0)&&s.aborted)throw new x_;const S=new AbortController,C=await this.fetchWithTimeout(d,u,f,S).catch(C_),E=Date.now();if(C instanceof globalThis.Error){const R=`retrying, ${n} attempts remaining`;if(!((o=a.signal)===null||o===void 0)&&o.aborted)throw new x_;const M=S_(C)||/timed? ?out/i.test(String(C)+("cause"in C?String(C.cause):""));if(n)return Ri(this).info(`[${g}] connection ${M?"timed out":"failed"} - ${R}`),Ri(this).debug(`[${g}] connection ${M?"timed out":"failed"} (${R})`,gc({retryOfRequestLogID:i,url:d,durationMs:E-v,message:C.message})),this.retryRequest(a,n,i??g);throw Ri(this).info(`[${g}] connection ${M?"timed out":"failed"} - error; no more retries left`),Ri(this).debug(`[${g}] connection ${M?"timed out":"failed"} (error; no more retries left)`,gc({retryOfRequestLogID:i,url:d,durationMs:E-v,message:C.message})),M?new x7:new mw({cause:C})}const k=`[${g}${m}] ${u.method} ${d} ${C.ok?"succeeded":"failed"} with status ${C.status} in ${E-v}ms`;if(!C.ok){const R=await this.shouldRetry(C);if(n&&R){const G=`retrying, ${n} attempts remaining`;return await NSe(C.body),Ri(this).info(`${k} - ${G}`),Ri(this).debug(`[${g}] response error (${G})`,gc({retryOfRequestLogID:i,url:C.url,status:C.status,headers:C.headers,durationMs:E-v})),this.retryRequest(a,n,i??g,C.headers)}const M=R?"error; no more retries left":"error; not retryable";Ri(this).info(`${k} - ${M}`);const D=await C.text().catch(G=>C_(G).message),P=_Se(D),N=P?void 0:D;throw Ri(this).debug(`[${g}] response error (${M})`,gc({retryOfRequestLogID:i,url:C.url,status:C.status,headers:C.headers,message:N,durationMs:Date.now()-v})),this.makeStatusError(C.status,P,N,C.headers)}return Ri(this).info(k),Ri(this).debug(`[${g}] response start`,gc({retryOfRequestLogID:i,url:C.url,status:C.status,headers:C.headers,durationMs:E-v})),{response:C,options:a,controller:S,requestLogID:g,retryOfRequestLogID:i,startTime:v}}async fetchWithTimeout(e,n,i,r){const s=n||{},{signal:o,method:a}=s,l=Lv(s,["signal","method"]);o&&o.addEventListener("abort",()=>r.abort());const u=setTimeout(()=>r.abort(),i),d=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,f=Object.assign(Object.assign(Object.assign({signal:r.signal},d?{duplex:"half"}:{}),{method:"GET"}),l);a&&(f.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,f)}finally{clearTimeout(u)}}async shouldRetry(e){const n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,i,r){var s;let o;const a=r?.get("retry-after-ms");if(a){const u=parseFloat(a);Number.isNaN(u)||(o=u)}const l=r?.get("retry-after");if(l&&!o){const u=parseFloat(l);Number.isNaN(u)?o=Date.parse(l)-Date.now():o=u*1e3}if(!(o&&0<=o&&o<60*1e3)){const u=(s=e.maxRetries)!==null&&s!==void 0?s:this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,u)}return await TSe(o),this.makeRequest(e,n-1,i)}calculateDefaultRetryTimeoutMillis(e,n){const s=n-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}async buildRequest(e,{retryCount:n=0}={}){var i,r,s;const o=Object.assign({},e),{method:a,path:l,query:u,defaultBaseURL:d}=o,f=this.buildURL(l,u,d);"timeout"in o&&ESe("timeout",o.timeout),o.timeout=(i=o.timeout)!==null&&i!==void 0?i:this.timeout;const{bodyHeaders:g,body:m}=this.buildBody({options:o}),v=await this.buildHeaders({options:e,method:a,bodyHeaders:g,retryCount:n});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:a,headers:v},o.signal&&{signal:o.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(r=this.fetchOptions)!==null&&r!==void 0?r:{}),(s=o.fetchOptions)!==null&&s!==void 0?s:{}),url:f,timeout:o.timeout}}async buildHeaders({options:e,method:n,bodyHeaders:i,retryCount:r}){let s={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);const o=await this.authHeaders(e);let a=Wf([s,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r)},e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{}),MSe()),this._options.defaultHeaders,i,e.headers,o]);return this.validateHeaders(a),a.values}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};const i=Wf([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&i.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:PSe(e)}:this.encoder({body:e,headers:i})}}yw.DEFAULT_TIMEOUT=6e4;class $n extends yw{constructor(){super(...arguments),this.interactions=new F7(this)}}z7=$n;$n.GeminiNextGenAPIClient=z7;$n.GeminiNextGenAPIClientError=ts;$n.APIError=Li;$n.APIConnectionError=mw;$n.APIConnectionTimeoutError=x7;$n.APIUserAbortError=x_;$n.NotFoundError=R7;$n.ConflictError=k7;$n.RateLimitError=M7;$n.BadRequestError=E7;$n.AuthenticationError=_7;$n.InternalServerError=D7;$n.PermissionDeniedError=T7;$n.UnprocessableEntityError=I7;$n.toFile=FSe;$n.Interactions=F7;function ZSe(t,e){const n={},i=y(t,["name"]);return i!=null&&b(n,["_url","name"],i),n}function eCe(t,e){const n={},i=y(t,["name"]);return i!=null&&b(n,["_url","name"],i),n}function tCe(t,e){const n={},i=y(t,["sdkHttpResponse"]);return i!=null&&b(n,["sdkHttpResponse"],i),n}function nCe(t,e){const n={},i=y(t,["sdkHttpResponse"]);return i!=null&&b(n,["sdkHttpResponse"],i),n}function iCe(t,e,n){const i={};if(y(t,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const r=y(t,["tunedModelDisplayName"]);if(e!==void 0&&r!=null&&b(e,["displayName"],r),y(t,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const s=y(t,["epochCount"]);e!==void 0&&s!=null&&b(e,["tuningTask","hyperparameters","epochCount"],s);const o=y(t,["learningRateMultiplier"]);if(o!=null&&b(i,["tuningTask","hyperparameters","learningRateMultiplier"],o),y(t,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(y(t,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(y(t,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const a=y(t,["batchSize"]);e!==void 0&&a!=null&&b(e,["tuningTask","hyperparameters","batchSize"],a);const l=y(t,["learningRate"]);if(e!==void 0&&l!=null&&b(e,["tuningTask","hyperparameters","learningRate"],l),y(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(y(t,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");return i}function rCe(t,e,n){const i={};let r=y(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const m=y(t,["validationDataset"]);e!==void 0&&m!=null&&b(e,["supervisedTuningSpec"],d4(m))}else if(r==="PREFERENCE_TUNING"){const m=y(t,["validationDataset"]);e!==void 0&&m!=null&&b(e,["preferenceOptimizationSpec"],d4(m))}const s=y(t,["tunedModelDisplayName"]);e!==void 0&&s!=null&&b(e,["tunedModelDisplayName"],s);const o=y(t,["description"]);e!==void 0&&o!=null&&b(e,["description"],o);let a=y(n,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){const m=y(t,["epochCount"]);e!==void 0&&m!=null&&b(e,["supervisedTuningSpec","hyperParameters","epochCount"],m)}else if(a==="PREFERENCE_TUNING"){const m=y(t,["epochCount"]);e!==void 0&&m!=null&&b(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],m)}let l=y(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){const m=y(t,["learningRateMultiplier"]);e!==void 0&&m!=null&&b(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],m)}else if(l==="PREFERENCE_TUNING"){const m=y(t,["learningRateMultiplier"]);e!==void 0&&m!=null&&b(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],m)}let u=y(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const m=y(t,["exportLastCheckpointOnly"]);e!==void 0&&m!=null&&b(e,["supervisedTuningSpec","exportLastCheckpointOnly"],m)}else if(u==="PREFERENCE_TUNING"){const m=y(t,["exportLastCheckpointOnly"]);e!==void 0&&m!=null&&b(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],m)}let d=y(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){const m=y(t,["adapterSize"]);e!==void 0&&m!=null&&b(e,["supervisedTuningSpec","hyperParameters","adapterSize"],m)}else if(d==="PREFERENCE_TUNING"){const m=y(t,["adapterSize"]);e!==void 0&&m!=null&&b(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],m)}if(y(t,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");if(y(t,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");const f=y(t,["labels"]);e!==void 0&&f!=null&&b(e,["labels"],f);const g=y(t,["beta"]);return e!==void 0&&g!=null&&b(e,["preferenceOptimizationSpec","hyperParameters","beta"],g),i}function sCe(t,e){const n={},i=y(t,["baseModel"]);i!=null&&b(n,["baseModel"],i);const r=y(t,["preTunedModel"]);r!=null&&b(n,["preTunedModel"],r);const s=y(t,["trainingDataset"]);s!=null&&mCe(s);const o=y(t,["config"]);return o!=null&&iCe(o,n),n}function oCe(t,e){const n={},i=y(t,["baseModel"]);i!=null&&b(n,["baseModel"],i);const r=y(t,["preTunedModel"]);r!=null&&b(n,["preTunedModel"],r);const s=y(t,["trainingDataset"]);s!=null&&ACe(s,n,e);const o=y(t,["config"]);return o!=null&&rCe(o,n,e),n}function aCe(t,e){const n={},i=y(t,["name"]);return i!=null&&b(n,["_url","name"],i),n}function lCe(t,e){const n={},i=y(t,["name"]);return i!=null&&b(n,["_url","name"],i),n}function cCe(t,e,n){const i={},r=y(t,["pageSize"]);e!==void 0&&r!=null&&b(e,["_query","pageSize"],r);const s=y(t,["pageToken"]);e!==void 0&&s!=null&&b(e,["_query","pageToken"],s);const o=y(t,["filter"]);return e!==void 0&&o!=null&&b(e,["_query","filter"],o),i}function uCe(t,e,n){const i={},r=y(t,["pageSize"]);e!==void 0&&r!=null&&b(e,["_query","pageSize"],r);const s=y(t,["pageToken"]);e!==void 0&&s!=null&&b(e,["_query","pageToken"],s);const o=y(t,["filter"]);return e!==void 0&&o!=null&&b(e,["_query","filter"],o),i}function dCe(t,e){const n={},i=y(t,["config"]);return i!=null&&cCe(i,n),n}function hCe(t,e){const n={},i=y(t,["config"]);return i!=null&&uCe(i,n),n}function fCe(t,e){const n={},i=y(t,["sdkHttpResponse"]);i!=null&&b(n,["sdkHttpResponse"],i);const r=y(t,["nextPageToken"]);r!=null&&b(n,["nextPageToken"],r);const s=y(t,["tunedModels"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>Q7(a))),b(n,["tuningJobs"],o)}return n}function pCe(t,e){const n={},i=y(t,["sdkHttpResponse"]);i!=null&&b(n,["sdkHttpResponse"],i);const r=y(t,["nextPageToken"]);r!=null&&b(n,["nextPageToken"],r);const s=y(t,["tuningJobs"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>T_(a))),b(n,["tuningJobs"],o)}return n}function gCe(t,e){const n={},i=y(t,["name"]);i!=null&&b(n,["model"],i);const r=y(t,["name"]);return r!=null&&b(n,["endpoint"],r),n}function mCe(t,e){const n={};if(y(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(y(t,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const i=y(t,["examples"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),b(n,["examples","examples"],r)}return n}function ACe(t,e,n){const i={};let r=y(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const o=y(t,["gcsUri"]);e!==void 0&&o!=null&&b(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(r==="PREFERENCE_TUNING"){const o=y(t,["gcsUri"]);e!==void 0&&o!=null&&b(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}let s=y(n,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const o=y(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&b(e,["supervisedTuningSpec","trainingDatasetUri"],o)}else if(s==="PREFERENCE_TUNING"){const o=y(t,["vertexDatasetResource"]);e!==void 0&&o!=null&&b(e,["preferenceOptimizationSpec","trainingDatasetUri"],o)}if(y(t,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return i}function Q7(t,e){const n={},i=y(t,["sdkHttpResponse"]);i!=null&&b(n,["sdkHttpResponse"],i);const r=y(t,["name"]);r!=null&&b(n,["name"],r);const s=y(t,["state"]);s!=null&&b(n,["state"],s7(s));const o=y(t,["createTime"]);o!=null&&b(n,["createTime"],o);const a=y(t,["tuningTask","startTime"]);a!=null&&b(n,["startTime"],a);const l=y(t,["tuningTask","completeTime"]);l!=null&&b(n,["endTime"],l);const u=y(t,["updateTime"]);u!=null&&b(n,["updateTime"],u);const d=y(t,["description"]);d!=null&&b(n,["description"],d);const f=y(t,["baseModel"]);f!=null&&b(n,["baseModel"],f);const g=y(t,["_self"]);return g!=null&&b(n,["tunedModel"],gCe(g)),n}function T_(t,e){const n={},i=y(t,["sdkHttpResponse"]);i!=null&&b(n,["sdkHttpResponse"],i);const r=y(t,["name"]);r!=null&&b(n,["name"],r);const s=y(t,["state"]);s!=null&&b(n,["state"],s7(s));const o=y(t,["createTime"]);o!=null&&b(n,["createTime"],o);const a=y(t,["startTime"]);a!=null&&b(n,["startTime"],a);const l=y(t,["endTime"]);l!=null&&b(n,["endTime"],l);const u=y(t,["updateTime"]);u!=null&&b(n,["updateTime"],u);const d=y(t,["error"]);d!=null&&b(n,["error"],d);const f=y(t,["description"]);f!=null&&b(n,["description"],f);const g=y(t,["baseModel"]);g!=null&&b(n,["baseModel"],g);const m=y(t,["tunedModel"]);m!=null&&b(n,["tunedModel"],m);const v=y(t,["preTunedModel"]);v!=null&&b(n,["preTunedModel"],v);const S=y(t,["supervisedTuningSpec"]);S!=null&&b(n,["supervisedTuningSpec"],S);const C=y(t,["preferenceOptimizationSpec"]);C!=null&&b(n,["preferenceOptimizationSpec"],C);const E=y(t,["tuningDataStats"]);E!=null&&b(n,["tuningDataStats"],E);const k=y(t,["encryptionSpec"]);k!=null&&b(n,["encryptionSpec"],k);const R=y(t,["partnerModelTuningSpec"]);R!=null&&b(n,["partnerModelTuningSpec"],R);const M=y(t,["customBaseModel"]);M!=null&&b(n,["customBaseModel"],M);const D=y(t,["experiment"]);D!=null&&b(n,["experiment"],D);const P=y(t,["labels"]);P!=null&&b(n,["labels"],P);const N=y(t,["outputUri"]);N!=null&&b(n,["outputUri"],N);const B=y(t,["pipelineJob"]);B!=null&&b(n,["pipelineJob"],B);const G=y(t,["serviceAccount"]);G!=null&&b(n,["serviceAccount"],G);const V=y(t,["tunedModelDisplayName"]);V!=null&&b(n,["tunedModelDisplayName"],V);const $=y(t,["veoTuningSpec"]);return $!=null&&b(n,["veoTuningSpec"],$),n}function yCe(t,e){const n={},i=y(t,["sdkHttpResponse"]);i!=null&&b(n,["sdkHttpResponse"],i);const r=y(t,["name"]);r!=null&&b(n,["name"],r);const s=y(t,["metadata"]);s!=null&&b(n,["metadata"],s);const o=y(t,["done"]);o!=null&&b(n,["done"],o);const a=y(t,["error"]);return a!=null&&b(n,["error"],a),n}function d4(t,e){const n={},i=y(t,["gcsUri"]);i!=null&&b(n,["validationDatasetUri"],i);const r=y(t,["vertexDatasetResource"]);return r!=null&&b(n,["validationDatasetUri"],r),n}class vCe extends Aa{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new jc(da.PAGED_ITEM_TUNING_JOBS,i=>this.listInternal(i),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var i;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){const r={tunedModelName:n.baseModel};!((i=n.config)===null||i===void 0)&&i.preTunedModelCheckpointId&&(r.checkpointId=n.config.preTunedModelCheckpointId);const s=Object.assign(Object.assign({},n),{preTunedModel:r});return s.baseModel=void 0,await this.tuneInternal(s)}else{const r=Object.assign({},n);return await this.tuneInternal(r)}else{const r=Object.assign({},n),s=await this.tuneMldevInternal(r);let o="";return s.metadata!==void 0&&s.metadata.tunedModel!==void 0?o=s.metadata.tunedModel:s.name!==void 0&&s.name.includes("/operations/")&&(o=s.name.split("/operations/")[0]),{name:o,state:g_.JOB_STATE_QUEUED}}}}async getInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=lCe(e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>T_(d))}else{const u=aCe(e);return a=Re("{name}",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>Q7(d))}}async listInternal(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=hCe(e);return a=Re("tuningJobs",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=pCe(d),g=new LL;return Object.assign(g,f),g})}else{const u=dCe(e);return a=Re("tunedModels",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=fCe(d),g=new LL;return Object.assign(g,f),g})}}async cancel(e){var n,i,r,s;let o,a="",l={};if(this.apiClient.isVertexAI()){const u=eCe(e);return a=Re("{name}:cancel",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=nCe(d),g=new UL;return Object.assign(g,f),g})}else{const u=ZSe(e);return a=Re("{name}:cancel",u._url),l=u._query,delete u._url,delete u._query,o=this.apiClient.request({path:a,queryParams:l,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(d=>d.json().then(f=>{const g=f;return g.sdkHttpResponse={headers:d.headers},g})),o.then(d=>{const f=tCe(d),g=new UL;return Object.assign(g,f),g})}}async tuneInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI()){const a=oCe(e,e);return s=Re("tuningJobs",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>T_(l))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(e){var n,i;let r,s="",o={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=sCe(e);return s=Re("tunedModels",a._url),o=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:s,queryParams:o,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:l.headers},d})),r.then(l=>yCe(l))}}}class bCe{async download(e,n){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an tag.")}}const wCe=1024*1024*8,SCe=3,CCe=1e3,xCe=2,Vv="x-goog-upload-status";async function ECe(t,e,n){var i;const r=await G7(t,e,n),s=await r?.json();if(((i=r?.headers)===null||i===void 0?void 0:i[Vv])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return s.file}async function _Ce(t,e,n){var i;const r=await G7(t,e,n),s=await r?.json();if(((i=r?.headers)===null||i===void 0?void 0:i[Vv])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const o=ZH(s),a=new kR;return Object.assign(a,o),a}async function G7(t,e,n){var i,r;let s=0,o=0,a=new m_(new Response),l="upload";for(s=t.size;o=s&&(l+=", finalize");let f=0,g=CCe;for(;fsetTimeout(e,t))}class kCe{async upload(e,n,i){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await ECe(e,n,i)}async uploadToFileSearchStore(e,n,i){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await _Ce(e,n,i)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await TCe(e)}}class ICe{create(e,n,i){return new MCe(e,n,i)}}class MCe{constructor(e,n,i){this.url=e,this.headers=n,this.callbacks=i}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}const h4="x-goog-api-key";class DCe{constructor(e){this.apiKey=e}async addAuthHeaders(e,n){if(e.get(h4)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(h4,this.apiKey)}}}const PCe="gl-node/";class rE{get interactions(){if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const e=this.httpOptions;e?.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const n=new $n({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:e?.timeout});return this._interactions=n.interactions,this._interactions}constructor(e){var n;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(n=e.vertexai)!==null&&n!==void 0?n:!1,this.apiKey=e.apiKey;const i=RAe(e.httpOptions,e.vertexai,void 0,void 0);i&&(e.httpOptions?e.httpOptions.baseUrl=i:e.httpOptions={baseUrl:i}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;const r=new DCe(this.apiKey);this.apiClient=new Twe({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:PCe+"web",uploader:new kCe,downloader:new bCe}),this.models=new Wwe(this.apiClient),this.live=new Fwe(this.apiClient,r,new ICe),this.batches=new iye(this.apiClient),this.chats=new Uye(this.models,this.apiClient),this.caches=new Oye(this.apiClient),this.files=new Kye(this.apiClient),this.operations=new jwe(this.apiClient),this.authTokens=new cSe(this.apiClient),this.tunings=new vCe(this.apiClient),this.fileSearchStores=new ASe(this.apiClient)}}const NCe=(t,e)=>{if(!e)return t;const n=t.content;if(typeof n=="string")return t;const i=[...n],r=i[i.length-1];return r?.type==="reasoning"?i[i.length-1]={...r,text:r.text+e}:i.push({type:"reasoning",text:e}),{...t,content:i}},OCe=(t,e)=>{if(!e)return t;const n=t.content;if(typeof n=="string")return t;const i=[...n],r=i[i.length-1];return r?.type==="text"?i[i.length-1]={...r,text:r.text+e}:i.push({type:"text",text:e}),{...t,content:i}},BCe=(t,e)=>{const n=t.content;if(typeof n=="string")return t;const i=[...n],r={type:"tool-call",toolCallId:`${e.name}_${Date.now()}`,toolName:e.name,args:e.args,argsText:JSON.stringify(e.args),...e.thoughtSignature&&{metadata:{thoughtSignature:e.thoughtSignature}}};return i.push(r),{...t,content:i}},LCe=(t,e)=>{let n=t;const i=e.candidates?.[0];if(!i?.content?.parts)return n;for(const r of i.content.parts)r.thought&&(n=NCe(n,r.text??"")),r.text&&(n=OCe(n,r.text)),r.functionCall&&(n=BCe(n,{name:r.functionCall.name??"",args:r.functionCall.args??{},thoughtSignature:r.thoughtSignature}));return n},U0={name:"Google AI",baseUrl:"https://generativelanguage.googleapis.com",modelFilters:["gemini-3-pro-preview","gemini-3-flash-preview"],modelNames:{"gemini-3-pro-preview":"Gemini 3 Pro","gemini-3-flash-preview":"Gemini 3 Flash"}},UCe=t=>{const e=t.includes("\\")?"\\":"/";return t.split(e).pop()??t},VCe=t=>t.map(e=>({name:e.name,description:e.description,parameters:{type:"OBJECT",...e.inputSchema}})),FCe=t=>{const e=t.match(/^data:([^;]+);base64,(.+)$/);return e?{mimeType:e[1],data:e[2]}:null},HCe=t=>{if(typeof t.content=="string")return[{text:t.content}];const e=[];for(const n of t.content){if(n.type==="text"){e.push({text:n.text});continue}if(n.type==="image"){const i=FCe(n.image);i&&e.push({inlineData:{mimeType:i.mimeType,data:i.data}});continue}if(n.type==="file"){const i=JSON.parse(n.mimeType),r=UCe(i.path);e.push({text:`File: ${r} +${s} +${l}`)}return s}),uT=rUe(sie);class aie extends iie{create(t,n){var o;const{api_version:r=this._client.apiVersion}=t,i=AE(t,["api_version"]);if("model"in i&&"agent_config"in i)throw new $i("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new $i("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(uT`/${r}/interactions`,Object.assign(Object.assign({body:i},n),{stream:(o=t.stream)!==null&&o!==void 0?o:!1}))}delete(t,n={},o){const{api_version:r=this._client.apiVersion}=n??{};return this._client.delete(uT`/${r}/interactions/${t}`,o)}cancel(t,n={},o){const{api_version:r=this._client.apiVersion}=n??{};return this._client.post(uT`/${r}/interactions/${t}/cancel`,o)}get(t,n={},o){var r;const i=n??{},{api_version:s=this._client.apiVersion}=i,a=AE(i,["api_version"]);return this._client.get(uT`/${s}/interactions/${t}`,Object.assign(Object.assign({query:a},o),{stream:(r=n?.stream)!==null&&r!==void 0?r:!1}))}}aie._key=Object.freeze(["interactions"]);class lie extends aie{}function oUe(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let o=0;for(const r of e)n.set(r,o),o+=r.length;return n}let cT;function Dx(e){let t;return(cT??(t=new globalThis.TextEncoder,cT=t.encode.bind(t)))(e)}let dT;function k6(e){let t;return(dT??(t=new globalThis.TextDecoder,dT=t.decode.bind(t)))(e)}class rP{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Dx(t):t;this.buffer=oUe([this.buffer,n]);const o=[];let r;for(;(r=iUe(this.buffer,this.carriageReturnIndex))!=null;){if(r.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=r.index;continue}if(this.carriageReturnIndex!=null&&(r.index!==this.carriageReturnIndex+1||r.carriage)){o.push(k6(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const i=this.carriageReturnIndex!==null?r.preceding-1:r.preceding,s=k6(this.buffer.subarray(0,i));o.push(s),this.buffer=this.buffer.subarray(r.index),this.carriageReturnIndex=null}return o}flush(){return this.buffer.length?this.decode(` +`):[]}}rP.NEWLINE_CHARS=new Set([` +`,"\r"]);rP.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function iUe(e,t){for(let r=t??0;r{if(e){if(kke(_E,e))return e;mo(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(_E))}`)}};function XS(){}function fT(e,t,n){return!t||_E[e]>_E[n]?XS:t[e].bind(t)}const aUe={error:XS,warn:XS,info:XS,debug:XS};let q6=new WeakMap;function mo(e){var t;const n=e.logger,o=(t=e.logLevel)!==null&&t!==void 0?t:"off";if(!n)return aUe;const r=q6.get(n);if(r&&r[0]===o)return r[1];const i={error:fT("error",n,o),warn:fT("warn",n,o),info:fT("info",n,o),debug:fT("debug",n,o)};return q6.set(n,[o,i]),i}const vg=e=>(e.options&&(e.options=Object.assign({},e.options),delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);class By{constructor(t,n,o){this.iterator=t,this.controller=n,this.client=o}static fromSSEResponse(t,n,o){let r=!1;const i=o?mo(o):console;function s(){return vs(this,arguments,function*(){var c,p,u,l;if(r)throw new $i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let d=!1;try{try{for(var f=!0,h=Ss(lUe(t,n)),m;m=yield _t(h.next()),c=m.done,!c;f=!0){l=m.value,f=!1;const g=l;if(!d)if(g.data.startsWith("[DONE]")){d=!0;continue}else try{yield yield _t(JSON.parse(g.data))}catch(y){throw i.error("Could not parse message into JSON:",g.data),i.error("From chunk:",g.raw),y}}}catch(g){p={error:g}}finally{try{!f&&!c&&(u=h.return)&&(yield _t(u.call(h)))}finally{if(p)throw p.error}}d=!0}catch(g){if(C1(g))return yield _t(void 0);throw g}finally{d||n.abort()}})}return new By(s,n,o)}static fromReadableStream(t,n,o){let r=!1;function i(){return vs(this,arguments,function*(){var c,p,u,l;const d=new rP,f=nie(t);try{for(var h=!0,m=Ss(f),g;g=yield _t(m.next()),c=g.done,!c;h=!0){l=g.value,h=!1;const y=l;for(const _ of d.decode(y))yield yield _t(_)}}catch(y){p={error:y}}finally{try{!h&&!c&&(u=m.return)&&(yield _t(u.call(m)))}finally{if(p)throw p.error}}for(const y of d.flush())yield yield _t(y)})}function s(){return vs(this,arguments,function*(){var c,p,u,l;if(r)throw new $i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let d=!1;try{try{for(var f=!0,h=Ss(i()),m;m=yield _t(h.next()),c=m.done,!c;f=!0){l=m.value,f=!1;const g=l;d||g&&(yield yield _t(JSON.parse(g)))}}catch(g){p={error:g}}finally{try{!f&&!c&&(u=h.return)&&(yield _t(u.call(h)))}finally{if(p)throw p.error}}d=!0}catch(g){if(C1(g))return yield _t(void 0);throw g}finally{d||n.abort()}})}return new By(s,n,o)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],n=[],o=this.iterator(),r=i=>({next:()=>{if(i.length===0){const s=o.next();t.push(s),n.push(s)}return i.shift()}});return[new By(()=>r(t),this.controller,this.client),new By(()=>r(n),this.controller,this.client)]}toReadableStream(){const t=this;let n;return tie({async start(){n=t[Symbol.asyncIterator]()},async pull(o){try{const{value:r,done:i}=await n.next();if(i)return o.close();const s=Dx(JSON.stringify(r)+` +`);o.enqueue(s)}catch(r){o.error(r)}},async cancel(){var o;await((o=n.return)===null||o===void 0?void 0:o.call(n))}})}}function lUe(e,t){return vs(this,arguments,function*(){var o,r,i,s;if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new $i("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new $i("Attempted to iterate over a response with no body");const a=new cUe,c=new rP,p=nie(e.body);try{for(var u=!0,l=Ss(uUe(p)),d;d=yield _t(l.next()),o=d.done,!o;u=!0){s=d.value,u=!1;const f=s;for(const h of c.decode(f)){const m=a.decode(h);m&&(yield yield _t(m))}}}catch(f){r={error:f}}finally{try{!u&&!o&&(i=l.return)&&(yield _t(i.call(l)))}finally{if(r)throw r.error}}for(const f of c.flush()){const h=a.decode(f);h&&(yield yield _t(h))}})}function uUe(e){return vs(this,arguments,function*(){var n,o,r,i;let s=new Uint8Array;try{for(var a=!0,c=Ss(e),p;p=yield _t(c.next()),n=p.done,!n;a=!0){i=p.value,a=!1;const u=i;if(u==null)continue;const l=u instanceof ArrayBuffer?new Uint8Array(u):typeof u=="string"?Dx(u):u;let d=new Uint8Array(s.length+l.length);d.set(s),d.set(l,s.length),s=d;let f;for(;(f=sUe(s))!==-1;)yield yield _t(s.slice(0,f)),s=s.slice(f)}}catch(u){o={error:u}}finally{try{!a&&!n&&(r=c.return)&&(yield _t(r.call(c)))}finally{if(o)throw o.error}}s.length>0&&(yield yield _t(s))})}class cUe{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const i={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,o,r]=dUe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}function dUe(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function fUe(e,t){const{response:n,requestLogID:o,retryOfRequestLogID:r,startTime:i}=t,s=await(async()=>{var a;if(t.options.stream)return mo(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e):By.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const c=n.headers.get("content-type"),p=(a=c?.split(";")[0])===null||a===void 0?void 0:a.trim();return p?.includes("application/json")||p?.endsWith("+json")?await n.json():await n.text()})();return mo(e).debug(`[${o}] response parsed`,vg({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-i})),s}class Nx extends Promise{constructor(t,n,o=fUe){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=o,this.client=t}_thenUnwrap(t){return new Nx(this.client,this.responsePromise,async(n,o)=>t(await this.parseResponse(n,o),o))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(this.client,t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}const uie=Symbol("brand.privateNullableHeaders");function*hUe(e){if(!e)return;if(uie in e){const{values:o,nulls:r}=e;yield*o.entries();for(const i of r)yield[i,null];return}let t=!1,n;e instanceof Headers?n=e.entries():L6(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let o of n){const r=o[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const i=L6(o[1])?o[1]:[o[1]];let s=!1;for(const a of i)a!==void 0&&(t&&!s&&(s=!0,yield[r,null]),yield[r,a])}}const pv=e=>{const t=new Headers,n=new Set;for(const o of e){const r=new Set;for(const[i,s]of hUe(o)){const a=i.toLowerCase();r.has(a)||(t.delete(i),r.add(a)),s===null?(t.delete(i),n.add(a)):(t.append(i,s),n.delete(a))}}return{[uie]:!0,values:t,nulls:n}};const QD=e=>{var t,n,o,r,i,s;if(typeof globalThis.process<"u")return(o=(n=(t=k2e)===null||t===void 0?void 0:t[e])===null||n===void 0?void 0:n.trim())!==null&&o!==void 0?o:void 0;if(typeof globalThis.Deno<"u")return(s=(i=(r=globalThis.Deno.env)===null||r===void 0?void 0:r.get)===null||i===void 0?void 0:i.call(r,e))===null||s===void 0?void 0:s.trim()};var cie;class oP{constructor(t){var n,o,r,i,s,a,c,{baseURL:p=QD("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:u=(n=QD("GEMINI_API_KEY"))!==null&&n!==void 0?n:null,apiVersion:l="v1beta"}=t,d=AE(t,["baseURL","apiKey","apiVersion"]);const f=Object.assign(Object.assign({apiKey:u,apiVersion:l},d),{baseURL:p||"https://generativelanguage.googleapis.com"});this.baseURL=f.baseURL,this.timeout=(o=f.timeout)!==null&&o!==void 0?o:oP.DEFAULT_TIMEOUT,this.logger=(r=f.logger)!==null&&r!==void 0?r:console;const h="warn";this.logLevel=h,this.logLevel=(s=(i=U6(f.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:U6(QD("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&s!==void 0?s:h,this.fetchOptions=f.fetchOptions,this.maxRetries=(a=f.maxRetries)!==null&&a!==void 0?a:2,this.fetch=(c=f.fetch)!==null&&c!==void 0?c:Kke(),this.encoder=Wke,this._options=f,this.apiKey=u,this.apiVersion=l,this.clientAdapter=f.clientAdapter}withOptions(t){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),t))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.has("authorization")||t.has("x-goog-api-key"))&&!(this.apiKey&&t.get("x-goog-api-key"))&&!n.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(t){const n=pv([t.headers]);if(!(n.values.has("authorization")||n.values.has("x-goog-api-key"))){if(this.apiKey)return pv([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return pv([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return Object.entries(t).filter(([n,o])=>typeof o<"u").map(([n,o])=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(o)}`;if(o===null)return`${encodeURIComponent(n)}=`;throw new $i(`Cannot stringify type ${typeof o}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${jy}`}defaultIdempotencyKey(){return`stainless-node-retry-${Dke()}`}makeStatusError(t,n,o,r){return wo.generate(t,n,o,r)}buildURL(t,n,o){const r=!this.baseURLOverridden()&&o||this.baseURL,i=Lke(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery();return Bke(s)||(n=Object.assign(Object.assign({},s),n)),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}async prepareOptions(t){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!t.path.startsWith(`/${this.apiVersion}/projects/`)){const n=t.path.slice(this.apiVersion.length+1);t.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${n}`}}async prepareRequest(t,{url:n,options:o}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,o){return this.request(Promise.resolve(o).then(r=>Object.assign({method:t,path:n},r)))}request(t,n=null){return new Nx(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,o){var r,i,s;const a=await t,c=(r=a.maxRetries)!==null&&r!==void 0?r:this.maxRetries;n==null&&(n=c),await this.prepareOptions(a);const{req:p,url:u,timeout:l}=await this.buildRequest(a,{retryCount:c-n});await this.prepareRequest(p,{url:u,options:a});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=o===void 0?"":`, retryOf: ${o}`,h=Date.now();if(mo(this).debug(`[${d}] sending request`,vg({retryOfRequestLogID:o,method:a.method,url:u,options:a,headers:p.headers})),!((i=a.signal)===null||i===void 0)&&i.aborted)throw new O1;const m=new AbortController,g=await this.fetchWithTimeout(u,p,l,m).catch(w1),y=Date.now();if(g instanceof globalThis.Error){const S=`retrying, ${n} attempts remaining`;if(!((s=a.signal)===null||s===void 0)&&s.aborted)throw new O1;const w=C1(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(n)return mo(this).info(`[${d}] connection ${w?"timed out":"failed"} - ${S}`),mo(this).debug(`[${d}] connection ${w?"timed out":"failed"} (${S})`,vg({retryOfRequestLogID:o,url:u,durationMs:y-h,message:g.message})),this.retryRequest(a,n,o??d);throw mo(this).info(`[${d}] connection ${w?"timed out":"failed"} - error; no more retries left`),mo(this).debug(`[${d}] connection ${w?"timed out":"failed"} (error; no more retries left)`,vg({retryOfRequestLogID:o,url:u,durationMs:y-h,message:g.message})),w?new zoe:new nP({cause:g})}const _=`[${d}${f}] ${p.method} ${u} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${y-h}ms`;if(!g.ok){const S=await this.shouldRetry(g);if(n&&S){const B=`retrying, ${n} attempts remaining`;return await $ke(g.body),mo(this).info(`${_} - ${B}`),mo(this).debug(`[${d}] response error (${B})`,vg({retryOfRequestLogID:o,url:g.url,status:g.status,headers:g.headers,durationMs:y-h})),this.retryRequest(a,n,o??d,g.headers)}const w=S?"error; no more retries left":"error; not retryable";mo(this).info(`${_} - ${w}`);const R=await g.text().catch(B=>w1(B).message),E=qke(R),T=E?void 0:R;throw mo(this).debug(`[${d}] response error (${w})`,vg({retryOfRequestLogID:o,url:g.url,status:g.status,headers:g.headers,message:T,durationMs:Date.now()-h})),this.makeStatusError(g.status,E,T,g.headers)}return mo(this).info(_),mo(this).debug(`[${d}] response start`,vg({retryOfRequestLogID:o,url:g.url,status:g.status,headers:g.headers,durationMs:y-h})),{response:g,options:a,controller:m,requestLogID:d,retryOfRequestLogID:o,startTime:h}}async fetchWithTimeout(t,n,o,r){const i=n||{},{signal:s,method:a}=i,c=AE(i,["signal","method"]);s&&s.addEventListener("abort",()=>r.abort());const p=setTimeout(()=>r.abort(),o),u=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body=="object"&&c.body!==null&&Symbol.asyncIterator in c.body,l=Object.assign(Object.assign(Object.assign({signal:r.signal},u?{duplex:"half"}:{}),{method:"GET"}),c);a&&(l.method=a.toUpperCase());try{return await this.fetch.call(void 0,t,l)}finally{clearTimeout(p)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,o,r){var i;let s;const a=r?.get("retry-after-ms");if(a){const p=parseFloat(a);Number.isNaN(p)||(s=p)}const c=r?.get("retry-after");if(c&&!s){const p=parseFloat(c);Number.isNaN(p)?s=Date.parse(c)-Date.now():s=p*1e3}if(!(s&&0<=s&&s<60*1e3)){const p=(i=t.maxRetries)!==null&&i!==void 0?i:this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,p)}return await Jke(s),this.makeRequest(t,n-1,o)}calculateDefaultRetryTimeoutMillis(t,n){const i=n-t,s=Math.min(.5*Math.pow(2,i),8),a=1-Math.random()*.25;return s*a*1e3}async buildRequest(t,{retryCount:n=0}={}){var o,r,i;const s=Object.assign({},t),{method:a,path:c,query:p,defaultBaseURL:u}=s,l=this.buildURL(c,p,u);"timeout"in s&&Uke("timeout",s.timeout),s.timeout=(o=s.timeout)!==null&&o!==void 0?o:this.timeout;const{bodyHeaders:d,body:f}=this.buildBody({options:s}),h=await this.buildHeaders({options:t,method:a,bodyHeaders:d,retryCount:n});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:a,headers:h},s.signal&&{signal:s.signal}),globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"}),f&&{body:f}),(r=this.fetchOptions)!==null&&r!==void 0?r:{}),(i=s.fetchOptions)!==null&&i!==void 0?i:{}),url:l,timeout:s.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:o,retryCount:r}){let i={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const s=await this.authHeaders(t);let a=pv([i,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r)},t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{}),zke()),this._options.defaultHeaders,o,t.headers,s]);return this.validateHeaders(a),a.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const o=pv([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&o.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:Qke(t)}:this.encoder({body:t,headers:o})}}oP.DEFAULT_TIMEOUT=6e4;class Mr extends oP{constructor(){super(...arguments),this.interactions=new lie(this)}}cie=Mr;Mr.GeminiNextGenAPIClient=cie;Mr.GeminiNextGenAPIClientError=$i;Mr.APIError=wo;Mr.APIConnectionError=nP;Mr.APIConnectionTimeoutError=zoe;Mr.APIUserAbortError=O1;Mr.NotFoundError=Woe;Mr.ConflictError=Yoe;Mr.RateLimitError=Zoe;Mr.BadRequestError=Koe;Mr.AuthenticationError=Qoe;Mr.InternalServerError=eie;Mr.PermissionDeniedError=$oe;Mr.UnprocessableEntityError=Xoe;Mr.toFile=tUe;Mr.Interactions=lie;function pUe(e,t){const n={},o=O(e,["name"]);return o!=null&&M(n,["_url","name"],o),n}function mUe(e,t){const n={},o=O(e,["name"]);return o!=null&&M(n,["_url","name"],o),n}function gUe(e,t){const n={},o=O(e,["sdkHttpResponse"]);return o!=null&&M(n,["sdkHttpResponse"],o),n}function bUe(e,t){const n={},o=O(e,["sdkHttpResponse"]);return o!=null&&M(n,["sdkHttpResponse"],o),n}function yUe(e,t,n){const o={};if(O(e,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const r=O(e,["tunedModelDisplayName"]);if(t!==void 0&&r!=null&&M(t,["displayName"],r),O(e,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const i=O(e,["epochCount"]);t!==void 0&&i!=null&&M(t,["tuningTask","hyperparameters","epochCount"],i);const s=O(e,["learningRateMultiplier"]);if(s!=null&&M(o,["tuningTask","hyperparameters","learningRateMultiplier"],s),O(e,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(O(e,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(O(e,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const a=O(e,["batchSize"]);t!==void 0&&a!=null&&M(t,["tuningTask","hyperparameters","batchSize"],a);const c=O(e,["learningRate"]);if(t!==void 0&&c!=null&&M(t,["tuningTask","hyperparameters","learningRate"],c),O(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(O(e,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");return o}function AUe(e,t,n){const o={};let r=O(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const f=O(e,["validationDataset"]);t!==void 0&&f!=null&&M(t,["supervisedTuningSpec"],J6(f))}else if(r==="PREFERENCE_TUNING"){const f=O(e,["validationDataset"]);t!==void 0&&f!=null&&M(t,["preferenceOptimizationSpec"],J6(f))}const i=O(e,["tunedModelDisplayName"]);t!==void 0&&i!=null&&M(t,["tunedModelDisplayName"],i);const s=O(e,["description"]);t!==void 0&&s!=null&&M(t,["description"],s);let a=O(n,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){const f=O(e,["epochCount"]);t!==void 0&&f!=null&&M(t,["supervisedTuningSpec","hyperParameters","epochCount"],f)}else if(a==="PREFERENCE_TUNING"){const f=O(e,["epochCount"]);t!==void 0&&f!=null&&M(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],f)}let c=O(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){const f=O(e,["learningRateMultiplier"]);t!==void 0&&f!=null&&M(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],f)}else if(c==="PREFERENCE_TUNING"){const f=O(e,["learningRateMultiplier"]);t!==void 0&&f!=null&&M(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],f)}let p=O(n,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){const f=O(e,["exportLastCheckpointOnly"]);t!==void 0&&f!=null&&M(t,["supervisedTuningSpec","exportLastCheckpointOnly"],f)}else if(p==="PREFERENCE_TUNING"){const f=O(e,["exportLastCheckpointOnly"]);t!==void 0&&f!=null&&M(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],f)}let u=O(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const f=O(e,["adapterSize"]);t!==void 0&&f!=null&&M(t,["supervisedTuningSpec","hyperParameters","adapterSize"],f)}else if(u==="PREFERENCE_TUNING"){const f=O(e,["adapterSize"]);t!==void 0&&f!=null&&M(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],f)}if(O(e,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");if(O(e,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");const l=O(e,["labels"]);t!==void 0&&l!=null&&M(t,["labels"],l);const d=O(e,["beta"]);return t!==void 0&&d!=null&&M(t,["preferenceOptimizationSpec","hyperParameters","beta"],d),o}function _Ue(e,t){const n={},o=O(e,["baseModel"]);o!=null&&M(n,["baseModel"],o);const r=O(e,["preTunedModel"]);r!=null&&M(n,["preTunedModel"],r);const i=O(e,["trainingDataset"]);i!=null&&IUe(i);const s=O(e,["config"]);return s!=null&&yUe(s,n),n}function vUe(e,t){const n={},o=O(e,["baseModel"]);o!=null&&M(n,["baseModel"],o);const r=O(e,["preTunedModel"]);r!=null&&M(n,["preTunedModel"],r);const i=O(e,["trainingDataset"]);i!=null&&jUe(i,n,t);const s=O(e,["config"]);return s!=null&&AUe(s,n,t),n}function SUe(e,t){const n={},o=O(e,["name"]);return o!=null&&M(n,["_url","name"],o),n}function CUe(e,t){const n={},o=O(e,["name"]);return o!=null&&M(n,["_url","name"],o),n}function wUe(e,t,n){const o={},r=O(e,["pageSize"]);t!==void 0&&r!=null&&M(t,["_query","pageSize"],r);const i=O(e,["pageToken"]);t!==void 0&&i!=null&&M(t,["_query","pageToken"],i);const s=O(e,["filter"]);return t!==void 0&&s!=null&&M(t,["_query","filter"],s),o}function OUe(e,t,n){const o={},r=O(e,["pageSize"]);t!==void 0&&r!=null&&M(t,["_query","pageSize"],r);const i=O(e,["pageToken"]);t!==void 0&&i!=null&&M(t,["_query","pageToken"],i);const s=O(e,["filter"]);return t!==void 0&&s!=null&&M(t,["_query","filter"],s),o}function TUe(e,t){const n={},o=O(e,["config"]);return o!=null&&wUe(o,n),n}function RUe(e,t){const n={},o=O(e,["config"]);return o!=null&&OUe(o,n),n}function EUe(e,t){const n={},o=O(e,["sdkHttpResponse"]);o!=null&&M(n,["sdkHttpResponse"],o);const r=O(e,["nextPageToken"]);r!=null&&M(n,["nextPageToken"],r);const i=O(e,["tunedModels"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>die(a))),M(n,["tuningJobs"],s)}return n}function MUe(e,t){const n={},o=O(e,["sdkHttpResponse"]);o!=null&&M(n,["sdkHttpResponse"],o);const r=O(e,["nextPageToken"]);r!=null&&M(n,["nextPageToken"],r);const i=O(e,["tuningJobs"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>E1(a))),M(n,["tuningJobs"],s)}return n}function PUe(e,t){const n={},o=O(e,["name"]);o!=null&&M(n,["model"],o);const r=O(e,["name"]);return r!=null&&M(n,["endpoint"],r),n}function IUe(e,t){const n={};if(O(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(O(e,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const o=O(e,["examples"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),M(n,["examples","examples"],r)}return n}function jUe(e,t,n){const o={};let r=O(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const s=O(e,["gcsUri"]);t!==void 0&&s!=null&&M(t,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(r==="PREFERENCE_TUNING"){const s=O(e,["gcsUri"]);t!==void 0&&s!=null&&M(t,["preferenceOptimizationSpec","trainingDatasetUri"],s)}let i=O(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){const s=O(e,["vertexDatasetResource"]);t!==void 0&&s!=null&&M(t,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(i==="PREFERENCE_TUNING"){const s=O(e,["vertexDatasetResource"]);t!==void 0&&s!=null&&M(t,["preferenceOptimizationSpec","trainingDatasetUri"],s)}if(O(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return o}function die(e,t){const n={},o=O(e,["sdkHttpResponse"]);o!=null&&M(n,["sdkHttpResponse"],o);const r=O(e,["name"]);r!=null&&M(n,["name"],r);const i=O(e,["state"]);i!=null&&M(n,["state"],Roe(i));const s=O(e,["createTime"]);s!=null&&M(n,["createTime"],s);const a=O(e,["tuningTask","startTime"]);a!=null&&M(n,["startTime"],a);const c=O(e,["tuningTask","completeTime"]);c!=null&&M(n,["endTime"],c);const p=O(e,["updateTime"]);p!=null&&M(n,["updateTime"],p);const u=O(e,["description"]);u!=null&&M(n,["description"],u);const l=O(e,["baseModel"]);l!=null&&M(n,["baseModel"],l);const d=O(e,["_self"]);return d!=null&&M(n,["tunedModel"],PUe(d)),n}function E1(e,t){const n={},o=O(e,["sdkHttpResponse"]);o!=null&&M(n,["sdkHttpResponse"],o);const r=O(e,["name"]);r!=null&&M(n,["name"],r);const i=O(e,["state"]);i!=null&&M(n,["state"],Roe(i));const s=O(e,["createTime"]);s!=null&&M(n,["createTime"],s);const a=O(e,["startTime"]);a!=null&&M(n,["startTime"],a);const c=O(e,["endTime"]);c!=null&&M(n,["endTime"],c);const p=O(e,["updateTime"]);p!=null&&M(n,["updateTime"],p);const u=O(e,["error"]);u!=null&&M(n,["error"],u);const l=O(e,["description"]);l!=null&&M(n,["description"],l);const d=O(e,["baseModel"]);d!=null&&M(n,["baseModel"],d);const f=O(e,["tunedModel"]);f!=null&&M(n,["tunedModel"],f);const h=O(e,["preTunedModel"]);h!=null&&M(n,["preTunedModel"],h);const m=O(e,["supervisedTuningSpec"]);m!=null&&M(n,["supervisedTuningSpec"],m);const g=O(e,["preferenceOptimizationSpec"]);g!=null&&M(n,["preferenceOptimizationSpec"],g);const y=O(e,["tuningDataStats"]);y!=null&&M(n,["tuningDataStats"],y);const _=O(e,["encryptionSpec"]);_!=null&&M(n,["encryptionSpec"],_);const S=O(e,["partnerModelTuningSpec"]);S!=null&&M(n,["partnerModelTuningSpec"],S);const w=O(e,["customBaseModel"]);w!=null&&M(n,["customBaseModel"],w);const R=O(e,["experiment"]);R!=null&&M(n,["experiment"],R);const E=O(e,["labels"]);E!=null&&M(n,["labels"],E);const T=O(e,["outputUri"]);T!=null&&M(n,["outputUri"],T);const D=O(e,["pipelineJob"]);D!=null&&M(n,["pipelineJob"],D);const B=O(e,["serviceAccount"]);B!=null&&M(n,["serviceAccount"],B);const N=O(e,["tunedModelDisplayName"]);N!=null&&M(n,["tunedModelDisplayName"],N);const L=O(e,["veoTuningSpec"]);return L!=null&&M(n,["veoTuningSpec"],L),n}function DUe(e,t){const n={},o=O(e,["sdkHttpResponse"]);o!=null&&M(n,["sdkHttpResponse"],o);const r=O(e,["name"]);r!=null&&M(n,["name"],r);const i=O(e,["metadata"]);i!=null&&M(n,["metadata"],i);const s=O(e,["done"]);s!=null&&M(n,["done"],s);const a=O(e,["error"]);return a!=null&&M(n,["error"],a),n}function J6(e,t){const n={},o=O(e,["gcsUri"]);o!=null&&M(n,["validationDatasetUri"],o);const r=O(e,["vertexDatasetResource"]);return r!=null&&M(n,["validationDatasetUri"],r),n}class NUe extends mp{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new Zg(up.PAGED_ITEM_TUNING_JOBS,o=>this.listInternal(o),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var o;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){const r={tunedModelName:n.baseModel};!((o=n.config)===null||o===void 0)&&o.preTunedModelCheckpointId&&(r.checkpointId=n.config.preTunedModelCheckpointId);const i=Object.assign(Object.assign({},n),{preTunedModel:r});return i.baseModel=void 0,await this.tuneInternal(i)}else{const r=Object.assign({},n);return await this.tuneInternal(r)}else{const r=Object.assign({},n),i=await this.tuneMldevInternal(r);let s="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?s=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(s=i.name.split("/operations/")[0]),{name:s,state:g1.JOB_STATE_QUEUED}}}}async getInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=CUe(t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>E1(u))}else{const p=SUe(t);return a=qe("{name}",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>die(u))}}async listInternal(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=RUe(t);return a=qe("tuningJobs",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=MUe(u),d=new p6;return Object.assign(d,l),d})}else{const p=TUe(t);return a=qe("tunedModels",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=EUe(u),d=new p6;return Object.assign(d,l),d})}}async cancel(t){var n,o,r,i;let s,a="",c={};if(this.apiClient.isVertexAI()){const p=mUe(t);return a=qe("{name}:cancel",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=bUe(u),d=new m6;return Object.assign(d,l),d})}else{const p=pUe(t);return a=qe("{name}:cancel",p._url),c=p._query,delete p._url,delete p._query,s=this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(u=>u.json().then(l=>{const d=l;return d.sdkHttpResponse={headers:u.headers},d})),s.then(u=>{const l=gUe(u),d=new m6;return Object.assign(d,l),d})}}async tuneInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=vUe(t,t);return i=qe("tuningJobs",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>E1(c))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=_Ue(t);return i=qe("tunedModels",a._url),s=a._query,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=t.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(p=>{const u=p;return u.sdkHttpResponse={headers:c.headers},u})),r.then(c=>DUe(c))}}}class LUe{async download(t,n){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an tag.")}}const FUe=1024*1024*8,xUe=3,BUe=1e3,kUe=2,vE="x-goog-upload-status";async function UUe(e,t,n){var o;const r=await fie(e,t,n),i=await r?.json();if(((o=r?.headers)===null||o===void 0?void 0:o[vE])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return i.file}async function qUe(e,t,n){var o;const r=await fie(e,t,n),i=await r?.json();if(((o=r?.headers)===null||o===void 0?void 0:o[vE])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const s=voe(i),a=new Rx;return Object.assign(a,s),a}async function fie(e,t,n){var o,r;let i=0,s=0,a=new b1(new Response),c="upload";for(i=e.size;s=i&&(c+=", finalize");let l=0,d=BUe;for(;lsetTimeout(t,e))}class HUe{async upload(t,n,o){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await UUe(t,n,o)}async uploadToFileSearchStore(t,n,o){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await qUe(t,n,o)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await JUe(t)}}class GUe{create(t,n,o){return new zUe(t,n,o)}}class zUe{constructor(t,n,o){this.url=t,this.headers=n,this.callbacks=o}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(t){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(t)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}const V6="x-goog-api-key";class KUe{constructor(t){this.apiKey=t}async addAuthHeaders(t,n){if(t.get(V6)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");t.append(V6,this.apiKey)}}}const QUe="gl-node/";class $D{get interactions(){if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const t=this.httpOptions;t?.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const n=new Mr({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:t?.timeout});return this._interactions=n.interactions,this._interactions}constructor(t){var n;if(t.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(t.project||t.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(n=t.vertexai)!==null&&n!==void 0?n:!1,this.apiKey=t.apiKey;const o=V2e(t.httpOptions,t.vertexai,void 0,void 0);o&&(t.httpOptions?t.httpOptions.baseUrl=o:t.httpOptions={baseUrl:o}),this.apiVersion=t.apiVersion,this.httpOptions=t.httpOptions;const r=new KUe(this.apiKey);this.apiClient=new JBe({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:QUe+"web",uploader:new HUe,downloader:new LUe}),this.models=new ake(this.apiClient),this.live=new tke(this.apiClient,r,new GUe),this.batches=new yLe(this.apiClient),this.chats=new ZLe(this.models,this.apiClient),this.caches=new WLe(this.apiClient),this.files=new uFe(this.apiClient),this.operations=new lke(this.apiClient),this.authTokens=new wke(this.apiClient),this.tunings=new NUe(this.apiClient),this.fileSearchStores=new jke(this.apiClient)}}const $Ue=(e,t)=>{if(!t)return e;const n=e.content;if(typeof n=="string")return e;const o=[...n],r=o[o.length-1];return r?.type==="reasoning"?o[o.length-1]={...r,text:r.text+t}:o.push({type:"reasoning",text:t}),{...e,content:o}},WUe=(e,t)=>{if(!t)return e;const n=e.content;if(typeof n=="string")return e;const o=[...n],r=o[o.length-1];return r?.type==="text"?o[o.length-1]={...r,text:r.text+t}:o.push({type:"text",text:t}),{...e,content:o}},YUe=(e,t)=>{const n=e.content;if(typeof n=="string")return e;const o=[...n],r={type:"tool-call",toolCallId:`${t.name}_${Date.now()}`,toolName:t.name,args:t.args,argsText:JSON.stringify(t.args),...t.thoughtSignature&&{metadata:{thoughtSignature:t.thoughtSignature}}};return o.push(r),{...e,content:o}},XUe=(e,t)=>{let n=e;const o=t.candidates?.[0];if(!o?.content?.parts)return n;for(const r of o.content.parts)r.thought&&(n=$Ue(n,r.text??"")),r.text&&(n=WUe(n,r.text)),r.functionCall&&(n=YUe(n,{name:r.functionCall.name??"",args:r.functionCall.args??{},thoughtSignature:r.thoughtSignature}));return n},hT={name:"Google AI",baseUrl:"https://generativelanguage.googleapis.com",modelFilters:["gemini-3-pro-preview","gemini-3-flash-preview"],modelNames:{"gemini-3-pro-preview":"Gemini 3 Pro","gemini-3-flash-preview":"Gemini 3 Flash"}},ZUe=e=>{const t=e.includes("\\")?"\\":"/";return e.split(t).pop()??e},eqe=e=>e.map(t=>({name:t.name,description:t.description,parameters:{type:"OBJECT",...t.inputSchema}})),tqe=e=>{const t=e.match(/^data:([^;]+);base64,(.+)$/);return t?{mimeType:t[1],data:t[2]}:null},nqe=e=>{if(typeof e.content=="string")return[{text:e.content}];const t=[];for(const n of e.content){if(n.type==="text"){t.push({text:n.text});continue}if(n.type==="image"){const o=tqe(n.image);o&&t.push({inlineData:{mimeType:o.mimeType,data:o.data}});continue}if(n.type==="file"){const o=JSON.parse(n.mimeType),r=ZUe(o.path);t.push({text:`File: ${r} File content: -${n.data}`})}}return e},zCe=t=>{const e=[];if(typeof t.content=="string")return t.content&&e.push({role:"model",parts:[{text:t.content}]}),e;const n=[],i=[];for(const r of t.content)if(r.type==="text")n.push({text:r.text});else if(r.type==="reasoning")n.push({text:r.text,thought:!0});else if(r.type==="tool-call"){const o=r.metadata?.thoughtSignature;n.push({functionCall:{name:r.toolName,args:r.args},...o&&{thoughtSignature:o}}),r.result&&i.push({functionResponse:{name:r.toolName,response:{result:r.result}}})}return n.length&&e.push({role:"model",parts:n}),i.length&&e.push({role:"user",parts:i}),e},V0=t=>{const e=[];for(const n of t)n.role==="user"||n.role==="system"?e.push({role:"user",parts:HCe(n)}):e.push(...zCe(n));return e},QCe=t=>({isEnd:!0,responseMessage:{role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:t}}}),GCe=(t,e)=>{if(typeof t.content=="string")return t;const n=typeof e?.content=="string"?0:e?.content.length??0;return{...t,content:t.content.filter((i,r)=>i.type==="tool-call"||r>=n)}},$Ce=t=>(typeof t.content=="string",t.content.length>0);class WCe extends YT{recreateClient(){this.client=new rE({apiKey:this.apiKey??"",httpOptions:this.url?{baseUrl:this.url}:void 0})}setProvider=e=>{this.provider=e,this.apiKey=e.key,this.url=e.baseUrl,this.recreateClient()};setApiKey(e){this.apiKey=e,this.recreateClient()}setUrl(e){this.url=e,this.recreateClient()}setPrevMessages=e=>{this.prevMessages=V0(e)};setTools=e=>{this.tools=VCe(e)};async createChatName(e){try{return this.client?(await this.client.models.generateContent({model:this.modelKey,contents:[{role:"user",parts:[{text:e}]}],config:{systemInstruction:KT}})).text??e.substring(0,25):""}catch{return""}}async*sendMessage(e,n,i,r){try{if(!this.client)return;const s=V0(e),o=[...this.prevMessages,...s];this.prevMessages.push(...s);let a=n&&i?nR(i):{role:"assistant",content:[]};const l=r?{thinkingLevel:p_.THINKING_LEVEL_UNSPECIFIED,includeThoughts:!0}:void 0,u=await this.client.models.generateContentStream({model:this.modelKey,contents:o,config:{systemInstruction:this.systemPrompt,tools:this.tools.length?[{functionDeclarations:this.tools}]:void 0,thinkingConfig:l}});for await(const f of u){if(this.stopFlag){$Ce(a)&&this.prevMessages.push(...V0([a])),this.stopFlag=!1,yield{isEnd:!0,responseMessage:a};return}a=LCe(a,f),yield a}const d=n?GCe(a,i):a;this.prevMessages.push(...V0([d])),yield{isEnd:!0,responseMessage:a}}catch(s){console.error("GenAI sendMessage error:",s),yield QCe(s)}}async*sendMessageAfterToolCall(e,n){if(typeof e.content=="string")return e;const i=e.content.filter(s=>s.type==="tool-call").reverse()[0];if(!i)return e;const r={role:"user",parts:[{functionResponse:{name:i.toolName,response:{result:i.result||""}}}]};return this.prevMessages.push(r),yield*this.sendMessage([],!0,e,n),e}getName=()=>U0.name;getBaseUrl=()=>U0.baseUrl;checkProvider=async e=>{try{return await new rE({apiKey:e.apiKey??"",httpOptions:e.url?{baseUrl:e.url}:void 0}).models.list(),!0}catch(n){if(!e.apiKey)return hn.emptyKey();const i=n instanceof Error?n.message:"";return n!==null&&typeof n=="object"&&Object.keys(n).length===0?hn.invalidUrl():i.includes("API key")||e.apiKey?hn.invalidKey():hn.emptyKey()}};getProviderModels=async e=>{try{const n=new rE({apiKey:e.apiKey??"",httpOptions:e.url?{baseUrl:e.url}:void 0}),i=[],r=await n.models.list();let s=await r.page;for(;s.length>0;){for(const o of s){const a=o.name?.replace("models/","")??"";U0.modelFilters.includes(a)&&i.push({id:a,name:U0.modelNames[a]||o.displayName||a,provider:"genai"})}if(!r.hasNextPage())break;s=await r.nextPage()}return i}catch{return[]}}}const jCe=new WCe,sE={name:"LM Studio",baseUrl:"http://localhost:1234/v1",modelFilters:[],modelNames:{}};class KCe extends Wc{setProvider=e=>{this.provider=e;const n=e.key||"lm-studio";this.client=this.createClient(n,e.baseUrl),this.setApiKey(n),e.baseUrl&&this.setUrl(e.baseUrl)};getName=()=>sE.name;getBaseUrl=()=>sE.baseUrl;checkProvider=async e=>{const n=this.createClient("lm-studio",e.url);try{const i=await n.models.list();return!i.data||i.data.length===0?hn.invalidUrl("No models loaded in LM Studio"):!0}catch(i){const r=i instanceof Error?i.message:"Failed to connect to LM Studio";return hn.invalidUrl(r)}};getProviderModels=async e=>{const n=this.createClient("lm-studio",e.url);try{return(await n.models.list()).data.map(r=>({id:r.id,name:sE.modelNames[r.id]||r.id,provider:"lm-studio"}))}catch(i){return console.error("Failed to fetch LM Studio models:",i),[]}}}const YCe=new KCe,oE={name:"Ollama",baseUrl:"http://localhost:11434/v1",modelFilters:[],modelNames:{}};class qCe extends Wc{setProvider=e=>{this.provider=e;const n=e.key||"ollama";this.client=this.createClient(n,e.baseUrl),this.setApiKey(n),e.baseUrl&&this.setUrl(e.baseUrl)};getName=()=>oE.name;getBaseUrl=()=>oE.baseUrl;checkProvider=async e=>{const n=this.createClient("ollama",e.url);try{return await n.models.list(),!0}catch{return hn.invalidUrl()}};getProviderModels=async e=>{const n=this.createClient("ollama",e.url);try{return(await n.models.list()).data.map(r=>({id:r.id,name:oE.modelNames[r.id]||r.id,provider:"ollama"}))}catch(i){return console.error("Failed to fetch Ollama models:",i),[]}}}const JCe=new qCe,jf={name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",modelFilters:["openai/gpt-5.2","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.5","anthropic/claude-opus-4.5","x-ai/grok-4","x-ai/grok-4.1-fast","qwen/qwen3-235b-a22b-2507","qwen/qwen3-max","deepseek/deepseek-v3.1-terminus","google/gemini-3-pro-preview","google/gemini-3-flash-preview"],modelNames:{"openai/gpt-5.2":"GPT-5.2","anthropic/claude-haiku-4.5":"Claude Haiku 4.5","anthropic/claude-sonnet-4.5":"Claude Sonnet 4.5","anthropic/claude-opus-4.5":"Claude Opus 4.5","x-ai/grok-4":"Grok 4","x-ai/grok-4.1-fast":"Grok 4.1 Fast","qwen/qwen3-235b-a22b-2507":"Qwen3","qwen/qwen3-max":"Qwen3 Max","deepseek/deepseek-v3.1-terminus":"DeepSeek V3.1 Terminus","google/gemini-3-pro-preview":"Gemini 3 Pro Preview","google/gemini-3-flash-preview":"Gemini 3 Flash Preview"},reasoningModels:["openai/gpt-5.2","anthropic/claude-sonnet-4.5","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","qwen/qwen3-235b-a22b-2507","qwen/qwen3-max","deepseek/deepseek-v3.1-terminus","google/gemini-3-pro-preview","google/gemini-3-flash-preview"]};class XCe extends Wc{getName=()=>jf.name;getBaseUrl=()=>jf.baseUrl;checkProvider=async e=>{try{const n=await fetch(`${e.url}/models/user`,{headers:{Authorization:`Bearer ${e.apiKey}`}});return n.ok?!0:e.apiKey?n.status===401?hn.invalidKey():hn.invalidUrl():hn.emptyKey()}catch{return hn.connectionFailed()}};getProviderModels=async e=>(await this.createClient(e.apiKey,e.url).models.list()).data.filter(r=>jf.modelFilters.includes(r.id)).map(r=>({id:jf.reasoningModels.includes(r.id)?`${r.id}-thinking`:r.id,name:jf.modelNames[r.id]||r.id.toUpperCase(),provider:"openrouter"}))}const ZCe=new XCe,F0={name:"TogetherAI",baseUrl:"https://api.together.xyz/v1",modelFilters:["deepseek-ai/DeepSeek-V3.1"],modelNames:{"deepseek-ai/DeepSeek-V3.1":"DeepSeek V3.1"}};class exe extends Wc{getName=()=>F0.name;getBaseUrl=()=>F0.baseUrl;getProviderModels=async e=>(await(await fetch(`${e.url}/models`,{headers:{Authorization:`Bearer ${e.apiKey}`}})).json()).filter(r=>F0.modelFilters.includes(r.id)).map(r=>({id:r.id,name:F0.modelNames[r.id]||r.id,provider:"together"}))}const txe=new exe,ed={name:"xAI",baseUrl:"https://api.x.ai/v1",modelFilters:["grok-4-1-fast-non-reasoning","grok-4-1-fast-reasoning","grok-4-0709"],modelNames:{"grok-4-0709":"Grok 4","grok-4-1-fast-non-reasoning":"Grok 4.1 Fast","grok-4-1-fast-reasoning":"Grok 4.1 Fast Reasoning"}};class nxe extends Wc{getName=()=>ed.name;getBaseUrl=()=>ed.baseUrl;getProviderModels=async e=>{const n=this.createClient(e.apiKey,e.url||ed.baseUrl);try{const i=(await n.models.list()).data;return(ed.modelFilters.length>0?i.filter(s=>ed.modelFilters.includes(s.id)).map(s=>{const o=ed.modelNames[s.id]||s.id;return{id:s.id,name:o,provider:"xai"}}):i.map(s=>({id:s.id,name:s.id,provider:"xai"}))).reverse()}catch{return[]}}}const ixe=new nxe,Fv={anthropic:tme,ollama:JCe,openai:wAe,together:txe,openrouter:ZCe,genai:jCe,deepseek:CAe,xai:ixe,"lm-studio":YCe},H0=t=>Fv[t],rxe=()=>Object.keys(Fv);let sxe=class{currentProvider;currentProviderInfo;currentProviderType;setCurrentProvider=e=>{if(!e){this.currentProvider=void 0,this.currentProviderInfo=void 0,this.currentProviderType=void 0;return}if(this.currentProviderInfo=e,this.currentProvider=H0(e.type),this.currentProviderType=this.currentProvider?e.type:void 0,this.currentProvider){this.currentProvider.setProvider(e),this.currentProvider.setSystemPrompt(Bpe);const n=localStorage.getItem(op);if(n){const i=JSON.parse(n);this.currentProvider.setModelKey(i.id)}}};setCurrentProviderModel=e=>{this.currentProvider&&this.currentProvider.setModelKey(e)};setCurrentProviderTools=e=>{this.currentProvider&&this.currentProvider.setTools(e)};setCurrentProviderPrevMessages=e=>{this.currentProvider&&this.currentProvider.setPrevMessages(e)};getCurrentProviderModel=()=>{if(this.currentProvider)return this.currentProvider.modelKey};createChatName=async e=>{if(!this.currentProvider)return"";const n=await this.currentProvider.createChatName(e);return n.includes("")?n.split("")[1].slice(0,128):n.slice(0,128)};sendMessage=(e,n)=>{if(this.currentProvider)return this.currentProvider.sendMessage(e,!1,void 0,n)};sendMessageAfterToolCall=(e,n)=>{if(this.currentProvider)return this.currentProvider.sendMessageAfterToolCall(e,n)};stopMessage=()=>{this.currentProvider&&this.currentProvider.stopMessage()};getProvidersInfo=()=>rxe().map(e=>{const n=Fv[e];return{type:e,name:n.getName(),baseUrl:n.getBaseUrl()}});getProviderInfo=e=>{const n=H0(e);return n?{type:e,name:n.getName(),baseUrl:n.getBaseUrl()}:{name:"",baseUrl:""}};checkNewProvider=(e,n)=>{const i=H0(e);return i?i.checkProvider(n):!1};getProvidersModels=async e=>{const n=new Map,i=e.filter(o=>H0(o.type)),r=i.map(o=>Fv[o.type].getProviderModels({url:o.baseUrl,apiKey:o.key})),s=await Promise.allSettled(r);return i.forEach((o,a)=>{const l=s[a];l.status==="fulfilled"&&l.value&&l.value.length>0&&n.set(o.name,l.value)}),n}};const It=new sxe,vh=Co(t=>({currentModel:(()=>{const e=localStorage.getItem(op);if(!e)return null;const n=JSON.parse(e);return It.setCurrentProviderModel(n.id),n})(),persistedModel:(()=>{const e=localStorage.getItem(op);if(!e)return null;const n=JSON.parse(e);return It.setCurrentProviderModel(n.id),n})(),extendedThinking:(()=>{const e=localStorage.getItem(UO);return e?JSON.parse(e):!1})(),selectModel:e=>{t({currentModel:e,persistedModel:e}),It.setCurrentProviderModel(e.id),localStorage.setItem(op,JSON.stringify(e))},setSessionModel:e=>{t(n=>{const i=e??n.persistedModel??null;return It.setCurrentProviderModel(i?.id??""),{currentModel:i}})},deleteSelectedModel:()=>{t({currentModel:null,persistedModel:null}),localStorage.removeItem(op),It.setCurrentProviderModel("")},toggleExtendedThinking:()=>{t(e=>{const n=!e.extendedThinking;return localStorage.setItem(UO,JSON.stringify(n)),{extendedThinking:n}})}})),f4={field:"name",message:"Duplicate name"},Tr=Co()((t,e)=>({providers:(()=>{const n=localStorage.getItem(o0);return n?JSON.parse(n):[]})(),currentProvider:(()=>{const n=localStorage.getItem(a0);if(!n)return null;const i=JSON.parse(n);return It.setCurrentProvider(i),i})(),persistedProvider:(()=>{const n=localStorage.getItem(a0);if(!n)return null;const i=JSON.parse(n);return It.setCurrentProvider(i),i})(),providersModels:new Map,fetchProvidersModels:async()=>{const n=e().providers,i=await It.getProvidersModels(n);t({providersModels:i})},setCurrentProvider:n=>{It.setCurrentProvider(n),localStorage.setItem(a0,JSON.stringify(n)),t({currentProvider:n,persistedProvider:n})},setSessionProvider:n=>{t(i=>{const r=n??i.persistedProvider??null;return It.setCurrentProvider(r||void 0),{currentProvider:r}})},addProvider:async n=>{if(e().providers.some(o=>o.name.toLowerCase()===n.name.toLowerCase()))return f4;const s=await It.checkNewProvider(n.type,{url:n.baseUrl,apiKey:n.key});return typeof s=="boolean"&&s?(t(o=>{const a=[...o.providers,n];return localStorage.setItem(o0,JSON.stringify(a)),{providers:a}}),!0):s},editProvider:async(n,i)=>{if(e().providers.some(a=>a.name.toLowerCase()===n.name.toLowerCase()&&a.baseUrl!==n.baseUrl&&a.key!==n.key&&a.type!==n.type))return f4;const o=await It.checkNewProvider(n.type,{url:n.baseUrl,apiKey:n.key});return typeof o=="boolean"&&o?(t(a=>{const l=a.providers.map(u=>u.name===i?n:u);return localStorage.setItem(o0,JSON.stringify(l)),{providers:l}}),!0):o},deleteProvider:async n=>{t(i=>{const r=i.providers.filter(l=>l.name!==n.name),s=i.persistedProvider?.name===n.name;let o=i.persistedProvider,a=i.currentProvider;return s&&(o=null,localStorage.removeItem(a0)),i.currentProvider?.name===n.name&&(a=o,It.setCurrentProvider(a||void 0)),localStorage.setItem(o0,JSON.stringify(r)),{providers:r,currentProvider:a,persistedProvider:o}})}})),p4=t=>{const{setSessionProvider:e}=Tr.getState(),{setSessionModel:n}=vh.getState();e(t?.provider??null),n(t?.model??null)},om=Co((t,e)=>({threadId:crypto.randomUUID(),threads:[],initThreads:async()=>{const n=await Dpe();t({threads:n})},insertThread:(n,i)=>{const r=e(),s=i?.provider??null,o=i?.model??null;t({threads:[{threadId:r.threadId,title:n,provider:s??void 0,model:o??void 0,lastEditDate:Date.now()},...r.threads]}),Mpe(r.threadId,n,s??void 0,o??void 0)},insertNewMessageToThread:n=>{const i=e(),r=n?.provider??null,s=n?.model??null;Npe(i.threadId,{...n&&"provider"in n?{provider:r}:{},...n&&"model"in n?{model:s}:{}}),t({threads:i.threads.map(o=>o.threadId===i.threadId?{...o,...n&&"provider"in n?{provider:r??void 0}:{},...n&&"model"in n?{model:s??void 0}:{},lastEditDate:Date.now()}:o)})},onSwitchToNewThread:()=>{p4(void 0),t({threadId:crypto.randomUUID()})},onSwitchToThread:n=>{const r=e().threads.find(s=>s.threadId===n);p4(r),t({threadId:n})},onDownloadThread:async n=>{const r=e().threads.find(l=>l.threadId===n),s=await $8(n),o=$T(r?.title||"Chat Export"),a=k8(s);window.AscDesktopEditor.SaveFilenameDialog(`${o}.docx`,l=>{l&&window.AscDesktopEditor.saveAndOpen(a,92,l,65,u=>{u||console.log("Conversion error")})})},onRenameThread:(n,i)=>{const r=e();t({threads:r.threads.map(s=>s.threadId===n?{...s,title:i}:s)}),Ppe(n,i)},onDeleteThread:n=>{const i=e();i.threadId===n&&i.onSwitchToNewThread(),t({threads:i.threads.filter(r=>r.threadId!==n)}),Ope(n)}}));function oxe(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,axe(r,...e)]}function axe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function lxe(t){const e=cxe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(dxe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function cxe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=fxe(r),a=hxe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var uxe=Symbol("radix.slottable");function dxe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===uxe}function hxe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function fxe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var pxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gxe=pxe.reduce((t,e)=>{const n=lxe(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function mxe(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,Axe(r,...e)]}function Axe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function g4(t){const e=yxe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(bxe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function yxe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Sxe(r),a=wxe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var vxe=Symbol("radix.slottable");function bxe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vxe}function wxe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Sxe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function $7(t){const e=t+"CollectionProvider",[n,i]=mxe(e),[r,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=S=>{const{scope:C,children:E}=S,k=me.useRef(null),R=me.useRef(new Map).current;return _.jsx(r,{scope:C,itemMap:R,collectionRef:k,children:E})};o.displayName=e;const a=t+"CollectionSlot",l=g4(a),u=me.forwardRef((S,C)=>{const{scope:E,children:k}=S,R=s(a,E),M=$t(C,R.collectionRef);return _.jsx(l,{ref:M,children:k})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",g=g4(d),m=me.forwardRef((S,C)=>{const{scope:E,children:k,...R}=S,M=me.useRef(null),D=$t(C,M),P=s(d,E);return me.useEffect(()=>(P.itemMap.set(M,{ref:M,...R}),()=>{P.itemMap.delete(M)})),_.jsx(g,{[f]:"",ref:D,children:k})});m.displayName=d;function v(S){const C=s(t+"CollectionConsumer",S);return me.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const R=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((P,N)=>R.indexOf(P.ref.current)-R.indexOf(N.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},v,i]}function Cxe(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,xxe(r,...e)]}function xxe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Exe=T.createContext(void 0);function LR(t){const e=T.useContext(Exe);return t||e||"ltr"}function W7(t){const e=_xe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Rxe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function _xe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Ixe(r),a=kxe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Txe=Symbol("radix.slottable");function Rxe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Txe}function kxe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Ixe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Mxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],am=Mxe.reduce((t,e)=>{const n=W7(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function Dxe(t,e){t&&Kb.flushSync(()=>t.dispatchEvent(e))}function Pxe(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,Nxe(r,...e)]}function Nxe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Oxe(t){const e=Bxe(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(Uxe);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function Bxe(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=Fxe(r),a=Vxe(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Lxe=Symbol("radix.slottable");function Uxe(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Lxe}function Vxe(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function Fxe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Hxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j7=Hxe.reduce((t,e)=>{const n=Oxe(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),aE="rovingFocusGroup.onEntryFocus",zxe={bubbles:!1,cancelable:!0},lm="RovingFocusGroup",[R_,K7,Qxe]=$7(lm),[Gxe,vw]=Pxe(lm,[Qxe]),[$xe,Wxe]=Gxe(lm),Y7=T.forwardRef((t,e)=>_.jsx(R_.Provider,{scope:t.__scopeRovingFocusGroup,children:_.jsx(R_.Slot,{scope:t.__scopeRovingFocusGroup,children:_.jsx(jxe,{...t,ref:e})})}));Y7.displayName=lm;var jxe=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:r=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,g=T.useRef(null),m=$t(e,g),v=LR(s),[S,C]=dh({prop:o,defaultProp:a??null,onChange:l,caller:lm}),[E,k]=T.useState(!1),R=Bi(u),M=K7(n),D=T.useRef(!1),[P,N]=T.useState(0);return T.useEffect(()=>{const B=g.current;if(B)return B.addEventListener(aE,R),()=>B.removeEventListener(aE,R)},[R]),_.jsx($xe,{scope:n,orientation:i,dir:v,loop:r,currentTabStopId:S,onItemFocus:T.useCallback(B=>C(B),[C]),onItemShiftTab:T.useCallback(()=>k(!0),[]),onFocusableItemAdd:T.useCallback(()=>N(B=>B+1),[]),onFocusableItemRemove:T.useCallback(()=>N(B=>B-1),[]),children:_.jsx(j7.div,{tabIndex:E||P===0?-1:0,"data-orientation":i,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:Ve(t.onMouseDown,()=>{D.current=!0}),onFocus:Ve(t.onFocus,B=>{const G=!D.current;if(B.target===B.currentTarget&&G&&!E){const V=new CustomEvent(aE,zxe);if(B.currentTarget.dispatchEvent(V),!V.defaultPrevented){const $=M().filter(Q=>Q.focusable),K=$.find(Q=>Q.active),X=$.find(Q=>Q.id===S),Z=[K,X,...$].filter(Boolean).map(Q=>Q.ref.current);X7(Z,d)}}D.current=!1}),onBlur:Ve(t.onBlur,()=>k(!1))})})}),q7="RovingFocusGroupItem",J7=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:r=!1,tabStopId:s,children:o,...a}=t,l=Al(),u=s||l,d=Wxe(q7,n),f=d.currentTabStopId===u,g=K7(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:S}=d;return T.useEffect(()=>{if(i)return m(),()=>v()},[i,m,v]),_.jsx(R_.ItemSlot,{scope:n,id:u,focusable:i,active:r,children:_.jsx(j7.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:e,onMouseDown:Ve(t.onMouseDown,C=>{i?d.onItemFocus(u):C.preventDefault()}),onFocus:Ve(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ve(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){d.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=qxe(C,d.orientation,d.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=g().filter(M=>M.focusable).map(M=>M.ref.current);if(E==="last")R.reverse();else if(E==="prev"||E==="next"){E==="prev"&&R.reverse();const M=R.indexOf(C.currentTarget);R=d.loop?Jxe(R,M+1):R.slice(M+1)}setTimeout(()=>X7(R))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:S!=null}):o})})});J7.displayName=q7;var Kxe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yxe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function qxe(t,e,n){const i=Yxe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Kxe[i]}function X7(t,e=!1){const n=document.activeElement;for(const i of t)if(i===n||(i.focus({preventScroll:e}),document.activeElement!==n))return}function Jxe(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var Z7=Y7,ez=J7,k_=["Enter"," "],Xxe=["ArrowDown","PageUp","Home"],tz=["ArrowUp","PageDown","End"],Zxe=[...Xxe,...tz],eEe={ltr:[...k_,"ArrowRight"],rtl:[...k_,"ArrowLeft"]},tEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cm="Menu",[gg,nEe,iEe]=$7(cm),[Kc,nz]=Cxe(cm,[iEe,ew,vw]),bw=ew(),iz=vw(),[rEe,bh]=Kc(cm),[sEe,um]=Kc(cm),rz=t=>{const{__scopeMenu:e,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=t,a=bw(e),[l,u]=T.useState(null),d=T.useRef(!1),f=Bi(s),g=LR(r);return T.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),_.jsx(_F,{...a,children:_.jsx(rEe,{scope:e,open:n,onOpenChange:f,content:l,onContentChange:u,children:_.jsx(sEe,{scope:e,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:o,children:i})})})};rz.displayName=cm;var oEe="MenuAnchor",UR=T.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t,r=bw(n);return _.jsx(TF,{...r,...i,ref:e})});UR.displayName=oEe;var aEe="MenuPortal",[sft,sz]=Kc(aEe,{forceMount:void 0}),Xr="MenuContent",[lEe,VR]=Kc(Xr),oz=T.forwardRef((t,e)=>{const n=sz(Xr,t.__scopeMenu),{forceMount:i=n.forceMount,...r}=t,s=bh(Xr,t.__scopeMenu),o=um(Xr,t.__scopeMenu);return _.jsx(gg.Provider,{scope:t.__scopeMenu,children:_.jsx(_o,{present:i||s.open,children:_.jsx(gg.Slot,{scope:t.__scopeMenu,children:o.modal?_.jsx(cEe,{...r,ref:e}):_.jsx(uEe,{...r,ref:e})})})})}),cEe=T.forwardRef((t,e)=>{const n=bh(Xr,t.__scopeMenu),i=T.useRef(null),r=$t(e,i);return T.useEffect(()=>{const s=i.current;if(s)return MF(s)},[]),_.jsx(FR,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ve(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),uEe=T.forwardRef((t,e)=>{const n=bh(Xr,t.__scopeMenu);return _.jsx(FR,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),dEe=W7("MenuContent.ScrollLock"),FR=T.forwardRef((t,e)=>{const{__scopeMenu:n,loop:i=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:m,disableOutsideScroll:v,...S}=t,C=bh(Xr,n),E=um(Xr,n),k=bw(n),R=iz(n),M=nEe(n),[D,P]=T.useState(null),N=T.useRef(null),B=$t(e,N,C.onContentChange),G=T.useRef(0),V=T.useRef(""),$=T.useRef(0),K=T.useRef(null),X=T.useRef("right"),J=T.useRef(0),Z=v?VT:T.Fragment,Q=v?{as:dEe,allowPinchZoom:!0}:void 0,q=oe=>{const L=V.current+oe,z=M().filter(ve=>!ve.disabled),te=document.activeElement,U=z.find(ve=>ve.ref.current===te)?.textValue,pe=z.map(ve=>ve.textValue),xe=CEe(pe,L,U),Ce=z.find(ve=>ve.textValue===xe)?.ref.current;(function ve(tt){V.current=tt,window.clearTimeout(G.current),tt!==""&&(G.current=window.setTimeout(()=>ve(""),1e3))})(L),Ce&&setTimeout(()=>Ce.focus())};T.useEffect(()=>()=>window.clearTimeout(G.current),[]),tF();const j=T.useCallback(oe=>X.current===K.current?.side&&EEe(oe,K.current?.area),[]);return _.jsx(lEe,{scope:n,searchRef:V,onItemEnter:T.useCallback(oe=>{j(oe)&&oe.preventDefault()},[j]),onItemLeave:T.useCallback(oe=>{j(oe)||(N.current?.focus(),P(null))},[j]),onTriggerLeave:T.useCallback(oe=>{j(oe)&&oe.preventDefault()},[j]),pointerGraceTimerRef:$,onPointerGraceIntentChange:T.useCallback(oe=>{K.current=oe},[]),children:_.jsx(Z,{...Q,children:_.jsx(kT,{asChild:!0,trapped:r,onMountAutoFocus:Ve(s,oe=>{oe.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:_.jsx(Yb,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:m,children:_.jsx(Z7,{asChild:!0,...R,dir:E.dir,orientation:"vertical",loop:i,currentTabStopId:D,onCurrentTabStopIdChange:P,onEntryFocus:Ve(l,oe=>{E.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(RF,{role:"menu","aria-orientation":"vertical","data-state":Sz(C.open),"data-radix-menu-content":"",dir:E.dir,...k,...S,ref:B,style:{outline:"none",...S.style},onKeyDown:Ve(S.onKeyDown,oe=>{const z=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,te=oe.ctrlKey||oe.altKey||oe.metaKey,U=oe.key.length===1;z&&(oe.key==="Tab"&&oe.preventDefault(),!te&&U&&q(oe.key));const pe=N.current;if(oe.target!==pe||!Zxe.includes(oe.key))return;oe.preventDefault();const Ce=M().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);tz.includes(oe.key)&&Ce.reverse(),wEe(Ce)}),onBlur:Ve(t.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(G.current),V.current="")}),onPointerMove:Ve(t.onPointerMove,mg(oe=>{const L=oe.target,z=J.current!==oe.clientX;if(oe.currentTarget.contains(L)&&z){const te=oe.clientX>J.current?"right":"left";X.current=te,J.current=oe.clientX}}))})})})})})})});oz.displayName=Xr;var hEe="MenuGroup",HR=T.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return _.jsx(am.div,{role:"group",...i,ref:e})});HR.displayName=hEe;var fEe="MenuLabel",az=T.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return _.jsx(am.div,{...i,ref:e})});az.displayName=fEe;var Hv="MenuItem",m4="menu.itemSelect",ww=T.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:i,...r}=t,s=T.useRef(null),o=um(Hv,t.__scopeMenu),a=VR(Hv,t.__scopeMenu),l=$t(e,s),u=T.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const g=new CustomEvent(m4,{bubbles:!0,cancelable:!0});f.addEventListener(m4,m=>i?.(m),{once:!0}),Dxe(f,g),g.defaultPrevented?u.current=!1:o.onClose()}};return _.jsx(lz,{...r,ref:l,disabled:n,onClick:Ve(t.onClick,d),onPointerDown:f=>{t.onPointerDown?.(f),u.current=!0},onPointerUp:Ve(t.onPointerUp,f=>{u.current||f.currentTarget?.click()}),onKeyDown:Ve(t.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||k_.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});ww.displayName=Hv;var lz=T.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:i=!1,textValue:r,...s}=t,o=VR(Hv,n),a=iz(n),l=T.useRef(null),u=$t(e,l),[d,f]=T.useState(!1),[g,m]=T.useState("");return T.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[s.children]),_.jsx(gg.ItemSlot,{scope:n,disabled:i,textValue:r??g,children:_.jsx(ez,{asChild:!0,...a,focusable:!i,children:_.jsx(am.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:u,onPointerMove:Ve(t.onPointerMove,mg(v=>{i?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ve(t.onPointerLeave,mg(v=>o.onItemLeave(v))),onFocus:Ve(t.onFocus,()=>f(!0)),onBlur:Ve(t.onBlur,()=>f(!1))})})})}),pEe="MenuCheckboxItem",cz=T.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:i,...r}=t;return _.jsx(pz,{scope:t.__scopeMenu,checked:n,children:_.jsx(ww,{role:"menuitemcheckbox","aria-checked":zv(n)?"mixed":n,...r,ref:e,"data-state":QR(n),onSelect:Ve(r.onSelect,()=>i?.(zv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cz.displayName=pEe;var uz="MenuRadioGroup",[gEe,mEe]=Kc(uz,{value:void 0,onValueChange:()=>{}}),dz=T.forwardRef((t,e)=>{const{value:n,onValueChange:i,...r}=t,s=Bi(i);return _.jsx(gEe,{scope:t.__scopeMenu,value:n,onValueChange:s,children:_.jsx(HR,{...r,ref:e})})});dz.displayName=uz;var hz="MenuRadioItem",fz=T.forwardRef((t,e)=>{const{value:n,...i}=t,r=mEe(hz,t.__scopeMenu),s=n===r.value;return _.jsx(pz,{scope:t.__scopeMenu,checked:s,children:_.jsx(ww,{role:"menuitemradio","aria-checked":s,...i,ref:e,"data-state":QR(s),onSelect:Ve(i.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});fz.displayName=hz;var zR="MenuItemIndicator",[pz,AEe]=Kc(zR,{checked:!1}),gz=T.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:i,...r}=t,s=AEe(zR,n);return _.jsx(_o,{present:i||zv(s.checked)||s.checked===!0,children:_.jsx(am.span,{...r,ref:e,"data-state":QR(s.checked)})})});gz.displayName=zR;var yEe="MenuSeparator",mz=T.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return _.jsx(am.div,{role:"separator","aria-orientation":"horizontal",...i,ref:e})});mz.displayName=yEe;var vEe="MenuArrow",Az=T.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t,r=bw(n);return _.jsx(kF,{...r,...i,ref:e})});Az.displayName=vEe;var bEe="MenuSub",[oft,yz]=Kc(bEe),Sp="MenuSubTrigger",vz=T.forwardRef((t,e)=>{const n=bh(Sp,t.__scopeMenu),i=um(Sp,t.__scopeMenu),r=yz(Sp,t.__scopeMenu),s=VR(Sp,t.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},d=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>d,[d]),T.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),_.jsx(UR,{asChild:!0,...u,children:_.jsx(lz,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":Sz(n.open),...t,ref:Gn(e,r.onTriggerChange),onClick:f=>{t.onClick?.(f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ve(t.onPointerMove,mg(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ve(t.onPointerLeave,mg(f=>{d();const g=n.content?.getBoundingClientRect();if(g){const m=n.content?.dataset.side,v=m==="right",S=v?-5:5,C=g[v?"left":"right"],E=g[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+S,y:f.clientY},{x:C,y:g.top},{x:E,y:g.top},{x:E,y:g.bottom},{x:C,y:g.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ve(t.onKeyDown,f=>{const g=s.searchRef.current!=="";t.disabled||g&&f.key===" "||eEe[i.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});vz.displayName=Sp;var bz="MenuSubContent",wz=T.forwardRef((t,e)=>{const n=sz(Xr,t.__scopeMenu),{forceMount:i=n.forceMount,...r}=t,s=bh(Xr,t.__scopeMenu),o=um(Xr,t.__scopeMenu),a=yz(bz,t.__scopeMenu),l=T.useRef(null),u=$t(e,l);return _.jsx(gg.Provider,{scope:t.__scopeMenu,children:_.jsx(_o,{present:i||s.open,children:_.jsx(gg.Slot,{scope:t.__scopeMenu,children:_.jsx(FR,{id:a.contentId,"aria-labelledby":a.triggerId,...r,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{o.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ve(t.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ve(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ve(t.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=tEe[o.dir].includes(d.key);f&&g&&(s.onOpenChange(!1),a.trigger?.focus(),d.preventDefault())})})})})})});wz.displayName=bz;function Sz(t){return t?"open":"closed"}function zv(t){return t==="indeterminate"}function QR(t){return zv(t)?"indeterminate":t?"checked":"unchecked"}function wEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function SEe(t,e){return t.map((n,i)=>t[(e+i)%t.length])}function CEe(t,e,n){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=SEe(t,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function xEe(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=g>i&&n<(f-u)*(i-d)/(g-d)+u&&(r=!r)}return r}function EEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return xEe(n,e)}function mg(t){return e=>e.pointerType==="mouse"?t(e):void 0}var _Ee=rz,TEe=UR,REe=oz,kEe=HR,IEe=az,MEe=ww,DEe=cz,PEe=dz,NEe=fz,OEe=gz,BEe=mz,LEe=Az,UEe=vz,VEe=wz,Sw="DropdownMenu",[FEe]=oxe(Sw,[nz]),tr=nz(),[HEe,Cz]=FEe(Sw),xz=t=>{const{__scopeDropdownMenu:e,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=tr(e),u=T.useRef(null),[d,f]=dh({prop:r,defaultProp:s??!1,onChange:o,caller:Sw});return _.jsx(HEe,{scope:e,triggerId:Al(),triggerRef:u,contentId:Al(),open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(g=>!g),[f]),modal:a,children:_.jsx(_Ee,{...l,open:d,onOpenChange:f,dir:i,modal:a,children:n})})};xz.displayName=Sw;var Ez="DropdownMenuTrigger",_z=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:i=!1,...r}=t,s=Cz(Ez,n),o=tr(n);return _.jsx(TEe,{asChild:!0,...o,children:_.jsx(gxe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...r,ref:Gn(e,s.triggerRef),onPointerDown:Ve(t.onPointerDown,a=>{!i&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ve(t.onKeyDown,a=>{i||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});_z.displayName=Ez;var Tz="DropdownMenuContent",Rz=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Cz(Tz,n),s=tr(n),o=T.useRef(!1);return _.jsx(REe,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...i,ref:e,onCloseAutoFocus:Ve(t.onCloseAutoFocus,a=>{o.current||r.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Ve(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!r.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rz.displayName=Tz;var zEe="DropdownMenuGroup",QEe=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(kEe,{...r,...i,ref:e})});QEe.displayName=zEe;var GEe="DropdownMenuLabel",$Ee=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(IEe,{...r,...i,ref:e})});$Ee.displayName=GEe;var WEe="DropdownMenuItem",kz=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(MEe,{...r,...i,ref:e})});kz.displayName=WEe;var jEe="DropdownMenuCheckboxItem",KEe=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(DEe,{...r,...i,ref:e})});KEe.displayName=jEe;var YEe="DropdownMenuRadioGroup",qEe=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(PEe,{...r,...i,ref:e})});qEe.displayName=YEe;var JEe="DropdownMenuRadioItem",XEe=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(NEe,{...r,...i,ref:e})});XEe.displayName=JEe;var ZEe="DropdownMenuItemIndicator",e1e=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(OEe,{...r,...i,ref:e})});e1e.displayName=ZEe;var t1e="DropdownMenuSeparator",n1e=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(BEe,{...r,...i,ref:e})});n1e.displayName=t1e;var i1e="DropdownMenuArrow",r1e=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(LEe,{...r,...i,ref:e})});r1e.displayName=i1e;var s1e="DropdownMenuSubTrigger",o1e=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(UEe,{...r,...i,ref:e})});o1e.displayName=s1e;var a1e="DropdownMenuSubContent",l1e=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=tr(n);return _.jsx(VEe,{...r,...i,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});l1e.displayName=a1e;var c1e=xz,u1e=_z,d1e=Rz,h1e=kz;function f1e(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,p1e(r,...e)]}function p1e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function g1e(t){const e=T.useRef({value:t,previous:t});return T.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function m1e(t){const e=A1e(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(v1e);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function A1e(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=w1e(r),a=b1e(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var y1e=Symbol("radix.slottable");function v1e(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===y1e}function b1e(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function w1e(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var S1e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Iz=S1e.reduce((t,e)=>{const n=m1e(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),Cw="Switch",[C1e]=f1e(Cw),[x1e,E1e]=C1e(Cw),Mz=T.forwardRef((t,e)=>{const{__scopeSwitch:n,name:i,checked:r,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:u,form:d,...f}=t,[g,m]=T.useState(null),v=$t(e,R=>m(R)),S=T.useRef(!1),C=g?d||!!g.closest("form"):!0,[E,k]=dh({prop:r,defaultProp:s??!1,onChange:u,caller:Cw});return _.jsxs(x1e,{scope:n,checked:E,disabled:a,children:[_.jsx(Iz.button,{type:"button",role:"switch","aria-checked":E,"aria-required":o,"data-state":Oz(E),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:v,onClick:Ve(t.onClick,R=>{k(M=>!M),C&&(S.current=R.isPropagationStopped(),S.current||R.stopPropagation())})}),C&&_.jsx(Nz,{control:g,bubbles:!S.current,name:i,value:l,checked:E,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Mz.displayName=Cw;var Dz="SwitchThumb",Pz=T.forwardRef((t,e)=>{const{__scopeSwitch:n,...i}=t,r=E1e(Dz,n);return _.jsx(Iz.span,{"data-state":Oz(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:e})});Pz.displayName=Dz;var _1e="SwitchBubbleInput",Nz=T.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:i=!0,...r},s)=>{const o=T.useRef(null),a=$t(o,s),l=g1e(n),u=mF(e);return T.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&m){const v=new Event("click",{bubbles:i});m.call(d,n),d.dispatchEvent(v)}},[l,n,i]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:a,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Nz.displayName=_1e;function Oz(t){return t?"checked":"unchecked"}var T1e=Mz,R1e=Pz;const Bz=({checked:t,onCheckedChange:e,disabled:n=!1,id:i,className:r})=>_.jsx("div",{className:"flex items-center gap-2",children:_.jsx(T1e,{dir:"ltr",id:i,checked:t,onCheckedChange:e,disabled:n,className:_e("relative inline-flex align-center shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out","focus:outline-none","disabled:cursor-not-allowed disabled:opacity-50","bg-[var(--toggle-button-off-background-color)] data-[state=checked]:bg-[var(--toggle-button-background-color)]","data-[state=checked]:hover:enabled:bg-[var(--toggle-button-background-hover-color)]","w-[24px] h-[14px]",r),children:_.jsx(R1e,{className:_e("pointer-events-none inline-block rounded-full bg-[var(--toggle-button-circle-color)] ring-0 transition-transform duration-200 ease-in-out","w-[10px] h-[10px] translate-x-[1px] data-[state=checked]:translate-x-[10px]")})})}),k1e=({text:t,icon:e,iconSize:n=16,onClick:i,isActive:r,isSeparator:s,withToggle:o,toggleChecked:a,onToggleChange:l,toggleDisabled:u,subMenu:d,checked:f,tooltipText:g,withSpace:m,withAbout:v,aboutContent:S})=>{const{isRTL:C}=Wt(),[E,k]=T.useState(!1),[R,M]=T.useState("left"),[D,P]=T.useState(12),[N,B]=T.useState(!1),G=T.useRef(null),V=T.useRef(null);if(s)return _.jsx("div",{className:"h-px min-h-[1px] w-full bg-[var(--drop-down-menu-separator-color)] my-[4px] flex-shrink-0"});const $=Q=>{if(o){Q.stopPropagation(),Q.preventDefault();return}i(Q)},K=Q=>{Q.stopPropagation(),Q.preventDefault(),!(Q.target instanceof HTMLElement&&(Q.target.closest("[data-slot='tooltip-trigger']")||Q.target.closest("[data-slot='tooltip-content']")))&&(u||l?.(!a))},X=Q=>{if(!G.current||!V.current)return;const q=Q.clientX,j=Q.clientY,oe=G.current.getBoundingClientRect(),L=V.current?.getBoundingClientRect(),z=q>=oe.left&&q<=oe.right&&j>=oe.top&&j<=oe.bottom,te=L&&q>=L.left&&q<=L.right&&j>=L.top&&j<=L.bottom;!z&&!te&&(k(!1),window.removeEventListener("mousemove",X))},J=()=>{if(!(E||!d)){if(G.current){const Q=G.current.getBoundingClientRect(),j=window.innerWidth-Q.right,oe=Q.left,L=154;let z;C?z=oe>=L?"left":"right":z=j>=L?"right":"left",M(z),P(12)}k(!0),window.addEventListener("mousemove",X)}},Z=_.jsxs(h1e,{className:_e("dropdown-menu-item","flex items-center justify-between gap-[32px] min-w-0 w-full max-w-full min-h-[32px] h-[32px] px-[12px] select-none cursor-pointer","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 border-0","hover:bg-[var(--drop-down-menu-item-hover-color)] hover:text-[var(--drop-down-menu-item-hover-color)]","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",r||d&&E?"bg-[var(--drop-down-menu-item-active-color)] text-[var(--drop-down-menu-item-active-color)]":""),onSelect:o?Q=>Q.preventDefault():$,onClick:o?K:void 0,onMouseEnter:J,ref:G,dir:C?"rtl":"ltr",children:[_.jsxs("div",{className:_e("flex items-center gap-[4px] min-w-0 flex-1"),children:[e&&typeof e=="string"?_.jsx(gt,{iconName:e,size:n,disableHover:!0}):e??null,_.jsx("span",{className:_e("truncate font-normal text-[14px] leading-[20px] text-[var(--drop-down-menu-item-color)]",m?"ms-[28px]":""),children:t}),v?_.jsxs(Kd,{open:N,children:[_.jsx(qd,{asChild:!0,children:_.jsx(gt,{iconName:"btn-menu-about",size:24,disableHover:!0,onClick:()=>B(Q=>!Q)})}),_.jsx(Yd,{side:void 0,sideOffset:4,isAbout:!0,children:S})]}):null]}),d?_.jsx(Yc,{trigger:_.jsx(gt,{iconName:"arrow.right",size:12,insideElement:!0,isStroke:!0,className:C?"rotate-180":""}),items:d,side:R,align:"start",sideOffset:D,open:E,contentClassName:"mt-[-15px] max-w-[300px]",containerRef:G.current,dropdownRef:V}):null,f?_.jsx(gt,{iconName:"checked",size:16,disableHover:!0,isStroke:!0}):null,o&&l?_.jsx("div",{onClick:Q=>Q.stopPropagation(),children:_.jsx(Bz,{checked:a??!1,onCheckedChange:l,disabled:u})}):null]});return g?_.jsxs(Kd,{children:[_.jsx(qd,{asChild:!0,children:Z}),_.jsx(Yd,{side:void 0,sideOffset:4,children:g})]}):Z},Yc=({trigger:t,items:e,side:n,align:i,sideOffset:r,contentClassName:s,maxWidth:o,matchTriggerWidth:a,open:l,dropdownRef:u,onOpenChange:d})=>{const{isRTL:f}=Wt();return _.jsxs(c1e,{open:l,onOpenChange:d,children:[_.jsx(u1e,{asChild:!0,children:t}),_.jsx(d1e,{ref:u,dir:f?"rtl":"ltr",side:n??"bottom",align:i??"start",sideOffset:r??6,"data-side":n,"data-align":i,"data-orientation":"vertical",className:_e("dropdown-menu z-50 border border-[var(--drop-down-menu-border-color)] rounded-[8px] shadow-[var(--drop-down-menu-shadow)] bg-[var(--drop-down-menu-background-color)] py-[8px] max-h-56 overflow-y-auto flex flex-col gap-[4px]",a?"min-w-[150px] w-[var(--radix-dropdown-menu-trigger-width)]":"w-fit",s),style:o?{maxWidth:o}:void 0,children:e.map((g,m)=>_.jsx(k1e,{...g},g.id||g.text||`item-${m}`))})]})},A4=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y4=bv,I1e=(t,e)=>n=>{var i;if(e?.variants==null)return y4(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const g=A4(d)||A4(f);return r[u][g]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,g]=d;return g===void 0||(u[f]=g),u},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((u,d)=>{let{class:f,className:g,...m}=d;return Object.entries(m).every(v=>{let[S,C]=v;return Array.isArray(C)?C.includes({...s,...a}[S]):{...s,...a}[S]===C})?[...u,f,g]:u},[]);return y4(t,o,l,n?.class,n?.className)},M1e="inline-flex items-center justify-center rounded-[4px] min-w-[40px]",D1e="outline-none focus:outline-none focus-visible:outline-none",P1e="bg-[var(--button-default-background-color)] border border-[var(--button-default-border-color)] text-[var(--button-default-color)]",N1e="hover:enabled:bg-[var(--button-default-hover-background-color)]",O1e="active:enabled:bg-[var(--button-default-pressed-background-color)]",B1e="focus:shadow-[var(--button-default-focus-shadow)]",L1e="disabled:bg-[var(--button-default-disabled-background-color)] disabled:text-[var(--button-default-disabled-color)] disabled:opacity-40 disabled:cursor-not-allowed",U1e="bg-[var(--button-background-color)] text-[var(--button-color)]",V1e="hover:enabled:bg-[var(--button-background-hover-color)]",F1e="active:enabled:bg-[var(--button-background-pressed-color)]",H1e="focus:bg-[var(--button-background-color)] focus:border-[var(--button-border-focus-color)] focus:shadow-[var(--button-shadow-focus)]",z1e="disabled:opacity-50 disabled:cursor-not-allowed",Q1e="h-[32px] min-w-[40px] px-[12px] text-[14px] font-semibold leading-[16px]",G1e=I1e(`${M1e} ${D1e}`,{variants:{variant:{default:_e(P1e,N1e,O1e,B1e,L1e),primary:_e(U1e,V1e,F1e,H1e,z1e)},size:{default:Q1e},scale:{default:"w-fit",scale:"w-full"}},defaultVariants:{variant:"primary",size:"default",scale:"default"}}),ln=({className:t,variant:e,size:n,asChild:i=!1,...r})=>{const s=i?RT:"button";return _.jsx(s,{"data-slot":"button",className:_e("cursor-pointer",G1e({variant:e,size:n,className:t})),...r})};function $1e(t,e){const n=T.createContext(e),i=s=>{const{children:o,...a}=s,l=T.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:l,children:o})};i.displayName=t+"Provider";function r(s){const o=T.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[i,r]}function W1e(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,j1e(r,...e)]}function j1e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Lz(t){const e=K1e(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(q1e);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function K1e(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=X1e(r),a=J1e(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Y1e=Symbol("radix.slottable");function q1e(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Y1e}function J1e(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function X1e(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Z1e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dm=Z1e.reduce((t,e)=>{const n=Lz(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),xw="Dialog",[Uz]=W1e(xw),[e_e,Ps]=Uz(xw),Vz=t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!0}=t,a=T.useRef(null),l=T.useRef(null),[u,d]=dh({prop:i,defaultProp:r??!1,onChange:s,caller:xw});return _.jsx(e_e,{scope:e,triggerRef:a,contentRef:l,contentId:Al(),titleId:Al(),descriptionId:Al(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};Vz.displayName=xw;var Fz="DialogTrigger",t_e=T.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=Ps(Fz,n),s=$t(e,r.triggerRef);return _.jsx(dm.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":WR(r.open),...i,ref:s,onClick:Ve(t.onClick,r.onOpenToggle)})});t_e.displayName=Fz;var GR="DialogPortal",[n_e,Hz]=Uz(GR,{forceMount:void 0}),zz=t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,s=Ps(GR,e);return _.jsx(n_e,{scope:e,forceMount:n,children:T.Children.map(i,o=>_.jsx(_o,{present:n||s.open,children:_.jsx(UT,{asChild:!0,container:r,children:o})}))})};zz.displayName=GR;var Qv="DialogOverlay",Qz=T.forwardRef((t,e)=>{const n=Hz(Qv,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=Ps(Qv,t.__scopeDialog);return s.modal?_.jsx(_o,{present:i||s.open,children:_.jsx(r_e,{...r,ref:e})}):null});Qz.displayName=Qv;var i_e=Lz("DialogOverlay.RemoveScroll"),r_e=T.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=Ps(Qv,n);return _.jsx(VT,{as:i_e,allowPinchZoom:!0,shards:[r.contentRef],children:_.jsx(dm.div,{"data-state":WR(r.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),Uc="DialogContent",Gz=T.forwardRef((t,e)=>{const n=Hz(Uc,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=Ps(Uc,t.__scopeDialog);return _.jsx(_o,{present:i||s.open,children:s.modal?_.jsx(s_e,{...r,ref:e}):_.jsx(o_e,{...r,ref:e})})});Gz.displayName=Uc;var s_e=T.forwardRef((t,e)=>{const n=Ps(Uc,t.__scopeDialog),i=T.useRef(null),r=$t(e,n.contentRef,i);return T.useEffect(()=>{const s=i.current;if(s)return MF(s)},[]),_.jsx($z,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ve(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ve(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ve(t.onFocusOutside,s=>s.preventDefault())})}),o_e=T.forwardRef((t,e)=>{const n=Ps(Uc,t.__scopeDialog),i=T.useRef(!1),r=T.useRef(!1);return _.jsx($z,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||n.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),$z=T.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:s,...o}=t,a=Ps(Uc,n),l=T.useRef(null),u=$t(e,l);return tF(),_.jsxs(_.Fragment,{children:[_.jsx(kT,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:s,children:_.jsx(Yb,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":WR(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(l_e,{titleId:a.titleId}),_.jsx(u_e,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$R="DialogTitle",Wz=T.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=Ps($R,n);return _.jsx(dm.h2,{id:r.titleId,...i,ref:e})});Wz.displayName=$R;var jz="DialogDescription",Kz=T.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=Ps(jz,n);return _.jsx(dm.p,{id:r.descriptionId,...i,ref:e})});Kz.displayName=jz;var Yz="DialogClose",a_e=T.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=Ps(Yz,n);return _.jsx(dm.button,{type:"button",...i,ref:e,onClick:Ve(t.onClick,()=>r.onOpenChange(!1))})});a_e.displayName=Yz;function WR(t){return t?"open":"closed"}var qz="DialogTitleWarning",[aft,Jz]=$1e(qz,{contentName:Uc,titleName:$R,docsSlug:"dialog"}),l_e=({titleId:t})=>{const e=Jz(qz),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +${n.data}`})}}return t},rqe=e=>{const t=[];if(typeof e.content=="string")return e.content&&t.push({role:"model",parts:[{text:e.content}]}),t;const n=[],o=[];for(const r of e.content)if(r.type==="text")n.push({text:r.text});else if(r.type==="reasoning")n.push({text:r.text,thought:!0});else if(r.type==="tool-call"){const s=r.metadata?.thoughtSignature;n.push({functionCall:{name:r.toolName,args:r.args},...s&&{thoughtSignature:s}}),r.result&&o.push({functionResponse:{name:r.toolName,response:{result:r.result}}})}return n.length&&t.push({role:"model",parts:n}),o.length&&t.push({role:"user",parts:o}),t},pT=e=>{const t=[];for(const n of e)n.role==="user"||n.role==="system"?t.push({role:"user",parts:nqe(n)}):t.push(...rqe(n));return t},oqe=e=>({isEnd:!0,responseMessage:{role:"assistant",content:"",status:{type:"incomplete",reason:"error",error:e}}}),iqe=(e,t)=>{if(typeof e.content=="string")return e;const n=typeof t?.content=="string"?0:t?.content.length??0;return{...e,content:e.content.filter((o,r)=>o.type==="tool-call"||r>=n)}},sqe=e=>(typeof e.content=="string",e.content.length>0);class aqe extends JM{recreateClient(){this.client=new $D({apiKey:this.apiKey??"",httpOptions:this.url?{baseUrl:this.url}:void 0})}setProvider=t=>{this.provider=t,this.apiKey=t.key,this.url=t.baseUrl,this.recreateClient()};setApiKey(t){this.apiKey=t,this.recreateClient()}setUrl(t){this.url=t,this.recreateClient()}setPrevMessages=t=>{this.prevMessages=pT(t)};setTools=t=>{this.tools=eqe(t)};async createChatName(t){try{return this.client?(await this.client.models.generateContent({model:this.modelKey,contents:[{role:"user",parts:[{text:t}]}],config:{systemInstruction:qM}})).text??t.substring(0,25):""}catch{return""}}async*sendMessage(t,n,o,r){try{if(!this.client)return;const i=pT(t),s=[...this.prevMessages,...i];this.prevMessages.push(...i);let a=n&&o?GM(o):{role:"assistant",content:[]};const c=r?{thinkingLevel:m1.THINKING_LEVEL_UNSPECIFIED,includeThoughts:!0}:void 0,p=await this.client.models.generateContentStream({model:this.modelKey,contents:s,config:{systemInstruction:this.systemPrompt,tools:this.tools.length?[{functionDeclarations:this.tools}]:void 0,thinkingConfig:c}});for await(const l of p){if(this.stopFlag){sqe(a)&&this.prevMessages.push(...pT([a])),this.stopFlag=!1,yield{isEnd:!0,responseMessage:a};return}a=XUe(a,l),yield a}const u=n?iqe(a,o):a;this.prevMessages.push(...pT([u])),yield{isEnd:!0,responseMessage:a}}catch(i){console.error("GenAI sendMessage error:",i),yield oqe(i)}}async*sendMessageAfterToolCall(t,n){if(typeof t.content=="string")return t;const o=t.content.filter(i=>i.type==="tool-call").reverse()[0];if(!o)return t;const r={role:"user",parts:[{functionResponse:{name:o.toolName,response:{result:o.result||""}}}]};return this.prevMessages.push(r),yield*this.sendMessage([],!0,t,n),t}getName=()=>hT.name;getBaseUrl=()=>hT.baseUrl;checkProvider=async t=>{try{return await new $D({apiKey:t.apiKey??"",httpOptions:t.url?{baseUrl:t.url}:void 0}).models.list(),!0}catch(n){if(!t.apiKey)return yn.emptyKey();const o=n instanceof Error?n.message:"";return n!==null&&typeof n=="object"&&Object.keys(n).length===0?yn.invalidUrl():o.includes("API key")||t.apiKey?yn.invalidKey():yn.emptyKey()}};getProviderModels=async t=>{try{const n=new $D({apiKey:t.apiKey??"",httpOptions:t.url?{baseUrl:t.url}:void 0}),o=[],r=await n.models.list();let i=await r.page;for(;i.length>0;){for(const s of i){const a=s.name?.replace("models/","")??"";hT.modelFilters.includes(a)&&o.push({id:a,name:hT.modelNames[a]||s.displayName||a,provider:"genai"})}if(!r.hasNextPage())break;i=await r.nextPage()}return o}catch{return[]}}}const lqe=new aqe,WD={name:"LM Studio",baseUrl:"http://localhost:1234/v1",modelFilters:[],modelNames:{}};class uqe extends Xg{setProvider=t=>{this.provider=t;const n=t.key||"lm-studio";this.client=this.createClient(n,t.baseUrl),this.setApiKey(n),t.baseUrl&&this.setUrl(t.baseUrl)};getName=()=>WD.name;getBaseUrl=()=>WD.baseUrl;checkProvider=async t=>{const n=this.createClient("lm-studio",t.url);try{const o=await n.models.list();return!o.data||o.data.length===0?yn.invalidUrl("No models loaded in LM Studio"):!0}catch(o){const r=o instanceof Error?o.message:"Failed to connect to LM Studio";return yn.invalidUrl(r)}};getProviderModels=async t=>{const n=this.createClient("lm-studio",t.url);try{return(await n.models.list()).data.map(r=>({id:r.id,name:WD.modelNames[r.id]||r.id,provider:"lm-studio"}))}catch(o){return console.error("Failed to fetch LM Studio models:",o),[]}}}const cqe=new uqe,dqe=(e,t)=>{if(!e.toolCalls?.length)return t;const n=e.toolCalls[0],o=n.id||"",r=n.function?.arguments||"{}",i=[{type:"tool-call",toolCallId:o,toolName:n.function?.name||"",args:typeof r=="string"?JSON.parse(r):r,argsText:typeof r=="string"?r:JSON.stringify(r),result:"",parentId:o}];return typeof t.content!="string"?{...t,content:[...t.content,...i]}:t},fqe=(e,t)=>{if(typeof e?.content!="string"||typeof t.content=="string")return t;const n=e.content,o=t.content.at(-1);return o&&o.type==="text"?{...t,content:[...t.content.slice(0,-1),{...o,text:o.text+n}]}:{...t,content:[...t.content,{type:"text",text:n}]}},hqe=e=>e.data?.choices?.[0];var ss={},YD={},mT={},H6;function Je(){if(H6)return mT;H6=1,Object.defineProperty(mT,"__esModule",{value:!0}),mT.pathToFunc=t;const e=Object.prototype.hasOwnProperty;function t(n,o){const r=/\{([a-zA-Z0-9_]+?)\}/g;return function(s={}){return n.replace(r,function(a,c){if(!e.call(s,c))throw new Error(`Parameter '${c}' is required`);const p=s[c];if(typeof p!="string"&&typeof p!="number")throw new Error(`Parameter '${c}' must be a string or number`);return o?.charEncoding==="percent"?encodeURIComponent(`${p}`):`${p}`})}}return mT}var G6;function Lx(){return G6||(G6=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SDK_METADATA=e.ServerList=e.ServerEu=void 0,e.serverURLFromOptions=n;const t=Je();e.ServerEu="eu",e.ServerList={[e.ServerEu]:"https://api.mistral.ai"};function n(o){let r=o.serverURL;const i={};if(!r){const a=o.server??e.ServerEu;r=e.ServerList[a]||""}const s=(0,t.pathToFunc)(r)(i);return new URL(s)}e.SDK_METADATA={language:"typescript",openapiDocVersion:"1.0.0",sdkVersion:"1.11.0",genVersion:"2.687.13",userAgent:"speakeasy-sdk/typescript 1.11.0 2.687.13 1.0.0 @mistralai/mistralai"}})(YD)),YD}var mv={},z6;function xC(){if(z6)return mv;z6=1,Object.defineProperty(mv,"__esModule",{value:!0}),mv.readableStreamToArrayBuffer=e,mv.getContentTypeFromFileName=t;async function e(n){const o=n.getReader(),r=[];let i=0,s=!1;for(;!s;){const{value:p,done:u}=await o.read();u?s=!0:(r.push(p),i+=p.length)}const a=new Uint8Array(i);let c=0;for(const p of r)a.set(p,c),c+=p.length;return a.buffer}function t(n){if(!n)return null;const o=n.toLowerCase().split(".").pop();return o&&{json:"application/json",xml:"application/xml",html:"text/html",htm:"text/html",txt:"text/plain",csv:"text/csv",pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",js:"application/javascript",css:"text/css",zip:"application/zip",tar:"application/x-tar",gz:"application/gzip",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",webp:"image/webp",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf"}[o]||null}return mv}var as={},K6;function iP(){if(K6)return as;K6=1,Object.defineProperty(as,"__esModule",{value:!0}),as.HTTPClient=void 0,as.matchContentType=o,as.matchStatusCode=i,as.matchResponse=s,as.isConnectionError=a,as.isTimeoutError=c,as.isAbortError=p;const e=(u,l)=>l==null?fetch(u):fetch(u,l);class t{constructor(l={}){this.options=l,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=l.fetcher||e}async request(l){let d=l;for(const f of this.requestHooks){const h=await f(d);h&&(d=h)}try{const f=await this.fetcher(d);for(const h of this.responseHooks)await h(f,d);return f}catch(f){for(const h of this.requestErrorHooks)await h(f,d);throw f}}addHook(...l){if(l[0]==="beforeRequest")this.requestHooks.push(l[1]);else if(l[0]==="requestError")this.requestErrorHooks.push(l[1]);else if(l[0]==="response")this.responseHooks.push(l[1]);else throw new Error(`Invalid hook type: ${l[0]}`);return this}removeHook(...l){let d;if(l[0]==="beforeRequest")d=this.requestHooks;else if(l[0]==="requestError")d=this.requestErrorHooks;else if(l[0]==="response")d=this.responseHooks;else throw new Error(`Invalid hook type: ${l[0]}`);const f=d.findIndex(h=>h===l[1]);return f>=0&&d.splice(f,1),this}clone(){const l=new t(this.options);return l.requestHooks=this.requestHooks.slice(),l.requestErrorHooks=this.requestErrorHooks.slice(),l.responseHooks=this.responseHooks.slice(),l}}as.HTTPClient=t;const n=/\s*;\s*/g;function o(u,l){if(l==="*")return!0;let d=u.headers.get("content-type")?.trim()||"application/octet-stream";d=d.toLowerCase();const f=l.toLowerCase().trim().split(n),[h="",...m]=f;if(h.split("/").length!==2)return!1;const g=d.split(n),[y="",..._]=g,[S="",w=""]=y.split("/");if(!S||!w||h!=="*/*"&&y!==h&&`${S}/*`!==h&&`*/${w}`!==h||_.length{const m=`${h}`;if(m==="default")return!0;if(!r.test(`${m}`))return m===d;const g=m.charAt(0);if(!g)throw new Error("Invalid status code range");const y=d.charAt(0);if(!y)throw new Error(`Invalid response status code: ${d}`);return y===g}):!1}function s(u,l,d){return i(u,l)&&o(u,d)}function a(u){if(typeof u!="object"||u==null)return!1;const l=u instanceof TypeError&&u.message.toLowerCase().startsWith("failed to fetch"),d=u instanceof TypeError&&u.message.toLowerCase().startsWith("fetch failed"),f="name"in u&&u.name==="ConnectionError",h="code"in u&&typeof u.code=="string"&&u.code.toLowerCase()==="econnreset";return l||d||h||f}function c(u){if(typeof u!="object"||u==null)return!1;const l="name"in u&&u.name==="TimeoutError",d="code"in u&&u.code===23,f="code"in u&&typeof u.code=="string"&&u.code.toLowerCase()==="econnaborted";return l||d||f}function p(u){if(typeof u!="object"||u==null)return!1;const l="name"in u&&u.name==="AbortError",d="code"in u&&u.code===20,f="code"in u&&typeof u.code=="string"&&u.code.toLowerCase()==="econnaborted";return l||d||f}return as}var gv={},yu={},bv={},gT={},yv={},Q6;function pqe(){if(Q6)return yv;Q6=1,Object.defineProperty(yv,"__esModule",{value:!0}),yv.CustomUserAgentHook=void 0;const e=Lx();class t{beforeRequest(o,r){const s=`mistral-client-typescript/${e.SDK_METADATA.sdkVersion}`;return r.headers.set("user-agent",s),r.headers.get("user-agent")||r.headers.set("x-mistral-user-agent",s),r}}return yv.CustomUserAgentHook=t,yv}var Av={},$6;function mqe(){if($6)return Av;$6=1,Object.defineProperty(Av,"__esModule",{value:!0}),Av.DeprecationWarningHook=void 0;const e="x-model-deprecation-timestamp";class t{afterSuccess(o,r){return r.headers.has(e)&&r.clone().json().then(i=>{const s=i.model;console.warn(`WARNING: The model ${s} is deprecated and will be removed on ${r.headers.get(e)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),r}}return Av.DeprecationWarningHook=t,Av}var W6;function gqe(){if(W6)return gT;W6=1,Object.defineProperty(gT,"__esModule",{value:!0}),gT.initHooks=n;const e=pqe(),t=mqe();function n(o){const r=new e.CustomUserAgentHook;o.registerBeforeRequestHook(r);const i=new t.DeprecationWarningHook;o.registerAfterSuccessHook(i)}return gT}var Y6;function bqe(){if(Y6)return bv;Y6=1,Object.defineProperty(bv,"__esModule",{value:!0}),bv.SDKHooks=void 0;const e=gqe();class t{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];const o=[];for(const r of o)"sdkInit"in r&&this.registerSDKInitHook(r),"beforeCreateRequest"in r&&this.registerBeforeCreateRequestHook(r),"beforeRequest"in r&&this.registerBeforeRequestHook(r),"afterSuccess"in r&&this.registerAfterSuccessHook(r),"afterError"in r&&this.registerAfterErrorHook(r);(0,e.initHooks)(this)}registerSDKInitHook(o){this.sdkInitHooks.push(o)}registerBeforeCreateRequestHook(o){this.beforeCreateRequestHooks.push(o)}registerBeforeRequestHook(o){this.beforeRequestHooks.push(o)}registerAfterSuccessHook(o){this.afterSuccessHooks.push(o)}registerAfterErrorHook(o){this.afterErrorHooks.push(o)}sdkInit(o){return this.sdkInitHooks.reduce((r,i)=>i.sdkInit(r),o)}beforeCreateRequest(o,r){let i=r;for(const s of this.beforeCreateRequestHooks)i=s.beforeCreateRequest(o,i);return i}async beforeRequest(o,r){let i=r;for(const s of this.beforeRequestHooks)i=await s.beforeRequest(o,i);return i}async afterSuccess(o,r){let i=r;for(const s of this.afterSuccessHooks)i=await s.afterSuccess(o,i);return i}async afterError(o,r,i){let s=r,a=i;for(const c of this.afterErrorHooks){const p=await c.afterError(o,s,a);s=p.response,a=p.error}return{response:s,error:a}}}return bv.SDKHooks=t,bv}var fo={},X6;function hie(){if(X6)return fo;X6=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.ConnectionError=fo.RequestTimeoutError=fo.RequestAbortedError=fo.InvalidRequestError=fo.UnexpectedClientError=fo.HTTPClientError=void 0;class e extends Error{constructor(a,c){let p=a;c?.cause&&(p+=`: ${c.cause}`),super(p,c),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=c?.cause)}}fo.HTTPClientError=e;class t extends e{constructor(){super(...arguments),this.name="UnexpectedClientError"}}fo.UnexpectedClientError=t;class n extends e{constructor(){super(...arguments),this.name="InvalidRequestError"}}fo.InvalidRequestError=n;class o extends e{constructor(){super(...arguments),this.name="RequestAbortedError"}}fo.RequestAbortedError=o;class r extends e{constructor(){super(...arguments),this.name="RequestTimeoutError"}}fo.RequestTimeoutError=r;class i extends e{constructor(){super(...arguments),this.name="ConnectionError"}}return fo.ConnectionError=i,fo}var ug={},Z6;function Ar(){if(Z6)return ug;Z6=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.OK=e,ug.ERR=t,ug.unwrap=n,ug.unwrapAsync=o;function e(r){return{ok:!0,value:r}}function t(r){return{ok:!1,error:r}}function n(r){if(!r.ok)throw r.error;return r.value}async function o(r){const i=await r;if(!i.ok)throw i.error;return i.value}return ug}var fr={},ls={},cg={},Au={},bT={},_u={},XD={},eH;function sP(){return eH||(eH=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=c=>{};function i(c){}r.assertIs=i;function s(c){throw new Error}r.assertNever=s,r.arrayToEnum=c=>{const p={};for(const u of c)p[u]=u;return p},r.getValidEnumValues=c=>{const p=r.objectKeys(c).filter(l=>typeof c[c[l]]!="number"),u={};for(const l of p)u[l]=c[l];return r.objectValues(u)},r.objectValues=c=>r.objectKeys(c).map(function(p){return c[p]}),r.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const p=[];for(const u in c)Object.prototype.hasOwnProperty.call(c,u)&&p.push(u);return p},r.find=(c,p)=>{for(const u of c)if(p(u))return u},r.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&Number.isFinite(c)&&Math.floor(c)===c;function a(c,p=" | "){return c.map(u=>typeof u=="string"?`'${u}'`:u).join(p)}r.joinValues=a,r.jsonStringifyReplacer=(c,p)=>typeof p=="bigint"?p.toString():p})(t||(e.util=t={}));var n;(function(r){r.mergeShapes=(i,s)=>({...i,...s})})(n||(e.objectUtil=n={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const o=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return Number.isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=o})(XD)),XD}var tH;function Fx(){if(tH)return _u;tH=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.ZodError=_u.quotelessJson=_u.ZodIssueCode=void 0;const e=sP();_u.ZodIssueCode=e.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const t=o=>JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:");_u.quotelessJson=t;let n=class pie extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}format(r){const i=r||function(c){return c.message},s={_errors:[]},a=c=>{for(const p of c.issues)if(p.code==="invalid_union")p.unionErrors.map(a);else if(p.code==="invalid_return_type")a(p.returnTypeError);else if(p.code==="invalid_arguments")a(p.argumentsError);else if(p.path.length===0)s._errors.push(i(p));else{let u=s,l=0;for(;li.message){const i={},s=[];for(const a of this.issues)if(a.path.length>0){const c=a.path[0];i[c]=i[c]||[],i[c].push(r(a))}else s.push(r(a));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}};return _u.ZodError=n,n.create=o=>new n(o),_u}var nH;function mie(){if(nH)return bT;nH=1,Object.defineProperty(bT,"__esModule",{value:!0});const e=Fx(),t=sP(),n=(o,r)=>{let i;switch(o.code){case e.ZodIssueCode.invalid_type:o.received===t.ZodParsedType.undefined?i="Required":i=`Expected ${o.expected}, received ${o.received}`;break;case e.ZodIssueCode.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(o.expected,t.util.jsonStringifyReplacer)}`;break;case e.ZodIssueCode.unrecognized_keys:i=`Unrecognized key(s) in object: ${t.util.joinValues(o.keys,", ")}`;break;case e.ZodIssueCode.invalid_union:i="Invalid input";break;case e.ZodIssueCode.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${t.util.joinValues(o.options)}`;break;case e.ZodIssueCode.invalid_enum_value:i=`Invalid enum value. Expected ${t.util.joinValues(o.options)}, received '${o.received}'`;break;case e.ZodIssueCode.invalid_arguments:i="Invalid function arguments";break;case e.ZodIssueCode.invalid_return_type:i="Invalid function return type";break;case e.ZodIssueCode.invalid_date:i="Invalid date";break;case e.ZodIssueCode.invalid_string:typeof o.validation=="object"?"includes"in o.validation?(i=`Invalid input: must include "${o.validation.includes}"`,typeof o.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${o.validation.position}`)):"startsWith"in o.validation?i=`Invalid input: must start with "${o.validation.startsWith}"`:"endsWith"in o.validation?i=`Invalid input: must end with "${o.validation.endsWith}"`:t.util.assertNever(o.validation):o.validation!=="regex"?i=`Invalid ${o.validation}`:i="Invalid";break;case e.ZodIssueCode.too_small:o.type==="array"?i=`Array must contain ${o.exact?"exactly":o.inclusive?"at least":"more than"} ${o.minimum} element(s)`:o.type==="string"?i=`String must contain ${o.exact?"exactly":o.inclusive?"at least":"over"} ${o.minimum} character(s)`:o.type==="number"?i=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="bigint"?i=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="date"?i=`Date must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(o.minimum))}`:i="Invalid input";break;case e.ZodIssueCode.too_big:o.type==="array"?i=`Array must contain ${o.exact?"exactly":o.inclusive?"at most":"less than"} ${o.maximum} element(s)`:o.type==="string"?i=`String must contain ${o.exact?"exactly":o.inclusive?"at most":"under"} ${o.maximum} character(s)`:o.type==="number"?i=`Number must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="bigint"?i=`BigInt must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="date"?i=`Date must be ${o.exact?"exactly":o.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(o.maximum))}`:i="Invalid input";break;case e.ZodIssueCode.custom:i="Invalid input";break;case e.ZodIssueCode.invalid_intersection_types:i="Intersection results could not be merged";break;case e.ZodIssueCode.not_multiple_of:i=`Number must be a multiple of ${o.multipleOf}`;break;case e.ZodIssueCode.not_finite:i="Number must be finite";break;default:i=r.defaultError,t.util.assertNever(o)}return{message:i}};return bT.default=n,bT}var rH;function xx(){if(rH)return Au;rH=1;var e=Au&&Au.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Au,"__esModule",{value:!0}),Au.defaultErrorMap=void 0,Au.setErrorMap=o,Au.getErrorMap=r;const t=e(mie());Au.defaultErrorMap=t.default;let n=t.default;function o(i){n=i}function r(){return n}return Au}var _v={},oH;function gie(){return oH||(oH=1,(function(e){var t=_v&&_v.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.EMPTY_PATH=e.makeIssue=void 0,e.addIssueToContext=i;const n=xx(),o=t(mie()),r=f=>{const{data:h,path:m,errorMaps:g,issueData:y}=f,_=[...m,...y.path||[]],S={...y,path:_};if(y.message!==void 0)return{...y,path:_,message:y.message};let w="";const R=g.filter(E=>!!E).slice().reverse();for(const E of R)w=E(S,{data:h,defaultError:w}).message;return{...y,path:_,message:w}};e.makeIssue=r,e.EMPTY_PATH=[];function i(f,h){const m=(0,n.getErrorMap)(),g=(0,e.makeIssue)({issueData:h,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,m,m===o.default?void 0:o.default].filter(y=>!!y)});f.common.issues.push(g)}class s{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(h,m){const g=[];for(const y of m){if(y.status==="aborted")return e.INVALID;y.status==="dirty"&&h.dirty(),g.push(y.value)}return{status:h.value,value:g}}static async mergeObjectAsync(h,m){const g=[];for(const y of m){const _=await y.key,S=await y.value;g.push({key:_,value:S})}return s.mergeObjectSync(h,g)}static mergeObjectSync(h,m){const g={};for(const y of m){const{key:_,value:S}=y;if(_.status==="aborted"||S.status==="aborted")return e.INVALID;_.status==="dirty"&&h.dirty(),S.status==="dirty"&&h.dirty(),_.value!=="__proto__"&&(typeof S.value<"u"||y.alwaysSet)&&(g[_.value]=S.value)}return{status:h.value,value:g}}}e.ParseStatus=s,e.INVALID=Object.freeze({status:"aborted"});const a=f=>({status:"dirty",value:f});e.DIRTY=a;const c=f=>({status:"valid",value:f});e.OK=c;const p=f=>f.status==="aborted";e.isAborted=p;const u=f=>f.status==="dirty";e.isDirty=u;const l=f=>f.status==="valid";e.isValid=l;const d=f=>typeof Promise<"u"&&f instanceof Promise;e.isAsync=d})(_v)),_v}var ZD={},iH;function yqe(){return iH||(iH=1,Object.defineProperty(ZD,"__esModule",{value:!0})),ZD}var fe={},vv={},sH;function Aqe(){if(sH)return vv;sH=1,Object.defineProperty(vv,"__esModule",{value:!0}),vv.errorUtil=void 0;var e;return(function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n?.message})(e||(vv.errorUtil=e={})),vv}var aH;function _qe(){if(aH)return fe;aH=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.discriminatedUnion=fe.date=fe.boolean=fe.bigint=fe.array=fe.any=fe.coerce=fe.ZodFirstPartyTypeKind=fe.late=fe.ZodSchema=fe.Schema=fe.ZodReadonly=fe.ZodPipeline=fe.ZodBranded=fe.BRAND=fe.ZodNaN=fe.ZodCatch=fe.ZodDefault=fe.ZodNullable=fe.ZodOptional=fe.ZodTransformer=fe.ZodEffects=fe.ZodPromise=fe.ZodNativeEnum=fe.ZodEnum=fe.ZodLiteral=fe.ZodLazy=fe.ZodFunction=fe.ZodSet=fe.ZodMap=fe.ZodRecord=fe.ZodTuple=fe.ZodIntersection=fe.ZodDiscriminatedUnion=fe.ZodUnion=fe.ZodObject=fe.ZodArray=fe.ZodVoid=fe.ZodNever=fe.ZodUnknown=fe.ZodAny=fe.ZodNull=fe.ZodUndefined=fe.ZodSymbol=fe.ZodDate=fe.ZodBoolean=fe.ZodBigInt=fe.ZodNumber=fe.ZodString=fe.ZodType=void 0,fe.NEVER=fe.void=fe.unknown=fe.union=fe.undefined=fe.tuple=fe.transformer=fe.symbol=fe.string=fe.strictObject=fe.set=fe.record=fe.promise=fe.preprocess=fe.pipeline=fe.ostring=fe.optional=fe.onumber=fe.oboolean=fe.object=fe.number=fe.nullable=fe.null=fe.never=fe.nativeEnum=fe.nan=fe.map=fe.literal=fe.lazy=fe.intersection=fe.instanceof=fe.function=fe.enum=fe.effect=void 0,fe.datetimeRegex=I,fe.custom=vp;const e=Fx(),t=xx(),n=Aqe(),o=gie(),r=sP();class i{constructor(k,z,Y,re){this._cachedPath=[],this.parent=k,this.data=z,this._path=Y,this._key=re}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const s=(oe,k)=>{if((0,o.isValid)(k))return{success:!0,data:k.value};if(!oe.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const z=new e.ZodError(oe.common.issues);return this._error=z,this._error}}};function a(oe){if(!oe)return{};const{errorMap:k,invalid_type_error:z,required_error:Y,description:re}=oe;if(k&&(z||Y))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return k?{errorMap:k,description:re}:{errorMap:(Pe,Ce)=>{const{message:Xe}=oe;return Pe.code==="invalid_enum_value"?{message:Xe??Ce.defaultError}:typeof Ce.data>"u"?{message:Xe??Y??Ce.defaultError}:Pe.code!=="invalid_type"?{message:Ce.defaultError}:{message:Xe??z??Ce.defaultError}},description:re}}class c{get description(){return this._def.description}_getType(k){return(0,r.getParsedType)(k.data)}_getOrReturnCtx(k,z){return z||{common:k.parent.common,data:k.data,parsedType:(0,r.getParsedType)(k.data),schemaErrorMap:this._def.errorMap,path:k.path,parent:k.parent}}_processInputParams(k){return{status:new o.ParseStatus,ctx:{common:k.parent.common,data:k.data,parsedType:(0,r.getParsedType)(k.data),schemaErrorMap:this._def.errorMap,path:k.path,parent:k.parent}}}_parseSync(k){const z=this._parse(k);if((0,o.isAsync)(z))throw new Error("Synchronous parse encountered promise.");return z}_parseAsync(k){const z=this._parse(k);return Promise.resolve(z)}parse(k,z){const Y=this.safeParse(k,z);if(Y.success)return Y.data;throw Y.error}safeParse(k,z){const Y={common:{issues:[],async:z?.async??!1,contextualErrorMap:z?.errorMap},path:z?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:k,parsedType:(0,r.getParsedType)(k)},re=this._parseSync({data:k,path:Y.path,parent:Y});return s(Y,re)}"~validate"(k){const z={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:k,parsedType:(0,r.getParsedType)(k)};if(!this["~standard"].async)try{const Y=this._parseSync({data:k,path:[],parent:z});return(0,o.isValid)(Y)?{value:Y.value}:{issues:z.common.issues}}catch(Y){Y?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),z.common={issues:[],async:!0}}return this._parseAsync({data:k,path:[],parent:z}).then(Y=>(0,o.isValid)(Y)?{value:Y.value}:{issues:z.common.issues})}async parseAsync(k,z){const Y=await this.safeParseAsync(k,z);if(Y.success)return Y.data;throw Y.error}async safeParseAsync(k,z){const Y={common:{issues:[],contextualErrorMap:z?.errorMap,async:!0},path:z?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:k,parsedType:(0,r.getParsedType)(k)},re=this._parse({data:k,path:Y.path,parent:Y}),ie=await((0,o.isAsync)(re)?re:Promise.resolve(re));return s(Y,ie)}refine(k,z){const Y=re=>typeof z=="string"||typeof z>"u"?{message:z}:typeof z=="function"?z(re):z;return this._refinement((re,ie)=>{const Pe=k(re),Ce=()=>ie.addIssue({code:e.ZodIssueCode.custom,...Y(re)});return typeof Promise<"u"&&Pe instanceof Promise?Pe.then(Xe=>Xe?!0:(Ce(),!1)):Pe?!0:(Ce(),!1)})}refinement(k,z){return this._refinement((Y,re)=>k(Y)?!0:(re.addIssue(typeof z=="function"?z(Y,re):z),!1))}_refinement(k){return new dt({schema:this,typeName:it.ZodEffects,effect:{type:"refinement",refinement:k}})}superRefine(k){return this._refinement(k)}constructor(k){this.spa=this.safeParseAsync,this._def=k,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:z=>this["~validate"](z)}}optional(){return Ct.create(this,this._def)}nullable(){return On.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return ot.create(this,this._def)}or(k){return kn.create([this,k],this._def)}and(k){return Ho.create(this,k,this._def)}transform(k){return new dt({...a(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:k}})}default(k){const z=typeof k=="function"?k:()=>k;return new Dr({...a(this._def),innerType:this,defaultValue:z,typeName:it.ZodDefault})}brand(){return new zn({typeName:it.ZodBranded,type:this,...a(this._def)})}catch(k){const z=typeof k=="function"?k:()=>k;return new Mn({...a(this._def),innerType:this,catchValue:z,typeName:it.ZodCatch})}describe(k){const z=this.constructor;return new z({...this._def,description:k})}pipe(k){return qt.create(this,k)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}fe.ZodType=c,fe.Schema=c,fe.ZodSchema=c;const p=/^c[^\s-]{8,}$/i,u=/^[0-9a-z]+$/,l=/^[0-9A-HJKMNP-TV-Z]{26}$/i,d=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,f=/^[a-z0-9_-]{21}$/i,h=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,m=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,g=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,y="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _;const S=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,E=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,T=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,B="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N=new RegExp(`^${B}$`);function L(oe){let k="[0-5]\\d";oe.precision?k=`${k}\\.\\d{${oe.precision}}`:oe.precision==null&&(k=`${k}(\\.\\d+)?`);const z=oe.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${k})${z}`}function q(oe){return new RegExp(`^${L(oe)}$`)}function I(oe){let k=`${B}T${L(oe)}`;const z=[];return z.push(oe.local?"Z?":"Z"),oe.offset&&z.push("([+-]\\d{2}:?\\d{2})"),k=`${k}(${z.join("|")})`,new RegExp(`^${k}$`)}function U(oe,k){return!!((k==="v4"||!k)&&S.test(oe)||(k==="v6"||!k)&&R.test(oe))}function J(oe,k){if(!h.test(oe))return!1;try{const[z]=oe.split(".");if(!z)return!1;const Y=z.replace(/-/g,"+").replace(/_/g,"/").padEnd(z.length+(4-z.length%4)%4,"="),re=JSON.parse(atob(Y));return!(typeof re!="object"||re===null||"typ"in re&&re?.typ!=="JWT"||!re.alg||k&&re.alg!==k)}catch{return!1}}function V(oe,k){return!!((k==="v4"||!k)&&w.test(oe)||(k==="v6"||!k)&&E.test(oe))}class G extends c{_parse(k){if(this._def.coerce&&(k.data=String(k.data)),this._getType(k)!==r.ZodParsedType.string){const ie=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(ie,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:ie.parsedType}),o.INVALID}const Y=new o.ParseStatus;let re;for(const ie of this._def.checks)if(ie.kind==="min")k.data.lengthie.value&&(re=this._getOrReturnCtx(k,re),(0,o.addIssueToContext)(re,{code:e.ZodIssueCode.too_big,maximum:ie.value,type:"string",inclusive:!0,exact:!1,message:ie.message}),Y.dirty());else if(ie.kind==="length"){const Pe=k.data.length>ie.value,Ce=k.data.lengthk.test(re),{validation:z,code:e.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(Y)})}_addCheck(k){return new G({...this._def,checks:[...this._def.checks,k]})}email(k){return this._addCheck({kind:"email",...n.errorUtil.errToObj(k)})}url(k){return this._addCheck({kind:"url",...n.errorUtil.errToObj(k)})}emoji(k){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(k)})}uuid(k){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(k)})}nanoid(k){return this._addCheck({kind:"nanoid",...n.errorUtil.errToObj(k)})}cuid(k){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(k)})}cuid2(k){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(k)})}ulid(k){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(k)})}base64(k){return this._addCheck({kind:"base64",...n.errorUtil.errToObj(k)})}base64url(k){return this._addCheck({kind:"base64url",...n.errorUtil.errToObj(k)})}jwt(k){return this._addCheck({kind:"jwt",...n.errorUtil.errToObj(k)})}ip(k){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(k)})}cidr(k){return this._addCheck({kind:"cidr",...n.errorUtil.errToObj(k)})}datetime(k){return typeof k=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:k}):this._addCheck({kind:"datetime",precision:typeof k?.precision>"u"?null:k?.precision,offset:k?.offset??!1,local:k?.local??!1,...n.errorUtil.errToObj(k?.message)})}date(k){return this._addCheck({kind:"date",message:k})}time(k){return typeof k=="string"?this._addCheck({kind:"time",precision:null,message:k}):this._addCheck({kind:"time",precision:typeof k?.precision>"u"?null:k?.precision,...n.errorUtil.errToObj(k?.message)})}duration(k){return this._addCheck({kind:"duration",...n.errorUtil.errToObj(k)})}regex(k,z){return this._addCheck({kind:"regex",regex:k,...n.errorUtil.errToObj(z)})}includes(k,z){return this._addCheck({kind:"includes",value:k,position:z?.position,...n.errorUtil.errToObj(z?.message)})}startsWith(k,z){return this._addCheck({kind:"startsWith",value:k,...n.errorUtil.errToObj(z)})}endsWith(k,z){return this._addCheck({kind:"endsWith",value:k,...n.errorUtil.errToObj(z)})}min(k,z){return this._addCheck({kind:"min",value:k,...n.errorUtil.errToObj(z)})}max(k,z){return this._addCheck({kind:"max",value:k,...n.errorUtil.errToObj(z)})}length(k,z){return this._addCheck({kind:"length",value:k,...n.errorUtil.errToObj(z)})}nonempty(k){return this.min(1,n.errorUtil.errToObj(k))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(k=>k.kind==="datetime")}get isDate(){return!!this._def.checks.find(k=>k.kind==="date")}get isTime(){return!!this._def.checks.find(k=>k.kind==="time")}get isDuration(){return!!this._def.checks.find(k=>k.kind==="duration")}get isEmail(){return!!this._def.checks.find(k=>k.kind==="email")}get isURL(){return!!this._def.checks.find(k=>k.kind==="url")}get isEmoji(){return!!this._def.checks.find(k=>k.kind==="emoji")}get isUUID(){return!!this._def.checks.find(k=>k.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(k=>k.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(k=>k.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(k=>k.kind==="cuid2")}get isULID(){return!!this._def.checks.find(k=>k.kind==="ulid")}get isIP(){return!!this._def.checks.find(k=>k.kind==="ip")}get isCIDR(){return!!this._def.checks.find(k=>k.kind==="cidr")}get isBase64(){return!!this._def.checks.find(k=>k.kind==="base64")}get isBase64url(){return!!this._def.checks.find(k=>k.kind==="base64url")}get minLength(){let k=null;for(const z of this._def.checks)z.kind==="min"&&(k===null||z.value>k)&&(k=z.value);return k}get maxLength(){let k=null;for(const z of this._def.checks)z.kind==="max"&&(k===null||z.valuenew G({checks:[],typeName:it.ZodString,coerce:oe?.coerce??!1,...a(oe)});function Q(oe,k){const z=(oe.toString().split(".")[1]||"").length,Y=(k.toString().split(".")[1]||"").length,re=z>Y?z:Y,ie=Number.parseInt(oe.toFixed(re).replace(".","")),Pe=Number.parseInt(k.toFixed(re).replace(".",""));return ie%Pe/10**re}class le extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(k){if(this._def.coerce&&(k.data=Number(k.data)),this._getType(k)!==r.ZodParsedType.number){const ie=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(ie,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:ie.parsedType}),o.INVALID}let Y;const re=new o.ParseStatus;for(const ie of this._def.checks)ie.kind==="int"?r.util.isInteger(k.data)||(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:ie.message}),re.dirty()):ie.kind==="min"?(ie.inclusive?k.dataie.value:k.data>=ie.value)&&(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.too_big,maximum:ie.value,type:"number",inclusive:ie.inclusive,exact:!1,message:ie.message}),re.dirty()):ie.kind==="multipleOf"?Q(k.data,ie.value)!==0&&(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.not_multiple_of,multipleOf:ie.value,message:ie.message}),re.dirty()):ie.kind==="finite"?Number.isFinite(k.data)||(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.not_finite,message:ie.message}),re.dirty()):r.util.assertNever(ie);return{status:re.value,value:k.data}}gte(k,z){return this.setLimit("min",k,!0,n.errorUtil.toString(z))}gt(k,z){return this.setLimit("min",k,!1,n.errorUtil.toString(z))}lte(k,z){return this.setLimit("max",k,!0,n.errorUtil.toString(z))}lt(k,z){return this.setLimit("max",k,!1,n.errorUtil.toString(z))}setLimit(k,z,Y,re){return new le({...this._def,checks:[...this._def.checks,{kind:k,value:z,inclusive:Y,message:n.errorUtil.toString(re)}]})}_addCheck(k){return new le({...this._def,checks:[...this._def.checks,k]})}int(k){return this._addCheck({kind:"int",message:n.errorUtil.toString(k)})}positive(k){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(k)})}negative(k){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(k)})}nonpositive(k){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(k)})}nonnegative(k){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(k)})}multipleOf(k,z){return this._addCheck({kind:"multipleOf",value:k,message:n.errorUtil.toString(z)})}finite(k){return this._addCheck({kind:"finite",message:n.errorUtil.toString(k)})}safe(k){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(k)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(k)})}get minValue(){let k=null;for(const z of this._def.checks)z.kind==="min"&&(k===null||z.value>k)&&(k=z.value);return k}get maxValue(){let k=null;for(const z of this._def.checks)z.kind==="max"&&(k===null||z.valuek.kind==="int"||k.kind==="multipleOf"&&r.util.isInteger(k.value))}get isFinite(){let k=null,z=null;for(const Y of this._def.checks){if(Y.kind==="finite"||Y.kind==="int"||Y.kind==="multipleOf")return!0;Y.kind==="min"?(z===null||Y.value>z)&&(z=Y.value):Y.kind==="max"&&(k===null||Y.valuenew le({checks:[],typeName:it.ZodNumber,coerce:oe?.coerce||!1,...a(oe)});class K extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(k){if(this._def.coerce)try{k.data=BigInt(k.data)}catch{return this._getInvalidInput(k)}if(this._getType(k)!==r.ZodParsedType.bigint)return this._getInvalidInput(k);let Y;const re=new o.ParseStatus;for(const ie of this._def.checks)ie.kind==="min"?(ie.inclusive?k.dataie.value:k.data>=ie.value)&&(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.too_big,type:"bigint",maximum:ie.value,inclusive:ie.inclusive,message:ie.message}),re.dirty()):ie.kind==="multipleOf"?k.data%ie.value!==BigInt(0)&&(Y=this._getOrReturnCtx(k,Y),(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.not_multiple_of,multipleOf:ie.value,message:ie.message}),re.dirty()):r.util.assertNever(ie);return{status:re.value,value:k.data}}_getInvalidInput(k){const z=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:z.parsedType}),o.INVALID}gte(k,z){return this.setLimit("min",k,!0,n.errorUtil.toString(z))}gt(k,z){return this.setLimit("min",k,!1,n.errorUtil.toString(z))}lte(k,z){return this.setLimit("max",k,!0,n.errorUtil.toString(z))}lt(k,z){return this.setLimit("max",k,!1,n.errorUtil.toString(z))}setLimit(k,z,Y,re){return new K({...this._def,checks:[...this._def.checks,{kind:k,value:z,inclusive:Y,message:n.errorUtil.toString(re)}]})}_addCheck(k){return new K({...this._def,checks:[...this._def.checks,k]})}positive(k){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(k)})}negative(k){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(k)})}nonpositive(k){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(k)})}nonnegative(k){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(k)})}multipleOf(k,z){return this._addCheck({kind:"multipleOf",value:k,message:n.errorUtil.toString(z)})}get minValue(){let k=null;for(const z of this._def.checks)z.kind==="min"&&(k===null||z.value>k)&&(k=z.value);return k}get maxValue(){let k=null;for(const z of this._def.checks)z.kind==="max"&&(k===null||z.valuenew K({checks:[],typeName:it.ZodBigInt,coerce:oe?.coerce??!1,...a(oe)});class X extends c{_parse(k){if(this._def.coerce&&(k.data=!!k.data),this._getType(k)!==r.ZodParsedType.boolean){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:Y.parsedType}),o.INVALID}return(0,o.OK)(k.data)}}fe.ZodBoolean=X,X.create=oe=>new X({typeName:it.ZodBoolean,coerce:oe?.coerce||!1,...a(oe)});class ce extends c{_parse(k){if(this._def.coerce&&(k.data=new Date(k.data)),this._getType(k)!==r.ZodParsedType.date){const ie=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(ie,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:ie.parsedType}),o.INVALID}if(Number.isNaN(k.data.getTime())){const ie=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(ie,{code:e.ZodIssueCode.invalid_date}),o.INVALID}const Y=new o.ParseStatus;let re;for(const ie of this._def.checks)ie.kind==="min"?k.data.getTime()ie.value&&(re=this._getOrReturnCtx(k,re),(0,o.addIssueToContext)(re,{code:e.ZodIssueCode.too_big,message:ie.message,inclusive:!0,exact:!1,maximum:ie.value,type:"date"}),Y.dirty()):r.util.assertNever(ie);return{status:Y.value,value:new Date(k.data.getTime())}}_addCheck(k){return new ce({...this._def,checks:[...this._def.checks,k]})}min(k,z){return this._addCheck({kind:"min",value:k.getTime(),message:n.errorUtil.toString(z)})}max(k,z){return this._addCheck({kind:"max",value:k.getTime(),message:n.errorUtil.toString(z)})}get minDate(){let k=null;for(const z of this._def.checks)z.kind==="min"&&(k===null||z.value>k)&&(k=z.value);return k!=null?new Date(k):null}get maxDate(){let k=null;for(const z of this._def.checks)z.kind==="max"&&(k===null||z.valuenew ce({checks:[],coerce:oe?.coerce||!1,typeName:it.ZodDate,...a(oe)});class W extends c{_parse(k){if(this._getType(k)!==r.ZodParsedType.symbol){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:Y.parsedType}),o.INVALID}return(0,o.OK)(k.data)}}fe.ZodSymbol=W,W.create=oe=>new W({typeName:it.ZodSymbol,...a(oe)});class _e extends c{_parse(k){if(this._getType(k)!==r.ZodParsedType.undefined){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:Y.parsedType}),o.INVALID}return(0,o.OK)(k.data)}}fe.ZodUndefined=_e,_e.create=oe=>new _e({typeName:it.ZodUndefined,...a(oe)});class Ne extends c{_parse(k){if(this._getType(k)!==r.ZodParsedType.null){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:Y.parsedType}),o.INVALID}return(0,o.OK)(k.data)}}fe.ZodNull=Ne,Ne.create=oe=>new Ne({typeName:it.ZodNull,...a(oe)});class Ie extends c{constructor(){super(...arguments),this._any=!0}_parse(k){return(0,o.OK)(k.data)}}fe.ZodAny=Ie,Ie.create=oe=>new Ie({typeName:it.ZodAny,...a(oe)});class Me extends c{constructor(){super(...arguments),this._unknown=!0}_parse(k){return(0,o.OK)(k.data)}}fe.ZodUnknown=Me,Me.create=oe=>new Me({typeName:it.ZodUnknown,...a(oe)});class Ye extends c{_parse(k){const z=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:z.parsedType}),o.INVALID}}fe.ZodNever=Ye,Ye.create=oe=>new Ye({typeName:it.ZodNever,...a(oe)});class ct extends c{_parse(k){if(this._getType(k)!==r.ZodParsedType.undefined){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:Y.parsedType}),o.INVALID}return(0,o.OK)(k.data)}}fe.ZodVoid=ct,ct.create=oe=>new ct({typeName:it.ZodVoid,...a(oe)});class Pt extends c{_parse(k){const{ctx:z,status:Y}=this._processInputParams(k),re=this._def;if(z.parsedType!==r.ZodParsedType.array)return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:z.parsedType}),o.INVALID;if(re.exactLength!==null){const Pe=z.data.length>re.exactLength.value,Ce=z.data.lengthre.maxLength.value&&((0,o.addIssueToContext)(z,{code:e.ZodIssueCode.too_big,maximum:re.maxLength.value,type:"array",inclusive:!0,exact:!1,message:re.maxLength.message}),Y.dirty()),z.common.async)return Promise.all([...z.data].map((Pe,Ce)=>re.type._parseAsync(new i(z,Pe,z.path,Ce)))).then(Pe=>o.ParseStatus.mergeArray(Y,Pe));const ie=[...z.data].map((Pe,Ce)=>re.type._parseSync(new i(z,Pe,z.path,Ce)));return o.ParseStatus.mergeArray(Y,ie)}get element(){return this._def.type}min(k,z){return new Pt({...this._def,minLength:{value:k,message:n.errorUtil.toString(z)}})}max(k,z){return new Pt({...this._def,maxLength:{value:k,message:n.errorUtil.toString(z)}})}length(k,z){return new Pt({...this._def,exactLength:{value:k,message:n.errorUtil.toString(z)}})}nonempty(k){return this.min(1,k)}}fe.ZodArray=Pt,Pt.create=(oe,k)=>new Pt({type:oe,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...a(k)});function tn(oe){if(oe instanceof Mt){const k={};for(const z in oe.shape){const Y=oe.shape[z];k[z]=Ct.create(tn(Y))}return new Mt({...oe._def,shape:()=>k})}else return oe instanceof Pt?new Pt({...oe._def,type:tn(oe.element)}):oe instanceof Ct?Ct.create(tn(oe.unwrap())):oe instanceof On?On.create(tn(oe.unwrap())):oe instanceof Ir?Ir.create(oe.items.map(k=>tn(k))):oe}class Mt extends c{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const k=this._def.shape(),z=r.util.objectKeys(k);return this._cached={shape:k,keys:z},this._cached}_parse(k){if(this._getType(k)!==r.ZodParsedType.object){const nt=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(nt,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:nt.parsedType}),o.INVALID}const{status:Y,ctx:re}=this._processInputParams(k),{shape:ie,keys:Pe}=this._getCached(),Ce=[];if(!(this._def.catchall instanceof Ye&&this._def.unknownKeys==="strip"))for(const nt in re.data)Pe.includes(nt)||Ce.push(nt);const Xe=[];for(const nt of Pe){const wt=ie[nt],Qr=re.data[nt];Xe.push({key:{status:"valid",value:nt},value:wt._parse(new i(re,Qr,re.path,nt)),alwaysSet:nt in re.data})}if(this._def.catchall instanceof Ye){const nt=this._def.unknownKeys;if(nt==="passthrough")for(const wt of Ce)Xe.push({key:{status:"valid",value:wt},value:{status:"valid",value:re.data[wt]}});else if(nt==="strict")Ce.length>0&&((0,o.addIssueToContext)(re,{code:e.ZodIssueCode.unrecognized_keys,keys:Ce}),Y.dirty());else if(nt!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const nt=this._def.catchall;for(const wt of Ce){const Qr=re.data[wt];Xe.push({key:{status:"valid",value:wt},value:nt._parse(new i(re,Qr,re.path,wt)),alwaysSet:wt in re.data})}}return re.common.async?Promise.resolve().then(async()=>{const nt=[];for(const wt of Xe){const Qr=await wt.key,Nr=await wt.value;nt.push({key:Qr,value:Nr,alwaysSet:wt.alwaysSet})}return nt}).then(nt=>o.ParseStatus.mergeObjectSync(Y,nt)):o.ParseStatus.mergeObjectSync(Y,Xe)}get shape(){return this._def.shape()}strict(k){return n.errorUtil.errToObj,new Mt({...this._def,unknownKeys:"strict",...k!==void 0?{errorMap:(z,Y)=>{const re=this._def.errorMap?.(z,Y).message??Y.defaultError;return z.code==="unrecognized_keys"?{message:n.errorUtil.errToObj(k).message??re}:{message:re}}}:{}})}strip(){return new Mt({...this._def,unknownKeys:"strip"})}passthrough(){return new Mt({...this._def,unknownKeys:"passthrough"})}extend(k){return new Mt({...this._def,shape:()=>({...this._def.shape(),...k})})}merge(k){return new Mt({unknownKeys:k._def.unknownKeys,catchall:k._def.catchall,shape:()=>({...this._def.shape(),...k._def.shape()}),typeName:it.ZodObject})}setKey(k,z){return this.augment({[k]:z})}catchall(k){return new Mt({...this._def,catchall:k})}pick(k){const z={};for(const Y of r.util.objectKeys(k))k[Y]&&this.shape[Y]&&(z[Y]=this.shape[Y]);return new Mt({...this._def,shape:()=>z})}omit(k){const z={};for(const Y of r.util.objectKeys(this.shape))k[Y]||(z[Y]=this.shape[Y]);return new Mt({...this._def,shape:()=>z})}deepPartial(){return tn(this)}partial(k){const z={};for(const Y of r.util.objectKeys(this.shape)){const re=this.shape[Y];k&&!k[Y]?z[Y]=re:z[Y]=re.optional()}return new Mt({...this._def,shape:()=>z})}required(k){const z={};for(const Y of r.util.objectKeys(this.shape))if(k&&!k[Y])z[Y]=this.shape[Y];else{let ie=this.shape[Y];for(;ie instanceof Ct;)ie=ie._def.innerType;z[Y]=ie}return new Mt({...this._def,shape:()=>z})}keyof(){return Zi(r.util.objectKeys(this.shape))}}fe.ZodObject=Mt,Mt.create=(oe,k)=>new Mt({shape:()=>oe,unknownKeys:"strip",catchall:Ye.create(),typeName:it.ZodObject,...a(k)}),Mt.strictCreate=(oe,k)=>new Mt({shape:()=>oe,unknownKeys:"strict",catchall:Ye.create(),typeName:it.ZodObject,...a(k)}),Mt.lazycreate=(oe,k)=>new Mt({shape:oe,unknownKeys:"strip",catchall:Ye.create(),typeName:it.ZodObject,...a(k)});class kn extends c{_parse(k){const{ctx:z}=this._processInputParams(k),Y=this._def.options;function re(ie){for(const Ce of ie)if(Ce.result.status==="valid")return Ce.result;for(const Ce of ie)if(Ce.result.status==="dirty")return z.common.issues.push(...Ce.ctx.common.issues),Ce.result;const Pe=ie.map(Ce=>new e.ZodError(Ce.ctx.common.issues));return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_union,unionErrors:Pe}),o.INVALID}if(z.common.async)return Promise.all(Y.map(async ie=>{const Pe={...z,common:{...z.common,issues:[]},parent:null};return{result:await ie._parseAsync({data:z.data,path:z.path,parent:Pe}),ctx:Pe}})).then(re);{let ie;const Pe=[];for(const Xe of Y){const nt={...z,common:{...z.common,issues:[]},parent:null},wt=Xe._parseSync({data:z.data,path:z.path,parent:nt});if(wt.status==="valid")return wt;wt.status==="dirty"&&!ie&&(ie={result:wt,ctx:nt}),nt.common.issues.length&&Pe.push(nt.common.issues)}if(ie)return z.common.issues.push(...ie.ctx.common.issues),ie.result;const Ce=Pe.map(Xe=>new e.ZodError(Xe));return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_union,unionErrors:Ce}),o.INVALID}}get options(){return this._def.options}}fe.ZodUnion=kn,kn.create=(oe,k)=>new kn({options:oe,typeName:it.ZodUnion,...a(k)});const un=oe=>oe instanceof bi?un(oe.schema):oe instanceof dt?un(oe.innerType()):oe instanceof Xt?[oe.value]:oe instanceof Ae?oe.options:oe instanceof je?r.util.objectValues(oe.enum):oe instanceof Dr?un(oe._def.innerType):oe instanceof _e?[void 0]:oe instanceof Ne?[null]:oe instanceof Ct?[void 0,...un(oe.unwrap())]:oe instanceof On?[null,...un(oe.unwrap())]:oe instanceof zn||oe instanceof Sr?un(oe.unwrap()):oe instanceof Mn?un(oe._def.innerType):[];class zr extends c{_parse(k){const{ctx:z}=this._processInputParams(k);if(z.parsedType!==r.ZodParsedType.object)return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:z.parsedType}),o.INVALID;const Y=this.discriminator,re=z.data[Y],ie=this.optionsMap.get(re);return ie?z.common.async?ie._parseAsync({data:z.data,path:z.path,parent:z}):ie._parseSync({data:z.data,path:z.path,parent:z}):((0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Y]}),o.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(k,z,Y){const re=new Map;for(const ie of z){const Pe=un(ie.shape[k]);if(!Pe.length)throw new Error(`A discriminator value for key \`${k}\` could not be extracted from all schema options`);for(const Ce of Pe){if(re.has(Ce))throw new Error(`Discriminator property ${String(k)} has duplicate value ${String(Ce)}`);re.set(Ce,ie)}}return new zr({typeName:it.ZodDiscriminatedUnion,discriminator:k,options:z,optionsMap:re,...a(Y)})}}fe.ZodDiscriminatedUnion=zr;function Pr(oe,k){const z=(0,r.getParsedType)(oe),Y=(0,r.getParsedType)(k);if(oe===k)return{valid:!0,data:oe};if(z===r.ZodParsedType.object&&Y===r.ZodParsedType.object){const re=r.util.objectKeys(k),ie=r.util.objectKeys(oe).filter(Ce=>re.indexOf(Ce)!==-1),Pe={...oe,...k};for(const Ce of ie){const Xe=Pr(oe[Ce],k[Ce]);if(!Xe.valid)return{valid:!1};Pe[Ce]=Xe.data}return{valid:!0,data:Pe}}else if(z===r.ZodParsedType.array&&Y===r.ZodParsedType.array){if(oe.length!==k.length)return{valid:!1};const re=[];for(let ie=0;ie{if((0,o.isAborted)(ie)||(0,o.isAborted)(Pe))return o.INVALID;const Ce=Pr(ie.value,Pe.value);return Ce.valid?(((0,o.isDirty)(ie)||(0,o.isDirty)(Pe))&&z.dirty(),{status:z.value,value:Ce.data}):((0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_intersection_types}),o.INVALID)};return Y.common.async?Promise.all([this._def.left._parseAsync({data:Y.data,path:Y.path,parent:Y}),this._def.right._parseAsync({data:Y.data,path:Y.path,parent:Y})]).then(([ie,Pe])=>re(ie,Pe)):re(this._def.left._parseSync({data:Y.data,path:Y.path,parent:Y}),this._def.right._parseSync({data:Y.data,path:Y.path,parent:Y}))}}fe.ZodIntersection=Ho,Ho.create=(oe,k,z)=>new Ho({left:oe,right:k,typeName:it.ZodIntersection,...a(z)});class Ir extends c{_parse(k){const{status:z,ctx:Y}=this._processInputParams(k);if(Y.parsedType!==r.ZodParsedType.array)return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:Y.parsedType}),o.INVALID;if(Y.data.lengththis._def.items.length&&((0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z.dirty());const ie=[...Y.data].map((Pe,Ce)=>{const Xe=this._def.items[Ce]||this._def.rest;return Xe?Xe._parse(new i(Y,Pe,Y.path,Ce)):null}).filter(Pe=>!!Pe);return Y.common.async?Promise.all(ie).then(Pe=>o.ParseStatus.mergeArray(z,Pe)):o.ParseStatus.mergeArray(z,ie)}get items(){return this._def.items}rest(k){return new Ir({...this._def,rest:k})}}fe.ZodTuple=Ir,Ir.create=(oe,k)=>{if(!Array.isArray(oe))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ir({items:oe,typeName:it.ZodTuple,rest:null,...a(k)})};class To extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(k){const{status:z,ctx:Y}=this._processInputParams(k);if(Y.parsedType!==r.ZodParsedType.object)return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:Y.parsedType}),o.INVALID;const re=[],ie=this._def.keyType,Pe=this._def.valueType;for(const Ce in Y.data)re.push({key:ie._parse(new i(Y,Ce,Y.path,Ce)),value:Pe._parse(new i(Y,Y.data[Ce],Y.path,Ce)),alwaysSet:Ce in Y.data});return Y.common.async?o.ParseStatus.mergeObjectAsync(z,re):o.ParseStatus.mergeObjectSync(z,re)}get element(){return this._def.valueType}static create(k,z,Y){return z instanceof c?new To({keyType:k,valueType:z,typeName:it.ZodRecord,...a(Y)}):new To({keyType:G.create(),valueType:k,typeName:it.ZodRecord,...a(z)})}}fe.ZodRecord=To;class Kr extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(k){const{status:z,ctx:Y}=this._processInputParams(k);if(Y.parsedType!==r.ZodParsedType.map)return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:Y.parsedType}),o.INVALID;const re=this._def.keyType,ie=this._def.valueType,Pe=[...Y.data.entries()].map(([Ce,Xe],nt)=>({key:re._parse(new i(Y,Ce,Y.path,[nt,"key"])),value:ie._parse(new i(Y,Xe,Y.path,[nt,"value"]))}));if(Y.common.async){const Ce=new Map;return Promise.resolve().then(async()=>{for(const Xe of Pe){const nt=await Xe.key,wt=await Xe.value;if(nt.status==="aborted"||wt.status==="aborted")return o.INVALID;(nt.status==="dirty"||wt.status==="dirty")&&z.dirty(),Ce.set(nt.value,wt.value)}return{status:z.value,value:Ce}})}else{const Ce=new Map;for(const Xe of Pe){const nt=Xe.key,wt=Xe.value;if(nt.status==="aborted"||wt.status==="aborted")return o.INVALID;(nt.status==="dirty"||wt.status==="dirty")&&z.dirty(),Ce.set(nt.value,wt.value)}return{status:z.value,value:Ce}}}}fe.ZodMap=Kr,Kr.create=(oe,k,z)=>new Kr({valueType:k,keyType:oe,typeName:it.ZodMap,...a(z)});class jr extends c{_parse(k){const{status:z,ctx:Y}=this._processInputParams(k);if(Y.parsedType!==r.ZodParsedType.set)return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:Y.parsedType}),o.INVALID;const re=this._def;re.minSize!==null&&Y.data.sizere.maxSize.value&&((0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.too_big,maximum:re.maxSize.value,type:"set",inclusive:!0,exact:!1,message:re.maxSize.message}),z.dirty());const ie=this._def.valueType;function Pe(Xe){const nt=new Set;for(const wt of Xe){if(wt.status==="aborted")return o.INVALID;wt.status==="dirty"&&z.dirty(),nt.add(wt.value)}return{status:z.value,value:nt}}const Ce=[...Y.data.values()].map((Xe,nt)=>ie._parse(new i(Y,Xe,Y.path,nt)));return Y.common.async?Promise.all(Ce).then(Xe=>Pe(Xe)):Pe(Ce)}min(k,z){return new jr({...this._def,minSize:{value:k,message:n.errorUtil.toString(z)}})}max(k,z){return new jr({...this._def,maxSize:{value:k,message:n.errorUtil.toString(z)}})}size(k,z){return this.min(k,z).max(k,z)}nonempty(k){return this.min(1,k)}}fe.ZodSet=jr,jr.create=(oe,k)=>new jr({valueType:oe,minSize:null,maxSize:null,typeName:it.ZodSet,...a(k)});class Go extends c{constructor(){super(...arguments),this.validate=this.implement}_parse(k){const{ctx:z}=this._processInputParams(k);if(z.parsedType!==r.ZodParsedType.function)return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.function,received:z.parsedType}),o.INVALID;function Y(Ce,Xe){return(0,o.makeIssue)({data:Ce,path:z.path,errorMaps:[z.common.contextualErrorMap,z.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(nt=>!!nt),issueData:{code:e.ZodIssueCode.invalid_arguments,argumentsError:Xe}})}function re(Ce,Xe){return(0,o.makeIssue)({data:Ce,path:z.path,errorMaps:[z.common.contextualErrorMap,z.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(nt=>!!nt),issueData:{code:e.ZodIssueCode.invalid_return_type,returnTypeError:Xe}})}const ie={errorMap:z.common.contextualErrorMap},Pe=z.data;if(this._def.returns instanceof ot){const Ce=this;return(0,o.OK)(async function(...Xe){const nt=new e.ZodError([]),wt=await Ce._def.args.parseAsync(Xe,ie).catch(Ql=>{throw nt.addIssue(Y(Xe,Ql)),nt}),Qr=await Reflect.apply(Pe,this,wt);return await Ce._def.returns._def.type.parseAsync(Qr,ie).catch(Ql=>{throw nt.addIssue(re(Qr,Ql)),nt})})}else{const Ce=this;return(0,o.OK)(function(...Xe){const nt=Ce._def.args.safeParse(Xe,ie);if(!nt.success)throw new e.ZodError([Y(Xe,nt.error)]);const wt=Reflect.apply(Pe,this,nt.data),Qr=Ce._def.returns.safeParse(wt,ie);if(!Qr.success)throw new e.ZodError([re(wt,Qr.error)]);return Qr.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...k){return new Go({...this._def,args:Ir.create(k).rest(Me.create())})}returns(k){return new Go({...this._def,returns:k})}implement(k){return this.parse(k)}strictImplement(k){return this.parse(k)}static create(k,z,Y){return new Go({args:k||Ir.create([]).rest(Me.create()),returns:z||Me.create(),typeName:it.ZodFunction,...a(Y)})}}fe.ZodFunction=Go;class bi extends c{get schema(){return this._def.getter()}_parse(k){const{ctx:z}=this._processInputParams(k);return this._def.getter()._parse({data:z.data,path:z.path,parent:z})}}fe.ZodLazy=bi,bi.create=(oe,k)=>new bi({getter:oe,typeName:it.ZodLazy,...a(k)});class Xt extends c{_parse(k){if(k.data!==this._def.value){const z=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(z,{received:z.data,code:e.ZodIssueCode.invalid_literal,expected:this._def.value}),o.INVALID}return{status:"valid",value:k.data}}get value(){return this._def.value}}fe.ZodLiteral=Xt,Xt.create=(oe,k)=>new Xt({value:oe,typeName:it.ZodLiteral,...a(k)});function Zi(oe,k){return new Ae({values:oe,typeName:it.ZodEnum,...a(k)})}class Ae extends c{_parse(k){if(typeof k.data!="string"){const z=this._getOrReturnCtx(k),Y=this._def.values;return(0,o.addIssueToContext)(z,{expected:r.util.joinValues(Y),received:z.parsedType,code:e.ZodIssueCode.invalid_type}),o.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(k.data)){const z=this._getOrReturnCtx(k),Y=this._def.values;return(0,o.addIssueToContext)(z,{received:z.data,code:e.ZodIssueCode.invalid_enum_value,options:Y}),o.INVALID}return(0,o.OK)(k.data)}get options(){return this._def.values}get enum(){const k={};for(const z of this._def.values)k[z]=z;return k}get Values(){const k={};for(const z of this._def.values)k[z]=z;return k}get Enum(){const k={};for(const z of this._def.values)k[z]=z;return k}extract(k,z=this._def){return Ae.create(k,{...this._def,...z})}exclude(k,z=this._def){return Ae.create(this.options.filter(Y=>!k.includes(Y)),{...this._def,...z})}}fe.ZodEnum=Ae,Ae.create=Zi;class je extends c{_parse(k){const z=r.util.getValidEnumValues(this._def.values),Y=this._getOrReturnCtx(k);if(Y.parsedType!==r.ZodParsedType.string&&Y.parsedType!==r.ZodParsedType.number){const re=r.util.objectValues(z);return(0,o.addIssueToContext)(Y,{expected:r.util.joinValues(re),received:Y.parsedType,code:e.ZodIssueCode.invalid_type}),o.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(k.data)){const re=r.util.objectValues(z);return(0,o.addIssueToContext)(Y,{received:Y.data,code:e.ZodIssueCode.invalid_enum_value,options:re}),o.INVALID}return(0,o.OK)(k.data)}get enum(){return this._def.values}}fe.ZodNativeEnum=je,je.create=(oe,k)=>new je({values:oe,typeName:it.ZodNativeEnum,...a(k)});class ot extends c{unwrap(){return this._def.type}_parse(k){const{ctx:z}=this._processInputParams(k);if(z.parsedType!==r.ZodParsedType.promise&&z.common.async===!1)return(0,o.addIssueToContext)(z,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:z.parsedType}),o.INVALID;const Y=z.parsedType===r.ZodParsedType.promise?z.data:Promise.resolve(z.data);return(0,o.OK)(Y.then(re=>this._def.type.parseAsync(re,{path:z.path,errorMap:z.common.contextualErrorMap})))}}fe.ZodPromise=ot,ot.create=(oe,k)=>new ot({type:oe,typeName:it.ZodPromise,...a(k)});class dt extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===it.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(k){const{status:z,ctx:Y}=this._processInputParams(k),re=this._def.effect||null,ie={addIssue:Pe=>{(0,o.addIssueToContext)(Y,Pe),Pe.fatal?z.abort():z.dirty()},get path(){return Y.path}};if(ie.addIssue=ie.addIssue.bind(ie),re.type==="preprocess"){const Pe=re.transform(Y.data,ie);if(Y.common.async)return Promise.resolve(Pe).then(async Ce=>{if(z.value==="aborted")return o.INVALID;const Xe=await this._def.schema._parseAsync({data:Ce,path:Y.path,parent:Y});return Xe.status==="aborted"?o.INVALID:Xe.status==="dirty"||z.value==="dirty"?(0,o.DIRTY)(Xe.value):Xe});{if(z.value==="aborted")return o.INVALID;const Ce=this._def.schema._parseSync({data:Pe,path:Y.path,parent:Y});return Ce.status==="aborted"?o.INVALID:Ce.status==="dirty"||z.value==="dirty"?(0,o.DIRTY)(Ce.value):Ce}}if(re.type==="refinement"){const Pe=Ce=>{const Xe=re.refinement(Ce,ie);if(Y.common.async)return Promise.resolve(Xe);if(Xe instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Ce};if(Y.common.async===!1){const Ce=this._def.schema._parseSync({data:Y.data,path:Y.path,parent:Y});return Ce.status==="aborted"?o.INVALID:(Ce.status==="dirty"&&z.dirty(),Pe(Ce.value),{status:z.value,value:Ce.value})}else return this._def.schema._parseAsync({data:Y.data,path:Y.path,parent:Y}).then(Ce=>Ce.status==="aborted"?o.INVALID:(Ce.status==="dirty"&&z.dirty(),Pe(Ce.value).then(()=>({status:z.value,value:Ce.value}))))}if(re.type==="transform")if(Y.common.async===!1){const Pe=this._def.schema._parseSync({data:Y.data,path:Y.path,parent:Y});if(!(0,o.isValid)(Pe))return o.INVALID;const Ce=re.transform(Pe.value,ie);if(Ce instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:z.value,value:Ce}}else return this._def.schema._parseAsync({data:Y.data,path:Y.path,parent:Y}).then(Pe=>(0,o.isValid)(Pe)?Promise.resolve(re.transform(Pe.value,ie)).then(Ce=>({status:z.value,value:Ce})):o.INVALID);r.util.assertNever(re)}}fe.ZodEffects=dt,fe.ZodTransformer=dt,dt.create=(oe,k,z)=>new dt({schema:oe,typeName:it.ZodEffects,effect:k,...a(z)}),dt.createWithPreprocess=(oe,k,z)=>new dt({schema:k,effect:{type:"preprocess",transform:oe},typeName:it.ZodEffects,...a(z)});class Ct extends c{_parse(k){return this._getType(k)===r.ZodParsedType.undefined?(0,o.OK)(void 0):this._def.innerType._parse(k)}unwrap(){return this._def.innerType}}fe.ZodOptional=Ct,Ct.create=(oe,k)=>new Ct({innerType:oe,typeName:it.ZodOptional,...a(k)});class On extends c{_parse(k){return this._getType(k)===r.ZodParsedType.null?(0,o.OK)(null):this._def.innerType._parse(k)}unwrap(){return this._def.innerType}}fe.ZodNullable=On,On.create=(oe,k)=>new On({innerType:oe,typeName:it.ZodNullable,...a(k)});class Dr extends c{_parse(k){const{ctx:z}=this._processInputParams(k);let Y=z.data;return z.parsedType===r.ZodParsedType.undefined&&(Y=this._def.defaultValue()),this._def.innerType._parse({data:Y,path:z.path,parent:z})}removeDefault(){return this._def.innerType}}fe.ZodDefault=Dr,Dr.create=(oe,k)=>new Dr({innerType:oe,typeName:it.ZodDefault,defaultValue:typeof k.default=="function"?k.default:()=>k.default,...a(k)});class Mn extends c{_parse(k){const{ctx:z}=this._processInputParams(k),Y={...z,common:{...z.common,issues:[]}},re=this._def.innerType._parse({data:Y.data,path:Y.path,parent:{...Y}});return(0,o.isAsync)(re)?re.then(ie=>({status:"valid",value:ie.status==="valid"?ie.value:this._def.catchValue({get error(){return new e.ZodError(Y.common.issues)},input:Y.data})})):{status:"valid",value:re.status==="valid"?re.value:this._def.catchValue({get error(){return new e.ZodError(Y.common.issues)},input:Y.data})}}removeCatch(){return this._def.innerType}}fe.ZodCatch=Mn,Mn.create=(oe,k)=>new Mn({innerType:oe,typeName:it.ZodCatch,catchValue:typeof k.catch=="function"?k.catch:()=>k.catch,...a(k)});class cn extends c{_parse(k){if(this._getType(k)!==r.ZodParsedType.nan){const Y=this._getOrReturnCtx(k);return(0,o.addIssueToContext)(Y,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:Y.parsedType}),o.INVALID}return{status:"valid",value:k.data}}}fe.ZodNaN=cn,cn.create=oe=>new cn({typeName:it.ZodNaN,...a(oe)}),fe.BRAND=Symbol("zod_brand");class zn extends c{_parse(k){const{ctx:z}=this._processInputParams(k),Y=z.data;return this._def.type._parse({data:Y,path:z.path,parent:z})}unwrap(){return this._def.type}}fe.ZodBranded=zn;class qt extends c{_parse(k){const{status:z,ctx:Y}=this._processInputParams(k);if(Y.common.async)return(async()=>{const ie=await this._def.in._parseAsync({data:Y.data,path:Y.path,parent:Y});return ie.status==="aborted"?o.INVALID:ie.status==="dirty"?(z.dirty(),(0,o.DIRTY)(ie.value)):this._def.out._parseAsync({data:ie.value,path:Y.path,parent:Y})})();{const re=this._def.in._parseSync({data:Y.data,path:Y.path,parent:Y});return re.status==="aborted"?o.INVALID:re.status==="dirty"?(z.dirty(),{status:"dirty",value:re.value}):this._def.out._parseSync({data:re.value,path:Y.path,parent:Y})}}static create(k,z){return new qt({in:k,out:z,typeName:it.ZodPipeline})}}fe.ZodPipeline=qt;class Sr extends c{_parse(k){const z=this._def.innerType._parse(k),Y=re=>((0,o.isValid)(re)&&(re.value=Object.freeze(re.value)),re);return(0,o.isAsync)(z)?z.then(re=>Y(re)):Y(z)}unwrap(){return this._def.innerType}}fe.ZodReadonly=Sr,Sr.create=(oe,k)=>new Sr({innerType:oe,typeName:it.ZodReadonly,...a(k)});function Kn(oe,k){const z=typeof oe=="function"?oe(k):typeof oe=="string"?{message:oe}:oe;return typeof z=="string"?{message:z}:z}function vp(oe,k={},z){return oe?Ie.create().superRefine((Y,re)=>{const ie=oe(Y);if(ie instanceof Promise)return ie.then(Pe=>{if(!Pe){const Ce=Kn(k,Y),Xe=Ce.fatal??z??!0;re.addIssue({code:"custom",...Ce,fatal:Xe})}});if(!ie){const Pe=Kn(k,Y),Ce=Pe.fatal??z??!0;re.addIssue({code:"custom",...Pe,fatal:Ce})}}):Ie.create()}fe.late={object:Mt.lazycreate};var it;(function(oe){oe.ZodString="ZodString",oe.ZodNumber="ZodNumber",oe.ZodNaN="ZodNaN",oe.ZodBigInt="ZodBigInt",oe.ZodBoolean="ZodBoolean",oe.ZodDate="ZodDate",oe.ZodSymbol="ZodSymbol",oe.ZodUndefined="ZodUndefined",oe.ZodNull="ZodNull",oe.ZodAny="ZodAny",oe.ZodUnknown="ZodUnknown",oe.ZodNever="ZodNever",oe.ZodVoid="ZodVoid",oe.ZodArray="ZodArray",oe.ZodObject="ZodObject",oe.ZodUnion="ZodUnion",oe.ZodDiscriminatedUnion="ZodDiscriminatedUnion",oe.ZodIntersection="ZodIntersection",oe.ZodTuple="ZodTuple",oe.ZodRecord="ZodRecord",oe.ZodMap="ZodMap",oe.ZodSet="ZodSet",oe.ZodFunction="ZodFunction",oe.ZodLazy="ZodLazy",oe.ZodLiteral="ZodLiteral",oe.ZodEnum="ZodEnum",oe.ZodEffects="ZodEffects",oe.ZodNativeEnum="ZodNativeEnum",oe.ZodOptional="ZodOptional",oe.ZodNullable="ZodNullable",oe.ZodDefault="ZodDefault",oe.ZodCatch="ZodCatch",oe.ZodPromise="ZodPromise",oe.ZodBranded="ZodBranded",oe.ZodPipeline="ZodPipeline",oe.ZodReadonly="ZodReadonly"})(it||(fe.ZodFirstPartyTypeKind=it={}));const Fs=(oe,k={message:`Input not instance of ${oe.name}`})=>vp(z=>z instanceof oe,k);fe.instanceof=Fs;const zo=G.create;fe.string=zo;const yi=le.create;fe.number=yi;const Sp=cn.create;fe.nan=Sp;const Gl=K.create;fe.bigint=Gl;const bb=X.create;fe.boolean=bb;const yb=ce.create;fe.date=yb;const Cp=W.create;fe.symbol=Cp;const xs=_e.create;fe.undefined=xs;const es=Ne.create;fe.null=es;const Ab=Ie.create;fe.any=Ab;const _b=Me.create;fe.unknown=_b;const vb=Ye.create;fe.never=vb;const Bm=ct.create;fe.void=Bm;const km=Pt.create;fe.array=km;const Ro=Mt.create;fe.object=Ro;const Sb=Mt.strictCreate;fe.strictObject=Sb;const Ai=kn.create;fe.union=Ai;const Un=zr.create;fe.discriminatedUnion=Un;const Cr=Ho.create;fe.intersection=Cr;const Bs=Ir.create;fe.tuple=Bs;const _i=To.create;fe.record=_i;const o_=Kr.create;fe.map=o_;const i_=jr.create;fe.set=i_;const Cb=Go.create;fe.function=Cb;const zl=bi.create;fe.lazy=zl;const Um=Xt.create;fe.literal=Um;const ao=Ae.create;fe.enum=ao;const ks=je.create;fe.nativeEnum=ks;const Kl=ot.create;fe.promise=Kl;const ts=dt.create;fe.effect=ts,fe.transformer=ts;const jn=Ct.create;fe.optional=jn;const wb=On.create;fe.nullable=wb;const Ob=dt.createWithPreprocess;fe.preprocess=Ob;const vi=qt.create;fe.pipeline=vi;const Ko=()=>zo().optional();fe.ostring=Ko;const s_=()=>yi().optional();fe.onumber=s_;const wp=()=>bb().optional();return fe.oboolean=wp,fe.coerce={string:(oe=>G.create({...oe,coerce:!0})),number:(oe=>le.create({...oe,coerce:!0})),boolean:(oe=>X.create({...oe,coerce:!0})),bigint:(oe=>K.create({...oe,coerce:!0})),date:(oe=>ce.create({...oe,coerce:!0}))},fe.NEVER=o.INVALID,fe}var lH;function SE(){return lH||(lH=1,(function(e){var t=cg&&cg.__createBinding||(Object.create?(function(o,r,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(r,i);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,s,a)}):(function(o,r,i,s){s===void 0&&(s=i),o[s]=r[i]})),n=cg&&cg.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(xx(),e),n(gie(),e),n(yqe(),e),n(sP(),e),n(_qe(),e),n(Fx(),e)})(cg)),cg}var uH;function ne(){return uH||(uH=1,(function(e){var t=ls&&ls.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=ls&&ls.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=ls&&ls.__importStar||function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var c in s)c!=="default"&&Object.prototype.hasOwnProperty.call(s,c)&&t(a,s,c);return n(a,s),a},r=ls&&ls.__exportStar||function(s,a){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&t(a,s,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const i=o(SE());e.z=i,r(SE(),e),e.default=i})(ls)),ls}var cH;function bie(){if(cH)return fr;cH=1;var e=fr&&fr.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),t=fr&&fr.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),n=fr&&fr.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;hl.charCodeAt(0))}function s(u){return new TextEncoder().encode(u)}function a(u){return new TextDecoder().decode(u)}function c(u){return r(s(u))}function p(u){return a(i(u))}return fr.zodOutbound=o.instanceof(Uint8Array).or(o.string().transform(s)),fr.zodInbound=o.instanceof(Uint8Array).or(o.string().transform(i)),fr}var eN={},yT={},dH;function yie(){if(dH)return yT;dH=1,Object.defineProperty(yT,"__esModule",{value:!0}),yT.isPlainObject=e;function e(t){if(typeof t!="object"||t===null)return!1;const n=Object.getPrototypeOf(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}return yT}var fH;function $e(){return fH||(fH=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeDeepObjectQuery=e.encodePipeDelimitedQuery=e.encodeSpaceDelimitedQuery=e.encodeFormQuery=e.encodeJSONQuery=e.encodeSimple=e.encodePipeDelimited=e.encodeSpaceDelimited=e.encodeForm=e.EncodingError=void 0,e.encodeMatrix=r,e.encodeLabel=i,e.encodeBodyForm=a,e.encodeDeepObject=c,e.encodeDeepObjectObject=p,e.encodeJSON=u,e.queryJoin=y,e.queryEncoder=_,e.appendForm=S;const t=bie(),n=yie();class o extends Error{constructor(R){super(R),this.name="EncodingError"}}e.EncodingError=o;function r(w,R,E){let T="";const D=E?.explode?d(w,R):[[w,R]];if(D.every(([L,q])=>q==null))return;const B=L=>E?.charEncoding==="percent"?encodeURIComponent(L):L,N=L=>B(f(L));return D.forEach(([L,q])=>{let I="",U=null;if(q==null||(Array.isArray(q)?U=m(q,V=>`${N(V)}`)?.join(","):(0,n.isPlainObject)(q)?U=g(Object.entries(q),([G,Q])=>`,${B(G)},${N(Q)}`)?.join("").slice(1):U=`${N(q)}`,U==null))return;const J=B(L);I=`${J}=${U}`,I===`${J}=`&&(I=I.slice(0,-1)),I&&(T+=`;${I}`)}),T}function i(w,R,E){let T="";const D=E?.explode?d(w,R):[[w,R]];if(D.every(([L,q])=>q==null))return;const B=L=>E?.charEncoding==="percent"?encodeURIComponent(L):L,N=L=>B(f(L));return D.forEach(([L,q])=>{let I="";q!=null&&(Array.isArray(q)?I=m(q,U=>`${N(U)}`)?.join("."):(0,n.isPlainObject)(q)?I=g(Object.entries(q),([J,V])=>`.${B(J)}.${N(V)}`)?.join("").slice(1):I=`${E?.explode&&(0,n.isPlainObject)(R)?`${B(L)}=`:""}${N(q)}`,T+=I==null?"":`.${I}`)}),T}function s(w){return(R,E,T)=>{let D="";const B=T?.explode?d(R,E):[[R,E]];if(B.every(([I,U])=>U==null))return;const N=I=>T?.charEncoding==="percent"?encodeURIComponent(I):I,L=I=>N(f(I)),q=N(w);return B.forEach(([I,U])=>{let J="",V=null;U!=null&&(Array.isArray(U)?V=m(U,G=>`${L(G)}`)?.join(q):(0,n.isPlainObject)(U)?V=g(Object.entries(U),([G,Q])=>`${N(G)}${q}${L(Q)}`)?.join(q):V=`${L(U)}`,V!=null&&(J=`${N(I)}=${V}`,!(!J||J==="=")&&(D+=`&${J}`)))}),D.slice(1)}}e.encodeForm=s(","),e.encodeSpaceDelimited=s(" "),e.encodePipeDelimited=s("|");function a(w,R,E){let T="";const D=E?.explode?d(w,R):[[w,R]],B=L=>E?.charEncoding==="percent"?encodeURIComponent(L):L,N=L=>B(f(L));return D.forEach(([L,q])=>{let I="",U="";q!=null&&(Array.isArray(q)||(0,n.isPlainObject)(q)?U=JSON.stringify(q,h):U=`${N(q)}`,I=`${B(L)}=${U}`,!(!I||I==="=")&&(T+=`&${I}`))}),T.slice(1)}function c(w,R,E){if(R!=null){if(!(0,n.isPlainObject)(R))throw new o(`Value of parameter '${w}' which uses deepObject encoding must be an object or null`);return p(w,R,E)}}function p(w,R,E){if(R==null)return;let T="";const D=B=>E?.charEncoding==="percent"?encodeURIComponent(B):B;if(!(0,n.isPlainObject)(R))throw new o(`Expected parameter '${w}' to be an object.`);return Object.entries(R).forEach(([B,N])=>{if(N==null)return;const L=`${w}[${B}]`;if((0,n.isPlainObject)(N)){const U=p(L,N,E);T+=U==null?"":`&${U}`;return}const q=Array.isArray(N)?N:[N],I=m(q,U=>`${D(L)}=${D(f(U))}`)?.join("&");T+=I==null?"":`&${I}`}),T.slice(1)}function u(w,R,E){if(typeof R>"u")return;const T=B=>E?.charEncoding==="percent"?encodeURIComponent(B):B,D=T(JSON.stringify(R,h));return E?.explode?D:`${T(w)}=${D}`}const l=(w,R,E)=>{let T="";const D=E?.explode?d(w,R):[[w,R]];if(D.every(([L,q])=>q==null))return;const B=L=>E?.charEncoding==="percent"?encodeURIComponent(L):L,N=L=>B(f(L));return D.forEach(([L,q])=>{let I="";q!=null&&(Array.isArray(q)?I=m(q,U=>`${N(U)}`)?.join(","):(0,n.isPlainObject)(q)?I=g(Object.entries(q),([J,V])=>`,${B(J)},${N(V)}`)?.join("").slice(1):I=`${E?.explode&&(0,n.isPlainObject)(R)?`${L}=`:""}${N(q)}`,T+=I?`,${I}`:"")}),T.slice(1)};e.encodeSimple=l;function d(w,R){return Array.isArray(R)?R.map(E=>[w,E]):(0,n.isPlainObject)(R)?Object.entries(R??{}).map(([T,D])=>[T,D]):[[w,R]]}function f(w){return w==null?"":w instanceof Date?w.toISOString():w instanceof Uint8Array?(0,t.bytesToBase64)(w):typeof w=="object"?JSON.stringify(w,h):`${w}`}function h(w,R){return R instanceof Uint8Array?(0,t.bytesToBase64)(R):R}function m(w,R){const E=w.reduce((T,D)=>{if(D==null)return T;const B=R(D);return B==null||T.push(B),T},[]);return E.length?E:null}function g(w,R){const E=[];for(const[T,D]of w){if(D==null)continue;const B=R([T,D]);B!=null&&E.push(B)}return E.length?E:null}function y(...w){return w.filter(Boolean).join("&")}function _(w){return function(E,T){const D={...T,explode:T?.explode??!0,charEncoding:T?.charEncoding??"percent"},B=Object.entries(E).map(([N,L])=>w(N,L,D));return y(...B)}}e.encodeJSONQuery=_(u),e.encodeFormQuery=_(e.encodeForm),e.encodeSpaceDelimitedQuery=_(e.encodeSpaceDelimited),e.encodePipeDelimitedQuery=_(e.encodePipeDelimited),e.encodeDeepObjectQuery=_(c);function S(w,R,E,T){E!=null&&(E instanceof Blob&&T?w.append(R,E,T):E instanceof Blob?w.append(R,E):w.append(R,String(E)))}})(eN)),eN}var vu={},AT={},hH;function vqe(){if(hH)return AT;hH=1,Object.defineProperty(AT,"__esModule",{value:!0}),AT.dlv=e;function e(t,n,o,r,i){for(n=Array.isArray(n)?n:n.split("."),r=0;r"u"&&(this.cause=f?.cause),Object.setPrototypeOf(this,n.prototype)}}tm.PermanentError=n;class o extends Error{constructor(d,f){super(d),this.response=f,this.name="TemporaryError",Object.setPrototypeOf(this,o.prototype)}}tm.TemporaryError=o;async function r(l,d){return d.config.strategy==="backoff"?c(i(l,{statusCodes:d.statusCodes,retryConnectionErrors:!!d.config.retryConnectionErrors}),d.config.backoff??t):await l()}function i(l,d){return async()=>{try{const f=await l();if(a(f,d.statusCodes))throw new o("Response failed with retryable status code",f);return f}catch(f){throw f instanceof o||d.retryConnectionErrors&&((0,e.isTimeoutError)(f)||(0,e.isConnectionError)(f))?f:new n("Permanent error",{cause:f})}}}const s=new RegExp("^[0-9]xx$","i");function a(l,d){const f=`${l.status}`;return d.some(h=>{if(!s.test(h))return h===f;const m=h.charAt(0);if(!m)throw new Error("Invalid status code range");const g=f.charAt(0);if(!g)throw new Error(`Invalid response status code: ${f}`);return g===m})}async function c(l,d){const{maxElapsedTime:f,initialInterval:h,exponent:m,maxInterval:g}=d,y=Date.now();let _=0;for(;;)try{return await l()}catch(S){if(S instanceof n)throw S.cause;if(Date.now()-y>f){if(S instanceof o)return S.response;throw S}let R=0;S instanceof o&&(R=p(S.response)),R<=0&&(R=h*Math.pow(_,m)+Math.random()*1e3);const E=Math.min(R,g);await u(E),_++}}function p(l){const d=l.headers.get("retry-after")||"";if(!d)return 0;const f=Number(d);if(Number.isInteger(f))return f*1e3;const h=Date.parse(d);if(Number.isInteger(h)){const m=h-Date.now();return m>0?Math.ceil(m):0}return 0}async function u(l){return new Promise(d=>setTimeout(d,l))}return tm}var gH;function Gn(){if(gH)return yu;gH=1;var e=yu&&yu.__classPrivateFieldSet||function(E,T,D,B,N){if(B==="m")throw new TypeError("Private method is not writable");if(B==="a"&&!N)throw new TypeError("Private accessor was defined without a setter");if(typeof T=="function"?E!==T||!N:!T.has(E))throw new TypeError("Cannot write private member to an object whose class did not declare it");return B==="a"?N.call(E,D):N?N.value=D:T.set(E,D),D},t=yu&&yu.__classPrivateFieldGet||function(E,T,D,B){if(D==="a"&&!B)throw new TypeError("Private accessor was defined without a getter");if(typeof T=="function"?E!==T||!B:!T.has(E))throw new TypeError("Cannot read private member from an object whose class did not declare it");return D==="m"?B:D==="a"?B.call(E):B?B.value:T.get(E)},n,o,r;Object.defineProperty(yu,"__esModule",{value:!0}),yu.ClientSDK=void 0;const i=bqe(),s=hie(),a=Ar(),c=bie(),p=Lx(),u=$e(),l=Aie(),d=iP(),f=Sqe(),h=typeof globalThis>"u"?null:globalThis,g=typeof h=="object"&&h!=null&&"importScripts"in h&&typeof h.importScripts=="function"||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u";class y{constructor(T={}){n.set(this,void 0),o.set(this,void 0),r.set(this,void 0);const D=T;typeof D=="object"&&D!=null&&"hooks"in D&&D.hooks instanceof i.SDKHooks?e(this,o,D.hooks,"f"):e(this,o,new i.SDKHooks,"f");const B=(0,p.serverURLFromOptions)(T);B&&(B.pathname=B.pathname.replace(/\/+$/,"")+"/");const{baseURL:N,client:L}=t(this,o,"f").sdkInit({baseURL:B,client:T.httpClient||new d.HTTPClient});this._baseURL=N,e(this,n,L,"f"),this._options={...T,hooks:t(this,o,"f")},e(this,r,this._options.debugLogger,"f"),!t(this,r,"f")&&(0,l.env)().MISTRAL_DEBUG&&e(this,r,console,"f")}_createRequest(T,D,B){const{method:N,path:L,query:q,headers:I,security:U}=D,J=D.baseURL??this._baseURL;if(!J)return(0,a.ERR)(new s.InvalidRequestError("No base URL provided for operation"));const V=new URL(J),G=new URL(L,V);L&&(V.pathname+=V.pathname.endsWith("/")?"":"/",V.pathname+=G.pathname.replace(/^\/+/,""));let Q=q||"";const le=[];for(const[Ye,ct]of Object.entries(U?.queryParams||{})){const Pt=(0,u.encodeForm)(Ye,ct,{charEncoding:"percent"});typeof Pt<"u"&&le.push(Pt)}if(le.length&&(Q+=`&${le.join("&")}`),Q){const Ye=Q.startsWith("&")?Q.slice(1):Q;V.search=`?${Ye}`}const K=new Headers(I),X=U?.basic.username,ce=U?.basic.password;if(X!=null||ce!=null){const Ye=(0,c.stringToBase64)([X||"",ce||""].join(":"));K.set("Authorization",`Basic ${Ye}`)}const W=new Headers(U?.headers||{});for(const[Ye,ct]of W)K.set(Ye,ct);let _e=K.get("cookie")||"";for(const[Ye,ct]of Object.entries(U?.cookies||{}))_e+=`; ${Ye}=${ct}`;_e=_e.startsWith("; ")?_e.slice(2):_e,K.set("cookie",_e);const Ne=new Headers(B?.headers??B?.fetchOptions?.headers);for(const[Ye,ct]of Ne)K.set(Ye,ct);g||K.set(D.uaHeader??"user-agent",D.userAgent??p.SDK_METADATA.userAgent);const Ie={...B?.fetchOptions,...B};if(!Ie?.signal&&D.timeoutMs&&D.timeoutMs>0){const Ye=AbortSignal.timeout(D.timeoutMs);Ie.signal=Ye}D.body instanceof ReadableStream&&Object.assign(Ie,{duplex:"half"});let Me;try{Me=t(this,o,"f").beforeCreateRequest(T,{url:V,options:{...Ie,body:D.body??null,headers:K,method:N}})}catch(Ye){return(0,a.ERR)(new s.UnexpectedClientError("Create request hook failed to execute",{cause:Ye}))}return(0,a.OK)(new Request(Me.url,Me.options))}async _do(T,D){const{context:B,errorCodes:N}=D;return(0,f.retry)(async()=>{const L=await t(this,o,"f").beforeRequest(B,T.clone());await w(t(this,r,"f"),L).catch(I=>t(this,r,"f")?.log("Failed to log request:",I));let q=await t(this,n,"f").request(L);try{if((0,d.matchStatusCode)(q,N)){const I=await t(this,o,"f").afterError(B,q,null);if(I.error)throw I.error;q=I.response||q}else q=await t(this,o,"f").afterSuccess(B,q)}finally{await R(t(this,r,"f"),q,L).catch(I=>t(this,r,"f")?.log("Failed to log response:",I))}return q},{config:D.retryConfig,statusCodes:D.retryCodes}).then(L=>(0,a.OK)(L),L=>{switch(!0){case(0,d.isAbortError)(L):return(0,a.ERR)(new s.RequestAbortedError("Request aborted by client",{cause:L}));case(0,d.isTimeoutError)(L):return(0,a.ERR)(new s.RequestTimeoutError("Request timed out",{cause:L}));case(0,d.isConnectionError)(L):return(0,a.ERR)(new s.ConnectionError("Unable to make request",{cause:L}));default:return(0,a.ERR)(new s.UnexpectedClientError("Unexpected HTTP client error",{cause:L}))}})}}yu.ClientSDK=y,n=new WeakMap,o=new WeakMap,r=new WeakMap;const _=/(application|text)\/.*?\+*json.*/,S=/(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/;async function w(E,T){if(!E)return;const D=T.headers.get("content-type"),B=D?.split(";")[0]||"";E.group(`> Request: ${T.method} ${T.url}`),E.group("Headers:");for(const[N,L]of T.headers.entries())E.log(`${N}: ${L}`);switch(E.groupEnd(),E.group("Body:"),!0){case _.test(B):E.log(await T.clone().json());break;case B.startsWith("text/"):E.log(await T.clone().text());break;case B==="multipart/form-data":{const N=await T.clone().formData();for(const[L,q]of N){const I=q instanceof Blob?"":q;E.log(`${L}: ${I}`)}break}default:E.log(`<${D}>`);break}E.groupEnd(),E.groupEnd()}async function R(E,T,D){if(!E)return;const B=T.headers.get("content-type"),N=B?.split(";")[0]||"";E.group(`< Response: ${D.method} ${D.url}`),E.log("Status Code:",T.status,T.statusText),E.group("Headers:");for(const[L,q]of T.headers.entries())E.log(`${L}: ${q}`);switch(E.groupEnd(),E.group("Body:"),!0){case((0,d.matchContentType)(T,"application/json")||_.test(N)&&!S.test(N)):E.log(await T.clone().json());break;case((0,d.matchContentType)(T,"application/jsonl")||S.test(N)):E.log(await T.clone().text());break;case(0,d.matchContentType)(T,"text/event-stream"):E.log(`<${B}>`);break;case(0,d.matchContentType)(T,"text/*"):E.log(await T.clone().text());break;case(0,d.matchContentType)(T,"multipart/form-data"):{const L=await T.clone().formData();for(const[q,I]of L){const U=I instanceof Blob?"":I;E.log(`${q}: ${U}`)}break}default:E.log(`<${B}>`);break}E.groupEnd(),E.groupEnd()}return yu}var Sv={},$s={},Xn={},us={},Cv={},bH;function Bx(){if(bH)return Cv;bH=1,Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.MistralError=void 0;class e extends Error{constructor(n,o){super(n),this.statusCode=o.response.status,this.body=o.body,this.headers=o.response.headers,this.contentType=o.response.headers.get("content-type")||"",this.rawResponse=o.response,this.name="MistralError"}}return Cv.MistralError=e,Cv}var Ni={},yH;function kx(){if(yH)return Ni;yH=1;var e=Ni&&Ni.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),t=Ni&&Ni.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),n=Ni&&Ni.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u0?`│${c}`:c,c+=" ".repeat(a);let p="";const u=f=>p+=` +${c}${f}`,l=s.issues.length,d=l===1?`${l} issue found`:`${l} issues found`;l&&u(`┌ ${d}:`);for(const f of s.issues){let h=f.path.join(".");switch(h=h?`.${h}`:"",u(`│ • [${h}]: ${f.message} (${f.code})`),f.code){case"invalid_literal":case"invalid_type":{u(`│ Want: ${f.expected}`),u(`│ Got: ${f.received}`);break}case"unrecognized_keys":{u(`│ Keys: ${f.keys.join(", ")}`);break}case"invalid_enum_value":{u(`│ Allowed: ${f.options.join(", ")}`),u(`│ Got: ${f.received}`);break}case"invalid_union_discriminator":{u(`│ Allowed: ${f.options.join(", ")}`);break}case"invalid_union":{const m=f.unionErrors.length;u(`│ ✖︎ Attemped to deserialize into one of ${m} union members:`),f.unionErrors.forEach((g,y)=>{u(`│ ✖︎ Member ${y+1} of ${m}`),u(`${i(g,a+1)}`)})}}}return s.issues.length&&u("└─*"),p.slice(1)}return Ni}var AH;function _ie(){if(AH)return us;AH=1;var e=us&&us.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),t=us&&us.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),n=us&&us.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;l100?` +`:". ";let a=s;if(s.length>1e4){const c=s.substring(0,1e4),p=s.length-1e4;a=`${c}...and ${p} more chars`}o+=`Body: ${a}`,o=o.trim(),super(o,r),this.name="SDKError"}}return wv.SDKError=t,wv}var vH;function Ge(){if(vH)return Xn;vH=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.jsonErr=s,Xn.json=a,Xn.jsonl=c,Xn.jsonlErr=p,Xn.textErr=u,Xn.text=l,Xn.bytesErr=d,Xn.bytes=f,Xn.streamErr=h,Xn.stream=m,Xn.sseErr=g,Xn.sse=y,Xn.nilErr=_,Xn.nil=S,Xn.fail=w,Xn.match=R,Xn.unpackHeaders=T;const e=_ie(),t=vie(),n=Ar(),o=iP(),r=yie(),i={jsonl:"application/jsonl",json:"application/json",text:"text/plain",bytes:"application/octet-stream",stream:"application/octet-stream",sse:"text/event-stream",nil:"*",fail:"*"};function s(B,N,L){return{...L,err:!0,enc:"json",codes:B,schema:N}}function a(B,N,L){return{...L,enc:"json",codes:B,schema:N}}function c(B,N,L){return{...L,enc:"jsonl",codes:B,schema:N}}function p(B,N,L){return{...L,err:!0,enc:"jsonl",codes:B,schema:N}}function u(B,N,L){return{...L,err:!0,enc:"text",codes:B,schema:N}}function l(B,N,L){return{...L,enc:"text",codes:B,schema:N}}function d(B,N,L){return{...L,err:!0,enc:"bytes",codes:B,schema:N}}function f(B,N,L){return{...L,enc:"bytes",codes:B,schema:N}}function h(B,N,L){return{...L,err:!0,enc:"stream",codes:B,schema:N}}function m(B,N,L){return{...L,enc:"stream",codes:B,schema:N}}function g(B,N,L){return{...L,err:!0,enc:"sse",codes:B,schema:N}}function y(B,N,L){return{...L,enc:"sse",codes:B,schema:N}}function _(B,N,L){return{...L,err:!0,enc:"nil",codes:B,schema:N}}function S(B,N,L){return{...L,enc:"nil",codes:B,schema:N}}function w(B){return{enc:"fail",codes:B}}function R(...B){return async function(L,q,I){let U,J;for(const K of B){const{codes:X}=K,ce="ctype"in K?K.ctype:i[K.enc];if(ce&&(0,o.matchResponse)(L,X,ce)){J=K;break}else if(!ce&&(0,o.matchStatusCode)(L,X)){J=K;break}}if(!J)return[{ok:!1,error:new t.SDKError("Unexpected Status or Content-Type",{response:L,request:q,body:await L.text().catch(()=>"")})},U];const V=J.enc;let G="";switch(V){case"json":G=await L.text(),U=JSON.parse(G);break;case"jsonl":U=L.body;break;case"bytes":U=new Uint8Array(await L.arrayBuffer());break;case"stream":U=L.body;break;case"text":G=await L.text(),U=G;break;case"sse":U=L.body;break;case"nil":G=await L.text(),U=void 0;break;case"fail":G=await L.text(),U=G;break;default:throw new Error(`Unsupported response type: ${V}`)}if(J.enc==="fail")return[{ok:!1,error:new t.SDKError("API error occurred",{request:q,response:L,body:G})},U];const Q=J.key||I?.resultKey;let le;if("err"in J?le={...I?.extraFields,...J.hdrs?{Headers:T(L.headers)}:null,...(0,r.isPlainObject)(U)?U:null,request$:q,response$:L,body$:G}:Q?le={...I?.extraFields,...J.hdrs?{Headers:T(L.headers)}:null,[Q]:U}:J.hdrs?le={...I?.extraFields,...J.hdrs?{Headers:T(L.headers)}:null,...(0,r.isPlainObject)(U)?U:null}:le=U,"err"in J){const K=D(le,X=>J.schema.parse(X),"Response validation failed",{request:q,response:L,body:G});return[K.ok?{ok:!1,error:K.value}:K,U]}else return[D(le,K=>J.schema.parse(K),"Response validation failed",{request:q,response:L,body:G}),U]}}const E=/, */;function T(B){const N={};for(const[L,q]of B.entries())N[L]=q.split(E);return N}function D(B,N,L,q){try{return(0,n.OK)(N(B))}catch(I){return(0,n.ERR)(new e.ResponseValidationError(L,{cause:I,rawValue:B,rawMessage:L,...q}))}}return Xn}var Su={},SH;function ae(){if(SH)return Su;SH=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.invariant=t,Su.remap=n,Su.combineSignals=o,Su.abortSignalAny=r,Su.compactMap=i,Su.allRequired=s;class e extends Error{constructor(c){super(c),this.name="InvariantError"}}function t(a,c){if(!a)throw new e(c)}function n(a,c){let p={};if(!Object.keys(c).length)return p=a,p;for(const[u,l]of Object.entries(a)){const d=c[u];d!==null&&(p[d??u]=l)}return p}function o(...a){const c=[];for(const p of a)p&&c.push(p);switch(c.length){case 0:case 1:return c[0]||null;default:return"any"in AbortSignal&&typeof AbortSignal.any=="function"?AbortSignal.any(c):r(c)}}function r(a){const c=new AbortController,p=c.signal;if(!a.length)return c.signal;if(a.length===1)return a[0]||c.signal;for(const f of a)if(f.aborted)return f;function u(){c.abort(this.reason),d()}const l=[];function d(){for(const f of l){const h=f.deref();h&&h.removeEventListener("abort",u)}}for(const f of a)l.push(new WeakRef(f)),f.addEventListener("abort",u);return p}function i(a){const c={};for(const[p,u]of Object.entries(a))typeof u<"u"&&(c[p]=u);return c}function s(a){if(!Object.values(a).every(c=>c==null))return a}return Su}var yy={},CH;function ee(){if(CH)return yy;CH=1,Object.defineProperty(yy,"__esModule",{value:!0}),yy.parse=o,yy.safeParse=r,yy.collectExtraKeys=i;const e=ne(),t=kx(),n=Ar();function o(s,a,c){try{return a(s)}catch(p){throw p instanceof e.ZodError?new t.SDKValidationError(c,p,s):p}}function r(s,a,c){try{return(0,n.OK)(a(s))}catch(p){return(0,n.ERR)(new t.SDKValidationError(c,p,s))}}function i(s,a,c){return s.transform(p=>{const u={},{shape:l}=s;for(const[d]of Object.entries(p)){if(d in l)continue;const f=p[d];typeof f>"u"||(u[d]=f,delete p[d])}return c&&Object.keys(u).length===0?p:{...p,[a]:u}})}return yy}var Ws={},wH;function ze(){if(wH)return Ws;wH=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.SecurityError=Ws.SecurityErrorCode=void 0,Ws.resolveSecurity=o,Ws.resolveGlobalSecurity=s,Ws.extractSecurity=a;const e=Aie();var t;(function(c){c.Incomplete="incomplete",c.UnrecognisedSecurityType="unrecognized_security_type"})(t||(Ws.SecurityErrorCode=t={}));class n extends Error{constructor(p,u){super(u),this.code=p,this.name="SecurityError"}static incomplete(){return new n(t.Incomplete,"Security requirements not met in order to perform the operation")}static unrecognizedType(p){return new n(t.UnrecognisedSecurityType,`Unrecognised security type: ${p}`)}}Ws.SecurityError=n;function o(...c){const p={basic:{},headers:{},queryParams:{},cookies:{},oauth2:{type:"none"}},u=c.find(l=>l.every(d=>{if(d.value==null)return!1;if(d.type==="http:basic")return d.value.username!=null||d.value.password!=null;if(d.type==="http:custom")return null;if(d.type==="oauth2:password")return typeof d.value=="string"&&!!d.value;if(d.type==="oauth2:client_credentials")return typeof d.value=="string"?!!d.value:d.value.clientID!=null||d.value.clientSecret!=null;if(typeof d.value=="string")return!!d.value;throw new Error(`Unrecognized security type: ${d.type} (value type: ${typeof d.value})`)}));return u==null?null:(u.forEach(l=>{if(l.value==null)return;const{type:d}=l;switch(d){case"apiKey:header":p.headers[l.fieldName]=l.value;break;case"apiKey:query":p.queryParams[l.fieldName]=l.value;break;case"apiKey:cookie":p.cookies[l.fieldName]=l.value;break;case"http:basic":r(p,l);break;case"http:custom":break;case"http:bearer":i(p,l);break;case"oauth2":i(p,l);break;case"oauth2:password":i(p,l);break;case"oauth2:client_credentials":break;case"openIdConnect":i(p,l);break;default:throw n.unrecognizedType(d)}}),p)}function r(c,p){p.value!=null&&(c.basic=p.value)}function i(c,p){if(typeof p.value!="string"||!p.value)return;let u=p.value;u.slice(0,7).toLowerCase()!=="bearer "&&(u=`Bearer ${u}`),p.fieldName!==void 0&&(c.headers[p.fieldName]=u)}function s(c){return o([{fieldName:"Authorization",type:"http:bearer",value:c?.apiKey??(0,e.env)().MISTRAL_API_KEY}])}async function a(c){if(c!=null)return typeof c=="function"?c():c}return Ws}var dg={},Cu={},wu={},OH;function eb(){return OH||(OH=1,(function(e){var t=wu&&wu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=wu&&wu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=wu&&wu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.CodeInterpreterTool$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'CodeInterpreterTool' from JSON")}})(wu)),wu}var Ou={},Tu={},TH;function Sie(){return TH||(TH=1,(function(e){var t=Tu&&Tu.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Tu&&Tu.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Tu&&Tu.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.CompletionArgsStop$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'CompletionArgsStop' from JSON")}})(Tu)),Tu}var Ru={},RH;function UA(){return RH||(RH=1,(function(e){var t=Ru&&Ru.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Ru&&Ru.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Ru&&Ru.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.Prediction$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'Prediction' from JSON")}})(Ru)),Ru}var Eu={},Mu={},EH;function Cie(){return EH||(EH=1,(function(e){var t=Mu&&Mu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Mu&&Mu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Mu&&Mu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{schema:"schemaDefinition"})),e.JsonSchema$outboundSchema=r.object({name:r.string(),description:r.nullable(r.string()).optional(),schemaDefinition:r.record(r.any()),strict:r.boolean().optional()}).transform(u=>(0,i.remap)(u,{schemaDefinition:"schema"}));var a;(function(u){u.inboundSchema=e.JsonSchema$inboundSchema,u.outboundSchema=e.JsonSchema$outboundSchema})(a||(e.JsonSchema$=a={}));function c(u){return JSON.stringify(e.JsonSchema$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JsonSchema$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JsonSchema' from JSON")}})(Mu)),Mu}var Pu={},MH;function wie(){return MH||(MH=1,(function(e){var t=Pu&&Pu.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Pu&&Pu.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Pu&&Pu.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(d,{json_schema:"jsonSchema"})),e.ResponseFormat$outboundSchema=r.object({type:c.ResponseFormats$outboundSchema.optional(),jsonSchema:r.nullable(a.JsonSchema$outboundSchema).optional()}).transform(d=>(0,i.remap)(d,{jsonSchema:"json_schema"}));var p;(function(d){d.inboundSchema=e.ResponseFormat$inboundSchema,d.outboundSchema=e.ResponseFormat$outboundSchema})(p||(e.ResponseFormat$=p={}));function u(d){return JSON.stringify(e.ResponseFormat$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.ResponseFormat$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'ResponseFormat' from JSON")}})(Eu)),Eu}var Iu={},IH;function qA(){return IH||(IH=1,(function(e){var t=Iu&&Iu.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Iu&&Iu.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Iu&&Iu.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(h,{presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice"})),e.CompletionArgs$outboundSchema=r.object({stop:r.nullable(a.CompletionArgsStop$outboundSchema).optional(),presencePenalty:r.nullable(r.number()).optional(),frequencyPenalty:r.nullable(r.number()).optional(),temperature:r.nullable(r.number()).optional(),topP:r.nullable(r.number()).optional(),maxTokens:r.nullable(r.number().int()).optional(),randomSeed:r.nullable(r.number().int()).optional(),prediction:r.nullable(c.Prediction$outboundSchema).optional(),responseFormat:r.nullable(p.ResponseFormat$outboundSchema).optional(),toolChoice:u.ToolChoiceEnum$outboundSchema.optional()}).transform(h=>(0,i.remap)(h,{presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice"}));var l;(function(h){h.inboundSchema=e.CompletionArgs$inboundSchema,h.outboundSchema=e.CompletionArgs$outboundSchema})(l||(e.CompletionArgs$=l={}));function d(h){return JSON.stringify(e.CompletionArgs$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.CompletionArgs$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'CompletionArgs' from JSON")}})(Ou)),Ou}var ju={},DH;function nb(){return DH||(DH=1,(function(e){var t=ju&&ju.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=ju&&ju.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=ju&&ju.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{library_ids:"libraryIds"})),e.DocumentLibraryTool$outboundSchema=r.object({type:e.DocumentLibraryToolType$outboundSchema.default("document_library"),libraryIds:r.array(r.string())}).transform(l=>(0,i.remap)(l,{libraryIds:"library_ids"}));var c;(function(l){l.inboundSchema=e.DocumentLibraryTool$inboundSchema,l.outboundSchema=e.DocumentLibraryTool$outboundSchema})(c||(e.DocumentLibraryTool$=c={}));function p(l){return JSON.stringify(e.DocumentLibraryTool$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.DocumentLibraryTool$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'DocumentLibraryTool' from JSON")}})(ju)),ju}var Du={},Nu={},NH;function Ux(){return NH||(NH=1,(function(e){var t=Nu&&Nu.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Nu&&Nu.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Nu&&Nu.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.FunctionT$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'FunctionT' from JSON")}})(Nu)),Nu}var LH;function rb(){return LH||(LH=1,(function(e){var t=Du&&Du.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Du&&Du.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Du&&Du.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.FunctionTool$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'FunctionTool' from JSON")}})(Du)),Du}var Lu={},FH;function ob(){return FH||(FH=1,(function(e){var t=Lu&&Lu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Lu&&Lu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Lu&&Lu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ImageGenerationTool$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ImageGenerationTool' from JSON")}})(Lu)),Lu}var Fu={},xH;function ib(){return xH||(xH=1,(function(e){var t=Fu&&Fu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Fu&&Fu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Fu&&Fu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.WebSearchPremiumTool$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'WebSearchPremiumTool' from JSON")}})(Fu)),Fu}var xu={},BH;function sb(){return BH||(BH=1,(function(e){var t=xu&&xu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=xu&&xu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=xu&&xu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.WebSearchTool$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'WebSearchTool' from JSON")}})(xu)),xu}var kH;function Cqe(){return kH||(kH=1,(function(e){var t=Cu&&Cu.__createBinding||(Object.create?(function(R,E,T,D){D===void 0&&(D=T);var B=Object.getOwnPropertyDescriptor(E,T);(!B||("get"in B?!E.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return E[T]}}),Object.defineProperty(R,D,B)}):(function(R,E,T,D){D===void 0&&(D=T),R[D]=E[T]})),n=Cu&&Cu.__setModuleDefault||(Object.create?(function(R,E){Object.defineProperty(R,"default",{enumerable:!0,value:E})}):function(R,E){R.default=E}),o=Cu&&Cu.__importStar||(function(){var R=function(E){return R=Object.getOwnPropertyNames||function(T){var D=[];for(var B in T)Object.prototype.hasOwnProperty.call(T,B)&&(D[D.length]=B);return D},R(E)};return function(E){if(E&&E.__esModule)return E;var T={};if(E!=null)for(var D=R(E),B=0;B({type:R.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))]),e.AgentTools$outboundSchema=r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))]);var h;(function(R){R.inboundSchema=e.AgentTools$inboundSchema,R.outboundSchema=e.AgentTools$outboundSchema})(h||(e.AgentTools$=h={}));function m(R){return JSON.stringify(e.AgentTools$outboundSchema.parse(R))}function g(R){return(0,s.safeParse)(R,E=>e.AgentTools$inboundSchema.parse(JSON.parse(E)),"Failed to parse 'AgentTools' from JSON")}e.AgentObject$inboundSchema=r.nativeEnum(e.AgentObject),e.AgentObject$outboundSchema=e.AgentObject$inboundSchema;var y;(function(R){R.inboundSchema=e.AgentObject$inboundSchema,R.outboundSchema=e.AgentObject$outboundSchema})(y||(e.AgentObject$=y={})),e.Agent$inboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))])).optional(),completion_args:c.CompletionArgs$inboundSchema.optional(),model:r.string(),name:r.string(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),metadata:r.nullable(r.record(r.any())).optional(),object:e.AgentObject$inboundSchema.default("agent"),id:r.string(),version:r.number().int(),versions:r.array(r.number().int()),created_at:r.string().datetime({offset:!0}).transform(R=>new Date(R)),updated_at:r.string().datetime({offset:!0}).transform(R=>new Date(R)),deployment_chat:r.boolean(),source:r.string()}).transform(R=>(0,i.remap)(R,{completion_args:"completionArgs",created_at:"createdAt",updated_at:"updatedAt",deployment_chat:"deploymentChat"})),e.Agent$outboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))])).optional(),completionArgs:c.CompletionArgs$outboundSchema.optional(),model:r.string(),name:r.string(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),metadata:r.nullable(r.record(r.any())).optional(),object:e.AgentObject$outboundSchema.default("agent"),id:r.string(),version:r.number().int(),versions:r.array(r.number().int()),createdAt:r.date().transform(R=>R.toISOString()),updatedAt:r.date().transform(R=>R.toISOString()),deploymentChat:r.boolean(),source:r.string()}).transform(R=>(0,i.remap)(R,{completionArgs:"completion_args",createdAt:"created_at",updatedAt:"updated_at",deploymentChat:"deployment_chat"}));var _;(function(R){R.inboundSchema=e.Agent$inboundSchema,R.outboundSchema=e.Agent$outboundSchema})(_||(e.Agent$=_={}));function S(R){return JSON.stringify(e.Agent$outboundSchema.parse(R))}function w(R){return(0,s.safeParse)(R,E=>e.Agent$inboundSchema.parse(JSON.parse(E)),"Failed to parse 'Agent' from JSON")}})(Cu)),Cu}var Bu={},UH;function wqe(){return UH||(UH=1,(function(e){var t=Bu&&Bu.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Bu&&Bu.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Bu&&Bu.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)),updated_at:r.string().datetime({offset:!0}).transform(l=>new Date(l)),agent_id:r.string(),agent_version:r.nullable(r.number().int()).optional()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt",updated_at:"updatedAt",agent_id:"agentId",agent_version:"agentVersion"})),e.AgentConversation$outboundSchema=r.object({name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),object:e.AgentConversationObject$outboundSchema.default("conversation"),id:r.string(),createdAt:r.date().transform(l=>l.toISOString()),updatedAt:r.date().transform(l=>l.toISOString()),agentId:r.string(),agentVersion:r.nullable(r.number().int()).optional()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at",updatedAt:"updated_at",agentId:"agent_id",agentVersion:"agent_version"}));var c;(function(l){l.inboundSchema=e.AgentConversation$inboundSchema,l.outboundSchema=e.AgentConversation$outboundSchema})(c||(e.AgentConversation$=c={}));function p(l){return JSON.stringify(e.AgentConversation$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentConversation$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentConversation' from JSON")}})(Bu)),Bu}var ku={},qH;function Oqe(){return qH||(qH=1,(function(e){var t=ku&&ku.__createBinding||(Object.create?(function(w,R,E,T){T===void 0&&(T=E);var D=Object.getOwnPropertyDescriptor(R,E);(!D||("get"in D?!R.__esModule:D.writable||D.configurable))&&(D={enumerable:!0,get:function(){return R[E]}}),Object.defineProperty(w,T,D)}):(function(w,R,E,T){T===void 0&&(T=E),w[T]=R[E]})),n=ku&&ku.__setModuleDefault||(Object.create?(function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}):function(w,R){w.default=R}),o=ku&&ku.__importStar||(function(){var w=function(R){return w=Object.getOwnPropertyNames||function(E){var T=[];for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(T[T.length]=D);return T},w(R)};return function(R){if(R&&R.__esModule)return R;var E={};if(R!=null)for(var T=w(R),D=0;D({type:w.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))]),e.AgentCreationRequestTools$outboundSchema=r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))]);var h;(function(w){w.inboundSchema=e.AgentCreationRequestTools$inboundSchema,w.outboundSchema=e.AgentCreationRequestTools$outboundSchema})(h||(e.AgentCreationRequestTools$=h={}));function m(w){return JSON.stringify(e.AgentCreationRequestTools$outboundSchema.parse(w))}function g(w){return(0,s.safeParse)(w,R=>e.AgentCreationRequestTools$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'AgentCreationRequestTools' from JSON")}e.AgentCreationRequest$inboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))])).optional(),completion_args:c.CompletionArgs$inboundSchema.optional(),model:r.string(),name:r.string(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),metadata:r.nullable(r.record(r.any())).optional()}).transform(w=>(0,i.remap)(w,{completion_args:"completionArgs"})),e.AgentCreationRequest$outboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))])).optional(),completionArgs:c.CompletionArgs$outboundSchema.optional(),model:r.string(),name:r.string(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),metadata:r.nullable(r.record(r.any())).optional()}).transform(w=>(0,i.remap)(w,{completionArgs:"completion_args"}));var y;(function(w){w.inboundSchema=e.AgentCreationRequest$inboundSchema,w.outboundSchema=e.AgentCreationRequest$outboundSchema})(y||(e.AgentCreationRequest$=y={}));function _(w){return JSON.stringify(e.AgentCreationRequest$outboundSchema.parse(w))}function S(w){return(0,s.safeParse)(w,R=>e.AgentCreationRequest$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'AgentCreationRequest' from JSON")}})(ku)),ku}var Uu={},JH;function Oie(){return JH||(JH=1,(function(e){var t=Uu&&Uu.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Uu&&Uu.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Uu&&Uu.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)).optional(),output_index:r.number().int().default(0),id:r.string(),next_agent_id:r.string(),next_agent_name:r.string()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt",output_index:"outputIndex",next_agent_id:"nextAgentId",next_agent_name:"nextAgentName"})),e.AgentHandoffDoneEvent$outboundSchema=r.object({type:e.AgentHandoffDoneEventType$outboundSchema.default("agent.handoff.done"),createdAt:r.date().transform(l=>l.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),nextAgentId:r.string(),nextAgentName:r.string()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at",outputIndex:"output_index",nextAgentId:"next_agent_id",nextAgentName:"next_agent_name"}));var c;(function(l){l.inboundSchema=e.AgentHandoffDoneEvent$inboundSchema,l.outboundSchema=e.AgentHandoffDoneEvent$outboundSchema})(c||(e.AgentHandoffDoneEvent$=c={}));function p(l){return JSON.stringify(e.AgentHandoffDoneEvent$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentHandoffDoneEvent$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentHandoffDoneEvent' from JSON")}})(Uu)),Uu}var qu={},VH;function aP(){return VH||(VH=1,(function(e){var t=qu&&qu.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=qu&&qu.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=qu&&qu.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;gnew Date(d)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(d=>new Date(d))).optional(),id:r.string().optional(),previous_agent_id:r.string(),previous_agent_name:r.string(),next_agent_id:r.string(),next_agent_name:r.string()}).transform(d=>(0,i.remap)(d,{created_at:"createdAt",completed_at:"completedAt",previous_agent_id:"previousAgentId",previous_agent_name:"previousAgentName",next_agent_id:"nextAgentId",next_agent_name:"nextAgentName"})),e.AgentHandoffEntry$outboundSchema=r.object({object:e.AgentHandoffEntryObject$outboundSchema.default("entry"),type:e.AgentHandoffEntryType$outboundSchema.default("agent.handoff"),createdAt:r.date().transform(d=>d.toISOString()).optional(),completedAt:r.nullable(r.date().transform(d=>d.toISOString())).optional(),id:r.string().optional(),previousAgentId:r.string(),previousAgentName:r.string(),nextAgentId:r.string(),nextAgentName:r.string()}).transform(d=>(0,i.remap)(d,{createdAt:"created_at",completedAt:"completed_at",previousAgentId:"previous_agent_id",previousAgentName:"previous_agent_name",nextAgentId:"next_agent_id",nextAgentName:"next_agent_name"}));var p;(function(d){d.inboundSchema=e.AgentHandoffEntry$inboundSchema,d.outboundSchema=e.AgentHandoffEntry$outboundSchema})(p||(e.AgentHandoffEntry$=p={}));function u(d){return JSON.stringify(e.AgentHandoffEntry$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.AgentHandoffEntry$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'AgentHandoffEntry' from JSON")}})(qu)),qu}var Ju={},HH;function Tie(){return HH||(HH=1,(function(e){var t=Ju&&Ju.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Ju&&Ju.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Ju&&Ju.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)).optional(),output_index:r.number().int().default(0),id:r.string(),previous_agent_id:r.string(),previous_agent_name:r.string()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt",output_index:"outputIndex",previous_agent_id:"previousAgentId",previous_agent_name:"previousAgentName"})),e.AgentHandoffStartedEvent$outboundSchema=r.object({type:e.AgentHandoffStartedEventType$outboundSchema.default("agent.handoff.started"),createdAt:r.date().transform(l=>l.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),previousAgentId:r.string(),previousAgentName:r.string()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at",outputIndex:"output_index",previousAgentId:"previous_agent_id",previousAgentName:"previous_agent_name"}));var c;(function(l){l.inboundSchema=e.AgentHandoffStartedEvent$inboundSchema,l.outboundSchema=e.AgentHandoffStartedEvent$outboundSchema})(c||(e.AgentHandoffStartedEvent$=c={}));function p(l){return JSON.stringify(e.AgentHandoffStartedEvent$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentHandoffStartedEvent$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentHandoffStartedEvent' from JSON")}})(Ju)),Ju}var Vu={},Hu={},Gu={},zu={},GH;function Rie(){return GH||(GH=1,(function(e){var t=zu&&zu.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=zu&&zu.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=zu&&zu.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{input_audio:"inputAudio"})),e.AudioChunk$outboundSchema=r.object({inputAudio:r.string(),type:e.AudioChunkType$outboundSchema.default("input_audio")}).transform(l=>(0,i.remap)(l,{inputAudio:"input_audio"}));var c;(function(l){l.inboundSchema=e.AudioChunk$inboundSchema,l.outboundSchema=e.AudioChunk$outboundSchema})(c||(e.AudioChunk$=c={}));function p(l){return JSON.stringify(e.AudioChunk$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AudioChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AudioChunk' from JSON")}})(zu)),zu}var Ku={},zH;function JA(){return zH||(zH=1,(function(e){var t=Ku&&Ku.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Ku&&Ku.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Ku&&Ku.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{document_url:"documentUrl",document_name:"documentName"})),e.DocumentURLChunk$outboundSchema=r.object({documentUrl:r.string(),documentName:r.nullable(r.string()).optional(),type:e.DocumentURLChunkType$outboundSchema.default("document_url")}).transform(l=>(0,i.remap)(l,{documentUrl:"document_url",documentName:"document_name"}));var c;(function(l){l.inboundSchema=e.DocumentURLChunk$inboundSchema,l.outboundSchema=e.DocumentURLChunk$outboundSchema})(c||(e.DocumentURLChunk$=c={}));function p(l){return JSON.stringify(e.DocumentURLChunk$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.DocumentURLChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'DocumentURLChunk' from JSON")}})(Ku)),Ku}var Qu={},KH;function qx(){return KH||(KH=1,(function(e){var t=Qu&&Qu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Qu&&Qu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Qu&&Qu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.FileChunk$outboundSchema=r.object({type:r.literal("file").default("file"),fileId:r.string()}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.FileChunk$inboundSchema,u.outboundSchema=e.FileChunk$outboundSchema})(a||(e.FileChunk$=a={}));function c(u){return JSON.stringify(e.FileChunk$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FileChunk$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FileChunk' from JSON")}})(Qu)),Qu}var $u={},Wu={},QH;function Eie(){return QH||(QH=1,(function(e){var t=Wu&&Wu.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Wu&&Wu.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Wu&&Wu.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.ImageURL$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'ImageURL' from JSON")}})(Wu)),Wu}var $H;function VA(){return $H||($H=1,(function(e){var t=$u&&$u.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=$u&&$u.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=$u&&$u.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ImageURLChunk$=e.ImageURLChunk$outboundSchema=e.ImageURLChunk$inboundSchema=e.ImageURLChunkType$=e.ImageURLChunkType$outboundSchema=e.ImageURLChunkType$inboundSchema=e.ImageURLChunkImageURL$=e.ImageURLChunkImageURL$outboundSchema=e.ImageURLChunkImageURL$inboundSchema=e.ImageURLChunkType=void 0,e.imageURLChunkImageURLToJSON=p,e.imageURLChunkImageURLFromJSON=u,e.imageURLChunkToJSON=f,e.imageURLChunkFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=Eie();e.ImageURLChunkType={ImageUrl:"image_url"},e.ImageURLChunkImageURL$inboundSchema=r.union([a.ImageURL$inboundSchema,r.string()]),e.ImageURLChunkImageURL$outboundSchema=r.union([a.ImageURL$outboundSchema,r.string()]);var c;(function(m){m.inboundSchema=e.ImageURLChunkImageURL$inboundSchema,m.outboundSchema=e.ImageURLChunkImageURL$outboundSchema})(c||(e.ImageURLChunkImageURL$=c={}));function p(m){return JSON.stringify(e.ImageURLChunkImageURL$outboundSchema.parse(m))}function u(m){return(0,s.safeParse)(m,g=>e.ImageURLChunkImageURL$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ImageURLChunkImageURL' from JSON")}e.ImageURLChunkType$inboundSchema=r.nativeEnum(e.ImageURLChunkType),e.ImageURLChunkType$outboundSchema=e.ImageURLChunkType$inboundSchema;var l;(function(m){m.inboundSchema=e.ImageURLChunkType$inboundSchema,m.outboundSchema=e.ImageURLChunkType$outboundSchema})(l||(e.ImageURLChunkType$=l={})),e.ImageURLChunk$inboundSchema=r.object({image_url:r.union([a.ImageURL$inboundSchema,r.string()]),type:e.ImageURLChunkType$inboundSchema.default("image_url")}).transform(m=>(0,i.remap)(m,{image_url:"imageUrl"})),e.ImageURLChunk$outboundSchema=r.object({imageUrl:r.union([a.ImageURL$outboundSchema,r.string()]),type:e.ImageURLChunkType$outboundSchema.default("image_url")}).transform(m=>(0,i.remap)(m,{imageUrl:"image_url"}));var d;(function(m){m.inboundSchema=e.ImageURLChunk$inboundSchema,m.outboundSchema=e.ImageURLChunk$outboundSchema})(d||(e.ImageURLChunk$=d={}));function f(m){return JSON.stringify(e.ImageURLChunk$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.ImageURLChunk$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ImageURLChunk' from JSON")}})($u)),$u}var Yu={},WH;function Jx(){return WH||(WH=1,(function(e){var t=Yu&&Yu.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Yu&&Yu.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Yu&&Yu.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{reference_ids:"referenceIds"})),e.ReferenceChunk$outboundSchema=r.object({referenceIds:r.array(r.number().int()),type:e.ReferenceChunkType$outboundSchema.default("reference")}).transform(l=>(0,i.remap)(l,{referenceIds:"reference_ids"}));var c;(function(l){l.inboundSchema=e.ReferenceChunk$inboundSchema,l.outboundSchema=e.ReferenceChunk$outboundSchema})(c||(e.ReferenceChunk$=c={}));function p(l){return JSON.stringify(e.ReferenceChunk$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ReferenceChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ReferenceChunk' from JSON")}})(Yu)),Yu}var Xu={},YH;function ab(){return YH||(YH=1,(function(e){var t=Xu&&Xu.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Xu&&Xu.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Xu&&Xu.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.TextChunk$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'TextChunk' from JSON")}})(Xu)),Xu}var Zu={},XH;function HA(){return XH||(XH=1,(function(e){var t=Zu&&Zu.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=Zu&&Zu.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=Zu&&Zu.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ThinkChunk$=e.ThinkChunk$outboundSchema=e.ThinkChunk$inboundSchema=e.ThinkChunkType$=e.ThinkChunkType$outboundSchema=e.ThinkChunkType$inboundSchema=e.Thinking$=e.Thinking$outboundSchema=e.Thinking$inboundSchema=e.ThinkChunkType=void 0,e.thinkingToJSON=p,e.thinkingFromJSON=u,e.thinkChunkToJSON=f,e.thinkChunkFromJSON=h;const r=o(ne()),i=ee(),s=Jx(),a=ab();e.ThinkChunkType={Thinking:"thinking"},e.Thinking$inboundSchema=r.union([s.ReferenceChunk$inboundSchema,a.TextChunk$inboundSchema]),e.Thinking$outboundSchema=r.union([s.ReferenceChunk$outboundSchema,a.TextChunk$outboundSchema]);var c;(function(m){m.inboundSchema=e.Thinking$inboundSchema,m.outboundSchema=e.Thinking$outboundSchema})(c||(e.Thinking$=c={}));function p(m){return JSON.stringify(e.Thinking$outboundSchema.parse(m))}function u(m){return(0,i.safeParse)(m,g=>e.Thinking$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'Thinking' from JSON")}e.ThinkChunkType$inboundSchema=r.nativeEnum(e.ThinkChunkType),e.ThinkChunkType$outboundSchema=e.ThinkChunkType$inboundSchema;var l;(function(m){m.inboundSchema=e.ThinkChunkType$inboundSchema,m.outboundSchema=e.ThinkChunkType$outboundSchema})(l||(e.ThinkChunkType$=l={})),e.ThinkChunk$inboundSchema=r.object({thinking:r.array(r.union([s.ReferenceChunk$inboundSchema,a.TextChunk$inboundSchema])),closed:r.boolean().optional(),type:e.ThinkChunkType$inboundSchema.default("thinking")}),e.ThinkChunk$outboundSchema=r.object({thinking:r.array(r.union([s.ReferenceChunk$outboundSchema,a.TextChunk$outboundSchema])),closed:r.boolean().optional(),type:e.ThinkChunkType$outboundSchema.default("thinking")});var d;(function(m){m.inboundSchema=e.ThinkChunk$inboundSchema,m.outboundSchema=e.ThinkChunk$outboundSchema})(d||(e.ThinkChunk$=d={}));function f(m){return JSON.stringify(e.ThinkChunk$outboundSchema.parse(m))}function h(m){return(0,i.safeParse)(m,g=>e.ThinkChunk$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ThinkChunk' from JSON")}})(Zu)),Zu}var ZH;function BC(){return ZH||(ZH=1,(function(e){var t=Gu&&Gu.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),n=Gu&&Gu.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),o=Gu&&Gu.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;w({type:g.type}))),a.DocumentURLChunk$inboundSchema.and(r.object({type:r.literal("document_url")}).transform(g=>({type:g.type}))),l.TextChunk$inboundSchema.and(r.object({type:r.literal("text")}).transform(g=>({type:g.type}))),u.ReferenceChunk$inboundSchema.and(r.object({type:r.literal("reference")}).transform(g=>({type:g.type}))),c.FileChunk$inboundSchema.and(r.object({type:r.literal("file")}).transform(g=>({type:g.type}))),d.ThinkChunk$inboundSchema.and(r.object({type:r.literal("thinking")}).transform(g=>({type:g.type}))),s.AudioChunk$inboundSchema.and(r.object({type:r.literal("input_audio")}).transform(g=>({type:g.type})))]),e.ContentChunk$outboundSchema=r.union([p.ImageURLChunk$outboundSchema.and(r.object({type:r.literal("image_url")}).transform(g=>({type:g.type}))),a.DocumentURLChunk$outboundSchema.and(r.object({type:r.literal("document_url")}).transform(g=>({type:g.type}))),l.TextChunk$outboundSchema.and(r.object({type:r.literal("text")}).transform(g=>({type:g.type}))),u.ReferenceChunk$outboundSchema.and(r.object({type:r.literal("reference")}).transform(g=>({type:g.type}))),c.FileChunk$outboundSchema.and(r.object({type:r.literal("file")}).transform(g=>({type:g.type}))),d.ThinkChunk$outboundSchema.and(r.object({type:r.literal("thinking")}).transform(g=>({type:g.type}))),s.AudioChunk$outboundSchema.and(r.object({type:r.literal("input_audio")}).transform(g=>({type:g.type})))]);var f;(function(g){g.inboundSchema=e.ContentChunk$inboundSchema,g.outboundSchema=e.ContentChunk$outboundSchema})(f||(e.ContentChunk$=f={}));function h(g){return JSON.stringify(e.ContentChunk$outboundSchema.parse(g))}function m(g){return(0,i.safeParse)(g,y=>e.ContentChunk$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'ContentChunk' from JSON")}})(Gu)),Gu}var ec={},tc={},e8;function Mie(){return e8||(e8=1,(function(e){var t=tc&&tc.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=tc&&tc.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=tc&&tc.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;ge.Arguments$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'Arguments' from JSON")}e.FunctionCall$inboundSchema=r.object({name:r.string(),arguments:r.union([r.record(r.any()),r.string()])}),e.FunctionCall$outboundSchema=r.object({name:r.string(),arguments:r.union([r.record(r.any()),r.string()])});var p;(function(d){d.inboundSchema=e.FunctionCall$inboundSchema,d.outboundSchema=e.FunctionCall$outboundSchema})(p||(e.FunctionCall$=p={}));function u(d){return JSON.stringify(e.FunctionCall$outboundSchema.parse(d))}function l(d){return(0,i.safeParse)(d,f=>e.FunctionCall$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'FunctionCall' from JSON")}})(tc)),tc}var nc={},_T={},t8;function Jl(){if(t8)return _T;t8=1,Object.defineProperty(_T,"__esModule",{value:!0}),_T.catchUnrecognizedEnum=e;function e(t){return t}return _T}var n8;function lP(){return n8||(n8=1,(function(e){var t=nc&&nc.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),n=nc&&nc.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),o=nc&&nc.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;le.ToolCall$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ToolCall' from JSON")}})(ec)),ec}var o8;function bp(){return o8||(o8=1,(function(e){var t=Hu&&Hu.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),n=Hu&&Hu.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),o=Hu&&Hu.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;we.AssistantMessageContent$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'AssistantMessageContent' from JSON")}e.AssistantMessageRole$inboundSchema=r.nativeEnum(e.AssistantMessageRole),e.AssistantMessageRole$outboundSchema=e.AssistantMessageRole$inboundSchema;var d;(function(g){g.inboundSchema=e.AssistantMessageRole$inboundSchema,g.outboundSchema=e.AssistantMessageRole$outboundSchema})(d||(e.AssistantMessageRole$=d={})),e.AssistantMessage$inboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$inboundSchema)])).optional(),tool_calls:r.nullable(r.array(c.ToolCall$inboundSchema)).optional(),prefix:r.boolean().default(!1),role:e.AssistantMessageRole$inboundSchema.default("assistant")}).transform(g=>(0,i.remap)(g,{tool_calls:"toolCalls"})),e.AssistantMessage$outboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$outboundSchema)])).optional(),toolCalls:r.nullable(r.array(c.ToolCall$outboundSchema)).optional(),prefix:r.boolean().default(!1),role:e.AssistantMessageRole$outboundSchema.default("assistant")}).transform(g=>(0,i.remap)(g,{toolCalls:"tool_calls"}));var f;(function(g){g.inboundSchema=e.AssistantMessage$inboundSchema,g.outboundSchema=e.AssistantMessage$outboundSchema})(f||(e.AssistantMessage$=f={}));function h(g){return JSON.stringify(e.AssistantMessage$outboundSchema.parse(g))}function m(g){return(0,s.safeParse)(g,y=>e.AssistantMessage$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'AssistantMessage' from JSON")}})(Hu)),Hu}var rc={},i8;function kC(){return i8||(i8=1,(function(e){var t=rc&&rc.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),n=rc&&rc.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),o=rc&&rc.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;l({type:l.type}))),a.ThinkChunk$inboundSchema.and(r.object({type:r.literal("thinking")}).transform(l=>({type:l.type})))]),e.SystemMessageContentChunks$outboundSchema=r.union([s.TextChunk$outboundSchema.and(r.object({type:r.literal("text")}).transform(l=>({type:l.type}))),a.ThinkChunk$outboundSchema.and(r.object({type:r.literal("thinking")}).transform(l=>({type:l.type})))]);var c;(function(l){l.inboundSchema=e.SystemMessageContentChunks$inboundSchema,l.outboundSchema=e.SystemMessageContentChunks$outboundSchema})(c||(e.SystemMessageContentChunks$=c={}));function p(l){return JSON.stringify(e.SystemMessageContentChunks$outboundSchema.parse(l))}function u(l){return(0,i.safeParse)(l,d=>e.SystemMessageContentChunks$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'SystemMessageContentChunks' from JSON")}})(ic)),ic}var a8;function Mm(){return a8||(a8=1,(function(e){var t=oc&&oc.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=oc&&oc.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=oc&&oc.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_e.SystemMessageContent$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'SystemMessageContent' from JSON")}e.Role$inboundSchema=r.nativeEnum(e.Role),e.Role$outboundSchema=e.Role$inboundSchema;var u;(function(h){h.inboundSchema=e.Role$inboundSchema,h.outboundSchema=e.Role$outboundSchema})(u||(e.Role$=u={})),e.SystemMessage$inboundSchema=r.object({content:r.union([r.string(),r.array(s.SystemMessageContentChunks$inboundSchema)]),role:e.Role$inboundSchema.default("system")}),e.SystemMessage$outboundSchema=r.object({content:r.union([r.string(),r.array(s.SystemMessageContentChunks$outboundSchema)]),role:e.Role$outboundSchema.default("system")});var l;(function(h){h.inboundSchema=e.SystemMessage$inboundSchema,h.outboundSchema=e.SystemMessage$outboundSchema})(l||(e.SystemMessage$=l={}));function d(h){return JSON.stringify(e.SystemMessage$outboundSchema.parse(h))}function f(h){return(0,i.safeParse)(h,m=>e.SystemMessage$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'SystemMessage' from JSON")}})(oc)),oc}var sc={},l8;function UC(){return l8||(l8=1,(function(e){var t=sc&&sc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=sc&&sc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=sc&&sc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.Tool$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'Tool' from JSON")}})(sc)),sc}var ac={},lc={},u8;function Iie(){return u8||(u8=1,(function(e){var t=lc&&lc.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=lc&&lc.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=lc&&lc.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.FunctionName$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'FunctionName' from JSON")}})(lc)),lc}var c8;function qC(){return c8||(c8=1,(function(e){var t=ac&&ac.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=ac&&ac.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=ac&&ac.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.ToolChoice$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ToolChoice' from JSON")}})(ac)),ac}var uc={},d8;function Pm(){return d8||(d8=1,(function(e){var t=uc&&uc.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=uc&&uc.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=uc&&uc.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ToolMessage$=e.ToolMessage$outboundSchema=e.ToolMessage$inboundSchema=e.ToolMessageRole$=e.ToolMessageRole$outboundSchema=e.ToolMessageRole$inboundSchema=e.ToolMessageContent$=e.ToolMessageContent$outboundSchema=e.ToolMessageContent$inboundSchema=e.ToolMessageRole=void 0,e.toolMessageContentToJSON=p,e.toolMessageContentFromJSON=u,e.toolMessageToJSON=f,e.toolMessageFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=BC();e.ToolMessageRole={Tool:"tool"},e.ToolMessageContent$inboundSchema=r.union([r.string(),r.array(a.ContentChunk$inboundSchema)]),e.ToolMessageContent$outboundSchema=r.union([r.string(),r.array(a.ContentChunk$outboundSchema)]);var c;(function(m){m.inboundSchema=e.ToolMessageContent$inboundSchema,m.outboundSchema=e.ToolMessageContent$outboundSchema})(c||(e.ToolMessageContent$=c={}));function p(m){return JSON.stringify(e.ToolMessageContent$outboundSchema.parse(m))}function u(m){return(0,s.safeParse)(m,g=>e.ToolMessageContent$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolMessageContent' from JSON")}e.ToolMessageRole$inboundSchema=r.nativeEnum(e.ToolMessageRole),e.ToolMessageRole$outboundSchema=e.ToolMessageRole$inboundSchema;var l;(function(m){m.inboundSchema=e.ToolMessageRole$inboundSchema,m.outboundSchema=e.ToolMessageRole$outboundSchema})(l||(e.ToolMessageRole$=l={})),e.ToolMessage$inboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$inboundSchema)])),tool_call_id:r.nullable(r.string()).optional(),name:r.nullable(r.string()).optional(),role:e.ToolMessageRole$inboundSchema.default("tool")}).transform(m=>(0,i.remap)(m,{tool_call_id:"toolCallId"})),e.ToolMessage$outboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$outboundSchema)])),toolCallId:r.nullable(r.string()).optional(),name:r.nullable(r.string()).optional(),role:e.ToolMessageRole$outboundSchema.default("tool")}).transform(m=>(0,i.remap)(m,{toolCallId:"tool_call_id"}));var d;(function(m){m.inboundSchema=e.ToolMessage$inboundSchema,m.outboundSchema=e.ToolMessage$outboundSchema})(d||(e.ToolMessage$=d={}));function f(m){return JSON.stringify(e.ToolMessage$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.ToolMessage$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolMessage' from JSON")}})(uc)),uc}var cc={},f8;function Im(){return f8||(f8=1,(function(e){var t=cc&&cc.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=cc&&cc.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=cc&&cc.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_e.UserMessageContent$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'UserMessageContent' from JSON")}e.UserMessageRole$inboundSchema=r.nativeEnum(e.UserMessageRole),e.UserMessageRole$outboundSchema=e.UserMessageRole$inboundSchema;var u;(function(h){h.inboundSchema=e.UserMessageRole$inboundSchema,h.outboundSchema=e.UserMessageRole$outboundSchema})(u||(e.UserMessageRole$=u={})),e.UserMessage$inboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(s.ContentChunk$inboundSchema)])),role:e.UserMessageRole$inboundSchema.default("user")}),e.UserMessage$outboundSchema=r.object({content:r.nullable(r.union([r.string(),r.array(s.ContentChunk$outboundSchema)])),role:e.UserMessageRole$outboundSchema.default("user")});var l;(function(h){h.inboundSchema=e.UserMessage$inboundSchema,h.outboundSchema=e.UserMessage$outboundSchema})(l||(e.UserMessage$=l={}));function d(h){return JSON.stringify(e.UserMessage$outboundSchema.parse(h))}function f(h){return(0,i.safeParse)(h,m=>e.UserMessage$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'UserMessage' from JSON")}})(cc)),cc}var h8;function Tqe(){return h8||(h8=1,(function(e){var t=Vu&&Vu.__createBinding||(Object.create?(function(I,U,J,V){V===void 0&&(V=J);var G=Object.getOwnPropertyDescriptor(U,J);(!G||("get"in G?!U.__esModule:G.writable||G.configurable))&&(G={enumerable:!0,get:function(){return U[J]}}),Object.defineProperty(I,V,G)}):(function(I,U,J,V){V===void 0&&(V=J),I[V]=U[J]})),n=Vu&&Vu.__setModuleDefault||(Object.create?(function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}):function(I,U){I.default=U}),o=Vu&&Vu.__importStar||(function(){var I=function(U){return I=Object.getOwnPropertyNames||function(J){var V=[];for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(V[V.length]=G);return V},I(U)};return function(U){if(U&&U.__esModule)return U;var J={};if(U!=null)for(var V=I(U),G=0;Ge.AgentsCompletionRequestStop$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionRequestStop' from JSON")}e.AgentsCompletionRequestMessages$inboundSchema=r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]),e.AgentsCompletionRequestMessages$outboundSchema=r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]);var w;(function(I){I.inboundSchema=e.AgentsCompletionRequestMessages$inboundSchema,I.outboundSchema=e.AgentsCompletionRequestMessages$outboundSchema})(w||(e.AgentsCompletionRequestMessages$=w={}));function R(I){return JSON.stringify(e.AgentsCompletionRequestMessages$outboundSchema.parse(I))}function E(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionRequestMessages$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionRequestMessages' from JSON")}e.AgentsCompletionRequestToolChoice$inboundSchema=r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]),e.AgentsCompletionRequestToolChoice$outboundSchema=r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]);var T;(function(I){I.inboundSchema=e.AgentsCompletionRequestToolChoice$inboundSchema,I.outboundSchema=e.AgentsCompletionRequestToolChoice$outboundSchema})(T||(e.AgentsCompletionRequestToolChoice$=T={}));function D(I){return JSON.stringify(e.AgentsCompletionRequestToolChoice$outboundSchema.parse(I))}function B(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionRequestToolChoice$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionRequestToolChoice' from JSON")}e.AgentsCompletionRequest$inboundSchema=r.object({max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),response_format:u.ResponseFormat$inboundSchema.optional(),tools:r.nullable(r.array(d.Tool$inboundSchema)).optional(),tool_choice:r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:r.number().optional(),frequency_penalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$inboundSchema.optional(),parallel_tool_calls:r.boolean().optional(),prompt_mode:r.nullable(c.MistralPromptMode$inboundSchema).optional(),agent_id:r.string()}).transform(I=>(0,i.remap)(I,{max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",agent_id:"agentId"})),e.AgentsCompletionRequest$outboundSchema=r.object({maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),responseFormat:u.ResponseFormat$outboundSchema.optional(),tools:r.nullable(r.array(d.Tool$outboundSchema)).optional(),toolChoice:r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:r.number().optional(),frequencyPenalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$outboundSchema.optional(),parallelToolCalls:r.boolean().optional(),promptMode:r.nullable(c.MistralPromptMode$outboundSchema).optional(),agentId:r.string()}).transform(I=>(0,i.remap)(I,{maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",agentId:"agent_id"}));var N;(function(I){I.inboundSchema=e.AgentsCompletionRequest$inboundSchema,I.outboundSchema=e.AgentsCompletionRequest$outboundSchema})(N||(e.AgentsCompletionRequest$=N={}));function L(I){return JSON.stringify(e.AgentsCompletionRequest$outboundSchema.parse(I))}function q(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionRequest$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionRequest' from JSON")}})(Vu)),Vu}var dc={},p8;function Rqe(){return p8||(p8=1,(function(e){var t=dc&&dc.__createBinding||(Object.create?(function(I,U,J,V){V===void 0&&(V=J);var G=Object.getOwnPropertyDescriptor(U,J);(!G||("get"in G?!U.__esModule:G.writable||G.configurable))&&(G={enumerable:!0,get:function(){return U[J]}}),Object.defineProperty(I,V,G)}):(function(I,U,J,V){V===void 0&&(V=J),I[V]=U[J]})),n=dc&&dc.__setModuleDefault||(Object.create?(function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}):function(I,U){I.default=U}),o=dc&&dc.__importStar||(function(){var I=function(U){return I=Object.getOwnPropertyNames||function(J){var V=[];for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(V[V.length]=G);return V},I(U)};return function(U){if(U&&U.__esModule)return U;var J={};if(U!=null)for(var V=I(U),G=0;Ge.AgentsCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionStreamRequestStop' from JSON")}e.AgentsCompletionStreamRequestMessages$inboundSchema=r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]),e.AgentsCompletionStreamRequestMessages$outboundSchema=r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]);var w;(function(I){I.inboundSchema=e.AgentsCompletionStreamRequestMessages$inboundSchema,I.outboundSchema=e.AgentsCompletionStreamRequestMessages$outboundSchema})(w||(e.AgentsCompletionStreamRequestMessages$=w={}));function R(I){return JSON.stringify(e.AgentsCompletionStreamRequestMessages$outboundSchema.parse(I))}function E(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionStreamRequestMessages$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionStreamRequestMessages' from JSON")}e.AgentsCompletionStreamRequestToolChoice$inboundSchema=r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]),e.AgentsCompletionStreamRequestToolChoice$outboundSchema=r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]);var T;(function(I){I.inboundSchema=e.AgentsCompletionStreamRequestToolChoice$inboundSchema,I.outboundSchema=e.AgentsCompletionStreamRequestToolChoice$outboundSchema})(T||(e.AgentsCompletionStreamRequestToolChoice$=T={}));function D(I){return JSON.stringify(e.AgentsCompletionStreamRequestToolChoice$outboundSchema.parse(I))}function B(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionStreamRequestToolChoice$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionStreamRequestToolChoice' from JSON")}e.AgentsCompletionStreamRequest$inboundSchema=r.object({max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),response_format:u.ResponseFormat$inboundSchema.optional(),tools:r.nullable(r.array(d.Tool$inboundSchema)).optional(),tool_choice:r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:r.number().optional(),frequency_penalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$inboundSchema.optional(),parallel_tool_calls:r.boolean().optional(),prompt_mode:r.nullable(c.MistralPromptMode$inboundSchema).optional(),agent_id:r.string()}).transform(I=>(0,i.remap)(I,{max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",agent_id:"agentId"})),e.AgentsCompletionStreamRequest$outboundSchema=r.object({maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),responseFormat:u.ResponseFormat$outboundSchema.optional(),tools:r.nullable(r.array(d.Tool$outboundSchema)).optional(),toolChoice:r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:r.number().optional(),frequencyPenalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$outboundSchema.optional(),parallelToolCalls:r.boolean().optional(),promptMode:r.nullable(c.MistralPromptMode$outboundSchema).optional(),agentId:r.string()}).transform(I=>(0,i.remap)(I,{maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",agentId:"agent_id"}));var N;(function(I){I.inboundSchema=e.AgentsCompletionStreamRequest$inboundSchema,I.outboundSchema=e.AgentsCompletionStreamRequest$outboundSchema})(N||(e.AgentsCompletionStreamRequest$=N={}));function L(I){return JSON.stringify(e.AgentsCompletionStreamRequest$outboundSchema.parse(I))}function q(I){return(0,s.safeParse)(I,U=>e.AgentsCompletionStreamRequest$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'AgentsCompletionStreamRequest' from JSON")}})(dc)),dc}var fc={},m8;function Eqe(){return m8||(m8=1,(function(e){var t=fc&&fc.__createBinding||(Object.create?(function(w,R,E,T){T===void 0&&(T=E);var D=Object.getOwnPropertyDescriptor(R,E);(!D||("get"in D?!R.__esModule:D.writable||D.configurable))&&(D={enumerable:!0,get:function(){return R[E]}}),Object.defineProperty(w,T,D)}):(function(w,R,E,T){T===void 0&&(T=E),w[T]=R[E]})),n=fc&&fc.__setModuleDefault||(Object.create?(function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}):function(w,R){w.default=R}),o=fc&&fc.__importStar||(function(){var w=function(R){return w=Object.getOwnPropertyNames||function(E){var T=[];for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(T[T.length]=D);return T},w(R)};return function(R){if(R&&R.__esModule)return R;var E={};if(R!=null)for(var T=w(R),D=0;D({type:w.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))]),e.AgentUpdateRequestTools$outboundSchema=r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))]);var h;(function(w){w.inboundSchema=e.AgentUpdateRequestTools$inboundSchema,w.outboundSchema=e.AgentUpdateRequestTools$outboundSchema})(h||(e.AgentUpdateRequestTools$=h={}));function m(w){return JSON.stringify(e.AgentUpdateRequestTools$outboundSchema.parse(w))}function g(w){return(0,s.safeParse)(w,R=>e.AgentUpdateRequestTools$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'AgentUpdateRequestTools' from JSON")}e.AgentUpdateRequest$inboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))])).optional(),completion_args:c.CompletionArgs$inboundSchema.optional(),model:r.nullable(r.string()).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),deployment_chat:r.nullable(r.boolean()).optional(),metadata:r.nullable(r.record(r.any())).optional()}).transform(w=>(0,i.remap)(w,{completion_args:"completionArgs",deployment_chat:"deploymentChat"})),e.AgentUpdateRequest$outboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(w=>({type:w.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(w=>({type:w.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(w=>({type:w.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(w=>({type:w.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(w=>({type:w.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(w=>({type:w.type})))])).optional(),completionArgs:c.CompletionArgs$outboundSchema.optional(),model:r.nullable(r.string()).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),handoffs:r.nullable(r.array(r.string())).optional(),deploymentChat:r.nullable(r.boolean()).optional(),metadata:r.nullable(r.record(r.any())).optional()}).transform(w=>(0,i.remap)(w,{completionArgs:"completion_args",deploymentChat:"deployment_chat"}));var y;(function(w){w.inboundSchema=e.AgentUpdateRequest$inboundSchema,w.outboundSchema=e.AgentUpdateRequest$outboundSchema})(y||(e.AgentUpdateRequest$=y={}));function _(w){return JSON.stringify(e.AgentUpdateRequest$outboundSchema.parse(w))}function S(w){return(0,s.safeParse)(w,R=>e.AgentUpdateRequest$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'AgentUpdateRequest' from JSON")}})(fc)),fc}var hc={},g8;function jie(){return g8||(g8=1,(function(e){var t=hc&&hc.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),n=hc&&hc.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),o=hc&&hc.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;le.ArchiveFTModelOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ArchiveFTModelOut' from JSON")}})(pc)),pc}var mc={},Li={},y8;function jm(){if(y8)return Li;y8=1;var e=Li&&Li.__createBinding||(Object.create?(function(i,s,a,c){c===void 0&&(c=a);var p=Object.getOwnPropertyDescriptor(s,a);(!p||("get"in p?!s.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,c,p)}):(function(i,s,a,c){c===void 0&&(c=a),i[c]=s[a]})),t=Li&&Li.__setModuleDefault||(Object.create?(function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}):function(i,s){i.default=s}),n=Li&&Li.__importStar||(function(){var i=function(s){return i=Object.getOwnPropertyNames||function(a){var c=[];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(c[c.length]=p);return c},i(s)};return function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var c=i(s),p=0;pe.FileT$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'FileT' from JSON")}})(gc)),gc}var bc={},_8;function Gx(){return _8||(_8=1,(function(e){var t=bc&&bc.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=bc&&bc.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=bc&&bc.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(f,{file_url:"fileUrl",file_id:"fileId",timestamp_granularities:"timestampGranularities"})),e.AudioTranscriptionRequest$outboundSchema=r.object({model:r.string(),file:c.FileT$outboundSchema.or(a.blobLikeSchema).optional(),fileUrl:r.nullable(r.string()).optional(),fileId:r.nullable(r.string()).optional(),language:r.nullable(r.string()).optional(),temperature:r.nullable(r.number()).optional(),stream:r.literal(!1).default(!1),timestampGranularities:r.array(p.TimestampGranularity$outboundSchema).optional()}).transform(f=>(0,i.remap)(f,{fileUrl:"file_url",fileId:"file_id",timestampGranularities:"timestamp_granularities"}));var u;(function(f){f.inboundSchema=e.AudioTranscriptionRequest$inboundSchema,f.outboundSchema=e.AudioTranscriptionRequest$outboundSchema})(u||(e.AudioTranscriptionRequest$=u={}));function l(f){return JSON.stringify(e.AudioTranscriptionRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.AudioTranscriptionRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'AudioTranscriptionRequest' from JSON")}})(mc)),mc}var yc={},S8;function Iqe(){return S8||(S8=1,(function(e){var t=yc&&yc.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=yc&&yc.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=yc&&yc.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{file_url:"fileUrl",file_id:"fileId",timestamp_granularities:"timestampGranularities"})),e.AudioTranscriptionRequestStream$outboundSchema=r.object({model:r.string(),file:c.FileT$outboundSchema.or(a.blobLikeSchema).optional(),fileUrl:r.nullable(r.string()).optional(),fileId:r.nullable(r.string()).optional(),language:r.nullable(r.string()).optional(),temperature:r.nullable(r.number()).optional(),stream:r.literal(!0).default(!0),timestampGranularities:r.array(p.TimestampGranularity$outboundSchema).optional()}).transform(f=>(0,i.remap)(f,{fileUrl:"file_url",fileId:"file_id",timestampGranularities:"timestamp_granularities"}));var u;(function(f){f.inboundSchema=e.AudioTranscriptionRequestStream$inboundSchema,f.outboundSchema=e.AudioTranscriptionRequestStream$outboundSchema})(u||(e.AudioTranscriptionRequestStream$=u={}));function l(f){return JSON.stringify(e.AudioTranscriptionRequestStream$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.AudioTranscriptionRequestStream$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'AudioTranscriptionRequestStream' from JSON")}})(yc)),yc}var Ac={},_c={},C8;function zx(){return C8||(C8=1,(function(e){var t=_c&&_c.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=_c&&_c.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=_c&&_c.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{completion_chat:"completionChat",function_calling:"functionCalling",completion_fim:"completionFim",fine_tuning:"fineTuning"})),e.ModelCapabilities$outboundSchema=r.object({completionChat:r.boolean().default(!1),functionCalling:r.boolean().default(!1),completionFim:r.boolean().default(!1),fineTuning:r.boolean().default(!1),vision:r.boolean().default(!1),ocr:r.boolean().default(!1),classification:r.boolean().default(!1),moderation:r.boolean().default(!1),audio:r.boolean().default(!1)}).transform(u=>(0,i.remap)(u,{completionChat:"completion_chat",functionCalling:"function_calling",completionFim:"completion_fim",fineTuning:"fine_tuning"}));var a;(function(u){u.inboundSchema=e.ModelCapabilities$inboundSchema,u.outboundSchema=e.ModelCapabilities$outboundSchema})(a||(e.ModelCapabilities$=a={}));function c(u){return JSON.stringify(e.ModelCapabilities$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ModelCapabilities$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ModelCapabilities' from JSON")}})(_c)),_c}var w8;function Die(){return w8||(w8=1,(function(e){var t=Ac&&Ac.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Ac&&Ac.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Ac&&Ac.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;gnew Date(d))).optional(),deprecation_replacement_model:r.nullable(r.string()).optional(),default_model_temperature:r.nullable(r.number()).optional(),type:r.literal("base").default("base")}).transform(d=>(0,i.remap)(d,{owned_by:"ownedBy",max_context_length:"maxContextLength",deprecation_replacement_model:"deprecationReplacementModel",default_model_temperature:"defaultModelTemperature"})),e.BaseModelCard$outboundSchema=r.object({id:r.string(),object:r.string().default("model"),created:r.number().int().optional(),ownedBy:r.string().default("mistralai"),capabilities:a.ModelCapabilities$outboundSchema,name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),maxContextLength:r.number().int().default(32768),aliases:r.array(r.string()).optional(),deprecation:r.nullable(r.date().transform(d=>d.toISOString())).optional(),deprecationReplacementModel:r.nullable(r.string()).optional(),defaultModelTemperature:r.nullable(r.number()).optional(),type:r.literal("base").default("base")}).transform(d=>(0,i.remap)(d,{ownedBy:"owned_by",maxContextLength:"max_context_length",deprecationReplacementModel:"deprecation_replacement_model",defaultModelTemperature:"default_model_temperature"}));var p;(function(d){d.inboundSchema=e.BaseModelCard$inboundSchema,d.outboundSchema=e.BaseModelCard$outboundSchema})(p||(e.BaseModelCard$=p={}));function u(d){return JSON.stringify(e.BaseModelCard$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.BaseModelCard$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'BaseModelCard' from JSON")}})(Ac)),Ac}var vc={},O8;function Nie(){return O8||(O8=1,(function(e){var t=vc&&vc.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=vc&&vc.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=vc&&vc.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.BatchError$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'BatchError' from JSON")}})(vc)),vc}var Sc={},T8;function jqe(){return T8||(T8=1,(function(e){var t=Sc&&Sc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Sc&&Sc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Sc&&Sc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{input_files:"inputFiles",agent_id:"agentId",timeout_hours:"timeoutHours"})),e.BatchJobIn$outboundSchema=r.object({inputFiles:r.array(r.string()),endpoint:a.ApiEndpoint$outboundSchema,model:r.nullable(r.string()).optional(),agentId:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.string())).optional(),timeoutHours:r.number().int().default(24)}).transform(l=>(0,i.remap)(l,{inputFiles:"input_files",agentId:"agent_id",timeoutHours:"timeout_hours"}));var c;(function(l){l.inboundSchema=e.BatchJobIn$inboundSchema,l.outboundSchema=e.BatchJobIn$outboundSchema})(c||(e.BatchJobIn$=c={}));function p(l){return JSON.stringify(e.BatchJobIn$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.BatchJobIn$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'BatchJobIn' from JSON")}})(Sc)),Sc}var Cc={},wc={},R8;function Lie(){return R8||(R8=1,(function(e){var t=wc&&wc.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=wc&&wc.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=wc&&wc.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(f,{input_files:"inputFiles",agent_id:"agentId",output_file:"outputFile",error_file:"errorFile",created_at:"createdAt",total_requests:"totalRequests",completed_requests:"completedRequests",succeeded_requests:"succeededRequests",failed_requests:"failedRequests",started_at:"startedAt",completed_at:"completedAt"})),e.BatchJobOut$outboundSchema=r.object({id:r.string(),object:e.BatchJobOutObject$outboundSchema.default("batch"),inputFiles:r.array(r.string()),metadata:r.nullable(r.record(r.any())).optional(),endpoint:r.string(),model:r.nullable(r.string()).optional(),agentId:r.nullable(r.string()).optional(),outputFile:r.nullable(r.string()).optional(),errorFile:r.nullable(r.string()).optional(),errors:r.array(a.BatchError$outboundSchema),status:c.BatchJobStatus$outboundSchema,createdAt:r.number().int(),totalRequests:r.number().int(),completedRequests:r.number().int(),succeededRequests:r.number().int(),failedRequests:r.number().int(),startedAt:r.nullable(r.number().int()).optional(),completedAt:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{inputFiles:"input_files",agentId:"agent_id",outputFile:"output_file",errorFile:"error_file",createdAt:"created_at",totalRequests:"total_requests",completedRequests:"completed_requests",succeededRequests:"succeeded_requests",failedRequests:"failed_requests",startedAt:"started_at",completedAt:"completed_at"}));var u;(function(f){f.inboundSchema=e.BatchJobOut$inboundSchema,f.outboundSchema=e.BatchJobOut$outboundSchema})(u||(e.BatchJobOut$=u={}));function l(f){return JSON.stringify(e.BatchJobOut$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.BatchJobOut$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'BatchJobOut' from JSON")}})(Cc)),Cc}var Oc={},M8;function Dqe(){return M8||(M8=1,(function(e){var t=Oc&&Oc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Oc&&Oc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Oc&&Oc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.BatchJobsOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'BatchJobsOut' from JSON")}})(Oc)),Oc}var Tc={},P8;function lb(){return P8||(P8=1,(function(e){var t=Tc&&Tc.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Tc&&Tc.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Tc&&Tc.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u({role:g.role}))),c.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(g=>({role:g.role}))),p.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(g=>({role:g.role}))),s.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(g=>({role:g.role})))]),e.InstructRequestMessages$outboundSchema=r.union([a.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(g=>({role:g.role}))),c.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(g=>({role:g.role}))),p.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(g=>({role:g.role}))),s.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(g=>({role:g.role})))]);var u;(function(g){g.inboundSchema=e.InstructRequestMessages$inboundSchema,g.outboundSchema=e.InstructRequestMessages$outboundSchema})(u||(e.InstructRequestMessages$=u={}));function l(g){return JSON.stringify(e.InstructRequestMessages$outboundSchema.parse(g))}function d(g){return(0,i.safeParse)(g,y=>e.InstructRequestMessages$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'InstructRequestMessages' from JSON")}e.InstructRequest$inboundSchema=r.object({messages:r.array(r.union([a.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(g=>({role:g.role}))),c.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(g=>({role:g.role}))),p.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(g=>({role:g.role}))),s.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(g=>({role:g.role})))]))}),e.InstructRequest$outboundSchema=r.object({messages:r.array(r.union([a.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(g=>({role:g.role}))),c.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(g=>({role:g.role}))),p.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(g=>({role:g.role}))),s.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(g=>({role:g.role})))]))});var f;(function(g){g.inboundSchema=e.InstructRequest$inboundSchema,g.outboundSchema=e.InstructRequest$outboundSchema})(f||(e.InstructRequest$=f={}));function h(g){return JSON.stringify(e.InstructRequest$outboundSchema.parse(g))}function m(g){return(0,i.safeParse)(g,y=>e.InstructRequest$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'InstructRequest' from JSON")}})(Mc)),Mc}var j8;function Bie(){return j8||(j8=1,(function(e){var t=Ec&&Ec.__createBinding||(Object.create?(function(w,R,E,T){T===void 0&&(T=E);var D=Object.getOwnPropertyDescriptor(R,E);(!D||("get"in D?!R.__esModule:D.writable||D.configurable))&&(D={enumerable:!0,get:function(){return R[E]}}),Object.defineProperty(w,T,D)}):(function(w,R,E,T){T===void 0&&(T=E),w[T]=R[E]})),n=Ec&&Ec.__setModuleDefault||(Object.create?(function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}):function(w,R){w.default=R}),o=Ec&&Ec.__importStar||(function(){var w=function(R){return w=Object.getOwnPropertyNames||function(E){var T=[];for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(T[T.length]=D);return T},w(R)};return function(R){if(R&&R.__esModule)return R;var E={};if(R!=null)for(var T=w(R),D=0;D({role:w.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(w=>({role:w.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(w=>({role:w.role}))),s.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(w=>({role:w.role})))]),e.InstructRequestInputsMessages$outboundSchema=r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(w=>({role:w.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(w=>({role:w.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(w=>({role:w.role}))),s.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(w=>({role:w.role})))]);var l;(function(w){w.inboundSchema=e.InstructRequestInputsMessages$inboundSchema,w.outboundSchema=e.InstructRequestInputsMessages$outboundSchema})(l||(e.InstructRequestInputsMessages$=l={}));function d(w){return JSON.stringify(e.InstructRequestInputsMessages$outboundSchema.parse(w))}function f(w){return(0,i.safeParse)(w,R=>e.InstructRequestInputsMessages$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'InstructRequestInputsMessages' from JSON")}e.InstructRequestInputs$inboundSchema=r.object({messages:r.array(r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(w=>({role:w.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(w=>({role:w.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(w=>({role:w.role}))),s.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(w=>({role:w.role})))]))}),e.InstructRequestInputs$outboundSchema=r.object({messages:r.array(r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(w=>({role:w.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(w=>({role:w.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(w=>({role:w.role}))),s.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(w=>({role:w.role})))]))});var h;(function(w){w.inboundSchema=e.InstructRequestInputs$inboundSchema,w.outboundSchema=e.InstructRequestInputs$outboundSchema})(h||(e.InstructRequestInputs$=h={}));function m(w){return JSON.stringify(e.InstructRequestInputs$outboundSchema.parse(w))}function g(w){return(0,i.safeParse)(w,R=>e.InstructRequestInputs$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'InstructRequestInputs' from JSON")}e.Inputs$inboundSchema=r.union([r.lazy(()=>e.InstructRequestInputs$inboundSchema),r.array(a.InstructRequest$inboundSchema)]),e.Inputs$outboundSchema=r.union([r.lazy(()=>e.InstructRequestInputs$outboundSchema),r.array(a.InstructRequest$outboundSchema)]);var y;(function(w){w.inboundSchema=e.Inputs$inboundSchema,w.outboundSchema=e.Inputs$outboundSchema})(y||(e.Inputs$=y={}));function _(w){return JSON.stringify(e.Inputs$outboundSchema.parse(w))}function S(w){return(0,i.safeParse)(w,R=>e.Inputs$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'Inputs' from JSON")}})(Ec)),Ec}var D8;function Nqe(){return D8||(D8=1,(function(e){var t=Rc&&Rc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Rc&&Rc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Rc&&Rc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{input:"inputs"})),e.ChatClassificationRequest$outboundSchema=r.object({model:r.string(),inputs:a.Inputs$outboundSchema}).transform(l=>(0,i.remap)(l,{inputs:"input"}));var c;(function(l){l.inboundSchema=e.ChatClassificationRequest$inboundSchema,l.outboundSchema=e.ChatClassificationRequest$outboundSchema})(c||(e.ChatClassificationRequest$=c={}));function p(l){return JSON.stringify(e.ChatClassificationRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ChatClassificationRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ChatClassificationRequest' from JSON")}})(Rc)),Rc}var Pc={},N8;function Kx(){return N8||(N8=1,(function(e){var t=Pc&&Pc.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=Pc&&Pc.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=Pc&&Pc.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{finish_reason:"finishReason"})),e.ChatCompletionChoice$outboundSchema=r.object({index:r.number().int(),message:c.AssistantMessage$outboundSchema,finishReason:e.FinishReason$outboundSchema}).transform(f=>(0,i.remap)(f,{finishReason:"finish_reason"}));var u;(function(f){f.inboundSchema=e.ChatCompletionChoice$inboundSchema,f.outboundSchema=e.ChatCompletionChoice$outboundSchema})(u||(e.ChatCompletionChoice$=u={}));function l(f){return JSON.stringify(e.ChatCompletionChoice$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ChatCompletionChoice$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ChatCompletionChoice' from JSON")}})(Pc)),Pc}var Ic={},L8;function Lqe(){return L8||(L8=1,(function(e){var t=Ic&&Ic.__createBinding||(Object.create?(function(I,U,J,V){V===void 0&&(V=J);var G=Object.getOwnPropertyDescriptor(U,J);(!G||("get"in G?!U.__esModule:G.writable||G.configurable))&&(G={enumerable:!0,get:function(){return U[J]}}),Object.defineProperty(I,V,G)}):(function(I,U,J,V){V===void 0&&(V=J),I[V]=U[J]})),n=Ic&&Ic.__setModuleDefault||(Object.create?(function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}):function(I,U){I.default=U}),o=Ic&&Ic.__importStar||(function(){var I=function(U){return I=Object.getOwnPropertyNames||function(J){var V=[];for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(V[V.length]=G);return V},I(U)};return function(U){if(U&&U.__esModule)return U;var J={};if(U!=null)for(var V=I(U),G=0;Ge.Stop$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'Stop' from JSON")}e.Messages$inboundSchema=r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]),e.Messages$outboundSchema=r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]);var w;(function(I){I.inboundSchema=e.Messages$inboundSchema,I.outboundSchema=e.Messages$outboundSchema})(w||(e.Messages$=w={}));function R(I){return JSON.stringify(e.Messages$outboundSchema.parse(I))}function E(I){return(0,s.safeParse)(I,U=>e.Messages$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'Messages' from JSON")}e.ChatCompletionRequestToolChoice$inboundSchema=r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]),e.ChatCompletionRequestToolChoice$outboundSchema=r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]);var T;(function(I){I.inboundSchema=e.ChatCompletionRequestToolChoice$inboundSchema,I.outboundSchema=e.ChatCompletionRequestToolChoice$outboundSchema})(T||(e.ChatCompletionRequestToolChoice$=T={}));function D(I){return JSON.stringify(e.ChatCompletionRequestToolChoice$outboundSchema.parse(I))}function B(I){return(0,s.safeParse)(I,U=>e.ChatCompletionRequestToolChoice$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionRequestToolChoice' from JSON")}e.ChatCompletionRequest$inboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),top_p:r.number().optional(),max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),response_format:u.ResponseFormat$inboundSchema.optional(),tools:r.nullable(r.array(d.Tool$inboundSchema)).optional(),tool_choice:r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:r.number().optional(),frequency_penalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$inboundSchema.optional(),parallel_tool_calls:r.boolean().optional(),prompt_mode:r.nullable(c.MistralPromptMode$inboundSchema).optional(),safe_prompt:r.boolean().optional()}).transform(I=>(0,i.remap)(I,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",safe_prompt:"safePrompt"})),e.ChatCompletionRequest$outboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),topP:r.number().optional(),maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),responseFormat:u.ResponseFormat$outboundSchema.optional(),tools:r.nullable(r.array(d.Tool$outboundSchema)).optional(),toolChoice:r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:r.number().optional(),frequencyPenalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$outboundSchema.optional(),parallelToolCalls:r.boolean().optional(),promptMode:r.nullable(c.MistralPromptMode$outboundSchema).optional(),safePrompt:r.boolean().optional()}).transform(I=>(0,i.remap)(I,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",safePrompt:"safe_prompt"}));var N;(function(I){I.inboundSchema=e.ChatCompletionRequest$inboundSchema,I.outboundSchema=e.ChatCompletionRequest$outboundSchema})(N||(e.ChatCompletionRequest$=N={}));function L(I){return JSON.stringify(e.ChatCompletionRequest$outboundSchema.parse(I))}function q(I){return(0,s.safeParse)(I,U=>e.ChatCompletionRequest$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionRequest' from JSON")}})(Ic)),Ic}var jc={},Dc={},F8;function ub(){return F8||(F8=1,(function(e){var t=Dc&&Dc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Dc&&Dc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Dc&&Dc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",prompt_audio_seconds:"promptAudioSeconds"})),e.UsageInfo$outboundSchema=r.object({promptTokens:r.number().int().default(0),completionTokens:r.number().int().default(0),totalTokens:r.number().int().default(0),promptAudioSeconds:r.nullable(r.number().int()).optional(),additionalProperties:r.record(r.any())}).transform(u=>({...u.additionalProperties,...(0,i.remap)(u,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",promptAudioSeconds:"prompt_audio_seconds",additionalProperties:null})}));var a;(function(u){u.inboundSchema=e.UsageInfo$inboundSchema,u.outboundSchema=e.UsageInfo$outboundSchema})(a||(e.UsageInfo$=a={}));function c(u){return JSON.stringify(e.UsageInfo$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.UsageInfo$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'UsageInfo' from JSON")}})(Dc)),Dc}var x8;function Fqe(){return x8||(x8=1,(function(e){var t=jc&&jc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=jc&&jc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=jc&&jc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.ChatCompletionResponse$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ChatCompletionResponse' from JSON")}})(jc)),jc}var Nc={},B8;function xqe(){return B8||(B8=1,(function(e){var t=Nc&&Nc.__createBinding||(Object.create?(function(I,U,J,V){V===void 0&&(V=J);var G=Object.getOwnPropertyDescriptor(U,J);(!G||("get"in G?!U.__esModule:G.writable||G.configurable))&&(G={enumerable:!0,get:function(){return U[J]}}),Object.defineProperty(I,V,G)}):(function(I,U,J,V){V===void 0&&(V=J),I[V]=U[J]})),n=Nc&&Nc.__setModuleDefault||(Object.create?(function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}):function(I,U){I.default=U}),o=Nc&&Nc.__importStar||(function(){var I=function(U){return I=Object.getOwnPropertyNames||function(J){var V=[];for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(V[V.length]=G);return V},I(U)};return function(U){if(U&&U.__esModule)return U;var J={};if(U!=null)for(var V=I(U),G=0;Ge.ChatCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionStreamRequestStop' from JSON")}e.ChatCompletionStreamRequestMessages$inboundSchema=r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]),e.ChatCompletionStreamRequestMessages$outboundSchema=r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))]);var w;(function(I){I.inboundSchema=e.ChatCompletionStreamRequestMessages$inboundSchema,I.outboundSchema=e.ChatCompletionStreamRequestMessages$outboundSchema})(w||(e.ChatCompletionStreamRequestMessages$=w={}));function R(I){return JSON.stringify(e.ChatCompletionStreamRequestMessages$outboundSchema.parse(I))}function E(I){return(0,s.safeParse)(I,U=>e.ChatCompletionStreamRequestMessages$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionStreamRequestMessages' from JSON")}e.ChatCompletionStreamRequestToolChoice$inboundSchema=r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]),e.ChatCompletionStreamRequestToolChoice$outboundSchema=r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]);var T;(function(I){I.inboundSchema=e.ChatCompletionStreamRequestToolChoice$inboundSchema,I.outboundSchema=e.ChatCompletionStreamRequestToolChoice$outboundSchema})(T||(e.ChatCompletionStreamRequestToolChoice$=T={}));function D(I){return JSON.stringify(e.ChatCompletionStreamRequestToolChoice$outboundSchema.parse(I))}function B(I){return(0,s.safeParse)(I,U=>e.ChatCompletionStreamRequestToolChoice$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionStreamRequestToolChoice' from JSON")}e.ChatCompletionStreamRequest$inboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),top_p:r.number().optional(),max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),response_format:u.ResponseFormat$inboundSchema.optional(),tools:r.nullable(r.array(d.Tool$inboundSchema)).optional(),tool_choice:r.union([f.ToolChoice$inboundSchema,h.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:r.number().optional(),frequency_penalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$inboundSchema.optional(),parallel_tool_calls:r.boolean().optional(),prompt_mode:r.nullable(c.MistralPromptMode$inboundSchema).optional(),safe_prompt:r.boolean().optional()}).transform(I=>(0,i.remap)(I,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",safe_prompt:"safePrompt"})),e.ChatCompletionStreamRequest$outboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),topP:r.number().optional(),maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),messages:r.array(r.union([l.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(I=>({role:I.role}))),m.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(I=>({role:I.role}))),g.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(I=>({role:I.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(I=>({role:I.role})))])),responseFormat:u.ResponseFormat$outboundSchema.optional(),tools:r.nullable(r.array(d.Tool$outboundSchema)).optional(),toolChoice:r.union([f.ToolChoice$outboundSchema,h.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:r.number().optional(),frequencyPenalty:r.number().optional(),n:r.nullable(r.number().int()).optional(),prediction:p.Prediction$outboundSchema.optional(),parallelToolCalls:r.boolean().optional(),promptMode:r.nullable(c.MistralPromptMode$outboundSchema).optional(),safePrompt:r.boolean().optional()}).transform(I=>(0,i.remap)(I,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",safePrompt:"safe_prompt"}));var N;(function(I){I.inboundSchema=e.ChatCompletionStreamRequest$inboundSchema,I.outboundSchema=e.ChatCompletionStreamRequest$outboundSchema})(N||(e.ChatCompletionStreamRequest$=N={}));function L(I){return JSON.stringify(e.ChatCompletionStreamRequest$outboundSchema.parse(I))}function q(I){return(0,s.safeParse)(I,U=>e.ChatCompletionStreamRequest$inboundSchema.parse(JSON.parse(U)),"Failed to parse 'ChatCompletionStreamRequest' from JSON")}})(Nc)),Nc}var Lc={},k8;function Bqe(){return k8||(k8=1,(function(e){var t=Lc&&Lc.__createBinding||(Object.create?(function(T,D,B,N){N===void 0&&(N=B);var L=Object.getOwnPropertyDescriptor(D,B);(!L||("get"in L?!D.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return D[B]}}),Object.defineProperty(T,N,L)}):(function(T,D,B,N){N===void 0&&(N=B),T[N]=D[B]})),n=Lc&&Lc.__setModuleDefault||(Object.create?(function(T,D){Object.defineProperty(T,"default",{enumerable:!0,value:D})}):function(T,D){T.default=D}),o=Lc&&Lc.__importStar||(function(){var T=function(D){return T=Object.getOwnPropertyNames||function(B){var N=[];for(var L in B)Object.prototype.hasOwnProperty.call(B,L)&&(N[N.length]=L);return N},T(D)};return function(D){if(D&&D.__esModule)return D;var B={};if(D!=null)for(var N=T(D),L=0;L({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))]),e.Two$outboundSchema=r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))]);var l;(function(T){T.inboundSchema=e.Two$inboundSchema,T.outboundSchema=e.Two$outboundSchema})(l||(e.Two$=l={}));function d(T){return JSON.stringify(e.Two$outboundSchema.parse(T))}function f(T){return(0,s.safeParse)(T,D=>e.Two$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'Two' from JSON")}e.One$inboundSchema=r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))]),e.One$outboundSchema=r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))]);var h;(function(T){T.inboundSchema=e.One$inboundSchema,T.outboundSchema=e.One$outboundSchema})(h||(e.One$=h={}));function m(T){return JSON.stringify(e.One$outboundSchema.parse(T))}function g(T){return(0,s.safeParse)(T,D=>e.One$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'One' from JSON")}e.ChatModerationRequestInputs$inboundSchema=r.union([r.array(r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])),r.array(r.array(r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])))]),e.ChatModerationRequestInputs$outboundSchema=r.union([r.array(r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])),r.array(r.array(r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])))]);var y;(function(T){T.inboundSchema=e.ChatModerationRequestInputs$inboundSchema,T.outboundSchema=e.ChatModerationRequestInputs$outboundSchema})(y||(e.ChatModerationRequestInputs$=y={}));function _(T){return JSON.stringify(e.ChatModerationRequestInputs$outboundSchema.parse(T))}function S(T){return(0,s.safeParse)(T,D=>e.ChatModerationRequestInputs$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'ChatModerationRequestInputs' from JSON")}e.ChatModerationRequest$inboundSchema=r.object({input:r.union([r.array(r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])),r.array(r.array(r.union([c.SystemMessage$inboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$inboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$inboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$inboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])))]),model:r.string()}).transform(T=>(0,i.remap)(T,{input:"inputs"})),e.ChatModerationRequest$outboundSchema=r.object({inputs:r.union([r.array(r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])),r.array(r.array(r.union([c.SystemMessage$outboundSchema.and(r.object({role:r.literal("system")}).transform(T=>({role:T.role}))),p.ToolMessage$outboundSchema.and(r.object({role:r.literal("tool")}).transform(T=>({role:T.role}))),u.UserMessage$outboundSchema.and(r.object({role:r.literal("user")}).transform(T=>({role:T.role}))),a.AssistantMessage$outboundSchema.and(r.object({role:r.literal("assistant")}).transform(T=>({role:T.role})))])))]),model:r.string()}).transform(T=>(0,i.remap)(T,{inputs:"input"}));var w;(function(T){T.inboundSchema=e.ChatModerationRequest$inboundSchema,T.outboundSchema=e.ChatModerationRequest$outboundSchema})(w||(e.ChatModerationRequest$=w={}));function R(T){return JSON.stringify(e.ChatModerationRequest$outboundSchema.parse(T))}function E(T){return(0,s.safeParse)(T,D=>e.ChatModerationRequest$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'ChatModerationRequest' from JSON")}})(Lc)),Lc}var Fc={},xc={},U8;function kie(){return U8||(U8=1,(function(e){var t=xc&&xc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=xc&&xc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=xc&&xc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{train_loss:"trainLoss",valid_loss:"validLoss",valid_mean_token_accuracy:"validMeanTokenAccuracy"})),e.MetricOut$outboundSchema=r.object({trainLoss:r.nullable(r.number()).optional(),validLoss:r.nullable(r.number()).optional(),validMeanTokenAccuracy:r.nullable(r.number()).optional()}).transform(u=>(0,i.remap)(u,{trainLoss:"train_loss",validLoss:"valid_loss",validMeanTokenAccuracy:"valid_mean_token_accuracy"}));var a;(function(u){u.inboundSchema=e.MetricOut$inboundSchema,u.outboundSchema=e.MetricOut$outboundSchema})(a||(e.MetricOut$=a={}));function c(u){return JSON.stringify(e.MetricOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.MetricOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'MetricOut' from JSON")}})(xc)),xc}var q8;function Qx(){return q8||(q8=1,(function(e){var t=Fc&&Fc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Fc&&Fc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Fc&&Fc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{step_number:"stepNumber",created_at:"createdAt"})),e.CheckpointOut$outboundSchema=r.object({metrics:a.MetricOut$outboundSchema,stepNumber:r.number().int(),createdAt:r.number().int()}).transform(l=>(0,i.remap)(l,{stepNumber:"step_number",createdAt:"created_at"}));var c;(function(l){l.inboundSchema=e.CheckpointOut$inboundSchema,l.outboundSchema=e.CheckpointOut$outboundSchema})(c||(e.CheckpointOut$=c={}));function p(l){return JSON.stringify(e.CheckpointOut$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.CheckpointOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'CheckpointOut' from JSON")}})(Fc)),Fc}var Bc={},J8;function kqe(){return J8||(J8=1,(function(e){var t=Bc&&Bc.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=Bc&&Bc.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=Bc&&Bc.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;ye.ClassificationRequestInputs$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ClassificationRequestInputs' from JSON")}e.ClassificationRequest$inboundSchema=r.object({model:r.string(),input:r.union([r.string(),r.array(r.string())])}).transform(f=>(0,i.remap)(f,{input:"inputs"})),e.ClassificationRequest$outboundSchema=r.object({model:r.string(),inputs:r.union([r.string(),r.array(r.string())])}).transform(f=>(0,i.remap)(f,{inputs:"input"}));var u;(function(f){f.inboundSchema=e.ClassificationRequest$inboundSchema,f.outboundSchema=e.ClassificationRequest$outboundSchema})(u||(e.ClassificationRequest$=u={}));function l(f){return JSON.stringify(e.ClassificationRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ClassificationRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ClassificationRequest' from JSON")}})(Bc)),Bc}var kc={},Uc={},V8;function Uie(){return V8||(V8=1,(function(e){var t=Uc&&Uc.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Uc&&Uc.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Uc&&Uc.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.ClassificationTargetResult$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'ClassificationTargetResult' from JSON")}})(Uc)),Uc}var H8;function Uqe(){return H8||(H8=1,(function(e){var t=kc&&kc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=kc&&kc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=kc&&kc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ClassificationResponse$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ClassificationResponse' from JSON")}})(kc)),kc}var qc={},Jc={},Vc={},G8;function $x(){return G8||(G8=1,(function(e){var t=Vc&&Vc.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Vc&&Vc.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Vc&&Vc.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(l,{loss_function:"lossFunction"})),e.ClassifierTargetOut$outboundSchema=r.object({name:r.string(),labels:r.array(r.string()),weight:r.number(),lossFunction:a.FTClassifierLossFunction$outboundSchema}).transform(l=>(0,i.remap)(l,{lossFunction:"loss_function"}));var c;(function(l){l.inboundSchema=e.ClassifierTargetOut$inboundSchema,l.outboundSchema=e.ClassifierTargetOut$outboundSchema})(c||(e.ClassifierTargetOut$=c={}));function p(l){return JSON.stringify(e.ClassifierTargetOut$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ClassifierTargetOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ClassifierTargetOut' from JSON")}})(Jc)),Jc}var Hc={},K8;function Yx(){return K8||(K8=1,(function(e){var t=Hc&&Hc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Hc&&Hc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Hc&&Hc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen"})),e.ClassifierTrainingParameters$outboundSchema=r.object({trainingSteps:r.nullable(r.number().int()).optional(),learningRate:r.number().default(1e-4),weightDecay:r.nullable(r.number()).optional(),warmupFraction:r.nullable(r.number()).optional(),epochs:r.nullable(r.number()).optional(),seqLen:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len"}));var a;(function(u){u.inboundSchema=e.ClassifierTrainingParameters$inboundSchema,u.outboundSchema=e.ClassifierTrainingParameters$outboundSchema})(a||(e.ClassifierTrainingParameters$=a={}));function c(u){return JSON.stringify(e.ClassifierTrainingParameters$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ClassifierTrainingParameters$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ClassifierTrainingParameters' from JSON")}})(Hc)),Hc}var Gc={},Q8;function Xx(){return Q8||(Q8=1,(function(e){var t=Gc&&Gc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Gc&&Gc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Gc&&Gc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{created_at:"createdAt"})),e.EventOut$outboundSchema=r.object({name:r.string(),data:r.nullable(r.record(r.any())).optional(),createdAt:r.number().int()}).transform(u=>(0,i.remap)(u,{createdAt:"created_at"}));var a;(function(u){u.inboundSchema=e.EventOut$inboundSchema,u.outboundSchema=e.EventOut$outboundSchema})(a||(e.EventOut$=a={}));function c(u){return JSON.stringify(e.EventOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.EventOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'EventOut' from JSON")}})(Gc)),Gc}var zc={},$8;function JC(){return $8||($8=1,(function(e){var t=zc&&zc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=zc&&zc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=zc&&zc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{expected_duration_seconds:"expectedDurationSeconds",cost_currency:"costCurrency",train_tokens_per_step:"trainTokensPerStep",train_tokens:"trainTokens",data_tokens:"dataTokens",estimated_start_time:"estimatedStartTime"})),e.JobMetadataOut$outboundSchema=r.object({expectedDurationSeconds:r.nullable(r.number().int()).optional(),cost:r.nullable(r.number()).optional(),costCurrency:r.nullable(r.string()).optional(),trainTokensPerStep:r.nullable(r.number().int()).optional(),trainTokens:r.nullable(r.number().int()).optional(),dataTokens:r.nullable(r.number().int()).optional(),estimatedStartTime:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{expectedDurationSeconds:"expected_duration_seconds",costCurrency:"cost_currency",trainTokensPerStep:"train_tokens_per_step",trainTokens:"train_tokens",dataTokens:"data_tokens",estimatedStartTime:"estimated_start_time"}));var a;(function(u){u.inboundSchema=e.JobMetadataOut$inboundSchema,u.outboundSchema=e.JobMetadataOut$outboundSchema})(a||(e.JobMetadataOut$=a={}));function c(u){return JSON.stringify(e.JobMetadataOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JobMetadataOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JobMetadataOut' from JSON")}})(zc)),zc}var Kc={},W8;function VC(){return W8||(W8=1,(function(e){var t=Kc&&Kc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Kc&&Kc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Kc&&Kc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{run_name:"runName"})),e.WandbIntegrationOut$outboundSchema=r.object({type:e.WandbIntegrationOutType$outboundSchema.default("wandb"),project:r.string(),name:r.nullable(r.string()).optional(),runName:r.nullable(r.string()).optional(),url:r.nullable(r.string()).optional()}).transform(l=>(0,i.remap)(l,{runName:"run_name"}));var c;(function(l){l.inboundSchema=e.WandbIntegrationOut$inboundSchema,l.outboundSchema=e.WandbIntegrationOut$outboundSchema})(c||(e.WandbIntegrationOut$=c={}));function p(l){return JSON.stringify(e.WandbIntegrationOut$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.WandbIntegrationOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'WandbIntegrationOut' from JSON")}})(Kc)),Kc}var Y8;function qqe(){return Y8||(Y8=1,(function(e){var t=qc&&qc.__createBinding||(Object.create?(function(E,T,D,B){B===void 0&&(B=D);var N=Object.getOwnPropertyDescriptor(T,D);(!N||("get"in N?!T.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return T[D]}}),Object.defineProperty(E,B,N)}):(function(E,T,D,B){B===void 0&&(B=D),E[B]=T[D]})),n=qc&&qc.__setModuleDefault||(Object.create?(function(E,T){Object.defineProperty(E,"default",{enumerable:!0,value:T})}):function(E,T){E.default=T}),o=qc&&qc.__importStar||(function(){var E=function(T){return E=Object.getOwnPropertyNames||function(D){var B=[];for(var N in D)Object.prototype.hasOwnProperty.call(D,N)&&(B[B.length]=N);return B},E(T)};return function(T){if(T&&T.__esModule)return T;var D={};if(T!=null)for(var B=E(T),N=0;Ne.ClassifierDetailedJobOutIntegrations$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'ClassifierDetailedJobOutIntegrations' from JSON")}e.ClassifierDetailedJobOutJobType$inboundSchema=r.nativeEnum(e.ClassifierDetailedJobOutJobType),e.ClassifierDetailedJobOutJobType$outboundSchema=e.ClassifierDetailedJobOutJobType$inboundSchema;var _;(function(E){E.inboundSchema=e.ClassifierDetailedJobOutJobType$inboundSchema,E.outboundSchema=e.ClassifierDetailedJobOutJobType$outboundSchema})(_||(e.ClassifierDetailedJobOutJobType$=_={})),e.ClassifierDetailedJobOut$inboundSchema=r.object({id:r.string(),auto_start:r.boolean(),model:r.string(),status:e.ClassifierDetailedJobOutStatus$inboundSchema,created_at:r.number().int(),modified_at:r.number().int(),training_files:r.array(r.string()),validation_files:r.nullable(r.array(r.string())).optional(),object:e.ClassifierDetailedJobOutObject$inboundSchema.default("job"),fine_tuned_model:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(d.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(l.JobMetadataOut$inboundSchema).optional(),job_type:e.ClassifierDetailedJobOutJobType$inboundSchema.default("classifier"),hyperparameters:p.ClassifierTrainingParameters$inboundSchema,events:r.array(u.EventOut$inboundSchema).optional(),checkpoints:r.array(a.CheckpointOut$inboundSchema).optional(),classifier_targets:r.array(c.ClassifierTargetOut$inboundSchema)}).transform(E=>(0,i.remap)(E,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType",classifier_targets:"classifierTargets"})),e.ClassifierDetailedJobOut$outboundSchema=r.object({id:r.string(),autoStart:r.boolean(),model:r.string(),status:e.ClassifierDetailedJobOutStatus$outboundSchema,createdAt:r.number().int(),modifiedAt:r.number().int(),trainingFiles:r.array(r.string()),validationFiles:r.nullable(r.array(r.string())).optional(),object:e.ClassifierDetailedJobOutObject$outboundSchema.default("job"),fineTunedModel:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(d.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(l.JobMetadataOut$outboundSchema).optional(),jobType:e.ClassifierDetailedJobOutJobType$outboundSchema.default("classifier"),hyperparameters:p.ClassifierTrainingParameters$outboundSchema,events:r.array(u.EventOut$outboundSchema).optional(),checkpoints:r.array(a.CheckpointOut$outboundSchema).optional(),classifierTargets:r.array(c.ClassifierTargetOut$outboundSchema)}).transform(E=>(0,i.remap)(E,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type",classifierTargets:"classifier_targets"}));var S;(function(E){E.inboundSchema=e.ClassifierDetailedJobOut$inboundSchema,E.outboundSchema=e.ClassifierDetailedJobOut$outboundSchema})(S||(e.ClassifierDetailedJobOut$=S={}));function w(E){return JSON.stringify(e.ClassifierDetailedJobOut$outboundSchema.parse(E))}function R(E){return(0,s.safeParse)(E,T=>e.ClassifierDetailedJobOut$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'ClassifierDetailedJobOut' from JSON")}})(qc)),qc}var Qc={},$c={},X8;function Zx(){return X8||(X8=1,(function(e){var t=$c&&$c.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=$c&&$c.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=$c&&$c.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{completion_chat:"completionChat",completion_fim:"completionFim",function_calling:"functionCalling",fine_tuning:"fineTuning"})),e.FTModelCapabilitiesOut$outboundSchema=r.object({completionChat:r.boolean().default(!0),completionFim:r.boolean().default(!1),functionCalling:r.boolean().default(!1),fineTuning:r.boolean().default(!1),classification:r.boolean().default(!1)}).transform(u=>(0,i.remap)(u,{completionChat:"completion_chat",completionFim:"completion_fim",functionCalling:"function_calling",fineTuning:"fine_tuning"}));var a;(function(u){u.inboundSchema=e.FTModelCapabilitiesOut$inboundSchema,u.outboundSchema=e.FTModelCapabilitiesOut$outboundSchema})(a||(e.FTModelCapabilitiesOut$=a={}));function c(u){return JSON.stringify(e.FTModelCapabilitiesOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FTModelCapabilitiesOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FTModelCapabilitiesOut' from JSON")}})($c)),$c}var Z8;function Jqe(){return Z8||(Z8=1,(function(e){var t=Qc&&Qc.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Qc&&Qc.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Qc&&Qc.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{owned_by:"ownedBy",workspace_id:"workspaceId",root_version:"rootVersion",max_context_length:"maxContextLength",classifier_targets:"classifierTargets",model_type:"modelType"})),e.ClassifierFTModelOut$outboundSchema=r.object({id:r.string(),object:e.ClassifierFTModelOutObject$outboundSchema.default("model"),created:r.number().int(),ownedBy:r.string(),workspaceId:r.string(),root:r.string(),rootVersion:r.string(),archived:r.boolean(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),capabilities:c.FTModelCapabilitiesOut$outboundSchema,maxContextLength:r.number().int().default(32768),aliases:r.array(r.string()).optional(),job:r.string(),classifierTargets:r.array(a.ClassifierTargetOut$outboundSchema),modelType:e.ClassifierFTModelOutModelType$outboundSchema.default("classifier")}).transform(h=>(0,i.remap)(h,{ownedBy:"owned_by",workspaceId:"workspace_id",rootVersion:"root_version",maxContextLength:"max_context_length",classifierTargets:"classifier_targets",modelType:"model_type"}));var l;(function(h){h.inboundSchema=e.ClassifierFTModelOut$inboundSchema,h.outboundSchema=e.ClassifierFTModelOut$outboundSchema})(l||(e.ClassifierFTModelOut$=l={}));function d(h){return JSON.stringify(e.ClassifierFTModelOut$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.ClassifierFTModelOut$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'ClassifierFTModelOut' from JSON")}})(Qc)),Qc}var Wc={},eG;function qie(){return eG||(eG=1,(function(e){var t=Wc&&Wc.__createBinding||(Object.create?(function(S,w,R,E){E===void 0&&(E=R);var T=Object.getOwnPropertyDescriptor(w,R);(!T||("get"in T?!w.__esModule:T.writable||T.configurable))&&(T={enumerable:!0,get:function(){return w[R]}}),Object.defineProperty(S,E,T)}):(function(S,w,R,E){E===void 0&&(E=R),S[E]=w[R]})),n=Wc&&Wc.__setModuleDefault||(Object.create?(function(S,w){Object.defineProperty(S,"default",{enumerable:!0,value:w})}):function(S,w){S.default=w}),o=Wc&&Wc.__importStar||(function(){var S=function(w){return S=Object.getOwnPropertyNames||function(R){var E=[];for(var T in R)Object.prototype.hasOwnProperty.call(R,T)&&(E[E.length]=T);return E},S(w)};return function(w){if(w&&w.__esModule)return w;var R={};if(w!=null)for(var E=S(w),T=0;Te.ClassifierJobOutIntegrations$inboundSchema.parse(JSON.parse(w)),"Failed to parse 'ClassifierJobOutIntegrations' from JSON")}e.ClassifierJobOutJobType$inboundSchema=r.nativeEnum(e.ClassifierJobOutJobType),e.ClassifierJobOutJobType$outboundSchema=e.ClassifierJobOutJobType$inboundSchema;var m;(function(S){S.inboundSchema=e.ClassifierJobOutJobType$inboundSchema,S.outboundSchema=e.ClassifierJobOutJobType$outboundSchema})(m||(e.ClassifierJobOutJobType$=m={})),e.ClassifierJobOut$inboundSchema=r.object({id:r.string(),auto_start:r.boolean(),model:r.string(),status:e.ClassifierJobOutStatus$inboundSchema,created_at:r.number().int(),modified_at:r.number().int(),training_files:r.array(r.string()),validation_files:r.nullable(r.array(r.string())).optional(),object:e.ClassifierJobOutObject$inboundSchema.default("job"),fine_tuned_model:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(p.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(c.JobMetadataOut$inboundSchema).optional(),job_type:e.ClassifierJobOutJobType$inboundSchema.default("classifier"),hyperparameters:a.ClassifierTrainingParameters$inboundSchema}).transform(S=>(0,i.remap)(S,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"})),e.ClassifierJobOut$outboundSchema=r.object({id:r.string(),autoStart:r.boolean(),model:r.string(),status:e.ClassifierJobOutStatus$outboundSchema,createdAt:r.number().int(),modifiedAt:r.number().int(),trainingFiles:r.array(r.string()),validationFiles:r.nullable(r.array(r.string())).optional(),object:e.ClassifierJobOutObject$outboundSchema.default("job"),fineTunedModel:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(p.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(c.JobMetadataOut$outboundSchema).optional(),jobType:e.ClassifierJobOutJobType$outboundSchema.default("classifier"),hyperparameters:a.ClassifierTrainingParameters$outboundSchema}).transform(S=>(0,i.remap)(S,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var g;(function(S){S.inboundSchema=e.ClassifierJobOut$inboundSchema,S.outboundSchema=e.ClassifierJobOut$outboundSchema})(g||(e.ClassifierJobOut$=g={}));function y(S){return JSON.stringify(e.ClassifierJobOut$outboundSchema.parse(S))}function _(S){return(0,s.safeParse)(S,w=>e.ClassifierJobOut$inboundSchema.parse(JSON.parse(w)),"Failed to parse 'ClassifierJobOut' from JSON")}})(Wc)),Wc}var Yc={},tG;function Jie(){return tG||(tG=1,(function(e){var t=Yc&&Yc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Yc&&Yc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Yc&&Yc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{loss_function:"lossFunction"})),e.ClassifierTargetIn$outboundSchema=r.object({name:r.string(),labels:r.array(r.string()),weight:r.number().default(1),lossFunction:r.nullable(a.FTClassifierLossFunction$outboundSchema).optional()}).transform(l=>(0,i.remap)(l,{lossFunction:"loss_function"}));var c;(function(l){l.inboundSchema=e.ClassifierTargetIn$inboundSchema,l.outboundSchema=e.ClassifierTargetIn$outboundSchema})(c||(e.ClassifierTargetIn$=c={}));function p(l){return JSON.stringify(e.ClassifierTargetIn$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ClassifierTargetIn$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ClassifierTargetIn' from JSON")}})(Yc)),Yc}var Xc={},nG;function Vie(){return nG||(nG=1,(function(e){var t=Xc&&Xc.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Xc&&Xc.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Xc&&Xc.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen"})),e.ClassifierTrainingParametersIn$outboundSchema=r.object({trainingSteps:r.nullable(r.number().int()).optional(),learningRate:r.number().default(1e-4),weightDecay:r.nullable(r.number()).optional(),warmupFraction:r.nullable(r.number()).optional(),epochs:r.nullable(r.number()).optional(),seqLen:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len"}));var a;(function(u){u.inboundSchema=e.ClassifierTrainingParametersIn$inboundSchema,u.outboundSchema=e.ClassifierTrainingParametersIn$outboundSchema})(a||(e.ClassifierTrainingParametersIn$=a={}));function c(u){return JSON.stringify(e.ClassifierTrainingParametersIn$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ClassifierTrainingParametersIn$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ClassifierTrainingParametersIn' from JSON")}})(Xc)),Xc}var Zc={},ed={},td={},rG;function Hie(){return rG||(rG=1,(function(e){var t=td&&td.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=td&&td.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=td&&td.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.DeltaMessage$=e.DeltaMessage$outboundSchema=e.DeltaMessage$inboundSchema=e.Content$=e.Content$outboundSchema=e.Content$inboundSchema=void 0,e.contentToJSON=u,e.contentFromJSON=l,e.deltaMessageToJSON=f,e.deltaMessageFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=BC(),c=Vx();e.Content$inboundSchema=r.union([r.string(),r.array(a.ContentChunk$inboundSchema)]),e.Content$outboundSchema=r.union([r.string(),r.array(a.ContentChunk$outboundSchema)]);var p;(function(m){m.inboundSchema=e.Content$inboundSchema,m.outboundSchema=e.Content$outboundSchema})(p||(e.Content$=p={}));function u(m){return JSON.stringify(e.Content$outboundSchema.parse(m))}function l(m){return(0,s.safeParse)(m,g=>e.Content$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'Content' from JSON")}e.DeltaMessage$inboundSchema=r.object({role:r.nullable(r.string()).optional(),content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$inboundSchema)])).optional(),tool_calls:r.nullable(r.array(c.ToolCall$inboundSchema)).optional()}).transform(m=>(0,i.remap)(m,{tool_calls:"toolCalls"})),e.DeltaMessage$outboundSchema=r.object({role:r.nullable(r.string()).optional(),content:r.nullable(r.union([r.string(),r.array(a.ContentChunk$outboundSchema)])).optional(),toolCalls:r.nullable(r.array(c.ToolCall$outboundSchema)).optional()}).transform(m=>(0,i.remap)(m,{toolCalls:"tool_calls"}));var d;(function(m){m.inboundSchema=e.DeltaMessage$inboundSchema,m.outboundSchema=e.DeltaMessage$outboundSchema})(d||(e.DeltaMessage$=d={}));function f(m){return JSON.stringify(e.DeltaMessage$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.DeltaMessage$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'DeltaMessage' from JSON")}})(td)),td}var oG;function Gie(){return oG||(oG=1,(function(e){var t=ed&&ed.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=ed&&ed.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=ed&&ed.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{finish_reason:"finishReason"})),e.CompletionResponseStreamChoice$outboundSchema=r.object({index:r.number().int(),delta:c.DeltaMessage$outboundSchema,finishReason:r.nullable(e.CompletionResponseStreamChoiceFinishReason$outboundSchema)}).transform(f=>(0,i.remap)(f,{finishReason:"finish_reason"}));var u;(function(f){f.inboundSchema=e.CompletionResponseStreamChoice$inboundSchema,f.outboundSchema=e.CompletionResponseStreamChoice$outboundSchema})(u||(e.CompletionResponseStreamChoice$=u={}));function l(f){return JSON.stringify(e.CompletionResponseStreamChoice$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.CompletionResponseStreamChoice$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'CompletionResponseStreamChoice' from JSON")}})(ed)),ed}var iG;function zie(){return iG||(iG=1,(function(e){var t=Zc&&Zc.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Zc&&Zc.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Zc&&Zc.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.CompletionChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'CompletionChunk' from JSON")}})(Zc)),Zc}var nd={},rd={},sG;function eB(){return sG||(sG=1,(function(e){var t=rd&&rd.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=rd&&rd.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=rd&&rd.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen",fim_ratio:"fimRatio"})),e.CompletionTrainingParameters$outboundSchema=r.object({trainingSteps:r.nullable(r.number().int()).optional(),learningRate:r.number().default(1e-4),weightDecay:r.nullable(r.number()).optional(),warmupFraction:r.nullable(r.number()).optional(),epochs:r.nullable(r.number()).optional(),seqLen:r.nullable(r.number().int()).optional(),fimRatio:r.nullable(r.number()).optional()}).transform(u=>(0,i.remap)(u,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len",fimRatio:"fim_ratio"}));var a;(function(u){u.inboundSchema=e.CompletionTrainingParameters$inboundSchema,u.outboundSchema=e.CompletionTrainingParameters$outboundSchema})(a||(e.CompletionTrainingParameters$=a={}));function c(u){return JSON.stringify(e.CompletionTrainingParameters$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.CompletionTrainingParameters$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'CompletionTrainingParameters' from JSON")}})(rd)),rd}var od={},aG;function tB(){return aG||(aG=1,(function(e){var t=od&&od.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=od&&od.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=od&&od.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{commit_id:"commitId"})),e.GithubRepositoryOut$outboundSchema=r.object({type:e.GithubRepositoryOutType$outboundSchema.default("github"),name:r.string(),owner:r.string(),ref:r.nullable(r.string()).optional(),weight:r.number().default(1),commitId:r.string()}).transform(l=>(0,i.remap)(l,{commitId:"commit_id"}));var c;(function(l){l.inboundSchema=e.GithubRepositoryOut$inboundSchema,l.outboundSchema=e.GithubRepositoryOut$outboundSchema})(c||(e.GithubRepositoryOut$=c={}));function p(l){return JSON.stringify(e.GithubRepositoryOut$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.GithubRepositoryOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'GithubRepositoryOut' from JSON")}})(od)),od}var lG;function Vqe(){return lG||(lG=1,(function(e){var t=nd&&nd.__createBinding||(Object.create?(function(B,N,L,q){q===void 0&&(q=L);var I=Object.getOwnPropertyDescriptor(N,L);(!I||("get"in I?!N.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return N[L]}}),Object.defineProperty(B,q,I)}):(function(B,N,L,q){q===void 0&&(q=L),B[q]=N[L]})),n=nd&&nd.__setModuleDefault||(Object.create?(function(B,N){Object.defineProperty(B,"default",{enumerable:!0,value:N})}):function(B,N){B.default=N}),o=nd&&nd.__importStar||(function(){var B=function(N){return B=Object.getOwnPropertyNames||function(L){var q=[];for(var I in L)Object.prototype.hasOwnProperty.call(L,I)&&(q[q.length]=I);return q},B(N)};return function(N){if(N&&N.__esModule)return N;var L={};if(N!=null)for(var q=B(N),I=0;Ie.CompletionDetailedJobOutIntegrations$inboundSchema.parse(JSON.parse(N)),"Failed to parse 'CompletionDetailedJobOutIntegrations' from JSON")}e.CompletionDetailedJobOutJobType$inboundSchema=r.nativeEnum(e.CompletionDetailedJobOutJobType),e.CompletionDetailedJobOutJobType$outboundSchema=e.CompletionDetailedJobOutJobType$inboundSchema;var _;(function(B){B.inboundSchema=e.CompletionDetailedJobOutJobType$inboundSchema,B.outboundSchema=e.CompletionDetailedJobOutJobType$outboundSchema})(_||(e.CompletionDetailedJobOutJobType$=_={})),e.CompletionDetailedJobOutRepositories$inboundSchema=u.GithubRepositoryOut$inboundSchema,e.CompletionDetailedJobOutRepositories$outboundSchema=u.GithubRepositoryOut$outboundSchema;var S;(function(B){B.inboundSchema=e.CompletionDetailedJobOutRepositories$inboundSchema,B.outboundSchema=e.CompletionDetailedJobOutRepositories$outboundSchema})(S||(e.CompletionDetailedJobOutRepositories$=S={}));function w(B){return JSON.stringify(e.CompletionDetailedJobOutRepositories$outboundSchema.parse(B))}function R(B){return(0,s.safeParse)(B,N=>e.CompletionDetailedJobOutRepositories$inboundSchema.parse(JSON.parse(N)),"Failed to parse 'CompletionDetailedJobOutRepositories' from JSON")}e.CompletionDetailedJobOut$inboundSchema=r.object({id:r.string(),auto_start:r.boolean(),model:r.string(),status:e.CompletionDetailedJobOutStatus$inboundSchema,created_at:r.number().int(),modified_at:r.number().int(),training_files:r.array(r.string()),validation_files:r.nullable(r.array(r.string())).optional(),object:e.CompletionDetailedJobOutObject$inboundSchema.default("job"),fine_tuned_model:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(d.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(l.JobMetadataOut$inboundSchema).optional(),job_type:e.CompletionDetailedJobOutJobType$inboundSchema.default("completion"),hyperparameters:c.CompletionTrainingParameters$inboundSchema,repositories:r.array(u.GithubRepositoryOut$inboundSchema).optional(),events:r.array(p.EventOut$inboundSchema).optional(),checkpoints:r.array(a.CheckpointOut$inboundSchema).optional()}).transform(B=>(0,i.remap)(B,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"})),e.CompletionDetailedJobOut$outboundSchema=r.object({id:r.string(),autoStart:r.boolean(),model:r.string(),status:e.CompletionDetailedJobOutStatus$outboundSchema,createdAt:r.number().int(),modifiedAt:r.number().int(),trainingFiles:r.array(r.string()),validationFiles:r.nullable(r.array(r.string())).optional(),object:e.CompletionDetailedJobOutObject$outboundSchema.default("job"),fineTunedModel:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(d.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(l.JobMetadataOut$outboundSchema).optional(),jobType:e.CompletionDetailedJobOutJobType$outboundSchema.default("completion"),hyperparameters:c.CompletionTrainingParameters$outboundSchema,repositories:r.array(u.GithubRepositoryOut$outboundSchema).optional(),events:r.array(p.EventOut$outboundSchema).optional(),checkpoints:r.array(a.CheckpointOut$outboundSchema).optional()}).transform(B=>(0,i.remap)(B,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var E;(function(B){B.inboundSchema=e.CompletionDetailedJobOut$inboundSchema,B.outboundSchema=e.CompletionDetailedJobOut$outboundSchema})(E||(e.CompletionDetailedJobOut$=E={}));function T(B){return JSON.stringify(e.CompletionDetailedJobOut$outboundSchema.parse(B))}function D(B){return(0,s.safeParse)(B,N=>e.CompletionDetailedJobOut$inboundSchema.parse(JSON.parse(N)),"Failed to parse 'CompletionDetailedJobOut' from JSON")}})(nd)),nd}var id={},uG;function Hqe(){return uG||(uG=1,(function(e){var t=id&&id.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=id&&id.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=id&&id.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h{try{return JSON.parse(u)}catch(d){return l.addIssue({code:r.ZodIssueCode.custom,message:`malformed json: ${d}`}),r.NEVER}}).pipe(s.CompletionChunk$inboundSchema)}),e.CompletionEvent$outboundSchema=r.object({data:s.CompletionChunk$outboundSchema});var a;(function(u){u.inboundSchema=e.CompletionEvent$inboundSchema,u.outboundSchema=e.CompletionEvent$outboundSchema})(a||(e.CompletionEvent$=a={}));function c(u){return JSON.stringify(e.CompletionEvent$outboundSchema.parse(u))}function p(u){return(0,i.safeParse)(u,l=>e.CompletionEvent$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'CompletionEvent' from JSON")}})(id)),id}var sd={},cG;function Gqe(){return cG||(cG=1,(function(e){var t=sd&&sd.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=sd&&sd.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=sd&&sd.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{owned_by:"ownedBy",workspace_id:"workspaceId",root_version:"rootVersion",max_context_length:"maxContextLength",model_type:"modelType"})),e.CompletionFTModelOut$outboundSchema=r.object({id:r.string(),object:e.CompletionFTModelOutObject$outboundSchema.default("model"),created:r.number().int(),ownedBy:r.string(),workspaceId:r.string(),root:r.string(),rootVersion:r.string(),archived:r.boolean(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),capabilities:a.FTModelCapabilitiesOut$outboundSchema,maxContextLength:r.number().int().default(32768),aliases:r.array(r.string()).optional(),job:r.string(),modelType:e.ModelType$outboundSchema.default("completion")}).transform(f=>(0,i.remap)(f,{ownedBy:"owned_by",workspaceId:"workspace_id",rootVersion:"root_version",maxContextLength:"max_context_length",modelType:"model_type"}));var u;(function(f){f.inboundSchema=e.CompletionFTModelOut$inboundSchema,f.outboundSchema=e.CompletionFTModelOut$outboundSchema})(u||(e.CompletionFTModelOut$=u={}));function l(f){return JSON.stringify(e.CompletionFTModelOut$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.CompletionFTModelOut$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'CompletionFTModelOut' from JSON")}})(sd)),sd}var ad={},dG;function Kie(){return dG||(dG=1,(function(e){var t=ad&&ad.__createBinding||(Object.create?(function(T,D,B,N){N===void 0&&(N=B);var L=Object.getOwnPropertyDescriptor(D,B);(!L||("get"in L?!D.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return D[B]}}),Object.defineProperty(T,N,L)}):(function(T,D,B,N){N===void 0&&(N=B),T[N]=D[B]})),n=ad&&ad.__setModuleDefault||(Object.create?(function(T,D){Object.defineProperty(T,"default",{enumerable:!0,value:D})}):function(T,D){T.default=D}),o=ad&&ad.__importStar||(function(){var T=function(D){return T=Object.getOwnPropertyNames||function(B){var N=[];for(var L in B)Object.prototype.hasOwnProperty.call(B,L)&&(N[N.length]=L);return N},T(D)};return function(D){if(D&&D.__esModule)return D;var B={};if(D!=null)for(var N=T(D),L=0;Le.Integrations$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'Integrations' from JSON")}e.JobType$inboundSchema=r.nativeEnum(e.JobType),e.JobType$outboundSchema=e.JobType$inboundSchema;var g;(function(T){T.inboundSchema=e.JobType$inboundSchema,T.outboundSchema=e.JobType$outboundSchema})(g||(e.JobType$=g={})),e.Repositories$inboundSchema=c.GithubRepositoryOut$inboundSchema,e.Repositories$outboundSchema=c.GithubRepositoryOut$outboundSchema;var y;(function(T){T.inboundSchema=e.Repositories$inboundSchema,T.outboundSchema=e.Repositories$outboundSchema})(y||(e.Repositories$=y={}));function _(T){return JSON.stringify(e.Repositories$outboundSchema.parse(T))}function S(T){return(0,s.safeParse)(T,D=>e.Repositories$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'Repositories' from JSON")}e.CompletionJobOut$inboundSchema=r.object({id:r.string(),auto_start:r.boolean(),model:r.string(),status:e.Status$inboundSchema,created_at:r.number().int(),modified_at:r.number().int(),training_files:r.array(r.string()),validation_files:r.nullable(r.array(r.string())).optional(),object:e.CompletionJobOutObject$inboundSchema.default("job"),fine_tuned_model:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(u.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(p.JobMetadataOut$inboundSchema).optional(),job_type:e.JobType$inboundSchema.default("completion"),hyperparameters:a.CompletionTrainingParameters$inboundSchema,repositories:r.array(c.GithubRepositoryOut$inboundSchema).optional()}).transform(T=>(0,i.remap)(T,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"})),e.CompletionJobOut$outboundSchema=r.object({id:r.string(),autoStart:r.boolean(),model:r.string(),status:e.Status$outboundSchema,createdAt:r.number().int(),modifiedAt:r.number().int(),trainingFiles:r.array(r.string()),validationFiles:r.nullable(r.array(r.string())).optional(),object:e.CompletionJobOutObject$outboundSchema.default("job"),fineTunedModel:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(u.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:r.nullable(r.number().int()).optional(),metadata:r.nullable(p.JobMetadataOut$outboundSchema).optional(),jobType:e.JobType$outboundSchema.default("completion"),hyperparameters:a.CompletionTrainingParameters$outboundSchema,repositories:r.array(c.GithubRepositoryOut$outboundSchema).optional()}).transform(T=>(0,i.remap)(T,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var w;(function(T){T.inboundSchema=e.CompletionJobOut$inboundSchema,T.outboundSchema=e.CompletionJobOut$outboundSchema})(w||(e.CompletionJobOut$=w={}));function R(T){return JSON.stringify(e.CompletionJobOut$outboundSchema.parse(T))}function E(T){return(0,s.safeParse)(T,D=>e.CompletionJobOut$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'CompletionJobOut' from JSON")}})(ad)),ad}var ld={},fG;function Qie(){return fG||(fG=1,(function(e){var t=ld&&ld.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=ld&&ld.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=ld&&ld.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen",fim_ratio:"fimRatio"})),e.CompletionTrainingParametersIn$outboundSchema=r.object({trainingSteps:r.nullable(r.number().int()).optional(),learningRate:r.number().default(1e-4),weightDecay:r.nullable(r.number()).optional(),warmupFraction:r.nullable(r.number()).optional(),epochs:r.nullable(r.number()).optional(),seqLen:r.nullable(r.number().int()).optional(),fimRatio:r.nullable(r.number()).optional()}).transform(u=>(0,i.remap)(u,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len",fimRatio:"fim_ratio"}));var a;(function(u){u.inboundSchema=e.CompletionTrainingParametersIn$inboundSchema,u.outboundSchema=e.CompletionTrainingParametersIn$outboundSchema})(a||(e.CompletionTrainingParametersIn$=a={}));function c(u){return JSON.stringify(e.CompletionTrainingParametersIn$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.CompletionTrainingParametersIn$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'CompletionTrainingParametersIn' from JSON")}})(ld)),ld}var ud={},cd={},dd={},fd={},hd={},hG;function $ie(){return hG||(hG=1,(function(e){var t=hd&&hd.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=hd&&hd.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=hd&&hd.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.FunctionCallEntryArguments$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'FunctionCallEntryArguments' from JSON")}})(hd)),hd}var pG;function uP(){return pG||(pG=1,(function(e){var t=fd&&fd.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=fd&&fd.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=fd&&fd.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;ynew Date(f)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(f=>new Date(f))).optional(),id:r.string().optional(),tool_call_id:r.string(),name:r.string(),arguments:a.FunctionCallEntryArguments$inboundSchema}).transform(f=>(0,i.remap)(f,{created_at:"createdAt",completed_at:"completedAt",tool_call_id:"toolCallId"})),e.FunctionCallEntry$outboundSchema=r.object({object:e.FunctionCallEntryObject$outboundSchema.default("entry"),type:e.FunctionCallEntryType$outboundSchema.default("function.call"),createdAt:r.date().transform(f=>f.toISOString()).optional(),completedAt:r.nullable(r.date().transform(f=>f.toISOString())).optional(),id:r.string().optional(),toolCallId:r.string(),name:r.string(),arguments:a.FunctionCallEntryArguments$outboundSchema}).transform(f=>(0,i.remap)(f,{createdAt:"created_at",completedAt:"completed_at",toolCallId:"tool_call_id"}));var u;(function(f){f.inboundSchema=e.FunctionCallEntry$inboundSchema,f.outboundSchema=e.FunctionCallEntry$outboundSchema})(u||(e.FunctionCallEntry$=u={}));function l(f){return JSON.stringify(e.FunctionCallEntry$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.FunctionCallEntry$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FunctionCallEntry' from JSON")}})(fd)),fd}var pd={},mG;function nB(){return mG||(mG=1,(function(e){var t=pd&&pd.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=pd&&pd.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=pd&&pd.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;gnew Date(d)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(d=>new Date(d))).optional(),id:r.string().optional(),tool_call_id:r.string(),result:r.string()}).transform(d=>(0,i.remap)(d,{created_at:"createdAt",completed_at:"completedAt",tool_call_id:"toolCallId"})),e.FunctionResultEntry$outboundSchema=r.object({object:e.FunctionResultEntryObject$outboundSchema.default("entry"),type:e.FunctionResultEntryType$outboundSchema.default("function.result"),createdAt:r.date().transform(d=>d.toISOString()).optional(),completedAt:r.nullable(r.date().transform(d=>d.toISOString())).optional(),id:r.string().optional(),toolCallId:r.string(),result:r.string()}).transform(d=>(0,i.remap)(d,{createdAt:"created_at",completedAt:"completed_at",toolCallId:"tool_call_id"}));var p;(function(d){d.inboundSchema=e.FunctionResultEntry$inboundSchema,d.outboundSchema=e.FunctionResultEntry$outboundSchema})(p||(e.FunctionResultEntry$=p={}));function u(d){return JSON.stringify(e.FunctionResultEntry$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.FunctionResultEntry$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'FunctionResultEntry' from JSON")}})(pd)),pd}var md={},gd={},bd={},gG;function cP(){return gG||(gG=1,(function(e){var t=bd&&bd.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=bd&&bd.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=bd&&bd.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;g(0,i.remap)(d,{file_id:"fileId",file_name:"fileName",file_type:"fileType"})),e.ToolFileChunk$outboundSchema=r.object({type:e.ToolFileChunkType$outboundSchema.default("tool_file"),tool:a.BuiltInConnectors$outboundSchema,fileId:r.string(),fileName:r.nullable(r.string()).optional(),fileType:r.nullable(r.string()).optional()}).transform(d=>(0,i.remap)(d,{fileId:"file_id",fileName:"file_name",fileType:"file_type"}));var p;(function(d){d.inboundSchema=e.ToolFileChunk$inboundSchema,d.outboundSchema=e.ToolFileChunk$outboundSchema})(p||(e.ToolFileChunk$=p={}));function u(d){return JSON.stringify(e.ToolFileChunk$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.ToolFileChunk$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'ToolFileChunk' from JSON")}})(bd)),bd}var bG;function Wie(){return bG||(bG=1,(function(e){var t=gd&&gd.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=gd&&gd.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=gd&&gd.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_e.MessageInputContentChunks$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'MessageInputContentChunks' from JSON")}})(gd)),gd}var yG;function dP(){return yG||(yG=1,(function(e){var t=md&&md.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),n=md&&md.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),o=md&&md.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;Re.MessageInputEntryContent$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'MessageInputEntryContent' from JSON")}e.MessageInputEntry$inboundSchema=r.object({object:e.ObjectT$inboundSchema.default("entry"),type:e.MessageInputEntryType$inboundSchema.default("message.input"),created_at:r.string().datetime({offset:!0}).transform(y=>new Date(y)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(y=>new Date(y))).optional(),id:r.string().optional(),role:e.MessageInputEntryRole$inboundSchema,content:r.union([r.string(),r.array(a.MessageInputContentChunks$inboundSchema)]),prefix:r.boolean().default(!1)}).transform(y=>(0,i.remap)(y,{created_at:"createdAt",completed_at:"completedAt"})),e.MessageInputEntry$outboundSchema=r.object({object:e.ObjectT$outboundSchema.default("entry"),type:e.MessageInputEntryType$outboundSchema.default("message.input"),createdAt:r.date().transform(y=>y.toISOString()).optional(),completedAt:r.nullable(r.date().transform(y=>y.toISOString())).optional(),id:r.string().optional(),role:e.MessageInputEntryRole$outboundSchema,content:r.union([r.string(),r.array(a.MessageInputContentChunks$outboundSchema)]),prefix:r.boolean().default(!1)}).transform(y=>(0,i.remap)(y,{createdAt:"created_at",completedAt:"completed_at"}));var h;(function(y){y.inboundSchema=e.MessageInputEntry$inboundSchema,y.outboundSchema=e.MessageInputEntry$outboundSchema})(h||(e.MessageInputEntry$=h={}));function m(y){return JSON.stringify(e.MessageInputEntry$outboundSchema.parse(y))}function g(y){return(0,s.safeParse)(y,_=>e.MessageInputEntry$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'MessageInputEntry' from JSON")}})(md)),md}var yd={},Ad={},_d={},AG;function rB(){return AG||(AG=1,(function(e){var t=_d&&_d.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=_d&&_d.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=_d&&_d.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.ToolReferenceChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ToolReferenceChunk' from JSON")}})(_d)),_d}var _G;function Yie(){return _G||(_G=1,(function(e){var t=Ad&&Ad.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=Ad&&Ad.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=Ad&&Ad.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.MessageOutputContentChunks$=e.MessageOutputContentChunks$outboundSchema=e.MessageOutputContentChunks$inboundSchema=void 0,e.messageOutputContentChunksToJSON=f,e.messageOutputContentChunksFromJSON=h;const r=o(ne()),i=ee(),s=JA(),a=VA(),c=ab(),p=HA(),u=cP(),l=rB();e.MessageOutputContentChunks$inboundSchema=r.union([u.ToolFileChunk$inboundSchema,l.ToolReferenceChunk$inboundSchema,c.TextChunk$inboundSchema,a.ImageURLChunk$inboundSchema,s.DocumentURLChunk$inboundSchema,p.ThinkChunk$inboundSchema]),e.MessageOutputContentChunks$outboundSchema=r.union([u.ToolFileChunk$outboundSchema,l.ToolReferenceChunk$outboundSchema,c.TextChunk$outboundSchema,a.ImageURLChunk$outboundSchema,s.DocumentURLChunk$outboundSchema,p.ThinkChunk$outboundSchema]);var d;(function(m){m.inboundSchema=e.MessageOutputContentChunks$inboundSchema,m.outboundSchema=e.MessageOutputContentChunks$outboundSchema})(d||(e.MessageOutputContentChunks$=d={}));function f(m){return JSON.stringify(e.MessageOutputContentChunks$outboundSchema.parse(m))}function h(m){return(0,i.safeParse)(m,g=>e.MessageOutputContentChunks$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'MessageOutputContentChunks' from JSON")}})(Ad)),Ad}var vG;function HC(){return vG||(vG=1,(function(e){var t=yd&&yd.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),n=yd&&yd.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),o=yd&&yd.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;Re.MessageOutputEntryContent$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'MessageOutputEntryContent' from JSON")}e.MessageOutputEntry$inboundSchema=r.object({object:e.MessageOutputEntryObject$inboundSchema.default("entry"),type:e.MessageOutputEntryType$inboundSchema.default("message.output"),created_at:r.string().datetime({offset:!0}).transform(y=>new Date(y)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(y=>new Date(y))).optional(),id:r.string().optional(),agent_id:r.nullable(r.string()).optional(),model:r.nullable(r.string()).optional(),role:e.MessageOutputEntryRole$inboundSchema.default("assistant"),content:r.union([r.string(),r.array(a.MessageOutputContentChunks$inboundSchema)])}).transform(y=>(0,i.remap)(y,{created_at:"createdAt",completed_at:"completedAt",agent_id:"agentId"})),e.MessageOutputEntry$outboundSchema=r.object({object:e.MessageOutputEntryObject$outboundSchema.default("entry"),type:e.MessageOutputEntryType$outboundSchema.default("message.output"),createdAt:r.date().transform(y=>y.toISOString()).optional(),completedAt:r.nullable(r.date().transform(y=>y.toISOString())).optional(),id:r.string().optional(),agentId:r.nullable(r.string()).optional(),model:r.nullable(r.string()).optional(),role:e.MessageOutputEntryRole$outboundSchema.default("assistant"),content:r.union([r.string(),r.array(a.MessageOutputContentChunks$outboundSchema)])}).transform(y=>(0,i.remap)(y,{createdAt:"created_at",completedAt:"completed_at",agentId:"agent_id"}));var h;(function(y){y.inboundSchema=e.MessageOutputEntry$inboundSchema,y.outboundSchema=e.MessageOutputEntry$outboundSchema})(h||(e.MessageOutputEntry$=h={}));function m(y){return JSON.stringify(e.MessageOutputEntry$outboundSchema.parse(y))}function g(y){return(0,s.safeParse)(y,_=>e.MessageOutputEntry$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'MessageOutputEntry' from JSON")}})(yd)),yd}var vd={},SG;function fP(){return SG||(SG=1,(function(e){var t=vd&&vd.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),n=vd&&vd.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),o=vd&&vd.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;we.Name$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'Name' from JSON")}e.ToolExecutionEntry$inboundSchema=r.object({object:e.ToolExecutionEntryObject$inboundSchema.default("entry"),type:e.ToolExecutionEntryType$inboundSchema.default("tool.execution"),created_at:r.string().datetime({offset:!0}).transform(g=>new Date(g)).optional(),completed_at:r.nullable(r.string().datetime({offset:!0}).transform(g=>new Date(g))).optional(),id:r.string().optional(),name:r.union([a.BuiltInConnectors$inboundSchema,r.string()]),arguments:r.string(),info:r.record(r.any()).optional()}).transform(g=>(0,i.remap)(g,{created_at:"createdAt",completed_at:"completedAt"})),e.ToolExecutionEntry$outboundSchema=r.object({object:e.ToolExecutionEntryObject$outboundSchema.default("entry"),type:e.ToolExecutionEntryType$outboundSchema.default("tool.execution"),createdAt:r.date().transform(g=>g.toISOString()).optional(),completedAt:r.nullable(r.date().transform(g=>g.toISOString())).optional(),id:r.string().optional(),name:r.union([a.BuiltInConnectors$outboundSchema,r.string()]),arguments:r.string(),info:r.record(r.any()).optional()}).transform(g=>(0,i.remap)(g,{createdAt:"created_at",completedAt:"completed_at"}));var f;(function(g){g.inboundSchema=e.ToolExecutionEntry$inboundSchema,g.outboundSchema=e.ToolExecutionEntry$outboundSchema})(f||(e.ToolExecutionEntry$=f={}));function h(g){return JSON.stringify(e.ToolExecutionEntry$outboundSchema.parse(g))}function m(g){return(0,s.safeParse)(g,y=>e.ToolExecutionEntry$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'ToolExecutionEntry' from JSON")}})(vd)),vd}var CG;function Xie(){return CG||(CG=1,(function(e){var t=dd&&dd.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=dd&&dd.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=dd&&dd.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.InputEntries$=e.InputEntries$outboundSchema=e.InputEntries$inboundSchema=void 0,e.inputEntriesToJSON=f,e.inputEntriesFromJSON=h;const r=o(ne()),i=ee(),s=aP(),a=uP(),c=nB(),p=dP(),u=HC(),l=fP();e.InputEntries$inboundSchema=r.union([s.AgentHandoffEntry$inboundSchema,a.FunctionCallEntry$inboundSchema,p.MessageInputEntry$inboundSchema,c.FunctionResultEntry$inboundSchema,l.ToolExecutionEntry$inboundSchema,u.MessageOutputEntry$inboundSchema]),e.InputEntries$outboundSchema=r.union([s.AgentHandoffEntry$outboundSchema,a.FunctionCallEntry$outboundSchema,p.MessageInputEntry$outboundSchema,c.FunctionResultEntry$outboundSchema,l.ToolExecutionEntry$outboundSchema,u.MessageOutputEntry$outboundSchema]);var d;(function(m){m.inboundSchema=e.InputEntries$inboundSchema,m.outboundSchema=e.InputEntries$outboundSchema})(d||(e.InputEntries$=d={}));function f(m){return JSON.stringify(e.InputEntries$outboundSchema.parse(m))}function h(m){return(0,i.safeParse)(m,g=>e.InputEntries$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'InputEntries' from JSON")}})(dd)),dd}var wG;function cb(){return wG||(wG=1,(function(e){var t=cd&&cd.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=cd&&cd.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=cd&&cd.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ConversationInputs$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ConversationInputs' from JSON")}})(cd)),cd}var OG;function zqe(){return OG||(OG=1,(function(e){var t=ud&&ud.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=ud&&ud.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=ud&&ud.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{handoff_execution:"handoffExecution",completion_args:"completionArgs"})),e.ConversationAppendRequest$outboundSchema=r.object({inputs:c.ConversationInputs$outboundSchema,stream:r.boolean().default(!1),store:r.boolean().default(!0),handoffExecution:e.ConversationAppendRequestHandoffExecution$outboundSchema.default("server"),completionArgs:a.CompletionArgs$outboundSchema.optional()}).transform(f=>(0,i.remap)(f,{handoffExecution:"handoff_execution",completionArgs:"completion_args"}));var u;(function(f){f.inboundSchema=e.ConversationAppendRequest$inboundSchema,f.outboundSchema=e.ConversationAppendRequest$outboundSchema})(u||(e.ConversationAppendRequest$=u={}));function l(f){return JSON.stringify(e.ConversationAppendRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ConversationAppendRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ConversationAppendRequest' from JSON")}})(ud)),ud}var Sd={},TG;function Kqe(){return TG||(TG=1,(function(e){var t=Sd&&Sd.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=Sd&&Sd.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=Sd&&Sd.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{handoff_execution:"handoffExecution",completion_args:"completionArgs"})),e.ConversationAppendStreamRequest$outboundSchema=r.object({inputs:c.ConversationInputs$outboundSchema,stream:r.boolean().default(!0),store:r.boolean().default(!0),handoffExecution:e.ConversationAppendStreamRequestHandoffExecution$outboundSchema.default("server"),completionArgs:a.CompletionArgs$outboundSchema.optional()}).transform(f=>(0,i.remap)(f,{handoffExecution:"handoff_execution",completionArgs:"completion_args"}));var u;(function(f){f.inboundSchema=e.ConversationAppendStreamRequest$inboundSchema,f.outboundSchema=e.ConversationAppendStreamRequest$outboundSchema})(u||(e.ConversationAppendStreamRequest$=u={}));function l(f){return JSON.stringify(e.ConversationAppendStreamRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ConversationAppendStreamRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ConversationAppendStreamRequest' from JSON")}})(Sd)),Sd}var Cd={},wd={},RG;function Zie(){return RG||(RG=1,(function(e){var t=wd&&wd.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=wd&&wd.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=wd&&wd.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)).optional(),output_index:r.number().int().default(0),id:r.string(),name:r.string(),tool_call_id:r.string(),arguments:r.string()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt",output_index:"outputIndex",tool_call_id:"toolCallId"})),e.FunctionCallEvent$outboundSchema=r.object({type:e.FunctionCallEventType$outboundSchema.default("function.call.delta"),createdAt:r.date().transform(l=>l.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),name:r.string(),toolCallId:r.string(),arguments:r.string()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at",outputIndex:"output_index",toolCallId:"tool_call_id"}));var c;(function(l){l.inboundSchema=e.FunctionCallEvent$inboundSchema,l.outboundSchema=e.FunctionCallEvent$outboundSchema})(c||(e.FunctionCallEvent$=c={}));function p(l){return JSON.stringify(e.FunctionCallEvent$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.FunctionCallEvent$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'FunctionCallEvent' from JSON")}})(wd)),wd}var Od={},Td={},EG;function ese(){return EG||(EG=1,(function(e){var t=Td&&Td.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=Td&&Td.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=Td&&Td.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.OutputContentChunks$=e.OutputContentChunks$outboundSchema=e.OutputContentChunks$inboundSchema=void 0,e.outputContentChunksToJSON=f,e.outputContentChunksFromJSON=h;const r=o(ne()),i=ee(),s=JA(),a=VA(),c=ab(),p=HA(),u=cP(),l=rB();e.OutputContentChunks$inboundSchema=r.union([u.ToolFileChunk$inboundSchema,l.ToolReferenceChunk$inboundSchema,c.TextChunk$inboundSchema,a.ImageURLChunk$inboundSchema,s.DocumentURLChunk$inboundSchema,p.ThinkChunk$inboundSchema]),e.OutputContentChunks$outboundSchema=r.union([u.ToolFileChunk$outboundSchema,l.ToolReferenceChunk$outboundSchema,c.TextChunk$outboundSchema,a.ImageURLChunk$outboundSchema,s.DocumentURLChunk$outboundSchema,p.ThinkChunk$outboundSchema]);var d;(function(m){m.inboundSchema=e.OutputContentChunks$inboundSchema,m.outboundSchema=e.OutputContentChunks$outboundSchema})(d||(e.OutputContentChunks$=d={}));function f(m){return JSON.stringify(e.OutputContentChunks$outboundSchema.parse(m))}function h(m){return(0,i.safeParse)(m,g=>e.OutputContentChunks$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'OutputContentChunks' from JSON")}})(Td)),Td}var MG;function tse(){return MG||(MG=1,(function(e){var t=Od&&Od.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),n=Od&&Od.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),o=Od&&Od.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;we.MessageOutputEventContent$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'MessageOutputEventContent' from JSON")}e.MessageOutputEvent$inboundSchema=r.object({type:e.MessageOutputEventType$inboundSchema.default("message.output.delta"),created_at:r.string().datetime({offset:!0}).transform(g=>new Date(g)).optional(),output_index:r.number().int().default(0),id:r.string(),content_index:r.number().int().default(0),model:r.nullable(r.string()).optional(),agent_id:r.nullable(r.string()).optional(),role:e.MessageOutputEventRole$inboundSchema.default("assistant"),content:r.union([r.string(),a.OutputContentChunks$inboundSchema])}).transform(g=>(0,i.remap)(g,{created_at:"createdAt",output_index:"outputIndex",content_index:"contentIndex",agent_id:"agentId"})),e.MessageOutputEvent$outboundSchema=r.object({type:e.MessageOutputEventType$outboundSchema.default("message.output.delta"),createdAt:r.date().transform(g=>g.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),contentIndex:r.number().int().default(0),model:r.nullable(r.string()).optional(),agentId:r.nullable(r.string()).optional(),role:e.MessageOutputEventRole$outboundSchema.default("assistant"),content:r.union([r.string(),a.OutputContentChunks$outboundSchema])}).transform(g=>(0,i.remap)(g,{createdAt:"created_at",outputIndex:"output_index",contentIndex:"content_index",agentId:"agent_id"}));var f;(function(g){g.inboundSchema=e.MessageOutputEvent$inboundSchema,g.outboundSchema=e.MessageOutputEvent$outboundSchema})(f||(e.MessageOutputEvent$=f={}));function h(g){return JSON.stringify(e.MessageOutputEvent$outboundSchema.parse(g))}function m(g){return(0,s.safeParse)(g,y=>e.MessageOutputEvent$inboundSchema.parse(JSON.parse(y)),"Failed to parse 'MessageOutputEvent' from JSON")}})(Od)),Od}var Rd={},Ed={},PG;function oB(){return PG||(PG=1,(function(e){var t=Ed&&Ed.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Ed&&Ed.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Ed&&Ed.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",connector_tokens:"connectorTokens"})),e.ConversationUsageInfo$outboundSchema=r.object({promptTokens:r.number().int().default(0),completionTokens:r.number().int().default(0),totalTokens:r.number().int().default(0),connectorTokens:r.nullable(r.number().int()).optional(),connectors:r.nullable(r.record(r.number().int())).optional()}).transform(u=>(0,i.remap)(u,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",connectorTokens:"connector_tokens"}));var a;(function(u){u.inboundSchema=e.ConversationUsageInfo$inboundSchema,u.outboundSchema=e.ConversationUsageInfo$outboundSchema})(a||(e.ConversationUsageInfo$=a={}));function c(u){return JSON.stringify(e.ConversationUsageInfo$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ConversationUsageInfo$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ConversationUsageInfo' from JSON")}})(Ed)),Ed}var IG;function nse(){return IG||(IG=1,(function(e){var t=Rd&&Rd.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Rd&&Rd.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Rd&&Rd.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;gnew Date(d)).optional(),usage:a.ConversationUsageInfo$inboundSchema}).transform(d=>(0,i.remap)(d,{created_at:"createdAt"})),e.ResponseDoneEvent$outboundSchema=r.object({type:e.ResponseDoneEventType$outboundSchema.default("conversation.response.done"),createdAt:r.date().transform(d=>d.toISOString()).optional(),usage:a.ConversationUsageInfo$outboundSchema}).transform(d=>(0,i.remap)(d,{createdAt:"created_at"}));var p;(function(d){d.inboundSchema=e.ResponseDoneEvent$inboundSchema,d.outboundSchema=e.ResponseDoneEvent$outboundSchema})(p||(e.ResponseDoneEvent$=p={}));function u(d){return JSON.stringify(e.ResponseDoneEvent$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.ResponseDoneEvent$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'ResponseDoneEvent' from JSON")}})(Rd)),Rd}var Md={},jG;function rse(){return jG||(jG=1,(function(e){var t=Md&&Md.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Md&&Md.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Md&&Md.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)).optional(),message:r.string(),code:r.number().int()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt"})),e.ResponseErrorEvent$outboundSchema=r.object({type:e.ResponseErrorEventType$outboundSchema.default("conversation.response.error"),createdAt:r.date().transform(l=>l.toISOString()).optional(),message:r.string(),code:r.number().int()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at"}));var c;(function(l){l.inboundSchema=e.ResponseErrorEvent$inboundSchema,l.outboundSchema=e.ResponseErrorEvent$outboundSchema})(c||(e.ResponseErrorEvent$=c={}));function p(l){return JSON.stringify(e.ResponseErrorEvent$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ResponseErrorEvent$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ResponseErrorEvent' from JSON")}})(Md)),Md}var Pd={},DG;function ose(){return DG||(DG=1,(function(e){var t=Pd&&Pd.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Pd&&Pd.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Pd&&Pd.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l)).optional(),conversation_id:r.string()}).transform(l=>(0,i.remap)(l,{created_at:"createdAt",conversation_id:"conversationId"})),e.ResponseStartedEvent$outboundSchema=r.object({type:e.ResponseStartedEventType$outboundSchema.default("conversation.response.started"),createdAt:r.date().transform(l=>l.toISOString()).optional(),conversationId:r.string()}).transform(l=>(0,i.remap)(l,{createdAt:"created_at",conversationId:"conversation_id"}));var c;(function(l){l.inboundSchema=e.ResponseStartedEvent$inboundSchema,l.outboundSchema=e.ResponseStartedEvent$outboundSchema})(c||(e.ResponseStartedEvent$=c={}));function p(l){return JSON.stringify(e.ResponseStartedEvent$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.ResponseStartedEvent$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ResponseStartedEvent' from JSON")}})(Pd)),Pd}var Id={},NG;function ise(){return NG||(NG=1,(function(e){var t=Id&&Id.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Id&&Id.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Id&&Id.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;ue.ToolExecutionDeltaEventName$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionDeltaEventName' from JSON")}e.ToolExecutionDeltaEvent$inboundSchema=r.object({type:e.ToolExecutionDeltaEventType$inboundSchema.default("tool.execution.delta"),created_at:r.string().datetime({offset:!0}).transform(m=>new Date(m)).optional(),output_index:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$inboundSchema,r.string()]),arguments:r.string()}).transform(m=>(0,i.remap)(m,{created_at:"createdAt",output_index:"outputIndex"})),e.ToolExecutionDeltaEvent$outboundSchema=r.object({type:e.ToolExecutionDeltaEventType$outboundSchema.default("tool.execution.delta"),createdAt:r.date().transform(m=>m.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$outboundSchema,r.string()]),arguments:r.string()}).transform(m=>(0,i.remap)(m,{createdAt:"created_at",outputIndex:"output_index"}));var d;(function(m){m.inboundSchema=e.ToolExecutionDeltaEvent$inboundSchema,m.outboundSchema=e.ToolExecutionDeltaEvent$outboundSchema})(d||(e.ToolExecutionDeltaEvent$=d={}));function f(m){return JSON.stringify(e.ToolExecutionDeltaEvent$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.ToolExecutionDeltaEvent$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionDeltaEvent' from JSON")}})(jd)),jd}var Dd={},FG;function ase(){return FG||(FG=1,(function(e){var t=Dd&&Dd.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=Dd&&Dd.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=Dd&&Dd.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ToolExecutionDoneEvent$=e.ToolExecutionDoneEvent$outboundSchema=e.ToolExecutionDoneEvent$inboundSchema=e.ToolExecutionDoneEventName$=e.ToolExecutionDoneEventName$outboundSchema=e.ToolExecutionDoneEventName$inboundSchema=e.ToolExecutionDoneEventType$=e.ToolExecutionDoneEventType$outboundSchema=e.ToolExecutionDoneEventType$inboundSchema=e.ToolExecutionDoneEventType=void 0,e.toolExecutionDoneEventNameToJSON=u,e.toolExecutionDoneEventNameFromJSON=l,e.toolExecutionDoneEventToJSON=f,e.toolExecutionDoneEventFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=lb();e.ToolExecutionDoneEventType={ToolExecutionDone:"tool.execution.done"},e.ToolExecutionDoneEventType$inboundSchema=r.nativeEnum(e.ToolExecutionDoneEventType),e.ToolExecutionDoneEventType$outboundSchema=e.ToolExecutionDoneEventType$inboundSchema;var c;(function(m){m.inboundSchema=e.ToolExecutionDoneEventType$inboundSchema,m.outboundSchema=e.ToolExecutionDoneEventType$outboundSchema})(c||(e.ToolExecutionDoneEventType$=c={})),e.ToolExecutionDoneEventName$inboundSchema=r.union([a.BuiltInConnectors$inboundSchema,r.string()]),e.ToolExecutionDoneEventName$outboundSchema=r.union([a.BuiltInConnectors$outboundSchema,r.string()]);var p;(function(m){m.inboundSchema=e.ToolExecutionDoneEventName$inboundSchema,m.outboundSchema=e.ToolExecutionDoneEventName$outboundSchema})(p||(e.ToolExecutionDoneEventName$=p={}));function u(m){return JSON.stringify(e.ToolExecutionDoneEventName$outboundSchema.parse(m))}function l(m){return(0,s.safeParse)(m,g=>e.ToolExecutionDoneEventName$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionDoneEventName' from JSON")}e.ToolExecutionDoneEvent$inboundSchema=r.object({type:e.ToolExecutionDoneEventType$inboundSchema.default("tool.execution.done"),created_at:r.string().datetime({offset:!0}).transform(m=>new Date(m)).optional(),output_index:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$inboundSchema,r.string()]),info:r.record(r.any()).optional()}).transform(m=>(0,i.remap)(m,{created_at:"createdAt",output_index:"outputIndex"})),e.ToolExecutionDoneEvent$outboundSchema=r.object({type:e.ToolExecutionDoneEventType$outboundSchema.default("tool.execution.done"),createdAt:r.date().transform(m=>m.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$outboundSchema,r.string()]),info:r.record(r.any()).optional()}).transform(m=>(0,i.remap)(m,{createdAt:"created_at",outputIndex:"output_index"}));var d;(function(m){m.inboundSchema=e.ToolExecutionDoneEvent$inboundSchema,m.outboundSchema=e.ToolExecutionDoneEvent$outboundSchema})(d||(e.ToolExecutionDoneEvent$=d={}));function f(m){return JSON.stringify(e.ToolExecutionDoneEvent$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.ToolExecutionDoneEvent$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionDoneEvent' from JSON")}})(Dd)),Dd}var Nd={},xG;function lse(){return xG||(xG=1,(function(e){var t=Nd&&Nd.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=Nd&&Nd.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=Nd&&Nd.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ToolExecutionStartedEvent$=e.ToolExecutionStartedEvent$outboundSchema=e.ToolExecutionStartedEvent$inboundSchema=e.ToolExecutionStartedEventName$=e.ToolExecutionStartedEventName$outboundSchema=e.ToolExecutionStartedEventName$inboundSchema=e.ToolExecutionStartedEventType$=e.ToolExecutionStartedEventType$outboundSchema=e.ToolExecutionStartedEventType$inboundSchema=e.ToolExecutionStartedEventType=void 0,e.toolExecutionStartedEventNameToJSON=u,e.toolExecutionStartedEventNameFromJSON=l,e.toolExecutionStartedEventToJSON=f,e.toolExecutionStartedEventFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=lb();e.ToolExecutionStartedEventType={ToolExecutionStarted:"tool.execution.started"},e.ToolExecutionStartedEventType$inboundSchema=r.nativeEnum(e.ToolExecutionStartedEventType),e.ToolExecutionStartedEventType$outboundSchema=e.ToolExecutionStartedEventType$inboundSchema;var c;(function(m){m.inboundSchema=e.ToolExecutionStartedEventType$inboundSchema,m.outboundSchema=e.ToolExecutionStartedEventType$outboundSchema})(c||(e.ToolExecutionStartedEventType$=c={})),e.ToolExecutionStartedEventName$inboundSchema=r.union([a.BuiltInConnectors$inboundSchema,r.string()]),e.ToolExecutionStartedEventName$outboundSchema=r.union([a.BuiltInConnectors$outboundSchema,r.string()]);var p;(function(m){m.inboundSchema=e.ToolExecutionStartedEventName$inboundSchema,m.outboundSchema=e.ToolExecutionStartedEventName$outboundSchema})(p||(e.ToolExecutionStartedEventName$=p={}));function u(m){return JSON.stringify(e.ToolExecutionStartedEventName$outboundSchema.parse(m))}function l(m){return(0,s.safeParse)(m,g=>e.ToolExecutionStartedEventName$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionStartedEventName' from JSON")}e.ToolExecutionStartedEvent$inboundSchema=r.object({type:e.ToolExecutionStartedEventType$inboundSchema.default("tool.execution.started"),created_at:r.string().datetime({offset:!0}).transform(m=>new Date(m)).optional(),output_index:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$inboundSchema,r.string()]),arguments:r.string()}).transform(m=>(0,i.remap)(m,{created_at:"createdAt",output_index:"outputIndex"})),e.ToolExecutionStartedEvent$outboundSchema=r.object({type:e.ToolExecutionStartedEventType$outboundSchema.default("tool.execution.started"),createdAt:r.date().transform(m=>m.toISOString()).optional(),outputIndex:r.number().int().default(0),id:r.string(),name:r.union([a.BuiltInConnectors$outboundSchema,r.string()]),arguments:r.string()}).transform(m=>(0,i.remap)(m,{createdAt:"created_at",outputIndex:"output_index"}));var d;(function(m){m.inboundSchema=e.ToolExecutionStartedEvent$inboundSchema,m.outboundSchema=e.ToolExecutionStartedEvent$outboundSchema})(d||(e.ToolExecutionStartedEvent$=d={}));function f(m){return JSON.stringify(e.ToolExecutionStartedEvent$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.ToolExecutionStartedEvent$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'ToolExecutionStartedEvent' from JSON")}})(Nd)),Nd}var BG;function Qqe(){return BG||(BG=1,(function(e){var t=Cd&&Cd.__createBinding||(Object.create?(function(T,D,B,N){N===void 0&&(N=B);var L=Object.getOwnPropertyDescriptor(D,B);(!L||("get"in L?!D.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return D[B]}}),Object.defineProperty(T,N,L)}):(function(T,D,B,N){N===void 0&&(N=B),T[N]=D[B]})),n=Cd&&Cd.__setModuleDefault||(Object.create?(function(T,D){Object.defineProperty(T,"default",{enumerable:!0,value:D})}):function(T,D){T.default=D}),o=Cd&&Cd.__importStar||(function(){var T=function(D){return T=Object.getOwnPropertyNames||function(B){var N=[];for(var L in B)Object.prototype.hasOwnProperty.call(B,L)&&(N[N.length]=L);return N},T(D)};return function(D){if(D&&D.__esModule)return D;var B={};if(D!=null)for(var N=T(D),L=0;L({type:T.type}))),s.AgentHandoffDoneEvent$inboundSchema.and(r.object({type:r.literal("agent.handoff.done")}).transform(T=>({type:T.type}))),a.AgentHandoffStartedEvent$inboundSchema.and(r.object({type:r.literal("agent.handoff.started")}).transform(T=>({type:T.type}))),h.ToolExecutionDeltaEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.delta")}).transform(T=>({type:T.type}))),g.ToolExecutionStartedEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.started")}).transform(T=>({type:T.type}))),l.ResponseErrorEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.error")}).transform(T=>({type:T.type}))),p.MessageOutputEvent$inboundSchema.and(r.object({type:r.literal("message.output.delta")}).transform(T=>({type:T.type}))),m.ToolExecutionDoneEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.done")}).transform(T=>({type:T.type}))),u.ResponseDoneEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.done")}).transform(T=>({type:T.type}))),d.ResponseStartedEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.started")}).transform(T=>({type:T.type})))]),e.ConversationEventsData$outboundSchema=r.union([c.FunctionCallEvent$outboundSchema.and(r.object({type:r.literal("function.call.delta")}).transform(T=>({type:T.type}))),s.AgentHandoffDoneEvent$outboundSchema.and(r.object({type:r.literal("agent.handoff.done")}).transform(T=>({type:T.type}))),a.AgentHandoffStartedEvent$outboundSchema.and(r.object({type:r.literal("agent.handoff.started")}).transform(T=>({type:T.type}))),h.ToolExecutionDeltaEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.delta")}).transform(T=>({type:T.type}))),g.ToolExecutionStartedEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.started")}).transform(T=>({type:T.type}))),l.ResponseErrorEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.error")}).transform(T=>({type:T.type}))),p.MessageOutputEvent$outboundSchema.and(r.object({type:r.literal("message.output.delta")}).transform(T=>({type:T.type}))),m.ToolExecutionDoneEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.done")}).transform(T=>({type:T.type}))),u.ResponseDoneEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.done")}).transform(T=>({type:T.type}))),d.ResponseStartedEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.started")}).transform(T=>({type:T.type})))]);var y;(function(T){T.inboundSchema=e.ConversationEventsData$inboundSchema,T.outboundSchema=e.ConversationEventsData$outboundSchema})(y||(e.ConversationEventsData$=y={}));function _(T){return JSON.stringify(e.ConversationEventsData$outboundSchema.parse(T))}function S(T){return(0,i.safeParse)(T,D=>e.ConversationEventsData$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'ConversationEventsData' from JSON")}e.ConversationEvents$inboundSchema=r.object({event:f.SSETypes$inboundSchema,data:r.string().transform((T,D)=>{try{return JSON.parse(T)}catch(B){return D.addIssue({code:r.ZodIssueCode.custom,message:`malformed json: ${B}`}),r.NEVER}}).pipe(r.union([c.FunctionCallEvent$inboundSchema.and(r.object({type:r.literal("function.call.delta")}).transform(T=>({type:T.type}))),s.AgentHandoffDoneEvent$inboundSchema.and(r.object({type:r.literal("agent.handoff.done")}).transform(T=>({type:T.type}))),a.AgentHandoffStartedEvent$inboundSchema.and(r.object({type:r.literal("agent.handoff.started")}).transform(T=>({type:T.type}))),h.ToolExecutionDeltaEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.delta")}).transform(T=>({type:T.type}))),g.ToolExecutionStartedEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.started")}).transform(T=>({type:T.type}))),l.ResponseErrorEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.error")}).transform(T=>({type:T.type}))),p.MessageOutputEvent$inboundSchema.and(r.object({type:r.literal("message.output.delta")}).transform(T=>({type:T.type}))),m.ToolExecutionDoneEvent$inboundSchema.and(r.object({type:r.literal("tool.execution.done")}).transform(T=>({type:T.type}))),u.ResponseDoneEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.done")}).transform(T=>({type:T.type}))),d.ResponseStartedEvent$inboundSchema.and(r.object({type:r.literal("conversation.response.started")}).transform(T=>({type:T.type})))]))}),e.ConversationEvents$outboundSchema=r.object({event:f.SSETypes$outboundSchema,data:r.union([c.FunctionCallEvent$outboundSchema.and(r.object({type:r.literal("function.call.delta")}).transform(T=>({type:T.type}))),s.AgentHandoffDoneEvent$outboundSchema.and(r.object({type:r.literal("agent.handoff.done")}).transform(T=>({type:T.type}))),a.AgentHandoffStartedEvent$outboundSchema.and(r.object({type:r.literal("agent.handoff.started")}).transform(T=>({type:T.type}))),h.ToolExecutionDeltaEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.delta")}).transform(T=>({type:T.type}))),g.ToolExecutionStartedEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.started")}).transform(T=>({type:T.type}))),l.ResponseErrorEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.error")}).transform(T=>({type:T.type}))),p.MessageOutputEvent$outboundSchema.and(r.object({type:r.literal("message.output.delta")}).transform(T=>({type:T.type}))),m.ToolExecutionDoneEvent$outboundSchema.and(r.object({type:r.literal("tool.execution.done")}).transform(T=>({type:T.type}))),u.ResponseDoneEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.done")}).transform(T=>({type:T.type}))),d.ResponseStartedEvent$outboundSchema.and(r.object({type:r.literal("conversation.response.started")}).transform(T=>({type:T.type})))])});var w;(function(T){T.inboundSchema=e.ConversationEvents$inboundSchema,T.outboundSchema=e.ConversationEvents$outboundSchema})(w||(e.ConversationEvents$=w={}));function R(T){return JSON.stringify(e.ConversationEvents$outboundSchema.parse(T))}function E(T){return(0,i.safeParse)(T,D=>e.ConversationEvents$inboundSchema.parse(JSON.parse(D)),"Failed to parse 'ConversationEvents' from JSON")}})(Cd)),Cd}var Ld={},kG;function $qe(){return kG||(kG=1,(function(e){var t=Ld&&Ld.__createBinding||(Object.create?(function(w,R,E,T){T===void 0&&(T=E);var D=Object.getOwnPropertyDescriptor(R,E);(!D||("get"in D?!R.__esModule:D.writable||D.configurable))&&(D={enumerable:!0,get:function(){return R[E]}}),Object.defineProperty(w,T,D)}):(function(w,R,E,T){T===void 0&&(T=E),w[T]=R[E]})),n=Ld&&Ld.__setModuleDefault||(Object.create?(function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}):function(w,R){w.default=R}),o=Ld&&Ld.__importStar||(function(){var w=function(R){return w=Object.getOwnPropertyNames||function(E){var T=[];for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(T[T.length]=D);return T},w(R)};return function(R){if(R&&R.__esModule)return R;var E={};if(R!=null)for(var T=w(R),D=0;De.Entries$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'Entries' from JSON")}e.ConversationHistory$inboundSchema=r.object({object:e.ConversationHistoryObject$inboundSchema.default("conversation.history"),conversation_id:r.string(),entries:r.array(r.union([a.AgentHandoffEntry$inboundSchema,c.FunctionCallEntry$inboundSchema,u.MessageInputEntry$inboundSchema,p.FunctionResultEntry$inboundSchema,d.ToolExecutionEntry$inboundSchema,l.MessageOutputEntry$inboundSchema]))}).transform(w=>(0,i.remap)(w,{conversation_id:"conversationId"})),e.ConversationHistory$outboundSchema=r.object({object:e.ConversationHistoryObject$outboundSchema.default("conversation.history"),conversationId:r.string(),entries:r.array(r.union([a.AgentHandoffEntry$outboundSchema,c.FunctionCallEntry$outboundSchema,u.MessageInputEntry$outboundSchema,p.FunctionResultEntry$outboundSchema,d.ToolExecutionEntry$outboundSchema,l.MessageOutputEntry$outboundSchema]))}).transform(w=>(0,i.remap)(w,{conversationId:"conversation_id"}));var y;(function(w){w.inboundSchema=e.ConversationHistory$inboundSchema,w.outboundSchema=e.ConversationHistory$outboundSchema})(y||(e.ConversationHistory$=y={}));function _(w){return JSON.stringify(e.ConversationHistory$outboundSchema.parse(w))}function S(w){return(0,s.safeParse)(w,R=>e.ConversationHistory$inboundSchema.parse(JSON.parse(R)),"Failed to parse 'ConversationHistory' from JSON")}})(Ld)),Ld}var Fd={},xd={},UG;function use(){return UG||(UG=1,(function(e){var t=xd&&xd.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=xd&&xd.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=xd&&xd.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.MessageEntries$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'MessageEntries' from JSON")}})(xd)),xd}var qG;function Wqe(){return qG||(qG=1,(function(e){var t=Fd&&Fd.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Fd&&Fd.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Fd&&Fd.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;g(0,i.remap)(d,{conversation_id:"conversationId"})),e.ConversationMessages$outboundSchema=r.object({object:e.ConversationMessagesObject$outboundSchema.default("conversation.messages"),conversationId:r.string(),messages:r.array(a.MessageEntries$outboundSchema)}).transform(d=>(0,i.remap)(d,{conversationId:"conversation_id"}));var p;(function(d){d.inboundSchema=e.ConversationMessages$inboundSchema,d.outboundSchema=e.ConversationMessages$outboundSchema})(p||(e.ConversationMessages$=p={}));function u(d){return JSON.stringify(e.ConversationMessages$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.ConversationMessages$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'ConversationMessages' from JSON")}})(Fd)),Fd}var Bd={},JG;function Yqe(){return JG||(JG=1,(function(e){var t=Bd&&Bd.__createBinding||(Object.create?(function(E,T,D,B){B===void 0&&(B=D);var N=Object.getOwnPropertyDescriptor(T,D);(!N||("get"in N?!T.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return T[D]}}),Object.defineProperty(E,B,N)}):(function(E,T,D,B){B===void 0&&(B=D),E[B]=T[D]})),n=Bd&&Bd.__setModuleDefault||(Object.create?(function(E,T){Object.defineProperty(E,"default",{enumerable:!0,value:T})}):function(E,T){E.default=T}),o=Bd&&Bd.__importStar||(function(){var E=function(T){return E=Object.getOwnPropertyNames||function(D){var B=[];for(var N in D)Object.prototype.hasOwnProperty.call(D,N)&&(B[B.length]=N);return B},E(T)};return function(T){if(T&&T.__esModule)return T;var D={};if(T!=null)for(var B=E(T),N=0;N({type:E.type}))),l.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))]),e.Tools$outboundSchema=r.union([u.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))]);var g;(function(E){E.inboundSchema=e.Tools$inboundSchema,E.outboundSchema=e.Tools$outboundSchema})(g||(e.Tools$=g={}));function y(E){return JSON.stringify(e.Tools$outboundSchema.parse(E))}function _(E){return(0,s.safeParse)(E,T=>e.Tools$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'Tools' from JSON")}e.ConversationRequest$inboundSchema=r.object({inputs:p.ConversationInputs$inboundSchema,stream:r.boolean().default(!1),store:r.nullable(r.boolean()).optional(),handoff_execution:r.nullable(e.HandoffExecution$inboundSchema).optional(),instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([u.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))])).optional(),completion_args:r.nullable(c.CompletionArgs$inboundSchema).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),agent_id:r.nullable(r.string()).optional(),agent_version:r.nullable(r.number().int()).optional(),model:r.nullable(r.string()).optional()}).transform(E=>(0,i.remap)(E,{handoff_execution:"handoffExecution",completion_args:"completionArgs",agent_id:"agentId",agent_version:"agentVersion"})),e.ConversationRequest$outboundSchema=r.object({inputs:p.ConversationInputs$outboundSchema,stream:r.boolean().default(!1),store:r.nullable(r.boolean()).optional(),handoffExecution:r.nullable(e.HandoffExecution$outboundSchema).optional(),instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([u.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))])).optional(),completionArgs:r.nullable(c.CompletionArgs$outboundSchema).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),agentId:r.nullable(r.string()).optional(),agentVersion:r.nullable(r.number().int()).optional(),model:r.nullable(r.string()).optional()}).transform(E=>(0,i.remap)(E,{handoffExecution:"handoff_execution",completionArgs:"completion_args",agentId:"agent_id",agentVersion:"agent_version"}));var S;(function(E){E.inboundSchema=e.ConversationRequest$inboundSchema,E.outboundSchema=e.ConversationRequest$outboundSchema})(S||(e.ConversationRequest$=S={}));function w(E){return JSON.stringify(e.ConversationRequest$outboundSchema.parse(E))}function R(E){return(0,s.safeParse)(E,T=>e.ConversationRequest$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'ConversationRequest' from JSON")}})(Bd)),Bd}var kd={},VG;function Xqe(){return VG||(VG=1,(function(e){var t=kd&&kd.__createBinding||(Object.create?(function(S,w,R,E){E===void 0&&(E=R);var T=Object.getOwnPropertyDescriptor(w,R);(!T||("get"in T?!w.__esModule:T.writable||T.configurable))&&(T={enumerable:!0,get:function(){return w[R]}}),Object.defineProperty(S,E,T)}):(function(S,w,R,E){E===void 0&&(E=R),S[E]=w[R]})),n=kd&&kd.__setModuleDefault||(Object.create?(function(S,w){Object.defineProperty(S,"default",{enumerable:!0,value:w})}):function(S,w){S.default=w}),o=kd&&kd.__importStar||(function(){var S=function(w){return S=Object.getOwnPropertyNames||function(R){var E=[];for(var T in R)Object.prototype.hasOwnProperty.call(R,T)&&(E[E.length]=T);return E},S(w)};return function(w){if(w&&w.__esModule)return w;var R={};if(w!=null)for(var E=S(w),T=0;Te.Outputs$inboundSchema.parse(JSON.parse(w)),"Failed to parse 'Outputs' from JSON")}e.ConversationResponse$inboundSchema=r.object({object:e.ConversationResponseObject$inboundSchema.default("conversation.response"),conversation_id:r.string(),outputs:r.array(r.union([a.AgentHandoffEntry$inboundSchema,p.FunctionCallEntry$inboundSchema,l.ToolExecutionEntry$inboundSchema,u.MessageOutputEntry$inboundSchema])),usage:c.ConversationUsageInfo$inboundSchema}).transform(S=>(0,i.remap)(S,{conversation_id:"conversationId"})),e.ConversationResponse$outboundSchema=r.object({object:e.ConversationResponseObject$outboundSchema.default("conversation.response"),conversationId:r.string(),outputs:r.array(r.union([a.AgentHandoffEntry$outboundSchema,p.FunctionCallEntry$outboundSchema,l.ToolExecutionEntry$outboundSchema,u.MessageOutputEntry$outboundSchema])),usage:c.ConversationUsageInfo$outboundSchema}).transform(S=>(0,i.remap)(S,{conversationId:"conversation_id"}));var g;(function(S){S.inboundSchema=e.ConversationResponse$inboundSchema,S.outboundSchema=e.ConversationResponse$outboundSchema})(g||(e.ConversationResponse$=g={}));function y(S){return JSON.stringify(e.ConversationResponse$outboundSchema.parse(S))}function _(S){return(0,s.safeParse)(S,w=>e.ConversationResponse$inboundSchema.parse(JSON.parse(w)),"Failed to parse 'ConversationResponse' from JSON")}})(kd)),kd}var Ud={},HG;function Zqe(){return HG||(HG=1,(function(e){var t=Ud&&Ud.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=Ud&&Ud.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=Ud&&Ud.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{handoff_execution:"handoffExecution",completion_args:"completionArgs",from_entry_id:"fromEntryId",agent_version:"agentVersion"})),e.ConversationRestartRequest$outboundSchema=r.object({inputs:c.ConversationInputs$outboundSchema,stream:r.boolean().default(!1),store:r.boolean().default(!0),handoffExecution:e.ConversationRestartRequestHandoffExecution$outboundSchema.default("server"),completionArgs:a.CompletionArgs$outboundSchema.optional(),metadata:r.nullable(r.record(r.any())).optional(),fromEntryId:r.string(),agentVersion:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{handoffExecution:"handoff_execution",completionArgs:"completion_args",fromEntryId:"from_entry_id",agentVersion:"agent_version"}));var u;(function(f){f.inboundSchema=e.ConversationRestartRequest$inboundSchema,f.outboundSchema=e.ConversationRestartRequest$outboundSchema})(u||(e.ConversationRestartRequest$=u={}));function l(f){return JSON.stringify(e.ConversationRestartRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ConversationRestartRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ConversationRestartRequest' from JSON")}})(Ud)),Ud}var qd={},GG;function e4e(){return GG||(GG=1,(function(e){var t=qd&&qd.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=qd&&qd.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=qd&&qd.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{handoff_execution:"handoffExecution",completion_args:"completionArgs",from_entry_id:"fromEntryId",agent_version:"agentVersion"})),e.ConversationRestartStreamRequest$outboundSchema=r.object({inputs:c.ConversationInputs$outboundSchema,stream:r.boolean().default(!0),store:r.boolean().default(!0),handoffExecution:e.ConversationRestartStreamRequestHandoffExecution$outboundSchema.default("server"),completionArgs:a.CompletionArgs$outboundSchema.optional(),metadata:r.nullable(r.record(r.any())).optional(),fromEntryId:r.string(),agentVersion:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{handoffExecution:"handoff_execution",completionArgs:"completion_args",fromEntryId:"from_entry_id",agentVersion:"agent_version"}));var u;(function(f){f.inboundSchema=e.ConversationRestartStreamRequest$inboundSchema,f.outboundSchema=e.ConversationRestartStreamRequest$outboundSchema})(u||(e.ConversationRestartStreamRequest$=u={}));function l(f){return JSON.stringify(e.ConversationRestartStreamRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.ConversationRestartStreamRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'ConversationRestartStreamRequest' from JSON")}})(qd)),qd}var Jd={},zG;function t4e(){return zG||(zG=1,(function(e){var t=Jd&&Jd.__createBinding||(Object.create?(function(E,T,D,B){B===void 0&&(B=D);var N=Object.getOwnPropertyDescriptor(T,D);(!N||("get"in N?!T.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return T[D]}}),Object.defineProperty(E,B,N)}):(function(E,T,D,B){B===void 0&&(B=D),E[B]=T[D]})),n=Jd&&Jd.__setModuleDefault||(Object.create?(function(E,T){Object.defineProperty(E,"default",{enumerable:!0,value:T})}):function(E,T){E.default=T}),o=Jd&&Jd.__importStar||(function(){var E=function(T){return E=Object.getOwnPropertyNames||function(D){var B=[];for(var N in D)Object.prototype.hasOwnProperty.call(D,N)&&(B[B.length]=N);return B},E(T)};return function(T){if(T&&T.__esModule)return T;var D={};if(T!=null)for(var B=E(T),N=0;N({type:E.type}))),l.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))]),e.ConversationStreamRequestTools$outboundSchema=r.union([u.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))]);var g;(function(E){E.inboundSchema=e.ConversationStreamRequestTools$inboundSchema,E.outboundSchema=e.ConversationStreamRequestTools$outboundSchema})(g||(e.ConversationStreamRequestTools$=g={}));function y(E){return JSON.stringify(e.ConversationStreamRequestTools$outboundSchema.parse(E))}function _(E){return(0,s.safeParse)(E,T=>e.ConversationStreamRequestTools$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'ConversationStreamRequestTools' from JSON")}e.ConversationStreamRequest$inboundSchema=r.object({inputs:p.ConversationInputs$inboundSchema,stream:r.boolean().default(!0),store:r.nullable(r.boolean()).optional(),handoff_execution:r.nullable(e.ConversationStreamRequestHandoffExecution$inboundSchema).optional(),instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([u.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))])).optional(),completion_args:r.nullable(c.CompletionArgs$inboundSchema).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),agent_id:r.nullable(r.string()).optional(),agent_version:r.nullable(r.number().int()).optional(),model:r.nullable(r.string()).optional()}).transform(E=>(0,i.remap)(E,{handoff_execution:"handoffExecution",completion_args:"completionArgs",agent_id:"agentId",agent_version:"agentVersion"})),e.ConversationStreamRequest$outboundSchema=r.object({inputs:p.ConversationInputs$outboundSchema,stream:r.boolean().default(!0),store:r.nullable(r.boolean()).optional(),handoffExecution:r.nullable(e.ConversationStreamRequestHandoffExecution$outboundSchema).optional(),instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([u.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(E=>({type:E.type}))),l.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(E=>({type:E.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(E=>({type:E.type}))),d.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(E=>({type:E.type}))),h.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(E=>({type:E.type}))),f.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(E=>({type:E.type})))])).optional(),completionArgs:r.nullable(c.CompletionArgs$outboundSchema).optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),agentId:r.nullable(r.string()).optional(),agentVersion:r.nullable(r.number().int()).optional(),model:r.nullable(r.string()).optional()}).transform(E=>(0,i.remap)(E,{handoffExecution:"handoff_execution",completionArgs:"completion_args",agentId:"agent_id",agentVersion:"agent_version"}));var S;(function(E){E.inboundSchema=e.ConversationStreamRequest$inboundSchema,E.outboundSchema=e.ConversationStreamRequest$outboundSchema})(S||(e.ConversationStreamRequest$=S={}));function w(E){return JSON.stringify(e.ConversationStreamRequest$outboundSchema.parse(E))}function R(E){return(0,s.safeParse)(E,T=>e.ConversationStreamRequest$inboundSchema.parse(JSON.parse(T)),"Failed to parse 'ConversationStreamRequest' from JSON")}})(Jd)),Jd}var Vd={},KG;function n4e(){return KG||(KG=1,(function(e){var t=Vd&&Vd.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Vd&&Vd.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Vd&&Vd.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.DeleteFileOut$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'DeleteFileOut' from JSON")}})(Vd)),Vd}var Hd={},QG;function r4e(){return QG||(QG=1,(function(e){var t=Hd&&Hd.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Hd&&Hd.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Hd&&Hd.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.DeleteModelOut$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'DeleteModelOut' from JSON")}})(Hd)),Hd}var Gd={},$G;function cse(){return $G||($G=1,(function(e){var t=Gd&&Gd.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Gd&&Gd.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Gd&&Gd.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;hnew Date(u)),last_processed_at:r.nullable(r.string().datetime({offset:!0}).transform(u=>new Date(u))).optional(),number_of_pages:r.nullable(r.number().int()).optional(),processing_status:r.string(),uploaded_by_id:r.nullable(r.string()),uploaded_by_type:r.string(),tokens_processing_main_content:r.nullable(r.number().int()).optional(),tokens_processing_summary:r.nullable(r.number().int()).optional(),url:r.nullable(r.string()).optional(),attributes:r.nullable(r.record(r.any())).optional(),tokens_processing_total:r.number().int()}).transform(u=>(0,i.remap)(u,{library_id:"libraryId",mime_type:"mimeType",created_at:"createdAt",last_processed_at:"lastProcessedAt",number_of_pages:"numberOfPages",processing_status:"processingStatus",uploaded_by_id:"uploadedById",uploaded_by_type:"uploadedByType",tokens_processing_main_content:"tokensProcessingMainContent",tokens_processing_summary:"tokensProcessingSummary",tokens_processing_total:"tokensProcessingTotal"})),e.DocumentOut$outboundSchema=r.object({id:r.string(),libraryId:r.string(),hash:r.nullable(r.string()),mimeType:r.nullable(r.string()),extension:r.nullable(r.string()),size:r.nullable(r.number().int()),name:r.string(),summary:r.nullable(r.string()).optional(),createdAt:r.date().transform(u=>u.toISOString()),lastProcessedAt:r.nullable(r.date().transform(u=>u.toISOString())).optional(),numberOfPages:r.nullable(r.number().int()).optional(),processingStatus:r.string(),uploadedById:r.nullable(r.string()),uploadedByType:r.string(),tokensProcessingMainContent:r.nullable(r.number().int()).optional(),tokensProcessingSummary:r.nullable(r.number().int()).optional(),url:r.nullable(r.string()).optional(),attributes:r.nullable(r.record(r.any())).optional(),tokensProcessingTotal:r.number().int()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",mimeType:"mime_type",createdAt:"created_at",lastProcessedAt:"last_processed_at",numberOfPages:"number_of_pages",processingStatus:"processing_status",uploadedById:"uploaded_by_id",uploadedByType:"uploaded_by_type",tokensProcessingMainContent:"tokens_processing_main_content",tokensProcessingSummary:"tokens_processing_summary",tokensProcessingTotal:"tokens_processing_total"}));var a;(function(u){u.inboundSchema=e.DocumentOut$inboundSchema,u.outboundSchema=e.DocumentOut$outboundSchema})(a||(e.DocumentOut$=a={}));function c(u){return JSON.stringify(e.DocumentOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.DocumentOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'DocumentOut' from JSON")}})(Gd)),Gd}var zd={},WG;function o4e(){return WG||(WG=1,(function(e){var t=zd&&zd.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=zd&&zd.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=zd&&zd.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.DocumentTextContent$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'DocumentTextContent' from JSON")}})(zd)),zd}var Kd={},YG;function i4e(){return YG||(YG=1,(function(e){var t=Kd&&Kd.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Kd&&Kd.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Kd&&Kd.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;gnew Date(d)),r.array(r.string()),r.array(r.number().int()),r.array(r.number()),r.array(r.boolean())]),e.Attributes$outboundSchema=r.union([r.boolean(),r.string(),r.number().int(),r.number(),r.date().transform(d=>d.toISOString()),r.array(r.string()),r.array(r.number().int()),r.array(r.number()),r.array(r.boolean())]);var s;(function(d){d.inboundSchema=e.Attributes$inboundSchema,d.outboundSchema=e.Attributes$outboundSchema})(s||(e.Attributes$=s={}));function a(d){return JSON.stringify(e.Attributes$outboundSchema.parse(d))}function c(d){return(0,i.safeParse)(d,f=>e.Attributes$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'Attributes' from JSON")}e.DocumentUpdateIn$inboundSchema=r.object({name:r.nullable(r.string()).optional(),attributes:r.nullable(r.record(r.union([r.boolean(),r.string(),r.number().int(),r.number(),r.string().datetime({offset:!0}).transform(d=>new Date(d)),r.array(r.string()),r.array(r.number().int()),r.array(r.number()),r.array(r.boolean())]))).optional()}),e.DocumentUpdateIn$outboundSchema=r.object({name:r.nullable(r.string()).optional(),attributes:r.nullable(r.record(r.union([r.boolean(),r.string(),r.number().int(),r.number(),r.date().transform(d=>d.toISOString()),r.array(r.string()),r.array(r.number().int()),r.array(r.number()),r.array(r.boolean())]))).optional()});var p;(function(d){d.inboundSchema=e.DocumentUpdateIn$inboundSchema,d.outboundSchema=e.DocumentUpdateIn$outboundSchema})(p||(e.DocumentUpdateIn$=p={}));function u(d){return JSON.stringify(e.DocumentUpdateIn$outboundSchema.parse(d))}function l(d){return(0,i.safeParse)(d,f=>e.DocumentUpdateIn$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'DocumentUpdateIn' from JSON")}})(Kd)),Kd}var Qd={},XG;function dse(){return XG||(XG=1,(function(e){var t=Qd&&Qd.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Qd&&Qd.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Qd&&Qd.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;ue.EmbeddingRequestInputs$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'EmbeddingRequestInputs' from JSON")}e.EmbeddingRequest$inboundSchema=r.object({model:r.string(),input:r.union([r.string(),r.array(r.string())]),output_dimension:r.nullable(r.number().int()).optional(),output_dtype:a.EmbeddingDtype$inboundSchema.optional(),encoding_format:c.EncodingFormat$inboundSchema.optional()}).transform(m=>(0,i.remap)(m,{input:"inputs",output_dimension:"outputDimension",output_dtype:"outputDtype",encoding_format:"encodingFormat"})),e.EmbeddingRequest$outboundSchema=r.object({model:r.string(),inputs:r.union([r.string(),r.array(r.string())]),outputDimension:r.nullable(r.number().int()).optional(),outputDtype:a.EmbeddingDtype$outboundSchema.optional(),encodingFormat:c.EncodingFormat$outboundSchema.optional()}).transform(m=>(0,i.remap)(m,{inputs:"input",outputDimension:"output_dimension",outputDtype:"output_dtype",encodingFormat:"encoding_format"}));var d;(function(m){m.inboundSchema=e.EmbeddingRequest$inboundSchema,m.outboundSchema=e.EmbeddingRequest$outboundSchema})(d||(e.EmbeddingRequest$=d={}));function f(m){return JSON.stringify(e.EmbeddingRequest$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.EmbeddingRequest$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'EmbeddingRequest' from JSON")}})($d)),$d}var Yd={},Xd={},tz;function hse(){return tz||(tz=1,(function(e){var t=Xd&&Xd.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Xd&&Xd.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Xd&&Xd.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.EmbeddingResponseData$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'EmbeddingResponseData' from JSON")}})(Xd)),Xd}var nz;function a4e(){return nz||(nz=1,(function(e){var t=Yd&&Yd.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Yd&&Yd.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Yd&&Yd.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.EmbeddingResponse$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'EmbeddingResponse' from JSON")}})(Yd)),Yd}var Zd={},rz;function iB(){return rz||(rz=1,(function(e){var t=Zd&&Zd.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),n=Zd&&Zd.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),o=Zd&&Zd.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;l(0,i.remap)(f,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"})),e.FileSchema$outboundSchema=r.object({id:r.string(),object:r.string(),sizeBytes:r.number().int(),createdAt:r.number().int(),filename:r.string(),purpose:a.FilePurpose$outboundSchema,sampleType:c.SampleType$outboundSchema,numLines:r.nullable(r.number().int()).optional(),mimetype:r.nullable(r.string()).optional(),source:p.Source$outboundSchema,signature:r.nullable(r.string()).optional()}).transform(f=>(0,i.remap)(f,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var u;(function(f){f.inboundSchema=e.FileSchema$inboundSchema,f.outboundSchema=e.FileSchema$outboundSchema})(u||(e.FileSchema$=u={}));function l(f){return JSON.stringify(e.FileSchema$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.FileSchema$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FileSchema' from JSON")}})(tf)),tf}var of={},lz;function l4e(){return lz||(lz=1,(function(e){var t=of&&of.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=of&&of.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=of&&of.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.FileSignedURL$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'FileSignedURL' from JSON")}})(of)),of}var sf={},uz;function u4e(){return uz||(uz=1,(function(e){var t=sf&&sf.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=sf&&sf.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=sf&&sf.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;ye.FIMCompletionRequestStop$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FIMCompletionRequestStop' from JSON")}e.FIMCompletionRequest$inboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),top_p:r.number().default(1),max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),prompt:r.string(),suffix:r.nullable(r.string()).optional(),min_tokens:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",min_tokens:"minTokens"})),e.FIMCompletionRequest$outboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),topP:r.number().default(1),maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!1),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),prompt:r.string(),suffix:r.nullable(r.string()).optional(),minTokens:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",minTokens:"min_tokens"}));var u;(function(f){f.inboundSchema=e.FIMCompletionRequest$inboundSchema,f.outboundSchema=e.FIMCompletionRequest$outboundSchema})(u||(e.FIMCompletionRequest$=u={}));function l(f){return JSON.stringify(e.FIMCompletionRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.FIMCompletionRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FIMCompletionRequest' from JSON")}})(sf)),sf}var af={},cz;function c4e(){return cz||(cz=1,(function(e){var t=af&&af.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=af&&af.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=af&&af.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.FIMCompletionResponse$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'FIMCompletionResponse' from JSON")}})(af)),af}var lf={},dz;function d4e(){return dz||(dz=1,(function(e){var t=lf&&lf.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=lf&&lf.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=lf&&lf.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;ye.FIMCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FIMCompletionStreamRequestStop' from JSON")}e.FIMCompletionStreamRequest$inboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),top_p:r.number().default(1),max_tokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),random_seed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),prompt:r.string(),suffix:r.nullable(r.string()).optional(),min_tokens:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",min_tokens:"minTokens"})),e.FIMCompletionStreamRequest$outboundSchema=r.object({model:r.string(),temperature:r.nullable(r.number()).optional(),topP:r.number().default(1),maxTokens:r.nullable(r.number().int()).optional(),stream:r.boolean().default(!0),stop:r.union([r.string(),r.array(r.string())]).optional(),randomSeed:r.nullable(r.number().int()).optional(),metadata:r.nullable(r.record(r.any())).optional(),prompt:r.string(),suffix:r.nullable(r.string()).optional(),minTokens:r.nullable(r.number().int()).optional()}).transform(f=>(0,i.remap)(f,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",minTokens:"min_tokens"}));var u;(function(f){f.inboundSchema=e.FIMCompletionStreamRequest$inboundSchema,f.outboundSchema=e.FIMCompletionStreamRequest$outboundSchema})(u||(e.FIMCompletionStreamRequest$=u={}));function l(f){return JSON.stringify(e.FIMCompletionStreamRequest$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.FIMCompletionStreamRequest$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'FIMCompletionStreamRequest' from JSON")}})(lf)),lf}var uf={},fz;function mse(){return fz||(fz=1,(function(e){var t=uf&&uf.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=uf&&uf.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=uf&&uf.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;unew Date(d))).optional(),deprecation_replacement_model:r.nullable(r.string()).optional(),default_model_temperature:r.nullable(r.number()).optional(),type:r.literal("fine-tuned").default("fine-tuned"),job:r.string(),root:r.string(),archived:r.boolean().default(!1)}).transform(d=>(0,i.remap)(d,{owned_by:"ownedBy",max_context_length:"maxContextLength",deprecation_replacement_model:"deprecationReplacementModel",default_model_temperature:"defaultModelTemperature"})),e.FTModelCard$outboundSchema=r.object({id:r.string(),object:r.string().default("model"),created:r.number().int().optional(),ownedBy:r.string().default("mistralai"),capabilities:a.ModelCapabilities$outboundSchema,name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),maxContextLength:r.number().int().default(32768),aliases:r.array(r.string()).optional(),deprecation:r.nullable(r.date().transform(d=>d.toISOString())).optional(),deprecationReplacementModel:r.nullable(r.string()).optional(),defaultModelTemperature:r.nullable(r.number()).optional(),type:r.literal("fine-tuned").default("fine-tuned"),job:r.string(),root:r.string(),archived:r.boolean().default(!1)}).transform(d=>(0,i.remap)(d,{ownedBy:"owned_by",maxContextLength:"max_context_length",deprecationReplacementModel:"deprecation_replacement_model",defaultModelTemperature:"default_model_temperature"}));var p;(function(d){d.inboundSchema=e.FTModelCard$inboundSchema,d.outboundSchema=e.FTModelCard$outboundSchema})(p||(e.FTModelCard$=p={}));function u(d){return JSON.stringify(e.FTModelCard$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.FTModelCard$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'FTModelCard' from JSON")}})(cf)),cf}var df={},pz;function bse(){return pz||(pz=1,(function(e){var t=df&&df.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=df&&df.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=df&&df.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.GithubRepositoryIn$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'GithubRepositoryIn' from JSON")}})(df)),df}var ff={},hf={},mz;function yse(){return mz||(mz=1,(function(e){var t=hf&&hf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=hf&&hf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=hf&&hf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.TrainingFile$outboundSchema=r.object({fileId:r.string(),weight:r.number().default(1)}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.TrainingFile$inboundSchema,u.outboundSchema=e.TrainingFile$outboundSchema})(a||(e.TrainingFile$=a={}));function c(u){return JSON.stringify(e.TrainingFile$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.TrainingFile$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'TrainingFile' from JSON")}})(hf)),hf}var pf={},gz;function Ase(){return gz||(gz=1,(function(e){var t=pf&&pf.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=pf&&pf.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=pf&&pf.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{api_key:"apiKey",run_name:"runName"})),e.WandbIntegration$outboundSchema=r.object({type:e.WandbIntegrationType$outboundSchema.default("wandb"),project:r.string(),name:r.nullable(r.string()).optional(),apiKey:r.string(),runName:r.nullable(r.string()).optional()}).transform(l=>(0,i.remap)(l,{apiKey:"api_key",runName:"run_name"}));var c;(function(l){l.inboundSchema=e.WandbIntegration$inboundSchema,l.outboundSchema=e.WandbIntegration$outboundSchema})(c||(e.WandbIntegration$=c={}));function p(l){return JSON.stringify(e.WandbIntegration$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.WandbIntegration$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'WandbIntegration' from JSON")}})(pf)),pf}var bz;function f4e(){return bz||(bz=1,(function(e){var t=ff&&ff.__createBinding||(Object.create?(function(N,L,q,I){I===void 0&&(I=q);var U=Object.getOwnPropertyDescriptor(L,q);(!U||("get"in U?!L.__esModule:U.writable||U.configurable))&&(U={enumerable:!0,get:function(){return L[q]}}),Object.defineProperty(N,I,U)}):(function(N,L,q,I){I===void 0&&(I=q),N[I]=L[q]})),n=ff&&ff.__setModuleDefault||(Object.create?(function(N,L){Object.defineProperty(N,"default",{enumerable:!0,value:L})}):function(N,L){N.default=L}),o=ff&&ff.__importStar||(function(){var N=function(L){return N=Object.getOwnPropertyNames||function(q){var I=[];for(var U in q)Object.prototype.hasOwnProperty.call(q,U)&&(I[I.length]=U);return I},N(L)};return function(L){if(L&&L.__esModule)return L;var q={};if(L!=null)for(var I=N(L),U=0;Ue.JobInIntegrations$inboundSchema.parse(JSON.parse(L)),"Failed to parse 'JobInIntegrations' from JSON")}e.Hyperparameters$inboundSchema=r.union([p.CompletionTrainingParametersIn$inboundSchema,c.ClassifierTrainingParametersIn$inboundSchema]),e.Hyperparameters$outboundSchema=r.union([p.CompletionTrainingParametersIn$outboundSchema,c.ClassifierTrainingParametersIn$outboundSchema]);var y;(function(N){N.inboundSchema=e.Hyperparameters$inboundSchema,N.outboundSchema=e.Hyperparameters$outboundSchema})(y||(e.Hyperparameters$=y={}));function _(N){return JSON.stringify(e.Hyperparameters$outboundSchema.parse(N))}function S(N){return(0,s.safeParse)(N,L=>e.Hyperparameters$inboundSchema.parse(JSON.parse(L)),"Failed to parse 'Hyperparameters' from JSON")}e.JobInRepositories$inboundSchema=l.GithubRepositoryIn$inboundSchema,e.JobInRepositories$outboundSchema=l.GithubRepositoryIn$outboundSchema;var w;(function(N){N.inboundSchema=e.JobInRepositories$inboundSchema,N.outboundSchema=e.JobInRepositories$outboundSchema})(w||(e.JobInRepositories$=w={}));function R(N){return JSON.stringify(e.JobInRepositories$outboundSchema.parse(N))}function E(N){return(0,s.safeParse)(N,L=>e.JobInRepositories$inboundSchema.parse(JSON.parse(L)),"Failed to parse 'JobInRepositories' from JSON")}e.JobIn$inboundSchema=r.object({model:r.string(),training_files:r.array(d.TrainingFile$inboundSchema).optional(),validation_files:r.nullable(r.array(r.string())).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(f.WandbIntegration$inboundSchema)).optional(),auto_start:r.boolean().optional(),invalid_sample_skip_percentage:r.number().default(0),job_type:r.nullable(u.FineTuneableModelType$inboundSchema).optional(),hyperparameters:r.union([p.CompletionTrainingParametersIn$inboundSchema,c.ClassifierTrainingParametersIn$inboundSchema]),repositories:r.nullable(r.array(l.GithubRepositoryIn$inboundSchema)).optional(),classifier_targets:r.nullable(r.array(a.ClassifierTargetIn$inboundSchema)).optional()}).transform(N=>(0,i.remap)(N,{training_files:"trainingFiles",validation_files:"validationFiles",auto_start:"autoStart",invalid_sample_skip_percentage:"invalidSampleSkipPercentage",job_type:"jobType",classifier_targets:"classifierTargets"})),e.JobIn$outboundSchema=r.object({model:r.string(),trainingFiles:r.array(d.TrainingFile$outboundSchema).optional(),validationFiles:r.nullable(r.array(r.string())).optional(),suffix:r.nullable(r.string()).optional(),integrations:r.nullable(r.array(f.WandbIntegration$outboundSchema)).optional(),autoStart:r.boolean().optional(),invalidSampleSkipPercentage:r.number().default(0),jobType:r.nullable(u.FineTuneableModelType$outboundSchema).optional(),hyperparameters:r.union([p.CompletionTrainingParametersIn$outboundSchema,c.ClassifierTrainingParametersIn$outboundSchema]),repositories:r.nullable(r.array(l.GithubRepositoryIn$outboundSchema)).optional(),classifierTargets:r.nullable(r.array(a.ClassifierTargetIn$outboundSchema)).optional()}).transform(N=>(0,i.remap)(N,{trainingFiles:"training_files",validationFiles:"validation_files",autoStart:"auto_start",invalidSampleSkipPercentage:"invalid_sample_skip_percentage",jobType:"job_type",classifierTargets:"classifier_targets"}));var T;(function(N){N.inboundSchema=e.JobIn$inboundSchema,N.outboundSchema=e.JobIn$outboundSchema})(T||(e.JobIn$=T={}));function D(N){return JSON.stringify(e.JobIn$outboundSchema.parse(N))}function B(N){return(0,s.safeParse)(N,L=>e.JobIn$inboundSchema.parse(JSON.parse(L)),"Failed to parse 'JobIn' from JSON")}})(ff)),ff}var mf={},yz;function h4e(){return yz||(yz=1,(function(e){var t=mf&&mf.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=mf&&mf.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=mf&&mf.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.JobsOut$=e.JobsOut$outboundSchema=e.JobsOut$inboundSchema=e.JobsOutObject$=e.JobsOutObject$outboundSchema=e.JobsOutObject$inboundSchema=e.JobsOutData$=e.JobsOutData$outboundSchema=e.JobsOutData$inboundSchema=e.JobsOutObject=void 0,e.jobsOutDataToJSON=p,e.jobsOutDataFromJSON=u,e.jobsOutToJSON=f,e.jobsOutFromJSON=h;const r=o(ne()),i=ee(),s=qie(),a=Kie();e.JobsOutObject={List:"list"},e.JobsOutData$inboundSchema=r.union([s.ClassifierJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(m=>({jobType:m.job_type}))),a.CompletionJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(m=>({jobType:m.job_type})))]),e.JobsOutData$outboundSchema=r.union([s.ClassifierJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(m=>({job_type:m.jobType}))),a.CompletionJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(m=>({job_type:m.jobType})))]);var c;(function(m){m.inboundSchema=e.JobsOutData$inboundSchema,m.outboundSchema=e.JobsOutData$outboundSchema})(c||(e.JobsOutData$=c={}));function p(m){return JSON.stringify(e.JobsOutData$outboundSchema.parse(m))}function u(m){return(0,i.safeParse)(m,g=>e.JobsOutData$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'JobsOutData' from JSON")}e.JobsOutObject$inboundSchema=r.nativeEnum(e.JobsOutObject),e.JobsOutObject$outboundSchema=e.JobsOutObject$inboundSchema;var l;(function(m){m.inboundSchema=e.JobsOutObject$inboundSchema,m.outboundSchema=e.JobsOutObject$outboundSchema})(l||(e.JobsOutObject$=l={})),e.JobsOut$inboundSchema=r.object({data:r.array(r.union([s.ClassifierJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(m=>({jobType:m.job_type}))),a.CompletionJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(m=>({jobType:m.job_type})))])).optional(),object:e.JobsOutObject$inboundSchema.default("list"),total:r.number().int()}),e.JobsOut$outboundSchema=r.object({data:r.array(r.union([s.ClassifierJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(m=>({job_type:m.jobType}))),a.CompletionJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(m=>({job_type:m.jobType})))])).optional(),object:e.JobsOutObject$outboundSchema.default("list"),total:r.number().int()});var d;(function(m){m.inboundSchema=e.JobsOut$inboundSchema,m.outboundSchema=e.JobsOut$outboundSchema})(d||(e.JobsOut$=d={}));function f(m){return JSON.stringify(e.JobsOut$outboundSchema.parse(m))}function h(m){return(0,i.safeParse)(m,g=>e.JobsOut$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'JobsOut' from JSON")}})(mf)),mf}var gf={},Az;function p4e(){return Az||(Az=1,(function(e){var t=gf&&gf.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=gf&&gf.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=gf&&gf.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{expected_duration_seconds:"expectedDurationSeconds",cost_currency:"costCurrency",train_tokens_per_step:"trainTokensPerStep",train_tokens:"trainTokens",data_tokens:"dataTokens",estimated_start_time:"estimatedStartTime",training_steps:"trainingSteps"})),e.LegacyJobMetadataOut$outboundSchema=r.object({expectedDurationSeconds:r.nullable(r.number().int()).optional(),cost:r.nullable(r.number()).optional(),costCurrency:r.nullable(r.string()).optional(),trainTokensPerStep:r.nullable(r.number().int()).optional(),trainTokens:r.nullable(r.number().int()).optional(),dataTokens:r.nullable(r.number().int()).optional(),estimatedStartTime:r.nullable(r.number().int()).optional(),deprecated:r.boolean().default(!0),details:r.string(),epochs:r.nullable(r.number()).optional(),trainingSteps:r.nullable(r.number().int()).optional(),object:e.LegacyJobMetadataOutObject$outboundSchema.default("job.metadata")}).transform(l=>(0,i.remap)(l,{expectedDurationSeconds:"expected_duration_seconds",costCurrency:"cost_currency",trainTokensPerStep:"train_tokens_per_step",trainTokens:"train_tokens",dataTokens:"data_tokens",estimatedStartTime:"estimated_start_time",trainingSteps:"training_steps"}));var c;(function(l){l.inboundSchema=e.LegacyJobMetadataOut$inboundSchema,l.outboundSchema=e.LegacyJobMetadataOut$outboundSchema})(c||(e.LegacyJobMetadataOut$=c={}));function p(l){return JSON.stringify(e.LegacyJobMetadataOut$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.LegacyJobMetadataOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'LegacyJobMetadataOut' from JSON")}})(gf)),gf}var bf={},_z;function m4e(){return _z||(_z=1,(function(e){var t=bf&&bf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=bf&&bf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=bf&&bf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{chunk_size:"chunkSize"})),e.LibraryIn$outboundSchema=r.object({name:r.string(),description:r.nullable(r.string()).optional(),chunkSize:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{chunkSize:"chunk_size"}));var a;(function(u){u.inboundSchema=e.LibraryIn$inboundSchema,u.outboundSchema=e.LibraryIn$outboundSchema})(a||(e.LibraryIn$=a={}));function c(u){return JSON.stringify(e.LibraryIn$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibraryIn$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibraryIn' from JSON")}})(bf)),bf}var yf={},vz;function g4e(){return vz||(vz=1,(function(e){var t=yf&&yf.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=yf&&yf.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=yf&&yf.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.LibraryInUpdate$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'LibraryInUpdate' from JSON")}})(yf)),yf}var Af={},Sz;function _se(){return Sz||(Sz=1,(function(e){var t=Af&&Af.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Af&&Af.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Af&&Af.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;hnew Date(u)),updated_at:r.string().datetime({offset:!0}).transform(u=>new Date(u)),owner_id:r.nullable(r.string()),owner_type:r.string(),total_size:r.number().int(),nb_documents:r.number().int(),chunk_size:r.nullable(r.number().int()),emoji:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),generated_description:r.nullable(r.string()).optional(),explicit_user_members_count:r.nullable(r.number().int()).optional(),explicit_workspace_members_count:r.nullable(r.number().int()).optional(),org_sharing_role:r.nullable(r.string()).optional(),generated_name:r.nullable(r.string()).optional()}).transform(u=>(0,i.remap)(u,{created_at:"createdAt",updated_at:"updatedAt",owner_id:"ownerId",owner_type:"ownerType",total_size:"totalSize",nb_documents:"nbDocuments",chunk_size:"chunkSize",generated_description:"generatedDescription",explicit_user_members_count:"explicitUserMembersCount",explicit_workspace_members_count:"explicitWorkspaceMembersCount",org_sharing_role:"orgSharingRole",generated_name:"generatedName"})),e.LibraryOut$outboundSchema=r.object({id:r.string(),name:r.string(),createdAt:r.date().transform(u=>u.toISOString()),updatedAt:r.date().transform(u=>u.toISOString()),ownerId:r.nullable(r.string()),ownerType:r.string(),totalSize:r.number().int(),nbDocuments:r.number().int(),chunkSize:r.nullable(r.number().int()),emoji:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),generatedDescription:r.nullable(r.string()).optional(),explicitUserMembersCount:r.nullable(r.number().int()).optional(),explicitWorkspaceMembersCount:r.nullable(r.number().int()).optional(),orgSharingRole:r.nullable(r.string()).optional(),generatedName:r.nullable(r.string()).optional()}).transform(u=>(0,i.remap)(u,{createdAt:"created_at",updatedAt:"updated_at",ownerId:"owner_id",ownerType:"owner_type",totalSize:"total_size",nbDocuments:"nb_documents",chunkSize:"chunk_size",generatedDescription:"generated_description",explicitUserMembersCount:"explicit_user_members_count",explicitWorkspaceMembersCount:"explicit_workspace_members_count",orgSharingRole:"org_sharing_role",generatedName:"generated_name"}));var a;(function(u){u.inboundSchema=e.LibraryOut$inboundSchema,u.outboundSchema=e.LibraryOut$outboundSchema})(a||(e.LibraryOut$=a={}));function c(u){return JSON.stringify(e.LibraryOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibraryOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibraryOut' from JSON")}})(Af)),Af}var _f={},vf={},Cz;function vse(){return Cz||(Cz=1,(function(e){var t=vf&&vf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=vf&&vf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=vf&&vf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{total_items:"totalItems",total_pages:"totalPages",current_page:"currentPage",page_size:"pageSize",has_more:"hasMore"})),e.PaginationInfo$outboundSchema=r.object({totalItems:r.number().int(),totalPages:r.number().int(),currentPage:r.number().int(),pageSize:r.number().int(),hasMore:r.boolean()}).transform(u=>(0,i.remap)(u,{totalItems:"total_items",totalPages:"total_pages",currentPage:"current_page",pageSize:"page_size",hasMore:"has_more"}));var a;(function(u){u.inboundSchema=e.PaginationInfo$inboundSchema,u.outboundSchema=e.PaginationInfo$outboundSchema})(a||(e.PaginationInfo$=a={}));function c(u){return JSON.stringify(e.PaginationInfo$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.PaginationInfo$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'PaginationInfo' from JSON")}})(vf)),vf}var wz;function b4e(){return wz||(wz=1,(function(e){var t=_f&&_f.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=_f&&_f.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=_f&&_f.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.ListDocumentOut$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'ListDocumentOut' from JSON")}})(_f)),_f}var Sf={},Oz;function y4e(){return Oz||(Oz=1,(function(e){var t=Sf&&Sf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Sf&&Sf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Sf&&Sf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ListFilesOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ListFilesOut' from JSON")}})(Sf)),Sf}var Cf={},Tz;function A4e(){return Tz||(Tz=1,(function(e){var t=Cf&&Cf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Cf&&Cf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Cf&&Cf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ListLibraryOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ListLibraryOut' from JSON")}})(Cf)),Cf}var wf={},Of={},Rz;function Sse(){return Rz||(Rz=1,(function(e){var t=Of&&Of.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Of&&Of.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Of&&Of.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",user_id:"userId",org_id:"orgId",share_with_type:"shareWithType",share_with_uuid:"shareWithUuid"})),e.SharingOut$outboundSchema=r.object({libraryId:r.string(),userId:r.nullable(r.string()).optional(),orgId:r.string(),role:r.string(),shareWithType:r.string(),shareWithUuid:r.nullable(r.string())}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",userId:"user_id",orgId:"org_id",shareWithType:"share_with_type",shareWithUuid:"share_with_uuid"}));var a;(function(u){u.inboundSchema=e.SharingOut$inboundSchema,u.outboundSchema=e.SharingOut$outboundSchema})(a||(e.SharingOut$=a={}));function c(u){return JSON.stringify(e.SharingOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.SharingOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'SharingOut' from JSON")}})(Of)),Of}var Ez;function _4e(){return Ez||(Ez=1,(function(e){var t=wf&&wf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=wf&&wf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=wf&&wf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ListSharingOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ListSharingOut' from JSON")}})(wf)),wf}var Tf={},Mz;function v4e(){return Mz||(Mz=1,(function(e){var t=Tf&&Tf.__createBinding||(Object.create?(function(R,E,T,D){D===void 0&&(D=T);var B=Object.getOwnPropertyDescriptor(E,T);(!B||("get"in B?!E.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return E[T]}}),Object.defineProperty(R,D,B)}):(function(R,E,T,D){D===void 0&&(D=T),R[D]=E[T]})),n=Tf&&Tf.__setModuleDefault||(Object.create?(function(R,E){Object.defineProperty(R,"default",{enumerable:!0,value:E})}):function(R,E){R.default=E}),o=Tf&&Tf.__importStar||(function(){var R=function(E){return R=Object.getOwnPropertyNames||function(T){var D=[];for(var B in T)Object.prototype.hasOwnProperty.call(T,B)&&(D[D.length]=B);return D},R(E)};return function(E){if(E&&E.__esModule)return E;var T={};if(E!=null)for(var D=R(E),B=0;B({type:R.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))]),e.ModelConversationTools$outboundSchema=r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))]);var h;(function(R){R.inboundSchema=e.ModelConversationTools$inboundSchema,R.outboundSchema=e.ModelConversationTools$outboundSchema})(h||(e.ModelConversationTools$=h={}));function m(R){return JSON.stringify(e.ModelConversationTools$outboundSchema.parse(R))}function g(R){return(0,s.safeParse)(R,E=>e.ModelConversationTools$inboundSchema.parse(JSON.parse(E)),"Failed to parse 'ModelConversationTools' from JSON")}e.ModelConversationObject$inboundSchema=r.nativeEnum(e.ModelConversationObject),e.ModelConversationObject$outboundSchema=e.ModelConversationObject$inboundSchema;var y;(function(R){R.inboundSchema=e.ModelConversationObject$inboundSchema,R.outboundSchema=e.ModelConversationObject$outboundSchema})(y||(e.ModelConversationObject$=y={})),e.ModelConversation$inboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$inboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$inboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$inboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$inboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$inboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$inboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))])).optional(),completion_args:c.CompletionArgs$inboundSchema.optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),object:e.ModelConversationObject$inboundSchema.default("conversation"),id:r.string(),created_at:r.string().datetime({offset:!0}).transform(R=>new Date(R)),updated_at:r.string().datetime({offset:!0}).transform(R=>new Date(R)),model:r.string()}).transform(R=>(0,i.remap)(R,{completion_args:"completionArgs",created_at:"createdAt",updated_at:"updatedAt"})),e.ModelConversation$outboundSchema=r.object({instructions:r.nullable(r.string()).optional(),tools:r.array(r.union([p.DocumentLibraryTool$outboundSchema.and(r.object({type:r.literal("document_library")}).transform(R=>({type:R.type}))),u.FunctionTool$outboundSchema.and(r.object({type:r.literal("function")}).transform(R=>({type:R.type}))),a.CodeInterpreterTool$outboundSchema.and(r.object({type:r.literal("code_interpreter")}).transform(R=>({type:R.type}))),l.ImageGenerationTool$outboundSchema.and(r.object({type:r.literal("image_generation")}).transform(R=>({type:R.type}))),f.WebSearchTool$outboundSchema.and(r.object({type:r.literal("web_search")}).transform(R=>({type:R.type}))),d.WebSearchPremiumTool$outboundSchema.and(r.object({type:r.literal("web_search_premium")}).transform(R=>({type:R.type})))])).optional(),completionArgs:c.CompletionArgs$outboundSchema.optional(),name:r.nullable(r.string()).optional(),description:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),object:e.ModelConversationObject$outboundSchema.default("conversation"),id:r.string(),createdAt:r.date().transform(R=>R.toISOString()),updatedAt:r.date().transform(R=>R.toISOString()),model:r.string()}).transform(R=>(0,i.remap)(R,{completionArgs:"completion_args",createdAt:"created_at",updatedAt:"updated_at"}));var _;(function(R){R.inboundSchema=e.ModelConversation$inboundSchema,R.outboundSchema=e.ModelConversation$outboundSchema})(_||(e.ModelConversation$=_={}));function S(R){return JSON.stringify(e.ModelConversation$outboundSchema.parse(R))}function w(R){return(0,s.safeParse)(R,E=>e.ModelConversation$inboundSchema.parse(JSON.parse(E)),"Failed to parse 'ModelConversation' from JSON")}})(Tf)),Tf}var Rf={},Pz;function S4e(){return Pz||(Pz=1,(function(e){var t=Rf&&Rf.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Rf&&Rf.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Rf&&Rf.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_({type:h.type}))),s.BaseModelCard$inboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))]),e.Data$outboundSchema=r.union([a.FTModelCard$outboundSchema.and(r.object({type:r.literal("fine-tuned")}).transform(h=>({type:h.type}))),s.BaseModelCard$outboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))]);var c;(function(h){h.inboundSchema=e.Data$inboundSchema,h.outboundSchema=e.Data$outboundSchema})(c||(e.Data$=c={}));function p(h){return JSON.stringify(e.Data$outboundSchema.parse(h))}function u(h){return(0,i.safeParse)(h,m=>e.Data$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'Data' from JSON")}e.ModelList$inboundSchema=r.object({object:r.string().default("list"),data:r.array(r.union([a.FTModelCard$inboundSchema.and(r.object({type:r.literal("fine-tuned")}).transform(h=>({type:h.type}))),s.BaseModelCard$inboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))])).optional()}),e.ModelList$outboundSchema=r.object({object:r.string().default("list"),data:r.array(r.union([a.FTModelCard$outboundSchema.and(r.object({type:r.literal("fine-tuned")}).transform(h=>({type:h.type}))),s.BaseModelCard$outboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))])).optional()});var l;(function(h){h.inboundSchema=e.ModelList$inboundSchema,h.outboundSchema=e.ModelList$outboundSchema})(l||(e.ModelList$=l={}));function d(h){return JSON.stringify(e.ModelList$outboundSchema.parse(h))}function f(h){return(0,i.safeParse)(h,m=>e.ModelList$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'ModelList' from JSON")}})(Rf)),Rf}var Ef={},Iz;function Cse(){return Iz||(Iz=1,(function(e){var t=Ef&&Ef.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Ef&&Ef.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Ef&&Ef.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{category_scores:"categoryScores"})),e.ModerationObject$outboundSchema=r.object({categories:r.record(r.boolean()).optional(),categoryScores:r.record(r.number()).optional()}).transform(u=>(0,i.remap)(u,{categoryScores:"category_scores"}));var a;(function(u){u.inboundSchema=e.ModerationObject$inboundSchema,u.outboundSchema=e.ModerationObject$outboundSchema})(a||(e.ModerationObject$=a={}));function c(u){return JSON.stringify(e.ModerationObject$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ModerationObject$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ModerationObject' from JSON")}})(Ef)),Ef}var Mf={},jz;function C4e(){return jz||(jz=1,(function(e){var t=Mf&&Mf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Mf&&Mf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Mf&&Mf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.ModerationResponse$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ModerationResponse' from JSON")}})(Mf)),Mf}var Pf={},Dz;function wse(){return Dz||(Dz=1,(function(e){var t=Pf&&Pf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Pf&&Pf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Pf&&Pf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{top_left_x:"topLeftX",top_left_y:"topLeftY",bottom_right_x:"bottomRightX",bottom_right_y:"bottomRightY",image_base64:"imageBase64",image_annotation:"imageAnnotation"})),e.OCRImageObject$outboundSchema=r.object({id:r.string(),topLeftX:r.nullable(r.number().int()),topLeftY:r.nullable(r.number().int()),bottomRightX:r.nullable(r.number().int()),bottomRightY:r.nullable(r.number().int()),imageBase64:r.nullable(r.string()).optional(),imageAnnotation:r.nullable(r.string()).optional()}).transform(u=>(0,i.remap)(u,{topLeftX:"top_left_x",topLeftY:"top_left_y",bottomRightX:"bottom_right_x",bottomRightY:"bottom_right_y",imageBase64:"image_base64",imageAnnotation:"image_annotation"}));var a;(function(u){u.inboundSchema=e.OCRImageObject$inboundSchema,u.outboundSchema=e.OCRImageObject$outboundSchema})(a||(e.OCRImageObject$=a={}));function c(u){return JSON.stringify(e.OCRImageObject$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.OCRImageObject$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'OCRImageObject' from JSON")}})(Pf)),Pf}var If={},Nz;function Ose(){return Nz||(Nz=1,(function(e){var t=If&&If.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=If&&If.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=If&&If.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.OCRPageDimensions$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'OCRPageDimensions' from JSON")}})(If)),If}var jf={},Df={},Lz;function Tse(){return Lz||(Lz=1,(function(e){var t=Df&&Df.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Df&&Df.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Df&&Df.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.OCRTableObject$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'OCRTableObject' from JSON")}})(Df)),Df}var Fz;function Rse(){return Fz||(Fz=1,(function(e){var t=jf&&jf.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=jf&&jf.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=jf&&jf.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;ge.OCRPageObject$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'OCRPageObject' from JSON")}})(jf)),jf}var Nf={},xz;function w4e(){return xz||(xz=1,(function(e){var t=Nf&&Nf.__createBinding||(Object.create?(function(_,S,w,R){R===void 0&&(R=w);var E=Object.getOwnPropertyDescriptor(S,w);(!E||("get"in E?!S.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return S[w]}}),Object.defineProperty(_,R,E)}):(function(_,S,w,R){R===void 0&&(R=w),_[R]=S[w]})),n=Nf&&Nf.__setModuleDefault||(Object.create?(function(_,S){Object.defineProperty(_,"default",{enumerable:!0,value:S})}):function(_,S){_.default=S}),o=Nf&&Nf.__importStar||(function(){var _=function(S){return _=Object.getOwnPropertyNames||function(w){var R=[];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[R.length]=E);return R},_(S)};return function(S){if(S&&S.__esModule)return S;var w={};if(S!=null)for(var R=_(S),E=0;Ee.Document$inboundSchema.parse(JSON.parse(S)),"Failed to parse 'Document' from JSON")}e.TableFormat$inboundSchema=r.nativeEnum(e.TableFormat),e.TableFormat$outboundSchema=e.TableFormat$inboundSchema;var h;(function(_){_.inboundSchema=e.TableFormat$inboundSchema,_.outboundSchema=e.TableFormat$outboundSchema})(h||(e.TableFormat$=h={})),e.OCRRequest$inboundSchema=r.object({model:r.nullable(r.string()),id:r.string().optional(),document:r.union([c.FileChunk$inboundSchema,a.DocumentURLChunk$inboundSchema,p.ImageURLChunk$inboundSchema]),pages:r.nullable(r.array(r.number().int())).optional(),include_image_base64:r.nullable(r.boolean()).optional(),image_limit:r.nullable(r.number().int()).optional(),image_min_size:r.nullable(r.number().int()).optional(),bbox_annotation_format:r.nullable(u.ResponseFormat$inboundSchema).optional(),document_annotation_format:r.nullable(u.ResponseFormat$inboundSchema).optional(),table_format:r.nullable(e.TableFormat$inboundSchema).optional(),extract_header:r.boolean().optional(),extract_footer:r.boolean().optional()}).transform(_=>(0,i.remap)(_,{include_image_base64:"includeImageBase64",image_limit:"imageLimit",image_min_size:"imageMinSize",bbox_annotation_format:"bboxAnnotationFormat",document_annotation_format:"documentAnnotationFormat",table_format:"tableFormat",extract_header:"extractHeader",extract_footer:"extractFooter"})),e.OCRRequest$outboundSchema=r.object({model:r.nullable(r.string()),id:r.string().optional(),document:r.union([c.FileChunk$outboundSchema,a.DocumentURLChunk$outboundSchema,p.ImageURLChunk$outboundSchema]),pages:r.nullable(r.array(r.number().int())).optional(),includeImageBase64:r.nullable(r.boolean()).optional(),imageLimit:r.nullable(r.number().int()).optional(),imageMinSize:r.nullable(r.number().int()).optional(),bboxAnnotationFormat:r.nullable(u.ResponseFormat$outboundSchema).optional(),documentAnnotationFormat:r.nullable(u.ResponseFormat$outboundSchema).optional(),tableFormat:r.nullable(e.TableFormat$outboundSchema).optional(),extractHeader:r.boolean().optional(),extractFooter:r.boolean().optional()}).transform(_=>(0,i.remap)(_,{includeImageBase64:"include_image_base64",imageLimit:"image_limit",imageMinSize:"image_min_size",bboxAnnotationFormat:"bbox_annotation_format",documentAnnotationFormat:"document_annotation_format",tableFormat:"table_format",extractHeader:"extract_header",extractFooter:"extract_footer"}));var m;(function(_){_.inboundSchema=e.OCRRequest$inboundSchema,_.outboundSchema=e.OCRRequest$outboundSchema})(m||(e.OCRRequest$=m={}));function g(_){return JSON.stringify(e.OCRRequest$outboundSchema.parse(_))}function y(_){return(0,s.safeParse)(_,S=>e.OCRRequest$inboundSchema.parse(JSON.parse(S)),"Failed to parse 'OCRRequest' from JSON")}})(Nf)),Nf}var Lf={},Ff={},Bz;function Ese(){return Bz||(Bz=1,(function(e){var t=Ff&&Ff.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Ff&&Ff.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Ff&&Ff.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{pages_processed:"pagesProcessed",doc_size_bytes:"docSizeBytes"})),e.OCRUsageInfo$outboundSchema=r.object({pagesProcessed:r.number().int(),docSizeBytes:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{pagesProcessed:"pages_processed",docSizeBytes:"doc_size_bytes"}));var a;(function(u){u.inboundSchema=e.OCRUsageInfo$inboundSchema,u.outboundSchema=e.OCRUsageInfo$outboundSchema})(a||(e.OCRUsageInfo$=a={}));function c(u){return JSON.stringify(e.OCRUsageInfo$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.OCRUsageInfo$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'OCRUsageInfo' from JSON")}})(Ff)),Ff}var kz;function O4e(){return kz||(kz=1,(function(e){var t=Lf&&Lf.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Lf&&Lf.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Lf&&Lf.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;g(0,i.remap)(d,{document_annotation:"documentAnnotation",usage_info:"usageInfo"})),e.OCRResponse$outboundSchema=r.object({pages:r.array(a.OCRPageObject$outboundSchema),model:r.string(),documentAnnotation:r.nullable(r.string()).optional(),usageInfo:c.OCRUsageInfo$outboundSchema}).transform(d=>(0,i.remap)(d,{documentAnnotation:"document_annotation",usageInfo:"usage_info"}));var p;(function(d){d.inboundSchema=e.OCRResponse$inboundSchema,d.outboundSchema=e.OCRResponse$outboundSchema})(p||(e.OCRResponse$=p={}));function u(d){return JSON.stringify(e.OCRResponse$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.OCRResponse$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'OCRResponse' from JSON")}})(Lf)),Lf}var xf={},Uz;function T4e(){return Uz||(Uz=1,(function(e){var t=xf&&xf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=xf&&xf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=xf&&xf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{document_id:"documentId",processing_status:"processingStatus"})),e.ProcessingStatusOut$outboundSchema=r.object({documentId:r.string(),processingStatus:r.string()}).transform(u=>(0,i.remap)(u,{documentId:"document_id",processingStatus:"processing_status"}));var a;(function(u){u.inboundSchema=e.ProcessingStatusOut$inboundSchema,u.outboundSchema=e.ProcessingStatusOut$outboundSchema})(a||(e.ProcessingStatusOut$=a={}));function c(u){return JSON.stringify(e.ProcessingStatusOut$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.ProcessingStatusOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'ProcessingStatusOut' from JSON")}})(xf)),xf}var Bf={},qz;function R4e(){return qz||(qz=1,(function(e){var t=Bf&&Bf.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Bf&&Bf.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Bf&&Bf.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(f,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"})),e.RetrieveFileOut$outboundSchema=r.object({id:r.string(),object:r.string(),sizeBytes:r.number().int(),createdAt:r.number().int(),filename:r.string(),purpose:a.FilePurpose$outboundSchema,sampleType:c.SampleType$outboundSchema,numLines:r.nullable(r.number().int()).optional(),mimetype:r.nullable(r.string()).optional(),source:p.Source$outboundSchema,signature:r.nullable(r.string()).optional(),deleted:r.boolean()}).transform(f=>(0,i.remap)(f,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var u;(function(f){f.inboundSchema=e.RetrieveFileOut$inboundSchema,f.outboundSchema=e.RetrieveFileOut$outboundSchema})(u||(e.RetrieveFileOut$=u={}));function l(f){return JSON.stringify(e.RetrieveFileOut$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.RetrieveFileOut$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'RetrieveFileOut' from JSON")}})(kf)),kf}var Uf={},Vz;function M4e(){return Vz||(Vz=1,(function(e){var t=Uf&&Uf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Uf&&Uf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Uf&&Uf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{ApiKey:"apiKey"})),e.Security$outboundSchema=r.object({apiKey:r.string().optional()}).transform(u=>(0,i.remap)(u,{apiKey:"ApiKey"}));var a;(function(u){u.inboundSchema=e.Security$inboundSchema,u.outboundSchema=e.Security$outboundSchema})(a||(e.Security$=a={}));function c(u){return JSON.stringify(e.Security$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.Security$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'Security' from JSON")}})(Uf)),Uf}var qf={},Hz;function Mse(){return Hz||(Hz=1,(function(e){var t=qf&&qf.__createBinding||(Object.create?(function(a,c,p,u){u===void 0&&(u=p);var l=Object.getOwnPropertyDescriptor(c,p);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(a,u,l)}):(function(a,c,p,u){u===void 0&&(u=p),a[u]=c[p]})),n=qf&&qf.__setModuleDefault||(Object.create?(function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}):function(a,c){a.default=c}),o=qf&&qf.__importStar||(function(){var a=function(c){return a=Object.getOwnPropertyNames||function(p){var u=[];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(u[u.length]=l);return u},a(c)};return function(c){if(c&&c.__esModule)return c;var p={};if(c!=null)for(var u=a(c),l=0;l(0,i.remap)(l,{org_id:"orgId",share_with_uuid:"shareWithUuid",share_with_type:"shareWithType"})),e.SharingDelete$outboundSchema=r.object({orgId:r.nullable(r.string()).optional(),shareWithUuid:r.string(),shareWithType:a.EntityType$outboundSchema}).transform(l=>(0,i.remap)(l,{orgId:"org_id",shareWithUuid:"share_with_uuid",shareWithType:"share_with_type"}));var c;(function(l){l.inboundSchema=e.SharingDelete$inboundSchema,l.outboundSchema=e.SharingDelete$outboundSchema})(c||(e.SharingDelete$=c={}));function p(l){return JSON.stringify(e.SharingDelete$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.SharingDelete$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'SharingDelete' from JSON")}})(Jf)),Jf}var Vf={},zz;function I4e(){return zz||(zz=1,(function(e){var t=Vf&&Vf.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Vf&&Vf.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Vf&&Vf.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;g(0,i.remap)(d,{org_id:"orgId",share_with_uuid:"shareWithUuid",share_with_type:"shareWithType"})),e.SharingIn$outboundSchema=r.object({orgId:r.nullable(r.string()).optional(),level:c.ShareEnum$outboundSchema,shareWithUuid:r.string(),shareWithType:a.EntityType$outboundSchema}).transform(d=>(0,i.remap)(d,{orgId:"org_id",shareWithUuid:"share_with_uuid",shareWithType:"share_with_type"}));var p;(function(d){d.inboundSchema=e.SharingIn$inboundSchema,d.outboundSchema=e.SharingIn$outboundSchema})(p||(e.SharingIn$=p={}));function u(d){return JSON.stringify(e.SharingIn$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.SharingIn$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'SharingIn' from JSON")}})(Vf)),Vf}var Hf={},Gf={},Kz;function sB(){return Kz||(Kz=1,(function(e){var t=Gf&&Gf.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Gf&&Gf.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Gf&&Gf.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m({...l.additionalProperties,...(0,i.remap)(l,{additionalProperties:null})}));var c;(function(l){l.inboundSchema=e.TranscriptionSegmentChunk$inboundSchema,l.outboundSchema=e.TranscriptionSegmentChunk$outboundSchema})(c||(e.TranscriptionSegmentChunk$=c={}));function p(l){return JSON.stringify(e.TranscriptionSegmentChunk$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.TranscriptionSegmentChunk$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'TranscriptionSegmentChunk' from JSON")}})(Gf)),Gf}var Qz;function j4e(){return Qz||(Qz=1,(function(e){var t=Hf&&Hf.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=Hf&&Hf.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=Hf&&Hf.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;g({...d.additionalProperties,...(0,i.remap)(d,{additionalProperties:null})}));var p;(function(d){d.inboundSchema=e.TranscriptionResponse$inboundSchema,d.outboundSchema=e.TranscriptionResponse$outboundSchema})(p||(e.TranscriptionResponse$=p={}));function u(d){return JSON.stringify(e.TranscriptionResponse$outboundSchema.parse(d))}function l(d){return(0,s.safeParse)(d,f=>e.TranscriptionResponse$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'TranscriptionResponse' from JSON")}})(Hf)),Hf}var zf={},$z;function Pse(){return $z||($z=1,(function(e){var t=zf&&zf.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=zf&&zf.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=zf&&zf.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y({...f.additionalProperties,...(0,i.remap)(f,{additionalProperties:null})}));var u;(function(f){f.inboundSchema=e.TranscriptionStreamDone$inboundSchema,f.outboundSchema=e.TranscriptionStreamDone$outboundSchema})(u||(e.TranscriptionStreamDone$=u={}));function l(f){return JSON.stringify(e.TranscriptionStreamDone$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.TranscriptionStreamDone$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'TranscriptionStreamDone' from JSON")}})(zf)),zf}var Kf={},Qf={},Wz;function Ise(){return Wz||(Wz=1,(function(e){var t=Qf&&Qf.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=Qf&&Qf.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=Qf&&Qf.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;u(0,i.remap)(l,{audio_language:"audioLanguage"})),e.TranscriptionStreamLanguage$outboundSchema=r.object({type:e.TranscriptionStreamLanguageType$outboundSchema.default("transcription.language"),audioLanguage:r.string(),additionalProperties:r.record(r.any())}).transform(l=>({...l.additionalProperties,...(0,i.remap)(l,{audioLanguage:"audio_language",additionalProperties:null})}));var c;(function(l){l.inboundSchema=e.TranscriptionStreamLanguage$inboundSchema,l.outboundSchema=e.TranscriptionStreamLanguage$outboundSchema})(c||(e.TranscriptionStreamLanguage$=c={}));function p(l){return JSON.stringify(e.TranscriptionStreamLanguage$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.TranscriptionStreamLanguage$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'TranscriptionStreamLanguage' from JSON")}})($f)),$f}var Wf={},Xz;function Dse(){return Xz||(Xz=1,(function(e){var t=Wf&&Wf.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Wf&&Wf.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Wf&&Wf.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m({...l.additionalProperties,...(0,i.remap)(l,{additionalProperties:null})}));var c;(function(l){l.inboundSchema=e.TranscriptionStreamSegmentDelta$inboundSchema,l.outboundSchema=e.TranscriptionStreamSegmentDelta$outboundSchema})(c||(e.TranscriptionStreamSegmentDelta$=c={}));function p(l){return JSON.stringify(e.TranscriptionStreamSegmentDelta$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.TranscriptionStreamSegmentDelta$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'TranscriptionStreamSegmentDelta' from JSON")}})(Wf)),Wf}var Yf={},Zz;function Nse(){return Zz||(Zz=1,(function(e){var t=Yf&&Yf.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Yf&&Yf.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Yf&&Yf.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m({...l.additionalProperties,...(0,i.remap)(l,{additionalProperties:null})}));var c;(function(l){l.inboundSchema=e.TranscriptionStreamTextDelta$inboundSchema,l.outboundSchema=e.TranscriptionStreamTextDelta$outboundSchema})(c||(e.TranscriptionStreamTextDelta$=c={}));function p(l){return JSON.stringify(e.TranscriptionStreamTextDelta$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.TranscriptionStreamTextDelta$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'TranscriptionStreamTextDelta' from JSON")}})(Yf)),Yf}var e9;function D4e(){return e9||(e9=1,(function(e){var t=Kf&&Kf.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),n=Kf&&Kf.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),o=Kf&&Kf.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;R({type:y.type}))),p.TranscriptionStreamSegmentDelta$inboundSchema.and(r.object({type:r.literal("transcription.segment")}).transform(y=>({type:y.type}))),c.TranscriptionStreamLanguage$inboundSchema.and(r.object({type:r.literal("transcription.language")}).transform(y=>({type:y.type}))),u.TranscriptionStreamTextDelta$inboundSchema.and(r.object({type:r.literal("transcription.text.delta")}).transform(y=>({type:y.type})))]),e.TranscriptionStreamEventsData$outboundSchema=r.union([s.TranscriptionStreamDone$outboundSchema.and(r.object({type:r.literal("transcription.done")}).transform(y=>({type:y.type}))),p.TranscriptionStreamSegmentDelta$outboundSchema.and(r.object({type:r.literal("transcription.segment")}).transform(y=>({type:y.type}))),c.TranscriptionStreamLanguage$outboundSchema.and(r.object({type:r.literal("transcription.language")}).transform(y=>({type:y.type}))),u.TranscriptionStreamTextDelta$outboundSchema.and(r.object({type:r.literal("transcription.text.delta")}).transform(y=>({type:y.type})))]);var l;(function(y){y.inboundSchema=e.TranscriptionStreamEventsData$inboundSchema,y.outboundSchema=e.TranscriptionStreamEventsData$outboundSchema})(l||(e.TranscriptionStreamEventsData$=l={}));function d(y){return JSON.stringify(e.TranscriptionStreamEventsData$outboundSchema.parse(y))}function f(y){return(0,i.safeParse)(y,_=>e.TranscriptionStreamEventsData$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'TranscriptionStreamEventsData' from JSON")}e.TranscriptionStreamEvents$inboundSchema=r.object({event:a.TranscriptionStreamEventTypes$inboundSchema,data:r.string().transform((y,_)=>{try{return JSON.parse(y)}catch(S){return _.addIssue({code:r.ZodIssueCode.custom,message:`malformed json: ${S}`}),r.NEVER}}).pipe(r.union([s.TranscriptionStreamDone$inboundSchema.and(r.object({type:r.literal("transcription.done")}).transform(y=>({type:y.type}))),p.TranscriptionStreamSegmentDelta$inboundSchema.and(r.object({type:r.literal("transcription.segment")}).transform(y=>({type:y.type}))),c.TranscriptionStreamLanguage$inboundSchema.and(r.object({type:r.literal("transcription.language")}).transform(y=>({type:y.type}))),u.TranscriptionStreamTextDelta$inboundSchema.and(r.object({type:r.literal("transcription.text.delta")}).transform(y=>({type:y.type})))]))}),e.TranscriptionStreamEvents$outboundSchema=r.object({event:a.TranscriptionStreamEventTypes$outboundSchema,data:r.union([s.TranscriptionStreamDone$outboundSchema.and(r.object({type:r.literal("transcription.done")}).transform(y=>({type:y.type}))),p.TranscriptionStreamSegmentDelta$outboundSchema.and(r.object({type:r.literal("transcription.segment")}).transform(y=>({type:y.type}))),c.TranscriptionStreamLanguage$outboundSchema.and(r.object({type:r.literal("transcription.language")}).transform(y=>({type:y.type}))),u.TranscriptionStreamTextDelta$outboundSchema.and(r.object({type:r.literal("transcription.text.delta")}).transform(y=>({type:y.type})))])});var h;(function(y){y.inboundSchema=e.TranscriptionStreamEvents$inboundSchema,y.outboundSchema=e.TranscriptionStreamEvents$outboundSchema})(h||(e.TranscriptionStreamEvents$=h={}));function m(y){return JSON.stringify(e.TranscriptionStreamEvents$outboundSchema.parse(y))}function g(y){return(0,i.safeParse)(y,_=>e.TranscriptionStreamEvents$inboundSchema.parse(JSON.parse(_)),"Failed to parse 'TranscriptionStreamEvents' from JSON")}})(Kf)),Kf}var Xf={},t9;function N4e(){return t9||(t9=1,(function(e){var t=Xf&&Xf.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Xf&&Xf.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Xf&&Xf.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;he.UnarchiveFTModelOut$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'UnarchiveFTModelOut' from JSON")}})(Xf)),Xf}var Zf={},n9;function L4e(){return n9||(n9=1,(function(e){var t=Zf&&Zf.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=Zf&&Zf.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=Zf&&Zf.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fe.UpdateFTModelIn$inboundSchema.parse(JSON.parse(u)),"Failed to parse 'UpdateFTModelIn' from JSON")}})(Zf)),Zf}var eh={},r9;function F4e(){return r9||(r9=1,(function(e){var t=eh&&eh.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=eh&&eh.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=eh&&eh.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y(0,i.remap)(f,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"})),e.UploadFileOut$outboundSchema=r.object({id:r.string(),object:r.string(),sizeBytes:r.number().int(),createdAt:r.number().int(),filename:r.string(),purpose:a.FilePurpose$outboundSchema,sampleType:c.SampleType$outboundSchema,numLines:r.nullable(r.number().int()).optional(),mimetype:r.nullable(r.string()).optional(),source:p.Source$outboundSchema,signature:r.nullable(r.string()).optional()}).transform(f=>(0,i.remap)(f,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var u;(function(f){f.inboundSchema=e.UploadFileOut$inboundSchema,f.outboundSchema=e.UploadFileOut$outboundSchema})(u||(e.UploadFileOut$=u={}));function l(f){return JSON.stringify(e.UploadFileOut$outboundSchema.parse(f))}function d(f){return(0,s.safeParse)(f,h=>e.UploadFileOut$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'UploadFileOut' from JSON")}})(eh)),eh}var th={},o9;function x4e(){return o9||(o9=1,(function(e){var t=th&&th.__createBinding||(Object.create?(function(d,f,h,m){m===void 0&&(m=h);var g=Object.getOwnPropertyDescriptor(f,h);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(d,m,g)}):(function(d,f,h,m){m===void 0&&(m=h),d[m]=f[h]})),n=th&&th.__setModuleDefault||(Object.create?(function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}):function(d,f){d.default=f}),o=th&&th.__importStar||(function(){var d=function(f){return d=Object.getOwnPropertyNames||function(h){var m=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(m[m.length]=g);return m},d(f)};return function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m=d(f),g=0;ge.Loc$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'Loc' from JSON")}e.ValidationError$inboundSchema=r.object({loc:r.array(r.union([r.string(),r.number().int()])),msg:r.string(),type:r.string()}),e.ValidationError$outboundSchema=r.object({loc:r.array(r.union([r.string(),r.number().int()])),msg:r.string(),type:r.string()});var p;(function(d){d.inboundSchema=e.ValidationError$inboundSchema,d.outboundSchema=e.ValidationError$outboundSchema})(p||(e.ValidationError$=p={}));function u(d){return JSON.stringify(e.ValidationError$outboundSchema.parse(d))}function l(d){return(0,i.safeParse)(d,f=>e.ValidationError$inboundSchema.parse(JSON.parse(f)),"Failed to parse 'ValidationError' from JSON")}})(th)),th}var i9;function xe(){return i9||(i9=1,(function(e){var t=dg&&dg.__createBinding||(Object.create?(function(o,r,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(r,i);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,s,a)}):(function(o,r,i,s){s===void 0&&(s=i),o[s]=r[i]})),n=dg&&dg.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Cqe(),e),n(wqe(),e),n(Oqe(),e),n(Oie(),e),n(aP(),e),n(Tie(),e),n(Tqe(),e),n(Rqe(),e),n(Eqe(),e),n(jie(),e),n(Mqe(),e),n(bp(),e),n(Rie(),e),n(Pqe(),e),n(Iqe(),e),n(Die(),e),n(Nie(),e),n(jqe(),e),n(Fie(),e),n(Dqe(),e),n(Lie(),e),n(lb(),e),n(Nqe(),e),n(Kx(),e),n(Lqe(),e),n(Fqe(),e),n(xqe(),e),n(Bqe(),e),n(Qx(),e),n(kqe(),e),n(Uqe(),e),n(Uie(),e),n(qqe(),e),n(Jqe(),e),n(qie(),e),n(Jie(),e),n(Wx(),e),n(Yx(),e),n(Vie(),e),n(eb(),e),n(Ps(),e),n(Sie(),e),n(zie(),e),n(Vqe(),e),n(Hqe(),e),n(Gqe(),e),n(Kie(),e),n(Gie(),e),n(eB(),e),n(Qie(),e),n(BC(),e),n(zqe(),e),n(Kqe(),e),n(Qqe(),e),n($qe(),e),n(cb(),e),n(Wqe(),e),n(Yqe(),e),n(Xqe(),e),n(Zqe(),e),n(e4e(),e),n(t4e(),e),n(oB(),e),n(n4e(),e),n(r4e(),e),n(Hie(),e),n(nb(),e),n(cse(),e),n(o4e(),e),n(i4e(),e),n(JA(),e),n(dse(),e),n(s4e(),e),n(a4e(),e),n(hse(),e),n(fse(),e),n(iB(),e),n(Xx(),e),n(Hx(),e),n(qx(),e),n(hP(),e),n(pse(),e),n(l4e(),e),n(u4e(),e),n(c4e(),e),n(d4e(),e),n(mse(),e),n($x(),e),n(Zx(),e),n(gse(),e),n(Ux(),e),n(Mie(),e),n(uP(),e),n($ie(),e),n(Zie(),e),n(Iie(),e),n(nB(),e),n(rb(),e),n(bse(),e),n(tB(),e),n(ob(),e),n(Eie(),e),n(VA(),e),n(Xie(),e),n(Bie(),e),n(xie(),e),n(f4e(),e),n(JC(),e),n(h4e(),e),n(Cie(),e),n(p4e(),e),n(m4e(),e),n(g4e(),e),n(_se(),e),n(b4e(),e),n(y4e(),e),n(A4e(),e),n(_4e(),e),n(use(),e),n(Wie(),e),n(dP(),e),n(Yie(),e),n(HC(),e),n(tse(),e),n(kie(),e),n(kC(),e),n(zx(),e),n(v4e(),e),n(S4e(),e),n(Cse(),e),n(C4e(),e),n(wse(),e),n(Ose(),e),n(Rse(),e),n(w4e(),e),n(O4e(),e),n(Tse(),e),n(Ese(),e),n(ese(),e),n(vse(),e),n(UA(),e),n(T4e(),e),n(Jx(),e),n(R4e(),e),n(nse(),e),n(rse(),e),n(tb(),e),n(wie(),e),n(ose(),e),n(E4e(),e),n(pP(),e),n(M4e(),e),n(Mse(),e),n(P4e(),e),n(I4e(),e),n(Sse(),e),n(mP(),e),n(ise(),e),n(Mm(),e),n(Pie(),e),n(ab(),e),n(HA(),e),n(Gx(),e),n(UC(),e),n(Vx(),e),n(qC(),e),n(qA(),e),n(sse(),e),n(ase(),e),n(fP(),e),n(lse(),e),n(cP(),e),n(Pm(),e),n(rB(),e),n(lP(),e),n(yse(),e),n(j4e(),e),n(sB(),e),n(Pse(),e),n(D4e(),e),n(Ise(),e),n(jse(),e),n(Dse(),e),n(Nse(),e),n(N4e(),e),n(L4e(),e),n(F4e(),e),n(ub(),e),n(Im(),e),n(x4e(),e),n(Ase(),e),n(VC(),e),n(ib(),e),n(sb(),e)})(dg)),dg}var fg={},nh={},s9;function B4e(){return s9||(s9=1,(function(e){var t=nh&&nh.__createBinding||(Object.create?(function(p,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(p,d,f)}):(function(p,u,l,d){d===void 0&&(d=l),p[d]=u[l]})),n=nh&&nh.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),o=nh&&nh.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(l){var d=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(d[d.length]=f);return d},p(u)};return function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var d=p(u),f=0;fnew a(p,{request:p.request$,response:p.response$,body:p.body$})),e.HTTPValidationError$outboundSchema=r.instanceof(a).transform(p=>p.data$).pipe(r.object({detail:r.array(i.ValidationError$outboundSchema).optional()}));var c;(function(p){p.inboundSchema=e.HTTPValidationError$inboundSchema,p.outboundSchema=e.HTTPValidationError$outboundSchema})(c||(e.HTTPValidationError$=c={}))})(nh)),nh}var a9;function yt(){return a9||(a9=1,(function(e){var t=fg&&fg.__createBinding||(Object.create?(function(o,r,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(r,i);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,s,a)}):(function(o,r,i,s){s===void 0&&(s=i),o[s]=r[i]})),n=fg&&fg.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(hie(),e),n(B4e(),e),n(_ie(),e),n(vie(),e),n(kx(),e)})(fg)),fg}var rh={},l9;function Ke(){if(l9)return rh;l9=1;var e=rh&&rh.__classPrivateFieldSet||function(s,a,c,p,u){if(p==="m")throw new TypeError("Private method is not writable");if(p==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof a=="function"?s!==a||!u:!a.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p==="a"?u.call(s,c):u?u.value=c:a.set(s,c),c},t=rh&&rh.__classPrivateFieldGet||function(s,a,c,p){if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?s!==a||!p:!a.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?p:c==="a"?p.call(s):p?p.value:a.get(s)},n,o,r;Object.defineProperty(rh,"__esModule",{value:!0}),rh.APIPromise=void 0;class i{constructor(a){n.set(this,void 0),o.set(this,void 0),this[r]="APIPromise",e(this,n,a instanceof Promise?a:Promise.resolve(a),"f"),e(this,o,a instanceof Promise?t(this,n,"f").then(([c])=>c):Promise.resolve(a[0]),"f")}then(a,c){return t(this,n,"f").then(a?([p])=>a(p):void 0,c)}catch(a){return t(this,o,"f").catch(a)}finally(a){return t(this,o,"f").finally(a)}$inspect(){return t(this,n,"f")}}return rh.APIPromise=i,n=new WeakMap,o=new WeakMap,r=Symbol.toStringTag,rh}var u9;function k4e(){if(u9)return $s;u9=1;var e=$s&&$s.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=$s&&$s.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=$s&&$s.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.AgentsCompletionRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/agents/completions")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"agents_completion_v1_agents_completions_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ChatCompletionResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return $s}var Ys={},Ov={},c9;function db(){if(c9)return Ov;c9=1,Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.EventStream=void 0;class e extends ReadableStream{constructor(i,s){const a=i.getReader();let c=new Uint8Array;super({async pull(p){try{for(;;){const u=n(c);if(!u){const f=await a.read();if(f.done)return p.close();c=t(c,f.value);continue}const l=c.slice(0,u.index);c=c.slice(u.index+u.length);const d=o(l,s);if(d?.value)return p.enqueue(d.value);if(d?.done)return await a.cancel("done"),p.close()}}catch(u){p.error(u),await a.cancel(u)}},cancel:p=>a.cancel(p)})}[Symbol.asyncIterator](){const i=ReadableStream.prototype[Symbol.asyncIterator];if(typeof i=="function")return i.call(this);const s=this.getReader();return{next:async()=>{const a=await s.read();return a.done?(s.releaseLock(),{done:!0,value:void 0}):{done:!1,value:a.value}},throw:async a=>(await s.cancel(a),s.releaseLock(),{done:!0,value:void 0}),return:async()=>(await s.cancel("done"),s.releaseLock(),{done:!0,value:void 0}),[Symbol.asyncIterator](){return this}}}}Ov.EventStream=e;function t(r,i){const s=new Uint8Array(r.length+i.length);return s.set(r,0),s.set(i,r.length),s}function n(r){const i=r.length;for(let s=0;sl.AgentsCompletionStreamRequest$outboundSchema.parse(Q),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=(0,r.encodeJSON)("body",w,{explode:!0}),E=(0,u.pathToFunc)("/v1/agents/completions#stream")(),T=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),D=await(0,p.extractSecurity)(g._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,p.resolveGlobalSecurity)(B),L={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"stream_agents",oAuth2Scopes:[],resolvedSecurity:N,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},q=g._createRequest(L,{security:N,method:"POST",baseURL:_?.serverURL,path:E,headers:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await g._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(Q=>new i.EventStream(Q,le=>le.data==="[DONE]"?{done:!0}:{value:l.CompletionEvent$inboundSchema.parse(le)}))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ys}var f9;function q4e(){if(f9)return Sv;f9=1,Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.Agents=void 0;const e=k4e(),t=U4e(),n=Gn(),o=Ar();class r extends n.ClientSDK{async complete(s,a){return(0,o.unwrapAsync)((0,e.agentsComplete)(this,s,a))}async stream(s,a){return(0,o.unwrapAsync)((0,t.agentsStream)(this,s,a))}}return Sv.Agents=r,Sv}var Tv={},Rv={},Xs={},vT={},h9;function gP(){if(h9)return vT;h9=1,Object.defineProperty(vT,"__esModule",{value:!0}),vT.isReadableStream=e;function e(t){if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.getReader=="function"&&typeof n.cancel=="function"&&typeof n.tee=="function"}return vT}var p9;function J4e(){if(p9)return Xs;p9=1;var e=Xs&&Xs.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),t=Xs&&Xs.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),n=Xs&&Xs.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;wu.AudioTranscriptionRequest$outboundSchema.parse(G),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=new FormData;if((0,o.appendForm)(R,"model",w.model),w.file!==void 0)if((0,d.isBlobLike)(w.file))(0,o.appendForm)(R,"file",w.file);else if((0,f.isReadableStream)(w.file.content)){const G=await(0,r.readableStreamToArrayBuffer)(w.file.content),Q=(0,r.getContentTypeFromFileName)(w.file.fileName)||"application/octet-stream",le=new Blob([G],{type:Q});(0,o.appendForm)(R,"file",le,w.file.fileName)}else{const G=(0,r.getContentTypeFromFileName)(w.file.fileName)||"application/octet-stream";(0,o.appendForm)(R,"file",new Blob([w.file.content],{type:G}),w.file.fileName)}w.file_id!==void 0&&(0,o.appendForm)(R,"file_id",w.file_id),w.file_url!==void 0&&(0,o.appendForm)(R,"file_url",w.file_url),w.language!==void 0&&(0,o.appendForm)(R,"language",w.language),w.stream!==void 0&&(0,o.appendForm)(R,"stream",w.stream),w.temperature!==void 0&&(0,o.appendForm)(R,"temperature",w.temperature),w.timestamp_granularities!==void 0&&(0,o.appendForm)(R,"timestamp_granularities",w.timestamp_granularities);const E=(0,p.pathToFunc)("/v1/audio/transcriptions")(),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(g._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"audio_api_v1_transcriptions_post",oAuth2Scopes:[],resolvedSecurity:N,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},q=g._createRequest(L,{security:N,method:"POST",baseURL:_?.serverURL,path:E,headers:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await g._do(I,{context:L,errorCodes:["4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,[V]=await i.match(i.json(200,u.TranscriptionResponse$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I);return V.ok?[V,{status:"complete",request:I,response:J}]:[V,{status:"complete",request:I,response:J}]}return Xs}var Zs={},m9;function V4e(){if(m9)return Zs;m9=1;var e=Zs&&Zs.__createBinding||(Object.create?(function(_,S,w,R){R===void 0&&(R=w);var E=Object.getOwnPropertyDescriptor(S,w);(!E||("get"in E?!S.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return S[w]}}),Object.defineProperty(_,R,E)}):(function(_,S,w,R){R===void 0&&(R=w),_[R]=S[w]})),t=Zs&&Zs.__setModuleDefault||(Object.create?(function(_,S){Object.defineProperty(_,"default",{enumerable:!0,value:S})}):function(_,S){_.default=S}),n=Zs&&Zs.__importStar||(function(){var _=function(S){return _=Object.getOwnPropertyNames||function(w){var R=[];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[R.length]=E);return R},_(S)};return function(S){if(S&&S.__esModule)return S;var w={};if(S!=null)for(var R=_(S),E=0;Ed.AudioTranscriptionRequestStream$outboundSchema.parse(le),"Input validation failed");if(!R.ok)return[R,{status:"invalid"}];const E=R.value,T=new FormData;if((0,r.appendForm)(T,"model",E.model),E.file!==void 0)if((0,h.isBlobLike)(E.file))(0,r.appendForm)(T,"file",E.file);else if((0,m.isReadableStream)(E.file.content)){const le=await(0,s.readableStreamToArrayBuffer)(E.file.content),K=(0,s.getContentTypeFromFileName)(E.file.fileName)||"application/octet-stream",X=new Blob([le],{type:K});(0,r.appendForm)(T,"file",X,E.file.fileName)}else{const le=(0,s.getContentTypeFromFileName)(E.file.fileName)||"application/octet-stream";(0,r.appendForm)(T,"file",new Blob([E.file.content],{type:le}),E.file.fileName)}E.file_id!==void 0&&(0,r.appendForm)(T,"file_id",E.file_id),E.file_url!==void 0&&(0,r.appendForm)(T,"file_url",E.file_url),E.language!==void 0&&(0,r.appendForm)(T,"language",E.language),E.stream!==void 0&&(0,r.appendForm)(T,"stream",E.stream),E.temperature!==void 0&&(0,r.appendForm)(T,"temperature",E.temperature),E.timestamp_granularities!==void 0&&(0,r.appendForm)(T,"timestamp_granularities",E.timestamp_granularities);const D=(0,l.pathToFunc)("/v1/audio/transcriptions#stream")(),B=new Headers((0,c.compactMap)({Accept:"text/event-stream"})),N=await(0,u.extractSecurity)(_._options.apiKey),L=N==null?{}:{apiKey:N},q=(0,u.resolveGlobalSecurity)(L),I={options:_._options,baseURL:w?.serverURL??_._baseURL??"",operationID:"audio_api_v1_transcriptions_post_stream",oAuth2Scopes:[],resolvedSecurity:q,securitySource:_._options.apiKey,retryConfig:w?.retries||_._options.retryConfig||{strategy:"none"},retryCodes:w?.retryCodes||["429","500","502","503","504"]},U=_._createRequest(I,{security:q,method:"POST",baseURL:w?.serverURL,path:D,headers:B,body:T,userAgent:_._options.userAgent,timeoutMs:w?.timeoutMs||_._options.timeoutMs||-1},w);if(!U.ok)return[U,{status:"invalid"}];const J=U.value,V=await _._do(J,{context:I,errorCodes:["4XX","5XX"],retryConfig:I.retryConfig,retryCodes:I.retryCodes});if(!V.ok)return[V,{status:"request-error",request:J}];const G=V.value,[Q]=await a.match(a.sse(200,o.instanceof(ReadableStream).transform(le=>new i.EventStream(le,K=>({value:d.TranscriptionStreamEvents$inboundSchema.parse(K)})))),a.fail("4XX"),a.fail("5XX"))(G,J);return Q.ok?[Q,{status:"complete",request:J,response:G}]:[Q,{status:"complete",request:J,response:G}]}return Zs}var g9;function H4e(){if(g9)return Rv;g9=1,Object.defineProperty(Rv,"__esModule",{value:!0}),Rv.Transcriptions=void 0;const e=J4e(),t=V4e(),n=Gn(),o=Ar();class r extends n.ClientSDK{async complete(s,a){return(0,o.unwrapAsync)((0,e.audioTranscriptionsComplete)(this,s,a))}async stream(s,a){return(0,o.unwrapAsync)((0,t.audioTranscriptionsStream)(this,s,a))}}return Rv.Transcriptions=r,Rv}var b9;function G4e(){if(b9)return Tv;b9=1,Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.Audio=void 0;const e=Gn(),t=H4e();class n extends e.ClientSDK{get transcriptions(){return this._transcriptions??(this._transcriptions=new t.Transcriptions(this._options))}}return Tv.Audio=n,Tv}var Ev={},Mv={},ea={},hg={},oh={},y9;function z4e(){return y9||(y9=1,(function(e){var t=oh&&oh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=oh&&oh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=oh&&oh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{agent_id:"agentId"})),e.AgentsApiV1AgentsDeleteRequest$outboundSchema=r.object({agentId:r.string()}).transform(u=>(0,i.remap)(u,{agentId:"agent_id"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1AgentsDeleteRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1AgentsDeleteRequest$outboundSchema})(a||(e.AgentsApiV1AgentsDeleteRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1AgentsDeleteRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1AgentsDeleteRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1AgentsDeleteRequest' from JSON")}})(oh)),oh}var ih={},A9;function K4e(){return A9||(A9=1,(function(e){var t=ih&&ih.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=ih&&ih.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=ih&&ih.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{agent_id:"agentId",agent_version:"agentVersion"})),e.AgentsApiV1AgentsGetRequest$outboundSchema=r.object({agentId:r.string(),agentVersion:r.nullable(r.number().int()).optional()}).transform(u=>(0,i.remap)(u,{agentId:"agent_id",agentVersion:"agent_version"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1AgentsGetRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1AgentsGetRequest$outboundSchema})(a||(e.AgentsApiV1AgentsGetRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1AgentsGetRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1AgentsGetRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1AgentsGetRequest' from JSON")}})(ih)),ih}var sh={},_9;function Q4e(){return _9||(_9=1,(function(e){var t=sh&&sh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=sh&&sh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=sh&&sh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{page_size:"pageSize",deployment_chat:"deploymentChat"})),e.AgentsApiV1AgentsListRequest$outboundSchema=r.object({page:r.number().int().default(0),pageSize:r.number().int().default(20),deploymentChat:r.nullable(r.boolean()).optional(),sources:r.nullable(r.array(a.RequestSource$outboundSchema)).optional(),name:r.nullable(r.string()).optional(),id:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional()}).transform(l=>(0,i.remap)(l,{pageSize:"page_size",deploymentChat:"deployment_chat"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1AgentsListRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1AgentsListRequest$outboundSchema})(c||(e.AgentsApiV1AgentsListRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1AgentsListRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1AgentsListRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1AgentsListRequest' from JSON")}})(sh)),sh}var ah={},v9;function $4e(){return v9||(v9=1,(function(e){var t=ah&&ah.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=ah&&ah.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=ah&&ah.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{agent_id:"agentId",AgentUpdateRequest:"agentUpdateRequest"})),e.AgentsApiV1AgentsUpdateRequest$outboundSchema=r.object({agentId:r.string(),agentUpdateRequest:a.AgentUpdateRequest$outboundSchema}).transform(l=>(0,i.remap)(l,{agentId:"agent_id",agentUpdateRequest:"AgentUpdateRequest"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1AgentsUpdateRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1AgentsUpdateRequest$outboundSchema})(c||(e.AgentsApiV1AgentsUpdateRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1AgentsUpdateRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1AgentsUpdateRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1AgentsUpdateRequest' from JSON")}})(ah)),ah}var lh={},S9;function W4e(){return S9||(S9=1,(function(e){var t=lh&&lh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=lh&&lh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=lh&&lh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{agent_id:"agentId"})),e.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema=r.object({agentId:r.string(),version:r.number().int()}).transform(u=>(0,i.remap)(u,{agentId:"agent_id"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema})(a||(e.AgentsApiV1AgentsUpdateVersionRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1AgentsUpdateVersionRequest' from JSON")}})(lh)),lh}var uh={},C9;function Y4e(){return C9||(C9=1,(function(e){var t=uh&&uh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=uh&&uh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=uh&&uh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{conversation_id:"conversationId",ConversationAppendRequest:"conversationAppendRequest"})),e.AgentsApiV1ConversationsAppendRequest$outboundSchema=r.object({conversationId:r.string(),conversationAppendRequest:a.ConversationAppendRequest$outboundSchema}).transform(l=>(0,i.remap)(l,{conversationId:"conversation_id",conversationAppendRequest:"ConversationAppendRequest"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1ConversationsAppendRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1ConversationsAppendRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsAppendRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1ConversationsAppendRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1ConversationsAppendRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1ConversationsAppendRequest' from JSON")}})(uh)),uh}var ch={},w9;function X4e(){return w9||(w9=1,(function(e){var t=ch&&ch.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=ch&&ch.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=ch&&ch.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{conversation_id:"conversationId",ConversationAppendStreamRequest:"conversationAppendStreamRequest"})),e.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema=r.object({conversationId:r.string(),conversationAppendStreamRequest:a.ConversationAppendStreamRequest$outboundSchema}).transform(l=>(0,i.remap)(l,{conversationId:"conversation_id",conversationAppendStreamRequest:"ConversationAppendStreamRequest"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsAppendStreamRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1ConversationsAppendStreamRequest' from JSON")}})(ch)),ch}var dh={},O9;function Z4e(){return O9||(O9=1,(function(e){var t=dh&&dh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=dh&&dh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=dh&&dh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{conversation_id:"conversationId"})),e.AgentsApiV1ConversationsDeleteRequest$outboundSchema=r.object({conversationId:r.string()}).transform(u=>(0,i.remap)(u,{conversationId:"conversation_id"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1ConversationsDeleteRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1ConversationsDeleteRequest$outboundSchema})(a||(e.AgentsApiV1ConversationsDeleteRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1ConversationsDeleteRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1ConversationsDeleteRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1ConversationsDeleteRequest' from JSON")}})(dh)),dh}var fh={},T9;function eJe(){return T9||(T9=1,(function(e){var t=fh&&fh.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=fh&&fh.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=fh&&fh.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{conversation_id:"conversationId"})),e.AgentsApiV1ConversationsGetRequest$outboundSchema=r.object({conversationId:r.string()}).transform(h=>(0,i.remap)(h,{conversationId:"conversation_id"}));var c;(function(h){h.inboundSchema=e.AgentsApiV1ConversationsGetRequest$inboundSchema,h.outboundSchema=e.AgentsApiV1ConversationsGetRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsGetRequest$=c={}));function p(h){return JSON.stringify(e.AgentsApiV1ConversationsGetRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.AgentsApiV1ConversationsGetRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'AgentsApiV1ConversationsGetRequest' from JSON")}e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema=r.union([a.ModelConversation$inboundSchema,a.AgentConversation$inboundSchema]),e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema=r.union([a.ModelConversation$outboundSchema,a.AgentConversation$outboundSchema]);var l;(function(h){h.inboundSchema=e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema,h.outboundSchema=e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema})(l||(e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$=l={}));function d(h){return JSON.stringify(e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'AgentsApiV1ConversationsGetResponseV1ConversationsGet' from JSON")}})(fh)),fh}var hh={},R9;function tJe(){return R9||(R9=1,(function(e){var t=hh&&hh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=hh&&hh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=hh&&hh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{conversation_id:"conversationId"})),e.AgentsApiV1ConversationsHistoryRequest$outboundSchema=r.object({conversationId:r.string()}).transform(u=>(0,i.remap)(u,{conversationId:"conversation_id"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1ConversationsHistoryRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1ConversationsHistoryRequest$outboundSchema})(a||(e.AgentsApiV1ConversationsHistoryRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1ConversationsHistoryRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1ConversationsHistoryRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1ConversationsHistoryRequest' from JSON")}})(hh)),hh}var ph={},E9;function nJe(){return E9||(E9=1,(function(e){var t=ph&&ph.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=ph&&ph.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=ph&&ph.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{page_size:"pageSize"})),e.AgentsApiV1ConversationsListRequest$outboundSchema=r.object({page:r.number().int().default(0),pageSize:r.number().int().default(100),metadata:r.nullable(r.record(r.any())).optional()}).transform(h=>(0,i.remap)(h,{pageSize:"page_size"}));var c;(function(h){h.inboundSchema=e.AgentsApiV1ConversationsListRequest$inboundSchema,h.outboundSchema=e.AgentsApiV1ConversationsListRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsListRequest$=c={}));function p(h){return JSON.stringify(e.AgentsApiV1ConversationsListRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.AgentsApiV1ConversationsListRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'AgentsApiV1ConversationsListRequest' from JSON")}e.ResponseBody$inboundSchema=r.union([a.ModelConversation$inboundSchema,a.AgentConversation$inboundSchema]),e.ResponseBody$outboundSchema=r.union([a.ModelConversation$outboundSchema,a.AgentConversation$outboundSchema]);var l;(function(h){h.inboundSchema=e.ResponseBody$inboundSchema,h.outboundSchema=e.ResponseBody$outboundSchema})(l||(e.ResponseBody$=l={}));function d(h){return JSON.stringify(e.ResponseBody$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.ResponseBody$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'ResponseBody' from JSON")}})(ph)),ph}var mh={},M9;function rJe(){return M9||(M9=1,(function(e){var t=mh&&mh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=mh&&mh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=mh&&mh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{conversation_id:"conversationId"})),e.AgentsApiV1ConversationsMessagesRequest$outboundSchema=r.object({conversationId:r.string()}).transform(u=>(0,i.remap)(u,{conversationId:"conversation_id"}));var a;(function(u){u.inboundSchema=e.AgentsApiV1ConversationsMessagesRequest$inboundSchema,u.outboundSchema=e.AgentsApiV1ConversationsMessagesRequest$outboundSchema})(a||(e.AgentsApiV1ConversationsMessagesRequest$=a={}));function c(u){return JSON.stringify(e.AgentsApiV1ConversationsMessagesRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.AgentsApiV1ConversationsMessagesRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'AgentsApiV1ConversationsMessagesRequest' from JSON")}})(mh)),mh}var gh={},P9;function oJe(){return P9||(P9=1,(function(e){var t=gh&&gh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=gh&&gh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=gh&&gh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{conversation_id:"conversationId",ConversationRestartRequest:"conversationRestartRequest"})),e.AgentsApiV1ConversationsRestartRequest$outboundSchema=r.object({conversationId:r.string(),conversationRestartRequest:a.ConversationRestartRequest$outboundSchema}).transform(l=>(0,i.remap)(l,{conversationId:"conversation_id",conversationRestartRequest:"ConversationRestartRequest"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1ConversationsRestartRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1ConversationsRestartRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsRestartRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1ConversationsRestartRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1ConversationsRestartRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1ConversationsRestartRequest' from JSON")}})(gh)),gh}var bh={},I9;function iJe(){return I9||(I9=1,(function(e){var t=bh&&bh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=bh&&bh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=bh&&bh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{conversation_id:"conversationId",ConversationRestartStreamRequest:"conversationRestartStreamRequest"})),e.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema=r.object({conversationId:r.string(),conversationRestartStreamRequest:a.ConversationRestartStreamRequest$outboundSchema}).transform(l=>(0,i.remap)(l,{conversationId:"conversation_id",conversationRestartStreamRequest:"ConversationRestartStreamRequest"}));var c;(function(l){l.inboundSchema=e.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema,l.outboundSchema=e.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema})(c||(e.AgentsApiV1ConversationsRestartStreamRequest$=c={}));function p(l){return JSON.stringify(e.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'AgentsApiV1ConversationsRestartStreamRequest' from JSON")}})(bh)),bh}var yh={},j9;function sJe(){return j9||(j9=1,(function(e){var t=yh&&yh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=yh&&yh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=yh&&yh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{model_id:"modelId"})),e.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema=r.object({modelId:r.string()}).transform(u=>(0,i.remap)(u,{modelId:"model_id"}));var a;(function(u){u.inboundSchema=e.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema,u.outboundSchema=e.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema})(a||(e.DeleteModelV1ModelsModelIdDeleteRequest$=a={}));function c(u){return JSON.stringify(e.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'DeleteModelV1ModelsModelIdDeleteRequest' from JSON")}})(yh)),yh}var Ah={},D9;function aJe(){return D9||(D9=1,(function(e){var t=Ah&&Ah.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Ah&&Ah.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Ah&&Ah.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.FilesApiRoutesDeleteFileRequest$outboundSchema=r.object({fileId:r.string()}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.FilesApiRoutesDeleteFileRequest$inboundSchema,u.outboundSchema=e.FilesApiRoutesDeleteFileRequest$outboundSchema})(a||(e.FilesApiRoutesDeleteFileRequest$=a={}));function c(u){return JSON.stringify(e.FilesApiRoutesDeleteFileRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FilesApiRoutesDeleteFileRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FilesApiRoutesDeleteFileRequest' from JSON")}})(Ah)),Ah}var _h={},N9;function lJe(){return N9||(N9=1,(function(e){var t=_h&&_h.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=_h&&_h.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=_h&&_h.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.FilesApiRoutesDownloadFileRequest$outboundSchema=r.object({fileId:r.string()}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.FilesApiRoutesDownloadFileRequest$inboundSchema,u.outboundSchema=e.FilesApiRoutesDownloadFileRequest$outboundSchema})(a||(e.FilesApiRoutesDownloadFileRequest$=a={}));function c(u){return JSON.stringify(e.FilesApiRoutesDownloadFileRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FilesApiRoutesDownloadFileRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FilesApiRoutesDownloadFileRequest' from JSON")}})(_h)),_h}var vh={},L9;function uJe(){return L9||(L9=1,(function(e){var t=vh&&vh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=vh&&vh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=vh&&vh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.FilesApiRoutesGetSignedUrlRequest$outboundSchema=r.object({fileId:r.string(),expiry:r.number().int().default(24)}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.FilesApiRoutesGetSignedUrlRequest$inboundSchema,u.outboundSchema=e.FilesApiRoutesGetSignedUrlRequest$outboundSchema})(a||(e.FilesApiRoutesGetSignedUrlRequest$=a={}));function c(u){return JSON.stringify(e.FilesApiRoutesGetSignedUrlRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FilesApiRoutesGetSignedUrlRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FilesApiRoutesGetSignedUrlRequest' from JSON")}})(vh)),vh}var Sh={},F9;function cJe(){return F9||(F9=1,(function(e){var t=Sh&&Sh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Sh&&Sh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Sh&&Sh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{page_size:"pageSize",include_total:"includeTotal",sample_type:"sampleType"})),e.FilesApiRoutesListFilesRequest$outboundSchema=r.object({page:r.number().int().default(0),pageSize:r.number().int().default(100),includeTotal:r.boolean().default(!0),sampleType:r.nullable(r.array(a.SampleType$outboundSchema)).optional(),source:r.nullable(r.array(a.Source$outboundSchema)).optional(),search:r.nullable(r.string()).optional(),purpose:r.nullable(a.FilePurpose$outboundSchema).optional()}).transform(l=>(0,i.remap)(l,{pageSize:"page_size",includeTotal:"include_total",sampleType:"sample_type"}));var c;(function(l){l.inboundSchema=e.FilesApiRoutesListFilesRequest$inboundSchema,l.outboundSchema=e.FilesApiRoutesListFilesRequest$outboundSchema})(c||(e.FilesApiRoutesListFilesRequest$=c={}));function p(l){return JSON.stringify(e.FilesApiRoutesListFilesRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.FilesApiRoutesListFilesRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'FilesApiRoutesListFilesRequest' from JSON")}})(Sh)),Sh}var Ch={},x9;function dJe(){return x9||(x9=1,(function(e){var t=Ch&&Ch.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Ch&&Ch.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Ch&&Ch.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{file_id:"fileId"})),e.FilesApiRoutesRetrieveFileRequest$outboundSchema=r.object({fileId:r.string()}).transform(u=>(0,i.remap)(u,{fileId:"file_id"}));var a;(function(u){u.inboundSchema=e.FilesApiRoutesRetrieveFileRequest$inboundSchema,u.outboundSchema=e.FilesApiRoutesRetrieveFileRequest$outboundSchema})(a||(e.FilesApiRoutesRetrieveFileRequest$=a={}));function c(u){return JSON.stringify(e.FilesApiRoutesRetrieveFileRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.FilesApiRoutesRetrieveFileRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'FilesApiRoutesRetrieveFileRequest' from JSON")}})(Ch)),Ch}var wh={},B9;function fJe(){return B9||(B9=1,(function(e){var t=wh&&wh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=wh&&wh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=wh&&wh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;me.FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'FilesApiRoutesUploadFileMultiPartBodyParams' from JSON")}})(wh)),wh}var Oh={},k9;function hJe(){return k9||(k9=1,(function(e){var t=Oh&&Oh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Oh&&Oh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Oh&&Oh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{job_id:"jobId"})),e.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema=r.object({jobId:r.string()}).transform(u=>(0,i.remap)(u,{jobId:"job_id"}));var a;(function(u){u.inboundSchema=e.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema,u.outboundSchema=e.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema})(a||(e.JobsApiRoutesBatchCancelBatchJobRequest$=a={}));function c(u){return JSON.stringify(e.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JobsApiRoutesBatchCancelBatchJobRequest' from JSON")}})(Oh)),Oh}var Th={},U9;function pJe(){return U9||(U9=1,(function(e){var t=Th&&Th.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Th&&Th.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Th&&Th.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{job_id:"jobId"})),e.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema=r.object({jobId:r.string()}).transform(u=>(0,i.remap)(u,{jobId:"job_id"}));var a;(function(u){u.inboundSchema=e.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema,u.outboundSchema=e.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema})(a||(e.JobsApiRoutesBatchGetBatchJobRequest$=a={}));function c(u){return JSON.stringify(e.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JobsApiRoutesBatchGetBatchJobRequest' from JSON")}})(Th)),Th}var Rh={},q9;function mJe(){return q9||(q9=1,(function(e){var t=Rh&&Rh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Rh&&Rh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Rh&&Rh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l))).optional(),created_by_me:r.boolean().default(!1),status:r.nullable(r.array(a.BatchJobStatus$inboundSchema)).optional()}).transform(l=>(0,i.remap)(l,{page_size:"pageSize",agent_id:"agentId",created_after:"createdAfter",created_by_me:"createdByMe"})),e.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema=r.object({page:r.number().int().default(0),pageSize:r.number().int().default(100),model:r.nullable(r.string()).optional(),agentId:r.nullable(r.string()).optional(),metadata:r.nullable(r.record(r.any())).optional(),createdAfter:r.nullable(r.date().transform(l=>l.toISOString())).optional(),createdByMe:r.boolean().default(!1),status:r.nullable(r.array(a.BatchJobStatus$outboundSchema)).optional()}).transform(l=>(0,i.remap)(l,{pageSize:"page_size",agentId:"agent_id",createdAfter:"created_after",createdByMe:"created_by_me"}));var c;(function(l){l.inboundSchema=e.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema,l.outboundSchema=e.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema})(c||(e.JobsApiRoutesBatchGetBatchJobsRequest$=c={}));function p(l){return JSON.stringify(e.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'JobsApiRoutesBatchGetBatchJobsRequest' from JSON")}})(Rh)),Rh}var Eh={},J9;function gJe(){return J9||(J9=1,(function(e){var t=Eh&&Eh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Eh&&Eh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Eh&&Eh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{model_id:"modelId"})),e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema=r.object({modelId:r.string()}).transform(u=>(0,i.remap)(u,{modelId:"model_id"}));var a;(function(u){u.inboundSchema=e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema,u.outboundSchema=e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema})(a||(e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$=a={}));function c(u){return JSON.stringify(e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JobsApiRoutesFineTuningArchiveFineTunedModelRequest' from JSON")}})(Eh)),Eh}var Mh={},V9;function bJe(){return V9||(V9=1,(function(e){var t=Mh&&Mh.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Mh&&Mh.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Mh&&Mh.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{job_id:"jobId"})),e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema=r.object({jobId:r.string()}).transform(h=>(0,i.remap)(h,{jobId:"job_id"}));var c;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema})(c||(e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$=c={}));function p(h){return JSON.stringify(e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningCancelFineTuningJobRequest' from JSON")}e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema=r.union([a.ClassifierDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(h=>({jobType:h.job_type}))),a.CompletionDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(h=>({jobType:h.job_type})))]),e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema=r.union([a.ClassifierDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(h=>({job_type:h.jobType}))),a.CompletionDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(h=>({job_type:h.jobType})))]);var l;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema})(l||(e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$=l={}));function d(h){return JSON.stringify(e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningCancelFineTuningJobResponse' from JSON")}})(Mh)),Mh}var Ph={},H9;function yJe(){return H9||(H9=1,(function(e){var t=Ph&&Ph.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),n=Ph&&Ph.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),o=Ph&&Ph.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;y({jobType:f.job_type}))),s.CompletionJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(f=>({jobType:f.job_type})))]),e.One$outboundSchema=r.union([s.ClassifierJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(f=>({job_type:f.jobType}))),s.CompletionJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(f=>({job_type:f.jobType})))]);var a;(function(f){f.inboundSchema=e.One$inboundSchema,f.outboundSchema=e.One$outboundSchema})(a||(e.One$=a={}));function c(f){return JSON.stringify(e.One$outboundSchema.parse(f))}function p(f){return(0,i.safeParse)(f,h=>e.One$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'One' from JSON")}e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema=r.union([s.LegacyJobMetadataOut$inboundSchema,r.union([s.ClassifierJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(f=>({jobType:f.job_type}))),s.CompletionJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(f=>({jobType:f.job_type})))])]),e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema=r.union([s.LegacyJobMetadataOut$outboundSchema,r.union([s.ClassifierJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(f=>({job_type:f.jobType}))),s.CompletionJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(f=>({job_type:f.jobType})))])]);var u;(function(f){f.inboundSchema=e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema,f.outboundSchema=e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema})(u||(e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$=u={}));function l(f){return JSON.stringify(e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema.parse(f))}function d(f){return(0,i.safeParse)(f,h=>e.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema.parse(JSON.parse(h)),"Failed to parse 'JobsApiRoutesFineTuningCreateFineTuningJobResponse' from JSON")}})(Ph)),Ph}var Ih={},G9;function AJe(){return G9||(G9=1,(function(e){var t=Ih&&Ih.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Ih&&Ih.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Ih&&Ih.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{job_id:"jobId"})),e.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema=r.object({jobId:r.string()}).transform(h=>(0,i.remap)(h,{jobId:"job_id"}));var c;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema})(c||(e.JobsApiRoutesFineTuningGetFineTuningJobRequest$=c={}));function p(h){return JSON.stringify(e.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobRequest' from JSON")}e.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema=r.union([a.ClassifierDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(h=>({jobType:h.job_type}))),a.CompletionDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(h=>({jobType:h.job_type})))]),e.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema=r.union([a.ClassifierDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(h=>({job_type:h.jobType}))),a.CompletionDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(h=>({job_type:h.jobType})))]);var l;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema})(l||(e.JobsApiRoutesFineTuningGetFineTuningJobResponse$=l={}));function d(h){return JSON.stringify(e.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobResponse' from JSON")}})(Ih)),Ih}var jh={},z9;function _Je(){return z9||(z9=1,(function(e){var t=jh&&jh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=jh&&jh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=jh&&jh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mnew Date(l))).optional(),created_before:r.nullable(r.string().datetime({offset:!0}).transform(l=>new Date(l))).optional(),created_by_me:r.boolean().default(!1),status:r.nullable(e.Status$inboundSchema).optional(),wandb_project:r.nullable(r.string()).optional(),wandb_name:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional()}).transform(l=>(0,i.remap)(l,{page_size:"pageSize",created_after:"createdAfter",created_before:"createdBefore",created_by_me:"createdByMe",wandb_project:"wandbProject",wandb_name:"wandbName"})),e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema=r.object({page:r.number().int().default(0),pageSize:r.number().int().default(100),model:r.nullable(r.string()).optional(),createdAfter:r.nullable(r.date().transform(l=>l.toISOString())).optional(),createdBefore:r.nullable(r.date().transform(l=>l.toISOString())).optional(),createdByMe:r.boolean().default(!1),status:r.nullable(e.Status$outboundSchema).optional(),wandbProject:r.nullable(r.string()).optional(),wandbName:r.nullable(r.string()).optional(),suffix:r.nullable(r.string()).optional()}).transform(l=>(0,i.remap)(l,{pageSize:"page_size",createdAfter:"created_after",createdBefore:"created_before",createdByMe:"created_by_me",wandbProject:"wandb_project",wandbName:"wandb_name"}));var c;(function(l){l.inboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema,l.outboundSchema=e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema})(c||(e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$=c={}));function p(l){return JSON.stringify(e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobsRequest' from JSON")}})(jh)),jh}var Dh={},K9;function vJe(){return K9||(K9=1,(function(e){var t=Dh&&Dh.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Dh&&Dh.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Dh&&Dh.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{job_id:"jobId"})),e.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema=r.object({jobId:r.string()}).transform(h=>(0,i.remap)(h,{jobId:"job_id"}));var c;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema})(c||(e.JobsApiRoutesFineTuningStartFineTuningJobRequest$=c={}));function p(h){return JSON.stringify(e.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningStartFineTuningJobRequest' from JSON")}e.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema=r.union([a.ClassifierDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("classifier")}).transform(h=>({jobType:h.job_type}))),a.CompletionDetailedJobOut$inboundSchema.and(r.object({job_type:r.literal("completion")}).transform(h=>({jobType:h.job_type})))]),e.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema=r.union([a.ClassifierDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("classifier")}).transform(h=>({job_type:h.jobType}))),a.CompletionDetailedJobOut$outboundSchema.and(r.object({jobType:r.literal("completion")}).transform(h=>({job_type:h.jobType})))]);var l;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema})(l||(e.JobsApiRoutesFineTuningStartFineTuningJobResponse$=l={}));function d(h){return JSON.stringify(e.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningStartFineTuningJobResponse' from JSON")}})(Dh)),Dh}var Nh={},Q9;function SJe(){return Q9||(Q9=1,(function(e){var t=Nh&&Nh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Nh&&Nh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Nh&&Nh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{model_id:"modelId"})),e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema=r.object({modelId:r.string()}).transform(u=>(0,i.remap)(u,{modelId:"model_id"}));var a;(function(u){u.inboundSchema=e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema,u.outboundSchema=e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema})(a||(e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$=a={}));function c(u){return JSON.stringify(e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest' from JSON")}})(Nh)),Nh}var Lh={},$9;function CJe(){return $9||($9=1,(function(e){var t=Lh&&Lh.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Lh&&Lh.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Lh&&Lh.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{model_id:"modelId",UpdateFTModelIn:"updateFTModelIn"})),e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema=r.object({modelId:r.string(),updateFTModelIn:a.UpdateFTModelIn$outboundSchema}).transform(h=>(0,i.remap)(h,{modelId:"model_id",updateFTModelIn:"UpdateFTModelIn"}));var c;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema})(c||(e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$=c={}));function p(h){return JSON.stringify(e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningUpdateFineTunedModelRequest' from JSON")}e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema=r.union([a.ClassifierFTModelOut$inboundSchema.and(r.object({model_type:r.literal("classifier")}).transform(h=>({modelType:h.model_type}))),a.CompletionFTModelOut$inboundSchema.and(r.object({model_type:r.literal("completion")}).transform(h=>({modelType:h.model_type})))]),e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema=r.union([a.ClassifierFTModelOut$outboundSchema.and(r.object({modelType:r.literal("classifier")}).transform(h=>({model_type:h.modelType}))),a.CompletionFTModelOut$outboundSchema.and(r.object({modelType:r.literal("completion")}).transform(h=>({model_type:h.modelType})))]);var l;(function(h){h.inboundSchema=e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema,h.outboundSchema=e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema})(l||(e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$=l={}));function d(h){return JSON.stringify(e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'JobsApiRoutesFineTuningUpdateFineTunedModelResponse' from JSON")}})(Lh)),Lh}var Fh={},W9;function wJe(){return W9||(W9=1,(function(e){var t=Fh&&Fh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Fh&&Fh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Fh&&Fh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId"})),e.LibrariesDeleteV1Request$outboundSchema=r.object({libraryId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDeleteV1Request$inboundSchema,u.outboundSchema=e.LibrariesDeleteV1Request$outboundSchema})(a||(e.LibrariesDeleteV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDeleteV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDeleteV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDeleteV1Request' from JSON")}})(Fh)),Fh}var xh={},Y9;function OJe(){return Y9||(Y9=1,(function(e){var t=xh&&xh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=xh&&xh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=xh&&xh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsDeleteV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsDeleteV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsDeleteV1Request$outboundSchema})(a||(e.LibrariesDocumentsDeleteV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsDeleteV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsDeleteV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsDeleteV1Request' from JSON")}})(xh)),xh}var Bh={},X9;function TJe(){return X9||(X9=1,(function(e){var t=Bh&&Bh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Bh&&Bh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Bh&&Bh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema})(a||(e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsGetExtractedTextSignedUrlV1Request' from JSON")}})(Bh)),Bh}var kh={},Z9;function RJe(){return Z9||(Z9=1,(function(e){var t=kh&&kh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=kh&&kh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=kh&&kh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema})(a||(e.LibrariesDocumentsGetSignedUrlV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsGetSignedUrlV1Request' from JSON")}})(kh)),kh}var Uh={},eK;function EJe(){return eK||(eK=1,(function(e){var t=Uh&&Uh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Uh&&Uh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Uh&&Uh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsGetStatusV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsGetStatusV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsGetStatusV1Request$outboundSchema})(a||(e.LibrariesDocumentsGetStatusV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsGetStatusV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsGetStatusV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsGetStatusV1Request' from JSON")}})(Uh)),Uh}var qh={},tK;function MJe(){return tK||(tK=1,(function(e){var t=qh&&qh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=qh&&qh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=qh&&qh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsGetTextContentV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsGetTextContentV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsGetTextContentV1Request$outboundSchema})(a||(e.LibrariesDocumentsGetTextContentV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsGetTextContentV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsGetTextContentV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsGetTextContentV1Request' from JSON")}})(qh)),qh}var Jh={},nK;function PJe(){return nK||(nK=1,(function(e){var t=Jh&&Jh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Jh&&Jh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Jh&&Jh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsGetV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsGetV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsGetV1Request$outboundSchema})(a||(e.LibrariesDocumentsGetV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsGetV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsGetV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsGetV1Request' from JSON")}})(Jh)),Jh}var Vh={},rK;function IJe(){return rK||(rK=1,(function(e){var t=Vh&&Vh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Vh&&Vh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Vh&&Vh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",page_size:"pageSize",filters_attributes:"filtersAttributes",sort_by:"sortBy",sort_order:"sortOrder"})),e.LibrariesDocumentsListV1Request$outboundSchema=r.object({libraryId:r.string(),search:r.nullable(r.string()).optional(),pageSize:r.number().int().default(100),page:r.number().int().default(0),filtersAttributes:r.nullable(r.string()).optional(),sortBy:r.string().default("created_at"),sortOrder:r.string().default("desc")}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",pageSize:"page_size",filtersAttributes:"filters_attributes",sortBy:"sort_by",sortOrder:"sort_order"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsListV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsListV1Request$outboundSchema})(a||(e.LibrariesDocumentsListV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsListV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsListV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsListV1Request' from JSON")}})(Vh)),Vh}var Hh={},oK;function jJe(){return oK||(oK=1,(function(e){var t=Hh&&Hh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Hh&&Hh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Hh&&Hh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId",document_id:"documentId"})),e.LibrariesDocumentsReprocessV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id",documentId:"document_id"}));var a;(function(u){u.inboundSchema=e.LibrariesDocumentsReprocessV1Request$inboundSchema,u.outboundSchema=e.LibrariesDocumentsReprocessV1Request$outboundSchema})(a||(e.LibrariesDocumentsReprocessV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesDocumentsReprocessV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesDocumentsReprocessV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesDocumentsReprocessV1Request' from JSON")}})(Hh)),Hh}var Gh={},iK;function DJe(){return iK||(iK=1,(function(e){var t=Gh&&Gh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Gh&&Gh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Gh&&Gh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{library_id:"libraryId",document_id:"documentId",DocumentUpdateIn:"documentUpdateIn"})),e.LibrariesDocumentsUpdateV1Request$outboundSchema=r.object({libraryId:r.string(),documentId:r.string(),documentUpdateIn:a.DocumentUpdateIn$outboundSchema}).transform(l=>(0,i.remap)(l,{libraryId:"library_id",documentId:"document_id",documentUpdateIn:"DocumentUpdateIn"}));var c;(function(l){l.inboundSchema=e.LibrariesDocumentsUpdateV1Request$inboundSchema,l.outboundSchema=e.LibrariesDocumentsUpdateV1Request$outboundSchema})(c||(e.LibrariesDocumentsUpdateV1Request$=c={}));function p(l){return JSON.stringify(e.LibrariesDocumentsUpdateV1Request$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.LibrariesDocumentsUpdateV1Request$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'LibrariesDocumentsUpdateV1Request' from JSON")}})(Gh)),Gh}var zh={},sK;function NJe(){return sK||(sK=1,(function(e){var t=zh&&zh.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),n=zh&&zh.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),o=zh&&zh.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&t(y,g,_[S]);return n(y,g),y}})();Object.defineProperty(e,"__esModule",{value:!0}),e.LibrariesDocumentsUploadV1Request$=e.LibrariesDocumentsUploadV1Request$outboundSchema=e.LibrariesDocumentsUploadV1Request$inboundSchema=e.LibrariesDocumentsUploadV1DocumentUpload$=e.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema=e.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema=void 0,e.librariesDocumentsUploadV1DocumentUploadToJSON=u,e.librariesDocumentsUploadV1DocumentUploadFromJSON=l,e.librariesDocumentsUploadV1RequestToJSON=f,e.librariesDocumentsUploadV1RequestFromJSON=h;const r=o(ne()),i=ae(),s=ee(),a=jm(),c=o(xe());e.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema=r.object({file:c.FileT$inboundSchema}),e.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema=r.object({file:c.FileT$outboundSchema.or(a.blobLikeSchema)});var p;(function(m){m.inboundSchema=e.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema,m.outboundSchema=e.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema})(p||(e.LibrariesDocumentsUploadV1DocumentUpload$=p={}));function u(m){return JSON.stringify(e.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema.parse(m))}function l(m){return(0,s.safeParse)(m,g=>e.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'LibrariesDocumentsUploadV1DocumentUpload' from JSON")}e.LibrariesDocumentsUploadV1Request$inboundSchema=r.object({library_id:r.string(),RequestBody:r.lazy(()=>e.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema)}).transform(m=>(0,i.remap)(m,{library_id:"libraryId",RequestBody:"requestBody"})),e.LibrariesDocumentsUploadV1Request$outboundSchema=r.object({libraryId:r.string(),requestBody:r.lazy(()=>e.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema)}).transform(m=>(0,i.remap)(m,{libraryId:"library_id",requestBody:"RequestBody"}));var d;(function(m){m.inboundSchema=e.LibrariesDocumentsUploadV1Request$inboundSchema,m.outboundSchema=e.LibrariesDocumentsUploadV1Request$outboundSchema})(d||(e.LibrariesDocumentsUploadV1Request$=d={}));function f(m){return JSON.stringify(e.LibrariesDocumentsUploadV1Request$outboundSchema.parse(m))}function h(m){return(0,s.safeParse)(m,g=>e.LibrariesDocumentsUploadV1Request$inboundSchema.parse(JSON.parse(g)),"Failed to parse 'LibrariesDocumentsUploadV1Request' from JSON")}})(zh)),zh}var Kh={},aK;function LJe(){return aK||(aK=1,(function(e){var t=Kh&&Kh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Kh&&Kh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Kh&&Kh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId"})),e.LibrariesGetV1Request$outboundSchema=r.object({libraryId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id"}));var a;(function(u){u.inboundSchema=e.LibrariesGetV1Request$inboundSchema,u.outboundSchema=e.LibrariesGetV1Request$outboundSchema})(a||(e.LibrariesGetV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesGetV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesGetV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesGetV1Request' from JSON")}})(Kh)),Kh}var Qh={},lK;function FJe(){return lK||(lK=1,(function(e){var t=Qh&&Qh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Qh&&Qh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Qh&&Qh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{library_id:"libraryId",SharingIn:"sharingIn"})),e.LibrariesShareCreateV1Request$outboundSchema=r.object({libraryId:r.string(),sharingIn:a.SharingIn$outboundSchema}).transform(l=>(0,i.remap)(l,{libraryId:"library_id",sharingIn:"SharingIn"}));var c;(function(l){l.inboundSchema=e.LibrariesShareCreateV1Request$inboundSchema,l.outboundSchema=e.LibrariesShareCreateV1Request$outboundSchema})(c||(e.LibrariesShareCreateV1Request$=c={}));function p(l){return JSON.stringify(e.LibrariesShareCreateV1Request$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.LibrariesShareCreateV1Request$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'LibrariesShareCreateV1Request' from JSON")}})(Qh)),Qh}var $h={},uK;function xJe(){return uK||(uK=1,(function(e){var t=$h&&$h.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=$h&&$h.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=$h&&$h.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{library_id:"libraryId",SharingDelete:"sharingDelete"})),e.LibrariesShareDeleteV1Request$outboundSchema=r.object({libraryId:r.string(),sharingDelete:a.SharingDelete$outboundSchema}).transform(l=>(0,i.remap)(l,{libraryId:"library_id",sharingDelete:"SharingDelete"}));var c;(function(l){l.inboundSchema=e.LibrariesShareDeleteV1Request$inboundSchema,l.outboundSchema=e.LibrariesShareDeleteV1Request$outboundSchema})(c||(e.LibrariesShareDeleteV1Request$=c={}));function p(l){return JSON.stringify(e.LibrariesShareDeleteV1Request$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.LibrariesShareDeleteV1Request$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'LibrariesShareDeleteV1Request' from JSON")}})($h)),$h}var Wh={},cK;function BJe(){return cK||(cK=1,(function(e){var t=Wh&&Wh.__createBinding||(Object.create?(function(u,l,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(l,d);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(u,f,h)}):(function(u,l,d,f){f===void 0&&(f=d),u[f]=l[d]})),n=Wh&&Wh.__setModuleDefault||(Object.create?(function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}):function(u,l){u.default=l}),o=Wh&&Wh.__importStar||(function(){var u=function(l){return u=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},u(l)};return function(l){if(l&&l.__esModule)return l;var d={};if(l!=null)for(var f=u(l),h=0;h(0,i.remap)(u,{library_id:"libraryId"})),e.LibrariesShareListV1Request$outboundSchema=r.object({libraryId:r.string()}).transform(u=>(0,i.remap)(u,{libraryId:"library_id"}));var a;(function(u){u.inboundSchema=e.LibrariesShareListV1Request$inboundSchema,u.outboundSchema=e.LibrariesShareListV1Request$outboundSchema})(a||(e.LibrariesShareListV1Request$=a={}));function c(u){return JSON.stringify(e.LibrariesShareListV1Request$outboundSchema.parse(u))}function p(u){return(0,s.safeParse)(u,l=>e.LibrariesShareListV1Request$inboundSchema.parse(JSON.parse(l)),"Failed to parse 'LibrariesShareListV1Request' from JSON")}})(Wh)),Wh}var Yh={},dK;function kJe(){return dK||(dK=1,(function(e){var t=Yh&&Yh.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),n=Yh&&Yh.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),o=Yh&&Yh.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;m(0,i.remap)(l,{library_id:"libraryId",LibraryInUpdate:"libraryInUpdate"})),e.LibrariesUpdateV1Request$outboundSchema=r.object({libraryId:r.string(),libraryInUpdate:a.LibraryInUpdate$outboundSchema}).transform(l=>(0,i.remap)(l,{libraryId:"library_id",libraryInUpdate:"LibraryInUpdate"}));var c;(function(l){l.inboundSchema=e.LibrariesUpdateV1Request$inboundSchema,l.outboundSchema=e.LibrariesUpdateV1Request$outboundSchema})(c||(e.LibrariesUpdateV1Request$=c={}));function p(l){return JSON.stringify(e.LibrariesUpdateV1Request$outboundSchema.parse(l))}function u(l){return(0,s.safeParse)(l,d=>e.LibrariesUpdateV1Request$inboundSchema.parse(JSON.parse(d)),"Failed to parse 'LibrariesUpdateV1Request' from JSON")}})(Yh)),Yh}var Xh={},fK;function UJe(){return fK||(fK=1,(function(e){var t=Xh&&Xh.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),n=Xh&&Xh.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),o=Xh&&Xh.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_(0,i.remap)(h,{model_id:"modelId"})),e.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema=r.object({modelId:r.string()}).transform(h=>(0,i.remap)(h,{modelId:"model_id"}));var c;(function(h){h.inboundSchema=e.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema,h.outboundSchema=e.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema})(c||(e.RetrieveModelV1ModelsModelIdGetRequest$=c={}));function p(h){return JSON.stringify(e.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema.parse(h))}function u(h){return(0,s.safeParse)(h,m=>e.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'RetrieveModelV1ModelsModelIdGetRequest' from JSON")}e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema=r.union([a.FTModelCard$inboundSchema.and(r.object({type:r.literal("fine-tuned")}).transform(h=>({type:h.type}))),a.BaseModelCard$inboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))]),e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema=r.union([a.FTModelCard$outboundSchema.and(r.object({type:r.literal("fine-tuned")}).transform(h=>({type:h.type}))),a.BaseModelCard$outboundSchema.and(r.object({type:r.literal("base")}).transform(h=>({type:h.type})))]);var l;(function(h){h.inboundSchema=e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema,h.outboundSchema=e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema})(l||(e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$=l={}));function d(h){return JSON.stringify(e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema.parse(h))}function f(h){return(0,s.safeParse)(h,m=>e.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema.parse(JSON.parse(m)),"Failed to parse 'RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet' from JSON")}})(Xh)),Xh}var hK;function gt(){return hK||(hK=1,(function(e){var t=hg&&hg.__createBinding||(Object.create?(function(o,r,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(r,i);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,s,a)}):(function(o,r,i,s){s===void 0&&(s=i),o[s]=r[i]})),n=hg&&hg.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(z4e(),e),n(K4e(),e),n(Q4e(),e),n($4e(),e),n(W4e(),e),n(Y4e(),e),n(X4e(),e),n(Z4e(),e),n(eJe(),e),n(tJe(),e),n(nJe(),e),n(rJe(),e),n(oJe(),e),n(iJe(),e),n(sJe(),e),n(aJe(),e),n(lJe(),e),n(uJe(),e),n(cJe(),e),n(dJe(),e),n(fJe(),e),n(hJe(),e),n(pJe(),e),n(mJe(),e),n(gJe(),e),n(bJe(),e),n(yJe(),e),n(AJe(),e),n(_Je(),e),n(vJe(),e),n(SJe(),e),n(CJe(),e),n(wJe(),e),n(OJe(),e),n(TJe(),e),n(RJe(),e),n(EJe(),e),n(MJe(),e),n(PJe(),e),n(IJe(),e),n(jJe(),e),n(DJe(),e),n(NJe(),e),n(LJe(),e),n(FJe(),e),n(xJe(),e),n(BJe(),e),n(kJe(),e),n(UJe(),e)})(hg)),hg}var pK;function qJe(){if(pK)return ea;pK=1;var e=ea&&ea.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ea&&ea.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ea&&ea.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={job_id:(0,o.encodeSimple)("job_id",_.job_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/batch/jobs/{job_id}/cancel")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_batch_cancel_batch_job",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"POST",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.BatchJobOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return ea}var ta={},mK;function JJe(){if(mK)return ta;mK=1;var e=ta&&ta.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),t=ta&&ta.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=ta&&ta.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;yp.BatchJobIn$outboundSchema.parse(U),"Input validation failed");if(!g.ok)return[g,{status:"invalid"}];const y=g.value,_=(0,o.encodeJSON)("body",y,{explode:!0}),S=(0,c.pathToFunc)("/v1/batch/jobs")(),w=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),R=await(0,a.extractSecurity)(f._options.apiKey),E=R==null?{}:{apiKey:R},T=(0,a.resolveGlobalSecurity)(E),D={options:f._options,baseURL:m?.serverURL??f._baseURL??"",operationID:"jobs_api_routes_batch_create_batch_job",oAuth2Scopes:[],resolvedSecurity:T,securitySource:f._options.apiKey,retryConfig:m?.retries||f._options.retryConfig||{strategy:"none"},retryCodes:m?.retryCodes||["429","500","502","503","504"]},B=f._createRequest(D,{security:T,method:"POST",baseURL:m?.serverURL,path:S,headers:w,body:_,userAgent:f._options.userAgent,timeoutMs:m?.timeoutMs||f._options.timeoutMs||-1},m);if(!B.ok)return[B,{status:"invalid"}];const N=B.value,L=await f._do(N,{context:D,errorCodes:["4XX","5XX"],retryConfig:D.retryConfig,retryCodes:D.retryCodes});if(!L.ok)return[L,{status:"request-error",request:N}];const q=L.value,[I]=await r.match(r.json(200,p.BatchJobOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(q,N);return I.ok?[I,{status:"complete",request:N,response:q}]:[I,{status:"complete",request:N,response:q}]}return ta}var na={},gK;function VJe(){if(gK)return na;gK=1;var e=na&&na.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=na&&na.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=na&&na.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={job_id:(0,o.encodeSimple)("job_id",_.job_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/batch/jobs/{job_id}")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_batch_get_batch_job",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.BatchJobOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return na}var ra={},bK;function HJe(){if(bK)return ra;bK=1;var e=ra&&ra.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ra&&ra.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ra&&ra.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.optional().parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w=(0,c.pathToFunc)("/v1/batch/jobs")(),R=(0,o.encodeFormQuery)({agent_id:_?.agent_id,created_after:_?.created_after,created_by_me:_?.created_by_me,metadata:_?.metadata,model:_?.model,page:_?.page,page_size:_?.page_size,status:_?.status}),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_batch_get_batch_jobs",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:w,headers:E,query:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.BatchJobsOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return ra}var yK;function GJe(){if(yK)return Mv;yK=1,Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.MistralJobs=void 0;const e=qJe(),t=JJe(),n=VJe(),o=HJe(),r=Gn(),i=Ar();class s extends r.ClientSDK{async list(c,p){return(0,i.unwrapAsync)((0,o.batchJobsList)(this,c,p))}async create(c,p){return(0,i.unwrapAsync)((0,t.batchJobsCreate)(this,c,p))}async get(c,p){return(0,i.unwrapAsync)((0,n.batchJobsGet)(this,c,p))}async cancel(c,p){return(0,i.unwrapAsync)((0,e.batchJobsCancel)(this,c,p))}}return Mv.MistralJobs=s,Mv}var AK;function zJe(){if(AK)return Ev;AK=1,Object.defineProperty(Ev,"__esModule",{value:!0}),Ev.Batch=void 0;const e=Gn(),t=GJe();class n extends e.ClientSDK{get jobs(){return this._jobs??(this._jobs=new t.MistralJobs(this._options))}}return Ev.Batch=n,Ev}var Pv={},Iv={},oa={},_K;function KJe(){if(_K)return oa;_K=1;var e=oa&&oa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=oa&&oa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=oa&&oa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(oa,"__esModule",{value:!0}),oa.betaConversationsAppend=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.AgentsApiV1ConversationsAppendRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.ConversationAppendRequest,{explode:!0}),R={conversation_id:(0,o.encodeSimple)("conversation_id",S.conversation_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/conversations/{conversation_id}")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_append",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"POST",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ConversationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return oa}var ia={},vK;function QJe(){if(vK)return ia;vK=1;var e=ia&&ia.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),t=ia&&ia.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),n=ia&&ia.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;Rf.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema.parse(K),"Input validation failed");if(!w.ok)return[w,{status:"invalid"}];const R=w.value,E=(0,r.encodeJSON)("body",R.ConversationAppendStreamRequest,{explode:!0}),T={conversation_id:(0,r.encodeSimple)("conversation_id",R.conversation_id,{explode:!1,charEncoding:"percent"})},D=(0,u.pathToFunc)("/v1/conversations/{conversation_id}#stream")(T),B=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),N=await(0,p.extractSecurity)(y._options.apiKey),L=N==null?{}:{apiKey:N},q=(0,p.resolveGlobalSecurity)(L),I={options:y._options,baseURL:S?.serverURL??y._baseURL??"",operationID:"agents_api_v1_conversations_append_stream",oAuth2Scopes:[],resolvedSecurity:q,securitySource:y._options.apiKey,retryConfig:S?.retries||y._options.retryConfig||{strategy:"none"},retryCodes:S?.retryCodes||["429","500","502","503","504"]},U=y._createRequest(I,{security:q,method:"POST",baseURL:S?.serverURL,path:D,headers:B,body:E,userAgent:y._options.userAgent,timeoutMs:S?.timeoutMs||y._options.timeoutMs||-1},S);if(!U.ok)return[U,{status:"invalid"}];const J=U.value,V=await y._do(J,{context:I,errorCodes:["422","4XX","5XX"],retryConfig:I.retryConfig,retryCodes:I.retryCodes});if(!V.ok)return[V,{status:"request-error",request:J}];const G=V.value,Q={HttpMeta:{Response:G,Request:J}},[le]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(K=>new i.EventStream(K,X=>({value:l.ConversationEvents$inboundSchema.parse(X)})))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(G,J,{extraFields:Q});return le.ok?[le,{status:"complete",request:J,response:G}]:[le,{status:"complete",request:J,response:G}]}return ia}var sa={},SK;function $Je(){if(SK)return sa;SK=1;var e=sa&&sa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=sa&&sa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=sa&&sa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(sa,"__esModule",{value:!0}),sa.betaConversationsDelete=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.AgentsApiV1ConversationsDeleteRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={conversation_id:(0,r.encodeSimple)("conversation_id",S.conversation_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/conversations/{conversation_id}")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_delete",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.nil(204,o.void()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return sa}var aa={},CK;function WJe(){if(CK)return aa;CK=1;var e=aa&&aa.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=aa&&aa.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=aa&&aa.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.AgentsApiV1ConversationsGetRequest$outboundSchema.parse(G),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={conversation_id:(0,o.encodeSimple)("conversation_id",_.conversation_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/conversations/{conversation_id}")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"agents_api_v1_conversations_get",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["422","4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,J={HttpMeta:{Response:U,Request:q}},[V]=await r.match(r.json(200,u.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema),r.jsonErr(422,p.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q,{extraFields:J});return V.ok?[V,{status:"complete",request:q,response:U}]:[V,{status:"complete",request:q,response:U}]}return aa}var la={},wK;function YJe(){if(wK)return la;wK=1;var e=la&&la.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=la&&la.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=la&&la.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(la,"__esModule",{value:!0}),la.betaConversationsGetHistory=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.AgentsApiV1ConversationsHistoryRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={conversation_id:(0,o.encodeSimple)("conversation_id",S.conversation_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/conversations/{conversation_id}/history")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_history",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ConversationHistory$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return la}var ua={},OK;function XJe(){if(OK)return ua;OK=1;var e=ua&&ua.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=ua&&ua.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=ua&&ua.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(ua,"__esModule",{value:!0}),ua.betaConversationsGetMessages=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.AgentsApiV1ConversationsMessagesRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={conversation_id:(0,o.encodeSimple)("conversation_id",S.conversation_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/conversations/{conversation_id}/messages")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_messages",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ConversationMessages$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return ua}var ca={},TK;function ZJe(){if(TK)return ca;TK=1;var e=ca&&ca.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=ca&&ca.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=ca&&ca.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(ca,"__esModule",{value:!0}),ca.betaConversationsList=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.AgentsApiV1ConversationsListRequest$outboundSchema.optional().parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R=(0,p.pathToFunc)("/v1/conversations")(),E=(0,r.encodeFormQuery)({metadata:S?.metadata,page:S?.page,page_size:S?.page_size}),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_list",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:R,headers:T,query:E,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.json(200,o.array(l.ResponseBody$inboundSchema)),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return ca}var da={},RK;function eVe(){if(RK)return da;RK=1;var e=da&&da.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=da&&da.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=da&&da.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(da,"__esModule",{value:!0}),da.betaConversationsRestart=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.AgentsApiV1ConversationsRestartRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.ConversationRestartRequest,{explode:!0}),R={conversation_id:(0,o.encodeSimple)("conversation_id",S.conversation_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/conversations/{conversation_id}/restart")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_conversations_restart",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"POST",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ConversationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return da}var fa={},EK;function tVe(){if(EK)return fa;EK=1;var e=fa&&fa.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),t=fa&&fa.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),n=fa&&fa.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;Rf.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema.parse(K),"Input validation failed");if(!w.ok)return[w,{status:"invalid"}];const R=w.value,E=(0,r.encodeJSON)("body",R.ConversationRestartStreamRequest,{explode:!0}),T={conversation_id:(0,r.encodeSimple)("conversation_id",R.conversation_id,{explode:!1,charEncoding:"percent"})},D=(0,u.pathToFunc)("/v1/conversations/{conversation_id}/restart#stream")(T),B=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),N=await(0,p.extractSecurity)(y._options.apiKey),L=N==null?{}:{apiKey:N},q=(0,p.resolveGlobalSecurity)(L),I={options:y._options,baseURL:S?.serverURL??y._baseURL??"",operationID:"agents_api_v1_conversations_restart_stream",oAuth2Scopes:[],resolvedSecurity:q,securitySource:y._options.apiKey,retryConfig:S?.retries||y._options.retryConfig||{strategy:"none"},retryCodes:S?.retryCodes||["429","500","502","503","504"]},U=y._createRequest(I,{security:q,method:"POST",baseURL:S?.serverURL,path:D,headers:B,body:E,userAgent:y._options.userAgent,timeoutMs:S?.timeoutMs||y._options.timeoutMs||-1},S);if(!U.ok)return[U,{status:"invalid"}];const J=U.value,V=await y._do(J,{context:I,errorCodes:["422","4XX","5XX"],retryConfig:I.retryConfig,retryCodes:I.retryCodes});if(!V.ok)return[V,{status:"request-error",request:J}];const G=V.value,Q={HttpMeta:{Response:G,Request:J}},[le]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(K=>new i.EventStream(K,X=>({value:l.ConversationEvents$inboundSchema.parse(X)})))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(G,J,{extraFields:Q});return le.ok?[le,{status:"complete",request:J,response:G}]:[le,{status:"complete",request:J,response:G}]}return fa}var ha={},MK;function nVe(){if(MK)return ha;MK=1;var e=ha&&ha.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ha&&ha.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ha&&ha.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ConversationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/conversations")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"agents_api_v1_conversations_start",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ConversationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return ha}var pa={},PK;function rVe(){if(PK)return pa;PK=1;var e=pa&&pa.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),t=pa&&pa.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),n=pa&&pa.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;wl.ConversationStreamRequest$outboundSchema.parse(Q),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=(0,r.encodeJSON)("body",w,{explode:!0}),E=(0,u.pathToFunc)("/v1/conversations#stream")(),T=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),D=await(0,p.extractSecurity)(g._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,p.resolveGlobalSecurity)(B),L={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"agents_api_v1_conversations_start_stream",oAuth2Scopes:[],resolvedSecurity:N,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},q=g._createRequest(L,{security:N,method:"POST",baseURL:_?.serverURL,path:E,headers:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await g._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(Q=>new i.EventStream(Q,le=>({value:l.ConversationEvents$inboundSchema.parse(le)})))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return pa}var IK;function oVe(){if(IK)return Iv;IK=1,Object.defineProperty(Iv,"__esModule",{value:!0}),Iv.Conversations=void 0;const e=KJe(),t=QJe(),n=$Je(),o=WJe(),r=YJe(),i=XJe(),s=ZJe(),a=eVe(),c=tVe(),p=nVe(),u=rVe(),l=Gn(),d=Ar();class f extends l.ClientSDK{async start(m,g){return(0,d.unwrapAsync)((0,p.betaConversationsStart)(this,m,g))}async list(m,g){return(0,d.unwrapAsync)((0,s.betaConversationsList)(this,m,g))}async get(m,g){return(0,d.unwrapAsync)((0,o.betaConversationsGet)(this,m,g))}async delete(m,g){return(0,d.unwrapAsync)((0,n.betaConversationsDelete)(this,m,g))}async append(m,g){return(0,d.unwrapAsync)((0,e.betaConversationsAppend)(this,m,g))}async getHistory(m,g){return(0,d.unwrapAsync)((0,r.betaConversationsGetHistory)(this,m,g))}async getMessages(m,g){return(0,d.unwrapAsync)((0,i.betaConversationsGetMessages)(this,m,g))}async restart(m,g){return(0,d.unwrapAsync)((0,a.betaConversationsRestart)(this,m,g))}async startStream(m,g){return(0,d.unwrapAsync)((0,u.betaConversationsStartStream)(this,m,g))}async appendStream(m,g){return(0,d.unwrapAsync)((0,t.betaConversationsAppendStream)(this,m,g))}async restartStream(m,g){return(0,d.unwrapAsync)((0,c.betaConversationsRestartStream)(this,m,g))}}return Iv.Conversations=f,Iv}var jv={},ma={},jK;function iVe(){if(jK)return ma;jK=1;var e=ma&&ma.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ma&&ma.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ma&&ma.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.LibraryIn$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/libraries")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"libraries_create_v1",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(201,p.LibraryOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return ma}var ga={},DK;function sVe(){if(DK)return ga;DK=1;var e=ga&&ga.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=ga&&ga.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=ga&&ga.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(ga,"__esModule",{value:!0}),ga.betaLibrariesDelete=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesDeleteV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_delete_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.LibraryOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return ga}var ba={},NK;function aVe(){if(NK)return ba;NK=1;var e=ba&&ba.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=ba&&ba.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=ba&&ba.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(ba,"__esModule",{value:!0}),ba.betaLibrariesGet=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesGetV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_get_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.LibraryOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return ba}var ya={},LK;function lVe(){if(LK)return ya;LK=1;var e=ya&&ya.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),t=ya&&ya.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),n=ya&&ya.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;ml.LibrariesUpdateV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.LibraryInUpdate,{explode:!0}),R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_update_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"PUT",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.LibraryOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Aa}var Dv={},_a={},xK;function cVe(){if(xK)return _a;xK=1;var e=_a&&_a.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=_a&&_a.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=_a&&_a.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(_a,"__esModule",{value:!0}),_a.betaLibrariesAccessesDelete=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesShareDeleteV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.SharingDelete,{explode:!0}),R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/share")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_share_delete_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.SharingOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return _a}var va={},BK;function dVe(){if(BK)return va;BK=1;var e=va&&va.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=va&&va.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=va&&va.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(va,"__esModule",{value:!0}),va.betaLibrariesAccessesList=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesShareListV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/share")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_share_list_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ListSharingOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return va}var Sa={},kK;function fVe(){if(kK)return Sa;kK=1;var e=Sa&&Sa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Sa&&Sa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Sa&&Sa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.betaLibrariesAccessesUpdateOrCreate=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesShareCreateV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.SharingIn,{explode:!0}),R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/share")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_share_create_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"PUT",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.SharingOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Sa}var UK;function hVe(){if(UK)return Dv;UK=1,Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.Accesses=void 0;const e=cVe(),t=dVe(),n=fVe(),o=Gn(),r=Ar();class i extends o.ClientSDK{async list(a,c){return(0,r.unwrapAsync)((0,t.betaLibrariesAccessesList)(this,a,c))}async updateOrCreate(a,c){return(0,r.unwrapAsync)((0,n.betaLibrariesAccessesUpdateOrCreate)(this,a,c))}async delete(a,c){return(0,r.unwrapAsync)((0,e.betaLibrariesAccessesDelete)(this,a,c))}}return Dv.Accesses=i,Dv}var Nv={},Ca={},qK;function pVe(){if(qK)return Ca;qK=1;var e=Ca&&Ca.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ca&&Ca.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ca&&Ca.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.betaLibrariesDocumentsDelete=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.LibrariesDocumentsDeleteV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,r.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,r.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_delete_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.nil(204,o.void()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ca}var wa={},JK;function mVe(){if(JK)return wa;JK=1;var e=wa&&wa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=wa&&wa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=wa&&wa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(wa,"__esModule",{value:!0}),wa.betaLibrariesDocumentsExtractedTextSignedUrl=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,r.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,r.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_get_extracted_text_signed_url_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.json(200,o.string()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return wa}var Oa={},VK;function gVe(){if(VK)return Oa;VK=1;var e=Oa&&Oa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Oa&&Oa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Oa&&Oa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.betaLibrariesDocumentsGet=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesDocumentsGetV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,o.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_get_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.DocumentOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Oa}var Ta={},HK;function bVe(){if(HK)return Ta;HK=1;var e=Ta&&Ta.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ta&&Ta.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ta&&Ta.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.betaLibrariesDocumentsGetSignedUrl=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,r.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,r.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/signed-url")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_get_signed_url_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.json(200,o.string()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ta}var Ra={},GK;function yVe(){if(GK)return Ra;GK=1;var e=Ra&&Ra.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ra&&Ra.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ra&&Ra.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.betaLibrariesDocumentsList=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,le=>l.LibrariesDocumentsListV1Request$outboundSchema.parse(le),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/documents")(R),T=(0,o.encodeFormQuery)({filters_attributes:S.filters_attributes,page:S.page,page_size:S.page_size,search:S.search,sort_by:S.sort_by,sort_order:S.sort_order}),D=new Headers((0,i.compactMap)({Accept:"application/json"})),B=await(0,a.extractSecurity)(m._options.apiKey),N=B==null?{}:{apiKey:B},L=(0,a.resolveGlobalSecurity)(N),q={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_list_v1",oAuth2Scopes:[],resolvedSecurity:L,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},I=m._createRequest(q,{security:L,method:"GET",baseURL:y?.serverURL,path:E,headers:D,query:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!I.ok)return[I,{status:"invalid"}];const U=I.value,J=await m._do(U,{context:q,errorCodes:["422","4XX","5XX"],retryConfig:q.retryConfig,retryCodes:q.retryCodes});if(!J.ok)return[J,{status:"request-error",request:U}];const V=J.value,G={HttpMeta:{Response:V,Request:U}},[Q]=await r.match(r.json(200,p.ListDocumentOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(V,U,{extraFields:G});return Q.ok?[Q,{status:"complete",request:U,response:V}]:[Q,{status:"complete",request:U,response:V}]}return Ra}var Ea={},zK;function AVe(){if(zK)return Ea;zK=1;var e=Ea&&Ea.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ea&&Ea.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ea&&Ea.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.betaLibrariesDocumentsReprocess=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.LibrariesDocumentsReprocessV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,r.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,r.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/reprocess")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_reprocess_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"POST",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.nil(204,o.void()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ea}var Ma={},KK;function _Ve(){if(KK)return Ma;KK=1;var e=Ma&&Ma.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ma&&Ma.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ma&&Ma.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.betaLibrariesDocumentsStatus=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesDocumentsGetStatusV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,o.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/status")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_get_status_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.ProcessingStatusOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ma}var Pa={},QK;function vVe(){if(QK)return Pa;QK=1;var e=Pa&&Pa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Pa&&Pa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Pa&&Pa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.betaLibrariesDocumentsTextContent=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesDocumentsGetTextContentV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={document_id:(0,o.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/text_content")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_get_text_content_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"GET",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.DocumentTextContent$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Pa}var Ia={},$K;function SVe(){if($K)return Ia;$K=1;var e=Ia&&Ia.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ia&&Ia.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ia&&Ia.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.betaLibrariesDocumentsUpdate=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.LibrariesDocumentsUpdateV1Request$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.DocumentUpdateIn,{explode:!0}),R={document_id:(0,o.encodeSimple)("document_id",S.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,o.encodeSimple)("library_id",S.library_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"libraries_documents_update_v1",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"PUT",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.DocumentOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ia}var ja={},WK;function CVe(){if(WK)return ja;WK=1;var e=ja&&ja.__createBinding||(Object.create?(function(_,S,w,R){R===void 0&&(R=w);var E=Object.getOwnPropertyDescriptor(S,w);(!E||("get"in E?!S.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return S[w]}}),Object.defineProperty(_,R,E)}):(function(_,S,w,R){R===void 0&&(R=w),_[R]=S[w]})),t=ja&&ja.__setModuleDefault||(Object.create?(function(_,S){Object.defineProperty(_,"default",{enumerable:!0,value:S})}):function(_,S){_.default=S}),n=ja&&ja.__importStar||(function(){var _=function(S){return _=Object.getOwnPropertyNames||function(w){var R=[];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[R.length]=E);return R},_(S)};return function(S){if(S&&S.__esModule)return S;var w={};if(S!=null)for(var R=_(S),E=0;Ed.LibrariesDocumentsUploadV1Request$outboundSchema.parse(X),"Input validation failed");if(!R.ok)return[R,{status:"invalid"}];const E=R.value,T=new FormData;if((0,h.isBlobLike)(E.RequestBody.file))(0,o.appendForm)(T,"file",E.RequestBody.file);else if((0,m.isReadableStream)(E.RequestBody.file.content)){const X=await(0,r.readableStreamToArrayBuffer)(E.RequestBody.file.content),ce=(0,r.getContentTypeFromFileName)(E.RequestBody.file.fileName)||"application/octet-stream",W=new Blob([X],{type:ce});(0,o.appendForm)(T,"file",W,E.RequestBody.file.fileName)}else{const X=(0,r.getContentTypeFromFileName)(E.RequestBody.file.fileName)||"application/octet-stream";(0,o.appendForm)(T,"file",new Blob([E.RequestBody.file.content],{type:X}),E.RequestBody.file.fileName)}const D={library_id:(0,o.encodeSimple)("library_id",E.library_id,{explode:!1,charEncoding:"percent"})},B=(0,p.pathToFunc)("/v1/libraries/{library_id}/documents")(D),N=new Headers((0,s.compactMap)({Accept:"application/json"})),L=await(0,c.extractSecurity)(_._options.apiKey),q=L==null?{}:{apiKey:L},I=(0,c.resolveGlobalSecurity)(q),U={options:_._options,baseURL:w?.serverURL??_._baseURL??"",operationID:"libraries_documents_upload_v1",oAuth2Scopes:[],resolvedSecurity:I,securitySource:_._options.apiKey,retryConfig:w?.retries||_._options.retryConfig||{strategy:"none"},retryCodes:w?.retryCodes||["429","500","502","503","504"]},J=_._createRequest(U,{security:I,method:"POST",baseURL:w?.serverURL,path:B,headers:N,body:T,userAgent:_._options.userAgent,timeoutMs:w?.timeoutMs||_._options.timeoutMs||-1},w);if(!J.ok)return[J,{status:"invalid"}];const V=J.value,G=await _._do(V,{context:U,errorCodes:["422","4XX","5XX"],retryConfig:U.retryConfig,retryCodes:U.retryCodes});if(!G.ok)return[G,{status:"request-error",request:V}];const Q=G.value,le={HttpMeta:{Response:Q,Request:V}},[K]=await i.match(i.json([200,201],u.DocumentOut$inboundSchema),i.jsonErr(422,l.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(Q,V,{extraFields:le});return K.ok?[K,{status:"complete",request:V,response:Q}]:[K,{status:"complete",request:V,response:Q}]}return ja}var YK;function wVe(){if(YK)return Nv;YK=1,Object.defineProperty(Nv,"__esModule",{value:!0}),Nv.Documents=void 0;const e=pVe(),t=mVe(),n=gVe(),o=bVe(),r=yVe(),i=AVe(),s=_Ve(),a=vVe(),c=SVe(),p=CVe(),u=Gn(),l=Ar();class d extends u.ClientSDK{async list(h,m){return(0,l.unwrapAsync)((0,r.betaLibrariesDocumentsList)(this,h,m))}async upload(h,m){return(0,l.unwrapAsync)((0,p.betaLibrariesDocumentsUpload)(this,h,m))}async get(h,m){return(0,l.unwrapAsync)((0,n.betaLibrariesDocumentsGet)(this,h,m))}async update(h,m){return(0,l.unwrapAsync)((0,c.betaLibrariesDocumentsUpdate)(this,h,m))}async delete(h,m){return(0,l.unwrapAsync)((0,e.betaLibrariesDocumentsDelete)(this,h,m))}async textContent(h,m){return(0,l.unwrapAsync)((0,a.betaLibrariesDocumentsTextContent)(this,h,m))}async status(h,m){return(0,l.unwrapAsync)((0,s.betaLibrariesDocumentsStatus)(this,h,m))}async getSignedUrl(h,m){return(0,l.unwrapAsync)((0,o.betaLibrariesDocumentsGetSignedUrl)(this,h,m))}async extractedTextSignedUrl(h,m){return(0,l.unwrapAsync)((0,t.betaLibrariesDocumentsExtractedTextSignedUrl)(this,h,m))}async reprocess(h,m){return(0,l.unwrapAsync)((0,i.betaLibrariesDocumentsReprocess)(this,h,m))}}return Nv.Documents=d,Nv}var XK;function OVe(){if(XK)return jv;XK=1,Object.defineProperty(jv,"__esModule",{value:!0}),jv.Libraries=void 0;const e=iVe(),t=sVe(),n=aVe(),o=lVe(),r=uVe(),i=Gn(),s=Ar(),a=hVe(),c=wVe();class p extends i.ClientSDK{get documents(){return this._documents??(this._documents=new c.Documents(this._options))}get accesses(){return this._accesses??(this._accesses=new a.Accesses(this._options))}async list(l){return(0,s.unwrapAsync)((0,o.betaLibrariesList)(this,l))}async create(l,d){return(0,s.unwrapAsync)((0,e.betaLibrariesCreate)(this,l,d))}async get(l,d){return(0,s.unwrapAsync)((0,n.betaLibrariesGet)(this,l,d))}async delete(l,d){return(0,s.unwrapAsync)((0,t.betaLibrariesDelete)(this,l,d))}async update(l,d){return(0,s.unwrapAsync)((0,r.betaLibrariesUpdate)(this,l,d))}}return jv.Libraries=p,jv}var Lv={},Da={},ZK;function TVe(){if(ZK)return Da;ZK=1;var e=Da&&Da.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Da&&Da.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Da&&Da.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.AgentCreationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/agents")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"agents_api_v1_agents_create",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.Agent$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Da}var Na={},e7;function RVe(){if(e7)return Na;e7=1;var e=Na&&Na.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Na&&Na.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Na&&Na.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Na,"__esModule",{value:!0}),Na.betaAgentsDelete=f;const o=n(ne()),r=$e(),i=n(Ge()),s=ae(),a=ee(),c=ze(),p=Je(),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,a.safeParse)(g,Q=>l.AgentsApiV1AgentsDeleteRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={agent_id:(0,r.encodeSimple)("agent_id",S.agent_id,{explode:!1,charEncoding:"percent"})},E=(0,p.pathToFunc)("/v1/agents/{agent_id}")(R),T=new Headers((0,s.compactMap)({Accept:"application/json"})),D=await(0,c.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,c.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_agents_delete",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await i.match(i.nil(204,o.void()),i.jsonErr(422,u.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Na}var La={},t7;function EVe(){if(t7)return La;t7=1;var e=La&&La.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=La&&La.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=La&&La.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(La,"__esModule",{value:!0}),La.betaAgentsGet=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,le=>l.AgentsApiV1AgentsGetRequest$outboundSchema.parse(le),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={agent_id:(0,o.encodeSimple)("agent_id",S.agent_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/agents/{agent_id}")(R),T=(0,o.encodeFormQuery)({agent_version:S.agent_version}),D=new Headers((0,i.compactMap)({Accept:"application/json"})),B=await(0,a.extractSecurity)(m._options.apiKey),N=B==null?{}:{apiKey:B},L=(0,a.resolveGlobalSecurity)(N),q={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_agents_get",oAuth2Scopes:[],resolvedSecurity:L,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},I=m._createRequest(q,{security:L,method:"GET",baseURL:y?.serverURL,path:E,headers:D,query:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!I.ok)return[I,{status:"invalid"}];const U=I.value,J=await m._do(U,{context:q,errorCodes:["422","4XX","5XX"],retryConfig:q.retryConfig,retryCodes:q.retryCodes});if(!J.ok)return[J,{status:"request-error",request:U}];const V=J.value,G={HttpMeta:{Response:V,Request:U}},[Q]=await r.match(r.json(200,p.Agent$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(V,U,{extraFields:G});return Q.ok?[Q,{status:"complete",request:U,response:V}]:[Q,{status:"complete",request:U,response:V}]}return La}var Fa={},n7;function MVe(){if(n7)return Fa;n7=1;var e=Fa&&Fa.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),t=Fa&&Fa.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),n=Fa&&Fa.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;wd.AgentsApiV1AgentsListRequest$outboundSchema.optional().parse(le),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=null,E=(0,p.pathToFunc)("/v1/agents")(),T=(0,r.encodeFormQuery)({deployment_chat:w?.deployment_chat,id:w?.id,metadata:w?.metadata,name:w?.name,page:w?.page,page_size:w?.page_size,sources:w?.sources}),D=new Headers((0,s.compactMap)({Accept:"application/json"})),B=await(0,c.extractSecurity)(g._options.apiKey),N=B==null?{}:{apiKey:B},L=(0,c.resolveGlobalSecurity)(N),q={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"agents_api_v1_agents_list",oAuth2Scopes:[],resolvedSecurity:L,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},I=g._createRequest(q,{security:L,method:"GET",baseURL:_?.serverURL,path:E,headers:D,query:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!I.ok)return[I,{status:"invalid"}];const U=I.value,J=await g._do(U,{context:q,errorCodes:["422","4XX","5XX"],retryConfig:q.retryConfig,retryCodes:q.retryCodes});if(!J.ok)return[J,{status:"request-error",request:U}];const V=J.value,G={HttpMeta:{Response:V,Request:U}},[Q]=await i.match(i.json(200,o.array(u.Agent$inboundSchema)),i.jsonErr(422,l.HTTPValidationError$inboundSchema),i.fail("4XX"),i.fail("5XX"))(V,U,{extraFields:G});return Q.ok?[Q,{status:"complete",request:U,response:V}]:[Q,{status:"complete",request:U,response:V}]}return Fa}var xa={},r7;function PVe(){if(r7)return xa;r7=1;var e=xa&&xa.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=xa&&xa.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=xa&&xa.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(xa,"__esModule",{value:!0}),xa.betaAgentsUpdate=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.AgentsApiV1AgentsUpdateRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=(0,o.encodeJSON)("body",S.AgentUpdateRequest,{explode:!0}),R={agent_id:(0,o.encodeSimple)("agent_id",S.agent_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/agents/{agent_id}")(R),T=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_agents_update",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"PATCH",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.Agent$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return xa}var Ba={},o7;function IVe(){if(o7)return Ba;o7=1;var e=Ba&&Ba.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=Ba&&Ba.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=Ba&&Ba.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.betaAgentsUpdateVersion=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,le=>l.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema.parse(le),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={agent_id:(0,o.encodeSimple)("agent_id",S.agent_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/agents/{agent_id}/version")(R),T=(0,o.encodeFormQuery)({version:S.version}),D=new Headers((0,i.compactMap)({Accept:"application/json"})),B=await(0,a.extractSecurity)(m._options.apiKey),N=B==null?{}:{apiKey:B},L=(0,a.resolveGlobalSecurity)(N),q={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"agents_api_v1_agents_update_version",oAuth2Scopes:[],resolvedSecurity:L,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},I=m._createRequest(q,{security:L,method:"PATCH",baseURL:y?.serverURL,path:E,headers:D,query:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!I.ok)return[I,{status:"invalid"}];const U=I.value,J=await m._do(U,{context:q,errorCodes:["422","4XX","5XX"],retryConfig:q.retryConfig,retryCodes:q.retryCodes});if(!J.ok)return[J,{status:"request-error",request:U}];const V=J.value,G={HttpMeta:{Response:V,Request:U}},[Q]=await r.match(r.json(200,p.Agent$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(V,U,{extraFields:G});return Q.ok?[Q,{status:"complete",request:U,response:V}]:[Q,{status:"complete",request:U,response:V}]}return Ba}var i7;function jVe(){if(i7)return Lv;i7=1,Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.MistralAgents=void 0;const e=TVe(),t=RVe(),n=EVe(),o=MVe(),r=PVe(),i=IVe(),s=Gn(),a=Ar();class c extends s.ClientSDK{async create(u,l){return(0,a.unwrapAsync)((0,e.betaAgentsCreate)(this,u,l))}async list(u,l){return(0,a.unwrapAsync)((0,o.betaAgentsList)(this,u,l))}async get(u,l){return(0,a.unwrapAsync)((0,n.betaAgentsGet)(this,u,l))}async update(u,l){return(0,a.unwrapAsync)((0,r.betaAgentsUpdate)(this,u,l))}async delete(u,l){return(0,a.unwrapAsync)((0,t.betaAgentsDelete)(this,u,l))}async updateVersion(u,l){return(0,a.unwrapAsync)((0,i.betaAgentsUpdateVersion)(this,u,l))}}return Lv.MistralAgents=c,Lv}var s7;function DVe(){if(s7)return Pv;s7=1,Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Beta=void 0;const e=Gn(),t=oVe(),n=OVe(),o=jVe();class r extends e.ClientSDK{get conversations(){return this._conversations??(this._conversations=new t.Conversations(this._options))}get agents(){return this._agents??(this._agents=new o.MistralAgents(this._options))}get libraries(){return this._libraries??(this._libraries=new n.Libraries(this._options))}}return Pv.Beta=r,Pv}var Fv={},ka={},a7;function NVe(){if(a7)return ka;a7=1;var e=ka&&ka.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ka&&ka.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ka&&ka.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ChatCompletionRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/chat/completions")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"chat_completion_v1_chat_completions_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ChatCompletionResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return ka}var Ua={},l7;function LVe(){if(l7)return Ua;l7=1;var e=Ua&&Ua.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),t=Ua&&Ua.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),n=Ua&&Ua.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;wl.ChatCompletionStreamRequest$outboundSchema.parse(Q),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=(0,r.encodeJSON)("body",w,{explode:!0}),E=(0,u.pathToFunc)("/v1/chat/completions#stream")(),T=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),D=await(0,p.extractSecurity)(g._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,p.resolveGlobalSecurity)(B),L={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"stream_chat",oAuth2Scopes:[],resolvedSecurity:N,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},q=g._createRequest(L,{security:N,method:"POST",baseURL:_?.serverURL,path:E,headers:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await g._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(Q=>new i.EventStream(Q,le=>le.data==="[DONE]"?{done:!0}:{value:l.CompletionEvent$inboundSchema.parse(le)}))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Ua}var Ay={},pg={},tN={},u7;function aB(){return u7||(u7=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultOptions=e.defaultOptions=e.jsonDescription=e.ignoreOverride=void 0,e.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use");const t=(o,r)=>{if(r.description)try{return{...o,...JSON.parse(r.description)}}catch{}return o};e.jsonDescription=t,e.defaultOptions={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"};const n=o=>typeof o=="string"?{...e.defaultOptions,name:o}:{...e.defaultOptions,...o};e.getDefaultOptions=n})(tN)),tN}var xv={},c7;function Lse(){if(c7)return xv;c7=1,Object.defineProperty(xv,"__esModule",{value:!0}),xv.getRefs=void 0;const e=aB(),t=n=>{const o=(0,e.getDefaultOptions)(n),r=o.name!==void 0?[...o.basePath,o.definitionPath,o.name]:o.basePath;return{...o,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(o.definitions).map(([i,s])=>[s._def,{def:s._def,path:[...o.basePath,o.definitionPath,i],jsonSchema:void 0}]))}};return xv.getRefs=t,xv}var mg={},d7;function fb(){if(d7)return mg;d7=1,Object.defineProperty(mg,"__esModule",{value:!0}),mg.setResponseValueAndErrors=mg.addErrorMessage=void 0;function e(n,o,r,i){i?.errorMessages&&r&&(n.errorMessage={...n.errorMessage,[o]:r})}mg.addErrorMessage=e;function t(n,o,r,i,s){n[o]=r,e(n,o,i,s)}return mg.setResponseValueAndErrors=t,mg}var Bv={},f7;function lB(){if(f7)return Bv;f7=1,Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.getRelativePath=void 0;const e=(t,n)=>{let o=0;for(;o(0,e.parseDef)(n.innerType._def,o);return zv.parseCatchDef=t,zv}var Kv={},_7;function Use(){if(_7)return Kv;_7=1,Object.defineProperty(Kv,"__esModule",{value:!0}),Kv.parseDateDef=void 0;const e=fb();function t(o,r,i){const s=i??r.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((a,c)=>t(o,r,a))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return n(o,r)}}Kv.parseDateDef=t;const n=(o,r)=>{const i={type:"integer",format:"unix-time"};if(r.target==="openApi3")return i;for(const s of o.checks)switch(s.kind){case"min":(0,e.setResponseValueAndErrors)(i,"minimum",s.value,s.message,r);break;case"max":(0,e.setResponseValueAndErrors)(i,"maximum",s.value,s.message,r);break}return i};return Kv}var Qv={},v7;function qse(){if(v7)return Qv;v7=1,Object.defineProperty(Qv,"__esModule",{value:!0}),Qv.parseDefaultDef=void 0;const e=_r();function t(n,o){return{...(0,e.parseDef)(n.innerType._def,o),default:n.defaultValue()}}return Qv.parseDefaultDef=t,Qv}var $v={},S7;function Jse(){if(S7)return $v;S7=1,Object.defineProperty($v,"__esModule",{value:!0}),$v.parseEffectsDef=void 0;const e=_r(),t=Is();function n(o,r){return r.effectStrategy==="input"?(0,e.parseDef)(o.schema._def,r):(0,t.parseAnyDef)(r)}return $v.parseEffectsDef=n,$v}var Wv={},C7;function Vse(){if(C7)return Wv;C7=1,Object.defineProperty(Wv,"__esModule",{value:!0}),Wv.parseEnumDef=void 0;function e(t){return{type:"string",enum:Array.from(t.values)}}return Wv.parseEnumDef=e,Wv}var Yv={},w7;function Hse(){if(w7)return Yv;w7=1,Object.defineProperty(Yv,"__esModule",{value:!0}),Yv.parseIntersectionDef=void 0;const e=_r(),t=o=>"type"in o&&o.type==="string"?!1:"allOf"in o;function n(o,r){const i=[(0,e.parseDef)(o.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),(0,e.parseDef)(o.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(c=>!!c);let s=r.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const a=[];return i.forEach(c=>{if(t(c))a.push(...c.allOf),c.unevaluatedProperties===void 0&&(s=void 0);else{let p=c;if("additionalProperties"in c&&c.additionalProperties===!1){const{additionalProperties:u,...l}=c;p=l}else s=void 0;a.push(p)}}),a.length?{allOf:a,...s}:void 0}return Yv.parseIntersectionDef=n,Yv}var Xv={},O7;function Gse(){if(O7)return Xv;O7=1,Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.parseLiteralDef=void 0;function e(t,n){const o=typeof t.value;return o!=="bigint"&&o!=="number"&&o!=="boolean"&&o!=="string"?{type:Array.isArray(t.value)?"array":"object"}:n.target==="openApi3"?{type:o==="bigint"?"integer":o,enum:[t.value]}:{type:o==="bigint"?"integer":o,const:t.value}}return Xv.parseLiteralDef=e,Xv}var Zv={},eS={},nN={},T7;function dB(){return T7||(T7=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseStringDef=e.zodPatterns=void 0;const t=fb();let n;e.zodPatterns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(n===void 0&&(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function o(u,l){const d={type:"string"};if(u.checks)for(const f of u.checks)switch(f.kind){case"min":(0,t.setResponseValueAndErrors)(d,"minLength",typeof d.minLength=="number"?Math.max(d.minLength,f.value):f.value,f.message,l);break;case"max":(0,t.setResponseValueAndErrors)(d,"maxLength",typeof d.maxLength=="number"?Math.min(d.maxLength,f.value):f.value,f.message,l);break;case"email":switch(l.emailStrategy){case"format:email":a(d,"email",f.message,l);break;case"format:idn-email":a(d,"idn-email",f.message,l);break;case"pattern:zod":c(d,e.zodPatterns.email,f.message,l);break}break;case"url":a(d,"uri",f.message,l);break;case"uuid":a(d,"uuid",f.message,l);break;case"regex":c(d,f.regex,f.message,l);break;case"cuid":c(d,e.zodPatterns.cuid,f.message,l);break;case"cuid2":c(d,e.zodPatterns.cuid2,f.message,l);break;case"startsWith":c(d,RegExp(`^${r(f.value,l)}`),f.message,l);break;case"endsWith":c(d,RegExp(`${r(f.value,l)}$`),f.message,l);break;case"datetime":a(d,"date-time",f.message,l);break;case"date":a(d,"date",f.message,l);break;case"time":a(d,"time",f.message,l);break;case"duration":a(d,"duration",f.message,l);break;case"length":(0,t.setResponseValueAndErrors)(d,"minLength",typeof d.minLength=="number"?Math.max(d.minLength,f.value):f.value,f.message,l),(0,t.setResponseValueAndErrors)(d,"maxLength",typeof d.maxLength=="number"?Math.min(d.maxLength,f.value):f.value,f.message,l);break;case"includes":{c(d,RegExp(r(f.value,l)),f.message,l);break}case"ip":{f.version!=="v6"&&a(d,"ipv4",f.message,l),f.version!=="v4"&&a(d,"ipv6",f.message,l);break}case"base64url":c(d,e.zodPatterns.base64url,f.message,l);break;case"jwt":c(d,e.zodPatterns.jwt,f.message,l);break;case"cidr":{f.version!=="v6"&&c(d,e.zodPatterns.ipv4Cidr,f.message,l),f.version!=="v4"&&c(d,e.zodPatterns.ipv6Cidr,f.message,l);break}case"emoji":c(d,e.zodPatterns.emoji(),f.message,l);break;case"ulid":{c(d,e.zodPatterns.ulid,f.message,l);break}case"base64":{switch(l.base64Strategy){case"format:binary":{a(d,"binary",f.message,l);break}case"contentEncoding:base64":{(0,t.setResponseValueAndErrors)(d,"contentEncoding","base64",f.message,l);break}case"pattern:zod":{c(d,e.zodPatterns.base64,f.message,l);break}}break}case"nanoid":c(d,e.zodPatterns.nanoid,f.message,l)}return d}e.parseStringDef=o;function r(u,l){return l.patternStrategy==="escape"?s(u):u}const i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function s(u){let l="";for(let d=0;dh.format)?(u.anyOf||(u.anyOf=[]),u.format&&(u.anyOf.push({format:u.format,...u.errorMessage&&f.errorMessages&&{errorMessage:{format:u.errorMessage.format}}}),delete u.format,u.errorMessage&&(delete u.errorMessage.format,Object.keys(u.errorMessage).length===0&&delete u.errorMessage)),u.anyOf.push({format:l,...d&&f.errorMessages&&{errorMessage:{format:d}}})):(0,t.setResponseValueAndErrors)(u,"format",l,d,f)}function c(u,l,d,f){u.pattern||u.allOf?.some(h=>h.pattern)?(u.allOf||(u.allOf=[]),u.pattern&&(u.allOf.push({pattern:u.pattern,...u.errorMessage&&f.errorMessages&&{errorMessage:{pattern:u.errorMessage.pattern}}}),delete u.pattern,u.errorMessage&&(delete u.errorMessage.pattern,Object.keys(u.errorMessage).length===0&&delete u.errorMessage)),u.allOf.push({pattern:p(l,f),...d&&f.errorMessages&&{errorMessage:{pattern:d}}})):(0,t.setResponseValueAndErrors)(u,"pattern",p(l,f),d,f)}function p(u,l){if(!l.applyRegexFlags||!u.flags)return u.source;const d={i:u.flags.includes("i"),m:u.flags.includes("m"),s:u.flags.includes("s")},f=d.i?u.source.toLowerCase():u.source;let h="",m=!1,g=!1,y=!1;for(let _=0;_({...p,[u]:(0,t.parseDef)(s.valueType._def,{...a,currentPath:[...a.currentPath,"properties",u]})??(0,r.parseAnyDef)(a)}),{}),additionalProperties:a.rejectedAdditionalProperties};const c={type:"object",additionalProperties:(0,t.parseDef)(s.valueType._def,{...a,currentPath:[...a.currentPath,"additionalProperties"]})??a.allowedAdditionalProperties};if(a.target==="openApi3")return c;if(s.keyType?._def.typeName===e.ZodFirstPartyTypeKind.ZodString&&s.keyType._def.checks?.length){const{type:p,...u}=(0,n.parseStringDef)(s.keyType._def,a);return{...c,propertyNames:u}}else{if(s.keyType?._def.typeName===e.ZodFirstPartyTypeKind.ZodEnum)return{...c,propertyNames:{enum:s.keyType._def.values}};if(s.keyType?._def.typeName===e.ZodFirstPartyTypeKind.ZodBranded&&s.keyType._def.type._def.typeName===e.ZodFirstPartyTypeKind.ZodString&&s.keyType._def.type._def.checks?.length){const{type:p,...u}=(0,o.parseBrandedDef)(s.keyType._def,a);return{...c,propertyNames:u}}}return c}return eS.parseRecordDef=i,eS}var E7;function zse(){if(E7)return Zv;E7=1,Object.defineProperty(Zv,"__esModule",{value:!0}),Zv.parseMapDef=void 0;const e=_r(),t=fB(),n=Is();function o(r,i){if(i.mapStrategy==="record")return(0,t.parseRecordDef)(r,i);const s=(0,e.parseDef)(r.keyType._def,{...i,currentPath:[...i.currentPath,"items","items","0"]})||(0,n.parseAnyDef)(i),a=(0,e.parseDef)(r.valueType._def,{...i,currentPath:[...i.currentPath,"items","items","1"]})||(0,n.parseAnyDef)(i);return{type:"array",maxItems:125,items:{type:"array",items:[s,a],minItems:2,maxItems:2}}}return Zv.parseMapDef=o,Zv}var tS={},M7;function Kse(){if(M7)return tS;M7=1,Object.defineProperty(tS,"__esModule",{value:!0}),tS.parseNativeEnumDef=void 0;function e(t){const n=t.values,r=Object.keys(t.values).filter(s=>typeof n[n[s]]!="number").map(s=>n[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}return tS.parseNativeEnumDef=e,tS}var nS={},P7;function Qse(){if(P7)return nS;P7=1,Object.defineProperty(nS,"__esModule",{value:!0}),nS.parseNeverDef=void 0;const e=Is();function t(n){return n.target==="openAi"?void 0:{not:(0,e.parseAnyDef)({...n,currentPath:[...n.currentPath,"not"]})}}return nS.parseNeverDef=t,nS}var rS={},I7;function $se(){if(I7)return rS;I7=1,Object.defineProperty(rS,"__esModule",{value:!0}),rS.parseNullDef=void 0;function e(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}return rS.parseNullDef=e,rS}var oS={},rN={},j7;function hB(){return j7||(j7=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseUnionDef=e.primitiveMappings=void 0;const t=_r();e.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function n(r,i){if(i.target==="openApi3")return o(r,i);const s=r.options instanceof Map?Array.from(r.options.values()):r.options;if(s.every(a=>a._def.typeName in e.primitiveMappings&&(!a._def.checks||!a._def.checks.length))){const a=s.reduce((c,p)=>{const u=e.primitiveMappings[p._def.typeName];return u&&!c.includes(u)?[...c,u]:c},[]);return{type:a.length>1?a:a[0]}}else if(s.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){const a=s.reduce((c,p)=>{const u=typeof p._def.value;switch(u){case"string":case"number":case"boolean":return[...c,u];case"bigint":return[...c,"integer"];case"object":if(p._def.value===null)return[...c,"null"];default:return c}},[]);if(a.length===s.length){const c=a.filter((p,u,l)=>l.indexOf(p)===u);return{type:c.length>1?c:c[0],enum:s.reduce((p,u)=>p.includes(u._def.value)?p:[...p,u._def.value],[])}}}else if(s.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:s.reduce((a,c)=>[...a,...c._def.values.filter(p=>!a.includes(p))],[])};return o(r,i)}e.parseUnionDef=n;const o=(r,i)=>{const s=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((a,c)=>(0,t.parseDef)(a._def,{...i,currentPath:[...i.currentPath,"anyOf",`${c}`]})).filter(a=>!!a&&(!i.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return s.length?{anyOf:s}:void 0}})(rN)),rN}var D7;function Wse(){if(D7)return oS;D7=1,Object.defineProperty(oS,"__esModule",{value:!0}),oS.parseNullableDef=void 0;const e=_r(),t=hB();function n(o,r){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(o.innerType._def.typeName)&&(!o.innerType._def.checks||!o.innerType._def.checks.length))return r.target==="openApi3"?{type:t.primitiveMappings[o.innerType._def.typeName],nullable:!0}:{type:[t.primitiveMappings[o.innerType._def.typeName],"null"]};if(r.target==="openApi3"){const s=(0,e.parseDef)(o.innerType._def,{...r,currentPath:[...r.currentPath]});return s&&"$ref"in s?{allOf:[s],nullable:!0}:s&&{...s,nullable:!0}}const i=(0,e.parseDef)(o.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return i&&{anyOf:[i,{type:"null"}]}}return oS.parseNullableDef=n,oS}var iS={},N7;function Yse(){if(N7)return iS;N7=1,Object.defineProperty(iS,"__esModule",{value:!0}),iS.parseNumberDef=void 0;const e=fb();function t(n,o){const r={type:"number"};if(!n.checks)return r;for(const i of n.checks)switch(i.kind){case"int":r.type="integer",(0,e.addErrorMessage)(r,"type",i.message,o);break;case"min":o.target==="jsonSchema7"?i.inclusive?(0,e.setResponseValueAndErrors)(r,"minimum",i.value,i.message,o):(0,e.setResponseValueAndErrors)(r,"exclusiveMinimum",i.value,i.message,o):(i.inclusive||(r.exclusiveMinimum=!0),(0,e.setResponseValueAndErrors)(r,"minimum",i.value,i.message,o));break;case"max":o.target==="jsonSchema7"?i.inclusive?(0,e.setResponseValueAndErrors)(r,"maximum",i.value,i.message,o):(0,e.setResponseValueAndErrors)(r,"exclusiveMaximum",i.value,i.message,o):(i.inclusive||(r.exclusiveMaximum=!0),(0,e.setResponseValueAndErrors)(r,"maximum",i.value,i.message,o));break;case"multipleOf":(0,e.setResponseValueAndErrors)(r,"multipleOf",i.value,i.message,o);break}return r}return iS.parseNumberDef=t,iS}var sS={},L7;function Xse(){if(L7)return sS;L7=1,Object.defineProperty(sS,"__esModule",{value:!0}),sS.parseObjectDef=void 0;const e=_r();function t(r,i){const s=i.target==="openAi",a={type:"object",properties:{}},c=[],p=r.shape();for(const l in p){let d=p[l];if(d===void 0||d._def===void 0)continue;let f=o(d);f&&s&&(d._def.typeName==="ZodOptional"&&(d=d._def.innerType),d.isNullable()||(d=d.nullable()),f=!1);const h=(0,e.parseDef)(d._def,{...i,currentPath:[...i.currentPath,"properties",l],propertyPath:[...i.currentPath,"properties",l]});h!==void 0&&(a.properties[l]=h,f||c.push(l))}c.length&&(a.required=c);const u=n(r,i);return u!==void 0&&(a.additionalProperties=u),a}sS.parseObjectDef=t;function n(r,i){if(r.catchall._def.typeName!=="ZodNever")return(0,e.parseDef)(r.catchall._def,{...i,currentPath:[...i.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return i.allowedAdditionalProperties;case"strict":return i.rejectedAdditionalProperties;case"strip":return i.removeAdditionalStrategy==="strict"?i.allowedAdditionalProperties:i.rejectedAdditionalProperties}}function o(r){try{return r.isOptional()}catch{return!0}}return sS}var aS={},F7;function Zse(){if(F7)return aS;F7=1,Object.defineProperty(aS,"__esModule",{value:!0}),aS.parseOptionalDef=void 0;const e=_r(),t=Is(),n=(o,r)=>{if(r.currentPath.toString()===r.propertyPath?.toString())return(0,e.parseDef)(o.innerType._def,r);const i=(0,e.parseDef)(o.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return i?{anyOf:[{not:(0,t.parseAnyDef)(r)},i]}:(0,t.parseAnyDef)(r)};return aS.parseOptionalDef=n,aS}var lS={},x7;function eae(){if(x7)return lS;x7=1,Object.defineProperty(lS,"__esModule",{value:!0}),lS.parsePipelineDef=void 0;const e=_r(),t=(n,o)=>{if(o.pipeStrategy==="input")return(0,e.parseDef)(n.in._def,o);if(o.pipeStrategy==="output")return(0,e.parseDef)(n.out._def,o);const r=(0,e.parseDef)(n.in._def,{...o,currentPath:[...o.currentPath,"allOf","0"]}),i=(0,e.parseDef)(n.out._def,{...o,currentPath:[...o.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(s=>s!==void 0)}};return lS.parsePipelineDef=t,lS}var uS={},B7;function tae(){if(B7)return uS;B7=1,Object.defineProperty(uS,"__esModule",{value:!0}),uS.parsePromiseDef=void 0;const e=_r();function t(n,o){return(0,e.parseDef)(n.type._def,o)}return uS.parsePromiseDef=t,uS}var cS={},k7;function nae(){if(k7)return cS;k7=1,Object.defineProperty(cS,"__esModule",{value:!0}),cS.parseSetDef=void 0;const e=fb(),t=_r();function n(o,r){const s={type:"array",uniqueItems:!0,items:(0,t.parseDef)(o.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})};return o.minSize&&(0,e.setResponseValueAndErrors)(s,"minItems",o.minSize.value,o.minSize.message,r),o.maxSize&&(0,e.setResponseValueAndErrors)(s,"maxItems",o.maxSize.value,o.maxSize.message,r),s}return cS.parseSetDef=n,cS}var dS={},U7;function rae(){if(U7)return dS;U7=1,Object.defineProperty(dS,"__esModule",{value:!0}),dS.parseTupleDef=void 0;const e=_r();function t(n,o){return n.rest?{type:"array",minItems:n.items.length,items:n.items.map((r,i)=>(0,e.parseDef)(r._def,{...o,currentPath:[...o.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:(0,e.parseDef)(n.rest._def,{...o,currentPath:[...o.currentPath,"additionalItems"]})}:{type:"array",minItems:n.items.length,maxItems:n.items.length,items:n.items.map((r,i)=>(0,e.parseDef)(r._def,{...o,currentPath:[...o.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}return dS.parseTupleDef=t,dS}var fS={},q7;function oae(){if(q7)return fS;q7=1,Object.defineProperty(fS,"__esModule",{value:!0}),fS.parseUndefinedDef=void 0;const e=Is();function t(n){return{not:(0,e.parseAnyDef)(n)}}return fS.parseUndefinedDef=t,fS}var hS={},J7;function iae(){if(J7)return hS;J7=1,Object.defineProperty(hS,"__esModule",{value:!0}),hS.parseUnknownDef=void 0;const e=Is();function t(n){return(0,e.parseAnyDef)(n)}return hS.parseUnknownDef=t,hS}var pS={},V7;function sae(){if(V7)return pS;V7=1,Object.defineProperty(pS,"__esModule",{value:!0}),pS.parseReadonlyDef=void 0;const e=_r(),t=(n,o)=>(0,e.parseDef)(n.innerType._def,o);return pS.parseReadonlyDef=t,pS}var H7;function aae(){if(H7)return Uv;H7=1,Object.defineProperty(Uv,"__esModule",{value:!0}),Uv.selectParser=void 0;const e=uB(),t=Is(),n=Fse(),o=xse(),r=Bse(),i=cB(),s=kse(),a=Use(),c=qse(),p=Jse(),u=Vse(),l=Hse(),d=Gse(),f=zse(),h=Kse(),m=Qse(),g=$se(),y=Wse(),_=Yse(),S=Xse(),w=Zse(),R=eae(),E=tae(),T=fB(),D=nae(),B=dB(),N=rae(),L=oae(),q=hB(),I=iae(),U=sae(),J=(V,G,Q)=>{switch(G){case e.ZodFirstPartyTypeKind.ZodString:return(0,B.parseStringDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodNumber:return(0,_.parseNumberDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodObject:return(0,S.parseObjectDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodBigInt:return(0,o.parseBigintDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodBoolean:return(0,r.parseBooleanDef)();case e.ZodFirstPartyTypeKind.ZodDate:return(0,a.parseDateDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodUndefined:return(0,L.parseUndefinedDef)(Q);case e.ZodFirstPartyTypeKind.ZodNull:return(0,g.parseNullDef)(Q);case e.ZodFirstPartyTypeKind.ZodArray:return(0,n.parseArrayDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodUnion:case e.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,q.parseUnionDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodIntersection:return(0,l.parseIntersectionDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodTuple:return(0,N.parseTupleDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodRecord:return(0,T.parseRecordDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodLiteral:return(0,d.parseLiteralDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodEnum:return(0,u.parseEnumDef)(V);case e.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,h.parseNativeEnumDef)(V);case e.ZodFirstPartyTypeKind.ZodNullable:return(0,y.parseNullableDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodOptional:return(0,w.parseOptionalDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodMap:return(0,f.parseMapDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodSet:return(0,D.parseSetDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodLazy:return()=>V.getter()._def;case e.ZodFirstPartyTypeKind.ZodPromise:return(0,E.parsePromiseDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodNaN:case e.ZodFirstPartyTypeKind.ZodNever:return(0,m.parseNeverDef)(Q);case e.ZodFirstPartyTypeKind.ZodEffects:return(0,p.parseEffectsDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodAny:return(0,t.parseAnyDef)(Q);case e.ZodFirstPartyTypeKind.ZodUnknown:return(0,I.parseUnknownDef)(Q);case e.ZodFirstPartyTypeKind.ZodDefault:return(0,c.parseDefaultDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodBranded:return(0,i.parseBrandedDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodReadonly:return(0,U.parseReadonlyDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodCatch:return(0,s.parseCatchDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodPipeline:return(0,R.parsePipelineDef)(V,Q);case e.ZodFirstPartyTypeKind.ZodFunction:case e.ZodFirstPartyTypeKind.ZodVoid:case e.ZodFirstPartyTypeKind.ZodSymbol:return;default:return(le=>{})()}};return Uv.selectParser=J,Uv}var G7;function _r(){if(G7)return kv;G7=1,Object.defineProperty(kv,"__esModule",{value:!0}),kv.parseDef=void 0;const e=aB(),t=aae(),n=lB(),o=Is();function r(a,c,p=!1){const u=c.seen.get(a);if(c.override){const h=c.override?.(a,c,u,p);if(h!==e.ignoreOverride)return h}if(u&&!p){const h=i(u,c);if(h!==void 0)return h}const l={def:a,path:c.currentPath,jsonSchema:void 0};c.seen.set(a,l);const d=(0,t.selectParser)(a,a.typeName,c),f=typeof d=="function"?r(d(),c):d;if(f&&s(a,c,f),c.postProcess){const h=c.postProcess(f,a,c);return l.jsonSchema=f,h}return l.jsonSchema=f,f}kv.parseDef=r;const i=(a,c)=>{switch(c.$refStrategy){case"root":return{$ref:a.path.join("/")};case"relative":return{$ref:(0,n.getRelativePath)(c.currentPath,a.path)};case"none":case"seen":return a.path.lengthc.currentPath[u]===p)?(console.warn(`Recursive reference detected at ${c.currentPath.join("/")}! Defaulting to any`),(0,o.parseAnyDef)(c)):c.$refStrategy==="seen"?(0,o.parseAnyDef)(c):void 0}},s=(a,c,p)=>(a.description&&(p.description=a.description,c.markdownDescription&&(p.markdownDescription=a.description)),p);return kv}var oN={},z7;function FVe(){return z7||(z7=1,Object.defineProperty(oN,"__esModule",{value:!0})),oN}var mS={},K7;function Q7(){if(K7)return mS;K7=1,Object.defineProperty(mS,"__esModule",{value:!0}),mS.zodToJsonSchema=void 0;const e=_r(),t=Lse(),n=Is(),o=(r,i)=>{const s=(0,t.getRefs)(i);let a=typeof i=="object"&&i.definitions?Object.entries(i.definitions).reduce((d,[f,h])=>({...d,[f]:(0,e.parseDef)(h._def,{...s,currentPath:[...s.basePath,s.definitionPath,f]},!0)??(0,n.parseAnyDef)(s)}),{}):void 0;const c=typeof i=="string"?i:i?.nameStrategy==="title"?void 0:i?.name,p=(0,e.parseDef)(r._def,c===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,c]},!1)??(0,n.parseAnyDef)(s),u=typeof i=="object"&&i.name!==void 0&&i.nameStrategy==="title"?i.name:void 0;u!==void 0&&(p.title=u),s.flags.hasReferencedOpenAiAnyType&&(a||(a={}),a[s.openAiAnyTypeName]||(a[s.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:s.$refStrategy==="relative"?"1":[...s.basePath,s.definitionPath,s.openAiAnyTypeName].join("/")}}));const l=c===void 0?a?{...p,[s.definitionPath]:a}:p:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,c].join("/"),[s.definitionPath]:{...a,[c]:p}};return s.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(s.target==="jsonSchema2019-09"||s.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),s.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l};return mS.zodToJsonSchema=o,mS}var $7;function xVe(){return $7||($7=1,(function(e){var t=pg&&pg.__createBinding||(Object.create?(function(r,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,a,c)}):(function(r,i,s,a){a===void 0&&(a=s),r[a]=i[s]})),n=pg&&pg.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(aB(),e),n(Lse(),e),n(fb(),e),n(lB(),e),n(_r(),e),n(FVe(),e),n(Is(),e),n(Fse(),e),n(xse(),e),n(Bse(),e),n(cB(),e),n(kse(),e),n(Use(),e),n(qse(),e),n(Jse(),e),n(Vse(),e),n(Hse(),e),n(Gse(),e),n(zse(),e),n(Kse(),e),n(Qse(),e),n($se(),e),n(Wse(),e),n(Yse(),e),n(Xse(),e),n(Zse(),e),n(eae(),e),n(tae(),e),n(sae(),e),n(fB(),e),n(nae(),e),n(dB(),e),n(rae(),e),n(oae(),e),n(hB(),e),n(iae(),e),n(aae(),e),n(Q7(),e);const o=Q7();e.default=o.zodToJsonSchema})(pg)),pg}var W7;function BVe(){if(W7)return Ay;W7=1,Object.defineProperty(Ay,"__esModule",{value:!0}),Ay.transformToChatCompletionRequest=t,Ay.convertToParsedChatCompletionResponse=n,Ay.responseFormatFromZodObject=o;const e=xVe();function t(r){const{responseFormat:i,...s}=r,a=o(i);return{...s,responseFormat:a}}function n(r,i){if(r.choices===void 0||r.choices.length===0)return{...r,choices:r.choices===void 0?void 0:[]};const s=[];for(const a of r.choices)a.message===null||typeof a.message>"u"?s.push({...a,message:void 0}):a.message.content!==null&&typeof a.message.content<"u"&&!Array.isArray(a.message.content)&&s.push({...a,message:{...a.message,parsed:i.safeParse(JSON.parse(a.message.content)).data}});return{...r,choices:s}}function o(r){return{type:"json_schema",jsonSchema:{name:"placeholderName",schemaDefinition:(0,e.zodToJsonSchema)(r),strict:!0}}}return Ay}var Y7;function kVe(){if(Y7)return Fv;Y7=1,Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.Chat=void 0;const e=NVe(),t=LVe(),n=Gn(),o=Ar(),r=BVe();class i extends n.ClientSDK{async parse(a,c){const p=(0,r.transformToChatCompletionRequest)(a),u=await(0,o.unwrapAsync)((0,e.chatComplete)(this,p,c));return(0,r.convertToParsedChatCompletionResponse)(u,a.responseFormat)}async parseStream(a,c){const p=(0,r.transformToChatCompletionRequest)(a);return(0,o.unwrapAsync)((0,t.chatStream)(this,p,c))}async complete(a,c){return(0,o.unwrapAsync)((0,e.chatComplete)(this,a,c))}async stream(a,c){return(0,o.unwrapAsync)((0,t.chatStream)(this,a,c))}}return Fv.Chat=i,Fv}var gS={},qa={},X7;function UVe(){if(X7)return qa;X7=1;var e=qa&&qa.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=qa&&qa.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=qa&&qa.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ClassificationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/classifications")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"classifications_v1_classifications_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ClassificationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return qa}var Ja={},Z7;function qVe(){if(Z7)return Ja;Z7=1;var e=Ja&&Ja.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Ja&&Ja.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Ja&&Ja.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ChatClassificationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/chat/classifications")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"chat_classifications_v1_chat_classifications_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ClassificationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Ja}var Va={},eQ;function JVe(){if(eQ)return Va;eQ=1;var e=Va&&Va.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Va&&Va.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Va&&Va.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ClassificationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/moderations")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"moderations_v1_moderations_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ModerationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Va}var Ha={},tQ;function VVe(){if(tQ)return Ha;tQ=1;var e=Ha&&Ha.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Ha&&Ha.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Ha&&Ha.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.ChatModerationRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/chat/moderations")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"chat_moderations_v1_chat_moderations_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.ModerationResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Ha}var nQ;function HVe(){if(nQ)return gS;nQ=1,Object.defineProperty(gS,"__esModule",{value:!0}),gS.Classifiers=void 0;const e=UVe(),t=qVe(),n=JVe(),o=VVe(),r=Gn(),i=Ar();class s extends r.ClientSDK{async moderate(c,p){return(0,i.unwrapAsync)((0,n.classifiersModerate)(this,c,p))}async moderateChat(c,p){return(0,i.unwrapAsync)((0,o.classifiersModerateChat)(this,c,p))}async classify(c,p){return(0,i.unwrapAsync)((0,e.classifiersClassify)(this,c,p))}async classifyChat(c,p){return(0,i.unwrapAsync)((0,t.classifiersClassifyChat)(this,c,p))}}return gS.Classifiers=s,gS}var bS={},Ga={},rQ;function GVe(){if(rQ)return Ga;rQ=1;var e=Ga&&Ga.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Ga&&Ga.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Ga&&Ga.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.EmbeddingRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/embeddings")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"embeddings_v1_embeddings_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.EmbeddingResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Ga}var oQ;function zVe(){if(oQ)return bS;oQ=1,Object.defineProperty(bS,"__esModule",{value:!0}),bS.Embeddings=void 0;const e=GVe(),t=Gn(),n=Ar();class o extends t.ClientSDK{async create(i,s){return(0,n.unwrapAsync)((0,e.embeddingsCreate)(this,i,s))}}return bS.Embeddings=o,bS}var yS={},za={},iQ;function KVe(){if(iQ)return za;iQ=1;var e=za&&za.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=za&&za.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=za&&za.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.FilesApiRoutesDeleteFileRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={file_id:(0,o.encodeSimple)("file_id",_.file_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/files/{file_id}")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"files_api_routes_delete_file",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"DELETE",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.DeleteFileOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return za}var Ka={},sQ;function QVe(){if(sQ)return Ka;sQ=1;var e=Ka&&Ka.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Ka&&Ka.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Ka&&Ka.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.FilesApiRoutesDownloadFileRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={file_id:(0,r.encodeSimple)("file_id",_.file_id,{explode:!1,charEncoding:"percent"})},R=(0,p.pathToFunc)("/v1/files/{file_id}/content")(w),E=new Headers((0,s.compactMap)({Accept:"application/octet-stream"})),T=await(0,c.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,c.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"files_api_routes_download_file",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await i.match(i.stream(200,o.instanceof(ReadableStream)),i.fail("4XX"),i.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return Ka}var Qa={},aQ;function $Ve(){if(aQ)return Qa;aQ=1;var e=Qa&&Qa.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Qa&&Qa.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Qa&&Qa.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.FilesApiRoutesGetSignedUrlRequest$outboundSchema.parse(G),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={file_id:(0,o.encodeSimple)("file_id",_.file_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/files/{file_id}/url")(w),E=(0,o.encodeFormQuery)({expiry:_.expiry}),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(h._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"files_api_routes_get_signed_url",oAuth2Scopes:[],resolvedSecurity:N,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},q=h._createRequest(L,{security:N,method:"GET",baseURL:g?.serverURL,path:R,headers:T,query:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await h._do(I,{context:L,errorCodes:["4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,[V]=await r.match(r.json(200,p.FileSignedURL$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I);return V.ok?[V,{status:"complete",request:I,response:J}]:[V,{status:"complete",request:I,response:J}]}return Qa}var $a={},lQ;function WVe(){if(lQ)return $a;lQ=1;var e=$a&&$a.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=$a&&$a.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=$a&&$a.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.FilesApiRoutesListFilesRequest$outboundSchema.optional().parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w=(0,c.pathToFunc)("/v1/files")(),R=(0,o.encodeFormQuery)({include_total:_?.include_total,page:_?.page,page_size:_?.page_size,purpose:_?.purpose,sample_type:_?.sample_type,search:_?.search,source:_?.source}),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"files_api_routes_list_files",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:w,headers:E,query:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.ListFilesOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return $a}var Wa={},uQ;function YVe(){if(uQ)return Wa;uQ=1;var e=Wa&&Wa.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Wa&&Wa.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Wa&&Wa.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.FilesApiRoutesRetrieveFileRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={file_id:(0,o.encodeSimple)("file_id",_.file_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/files/{file_id}")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"files_api_routes_retrieve_file",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.RetrieveFileOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return Wa}var Ya={},cQ;function XVe(){if(cQ)return Ya;cQ=1;var e=Ya&&Ya.__createBinding||(Object.create?(function(y,_,S,w){w===void 0&&(w=S);var R=Object.getOwnPropertyDescriptor(_,S);(!R||("get"in R?!_.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(y,w,R)}):(function(y,_,S,w){w===void 0&&(w=S),y[w]=_[S]})),t=Ya&&Ya.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),n=Ya&&Ya.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(w[w.length]=R);return w},y(_)};return function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var w=y(_),R=0;Rl.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema.parse(Q),"Input validation failed");if(!w.ok)return[w,{status:"invalid"}];const R=w.value,E=new FormData;if((0,f.isBlobLike)(R.file))(0,o.appendForm)(E,"file",R.file);else if((0,h.isReadableStream)(R.file.content)){const Q=await(0,r.readableStreamToArrayBuffer)(R.file.content),le=(0,r.getContentTypeFromFileName)(R.file.fileName)||"application/octet-stream",K=new Blob([Q],{type:le});(0,o.appendForm)(E,"file",K,R.file.fileName)}else{const Q=(0,r.getContentTypeFromFileName)(R.file.fileName)||"application/octet-stream";(0,o.appendForm)(E,"file",new Blob([R.file.content],{type:Q}),R.file.fileName)}R.purpose!==void 0&&(0,o.appendForm)(E,"purpose",R.purpose);const T=(0,p.pathToFunc)("/v1/files")(),D=new Headers((0,s.compactMap)({Accept:"application/json"})),B=await(0,c.extractSecurity)(y._options.apiKey),N=B==null?{}:{apiKey:B},L=(0,c.resolveGlobalSecurity)(N),q={options:y._options,baseURL:S?.serverURL??y._baseURL??"",operationID:"files_api_routes_upload_file",oAuth2Scopes:[],resolvedSecurity:L,securitySource:y._options.apiKey,retryConfig:S?.retries||y._options.retryConfig||{strategy:"none"},retryCodes:S?.retryCodes||["429","500","502","503","504"]},I=y._createRequest(q,{security:L,method:"POST",baseURL:S?.serverURL,path:T,headers:D,body:E,userAgent:y._options.userAgent,timeoutMs:S?.timeoutMs||y._options.timeoutMs||-1},S);if(!I.ok)return[I,{status:"invalid"}];const U=I.value,J=await y._do(U,{context:q,errorCodes:["4XX","5XX"],retryConfig:q.retryConfig,retryCodes:q.retryCodes});if(!J.ok)return[J,{status:"request-error",request:U}];const V=J.value,[G]=await i.match(i.json(200,u.UploadFileOut$inboundSchema),i.fail("4XX"),i.fail("5XX"))(V,U);return G.ok?[G,{status:"complete",request:U,response:V}]:[G,{status:"complete",request:U,response:V}]}return Ya}var dQ;function ZVe(){if(dQ)return yS;dQ=1,Object.defineProperty(yS,"__esModule",{value:!0}),yS.Files=void 0;const e=KVe(),t=QVe(),n=$Ve(),o=WVe(),r=YVe(),i=XVe(),s=Gn(),a=Ar();class c extends s.ClientSDK{async upload(u,l){return(0,a.unwrapAsync)((0,i.filesUpload)(this,u,l))}async list(u,l){return(0,a.unwrapAsync)((0,o.filesList)(this,u,l))}async retrieve(u,l){return(0,a.unwrapAsync)((0,r.filesRetrieve)(this,u,l))}async delete(u,l){return(0,a.unwrapAsync)((0,e.filesDelete)(this,u,l))}async download(u,l){return(0,a.unwrapAsync)((0,t.filesDownload)(this,u,l))}async getSignedUrl(u,l){return(0,a.unwrapAsync)((0,n.filesGetSignedUrl)(this,u,l))}}return yS.Files=c,yS}var AS={},Xa={},fQ;function e5e(){if(fQ)return Xa;fQ=1;var e=Xa&&Xa.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=Xa&&Xa.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=Xa&&Xa.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.FIMCompletionRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/fim/completions")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"fim_completion_v1_fim_completions_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.FIMCompletionResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return Xa}var Za={},hQ;function t5e(){if(hQ)return Za;hQ=1;var e=Za&&Za.__createBinding||(Object.create?(function(g,y,_,S){S===void 0&&(S=_);var w=Object.getOwnPropertyDescriptor(y,_);(!w||("get"in w?!y.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,S,w)}):(function(g,y,_,S){S===void 0&&(S=_),g[S]=y[_]})),t=Za&&Za.__setModuleDefault||(Object.create?(function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}):function(g,y){g.default=y}),n=Za&&Za.__importStar||(function(){var g=function(y){return g=Object.getOwnPropertyNames||function(_){var S=[];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(S[S.length]=w);return S},g(y)};return function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var S=g(y),w=0;wl.FIMCompletionStreamRequest$outboundSchema.parse(Q),"Input validation failed");if(!S.ok)return[S,{status:"invalid"}];const w=S.value,R=(0,r.encodeJSON)("body",w,{explode:!0}),E=(0,u.pathToFunc)("/v1/fim/completions#stream")(),T=new Headers((0,a.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),D=await(0,p.extractSecurity)(g._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,p.resolveGlobalSecurity)(B),L={options:g._options,baseURL:_?.serverURL??g._baseURL??"",operationID:"stream_fim",oAuth2Scopes:[],resolvedSecurity:N,securitySource:g._options.apiKey,retryConfig:_?.retries||g._options.retryConfig||{strategy:"none"},retryCodes:_?.retryCodes||["429","500","502","503","504"]},q=g._createRequest(L,{security:N,method:"POST",baseURL:_?.serverURL,path:E,headers:T,body:R,userAgent:g._options.userAgent,timeoutMs:_?.timeoutMs||g._options.timeoutMs||-1},_);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await g._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await s.match(s.sse(200,o.instanceof(ReadableStream).transform(Q=>new i.EventStream(Q,le=>le.data==="[DONE]"?{done:!0}:{value:l.CompletionEvent$inboundSchema.parse(le)}))),s.jsonErr(422,d.HTTPValidationError$inboundSchema),s.fail("4XX"),s.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return Za}var pQ;function n5e(){if(pQ)return AS;pQ=1,Object.defineProperty(AS,"__esModule",{value:!0}),AS.Fim=void 0;const e=e5e(),t=t5e(),n=Gn(),o=Ar();class r extends n.ClientSDK{async complete(s,a){return(0,o.unwrapAsync)((0,e.fimComplete)(this,s,a))}async stream(s,a){return(0,o.unwrapAsync)((0,t.fimStream)(this,s,a))}}return AS.Fim=r,AS}var _S={},vS={},el={},mQ;function r5e(){if(mQ)return el;mQ=1;var e=el&&el.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),t=el&&el.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=el&&el.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;yp.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema.parse(J),"Input validation failed");if(!g.ok)return[g,{status:"invalid"}];const y=g.value,_=null,S={job_id:(0,o.encodeSimple)("job_id",y.job_id,{explode:!1,charEncoding:"percent"})},w=(0,c.pathToFunc)("/v1/fine_tuning/jobs/{job_id}/cancel")(S),R=new Headers((0,i.compactMap)({Accept:"application/json"})),E=await(0,a.extractSecurity)(f._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:f._options,baseURL:m?.serverURL??f._baseURL??"",operationID:"jobs_api_routes_fine_tuning_cancel_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:D,securitySource:f._options.apiKey,retryConfig:m?.retries||f._options.retryConfig||{strategy:"none"},retryCodes:m?.retryCodes||["429","500","502","503","504"]},N=f._createRequest(B,{security:D,method:"POST",baseURL:m?.serverURL,path:w,headers:R,body:_,userAgent:f._options.userAgent,timeoutMs:m?.timeoutMs||f._options.timeoutMs||-1},m);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await f._do(L,{context:B,errorCodes:["4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,[U]=await r.match(r.json(200,p.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L);return U.ok?[U,{status:"complete",request:L,response:I}]:[U,{status:"complete",request:L,response:I}]}return el}var tl={},gQ;function o5e(){if(gQ)return tl;gQ=1;var e=tl&&tl.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=tl&&tl.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=tl&&tl.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.JobIn$outboundSchema.parse(J),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/fine_tuning/jobs")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_fine_tuning_create_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,[U]=await r.match(r.json(200,u.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L);return U.ok?[U,{status:"complete",request:L,response:I}]:[U,{status:"complete",request:L,response:I}]}return tl}var nl={},bQ;function i5e(){if(bQ)return nl;bQ=1;var e=nl&&nl.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),t=nl&&nl.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=nl&&nl.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;yp.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema.parse(J),"Input validation failed");if(!g.ok)return[g,{status:"invalid"}];const y=g.value,_=null,S={job_id:(0,o.encodeSimple)("job_id",y.job_id,{explode:!1,charEncoding:"percent"})},w=(0,c.pathToFunc)("/v1/fine_tuning/jobs/{job_id}")(S),R=new Headers((0,i.compactMap)({Accept:"application/json"})),E=await(0,a.extractSecurity)(f._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:f._options,baseURL:m?.serverURL??f._baseURL??"",operationID:"jobs_api_routes_fine_tuning_get_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:D,securitySource:f._options.apiKey,retryConfig:m?.retries||f._options.retryConfig||{strategy:"none"},retryCodes:m?.retryCodes||["429","500","502","503","504"]},N=f._createRequest(B,{security:D,method:"GET",baseURL:m?.serverURL,path:w,headers:R,body:_,userAgent:f._options.userAgent,timeoutMs:m?.timeoutMs||f._options.timeoutMs||-1},m);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await f._do(L,{context:B,errorCodes:["4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,[U]=await r.match(r.json(200,p.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L);return U.ok?[U,{status:"complete",request:L,response:I}]:[U,{status:"complete",request:L,response:I}]}return nl}var rl={},yQ;function s5e(){if(yQ)return rl;yQ=1;var e=rl&&rl.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=rl&&rl.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=rl&&rl.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema.optional().parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w=(0,c.pathToFunc)("/v1/fine_tuning/jobs")(),R=(0,o.encodeFormQuery)({created_after:_?.created_after,created_before:_?.created_before,created_by_me:_?.created_by_me,model:_?.model,page:_?.page,page_size:_?.page_size,status:_?.status,suffix:_?.suffix,wandb_name:_?.wandb_name,wandb_project:_?.wandb_project}),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_fine_tuning_get_fine_tuning_jobs",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:w,headers:E,query:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.JobsOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return rl}var ol={},AQ;function a5e(){if(AQ)return ol;AQ=1;var e=ol&&ol.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),t=ol&&ol.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=ol&&ol.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;yp.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema.parse(J),"Input validation failed");if(!g.ok)return[g,{status:"invalid"}];const y=g.value,_=null,S={job_id:(0,o.encodeSimple)("job_id",y.job_id,{explode:!1,charEncoding:"percent"})},w=(0,c.pathToFunc)("/v1/fine_tuning/jobs/{job_id}/start")(S),R=new Headers((0,i.compactMap)({Accept:"application/json"})),E=await(0,a.extractSecurity)(f._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:f._options,baseURL:m?.serverURL??f._baseURL??"",operationID:"jobs_api_routes_fine_tuning_start_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:D,securitySource:f._options.apiKey,retryConfig:m?.retries||f._options.retryConfig||{strategy:"none"},retryCodes:m?.retryCodes||["429","500","502","503","504"]},N=f._createRequest(B,{security:D,method:"POST",baseURL:m?.serverURL,path:w,headers:R,body:_,userAgent:f._options.userAgent,timeoutMs:m?.timeoutMs||f._options.timeoutMs||-1},m);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await f._do(L,{context:B,errorCodes:["4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,[U]=await r.match(r.json(200,p.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L);return U.ok?[U,{status:"complete",request:L,response:I}]:[U,{status:"complete",request:L,response:I}]}return ol}var _Q;function l5e(){if(_Q)return vS;_Q=1,Object.defineProperty(vS,"__esModule",{value:!0}),vS.Jobs=void 0;const e=r5e(),t=o5e(),n=i5e(),o=s5e(),r=a5e(),i=Gn(),s=Ar();class a extends i.ClientSDK{async list(p,u){return(0,s.unwrapAsync)((0,o.fineTuningJobsList)(this,p,u))}async create(p,u){return(0,s.unwrapAsync)((0,t.fineTuningJobsCreate)(this,p,u))}async get(p,u){return(0,s.unwrapAsync)((0,n.fineTuningJobsGet)(this,p,u))}async cancel(p,u){return(0,s.unwrapAsync)((0,e.fineTuningJobsCancel)(this,p,u))}async start(p,u){return(0,s.unwrapAsync)((0,r.fineTuningJobsStart)(this,p,u))}}return vS.Jobs=a,vS}var vQ;function u5e(){if(vQ)return _S;vQ=1,Object.defineProperty(_S,"__esModule",{value:!0}),_S.FineTuning=void 0;const e=Gn(),t=l5e();class n extends e.ClientSDK{get jobs(){return this._jobs??(this._jobs=new t.Jobs(this._options))}}return _S.FineTuning=n,_S}var SS={},il={},SQ;function c5e(){if(SQ)return il;SQ=1;var e=il&&il.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=il&&il.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=il&&il.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={model_id:(0,o.encodeSimple)("model_id",_.model_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/fine_tuning/models/{model_id}/archive")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_fine_tuning_archive_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"POST",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.ArchiveFTModelOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return il}var sl={},CQ;function d5e(){if(CQ)return sl;CQ=1;var e=sl&&sl.__createBinding||(Object.create?(function(m,g,y,_){_===void 0&&(_=y);var S=Object.getOwnPropertyDescriptor(g,y);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[y]}}),Object.defineProperty(m,_,S)}):(function(m,g,y,_){_===void 0&&(_=y),m[_]=g[y]})),t=sl&&sl.__setModuleDefault||(Object.create?(function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}):function(m,g){m.default=g}),n=sl&&sl.__importStar||(function(){var m=function(g){return m=Object.getOwnPropertyNames||function(y){var _=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(_[_.length]=S);return _},m(g)};return function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var _=m(g),S=0;S<_.length;S++)_[S]!=="default"&&e(y,g,_[S]);return t(y,g),y}})();Object.defineProperty(sl,"__esModule",{value:!0}),sl.modelsDelete=f;const o=$e(),r=n(Ge()),i=ae(),s=ee(),a=ze(),c=Je(),p=n(xe()),u=n(yt()),l=n(gt()),d=Ke();function f(m,g,y){return new d.APIPromise(h(m,g,y))}async function h(m,g,y){const _=(0,s.safeParse)(g,Q=>l.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema.parse(Q),"Input validation failed");if(!_.ok)return[_,{status:"invalid"}];const S=_.value,w=null,R={model_id:(0,o.encodeSimple)("model_id",S.model_id,{explode:!1,charEncoding:"percent"})},E=(0,c.pathToFunc)("/v1/models/{model_id}")(R),T=new Headers((0,i.compactMap)({Accept:"application/json"})),D=await(0,a.extractSecurity)(m._options.apiKey),B=D==null?{}:{apiKey:D},N=(0,a.resolveGlobalSecurity)(B),L={options:m._options,baseURL:y?.serverURL??m._baseURL??"",operationID:"delete_model_v1_models__model_id__delete",oAuth2Scopes:[],resolvedSecurity:N,securitySource:m._options.apiKey,retryConfig:y?.retries||m._options.retryConfig||{strategy:"none"},retryCodes:y?.retryCodes||["429","500","502","503","504"]},q=m._createRequest(L,{security:N,method:"DELETE",baseURL:y?.serverURL,path:E,headers:T,body:w,userAgent:m._options.userAgent,timeoutMs:y?.timeoutMs||m._options.timeoutMs||-1},y);if(!q.ok)return[q,{status:"invalid"}];const I=q.value,U=await m._do(I,{context:L,errorCodes:["422","4XX","5XX"],retryConfig:L.retryConfig,retryCodes:L.retryCodes});if(!U.ok)return[U,{status:"request-error",request:I}];const J=U.value,V={HttpMeta:{Response:J,Request:I}},[G]=await r.match(r.json(200,p.DeleteModelOut$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(J,I,{extraFields:V});return G.ok?[G,{status:"complete",request:I,response:J}]:[G,{status:"complete",request:I,response:J}]}return sl}var al={},wQ;function f5e(){if(wQ)return al;wQ=1;var e=al&&al.__createBinding||(Object.create?(function(l,d,f,h){h===void 0&&(h=f);var m=Object.getOwnPropertyDescriptor(d,f);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(l,h,m)}):(function(l,d,f,h){h===void 0&&(h=f),l[h]=d[f]})),t=al&&al.__setModuleDefault||(Object.create?(function(l,d){Object.defineProperty(l,"default",{enumerable:!0,value:d})}):function(l,d){l.default=d}),n=al&&al.__importStar||(function(){var l=function(d){return l=Object.getOwnPropertyNames||function(f){var h=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(h[h.length]=m);return h},l(d)};return function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h=l(d),m=0;mu.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema.parse(G),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={model_id:(0,o.encodeSimple)("model_id",_.model_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/models/{model_id}")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"retrieve_model_v1_models__model_id__get",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"GET",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["422","4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,J={HttpMeta:{Response:U,Request:q}},[V]=await r.match(r.json(200,u.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema),r.jsonErr(422,p.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q,{extraFields:J});return V.ok?[V,{status:"complete",request:q,response:U}]:[V,{status:"complete",request:q,response:U}]}return ll}var ul={},TQ;function p5e(){if(TQ)return ul;TQ=1;var e=ul&&ul.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=ul&&ul.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=ul&&ul.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_u.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=null,w={model_id:(0,o.encodeSimple)("model_id",_.model_id,{explode:!1,charEncoding:"percent"})},R=(0,c.pathToFunc)("/v1/fine_tuning/models/{model_id}/archive")(w),E=new Headers((0,i.compactMap)({Accept:"application/json"})),T=await(0,a.extractSecurity)(h._options.apiKey),D=T==null?{}:{apiKey:T},B=(0,a.resolveGlobalSecurity)(D),N={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"jobs_api_routes_fine_tuning_unarchive_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:B,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},L=h._createRequest(N,{security:B,method:"DELETE",baseURL:g?.serverURL,path:R,headers:E,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!L.ok)return[L,{status:"invalid"}];const q=L.value,I=await h._do(q,{context:N,errorCodes:["4XX","5XX"],retryConfig:N.retryConfig,retryCodes:N.retryCodes});if(!I.ok)return[I,{status:"request-error",request:q}];const U=I.value,[J]=await r.match(r.json(200,p.UnarchiveFTModelOut$inboundSchema),r.fail("4XX"),r.fail("5XX"))(U,q);return J.ok?[J,{status:"complete",request:q,response:U}]:[J,{status:"complete",request:q,response:U}]}return ul}var cl={},RQ;function m5e(){if(RQ)return cl;RQ=1;var e=cl&&cl.__createBinding||(Object.create?(function(f,h,m,g){g===void 0&&(g=m);var y=Object.getOwnPropertyDescriptor(h,m);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,g,y)}):(function(f,h,m,g){g===void 0&&(g=m),f[g]=h[m]})),t=cl&&cl.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=cl&&cl.__importStar||(function(){var f=function(h){return f=Object.getOwnPropertyNames||function(m){var g=[];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(g[g.length]=y);return g},f(h)};return function(h){if(h&&h.__esModule)return h;var m={};if(h!=null)for(var g=f(h),y=0;yp.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema.parse(J),"Input validation failed");if(!g.ok)return[g,{status:"invalid"}];const y=g.value,_=(0,o.encodeJSON)("body",y.UpdateFTModelIn,{explode:!0}),S={model_id:(0,o.encodeSimple)("model_id",y.model_id,{explode:!1,charEncoding:"percent"})},w=(0,c.pathToFunc)("/v1/fine_tuning/models/{model_id}")(S),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(f._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:f._options,baseURL:m?.serverURL??f._baseURL??"",operationID:"jobs_api_routes_fine_tuning_update_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:D,securitySource:f._options.apiKey,retryConfig:m?.retries||f._options.retryConfig||{strategy:"none"},retryCodes:m?.retryCodes||["429","500","502","503","504"]},N=f._createRequest(B,{security:D,method:"PATCH",baseURL:m?.serverURL,path:w,headers:R,body:_,userAgent:f._options.userAgent,timeoutMs:m?.timeoutMs||f._options.timeoutMs||-1},m);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await f._do(L,{context:B,errorCodes:["4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,[U]=await r.match(r.json(200,p.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L);return U.ok?[U,{status:"complete",request:L,response:I}]:[U,{status:"complete",request:L,response:I}]}return cl}var EQ;function g5e(){if(EQ)return SS;EQ=1,Object.defineProperty(SS,"__esModule",{value:!0}),SS.Models=void 0;const e=c5e(),t=d5e(),n=f5e(),o=h5e(),r=p5e(),i=m5e(),s=Gn(),a=Ar();class c extends s.ClientSDK{async list(u){return(0,a.unwrapAsync)((0,n.modelsList)(this,u))}async retrieve(u,l){return(0,a.unwrapAsync)((0,o.modelsRetrieve)(this,u,l))}async delete(u,l){return(0,a.unwrapAsync)((0,t.modelsDelete)(this,u,l))}async update(u,l){return(0,a.unwrapAsync)((0,i.modelsUpdate)(this,u,l))}async archive(u,l){return(0,a.unwrapAsync)((0,e.modelsArchive)(this,u,l))}async unarchive(u,l){return(0,a.unwrapAsync)((0,r.modelsUnarchive)(this,u,l))}}return SS.Models=c,SS}var CS={},dl={},MQ;function b5e(){if(MQ)return dl;MQ=1;var e=dl&&dl.__createBinding||(Object.create?(function(h,m,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(h,y,_)}):(function(h,m,g,y){y===void 0&&(y=g),h[y]=m[g]})),t=dl&&dl.__setModuleDefault||(Object.create?(function(h,m){Object.defineProperty(h,"default",{enumerable:!0,value:m})}):function(h,m){h.default=m}),n=dl&&dl.__importStar||(function(){var h=function(m){return h=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},h(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var y=h(m),_=0;_p.OCRRequest$outboundSchema.parse(V),"Input validation failed");if(!y.ok)return[y,{status:"invalid"}];const _=y.value,S=(0,o.encodeJSON)("body",_,{explode:!0}),w=(0,c.pathToFunc)("/v1/ocr")(),R=new Headers((0,i.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),E=await(0,a.extractSecurity)(h._options.apiKey),T=E==null?{}:{apiKey:E},D=(0,a.resolveGlobalSecurity)(T),B={options:h._options,baseURL:g?.serverURL??h._baseURL??"",operationID:"ocr_v1_ocr_post",oAuth2Scopes:[],resolvedSecurity:D,securitySource:h._options.apiKey,retryConfig:g?.retries||h._options.retryConfig||{strategy:"none"},retryCodes:g?.retryCodes||["429","500","502","503","504"]},N=h._createRequest(B,{security:D,method:"POST",baseURL:g?.serverURL,path:w,headers:R,body:S,userAgent:h._options.userAgent,timeoutMs:g?.timeoutMs||h._options.timeoutMs||-1},g);if(!N.ok)return[N,{status:"invalid"}];const L=N.value,q=await h._do(L,{context:B,errorCodes:["422","4XX","5XX"],retryConfig:B.retryConfig,retryCodes:B.retryCodes});if(!q.ok)return[q,{status:"request-error",request:L}];const I=q.value,U={HttpMeta:{Response:I,Request:L}},[J]=await r.match(r.json(200,p.OCRResponse$inboundSchema),r.jsonErr(422,u.HTTPValidationError$inboundSchema),r.fail("4XX"),r.fail("5XX"))(I,L,{extraFields:U});return J.ok?[J,{status:"complete",request:L,response:I}]:[J,{status:"complete",request:L,response:I}]}return dl}var PQ;function y5e(){if(PQ)return CS;PQ=1,Object.defineProperty(CS,"__esModule",{value:!0}),CS.Ocr=void 0;const e=b5e(),t=Gn(),n=Ar();class o extends t.ClientSDK{async process(i,s){return(0,n.unwrapAsync)((0,e.ocrProcess)(this,i,s))}}return CS.Ocr=o,CS}var IQ;function A5e(){if(IQ)return gv;IQ=1,Object.defineProperty(gv,"__esModule",{value:!0}),gv.Mistral=void 0;const e=Gn(),t=q4e(),n=G4e(),o=zJe(),r=DVe(),i=kVe(),s=HVe(),a=zVe(),c=ZVe(),p=n5e(),u=u5e(),l=g5e(),d=y5e();class f extends e.ClientSDK{get models(){return this._models??(this._models=new l.Models(this._options))}get beta(){return this._beta??(this._beta=new r.Beta(this._options))}get files(){return this._files??(this._files=new c.Files(this._options))}get fineTuning(){return this._fineTuning??(this._fineTuning=new u.FineTuning(this._options))}get batch(){return this._batch??(this._batch=new o.Batch(this._options))}get chat(){return this._chat??(this._chat=new i.Chat(this._options))}get fim(){return this._fim??(this._fim=new p.Fim(this._options))}get agents(){return this._agents??(this._agents=new t.Agents(this._options))}get embeddings(){return this._embeddings??(this._embeddings=new a.Embeddings(this._options))}get classifiers(){return this._classifiers??(this._classifiers=new s.Classifiers(this._options))}get ocr(){return this._ocr??(this._ocr=new d.Ocr(this._options))}get audio(){return this._audio??(this._audio=new n.Audio(this._options))}}return gv.Mistral=f,gv}var jQ;function _5e(){return jQ||(jQ=1,(function(e){var t=ss&&ss.__createBinding||(Object.create?(function(s,a,c,p){p===void 0&&(p=c);var u=Object.getOwnPropertyDescriptor(a,c);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,p,u)}):(function(s,a,c,p){p===void 0&&(p=c),s[p]=a[c]})),n=ss&&ss.__setModuleDefault||(Object.create?(function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}):function(s,a){s.default=a}),o=ss&&ss.__exportStar||function(s,a){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&t(a,s,c)},r=ss&&ss.__importStar||(function(){var s=function(a){return s=Object.getOwnPropertyNames||function(c){var p=[];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(p[p.length]=u);return p},s(a)};return function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var p=s(a),u=0;unew v5e.Mistral({apiKey:e??"",serverURL:t}),S5e=()=>({role:"assistant",content:[]}),C5e=e=>({role:"assistant",content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}]}),w5e=(e,t)=>e&&t?GM(t):S5e(),O5e=e=>{if(typeof e.content!="string")for(let t=e.content.length-1;t>=0;t-=1){const n=e.content[t];if(n.type==="tool-call")return n}},_y={name:"Mistral",baseUrl:"https://api.mistral.ai",modelFilters:["mistral-large-latest","mistral-medium-latest","mistral-small-latest"],modelNames:{"mistral-large-latest":"Mistral Large","mistral-medium-latest":"Mistral Medium","mistral-small-latest":"Mistral Small"},reasoningModels:[["small","magistral-small-latest"],["medium","magistral-medium-latest"],["large","magistral-medium-latest"]]},T5e=e=>e.map(t=>({type:"function",function:{name:t.name,description:t.description,parameters:t.inputSchema}})),sN=e=>{const t=[];for(const n of e){if(n.role==="user"){const o=[],r={content:null};n.attachments&&n.attachments.length>0&&n.attachments.forEach(i=>{i.type==="file"&&o.push({type:"text",text:`File: ${i.name}: ${i.content}`}),i.type==="image"&&o.push({type:"text",text:`Image: ${i.name}: ${i.content}`})}),typeof n.content=="string"?o.push({type:"text",text:n.content}):n.content.forEach(i=>{i.type==="text"&&o.push({type:"text",text:i.text}),i.type==="tool-call"&&(r.content=i.result||null,r.name=i.toolName,r.toolCallId=i.toolCallId),i.type==="image"&&o.push({type:"text",text:`Image: ${i.filename}: ${i.image}`}),i.type==="file"&&o.push({type:"text",text:`File: ${i.filename}: ${i.data}`})}),t.push({role:"user",content:o}),r.content&&t.push({role:"tool",...r});continue}if(n.role==="assistant"){const o=[],r=[];typeof n.content=="string"?o.push({type:"text",text:n.content}):n.content.forEach(i=>{i.type==="text"&&o.push({type:"text",text:i.text}),i.type==="reasoning"&&o.push({type:"thinking",thinking:[{type:"text",text:i.text}]}),i.type==="tool-call"&&r.push({type:"function",id:i.parentId,function:{name:i.toolName,arguments:i.argsText||i.args?JSON.stringify(i.args):""}})}),t.push({role:"assistant",content:o,toolCalls:r.length>0?r:void 0})}}return t};class R5e extends JM{setProvider=t=>{this.provider=t,this.client=iN(t.key,t.baseUrl),t.key&&this.setApiKey(t.key),t.baseUrl&&this.setUrl(t.baseUrl)};setPrevMessages=t=>{this.prevMessages=sN(t)};setTools=t=>{this.tools=T5e(t)};pushToHistory=t=>{const n=sN([t]);this.prevMessages.push(...n)};pushToHistorySliced=(t,n)=>{if(typeof t.content=="string"||typeof n.content=="string")return;const o=t.content.slice(n.content.length);this.pushToHistory({...t,content:o})};async createChatName(t){if(!this.client)return"";try{const o=(await this.client.chat.complete({model:this.modelKey,messages:[{role:"system",content:qM},{role:"user",content:t}]})).choices?.[0]?.message?.content;return typeof o=="string"?o.substring(0,25):t.substring(0,25)}catch{return""}}getModelKey=t=>{if(!t)return this.modelKey;const n=_y.reasoningModels.find(([o,r])=>this.modelKey.includes(o));return n?n[1]:this.modelKey};async*sendMessage(t,n,o,r){if(this.client)try{const i=sN(t);this.prevMessages.push(...i);const s=this.getModelKey(r),a=[{role:"system",content:this.systemPrompt},...this.prevMessages],c=await this.client.chat.stream({model:s,messages:a,tools:this.tools.length>0?this.tools:void 0});let p=w5e(n,o);for await(const u of c){if(this.stopFlag){this.stopFlag=!1,this.pushToHistory(p),yield{isEnd:!0,responseMessage:p};return}const l=hqe(u);if(!l)continue;const d=l.delta;if(p=dqe(d,p),p=fqe(d,p),l.finishReason){n&&o?this.pushToHistorySliced(p,o):this.pushToHistory(p),yield{isEnd:!0,responseMessage:p};return}yield p}}catch(i){console.error("Mistral sendMessage error:",i),yield{isEnd:!0,responseMessage:C5e(i)}}}async*sendMessageAfterToolCall(t,n){if(typeof t.content=="string")return t;const o=O5e(t);if(!o)return t;const r={role:"tool",content:typeof o.result=="string"?o.result:JSON.stringify(o.result),toolCallId:o.toolCallId??"",name:o.toolName};this.prevMessages.push(r),yield*this.sendMessage([],!0,t,n)}getBaseUrl=()=>_y.baseUrl;getName=()=>_y.name;checkProvider=async t=>{const n=iN(t.apiKey,t.url);try{return await n.models.list(),!0}catch(o){const r=hne(o);return r===0||o&&typeof o=="object"&&"cause"in o?yn.invalidUrl():r===401?yn.invalidKey(fne(o)):r===404?yn.invalidUrl():t.apiKey?yn.invalidKey():yn.emptyKey()}};getProviderModels=async t=>{const n=iN(t.apiKey,t.url);try{const r=(await n.models.list()).data??[],i=[];for(const s of r){if(!(_y.modelFilters.length===0||_y.modelFilters.some(p=>s.id?.includes(p))))continue;const c=_y.modelNames[s.id??""]??s.id??"Unknown";i.push({id:s.id??"",name:c,provider:"mistral"})}return i}catch{return[]}}}const E5e=new R5e,aN={name:"Ollama",baseUrl:"http://localhost:11434/v1",modelFilters:[],modelNames:{}};class M5e extends Xg{setProvider=t=>{this.provider=t;const n=t.key||"ollama";this.client=this.createClient(n,t.baseUrl),this.setApiKey(n),t.baseUrl&&this.setUrl(t.baseUrl)};getName=()=>aN.name;getBaseUrl=()=>aN.baseUrl;checkProvider=async t=>{const n=this.createClient("ollama",t.url);try{return await n.models.list(),!0}catch{return yn.invalidUrl()}};getProviderModels=async t=>{const n=this.createClient("ollama",t.url);try{return(await n.models.list()).data.map(r=>({id:r.id,name:aN.modelNames[r.id]||r.id,provider:"ollama"}))}catch(o){return console.error("Failed to fetch Ollama models:",o),[]}}}const P5e=new M5e,wS={name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",modelFilters:["openai/gpt-5.2","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.5","anthropic/claude-opus-4.5","x-ai/grok-4","x-ai/grok-4.1-fast","qwen/qwen3-235b-a22b-2507","qwen/qwen3-max","deepseek/deepseek-v3.1-terminus","google/gemini-3-pro-preview","google/gemini-3-flash-preview"],modelNames:{"openai/gpt-5.2":"GPT-5.2","anthropic/claude-haiku-4.5":"Claude Haiku 4.5","anthropic/claude-sonnet-4.5":"Claude Sonnet 4.5","anthropic/claude-opus-4.5":"Claude Opus 4.5","x-ai/grok-4":"Grok 4","x-ai/grok-4.1-fast":"Grok 4.1 Fast","qwen/qwen3-235b-a22b-2507":"Qwen3","qwen/qwen3-max":"Qwen3 Max","deepseek/deepseek-v3.1-terminus":"DeepSeek V3.1 Terminus","google/gemini-3-pro-preview":"Gemini 3 Pro Preview","google/gemini-3-flash-preview":"Gemini 3 Flash Preview"},reasoningModels:["openai/gpt-5.2","anthropic/claude-sonnet-4.5","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","qwen/qwen3-235b-a22b-2507","qwen/qwen3-max","deepseek/deepseek-v3.1-terminus","google/gemini-3-pro-preview","google/gemini-3-flash-preview"]};class I5e extends Xg{getName=()=>wS.name;getBaseUrl=()=>wS.baseUrl;checkProvider=async t=>{try{const n=await fetch(`${t.url}/models/user`,{headers:{Authorization:`Bearer ${t.apiKey}`}});return n.ok?!0:t.apiKey?n.status===401?yn.invalidKey():yn.invalidUrl():yn.emptyKey()}catch{return yn.connectionFailed()}};getProviderModels=async t=>(await this.createClient(t.apiKey,t.url).models.list()).data.filter(r=>wS.modelFilters.includes(r.id)).map(r=>({id:wS.reasoningModels.includes(r.id)?`${r.id}-thinking`:r.id,name:wS.modelNames[r.id]||r.id.toUpperCase(),provider:"openrouter"}))}const j5e=new I5e,ST={name:"TogetherAI",baseUrl:"https://api.together.xyz/v1",modelFilters:["deepseek-ai/DeepSeek-V3.1"],modelNames:{"deepseek-ai/DeepSeek-V3.1":"DeepSeek V3.1"}};class D5e extends Xg{getName=()=>ST.name;getBaseUrl=()=>ST.baseUrl;getProviderModels=async t=>(await(await fetch(`${t.url}/models`,{headers:{Authorization:`Bearer ${t.apiKey}`}})).json()).filter(r=>ST.modelFilters.includes(r.id)).map(r=>({id:r.id,name:ST.modelNames[r.id]||r.id,provider:"together"}))}const N5e=new D5e,vy={name:"xAI",baseUrl:"https://api.x.ai/v1",modelFilters:["grok-4-1-fast-non-reasoning","grok-4-1-fast-reasoning","grok-4-0709"],modelNames:{"grok-4-0709":"Grok 4","grok-4-1-fast-non-reasoning":"Grok 4.1 Fast","grok-4-1-fast-reasoning":"Grok 4.1 Fast Reasoning"}};class L5e extends Xg{getName=()=>vy.name;getBaseUrl=()=>vy.baseUrl;getProviderModels=async t=>{const n=this.createClient(t.apiKey,t.url||vy.baseUrl);try{const o=(await n.models.list()).data;return(vy.modelFilters.length>0?o.filter(i=>vy.modelFilters.includes(i.id)).map(i=>{const s=vy.modelNames[i.id]||i.id;return{id:i.id,name:s,provider:"xai"}}):o.map(i=>({id:i.id,name:i.id,provider:"xai"}))).reverse()}catch{return[]}}}const F5e=new L5e,CE={anthropic:gNe,ollama:P5e,openai:F2e,together:N5e,openrouter:j5e,genai:lqe,deepseek:B2e,xai:F5e,"lm-studio":cqe,mistral:E5e},CT=e=>CE[e],x5e=()=>Object.keys(CE);let B5e=class{currentProvider;currentProviderInfo;currentProviderType;setCurrentProvider=t=>{if(!t){this.currentProvider=void 0,this.currentProviderInfo=void 0,this.currentProviderType=void 0;return}if(this.currentProviderInfo=t,this.currentProvider=CT(t.type),this.currentProviderType=this.currentProvider?t.type:void 0,this.currentProvider){this.currentProvider.setProvider(t),this.currentProvider.setSystemPrompt(Zje);const n=localStorage.getItem(xS);if(n){const o=JSON.parse(n);this.currentProvider.setModelKey(o.id)}}};setCurrentProviderModel=t=>{this.currentProvider&&this.currentProvider.setModelKey(t)};setCurrentProviderTools=t=>{this.currentProvider&&this.currentProvider.setTools(t)};setCurrentProviderPrevMessages=t=>{this.currentProvider&&this.currentProvider.setPrevMessages(t)};getCurrentProviderModel=()=>{if(this.currentProvider)return this.currentProvider.modelKey};createChatName=async t=>{if(!this.currentProvider)return"";const n=await this.currentProvider.createChatName(t);return n.includes("")?n.split("")[1].slice(0,128):n.slice(0,128)};sendMessage=(t,n)=>{if(this.currentProvider)return this.currentProvider.sendMessage(t,!1,void 0,n)};sendMessageAfterToolCall=(t,n)=>{if(this.currentProvider)return this.currentProvider.sendMessageAfterToolCall(t,n)};stopMessage=()=>{this.currentProvider&&this.currentProvider.stopMessage()};getProvidersInfo=()=>x5e().map(t=>{const n=CE[t];return{type:t,name:n.getName(),baseUrl:n.getBaseUrl()}});getProviderInfo=t=>{const n=CT(t);return n?{type:t,name:n.getName(),baseUrl:n.getBaseUrl()}:{name:"",baseUrl:""}};checkNewProvider=(t,n)=>{const o=CT(t);return o?o.checkProvider(n):!1};getProvidersModels=async t=>{const n=new Map,o=t.filter(s=>CT(s.type)),r=o.map(s=>CE[s.type].getProviderModels({url:s.baseUrl,apiKey:s.key})),i=await Promise.allSettled(r);return o.forEach((s,a)=>{const c=i[a];c.status==="fulfilled"&&c.value&&c.value.length>0&&n.set(s.name,c.value)}),n}};const on=new B5e,GA=Bl(e=>({currentModel:(()=>{const t=localStorage.getItem(xS);if(!t)return null;const n=JSON.parse(t);return on.setCurrentProviderModel(n.id),n})(),persistedModel:(()=>{const t=localStorage.getItem(xS);if(!t)return null;const n=JSON.parse(t);return on.setCurrentProviderModel(n.id),n})(),extendedThinking:(()=>{const t=localStorage.getItem(m5);return t?JSON.parse(t):!1})(),selectModel:t=>{e({currentModel:t,persistedModel:t}),on.setCurrentProviderModel(t.id),localStorage.setItem(xS,JSON.stringify(t))},setSessionModel:t=>{e(n=>{const o=t??n.persistedModel??null;return on.setCurrentProviderModel(o?.id??""),{currentModel:o}})},deleteSelectedModel:()=>{e({currentModel:null,persistedModel:null}),localStorage.removeItem(xS),on.setCurrentProviderModel("")},toggleExtendedThinking:()=>{e(t=>{const n=!t.extendedThinking;return localStorage.setItem(m5,JSON.stringify(n)),{extendedThinking:n}})}})),DQ={field:"name",message:"Duplicate name"},gi=Bl()((e,t)=>({providers:(()=>{const n=localStorage.getItem(LO);return n?JSON.parse(n):[]})(),currentProvider:(()=>{const n=localStorage.getItem(FO);if(!n)return null;const o=JSON.parse(n);return on.setCurrentProvider(o),o})(),persistedProvider:(()=>{const n=localStorage.getItem(FO);if(!n)return null;const o=JSON.parse(n);return on.setCurrentProvider(o),o})(),providersModels:new Map,fetchProvidersModels:async()=>{const n=t().providers,o=await on.getProvidersModels(n);e({providersModels:o})},setCurrentProvider:n=>{on.setCurrentProvider(n),localStorage.setItem(FO,JSON.stringify(n)),e({currentProvider:n,persistedProvider:n})},setSessionProvider:n=>{e(o=>{const r=n??o.persistedProvider??null;return on.setCurrentProvider(r||void 0),{currentProvider:r}})},addProvider:async n=>{if(t().providers.some(s=>s.name.toLowerCase()===n.name.toLowerCase()))return DQ;const i=await on.checkNewProvider(n.type,{url:n.baseUrl,apiKey:n.key});return typeof i=="boolean"&&i?(e(s=>{const a=[...s.providers,n];return localStorage.setItem(LO,JSON.stringify(a)),{providers:a}}),!0):i},editProvider:async(n,o)=>{if(t().providers.some(a=>a.name.toLowerCase()===n.name.toLowerCase()&&a.baseUrl!==n.baseUrl&&a.key!==n.key&&a.type!==n.type))return DQ;const s=await on.checkNewProvider(n.type,{url:n.baseUrl,apiKey:n.key});return typeof s=="boolean"&&s?(e(a=>{const c=a.providers.map(p=>p.name===o?n:p);return localStorage.setItem(LO,JSON.stringify(c)),{providers:c}}),!0):s},deleteProvider:async n=>{e(o=>{const r=o.providers.filter(c=>c.name!==n.name),i=o.persistedProvider?.name===n.name;let s=o.persistedProvider,a=o.currentProvider;return i&&(s=null,localStorage.removeItem(FO)),o.currentProvider?.name===n.name&&(a=s,on.setCurrentProvider(a||void 0)),localStorage.setItem(LO,JSON.stringify(r)),{providers:r,currentProvider:a,persistedProvider:s}})}})),NQ=e=>{const{setSessionProvider:t}=gi.getState(),{setSessionModel:n}=GA.getState();t(e?.provider??null),n(e?.model??null)},GC=Bl((e,t)=>({threadId:crypto.randomUUID(),threads:[],initThreads:async()=>{const n=await $je();e({threads:n})},insertThread:(n,o)=>{const r=t(),i=o?.provider??null,s=o?.model??null;e({threads:[{threadId:r.threadId,title:n,provider:i??void 0,model:s??void 0,lastEditDate:Date.now()},...r.threads]}),Qje(r.threadId,n,i??void 0,s??void 0)},insertNewMessageToThread:n=>{const o=t(),r=n?.provider??null,i=n?.model??null;Yje(o.threadId,{...n&&"provider"in n?{provider:r}:{},...n&&"model"in n?{model:i}:{}}),e({threads:o.threads.map(s=>s.threadId===o.threadId?{...s,...n&&"provider"in n?{provider:r??void 0}:{},...n&&"model"in n?{model:i??void 0}:{},lastEditDate:Date.now()}:s)})},onSwitchToNewThread:()=>{NQ(void 0),e({threadId:crypto.randomUUID()})},onSwitchToThread:n=>{const r=t().threads.find(i=>i.threadId===n);NQ(r),e({threadId:n})},onDownloadThread:async n=>{const r=t().threads.find(c=>c.threadId===n),i=await dne(n),s=zF(r?.title||"Chat Export"),a=$te(i);window.AscDesktopEditor.SaveFilenameDialog(`${s}.docx`,c=>{c&&window.AscDesktopEditor.saveAndOpen(a,92,c,65,p=>{p||console.log("Conversion error")})})},onRenameThread:(n,o)=>{const r=t();e({threads:r.threads.map(i=>i.threadId===n?{...i,title:o}:i)}),Wje(n,o)},onDeleteThread:n=>{const o=t();o.threadId===n&&o.onSwitchToNewThread(),e({threads:o.threads.filter(r=>r.threadId!==n)}),Xje(n)}}));function k5e(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,U5e(r,...t)]}function U5e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function q5e(e){const t=J5e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(H5e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function J5e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=z5e(r),a=G5e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V5e=Symbol("radix.slottable");function H5e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V5e}function G5e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function z5e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var K5e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q5e=K5e.reduce((e,t)=>{const n=q5e(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $5e(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,W5e(r,...t)]}function W5e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function LQ(e){const t=Y5e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(Z5e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Y5e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=t3e(r),a=e3e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var X5e=Symbol("radix.slottable");function Z5e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X5e}function e3e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function t3e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lae(e){const t=e+"CollectionProvider",[n,o]=$5e(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:g,children:y}=m,_=Re.useRef(null),S=Re.useRef(new Map).current;return F.jsx(r,{scope:g,itemMap:S,collectionRef:_,children:y})};s.displayName=t;const a=e+"CollectionSlot",c=LQ(a),p=Re.forwardRef((m,g)=>{const{scope:y,children:_}=m,S=i(a,y),w=Cn(g,S.collectionRef);return F.jsx(c,{ref:w,children:_})});p.displayName=a;const u=e+"CollectionItemSlot",l="data-radix-collection-item",d=LQ(u),f=Re.forwardRef((m,g)=>{const{scope:y,children:_,...S}=m,w=Re.useRef(null),R=Cn(g,w),E=i(u,y);return Re.useEffect(()=>(E.itemMap.set(w,{ref:w,...S}),()=>{E.itemMap.delete(w)})),F.jsx(d,{[l]:"",ref:R,children:_})});f.displayName=u;function h(m){const g=i(e+"CollectionConsumer",m);return Re.useCallback(()=>{const _=g.collectionRef.current;if(!_)return[];const S=Array.from(_.querySelectorAll(`[${l}]`));return Array.from(g.itemMap.values()).sort((E,T)=>S.indexOf(E.ref.current)-S.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:p,ItemSlot:f},h,o]}function n3e(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,r3e(r,...t)]}function r3e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var o3e=x.createContext(void 0);function pB(e){const t=x.useContext(o3e);return e||t||"ltr"}function uae(e){const t=i3e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(a3e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function i3e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=u3e(r),a=l3e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var s3e=Symbol("radix.slottable");function a3e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===s3e}function l3e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function u3e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var c3e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zC=c3e.reduce((e,t)=>{const n=uae(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function d3e(e,t){e&&IM.flushSync(()=>e.dispatchEvent(t))}function f3e(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,h3e(r,...t)]}function h3e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function p3e(e){const t=m3e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(b3e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function m3e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=A3e(r),a=y3e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g3e=Symbol("radix.slottable");function b3e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g3e}function y3e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function A3e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _3e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cae=_3e.reduce((e,t)=>{const n=p3e(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),lN="rovingFocusGroup.onEntryFocus",v3e={bubbles:!1,cancelable:!0},KC="RovingFocusGroup",[M1,dae,S3e]=lae(KC),[C3e,bP]=f3e(KC,[S3e]),[w3e,O3e]=C3e(KC),fae=x.forwardRef((e,t)=>F.jsx(M1.Provider,{scope:e.__scopeRovingFocusGroup,children:F.jsx(M1.Slot,{scope:e.__scopeRovingFocusGroup,children:F.jsx(T3e,{...e,ref:t})})}));fae.displayName=KC;var T3e=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:p,preventScrollOnEntryFocus:u=!1,...l}=e,d=x.useRef(null),f=Cn(t,d),h=pB(i),[m,g]=jA({prop:s,defaultProp:a??null,onChange:c,caller:KC}),[y,_]=x.useState(!1),S=Co(p),w=dae(n),R=x.useRef(!1),[E,T]=x.useState(0);return x.useEffect(()=>{const D=d.current;if(D)return D.addEventListener(lN,S),()=>D.removeEventListener(lN,S)},[S]),F.jsx(w3e,{scope:n,orientation:o,dir:h,loop:r,currentTabStopId:m,onItemFocus:x.useCallback(D=>g(D),[g]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:x.useCallback(()=>T(D=>D-1),[]),children:F.jsx(cae.div,{tabIndex:y||E===0?-1:0,"data-orientation":o,...l,ref:f,style:{outline:"none",...e.style},onMouseDown:lt(e.onMouseDown,()=>{R.current=!0}),onFocus:lt(e.onFocus,D=>{const B=!R.current;if(D.target===D.currentTarget&&B&&!y){const N=new CustomEvent(lN,v3e);if(D.currentTarget.dispatchEvent(N),!N.defaultPrevented){const L=w().filter(V=>V.focusable),q=L.find(V=>V.active),I=L.find(V=>V.id===m),J=[q,I,...L].filter(Boolean).map(V=>V.ref.current);mae(J,u)}}R.current=!1}),onBlur:lt(e.onBlur,()=>_(!1))})})}),hae="RovingFocusGroupItem",pae=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...a}=e,c=hm(),p=i||c,u=O3e(hae,n),l=u.currentTabStopId===p,d=dae(n),{onFocusableItemAdd:f,onFocusableItemRemove:h,currentTabStopId:m}=u;return x.useEffect(()=>{if(o)return f(),()=>h()},[o,f,h]),F.jsx(M1.ItemSlot,{scope:n,id:p,focusable:o,active:r,children:F.jsx(cae.span,{tabIndex:l?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:lt(e.onMouseDown,g=>{o?u.onItemFocus(p):g.preventDefault()}),onFocus:lt(e.onFocus,()=>u.onItemFocus(p)),onKeyDown:lt(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=M3e(g,u.orientation,u.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let S=d().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const w=S.indexOf(g.currentTarget);S=u.loop?P3e(S,w+1):S.slice(w+1)}setTimeout(()=>mae(S))}}),children:typeof s=="function"?s({isCurrentTabStop:l,hasTabStop:m!=null}):s})})});pae.displayName=hae;var R3e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E3e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M3e(e,t,n){const o=E3e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return R3e[o]}function mae(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function P3e(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var gae=fae,bae=pae,P1=["Enter"," "],I3e=["ArrowDown","PageUp","Home"],yae=["ArrowUp","PageDown","End"],j3e=[...I3e,...yae],D3e={ltr:[...P1,"ArrowRight"],rtl:[...P1,"ArrowLeft"]},N3e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},QC="Menu",[z0,L3e,F3e]=lae(QC),[hb,Aae]=n3e(QC,[F3e,xM,bP]),yP=xM(),_ae=bP(),[x3e,zA]=hb(QC),[B3e,$C]=hb(QC),vae=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:s=!0}=e,a=yP(t),[c,p]=x.useState(null),u=x.useRef(!1),l=Co(i),d=pB(r);return x.useEffect(()=>{const f=()=>{u.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>u.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),F.jsx(zee,{...a,children:F.jsx(x3e,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:p,children:F.jsx(B3e,{scope:t,onClose:x.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:u,dir:d,modal:s,children:o})})})};vae.displayName=QC;var k3e="MenuAnchor",mB=x.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=yP(n);return F.jsx(Kee,{...r,...o,ref:t})});mB.displayName=k3e;var U3e="MenuPortal",[B2t,Sae]=hb(U3e,{forceMount:void 0}),zi="MenuContent",[q3e,gB]=hb(zi),Cae=x.forwardRef((e,t)=>{const n=Sae(zi,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=zA(zi,e.__scopeMenu),s=$C(zi,e.__scopeMenu);return F.jsx(z0.Provider,{scope:e.__scopeMenu,children:F.jsx(ql,{present:o||i.open,children:F.jsx(z0.Slot,{scope:e.__scopeMenu,children:s.modal?F.jsx(J3e,{...r,ref:t}):F.jsx(V3e,{...r,ref:t})})})})}),J3e=x.forwardRef((e,t)=>{const n=zA(zi,e.__scopeMenu),o=x.useRef(null),r=Cn(t,o);return x.useEffect(()=>{const i=o.current;if(i)return Yee(i)},[]),F.jsx(bB,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:lt(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),V3e=x.forwardRef((e,t)=>{const n=zA(zi,e.__scopeMenu);return F.jsx(bB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),H3e=uae("MenuContent.ScrollLock"),bB=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:p,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:d,onDismiss:f,disableOutsideScroll:h,...m}=e,g=zA(zi,n),y=$C(zi,n),_=yP(n),S=_ae(n),w=L3e(n),[R,E]=x.useState(null),T=x.useRef(null),D=Cn(t,T,g.onContentChange),B=x.useRef(0),N=x.useRef(""),L=x.useRef(0),q=x.useRef(null),I=x.useRef("right"),U=x.useRef(0),J=h?UF:x.Fragment,V=h?{as:H3e,allowPinchZoom:!0}:void 0,G=le=>{const K=N.current+le,X=w().filter(Me=>!Me.disabled),ce=document.activeElement,W=X.find(Me=>Me.ref.current===ce)?.textValue,_e=X.map(Me=>Me.textValue),Ne=n6e(_e,K,W),Ie=X.find(Me=>Me.textValue===Ne)?.ref.current;(function Me(Ye){N.current=Ye,window.clearTimeout(B.current),Ye!==""&&(B.current=window.setTimeout(()=>Me(""),1e3))})(K),Ie&&setTimeout(()=>Ie.focus())};x.useEffect(()=>()=>window.clearTimeout(B.current),[]),vee();const Q=x.useCallback(le=>I.current===q.current?.side&&o6e(le,q.current?.area),[]);return F.jsx(q3e,{scope:n,searchRef:N,onItemEnter:x.useCallback(le=>{Q(le)&&le.preventDefault()},[Q]),onItemLeave:x.useCallback(le=>{Q(le)||(T.current?.focus(),E(null))},[Q]),onTriggerLeave:x.useCallback(le=>{Q(le)&&le.preventDefault()},[Q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:x.useCallback(le=>{q.current=le},[]),children:F.jsx(J,{...V,children:F.jsx(PF,{asChild:!0,trapped:r,onMountAutoFocus:lt(i,le=>{le.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:F.jsx(jM,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:d,onDismiss:f,children:F.jsx(gae,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:E,onEntryFocus:lt(c,le=>{y.isUsingKeyboardRef.current||le.preventDefault()}),preventScrollOnEntryFocus:!0,children:F.jsx(Qee,{role:"menu","aria-orientation":"vertical","data-state":kae(g.open),"data-radix-menu-content":"",dir:y.dir,..._,...m,ref:D,style:{outline:"none",...m.style},onKeyDown:lt(m.onKeyDown,le=>{const X=le.target.closest("[data-radix-menu-content]")===le.currentTarget,ce=le.ctrlKey||le.altKey||le.metaKey,W=le.key.length===1;X&&(le.key==="Tab"&&le.preventDefault(),!ce&&W&&G(le.key));const _e=T.current;if(le.target!==_e||!j3e.includes(le.key))return;le.preventDefault();const Ie=w().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);yae.includes(le.key)&&Ie.reverse(),e6e(Ie)}),onBlur:lt(e.onBlur,le=>{le.currentTarget.contains(le.target)||(window.clearTimeout(B.current),N.current="")}),onPointerMove:lt(e.onPointerMove,K0(le=>{const K=le.target,X=U.current!==le.clientX;if(le.currentTarget.contains(K)&&X){const ce=le.clientX>U.current?"right":"left";I.current=ce,U.current=le.clientX}}))})})})})})})});Cae.displayName=zi;var G3e="MenuGroup",yB=x.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return F.jsx(zC.div,{role:"group",...o,ref:t})});yB.displayName=G3e;var z3e="MenuLabel",wae=x.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return F.jsx(zC.div,{...o,ref:t})});wae.displayName=z3e;var wE="MenuItem",FQ="menu.itemSelect",AP=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,i=x.useRef(null),s=$C(wE,e.__scopeMenu),a=gB(wE,e.__scopeMenu),c=Cn(t,i),p=x.useRef(!1),u=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(FQ,{bubbles:!0,cancelable:!0});l.addEventListener(FQ,f=>o?.(f),{once:!0}),d3e(l,d),d.defaultPrevented?p.current=!1:s.onClose()}};return F.jsx(Oae,{...r,ref:c,disabled:n,onClick:lt(e.onClick,u),onPointerDown:l=>{e.onPointerDown?.(l),p.current=!0},onPointerUp:lt(e.onPointerUp,l=>{p.current||l.currentTarget?.click()}),onKeyDown:lt(e.onKeyDown,l=>{const d=a.searchRef.current!=="";n||d&&l.key===" "||P1.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});AP.displayName=wE;var Oae=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...i}=e,s=gB(wE,n),a=_ae(n),c=x.useRef(null),p=Cn(t,c),[u,l]=x.useState(!1),[d,f]=x.useState("");return x.useEffect(()=>{const h=c.current;h&&f((h.textContent??"").trim())},[i.children]),F.jsx(z0.ItemSlot,{scope:n,disabled:o,textValue:r??d,children:F.jsx(bae,{asChild:!0,...a,focusable:!o,children:F.jsx(zC.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:p,onPointerMove:lt(e.onPointerMove,K0(h=>{o?s.onItemLeave(h):(s.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:lt(e.onPointerLeave,K0(h=>s.onItemLeave(h))),onFocus:lt(e.onFocus,()=>l(!0)),onBlur:lt(e.onBlur,()=>l(!1))})})})}),K3e="MenuCheckboxItem",Tae=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return F.jsx(Iae,{scope:e.__scopeMenu,checked:n,children:F.jsx(AP,{role:"menuitemcheckbox","aria-checked":OE(n)?"mixed":n,...r,ref:t,"data-state":_B(n),onSelect:lt(r.onSelect,()=>o?.(OE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Tae.displayName=K3e;var Rae="MenuRadioGroup",[Q3e,$3e]=hb(Rae,{value:void 0,onValueChange:()=>{}}),Eae=x.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,i=Co(o);return F.jsx(Q3e,{scope:e.__scopeMenu,value:n,onValueChange:i,children:F.jsx(yB,{...r,ref:t})})});Eae.displayName=Rae;var Mae="MenuRadioItem",Pae=x.forwardRef((e,t)=>{const{value:n,...o}=e,r=$3e(Mae,e.__scopeMenu),i=n===r.value;return F.jsx(Iae,{scope:e.__scopeMenu,checked:i,children:F.jsx(AP,{role:"menuitemradio","aria-checked":i,...o,ref:t,"data-state":_B(i),onSelect:lt(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Pae.displayName=Mae;var AB="MenuItemIndicator",[Iae,W3e]=hb(AB,{checked:!1}),jae=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,i=W3e(AB,n);return F.jsx(ql,{present:o||OE(i.checked)||i.checked===!0,children:F.jsx(zC.span,{...r,ref:t,"data-state":_B(i.checked)})})});jae.displayName=AB;var Y3e="MenuSeparator",Dae=x.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return F.jsx(zC.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});Dae.displayName=Y3e;var X3e="MenuArrow",Nae=x.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=yP(n);return F.jsx($ee,{...r,...o,ref:t})});Nae.displayName=X3e;var Z3e="MenuSub",[k2t,Lae]=hb(Z3e),ZS="MenuSubTrigger",Fae=x.forwardRef((e,t)=>{const n=zA(ZS,e.__scopeMenu),o=$C(ZS,e.__scopeMenu),r=Lae(ZS,e.__scopeMenu),i=gB(ZS,e.__scopeMenu),s=x.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,p={__scopeMenu:e.__scopeMenu},u=x.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return x.useEffect(()=>u,[u]),x.useEffect(()=>{const l=a.current;return()=>{window.clearTimeout(l),c(null)}},[a,c]),F.jsx(mB,{asChild:!0,...p,children:F.jsx(Oae,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":kae(n.open),...e,ref:Er(t,r.onTriggerChange),onClick:l=>{e.onClick?.(l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:lt(e.onPointerMove,K0(l=>{i.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:lt(e.onPointerLeave,K0(l=>{u();const d=n.content?.getBoundingClientRect();if(d){const f=n.content?.dataset.side,h=f==="right",m=h?-5:5,g=d[h?"left":"right"],y=d[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+m,y:l.clientY},{x:g,y:d.top},{x:y,y:d.top},{x:y,y:d.bottom},{x:g,y:d.bottom}],side:f}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:lt(e.onKeyDown,l=>{const d=i.searchRef.current!=="";e.disabled||d&&l.key===" "||D3e[o.dir].includes(l.key)&&(n.onOpenChange(!0),n.content?.focus(),l.preventDefault())})})})});Fae.displayName=ZS;var xae="MenuSubContent",Bae=x.forwardRef((e,t)=>{const n=Sae(zi,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=zA(zi,e.__scopeMenu),s=$C(zi,e.__scopeMenu),a=Lae(xae,e.__scopeMenu),c=x.useRef(null),p=Cn(t,c);return F.jsx(z0.Provider,{scope:e.__scopeMenu,children:F.jsx(ql,{present:o||i.open,children:F.jsx(z0.Slot,{scope:e.__scopeMenu,children:F.jsx(bB,{id:a.contentId,"aria-labelledby":a.triggerId,...r,ref:p,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{s.isUsingKeyboardRef.current&&c.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:lt(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:lt(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:lt(e.onKeyDown,u=>{const l=u.currentTarget.contains(u.target),d=N3e[s.dir].includes(u.key);l&&d&&(i.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});Bae.displayName=xae;function kae(e){return e?"open":"closed"}function OE(e){return e==="indeterminate"}function _B(e){return OE(e)?"indeterminate":e?"checked":"unchecked"}function e6e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t6e(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function n6e(e,t,n){const r=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=t6e(e,Math.max(i,0));r.length===1&&(s=s.filter(p=>p!==n));const c=s.find(p=>p.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function r6e(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;io!=d>o&&n<(l-p)*(o-u)/(d-u)+p&&(r=!r)}return r}function o6e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return r6e(n,t)}function K0(e){return t=>t.pointerType==="mouse"?e(t):void 0}var i6e=vae,s6e=mB,a6e=Cae,l6e=yB,u6e=wae,c6e=AP,d6e=Tae,f6e=Eae,h6e=Pae,p6e=jae,m6e=Dae,g6e=Nae,b6e=Fae,y6e=Bae,_P="DropdownMenu",[A6e]=k5e(_P,[Aae]),Jo=Aae(),[_6e,Uae]=A6e(_P),qae=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,c=Jo(t),p=x.useRef(null),[u,l]=jA({prop:r,defaultProp:i??!1,onChange:s,caller:_P});return F.jsx(_6e,{scope:t,triggerId:hm(),triggerRef:p,contentId:hm(),open:u,onOpenChange:l,onOpenToggle:x.useCallback(()=>l(d=>!d),[l]),modal:a,children:F.jsx(i6e,{...c,open:u,onOpenChange:l,dir:o,modal:a,children:n})})};qae.displayName=_P;var Jae="DropdownMenuTrigger",Vae=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,i=Uae(Jae,n),s=Jo(n);return F.jsx(s6e,{asChild:!0,...s,children:F.jsx(Q5e.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:Er(t,i.triggerRef),onPointerDown:lt(e.onPointerDown,a=>{!o&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:lt(e.onKeyDown,a=>{o||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Vae.displayName=Jae;var Hae="DropdownMenuContent",Gae=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Uae(Hae,n),i=Jo(n),s=x.useRef(!1);return F.jsx(a6e,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...o,ref:t,onCloseAutoFocus:lt(e.onCloseAutoFocus,a=>{s.current||r.triggerRef.current?.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:lt(e.onInteractOutside,a=>{const c=a.detail.originalEvent,p=c.button===0&&c.ctrlKey===!0,u=c.button===2||p;(!r.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gae.displayName=Hae;var v6e="DropdownMenuGroup",S6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(l6e,{...r,...o,ref:t})});S6e.displayName=v6e;var C6e="DropdownMenuLabel",w6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(u6e,{...r,...o,ref:t})});w6e.displayName=C6e;var O6e="DropdownMenuItem",zae=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(c6e,{...r,...o,ref:t})});zae.displayName=O6e;var T6e="DropdownMenuCheckboxItem",R6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(d6e,{...r,...o,ref:t})});R6e.displayName=T6e;var E6e="DropdownMenuRadioGroup",M6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(f6e,{...r,...o,ref:t})});M6e.displayName=E6e;var P6e="DropdownMenuRadioItem",I6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(h6e,{...r,...o,ref:t})});I6e.displayName=P6e;var j6e="DropdownMenuItemIndicator",D6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(p6e,{...r,...o,ref:t})});D6e.displayName=j6e;var N6e="DropdownMenuSeparator",L6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(m6e,{...r,...o,ref:t})});L6e.displayName=N6e;var F6e="DropdownMenuArrow",x6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(g6e,{...r,...o,ref:t})});x6e.displayName=F6e;var B6e="DropdownMenuSubTrigger",k6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(b6e,{...r,...o,ref:t})});k6e.displayName=B6e;var U6e="DropdownMenuSubContent",q6e=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Jo(n);return F.jsx(y6e,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q6e.displayName=U6e;var J6e=qae,V6e=Vae,H6e=Gae,G6e=zae;function z6e(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,K6e(r,...t)]}function K6e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Q6e(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function $6e(e){const t=W6e(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(X6e);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function W6e(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=eHe(r),a=Z6e(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Y6e=Symbol("radix.slottable");function X6e(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Y6e}function Z6e(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function eHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tHe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kae=tHe.reduce((e,t)=>{const n=$6e(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),vP="Switch",[nHe]=z6e(vP),[rHe,oHe]=nHe(vP),Qae=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:i,required:s,disabled:a,value:c="on",onCheckedChange:p,form:u,...l}=e,[d,f]=x.useState(null),h=Cn(t,S=>f(S)),m=x.useRef(!1),g=d?u||!!d.closest("form"):!0,[y,_]=jA({prop:r,defaultProp:i??!1,onChange:p,caller:vP});return F.jsxs(rHe,{scope:n,checked:y,disabled:a,children:[F.jsx(Kae.button,{type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":Xae(y),"data-disabled":a?"":void 0,disabled:a,value:c,...l,ref:h,onClick:lt(e.onClick,S=>{_(w=>!w),g&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})}),g&&F.jsx(Yae,{control:d,bubbles:!m.current,name:o,value:c,checked:y,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Qae.displayName=vP;var $ae="SwitchThumb",Wae=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=oHe($ae,n);return F.jsx(Kae.span,{"data-state":Xae(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});Wae.displayName=$ae;var iHe="SwitchBubbleInput",Yae=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},i)=>{const s=x.useRef(null),a=Cn(s,i),c=Q6e(n),p=Fee(t);return x.useEffect(()=>{const u=s.current;if(!u)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(c!==n&&f){const h=new Event("click",{bubbles:o});f.call(u,n),u.dispatchEvent(h)}},[c,n,o]),F.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:a,style:{...r.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Yae.displayName=iHe;function Xae(e){return e?"checked":"unchecked"}var sHe=Qae,aHe=Wae;const Zae=({checked:e,onCheckedChange:t,disabled:n=!1,id:o,className:r})=>F.jsx("div",{className:"flex items-center gap-2",children:F.jsx(sHe,{dir:"ltr",id:o,checked:e,onCheckedChange:t,disabled:n,className:ke("relative inline-flex align-center shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out","focus:outline-none","disabled:cursor-not-allowed disabled:opacity-50","bg-[var(--toggle-button-off-background-color)] data-[state=checked]:bg-[var(--toggle-button-background-color)]","data-[state=checked]:hover:enabled:bg-[var(--toggle-button-background-hover-color)]","w-[24px] h-[14px]",r),children:F.jsx(aHe,{className:ke("pointer-events-none inline-block rounded-full bg-[var(--toggle-button-circle-color)] ring-0 transition-transform duration-200 ease-in-out","w-[10px] h-[10px] translate-x-[1px] data-[state=checked]:translate-x-[10px]")})})}),lHe=({text:e,icon:t,iconSize:n=16,onClick:o,isActive:r,isSeparator:i,withToggle:s,toggleChecked:a,onToggleChange:c,toggleDisabled:p,subMenu:u,checked:l,tooltipText:d,withSpace:f,withAbout:h,aboutContent:m})=>{const{isRTL:g}=wn(),[y,_]=x.useState(!1),[S,w]=x.useState("left"),[R,E]=x.useState(12),[T,D]=x.useState(!1),B=x.useRef(null),N=x.useRef(null);if(i)return F.jsx("div",{className:"h-px min-h-[1px] w-full bg-[var(--drop-down-menu-separator-color)] my-[4px] flex-shrink-0"});const L=V=>{if(s){V.stopPropagation(),V.preventDefault();return}o(V)},q=V=>{V.stopPropagation(),V.preventDefault(),!(V.target instanceof HTMLElement&&(V.target.closest("[data-slot='tooltip-trigger']")||V.target.closest("[data-slot='tooltip-content']")))&&(p||c?.(!a))},I=V=>{if(!B.current||!N.current)return;const G=V.clientX,Q=V.clientY,le=B.current.getBoundingClientRect(),K=N.current?.getBoundingClientRect(),X=G>=le.left&&G<=le.right&&Q>=le.top&&Q<=le.bottom,ce=K&&G>=K.left&&G<=K.right&&Q>=K.top&&Q<=K.bottom;!X&&!ce&&(_(!1),window.removeEventListener("mousemove",I))},U=()=>{if(!(y||!u)){if(B.current){const V=B.current.getBoundingClientRect(),Q=window.innerWidth-V.right,le=V.left,K=154;let X;g?X=le>=K?"left":"right":X=Q>=K?"right":"left",w(X),E(12)}_(!0),window.addEventListener("mousemove",I)}},J=F.jsxs(G6e,{className:ke("dropdown-menu-item","flex items-center justify-between gap-[32px] min-w-0 w-full max-w-full min-h-[32px] h-[32px] px-[12px] select-none cursor-pointer","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 border-0","hover:bg-[var(--drop-down-menu-item-hover-color)] hover:text-[var(--drop-down-menu-item-hover-color)]","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",r||u&&y?"bg-[var(--drop-down-menu-item-active-color)] text-[var(--drop-down-menu-item-active-color)]":""),onSelect:s?V=>V.preventDefault():L,onClick:s?q:void 0,onMouseEnter:U,ref:B,dir:g?"rtl":"ltr",children:[F.jsxs("div",{className:ke("flex items-center gap-[4px] min-w-0 flex-1"),children:[t&&typeof t=="string"?F.jsx(Vt,{iconName:t,size:n,disableHover:!0}):t??null,F.jsx("span",{className:ke("truncate font-normal text-[14px] leading-[20px] text-[var(--drop-down-menu-item-color)]",f?"ms-[28px]":""),children:e}),h?F.jsxs(mA,{open:T,children:[F.jsx(bA,{asChild:!0,children:F.jsx(Vt,{iconName:"btn-menu-about",size:24,disableHover:!0,onClick:()=>D(V=>!V)})}),F.jsx(gA,{side:void 0,sideOffset:4,isAbout:!0,children:m})]}):null]}),u?F.jsx(pb,{trigger:F.jsx(Vt,{iconName:"arrow.right",size:12,insideElement:!0,isStroke:!0,className:g?"rotate-180":""}),items:u,side:S,align:"start",sideOffset:R,open:y,contentClassName:"mt-[-15px] max-w-[300px]",containerRef:B.current,dropdownRef:N}):null,l?F.jsx(Vt,{iconName:"checked",size:16,disableHover:!0,isStroke:!0}):null,s&&c?F.jsx("div",{onClick:V=>V.stopPropagation(),children:F.jsx(Zae,{checked:a??!1,onCheckedChange:c,disabled:p})}):null]});return d?F.jsxs(mA,{children:[F.jsx(bA,{asChild:!0,children:J}),F.jsx(gA,{side:void 0,sideOffset:4,children:d})]}):J},pb=({trigger:e,items:t,side:n,align:o,sideOffset:r,contentClassName:i,maxWidth:s,matchTriggerWidth:a,open:c,dropdownRef:p,onOpenChange:u})=>{const{isRTL:l}=wn();return F.jsxs(J6e,{open:c,onOpenChange:u,children:[F.jsx(V6e,{asChild:!0,children:e}),F.jsx(H6e,{ref:p,dir:l?"rtl":"ltr",side:n??"bottom",align:o??"start",sideOffset:r??6,"data-side":n,"data-align":o,"data-orientation":"vertical",className:ke("dropdown-menu z-50 border border-[var(--drop-down-menu-border-color)] rounded-[8px] shadow-[var(--drop-down-menu-shadow)] bg-[var(--drop-down-menu-background-color)] py-[8px] max-h-56 overflow-y-auto flex flex-col gap-[4px]",a?"min-w-[150px] w-[var(--radix-dropdown-menu-trigger-width)]":"w-fit",i),style:s?{maxWidth:s}:void 0,children:t.map((d,f)=>F.jsx(lHe,{...d},d.id||d.text||`item-${f}`))})]})},xQ=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BQ=nE,uHe=(e,t)=>n=>{var o;if(t?.variants==null)return BQ(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(p=>{const u=n?.[p],l=i?.[p];if(u===null)return null;const d=xQ(u)||xQ(l);return r[p][d]}),a=n&&Object.entries(n).reduce((p,u)=>{let[l,d]=u;return d===void 0||(p[l]=d),p},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((p,u)=>{let{class:l,className:d,...f}=u;return Object.entries(f).every(h=>{let[m,g]=h;return Array.isArray(g)?g.includes({...i,...a}[m]):{...i,...a}[m]===g})?[...p,l,d]:p},[]);return BQ(e,s,c,n?.class,n?.className)},cHe="inline-flex items-center justify-center rounded-[4px] min-w-[40px]",dHe="outline-none focus:outline-none focus-visible:outline-none",fHe="bg-[var(--button-default-background-color)] border border-[var(--button-default-border-color)] text-[var(--button-default-color)]",hHe="hover:enabled:bg-[var(--button-default-hover-background-color)]",pHe="active:enabled:bg-[var(--button-default-pressed-background-color)]",mHe="focus:shadow-[var(--button-default-focus-shadow)]",gHe="disabled:bg-[var(--button-default-disabled-background-color)] disabled:text-[var(--button-default-disabled-color)] disabled:opacity-40 disabled:cursor-not-allowed",bHe="bg-[var(--button-background-color)] text-[var(--button-color)]",yHe="hover:enabled:bg-[var(--button-background-hover-color)]",AHe="active:enabled:bg-[var(--button-background-pressed-color)]",_He="focus:bg-[var(--button-background-color)] focus:border-[var(--button-border-focus-color)] focus:shadow-[var(--button-shadow-focus)]",vHe="disabled:opacity-50 disabled:cursor-not-allowed",SHe="h-[32px] min-w-[40px] px-[12px] text-[14px] font-semibold leading-[16px]",CHe=uHe(`${cHe} ${dHe}`,{variants:{variant:{default:ke(fHe,hHe,pHe,mHe,gHe),primary:ke(bHe,yHe,AHe,_He,vHe)},size:{default:SHe},scale:{default:"w-fit",scale:"w-full"}},defaultVariants:{variant:"primary",size:"default",scale:"default"}}),Bn=({className:e,variant:t,size:n,asChild:o=!1,...r})=>{const i=o?MF:"button";return F.jsx(i,{"data-slot":"button",className:ke("cursor-pointer",CHe({variant:t,size:n,className:e})),...r})};function wHe(e,t){const n=x.createContext(t),o=i=>{const{children:s,...a}=i,c=x.useMemo(()=>a,Object.values(a));return F.jsx(n.Provider,{value:c,children:s})};o.displayName=e+"Provider";function r(i){const s=x.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function OHe(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,THe(r,...t)]}function THe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ele(e){const t=RHe(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(MHe);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function RHe(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=IHe(r),a=PHe(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EHe=Symbol("radix.slottable");function MHe(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EHe}function PHe(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function IHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jHe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],WC=jHe.reduce((e,t)=>{const n=ele(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),SP="Dialog",[tle]=OHe(SP),[DHe,js]=tle(SP),nle=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=x.useRef(null),c=x.useRef(null),[p,u]=jA({prop:o,defaultProp:r??!1,onChange:i,caller:SP});return F.jsx(DHe,{scope:t,triggerRef:a,contentRef:c,contentId:hm(),titleId:hm(),descriptionId:hm(),open:p,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(l=>!l),[u]),modal:s,children:n})};nle.displayName=SP;var rle="DialogTrigger",NHe=x.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=js(rle,n),i=Cn(t,r.triggerRef);return F.jsx(WC.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":CB(r.open),...o,ref:i,onClick:lt(e.onClick,r.onOpenToggle)})});NHe.displayName=rle;var vB="DialogPortal",[LHe,ole]=tle(vB,{forceMount:void 0}),ile=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=js(vB,t);return F.jsx(LHe,{scope:t,forceMount:n,children:x.Children.map(o,s=>F.jsx(ql,{present:n||i.open,children:F.jsx(kF,{asChild:!0,container:r,children:s})}))})};ile.displayName=vB;var TE="DialogOverlay",sle=x.forwardRef((e,t)=>{const n=ole(TE,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=js(TE,e.__scopeDialog);return i.modal?F.jsx(ql,{present:o||i.open,children:F.jsx(xHe,{...r,ref:t})}):null});sle.displayName=TE;var FHe=ele("DialogOverlay.RemoveScroll"),xHe=x.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=js(TE,n);return F.jsx(UF,{as:FHe,allowPinchZoom:!0,shards:[r.contentRef],children:F.jsx(WC.div,{"data-state":CB(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Hg="DialogContent",ale=x.forwardRef((e,t)=>{const n=ole(Hg,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=js(Hg,e.__scopeDialog);return F.jsx(ql,{present:o||i.open,children:i.modal?F.jsx(BHe,{...r,ref:t}):F.jsx(kHe,{...r,ref:t})})});ale.displayName=Hg;var BHe=x.forwardRef((e,t)=>{const n=js(Hg,e.__scopeDialog),o=x.useRef(null),r=Cn(t,n.contentRef,o);return x.useEffect(()=>{const i=o.current;if(i)return Yee(i)},[]),F.jsx(lle,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lt(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:lt(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:lt(e.onFocusOutside,i=>i.preventDefault())})}),kHe=x.forwardRef((e,t)=>{const n=js(Hg,e.__scopeDialog),o=x.useRef(!1),r=x.useRef(!1);return F.jsx(lle,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),lle=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...s}=e,a=js(Hg,n),c=x.useRef(null),p=Cn(t,c);return vee(),F.jsxs(F.Fragment,{children:[F.jsx(PF,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:F.jsx(jM,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":CB(a.open),...s,ref:p,onDismiss:()=>a.onOpenChange(!1)})}),F.jsxs(F.Fragment,{children:[F.jsx(qHe,{titleId:a.titleId}),F.jsx(VHe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),SB="DialogTitle",ule=x.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=js(SB,n);return F.jsx(WC.h2,{id:r.titleId,...o,ref:t})});ule.displayName=SB;var cle="DialogDescription",dle=x.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=js(cle,n);return F.jsx(WC.p,{id:r.descriptionId,...o,ref:t})});dle.displayName=cle;var fle="DialogClose",UHe=x.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=js(fle,n);return F.jsx(WC.button,{type:"button",...o,ref:t,onClick:lt(e.onClick,()=>r.onOpenChange(!1))})});UHe.displayName=fle;function CB(e){return e?"open":"closed"}var hle="DialogTitleWarning",[U2t,ple]=wHe(hle,{contentName:Hg,titleName:SB,docsSlug:"dialog"}),qHe=({titleId:e})=>{const t=ple(hle),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. -If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return T.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},c_e="DialogDescriptionWarning",u_e=({contentRef:t,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jz(c_e).contentName}}.`;return T.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,t,e]),null},d_e=Vz,h_e=zz,f_e=Qz,p_e=Gz,g_e=Wz,m_e=Kz;const Pl=({...t})=>_.jsx(d_e,{"data-slot":"dialog",...t}),A_e=({className:t,...e})=>_.jsx(f_e,{"data-slot":"dialog-overlay",className:_e("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[var(--modal-dialog-overlay-background)]",t),...e}),y_e=({...t})=>_.jsx(h_e,{"data-slot":"dialog-portal",container:document.getElementById("app"),...t}),v_e=({className:t,withWarningIcon:e,...n})=>{const{isRTL:i}=Wt();return _.jsx(g_e,{dir:i?"rtl":"ltr","data-slot":"dialog-title",className:_e("font-bold text-[var(--modal-dialog-header-color)] select-none",t,e?"text-[14px] leading-[20px]":"text-[18px] leading-[24px]"),...n})},b_e=()=>_.jsx(_.Fragment,{children:_.jsx(m_e,{className:"hidden",children:"Dialog content"})}),w_e="w-[348px]",S_e="w-[548px]",C_e=" box-border h-fit-content fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 rounded-[8px]",x_e="w-[352px] box-border h-fit-content fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 rounded-[8px]",E_e="bg-[var(--modal-dialog-background-color)] shadow-[var(--modal-dialog-shadows)]",Nl=({className:t,children:e,header:n,onClose:i,isHuge:r=!1,withWarningIcon:s=!1,...o})=>{const{isRTL:a}=Wt(),l=r?S_e:w_e,u=s?x_e:C_e;return me.useEffect(()=>{const d=f=>{f.key==="Escape"&&i()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i]),_.jsxs(y_e,{"data-slot":"dialog-portal",children:[_.jsx(A_e,{}),_.jsxs(p_e,{id:"dialog-content","data-slot":"dialog-content",dir:a?"rtl":"ltr",className:_e(l,u,E_e,"flex flex-col",t),onInteractOutside:d=>d.preventDefault(),...o,children:[_.jsx(b_e,{}),_.jsxs("div",{className:_e("flex items-center justify-between align-center",s?"h-[40px]":"h-[56px]",s?"ps-[16px] pe-[8px]":"ps-[32px] pe-[16px]"),children:[_.jsxs("div",{className:"flex items-center gap-[4px]",children:[s?_.jsx(wn,{name:"attention",size:20,noColor:!0}):null,_.jsx(v_e,{withWarningIcon:s,children:n})]}),_.jsx(gt,{iconName:"btn-close",size:24,onClick:i})]}),_.jsx("div",{className:_e("flex-1 min-h-0",s?"px-[16px]":"px-[32px]"),children:e})]})]})},__e=({id:t,onClose:e})=>{const{onDeleteThread:n}=om(),{isRTL:i}=Wt(),{t:r}=Ct(),s=me.useCallback(async()=>{await n(t),e()},[t,n,e]);return me.useEffect(()=>{const o=a=>{a.key==="Enter"&&(a.preventDefault(),s())};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}},[s]),_.jsx(Pl,{open:!0,children:_.jsx(Nl,{header:r("Warning"),onClose:e,withWarningIcon:!0,children:_.jsxs("div",{className:"flex flex-col justify-between h-full",children:[_.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:r("WantDeleteChat")}),_.jsxs("div",{className:i?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[_.jsx(ln,{variant:"default",onClick:e,children:r("No")}),_.jsx(ln,{onClick:s,children:r("Yes")})]})]})})})},T_e=()=>_.jsx(wn,{name:"btn-save",size:16,isStroke:!0}),R_e=()=>_.jsx(wn,{name:"btn-rename",size:16}),k_e=()=>_.jsx(wn,{name:"btn-remove",size:16}),I_e=({thread:t,isActive:e,onSwitchToThread:n,onRenameThread:i,onDownloadThread:r,setCurrentPage:s})=>{const[o,a]=me.useState(!1),[l,u]=me.useState(!1),[d,f]=me.useState(!1),[g,m]=me.useState(!1),[v,S]=me.useState(t.title),C=me.useRef(null),E=me.useRef(null),{t:k}=Ct();me.useEffect(()=>{const N=B=>{d&&(B.key==="Escape"?(B.preventDefault(),f(!1),S(t.title)):B.key==="Enter"&&(B.preventDefault(),E.current?.blur()))};return d&&document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[d,t.title]);const R=()=>{o||d||g||(n(t.threadId),s("chat"))},M=()=>{m(!0),a(!1)},D=()=>{f(!0),a(!1)},P=()=>{r(t.threadId),a(!1)};return _.jsxs("div",{ref:C,className:`cursor-pointer rounded-[4px] h-[36px] min-h-[36px] flex items-center justify-between ${d?"":`px-[12px] ${e||o?"bg-[var(--chat-list-item-active-background-color)]":"hover:bg-[var(--chat-list-item-hover-background-color)] active:bg-[var(--chat-list-item-active-background-color)]"}`}`,onMouseEnter:()=>u(!0),onMouseLeave:()=>{o||u(!1)},onClick:R,children:[d?_.jsx(mo,{ref:E,value:v,onChange:N=>S(N.target.value),onBlur:()=>{f(!1),v&&i(t.threadId,v)},autoFocus:!0,className:"w-full",maxLength:128}):_.jsxs(_.Fragment,{children:[_.jsx("p",{className:"text-[var(--chat-list-item-color)] font-normal text-[14px] leading-[20px] truncate",children:t.title}),l&&!d?_.jsx(Yc,{open:o,onOpenChange:a,trigger:_.jsx(gt,{iconName:"more",size:20,isActive:o,insideElement:!0}),items:[{icon:_.jsx(T_e,{}),text:k("Save"),onClick:P},{icon:_.jsx(R_e,{}),text:k("Rename"),onClick:D},{icon:_.jsx(k_e,{}),text:k("Delete"),onClick:M}],side:"right",align:"start",sideOffset:0,containerRef:C.current}):null]}),g?_.jsx(__e,{id:t.threadId,onClose:()=>m(!1)}):null]},t.threadId)},M_e=()=>{const{threads:t,threadId:e,onSwitchToThread:n,onRenameThread:i,onDownloadThread:r}=om(),{setCurrentPage:s}=qg(),[o,a]=me.useState(!1),[l,u]=me.useState(""),[d,f]=me.useState(t),{t:g}=Ct(),m=S=>{const C=S.target.value;u(C)};me.useEffect(()=>{const S=t.filter(C=>C.title?.toLowerCase().includes(l.toLowerCase()));f(S)},[t,l]);const v=t.length===0;return o?_.jsxs("div",{className:"w-[264px] min-w-[264px] h-full max-h-full border-e-[1px] border-[var(--chat-list-border-right)] flex flex-col overflow-y-auto",style:{maxHeight:"100%"},children:[_.jsxs("div",{className:"sticky top-0 bg-[var(--layout-background-color)] z-10 pt-[24px] px-[24px]",children:[_.jsxs("div",{className:"flex items-center justify-between px-[8px]",children:[_.jsx("h4",{className:"text-[14px] leading-[20px] font-bold text-[var(--chat-list-color)]",children:g("ChatHistory")}),_.jsx(gt,{iconName:"btn-previtem",size:24,isStroke:!0,onClick:()=>a(!1)})]}),!v&&_.jsx("div",{className:"mt-[32px]",children:_.jsx(mo,{className:"w-full",type:"search",placeholder:g("Search"),icon:"search",value:l,onChange:m,onClear:()=>u("")})})]}),_.jsx("div",{className:"flex flex-col px-[24px] pb-[24px]",children:v?_.jsx("p",{className:"text-[var(--chat-list-empty-color)] font-normal text-[14px] leading-[20px] w-full text-center mt-[24px]",children:g("NoChatYet")}):_.jsx("div",{className:"flex flex-col mt-[16px]",children:d.length?d.map(S=>{const C=S.threadId===e;return _.jsx(I_e,{thread:S,isActive:C,onSwitchToThread:n,setCurrentPage:s,onRenameThread:i,onDownloadThread:r},S.threadId)}):_.jsx("p",{className:"text-[var(--chat-list-empty-color)] font-normal text-[14px] leading-[20px] w-full",children:g("NoChatYet")})})})]}):_.jsx("div",{className:"ms-[32px] mt-[24px]",children:_.jsx(ua,{tooltip:g("ChatHistory"),children:_.jsx(gt,{iconName:"btn-list-search",size:24,onClick:()=>{s("chat"),a(!0)}})})})},D_e=()=>{const{t}=Ct(),{currentPage:e,setCurrentPage:n}=qg(),{onSwitchToNewThread:i}=om();return _.jsxs("nav",{className:"w-full flex justify-between items-center h-[56px] min-h-[56px] box-border border-b-[1px] border-[var(--header-border-color)] bg-[var(--header-background-color)] px-[32px]",children:[_.jsxs("div",{className:"flex items-center gap-[12px]",children:[_.jsx("h3",{className:"text-[var(--header-color)] font-bold text-[16px] leading-[24px]",children:t("AIAgent")}),_.jsx(ua,{tooltip:t("NewChat"),children:_.jsx(gt,{iconName:"btn-zoomup",size:24,isStroke:!0,onClick:()=>{n("chat"),i()},"data-testid":"new-chat-button"})})]}),_.jsx(ua,{tooltip:t("Settings"),children:_.jsx(gt,{iconName:"btn-settings",size:24,isStroke:!0,isActive:e==="settings",onClick:()=>n(e==="settings"?"chat":"settings"),"data-testid":"settings-button"})})]})},P_e=t=>t==="dark"?"theme-night":"theme-white",v4=({children:t})=>{const{currentPage:e}=qg(),{themeId:n,setThemeId:i}=l8(),{i18n:r}=Ct(),{isRTL:s}=Wt();me.useLayoutEffect(()=>{window.RendererProcessVariable&&r.changeLanguage(window.RendererProcessVariable.lang),window.on_update_plugin_info=a=>{if(a.lang&&r.changeLanguage(a.lang),a.theme)if(a.theme==="theme-system"){const l=P_e(window.RendererProcessVariable.theme.system);i(l)}else i(a.theme)}},[r,i]);const o=e==="settings";return _.jsx("div",{className:`h-[100vh] ${n}`,dir:s?"rtl":"ltr",children:_.jsxs("main",{id:"app",className:"h-[100vh] bg-[var(--layout-background-color)] flex flex-col",children:[_.jsx(D_e,{}),_.jsxs("div",{className:"flex flex-row flex-1",style:{height:"calc(100vh - 56px)"},children:[o?null:_.jsx(M_e,{}),_.jsx("div",{className:"w-full",children:t})]})]})})},b4=t=>{let e="";const n={};let i="";return Object.entries(t).forEach(([s,o])=>{s==="env"&&Object.entries(o).forEach(([a,l])=>{n[a]=l}),s==="command"&&(e=o),s==="args"&&(i=o.join(" "))}),{commandLine:`${e} ${i}`,env:n}},w4=t=>typeof t.url=="string",lE=t=>{const e=[],n=t.split(` -`);for(const i of n)if(i.startsWith("data: ")){const r=i.slice(6);try{const s=JSON.parse(r);e.push(s)}catch{}}if(e.length===0&&t.trim())try{e.push(JSON.parse(t))}catch{}return e},S4=t=>{const e=t.url,n=t.headers||{};return{url:e,headers:n}};class N_e{customServers;startedCustomServers;initedCustomServers;stoppedCustomServers;customServersProcesses;httpServers;customServersLogs;tools;constructor(){this.customServers={},this.startedCustomServers={},this.initedCustomServers={},this.customServersProcesses={},this.httpServers={},this.customServersLogs={},this.tools={},this.stoppedCustomServers=[]}onProcess=(e,n,i)=>{try{const r=JSON.parse(i);r.jsonrpc==="2.0"&&r.id&&r.id.includes(`init-${e}`)&&(this.initedCustomServers[e]=!0,this.stoppedCustomServers=this.stoppedCustomServers.filter(s=>s!==e)),r.jsonrpc==="2.0"&&r.id&&r.id.includes(`tools-${e}`)&&(this.tools[e]=r.result.tools,window.dispatchEvent(new CustomEvent("tools-changed")))}catch{}switch(n){case 0:{this.customServersLogs[e].push(`${new Date().toLocaleString()}: ${i} -`);break}case 1:{this.customServersLogs[e].push(`${new Date().toLocaleString()}: ${i} -`);break}case 2:{this.customServersLogs[e].push(`${new Date().toLocaleString()}: [stop] ${i} -`),this.stoppedCustomServers.push(e);break}}};setCustomServers=e=>{this.customServers=e.mcpServers};getServerType=e=>{let n="";return Object.keys(this.customServers).forEach(i=>{e.includes(`${i}_`)&&(n=i)}),n};startCustomServers=()=>{const e=[];Object.entries(this.customServers).forEach(([n,i])=>{e.push(n),w4(i)?this.startHttpServer(n,i):this.startStdioServer(n,i)}),Object.keys(this.customServersProcesses).forEach(n=>{e.includes(n)||this.deleteCustomServer(n)}),Object.keys(this.httpServers).forEach(n=>{e.includes(n)||this.deleteCustomServer(n)})};startHttpServer=(e,n)=>{const{url:i,headers:r}=S4(n);this.startedCustomServers[e]!==i&&(this.httpServers[e]?.abortController&&this.httpServers[e].abortController.abort(),this.customServersLogs[e]=[`${new Date().toLocaleString()}: HTTP MCP ${i} -`],this.httpServers[e]={url:i,headers:r,abortController:new AbortController},this.startedCustomServers[e]=i,this.initHttpServer(e))};startStdioServer=(e,n)=>{const{commandLine:i,env:r}=b4(n);if(this.startedCustomServers[e]&&this.startedCustomServers[e]===i)return;this.customServersProcesses[e]&&this.customServersProcesses[e].end(),this.customServersLogs[e]=[`${new Date().toLocaleString()}: ${i} -`];const s=new window.ExternalProcess(i,r);s.onprocess=this.onProcess.bind(this,e),this.customServersProcesses[e]=s,s.start(),this.startedCustomServers[e]=i,this.initCustomServer(e)};restartCustomServer=e=>{Object.entries(this.customServers).forEach(([n,i])=>{e===n&&(w4(i)?this.restartHttpServer(e,i):this.restartStdioServer(e,i))})};restartHttpServer=(e,n)=>{this.httpServers[e]?.abortController&&this.httpServers[e].abortController.abort();const{url:i,headers:r}=S4(n);this.customServersLogs[e]=[`${new Date().toLocaleString()}: HTTP MCP ${i} -`],this.tools[e]=[],this.initedCustomServers[e]=!1,this.httpServers[e]={url:i,headers:r,abortController:new AbortController},this.initHttpServer(e),window.dispatchEvent(new CustomEvent("tools-changed"))};restartStdioServer=(e,n)=>{this.customServersProcesses[e].end();const{commandLine:i,env:r}=b4(n);this.customServersLogs[e]=[`${new Date().toLocaleString()}: ${i} -`],this.tools[e]=[];const s=new window.ExternalProcess(i,r);s.onprocess=this.onProcess.bind(this,e),this.customServersProcesses[e]=s,s.start(),this.initCustomServer(e),window.dispatchEvent(new CustomEvent("tools-changed"))};deleteCustomServer=e=>{this.customServersProcesses[e]&&(this.customServersProcesses[e].end(),delete this.customServersProcesses[e]),this.httpServers[e]&&(this.httpServers[e].abortController&&this.httpServers[e].abortController.abort(),delete this.httpServers[e]),this.customServersLogs[e]&&delete this.customServersLogs[e],this.startedCustomServers[e]&&delete this.startedCustomServers[e],this.customServers[e]&&delete this.customServers[e],this.tools[e]&&delete this.tools[e],window.dispatchEvent(new CustomEvent("tools-changed"))};initHttpServer=async e=>{const n=this.httpServers[e];if(n)try{const i={jsonrpc:"2.0",id:`init-${e}`,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{tools:{}},clientInfo:{name:"ai-agent",version:"1.0.0"}}},r=await fetch(`onlyoffice-proxy://${n.url}`,{method:"POST",headers:{"Content-Type":"application/json",...n.headers},body:JSON.stringify(i)});if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=await r.text(),o=lE(s);for(const a of o){this.onProcess(e,0,JSON.stringify(a));const l=a;if(l.jsonrpc==="2.0"&&l.id?.includes(`init-${e}`)){this.initedCustomServers[e]=!0,this.stoppedCustomServers=this.stoppedCustomServers.filter(u=>u!==e),await this.getToolsFromHttpMCP(e);return}}}catch(i){console.error(`Error initializing HTTP MCP server ${e}:`,i),this.onProcess(e,2,`Connection failed: ${i}`)}};initCustomServer=e=>{const n=this.customServersProcesses[e];if(!n)return;const i=setInterval(()=>{if(this.initedCustomServers[e]){clearInterval(i),this.getToolsFromMCP(e);return}try{const r={jsonrpc:"2.0",id:`init-${e}`,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{tools:{}},clientInfo:{name:"ai-agent",version:"1.0.0"}}},o=`${JSON.stringify(r)} -`;n.stdin(o)}catch(r){console.error(`Error initializing custom server ${e}:`,r)}},1e3)};getToolsFromHttpMCP=async e=>{const n=this.httpServers[e];if(n)try{const i={jsonrpc:"2.0",id:`tools-${e}-${Date.now()}`,method:"tools/list",params:{}},r=await fetch(`onlyoffice-proxy://${n.url}`,{method:"POST",headers:{"Content-Type":"application/json",...n.headers},body:JSON.stringify(i)});if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=await r.text(),o=lE(s);for(const a of o)this.onProcess(e,0,JSON.stringify(a))}catch(i){console.error(`Error getting tools from HTTP MCP server ${e}:`,i)}};getToolsFromMCP=async e=>{const n=this.customServersProcesses[e];try{const i={jsonrpc:"2.0",id:`tools-${e}-${Date.now()}`,method:"tools/list",params:{}},s=`${JSON.stringify(i)} -`;n.stdin(s)}catch(i){console.error(`Error getting tools from MCP server ${e}:`,i)}};callToolFromMCP=async(e,n,i)=>this.httpServers[e]?this.callToolFromHttpMCP(e,n,i):this.callToolFromStdioMCP(e,n,i);callToolFromHttpMCP=async(e,n,i)=>{const r=this.httpServers[e];if(!r)throw new Error(`HTTP MCP server ${e} is not running`);if(!(this.tools[e]||[]).find(a=>a.name===n))throw new Error(`Tool ${n} not found on server ${e}`);try{const a={jsonrpc:"2.0",id:`call-${e}-${n}-${Date.now()}`,method:"tools/call",params:{name:n,arguments:i}},l=await fetch(`onlyoffice-proxy://${r.url}`,{method:"POST",headers:{"Content-Type":"application/json",...r.headers},body:JSON.stringify(a)});if(!l.ok)throw new Error(`HTTP ${l.status}`);const u=await l.text(),d=lE(u);for(const f of d){this.onProcess(e,0,JSON.stringify(f));const g=f;if(g.error)throw new Error(`MCP tool error (${g.error.code}): ${g.error.message}`);if(g.result!==void 0)return JSON.stringify(g.result)}throw new Error("No result in response")}catch(a){throw new Error(`Error calling HTTP MCP tool ${n} on server ${e}: ${a}`)}};callToolFromStdioMCP=async(e,n,i)=>{const r=this.customServersProcesses[e];if(!r)throw new Error(`MCP server ${e} is not running`);if(!(this.tools[e]||[]).find(a=>a.name===n))throw new Error(`Tool ${n} not found on server ${e}`);try{const a={jsonrpc:"2.0",id:`call-${e}-${n}-${Date.now()}`,method:"tools/call",params:{name:n,arguments:i}},u=`${JSON.stringify(a)} -`;return r.stdin(u),new Promise((d,f)=>{const g=setTimeout(()=>{f(new Error(`Timeout waiting for tool response from ${e}`))},3e4),m=r.onprocess;r.onprocess=(v,S)=>{if(m(v,S),v===0)try{const C=JSON.parse(S);C.id?.startsWith(`call-${e}-${n}`)&&(r.onprocess=m,clearTimeout(g),C.error?(console.error("MCP tool error response:",C.error),f(new Error(`MCP tool error (${C.error.code}): ${C.error.message}`))):(console.log("MCP tool success response:",C.result),d(JSON.stringify(C.result))))}catch{}}})}catch(a){throw new Error(`Error calling MCP tool ${n} on server ${e}: ${a}`)}};getTools=()=>this.tools}class O_e{tools;constructor(){this.tools=[],this.initTools()}setTools=e=>{this.tools=e};getTools=()=>[...this.tools];callTools=async(e,n)=>{const i={...n};return await window.AscDesktopEditor?.callToolFunction(e,JSON.stringify(i))};initTools=()=>{try{const e=window.AscDesktopEditor?.getToolFunctions()??"",n=JSON.parse(e).map(i=>({name:i.name,description:i.description,inputSchema:i.parameters}));this.setTools(n)}catch(e){console.error("Error parsing tools:",e)}}}const C4="webSearchProviderData";let B_e=class{tools;webSearchData=null;constructor(){this.tools=[];const e=localStorage.getItem(C4);e?this.webSearchData=JSON.parse(e):this.webSearchData=null,this.initTools()}setWebSearchData=e=>{this.webSearchData=e,localStorage.setItem(C4,e?JSON.stringify(e):""),this.initTools()};getWebSearchData=()=>this.webSearchData;setTools=e=>{this.tools=e};getTools=()=>[...this.tools];webSearch=async e=>{if(this.webSearchData?.provider==="Exa")try{const n=await fetch("onlyoffice-proxy://https://api.exa.ai/search",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.webSearchData?.key??""},body:JSON.stringify({query:e.query,text:!0,numResults:5,livecrawl:"preferred"})});if(!n.ok)return JSON.stringify({error:n.status,message:`Network error: ${n.status}`});const i=await n.json(),r=i.error?{error:i.error}:i.results;return JSON.stringify({data:r})}catch(n){return console.error("WebSearch error:",n),JSON.stringify({error:n})}return JSON.stringify(e)};webCrawling=async e=>{if(this.webSearchData?.provider==="Exa")try{const n=await fetch("onlyoffice-proxy://https://api.exa.ai/contents",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.webSearchData?.key??""},body:JSON.stringify({urls:e.urls,text:!0})});if(!n.ok)return JSON.stringify({error:n.status,message:`Network error: ${n.status}`});const i=await n.json(),r=i.error?{error:i.error}:i.results;return JSON.stringify({data:r})}catch(n){return console.error(n),JSON.stringify({error:n})}return JSON.stringify(e)};callTools=async(e,n)=>{if(e==="web_search")return await this.webSearch(n);if(e==="web_crawling")return await this.webCrawling(n)};initTools=()=>{if(!this.webSearchData){this.setTools([]);return}this.setTools([{name:"web_search",description:"The search endpoint lets you intelligently search the web and extract contents from the results.",inputSchema:{type:"object",properties:{query:{type:"string",description:"The query string for the search."}}}},{name:"web_crawling",description:"Get the full page contents, summaries, and metadata for a list of URLs.",inputSchema:{type:"object",properties:{urls:{type:"array",items:{type:"string"},description:"Array of URLs to crawl"}}}}]),window.dispatchEvent(new CustomEvent("tools-changed"))};getWebSearchEnabled=()=>!!this.webSearchData};const x4="allowAlwaysTools";let L_e=class{desktopEditorTool;customServers;webSearch;allowAlways;constructor(){this.desktopEditorTool=new O_e,this.customServers=new N_e,this.webSearch=new B_e,this.allowAlways=localStorage.getItem(x4)?.split(",")??[]}checkAllowAlways=(e,n)=>!!(e==="web-search"||this.allowAlways.includes(`${e}_${n}`));setAllowAlways=(e,n,i)=>{n!=="web-search"&&(e?this.allowAlways.push(`${n}_${i}`):this.allowAlways=this.allowAlways.filter(r=>r!==`${n}_${i}`),localStorage.setItem(x4,this.allowAlways.join(",")))};getTools=async()=>{const[e,n,i]=await Promise.all([this.desktopEditorTool.getTools(),this.webSearch.getTools(),this.customServers.getTools()]);return{"desktop-editor":e,"web-search":n,...i}};callTools=async(e,n,i)=>e==="desktop-editor"?this.desktopEditorTool.callTools(n,i):e==="web-search"?await this.webSearch.callTools(n,i):await this.customServers.callToolFromMCP(e,n,i);getServerType=e=>e.includes("desktop-editor_")?"desktop-editor":e.includes("web-search_")?"web-search":this.customServers.getServerType(e);setCustomServers=e=>{this.customServers.setCustomServers(e)};startCustomServers=()=>{this.customServers.startCustomServers()};restartCustomServer=e=>{this.customServers.restartCustomServer(e)};deleteCustomServer=e=>{this.customServers.deleteCustomServer(e)};getCustomServers=()=>this.customServers.customServers;getCustomServersStoped=()=>this.customServers.stoppedCustomServers;getCustomServersLogs=()=>this.customServers.customServersLogs;setWebSearchData=e=>{this.webSearch.setWebSearchData(e)};getWebSearchData=()=>this.webSearch.getWebSearchData();getWebSearchEnabled=()=>this.webSearch.getWebSearchEnabled()};const sn=new L_e,z0="disabledTools",Q0="mcpServers",Ns=Co((t,e)=>({servers:{},tools:[],disabledTools:{},manageToolData:void 0,webSearchEnabled:!1,initServers:()=>{const n=localStorage.getItem(Q0);if(n){const i=JSON.parse(n);sn.setCustomServers(i),sn.startCustomServers()}},getTools:async()=>{const n=await sn.getTools(),i=localStorage.getItem(z0),r=[],s={};let o=!1;if(i){const a=JSON.parse(i);Object.entries(n).forEach(([l,u])=>{if(l==="web-search"){if(s[l]=[...u],a["web-search"].length){t({webSearchEnabled:!1});return}const d=u.map(f=>({...f,name:`${l}_${f.name}`}));a[l]=[],r.push(...d),t({webSearchEnabled:u.length>0}),o=u.length>0;return}s[l]=u.map(d=>{a[l]||(a[l]=[]);const f=!a[l].includes(d.name);return(f&&o?r.length===Py:r.length===kd)?(a[l].push(d.name),{...d,enabled:!1}):(f&&r.push({...d,name:`${l}_${d.name}`}),{...d,enabled:f})})}),t({disabledTools:a})}else{const a={};let l=!1;Object.entries(n).forEach(([u,d])=>{if(a[u]=[],u==="web-search"){s[u]=[...d];const g=d.map(m=>({...m,name:`${u}_${m.name}`,enabled:!0}));r.push(...g),t({webSearchEnabled:d.length>0}),l=d.length>0;return}const f=d.map((g,m)=>r.length+m>=(l?Py:kd)?(a[u].push(g.name),{...g,enabled:!1}):{...g,enabled:!0});s[u]=f,r.push(...f.filter(g=>g.enabled).map(g=>({...g,name:`${u}_${g.name}`})))}),t({disabledTools:a})}t({tools:r,servers:s})},changeToolStatus:(n,i,r)=>{const s=e(),o=s.servers,a=o[n].find(l=>l.name===i);if(a){if(r){if(n==="web-search"){const u={...s.disabledTools,[n]:[]};t({disabledTools:u}),t({webSearchEnabled:!0}),t({servers:{...o,[n]:o[n].map(d=>({...d,enabled:!0}))}}),localStorage.setItem(z0,JSON.stringify(u));return}if(s.tools.length>=(s.webSearchEnabled?Py:kd))return;const l={...s.disabledTools,[n]:s.disabledTools[n].filter(u=>u!==i)};t({tools:[...s.tools,{...a,name:`${n}_${a.name}`}],disabledTools:l}),localStorage.setItem(z0,JSON.stringify(l))}else{const l=[...s.disabledTools[n],i],u={...s.disabledTools,[n]:l};let d=[];n==="web-search"?(u[n]=[...s.servers[n].map(f=>f.name)],t({webSearchEnabled:!1}),d=s.tools.filter(f=>!f.name.includes(n))):d=s.tools.filter(f=>f.name!==`${n}_${i}`),t({tools:d,disabledTools:u}),localStorage.setItem(z0,JSON.stringify(u))}t({servers:{...o,[n]:o[n].map(l=>l.name===i?{...l,enabled:r}:l)}})}},checkAllowAlways:(n,i)=>sn.checkAllowAlways(n,i),setAllowAlways:(n,i,r)=>{sn.setAllowAlways(n,i,r)},callTools:async(n,i)=>{const r=e(),s=sn.getServerType(n),o=n.replace(`${s}_`,"");if(!r.disabledTools[s].find(l=>l===o))return await sn.callTools(s,o,i)},setManageToolData:n=>{t({manageToolData:n})},getConfig:()=>JSON.parse(localStorage.getItem(Q0)||JSON.stringify({mcpServers:{}})),saveConfig:n=>{const i=n.mcpServers?n:{mcpServers:{}};localStorage.setItem(Q0,JSON.stringify(i)),sn.setCustomServers(i),sn.startCustomServers()},deleteCustomServer:n=>{sn.deleteCustomServer(n);const i=e().getConfig();delete i.mcpServers[n],localStorage.setItem(Q0,JSON.stringify(i))},getCustomServersLogs:()=>sn.getCustomServersLogs(),getWebSearchEnabled:()=>sn.getWebSearchEnabled()})),U_e=({checked:t=!1,onChange:e,disabled:n=!1,id:i,className:r=""})=>{const s=k=>{e&&!n&&e(k.target.checked)},o="inline-flex items-center relative group",a="absolute opacity-0 cursor-pointer w-4 h-4 m-0",l="disabled:cursor-not-allowed",u="inline-flex items-center select-none",d=n?"cursor-not-allowed opacity-60":"cursor-pointer",f="w-4 h-4 rounded-[2px] flex items-center justify-center transition-all duration-200 box-border",g="focus-within:outline-none",m="bg-[var(--checkbox-bg-color)] border border-[var(--checkbox-color)]",v=n?"":"group-hover:!bg-[var(--checkbox-bg-hover-color)] group-active:!bg-[var(--checkbox-bg-pressed-color)]",S="bg-[var(--checkbox-active-color)]",C=n?"":"group-hover:!bg-[var(--checkbox-active-hover-color)] group-active:!bg-[var(--checkbox-active-pressed-color)]";return _.jsxs("div",{className:_e(o,r),children:[_.jsx("input",{type:"checkbox",id:i,checked:t,onChange:s,disabled:n,className:_e(a,l)}),_.jsx("label",{htmlFor:i,className:_e(u,d),children:_.jsx("div",{className:_e(f,g,t?_e(S,C):_e(m,v)),children:t?_.jsx(wn,{name:"checked",size:16,color:"var(--checkbox-active-icon-color)",isStroke:!0,className:"flex items-center justify-center"}):null})})]})},wh=({className:t,size:e=16})=>_.jsx("div",{className:_e("inline-block animate-spin rounded-full border-2 border-solid border-[var(--loader-border-color)] border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",t),style:{width:`${e}px`,height:`${e}px`}}),td="var(--chat-message-tool-call-name-color)",Xz=({toolName:t,argsText:e,result:n})=>{const{t:i}=Ct(),{isRTL:r}=Wt(),[s,o]=T.useState(!0),[a,l]=T.useState(!1),[u,d]=T.useState(!1);T.useEffect(()=>{a&&setTimeout(()=>{l(!1)},2e3)},[a]),T.useEffect(()=>{u&&setTimeout(()=>{d(!1)},2e3)},[u]);const f=sn.getServerType(t),g=t.replace(`${f}_`,""),m=n===void 0,v=g==="web_search",S=g==="web_crawling";let C="",E=e;try{const R=JSON.parse(E);R.args&&(E=JSON.stringify(R.args)),C=E?v?JSON.parse(E).query:S?JSON.parse(E).urls[0]:"":""}catch{}let k=n;try{k=typeof n=="string"?JSON.parse(n):n}catch{}return _.jsxs("div",{className:"my-[16px] flex w-full flex-col gap-3",children:[_.jsxs("div",{className:"flex items-center gap-[10px] cursor-pointer",onClick:()=>{if(S){window.open(C,"_blank");return}v&&n===void 0||o(!s)},children:[m?_.jsx(wh,{size:16}):_.jsx(wn,{name:k?.data?.error?"status.error":"tool.called",size:16,noColor:!0}),m&&!v&&!S?_.jsx("p",{className:"text-[var(--chat-message-tool-call-header-color)] text-[14px] font-normal leading-[16px]",children:i("ToolExecuted")}):null,_.jsxs("span",{className:"flex items-center gap-[8px] rounded-[4px] ps-[4px] pe-[8px] text-[14px] leading-[20px] font-normal text-[var(--chat-message-tool-call-name-color)] bg-[var(--chat-message-tool-call-name-background-color)] min-w-0 w-fit",children:[v?_.jsx(wn,{name:"btn-web-search",size:24,color:td}):S?null:_.jsx(wn,{name:"code",size:24,color:td,isStroke:!0}),_.jsx("span",{className:"truncate",children:v?C:S?`${g} | ${C}`:g})]}),S?_.jsx(wn,{name:"btn-external",size:16,color:td,isStroke:!0}):v&&n===void 0?null:_.jsx("span",{className:r&&s?"rotate-180":"",children:_.jsx(wn,{name:s?"arrow.right":"arrow.bottom",size:16,width:8,height:8,color:td,isStroke:!0})})]}),s?null:_.jsxs("div",{className:"flex flex-col gap-[24px] mt-[8px] p-[12px] bg-[var(--chat-message-tool-call-body-background-color)] rounded-[12px]",children:[v?null:_.jsxs("div",{className:"",children:[_.jsxs("p",{className:"flex flex-row items-center justify-between text-[var(--chat-message-tool-call-header-color)] text-[14px] font-bold leading-[20px]",children:[i("ToolCallArguments"),_.jsx("span",{onClick:()=>l(!0),className:"cursor-pointer",children:_.jsx(wn,{name:a?"checked":"btn-copy",size:24,color:td,isStroke:a})})]}),_.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:E||"{}"})]}),n!==void 0&&_.jsx("div",{className:"",children:v?_.jsx("div",{children:(()=>{try{if(k?.data?.error)return _.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof k=="string"?n:k?.data?.error});const R=k?.data||[];return R.length>0?_.jsx("div",{className:"flex flex-col gap-[10px]",children:R.map((M,D)=>_.jsxs("div",{className:"group h-[36px] px-[8px] rounded-[4px] flex flex-row items-center justify-between cursor-pointer hover:bg-[var(--drop-down-menu-item-hover-color)] transition-colors",onClick:()=>window.open(M.url,"_blank"),children:[_.jsxs("div",{className:"flex flex-row items-center gap-[8px] min-w-0 flex-1",children:[_.jsx(gt,{iconName:"btn-web-search",size:24,disableHover:!0}),_.jsx("h4",{className:"text-[14px] font-normal text-[var(--chat-message-tool-call-pre-color)] truncate",children:M.title})]}),_.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:_.jsx(gt,{iconName:"btn-external",size:24,disableHover:!0})})]},M.id))}):_.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})}catch{return _.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})}})()}):_.jsxs(_.Fragment,{children:[_.jsxs("p",{className:"flex flex-row items-center justify-between text-[var(--chat-message-tool-call-header-color)] text-[14px] font-bold leading-[20px]",children:[i("ToolCallResult"),_.jsx("span",{onClick:()=>d(!0),className:"cursor-pointer",children:_.jsx(wn,{name:u?"checked":"btn-copy",size:24,color:td,isStroke:u})})]}),_.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})]})})]})]})},V_e=({onAllow:t,onDeny:e,onClose:n})=>{const{t:i}=Ct(),{manageToolData:r}=Ns(),[s,o]=T.useState(!1),a=me.useCallback(()=>{t(s),n()},[t,s,n]),l=()=>{e(),n()},u=r?.message?.content[r.idx];if(me.useEffect(()=>{const d=f=>{f.key==="Enter"&&(f.preventDefault(),a())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[a]),!(!u||typeof u!="object"||!("type"in u)||u.type!=="tool-call"))return _.jsx(Pl,{open:!0,children:_.jsxs(Nl,{header:i("Confirmation"),onClose:e,isHuge:!0,children:[_.jsxs("div",{className:"flex flex-col justify-between h-full mb-[16px] text-[var(--tool-fallback-color)]",children:[_.jsx("p",{className:"mt-[8px] font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:i("AIWouldLikeUseThisTool")}),_.jsx(Xz,{type:"tool-call",toolCallId:u.toolCallId??"",args:u.args??{},toolName:u.toolName,argsText:u.argsText??"{}",result:u.result,status:{type:"running"},addResult:()=>{}}),_.jsx("p",{className:"font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:i("ReviewEachAction")}),_.jsxs("p",{onClick:()=>o(d=>!d),className:"cursor-pointer flex items-center gap-[8px] mt-[24px] font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:[_.jsx(U_e,{checked:s,id:"allow-always-checkbox"}),i("AlwaysAllow")]})]}),_.jsxs("div",{className:"flex flex-row justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",children:[_.jsx(ln,{variant:"default",onClick:l,children:i("Deny")}),_.jsx(ln,{onClick:a,children:i("Allow")})]})]})})},F_e=async t=>{const e=is.getDB();return new Promise(n=>{const s=e.transaction(["threads"],"readonly").objectStore("threads").get(t);s.onerror=()=>n(null),s.onsuccess=()=>n(s.result||null)})},Ew=Co((t,e)=>({attachmentFiles:[],attachmentImages:[],addAttachmentFile:n=>{e().attachmentFiles.length>=5||t({attachmentFiles:[...e().attachmentFiles,n]})},deleteAttachmentFile:n=>{t({attachmentFiles:e().attachmentFiles.filter(i=>i.path!==n)})},clearAttachmentFiles:()=>{t({attachmentFiles:[]})},addAttachmentImage:n=>{e().attachmentImages.length>=5||t({attachmentImages:[...e().attachmentImages,n]})},deleteAttachmentImage:n=>{t({attachmentImages:e().attachmentImages.filter(i=>i.name!==n)})},clearAttachmentImages:()=>{t({attachmentImages:[]})}})),Sh=Co((t,e)=>({messages:[],isStreamRunning:!1,isRequestRunning:!1,fetchPrevMessages:async n=>{const i=await $8(n);t({messages:i}),It.setCurrentProviderPrevMessages(i)},setIsStreamRunning:n=>{t({isStreamRunning:n})},setIsRequestRunning:n=>{t({isRequestRunning:n})},addMessage:n=>{const i=e();if(i.messages.length&&i.messages[i.messages.length-1].status?.type==="incomplete"){t({messages:[...i.messages.slice(0,-1),{...n}]});return}t({messages:[...i.messages,n]})},updateLastMessage:n=>{const i=e();t({messages:[...i.messages.slice(0,-1),n]})},stopMessage:()=>{e().setIsStreamRunning(!1),It.stopMessage()}})),H_e=({isReady:t})=>{const{messages:e,setIsStreamRunning:n,setIsRequestRunning:i,addMessage:r,updateLastMessage:s,fetchPrevMessages:o}=Sh(),{threadId:a,insertThread:l,insertNewMessageToThread:u}=om(),{manageToolData:d,callTools:f,checkAllowAlways:g,setAllowAlways:m,setManageToolData:v}=Ns(),{attachmentFiles:S,clearAttachmentFiles:C,attachmentImages:E,clearAttachmentImages:k}=Ew(),{currentProvider:R}=Tr(),{currentModel:M,extendedThinking:D}=vh(),P=T.useRef(a);T.useEffect(()=>{t&&(P.current=a,o(a),C())},[a,t,o,C]);const N=X=>X,B=X=>{if(!d)return;const J=d?.message?.content[d.idx];if(!J||typeof J!="object"||!("type"in J)||J.type!=="tool-call")return;const Z=J.toolName,Q=sn.getServerType(Z),q=Z.replace(`${Q}_`,"");X&&m(!0,Q,q),V(d.message,d.idx,d.messageUID,!0,!1),v(void 0)},G=()=>{d&&(V(d.message,d.idx,d.messageUID,!1,!0),v(void 0))},V=async(X,J,Z,Q,q)=>{const j=X.content[J];if(!j||typeof j!="object"||!("type"in j)||j.type!=="tool-call")return;const oe=j.toolName,L=sn.getServerType(oe),z=oe.replace(`${L}_`,"");if(g(L,z)||Q||q){const te=q?"User deny tool call":await f(j.toolName,j.args),U=Array.isArray(X.content)?X.content.map((Ce,ve)=>ve===J?{...j,result:te}:Ce):X.content,pe={...X,content:U};if(s(pe),LO(Z,pe),!It)return;const xe=It.sendMessageAfterToolCall(pe,D);xe&&$(xe,!0,Z)}else v({message:X,idx:J,messageUID:Z})},$=async(X,J,Z)=>{n(!0);let Q=!!J;const q=J&&Z?Z:crypto.randomUUID();if(e)for await(const j of X){if("isEnd"in j){if(P.current!==a){n(!1),i(!1);return}if(j.responseMessage.status?.type==="incomplete"){r(j.responseMessage),n(!1),i(!1);return}const oe=j.responseMessage;if(oe?.role==="assistant"&&Array.isArray(oe.content)){const L=oe.content.findIndex(z=>z.type==="tool-call"&&!z.result);if(L!==-1){V(oe,L,q);return}}n(!1),i(!1);return}Q?(LO(q,j),P.current===a&&s(j)):(J||i(!0),r(j),s0(a,q,j),Q=!0)}};return{convertMessage:N,onNew:async X=>{if(!It||!R||!M||X.content[0].type!=="text")return;let J=[],Z=[];S.length>0&&(J=S.map(L=>({type:"file",mimeType:JSON.stringify({path:L.path,type:L.type}),data:L.content})),C()),E.length>0&&(Z=E.map(L=>({type:"image",image:L.base64,name:L.name})),k());const q={role:"user",content:[...J,...Z,{type:"text",text:X.content[0].text}],attachments:X.attachments};if(await F_e(a))u({provider:R,model:M}),(async()=>await s0(a,crypto.randomUUID(),q))();else{let L="";for(const z of e)z.status?.type==="incomplete"&&z.status?.error||(L+=typeof z.content=="string"?z.content:z.content[0].type==="text"?z.content[0].text:"",L+=` +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},JHe="DialogDescriptionWarning",VHe=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ple(JHe).contentName}}.`;return x.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},HHe=nle,GHe=ile,zHe=sle,KHe=ale,QHe=ule,$He=dle;const Dm=({...e})=>F.jsx(HHe,{"data-slot":"dialog",...e}),WHe=({className:e,...t})=>F.jsx(zHe,{"data-slot":"dialog-overlay",className:ke("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[var(--modal-dialog-overlay-background)]",e),...t}),YHe=({...e})=>F.jsx(GHe,{"data-slot":"dialog-portal",container:document.getElementById("app"),...e}),XHe=({className:e,withWarningIcon:t,...n})=>{const{isRTL:o}=wn();return F.jsx(QHe,{dir:o?"rtl":"ltr","data-slot":"dialog-title",className:ke("font-bold text-[var(--modal-dialog-header-color)] select-none",e,t?"text-[14px] leading-[20px]":"text-[18px] leading-[24px]"),...n})},ZHe=()=>F.jsx(F.Fragment,{children:F.jsx($He,{className:"hidden",children:"Dialog content"})}),e8e="w-[348px]",t8e="w-[548px]",n8e=" box-border h-fit-content fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 rounded-[8px]",r8e="w-[352px] box-border h-fit-content fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 rounded-[8px]",o8e="bg-[var(--modal-dialog-background-color)] shadow-[var(--modal-dialog-shadows)]",Nm=({className:e,children:t,header:n,onClose:o,isHuge:r=!1,withWarningIcon:i=!1,...s})=>{const{isRTL:a}=wn(),c=r?t8e:e8e,p=i?r8e:n8e;return Re.useEffect(()=>{const u=l=>{l.key==="Escape"&&o()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[o]),F.jsxs(YHe,{"data-slot":"dialog-portal",children:[F.jsx(WHe,{}),F.jsxs(KHe,{id:"dialog-content","data-slot":"dialog-content",dir:a?"rtl":"ltr",className:ke(c,p,o8e,"flex flex-col",e),onInteractOutside:u=>u.preventDefault(),...s,children:[F.jsx(ZHe,{}),F.jsxs("div",{className:ke("flex items-center justify-between align-center",i?"h-[40px]":"h-[56px]",i?"ps-[16px] pe-[8px]":"ps-[32px] pe-[16px]"),children:[F.jsxs("div",{className:"flex items-center gap-[4px]",children:[i?F.jsx(tr,{name:"attention",size:20,noColor:!0}):null,F.jsx(XHe,{withWarningIcon:i,children:n})]}),F.jsx(Vt,{iconName:"btn-close",size:24,onClick:o})]}),F.jsx("div",{className:ke("flex-1 min-h-0",i?"px-[16px]":"px-[32px]"),children:t})]})]})},i8e=({id:e,onClose:t})=>{const{onDeleteThread:n}=GC(),{isRTL:o}=wn(),{t:r}=Wt(),i=Re.useCallback(async()=>{await n(e),t()},[e,n,t]);return Re.useEffect(()=>{const s=a=>{a.key==="Enter"&&(a.preventDefault(),i())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[i]),F.jsx(Dm,{open:!0,children:F.jsx(Nm,{header:r("Warning"),onClose:t,withWarningIcon:!0,children:F.jsxs("div",{className:"flex flex-col justify-between h-full",children:[F.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:r("WantDeleteChat")}),F.jsxs("div",{className:o?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[F.jsx(Bn,{variant:"default",onClick:t,children:r("No")}),F.jsx(Bn,{onClick:i,children:r("Yes")})]})]})})})},s8e=()=>F.jsx(tr,{name:"btn-save",size:16,isStroke:!0}),a8e=()=>F.jsx(tr,{name:"btn-rename",size:16}),l8e=()=>F.jsx(tr,{name:"btn-remove",size:16}),u8e=({thread:e,isActive:t,onSwitchToThread:n,onRenameThread:o,onDownloadThread:r,setCurrentPage:i})=>{const[s,a]=Re.useState(!1),[c,p]=Re.useState(!1),[u,l]=Re.useState(!1),[d,f]=Re.useState(!1),[h,m]=Re.useState(e.title),g=Re.useRef(null),y=Re.useRef(null),{t:_}=Wt();Re.useEffect(()=>{const T=D=>{u&&(D.key==="Escape"?(D.preventDefault(),l(!1),m(e.title)):D.key==="Enter"&&(D.preventDefault(),y.current?.blur()))};return u&&document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[u,e.title]);const S=()=>{s||u||d||(n(e.threadId),i("chat"))},w=()=>{f(!0),a(!1)},R=()=>{l(!0),a(!1)},E=()=>{r(e.threadId),a(!1)};return F.jsxs("div",{ref:g,className:`cursor-pointer rounded-[4px] h-[36px] min-h-[36px] flex items-center justify-between ${u?"":`px-[12px] ${t||s?"bg-[var(--chat-list-item-active-background-color)]":"hover:bg-[var(--chat-list-item-hover-background-color)] active:bg-[var(--chat-list-item-active-background-color)]"}`}`,onMouseEnter:()=>p(!0),onMouseLeave:()=>{s||p(!1)},onClick:S,children:[u?F.jsx(Il,{ref:y,value:h,onChange:T=>m(T.target.value),onBlur:()=>{l(!1),h&&o(e.threadId,h)},autoFocus:!0,className:"w-full",maxLength:128}):F.jsxs(F.Fragment,{children:[F.jsx("p",{className:"text-[var(--chat-list-item-color)] font-normal text-[14px] leading-[20px] truncate",children:e.title}),c&&!u?F.jsx(pb,{open:s,onOpenChange:a,trigger:F.jsx(Vt,{iconName:"more",size:20,isActive:s,insideElement:!0}),items:[{icon:F.jsx(s8e,{}),text:_("Save"),onClick:E},{icon:F.jsx(a8e,{}),text:_("Rename"),onClick:R},{icon:F.jsx(l8e,{}),text:_("Delete"),onClick:w}],side:"right",align:"start",sideOffset:0,containerRef:g.current}):null]}),d?F.jsx(i8e,{id:e.threadId,onClose:()=>f(!1)}):null]},e.threadId)},c8e=()=>{const{threads:e,threadId:t,onSwitchToThread:n,onRenameThread:o,onDownloadThread:r}=GC(),{setCurrentPage:i}=RC(),[s,a]=Re.useState(!1),[c,p]=Re.useState(""),[u,l]=Re.useState(e),{t:d}=Wt(),f=m=>{const g=m.target.value;p(g)};Re.useEffect(()=>{const m=e.filter(g=>g.title?.toLowerCase().includes(c.toLowerCase()));l(m)},[e,c]);const h=e.length===0;return s?F.jsxs("div",{className:"w-[264px] min-w-[264px] h-full max-h-full border-e-[1px] border-[var(--chat-list-border-right)] flex flex-col overflow-y-auto",style:{maxHeight:"100%"},children:[F.jsxs("div",{className:"sticky top-0 bg-[var(--layout-background-color)] z-10 pt-[24px] px-[24px]",children:[F.jsxs("div",{className:"flex items-center justify-between px-[8px]",children:[F.jsx("h4",{className:"text-[14px] leading-[20px] font-bold text-[var(--chat-list-color)]",children:d("ChatHistory")}),F.jsx(Vt,{iconName:"btn-previtem",size:24,isStroke:!0,onClick:()=>a(!1)})]}),!h&&F.jsx("div",{className:"mt-[32px]",children:F.jsx(Il,{className:"w-full",type:"search",placeholder:d("Search"),icon:"search",value:c,onChange:f,onClear:()=>p("")})})]}),F.jsx("div",{className:"flex flex-col px-[24px] pb-[24px]",children:h?F.jsx("p",{className:"text-[var(--chat-list-empty-color)] font-normal text-[14px] leading-[20px] w-full text-center mt-[24px]",children:d("NoChatYet")}):F.jsx("div",{className:"flex flex-col mt-[16px]",children:u.length?u.map(m=>{const g=m.threadId===t;return F.jsx(u8e,{thread:m,isActive:g,onSwitchToThread:n,setCurrentPage:i,onRenameThread:o,onDownloadThread:r},m.threadId)}):F.jsx("p",{className:"text-[var(--chat-list-empty-color)] font-normal text-[14px] leading-[20px] w-full",children:d("NoChatYet")})})})]}):F.jsx("div",{className:"ms-[32px] mt-[24px]",children:F.jsx(lp,{tooltip:d("ChatHistory"),children:F.jsx(Vt,{iconName:"btn-list-search",size:24,onClick:()=>{i("chat"),a(!0)}})})})},d8e=()=>{const{t:e}=Wt(),{currentPage:t,setCurrentPage:n}=RC(),{onSwitchToNewThread:o}=GC();return F.jsxs("nav",{className:"w-full flex justify-between items-center h-[56px] min-h-[56px] box-border border-b-[1px] border-[var(--header-border-color)] bg-[var(--header-background-color)] px-[32px]",children:[F.jsxs("div",{className:"flex items-center gap-[12px]",children:[F.jsx("h3",{className:"text-[var(--header-color)] font-bold text-[16px] leading-[24px]",children:e("AIAgent")}),F.jsx(lp,{tooltip:e("NewChat"),children:F.jsx(Vt,{iconName:"btn-zoomup",size:24,isStroke:!0,onClick:()=>{n("chat"),o()},"data-testid":"new-chat-button"})})]}),F.jsx(lp,{tooltip:e("Settings"),children:F.jsx(Vt,{iconName:"btn-settings",size:24,isStroke:!0,isActive:t==="settings",onClick:()=>n(t==="settings"?"chat":"settings"),"data-testid":"settings-button"})})]})},f8e=e=>e==="dark"?"theme-night":"theme-white",kQ=({children:e})=>{const{currentPage:t}=RC(),{themeId:n,setThemeId:o}=Ete(),{i18n:r}=Wt(),{isRTL:i}=wn();Re.useLayoutEffect(()=>{window.RendererProcessVariable&&r.changeLanguage(window.RendererProcessVariable.lang),window.on_update_plugin_info=a=>{if(a.lang&&r.changeLanguage(a.lang),a.theme)if(a.theme==="theme-system"){const c=f8e(window.RendererProcessVariable.theme.system);o(c)}else o(a.theme)}},[r,o]);const s=t==="settings";return F.jsx("div",{className:`h-[100vh] ${n}`,dir:i?"rtl":"ltr",children:F.jsxs("main",{id:"app",className:"h-[100vh] bg-[var(--layout-background-color)] flex flex-col",children:[F.jsx(d8e,{}),F.jsxs("div",{className:"flex flex-row flex-1",style:{height:"calc(100vh - 56px)"},children:[s?null:F.jsx(c8e,{}),F.jsx("div",{className:"w-full",children:e})]})]})})},UQ=e=>{let t="";const n={};let o="";return Object.entries(e).forEach(([i,s])=>{i==="env"&&Object.entries(s).forEach(([a,c])=>{n[a]=c}),i==="command"&&(t=s),i==="args"&&(o=s.join(" "))}),{commandLine:`${t} ${o}`,env:n}},qQ=e=>typeof e.url=="string",uN=e=>{const t=[],n=e.split(` +`);for(const o of n)if(o.startsWith("data: ")){const r=o.slice(6);try{const i=JSON.parse(r);t.push(i)}catch{}}if(t.length===0&&e.trim())try{t.push(JSON.parse(e))}catch{}return t},JQ=e=>{const t=e.url,n=e.headers||{};return{url:t,headers:n}};class h8e{customServers;startedCustomServers;initedCustomServers;stoppedCustomServers;customServersProcesses;httpServers;customServersLogs;tools;constructor(){this.customServers={},this.startedCustomServers={},this.initedCustomServers={},this.customServersProcesses={},this.httpServers={},this.customServersLogs={},this.tools={},this.stoppedCustomServers=[]}onProcess=(t,n,o)=>{try{const r=JSON.parse(o);r.jsonrpc==="2.0"&&r.id&&r.id.includes(`init-${t}`)&&(this.initedCustomServers[t]=!0,this.stoppedCustomServers=this.stoppedCustomServers.filter(i=>i!==t)),r.jsonrpc==="2.0"&&r.id&&r.id.includes(`tools-${t}`)&&(this.tools[t]=r.result.tools,window.dispatchEvent(new CustomEvent("tools-changed")))}catch{}switch(n){case 0:{this.customServersLogs[t].push(`${new Date().toLocaleString()}: ${o} +`);break}case 1:{this.customServersLogs[t].push(`${new Date().toLocaleString()}: ${o} +`);break}case 2:{this.customServersLogs[t].push(`${new Date().toLocaleString()}: [stop] ${o} +`),this.stoppedCustomServers.push(t);break}}};setCustomServers=t=>{this.customServers=t.mcpServers};getServerType=t=>{let n="";return Object.keys(this.customServers).forEach(o=>{t.includes(`${o}_`)&&(n=o)}),n};startCustomServers=()=>{const t=[];Object.entries(this.customServers).forEach(([n,o])=>{t.push(n),qQ(o)?this.startHttpServer(n,o):this.startStdioServer(n,o)}),Object.keys(this.customServersProcesses).forEach(n=>{t.includes(n)||this.deleteCustomServer(n)}),Object.keys(this.httpServers).forEach(n=>{t.includes(n)||this.deleteCustomServer(n)})};startHttpServer=(t,n)=>{const{url:o,headers:r}=JQ(n);this.startedCustomServers[t]!==o&&(this.httpServers[t]?.abortController&&this.httpServers[t].abortController.abort(),this.customServersLogs[t]=[`${new Date().toLocaleString()}: HTTP MCP ${o} +`],this.httpServers[t]={url:o,headers:r,abortController:new AbortController},this.startedCustomServers[t]=o,this.initHttpServer(t))};startStdioServer=(t,n)=>{const{commandLine:o,env:r}=UQ(n);if(this.startedCustomServers[t]&&this.startedCustomServers[t]===o)return;this.customServersProcesses[t]&&this.customServersProcesses[t].end(),this.customServersLogs[t]=[`${new Date().toLocaleString()}: ${o} +`];const i=new window.ExternalProcess(o,r);i.onprocess=this.onProcess.bind(this,t),this.customServersProcesses[t]=i,i.start(),this.startedCustomServers[t]=o,this.initCustomServer(t)};restartCustomServer=t=>{Object.entries(this.customServers).forEach(([n,o])=>{t===n&&(qQ(o)?this.restartHttpServer(t,o):this.restartStdioServer(t,o))})};restartHttpServer=(t,n)=>{this.httpServers[t]?.abortController&&this.httpServers[t].abortController.abort();const{url:o,headers:r}=JQ(n);this.customServersLogs[t]=[`${new Date().toLocaleString()}: HTTP MCP ${o} +`],this.tools[t]=[],this.initedCustomServers[t]=!1,this.httpServers[t]={url:o,headers:r,abortController:new AbortController},this.initHttpServer(t),window.dispatchEvent(new CustomEvent("tools-changed"))};restartStdioServer=(t,n)=>{this.customServersProcesses[t].end();const{commandLine:o,env:r}=UQ(n);this.customServersLogs[t]=[`${new Date().toLocaleString()}: ${o} +`],this.tools[t]=[];const i=new window.ExternalProcess(o,r);i.onprocess=this.onProcess.bind(this,t),this.customServersProcesses[t]=i,i.start(),this.initCustomServer(t),window.dispatchEvent(new CustomEvent("tools-changed"))};deleteCustomServer=t=>{this.customServersProcesses[t]&&(this.customServersProcesses[t].end(),delete this.customServersProcesses[t]),this.httpServers[t]&&(this.httpServers[t].abortController&&this.httpServers[t].abortController.abort(),delete this.httpServers[t]),this.customServersLogs[t]&&delete this.customServersLogs[t],this.startedCustomServers[t]&&delete this.startedCustomServers[t],this.customServers[t]&&delete this.customServers[t],this.tools[t]&&delete this.tools[t],window.dispatchEvent(new CustomEvent("tools-changed"))};initHttpServer=async t=>{const n=this.httpServers[t];if(n)try{const o={jsonrpc:"2.0",id:`init-${t}`,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{tools:{}},clientInfo:{name:"ai-agent",version:"1.0.0"}}},r=await fetch(`onlyoffice-proxy://${n.url}`,{method:"POST",headers:{"Content-Type":"application/json",...n.headers},body:JSON.stringify(o)});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.text(),s=uN(i);for(const a of s){this.onProcess(t,0,JSON.stringify(a));const c=a;if(c.jsonrpc==="2.0"&&c.id?.includes(`init-${t}`)){this.initedCustomServers[t]=!0,this.stoppedCustomServers=this.stoppedCustomServers.filter(p=>p!==t),await this.getToolsFromHttpMCP(t);return}}}catch(o){console.error(`Error initializing HTTP MCP server ${t}:`,o),this.onProcess(t,2,`Connection failed: ${o}`)}};initCustomServer=t=>{const n=this.customServersProcesses[t];if(!n)return;const o=setInterval(()=>{if(this.initedCustomServers[t]){clearInterval(o),this.getToolsFromMCP(t);return}try{const r={jsonrpc:"2.0",id:`init-${t}`,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{tools:{}},clientInfo:{name:"ai-agent",version:"1.0.0"}}},s=`${JSON.stringify(r)} +`;n.stdin(s)}catch(r){console.error(`Error initializing custom server ${t}:`,r)}},1e3)};getToolsFromHttpMCP=async t=>{const n=this.httpServers[t];if(n)try{const o={jsonrpc:"2.0",id:`tools-${t}-${Date.now()}`,method:"tools/list",params:{}},r=await fetch(`onlyoffice-proxy://${n.url}`,{method:"POST",headers:{"Content-Type":"application/json",...n.headers},body:JSON.stringify(o)});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.text(),s=uN(i);for(const a of s)this.onProcess(t,0,JSON.stringify(a))}catch(o){console.error(`Error getting tools from HTTP MCP server ${t}:`,o)}};getToolsFromMCP=async t=>{const n=this.customServersProcesses[t];try{const o={jsonrpc:"2.0",id:`tools-${t}-${Date.now()}`,method:"tools/list",params:{}},i=`${JSON.stringify(o)} +`;n.stdin(i)}catch(o){console.error(`Error getting tools from MCP server ${t}:`,o)}};callToolFromMCP=async(t,n,o)=>this.httpServers[t]?this.callToolFromHttpMCP(t,n,o):this.callToolFromStdioMCP(t,n,o);callToolFromHttpMCP=async(t,n,o)=>{const r=this.httpServers[t];if(!r)throw new Error(`HTTP MCP server ${t} is not running`);if(!(this.tools[t]||[]).find(a=>a.name===n))throw new Error(`Tool ${n} not found on server ${t}`);try{const a={jsonrpc:"2.0",id:`call-${t}-${n}-${Date.now()}`,method:"tools/call",params:{name:n,arguments:o}},c=await fetch(`onlyoffice-proxy://${r.url}`,{method:"POST",headers:{"Content-Type":"application/json",...r.headers},body:JSON.stringify(a)});if(!c.ok)throw new Error(`HTTP ${c.status}`);const p=await c.text(),u=uN(p);for(const l of u){this.onProcess(t,0,JSON.stringify(l));const d=l;if(d.error)throw new Error(`MCP tool error (${d.error.code}): ${d.error.message}`);if(d.result!==void 0)return JSON.stringify(d.result)}throw new Error("No result in response")}catch(a){throw new Error(`Error calling HTTP MCP tool ${n} on server ${t}: ${a}`)}};callToolFromStdioMCP=async(t,n,o)=>{const r=this.customServersProcesses[t];if(!r)throw new Error(`MCP server ${t} is not running`);if(!(this.tools[t]||[]).find(a=>a.name===n))throw new Error(`Tool ${n} not found on server ${t}`);try{const a={jsonrpc:"2.0",id:`call-${t}-${n}-${Date.now()}`,method:"tools/call",params:{name:n,arguments:o}},p=`${JSON.stringify(a)} +`;return r.stdin(p),new Promise((u,l)=>{const d=setTimeout(()=>{l(new Error(`Timeout waiting for tool response from ${t}`))},3e4),f=r.onprocess;r.onprocess=(h,m)=>{if(f(h,m),h===0)try{const g=JSON.parse(m);g.id?.startsWith(`call-${t}-${n}`)&&(r.onprocess=f,clearTimeout(d),g.error?(console.error("MCP tool error response:",g.error),l(new Error(`MCP tool error (${g.error.code}): ${g.error.message}`))):(console.log("MCP tool success response:",g.result),u(JSON.stringify(g.result))))}catch{}}})}catch(a){throw new Error(`Error calling MCP tool ${n} on server ${t}: ${a}`)}};getTools=()=>this.tools}class p8e{tools;constructor(){this.tools=[],this.initTools()}setTools=t=>{this.tools=t};getTools=()=>[...this.tools];callTools=async(t,n)=>{const o={...n};return await window.AscDesktopEditor?.callToolFunction(t,JSON.stringify(o))};initTools=()=>{try{const t=window.AscDesktopEditor?.getToolFunctions()??"",n=JSON.parse(t).map(o=>({name:o.name,description:o.description,inputSchema:o.parameters}));this.setTools(n)}catch(t){console.error("Error parsing tools:",t)}}}const VQ="webSearchProviderData";let m8e=class{tools;webSearchData=null;constructor(){this.tools=[];const t=localStorage.getItem(VQ);t?this.webSearchData=JSON.parse(t):this.webSearchData=null,this.initTools()}setWebSearchData=t=>{this.webSearchData=t,localStorage.setItem(VQ,t?JSON.stringify(t):""),this.initTools()};getWebSearchData=()=>this.webSearchData;setTools=t=>{this.tools=t};getTools=()=>[...this.tools];webSearch=async t=>{if(this.webSearchData?.provider==="Exa")try{const n=await fetch("onlyoffice-proxy://https://api.exa.ai/search",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.webSearchData?.key??""},body:JSON.stringify({query:t.query,text:!0,numResults:5,livecrawl:"preferred"})});if(!n.ok)return JSON.stringify({error:n.status,message:`Network error: ${n.status}`});const o=await n.json(),r=o.error?{error:o.error}:o.results;return JSON.stringify({data:r})}catch(n){return console.error("WebSearch error:",n),JSON.stringify({error:n})}return JSON.stringify(t)};webCrawling=async t=>{if(this.webSearchData?.provider==="Exa")try{const n=await fetch("onlyoffice-proxy://https://api.exa.ai/contents",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.webSearchData?.key??""},body:JSON.stringify({urls:t.urls,text:!0})});if(!n.ok)return JSON.stringify({error:n.status,message:`Network error: ${n.status}`});const o=await n.json(),r=o.error?{error:o.error}:o.results;return JSON.stringify({data:r})}catch(n){return console.error(n),JSON.stringify({error:n})}return JSON.stringify(t)};callTools=async(t,n)=>{if(t==="web_search")return await this.webSearch(n);if(t==="web_crawling")return await this.webCrawling(n)};initTools=()=>{if(!this.webSearchData){this.setTools([]);return}this.setTools([{name:"web_search",description:"The search endpoint lets you intelligently search the web and extract contents from the results.",inputSchema:{type:"object",properties:{query:{type:"string",description:"The query string for the search."}}}},{name:"web_crawling",description:"Get the full page contents, summaries, and metadata for a list of URLs.",inputSchema:{type:"object",properties:{urls:{type:"array",items:{type:"string"},description:"Array of URLs to crawl"}}}}]),window.dispatchEvent(new CustomEvent("tools-changed"))};getWebSearchEnabled=()=>!!this.webSearchData};const HQ="allowAlwaysTools";let g8e=class{desktopEditorTool;customServers;webSearch;allowAlways;constructor(){this.desktopEditorTool=new p8e,this.customServers=new h8e,this.webSearch=new m8e,this.allowAlways=localStorage.getItem(HQ)?.split(",")??[]}checkAllowAlways=(t,n)=>!!(t==="web-search"||this.allowAlways.includes(`${t}_${n}`));setAllowAlways=(t,n,o)=>{n!=="web-search"&&(t?this.allowAlways.push(`${n}_${o}`):this.allowAlways=this.allowAlways.filter(r=>r!==`${n}_${o}`),localStorage.setItem(HQ,this.allowAlways.join(",")))};getTools=async()=>{const[t,n,o]=await Promise.all([this.desktopEditorTool.getTools(),this.webSearch.getTools(),this.customServers.getTools()]);return{"desktop-editor":t,"web-search":n,...o}};callTools=async(t,n,o)=>t==="desktop-editor"?this.desktopEditorTool.callTools(n,o):t==="web-search"?await this.webSearch.callTools(n,o):await this.customServers.callToolFromMCP(t,n,o);getServerType=t=>t.includes("desktop-editor_")?"desktop-editor":t.includes("web-search_")?"web-search":this.customServers.getServerType(t);setCustomServers=t=>{this.customServers.setCustomServers(t)};startCustomServers=()=>{this.customServers.startCustomServers()};restartCustomServer=t=>{this.customServers.restartCustomServer(t)};deleteCustomServer=t=>{this.customServers.deleteCustomServer(t)};getCustomServers=()=>this.customServers.customServers;getCustomServersStoped=()=>this.customServers.stoppedCustomServers;getCustomServersLogs=()=>this.customServers.customServersLogs;setWebSearchData=t=>{this.webSearch.setWebSearchData(t)};getWebSearchData=()=>this.webSearch.getWebSearchData();getWebSearchEnabled=()=>this.webSearch.getWebSearchEnabled()};const Ln=new g8e,wT="disabledTools",OT="mcpServers",Ds=Bl((e,t)=>({servers:{},tools:[],disabledTools:{},manageToolData:void 0,webSearchEnabled:!1,initServers:()=>{const n=localStorage.getItem(OT);if(n){const o=JSON.parse(n);Ln.setCustomServers(o),Ln.startCustomServers()}},getTools:async()=>{const n=await Ln.getTools(),o=localStorage.getItem(wT),r=[],i={};let s=!1;if(o){const a=JSON.parse(o);Object.entries(n).forEach(([c,p])=>{if(c==="web-search"){if(i[c]=[...p],a["web-search"].length){e({webSearchEnabled:!1});return}const u=p.map(l=>({...l,name:`${c}_${l.name}`}));a[c]=[],r.push(...u),e({webSearchEnabled:p.length>0}),s=p.length>0;return}i[c]=p.map(u=>{a[c]||(a[c]=[]);const l=!a[c].includes(u.name);return(l&&s?r.length===mR:r.length===Wy)?(a[c].push(u.name),{...u,enabled:!1}):(l&&r.push({...u,name:`${c}_${u.name}`}),{...u,enabled:l})})}),e({disabledTools:a})}else{const a={};let c=!1;Object.entries(n).forEach(([p,u])=>{if(a[p]=[],p==="web-search"){i[p]=[...u];const d=u.map(f=>({...f,name:`${p}_${f.name}`,enabled:!0}));r.push(...d),e({webSearchEnabled:u.length>0}),c=u.length>0;return}const l=u.map((d,f)=>r.length+f>=(c?mR:Wy)?(a[p].push(d.name),{...d,enabled:!1}):{...d,enabled:!0});i[p]=l,r.push(...l.filter(d=>d.enabled).map(d=>({...d,name:`${p}_${d.name}`})))}),e({disabledTools:a})}e({tools:r,servers:i})},changeToolStatus:(n,o,r)=>{const i=t(),s=i.servers,a=s[n].find(c=>c.name===o);if(a){if(r){if(n==="web-search"){const p={...i.disabledTools,[n]:[]};e({disabledTools:p}),e({webSearchEnabled:!0}),e({servers:{...s,[n]:s[n].map(u=>({...u,enabled:!0}))}}),localStorage.setItem(wT,JSON.stringify(p));return}if(i.tools.length>=(i.webSearchEnabled?mR:Wy))return;const c={...i.disabledTools,[n]:i.disabledTools[n].filter(p=>p!==o)};e({tools:[...i.tools,{...a,name:`${n}_${a.name}`}],disabledTools:c}),localStorage.setItem(wT,JSON.stringify(c))}else{const c=[...i.disabledTools[n],o],p={...i.disabledTools,[n]:c};let u=[];n==="web-search"?(p[n]=[...i.servers[n].map(l=>l.name)],e({webSearchEnabled:!1}),u=i.tools.filter(l=>!l.name.includes(n))):u=i.tools.filter(l=>l.name!==`${n}_${o}`),e({tools:u,disabledTools:p}),localStorage.setItem(wT,JSON.stringify(p))}e({servers:{...s,[n]:s[n].map(c=>c.name===o?{...c,enabled:r}:c)}})}},checkAllowAlways:(n,o)=>Ln.checkAllowAlways(n,o),setAllowAlways:(n,o,r)=>{Ln.setAllowAlways(n,o,r)},callTools:async(n,o)=>{const r=t(),i=Ln.getServerType(n),s=n.replace(`${i}_`,"");if(!r.disabledTools[i].find(c=>c===s))return await Ln.callTools(i,s,o)},setManageToolData:n=>{e({manageToolData:n})},getConfig:()=>JSON.parse(localStorage.getItem(OT)||JSON.stringify({mcpServers:{}})),saveConfig:n=>{const o=n.mcpServers?n:{mcpServers:{}};localStorage.setItem(OT,JSON.stringify(o)),Ln.setCustomServers(o),Ln.startCustomServers()},deleteCustomServer:n=>{Ln.deleteCustomServer(n);const o=t().getConfig();delete o.mcpServers[n],localStorage.setItem(OT,JSON.stringify(o))},getCustomServersLogs:()=>Ln.getCustomServersLogs(),getWebSearchEnabled:()=>Ln.getWebSearchEnabled()})),b8e=({checked:e=!1,onChange:t,disabled:n=!1,id:o,className:r=""})=>{const i=_=>{t&&!n&&t(_.target.checked)},s="inline-flex items-center relative group",a="absolute opacity-0 cursor-pointer w-4 h-4 m-0",c="disabled:cursor-not-allowed",p="inline-flex items-center select-none",u=n?"cursor-not-allowed opacity-60":"cursor-pointer",l="w-4 h-4 rounded-[2px] flex items-center justify-center transition-all duration-200 box-border",d="focus-within:outline-none",f="bg-[var(--checkbox-bg-color)] border border-[var(--checkbox-color)]",h=n?"":"group-hover:!bg-[var(--checkbox-bg-hover-color)] group-active:!bg-[var(--checkbox-bg-pressed-color)]",m="bg-[var(--checkbox-active-color)]",g=n?"":"group-hover:!bg-[var(--checkbox-active-hover-color)] group-active:!bg-[var(--checkbox-active-pressed-color)]";return F.jsxs("div",{className:ke(s,r),children:[F.jsx("input",{type:"checkbox",id:o,checked:e,onChange:i,disabled:n,className:ke(a,c)}),F.jsx("label",{htmlFor:o,className:ke(p,u),children:F.jsx("div",{className:ke(l,d,e?ke(m,g):ke(f,h)),children:e?F.jsx(tr,{name:"checked",size:16,color:"var(--checkbox-active-icon-color)",isStroke:!0,className:"flex items-center justify-center"}):null})})]})},KA=({className:e,size:t=16})=>F.jsx("div",{className:ke("inline-block animate-spin rounded-full border-2 border-solid border-[var(--loader-border-color)] border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",e),style:{width:`${t}px`,height:`${t}px`}}),Sy="var(--chat-message-tool-call-name-color)",mle=({toolName:e,argsText:t,result:n})=>{const{t:o}=Wt(),{isRTL:r}=wn(),[i,s]=x.useState(!0),[a,c]=x.useState(!1),[p,u]=x.useState(!1);x.useEffect(()=>{a&&setTimeout(()=>{c(!1)},2e3)},[a]),x.useEffect(()=>{p&&setTimeout(()=>{u(!1)},2e3)},[p]);const l=Ln.getServerType(e),d=e.replace(`${l}_`,""),f=n===void 0,h=d==="web_search",m=d==="web_crawling";let g="",y=t;try{const S=JSON.parse(y);S.args&&(y=JSON.stringify(S.args)),g=y?h?JSON.parse(y).query:m?JSON.parse(y).urls[0]:"":""}catch{}let _=n;try{_=typeof n=="string"?JSON.parse(n):n}catch{}return F.jsxs("div",{className:"my-[16px] flex w-full flex-col gap-3",children:[F.jsxs("div",{className:"flex items-center gap-[10px] cursor-pointer",onClick:()=>{if(m){window.open(g,"_blank");return}h&&n===void 0||s(!i)},children:[f?F.jsx(KA,{size:16}):F.jsx(tr,{name:_?.data?.error?"status.error":"tool.called",size:16,noColor:!0}),f&&!h&&!m?F.jsx("p",{className:"text-[var(--chat-message-tool-call-header-color)] text-[14px] font-normal leading-[16px]",children:o("ToolExecuted")}):null,F.jsxs("span",{className:"flex items-center gap-[8px] rounded-[4px] ps-[4px] pe-[8px] text-[14px] leading-[20px] font-normal text-[var(--chat-message-tool-call-name-color)] bg-[var(--chat-message-tool-call-name-background-color)] min-w-0 w-fit",children:[h?F.jsx(tr,{name:"btn-web-search",size:24,color:Sy}):m?null:F.jsx(tr,{name:"code",size:24,color:Sy,isStroke:!0}),F.jsx("span",{className:"truncate",children:h?g:m?`${d} | ${g}`:d})]}),m?F.jsx(tr,{name:"btn-external",size:16,color:Sy,isStroke:!0}):h&&n===void 0?null:F.jsx("span",{className:r&&i?"rotate-180":"",children:F.jsx(tr,{name:i?"arrow.right":"arrow.bottom",size:16,width:8,height:8,color:Sy,isStroke:!0})})]}),i?null:F.jsxs("div",{className:"flex flex-col gap-[24px] mt-[8px] p-[12px] bg-[var(--chat-message-tool-call-body-background-color)] rounded-[12px]",children:[h?null:F.jsxs("div",{className:"",children:[F.jsxs("p",{className:"flex flex-row items-center justify-between text-[var(--chat-message-tool-call-header-color)] text-[14px] font-bold leading-[20px]",children:[o("ToolCallArguments"),F.jsx("span",{onClick:()=>c(!0),className:"cursor-pointer",children:F.jsx(tr,{name:a?"checked":"btn-copy",size:24,color:Sy,isStroke:a})})]}),F.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:y||"{}"})]}),n!==void 0&&F.jsx("div",{className:"",children:h?F.jsx("div",{children:(()=>{try{if(_?.data?.error)return F.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof _=="string"?n:_?.data?.error});const S=_?.data||[];return S.length>0?F.jsx("div",{className:"flex flex-col gap-[10px]",children:S.map((w,R)=>F.jsxs("div",{className:"group h-[36px] px-[8px] rounded-[4px] flex flex-row items-center justify-between cursor-pointer hover:bg-[var(--drop-down-menu-item-hover-color)] transition-colors",onClick:()=>window.open(w.url,"_blank"),children:[F.jsxs("div",{className:"flex flex-row items-center gap-[8px] min-w-0 flex-1",children:[F.jsx(Vt,{iconName:"btn-web-search",size:24,disableHover:!0}),F.jsx("h4",{className:"text-[14px] font-normal text-[var(--chat-message-tool-call-pre-color)] truncate",children:w.title})]}),F.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:F.jsx(Vt,{iconName:"btn-external",size:24,disableHover:!0})})]},w.id))}):F.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})}catch{return F.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})}})()}):F.jsxs(F.Fragment,{children:[F.jsxs("p",{className:"flex flex-row items-center justify-between text-[var(--chat-message-tool-call-header-color)] text-[14px] font-bold leading-[20px]",children:[o("ToolCallResult"),F.jsx("span",{onClick:()=>u(!0),className:"cursor-pointer",children:F.jsx(tr,{name:p?"checked":"btn-copy",size:24,color:Sy,isStroke:p})})]}),F.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap text-[var(--chat-message-tool-call-pre-color)] border border-[var(--chat-message-tool-call-pre-border-color)] bg-[var(--chat-message-tool-call-pre-background-color)] px-[8px] py-[2px] rounded-[4px]",children:typeof n=="string"?n:JSON.stringify(n,null,2)})]})})]})]})},y8e=({onAllow:e,onDeny:t,onClose:n})=>{const{t:o}=Wt(),{manageToolData:r}=Ds(),[i,s]=x.useState(!1),a=Re.useCallback(()=>{e(i),n()},[e,i,n]),c=()=>{t(),n()},p=r?.message?.content[r.idx];if(Re.useEffect(()=>{const u=l=>{l.key==="Enter"&&(l.preventDefault(),a())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[a]),!(!p||typeof p!="object"||!("type"in p)||p.type!=="tool-call"))return F.jsx(Dm,{open:!0,children:F.jsxs(Nm,{header:o("Confirmation"),onClose:t,isHuge:!0,children:[F.jsxs("div",{className:"flex flex-col justify-between h-full mb-[16px] text-[var(--tool-fallback-color)]",children:[F.jsx("p",{className:"mt-[8px] font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:o("AIWouldLikeUseThisTool")}),F.jsx(mle,{type:"tool-call",toolCallId:p.toolCallId??"",args:p.args??{},toolName:p.toolName,argsText:p.argsText??"{}",result:p.result,status:{type:"running"},addResult:()=>{}}),F.jsx("p",{className:"font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:o("ReviewEachAction")}),F.jsxs("p",{onClick:()=>s(u=>!u),className:"cursor-pointer flex items-center gap-[8px] mt-[24px] font-[14px] leading-[20px] font-normal text-[var(--tool-fallback-color)]",children:[F.jsx(b8e,{checked:i,id:"allow-always-checkbox"}),o("AlwaysAllow")]})]}),F.jsxs("div",{className:"flex flex-row justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",children:[F.jsx(Bn,{variant:"default",onClick:c,children:o("Deny")}),F.jsx(Bn,{onClick:a,children:o("Allow")})]})]})})},A8e=async e=>{const t=Yi.getDB();return new Promise(n=>{const i=t.transaction(["threads"],"readonly").objectStore("threads").get(e);i.onerror=()=>n(null),i.onsuccess=()=>n(i.result||null)})},CP=Bl((e,t)=>({attachmentFiles:[],attachmentImages:[],addAttachmentFile:n=>{t().attachmentFiles.length>=5||e({attachmentFiles:[...t().attachmentFiles,n]})},deleteAttachmentFile:n=>{e({attachmentFiles:t().attachmentFiles.filter(o=>o.path!==n)})},clearAttachmentFiles:()=>{e({attachmentFiles:[]})},addAttachmentImage:n=>{t().attachmentImages.length>=5||e({attachmentImages:[...t().attachmentImages,n]})},deleteAttachmentImage:n=>{e({attachmentImages:t().attachmentImages.filter(o=>o.name!==n)})},clearAttachmentImages:()=>{e({attachmentImages:[]})}})),QA=Bl((e,t)=>({messages:[],isStreamRunning:!1,isRequestRunning:!1,fetchPrevMessages:async n=>{const o=await dne(n);e({messages:o}),on.setCurrentProviderPrevMessages(o)},setIsStreamRunning:n=>{e({isStreamRunning:n})},setIsRequestRunning:n=>{e({isRequestRunning:n})},addMessage:n=>{const o=t();if(o.messages.length&&o.messages[o.messages.length-1].status?.type==="incomplete"){e({messages:[...o.messages.slice(0,-1),{...n}]});return}e({messages:[...o.messages,n]})},updateLastMessage:n=>{const o=t();e({messages:[...o.messages.slice(0,-1),n]})},stopMessage:()=>{t().setIsStreamRunning(!1),on.stopMessage()}})),_8e=({isReady:e})=>{const{messages:t,setIsStreamRunning:n,setIsRequestRunning:o,addMessage:r,updateLastMessage:i,fetchPrevMessages:s}=QA(),{threadId:a,insertThread:c,insertNewMessageToThread:p}=GC(),{manageToolData:u,callTools:l,checkAllowAlways:d,setAllowAlways:f,setManageToolData:h}=Ds(),{attachmentFiles:m,clearAttachmentFiles:g,attachmentImages:y,clearAttachmentImages:_}=CP(),{currentProvider:S}=gi(),{currentModel:w,extendedThinking:R}=GA(),E=x.useRef(a);x.useEffect(()=>{e&&(E.current=a,s(a),g())},[a,e,s,g]);const T=I=>I,D=I=>{if(!u)return;const U=u?.message?.content[u.idx];if(!U||typeof U!="object"||!("type"in U)||U.type!=="tool-call")return;const J=U.toolName,V=Ln.getServerType(J),G=J.replace(`${V}_`,"");I&&f(!0,V,G),N(u.message,u.idx,u.messageUID,!0,!1),h(void 0)},B=()=>{u&&(N(u.message,u.idx,u.messageUID,!1,!0),h(void 0))},N=async(I,U,J,V,G)=>{const Q=I.content[U];if(!Q||typeof Q!="object"||!("type"in Q)||Q.type!=="tool-call")return;const le=Q.toolName,K=Ln.getServerType(le),X=le.replace(`${K}_`,"");if(d(K,X)||V||G){const ce=G?"User deny tool call":await l(Q.toolName,Q.args),W=Array.isArray(I.content)?I.content.map((Ie,Me)=>Me===U?{...Q,result:ce}:Ie):I.content,_e={...I,content:W};if(i(_e),p5(J,_e),!on)return;const Ne=on.sendMessageAfterToolCall(_e,R);Ne&&L(Ne,!0,J)}else h({message:I,idx:U,messageUID:J})},L=async(I,U,J)=>{n(!0);let V=!!U;const G=U&&J?J:crypto.randomUUID();if(t)for await(const Q of I){if("isEnd"in Q){if(E.current!==a){n(!1),o(!1);return}if(Q.responseMessage.status?.type==="incomplete"){r(Q.responseMessage),n(!1),o(!1);return}const le=Q.responseMessage;if(le?.role==="assistant"&&Array.isArray(le.content)){const K=le.content.findIndex(X=>X.type==="tool-call"&&!X.result);if(K!==-1){N(le,K,G);return}}n(!1),o(!1);return}V?(p5(G,Q),E.current===a&&i(Q)):(U||o(!0),r(Q),NO(a,G,Q),V=!0)}};return{convertMessage:T,onNew:async I=>{if(!on||!S||!w||I.content[0].type!=="text")return;let U=[],J=[];m.length>0&&(U=m.map(K=>({type:"file",mimeType:JSON.stringify({path:K.path,type:K.type}),data:K.content})),g()),y.length>0&&(J=y.map(K=>({type:"image",image:K.base64,name:K.name})),_());const G={role:"user",content:[...U,...J,{type:"text",text:I.content[0].text}],attachments:I.attachments};if(await A8e(a))p({provider:S,model:w}),(async()=>await NO(a,crypto.randomUUID(),G))();else{let K="";for(const X of t)X.status?.type==="incomplete"&&X.status?.error||(K+=typeof X.content=="string"?X.content:X.content[0].type==="text"?X.content[0].text:"",K+=` -`);L+=` +`);K+=` -${X.content[0].text}`;for(const z of e)z.status?.type==="incomplete"&&z.status?.error||await s0(a,crypto.randomUUID(),z);await s0(a,crypto.randomUUID(),q),It.createChatName(L).then(async z=>{z&&l(z,{provider:R,model:M})})}r(q);const oe=It.sendMessage([q],D);oe&&$(oe)},handleStream:$,approveToolCall:B,denyToolCall:G}},z_e=({isReady:t})=>{const{initServers:e,getTools:n,tools:i}=Ns(),{currentProvider:r}=Tr();return T.useEffect(()=>{if(!t)return;e(),n();const s=setInterval(()=>{n()},1e3*60*5);return()=>{clearInterval(s)}},[t,e,n]),T.useEffect(()=>{const s=()=>{n()};return window.addEventListener("tools-changed",s),()=>{window.removeEventListener("tools-changed",s)}},[n]),T.useEffect(()=>{!i||!r||It.setCurrentProviderTools(i)},[i,r]),{}},Q_e=({isReady:t})=>{const{initThreads:e}=om();return T.useEffect(()=>{t&&e()},[t,e]),{}},Zz=T.createContext({});function G_e(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}const jR=typeof window<"u",$_e=jR?T.useLayoutEffect:T.useEffect,KR=T.createContext(null);function YR(t,e){t.indexOf(e)===-1&&t.push(e)}function qR(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const wo=(t,e,n)=>n>e?e:n{};const ha={},eQ=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function tQ(t){return typeof t=="object"&&t!==null}const nQ=t=>/^0[^.\s]+$/u.test(t);function XR(t){let e;return()=>(e===void 0&&(e=t()),e)}const Zr=t=>t,W_e=(t,e)=>n=>e(t(n)),hm=(...t)=>t.reduce(W_e),Ag=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class ZR{constructor(){this.subscriptions=[]}add(e){return YR(this.subscriptions,e),()=>qR(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let s=0;st*1e3,jr=t=>t/1e3;function iQ(t,e){return e?t*(1e3/e):0}const rQ=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,j_e=1e-7,K_e=12;function Y_e(t,e,n,i,r){let s,o,a=0;do o=e+(n-e)/2,s=rQ(o,i,r)-t,s>0?n=o:e=o;while(Math.abs(s)>j_e&&++aY_e(s,0,1,t,n);return s=>s===0||s===1?s:rQ(r(s),e,i)}const sQ=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,oQ=t=>e=>1-t(1-e),aQ=fm(.33,1.53,.69,.99),ek=oQ(aQ),lQ=sQ(ek),cQ=t=>(t*=2)<1?.5*ek(t):.5*(2-Math.pow(2,-10*(t-1))),tk=t=>1-Math.sin(Math.acos(t)),uQ=oQ(tk),dQ=sQ(tk),q_e=fm(.42,0,1,1),J_e=fm(0,0,.58,1),hQ=fm(.42,0,.58,1),X_e=t=>Array.isArray(t)&&typeof t[0]!="number",fQ=t=>Array.isArray(t)&&typeof t[0]=="number",Z_e={linear:Zr,easeIn:q_e,easeInOut:hQ,easeOut:J_e,circIn:tk,circInOut:dQ,circOut:uQ,backIn:ek,backInOut:lQ,backOut:aQ,anticipate:cQ},e2e=t=>typeof t=="string",E4=t=>{if(fQ(t)){JR(t.length===4);const[e,n,i,r]=t;return fm(e,n,i,r)}else if(e2e(t))return Z_e[t];return t},G0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function t2e(t,e){let n=new Set,i=new Set,r=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(d){o.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,f=!1,g=!1)=>{const v=g&&r?n:i;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{i.delete(d),o.delete(d)},process:d=>{if(a=d,r){s=!0;return}r=!0,[n,i]=[i,n],n.forEach(l),n.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const n2e=40;function pQ(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=G0.reduce((R,M)=>(R[M]=t2e(s),R),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:f,preRender:g,render:m,postRender:v}=o,S=()=>{const R=ha.useManualTiming?r.timestamp:performance.now();n=!1,ha.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(R-r.timestamp,n2e),1)),r.timestamp=R,r.isProcessing=!0,a.process(r),l.process(r),u.process(r),d.process(r),f.process(r),g.process(r),m.process(r),v.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(S))},C=()=>{n=!0,i=!0,r.isProcessing||t(S)};return{schedule:G0.reduce((R,M)=>{const D=o[M];return R[M]=(P,N=!1,B=!1)=>(n||C(),D.schedule(P,N,B)),R},{}),cancel:R=>{for(let M=0;M(jy===void 0&&Di.set(ei.isProcessing||ha.useManualTiming?ei.timestamp:performance.now()),jy),set:t=>{jy=t,queueMicrotask(i2e)}},gQ=t=>e=>typeof e=="string"&&e.startsWith(t),mQ=gQ("--"),r2e=gQ("var(--"),nk=t=>r2e(t)?s2e.test(t.split("/*")[0].trim()):!1,s2e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _4(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Ch={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},yg={...Ch,transform:t=>wo(0,1,t)},$0={...Ch,default:1},Lp=t=>Math.round(t*1e5)/1e5,ik=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o2e(t){return t==null}const a2e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rk=(t,e)=>n=>!!(typeof n=="string"&&a2e.test(n)&&n.startsWith(t)||e&&!o2e(n)&&Object.prototype.hasOwnProperty.call(n,e)),AQ=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,a]=i.match(ik);return{[t]:parseFloat(r),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},l2e=t=>wo(0,255,t),uE={...Ch,transform:t=>Math.round(l2e(t))},_c={test:rk("rgb","red"),parse:AQ("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+uE.transform(t)+", "+uE.transform(e)+", "+uE.transform(n)+", "+Lp(yg.transform(i))+")"};function c2e(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const I_={test:rk("#"),parse:c2e,transform:_c.transform},pm=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ll=pm("deg"),Ao=pm("%"),De=pm("px"),u2e=pm("vh"),d2e=pm("vw"),T4={...Ao,parse:t=>Ao.parse(t)/100,transform:t=>Ao.transform(t*100)},yd={test:rk("hsl","hue"),parse:AQ("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ao.transform(Lp(e))+", "+Ao.transform(Lp(n))+", "+Lp(yg.transform(i))+")"},bn={test:t=>_c.test(t)||I_.test(t)||yd.test(t),parse:t=>_c.test(t)?_c.parse(t):yd.test(t)?yd.parse(t):I_.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?_c.transform(t):yd.transform(t),getAnimatableNone:t=>{const e=bn.parse(t);return e.alpha=0,bn.transform(e)}},h2e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function f2e(t){return isNaN(t)&&typeof t=="string"&&(t.match(ik)?.length||0)+(t.match(h2e)?.length||0)>0}const yQ="number",vQ="color",p2e="var",g2e="var(",R4="${}",m2e=/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 vg(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(m2e,l=>(bn.test(l)?(i.color.push(s),r.push(vQ),n.push(bn.parse(l))):l.startsWith(g2e)?(i.var.push(s),r.push(p2e),n.push(l)):(i.number.push(s),r.push(yQ),n.push(parseFloat(l))),++s,R4)).split(R4);return{values:n,split:a,indexes:i,types:r}}function bQ(t){return vg(t).values}function wQ(t){const{split:e,types:n}=vg(t),i=e.length;return r=>{let s="";for(let o=0;otypeof t=="number"?0:bn.test(t)?bn.getAnimatableNone(t):t;function y2e(t){const e=bQ(t);return wQ(t)(e.map(A2e))}const El={test:f2e,parse:bQ,createTransformer:wQ,getAnimatableNone:y2e};function dE(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function v2e({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,s=0,o=0;if(!e)r=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=dE(l,a,t+1/3),s=dE(l,a,t),o=dE(l,a,t-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function Gv(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,hE=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},b2e=[I_,_c,yd],w2e=t=>b2e.find(e=>e.test(t));function k4(t){const e=w2e(t);if(!e)return!1;let n=e.parse(t);return e===yd&&(n=v2e(n)),n}const I4=(t,e)=>{const n=k4(t),i=k4(e);if(!n||!i)return Gv(t,e);const r={...n};return s=>(r.red=hE(n.red,i.red,s),r.green=hE(n.green,i.green,s),r.blue=hE(n.blue,i.blue,s),r.alpha=Xt(n.alpha,i.alpha,s),_c.transform(r))},M_=new Set(["none","hidden"]);function S2e(t,e){return M_.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function C2e(t,e){return n=>Xt(t,e,n)}function sk(t){return typeof t=="number"?C2e:typeof t=="string"?nk(t)?Gv:bn.test(t)?I4:_2e:Array.isArray(t)?SQ:typeof t=="object"?bn.test(t)?I4:x2e:Gv}function SQ(t,e){const n=[...t],i=n.length,r=t.map((s,o)=>sk(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function E2e(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r{const n=El.createTransformer(e),i=vg(t),r=vg(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?M_.has(t)&&!r.values.length||M_.has(e)&&!i.values.length?S2e(t,e):hm(SQ(E2e(i,r),r.values),n):Gv(t,e)};function CQ(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Xt(t,e,n):sk(t)(t,e)}const T2e=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Gt.update(e,n),stop:()=>xl(e),now:()=>ei.isProcessing?ei.timestamp:Di.now()}},xQ=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let s=0;s=$v?1/0:e}function R2e(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(ok(i),$v);return{type:"keyframes",ease:s=>i.next(r*s).value/e,duration:jr(r)}}const k2e=5;function EQ(t,e,n){const i=Math.max(e-k2e,0);return iQ(n-t(i),e-i)}const on={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},fE=.001;function I2e({duration:t=on.duration,bounce:e=on.bounce,velocity:n=on.velocity,mass:i=on.mass}){let r,s,o=1-e;o=wo(on.minDamping,on.maxDamping,o),t=wo(on.minDuration,on.maxDuration,jr(t)),o<1?(r=u=>{const d=u*o,f=d*t,g=d-n,m=D_(u,o),v=Math.exp(-f);return fE-g/m*v},s=u=>{const f=u*o*t,g=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*t,v=Math.exp(-f),S=D_(Math.pow(u,2),o);return(-r(u)+fE>0?-1:1)*((g-m)*v)/S}):(r=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-fE+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,l=D2e(r,s,a);if(t=aa(t),isNaN(l))return{stiffness:on.stiffness,damping:on.damping,duration:t};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:t}}}const M2e=12;function D2e(t,e,n){let i=n;for(let r=1;rt[n]!==void 0)}function O2e(t){let e={velocity:on.velocity,stiffness:on.stiffness,damping:on.damping,mass:on.mass,isResolvedFromDuration:!1,...t};if(!M4(t,N2e)&&M4(t,P2e))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*wo(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:on.mass,stiffness:r,damping:s}}else{const n=I2e(t);e={...e,...n,mass:on.mass},e.isResolvedFromDuration=!0}return e}function Wv(t=on.visualDuration,e=on.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:f,velocity:g,isResolvedFromDuration:m}=O2e({...n,velocity:-jr(n.velocity||0)}),v=g||0,S=u/(2*Math.sqrt(l*d)),C=o-s,E=jr(Math.sqrt(l/d)),k=Math.abs(C)<5;i||(i=k?on.restSpeed.granular:on.restSpeed.default),r||(r=k?on.restDelta.granular:on.restDelta.default);let R;if(S<1){const D=D_(E,S);R=P=>{const N=Math.exp(-S*E*P);return o-N*((v+S*E*C)/D*Math.sin(D*P)+C*Math.cos(D*P))}}else if(S===1)R=D=>o-Math.exp(-E*D)*(C+(v+E*C)*D);else{const D=E*Math.sqrt(S*S-1);R=P=>{const N=Math.exp(-S*E*P),B=Math.min(D*P,300);return o-N*((v+S*E*C)*Math.sinh(B)+D*C*Math.cosh(B))/D}}const M={calculatedDuration:m&&f||null,next:D=>{const P=R(D);if(m)a.done=D>=f;else{let N=D===0?v:0;S<1&&(N=D===0?aa(v):EQ(R,D,P));const B=Math.abs(N)<=i,G=Math.abs(o-P)<=r;a.done=B&&G}return a.value=a.done?o:P,a},toString:()=>{const D=Math.min(ok(M),$v),P=xQ(N=>M.next(D*N).value,D,30);return D+"ms "+P},toTransition:()=>{}};return M}Wv.applyToOptions=t=>{const e=R2e(t,100,Wv);return t.ease=e.ease,t.duration=aa(e.duration),t.type="keyframes",t};function P_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const f=t[0],g={done:!1,value:f},m=B=>a!==void 0&&Bl,v=B=>a===void 0?l:l===void 0||Math.abs(a-B)-S*Math.exp(-B/i),R=B=>E+k(B),M=B=>{const G=k(B),V=R(B);g.done=Math.abs(G)<=u,g.value=g.done?E:V};let D,P;const N=B=>{m(g.value)&&(D=B,P=Wv({keyframes:[g.value,v(g.value)],velocity:EQ(R,B,g.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:B=>{let G=!1;return!P&&D===void 0&&(G=!0,M(B),N(B)),D!==void 0&&B>=D?P.next(B-D):(!G&&M(B),g)}}}function B2e(t,e,n){const i=[],r=n||ha.mix||CQ,s=t.length-1;for(let o=0;oe[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=B2e(e,i,r),l=a.length,u=d=>{if(o&&d1)for(;fu(wo(t[0],t[s-1],d)):u}function U2e(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=Ag(0,e,i);t.push(Xt(n,1,r))}}function V2e(t){const e=[0];return U2e(e,t.length-1),e}function F2e(t,e){return t.map(n=>n*e)}function H2e(t,e){return t.map(()=>e||hQ).splice(0,t.length-1)}function Up({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=X_e(i)?i.map(E4):E4(i),s={done:!1,value:e[0]},o=F2e(n&&n.length===e.length?n:V2e(e),t),a=L2e(o,e,{ease:Array.isArray(r)?r:H2e(e,r)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}const z2e=t=>t!==null;function ak(t,{repeat:e,repeatType:n="loop"},i,r=1){const s=t.filter(z2e),a=r<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||i===void 0?s[a]:i}const Q2e={decay:P_,inertia:P_,tween:Up,keyframes:Up,spring:Wv};function _Q(t){typeof t.type=="string"&&(t.type=Q2e[t.type])}class lk{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const G2e=t=>t/100;class ck extends lk{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Di.now()&&this.tick(Di.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;_Q(e);const{type:n=Up,repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Up;l!==Up&&typeof a[0]!="number"&&(this.mixKeyframes=hm(G2e,CQ(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ok(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:g,repeatDelay:m,type:v,onUpdate:S,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-u*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?E<0:E>r;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let R=this.currentTime,M=i;if(f){const B=Math.min(this.currentTime,r)/a;let G=Math.floor(B),V=B%1;!V&&B>=1&&(V=1),V===1&&G--,G=Math.min(G,f+1),G%2&&(g==="reverse"?(V=1-V,m&&(V-=m/a)):g==="mirror"&&(M=o)),R=wo(0,1,V)*a}const D=k?{done:!1,value:d[0]}:M.next(R);s&&(D.value=s(D.value));let{done:P}=D;!k&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return N&&v!==P_&&(D.value=ak(d,this.options,C,this.speed)),S&&S(D.value),N&&this.finish(),D}then(e,n){return this.finished.then(e,n)}get duration(){return jr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+jr(e)}get time(){return jr(this.currentTime)}set time(e){e=aa(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Di.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=jr(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=T2e,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(Di.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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function $2e(t){for(let e=1;et*180/Math.PI,N_=t=>{const e=Tc(Math.atan2(t[1],t[0]));return O_(e)},W2e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:N_,rotateZ:N_,skewX:t=>Tc(Math.atan(t[1])),skewY:t=>Tc(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},O_=t=>(t=t%360,t<0&&(t+=360),t),D4=N_,P4=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),N4=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),j2e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:P4,scaleY:N4,scale:t=>(P4(t)+N4(t))/2,rotateX:t=>O_(Tc(Math.atan2(t[6],t[5]))),rotateY:t=>O_(Tc(Math.atan2(-t[2],t[0]))),rotateZ:D4,rotate:D4,skewX:t=>Tc(Math.atan(t[4])),skewY:t=>Tc(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function B_(t){return t.includes("scale")?1:0}function L_(t,e){if(!t||t==="none")return B_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=j2e,r=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=W2e,r=a}if(!r)return B_(e);const s=i[e],o=r[1].split(",").map(Y2e);return typeof s=="function"?s(o):o[s]}const K2e=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return L_(n,e)};function Y2e(t){return parseFloat(t.trim())}const xh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eh=new Set(xh),O4=t=>t===Ch||t===De,q2e=new Set(["x","y","z"]),J2e=xh.filter(t=>!q2e.has(t));function X2e(t){const e=[];return J2e.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const pl={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>L_(e,"x"),y:(t,{transform:e})=>L_(e,"y")};pl.translateX=pl.x;pl.translateY=pl.y;const Pc=new Set;let U_=!1,V_=!1,F_=!1;function TQ(){if(V_){const t=Array.from(Pc).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=X2e(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{i.getValue(s)?.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}V_=!1,U_=!1,Pc.forEach(t=>t.complete(F_)),Pc.clear()}function RQ(){Pc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(V_=!0)})}function Z2e(){F_=!0,RQ(),TQ(),F_=!1}class uk{constructor(e,n,i,r,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Pc.add(this),U_||(U_=!0,Gt.read(RQ),Gt.resolveKeyframes(TQ))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const s=r?.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),r&&s===void 0&&r.set(e[0])}$2e(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Pc.delete(this)}cancel(){this.state==="scheduled"&&(Pc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const eTe=t=>t.startsWith("--");function tTe(t,e,n){eTe(e)?t.style.setProperty(e,n):t.style[e]=n}const nTe=XR(()=>window.ScrollTimeline!==void 0),iTe={};function rTe(t,e){const n=XR(t);return()=>iTe[e]??n()}const kQ=rTe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cp=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,B4={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cp([0,.65,.55,1]),circOut:Cp([.55,0,1,.45]),backIn:Cp([.31,.01,.66,-.59]),backOut:Cp([.33,1.53,.69,.99])};function IQ(t,e){if(t)return typeof t=="function"?kQ()?xQ(t,e):"ease-out":fQ(t)?Cp(t):Array.isArray(t)?t.map(n=>IQ(n,e)||B4.easeOut):B4[t]}function sTe(t,e,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const f=IQ(a,r);Array.isArray(f)&&(d.easing=f);const g={delay:i,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),t.animate(d,g)}function MQ(t){return typeof t=="function"&&"applyToOptions"in t}function oTe({type:t,...e}){return MQ(t)&&kQ()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class aTe extends lk{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,JR(typeof e.type!="string");const u=oTe(e);this.animation=sTe(n,i,r,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=ak(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):tTe(n,i,d),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return jr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+jr(e)}get time(){return jr(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aa(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&nTe()?(this.animation.timeline=e,Zr):n(this)}}const DQ={anticipate:cQ,backInOut:lQ,circInOut:dQ};function lTe(t){return t in DQ}function cTe(t){typeof t.ease=="string"&&lTe(t.ease)&&(t.ease=DQ[t.ease])}const pE=10;class uTe extends aTe{constructor(e){cTe(e),_Q(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:s,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new ck({...o,autoplay:!1}),l=Math.max(pE,Di.now()-this.startTime),u=wo(0,pE,l-pE);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const L4=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(El.test(t)||t==="0")&&!t.startsWith("url("));function dTe(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function gTe(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:s,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return pTe()&&n&&fTe.has(n)&&(n!=="transform"||!u)&&!l&&!i&&r!=="mirror"&&s!==0&&o!=="inertia"}const mTe=40;class ATe extends lk{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:d,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Di.now();const g={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,name:l,motionValue:u,element:d,...f},m=d?.KeyframeResolver||uk;this.keyframeResolver=new m(a,(v,S,C)=>this.onKeyframesResolved(v,S,g,!C),l,u,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=i;this.resolvedAt=Di.now(),hTe(e,s,o,a)||((ha.instantAnimations||!l)&&d?.(ak(e,i,n)),e[0]=e[e.length-1],H_(i),i.repeat=0);const g={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>mTe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!u&&gTe(g)?new uTe({...g,element:g.motionValue.owner.current}):new ck(g);m.finished.then(()=>this.notifyFinished()).catch(Zr),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Z2e()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const yTe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vTe(t){const e=yTe.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}function PQ(t,e,n=1){const[i,r]=vTe(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return eQ(o)?parseFloat(o):o}return nk(r)?PQ(r,e,n+1):r}function dk(t,e){return t?.[e]??t?.default??t}const NQ=new Set(["width","height","top","left","right","bottom",...xh]),bTe={test:t=>t==="auto",parse:t=>t},OQ=t=>e=>e.test(t),BQ=[Ch,De,Ao,ll,d2e,u2e,bTe],U4=t=>BQ.find(OQ(t));function wTe(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||nQ(t):!0}const STe=new Set(["brightness","contrast","saturate","opacity"]);function CTe(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(ik)||[];if(!i)return t;const r=n.replace(i,"");let s=STe.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+r+")"}const xTe=/\b([a-z-]*)\(.*?\)/gu,z_={...El,getAnimatableNone:t=>{const e=t.match(xTe);return e?e.map(CTe).join(" "):t}},V4={...Ch,transform:Math.round},ETe={rotate:ll,rotateX:ll,rotateY:ll,rotateZ:ll,scale:$0,scaleX:$0,scaleY:$0,scaleZ:$0,skew:ll,skewX:ll,skewY:ll,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:yg,originX:T4,originY:T4,originZ:De},hk={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,radius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,inset:De,insetBlock:De,insetBlockStart:De,insetBlockEnd:De,insetInline:De,insetInlineStart:De,insetInlineEnd:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,paddingBlock:De,paddingBlockStart:De,paddingBlockEnd:De,paddingInline:De,paddingInlineStart:De,paddingInlineEnd:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,marginBlock:De,marginBlockStart:De,marginBlockEnd:De,marginInline:De,marginInlineStart:De,marginInlineEnd:De,backgroundPositionX:De,backgroundPositionY:De,...ETe,zIndex:V4,fillOpacity:yg,strokeOpacity:yg,numOctaves:V4},_Te={...hk,color:bn,backgroundColor:bn,outlineColor:bn,fill:bn,stroke:bn,borderColor:bn,borderTopColor:bn,borderRightColor:bn,borderBottomColor:bn,borderLeftColor:bn,filter:z_,WebkitFilter:z_},LQ=t=>_Te[t];function UQ(t,e){let n=LQ(t);return n!==z_&&(n=El),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const TTe=new Set(["auto","none","0"]);function RTe(t,e,n){let i=0,r;for(;i{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function ITe(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const VQ=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function MTe(t){return tQ(t)&&"offsetHeight"in t}const F4=30,DTe=t=>!isNaN(parseFloat(t));class PTe{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=Di.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Di.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=DTe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ZR);const i=this.events[e].add(n);return e==="change"?()=>{i(),Gt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>F4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,F4);return iQ(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 Jd(t,e){return new PTe(t,e)}const{schedule:fk}=pQ(queueMicrotask,!1),gs={x:!1,y:!1};function FQ(){return gs.x||gs.y}function NTe(t){return t==="x"||t==="y"?gs[t]?null:(gs[t]=!0,()=>{gs[t]=!1}):gs.x||gs.y?null:(gs.x=gs.y=!0,()=>{gs.x=gs.y=!1})}function HQ(t,e){const n=ITe(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function H4(t){return!(t.pointerType==="touch"||FQ())}function OTe(t,e,n={}){const[i,r,s]=HQ(t,n),o=a=>{if(!H4(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const d=f=>{H4(f)&&(u(f),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,r)};return i.forEach(a=>{a.addEventListener("pointerenter",o,r)}),s}const zQ=(t,e)=>e?t===e?!0:zQ(t,e.parentElement):!1,pk=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,BTe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function QQ(t){return BTe.has(t.tagName)||t.isContentEditable===!0}const Ky=new WeakSet;function z4(t){return e=>{e.key==="Enter"&&t(e)}}function gE(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const LTe=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=z4(()=>{if(Ky.has(n))return;gE(n,"down");const r=z4(()=>{gE(n,"up")}),s=()=>gE(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function Q4(t){return pk(t)&&!FQ()}function UTe(t,e,n={}){const[i,r,s]=HQ(t,n),o=a=>{const l=a.currentTarget;if(!Q4(a))return;Ky.add(l);const u=e(l,a),d=(m,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",g),Ky.has(l)&&Ky.delete(l),Q4(m)&&typeof u=="function"&&u(m,{success:v})},f=m=>{d(m,l===window||l===document||n.useGlobalTarget||zQ(l,m.target))},g=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",g,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),MTe(a)&&(a.addEventListener("focus",u=>LTe(u,r)),!QQ(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function GQ(t){return tQ(t)&&"ownerSVGElement"in t}function VTe(t){return GQ(t)&&t.tagName==="svg"}const mi=t=>!!(t&&t.getVelocity),FTe=[...BQ,bn,El],HTe=t=>FTe.find(OQ(t)),$Q=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function zTe(t=!0){const e=T.useContext(KR);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,s=T.useId();T.useEffect(()=>{if(t)return r(s)},[t]);const o=T.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,o]:[!0]}const WQ=T.createContext({strict:!1}),G4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xd={};for(const t in G4)Xd[t]={isEnabled:e=>G4[t].some(n=>!!e[n])};function QTe(t){for(const e in t)Xd[e]={...Xd[e],...t[e]}}const GTe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function jv(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||GTe.has(t)}let jQ=t=>!jv(t);function $Te(t){typeof t=="function"&&(jQ=e=>e.startsWith("on")?!jv(e):t(e))}try{$Te(require("@emotion/is-prop-valid").default)}catch{}function WTe(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||(jQ(r)||n===!0&&jv(r)||!e&&!jv(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const _w=T.createContext({});function Tw(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function bg(t){return typeof t=="string"||Array.isArray(t)}const gk=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mk=["initial",...gk];function Rw(t){return Tw(t.animate)||mk.some(e=>bg(t[e]))}function KQ(t){return!!(Rw(t)||t.variants)}function jTe(t,e){if(Rw(t)){const{initial:n,animate:i}=t;return{initial:n===!1||bg(n)?n:void 0,animate:bg(i)?i:void 0}}return t.inherit!==!1?e:{}}function KTe(t){const{initial:e,animate:n}=jTe(t,T.useContext(_w));return T.useMemo(()=>({initial:e,animate:n}),[$4(e),$4(n)])}function $4(t){return Array.isArray(t)?t.join(" "):t}function W4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Kf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(De.test(t))t=parseFloat(t);else return t;const n=W4(t,e.target.x),i=W4(t,e.target.y);return`${n}% ${i}%`}},YTe={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=El.parse(t);if(r.length>5)return i;const s=El.createTransformer(t),o=typeof r[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const u=Xt(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}},Q_={borderRadius:{...Kf,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kf,borderTopRightRadius:Kf,borderBottomLeftRadius:Kf,borderBottomRightRadius:Kf,boxShadow:YTe};function YQ(t,{layout:e,layoutId:n}){return Eh.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Q_[t]||t==="opacity")}const qTe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JTe=xh.length;function XTe(t,e,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}});function qQ(t,e,n){for(const i in e)!mi(e[i])&&!YQ(i,n)&&(t[i]=e[i])}function ZTe({transformTemplate:t},e){return T.useMemo(()=>{const n=yk();return Ak(n,e,t),Object.assign({},n.vars,n.style)},[e])}function eRe(t,e){const n=t.style||{},i={};return qQ(i,n,t),Object.assign(i,ZTe(t,e)),i}function tRe(t,e){const n={},i=eRe(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const nRe={offset:"stroke-dashoffset",array:"stroke-dasharray"},iRe={offset:"strokeDashoffset",array:"strokeDasharray"};function rRe(t,e,n=1,i=0,r=!0){t.pathLength=1;const s=r?nRe:iRe;t[s.offset]=De.transform(-i);const o=De.transform(e),a=De.transform(n);t[s.array]=`${o} ${a}`}const sRe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function JQ(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:s=1,pathOffset:o=0,...a},l,u,d){if(Ak(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:g}=t;f.transform&&(g.transform=f.transform,delete f.transform),(g.transform||f.transformOrigin)&&(g.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),g.transform&&(g.transformBox=d?.transformBox??"fill-box",delete f.transformBox);for(const m of sRe)f[m]!==void 0&&(g[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),r!==void 0&&rRe(f,r,s,o,!1)}const XQ=()=>({...yk(),attrs:{}}),ZQ=t=>typeof t=="string"&&t.toLowerCase()==="svg";function oRe(t,e,n,i){const r=T.useMemo(()=>{const s=XQ();return JQ(s,e,ZQ(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};qQ(s,t.style,t),r.style={...s,...r.style}}return r}const aRe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vk(t){return typeof t!="string"||t.includes("-")?!1:!!(aRe.indexOf(t)>-1||/[A-Z]/u.test(t))}function lRe(t,e,n,{latestValues:i},r,s=!1,o){const l=(o??vk(t)?oRe:tRe)(e,i,r,t),u=WTe(e,typeof t=="string",s),d=t!==T.Fragment?{...u,...l,ref:n}:{},{children:f}=e,g=T.useMemo(()=>mi(f)?f.get():f,[f]);return T.createElement(t,{...d,children:g})}function j4(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function bk(t,e,n,i){if(typeof e=="function"){const[r,s]=j4(i);e=e(n!==void 0?n:t.custom,r,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,s]=j4(i);e=e(n!==void 0?n:t.custom,r,s)}return e}function Yy(t){return mi(t)?t.get():t}function cRe({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:uRe(n,i,r,t),renderState:e()}}function uRe(t,e,n,i){const r={},s=i(t,{});for(const g in s)r[g]=Yy(s[g]);let{initial:o,animate:a}=t;const l=Rw(t),u=KQ(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?a:o;if(f&&typeof f!="boolean"&&!Tw(f)){const g=Array.isArray(f)?f:[f];for(let m=0;m(e,n)=>{const i=T.useContext(_w),r=T.useContext(KR),s=()=>cRe(t,e,i,r);return n?s():G_e(s)};function wk(t,e,n){const{style:i}=t,r={};for(const s in i)(mi(i[s])||e.style&&mi(e.style[s])||YQ(s,t)||n?.getValue(s)?.liveStyle!==void 0)&&(r[s]=i[s]);return r}const dRe=eG({scrapeMotionValuesFromProps:wk,createRenderState:yk});function tG(t,e,n){const i=wk(t,e,n);for(const r in t)if(mi(t[r])||mi(e[r])){const s=xh.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=t[r]}return i}const hRe=eG({scrapeMotionValuesFromProps:tG,createRenderState:XQ}),fRe=Symbol.for("motionComponentSymbol");function pRe(t,e,n){const i=T.useRef(n);T.useInsertionEffect(()=>{i.current=n});const r=T.useRef(null);return T.useCallback(s=>{s&&t.onMount?.(s),e&&(s?e.mount(s):e.unmount());const o=i.current;if(typeof o=="function")if(s){const a=o(s);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s)},[e])}const Sk=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),gRe="framerAppearId",nG="data-"+Sk(gRe),iG=T.createContext({});function xp(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function mRe(t,e,n,i,r,s){const{visualElement:o}=T.useContext(_w),a=T.useContext(WQ),l=T.useContext(KR),u=T.useContext($Q).reducedMotion,d=T.useRef(null);i=i||a.renderer,!d.current&&i&&(d.current=i(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:s}));const f=d.current,g=T.useContext(iG);f&&!f.projection&&r&&(f.type==="html"||f.type==="svg")&&ARe(d.current,n,r,g);const m=T.useRef(!1);T.useInsertionEffect(()=>{f&&m.current&&f.update(n,l)});const v=n[nG],S=T.useRef(!!v&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return $_e(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),S.current&&f.animationState&&f.animationState.animateChanges())}),T.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),S.current=!1),f.enteringChildren=void 0)}),f}function ARe(t,e,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:rG(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&xp(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:u})}function rG(t){if(t)return t.options.allowProjection!==!1?t.projection:rG(t.parent)}function mE(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&QTe(i);const s=n?n==="svg":vk(t),o=s?hRe:dRe;function a(u,d){let f;const g={...T.useContext($Q),...u,layoutId:yRe(u)},{isStatic:m}=g,v=KTe(u),S=o(u,m);if(!m&&jR){vRe();const C=bRe(g);f=C.MeasureLayout,v.visualElement=mRe(t,S,g,r,C.ProjectionNode,s)}return _.jsxs(_w.Provider,{value:v,children:[f&&v.visualElement?_.jsx(f,{visualElement:v.visualElement,...g}):null,lRe(t,u,pRe(S,v.visualElement,d),S,m,e,s)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=T.forwardRef(a);return l[fRe]=t,l}function yRe({layoutId:t}){const e=T.useContext(Zz).id;return e&&t!==void 0?e+"-"+t:t}function vRe(t,e){T.useContext(WQ).strict}function bRe(t){const{drag:e,layout:n}=Xd;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function wRe(t,e){if(typeof Proxy>"u")return mE;const n=new Map,i=(s,o)=>mE(s,o,t,e),r=(s,o)=>i(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?i:(n.has(o)||n.set(o,mE(o,void 0,t,e)),n.get(o))})}function sG({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function SRe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function CRe(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function AE(t){return t===void 0||t===1}function G_({scale:t,scaleX:e,scaleY:n}){return!AE(t)||!AE(e)||!AE(n)}function mc(t){return G_(t)||oG(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function oG(t){return K4(t.x)||K4(t.y)}function K4(t){return t&&t!=="0%"}function Kv(t,e,n){const i=t-n,r=e*i;return n+r}function Y4(t,e,n,i,r){return r!==void 0&&(t=Kv(t,r,i)),Kv(t,n,i)+e}function $_(t,e=0,n=1,i,r){t.min=Y4(t.min,e,n,i,r),t.max=Y4(t.max,e,n,i,r)}function aG(t,{x:e,y:n}){$_(t.x,e.translate,e.scale,e.originPoint),$_(t.y,n.translate,n.scale,n.originPoint)}const q4=.999999999999,J4=1.0000000000001;function xRe(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;aq4&&(e.x=1),e.yq4&&(e.y=1)}function vd(t,e){t.min=t.min+e,t.max=t.max+e}function X4(t,e,n,i,r=.5){const s=Xt(t.min,t.max,r);$_(t,e,n,s,i)}function bd(t,e){X4(t.x,e.x,e.scaleX,e.scale,e.originX),X4(t.y,e.y,e.scaleY,e.scale,e.originY)}function lG(t,e){return sG(CRe(t.getBoundingClientRect(),e))}function ERe(t,e,n){const i=lG(t,n),{scroll:r}=e;return r&&(vd(i.x,r.offset.x),vd(i.y,r.offset.y)),i}const Z4=()=>({translate:0,scale:1,origin:0,originPoint:0}),wd=()=>({x:Z4(),y:Z4()}),eU=()=>({min:0,max:0}),Nn=()=>({x:eU(),y:eU()}),W_={current:null},cG={current:!1};function _Re(){if(cG.current=!0,!!jR)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>W_.current=t.matches;t.addEventListener("change",e),e()}else W_.current=!1}const TRe=new WeakMap;function RRe(t,e,n){for(const i in e){const r=e[i],s=n[i];if(mi(r))t.addValue(i,r);else if(mi(s))t.addValue(i,Jd(r,{owner:t}));else if(s!==r)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(i);t.addValue(i,Jd(o!==void 0?o:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const tU=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class kRe{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=uk,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Di.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(cG.current||_Re(),this.shouldReduceMotion=W_.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),xl(this.notifyUpdate),xl(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=Eh.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Gt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xd){const n=Xd[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Nn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Jd(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(eQ(i)||nQ(i))?i=parseFloat(i):!HTe(i)&&El.test(n)&&(i=UQ(e,n)),this.setBaseTarget(e,mi(i)?i.get():i)),mi(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const s=bk(this.props,n,this.presenceContext?.custom);s&&(i=s[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!mi(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ZR),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){fk.render(this.render)}}class uG extends kRe{constructor(){super(...arguments),this.KeyframeResolver=kTe}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;mi(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dG(t,{style:e,vars:n},i,r){const s=t.style;let o;for(o in e)s[o]=e[o];r?.applyProjectionStyles(s,i);for(o in n)s.setProperty(o,n[o])}function IRe(t){return window.getComputedStyle(t)}class MRe extends uG{constructor(){super(...arguments),this.type="html",this.renderInstance=dG}readValueFromInstance(e,n){if(Eh.has(n))return this.projection?.isProjecting?B_(n):K2e(e,n);{const i=IRe(e),r=(mQ(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return lG(e,n)}build(e,n,i){Ak(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return wk(e,n,i)}}const hG=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function DRe(t,e,n,i){dG(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(hG.has(r)?r:Sk(r),e.attrs[r])}class PRe extends uG{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Eh.has(n)){const i=LQ(n);return i&&i.default||0}return n=hG.has(n)?n:Sk(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return tG(e,n,i)}build(e,n,i){JQ(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){DRe(e,n,i,r)}mount(e){this.isSVGTag=ZQ(e.tagName),super.mount(e)}}const NRe=(t,e)=>e.isSVG??vk(t)?new PRe(e):new MRe(e,{allowProjection:t!==T.Fragment});function Pd(t,e,n){const i=t.getProps();return bk(i,e,n!==void 0?n:i.custom,t)}const j_=t=>Array.isArray(t);function ORe(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Jd(n))}function BRe(t){return j_(t)?t[t.length-1]||0:t}function LRe(t,e){const n=Pd(t,e);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const a=BRe(s[o]);ORe(t,o,a)}}function URe(t){return!!(mi(t)&&t.add)}function K_(t,e){const n=t.getValue("willChange");if(URe(n))return n.add(e);if(!n&&ha.WillChange){const i=new ha.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function fG(t){return t.props[nG]}const VRe=t=>t!==null;function FRe(t,{repeat:e,repeatType:n="loop"},i){const r=t.filter(VRe),s=e&&n!=="loop"&&e%2===1?0:r.length-1;return r[s]}const HRe={type:"spring",stiffness:500,damping:25,restSpeed:10},zRe=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),QRe={type:"keyframes",duration:.8},GRe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$Re=(t,{keyframes:e})=>e.length>2?QRe:Eh.has(t)?t.startsWith("scale")?zRe(e[1]):HRe:GRe;function WRe({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const Ck=(t,e,n,i={},r,s)=>o=>{const a=dk(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u=u-aa(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:g=>{e.set(g),a.onUpdate&&a.onUpdate(g)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:r};WRe(a)||Object.assign(d,$Re(t,d)),d.duration&&(d.duration=aa(d.duration)),d.repeatDelay&&(d.repeatDelay=aa(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(H_(d),d.delay===0&&(f=!0)),(ha.instantAnimations||ha.skipAnimations)&&(f=!0,H_(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const g=FRe(d.keyframes,a);if(g!==void 0){Gt.update(()=>{d.onUpdate(g),d.onComplete()});return}}return a.isSync?new ck(d):new ATe(d)};function jRe({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function pG(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(s=i);const l=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const d in a){const f=t.getValue(d,t.latestValues[d]??null),g=a[d];if(g===void 0||u&&jRe(u,d))continue;const m={delay:n,...dk(s||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(g)&&g===v&&!m.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const E=fG(t);if(E){const k=window.MotionHandoffAnimation(E,d,Gt);k!==null&&(m.startTime=k,S=!0)}}K_(t,d),f.start(Ck(d,f,g,t.shouldReduceMotion&&NQ.has(d)?{type:!1}:m,t,S));const C=f.animation;C&&l.push(C)}return o&&Promise.all(l).then(()=>{Gt.update(()=>{o&&LRe(t,o)})}),l}function gG(t,e,n,i=0,r=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,a=(o-1)*i;return typeof n=="function"?n(s,o):r===1?s*i:a-s*i}function Y_(t,e,n={}){const i=Pd(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>Promise.all(pG(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=r;return KRe(t,e,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function KRe(t,e,n=0,i=0,r=0,s=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Y_(l,e,{...o,delay:n+(typeof i=="function"?0:i)+gG(t.variantChildren,l,i,r,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function YRe(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>Y_(t,s,n));i=Promise.all(r)}else if(typeof e=="string")i=Y_(t,e,n);else{const r=typeof e=="function"?Pd(t,e,n.custom):e;i=Promise.all(pG(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function mG(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:n,options:i})=>YRe(t,n,i)))}function eke(t){let e=ZRe(t),n=nU(),i=!0;const r=l=>(u,d)=>{const f=Pd(t,d,l==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:g,transitionEnd:m,...v}=f;u={...u,...v,...m}}return u};function s(l){e=l(t)}function o(l){const{props:u}=t,d=AG(t.parent)||{},f=[],g=new Set;let m={},v=1/0;for(let C=0;Cv&&M,G=!1;const V=Array.isArray(R)?R:[R];let $=V.reduce(r(E),{});D===!1&&($={});const{prevResolvedValues:K={}}=k,X={...K,...$},J=q=>{B=!0,g.has(q)&&(G=!0,g.delete(q)),k.needsAnimating[q]=!0;const j=t.getValue(q);j&&(j.liveStyle=!1)};for(const q in X){const j=$[q],oe=K[q];if(m.hasOwnProperty(q))continue;let L=!1;j_(j)&&j_(oe)?L=!mG(j,oe):L=j!==oe,L?j!=null?J(q):g.add(q):j!==void 0&&g.has(q)?J(q):k.protectedKeys[q]=!0}k.prevProp=R,k.prevResolvedValues=$,k.isActive&&(m={...m,...$}),i&&t.blockInitialAnimation&&(B=!1);const Z=P&&N;B&&(!Z||G)&&f.push(...V.map(q=>{const j={type:E};if(typeof q=="string"&&i&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:oe}=t,L=Pd(oe,q);if(oe.enteringChildren&&L){const{delayChildren:z}=L.transition||{};j.delay=gG(oe.enteringChildren,t,z)}}return{animation:q,options:j}}))}if(g.size){const C={};if(typeof u.initial!="boolean"){const E=Pd(t,Array.isArray(u.initial)?u.initial[0]:u.initial);E&&E.transition&&(C.transition=E.transition)}g.forEach(E=>{const k=t.getBaseTarget(E),R=t.getValue(E);R&&(R.liveStyle=!0),C[E]=k??null}),f.push({animation:C})}let S=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(S=!1),i=!1,S?e(f):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(l,u)),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=nU()}}}function tke(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!mG(e,t):!1}function uc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nU(){return{animate:uc(!0),whileInView:uc(),whileHover:uc(),whileTap:uc(),whileDrag:uc(),whileFocus:uc(),exit:uc()}}class Ol{constructor(e){this.isMounted=!1,this.node=e}update(){}}class nke extends Ol{constructor(e){super(e),e.animationState||(e.animationState=eke(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Tw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let ike=0;class rke extends Ol{constructor(){super(...arguments),this.id=ike++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ske={animation:{Feature:nke},exit:{Feature:rke}};function wg(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function gm(t){return{point:{x:t.pageX,y:t.pageY}}}const oke=t=>e=>pk(e)&&t(e,gm(e));function Vp(t,e,n,i){return wg(t,e,oke(n),i)}const yG=1e-4,ake=1-yG,lke=1+yG,vG=.01,cke=0-vG,uke=0+vG;function Pi(t){return t.max-t.min}function dke(t,e,n){return Math.abs(t-e)<=n}function iU(t,e,n,i=.5){t.origin=i,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=Pi(n)/Pi(e),t.translate=Xt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ake&&t.scale<=lke||isNaN(t.scale))&&(t.scale=1),(t.translate>=cke&&t.translate<=uke||isNaN(t.translate))&&(t.translate=0)}function Fp(t,e,n,i){iU(t.x,e.x,n.x,i?i.originX:void 0),iU(t.y,e.y,n.y,i?i.originY:void 0)}function rU(t,e,n){t.min=n.min+e.min,t.max=t.min+Pi(e)}function hke(t,e,n){rU(t.x,e.x,n.x),rU(t.y,e.y,n.y)}function sU(t,e,n){t.min=e.min-n.min,t.max=t.min+Pi(e)}function Yv(t,e,n){sU(t.x,e.x,n.x),sU(t.y,e.y,n.y)}function Qr(t){return[t("x"),t("y")]}const bG=({current:t})=>t?t.ownerDocument.defaultView:null,oU=(t,e)=>Math.abs(t-e);function fke(t,e){const n=oU(t.x,e.x),i=oU(t.y,e.y);return Math.sqrt(n**2+i**2)}const aU=new Set(["auto","scroll"]);class wG{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=vE(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,S=fke(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!S)return;const{point:C}=m,{timestamp:E}=ei;this.history.push({...C,timestamp:E});const{onStart:k,onMove:R}=this.handlers;v||(k&&k(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,m)},this.handlePointerMove=(m,v)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=yE(v,this.transformPagePoint),Gt.update(this.updatePoint,!0)},this.handlePointerUp=(m,v)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=vE(m.type==="pointercancel"?this.lastMoveEventInfo:yE(v,this.transformPagePoint),this.history);this.startEvent&&S&&S(m,k),C&&C(m,k)},!pk(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=r||window;const l=gm(e),u=yE(l,this.transformPagePoint),{point:d}=u,{timestamp:f}=ei;this.history=[{...d,timestamp:f}];const{onSessionStart:g}=n;g&&g(e,vE(u,this.history)),this.removeListeners=hm(Vp(this.contextWindow,"pointermove",this.handlePointerMove),Vp(this.contextWindow,"pointerup",this.handlePointerUp),Vp(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(aU.has(i.overflowX)||aU.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Gt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),xl(this.updatePoint)}}function yE(t,e){return e?{point:e(t.point)}:t}function lU(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vE({point:t},e){return{point:t,delta:lU(t,SG(e)),offset:lU(t,pke(e)),velocity:gke(e,.1)}}function pke(t){return t[0]}function SG(t){return t[t.length-1]}function gke(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=SG(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>aa(e)));)n--;if(!i)return{x:0,y:0};const s=jr(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mke(t,{min:e,max:n},i){return e!==void 0&&tn&&(t=i?Xt(n,t,i.max):Math.min(t,n)),t}function cU(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ake(t,{top:e,left:n,bottom:i,right:r}){return{x:cU(t.x,n,r),y:cU(t.y,e,i)}}function uU(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.mini?n=Ag(e.min,e.max-i,t.min):i>r&&(n=Ag(t.min,t.max-r,e.min)),wo(0,1,n)}function bke(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const q_=.35;function wke(t=q_){return t===!1?t=0:t===!0&&(t=q_),{x:dU(t,"left","right"),y:dU(t,"top","bottom")}}function dU(t,e,n){return{min:hU(t,e),max:hU(t,n)}}function hU(t,e){return typeof t=="number"?t:t[e]||0}const Ske=new WeakMap;class Cke{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Nn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=f=>{n?(this.stopAnimation(),this.snapToCursor(gm(f).point)):this.pauseAnimation()},o=(f,g)=>{this.stopAnimation();const{drag:m,dragPropagation:v,onDragStart:S}=this.getProps();if(m&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=NTe(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qr(E=>{let k=this.getAxisMotionValue(E).get()||0;if(Ao.test(k)){const{projection:R}=this.visualElement;if(R&&R.layout){const M=R.layout.layoutBox[E];M&&(k=Pi(M)*(parseFloat(k)/100))}}this.originPoint[E]=k}),S&&Gt.postRender(()=>S(f,g)),K_(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},a=(f,g)=>{this.latestPointerEvent=f,this.latestPanInfo=g;const{dragPropagation:m,dragDirectionLock:v,onDirectionLock:S,onDrag:C}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:E}=g;if(v&&this.currentDirection===null){this.currentDirection=xke(E),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",g.point,E),this.updateAxis("y",g.point,E),this.visualElement.render(),C&&C(f,g)},l=(f,g)=>{this.latestPointerEvent=f,this.latestPanInfo=g,this.stop(f,g),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Qr(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:d}=this.getProps();this.panSession=new wG(e,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:i,contextWindow:bG(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Gt.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!W0(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=mke(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&xp(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=Ake(i.layoutBox,e):this.constraints=!1,this.elastic=wke(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Qr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=bke(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xp(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=ERe(i,r.root,this.visualElement.getTransformPagePoint());let o=yke(r.layout.layoutBox,s);if(n){const a=n(SRe(o));this.hasMutatedConstraints=!!a,a&&(o=sG(a))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Qr(d=>{if(!W0(d,n,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const g=r?200:1e6,m=r?40:1e7,v={type:"inertia",velocity:i?e[d]:0,bounceStiffness:g,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return K_(this.visualElement,e),i.start(Ck(e,i,0,n,this.visualElement,!1))}stopAnimation(){Qr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Qr(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Qr(n=>{const{drag:i}=this.getProps();if(!W0(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[n],l=s.get()||0;s.set(e[n]-Xt(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!xp(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Qr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=vke({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Qr(o=>{if(!W0(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Xt(l,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;Ske.set(this.visualElement,this);const e=this.visualElement.current,n=Vp(e,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&!QQ(l.target)&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();xp(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Gt.read(i);const o=wg(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Qr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=q_,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function W0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function xke(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Eke extends Ol{constructor(e){super(e),this.removeGroupControls=Zr,this.removeListeners=Zr,this.controls=new Cke(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const fU=t=>(e,n)=>{t&&Gt.postRender(()=>t(e,n))};class _ke extends Ol{constructor(){super(...arguments),this.removePointerDownListener=Zr}onPointerDown(e){this.session=new wG(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bG(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:fU(e),onStart:fU(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Gt.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=Vp(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let bE=!1;class Tke extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),bE&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),qy.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,{projection:o}=i;return o&&(o.isPresent=s,bE=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Gt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),fk.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;bE=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function CG(t){const[e,n]=zTe(),i=T.useContext(Zz);return _.jsx(Tke,{...t,layoutGroup:i,switchLayoutGroup:T.useContext(iG),isPresent:e,safeToRemove:n})}function Rke(t,e,n){const i=mi(t)?t:Jd(t);return i.start(Ck("",i,e,n)),i.animation}const kke=(t,e)=>t.depth-e.depth;class Ike{constructor(){this.children=[],this.isDirty=!1}add(e){YR(this.children,e),this.isDirty=!0}remove(e){qR(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kke),this.isDirty=!1,this.children.forEach(e)}}function Mke(t,e){const n=Di.now(),i=({timestamp:r})=>{const s=r-n;s>=e&&(xl(i),t(s-e))};return Gt.setup(i,!0),()=>xl(i)}const xG=["TopLeft","TopRight","BottomLeft","BottomRight"],Dke=xG.length,pU=t=>typeof t=="string"?parseFloat(t):t,gU=t=>typeof t=="number"||De.test(t);function Pke(t,e,n,i,r,s){r?(t.opacity=Xt(0,n.opacity??1,Nke(i)),t.opacityExit=Xt(e.opacity??1,0,Oke(i))):s&&(t.opacity=Xt(e.opacity??1,n.opacity??1,i));for(let o=0;oie?1:n(Ag(t,e,i))}function AU(t,e){t.min=e.min,t.max=e.max}function ps(t,e){AU(t.x,e.x),AU(t.y,e.y)}function yU(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vU(t,e,n,i,r){return t-=e,t=Kv(t,1/n,i),r!==void 0&&(t=Kv(t,1/r,i)),t}function Bke(t,e=0,n=1,i=.5,r,s=t,o=t){if(Ao.test(e)&&(e=parseFloat(e),e=Xt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Xt(s.min,s.max,i);t===s&&(a-=e),t.min=vU(t.min,e,n,a,r),t.max=vU(t.max,e,n,a,r)}function bU(t,e,[n,i,r],s,o){Bke(t,e[n],e[i],e[r],e.scale,s,o)}const Lke=["x","scaleX","originX"],Uke=["y","scaleY","originY"];function wU(t,e,n,i){bU(t.x,e,Lke,n?n.x:void 0,i?i.x:void 0),bU(t.y,e,Uke,n?n.y:void 0,i?i.y:void 0)}function SU(t){return t.translate===0&&t.scale===1}function _G(t){return SU(t.x)&&SU(t.y)}function CU(t,e){return t.min===e.min&&t.max===e.max}function Vke(t,e){return CU(t.x,e.x)&&CU(t.y,e.y)}function xU(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function TG(t,e){return xU(t.x,e.x)&&xU(t.y,e.y)}function EU(t){return Pi(t.x)/Pi(t.y)}function _U(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Fke{constructor(){this.members=[]}add(e){YR(this.members,e),e.scheduleRender()}remove(e){if(qR(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(r=>e===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Hke(t,e,n){let i="";const r=t.x.translate/e.x,s=t.y.translate/e.y,o=n?.z||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:g,skewX:m,skewY:v}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),g&&(i+=`rotateY(${g}deg) `),m&&(i+=`skewX(${m}deg) `),v&&(i+=`skewY(${v}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const wE=["","X","Y","Z"],zke=1e3;let Qke=0;function SE(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function RG(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=fG(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Gt,!(r||s))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&RG(i)}function kG({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e?.()){this.id=Qke++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Wke),this.nodes.forEach(qke),this.nodes.forEach(Jke),this.nodes.forEach(jke)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;Gt.read(()=>{f=window.innerWidth}),t(o,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=Mke(g,250),qy.hasAnimatedSinceResize&&(qy.hasAnimatedSinceResize=!1,this.nodes.forEach(kU)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:g,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||nIe,{onLayoutAnimationStart:S,onLayoutAnimationComplete:C}=u.getProps(),E=!this.targetLayout||!TG(this.targetLayout,m),k=!f&&g;if(this.options.layoutRoot||this.resumeFrom||k||f&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...dk(v,"layout"),onPlay:S,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(d,k)}else f||kU(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),xl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Xke),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&RG(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pi(this.snapshot.measuredBox.x)&&!Pi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const D=M/1e3;IU(f.x,o.x,D),IU(f.y,o.y,D),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yv(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),eIe(this.relativeTarget,this.relativeTargetOrigin,g,D),R&&Vke(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Nn()),ps(R,this.relativeTarget)),S&&(this.animationValues=d,Pke(d,u,this.latestValues,D,k,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(xl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gt.update(()=>{qy.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Jd(0)),this.currentAnimation=Rke(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zke),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&IG(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Nn();const f=Pi(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const g=Pi(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+g}ps(a,l),bd(a,d),Fp(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Fke),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&SE("z",o,u,this.animationValues);for(let d=0;do.currentAnimation?.stop()),this.root.nodes.forEach(TU),this.root.sharedNodes.clear()}}}function Gke(t){t.updateLayout()}function $ke(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,s=e.source!==t.layout.source;r==="size"?Qr(d=>{const f=s?e.measuredBox[d]:e.layoutBox[d],g=Pi(f);f.min=n[d].min,f.max=f.min+g}):IG(r,e.layoutBox,n)&&Qr(d=>{const f=s?e.measuredBox[d]:e.layoutBox[d],g=Pi(n[d]);f.max=f.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+g)});const o=wd();Fp(o,n,e.layoutBox);const a=wd();s?Fp(a,t.applyTransform(i,!0),e.measuredBox):Fp(a,n,e.layoutBox);const l=!_G(o);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:g}=d;if(f&&g){const m=Nn();Yv(m,e.layoutBox,f.layoutBox);const v=Nn();Yv(v,n,g.layoutBox),TG(m,v)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Wke(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function jke(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Kke(t){t.clearSnapshot()}function TU(t){t.clearMeasurements()}function RU(t){t.isLayoutDirty=!1}function Yke(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function kU(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qke(t){t.resolveTargetDelta()}function Jke(t){t.calcProjection()}function Xke(t){t.resetSkewAndRotation()}function Zke(t){t.removeLeadSnapshot()}function IU(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function MU(t,e,n,i){t.min=Xt(e.min,n.min,i),t.max=Xt(e.max,n.max,i)}function eIe(t,e,n,i){MU(t.x,e.x,n.x,i),MU(t.y,e.y,n.y,i)}function tIe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const nIe={duration:.45,ease:[.4,0,.1,1]},DU=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),PU=DU("applewebkit/")&&!DU("chrome/")?Math.round:Zr;function NU(t){t.min=PU(t.min),t.max=PU(t.max)}function iIe(t){NU(t.x),NU(t.y)}function IG(t,e,n){return t==="position"||t==="preserve-aspect"&&!dke(EU(e),EU(n),.2)}function rIe(t){return t!==t.root&&t.scroll?.wasRoot}const sIe=kG({attachResizeListener:(t,e)=>wg(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),CE={current:void 0},MG=kG({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!CE.current){const t=new sIe({});t.mount(window),t.setOptions({layoutScroll:!0}),CE.current=t}return CE.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),oIe={pan:{Feature:_ke},drag:{Feature:Eke,ProjectionNode:MG,MeasureLayout:CG}};function OU(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Gt.postRender(()=>s(e,gm(e)))}class aIe extends Ol{mount(){const{current:e}=this.node;e&&(this.unmount=OTe(e,(n,i)=>(OU(this.node,i,"Start"),r=>OU(this.node,r,"End"))))}unmount(){}}class lIe extends Ol{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=hm(wg(this.node.current,"focus",()=>this.onFocus()),wg(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function BU(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Gt.postRender(()=>s(e,gm(e)))}class cIe extends Ol{mount(){const{current:e}=this.node;e&&(this.unmount=UTe(e,(n,i)=>(BU(this.node,i,"Start"),(r,{success:s})=>BU(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const J_=new WeakMap,xE=new WeakMap,uIe=t=>{const e=J_.get(t.target);e&&e(t)},dIe=t=>{t.forEach(uIe)};function hIe({root:t,...e}){const n=t||document;xE.has(n)||xE.set(n,{});const i=xE.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(dIe,{root:t,...e})),i[r]}function fIe(t,e,n){const i=hIe(e);return J_.set(t,n),i.observe(t),()=>{J_.delete(t),i.unobserve(t)}}const pIe={some:0,all:1};class gIe extends Ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:pIe[r]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),g=u?d:f;g&&g(l)};return fIe(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(mIe(e,n))&&this.startObserver()}unmount(){}}function mIe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const AIe={inView:{Feature:gIe},tap:{Feature:cIe},focus:{Feature:lIe},hover:{Feature:aIe}},yIe={layout:{ProjectionNode:MG,MeasureLayout:CG}},vIe={...ske,...AIe,...oIe,...yIe},xk=wRe(vIe,NRe);function DG(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bIe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wIe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SIe={};function LU(t,e){return(SIe.jsx?wIe:bIe).test(t)}const CIe=/[ \t\n\f\r]/g;function kw(t){return typeof t=="object"?t.type==="text"?UU(t.value):!1:UU(t)}function UU(t){return t.replace(CIe,"")===""}class mm{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}mm.prototype.normal={};mm.prototype.property={};mm.prototype.space=void 0;function PG(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new mm(n,i,e)}function X_(t){return t.toLowerCase()}class nr{constructor(e,n){this.attribute=n,this.property=e}}nr.prototype.attribute="";nr.prototype.booleanish=!1;nr.prototype.boolean=!1;nr.prototype.commaOrSpaceSeparated=!1;nr.prototype.commaSeparated=!1;nr.prototype.defined=!1;nr.prototype.mustUseProperty=!1;nr.prototype.number=!1;nr.prototype.overloadedBoolean=!1;nr.prototype.property="";nr.prototype.spaceSeparated=!1;nr.prototype.space=void 0;let xIe=0;const Ze=qc(),vn=qc(),Z_=qc(),ye=qc(),Vt=qc(),Nd=qc(),yr=qc();function qc(){return 2**++xIe}const e2=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:vn,commaOrSpaceSeparated:yr,commaSeparated:Nd,number:ye,overloadedBoolean:Z_,spaceSeparated:Vt},Symbol.toStringTag,{value:"Module"})),EE=Object.keys(e2);class Ek extends nr{constructor(e,n,i,r){let s=-1;if(super(e,n),VU(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&kIe.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(FU,MIe);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!FU.test(s)){let o=s.replace(RIe,IIe);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=Ek}return new r(i,e)}function IIe(t){return"-"+t.toLowerCase()}function MIe(t){return t.charAt(1).toUpperCase()}const HG=PG([NG,EIe,LG,UG,VG],"html"),Am=PG([NG,_Ie,LG,UG,VG],"svg");function zG(t){return t.join(" ").trim()}var nd={},_E,HU;function DIe(){if(HU)return _E;HU=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=` -`,u="/",d="*",f="",g="comment",m="declaration";function v(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var k=1,R=1;function M(J){var Z=J.match(e);Z&&(k+=Z.length);var Q=J.lastIndexOf(l);R=~Q?J.length-Q:R+J.length}function D(){var J={line:k,column:R};return function(Z){return Z.position=new P(J),G(),Z}}function P(J){this.start=J,this.end={line:k,column:R},this.source=E.source}P.prototype.content=C;function N(J){var Z=new Error(E.source+":"+k+":"+R+": "+J);if(Z.reason=J,Z.filename=E.source,Z.line=k,Z.column=R,Z.source=C,!E.silent)throw Z}function B(J){var Z=J.exec(C);if(Z){var Q=Z[0];return M(Q),C=C.slice(Q.length),Z}}function G(){B(n)}function V(J){var Z;for(J=J||[];Z=$();)Z!==!1&&J.push(Z);return J}function $(){var J=D();if(!(u!=C.charAt(0)||d!=C.charAt(1))){for(var Z=2;f!=C.charAt(Z)&&(d!=C.charAt(Z)||u!=C.charAt(Z+1));)++Z;if(Z+=2,f===C.charAt(Z-1))return N("End of comment missing");var Q=C.slice(2,Z-2);return R+=2,M(Q),C=C.slice(Z),R+=2,J({type:g,comment:Q})}}function K(){var J=D(),Z=B(i);if(Z){if($(),!B(r))return N("property missing ':'");var Q=B(s),q=J({type:m,property:S(Z[0].replace(t,f)),value:Q?S(Q[0].replace(t,f)):f});return B(o),q}}function X(){var J=[];V(J);for(var Z;Z=K();)Z!==!1&&(J.push(Z),V(J));return J}return G(),X()}function S(C){return C?C.replace(a,f):f}return _E=v,_E}var zU;function PIe(){if(zU)return nd;zU=1;var t=nd&&nd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(nd,"__esModule",{value:!0}),nd.default=n;const e=t(DIe());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const o=(0,e.default)(i),a=typeof r=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:d}=l;a?r(u,d,l):d&&(s=s||{},s[u]=d)}),s}return nd}var Yf={},QU;function NIe(){if(QU)return Yf;QU=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(u){return!u||n.test(u)||t.test(u)},o=function(u,d){return d.toUpperCase()},a=function(u,d){return"".concat(d,"-")},l=function(u,d){return d===void 0&&(d={}),s(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(r,a):u=u.replace(i,a),u.replace(e,o))};return Yf.camelCase=l,Yf}var qf,GU;function OIe(){if(GU)return qf;GU=1;var t=qf&&qf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(PIe()),n=NIe();function i(r,s){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return i.default=i,qf=i,qf}var BIe=OIe();const LIe=Gc(BIe),QG=GG("end"),_k=GG("start");function GG(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function UIe(t){const e=_k(t),n=QG(t);if(e&&n)return{start:e,end:n}}function Hp(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?$U(t.position):"start"in t||"end"in t?$U(t):"line"in t||"column"in t?t2(t):""}function t2(t){return WU(t&&t.line)+":"+WU(t&&t.column)}function $U(t){return t2(t&&t.start)+"-"+t2(t&&t.end)}function WU(t){return t&&typeof t=="number"?t:1}class vi extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(o=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?s.ruleId=i:(s.source=i.slice(0,l),s.ruleId=i.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Hp(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vi.prototype.file="";vi.prototype.name="";vi.prototype.reason="";vi.prototype.message="";vi.prototype.stack="";vi.prototype.column=void 0;vi.prototype.line=void 0;vi.prototype.ancestors=void 0;vi.prototype.cause=void 0;vi.prototype.fatal=void 0;vi.prototype.place=void 0;vi.prototype.ruleId=void 0;vi.prototype.source=void 0;const Tk={}.hasOwnProperty,VIe=new Map,FIe=/[A-Z]/g,HIe=new Set(["table","tbody","thead","tfoot","tr"]),zIe=new Set(["td","th"]),$G="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WG(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=qIe(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=YIe(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Am:HG,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=jG(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function jG(t,e,n){if(e.type==="element")return QIe(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return GIe(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return WIe(t,e,n);if(e.type==="mdxjsEsm")return $Ie(t,e);if(e.type==="root")return jIe(t,e,n);if(e.type==="text")return KIe(t,e)}function QIe(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Am,t.schema=r),t.ancestors.push(e);const s=YG(t,e.tagName,!1),o=JIe(t,e);let a=kk(t,e);return HIe.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!kw(l):!0})),KG(t,o,s,e),Rk(o,a),t.ancestors.pop(),t.schema=i,t.create(e,s,o,n)}function GIe(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}Sg(t,e.position)}function $Ie(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Sg(t,e.position)}function WIe(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=Am,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:YG(t,e.name,!0),o=XIe(t,e),a=kk(t,e);return KG(t,o,s,e),Rk(o,a),t.ancestors.pop(),t.schema=i,t.create(e,s,o,n)}function jIe(t,e,n){const i={};return Rk(i,kk(t,e)),t.create(e,t.Fragment,i,n)}function KIe(t,e){return e.value}function KG(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function Rk(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function YIe(t,e,n){return i;function i(r,s,o,a){const u=Array.isArray(o.children)?n:e;return a?u(s,o,a):u(s,o)}}function qIe(t,e){return n;function n(i,r,s,o){const a=Array.isArray(s.children),l=_k(i);return e(r,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function JIe(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&Tk.call(e.properties,r)){const s=ZIe(t,r,e.properties[r]);if(s){const[o,a]=s;t.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&zIe.has(e.tagName)?i=a:n[o]=a}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function XIe(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else Sg(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const a=i.value.data.estree.body[0];a.type,s=t.evaluater.evaluateExpression(a.expression)}else Sg(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function kk(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:VIe;for(;++ir?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s0?(xr(t,t.length,0,e),t):e}const YU={}.hasOwnProperty;function JG(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function _s(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ii=Bl(/[A-Za-z]/),Ai=Bl(/[\dA-Za-z]/),lMe=Bl(/[#-'*+\--9=?A-Z^-~]/);function qv(t){return t!==null&&(t<32||t===127)}const n2=Bl(/\d/),cMe=Bl(/[\dA-Fa-f]/),uMe=Bl(/[!-/:-@[-`{-~]/);function He(t){return t!==null&&t<-2}function Ut(t){return t!==null&&(t<0||t===32)}function dt(t){return t===-2||t===-1||t===32}const Iw=Bl(new RegExp("\\p{P}|\\p{S}","u")),Vc=Bl(/\s/);function Bl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Th(t){const e=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),r=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function mt(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return dt(l)?(t.enter(n),a(l)):e(l)}function a(l){return dt(l)&&s++o))return;const N=e.events.length;let B=N,G,V;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){if(G){V=e.events[B][1].end;break}G=!0}for(E(i),P=N;PR;){const D=n[M];e.containerState=D[1],D[0].exit.call(e,t)}n.length=R}function k(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function gMe(t,e,n){return mt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zd(t){if(t===null||Ut(t)||Vc(t))return 1;if(Iw(t))return 2}function Mw(t,e,n){const i=[];let r=-1;for(;++r1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[i][1].end},g={...t[n][1].start};JU(f,-l),JU(g,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},s={type:l>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[i][1].end={...o.start},t[n][1].start={...a.end},u=[],t[i][1].end.offset-t[i][1].start.offset&&(u=Gr(u,[["enter",t[i][1],e],["exit",t[i][1],e]])),u=Gr(u,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",s,e]]),u=Gr(u,Mw(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),u=Gr(u,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,u=Gr(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,xr(t,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&dt(P)?mt(t,k,"linePrefix",s+1)(P):k(P)}function k(P){return P===null||He(P)?t.check(XU,S,M)(P):(t.enter("codeFlowValue"),R(P))}function R(P){return P===null||He(P)?(t.exit("codeFlowValue"),k(P)):(t.consume(P),R)}function M(P){return t.exit("codeFenced"),e(P)}function D(P,N,B){let G=0;return V;function V(Z){return P.enter("lineEnding"),P.consume(Z),P.exit("lineEnding"),$}function $(Z){return P.enter("codeFencedFence"),dt(Z)?mt(P,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):K(Z)}function K(Z){return Z===a?(P.enter("codeFencedFenceSequence"),X(Z)):B(Z)}function X(Z){return Z===a?(G++,P.consume(Z),X):G>=o?(P.exit("codeFencedFenceSequence"),dt(Z)?mt(P,J,"whitespace")(Z):J(Z)):B(Z)}function J(Z){return Z===null||He(Z)?(P.exit("codeFencedFence"),N(Z)):B(Z)}}}function TMe(t,e,n){const i=this;return r;function r(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}const RE={name:"codeIndented",tokenize:kMe},RMe={partial:!0,tokenize:IMe};function kMe(t,e,n){const i=this;return r;function r(u){return t.enter("codeIndented"),mt(t,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):He(u)?t.attempt(RMe,o,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||He(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function IMe(t,e,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):He(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):mt(t,s,"linePrefix",5)(o)}function s(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):He(o)?r(o):n(o)}}const MMe={name:"codeText",previous:PMe,resolve:DMe,tokenize:NMe};function DMe(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Jf(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Jf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Jf(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(o):t.interrupt(i.parser.constructs.flow,n,e)(o)}}function i$(t,e,n,i,r,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(E),t.exit(s),g):E===null||E===32||E===41||qv(E)?n(E):(t.enter(i),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),S(E))}function g(E){return E===62?(t.enter(s),t.consume(E),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===62?(t.exit("chunkString"),t.exit(a),g(E)):E===null||E===60||He(E)?n(E):(t.consume(E),E===92?v:m)}function v(E){return E===60||E===62||E===92?(t.consume(E),m):m(E)}function S(E){return!d&&(E===null||E===41||Ut(E))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(i),e(E)):d999||m===null||m===91||m===93&&!l||m===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(t.exit(s),t.enter(r),t.consume(m),t.exit(r),t.exit(i),e):He(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||He(m)||a++>999?(t.exit("chunkString"),d(m)):(t.consume(m),l||(l=!dt(m)),m===92?g:f)}function g(m){return m===91||m===92||m===93?(t.consume(m),a++,f):f(m)}}function s$(t,e,n,i,r,s){let o;return a;function a(g){return g===34||g===39||g===40?(t.enter(i),t.enter(r),t.consume(g),t.exit(r),o=g===40?41:g,l):n(g)}function l(g){return g===o?(t.enter(r),t.consume(g),t.exit(r),t.exit(i),e):(t.enter(s),u(g))}function u(g){return g===o?(t.exit(s),l(o)):g===null?n(g):He(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),mt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===o||g===null||He(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?f:d)}function f(g){return g===o||g===92?(t.consume(g),d):d(g)}}function zp(t,e){let n;return i;function i(r){return He(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):dt(r)?mt(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const zMe={name:"definition",tokenize:GMe},QMe={partial:!0,tokenize:$Me};function GMe(t,e,n){const i=this;let r;return s;function s(m){return t.enter("definition"),o(m)}function o(m){return r$.call(i,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return r=_s(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):n(m)}function l(m){return Ut(m)?zp(t,u)(m):u(m)}function u(m){return i$(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return t.attempt(QMe,f,f)(m)}function f(m){return dt(m)?mt(t,g,"whitespace")(m):g(m)}function g(m){return m===null||He(m)?(t.exit("definition"),i.parser.defined.push(r),e(m)):n(m)}}function $Me(t,e,n){return i;function i(a){return Ut(a)?zp(t,r)(a):n(a)}function r(a){return s$(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return dt(a)?mt(t,o,"whitespace")(a):o(a)}function o(a){return a===null||He(a)?e(a):n(a)}}const WMe={name:"hardBreakEscape",tokenize:jMe};function jMe(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return He(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const KMe={name:"headingAtx",resolve:YMe,tokenize:qMe};function YMe(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},xr(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function qMe(t,e,n){let i=0;return r;function r(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(t.consume(d),o):d===null||Ut(d)?(t.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||He(d)?(t.exit("atxHeading"),e(d)):dt(d)?mt(t,a,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||Ut(d)?(t.exit("atxHeadingText"),a(d)):(t.consume(d),u)}}const JMe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],e5=["pre","script","style","textarea"],XMe={concrete:!0,name:"htmlFlow",resolveTo:tDe,tokenize:nDe},ZMe={partial:!0,tokenize:rDe},eDe={partial:!0,tokenize:iDe};function tDe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function nDe(t,e,n){const i=this;let r,s,o,a,l;return u;function u(U){return d(U)}function d(U){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(U),f}function f(U){return U===33?(t.consume(U),g):U===47?(t.consume(U),s=!0,S):U===63?(t.consume(U),r=3,i.interrupt?e:L):Ii(U)?(t.consume(U),o=String.fromCharCode(U),C):n(U)}function g(U){return U===45?(t.consume(U),r=2,m):U===91?(t.consume(U),r=5,a=0,v):Ii(U)?(t.consume(U),r=4,i.interrupt?e:L):n(U)}function m(U){return U===45?(t.consume(U),i.interrupt?e:L):n(U)}function v(U){const pe="CDATA[";return U===pe.charCodeAt(a++)?(t.consume(U),a===pe.length?i.interrupt?e:K:v):n(U)}function S(U){return Ii(U)?(t.consume(U),o=String.fromCharCode(U),C):n(U)}function C(U){if(U===null||U===47||U===62||Ut(U)){const pe=U===47,xe=o.toLowerCase();return!pe&&!s&&e5.includes(xe)?(r=1,i.interrupt?e(U):K(U)):JMe.includes(o.toLowerCase())?(r=6,pe?(t.consume(U),E):i.interrupt?e(U):K(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?k(U):R(U))}return U===45||Ai(U)?(t.consume(U),o+=String.fromCharCode(U),C):n(U)}function E(U){return U===62?(t.consume(U),i.interrupt?e:K):n(U)}function k(U){return dt(U)?(t.consume(U),k):V(U)}function R(U){return U===47?(t.consume(U),V):U===58||U===95||Ii(U)?(t.consume(U),M):dt(U)?(t.consume(U),R):V(U)}function M(U){return U===45||U===46||U===58||U===95||Ai(U)?(t.consume(U),M):D(U)}function D(U){return U===61?(t.consume(U),P):dt(U)?(t.consume(U),D):R(U)}function P(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(t.consume(U),l=U,N):dt(U)?(t.consume(U),P):B(U)}function N(U){return U===l?(t.consume(U),l=null,G):U===null||He(U)?n(U):(t.consume(U),N)}function B(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Ut(U)?D(U):(t.consume(U),B)}function G(U){return U===47||U===62||dt(U)?R(U):n(U)}function V(U){return U===62?(t.consume(U),$):n(U)}function $(U){return U===null||He(U)?K(U):dt(U)?(t.consume(U),$):n(U)}function K(U){return U===45&&r===2?(t.consume(U),Q):U===60&&r===1?(t.consume(U),q):U===62&&r===4?(t.consume(U),z):U===63&&r===3?(t.consume(U),L):U===93&&r===5?(t.consume(U),oe):He(U)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(ZMe,te,X)(U)):U===null||He(U)?(t.exit("htmlFlowData"),X(U)):(t.consume(U),K)}function X(U){return t.check(eDe,J,te)(U)}function J(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),Z}function Z(U){return U===null||He(U)?X(U):(t.enter("htmlFlowData"),K(U))}function Q(U){return U===45?(t.consume(U),L):K(U)}function q(U){return U===47?(t.consume(U),o="",j):K(U)}function j(U){if(U===62){const pe=o.toLowerCase();return e5.includes(pe)?(t.consume(U),z):K(U)}return Ii(U)&&o.length<8?(t.consume(U),o+=String.fromCharCode(U),j):K(U)}function oe(U){return U===93?(t.consume(U),L):K(U)}function L(U){return U===62?(t.consume(U),z):U===45&&r===2?(t.consume(U),L):K(U)}function z(U){return U===null||He(U)?(t.exit("htmlFlowData"),te(U)):(t.consume(U),z)}function te(U){return t.exit("htmlFlow"),e(U)}}function iDe(t,e,n){const i=this;return r;function r(o){return He(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}function rDe(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(ym,e,n)}}const sDe={name:"htmlText",tokenize:oDe};function oDe(t,e,n){const i=this;let r,s,o;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),u):L===47?(t.consume(L),D):L===63?(t.consume(L),R):Ii(L)?(t.consume(L),B):n(L)}function u(L){return L===45?(t.consume(L),d):L===91?(t.consume(L),s=0,v):Ii(L)?(t.consume(L),k):n(L)}function d(L){return L===45?(t.consume(L),m):n(L)}function f(L){return L===null?n(L):L===45?(t.consume(L),g):He(L)?(o=f,q(L)):(t.consume(L),f)}function g(L){return L===45?(t.consume(L),m):f(L)}function m(L){return L===62?Q(L):L===45?g(L):f(L)}function v(L){const z="CDATA[";return L===z.charCodeAt(s++)?(t.consume(L),s===z.length?S:v):n(L)}function S(L){return L===null?n(L):L===93?(t.consume(L),C):He(L)?(o=S,q(L)):(t.consume(L),S)}function C(L){return L===93?(t.consume(L),E):S(L)}function E(L){return L===62?Q(L):L===93?(t.consume(L),E):S(L)}function k(L){return L===null||L===62?Q(L):He(L)?(o=k,q(L)):(t.consume(L),k)}function R(L){return L===null?n(L):L===63?(t.consume(L),M):He(L)?(o=R,q(L)):(t.consume(L),R)}function M(L){return L===62?Q(L):R(L)}function D(L){return Ii(L)?(t.consume(L),P):n(L)}function P(L){return L===45||Ai(L)?(t.consume(L),P):N(L)}function N(L){return He(L)?(o=N,q(L)):dt(L)?(t.consume(L),N):Q(L)}function B(L){return L===45||Ai(L)?(t.consume(L),B):L===47||L===62||Ut(L)?G(L):n(L)}function G(L){return L===47?(t.consume(L),Q):L===58||L===95||Ii(L)?(t.consume(L),V):He(L)?(o=G,q(L)):dt(L)?(t.consume(L),G):Q(L)}function V(L){return L===45||L===46||L===58||L===95||Ai(L)?(t.consume(L),V):$(L)}function $(L){return L===61?(t.consume(L),K):He(L)?(o=$,q(L)):dt(L)?(t.consume(L),$):G(L)}function K(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),r=L,X):He(L)?(o=K,q(L)):dt(L)?(t.consume(L),K):(t.consume(L),J)}function X(L){return L===r?(t.consume(L),r=void 0,Z):L===null?n(L):He(L)?(o=X,q(L)):(t.consume(L),X)}function J(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Ut(L)?G(L):(t.consume(L),J)}function Z(L){return L===47||L===62||Ut(L)?G(L):n(L)}function Q(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function q(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),j}function j(L){return dt(L)?mt(t,oe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):oe(L)}function oe(L){return t.enter("htmlTextData"),o(L)}}const Dk={name:"labelEnd",resolveAll:uDe,resolveTo:dDe,tokenize:hDe},aDe={tokenize:fDe},lDe={tokenize:pDe},cDe={tokenize:gDe};function uDe(t){let e=-1;const n=[];for(;++e=3&&(u===null||He(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===r?(t.consume(u),i++,l):(t.exit("thematicBreakSequence"),dt(u)?mt(t,a,"whitespace")(u):a(u))}}const Wi={continuation:{tokenize:EDe},exit:TDe,name:"list",tokenize:xDe},SDe={partial:!0,tokenize:RDe},CDe={partial:!0,tokenize:_De};function xDe(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return a;function a(m){const v=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:n2(m)){if(i.containerState.type||(i.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Jy,n,u)(m):u(m);if(!i.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return n(m)}function l(m){return n2(m)&&++o<10?(t.consume(m),l):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),u(m)):n(m)}function u(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,t.check(ym,i.interrupt?n:d,t.attempt(SDe,g,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,g(m)}function f(m){return dt(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),g):n(m)}function g(m){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function EDe(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(ym,r,s);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,mt(t,e,"listItemIndent",i.containerState.size+1)(a)}function s(a){return i.containerState.furtherBlankLines||!dt(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(CDe,e,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,mt(t,t.attempt(Wi,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function _De(t,e,n){const i=this;return mt(t,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?e(s):n(s)}}function TDe(t){t.exit(this.containerState.type)}function RDe(t,e,n){const i=this;return mt(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!dt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const t5={name:"setextUnderline",resolveTo:kDe,tokenize:IDe};function kDe(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",o,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=o,t.push(["exit",o,e]),t}function IDe(t,e,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(t.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===r?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),dt(u)?mt(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||He(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const MDe={tokenize:DDe};function DDe(t){const e=this,n=t.attempt(ym,i,t.attempt(this.parser.constructs.flowInitial,r,mt(t,t.attempt(this.parser.constructs.flow,r,t.attempt(LMe,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const PDe={resolveAll:a$()},NDe=o$("string"),ODe=o$("text");function o$(t){return{resolveAll:a$(t==="text"?BDe:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,o,a);return o;function o(d){return u(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=r[d];let g=-1;if(f)for(;++g-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}s>0&&o.push(t[r].slice(0,s))}return o}function YDe(t,e){let n=-1;const i=[];let r;for(;++n0){const Si=ze.tokenStack[ze.tokenStack.length-1];(Si[1]||i5).call(ze,void 0,Si[0])}for(be.position={start:ol(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:ol(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function cPe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function uPe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dPe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=Th(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let o,a=t.footnoteCounts.get(i);a===void 0?(a=0,t.footnoteOrder.push(i),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function hPe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function fPe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function u$(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function pPe(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return u$(t,e);const r={src:Th(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function gPe(t,e){const n={src:Th(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function mPe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function APe(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return u$(t,e);const r={href:Th(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function yPe(t,e){const n={href:Th(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function vPe(t,e,n){const i=t.all(e),r=n?bPe(n):d$(e),s={},o=[];if(typeof e.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a1}function wPe(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=_k(e.children[1]),l=QG(e.children[e.children.length-1]);a&&l&&(o.position={start:a,end:l}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function _Pe(t,e,n){const i=n?n.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return s.push(o5(e.slice(r),r>0,!1)),s.join("")}function o5(t,e,n){let i=0,r=t.length;if(e){let s=t.codePointAt(i);for(;s===r5||s===s5;)i++,s=t.codePointAt(i)}if(n){let s=t.codePointAt(r-1);for(;s===r5||s===s5;)r--,s=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function kPe(t,e){const n={type:"text",value:RPe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function IPe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const MPe={blockquote:oPe,break:aPe,code:lPe,delete:cPe,emphasis:uPe,footnoteReference:dPe,heading:hPe,html:fPe,imageReference:pPe,image:gPe,inlineCode:mPe,linkReference:APe,link:yPe,listItem:vPe,list:wPe,paragraph:SPe,root:CPe,strong:xPe,table:EPe,tableCell:TPe,tableRow:_Pe,text:kPe,thematicBreak:IPe,toml:j0,yaml:j0,definition:j0,footnoteDefinition:j0};function j0(){}const h$=-1,Dw=0,Qp=1,Jv=2,Pk=3,Nk=4,Ok=5,Bk=6,f$=7,p$=8,a5=typeof self=="object"?self:globalThis,DPe=(t,e)=>{const n=(r,s)=>(t.set(s,r),r),i=r=>{if(t.has(r))return t.get(r);const[s,o]=e[r];switch(s){case Dw:case h$:return n(o,r);case Qp:{const a=n([],r);for(const l of o)a.push(i(l));return a}case Jv:{const a=n({},r);for(const[l,u]of o)a[i(l)]=i(u);return a}case Pk:return n(new Date(o),r);case Nk:{const{source:a,flags:l}=o;return n(new RegExp(a,l),r)}case Ok:{const a=n(new Map,r);for(const[l,u]of o)a.set(i(l),i(u));return a}case Bk:{const a=n(new Set,r);for(const l of o)a.add(i(l));return a}case f$:{const{name:a,message:l}=o;return n(new a5[a](l),r)}case p$:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new a5[s](o),r)};return i},l5=t=>DPe(new Map,t)(0),id="",{toString:PPe}={},{keys:NPe}=Object,Xf=t=>{const e=typeof t;if(e!=="object"||!t)return[Dw,e];const n=PPe.call(t).slice(8,-1);switch(n){case"Array":return[Qp,id];case"Object":return[Jv,id];case"Date":return[Pk,id];case"RegExp":return[Nk,id];case"Map":return[Ok,id];case"Set":return[Bk,id];case"DataView":return[Qp,n]}return n.includes("Array")?[Qp,n]:n.includes("Error")?[f$,n]:[Jv,n]},K0=([t,e])=>t===Dw&&(e==="function"||e==="symbol"),OPe=(t,e,n,i)=>{const r=(o,a)=>{const l=i.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Xf(o);switch(a){case Dw:{let d=o;switch(l){case"bigint":a=p$,d=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return r([h$],o)}return r([a,d],o)}case Qp:{if(l){let g=o;return l==="DataView"?g=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(g=new Uint8Array(o)),r([l,[...g]],o)}const d=[],f=r([a,d],o);for(const g of o)d.push(s(g));return f}case Jv:{if(l)switch(l){case"BigInt":return r([l,o.toString()],o);case"Boolean":case"Number":case"String":return r([l,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([a,d],o);for(const g of NPe(o))(t||!K0(Xf(o[g])))&&d.push([s(g),s(o[g])]);return f}case Pk:return r([a,o.toISOString()],o);case Nk:{const{source:d,flags:f}=o;return r([a,{source:d,flags:f}],o)}case Ok:{const d=[],f=r([a,d],o);for(const[g,m]of o)(t||!(K0(Xf(g))||K0(Xf(m))))&&d.push([s(g),s(m)]);return f}case Bk:{const d=[],f=r([a,d],o);for(const g of o)(t||!K0(Xf(g)))&&d.push(s(g));return f}}const{message:u}=o;return r([a,{name:l,message:u}],o)};return s},c5=(t,{json:e,lossy:n}={})=>{const i=[];return OPe(!(e||n),!!e,new Map,i)(t),i},Xv=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?l5(c5(t,e)):structuredClone(t):(t,e)=>l5(c5(t,e));function BPe(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function LPe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function UPe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||BPe,i=t.options.footnoteBackLabel||LPe,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&v.push({type:"text",value:" "});let k=typeof n=="string"?n:n(l,m);typeof k=="string"&&(k={type:"text",value:k}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,m),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const C=d[d.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const k=C.children[C.children.length-1];k&&k.type==="text"?k.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else d.push(...v);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(d,!0)};t.patch(u,E),a.push(E)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Xv(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` -`}]}}const Pw=(function(t){if(t==null)return zPe;if(typeof t=="function")return Nw(t);if(typeof t=="object")return Array.isArray(t)?VPe(t):FPe(t);if(typeof t=="string")return HPe(t);throw new Error("Expected function, string, or object as test")});function VPe(t){const e=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let m=g$,v,S,C;if((!e||s(l,u,d[d.length-1]||void 0))&&(m=WPe(n(l,d)),m[0]===r2))return m;if("children"in l&&l.children){const E=l;if(E.children&&m[0]!==$Pe)for(S=(i?E.children.length:-1)+o,C=d.concat(E);S>-1&&S0&&n.push({type:"text",value:` -`}),n}function u5(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function d5(t,e){const n=KPe(t,e),i=n.one(t,void 0),r=UPe(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function ZPe(t,e){return t&&"run"in t?async function(n,i){const r=d5(n,{file:i,...e});await t.run(r,i)}:function(n,i){return d5(n,{file:i,...t||e})}}function h5(t){if(t)throw t}var IE,f5;function eNe(){if(f5)return IE;f5=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!f)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(i)return i(u,d).value}else return;return u[d]};return IE=function l(){var u,d,f,g,m,v,S=arguments[0],C=1,E=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});Co.length;let l;a&&o.push(r);try{l=t.apply(this,o)}catch(u){const d=u;if(a&&n)throw d;return r(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,r):l instanceof Error?r(l):s(l))}function r(o,...a){n||(n=!0,e(o,...a))}function s(o){r(null,o)}}const no={basename:rNe,dirname:sNe,extname:oNe,join:aNe,sep:"/"};function rNe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');vm(t);let n=0,i=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let o=-1,a=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),a>-1&&(t.codePointAt(r)===e.codePointAt(a--)?a<0&&(i=r):(a=-1,i=o));return n===i?i=o:i<0&&(i=t.length),t.slice(n,i)}function sNe(t){if(vm(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function oNe(t){vm(t);let e=t.length,n=-1,i=0,r=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){i=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function aNe(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function cNe(t,e){let n="",i=0,r=-1,s=0,o=-1,a,l;for(;++o<=t.length;){if(o2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,o):n=t.slice(r+1,o),i=o-r-1;r=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function vm(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const uNe={cwd:dNe};function dNe(){return"/"}function a2(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function hNe(t){if(typeof t=="string")t=new URL(t);else if(!a2(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return fNe(t)}function fNe(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n0){let[m,...v]=d;const S=i[g][1];o2(S)&&o2(m)&&(m=ME(!0,S,m)),i[g]=[u,m,...v]}}}}const ANe=new Uk().freeze();function OE(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function BE(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function LE(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g5(t){if(!o2(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function m5(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Y0(t){return yNe(t)?t:new A$(t)}function yNe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function vNe(t){return typeof t=="string"||bNe(t)}function bNe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const wNe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A5=[],y5={allowDangerousHtml:!0},SNe=/^(https?|ircs?|mailto|xmpp)$/i,CNe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function y$(t){const e=xNe(t),n=ENe(t);return _Ne(e.runSync(e.parse(n),n),t)}function xNe(t){const e=t.rehypePlugins||A5,n=t.remarkPlugins||A5,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...y5}:y5;return ANe().use(sPe).use(n).use(ZPe,i).use(e)}function ENe(t){const e=t.children||"",n=new A$;return typeof e=="string"&&(n.value=e),n}function _Ne(t,e){const n=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,l=e.urlTransform||TNe;for(const d of CNe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+wNe+d.id,void 0);return Lk(t,u),WG(t,{Fragment:_.Fragment,components:r,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function u(d,f,g){if(d.type==="raw"&&g&&typeof f=="number")return o?g.children.splice(f,1):g.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in TE)if(Object.hasOwn(TE,m)&&Object.hasOwn(d.properties,m)){const v=d.properties[m],S=TE[m];(S===null||S.includes(d.tagName))&&(d.properties[m]=l(String(v||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,g)),m&&g&&typeof f=="number")return a&&d.children?g.children.splice(f,1,...d.children):g.children.splice(f,1),f}}}function TNe(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||i!==-1&&e>i||SNe.test(t.slice(0,e))?t:""}const RNe=(t,e)=>typeof t=="string"?t===e:JSON.stringify(t)===JSON.stringify(e),kNe=(t,e)=>{if(!t||!e)return!1;const n=i=>{const{position:r,data:s,...o}=i||{};return o};return JSON.stringify(n(t.properties))===JSON.stringify(n(e.properties))&&RNe(t.children,e.children)},Vk=(t,e)=>kNe(t.node,e.node),INe=(t={})=>Object.fromEntries(Object.entries(t??{}).map(([e,n])=>{if(!n)return[e,n];const i=n,r=({node:s,...o})=>_.jsx(i,{...o});return[e,T.memo(r,Vk)]})),Fk=T.createContext(null),v$=()=>T.useContext(Fk)!==null,MNe=({children:t,...e})=>_.jsx(Fk.Provider,{value:e,children:t}),DNe=T.memo(MNe,Vk),PNe=({node:t,...e})=>_.jsx("pre",{...e}),NNe=({node:t,...e})=>_.jsx("code",{...e}),Hk=({node:t,components:{Pre:e,Code:n},code:i})=>_.jsx(e,{children:_.jsx(n,{node:t,children:i})}),ONe=()=>null,BNe=({node:t,components:{Pre:e,Code:n,SyntaxHighlighter:i,CodeHeader:r},language:s,code:o})=>{const a=T.useMemo(()=>({Pre:e,Code:n}),[e,n]),l=s?i:Hk;return _.jsxs(_.Fragment,{children:[_.jsx(r,{node:t,language:s,code:o}),_.jsx(l,{node:t,components:a,language:s??"unknown",code:o})]})};var UE={exports:{}};var v5;function LNe(){return v5||(v5=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",o=0;o({className:n,...i})=>({className:b$(t,n),...e,...i}),VNe=({node:t,components:{Pre:e,Code:n,SyntaxHighlighter:i,CodeHeader:r},componentsByLanguage:s={},children:o,...a})=>{const l=T.useContext(Fk),u=b5(l),d=Bi(C=>_.jsx(e,{...u(C)})),f=b5(a),g=Bi(C=>_.jsx(n,{...f(C)})),m=/language-(\w+)/.exec(a.className||"")?.[1]??"";if(typeof o!="string")return _.jsx(Hk,{node:t,components:{Pre:d,Code:g},code:o});const v=s[m]?.SyntaxHighlighter??i,S=s[m]?.CodeHeader??r;return _.jsx(BNe,{node:t,components:{Pre:d,Code:g,SyntaxHighlighter:v,CodeHeader:S},language:m||"unknown",code:o})},FNe=({node:t,components:e,componentsByLanguage:n,...i})=>v$()?_.jsx(VNe,{node:t,components:e,componentsByLanguage:n,...i}):_.jsx(e.Code,{...i}),HNe=T.memo(FNe,(t,e)=>t.components===e.components&&t.componentsByLanguage===e.componentsByLanguage&&Vk(t,e)),{useSmooth:zNe,useSmoothStatus:QNe,withSmoothContextProvider:GNe}=Aee,$Ne=({components:t,componentsByLanguage:e,smooth:n=!0,preprocess:i,...r})=>{const s=HF(),o=T.useMemo(()=>i?{...s,text:i(s.text)}:s,[s,i]),{text:a}=zNe(o,n),{pre:l=PNe,code:u=NNe,SyntaxHighlighter:d=Hk,CodeHeader:f=ONe}=t??{},g=T.useMemo(()=>({Pre:l,Code:u,SyntaxHighlighter:d,CodeHeader:f}),[l,u,d,f]),m=Bi(S=>_.jsx(HNe,{components:g,componentsByLanguage:e,...S})),v=T.useMemo(()=>{const{pre:S,code:C,SyntaxHighlighter:E,CodeHeader:k,...R}=t??{};return{...R,pre:DNe,code:m}},[m,t]);return _.jsx(y$,{components:v,...r,children:a})},w$=T.forwardRef(({className:t,containerProps:e,containerComponent:n="div",...i},r)=>{const s=QNe();return _.jsx(n,{"data-status":s.type,...e,className:b$(t,e?.className),ref:r,children:_.jsx($Ne,{...i})})});w$.displayName="MarkdownTextPrimitive";const WNe=GNe(w$);function Zv(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}function jNe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KNe(t,e,n){const r=Pw((n||{}).ignore||[]),s=YNe(e);let o=-1;for(;++o0?{type:"text",value:P}:void 0),P===!1?g.lastIndex=M+1:(v!==M&&k.push({type:"text",value:u.value.slice(v,M)}),Array.isArray(P)?k.push(...P):P&&k.push(P),v=M+R[0].length,E=!0),!g.global)break;R=g.exec(u.value)}return E?(v?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=Zv(t,"(");let s=Zv(t,")");for(;i!==-1&&r>s;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[t,n]}function S$(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Vc(n)||Iw(n))&&(!e||n!==47)}C$.peek=yOe;function uOe(){this.buffer()}function dOe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function hOe(){this.buffer()}function fOe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function pOe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_s(this.sliceSerialize(t)).toLowerCase(),n.label=e}function gOe(t){this.exit(t)}function mOe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_s(this.sliceSerialize(t)).toLowerCase(),n.label=e}function AOe(t){this.exit(t)}function yOe(){return"["}function C$(t,e,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=r.move(n.safe(n.associationId(t),{after:"]",before:s})),a(),o(),s+=r.move("]"),s}function vOe(){return{enter:{gfmFootnoteCallString:uOe,gfmFootnoteCall:dOe,gfmFootnoteDefinitionLabelString:hOe,gfmFootnoteDefinition:fOe},exit:{gfmFootnoteCallString:pOe,gfmFootnoteCall:gOe,gfmFootnoteDefinitionLabelString:mOe,gfmFootnoteDefinition:AOe}}}function bOe(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:C$},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return l+=a.move(s.safe(s.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((e?` -`:" ")+s.indentLines(s.containerFlow(i,a.current()),e?x$:wOe))),u(),l}}function wOe(t,e,n){return e===0?t:x$(t,e,n)}function x$(t,e,n){return(n?"":" ")+t}const SOe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];E$.peek=TOe;function COe(){return{canContainEols:["delete"],enter:{strikethrough:EOe},exit:{strikethrough:_Oe}}}function xOe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:SOe}],handlers:{delete:E$}}}function EOe(t){this.enter({type:"delete",children:[]},t)}function _Oe(t){this.exit(t)}function E$(t,e,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(t,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function TOe(){return"~"}function ROe(t){return t.length}function kOe(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||ROe,s=[],o=[],a=[],l=[];let u=0,d=-1;for(;++du&&(u=t[d].length);++El[E])&&(l[E]=R)}S.push(k)}o[d]=S,a[d]=C}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fl[f]&&(l[f]=k),m[f]=k),g[f]=R}o.splice(1,0,g),a.splice(1,0,m),d=-1;const v=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(t,s.current()),POe);return r(),o}function POe(t,e,n){return">"+(n?"":" ")+t}function NOe(t,e){return C5(t,e.inConstruct,!0)&&!C5(t,e.notInConstruct,!1)}function C5(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+e.length,i=n.indexOf(e,r);return o}function BOe(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function LOe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function UOe(t,e,n,i){const r=LOe(n),s=t.value||"",o=r==="`"?"GraveAccent":"Tilde";if(BOe(t,n)){const f=n.enter("codeIndented"),g=n.indentLines(s,VOe);return f(),g}const a=n.createTracker(i),l=r.repeat(Math.max(OOe(s,r)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(t.lang){const f=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(t.meta,{before:d,after:` -`,encode:["`"],...a.current()})),f()}return d+=a.move(` -`),s&&(d+=a.move(s+` -`)),d+=a.move(l),u(),d}function VOe(t,e,n){return(n?"":" ")+t}function zk(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function FOe(t,e,n,i){const r=zk(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let u=l.move("[");return u+=l.move(n.safe(n.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":` -`,...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+r),u+=l.move(n.safe(t.title,{before:u,after:r,...l.current()})),u+=l.move(r),a()),o(),u}function HOe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Cg(t){return"&#x"+t.toString(16).toUpperCase()+";"}function eb(t,e,n){const i=Zd(t),r=Zd(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_$.peek=zOe;function _$(t,e,n,i){const r=HOe(n),s=n.enter("emphasis"),o=n.createTracker(i),a=o.move(r);let l=o.move(n.containerPhrasing(t,{after:r,before:a,...o.current()}));const u=l.charCodeAt(0),d=eb(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(l=Cg(u)+l.slice(1));const f=l.charCodeAt(l.length-1),g=eb(i.after.charCodeAt(0),f,r);g.inside&&(l=l.slice(0,-1)+Cg(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:d.outside},a+l+m}function zOe(t,e,n){return n.options.emphasis||"*"}function QOe(t,e){let n=!1;return Lk(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,r2}),!!((!t.depth||t.depth<3)&&Ik(t)&&(e.options.setext||n))}function GOe(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(QOe(t,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(t,{...s.current(),before:` +${I.content[0].text}`;for(const X of t)X.status?.type==="incomplete"&&X.status?.error||await NO(a,crypto.randomUUID(),X);await NO(a,crypto.randomUUID(),G),on.createChatName(K).then(async X=>{X&&c(X,{provider:S,model:w})})}r(G);const le=on.sendMessage([G],R);le&&L(le)},handleStream:L,approveToolCall:D,denyToolCall:B}},v8e=({isReady:e})=>{const{initServers:t,getTools:n,tools:o}=Ds(),{currentProvider:r}=gi();return x.useEffect(()=>{if(!e)return;t(),n();const i=setInterval(()=>{n()},1e3*60*5);return()=>{clearInterval(i)}},[e,t,n]),x.useEffect(()=>{const i=()=>{n()};return window.addEventListener("tools-changed",i),()=>{window.removeEventListener("tools-changed",i)}},[n]),x.useEffect(()=>{!o||!r||on.setCurrentProviderTools(o)},[o,r]),{}},S8e=({isReady:e})=>{const{initThreads:t}=GC();return x.useEffect(()=>{e&&t()},[e,t]),{}},gle=x.createContext({});function C8e(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const wB=typeof window<"u",w8e=wB?x.useLayoutEffect:x.useEffect,OB=x.createContext(null);function TB(e,t){e.indexOf(t)===-1&&e.push(t)}function RB(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Fl=(e,t,n)=>n>t?t:n{};const cp={},ble=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function yle(e){return typeof e=="object"&&e!==null}const Ale=e=>/^0[^.\s]+$/u.test(e);function MB(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ki=e=>e,O8e=(e,t)=>n=>t(e(n)),YC=(...e)=>e.reduce(O8e),Q0=(e,t,n)=>{const o=t-e;return o===0?1:(n-e)/o};class PB{constructor(){this.subscriptions=[]}add(t){return TB(this.subscriptions,t),()=>RB(this.subscriptions,t)}notify(t,n,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,o);else for(let i=0;ie*1e3,qi=e=>e/1e3;function _le(e,t){return t?e*(1e3/t):0}const vle=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,T8e=1e-7,R8e=12;function E8e(e,t,n,o,r){let i,s,a=0;do s=t+(n-t)/2,i=vle(s,o,r)-e,i>0?n=s:t=s;while(Math.abs(i)>T8e&&++aE8e(i,0,1,e,n);return i=>i===0||i===1?i:vle(r(i),t,o)}const Sle=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Cle=e=>t=>1-e(1-t),wle=XC(.33,1.53,.69,.99),IB=Cle(wle),Ole=Sle(IB),Tle=e=>(e*=2)<1?.5*IB(e):.5*(2-Math.pow(2,-10*(e-1))),jB=e=>1-Math.sin(Math.acos(e)),Rle=Cle(jB),Ele=Sle(jB),M8e=XC(.42,0,1,1),P8e=XC(0,0,.58,1),Mle=XC(.42,0,.58,1),I8e=e=>Array.isArray(e)&&typeof e[0]!="number",Ple=e=>Array.isArray(e)&&typeof e[0]=="number",j8e={linear:Ki,easeIn:M8e,easeInOut:Mle,easeOut:P8e,circIn:jB,circInOut:Ele,circOut:Rle,backIn:IB,backInOut:Ole,backOut:wle,anticipate:Tle},D8e=e=>typeof e=="string",GQ=e=>{if(Ple(e)){EB(e.length===4);const[t,n,o,r]=e;return XC(t,n,o,r)}else if(D8e(e))return j8e[e];return e},TT=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N8e(e,t){let n=new Set,o=new Set,r=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){s.has(u)&&(p.schedule(u),e()),u(a)}const p={schedule:(u,l=!1,d=!1)=>{const h=d&&r?n:o;return l&&s.add(u),h.has(u)||h.add(u),u},cancel:u=>{o.delete(u),s.delete(u)},process:u=>{if(a=u,r){i=!0;return}r=!0,[n,o]=[o,n],n.forEach(c),n.clear(),r=!1,i&&(i=!1,p.process(u))}};return p}const L8e=40;function Ile(e,t){let n=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=TT.reduce((S,w)=>(S[w]=N8e(i),S),{}),{setup:a,read:c,resolveKeyframes:p,preUpdate:u,update:l,preRender:d,render:f,postRender:h}=s,m=()=>{const S=cp.useManualTiming?r.timestamp:performance.now();n=!1,cp.useManualTiming||(r.delta=o?1e3/60:Math.max(Math.min(S-r.timestamp,L8e),1)),r.timestamp=S,r.isProcessing=!0,a.process(r),c.process(r),p.process(r),u.process(r),l.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(o=!1,e(m))},g=()=>{n=!0,o=!0,r.isProcessing||e(m)};return{schedule:TT.reduce((S,w)=>{const R=s[w];return S[w]=(E,T=!1,D=!1)=>(n||g(),R.schedule(E,T,D)),S},{}),cancel:S=>{for(let w=0;w(MR===void 0&&Ao.set(Ur.isProcessing||cp.useManualTiming?Ur.timestamp:performance.now()),MR),set:e=>{MR=e,queueMicrotask(F8e)}},jle=e=>t=>typeof t=="string"&&t.startsWith(e),Dle=jle("--"),x8e=jle("var(--"),DB=e=>x8e(e)?B8e.test(e.split("/*")[0].trim()):!1,B8e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zQ(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const $A={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$0={...$A,transform:e=>Fl(0,1,e)},RT={...$A,default:1},p0=e=>Math.round(e*1e5)/1e5,NB=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function k8e(e){return e==null}const U8e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,LB=(e,t)=>n=>!!(typeof n=="string"&&U8e.test(n)&&n.startsWith(e)||t&&!k8e(n)&&Object.prototype.hasOwnProperty.call(n,t)),Nle=(e,t,n)=>o=>{if(typeof o!="string")return o;const[r,i,s,a]=o.match(NB);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},q8e=e=>Fl(0,255,e),dN={...$A,transform:e=>Math.round(q8e(e))},jg={test:LB("rgb","red"),parse:Nle("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:o=1})=>"rgba("+dN.transform(e)+", "+dN.transform(t)+", "+dN.transform(n)+", "+p0($0.transform(o))+")"};function J8e(e){let t="",n="",o="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),o=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),o=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,o+=o,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const I1={test:LB("#"),parse:J8e,transform:jg.transform},ZC=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),om=ZC("deg"),jl=ZC("%"),We=ZC("px"),V8e=ZC("vh"),H8e=ZC("vw"),KQ={...jl,parse:e=>jl.parse(e)/100,transform:e=>jl.transform(e*100)},ky={test:LB("hsl","hue"),parse:Nle("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:o=1})=>"hsla("+Math.round(e)+", "+jl.transform(p0(t))+", "+jl.transform(p0(n))+", "+p0($0.transform(o))+")"},er={test:e=>jg.test(e)||I1.test(e)||ky.test(e),parse:e=>jg.test(e)?jg.parse(e):ky.test(e)?ky.parse(e):I1.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?jg.transform(e):ky.transform(e),getAnimatableNone:e=>{const t=er.parse(e);return t.alpha=0,er.transform(t)}},G8e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z8e(e){return isNaN(e)&&typeof e=="string"&&(e.match(NB)?.length||0)+(e.match(G8e)?.length||0)>0}const Lle="number",Fle="color",K8e="var",Q8e="var(",QQ="${}",$8e=/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 W0(e){const t=e.toString(),n=[],o={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace($8e,c=>(er.test(c)?(o.color.push(i),r.push(Fle),n.push(er.parse(c))):c.startsWith(Q8e)?(o.var.push(i),r.push(K8e),n.push(c)):(o.number.push(i),r.push(Lle),n.push(parseFloat(c))),++i,QQ)).split(QQ);return{values:n,split:a,indexes:o,types:r}}function xle(e){return W0(e).values}function Ble(e){const{split:t,types:n}=W0(e),o=t.length;return r=>{let i="";for(let s=0;stypeof e=="number"?0:er.test(e)?er.getAnimatableNone(e):e;function Y8e(e){const t=xle(e);return Ble(e)(t.map(W8e))}const vm={test:z8e,parse:xle,createTransformer:Ble,getAnimatableNone:Y8e};function fN(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function X8e({hue:e,saturation:t,lightness:n,alpha:o}){e/=360,t/=100,n/=100;let r=0,i=0,s=0;if(!t)r=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=fN(c,a,e+1/3),i=fN(c,a,e),s=fN(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:o}}function RE(e,t){return n=>n>0?t:e}const Pn=(e,t,n)=>e+(t-e)*n,hN=(e,t,n)=>{const o=e*e,r=n*(t*t-o)+o;return r<0?0:Math.sqrt(r)},Z8e=[I1,jg,ky],eGe=e=>Z8e.find(t=>t.test(e));function $Q(e){const t=eGe(e);if(!t)return!1;let n=t.parse(e);return t===ky&&(n=X8e(n)),n}const WQ=(e,t)=>{const n=$Q(e),o=$Q(t);if(!n||!o)return RE(e,t);const r={...n};return i=>(r.red=hN(n.red,o.red,i),r.green=hN(n.green,o.green,i),r.blue=hN(n.blue,o.blue,i),r.alpha=Pn(n.alpha,o.alpha,i),jg.transform(r))},j1=new Set(["none","hidden"]);function tGe(e,t){return j1.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nGe(e,t){return n=>Pn(e,t,n)}function FB(e){return typeof e=="number"?nGe:typeof e=="string"?DB(e)?RE:er.test(e)?WQ:iGe:Array.isArray(e)?kle:typeof e=="object"?er.test(e)?WQ:rGe:RE}function kle(e,t){const n=[...e],o=n.length,r=e.map((i,s)=>FB(i)(i,t[s]));return i=>{for(let s=0;s{for(const i in o)n[i]=o[i](r);return n}}function oGe(e,t){const n=[],o={color:0,var:0,number:0};for(let r=0;r{const n=vm.createTransformer(t),o=W0(e),r=W0(t);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?j1.has(e)&&!r.values.length||j1.has(t)&&!o.values.length?tGe(e,t):YC(kle(oGe(o,r),r.values),n):RE(e,t)};function Ule(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Pn(e,t,n):FB(e)(e,t)}const sGe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Sn.update(t,n),stop:()=>_m(t),now:()=>Ur.isProcessing?Ur.timestamp:Ao.now()}},qle=(e,t,n=10)=>{let o="";const r=Math.max(Math.round(t/n),2);for(let i=0;i=EE?1/0:t}function aGe(e,t=100,n){const o=n({...e,keyframes:[0,t]}),r=Math.min(xB(o),EE);return{type:"keyframes",ease:i=>o.next(r*i).value/t,duration:qi(r)}}const lGe=5;function Jle(e,t,n){const o=Math.max(t-lGe,0);return _le(n-e(o),t-o)}const Fn={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},pN=.001;function uGe({duration:e=Fn.duration,bounce:t=Fn.bounce,velocity:n=Fn.velocity,mass:o=Fn.mass}){let r,i,s=1-t;s=Fl(Fn.minDamping,Fn.maxDamping,s),e=Fl(Fn.minDuration,Fn.maxDuration,qi(e)),s<1?(r=p=>{const u=p*s,l=u*e,d=u-n,f=D1(p,s),h=Math.exp(-l);return pN-d/f*h},i=p=>{const l=p*s*e,d=l*n+n,f=Math.pow(s,2)*Math.pow(p,2)*e,h=Math.exp(-l),m=D1(Math.pow(p,2),s);return(-r(p)+pN>0?-1:1)*((d-f)*h)/m}):(r=p=>{const u=Math.exp(-p*e),l=(p-n)*e+1;return-pN+u*l},i=p=>{const u=Math.exp(-p*e),l=(n-p)*(e*e);return u*l});const a=5/e,c=dGe(r,i,a);if(e=ip(e),isNaN(c))return{stiffness:Fn.stiffness,damping:Fn.damping,duration:e};{const p=Math.pow(c,2)*o;return{stiffness:p,damping:s*2*Math.sqrt(o*p),duration:e}}}const cGe=12;function dGe(e,t,n){let o=n;for(let r=1;re[n]!==void 0)}function pGe(e){let t={velocity:Fn.velocity,stiffness:Fn.stiffness,damping:Fn.damping,mass:Fn.mass,isResolvedFromDuration:!1,...e};if(!YQ(e,hGe)&&YQ(e,fGe))if(e.visualDuration){const n=e.visualDuration,o=2*Math.PI/(n*1.2),r=o*o,i=2*Fl(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Fn.mass,stiffness:r,damping:i}}else{const n=uGe(e);t={...t,...n,mass:Fn.mass},t.isResolvedFromDuration=!0}return t}function ME(e=Fn.visualDuration,t=Fn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:o,restDelta:r}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:p,mass:u,duration:l,velocity:d,isResolvedFromDuration:f}=pGe({...n,velocity:-qi(n.velocity||0)}),h=d||0,m=p/(2*Math.sqrt(c*u)),g=s-i,y=qi(Math.sqrt(c/u)),_=Math.abs(g)<5;o||(o=_?Fn.restSpeed.granular:Fn.restSpeed.default),r||(r=_?Fn.restDelta.granular:Fn.restDelta.default);let S;if(m<1){const R=D1(y,m);S=E=>{const T=Math.exp(-m*y*E);return s-T*((h+m*y*g)/R*Math.sin(R*E)+g*Math.cos(R*E))}}else if(m===1)S=R=>s-Math.exp(-y*R)*(g+(h+y*g)*R);else{const R=y*Math.sqrt(m*m-1);S=E=>{const T=Math.exp(-m*y*E),D=Math.min(R*E,300);return s-T*((h+m*y*g)*Math.sinh(D)+R*g*Math.cosh(D))/R}}const w={calculatedDuration:f&&l||null,next:R=>{const E=S(R);if(f)a.done=R>=l;else{let T=R===0?h:0;m<1&&(T=R===0?ip(h):Jle(S,R,E));const D=Math.abs(T)<=o,B=Math.abs(s-E)<=r;a.done=D&&B}return a.value=a.done?s:E,a},toString:()=>{const R=Math.min(xB(w),EE),E=qle(T=>w.next(R*T).value,R,30);return R+"ms "+E},toTransition:()=>{}};return w}ME.applyToOptions=e=>{const t=aGe(e,100,ME);return e.ease=t.ease,e.duration=ip(t.duration),e.type="keyframes",e};function N1({keyframes:e,velocity:t=0,power:n=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:c,restDelta:p=.5,restSpeed:u}){const l=e[0],d={done:!1,value:l},f=D=>a!==void 0&&Dc,h=D=>a===void 0?c:c===void 0||Math.abs(a-D)-m*Math.exp(-D/o),S=D=>y+_(D),w=D=>{const B=_(D),N=S(D);d.done=Math.abs(B)<=p,d.value=d.done?y:N};let R,E;const T=D=>{f(d.value)&&(R=D,E=ME({keyframes:[d.value,h(d.value)],velocity:Jle(S,D,d.value),damping:r,stiffness:i,restDelta:p,restSpeed:u}))};return T(0),{calculatedDuration:null,next:D=>{let B=!1;return!E&&R===void 0&&(B=!0,w(D),T(D)),R!==void 0&&D>=R?E.next(D-R):(!B&&w(D),d)}}}function mGe(e,t,n){const o=[],r=n||cp.mix||Ule,i=e.length-1;for(let s=0;st[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=mGe(t,o,r),c=a.length,p=u=>{if(s&&u1)for(;lp(Fl(e[0],e[i-1],u)):p}function bGe(e,t){const n=e[e.length-1];for(let o=1;o<=t;o++){const r=Q0(0,t,o);e.push(Pn(n,1,r))}}function yGe(e){const t=[0];return bGe(t,e.length-1),t}function AGe(e,t){return e.map(n=>n*t)}function _Ge(e,t){return e.map(()=>t||Mle).splice(0,e.length-1)}function m0({duration:e=300,keyframes:t,times:n,ease:o="easeInOut"}){const r=I8e(o)?o.map(GQ):GQ(o),i={done:!1,value:t[0]},s=AGe(n&&n.length===t.length?n:yGe(t),e),a=gGe(s,t,{ease:Array.isArray(r)?r:_Ge(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const vGe=e=>e!==null;function BB(e,{repeat:t,repeatType:n="loop"},o,r=1){const i=e.filter(vGe),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||o===void 0?i[a]:o}const SGe={decay:N1,inertia:N1,tween:m0,keyframes:m0,spring:ME};function Vle(e){typeof e.type=="string"&&(e.type=SGe[e.type])}class kB{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const CGe=e=>e/100;class UB extends kB{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:n}=this.options;n&&n.updatedAt!==Ao.now()&&this.tick(Ao.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;Vle(t);const{type:n=m0,repeat:o=0,repeatDelay:r=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const c=n||m0;c!==m0&&typeof a[0]!="number"&&(this.mixKeyframes=YC(CGe,Ule(a[0],a[1])),a=[0,100]);const p=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-s})),p.calculatedDuration===null&&(p.calculatedDuration=xB(p));const{calculatedDuration:u}=p;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(o+1)-r,this.generator=p}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:o,totalDuration:r,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:u,repeat:l,repeatType:d,repeatDelay:f,type:h,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-p*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let S=this.currentTime,w=o;if(l){const D=Math.min(this.currentTime,r)/a;let B=Math.floor(D),N=D%1;!N&&D>=1&&(N=1),N===1&&B--,B=Math.min(B,l+1),B%2&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(w=s)),S=Fl(0,1,N)*a}const R=_?{done:!1,value:u[0]}:w.next(S);i&&(R.value=i(R.value));let{done:E}=R;!_&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return T&&h!==N1&&(R.value=BB(u,this.options,g,this.speed)),m&&m(R.value),T&&this.finish(),R}then(t,n){return this.finished.then(t,n)}get duration(){return qi(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qi(t)}get time(){return qi(this.currentTime)}set time(t){t=ip(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(Ao.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=qi(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=sGe,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=n??o),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(Ao.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 wGe(e){for(let t=1;te*180/Math.PI,L1=e=>{const t=Dg(Math.atan2(e[1],e[0]));return F1(t)},OGe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:L1,rotateZ:L1,skewX:e=>Dg(Math.atan(e[1])),skewY:e=>Dg(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},F1=e=>(e=e%360,e<0&&(e+=360),e),XQ=L1,ZQ=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),e$=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),TGe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ZQ,scaleY:e$,scale:e=>(ZQ(e)+e$(e))/2,rotateX:e=>F1(Dg(Math.atan2(e[6],e[5]))),rotateY:e=>F1(Dg(Math.atan2(-e[2],e[0]))),rotateZ:XQ,rotate:XQ,skewX:e=>Dg(Math.atan(e[4])),skewY:e=>Dg(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function x1(e){return e.includes("scale")?1:0}function B1(e,t){if(!e||e==="none")return x1(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,r;if(n)o=TGe,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=OGe,r=a}if(!r)return x1(t);const i=o[t],s=r[1].split(",").map(EGe);return typeof i=="function"?i(s):s[i]}const RGe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return B1(n,t)};function EGe(e){return parseFloat(e.trim())}const WA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],YA=new Set(WA),t$=e=>e===$A||e===We,MGe=new Set(["x","y","z"]),PGe=WA.filter(e=>!MGe.has(e));function IGe(e){const t=[];return PGe.forEach(n=>{const o=e.getValue(n);o!==void 0&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),t}const cm={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),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})=>B1(t,"x"),y:(e,{transform:t})=>B1(t,"y")};cm.translateX=cm.x;cm.translateY=cm.y;const kg=new Set;let k1=!1,U1=!1,q1=!1;function Hle(){if(U1){const e=Array.from(kg).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),n=new Map;t.forEach(o=>{const r=IGe(o);r.length&&(n.set(o,r),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const r=n.get(o);r&&r.forEach(([i,s])=>{o.getValue(i)?.set(s)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}U1=!1,k1=!1,kg.forEach(e=>e.complete(q1)),kg.clear()}function Gle(){kg.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(U1=!0)})}function jGe(){q1=!0,Gle(),Hle(),q1=!1}class qB{constructor(t,n,o,r,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=o,this.motionValue=r,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(kg.add(this),k1||(k1=!0,Sn.read(Gle),Sn.resolveKeyframes(Hle))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:o,motionValue:r}=this;if(t[0]===null){const i=r?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(o&&n){const a=o.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),r&&i===void 0&&r.set(t[0])}wGe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),kg.delete(this)}cancel(){this.state==="scheduled"&&(kg.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const DGe=e=>e.startsWith("--");function NGe(e,t,n){DGe(t)?e.style.setProperty(t,n):e.style[t]=n}const LGe=MB(()=>window.ScrollTimeline!==void 0),FGe={};function xGe(e,t){const n=MB(e);return()=>FGe[t]??n()}const zle=xGe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),e0=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`,n$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:e0([0,.65,.55,1]),circOut:e0([.55,0,1,.45]),backIn:e0([.31,.01,.66,-.59]),backOut:e0([.33,1.53,.69,.99])};function Kle(e,t){if(e)return typeof e=="function"?zle()?qle(e,t):"ease-out":Ple(e)?e0(e):Array.isArray(e)?e.map(n=>Kle(n,t)||n$.easeOut):n$[e]}function BGe(e,t,n,{delay:o=0,duration:r=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:c}={},p=void 0){const u={[t]:n};c&&(u.offset=c);const l=Kle(a,r);Array.isArray(l)&&(u.easing=l);const d={delay:o,duration:r,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return p&&(d.pseudoElement=p),e.animate(u,d)}function Qle(e){return typeof e=="function"&&"applyToOptions"in e}function kGe({type:e,...t}){return Qle(e)&&zle()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class UGe extends kB{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:o,keyframes:r,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,EB(typeof t.type!="string");const p=kGe(t);this.animation=BGe(n,o,r,p,i),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=BB(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):NGe(n,o,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 qi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qi(t)}get time(){return qi(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ip(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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&LGe()?(this.animation.timeline=t,Ki):n(this)}}const $le={anticipate:Tle,backInOut:Ole,circInOut:Ele};function qGe(e){return e in $le}function JGe(e){typeof e.ease=="string"&&qGe(e.ease)&&(e.ease=$le[e.ease])}const mN=10;class VGe extends UGe{constructor(t){JGe(t),Vle(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:o,onComplete:r,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new UB({...s,autoplay:!1}),c=Math.max(mN,Ao.now()-this.startTime),p=Fl(0,mN,c-mN);n.setWithVelocity(a.sample(Math.max(0,c-p)).value,a.sample(c).value,p),a.stop()}}const r$=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vm.test(e)||e==="0")&&!e.startsWith("url("));function HGe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function QGe(e){const{motionValue:t,name:n,repeatDelay:o,repeatType:r,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:p}=t.owner.getProps();return KGe()&&n&&zGe.has(n)&&(n!=="transform"||!p)&&!c&&!o&&r!=="mirror"&&i!==0&&s!=="inertia"}const $Ge=40;class WGe extends kB{constructor({autoplay:t=!0,delay:n=0,type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:c,motionValue:p,element:u,...l}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ao.now();const d={autoplay:t,delay:n,type:o,repeat:r,repeatDelay:i,repeatType:s,name:c,motionValue:p,element:u,...l},f=u?.KeyframeResolver||qB;this.keyframeResolver=new f(a,(h,m,g)=>this.onKeyframesResolved(h,m,d,!g),c,p,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,o,r){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:c,isHandoff:p,onUpdate:u}=o;this.resolvedAt=Ao.now(),GGe(t,i,s,a)||((cp.instantAnimations||!c)&&u?.(BB(t,o,n)),t[0]=t[t.length-1],J1(o),o.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>$Ge?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...o,keyframes:t},f=!p&&QGe(d)?new VGe({...d,element:d.motionValue.owner.current}):new UB(d);f.finished.then(()=>this.notifyFinished()).catch(Ki),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),jGe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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 YGe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XGe(e){const t=YGe.exec(e);if(!t)return[,];const[,n,o,r]=t;return[`--${n??o}`,r]}function Wle(e,t,n=1){const[o,r]=XGe(e);if(!o)return;const i=window.getComputedStyle(t).getPropertyValue(o);if(i){const s=i.trim();return ble(s)?parseFloat(s):s}return DB(r)?Wle(r,t,n+1):r}function JB(e,t){return e?.[t]??e?.default??e}const Yle=new Set(["width","height","top","left","right","bottom",...WA]),ZGe={test:e=>e==="auto",parse:e=>e},Xle=e=>t=>t.test(e),Zle=[$A,We,jl,om,H8e,V8e,ZGe],o$=e=>Zle.find(Xle(e));function eze(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ale(e):!0}const tze=new Set(["brightness","contrast","saturate","opacity"]);function nze(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[o]=n.match(NB)||[];if(!o)return e;const r=n.replace(o,"");let i=tze.has(t)?1:0;return o!==n&&(i*=100),t+"("+i+r+")"}const rze=/\b([a-z-]*)\(.*?\)/gu,V1={...vm,getAnimatableNone:e=>{const t=e.match(rze);return t?t.map(nze).join(" "):e}},i$={...$A,transform:Math.round},oze={rotate:om,rotateX:om,rotateY:om,rotateZ:om,scale:RT,scaleX:RT,scaleY:RT,scaleZ:RT,skew:om,skewX:om,skewY:om,distance:We,translateX:We,translateY:We,translateZ:We,x:We,y:We,z:We,perspective:We,transformPerspective:We,opacity:$0,originX:KQ,originY:KQ,originZ:We},VB={borderWidth:We,borderTopWidth:We,borderRightWidth:We,borderBottomWidth:We,borderLeftWidth:We,borderRadius:We,radius:We,borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomRightRadius:We,borderBottomLeftRadius:We,width:We,maxWidth:We,height:We,maxHeight:We,top:We,right:We,bottom:We,left:We,inset:We,insetBlock:We,insetBlockStart:We,insetBlockEnd:We,insetInline:We,insetInlineStart:We,insetInlineEnd:We,padding:We,paddingTop:We,paddingRight:We,paddingBottom:We,paddingLeft:We,paddingBlock:We,paddingBlockStart:We,paddingBlockEnd:We,paddingInline:We,paddingInlineStart:We,paddingInlineEnd:We,margin:We,marginTop:We,marginRight:We,marginBottom:We,marginLeft:We,marginBlock:We,marginBlockStart:We,marginBlockEnd:We,marginInline:We,marginInlineStart:We,marginInlineEnd:We,backgroundPositionX:We,backgroundPositionY:We,...oze,zIndex:i$,fillOpacity:$0,strokeOpacity:$0,numOctaves:i$},ize={...VB,color:er,backgroundColor:er,outlineColor:er,fill:er,stroke:er,borderColor:er,borderTopColor:er,borderRightColor:er,borderBottomColor:er,borderLeftColor:er,filter:V1,WebkitFilter:V1},eue=e=>ize[e];function tue(e,t){let n=eue(e);return n!==V1&&(n=vm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sze=new Set(["auto","none","0"]);function aze(e,t,n){let o=0,r;for(;o{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function uze(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const r=n?.[e]??o.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const nue=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function cze(e){return yle(e)&&"offsetHeight"in e}const s$=30,dze=e=>!isNaN(parseFloat(e));class fze{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const r=Ao.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ao.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=dze(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new PB);const o=this.events[t].add(n);return t==="change"?()=>{o(),Sn.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,o){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&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=Ao.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>s$)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,s$);return _le(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 yA(e,t){return new fze(e,t)}const{schedule:HB}=Ile(queueMicrotask,!1),fs={x:!1,y:!1};function rue(){return fs.x||fs.y}function hze(e){return e==="x"||e==="y"?fs[e]?null:(fs[e]=!0,()=>{fs[e]=!1}):fs.x||fs.y?null:(fs.x=fs.y=!0,()=>{fs.x=fs.y=!1})}function oue(e,t){const n=uze(e),o=new AbortController,r={passive:!0,...t,signal:o.signal};return[n,r,()=>o.abort()]}function a$(e){return!(e.pointerType==="touch"||rue())}function pze(e,t,n={}){const[o,r,i]=oue(e,n),s=a=>{if(!a$(a))return;const{target:c}=a,p=t(c,a);if(typeof p!="function"||!c)return;const u=l=>{a$(l)&&(p(l),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,r)};return o.forEach(a=>{a.addEventListener("pointerenter",s,r)}),i}const iue=(e,t)=>t?e===t?!0:iue(e,t.parentElement):!1,GB=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,mze=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sue(e){return mze.has(e.tagName)||e.isContentEditable===!0}const PR=new WeakSet;function l$(e){return t=>{t.key==="Enter"&&e(t)}}function gN(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const gze=(e,t)=>{const n=e.currentTarget;if(!n)return;const o=l$(()=>{if(PR.has(n))return;gN(n,"down");const r=l$(()=>{gN(n,"up")}),i=()=>gN(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",o,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",o),t)};function u$(e){return GB(e)&&!rue()}function bze(e,t,n={}){const[o,r,i]=oue(e,n),s=a=>{const c=a.currentTarget;if(!u$(a))return;PR.add(c);const p=t(c,a),u=(f,h)=>{window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",d),PR.has(c)&&PR.delete(c),u$(f)&&typeof p=="function"&&p(f,{success:h})},l=f=>{u(f,c===window||c===document||n.useGlobalTarget||iue(c,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",d,r)};return o.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),cze(a)&&(a.addEventListener("focus",p=>gze(p,r)),!sue(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function aue(e){return yle(e)&&"ownerSVGElement"in e}function yze(e){return aue(e)&&e.tagName==="svg"}const no=e=>!!(e&&e.getVelocity),Aze=[...Zle,er,vm],_ze=e=>Aze.find(Xle(e)),lue=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function vze(e=!0){const t=x.useContext(OB);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=x.useId();x.useEffect(()=>{if(e)return r(i)},[e]);const s=x.useCallback(()=>e&&o&&o(i),[i,o,e]);return!n&&o?[!1,s]:[!0]}const uue=x.createContext({strict:!1}),c$={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},AA={};for(const e in c$)AA[e]={isEnabled:t=>c$[e].some(n=>!!t[n])};function Sze(e){for(const t in e)AA[t]={...AA[t],...e[t]}}const Cze=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function PE(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Cze.has(e)}let cue=e=>!PE(e);function wze(e){typeof e=="function"&&(cue=t=>t.startsWith("on")?!PE(t):e(t))}try{wze(require("@emotion/is-prop-valid").default)}catch{}function Oze(e,t,n){const o={};for(const r in e)r==="values"&&typeof e.values=="object"||(cue(r)||n===!0&&PE(r)||!t&&!PE(r)||e.draggable&&r.startsWith("onDrag"))&&(o[r]=e[r]);return o}const wP=x.createContext({});function OP(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Y0(e){return typeof e=="string"||Array.isArray(e)}const zB=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],KB=["initial",...zB];function TP(e){return OP(e.animate)||KB.some(t=>Y0(e[t]))}function due(e){return!!(TP(e)||e.variants)}function Tze(e,t){if(TP(e)){const{initial:n,animate:o}=e;return{initial:n===!1||Y0(n)?n:void 0,animate:Y0(o)?o:void 0}}return e.inherit!==!1?t:{}}function Rze(e){const{initial:t,animate:n}=Tze(e,x.useContext(wP));return x.useMemo(()=>({initial:t,animate:n}),[d$(t),d$(n)])}function d$(e){return Array.isArray(e)?e.join(" "):e}function f$(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const OS={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(We.test(e))e=parseFloat(e);else return e;const n=f$(e,t.target.x),o=f$(e,t.target.y);return`${n}% ${o}%`}},Eze={correct:(e,{treeScale:t,projectionDelta:n})=>{const o=e,r=vm.parse(e);if(r.length>5)return o;const i=vm.createTransformer(e),s=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+s]/=a,r[1+s]/=c;const p=Pn(a,c,.5);return typeof r[2+s]=="number"&&(r[2+s]/=p),typeof r[3+s]=="number"&&(r[3+s]/=p),i(r)}},H1={borderRadius:{...OS,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:OS,borderTopRightRadius:OS,borderBottomLeftRadius:OS,borderBottomRightRadius:OS,boxShadow:Eze};function fue(e,{layout:t,layoutId:n}){return YA.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!H1[e]||e==="opacity")}const Mze={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pze=WA.length;function Ize(e,t,n){let o="",r=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}});function hue(e,t,n){for(const o in t)!no(t[o])&&!fue(o,n)&&(e[o]=t[o])}function jze({transformTemplate:e},t){return x.useMemo(()=>{const n=$B();return QB(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Dze(e,t){const n=e.style||{},o={};return hue(o,n,e),Object.assign(o,jze(e,t)),o}function Nze(e,t){const n={},o=Dze(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=o,n}const Lze={offset:"stroke-dashoffset",array:"stroke-dasharray"},Fze={offset:"strokeDashoffset",array:"strokeDasharray"};function xze(e,t,n=1,o=0,r=!0){e.pathLength=1;const i=r?Lze:Fze;e[i.offset]=We.transform(-o);const s=We.transform(t),a=We.transform(n);e[i.array]=`${s} ${a}`}const Bze=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pue(e,{attrX:t,attrY:n,attrScale:o,pathLength:r,pathSpacing:i=1,pathOffset:s=0,...a},c,p,u){if(QB(e,a,p),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:l,style:d}=e;l.transform&&(d.transform=l.transform,delete l.transform),(d.transform||l.transformOrigin)&&(d.transformOrigin=l.transformOrigin??"50% 50%",delete l.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete l.transformBox);for(const f of Bze)l[f]!==void 0&&(d[f]=l[f],delete l[f]);t!==void 0&&(l.x=t),n!==void 0&&(l.y=n),o!==void 0&&(l.scale=o),r!==void 0&&xze(l,r,i,s,!1)}const mue=()=>({...$B(),attrs:{}}),gue=e=>typeof e=="string"&&e.toLowerCase()==="svg";function kze(e,t,n,o){const r=x.useMemo(()=>{const i=mue();return pue(i,t,gue(o),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};hue(i,e.style,e),r.style={...i,...r.style}}return r}const Uze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function WB(e){return typeof e!="string"||e.includes("-")?!1:!!(Uze.indexOf(e)>-1||/[A-Z]/u.test(e))}function qze(e,t,n,{latestValues:o},r,i=!1,s){const c=(s??WB(e)?kze:Nze)(t,o,r,e),p=Oze(t,typeof e=="string",i),u=e!==x.Fragment?{...p,...c,ref:n}:{},{children:l}=t,d=x.useMemo(()=>no(l)?l.get():l,[l]);return x.createElement(e,{...u,children:d})}function h$(e){const t=[{},{}];return e?.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function YB(e,t,n,o){if(typeof t=="function"){const[r,i]=h$(o);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=h$(o);t=t(n!==void 0?n:e.custom,r,i)}return t}function IR(e){return no(e)?e.get():e}function Jze({scrapeMotionValuesFromProps:e,createRenderState:t},n,o,r){return{latestValues:Vze(n,o,r,e),renderState:t()}}function Vze(e,t,n,o){const r={},i=o(e,{});for(const d in i)r[d]=IR(i[d]);let{initial:s,animate:a}=e;const c=TP(e),p=due(e);t&&p&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const l=u?a:s;if(l&&typeof l!="boolean"&&!OP(l)){const d=Array.isArray(l)?l:[l];for(let f=0;f(t,n)=>{const o=x.useContext(wP),r=x.useContext(OB),i=()=>Jze(e,t,o,r);return n?i():C8e(i)};function XB(e,t,n){const{style:o}=e,r={};for(const i in o)(no(o[i])||t.style&&no(t.style[i])||fue(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(r[i]=o[i]);return r}const Hze=bue({scrapeMotionValuesFromProps:XB,createRenderState:$B});function yue(e,t,n){const o=XB(e,t,n);for(const r in e)if(no(e[r])||no(t[r])){const i=WA.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[i]=e[r]}return o}const Gze=bue({scrapeMotionValuesFromProps:yue,createRenderState:mue}),zze=Symbol.for("motionComponentSymbol");function Kze(e,t,n){const o=x.useRef(n);x.useInsertionEffect(()=>{o.current=n});const r=x.useRef(null);return x.useCallback(i=>{i&&e.onMount?.(i),t&&(i?t.mount(i):t.unmount());const s=o.current;if(typeof s=="function")if(i){const a=s(i);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):s(i);else s&&(s.current=i)},[t])}const ZB=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qze="framerAppearId",Aue="data-"+ZB(Qze),_ue=x.createContext({});function t0(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $ze(e,t,n,o,r,i){const{visualElement:s}=x.useContext(wP),a=x.useContext(uue),c=x.useContext(OB),p=x.useContext(lue).reducedMotion,u=x.useRef(null);o=o||a.renderer,!u.current&&o&&(u.current=o(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:p,isSVG:i}));const l=u.current,d=x.useContext(_ue);l&&!l.projection&&r&&(l.type==="html"||l.type==="svg")&&Wze(u.current,n,r,d);const f=x.useRef(!1);x.useInsertionEffect(()=>{l&&f.current&&l.update(n,c)});const h=n[Aue],m=x.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return w8e(()=>{l&&(f.current=!0,window.MotionIsMounted=!0,l.updateFeatures(),l.scheduleRenderMicrotask(),m.current&&l.animationState&&l.animationState.animateChanges())}),x.useEffect(()=>{l&&(!m.current&&l.animationState&&l.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),m.current=!1),l.enteringChildren=void 0)}),l}function Wze(e,t,n,o){const{layoutId:r,layout:i,drag:s,dragConstraints:a,layoutScroll:c,layoutRoot:p,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:vue(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!s||a&&t0(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:o,crossfade:u,layoutScroll:c,layoutRoot:p})}function vue(e){if(e)return e.options.allowProjection!==!1?e.projection:vue(e.parent)}function bN(e,{forwardMotionProps:t=!1,type:n}={},o,r){o&&Sze(o);const i=n?n==="svg":WB(e),s=i?Gze:Hze;function a(p,u){let l;const d={...x.useContext(lue),...p,layoutId:Yze(p)},{isStatic:f}=d,h=Rze(p),m=s(p,f);if(!f&&wB){Xze();const g=Zze(d);l=g.MeasureLayout,h.visualElement=$ze(e,m,d,r,g.ProjectionNode,i)}return F.jsxs(wP.Provider,{value:h,children:[l&&h.visualElement?F.jsx(l,{visualElement:h.visualElement,...d}):null,qze(e,p,Kze(m,h.visualElement,u),m,f,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=x.forwardRef(a);return c[zze]=e,c}function Yze({layoutId:e}){const t=x.useContext(gle).id;return t&&e!==void 0?t+"-"+e:e}function Xze(e,t){x.useContext(uue).strict}function Zze(e){const{drag:t,layout:n}=AA;if(!t&&!n)return{};const o={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function e9e(e,t){if(typeof Proxy>"u")return bN;const n=new Map,o=(i,s)=>bN(i,s,e,t),r=(i,s)=>o(i,s);return new Proxy(r,{get:(i,s)=>s==="create"?o:(n.has(s)||n.set(s,bN(s,void 0,e,t)),n.get(s))})}function Sue({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function t9e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function n9e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}function yN(e){return e===void 0||e===1}function G1({scale:e,scaleX:t,scaleY:n}){return!yN(e)||!yN(t)||!yN(n)}function Sg(e){return G1(e)||Cue(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cue(e){return p$(e.x)||p$(e.y)}function p$(e){return e&&e!=="0%"}function IE(e,t,n){const o=e-n,r=t*o;return n+r}function m$(e,t,n,o,r){return r!==void 0&&(e=IE(e,r,o)),IE(e,n,o)+t}function z1(e,t=0,n=1,o,r){e.min=m$(e.min,t,n,o,r),e.max=m$(e.max,t,n,o,r)}function wue(e,{x:t,y:n}){z1(e.x,t.translate,t.scale,t.originPoint),z1(e.y,n.translate,n.scale,n.originPoint)}const g$=.999999999999,b$=1.0000000000001;function r9e(e,t,n,o=!1){const r=n.length;if(!r)return;t.x=t.y=1;let i,s;for(let a=0;ag$&&(t.x=1),t.yg$&&(t.y=1)}function Uy(e,t){e.min=e.min+t,e.max=e.max+t}function y$(e,t,n,o,r=.5){const i=Pn(e.min,e.max,r);z1(e,t,n,i,o)}function qy(e,t){y$(e.x,t.x,t.scaleX,t.scale,t.originX),y$(e.y,t.y,t.scaleY,t.scale,t.originY)}function Oue(e,t){return Sue(n9e(e.getBoundingClientRect(),t))}function o9e(e,t,n){const o=Oue(e,n),{scroll:r}=t;return r&&(Uy(o.x,r.offset.x),Uy(o.y,r.offset.y)),o}const A$=()=>({translate:0,scale:1,origin:0,originPoint:0}),Jy=()=>({x:A$(),y:A$()}),_$=()=>({min:0,max:0}),pr=()=>({x:_$(),y:_$()}),K1={current:null},Tue={current:!1};function i9e(){if(Tue.current=!0,!!wB)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>K1.current=e.matches;e.addEventListener("change",t),t()}else K1.current=!1}const s9e=new WeakMap;function a9e(e,t,n){for(const o in t){const r=t[o],i=n[o];if(no(r))e.addValue(o,r);else if(no(i))e.addValue(o,yA(r,{owner:e}));else if(i!==r)if(e.hasValue(o)){const s=e.getValue(o);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=e.getStaticValue(o);e.addValue(o,yA(s!==void 0?s:r,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const v$=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class l9e{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Ao.now();this.renderScheduledAtthis.bindToMotionValue(o,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Tue.current||i9e(),this.shouldReduceMotion=K1.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_m(this.notifyUpdate),_m(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const o=YA.has(t);o&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Sn.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in AA){const n=AA[t];if(!n)continue;const{isEnabled:o,Feature:r}=n;if(!this.features[t]&&r&&o(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let o=0;on.variantChildren.delete(t)}addValue(t,n){const o=this.values.get(t);n!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&n!==void 0&&(o=yA(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(ble(o)||Ale(o))?o=parseFloat(o):!_ze(o)&&vm.test(n)&&(o=tue(t,n)),this.setBaseTarget(t,no(o)?o.get():o)),no(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const i=YB(this.props,n,this.presenceContext?.custom);i&&(o=i[t])}if(n&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!no(r)?r:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new PB),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){HB.render(this.render)}}class Rue extends l9e{constructor(){super(...arguments),this.KeyframeResolver=lze}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:o}){delete n[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;no(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Eue(e,{style:t,vars:n},o,r){const i=e.style;let s;for(s in t)i[s]=t[s];r?.applyProjectionStyles(i,o);for(s in n)i.setProperty(s,n[s])}function u9e(e){return window.getComputedStyle(e)}class c9e extends Rue{constructor(){super(...arguments),this.type="html",this.renderInstance=Eue}readValueFromInstance(t,n){if(YA.has(n))return this.projection?.isProjecting?x1(n):RGe(t,n);{const o=u9e(t),r=(Dle(n)?o.getPropertyValue(n):o[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Oue(t,n)}build(t,n,o){QB(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return XB(t,n,o)}}const Mue=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function d9e(e,t,n,o){Eue(e,t,void 0,o);for(const r in t.attrs)e.setAttribute(Mue.has(r)?r:ZB(r),t.attrs[r])}class f9e extends Rue{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pr}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(YA.has(n)){const o=eue(n);return o&&o.default||0}return n=Mue.has(n)?n:ZB(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return yue(t,n,o)}build(t,n,o){pue(t,n,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,n,o,r){d9e(t,n,o,r)}mount(t){this.isSVGTag=gue(t.tagName),super.mount(t)}}const h9e=(e,t)=>t.isSVG??WB(e)?new f9e(t):new c9e(t,{allowProjection:e!==x.Fragment});function eA(e,t,n){const o=e.getProps();return YB(o,t,n!==void 0?n:o.custom,e)}const Q1=e=>Array.isArray(e);function p9e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,yA(n))}function m9e(e){return Q1(e)?e[e.length-1]||0:e}function g9e(e,t){const n=eA(e,t);let{transitionEnd:o={},transition:r={},...i}=n||{};i={...i,...o};for(const s in i){const a=m9e(i[s]);p9e(e,s,a)}}function b9e(e){return!!(no(e)&&e.add)}function $1(e,t){const n=e.getValue("willChange");if(b9e(n))return n.add(t);if(!n&&cp.WillChange){const o=new cp.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function Pue(e){return e.props[Aue]}const y9e=e=>e!==null;function A9e(e,{repeat:t,repeatType:n="loop"},o){const r=e.filter(y9e),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}const _9e={type:"spring",stiffness:500,damping:25,restSpeed:10},v9e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),S9e={type:"keyframes",duration:.8},C9e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w9e=(e,{keyframes:t})=>t.length>2?S9e:YA.has(e)?e.startsWith("scale")?v9e(t[1]):_9e:C9e;function O9e({when:e,delay:t,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:s,repeatDelay:a,from:c,elapsed:p,...u}){return!!Object.keys(u).length}const ek=(e,t,n,o={},r,i)=>s=>{const a=JB(o,e)||{},c=a.delay||o.delay||0;let{elapsed:p=0}=o;p=p-ip(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-p,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};O9e(a)||Object.assign(u,w9e(e,u)),u.duration&&(u.duration=ip(u.duration)),u.repeatDelay&&(u.repeatDelay=ip(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let l=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(J1(u),u.delay===0&&(l=!0)),(cp.instantAnimations||cp.skipAnimations)&&(l=!0,J1(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,l&&!i&&t.get()!==void 0){const d=A9e(u.keyframes,a);if(d!==void 0){Sn.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new UB(u):new WGe(u)};function T9e({protectedKeys:e,needsAnimating:t},n){const o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function Iue(e,t,{delay:n=0,transitionOverride:o,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;o&&(i=o);const c=[],p=r&&e.animationState&&e.animationState.getState()[r];for(const u in a){const l=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||p&&T9e(p,u))continue;const f={delay:n,...JB(i||{},u)},h=l.get();if(h!==void 0&&!l.isAnimating&&!Array.isArray(d)&&d===h&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Pue(e);if(y){const _=window.MotionHandoffAnimation(y,u,Sn);_!==null&&(f.startTime=_,m=!0)}}$1(e,u),l.start(ek(u,l,d,e.shouldReduceMotion&&Yle.has(u)?{type:!1}:f,e,m));const g=l.animation;g&&c.push(g)}return s&&Promise.all(c).then(()=>{Sn.update(()=>{s&&g9e(e,s)})}),c}function jue(e,t,n,o=0,r=1){const i=Array.from(e).sort((p,u)=>p.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*o;return typeof n=="function"?n(i,s):r===1?i*o:a-i*o}function W1(e,t,n={}){const o=eA(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(r=n.transitionOverride);const i=o?()=>Promise.all(Iue(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:p=0,staggerChildren:u,staggerDirection:l}=r;return R9e(e,t,c,p,u,l,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[c,p]=a==="beforeChildren"?[i,s]:[s,i];return c().then(()=>p())}else return Promise.all([i(),s(n.delay)])}function R9e(e,t,n=0,o=0,r=0,i=1,s){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(W1(c,t,{...s,delay:n+(typeof o=="function"?0:o)+jue(e.variantChildren,c,o,r,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function E9e(e,t,n={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const r=t.map(i=>W1(e,i,n));o=Promise.all(r)}else if(typeof t=="string")o=W1(e,t,n);else{const r=typeof t=="function"?eA(e,t,n.custom):t;o=Promise.all(Iue(e,r,n))}return o.then(()=>{e.notify("AnimationComplete",t)})}function Due(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let o=0;oPromise.all(t.map(({animation:n,options:o})=>E9e(e,n,o)))}function D9e(e){let t=j9e(e),n=S$(),o=!0;const r=c=>(p,u)=>{const l=eA(e,u,c==="exit"?e.presenceContext?.custom:void 0);if(l){const{transition:d,transitionEnd:f,...h}=l;p={...p,...h,...f}}return p};function i(c){t=c(e)}function s(c){const{props:p}=e,u=Nue(e.parent)||{},l=[],d=new Set;let f={},h=1/0;for(let g=0;gh&&w,B=!1;const N=Array.isArray(S)?S:[S];let L=N.reduce(r(y),{});R===!1&&(L={});const{prevResolvedValues:q={}}=_,I={...q,...L},U=G=>{D=!0,d.has(G)&&(B=!0,d.delete(G)),_.needsAnimating[G]=!0;const Q=e.getValue(G);Q&&(Q.liveStyle=!1)};for(const G in I){const Q=L[G],le=q[G];if(f.hasOwnProperty(G))continue;let K=!1;Q1(Q)&&Q1(le)?K=!Due(Q,le):K=Q!==le,K?Q!=null?U(G):d.add(G):Q!==void 0&&d.has(G)?U(G):_.protectedKeys[G]=!0}_.prevProp=S,_.prevResolvedValues=L,_.isActive&&(f={...f,...L}),o&&e.blockInitialAnimation&&(D=!1);const J=E&&T;D&&(!J||B)&&l.push(...N.map(G=>{const Q={type:y};if(typeof G=="string"&&o&&!J&&e.manuallyAnimateOnMount&&e.parent){const{parent:le}=e,K=eA(le,G);if(le.enteringChildren&&K){const{delayChildren:X}=K.transition||{};Q.delay=jue(le.enteringChildren,e,X)}}return{animation:G,options:Q}}))}if(d.size){const g={};if(typeof p.initial!="boolean"){const y=eA(e,Array.isArray(p.initial)?p.initial[0]:p.initial);y&&y.transition&&(g.transition=y.transition)}d.forEach(y=>{const _=e.getBaseTarget(y),S=e.getValue(y);S&&(S.liveStyle=!0),g[y]=_??null}),l.push({animation:g})}let m=!!l.length;return o&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(m=!1),o=!1,m?t(l):Promise.resolve()}function a(c,p){if(n[c].isActive===p)return Promise.resolve();e.variantChildren?.forEach(l=>l.animationState?.setActive(c,p)),n[c].isActive=p;const u=s(c);for(const l in n)n[l].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=S$()}}}function N9e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Due(t,e):!1}function gg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function S$(){return{animate:gg(!0),whileInView:gg(),whileHover:gg(),whileTap:gg(),whileDrag:gg(),whileFocus:gg(),exit:gg()}}class Lm{constructor(t){this.isMounted=!1,this.node=t}update(){}}class L9e extends Lm{constructor(t){super(t),t.animationState||(t.animationState=D9e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();OP(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let F9e=0;class x9e extends Lm{constructor(){super(...arguments),this.id=F9e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const B9e={animation:{Feature:L9e},exit:{Feature:x9e}};function X0(e,t,n,o={passive:!0}){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n)}function ew(e){return{point:{x:e.pageX,y:e.pageY}}}const k9e=e=>t=>GB(t)&&e(t,ew(t));function g0(e,t,n,o){return X0(e,t,k9e(n),o)}const Lue=1e-4,U9e=1-Lue,q9e=1+Lue,Fue=.01,J9e=0-Fue,V9e=0+Fue;function _o(e){return e.max-e.min}function H9e(e,t,n){return Math.abs(e-t)<=n}function C$(e,t,n,o=.5){e.origin=o,e.originPoint=Pn(t.min,t.max,e.origin),e.scale=_o(n)/_o(t),e.translate=Pn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=U9e&&e.scale<=q9e||isNaN(e.scale))&&(e.scale=1),(e.translate>=J9e&&e.translate<=V9e||isNaN(e.translate))&&(e.translate=0)}function b0(e,t,n,o){C$(e.x,t.x,n.x,o?o.originX:void 0),C$(e.y,t.y,n.y,o?o.originY:void 0)}function w$(e,t,n){e.min=n.min+t.min,e.max=e.min+_o(t)}function G9e(e,t,n){w$(e.x,t.x,n.x),w$(e.y,t.y,n.y)}function O$(e,t,n){e.min=t.min-n.min,e.max=e.min+_o(t)}function jE(e,t,n){O$(e.x,t.x,n.x),O$(e.y,t.y,n.y)}function xi(e){return[e("x"),e("y")]}const xue=({current:e})=>e?e.ownerDocument.defaultView:null,T$=(e,t)=>Math.abs(e-t);function z9e(e,t){const n=T$(e.x,t.x),o=T$(e.y,t.y);return Math.sqrt(n**2+o**2)}const R$=new Set(["auto","scroll"]);class Bue{constructor(t,n,{transformPagePoint:o,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=_N(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=z9e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!m)return;const{point:g}=f,{timestamp:y}=Ur;this.history.push({...g,timestamp:y});const{onStart:_,onMove:S}=this.handlers;h||(_&&_(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=AN(h,this.transformPagePoint),Sn.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=_N(f.type==="pointercancel"?this.lastMoveEventInfo:AN(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,_),g&&g(f,_)},!GB(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=o,this.distanceThreshold=s,this.contextWindow=r||window;const c=ew(t),p=AN(c,this.transformPagePoint),{point:u}=p,{timestamp:l}=Ur;this.history=[{...u,timestamp:l}];const{onSessionStart:d}=n;d&&d(t,_N(p,this.history)),this.removeListeners=YC(g0(this.contextWindow,"pointermove",this.handlePointerMove),g0(this.contextWindow,"pointerup",this.handlePointerUp),g0(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const o=getComputedStyle(n);(R$.has(o.overflowX)||R$.has(o.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const o=t===window,r=o?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:r.x-n.x,y:r.y-n.y};i.x===0&&i.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,r),Sn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),_m(this.updatePoint)}}function AN(e,t){return t?{point:t(e.point)}:e}function E$(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _N({point:e},t){return{point:e,delta:E$(e,kue(t)),offset:E$(e,K9e(t)),velocity:Q9e(t,.1)}}function K9e(e){return e[0]}function kue(e){return e[e.length-1]}function Q9e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,o=null;const r=kue(e);for(;n>=0&&(o=e[n],!(r.timestamp-o.timestamp>ip(t)));)n--;if(!o)return{x:0,y:0};const i=qi(r.timestamp-o.timestamp);if(i===0)return{x:0,y:0};const s={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function $9e(e,{min:t,max:n},o){return t!==void 0&&en&&(e=o?Pn(n,e,o.max):Math.min(e,n)),e}function M$(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function W9e(e,{top:t,left:n,bottom:o,right:r}){return{x:M$(e.x,n,r),y:M$(e.y,t,o)}}function P$(e,t){let n=t.min-e.min,o=t.max-e.max;return t.max-t.mino?n=Q0(t.min,t.max-o,e.min):o>r&&(n=Q0(e.min,e.max-r,t.min)),Fl(0,1,n)}function Z9e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Y1=.35;function eKe(e=Y1){return e===!1?e=0:e===!0&&(e=Y1),{x:I$(e,"left","right"),y:I$(e,"top","bottom")}}function I$(e,t,n){return{min:j$(e,t),max:j$(e,n)}}function j$(e,t){return typeof e=="number"?e:e[t]||0}const tKe=new WeakMap;class nKe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:o}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{n?(this.stopAnimation(),this.snapToCursor(ew(l).point)):this.pauseAnimation()},s=(l,d)=>{this.stopAnimation();const{drag:f,dragPropagation:h,onDragStart:m}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hze(f),!this.openDragLock))return;this.latestPointerEvent=l,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xi(y=>{let _=this.getAxisMotionValue(y).get()||0;if(jl.test(_)){const{projection:S}=this.visualElement;if(S&&S.layout){const w=S.layout.layoutBox[y];w&&(_=_o(w)*(parseFloat(_)/100))}}this.originPoint[y]=_}),m&&Sn.postRender(()=>m(l,d)),$1(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(l,d)=>{this.latestPointerEvent=l,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(h&&this.currentDirection===null){this.currentDirection=rKe(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),g&&g(l,d)},c=(l,d)=>{this.latestPointerEvent=l,this.latestPanInfo=d,this.stop(l,d),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>xi(l=>this.getAnimationState(l)==="paused"&&this.getAxisMotionValue(l).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Bue(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:c,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:o,contextWindow:xue(this.visualElement),element:this.visualElement.current})}stop(t,n){const o=t||this.latestPointerEvent,r=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!o)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Sn.postRender(()=>a(o,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,o){const{drag:r}=this.getProps();if(!o||!ET(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(s=$9e(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&t0(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=W9e(o.layoutBox,t):this.constraints=!1,this.elastic=eKe(n),r!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&xi(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Z9e(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!t0(t))return!1;const o=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=o9e(o,r.root,this.visualElement.getTransformPagePoint());let s=Y9e(r.layout.layoutBox,i);if(n){const a=n(t9e(s));this.hasMutatedConstraints=!!a,a&&(s=Sue(a))}return s}startAnimation(t){const{drag:n,dragMomentum:o,dragElastic:r,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},p=xi(u=>{if(!ET(u,n,this.currentDirection))return;let l=c&&c[u]||{};s&&(l={min:0,max:0});const d=r?200:1e6,f=r?40:1e7,h={type:"inertia",velocity:o?t[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(u,h)});return Promise.all(p).then(a)}startAxisValueAnimation(t,n){const o=this.getAxisMotionValue(t);return $1(this.visualElement,t),o.start(ek(t,o,0,n,this.visualElement,!1))}stopAnimation(){xi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xi(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),r=o[n];return r||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){xi(n=>{const{drag:o}=this.getProps();if(!ET(n,o,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:s,max:a}=r.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-Pn(s,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!t0(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};xi(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();r[s]=X9e({min:c,max:c},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),xi(s=>{if(!ET(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:p}=this.constraints[s];a.set(Pn(c,p,r[s]))})}addListeners(){if(!this.visualElement.current)return;tKe.set(this.visualElement,this);const t=this.visualElement.current,n=g0(t,"pointerdown",c=>{const{drag:p,dragListener:u=!0}=this.getProps();p&&u&&!sue(c.target)&&this.start(c)}),o=()=>{const{dragConstraints:c}=this.getProps();t0(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Sn.read(o);const s=X0(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:p})=>{this.isDragging&&p&&(xi(u=>{const l=this.getAxisMotionValue(u);l&&(this.originPoint[u]+=c[u].translate,l.set(l.get()+c[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:s=Y1,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:o,dragPropagation:r,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function ET(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function rKe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oKe extends Lm{constructor(t){super(t),this.removeGroupControls=Ki,this.removeListeners=Ki,this.controls=new nKe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ki}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const D$=e=>(t,n)=>{e&&Sn.postRender(()=>e(t,n))};class iKe extends Lm{constructor(){super(...arguments),this.removePointerDownListener=Ki}onPointerDown(t){this.session=new Bue(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xue(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:D$(t),onStart:D$(n),onMove:o,onEnd:(i,s)=>{delete this.session,r&&Sn.postRender(()=>r(i,s))}}}mount(){this.removePointerDownListener=g0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const jR={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let vN=!1;class sKe extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o,layoutId:r}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),o&&o.register&&r&&o.register(i),vN&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),jR.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:o,drag:r,isPresent:i}=this.props,{projection:s}=o;return s&&(s.isPresent=i,vN=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Sn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),HB.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o}=this.props,{projection:r}=t;vN=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uue(e){const[t,n]=vze(),o=x.useContext(gle);return F.jsx(sKe,{...e,layoutGroup:o,switchLayoutGroup:x.useContext(_ue),isPresent:t,safeToRemove:n})}function aKe(e,t,n){const o=no(e)?e:yA(e);return o.start(ek("",o,t,n)),o.animation}const lKe=(e,t)=>e.depth-t.depth;class uKe{constructor(){this.children=[],this.isDirty=!1}add(t){TB(this.children,t),this.isDirty=!0}remove(t){RB(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lKe),this.isDirty=!1,this.children.forEach(t)}}function cKe(e,t){const n=Ao.now(),o=({timestamp:r})=>{const i=r-n;i>=t&&(_m(o),e(i-t))};return Sn.setup(o,!0),()=>_m(o)}const que=["TopLeft","TopRight","BottomLeft","BottomRight"],dKe=que.length,N$=e=>typeof e=="string"?parseFloat(e):e,L$=e=>typeof e=="number"||We.test(e);function fKe(e,t,n,o,r,i){r?(e.opacity=Pn(0,n.opacity??1,hKe(o)),e.opacityExit=Pn(t.opacity??1,0,pKe(o))):i&&(e.opacity=Pn(t.opacity??1,n.opacity??1,o));for(let s=0;sot?1:n(Q0(e,t,o))}function x$(e,t){e.min=t.min,e.max=t.max}function ds(e,t){x$(e.x,t.x),x$(e.y,t.y)}function B$(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function k$(e,t,n,o,r){return e-=t,e=IE(e,1/n,o),r!==void 0&&(e=IE(e,1/r,o)),e}function mKe(e,t=0,n=1,o=.5,r,i=e,s=e){if(jl.test(t)&&(t=parseFloat(t),t=Pn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Pn(i.min,i.max,o);e===i&&(a-=t),e.min=k$(e.min,t,n,a,r),e.max=k$(e.max,t,n,a,r)}function U$(e,t,[n,o,r],i,s){mKe(e,t[n],t[o],t[r],t.scale,i,s)}const gKe=["x","scaleX","originX"],bKe=["y","scaleY","originY"];function q$(e,t,n,o){U$(e.x,t,gKe,n?n.x:void 0,o?o.x:void 0),U$(e.y,t,bKe,n?n.y:void 0,o?o.y:void 0)}function J$(e){return e.translate===0&&e.scale===1}function Vue(e){return J$(e.x)&&J$(e.y)}function V$(e,t){return e.min===t.min&&e.max===t.max}function yKe(e,t){return V$(e.x,t.x)&&V$(e.y,t.y)}function H$(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hue(e,t){return H$(e.x,t.x)&&H$(e.y,t.y)}function G$(e){return _o(e.x)/_o(e.y)}function z$(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class AKe{constructor(){this.members=[]}add(t){TB(this.members,t),t.scheduleRender()}remove(t){if(RB(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let o;for(let r=n;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1){o=i;break}}return o?(this.promote(o),!0):!1}promote(t,n){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:o}=t;n.onExitComplete&&n.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _Ke(e,t,n){let o="";const r=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((r||i||s)&&(o=`translate3d(${r}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:u,rotateX:l,rotateY:d,skewX:f,skewY:h}=n;p&&(o=`perspective(${p}px) ${o}`),u&&(o+=`rotate(${u}deg) `),l&&(o+=`rotateX(${l}deg) `),d&&(o+=`rotateY(${d}deg) `),f&&(o+=`skewX(${f}deg) `),h&&(o+=`skewY(${h}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(o+=`scale(${a}, ${c})`),o||"none"}const SN=["","X","Y","Z"],vKe=1e3;let SKe=0;function CN(e,t,n,o){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Gue(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Pue(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Sn,!(r||i))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Gue(o)}function zue({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(s={},a=t?.()){this.id=SKe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(OKe),this.nodes.forEach(MKe),this.nodes.forEach(PKe),this.nodes.forEach(TKe)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;Sn.read(()=>{l=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==l&&(l=f,this.root.updateBlockedByResize=!0,u&&u(),u=cKe(d,250),jR.hasAnimatedSinceResize&&(jR.hasAnimatedSinceResize=!1,this.nodes.forEach($$)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&p&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:l,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const h=this.options.transition||p.getDefaultTransition()||LKe,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=p.getProps(),y=!this.targetLayout||!Hue(this.targetLayout,f),_=!l&&d;if(this.options.layoutRoot||this.resumeFrom||_||l&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...JB(h,"layout"),onPlay:m,onComplete:g};(p.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,_)}else l||$$(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_m(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(IKe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gue(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_o(this.snapshot.measuredBox.x)&&!_o(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const R=w/1e3;W$(l.x,s.x,R),W$(l.y,s.y,R),this.setTargetDelta(l),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jE(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),DKe(this.relativeTarget,this.relativeTargetOrigin,d,R),S&&yKe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=pr()),ds(S,this.relativeTarget)),m&&(this.animationValues=u,fKe(u,p,this.latestValues,R,_,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(_m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{jR.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yA(0)),this.currentAnimation=aKe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vKe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:c,layout:p,latestValues:u}=s;if(!(!a||!c||!p)){if(this!==s&&this.layout&&p&&Kue(this.options.animationType,this.layout.layoutBox,p.layoutBox)){c=this.target||pr();const l=_o(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+l;const d=_o(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+d}ds(a,c),qy(a,u),b0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new AKe),this.sharedNodes.get(s).add(a);const p=a.options.initialPromotionConfig;a.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:c}={}){const p=this.getStack();p&&p.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const p={};c.z&&CN("z",s,p,this.animationValues);for(let u=0;us.currentAnimation?.stop()),this.root.nodes.forEach(K$),this.root.sharedNodes.clear()}}}function CKe(e){e.updateLayout()}function wKe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:o}=e.layout,{animationType:r}=e.options,i=t.source!==e.layout.source;r==="size"?xi(u=>{const l=i?t.measuredBox[u]:t.layoutBox[u],d=_o(l);l.min=n[u].min,l.max=l.min+d}):Kue(r,t.layoutBox,n)&&xi(u=>{const l=i?t.measuredBox[u]:t.layoutBox[u],d=_o(n[u]);l.max=l.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=Jy();b0(s,n,t.layoutBox);const a=Jy();i?b0(a,e.applyTransform(o,!0),t.measuredBox):b0(a,n,t.layoutBox);const c=!Vue(s);let p=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:l,layout:d}=u;if(l&&d){const f=pr();jE(f,t.layoutBox,l.layoutBox);const h=pr();jE(h,n,d.layoutBox),Hue(f,h)||(p=!0),u.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function OKe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function TKe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function RKe(e){e.clearSnapshot()}function K$(e){e.clearMeasurements()}function Q$(e){e.isLayoutDirty=!1}function EKe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $$(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function MKe(e){e.resolveTargetDelta()}function PKe(e){e.calcProjection()}function IKe(e){e.resetSkewAndRotation()}function jKe(e){e.removeLeadSnapshot()}function W$(e,t,n){e.translate=Pn(t.translate,0,n),e.scale=Pn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Y$(e,t,n,o){e.min=Pn(t.min,n.min,o),e.max=Pn(t.max,n.max,o)}function DKe(e,t,n,o){Y$(e.x,t.x,n.x,o),Y$(e.y,t.y,n.y,o)}function NKe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const LKe={duration:.45,ease:[.4,0,.1,1]},X$=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Z$=X$("applewebkit/")&&!X$("chrome/")?Math.round:Ki;function eW(e){e.min=Z$(e.min),e.max=Z$(e.max)}function FKe(e){eW(e.x),eW(e.y)}function Kue(e,t,n){return e==="position"||e==="preserve-aspect"&&!H9e(G$(t),G$(n),.2)}function xKe(e){return e!==e.root&&e.scroll?.wasRoot}const BKe=zue({attachResizeListener:(e,t)=>X0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wN={current:void 0},Que=zue({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wN.current){const e=new BKe({});e.mount(window),e.setOptions({layoutScroll:!0}),wN.current=e}return wN.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),kKe={pan:{Feature:iKe},drag:{Feature:oKe,ProjectionNode:Que,MeasureLayout:Uue}};function tW(e,t,n){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=o[r];i&&Sn.postRender(()=>i(t,ew(t)))}class UKe extends Lm{mount(){const{current:t}=this.node;t&&(this.unmount=pze(t,(n,o)=>(tW(this.node,o,"Start"),r=>tW(this.node,r,"End"))))}unmount(){}}class qKe extends Lm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=YC(X0(this.node.current,"focus",()=>this.onFocus()),X0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nW(e,t,n){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=o[r];i&&Sn.postRender(()=>i(t,ew(t)))}class JKe extends Lm{mount(){const{current:t}=this.node;t&&(this.unmount=bze(t,(n,o)=>(nW(this.node,o,"Start"),(r,{success:i})=>nW(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const X1=new WeakMap,ON=new WeakMap,VKe=e=>{const t=X1.get(e.target);t&&t(e)},HKe=e=>{e.forEach(VKe)};function GKe({root:e,...t}){const n=e||document;ON.has(n)||ON.set(n,{});const o=ON.get(n),r=JSON.stringify(t);return o[r]||(o[r]=new IntersectionObserver(HKe,{root:e,...t})),o[r]}function zKe(e,t,n){const o=GKe(t);return X1.set(e,n),o.observe(e),()=>{X1.delete(e),o.unobserve(e)}}const KKe={some:0,all:1};class QKe extends Lm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:o,amount:r="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:KKe[r]},a=c=>{const{isIntersecting:p}=c;if(this.isInView===p||(this.isInView=p,i&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:u,onViewportLeave:l}=this.node.getProps(),d=p?u:l;d&&d(c)};return zKe(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some($Ke(t,n))&&this.startObserver()}unmount(){}}function $Ke({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WKe={inView:{Feature:QKe},tap:{Feature:JKe},focus:{Feature:qKe},hover:{Feature:UKe}},YKe={layout:{ProjectionNode:Que,MeasureLayout:Uue}},XKe={...B9e,...WKe,...kKe,...YKe},tk=e9e(XKe,h9e);function $ue(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ZKe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e7e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t7e={};function rW(e,t){return(t7e.jsx?e7e:ZKe).test(e)}const n7e=/[ \t\n\f\r]/g;function RP(e){return typeof e=="object"?e.type==="text"?oW(e.value):!1:oW(e)}function oW(e){return e.replace(n7e,"")===""}class tw{constructor(t,n,o){this.normal=n,this.property=t,o&&(this.space=o)}}tw.prototype.normal={};tw.prototype.property={};tw.prototype.space=void 0;function Wue(e,t){const n={},o={};for(const r of e)Object.assign(n,r.property),Object.assign(o,r.normal);return new tw(n,o,t)}function Z1(e){return e.toLowerCase()}class Vo{constructor(t,n){this.attribute=n,this.property=t}}Vo.prototype.attribute="";Vo.prototype.booleanish=!1;Vo.prototype.boolean=!1;Vo.prototype.commaOrSpaceSeparated=!1;Vo.prototype.commaSeparated=!1;Vo.prototype.defined=!1;Vo.prototype.mustUseProperty=!1;Vo.prototype.number=!1;Vo.prototype.overloadedBoolean=!1;Vo.prototype.property="";Vo.prototype.spaceSeparated=!1;Vo.prototype.space=void 0;let r7e=0;const Rt=mb(),Zn=mb(),eL=mb(),De=mb(),gn=mb(),tA=mb(),ai=mb();function mb(){return 2**++r7e}const tL=Object.freeze(Object.defineProperty({__proto__:null,boolean:Rt,booleanish:Zn,commaOrSpaceSeparated:ai,commaSeparated:tA,number:De,overloadedBoolean:eL,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),TN=Object.keys(tL);class nk extends Vo{constructor(t,n,o,r){let i=-1;if(super(t,n),iW(this,"space",r),typeof o=="number")for(;++i4&&n.slice(0,4)==="data"&&l7e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(sW,c7e);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!sW.test(i)){let s=i.replace(a7e,u7e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=nk}return new r(o,t)}function u7e(e){return"-"+e.toLowerCase()}function c7e(e){return e.charAt(1).toUpperCase()}const oce=Wue([Yue,o7e,ece,tce,nce],"html"),nw=Wue([Yue,i7e,ece,tce,nce],"svg");function ice(e){return e.join(" ").trim()}var Cy={},RN,aW;function d7e(){if(aW)return RN;aW=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,c=` +`,p="/",u="*",l="",d="comment",f="declaration";function h(g,y){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];y=y||{};var _=1,S=1;function w(U){var J=U.match(t);J&&(_+=J.length);var V=U.lastIndexOf(c);S=~V?U.length-V:S+U.length}function R(){var U={line:_,column:S};return function(J){return J.position=new E(U),B(),J}}function E(U){this.start=U,this.end={line:_,column:S},this.source=y.source}E.prototype.content=g;function T(U){var J=new Error(y.source+":"+_+":"+S+": "+U);if(J.reason=U,J.filename=y.source,J.line=_,J.column=S,J.source=g,!y.silent)throw J}function D(U){var J=U.exec(g);if(J){var V=J[0];return w(V),g=g.slice(V.length),J}}function B(){D(n)}function N(U){var J;for(U=U||[];J=L();)J!==!1&&U.push(J);return U}function L(){var U=R();if(!(p!=g.charAt(0)||u!=g.charAt(1))){for(var J=2;l!=g.charAt(J)&&(u!=g.charAt(J)||p!=g.charAt(J+1));)++J;if(J+=2,l===g.charAt(J-1))return T("End of comment missing");var V=g.slice(2,J-2);return S+=2,w(V),g=g.slice(J),S+=2,U({type:d,comment:V})}}function q(){var U=R(),J=D(o);if(J){if(L(),!D(r))return T("property missing ':'");var V=D(i),G=U({type:f,property:m(J[0].replace(e,l)),value:V?m(V[0].replace(e,l)):l});return D(s),G}}function I(){var U=[];N(U);for(var J;J=q();)J!==!1&&(U.push(J),N(U));return U}return B(),I()}function m(g){return g?g.replace(a,l):l}return RN=h,RN}var lW;function f7e(){if(lW)return Cy;lW=1;var e=Cy&&Cy.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Cy,"__esModule",{value:!0}),Cy.default=n;const t=e(d7e());function n(o,r){let i=null;if(!o||typeof o!="string")return i;const s=(0,t.default)(o),a=typeof r=="function";return s.forEach(c=>{if(c.type!=="declaration")return;const{property:p,value:u}=c;a?r(p,u,c):u&&(i=i||{},i[p]=u)}),i}return Cy}var TS={},uW;function h7e(){if(uW)return TS;uW=1,Object.defineProperty(TS,"__esModule",{value:!0}),TS.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(p){return!p||n.test(p)||e.test(p)},s=function(p,u){return u.toUpperCase()},a=function(p,u){return"".concat(u,"-")},c=function(p,u){return u===void 0&&(u={}),i(p)?p:(p=p.toLowerCase(),u.reactCompat?p=p.replace(r,a):p=p.replace(o,a),p.replace(t,s))};return TS.camelCase=c,TS}var RS,cW;function p7e(){if(cW)return RS;cW=1;var e=RS&&RS.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(f7e()),n=h7e();function o(r,i){var s={};return!r||typeof r!="string"||(0,t.default)(r,function(a,c){a&&c&&(s[(0,n.camelCase)(a,i)]=c)}),s}return o.default=o,RS=o,RS}var m7e=p7e();const g7e=Wg(m7e),sce=ace("end"),rk=ace("start");function ace(e){return t;function t(n){const o=n&&n.position&&n.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function b7e(e){const t=rk(e),n=sce(e);if(t&&n)return{start:t,end:n}}function y0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dW(e.position):"start"in e||"end"in e?dW(e):"line"in e||"column"in e?nL(e):""}function nL(e){return fW(e&&e.line)+":"+fW(e&&e.column)}function dW(e){return nL(e&&e.start)+"-"+nL(e&&e.end)}function fW(e){return e&&typeof e=="number"?e:1}class io extends Error{constructor(t,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let r="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?r=t:!i.cause&&t&&(s=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?i.ruleId=o:(i.source=o.slice(0,c),i.ruleId=o.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=y0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}io.prototype.file="";io.prototype.name="";io.prototype.reason="";io.prototype.message="";io.prototype.stack="";io.prototype.column=void 0;io.prototype.line=void 0;io.prototype.ancestors=void 0;io.prototype.cause=void 0;io.prototype.fatal=void 0;io.prototype.place=void 0;io.prototype.ruleId=void 0;io.prototype.source=void 0;const ok={}.hasOwnProperty,y7e=new Map,A7e=/[A-Z]/g,_7e=new Set(["table","tbody","thead","tfoot","tr"]),v7e=new Set(["td","th"]),lce="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uce(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let o;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=M7e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=E7e(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?nw:oce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=cce(r,e,void 0);return i&&typeof i!="string"?i:r.create(e,r.Fragment,{children:i||void 0},void 0)}function cce(e,t,n){if(t.type==="element")return S7e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return C7e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return O7e(e,t,n);if(t.type==="mdxjsEsm")return w7e(e,t);if(t.type==="root")return T7e(e,t,n);if(t.type==="text")return R7e(e,t)}function S7e(e,t,n){const o=e.schema;let r=o;t.tagName.toLowerCase()==="svg"&&o.space==="html"&&(r=nw,e.schema=r),e.ancestors.push(t);const i=fce(e,t.tagName,!1),s=P7e(e,t);let a=sk(e,t);return _7e.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!RP(c):!0})),dce(e,s,i,t),ik(s,a),e.ancestors.pop(),e.schema=o,e.create(t,i,s,n)}function C7e(e,t){if(t.data&&t.data.estree&&e.evaluater){const o=t.data.estree.body[0];return o.type,e.evaluater.evaluateExpression(o.expression)}Z0(e,t.position)}function w7e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Z0(e,t.position)}function O7e(e,t,n){const o=e.schema;let r=o;t.name==="svg"&&o.space==="html"&&(r=nw,e.schema=r),e.ancestors.push(t);const i=t.name===null?e.Fragment:fce(e,t.name,!0),s=I7e(e,t),a=sk(e,t);return dce(e,s,i,t),ik(s,a),e.ancestors.pop(),e.schema=o,e.create(t,i,s,n)}function T7e(e,t,n){const o={};return ik(o,sk(e,t)),e.create(t,e.Fragment,o,n)}function R7e(e,t){return t.value}function dce(e,t,n,o){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=o)}function ik(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function E7e(e,t,n){return o;function o(r,i,s,a){const p=Array.isArray(s.children)?n:t;return a?p(i,s,a):p(i,s)}}function M7e(e,t){return n;function n(o,r,i,s){const a=Array.isArray(i.children),c=rk(o);return t(r,i,s,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function P7e(e,t){const n={};let o,r;for(r in t.properties)if(r!=="children"&&ok.call(t.properties,r)){const i=j7e(e,r,t.properties[r]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&v7e.has(t.tagName)?o=a:n[s]=a}}if(o){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return n}function I7e(e,t){const n={};for(const o of t.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){const i=o.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Z0(e,t.position);else{const r=o.name;let i;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&e.evaluater){const a=o.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Z0(e,t.position);else i=o.value===null?!0:o.value;n[r]=i}return n}function sk(e,t){const n=[];let o=-1;const r=e.passKeys?new Map:y7e;for(;++or?0:r+t:t=t>r?r:t,n=n>0?n:0,o.length<1e4)s=Array.from(o),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i0?(hi(e,e.length,0,t),e):t}const mW={}.hasOwnProperty;function pce(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bo=Fm(/[A-Za-z]/),ro=Fm(/[\dA-Za-z]/),q7e=Fm(/[#-'*+\--9=?A-Z^-~]/);function DE(e){return e!==null&&(e<32||e===127)}const rL=Fm(/\d/),J7e=Fm(/[\dA-Fa-f]/),V7e=Fm(/[!-/:-@[-`{-~]/);function ft(e){return e!==null&&e<-2}function mn(e){return e!==null&&(e<0||e===32)}function Bt(e){return e===-2||e===-1||e===32}const EP=Fm(new RegExp("\\p{P}|\\p{S}","u")),Gg=Fm(/\s/);function Fm(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ZA(e){const t=[];let n=-1,o=0,r=0;for(;++n55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),r=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(o,n),encodeURIComponent(s)),o=n+r+1,s=""),r&&(n+=r,r=0)}return t.join("")+e.slice(o)}function Ht(e,t,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(c){return Bt(c)?(e.enter(n),a(c)):t(c)}function a(c){return Bt(c)&&i++s))return;const T=t.events.length;let D=T,B,N;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(B){N=t.events[D][1].end;break}B=!0}for(y(o),E=T;ES;){const R=n[w];t.containerState=R[1],R[0].exit.call(t,e)}n.length=S}function _(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Q7e(e,t,n){return Ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _A(e){if(e===null||mn(e)||Gg(e))return 1;if(EP(e))return 2}function MP(e,t,n){const o=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const l={...e[o][1].end},d={...e[n][1].start};bW(l,-c),bW(d,c),s={type:c>1?"strongSequence":"emphasisSequence",start:l,end:{...e[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},i={type:c>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[o][1].end={...s.start},e[n][1].start={...a.end},p=[],e[o][1].end.offset-e[o][1].start.offset&&(p=Bi(p,[["enter",e[o][1],t],["exit",e[o][1],t]])),p=Bi(p,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",i,t]]),p=Bi(p,MP(t.parser.constructs.insideSpan.null,e.slice(o+1,n),t)),p=Bi(p,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,p=Bi(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,hi(e,o-1,n-o+3,p),n=o+p.length-u-2;break}}for(n=-1;++n0&&Bt(E)?Ht(e,_,"linePrefix",i+1)(E):_(E)}function _(E){return E===null||ft(E)?e.check(yW,m,w)(E):(e.enter("codeFlowValue"),S(E))}function S(E){return E===null||ft(E)?(e.exit("codeFlowValue"),_(E)):(e.consume(E),S)}function w(E){return e.exit("codeFenced"),t(E)}function R(E,T,D){let B=0;return N;function N(J){return E.enter("lineEnding"),E.consume(J),E.exit("lineEnding"),L}function L(J){return E.enter("codeFencedFence"),Bt(J)?Ht(E,q,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):q(J)}function q(J){return J===a?(E.enter("codeFencedFenceSequence"),I(J)):D(J)}function I(J){return J===a?(B++,E.consume(J),I):B>=s?(E.exit("codeFencedFenceSequence"),Bt(J)?Ht(E,U,"whitespace")(J):U(J)):D(J)}function U(J){return J===null||ft(J)?(E.exit("codeFencedFence"),T(J)):D(J)}}}function sQe(e,t,n){const o=this;return r;function r(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return o.parser.lazy[o.now().line]?n(s):t(s)}}const MN={name:"codeIndented",tokenize:lQe},aQe={partial:!0,tokenize:uQe};function lQe(e,t,n){const o=this;return r;function r(p){return e.enter("codeIndented"),Ht(e,i,"linePrefix",5)(p)}function i(p){const u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(p):n(p)}function s(p){return p===null?c(p):ft(p)?e.attempt(aQe,s,c)(p):(e.enter("codeFlowValue"),a(p))}function a(p){return p===null||ft(p)?(e.exit("codeFlowValue"),s(p)):(e.consume(p),a)}function c(p){return e.exit("codeIndented"),t(p)}}function uQe(e,t,n){const o=this;return r;function r(s){return o.parser.lazy[o.now().line]?n(s):ft(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):Ht(e,i,"linePrefix",5)(s)}function i(s){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ft(s)?r(s):n(s)}}const cQe={name:"codeText",previous:fQe,resolve:dQe,tokenize:hQe};function dQe(e){let t=e.length-4,n=3,o,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(o=n;++o=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(t,n,o){const r=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return o&&ES(this.left,o),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ES(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ES(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(o.parser.constructs.flow,n,t)(s)}}function _ce(e,t,n,o,r,i,s,a,c){const p=c||Number.POSITIVE_INFINITY;let u=0;return l;function l(y){return y===60?(e.enter(o),e.enter(r),e.enter(i),e.consume(y),e.exit(i),d):y===null||y===32||y===41||DE(y)?n(y):(e.enter(o),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function d(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),e.exit(o),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),d(y)):y===null||y===60||ft(y)?n(y):(e.consume(y),y===92?h:f)}function h(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function m(y){return!u&&(y===null||y===41||mn(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(o),t(y)):u999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(i),e.enter(r),e.consume(f),e.exit(r),e.exit(o),t):ft(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),l(f))}function l(f){return f===null||f===91||f===93||ft(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),c||(c=!Bt(f)),f===92?d:l)}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,l):l(f)}}function Sce(e,t,n,o,r,i){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(o),e.enter(r),e.consume(d),e.exit(r),s=d===40?41:d,c):n(d)}function c(d){return d===s?(e.enter(r),e.consume(d),e.exit(r),e.exit(o),t):(e.enter(i),p(d))}function p(d){return d===s?(e.exit(i),c(s)):d===null?n(d):ft(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ht(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||ft(d)?(e.exit("chunkString"),p(d)):(e.consume(d),d===92?l:u)}function l(d){return d===s||d===92?(e.consume(d),u):u(d)}}function A0(e,t){let n;return o;function o(r){return ft(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,o):Bt(r)?Ht(e,o,n?"linePrefix":"lineSuffix")(r):t(r)}}const vQe={name:"definition",tokenize:CQe},SQe={partial:!0,tokenize:wQe};function CQe(e,t,n){const o=this;let r;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return vce.call(o,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return r=Cs(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return mn(f)?A0(e,p)(f):p(f)}function p(f){return _ce(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(SQe,l,l)(f)}function l(f){return Bt(f)?Ht(e,d,"whitespace")(f):d(f)}function d(f){return f===null||ft(f)?(e.exit("definition"),o.parser.defined.push(r),t(f)):n(f)}}function wQe(e,t,n){return o;function o(a){return mn(a)?A0(e,r)(a):n(a)}function r(a){return Sce(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Bt(a)?Ht(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ft(a)?t(a):n(a)}}const OQe={name:"hardBreakEscape",tokenize:TQe};function TQe(e,t,n){return o;function o(i){return e.enter("hardBreakEscape"),e.consume(i),r}function r(i){return ft(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const RQe={name:"headingAtx",resolve:EQe,tokenize:MQe};function EQe(e,t){let n=e.length-2,o=3,r,i;return e[o][1].type==="whitespace"&&(o+=2),n-2>o&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(o===n-1||n-4>o&&e[n-2][1].type==="whitespace")&&(n-=o+1===n?2:4),n>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},i={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},hi(e,o,n-o+1,[["enter",r,t],["enter",i,t],["exit",i,t],["exit",r,t]])),e}function MQe(e,t,n){let o=0;return r;function r(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&o++<6?(e.consume(u),s):u===null||mn(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||ft(u)?(e.exit("atxHeading"),t(u)):Bt(u)?Ht(e,a,"whitespace")(u):(e.enter("atxHeadingText"),p(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function p(u){return u===null||u===35||mn(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),p)}}const PQe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],_W=["pre","script","style","textarea"],IQe={concrete:!0,name:"htmlFlow",resolveTo:NQe,tokenize:LQe},jQe={partial:!0,tokenize:xQe},DQe={partial:!0,tokenize:FQe};function NQe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LQe(e,t,n){const o=this;let r,i,s,a,c;return p;function p(W){return u(W)}function u(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),l}function l(W){return W===33?(e.consume(W),d):W===47?(e.consume(W),i=!0,m):W===63?(e.consume(W),r=3,o.interrupt?t:K):bo(W)?(e.consume(W),s=String.fromCharCode(W),g):n(W)}function d(W){return W===45?(e.consume(W),r=2,f):W===91?(e.consume(W),r=5,a=0,h):bo(W)?(e.consume(W),r=4,o.interrupt?t:K):n(W)}function f(W){return W===45?(e.consume(W),o.interrupt?t:K):n(W)}function h(W){const _e="CDATA[";return W===_e.charCodeAt(a++)?(e.consume(W),a===_e.length?o.interrupt?t:q:h):n(W)}function m(W){return bo(W)?(e.consume(W),s=String.fromCharCode(W),g):n(W)}function g(W){if(W===null||W===47||W===62||mn(W)){const _e=W===47,Ne=s.toLowerCase();return!_e&&!i&&_W.includes(Ne)?(r=1,o.interrupt?t(W):q(W)):PQe.includes(s.toLowerCase())?(r=6,_e?(e.consume(W),y):o.interrupt?t(W):q(W)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(W):i?_(W):S(W))}return W===45||ro(W)?(e.consume(W),s+=String.fromCharCode(W),g):n(W)}function y(W){return W===62?(e.consume(W),o.interrupt?t:q):n(W)}function _(W){return Bt(W)?(e.consume(W),_):N(W)}function S(W){return W===47?(e.consume(W),N):W===58||W===95||bo(W)?(e.consume(W),w):Bt(W)?(e.consume(W),S):N(W)}function w(W){return W===45||W===46||W===58||W===95||ro(W)?(e.consume(W),w):R(W)}function R(W){return W===61?(e.consume(W),E):Bt(W)?(e.consume(W),R):S(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),c=W,T):Bt(W)?(e.consume(W),E):D(W)}function T(W){return W===c?(e.consume(W),c=null,B):W===null||ft(W)?n(W):(e.consume(W),T)}function D(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||mn(W)?R(W):(e.consume(W),D)}function B(W){return W===47||W===62||Bt(W)?S(W):n(W)}function N(W){return W===62?(e.consume(W),L):n(W)}function L(W){return W===null||ft(W)?q(W):Bt(W)?(e.consume(W),L):n(W)}function q(W){return W===45&&r===2?(e.consume(W),V):W===60&&r===1?(e.consume(W),G):W===62&&r===4?(e.consume(W),X):W===63&&r===3?(e.consume(W),K):W===93&&r===5?(e.consume(W),le):ft(W)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(jQe,ce,I)(W)):W===null||ft(W)?(e.exit("htmlFlowData"),I(W)):(e.consume(W),q)}function I(W){return e.check(DQe,U,ce)(W)}function U(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),J}function J(W){return W===null||ft(W)?I(W):(e.enter("htmlFlowData"),q(W))}function V(W){return W===45?(e.consume(W),K):q(W)}function G(W){return W===47?(e.consume(W),s="",Q):q(W)}function Q(W){if(W===62){const _e=s.toLowerCase();return _W.includes(_e)?(e.consume(W),X):q(W)}return bo(W)&&s.length<8?(e.consume(W),s+=String.fromCharCode(W),Q):q(W)}function le(W){return W===93?(e.consume(W),K):q(W)}function K(W){return W===62?(e.consume(W),X):W===45&&r===2?(e.consume(W),K):q(W)}function X(W){return W===null||ft(W)?(e.exit("htmlFlowData"),ce(W)):(e.consume(W),X)}function ce(W){return e.exit("htmlFlow"),t(W)}}function FQe(e,t,n){const o=this;return r;function r(s){return ft(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return o.parser.lazy[o.now().line]?n(s):t(s)}}function xQe(e,t,n){return o;function o(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(rw,t,n)}}const BQe={name:"htmlText",tokenize:kQe};function kQe(e,t,n){const o=this;let r,i,s;return a;function a(K){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(K),c}function c(K){return K===33?(e.consume(K),p):K===47?(e.consume(K),R):K===63?(e.consume(K),S):bo(K)?(e.consume(K),D):n(K)}function p(K){return K===45?(e.consume(K),u):K===91?(e.consume(K),i=0,h):bo(K)?(e.consume(K),_):n(K)}function u(K){return K===45?(e.consume(K),f):n(K)}function l(K){return K===null?n(K):K===45?(e.consume(K),d):ft(K)?(s=l,G(K)):(e.consume(K),l)}function d(K){return K===45?(e.consume(K),f):l(K)}function f(K){return K===62?V(K):K===45?d(K):l(K)}function h(K){const X="CDATA[";return K===X.charCodeAt(i++)?(e.consume(K),i===X.length?m:h):n(K)}function m(K){return K===null?n(K):K===93?(e.consume(K),g):ft(K)?(s=m,G(K)):(e.consume(K),m)}function g(K){return K===93?(e.consume(K),y):m(K)}function y(K){return K===62?V(K):K===93?(e.consume(K),y):m(K)}function _(K){return K===null||K===62?V(K):ft(K)?(s=_,G(K)):(e.consume(K),_)}function S(K){return K===null?n(K):K===63?(e.consume(K),w):ft(K)?(s=S,G(K)):(e.consume(K),S)}function w(K){return K===62?V(K):S(K)}function R(K){return bo(K)?(e.consume(K),E):n(K)}function E(K){return K===45||ro(K)?(e.consume(K),E):T(K)}function T(K){return ft(K)?(s=T,G(K)):Bt(K)?(e.consume(K),T):V(K)}function D(K){return K===45||ro(K)?(e.consume(K),D):K===47||K===62||mn(K)?B(K):n(K)}function B(K){return K===47?(e.consume(K),V):K===58||K===95||bo(K)?(e.consume(K),N):ft(K)?(s=B,G(K)):Bt(K)?(e.consume(K),B):V(K)}function N(K){return K===45||K===46||K===58||K===95||ro(K)?(e.consume(K),N):L(K)}function L(K){return K===61?(e.consume(K),q):ft(K)?(s=L,G(K)):Bt(K)?(e.consume(K),L):B(K)}function q(K){return K===null||K===60||K===61||K===62||K===96?n(K):K===34||K===39?(e.consume(K),r=K,I):ft(K)?(s=q,G(K)):Bt(K)?(e.consume(K),q):(e.consume(K),U)}function I(K){return K===r?(e.consume(K),r=void 0,J):K===null?n(K):ft(K)?(s=I,G(K)):(e.consume(K),I)}function U(K){return K===null||K===34||K===39||K===60||K===61||K===96?n(K):K===47||K===62||mn(K)?B(K):(e.consume(K),U)}function J(K){return K===47||K===62||mn(K)?B(K):n(K)}function V(K){return K===62?(e.consume(K),e.exit("htmlTextData"),e.exit("htmlText"),t):n(K)}function G(K){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(K),e.exit("lineEnding"),Q}function Q(K){return Bt(K)?Ht(e,le,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):le(K)}function le(K){return e.enter("htmlTextData"),s(K)}}const uk={name:"labelEnd",resolveAll:VQe,resolveTo:HQe,tokenize:GQe},UQe={tokenize:zQe},qQe={tokenize:KQe},JQe={tokenize:QQe};function VQe(e){let t=-1;const n=[];for(;++t=3&&(p===null||ft(p))?(e.exit("thematicBreak"),t(p)):n(p)}function c(p){return p===r?(e.consume(p),o++,c):(e.exit("thematicBreakSequence"),Bt(p)?Ht(e,a,"whitespace")(p):a(p))}}const Do={continuation:{tokenize:o$e},exit:s$e,name:"list",tokenize:r$e},t$e={partial:!0,tokenize:a$e},n$e={partial:!0,tokenize:i$e};function r$e(e,t,n){const o=this,r=o.events[o.events.length-1];let i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(f){const h=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:rL(f)){if(o.containerState.type||(o.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(DR,n,p)(f):p(f);if(!o.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return rL(f)&&++s<10?(e.consume(f),c):(!o.interrupt||s<2)&&(o.containerState.marker?f===o.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),p(f)):n(f)}function p(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||f,e.check(rw,o.interrupt?n:u,e.attempt(t$e,d,l))}function u(f){return o.containerState.initialBlankLine=!0,i++,d(f)}function l(f){return Bt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):n(f)}function d(f){return o.containerState.size=i+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function o$e(e,t,n){const o=this;return o.containerState._closeFlow=void 0,e.check(rw,r,i);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Ht(e,t,"listItemIndent",o.containerState.size+1)(a)}function i(a){return o.containerState.furtherBlankLines||!Bt(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,s(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(n$e,t,s)(a))}function s(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Ht(e,e.attempt(Do,t,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function i$e(e,t,n){const o=this;return Ht(e,r,"listItemIndent",o.containerState.size+1);function r(i){const s=o.events[o.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===o.containerState.size?t(i):n(i)}}function s$e(e){e.exit(this.containerState.type)}function a$e(e,t,n){const o=this;return Ht(e,r,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(i){const s=o.events[o.events.length-1];return!Bt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const vW={name:"setextUnderline",resolveTo:l$e,tokenize:u$e};function l$e(e,t){let n=e.length,o,r,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){o=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[o][1],t]),e[o][1].end={...e[i][1].end}):e[o][1]=s,e.push(["exit",s,t]),e}function u$e(e,t,n){const o=this;let r;return i;function i(p){let u=o.events.length,l;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){l=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(e.enter("setextHeadingLine"),r=p,s(p)):n(p)}function s(p){return e.enter("setextHeadingLineSequence"),a(p)}function a(p){return p===r?(e.consume(p),a):(e.exit("setextHeadingLineSequence"),Bt(p)?Ht(e,c,"lineSuffix")(p):c(p))}function c(p){return p===null||ft(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const c$e={tokenize:d$e};function d$e(e){const t=this,n=e.attempt(rw,o,e.attempt(this.parser.constructs.flowInitial,r,Ht(e,e.attempt(this.parser.constructs.flow,r,e.attempt(gQe,r)),"linePrefix")));return n;function o(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const f$e={resolveAll:wce()},h$e=Cce("string"),p$e=Cce("text");function Cce(e){return{resolveAll:wce(e==="text"?m$e:void 0),tokenize:t};function t(n){const o=this,r=this.parser.constructs[e],i=n.attempt(r,s,a);return s;function s(u){return p(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return p(u)?(n.exit("data"),i(u)):(n.consume(u),c)}function p(u){if(u===null)return!0;const l=r[u];let d=-1;if(l)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(o):s.shift()}i>0&&s.push(e[r].slice(0,i))}return s}function E$e(e,t){let n=-1;const o=[];let r;for(;++n0){const On=ot.tokenStack[ot.tokenStack.length-1];(On[1]||CW).call(ot,void 0,On[0])}for(je.position={start:nm(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:nm(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},Ct=-1;++Ct0&&(o.className=["language-"+r[0]]);let i={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function J$e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V$e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H$e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",o=String(t.identifier).toUpperCase(),r=ZA(o.toLowerCase()),i=e.footnoteOrder.indexOf(o);let s,a=e.footnoteCounts.get(o);a===void 0?(a=0,e.footnoteOrder.push(o),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(o,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const p={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,p),e.applyData(t,p)}function G$e(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function z$e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Rce(e,t){const n=t.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+o}];const r=e.all(t),i=r[0];i&&i.type==="text"?i.value="["+i.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=o:r.push({type:"text",value:o}),r}function K$e(e,t){const n=String(t.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return Rce(e,t);const r={src:ZA(o.url||""),alt:t.alt};o.title!==null&&o.title!==void 0&&(r.title=o.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function Q$e(e,t){const n={src:ZA(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,o),e.applyData(t,o)}function $$e(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,o),e.applyData(t,o)}function W$e(e,t){const n=String(t.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return Rce(e,t);const r={href:ZA(o.url||"")};o.title!==null&&o.title!==void 0&&(r.title=o.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Y$e(e,t){const n={href:ZA(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const o={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function X$e(e,t,n){const o=e.all(t),r=n?Z$e(n):Ece(t),i={},s=[];if(typeof t.checked=="boolean"){const u=o[0];let l;u&&u.type==="element"&&u.tagName==="p"?l=u:(l={type:"element",tagName:"p",properties:{},children:[]},o.unshift(l)),l.children.length>0&&l.children.unshift({type:"text",value:" "}),l.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a1}function eWe(e,t){const n={},o=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=rk(t.children[1]),c=sce(t.children[t.children.length-1]);a&&c&&(s.position={start:a,end:c}),r.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function iWe(e,t,n){const o=n?n.children:void 0,i=(o?o.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let c=-1;const p=[];for(;++c0,!0),o[0]),r=o.index+o[0].length,o=n.exec(t);return i.push(TW(t.slice(r),r>0,!1)),i.join("")}function TW(e,t,n){let o=0,r=e.length;if(t){let i=e.codePointAt(o);for(;i===wW||i===OW;)o++,i=e.codePointAt(o)}if(n){let i=e.codePointAt(r-1);for(;i===wW||i===OW;)r--,i=e.codePointAt(r-1)}return r>o?e.slice(o,r):""}function lWe(e,t){const n={type:"text",value:aWe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uWe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cWe={blockquote:k$e,break:U$e,code:q$e,delete:J$e,emphasis:V$e,footnoteReference:H$e,heading:G$e,html:z$e,imageReference:K$e,image:Q$e,inlineCode:$$e,linkReference:W$e,link:Y$e,listItem:X$e,list:eWe,paragraph:tWe,root:nWe,strong:rWe,table:oWe,tableCell:sWe,tableRow:iWe,text:lWe,thematicBreak:uWe,toml:MT,yaml:MT,definition:MT,footnoteDefinition:MT};function MT(){}const Mce=-1,PP=0,_0=1,NE=2,ck=3,dk=4,fk=5,hk=6,Pce=7,Ice=8,RW=typeof self=="object"?self:globalThis,dWe=(e,t)=>{const n=(r,i)=>(e.set(i,r),r),o=r=>{if(e.has(r))return e.get(r);const[i,s]=t[r];switch(i){case PP:case Mce:return n(s,r);case _0:{const a=n([],r);for(const c of s)a.push(o(c));return a}case NE:{const a=n({},r);for(const[c,p]of s)a[o(c)]=o(p);return a}case ck:return n(new Date(s),r);case dk:{const{source:a,flags:c}=s;return n(new RegExp(a,c),r)}case fk:{const a=n(new Map,r);for(const[c,p]of s)a.set(o(c),o(p));return a}case hk:{const a=n(new Set,r);for(const c of s)a.add(o(c));return a}case Pce:{const{name:a,message:c}=s;return n(new RW[a](c),r)}case Ice:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new RW[i](s),r)};return o},EW=e=>dWe(new Map,e)(0),wy="",{toString:fWe}={},{keys:hWe}=Object,MS=e=>{const t=typeof e;if(t!=="object"||!e)return[PP,t];const n=fWe.call(e).slice(8,-1);switch(n){case"Array":return[_0,wy];case"Object":return[NE,wy];case"Date":return[ck,wy];case"RegExp":return[dk,wy];case"Map":return[fk,wy];case"Set":return[hk,wy];case"DataView":return[_0,n]}return n.includes("Array")?[_0,n]:n.includes("Error")?[Pce,n]:[NE,n]},PT=([e,t])=>e===PP&&(t==="function"||t==="symbol"),pWe=(e,t,n,o)=>{const r=(s,a)=>{const c=o.push(s)-1;return n.set(a,c),c},i=s=>{if(n.has(s))return n.get(s);let[a,c]=MS(s);switch(a){case PP:{let u=s;switch(c){case"bigint":a=Ice,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return r([Mce],s)}return r([a,u],s)}case _0:{if(c){let d=s;return c==="DataView"?d=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(d=new Uint8Array(s)),r([c,[...d]],s)}const u=[],l=r([a,u],s);for(const d of s)u.push(i(d));return l}case NE:{if(c)switch(c){case"BigInt":return r([c,s.toString()],s);case"Boolean":case"Number":case"String":return r([c,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],l=r([a,u],s);for(const d of hWe(s))(e||!PT(MS(s[d])))&&u.push([i(d),i(s[d])]);return l}case ck:return r([a,s.toISOString()],s);case dk:{const{source:u,flags:l}=s;return r([a,{source:u,flags:l}],s)}case fk:{const u=[],l=r([a,u],s);for(const[d,f]of s)(e||!(PT(MS(d))||PT(MS(f))))&&u.push([i(d),i(f)]);return l}case hk:{const u=[],l=r([a,u],s);for(const d of s)(e||!PT(MS(d)))&&u.push(i(d));return l}}const{message:p}=s;return r([a,{name:c,message:p}],s)};return i},MW=(e,{json:t,lossy:n}={})=>{const o=[];return pWe(!(t||n),!!t,new Map,o)(e),o},LE=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?EW(MW(e,t)):structuredClone(e):(e,t)=>EW(MW(e,t));function mWe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gWe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bWe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mWe,o=e.options.footnoteBackLabel||gWe,r=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c0&&h.push({type:"text",value:" "});let _=typeof n=="string"?n:n(c,f);typeof _=="string"&&(_={type:"text",value:_}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,f),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const g=u[u.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const _=g.children[g.children.length-1];_&&_.type==="text"?_.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...h)}else u.push(...h);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(u,!0)};e.patch(p,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...LE(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` +`}]}}const IP=(function(e){if(e==null)return vWe;if(typeof e=="function")return jP(e);if(typeof e=="object")return Array.isArray(e)?yWe(e):AWe(e);if(typeof e=="string")return _We(e);throw new Error("Expected function, string, or object as test")});function yWe(e){const t=[];let n=-1;for(;++n":""))+")"})}return d;function d(){let f=jce,h,m,g;if((!t||i(c,p,u[u.length-1]||void 0))&&(f=OWe(n(c,u)),f[0]===iL))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==wWe)for(m=(o?y.children.length:-1)+s,g=u.concat(y);m>-1&&m0&&n.push({type:"text",value:` +`}),n}function PW(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function IW(e,t){const n=RWe(e,t),o=n.one(e,void 0),r=bWe(n),i=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return r&&i.children.push({type:"text",value:` +`},r),i}function jWe(e,t){return e&&"run"in e?async function(n,o){const r=IW(n,{file:o,...t});await e.run(r,o)}:function(n,o){return IW(n,{file:o,...e||t})}}function jW(e){if(e)throw e}var IN,DW;function DWe(){if(DW)return IN;DW=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},i=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var u=e.call(p,"constructor"),l=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!u&&!l)return!1;var d;for(d in p);return typeof d>"u"||e.call(p,d)},s=function(p,u){n&&u.name==="__proto__"?n(p,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):p[u.name]=u.newValue},a=function(p,u){if(u==="__proto__")if(e.call(p,u)){if(o)return o(p,u).value}else return;return p[u]};return IN=function c(){var p,u,l,d,f,h,m=arguments[0],g=1,y=arguments.length,_=!1;for(typeof m=="boolean"&&(_=m,m=arguments[1]||{},g=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});gs.length;let c;a&&s.push(r);try{c=e.apply(this,s)}catch(p){const u=p;if(a&&n)throw u;return r(u)}a||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(s,...a){n||(n=!0,t(s,...a))}function i(s){r(null,s)}}const yl={basename:xWe,dirname:BWe,extname:kWe,join:UWe,sep:"/"};function xWe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ow(e);let n=0,o=-1,r=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else o<0&&(i=!0,o=r+1);return o<0?"":e.slice(n,o)}if(t===e)return"";let s=-1,a=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else s<0&&(i=!0,s=r+1),a>-1&&(e.codePointAt(r)===t.codePointAt(a--)?a<0&&(o=r):(a=-1,o=s));return n===o?o=s:o<0&&(o=e.length),e.slice(n,o)}function BWe(e){if(ow(e),e.length===0)return".";let t=-1,n=e.length,o;for(;--n;)if(e.codePointAt(n)===47){if(o){t=n;break}}else o||(o=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function kWe(e){ow(e);let t=e.length,n=-1,o=0,r=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){o=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?r<0?r=t:i!==1&&(i=1):r>-1&&(i=-1)}return r<0||n<0||i===0||i===1&&r===n-1&&r===o+1?"":e.slice(r,n)}function UWe(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function JWe(e,t){let n="",o=0,r=-1,i=0,s=-1,a,c;for(;++s<=e.length;){if(s2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",o=0):(n=n.slice(0,c),o=n.length-1-n.lastIndexOf("/")),r=s,i=0;continue}}else if(n.length>0){n="",o=0,r=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(r+1,s):n=e.slice(r+1,s),o=s-r-1;r=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function ow(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VWe={cwd:HWe};function HWe(){return"/"}function lL(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function GWe(e){if(typeof e=="string")e=new URL(e);else if(!lL(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zWe(e)}function zWe(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const t=e.pathname;let n=-1;for(;++n0){let[f,...h]=u;const m=o[d][1];aL(m)&&aL(f)&&(f=jN(!0,m,f)),o[d]=[p,f,...h]}}}}const WWe=new mk().freeze();function FN(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xN(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function BN(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function LW(e){if(!aL(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function FW(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function IT(e){return YWe(e)?e:new Nce(e)}function YWe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XWe(e){return typeof e=="string"||ZWe(e)}function ZWe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eYe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xW=[],BW={allowDangerousHtml:!0},tYe=/^(https?|ircs?|mailto|xmpp)$/i,nYe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Lce(e){const t=rYe(e),n=oYe(e);return iYe(t.runSync(t.parse(n),n),e)}function rYe(e){const t=e.rehypePlugins||xW,n=e.remarkPlugins||xW,o=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BW}:BW;return WWe().use(B$e).use(n).use(jWe,o).use(t)}function oYe(e){const t=e.children||"",n=new Nce;return typeof t=="string"&&(n.value=t),n}function iYe(e,t){const n=t.allowedElements,o=t.allowElement,r=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||sYe;for(const u of nYe)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+eYe+u.id,void 0);return pk(e,p),uce(e,{Fragment:F.Fragment,components:r,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function p(u,l,d){if(u.type==="raw"&&d&&typeof l=="number")return s?d.children.splice(l,1):d.children[l]={type:"text",value:u.value},l;if(u.type==="element"){let f;for(f in EN)if(Object.hasOwn(EN,f)&&Object.hasOwn(u.properties,f)){const h=u.properties[f],m=EN[f];(m===null||m.includes(u.tagName))&&(u.properties[f]=c(String(h||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!f&&o&&typeof l=="number"&&(f=!o(u,l,d)),f&&d&&typeof l=="number")return a&&u.children?d.children.splice(l,1,...u.children):d.children.splice(l,1),l}}}function sYe(e){const t=e.indexOf(":"),n=e.indexOf("?"),o=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||o!==-1&&t>o||tYe.test(e.slice(0,t))?e:""}const aYe=(e,t)=>typeof e=="string"?e===t:JSON.stringify(e)===JSON.stringify(t),lYe=(e,t)=>{if(!e||!t)return!1;const n=o=>{const{position:r,data:i,...s}=o||{};return s};return JSON.stringify(n(e.properties))===JSON.stringify(n(t.properties))&&aYe(e.children,t.children)},gk=(e,t)=>lYe(e.node,t.node),uYe=(e={})=>Object.fromEntries(Object.entries(e??{}).map(([t,n])=>{if(!n)return[t,n];const o=n,r=({node:i,...s})=>F.jsx(o,{...s});return[t,x.memo(r,gk)]})),bk=x.createContext(null),Fce=()=>x.useContext(bk)!==null,cYe=({children:e,...t})=>F.jsx(bk.Provider,{value:t,children:e}),dYe=x.memo(cYe,gk),fYe=({node:e,...t})=>F.jsx("pre",{...t}),hYe=({node:e,...t})=>F.jsx("code",{...t}),yk=({node:e,components:{Pre:t,Code:n},code:o})=>F.jsx(t,{children:F.jsx(n,{node:e,children:o})}),pYe=()=>null,mYe=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:o,CodeHeader:r},language:i,code:s})=>{const a=x.useMemo(()=>({Pre:t,Code:n}),[t,n]),c=i?o:yk;return F.jsxs(F.Fragment,{children:[F.jsx(r,{node:e,language:i,code:s}),F.jsx(c,{node:e,components:a,language:i??"unknown",code:s})]})};var kN={exports:{}};var kW;function gYe(){return kW||(kW=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s({className:n,...o})=>({className:xce(e,n),...t,...o}),yYe=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:o,CodeHeader:r},componentsByLanguage:i={},children:s,...a})=>{const c=x.useContext(bk),p=UW(c),u=Co(g=>F.jsx(t,{...p(g)})),l=UW(a),d=Co(g=>F.jsx(n,{...l(g)})),f=/language-(\w+)/.exec(a.className||"")?.[1]??"";if(typeof s!="string")return F.jsx(yk,{node:e,components:{Pre:u,Code:d},code:s});const h=i[f]?.SyntaxHighlighter??o,m=i[f]?.CodeHeader??r;return F.jsx(mYe,{node:e,components:{Pre:u,Code:d,SyntaxHighlighter:h,CodeHeader:m},language:f||"unknown",code:s})},AYe=({node:e,components:t,componentsByLanguage:n,...o})=>Fce()?F.jsx(yYe,{node:e,components:t,componentsByLanguage:n,...o}):F.jsx(t.Code,{...o}),_Ye=x.memo(AYe,(e,t)=>e.components===t.components&&e.componentsByLanguage===t.componentsByLanguage&&gk(e,t)),{useSmooth:vYe,useSmoothStatus:SYe,withSmoothContextProvider:CYe}=NAe,wYe=({components:e,componentsByLanguage:t,smooth:n=!0,preprocess:o,...r})=>{const i=ate(),s=x.useMemo(()=>o?{...i,text:o(i.text)}:i,[i,o]),{text:a}=vYe(s,n),{pre:c=fYe,code:p=hYe,SyntaxHighlighter:u=yk,CodeHeader:l=pYe}=e??{},d=x.useMemo(()=>({Pre:c,Code:p,SyntaxHighlighter:u,CodeHeader:l}),[c,p,u,l]),f=Co(m=>F.jsx(_Ye,{components:d,componentsByLanguage:t,...m})),h=x.useMemo(()=>{const{pre:m,code:g,SyntaxHighlighter:y,CodeHeader:_,...S}=e??{};return{...S,pre:dYe,code:f}},[f,e]);return F.jsx(Lce,{components:h,...r,children:a})},Bce=x.forwardRef(({className:e,containerProps:t,containerComponent:n="div",...o},r)=>{const i=SYe();return F.jsx(n,{"data-status":i.type,...t,className:xce(e,t?.className),ref:r,children:F.jsx(wYe,{...o})})});Bce.displayName="MarkdownTextPrimitive";const OYe=CYe(Bce);function FE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let o=0,r=n.indexOf(t);for(;r!==-1;)o++,r=n.indexOf(t,r+t.length);return o}function TYe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function RYe(e,t,n){const r=IP((n||{}).ignore||[]),i=EYe(t);let s=-1;for(;++s0?{type:"text",value:E}:void 0),E===!1?d.lastIndex=w+1:(h!==w&&_.push({type:"text",value:p.value.slice(h,w)}),Array.isArray(E)?_.push(...E):E&&_.push(E),h=w+S[0].length,y=!0),!d.global)break;S=d.exec(p.value)}return y?(h?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],o=n.indexOf(")");const r=FE(e,"(");let i=FE(e,")");for(;o!==-1&&r>i;)e+=n.slice(0,o+1),n=n.slice(o+1),o=n.indexOf(")"),i++;return[e,n]}function kce(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gg(n)||EP(n))&&(!t||n!==47)}Uce.peek=YYe;function VYe(){this.buffer()}function HYe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GYe(){this.buffer()}function zYe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KYe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QYe(e){this.exit(e)}function $Ye(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WYe(e){this.exit(e)}function YYe(){return"["}function Uce(e,t,n,o){const r=n.createTracker(o);let i=r.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return i+=r.move(n.safe(n.associationId(e),{after:"]",before:i})),a(),s(),i+=r.move("]"),i}function XYe(){return{enter:{gfmFootnoteCallString:VYe,gfmFootnoteCall:HYe,gfmFootnoteDefinitionLabelString:GYe,gfmFootnoteDefinition:zYe},exit:{gfmFootnoteCallString:KYe,gfmFootnoteCall:QYe,gfmFootnoteDefinitionLabelString:$Ye,gfmFootnoteDefinition:WYe}}}function ZYe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Uce},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(o,r,i,s){const a=i.createTracker(s);let c=a.move("[^");const p=i.enter("footnoteDefinition"),u=i.enter("label");return c+=a.move(i.safe(i.associationId(o),{before:c,after:"]"})),u(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((t?` +`:" ")+i.indentLines(i.containerFlow(o,a.current()),t?qce:eXe))),p(),c}}function eXe(e,t,n){return t===0?e:qce(e,t,n)}function qce(e,t,n){return(n?"":" ")+e}const tXe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jce.peek=sXe;function nXe(){return{canContainEols:["delete"],enter:{strikethrough:oXe},exit:{strikethrough:iXe}}}function rXe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tXe}],handlers:{delete:Jce}}}function oXe(e){this.enter({type:"delete",children:[]},e)}function iXe(e){this.exit(e)}function Jce(e,t,n,o){const r=n.createTracker(o),i=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(e,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),i(),s}function sXe(){return"~"}function aXe(e){return e.length}function lXe(e,t){const n=t||{},o=(n.align||[]).concat(),r=n.stringLength||aXe,i=[],s=[],a=[],c=[];let p=0,u=-1;for(;++up&&(p=e[u].length);++yc[y])&&(c[y]=S)}m.push(_)}s[u]=m,a[u]=g}let l=-1;if(typeof o=="object"&&"length"in o)for(;++lc[l]&&(c[l]=_),f[l]=_),d[l]=S}s.splice(1,0,d),a.splice(1,0,f),u=-1;const h=[];for(;++u "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),fXe);return r(),s}function fXe(e,t,n){return">"+(n?"":" ")+e}function hXe(e,t){return VW(e,t.inConstruct,!0)&&!VW(e,t.notInConstruct,!1)}function VW(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let o=-1;for(;++os&&(s=i):i=1,r=o+t.length,o=n.indexOf(t,r);return s}function mXe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function gXe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function bXe(e,t,n,o){const r=gXe(n),i=e.value||"",s=r==="`"?"GraveAccent":"Tilde";if(mXe(e,n)){const l=n.enter("codeIndented"),d=n.indentLines(i,yXe);return l(),d}const a=n.createTracker(o),c=r.repeat(Math.max(pXe(i,r)+1,3)),p=n.enter("codeFenced");let u=a.move(c);if(e.lang){const l=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),l()}if(e.lang&&e.meta){const l=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:` +`,encode:["`"],...a.current()})),l()}return u+=a.move(` +`),i&&(u+=a.move(i+` +`)),u+=a.move(c),p(),u}function yXe(e,t,n){return(n?"":" ")+e}function Ak(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function AXe(e,t,n,o){const r=Ak(n),i=r==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const c=n.createTracker(o);let p=c.move("[");return p+=c.move(n.safe(n.associationId(e),{before:p,after:"]",...c.current()})),p+=c.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(n.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(a=n.enter("destinationRaw"),p+=c.move(n.safe(e.url,{before:p,after:e.title?" ":` +`,...c.current()}))),a(),e.title&&(a=n.enter(`title${i}`),p+=c.move(" "+r),p+=c.move(n.safe(e.title,{before:p,after:r,...c.current()})),p+=c.move(r),a()),s(),p}function _Xe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function eC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function xE(e,t,n){const o=_A(e),r=_A(t);return o===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Vce.peek=vXe;function Vce(e,t,n,o){const r=_Xe(n),i=n.enter("emphasis"),s=n.createTracker(o),a=s.move(r);let c=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const p=c.charCodeAt(0),u=xE(o.before.charCodeAt(o.before.length-1),p,r);u.inside&&(c=eC(p)+c.slice(1));const l=c.charCodeAt(c.length-1),d=xE(o.after.charCodeAt(0),l,r);d.inside&&(c=c.slice(0,-1)+eC(l));const f=s.move(r);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},a+c+f}function vXe(e,t,n){return n.options.emphasis||"*"}function SXe(e,t){let n=!1;return pk(e,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return n=!0,iL}),!!((!e.depth||e.depth<3)&&ak(e)&&(t.options.setext||n))}function CXe(e,t,n,o){const r=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(o);if(SXe(e,n)){const u=n.enter("headingSetext"),l=n.enter("phrasing"),d=n.containerPhrasing(e,{...i.current(),before:` `,after:` -`});return f(),d(),g+` -`+(r===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const o="#".repeat(r),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(t,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=Cg(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}T$.peek=$Oe;function T$(t){return t.value||""}function $Oe(){return"<"}R$.peek=WOe;function R$(t,e,n,i){const r=zk(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let u=l.move("![");return u+=l.move(n.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+r),u+=l.move(n.safe(t.title,{before:u,after:r,...l.current()})),u+=l.move(r),a()),u+=l.move(")"),o(),u}function WOe(){return"!"}k$.peek=jOe;function k$(t,e,n,i){const r=t.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const u=n.safe(t.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?l+=a.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function jOe(){return"!"}I$.peek=KOe;function I$(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(t.url))}D$.peek=YOe;function D$(t,e,n,i){const r=zk(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let a,l;if(M$(t,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(t,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=d,f}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(t.title,{before:u,after:r,...o.current()})),u+=o.move(r),l()),u+=o.move(")"),a(),u}function YOe(t,e,n){return M$(t,n)?"<":"["}P$.peek=qOe;function P$(t,e,n,i){const r=t.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const u=n.containerPhrasing(t,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?l+=a.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function qOe(){return"["}function Qk(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function JOe(t){const e=Qk(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XOe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function N$(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function ZOe(t,e,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=t.ordered?XOe(n):Qk(n);const a=t.ordered?o==="."?")":".":JOe(n);let l=e&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),N$(n)===o&&d){let f=-1;for(;++f-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(i);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(t,a.current()),d);return l(),u;function d(f,g,m){return g?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function nBe(t,e,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(t,i);return s(),r(),o}const iBe=Pw(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rBe(t,e,n,i){return(t.children.some(function(o){return iBe(o)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function sBe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}O$.peek=oBe;function O$(t,e,n,i){const r=sBe(n),s=n.enter("strong"),o=n.createTracker(i),a=o.move(r+r);let l=o.move(n.containerPhrasing(t,{after:r,before:a,...o.current()}));const u=l.charCodeAt(0),d=eb(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(l=Cg(u)+l.slice(1));const f=l.charCodeAt(l.length-1),g=eb(i.after.charCodeAt(0),f,r);g.inside&&(l=l.slice(0,-1)+Cg(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:d.outside},a+l+m}function oBe(t,e,n){return n.options.strong||"*"}function aBe(t,e,n,i){return n.safe(t.value,i)}function lBe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function cBe(t,e,n){const i=(N$(n)+(n.options.ruleSpaces?" ":"")).repeat(lBe(n));return n.options.ruleSpaces?i.slice(0,-1):i}const B$={blockquote:DOe,break:x5,code:UOe,definition:FOe,emphasis:_$,hardBreak:x5,heading:GOe,html:T$,image:R$,imageReference:k$,inlineCode:I$,link:D$,linkReference:P$,list:ZOe,listItem:tBe,paragraph:nBe,root:rBe,strong:O$,text:aBe,thematicBreak:cBe};function uBe(){return{enter:{table:dBe,tableData:E5,tableHeader:E5,tableRow:fBe},exit:{codeText:pBe,table:hBe,tableData:zE,tableHeader:zE,tableRow:zE}}}function dBe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function hBe(t){this.exit(t),this.data.inTable=void 0}function fBe(t){this.enter({type:"tableRow",children:[]},t)}function zE(t){this.exit(t)}function E5(t){this.enter({type:"tableCell",children:[]},t)}function pBe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,gBe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function gBe(t,e){return e==="|"?e:t}function mBe(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:o,tableCell:l,tableRow:a}};function o(m,v,S,C){return u(d(m,S,C),m.align)}function a(m,v,S,C){const E=f(m,S,C),k=u([E]);return k.slice(0,k.indexOf(` -`))}function l(m,v,S,C){const E=S.enter("tableCell"),k=S.enter("phrasing"),R=S.containerPhrasing(m,{...C,before:s,after:s});return k(),E(),R}function u(m,v){return kOe(m,{align:v,alignDelimiters:i,padding:n,stringLength:r})}function d(m,v,S){const C=m.children;let E=-1;const k=[],R=v.enter("table");for(;++E0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const NBe={tokenize:zBe,partial:!0};function OBe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VBe,continuation:{tokenize:FBe},exit:HBe}},text:{91:{name:"gfmFootnoteCall",tokenize:UBe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BBe,resolveTo:LBe}}}}function BBe(t,e,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const l=i.events[r][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=_s(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function LBe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...a),t}function UBe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||Ut(f))return n(f);if(f===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return r.includes(_s(i.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Ut(f)||(o=!0),s++,t.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(t.consume(f),s++,u):u(f)}}function VBe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(v){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(v){return v===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(v)}function d(v){if(o>999||v===93&&!a||v===null||v===91||Ut(v))return n(v);if(v===93){t.exit("chunkString");const S=t.exit("gfmFootnoteDefinitionLabelString");return s=_s(i.sliceSerialize(S)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return Ut(v)||(a=!0),o++,t.consume(v),v===92?f:d}function f(v){return v===91||v===92||v===93?(t.consume(v),o++,d):d(v)}function g(v){return v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),r.includes(s)||r.push(s),mt(t,m,"gfmFootnoteDefinitionWhitespace")):n(v)}function m(v){return e(v)}}function FBe(t,e,n){return t.check(ym,e,t.attempt(NBe,e,n))}function HBe(t){t.exit("gfmFootnoteDefinition")}function zBe(t,e,n){const i=this;return mt(t,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):n(s)}}function QBe(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,a){let l=-1;for(;++l1?l(v):(o.consume(v),f++,m);if(f<2&&!n)return l(v);const C=o.exit("strikethroughSequenceTemporary"),E=Zd(v);return C._open=!E||E===2&&!!S,C._close=!S||S===2&&!!E,a(v)}}}class GBe{constructor(){this.map=[]}add(e,n,i){$Be(this,e,n,i)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const s of r)e.push(s);r=i.pop()}this.map.length=0}}function $Be(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const J=i.events[$][1].type;if(J==="lineEnding"||J==="linePrefix")$--;else break}const K=$>-1?i.events[$][1].type:null,X=K==="tableHead"||K==="tableRow"?P:l;return X===P&&i.parser.lazy[i.now().line]?n(V):X(V)}function l(V){return t.enter("tableHead"),t.enter("tableRow"),u(V)}function u(V){return V===124||(o=!0,s+=1),d(V)}function d(V){return V===null?n(V):He(V)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(V),t.exit("lineEnding"),m):n(V):dt(V)?mt(t,d,"whitespace")(V):(s+=1,o&&(o=!1,r+=1),V===124?(t.enter("tableCellDivider"),t.consume(V),t.exit("tableCellDivider"),o=!0,d):(t.enter("data"),f(V)))}function f(V){return V===null||V===124||Ut(V)?(t.exit("data"),d(V)):(t.consume(V),V===92?g:f)}function g(V){return V===92||V===124?(t.consume(V),f):f(V)}function m(V){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(V):(t.enter("tableDelimiterRow"),o=!1,dt(V)?mt(t,v,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):v(V))}function v(V){return V===45||V===58?C(V):V===124?(o=!0,t.enter("tableCellDivider"),t.consume(V),t.exit("tableCellDivider"),S):D(V)}function S(V){return dt(V)?mt(t,C,"whitespace")(V):C(V)}function C(V){return V===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(V),t.exit("tableDelimiterMarker"),E):V===45?(s+=1,E(V)):V===null||He(V)?M(V):D(V)}function E(V){return V===45?(t.enter("tableDelimiterFiller"),k(V)):D(V)}function k(V){return V===45?(t.consume(V),k):V===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(V),t.exit("tableDelimiterMarker"),R):(t.exit("tableDelimiterFiller"),R(V))}function R(V){return dt(V)?mt(t,M,"whitespace")(V):M(V)}function M(V){return V===124?v(V):V===null||He(V)?!o||r!==s?D(V):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(V)):D(V)}function D(V){return n(V)}function P(V){return t.enter("tableRow"),N(V)}function N(V){return V===124?(t.enter("tableCellDivider"),t.consume(V),t.exit("tableCellDivider"),N):V===null||He(V)?(t.exit("tableRow"),e(V)):dt(V)?mt(t,N,"whitespace")(V):(t.enter("data"),B(V))}function B(V){return V===null||V===124||Ut(V)?(t.exit("data"),N(V)):(t.consume(V),V===92?G:B)}function G(V){return V===92||V===124?(t.consume(V),B):B(V)}}function YBe(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,d,f;const g=new GBe;for(;++nn[2]+1){const v=n[2]+1,S=n[3]-n[2]-1;t.add(v,S,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return r!==void 0&&(s.end=Object.assign({},hd(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function T5(t,e,n,i,r){const s=[],o=hd(e.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,e])),i.end=Object.assign({},o),s.push(["exit",i,e]),t.add(n+1,0,s)}function hd(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const qBe={name:"tasklistCheck",tokenize:XBe};function JBe(){return{text:{91:qBe}}}function XBe(t,e,n){const i=this;return r;function r(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),s)}function s(l){return Ut(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(l)}function a(l){return He(l)?e(l):dt(l)?t.check({tokenize:ZBe},e,n)(l):n(l)}}function ZBe(t,e,n){return mt(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function eLe(t){return JG([EBe(),OBe(),QBe(t),jBe(),JBe()])}const tLe={};function $$(t){const e=this,n=t||tLe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(eLe(n)),s.push(wBe()),o.push(SBe(n))}var R5=Object.prototype.hasOwnProperty;function k5(t,e,n){for(n of t.keys())if(Gp(n,e))return n}function Gp(t,e){var n,i,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((i=t.length)===e.length)for(;i--&&Gp(t[i],e[i]););return i===-1}if(n===Set){if(t.size!==e.size)return!1;for(i of t)if(r=i,r&&typeof r=="object"&&(r=k5(e,r),!r)||!e.has(r))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(i of t)if(r=i[0],r&&typeof r=="object"&&(r=k5(e,r),!r)||!Gp(i[1],e.get(r)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((i=t.byteLength)===e.byteLength)for(;i--&&t.getInt8(i)===e.getInt8(i););return i===-1}if(ArrayBuffer.isView(t)){if((i=t.byteLength)===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}if(!n||typeof t=="object"){i=0;for(n in t)if(R5.call(t,n)&&++i&&!R5.call(e,n)||!(n in e)||!Gp(t[n],e[n]))return!1;return Object.keys(e).length===i}}return t!==t&&e!==e}var QE=t=>{const e=T.useRef(t),n=T.useRef(0);return typeof t!="object"||t===null?(t!==e.current&&(e.current=t,n.current+=1),[t,n.current]):(t!==e.current&&(Gp(t,e.current)||(e.current=t,n.current+=1)),[e.current,n.current])},nLe=(t,e,n)=>{const i=Date.now();clearTimeout(e.current.timeoutId);const r=Math.max(0,e.current.nextAllowedTime-i);e.current.timeoutId=setTimeout(()=>{t().catch(console.error),e.current.nextAllowedTime=i+n},r)},W$=(t,e,n)=>{const i=e?Array.isArray(e)?e:[e]:[];if(t==null||typeof t=="string"&&!t.trim())return{languageId:"plaintext",displayLanguageId:"plaintext",langsToLoad:void 0};if(typeof t=="object")return{languageId:t.name,displayLanguageId:t.name||null,langsToLoad:t};const r=t.toLowerCase(),s=a=>a?.toLowerCase()===r,o=i.find(a=>s(a.name)||s(a.scopeName)||s(a.scopeName?.split(".").pop())||a.aliases?.some(s)||a.fileTypes?.some(s));return o?{languageId:o.name||t,displayLanguageId:t,langsToLoad:o}:n?.[t]?{languageId:n[t],displayLanguageId:t,langsToLoad:n[t]}:{languageId:t,displayLanguageId:t,langsToLoad:t}};function iLe(t){const e=typeof t=="object"&&"tokenColors"in t&&Array.isArray(t.tokenColors),n=typeof t=="object"&&t!==null&&!e,i=typeof t=="object"&&t!==null&&!e&&Object.entries(t).some(([r,s])=>r&&s&&r.trim()!==""&&s!==""&&(typeof s=="string"||e));return n?{isMultiTheme:!0,themeId:i?`multi-${Object.values(t).map(s=>(typeof s=="string"?s:s?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:i?t:null,themesToLoad:i?Object.values(t):[]}:{isMultiTheme:!1,themeId:typeof t=="string"?t:t?.name||"custom",singleTheme:t,themesToLoad:[t]}}function rLe(t=1){return{name:"react-shiki:line-numbers",code(e){if(this.addClassToHast(e,"has-line-numbers"),t!==1){const n=e.properties?.style||"",i=n?`${n}; --line-start: ${t}`:`--line-start: ${t}`;e.properties={...e.properties,style:i}}},line(e){return this.addClassToHast(e,"line-numbers"),e}}}var I5={light:"github-light",dark:"github-dark"},sLe=(t,e,n,i,r={})=>{const[s,o]=T.useState(null),[a,l]=QE(e),[u,d]=QE(n),[f,g]=QE(r),{languageId:m,langsToLoad:v}=T.useMemo(()=>W$(a,f.customLanguages,f.langAlias),[a,f.customLanguages,f.langAlias]),{isMultiTheme:S,themeId:C,multiTheme:E,singleTheme:k,themesToLoad:R}=T.useMemo(()=>iLe(u),[u]),M=T.useRef({nextAllowedTime:0,timeoutId:void 0}),D=T.useMemo(()=>{const P={lang:m},{defaultColor:N,cssVariablePrefix:B,showLineNumbers:G,startingLineNumber:V,...$}=f,K=S?{themes:E||I5,defaultColor:N,cssVariablePrefix:B}:{theme:k||I5.dark},X=$.transformers||[];return G&&X.push(rLe(V)),{...P,...K,...$,transformers:X}},[m,C,l,d,g]);return T.useEffect(()=>{let P=!0;const N=async()=>{if(!m)return;const G=f.highlighter?f.highlighter:await i(v,R),$=G.getLoadedLanguages().includes(m)?m:"plaintext",K={...D,lang:$};if(P){const X=f.outputFormat==="html"?G.codeToHtml(t,K):WG(G.codeToHast(t,K),{jsx:_.jsx,jsxs:_.jsxs,Fragment:_.Fragment});o(X)}},{delay:B}=f;return B?nLe(N,M,B):N().catch(console.error),()=>{P=!1,clearTimeout(M.current.timeoutId)}},[t,D,f.delay,f.highlighter,v,R]),s};function oLe(t,{insertAt:e}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}oLe(`.relative { +`});return l(),u(),d+` +`+(r===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(` +`))+1))}const s="#".repeat(r),a=n.enter("headingAtx"),c=n.enter("phrasing");i.move(s+" ");let p=n.containerPhrasing(e,{before:"# ",after:` +`,...i.current()});return/^[\t ]/.test(p)&&(p=eC(p.charCodeAt(0))+p.slice(1)),p=p?s+" "+p:s,n.options.closeAtx&&(p+=" "+s),c(),a(),p}Hce.peek=wXe;function Hce(e){return e.value||""}function wXe(){return"<"}Gce.peek=OXe;function Gce(e,t,n,o){const r=Ak(n),i=r==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const c=n.createTracker(o);let p=c.move("![");return p+=c.move(n.safe(e.alt,{before:p,after:"]",...c.current()})),p+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(n.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(a=n.enter("destinationRaw"),p+=c.move(n.safe(e.url,{before:p,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=n.enter(`title${i}`),p+=c.move(" "+r),p+=c.move(n.safe(e.title,{before:p,after:r,...c.current()})),p+=c.move(r),a()),p+=c.move(")"),s(),p}function OXe(){return"!"}zce.peek=TXe;function zce(e,t,n,o){const r=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(o);let c=a.move("![");const p=n.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(p+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const l=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,i(),r==="full"||!p||p!==l?c+=a.move(l+"]"):r==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function TXe(){return"!"}Kce.peek=RXe;function Kce(e,t,n){let o=e.value||"",r="`",i=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(o);)r+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++i\u007F]/.test(e.url))}$ce.peek=EXe;function $ce(e,t,n,o){const r=Ak(n),i=r==='"'?"Quote":"Apostrophe",s=n.createTracker(o);let a,c;if(Qce(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let l=s.move("<");return l+=s.move(n.containerPhrasing(e,{before:l,after:">",...s.current()})),l+=s.move(">"),a(),n.stack=u,l}a=n.enter("link"),c=n.enter("label");let p=s.move("[");return p+=s.move(n.containerPhrasing(e,{before:p,after:"](",...s.current()})),p+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),p+=s.move("<"),p+=s.move(n.safe(e.url,{before:p,after:">",...s.current()})),p+=s.move(">")):(c=n.enter("destinationRaw"),p+=s.move(n.safe(e.url,{before:p,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${i}`),p+=s.move(" "+r),p+=s.move(n.safe(e.title,{before:p,after:r,...s.current()})),p+=s.move(r),c()),p+=s.move(")"),a(),p}function EXe(e,t,n){return Qce(e,n)?"<":"["}Wce.peek=MXe;function Wce(e,t,n,o){const r=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(o);let c=a.move("[");const p=n.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(p+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const l=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=u,i(),r==="full"||!p||p!==l?c+=a.move(l+"]"):r==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function MXe(){return"["}function _k(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function PXe(e){const t=_k(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function IXe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Yce(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function jXe(e,t,n,o){const r=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?IXe(n):_k(n);const a=e.ordered?s==="."?")":".":PXe(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Yce(n)===s&&u){let l=-1;for(;++l-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let s=i.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(o);a.move(i+" ".repeat(s-i.length)),a.shift(s);const c=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,a.current()),u);return c(),p;function u(l,d,f){return d?(f?"":" ".repeat(s))+l:(f?i:i+" ".repeat(s-i.length))+l}}function LXe(e,t,n,o){const r=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,o);return i(),r(),s}const FXe=IP(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xXe(e,t,n,o){return(e.children.some(function(s){return FXe(s)})?n.containerPhrasing:n.containerFlow).call(n,e,o)}function BXe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xce.peek=kXe;function Xce(e,t,n,o){const r=BXe(n),i=n.enter("strong"),s=n.createTracker(o),a=s.move(r+r);let c=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const p=c.charCodeAt(0),u=xE(o.before.charCodeAt(o.before.length-1),p,r);u.inside&&(c=eC(p)+c.slice(1));const l=c.charCodeAt(c.length-1),d=xE(o.after.charCodeAt(0),l,r);d.inside&&(c=c.slice(0,-1)+eC(l));const f=s.move(r+r);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},a+c+f}function kXe(e,t,n){return n.options.strong||"*"}function UXe(e,t,n,o){return n.safe(e.value,o)}function qXe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JXe(e,t,n){const o=(Yce(n)+(n.options.ruleSpaces?" ":"")).repeat(qXe(n));return n.options.ruleSpaces?o.slice(0,-1):o}const Zce={blockquote:dXe,break:HW,code:bXe,definition:AXe,emphasis:Vce,hardBreak:HW,heading:CXe,html:Hce,image:Gce,imageReference:zce,inlineCode:Kce,link:$ce,linkReference:Wce,list:jXe,listItem:NXe,paragraph:LXe,root:xXe,strong:Xce,text:UXe,thematicBreak:JXe};function VXe(){return{enter:{table:HXe,tableData:GW,tableHeader:GW,tableRow:zXe},exit:{codeText:KXe,table:GXe,tableData:VN,tableHeader:VN,tableRow:VN}}}function HXe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function GXe(e){this.exit(e),this.data.inTable=void 0}function zXe(e){this.enter({type:"tableRow",children:[]},e)}function VN(e){this.exit(e)}function GW(e){this.enter({type:"tableCell",children:[]},e)}function KXe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,QXe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function QXe(e,t){return t==="|"?t:e}function $Xe(e){const t=e||{},n=t.tableCellPadding,o=t.tablePipeAlign,r=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:c,tableRow:a}};function s(f,h,m,g){return p(u(f,m,g),f.align)}function a(f,h,m,g){const y=l(f,m,g),_=p([y]);return _.slice(0,_.indexOf(` +`))}function c(f,h,m,g){const y=m.enter("tableCell"),_=m.enter("phrasing"),S=m.containerPhrasing(f,{...g,before:i,after:i});return _(),y(),S}function p(f,h){return lXe(f,{align:h,alignDelimiters:o,padding:n,stringLength:r})}function u(f,h,m){const g=f.children;let y=-1;const _=[],S=h.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const hZe={tokenize:vZe,partial:!0};function pZe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yZe,continuation:{tokenize:AZe},exit:_Ze}},text:{91:{name:"gfmFootnoteCall",tokenize:bZe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mZe,resolveTo:gZe}}}}function mZe(e,t,n){const o=this;let r=o.events.length;const i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let s;for(;r--;){const c=o.events[r][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!s||!s._balanced)return n(c);const p=Cs(o.sliceSerialize({start:s.end,end:o.now()}));return p.codePointAt(0)!==94||!i.includes(p.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function gZe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},a=[e[n+1],e[n+2],["enter",o,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(n,e.length-n+1,...a),e}function bZe(e,t,n){const o=this,r=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i=0,s;return a;function a(l){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),c}function c(l){return l!==94?n(l):(e.enter("gfmFootnoteCallMarker"),e.consume(l),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(l){if(i>999||l===93&&!s||l===null||l===91||mn(l))return n(l);if(l===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return r.includes(Cs(o.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(l)}return mn(l)||(s=!0),i++,e.consume(l),l===92?u:p}function u(l){return l===91||l===92||l===93?(e.consume(l),i++,p):p(l)}}function yZe(e,t,n){const o=this,r=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i,s=0,a;return c;function c(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(h)}function u(h){if(s>999||h===93&&!a||h===null||h===91||mn(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return i=Cs(o.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return mn(h)||(a=!0),s++,e.consume(h),h===92?l:u}function l(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),r.includes(i)||r.push(i),Ht(e,f,"gfmFootnoteDefinitionWhitespace")):n(h)}function f(h){return t(h)}}function AZe(e,t,n){return e.check(rw,t,e.attempt(hZe,t,n))}function _Ze(e){e.exit("gfmFootnoteDefinition")}function vZe(e,t,n){const o=this;return Ht(e,r,"gfmFootnoteDefinitionIndent",5);function r(i){const s=o.events[o.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):n(i)}}function SZe(e){let n=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function r(s,a){let c=-1;for(;++c1?c(h):(s.consume(h),l++,f);if(l<2&&!n)return c(h);const g=s.exit("strikethroughSequenceTemporary"),y=_A(h);return g._open=!y||y===2&&!!m,g._close=!m||m===2&&!!y,a(h)}}}class CZe{constructor(){this.map=[]}add(t,n,o){wZe(this,t,n,o)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const o=[];for(;n>0;)n-=1,o.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];o.push(t.slice()),t.length=0;let r=o.pop();for(;r;){for(const i of r)t.push(i);r=o.pop()}this.map.length=0}}function wZe(e,t,n,o){let r=0;if(!(n===0&&o.length===0)){for(;r-1;){const U=o.events[L][1].type;if(U==="lineEnding"||U==="linePrefix")L--;else break}const q=L>-1?o.events[L][1].type:null,I=q==="tableHead"||q==="tableRow"?E:c;return I===E&&o.parser.lazy[o.now().line]?n(N):I(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),p(N)}function p(N){return N===124||(s=!0,i+=1),u(N)}function u(N){return N===null?n(N):ft(N)?i>1?(i=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),f):n(N):Bt(N)?Ht(e,u,"whitespace")(N):(i+=1,s&&(s=!1,r+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),l(N)))}function l(N){return N===null||N===124||mn(N)?(e.exit("data"),u(N)):(e.consume(N),N===92?d:l)}function d(N){return N===92||N===124?(e.consume(N),l):l(N)}function f(N){return o.interrupt=!1,o.parser.lazy[o.now().line]?n(N):(e.enter("tableDelimiterRow"),s=!1,Bt(N)?Ht(e,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):h(N))}function h(N){return N===45||N===58?g(N):N===124?(s=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),m):R(N)}function m(N){return Bt(N)?Ht(e,g,"whitespace")(N):g(N)}function g(N){return N===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),y):N===45?(i+=1,y(N)):N===null||ft(N)?w(N):R(N)}function y(N){return N===45?(e.enter("tableDelimiterFiller"),_(N)):R(N)}function _(N){return N===45?(e.consume(N),_):N===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(N))}function S(N){return Bt(N)?Ht(e,w,"whitespace")(N):w(N)}function w(N){return N===124?h(N):N===null||ft(N)?!s||r!==i?R(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):R(N)}function R(N){return n(N)}function E(N){return e.enter("tableRow"),T(N)}function T(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),T):N===null||ft(N)?(e.exit("tableRow"),t(N)):Bt(N)?Ht(e,T,"whitespace")(N):(e.enter("data"),D(N))}function D(N){return N===null||N===124||mn(N)?(e.exit("data"),T(N)):(e.consume(N),N===92?B:D)}function B(N){return N===92||N===124?(e.consume(N),D):D(N)}}function EZe(e,t){let n=-1,o=!0,r=0,i=[0,0,0,0],s=[0,0,0,0],a=!1,c=0,p,u,l;const d=new CZe;for(;++nn[2]+1){const h=n[2]+1,m=n[3]-n[2]-1;e.add(h,m,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return r!==void 0&&(i.end=Object.assign({},Dy(t.events,r)),e.add(r,0,[["exit",i,t]]),i=void 0),i}function KW(e,t,n,o,r){const i=[],s=Dy(t.events,n);r&&(r.end=Object.assign({},s),i.push(["exit",r,t])),o.end=Object.assign({},s),i.push(["exit",o,t]),e.add(n+1,0,i)}function Dy(e,t){const n=e[t],o=n[0]==="enter"?"start":"end";return n[1][o]}const MZe={name:"tasklistCheck",tokenize:IZe};function PZe(){return{text:{91:MZe}}}function IZe(e,t,n){const o=this;return r;function r(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return mn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(c)}function a(c){return ft(c)?t(c):Bt(c)?e.check({tokenize:jZe},t,n)(c):n(c)}}function jZe(e,t,n){return Ht(e,o,"whitespace");function o(r){return r===null?n(r):t(r)}}function DZe(e){return pce([oZe(),pZe(),SZe(e),TZe(),PZe()])}const NZe={};function lde(e){const t=this,n=e||NZe,o=t.data(),r=o.micromarkExtensions||(o.micromarkExtensions=[]),i=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),s=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);r.push(DZe(n)),i.push(eZe()),s.push(tZe(n))}var QW=Object.prototype.hasOwnProperty;function $W(e,t,n){for(n of e.keys())if(v0(n,t))return n}function v0(e,t){var n,o,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&v0(e[o],t[o]););return o===-1}if(n===Set){if(e.size!==t.size)return!1;for(o of e)if(r=o,r&&typeof r=="object"&&(r=$W(t,r),!r)||!t.has(r))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(o of e)if(r=o[0],r&&typeof r=="object"&&(r=$W(t,r),!r)||!v0(o[1],t.get(r)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return o===-1}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(QW.call(e,n)&&++o&&!QW.call(t,n)||!(n in t)||!v0(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}var HN=e=>{const t=x.useRef(e),n=x.useRef(0);return typeof e!="object"||e===null?(e!==t.current&&(t.current=e,n.current+=1),[e,n.current]):(e!==t.current&&(v0(e,t.current)||(t.current=e,n.current+=1)),[t.current,n.current])},LZe=(e,t,n)=>{const o=Date.now();clearTimeout(t.current.timeoutId);const r=Math.max(0,t.current.nextAllowedTime-o);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=o+n},r)},ude=(e,t,n)=>{const o=t?Array.isArray(t)?t:[t]:[];if(e==null||typeof e=="string"&&!e.trim())return{languageId:"plaintext",displayLanguageId:"plaintext",langsToLoad:void 0};if(typeof e=="object")return{languageId:e.name,displayLanguageId:e.name||null,langsToLoad:e};const r=e.toLowerCase(),i=a=>a?.toLowerCase()===r,s=o.find(a=>i(a.name)||i(a.scopeName)||i(a.scopeName?.split(".").pop())||a.aliases?.some(i)||a.fileTypes?.some(i));return s?{languageId:s.name||e,displayLanguageId:e,langsToLoad:s}:n?.[e]?{languageId:n[e],displayLanguageId:e,langsToLoad:n[e]}:{languageId:e,displayLanguageId:e,langsToLoad:e}};function FZe(e){const t=typeof e=="object"&&"tokenColors"in e&&Array.isArray(e.tokenColors),n=typeof e=="object"&&e!==null&&!t,o=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([r,i])=>r&&i&&r.trim()!==""&&i!==""&&(typeof i=="string"||t));return n?{isMultiTheme:!0,themeId:o?`multi-${Object.values(e).map(i=>(typeof i=="string"?i:i?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:o?e:null,themesToLoad:o?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function xZe(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const n=t.properties?.style||"",o=n?`${n}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:o}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var WW={light:"github-light",dark:"github-dark"},BZe=(e,t,n,o,r={})=>{const[i,s]=x.useState(null),[a,c]=HN(t),[p,u]=HN(n),[l,d]=HN(r),{languageId:f,langsToLoad:h}=x.useMemo(()=>ude(a,l.customLanguages,l.langAlias),[a,l.customLanguages,l.langAlias]),{isMultiTheme:m,themeId:g,multiTheme:y,singleTheme:_,themesToLoad:S}=x.useMemo(()=>FZe(p),[p]),w=x.useRef({nextAllowedTime:0,timeoutId:void 0}),R=x.useMemo(()=>{const E={lang:f},{defaultColor:T,cssVariablePrefix:D,showLineNumbers:B,startingLineNumber:N,...L}=l,q=m?{themes:y||WW,defaultColor:T,cssVariablePrefix:D}:{theme:_||WW.dark},I=L.transformers||[];return B&&I.push(xZe(N)),{...E,...q,...L,transformers:I}},[f,g,c,u,d]);return x.useEffect(()=>{let E=!0;const T=async()=>{if(!f)return;const B=l.highlighter?l.highlighter:await o(h,S),L=B.getLoadedLanguages().includes(f)?f:"plaintext",q={...R,lang:L};if(E){const I=l.outputFormat==="html"?B.codeToHtml(e,q):uce(B.codeToHast(e,q),{jsx:F.jsx,jsxs:F.jsxs,Fragment:F.Fragment});s(I)}},{delay:D}=l;return D?LZe(T,w,D):T().catch(console.error),()=>{E=!1,clearTimeout(w.current.timeoutId)}},[e,R,l.delay,l.highlighter,h,S]),i};function kZe(e,{insertAt:t}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}kZe(`.relative { position: relative; } .defaultStyles pre { @@ -254,9 +263,9 @@ ${X.content[0].text}`;for(const z of e)z.status?.type==="incomplete"&&z.status?. --line-numbers-font-family: inherit; --line-numbers-opacity: 1; } -`);var aLe=t=>T.forwardRef(({language:e,theme:n,delay:i,transformers:r,defaultColor:s,cssVariablePrefix:o,addDefaultStyles:a=!0,style:l,langStyle:u,className:d,langClassName:f,showLanguage:g=!0,showLineNumbers:m=!1,startingLineNumber:v=1,children:S,as:C="pre",customLanguages:E,...k},R)=>{const M={delay:i,transformers:r,customLanguages:E,showLineNumbers:m,defaultColor:s,cssVariablePrefix:o,startingLineNumber:v,...k},{displayLanguageId:D}=W$(e,E),P=t(S,e,n,M),N=typeof P=="string";return _.jsxs(C,{ref:R,"data-testid":"shiki-container",className:bv("relative","not-prose",a&&"defaultStyles",d),style:l,id:"shiki-container",children:[g&&D?_.jsx("span",{className:bv("languageLabel",f),style:u,id:"language-label",children:D}):null,N?_.jsx("div",{dangerouslySetInnerHTML:{__html:P}}):P]})});const lLe="modulepreload",cLe=function(t){return"/"+t},M5={},H=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let u=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var o=u;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");r=u(n.map(d=>{if(d=cLe(d),d in M5)return;M5[d]=!0;const f=d.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":lLe,f||(m.as="script"),m.crossOrigin="",m.href=d,l&&m.setAttribute("nonce",l),document.head.appendChild(m),f)return new Promise((v,S)=>{m.addEventListener("load",v),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return e().catch(s)})};let Sn=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function uLe(t){return $k(t)}function $k(t){return Array.isArray(t)?dLe(t):t instanceof RegExp?t:typeof t=="object"?hLe(t):t}function dLe(t){let e=[];for(let n=0,i=t.length;n{for(let i in n)t[i]=n[i]}),t}function K$(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?K$(t.substring(0,t.length-1)):t.substr(~e+1)}var GE=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,J0=class{static hasCaptures(t){return t===null?!1:(GE.lastIndex=0,GE.test(t))}static replaceCaptures(t,e,n){return t.replace(GE,(i,r,s,o)=>{let a=n[parseInt(r||s,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return i})}};function Y$(t,e){return te?1:0}function q$(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,i=e.length;if(n===i){for(let r=0;rthis._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,i=this._cachedMatchRoot.get(e).find(r=>fLe(t.parent,r.parentScopes));return i?new Z$(i.fontStyle,i.foreground,i.background):null}},$E=class Xy{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const i of n)e=new Xy(e,i);return e}static from(...e){let n=null;for(let i=0;i"){if(n===e.length-1)return!1;i=e[++n],r=!0}for(;t&&!pLe(t.scopeName,i);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function pLe(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Z$=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function gLe(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],i=0;for(let r=0,s=e.length;r1&&(C=v.slice(0,v.length-1),C.reverse()),n[i++]=new mLe(S,C,r,l,u,d)}}return n}var mLe=class{constructor(t,e,n,i,r,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=i,this.foreground=r,this.background=s}},pi=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(pi||{});function ALe(t,e){t.sort((l,u)=>{let d=Y$(l.scope,u.scope);return d!==0||(d=q$(l.parentScopes,u.parentScopes),d!==0)?d:l.index-u.index});let n=0,i="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(i=l.foreground),l.background!==null&&(r=l.background)}let s=new yLe(e),o=new Z$(n,s.getId(i),s.getId(r)),a=new bLe(new c2(0,null,-1,0,0),[]);for(let l=0,u=t.length;le?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),r!==0&&(this.background=r)}},bLe=class u2{constructor(e,n=[],i={}){this._mainRule=e,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let i=0,r=0;for(;e.parentScopes[i]===">"&&i++,n.parentScopes[r]===">"&&r++,!(i>=e.parentScopes.length||r>=n.parentScopes.length);){const s=n.parentScopes[r].length-e.parentScopes[i].length;if(s!==0)return s;i++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let i=e.indexOf("."),r,s;if(i===-1?(r=e,s=""):(r=e.substring(0,i),s=e.substring(i+1)),this._children.hasOwnProperty(r))return this._children[r].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(u2._cmpBySpecificity),n}insert(e,n,i,r,s,o){if(n===""){this._doInsertHere(e,i,r,s,o);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let d;this._children.hasOwnProperty(l)?d=this._children[l]:(d=new u2(this._mainRule.clone(),c2.cloneArr(this._rulesWithParentScopes)),this._children[l]=d),d.insert(e+1,u,i,r,s,o)}_doInsertHere(e,n,i,r,s){if(n===null){this._mainRule.acceptOverwrite(e,i,r,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,i,r,s,o,a){let l=zr.getLanguageId(e),u=zr.getTokenType(e),d=zr.containsBalancedBrackets(e)?1:0,f=zr.getFontStyle(e),g=zr.getForeground(e),m=zr.getBackground(e);return n!==0&&(l=n),i!==8&&(u=i),r!==null&&(d=r?1:0),s!==-1&&(f=s),o!==0&&(g=o),a!==0&&(m=a),(l<<0|u<<8|d<<10|f<<11|g<<15|m<<24)>>>0}};function nb(t,e){const n=[],i=wLe(t);let r=i.next();for(;r!==null;){let l=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let u=o();if(n.push({matcher:u,priority:l}),r!==",")break;r=i.next()}return n;function s(){if(r==="-"){r=i.next();const l=s();return u=>!!l&&!l(u)}if(r==="("){r=i.next();const l=a();return r===")"&&(r=i.next()),l}if(P5(r)){const l=[];do l.push(r),r=i.next();while(P5(r));return u=>e(l,u)}return null}function o(){const l=[];let u=s();for(;u;)l.push(u),u=s();return d=>l.every(f=>f(d))}function a(){const l=[];let u=o();for(;u&&(l.push(u),r==="|"||r===",");){do r=i.next();while(r==="|"||r===",");u=o()}return d=>l.some(f=>f(d))}}function P5(t){return!!t&&!!t.match(/[\w\.:]+/)}function wLe(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const i=n[0];return n=e.exec(t),i}}}function tW(t){typeof t.dispose=="function"&&t.dispose()}var xg=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},SLe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},CLe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},xLe=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xg(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new CLe;for(const n of t)ELe(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof xg){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function ELe(t,e,n,i){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof xg?Zy({baseGrammar:s,selfGrammar:r},i):d2(t.ruleName,{baseGrammar:s,selfGrammar:r,repository:r.repository},i);const o=n.injections(t.scopeName);if(o)for(const a of o)i.add(new xg(a))}function d2(t,e,n){if(e.repository&&e.repository[t]){const i=e.repository[t];ib([i],e,n)}}function Zy(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&ib(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&ib(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function ib(t,e,n){for(const i of t){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const r=i.repository?j$({},e.repository,i.repository):e.repository;Array.isArray(i.patterns)&&ib(i.patterns,{...e,repository:r},n);const s=i.include;if(!s)continue;const o=nW(s);switch(o.kind){case 0:Zy({...e,selfGrammar:e.baseGrammar},n);break;case 1:Zy(e,n);break;case 2:d2(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?d2(o.ruleName,l,n):Zy(l,n)}else o.kind===4?n.add(new SLe(o.scopeName,o.ruleName)):n.add(new xg(o.scopeName));break}}}var _Le=class{kind=0},TLe=class{kind=1},RLe=class{constructor(t){this.ruleName=t}kind=2},kLe=class{constructor(t){this.scopeName=t}kind=3},ILe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function nW(t){if(t==="$base")return new _Le;if(t==="$self")return new TLe;const e=t.indexOf("#");if(e===-1)return new kLe(t);if(e===0)return new RLe(t.substring(1));{const n=t.substring(0,e),i=t.substring(e+1);return new ILe(n,i)}}var MLe=/\\(\d+)/,N5=/\\(\d+)/g,DLe=-1,iW=-2;var bm=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,n,i,r){this.$location=e,this.id=n,this._name=i||null,this._nameIsCapturing=J0.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=J0.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${K$(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return!this._nameIsCapturing||this._name===null||e===null||n===null?this._name:J0.replaceCaptures(this._name,e,n)}getContentName(e,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:J0.replaceCaptures(this._contentName,e,n)}},PLe=class extends bm{retokenizeCapturedWithRuleId;constructor(t,e,n,i,r){super(t,e,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,i){throw new Error("Not supported!")}},NLe=class extends bm{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,i,r){super(t,e,n,null),this._match=new Eg(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _g,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},O5=class extends bm{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,i,r){super(t,e,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new _g,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},h2=class extends bm{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,i,r,s,o,a,l,u){super(t,e,n,i),this._begin=new Eg(r,this.id),this.beginCaptures=s,this._end=new Eg(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,i){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,i)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _g;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},rb=class extends bm{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,i,r,s,o,a,l){super(t,e,n,i),this._begin=new Eg(r,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Eg(o,iW),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,i){return this._getCachedCompiledPatterns(t).compileAG(t,n,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new _g;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,i){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,i)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new _g,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},rW=class di{static createCaptureRule(e,n,i,r,s){return e.registerRule(o=>new PLe(n,o,i,r,s))}static getCompiledRuleId(e,n,i){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new NLe(e.$vscodeTextmateLocation,e.id,e.name,e.match,di._compileCaptures(e.captures,n,i));if(typeof e.begin>"u"){e.repository&&(i=j$({},i,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new O5(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,di._compilePatterns(s,n,i))}return e.while?new rb(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,di._compileCaptures(e.beginCaptures||e.captures,n,i),e.while,di._compileCaptures(e.whileCaptures||e.captures,n,i),di._compilePatterns(e.patterns,n,i)):new h2(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,di._compileCaptures(e.beginCaptures||e.captures,n,i),e.end,di._compileCaptures(e.endCaptures||e.captures,n,i),e.applyEndPatternLast,di._compilePatterns(e.patterns,n,i))}),e.id}static _compileCaptures(e,n,i){let r=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;e[o].patterns&&(l=di.getCompiledRuleId(e[o],n,i)),r[a]=di.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return r}static _compilePatterns(e,n,i){let r=[];if(e)for(let s=0,o=e.length;se.substring(r.start,r.end));return N5.lastIndex=0,this.source.replace(N5,(r,s)=>J$(i[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],i=[],r=[],s,o,a,l;for(s=0,o=this.source.length;sn.source);this._cached=new B5(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let i=this._items.map(r=>r.resolveAnchors(e,n));return new B5(t,i,this._items.map(r=>r.ruleId))}},B5=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e{const n=this._scopeToLanguage(e),i=this._toStandardTokenType(e);return new WE(n,i)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(f2.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},BLe=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,i])=>J$(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},L5=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function oW(t,e,n,i,r,s,o,a){const l=e.content.length;let u=!1,d=-1;if(o){const m=LLe(t,e,n,i,r,s);r=m.stack,i=m.linePos,n=m.isFirstLine,d=m.anchorPosition}const f=Date.now();for(;!u;){if(a!==0&&Date.now()-f>a)return new L5(r,!0);g()}return new L5(r,!1);function g(){const m=ULe(t,e,n,i,r,d);if(!m){s.produce(r,l),u=!0;return}const v=m.captureIndices,S=m.matchedRuleId,C=v&&v.length>0?v[0].end>i:!1;if(S===DLe){const E=r.getRule(t);s.produce(r,v[0].start),r=r.withContentNameScopesList(r.nameScopesList),Ep(t,e,n,r,s,E.endCaptures,v),s.produce(r,v[0].end);const k=r;if(r=r.parent,d=k.getAnchorPos(),!C&&k.getEnterPos()===i){r=k,s.produce(r,l),u=!0;return}}else{const E=t.getRule(S);s.produce(r,v[0].start);const k=r,R=E.getName(e.content,v),M=r.contentNameScopesList.pushAttributed(R,t);if(r=r.push(S,i,d,v[0].end===l,null,M,M),E instanceof h2){const D=E;Ep(t,e,n,r,s,D.beginCaptures,v),s.produce(r,v[0].end),d=v[0].end;const P=D.getContentName(e.content,v),N=M.pushAttributed(P,t);if(r=r.withContentNameScopesList(N),D.endHasBackReferences&&(r=r.withEndRule(D.getEndWithResolvedBackReferences(e.content,v))),!C&&k.hasSameRuleAs(r)){r=r.pop(),s.produce(r,l),u=!0;return}}else if(E instanceof rb){const D=E;Ep(t,e,n,r,s,D.beginCaptures,v),s.produce(r,v[0].end),d=v[0].end;const P=D.getContentName(e.content,v),N=M.pushAttributed(P,t);if(r=r.withContentNameScopesList(N),D.whileHasBackReferences&&(r=r.withEndRule(D.getWhileWithResolvedBackReferences(e.content,v))),!C&&k.hasSameRuleAs(r)){r=r.pop(),s.produce(r,l),u=!0;return}}else if(Ep(t,e,n,r,s,E.captures,v),s.produce(r,v[0].end),r=r.pop(),!C){r=r.safePop(),s.produce(r,l),u=!0;return}}v[0].end>i&&(i=v[0].end,n=!1)}}function LLe(t,e,n,i,r,s){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let l=r;l;l=l.pop()){const u=l.getRule(t);u instanceof rb&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:d}=HLe(l.rule,t,l.stack.endRule,n,i===o),f=u.findNextMatchSync(e,i,d);if(f){if(f.ruleId!==iW){r=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(s.produce(l.stack,f.captureIndices[0].start),Ep(t,e,n,l.stack,s,l.rule.whileCaptures,f.captureIndices),s.produce(l.stack,f.captureIndices[0].end),o=f.captureIndices[0].end,f.captureIndices[0].end>i&&(i=f.captureIndices[0].end,n=!1))}else{r=l.stack.pop();break}}return{stack:r,linePos:i,anchorPosition:o,isFirstLine:n}}function ULe(t,e,n,i,r,s){const o=VLe(t,e,n,i,r,s),a=t.getInjections();if(a.length===0)return o;const l=FLe(a,t,e,n,i,r,s);if(!l)return o;if(!o)return l;const u=o.captureIndices[0].start,d=l.captureIndices[0].start;return d=a)&&(a=R,l=k.captureIndices,u=k.ruleId,d=v.priority,a===r))break}return l?{priorityMatch:d===-1,captureIndices:l,matchedRuleId:u}:null}function aW(t,e,n,i,r){return{ruleScanner:t.compileAG(e,n,i,r),findOptions:0}}function HLe(t,e,n,i,r){return{ruleScanner:t.compileWhileAG(e,n,i,r),findOptions:0}}function Ep(t,e,n,i,r,s,o){if(s.length===0)return;const a=e.content,l=Math.min(s.length,o.length),u=[],d=o[0].end;for(let f=0;fd)break;for(;u.length>0&&u[u.length-1].endPos<=m.start;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?r.produceFromScopes(u[u.length-1].scopes,m.start):r.produce(i,m.start),g.retokenizeCapturedWithRuleId){const S=g.getName(a,o),C=i.contentNameScopesList.pushAttributed(S,t),E=g.getContentName(a,o),k=C.pushAttributed(E,t),R=i.push(g.retokenizeCapturedWithRuleId,m.start,-1,!1,null,C,k),M=t.createOnigString(a.substring(0,m.end));oW(t,M,n&&m.start===0,m.start,R,r,!1,0),tW(M);continue}const v=g.getName(a,o);if(v!==null){const C=(u.length>0?u[u.length-1].scopes:i.contentNameScopesList).pushAttributed(v,t);u.push(new zLe(C,m.end))}}for(;u.length>0;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var zLe=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function QLe(t,e,n,i,r,s,o,a){return new $Le(t,e,n,i,r,s,o,a)}function U5(t,e,n,i,r){const s=nb(e,sb),o=rW.getCompiledRuleId(n,i,r.repository);for(const a of s)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:r,priority:a.priority})}function sb(t,e){if(e.length{for(let r=n;rn&&t.substr(0,n)===e&&t[n]==="."}var $Le=class{constructor(t,e,n,i,r,s,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new OLe(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=V5(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const l of Object.keys(r)){const u=nb(l,sb);for(const d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:r[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,i=t.lookup(n);if(i){const r=i.injections;if(r)for(let o in r)U5(e,o,r[o],this,i);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&U5(e,l,a,this,a)}})}return e.sort((r,s)=>r.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=V5(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const i=this._tokenize(t,e,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(t,e,n=0){const i=this._tokenize(t,e,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(t,e,n,i){this._rootId===-1&&(this._rootId=rW.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===p2.NULL){r=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),f=eh.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),g=this.getRule(this._rootId).getName(null,null);let m;g?m=$p.createRootAndLookUpScopeName(g,f,this):m=$p.createRoot("unknown",f),e=new p2(null,this._rootId,-1,-1,!1,null,m,m)}else r=!1,e.reset();t=t+` -`;const s=this.createOnigString(t),o=s.content.length,a=new jLe(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=oW(this,s,r,0,e,a,!0,i);return tW(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function V5(t,e){return t=uLe(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var $p=class Zs{constructor(e,n,i){this.parent=e,this.scopePath=n,this.tokenAttributes=i}static fromExtension(e,n){let i=e,r=e?.scopePath??null;for(const s of n)r=$E.push(r,s.scopeNames),i=new Zs(i,r,s.encodedTokenAttributes);return i}static createRoot(e,n){return new Zs(null,new $E(null,e),n)}static createRootAndLookUpScopeName(e,n,i){const r=i.getMetadataForScope(e),s=new $E(null,e),o=i.themeProvider.themeMatch(s),a=Zs.mergeAttributes(n,r,o);return new Zs(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Zs.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,i){let r=-1,s=0,o=0;return i!==null&&(r=i.fontStyle,s=i.foregroundId,o=i.backgroundId),eh.set(e,n.languageId,n.tokenType,null,r,s,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Zs._pushAttributed(this,e,n);const i=e.split(/ /g);let r=this;for(const s of i)r=Zs._pushAttributed(r,s,n);return r}static _pushAttributed(e,n,i){const r=i.getMetadataForScope(n),s=e.scopePath.push(n),o=i.themeProvider.themeMatch(s),a=Zs.mergeAttributes(e.tokenAttributes,r,o);return new Zs(e,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let i=this;for(;i&&i!==e;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===e?n.reverse():void 0}},p2=class Ac{constructor(e,n,i,r,s,o,a,l){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new Ac(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Ac._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?$p.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Ac._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,i,r,s,o,a){return new Ac(this,e,n,i,r,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Ac(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const i=$p.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new Ac(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,$p.fromExtension(i,n.contentNameScopesList))}},WLe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):nb(n,sb).map(i=>i.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>nb(n,sb).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},jLe=class{constructor(t,e,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let i=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(i=eh.set(i,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(s))}if(r&&(i=eh.set(i,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,r=this._binaryTokens.length;i0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,i,r,s)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(e,n=[],i=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,i,r)}_grammarForScopeName(e,n=0,i=null,r=null,s=null){return this._syncRegistry.grammarForScopeName(e,n,i,r,s)}},g2=p2.NULL;const qLe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],JLe=/["&'<>`]/g,XLe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ZLe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,e4e=/[|\\{}()[\]^$+*?.]/g,F5=new WeakMap;function t4e(t,e){if(t=t.replace(e.subset?n4e(e.subset):JLe,i),e.subset||e.escapeOnly)return t;return t.replace(XLe,n).replace(ZLe,i);function n(r,s,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function i(r,s,o){return e.format(r.charCodeAt(0),o.charCodeAt(s+1),e)}}function n4e(t){let e=F5.get(t);return e||(e=i4e(t),F5.set(t,e)),e}function i4e(t){const e=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},c4e=["cent","copy","divide","gt","lt","not","para","times"],lW={}.hasOwnProperty,m2={};let X0;for(X0 in jE)lW.call(jE,X0)&&(m2[jE[X0]]=X0);const u4e=/[^\dA-Za-z]/;function d4e(t,e,n,i){const r=String.fromCharCode(t);if(lW.call(m2,r)){const s=m2[r],o="&"+s;return n&&l4e.includes(s)&&!c4e.includes(s)&&(!i||e&&e!==61&&u4e.test(String.fromCharCode(e)))?o:o+";"}return""}function h4e(t,e,n){let i=s4e(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=d4e(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const s=a4e(t,e,n.omitOptionalSemicolons);s.length|^->||--!>|"],g4e=["<",">"];function m4e(t,e,n,i){return i.settings.bogusComments?"":"";function r(s){return Od(s,Object.assign({},i.settings.characterReferences,{subset:g4e}))}}function A4e(t,e,n,i){return""}const Vn=uW(1),cW=uW(-1),y4e=[];function uW(t){return e;function e(n,i,r){const s=n?n.children:y4e;let o=(i||0)+t,a=s[o];if(!r)for(;a&&kw(a);)o+=t,a=s[o];return a}}const v4e={}.hasOwnProperty;function dW(t){return e;function e(n,i,r){return v4e.call(t,n.tagName)&&t[n.tagName](n,i,r)}}const Wk=dW({body:w4e,caption:KE,colgroup:KE,dd:E4e,dt:x4e,head:KE,html:b4e,li:C4e,optgroup:_4e,option:T4e,p:S4e,rp:H5,rt:H5,tbody:k4e,td:z5,tfoot:I4e,th:z5,thead:R4e,tr:M4e});function KE(t,e,n){const i=Vn(n,e,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&kw(i.value.charAt(0)))}function b4e(t,e,n){const i=Vn(n,e);return!i||i.type!=="comment"}function w4e(t,e,n){const i=Vn(n,e);return!i||i.type!=="comment"}function S4e(t,e,n){const i=Vn(n,e);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function C4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&i.tagName==="li"}function x4e(t,e,n){const i=Vn(n,e);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function E4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function H5(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function _4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&i.tagName==="optgroup"}function T4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function R4e(t,e,n){const i=Vn(n,e);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function k4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function I4e(t,e,n){return!Vn(n,e)}function M4e(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&i.tagName==="tr"}function z5(t,e,n){const i=Vn(n,e);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const D4e=dW({body:O4e,colgroup:B4e,head:N4e,html:P4e,tbody:L4e});function P4e(t){const e=Vn(t,-1);return!e||e.type!=="comment"}function N4e(t){const e=new Set;for(const i of t.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(e.has(i.tagName))return!1;e.add(i.tagName)}const n=t.children[0];return!n||n.type==="element"}function O4e(t){const e=Vn(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&kw(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function B4e(t,e,n){const i=cW(n,e),r=Vn(t,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Wk(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function L4e(t,e,n){const i=cW(n,e),r=Vn(t,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Wk(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Z0={name:[[` +`);var UZe=e=>x.forwardRef(({language:t,theme:n,delay:o,transformers:r,defaultColor:i,cssVariablePrefix:s,addDefaultStyles:a=!0,style:c,langStyle:p,className:u,langClassName:l,showLanguage:d=!0,showLineNumbers:f=!1,startingLineNumber:h=1,children:m,as:g="pre",customLanguages:y,..._},S)=>{const w={delay:o,transformers:r,customLanguages:y,showLineNumbers:f,defaultColor:i,cssVariablePrefix:s,startingLineNumber:h,..._},{displayLanguageId:R}=ude(t,y),E=e(m,t,n,w),T=typeof E=="string";return F.jsxs(g,{ref:S,"data-testid":"shiki-container",className:nE("relative","not-prose",a&&"defaultStyles",u),style:c,id:"shiki-container",children:[d&&R?F.jsx("span",{className:nE("languageLabel",l),style:p,id:"language-label",children:R}):null,T?F.jsx("div",{dangerouslySetInnerHTML:{__html:E}}):E]})});const qZe="modulepreload",JZe=function(e){return"/"+e},YW={},te=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let p=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};var s=p;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");r=p(n.map(u=>{if(u=JZe(u),u in YW)return;YW[u]=!0;const l=u.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":qZe,l||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),l)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return r.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};let nr=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function VZe(e){return Sk(e)}function Sk(e){return Array.isArray(e)?HZe(e):e instanceof RegExp?e:typeof e=="object"?GZe(e):e}function HZe(e){let t=[];for(let n=0,o=e.length;n{for(let o in n)e[o]=n[o]}),e}function dde(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?dde(e.substring(0,e.length-1)):e.substr(~t+1)}var GN=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,DT=class{static hasCaptures(e){return e===null?!1:(GN.lastIndex=0,GN.test(e))}static replaceCaptures(e,t,n){return e.replace(GN,(o,r,i,s)=>{let a=n[parseInt(r||i,10)];if(a){let c=t.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(s){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return o})}};function fde(e,t){return et?1:0}function hde(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,o=t.length;if(n===o){for(let r=0;rthis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,o=this._cachedMatchRoot.get(t).find(r=>zZe(e.parent,r.parentScopes));return o?new gde(o.fontStyle,o.foreground,o.background):null}},zN=class NR{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const o of n)t=new NR(t,o);return t}static from(...t){let n=null;for(let o=0;o"){if(n===t.length-1)return!1;o=t[++n],r=!0}for(;e&&!KZe(e.scopeName,o);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function KZe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var gde=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function QZe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],o=0;for(let r=0,i=t.length;r1&&(g=h.slice(0,h.length-1),g.reverse()),n[o++]=new $Ze(m,g,r,c,p,u)}}return n}var $Ze=class{constructor(e,t,n,o,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=o,this.foreground=r,this.background=i}},eo=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(eo||{});function WZe(e,t){e.sort((c,p)=>{let u=fde(c.scope,p.scope);return u!==0||(u=hde(c.parentScopes,p.parentScopes),u!==0)?u:c.index-p.index});let n=0,o="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(o=c.foreground),c.background!==null&&(r=c.background)}let i=new YZe(t),s=new gde(n,i.getId(o),i.getId(r)),a=new ZZe(new cL(0,null,-1,0,0),[]);for(let c=0,p=e.length;ct?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),o!==0&&(this.foreground=o),r!==0&&(this.background=r)}},ZZe=class dL{constructor(t,n=[],o={}){this._mainRule=t,this._children=o,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let o=0,r=0;for(;t.parentScopes[o]===">"&&o++,n.parentScopes[r]===">"&&r++,!(o>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[o].length;if(i!==0)return i;o++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let o=t.indexOf("."),r,i;if(o===-1?(r=t,i=""):(r=t.substring(0,o),i=t.substring(o+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(dL._cmpBySpecificity),n}insert(t,n,o,r,i,s){if(n===""){this._doInsertHere(t,o,r,i,s);return}let a=n.indexOf("."),c,p;a===-1?(c=n,p=""):(c=n.substring(0,a),p=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new dL(this._mainRule.clone(),cL.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,p,o,r,i,s)}_doInsertHere(t,n,o,r,i){if(n===null){this._mainRule.acceptOverwrite(t,o,r,i);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,o,r,i,s,a){let c=Fi.getLanguageId(t),p=Fi.getTokenType(t),u=Fi.containsBalancedBrackets(t)?1:0,l=Fi.getFontStyle(t),d=Fi.getForeground(t),f=Fi.getBackground(t);return n!==0&&(c=n),o!==8&&(p=o),r!==null&&(u=r?1:0),i!==-1&&(l=i),s!==0&&(d=s),a!==0&&(f=a),(c<<0|p<<8|u<<10|l<<11|d<<15|f<<24)>>>0}};function kE(e,t){const n=[],o=eet(e);let r=o.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=o.next()}let p=s();if(n.push({matcher:p,priority:c}),r!==",")break;r=o.next()}return n;function i(){if(r==="-"){r=o.next();const c=i();return p=>!!c&&!c(p)}if(r==="("){r=o.next();const c=a();return r===")"&&(r=o.next()),c}if(ZW(r)){const c=[];do c.push(r),r=o.next();while(ZW(r));return p=>t(c,p)}return null}function s(){const c=[];let p=i();for(;p;)c.push(p),p=i();return u=>c.every(l=>l(u))}function a(){const c=[];let p=s();for(;p&&(c.push(p),r==="|"||r===",");){do r=o.next();while(r==="|"||r===",");p=s()}return u=>c.some(l=>l(u))}}function ZW(e){return!!e&&!!e.match(/[\w\.:]+/)}function eet(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const o=n[0];return n=t.exec(e),o}}}function yde(e){typeof e.dispose=="function"&&e.dispose()}var tC=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},tet=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},net=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ret=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new tC(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new net;for(const n of e)oet(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof tC){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function oet(e,t,n,o){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof tC?LR({baseGrammar:i,selfGrammar:r},o):fL(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},o);const s=n.injections(e.scopeName);if(s)for(const a of s)o.add(new tC(a))}function fL(e,t,n){if(t.repository&&t.repository[e]){const o=t.repository[e];UE([o],t,n)}}function LR(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&UE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&UE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function UE(e,t,n){for(const o of e){if(n.visitedRule.has(o))continue;n.visitedRule.add(o);const r=o.repository?cde({},t.repository,o.repository):t.repository;Array.isArray(o.patterns)&&UE(o.patterns,{...t,repository:r},n);const i=o.include;if(!i)continue;const s=Ade(i);switch(s.kind){case 0:LR({...t,selfGrammar:t.baseGrammar},n);break;case 1:LR(t,n);break;case 2:fL(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const c={baseGrammar:t.baseGrammar,selfGrammar:a,repository:r};s.kind===4?fL(s.ruleName,c,n):LR(c,n)}else s.kind===4?n.add(new tet(s.scopeName,s.ruleName)):n.add(new tC(s.scopeName));break}}}var iet=class{kind=0},set=class{kind=1},aet=class{constructor(e){this.ruleName=e}kind=2},uet=class{constructor(e){this.scopeName=e}kind=3},cet=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ade(e){if(e==="$base")return new iet;if(e==="$self")return new set;const t=e.indexOf("#");if(t===-1)return new uet(e);if(t===0)return new aet(e.substring(1));{const n=e.substring(0,t),o=e.substring(t+1);return new cet(n,o)}}var det=/\\(\d+)/,eY=/\\(\d+)/g,fet=-1,_de=-2;var iw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,n,o,r){this.$location=t,this.id=n,this._name=o||null,this._nameIsCapturing=DT.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=DT.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${dde(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,n){return!this._nameIsCapturing||this._name===null||t===null||n===null?this._name:DT.replaceCaptures(this._name,t,n)}getContentName(t,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:DT.replaceCaptures(this._contentName,t,n)}},het=class extends iw{retokenizeCapturedWithRuleId;constructor(e,t,n,o,r){super(e,t,n,o),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,o){throw new Error("Not supported!")}},pet=class extends iw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,null),this._match=new nC(o,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rC,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tY=class extends iw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,o),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rC,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hL=class extends iw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r,i,s,a,c,p){super(e,t,n,o),this._begin=new nC(r,this.id),this.beginCaptures=i,this._end=new nC(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,o)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rC;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},qE=class extends iw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,o,r,i,s,a,c){super(e,t,n,o),this._begin=new nC(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new nC(s,_de),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rC;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,o){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,o)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new rC,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},vde=class Yr{static createCaptureRule(t,n,o,r,i){return t.registerRule(s=>new het(n,s,o,r,i))}static getCompiledRuleId(t,n,o){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new pet(t.$vscodeTextmateLocation,t.id,t.name,t.match,Yr._compileCaptures(t.captures,n,o));if(typeof t.begin>"u"){t.repository&&(o=cde({},o,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new tY(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Yr._compilePatterns(i,n,o))}return t.while?new qE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Yr._compileCaptures(t.beginCaptures||t.captures,n,o),t.while,Yr._compileCaptures(t.whileCaptures||t.captures,n,o),Yr._compilePatterns(t.patterns,n,o)):new hL(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Yr._compileCaptures(t.beginCaptures||t.captures,n,o),t.end,Yr._compileCaptures(t.endCaptures||t.captures,n,o),t.applyEndPatternLast,Yr._compilePatterns(t.patterns,n,o))}),t.id}static _compileCaptures(t,n,o){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>i&&(i=a)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let c=0;t[s].patterns&&(c=Yr.getCompiledRuleId(t[s],n,o)),r[a]=Yr.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,c)}}return r}static _compilePatterns(t,n,o){let r=[];if(t)for(let i=0,s=t.length;it.substring(r.start,r.end));return eY.lastIndex=0,this.source.replace(eY,(r,i)=>pde(o[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],o=[],r=[],i,s,a,c;for(i=0,s=this.source.length;in.source);this._cached=new nY(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let o=this._items.map(r=>r.resolveAnchors(t,n));return new nY(e,o,this._items.map(r=>r.ruleId))}},nY=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),o=this._toStandardTokenType(t);return new KN(n,o)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(pL.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},get=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,o])=>pde(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},rY=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Cde(e,t,n,o,r,i,s,a){const c=t.content.length;let p=!1,u=-1;if(s){const f=bet(e,t,n,o,r,i);r=f.stack,o=f.linePos,n=f.isFirstLine,u=f.anchorPosition}const l=Date.now();for(;!p;){if(a!==0&&Date.now()-l>a)return new rY(r,!0);d()}return new rY(r,!1);function d(){const f=yet(e,t,n,o,r,u);if(!f){i.produce(r,c),p=!0;return}const h=f.captureIndices,m=f.matchedRuleId,g=h&&h.length>0?h[0].end>o:!1;if(m===fet){const y=r.getRule(e);i.produce(r,h[0].start),r=r.withContentNameScopesList(r.nameScopesList),n0(e,t,n,r,i,y.endCaptures,h),i.produce(r,h[0].end);const _=r;if(r=r.parent,u=_.getAnchorPos(),!g&&_.getEnterPos()===o){r=_,i.produce(r,c),p=!0;return}}else{const y=e.getRule(m);i.produce(r,h[0].start);const _=r,S=y.getName(t.content,h),w=r.contentNameScopesList.pushAttributed(S,e);if(r=r.push(m,o,u,h[0].end===c,null,w,w),y instanceof hL){const R=y;n0(e,t,n,r,i,R.beginCaptures,h),i.produce(r,h[0].end),u=h[0].end;const E=R.getContentName(t.content,h),T=w.pushAttributed(E,e);if(r=r.withContentNameScopesList(T),R.endHasBackReferences&&(r=r.withEndRule(R.getEndWithResolvedBackReferences(t.content,h))),!g&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),p=!0;return}}else if(y instanceof qE){const R=y;n0(e,t,n,r,i,R.beginCaptures,h),i.produce(r,h[0].end),u=h[0].end;const E=R.getContentName(t.content,h),T=w.pushAttributed(E,e);if(r=r.withContentNameScopesList(T),R.whileHasBackReferences&&(r=r.withEndRule(R.getWhileWithResolvedBackReferences(t.content,h))),!g&&_.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),p=!0;return}}else if(n0(e,t,n,r,i,y.captures,h),i.produce(r,h[0].end),r=r.pop(),!g){r=r.safePop(),i.produce(r,c),p=!0;return}}h[0].end>o&&(o=h[0].end,n=!1)}}function bet(e,t,n,o,r,i){let s=r.beginRuleCapturedEOL?0:-1;const a=[];for(let c=r;c;c=c.pop()){const p=c.getRule(e);p instanceof qE&&a.push({rule:p,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:p,findOptions:u}=vet(c.rule,e,c.stack.endRule,n,o===s),l=p.findNextMatchSync(t,o,u);if(l){if(l.ruleId!==_de){r=c.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(i.produce(c.stack,l.captureIndices[0].start),n0(e,t,n,c.stack,i,c.rule.whileCaptures,l.captureIndices),i.produce(c.stack,l.captureIndices[0].end),s=l.captureIndices[0].end,l.captureIndices[0].end>o&&(o=l.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:o,anchorPosition:s,isFirstLine:n}}function yet(e,t,n,o,r,i){const s=Aet(e,t,n,o,r,i),a=e.getInjections();if(a.length===0)return s;const c=_et(a,e,t,n,o,r,i);if(!c)return s;if(!s)return c;const p=s.captureIndices[0].start,u=c.captureIndices[0].start;return u=a)&&(a=S,c=_.captureIndices,p=_.ruleId,u=h.priority,a===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:p}:null}function wde(e,t,n,o,r){return{ruleScanner:e.compileAG(t,n,o,r),findOptions:0}}function vet(e,t,n,o,r){return{ruleScanner:e.compileWhileAG(t,n,o,r),findOptions:0}}function n0(e,t,n,o,r,i,s){if(i.length===0)return;const a=t.content,c=Math.min(i.length,s.length),p=[],u=s[0].end;for(let l=0;lu)break;for(;p.length>0&&p[p.length-1].endPos<=f.start;)r.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop();if(p.length>0?r.produceFromScopes(p[p.length-1].scopes,f.start):r.produce(o,f.start),d.retokenizeCapturedWithRuleId){const m=d.getName(a,s),g=o.contentNameScopesList.pushAttributed(m,e),y=d.getContentName(a,s),_=g.pushAttributed(y,e),S=o.push(d.retokenizeCapturedWithRuleId,f.start,-1,!1,null,g,_),w=e.createOnigString(a.substring(0,f.end));Cde(e,w,n&&f.start===0,f.start,S,r,!1,0),yde(w);continue}const h=d.getName(a,s);if(h!==null){const g=(p.length>0?p[p.length-1].scopes:o.contentNameScopesList).pushAttributed(h,e);p.push(new Cet(g,f.end))}}for(;p.length>0;)r.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop()}var Cet=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function wet(e,t,n,o,r,i,s,a){return new Tet(e,t,n,o,r,i,s,a)}function oY(e,t,n,o,r){const i=kE(t,JE),s=vde.getCompiledRuleId(n,o,r.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:r,priority:a.priority})}function JE(e,t){if(t.length{for(let r=n;rn&&e.substr(0,n)===t&&e[n]==="."}var Tet=class{constructor(e,t,n,o,r,i,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new met(n,o),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=iY(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const p=kE(c,JE);for(const u of p)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,o=e.lookup(n);if(o){const r=o.injections;if(r)for(let s in r)oY(t,s,r[s],this,o);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const c=a.injectionSelector;c&&oY(t,c,a,this,a)}})}return t.sort((r,i)=>r.priority-i.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=iY(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const o=this._tokenize(e,t,!1,n);return{tokens:o.lineTokens.getResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}tokenizeLine2(e,t,n=0){const o=this._tokenize(e,t,!0,n);return{tokens:o.lineTokens.getBinaryResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}_tokenize(e,t,n,o){this._rootId===-1&&(this._rootId=vde.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===mL.NULL){r=!0;const p=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),l=vA.set(0,p.languageId,p.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let f;d?f=S0.createRootAndLookUpScopeName(d,l,this):f=S0.createRoot("unknown",l),t=new mL(null,this._rootId,-1,-1,!1,null,f,f)}else r=!1,t.reset();e=e+` +`;const i=this.createOnigString(e),s=i.content.length,a=new Eet(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Cde(this,i,r,0,t,a,!0,o);return yde(i),{lineLength:s,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function iY(e,t){return e=VZe(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var S0=class ml{constructor(t,n,o){this.parent=t,this.scopePath=n,this.tokenAttributes=o}static fromExtension(t,n){let o=t,r=t?.scopePath??null;for(const i of n)r=zN.push(r,i.scopeNames),o=new ml(o,r,i.encodedTokenAttributes);return o}static createRoot(t,n){return new ml(null,new zN(null,t),n)}static createRootAndLookUpScopeName(t,n,o){const r=o.getMetadataForScope(t),i=new zN(null,t),s=o.themeProvider.themeMatch(i),a=ml.mergeAttributes(n,r,s);return new ml(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ml.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,o){let r=-1,i=0,s=0;return o!==null&&(r=o.fontStyle,i=o.foregroundId,s=o.backgroundId),vA.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ml._pushAttributed(this,t,n);const o=t.split(/ /g);let r=this;for(const i of o)r=ml._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,o){const r=o.getMetadataForScope(n),i=t.scopePath.push(n),s=o.themeProvider.themeMatch(i),a=ml.mergeAttributes(t.tokenAttributes,r,s);return new ml(t,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let o=this;for(;o&&o!==t;)n.push({encodedTokenAttributes:o.tokenAttributes,scopeNames:o.scopePath.getExtensionIfDefined(o.parent?.scopePath??null)}),o=o.parent;return o===t?n.reverse():void 0}},mL=class Cg{constructor(t,n,o,r,i,s,a,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=o,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new Cg(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Cg._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?S0.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Cg._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,o,r,i,s,a){return new Cg(this,t,n,o,r,i,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Cg(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const o=S0.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Cg(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,o,S0.fromExtension(o,n.contentNameScopesList))}},Ret=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):kE(n,JE).map(o=>o.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>kE(n,JE).map(o=>o.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Eet=class{constructor(e,t,n,o){this.balancedBracketSelectors=o,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(o=vA.set(o,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(o=vA.set(o,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let o=0,r=this._binaryTokens.length;o0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,o,r,i)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const o=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,o)}}addGrammar(t,n=[],o=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,o,r)}_grammarForScopeName(t,n=0,o=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,o,r,i)}},gL=mL.NULL;const Iet=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],jet=/["&'<>`]/g,Det=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Net=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Let=/[|\\{}()[\]^$+*?.]/g,sY=new WeakMap;function Fet(e,t){if(e=e.replace(t.subset?xet(t.subset):jet,o),t.subset||t.escapeOnly)return e;return e.replace(Det,n).replace(Net,o);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function o(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function xet(e){let t=sY.get(e);return t||(t=Bet(e),sY.set(e,t)),t}function Bet(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Het=["cent","copy","divide","gt","lt","not","para","times"],Ode={}.hasOwnProperty,bL={};let NT;for(NT in QN)Ode.call(QN,NT)&&(bL[QN[NT]]=NT);const Get=/[^\dA-Za-z]/;function zet(e,t,n,o){const r=String.fromCharCode(e);if(Ode.call(bL,r)){const i=bL[r],s="&"+i;return n&&Vet.includes(i)&&!Het.includes(i)&&(!o||t&&t!==61&&Get.test(String.fromCharCode(t)))?s:s+";"}return""}function Ket(e,t,n){let o=Uet(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=zet(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Jet(e,t,n.omitOptionalSemicolons);i.length|^->||--!>|"],Wet=["<",">"];function Yet(e,t,n,o){return o.settings.bogusComments?"":"";function r(i){return nA(i,Object.assign({},o.settings.characterReferences,{subset:Wet}))}}function Xet(e,t,n,o){return""}const vr=Rde(1),Tde=Rde(-1),Zet=[];function Rde(e){return t;function t(n,o,r){const i=n?n.children:Zet;let s=(o||0)+e,a=i[s];if(!r)for(;a&&RP(a);)s+=e,a=i[s];return a}}const ett={}.hasOwnProperty;function Ede(e){return t;function t(n,o,r){return ett.call(e,n.tagName)&&e[n.tagName](n,o,r)}}const Ck=Ede({body:ntt,caption:$N,colgroup:$N,dd:stt,dt:itt,head:$N,html:ttt,li:ott,optgroup:att,option:ltt,p:rtt,rp:aY,rt:aY,tbody:ctt,td:lY,tfoot:dtt,th:lY,thead:utt,tr:ftt});function $N(e,t,n){const o=vr(n,t,!0);return!o||o.type!=="comment"&&!(o.type==="text"&&RP(o.value.charAt(0)))}function ttt(e,t,n){const o=vr(n,t);return!o||o.type!=="comment"}function ntt(e,t,n){const o=vr(n,t);return!o||o.type!=="comment"}function rtt(e,t,n){const o=vr(n,t);return o?o.type==="element"&&(o.tagName==="address"||o.tagName==="article"||o.tagName==="aside"||o.tagName==="blockquote"||o.tagName==="details"||o.tagName==="div"||o.tagName==="dl"||o.tagName==="fieldset"||o.tagName==="figcaption"||o.tagName==="figure"||o.tagName==="footer"||o.tagName==="form"||o.tagName==="h1"||o.tagName==="h2"||o.tagName==="h3"||o.tagName==="h4"||o.tagName==="h5"||o.tagName==="h6"||o.tagName==="header"||o.tagName==="hgroup"||o.tagName==="hr"||o.tagName==="main"||o.tagName==="menu"||o.tagName==="nav"||o.tagName==="ol"||o.tagName==="p"||o.tagName==="pre"||o.tagName==="section"||o.tagName==="table"||o.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ott(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&o.tagName==="li"}function itt(e,t,n){const o=vr(n,t);return!!(o&&o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd"))}function stt(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd")}function aY(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&(o.tagName==="rp"||o.tagName==="rt")}function att(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&o.tagName==="optgroup"}function ltt(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&(o.tagName==="option"||o.tagName==="optgroup")}function utt(e,t,n){const o=vr(n,t);return!!(o&&o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot"))}function ctt(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot")}function dtt(e,t,n){return!vr(n,t)}function ftt(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&o.tagName==="tr"}function lY(e,t,n){const o=vr(n,t);return!o||o.type==="element"&&(o.tagName==="td"||o.tagName==="th")}const htt=Ede({body:gtt,colgroup:btt,head:mtt,html:ptt,tbody:ytt});function ptt(e){const t=vr(e,-1);return!t||t.type!=="comment"}function mtt(e){const t=new Set;for(const o of e.children)if(o.type==="element"&&(o.tagName==="base"||o.tagName==="title")){if(t.has(o.tagName))return!1;t.add(o.tagName)}const n=e.children[0];return!n||n.type==="element"}function gtt(e){const t=vr(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&RP(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function btt(e,t,n){const o=Tde(n,t),r=vr(e,-1,!0);return n&&o&&o.type==="element"&&o.tagName==="colgroup"&&Ck(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function ytt(e,t,n){const o=Tde(n,t),r=vr(e,-1);return n&&o&&o.type==="element"&&(o.tagName==="thead"||o.tagName==="tbody")&&Ck(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const LT={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -264,33 +273,33 @@ ${X.content[0].text}`;for(const z of e)z.status?.type==="incomplete"&&z.status?. \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function U4e(t,e,n,i){const r=i.schema,s=r.space==="svg"?!1:i.settings.omitOptionalTags;let o=r.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;r.space==="html"&&t.tagName==="svg"&&(i.schema=Am);const u=V4e(i,t.properties),d=i.all(r.space==="html"&&t.tagName==="template"?t.content:t);return i.schema=r,d&&(o=!1),(u||!s||!D4e(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),o&&(r.space==="svg"||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(d),!o&&(!s||!Wk(t,e,n))&&a.push(""),a.join("")}function V4e(t,e){const n=[];let i=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const s=F4e(t,r,e[r]);s&&n.push(s)}}for(;++iZv(n,t.alternative)&&(o=t.alternative),a=o+Od(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?Z0.single:Z0.double)[r][s],attribute:!0}))+o),l+(a&&"="+a))}const H4e=["<","&"];function hW(t,e,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Od(t.value,Object.assign({},i.settings.characterReferences,{subset:H4e}))}function z4e(t,e,n,i){return i.settings.allowDangerousHtml?t.value:hW(t,e,n,i)}function Q4e(t,e,n,i){return i.all(t)}const G4e=MOe("type",{invalid:$4e,unknown:W4e,handlers:{comment:m4e,doctype:A4e,element:U4e,raw:z4e,root:Q4e,text:hW}});function $4e(t){throw new Error("Expected node, not `"+t+"`")}function W4e(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const j4e={},K4e={},Y4e=[];function q4e(t,e){const n=e||j4e,i=n.quote||'"',r=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:J4e,all:X4e,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||qLe,characterReferences:n.characterReferences||K4e,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Am:HG,quote:i,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function J4e(t,e,n){return G4e(t,e,n,this)}function X4e(t){const e=[],n=t&&t.children||Y4e;let i=-1;for(;++ie.default||e)}function jk(t){return!t||["plaintext","txt","text","plain"].includes(t)}function pW(t){return t==="ansi"||jk(t)}function Kk(t){return t==="none"}function gW(t){return Kk(t)}function mW(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const i of n)i&&!t.properties.class.includes(i)&&t.properties.class.push(i);return t}function Ow(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let i=0;const r=[];for(let s=0;sr);function n(r){if(r===t.length)return{line:e.length-1,character:e[e.length-1].length};let s=r,o=0;for(const a of e){if(ss&&r[s])}const Yk="light-dark()",nUe=["color","background-color"];function iUe(t,e){let n=0;const i=[];for(const r of e)r>n&&i.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return ni-r);return n.length?t.map(i=>i.flatMap(r=>{const s=n.filter(o=>r.offseto-r.offset).sort((o,a)=>o-a);return s.length?iUe(r,s):r})):t}function sUe(t,e,n,i,r="css-vars"){const s={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(d=>ab(t.variants[d])),a=new Set(o.flatMap(d=>Object.keys(d))),l={},u=(d,f)=>{const g=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+e[d]+(f==="color"?"":g)};return o.forEach((d,f)=>{for(const g of a){const m=d[g]||"inherit";if(f===0&&i&&nUe.includes(g))if(i===Yk&&o.length>1){const v=e.findIndex(k=>k==="light"),S=e.findIndex(k=>k==="dark");if(v===-1||S===-1)throw new Sn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][g]||"inherit",E=o[S][g]||"inherit";l[g]=`light-dark(${C}, ${E})`,r==="css-vars"&&(l[u(f,g)]=m)}else l[g]=m;else r==="css-vars"&&(l[u(f,g)]=m)}}),s.htmlStyle=l,s}function ab(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&pi.Italic&&(e["font-style"]="italic"),t.fontStyle&pi.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&pi.Underline&&n.push("underline"),t.fontStyle&pi.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function A2(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const AW=new WeakMap;function Bw(t,e){AW.set(t,e)}function Tg(t){return AW.get(t)}class Rh{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Rh(Object.fromEntries(Z4e(n).map(i=>[i,g2])),e)}constructor(...e){if(e.length===2){const[n,i]=e;this.lang=i,this._stacks=n}else{const[n,i,r]=e;this.lang=i,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return oUe(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function oUe(t){const e=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);const s=r?.nameScopesList?.scopeName;s&&e.push(s),r.parent&&i(r.parent)}return i(t),e}function aUe(t,e){if(!(t instanceof Rh))throw new Sn("Invalid grammar state");return t.getInternalStack(e)}function lUe(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let i=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Sn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{const a=r.lines[o.line];if(a===void 0)throw new Sn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Sn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:r.posToIndex(o.line,l)}}};const r=eUe(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:i(o.start),end:i(o.end)}));cUe(s),t.set(n.meta,{decorations:s,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=e(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return rUe(n,r)},code(n){if(!this.options.decorations?.length)return;const i=e(this),r=Array.from(n.children).filter(d=>d.type==="element"&&d.tagName==="span");if(r.length!==i.converter.lines.length)throw new Sn(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function s(d,f,g,m){const v=r[d];let S="",C=-1,E=-1;if(f===0&&(C=0),g===0&&(E=0),g===Number.POSITIVE_INFINITY&&(E=v.children.length),C===-1||E===-1)for(let R=0;RS);return d.tagName=f.tagName||"span",d.properties={...d.properties,...m,class:d.properties.class},f.properties?.class&&mW(d,f.properties.class),d=v(d,g)||d,d}const l=[],u=i.decorations.sort((d,f)=>f.start.offset-d.start.offset||d.end.offset-f.end.offset);for(const d of u){const{start:f,end:g}=d;if(f.line===g.line)s(f.line,f.character,g.character,d);else if(f.lineo(m,d));s(g.line,0,g.character,d)}}l.forEach(d=>d())}}}function cUe(t){for(let e=0;en.end.offset)throw new Sn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=e+1;iNumber.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function fUe(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)e.push({type:"resetAll"});else if(i<=9)YE[i]&&e.push({type:"setDecoration",value:YE[i]});else if(i<=29){const r=YE[i-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)e.push({type:"setForegroundColor",value:{type:"named",name:Rc[i-30]}});else if(i===38){const r=Q5(t);r&&e.push({type:"setForegroundColor",value:r})}else if(i===39)e.push({type:"resetForegroundColor"});else if(i<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:Rc[i-40]}});else if(i===48){const r=Q5(t);r&&e.push({type:"setBackgroundColor",value:r})}else i===49?e.push({type:"resetBackgroundColor"}):i===53?e.push({type:"setDecoration",value:"overline"}):i===55?e.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?e.push({type:"setForegroundColor",value:{type:"named",name:Rc[i-90+8]}}):i>=100&&i<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:Rc[i-100+8]}})}return e}function pUe(){let t=null,e=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=hUe(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const l=fUe(o.sequence);for(const u of l)u.type==="resetAll"?(t=null,e=null,n.clear()):u.type==="resetForegroundColor"?t=null:u.type==="resetBackgroundColor"?e=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?t=u.value:u.type==="setBackgroundColor"?e=u.value:u.type==="setDecoration"&&n.add(u.value)}s=o.position}while(sMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let u=0;u{const u=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,d=t.colors?.[u];return[l,d||AUe[l]]})),o=mUe(s),a=pUe();return r.map(l=>a.parse(l[0]).map(u=>{let d,f;u.decorations.has("reverse")?(d=u.background?o.value(u.background):t.bg,f=u.foreground?o.value(u.foreground):t.fg):(d=u.foreground?o.value(u.foreground):t.fg,f=u.background?o.value(u.background):void 0),d=yl(d,i),f=yl(f,i),u.decorations.has("dim")&&(d=vUe(d));let g=pi.None;return u.decorations.has("bold")&&(g|=pi.Bold),u.decorations.has("italic")&&(g|=pi.Italic),u.decorations.has("underline")&&(g|=pi.Underline),u.decorations.has("strikethrough")&&(g|=pi.Strikethrough),{content:u.value,offset:l[1],color:d,bgColor:f,fontStyle:g}}))}function vUe(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const i=e[1];if(i.length===8){const r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const r=i[0],s=i[1],o=i[2],a=i[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${s}${s}${o}${o}${l}`}else if(i.length===3){const r=i[0],s=i[1],o=i[2];return`#${r}${r}${s}${s}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function qk(t,e,n={}){const{theme:i=t.getLoadedThemes()[0]}=n,r=t.resolveLangAlias(n.lang||"text");if(jk(r)||Kk(i))return Ow(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:o}=t.setTheme(i);if(r==="ansi")return yUe(s,e,n);const a=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Sn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Sn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return wUe(e,a,s,o,n)}function bUe(...t){if(t.length===2)return Tg(t[1]);const[e,n,i={}]=t,{lang:r="text",theme:s=e.getLoadedThemes()[0]}=i;if(jk(r)||Kk(s))throw new Sn("Plain language does not have grammar state");if(r==="ansi")throw new Sn("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(s),l=e.getLanguage(r);return new Rh(Jk(n,l,o,a,i).stateStack,l.name,o.name)}function wUe(t,e,n,i,r){const s=Jk(t,e,n,i,r),o=new Rh(s.stateStack,e.name,n.name);return Bw(s.tokens,o),s.tokens}function Jk(t,e,n,i,r){const s=ob(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,l=Ow(t);let u=r.grammarState?aUe(r.grammarState,n.name)??g2:r.grammarContextCode!=null?Jk(r.grammarContextCode,e,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:g2,d=[];const f=[];for(let g=0,m=l.length;g0&&v.length>=o){d=[],f.push([{content:v,offset:S,color:"",fontStyle:0}]);continue}let C,E,k;r.includeExplanation&&(C=e.tokenizeLine(v,u,a),E=C.tokens,k=0);const R=e.tokenizeLine2(v,u,a),M=R.tokens.length/2;for(let D=0;DQ.trim());break;case"object":Z=J.scope;break;default:continue}K.push({settings:J,selectors:Z.map(Q=>Q.split(/ /))})}$.explanation=[];let X=0;for(;P+X({scopeName:e}))}function CUe(t,e){const n=[];for(let i=0,r=e.length;i=0&&r>=0;)G5(t[i],n[r])&&(i-=1),r-=1;return i===-1}function EUe(t,e,n){const i=[];for(const{selectors:r,settings:s}of t)for(const o of r)if(xUe(o,e,n)){i.push(s);break}return i}function vW(t,e,n){const i=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),r=i.map(l=>{const u=qk(t,e,{...n,theme:l.theme}),d=Tg(u),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:d,theme:f}}),s=_Ue(...r.map(l=>l.tokens)),o=s[0].map((l,u)=>l.map((d,f)=>{const g={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=d.explanation),s.forEach((m,v)=>{const{content:S,explanation:C,offset:E,...k}=m[u][f];g.variants[i[v].color]=k}),g})),a=r[0].state?new Rh(Object.fromEntries(r.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),r[0].state.lang):void 0;return a&&Bw(o,a),o}function _Ue(...t){const e=t.map(()=>[]),n=t.length;for(let i=0;il[i]),s=e.map(()=>[]);e.forEach((l,u)=>l.push(s[u]));const o=r.map(()=>0),a=r.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;uE[1]).map(E=>({color:E[0],theme:E[1]})).sort((E,k)=>E.color===u?-1:k.color===u?1:0);if(g.length===0)throw new Sn("`themes` option must not be empty");const m=vW(t,e,n);if(l=Tg(m),u&&Yk!==u&&!g.find(E=>E.color===u))throw new Sn(`\`themes\` option must contain the defaultColor key \`${u}\``);const v=g.map(E=>t.getTheme(E.theme)),S=g.map(E=>E.color);s=m.map(E=>E.map(k=>sUe(k,S,d,u,f))),l&&Bw(s,l);const C=g.map(E=>ob(E.theme,n));r=$5(g,v,C,d,u,"fg",f),i=$5(g,v,C,d,u,"bg",f),o=`shiki-themes ${v.map(E=>E.name).join(" ")}`,a=u?void 0:[r,i].join(";")}else if("theme"in n){const u=ob(n.theme,n);s=qk(t,e,n);const d=t.getTheme(n.theme);i=yl(d.bg,u),r=yl(d.fg,u),o=d.name,l=Tg(s)}else throw new Sn("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function $5(t,e,n,i,r,s,o){return t.map((a,l)=>{const u=yl(e[l][s],n[l])||"inherit",d=`${i+a.color}${s==="bg"?"-bg":""}:${u}`;if(l===0&&r){if(r===Yk&&t.length>1){const f=t.findIndex(S=>S.color==="light"),g=t.findIndex(S=>S.color==="dark");if(f===-1||g===-1)throw new Sn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=yl(e[f][s],n[f])||"inherit",v=yl(e[g][s],n[g])||"inherit";return`light-dark(${m}, ${v});${d}`}return u}return o==="css-vars"?d:null}).filter(a=>!!a).join(";")}function ub(t,e,n,i={meta:{},options:n,codeToHast:(r,s)=>ub(t,r,s),codeToTokens:(r,s)=>cb(t,r,s)}){let r=e;for(const v of lb(n))r=v.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:u,grammarState:d}=cb(t,r,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?s=RUe(s):f==="never"&&(s=kUe(s)),g&&(s=IUe(s));const m={...i,get source(){return r}};for(const v of lb(n))s=v.tokens?.call(m,s)||s;return TUe(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},m,d)}function TUe(t,e,n,i=Tg(t)){const r=lb(e),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e,u={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?u.style=e.rootStyle:u.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[S,C]of Object.entries(e.meta||{}))S.startsWith("_")||(u[S]=C);let d={type:"element",tagName:"pre",properties:u,children:[],data:e.data},f={type:"element",tagName:"code",properties:{},children:s};const g=[],m={...n,structure:a,addClassToHast:mW,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return d},get code(){return f},get lines(){return g}};if(t.forEach((S,C)=>{C&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:` -`}));let E={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const R of S){let M={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]};const D=A2(R.htmlStyle||ab(R));D&&(M.properties.style=D);for(const P of r)M=P?.span?.call(m,M,C+1,k,E,R)||M;a==="inline"?o.children.push(M):a==="classic"&&E.children.push(M),k+=R.content.length}if(a==="classic"){for(const R of r)E=R?.line?.call(m,E,C+1)||E;g.push(E),s.push(E)}else a==="inline"&&g.push(E)}),a==="classic"){for(const S of r)f=S?.code?.call(m,f)||f;d.children.push(f);for(const S of r)d=S?.pre?.call(m,d)||d;o.children.push(d)}else if(a==="inline"){const S=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of o.children)R.type==="element"&&R.tagName==="br"?(S.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&C.children.push(R);S.push(C);let k={type:"element",tagName:"code",properties:{},children:S};for(const R of r)k=R?.code?.call(m,k)||k;o.children=[];for(let R=0;R0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const M=k.children[R];M.type==="element"&&o.children.push(...M.children)}}let v=o;for(const S of r)v=S?.root?.call(m,v)||v;return i&&Bw(v,i),v}function RUe(t){return t.map(e=>{const n=[];let i="",r;return e.forEach((s,o)=>{const l=!(s.fontStyle&&(s.fontStyle&pi.Underline||s.fontStyle&pi.Strikethrough));l&&s.content.match(/^\s+$/)&&e[o+1]?(r===void 0&&(r=s.offset),i+=s.content):i?(l?n.push({...s,offset:r,content:i+s.content}):n.push({content:i,offset:r},s),r=void 0,i=""):n.push(s)}),n})}function kUe(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const i=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!i)return n;const[,r,s,o]=i;if(!r&&!o)return n;const a=[{...n,offset:n.offset+r.length,content:s}];return r&&a.unshift({content:r,offset:n.offset}),o&&a.push({content:o,offset:n.offset+r.length+s.length}),a}))}function IUe(t){return t.map(e=>{const n=[];for(const i of e){if(n.length===0){n.push({...i});continue}const r=n[n.length-1],s=A2(r.htmlStyle||ab(r)),o=A2(i.htmlStyle||ab(i)),a=r.fontStyle&&(r.fontStyle&pi.Underline||r.fontStyle&pi.Strikethrough),l=i.fontStyle&&(i.fontStyle&pi.Underline||i.fontStyle&pi.Strikethrough);!a&&!l&&s===o?r.content+=i.content:n.push({...i})}return n})}const MUe=q4e;function DUe(t,e,n){const i={meta:{},options:n,codeToHast:(s,o)=>ub(t,s,o),codeToTokens:(s,o)=>cb(t,s,o)};let r=MUe(ub(t,e,n,i));for(const s of lb(n))r=s.postprocess?.call(i,r,n)||r;return r}const W5={light:"#333333",dark:"#bbbbbb"},j5={light:"#fffffe",dark:"#1e1e1e"},K5="__shiki_resolved";function Xk(t){if(t?.[K5])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:i}=e;if(!n||!i){const a=e.settings?e.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(i=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!i&&e?.colors?.["editor.foreground"]&&(i=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),i||(i=e.type==="light"?W5.light:W5.dark),n||(n=e.type==="light"?j5.light:j5.dark),e.fg=i,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let r=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);r+=1;const l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}e.settings=e.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const d={...a,settings:{...a.settings}};if(l){const f=o(a.settings.foreground);e.colorReplacements[f]=a.settings.foreground,d.settings.foreground=f}if(u){const f=o(a.settings.background);e.colorReplacements[f]=a.settings.background,d.settings.background=f}return d});for(const a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){const l=o(e.colors[a]);e.colorReplacements[l]=e.colors[a],e.colors[a]=l}return Object.defineProperty(e,K5,{enumerable:!1,writable:!1,value:!0}),e}async function bW(t){return Array.from(new Set((await Promise.all(t.filter(e=>!pW(e)).map(async e=>await fW(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function wW(t){return(await Promise.all(t.map(async n=>gW(n)?null:Xk(await fW(n))))).filter(n=>!!n)}let PUe=3;function NUe(t,e=3){e>PUe||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let Sd=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function SW(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new Sd(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class OUe extends YLe{constructor(e,n,i,r={}){super(e),this._resolver=e,this._themes=n,this._langs=i,this._alias=r,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=Xk(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=tb.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=SW(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const i={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,i);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),i=n.filter(([r,s])=>!s);if(i.length){const r=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(l=>i.map(([u])=>u).includes(l)):!1).filter(s=>!i.includes(s));throw new Sd(`Missing languages ${i.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of n)this._resolver.addLanguage(s);for(const[r,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const i of n)this._langGraph.set(i,this._langMap.get(i))}}class BUe{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:i=>e.createScanner(i),createOnigString:i=>e.createString(i)},n.forEach(i=>this.addLanguage(i))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let i=[];for(let r=1;r<=n.length;r++){const s=n.slice(0,r).join(".");i=[...i,...this._injections.get(s)||[]]}return i}}let Zf=0;function LUe(t){Zf+=1,t.warnings!==!1&&Zf>=10&&Zf%10===0&&console.warn(`[Shiki] ${Zf} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new Sd("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),i=(t.themes||[]).flat(1).map(Xk),r=new BUe(t.engine,n),s=new OUe(r,i,n,t.langAlias);let o;function a(R){return SW(R,t.langAlias)}function l(R){E();const M=s.getGrammar(typeof R=="string"?R:R.name);if(!M)throw new Sd(`Language \`${R}\` not found, you may need to load it first`);return M}function u(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};E();const M=s.getTheme(R);if(!M)throw new Sd(`Theme \`${R}\` not found, you may need to load it first`);return M}function d(R){E();const M=u(R);o!==R&&(s.setTheme(M),o=R);const D=s.getColorMap();return{theme:M,colorMap:D}}function f(){return E(),s.getLoadedThemes()}function g(){return E(),s.getLoadedLanguages()}function m(...R){E(),s.loadLanguages(R.flat(1))}async function v(...R){return m(await bW(R))}function S(...R){E();for(const M of R.flat(1))s.loadTheme(M)}async function C(...R){return E(),S(await wW(R))}function E(){if(e)throw new Sd("Shiki instance has been disposed")}function k(){e||(e=!0,s.dispose(),Zf-=1)}return{setTheme:d,getTheme:u,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:v,loadLanguageSync:m,loadTheme:C,loadThemeSync:S,dispose:k,[Symbol.dispose]:k}}async function UUe(t){t.engine||NUe("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,i]=await Promise.all([wW(t.themes||[]),bW(t.langs||[]),t.engine]);return LUe({...t,themes:e,langs:n,engine:i})}async function VUe(t){const e=await UUe(t);return{getLastGrammarState:(...n)=>bUe(e,...n),codeToTokensBase:(n,i)=>qk(e,n,i),codeToTokensWithThemes:(n,i)=>vW(e,n,i),codeToTokens:(n,i)=>cb(e,n,i),codeToHast:(n,i)=>ub(e,n,i),codeToHtml:(n,i)=>DUe(e,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function FUe(t){const e=t.langs,n=t.themes,i=t.engine;async function r(s){function o(f){if(typeof f=="string"){if(f=s.langAlias?.[f]||f,pW(f))return[];const g=e[f];if(!g)throw new Sn(`Language \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}function a(f){if(gW(f))return"none";if(typeof f=="string"){const g=n[f];if(!g)throw new Sn(`Theme \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}const l=(s.themes??[]).map(f=>a(f)),u=(s.langs??[]).map(f=>o(f)),d=await VUe({engine:s.engine??i(),...s,themes:l,langs:u});return{...d,loadLanguage(...f){return d.loadLanguage(...f.map(o))},loadTheme(...f){return d.loadTheme(...f.map(a))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return r}function HUe(t){let e;async function n(i={}){if(e){const r=await e;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}else{e=t({...i,themes:[],langs:[]});const r=await e;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}}return n}function zUe(t,e){const n=HUe(t);async function i(r,s){const o=await n({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)}),a=await e?.guessEmbeddedLanguages?.(r,s.lang,o);return a&&await o.loadLanguage(...a),o}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,s){return(await i(r,s)).codeToHtml(r,s)},async codeToHast(r,s){return(await i(r,s)).codeToHast(r,s)},async codeToTokens(r,s){return(await i(r,s)).codeToTokens(r,s)},async codeToTokensBase(r,s){return(await i(r,s)).codeToTokensBase(r,s)},async codeToTokensWithThemes(r,s){return(await i(r,s)).codeToTokensWithThemes(r,s)},async getLastGrammarState(r,s){return(await n({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(r,s)}}}const CW=[{id:"abap",name:"ABAP",import:(()=>H(()=>import("./abap.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>H(()=>import("./actionscript-3.js"),[]))},{id:"ada",name:"Ada",import:(()=>H(()=>import("./ada.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>H(()=>import("./angular-html.js").then(t=>t.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>H(()=>import("./angular-ts.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>H(()=>import("./apache.js"),[]))},{id:"apex",name:"Apex",import:(()=>H(()=>import("./apex.js"),[]))},{id:"apl",name:"APL",import:(()=>H(()=>import("./apl.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>H(()=>import("./applescript.js"),[]))},{id:"ara",name:"Ara",import:(()=>H(()=>import("./ara.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>H(()=>import("./asciidoc.js"),[]))},{id:"asm",name:"Assembly",import:(()=>H(()=>import("./asm.js"),[]))},{id:"astro",name:"Astro",import:(()=>H(()=>import("./astro.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>H(()=>import("./awk.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>H(()=>import("./ballerina.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>H(()=>import("./bat.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>H(()=>import("./beancount.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>H(()=>import("./berry.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>H(()=>import("./bibtex.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>H(()=>import("./bicep.js"),[]))},{id:"blade",name:"Blade",import:(()=>H(()=>import("./blade.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>H(()=>import("./bsl.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>H(()=>import("./c.js"),[]))},{id:"c3",name:"C3",import:(()=>H(()=>import("./c3.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>H(()=>import("./cadence.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>H(()=>import("./cairo.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>H(()=>import("./clarity.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>H(()=>import("./clojure.js"),[]))},{id:"cmake",name:"CMake",import:(()=>H(()=>import("./cmake.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>H(()=>import("./cobol.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>H(()=>import("./codeowners.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>H(()=>import("./codeql.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>H(()=>import("./coffee.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>H(()=>import("./common-lisp.js"),[]))},{id:"coq",name:"Coq",import:(()=>H(()=>import("./coq.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>H(()=>import("./cpp.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>H(()=>import("./crystal.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>H(()=>import("./csharp.js"),[]))},{id:"css",name:"CSS",import:(()=>H(()=>import("./css.js"),[]))},{id:"csv",name:"CSV",import:(()=>H(()=>import("./csv.js"),[]))},{id:"cue",name:"CUE",import:(()=>H(()=>import("./cue.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>H(()=>import("./cypher.js"),[]))},{id:"d",name:"D",import:(()=>H(()=>import("./d.js"),[]))},{id:"dart",name:"Dart",import:(()=>H(()=>import("./dart.js"),[]))},{id:"dax",name:"DAX",import:(()=>H(()=>import("./dax.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>H(()=>import("./desktop.js"),[]))},{id:"diff",name:"Diff",import:(()=>H(()=>import("./diff.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>H(()=>import("./docker.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>H(()=>import("./dotenv.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>H(()=>import("./dream-maker.js"),[]))},{id:"edge",name:"Edge",import:(()=>H(()=>import("./edge.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>H(()=>import("./elixir.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>H(()=>import("./elm.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>H(()=>import("./emacs-lisp.js"),[]))},{id:"erb",name:"ERB",import:(()=>H(()=>import("./erb.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>H(()=>import("./erlang.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>H(()=>import("./fennel.js"),[]))},{id:"fish",name:"Fish",import:(()=>H(()=>import("./fish.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>H(()=>import("./fluent.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>H(()=>import("./fortran-fixed-form.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>H(()=>import("./fortran-free-form.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>H(()=>import("./fsharp.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>H(()=>import("./gdresource.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>H(()=>import("./gdscript.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>H(()=>import("./gdshader.js"),[]))},{id:"genie",name:"Genie",import:(()=>H(()=>import("./genie.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>H(()=>import("./gherkin.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>H(()=>import("./git-commit.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>H(()=>import("./git-rebase.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>H(()=>import("./gleam.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>H(()=>import("./glimmer-js.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>H(()=>import("./glimmer-ts.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>H(()=>import("./glsl.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>H(()=>import("./gn.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>H(()=>import("./gnuplot.js"),[]))},{id:"go",name:"Go",import:(()=>H(()=>import("./go.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>H(()=>import("./graphql.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>H(()=>import("./groovy.js"),[]))},{id:"hack",name:"Hack",import:(()=>H(()=>import("./hack.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>H(()=>import("./haml.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>H(()=>import("./handlebars.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>H(()=>import("./haskell.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>H(()=>import("./haxe.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>H(()=>import("./hcl.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>H(()=>import("./hjson.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>H(()=>import("./hlsl.js"),[]))},{id:"html",name:"HTML",import:(()=>H(()=>import("./html.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>H(()=>import("./html-derivative.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>H(()=>import("./http.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>H(()=>import("./hurl.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>H(()=>import("./hxml.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>H(()=>import("./hy.js"),[]))},{id:"imba",name:"Imba",import:(()=>H(()=>import("./imba.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>H(()=>import("./ini.js"),[]))},{id:"java",name:"Java",import:(()=>H(()=>import("./java.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>H(()=>import("./javascript.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>H(()=>import("./jinja.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>H(()=>import("./jison.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>H(()=>import("./json.js"),[]))},{id:"json5",name:"JSON5",import:(()=>H(()=>import("./json5.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>H(()=>import("./jsonc.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>H(()=>import("./jsonl.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>H(()=>import("./jsonnet.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>H(()=>import("./jssm.js"),[]))},{id:"jsx",name:"JSX",import:(()=>H(()=>import("./jsx.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>H(()=>import("./julia.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>H(()=>import("./kdl.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>H(()=>import("./kotlin.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>H(()=>import("./kusto.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>H(()=>import("./latex.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>H(()=>import("./lean.js"),[]))},{id:"less",name:"Less",import:(()=>H(()=>import("./less.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>H(()=>import("./liquid.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>H(()=>import("./llvm.js"),[]))},{id:"log",name:"Log file",import:(()=>H(()=>import("./log.js"),[]))},{id:"logo",name:"Logo",import:(()=>H(()=>import("./logo.js"),[]))},{id:"lua",name:"Lua",import:(()=>H(()=>import("./lua.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>H(()=>import("./luau.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>H(()=>import("./make.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>H(()=>import("./markdown.js"),[]))},{id:"marko",name:"Marko",import:(()=>H(()=>import("./marko.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>H(()=>import("./matlab.js"),[]))},{id:"mdc",name:"MDC",import:(()=>H(()=>import("./mdc.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>H(()=>import("./mdx.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>H(()=>import("./mermaid.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>H(()=>import("./mipsasm.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>H(()=>import("./mojo.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>H(()=>import("./moonbit.js"),[]))},{id:"move",name:"Move",import:(()=>H(()=>import("./move.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>H(()=>import("./narrat.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>H(()=>import("./nextflow.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>H(()=>import("./nginx.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>H(()=>import("./nim.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>H(()=>import("./nix.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>H(()=>import("./nushell.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>H(()=>import("./objective-c.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>H(()=>import("./objective-cpp.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>H(()=>import("./ocaml.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>H(()=>import("./openscad.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>H(()=>import("./pascal.js"),[]))},{id:"perl",name:"Perl",import:(()=>H(()=>import("./perl.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>H(()=>import("./php.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>H(()=>import("./pkl.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>H(()=>import("./plsql.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>H(()=>import("./po.js"),[]))},{id:"polar",name:"Polar",import:(()=>H(()=>import("./polar.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>H(()=>import("./postcss.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>H(()=>import("./powerquery.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>H(()=>import("./powershell.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>H(()=>import("./prisma.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>H(()=>import("./prolog.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>H(()=>import("./proto.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>H(()=>import("./pug.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>H(()=>import("./puppet.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>H(()=>import("./purescript.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>H(()=>import("./python.js"),[]))},{id:"qml",name:"QML",import:(()=>H(()=>import("./qml.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>H(()=>import("./qmldir.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>H(()=>import("./qss.js"),[]))},{id:"r",name:"R",import:(()=>H(()=>import("./r.js"),[]))},{id:"racket",name:"Racket",import:(()=>H(()=>import("./racket.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>H(()=>import("./raku.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>H(()=>import("./razor.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>H(()=>import("./reg.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>H(()=>import("./regexp.js"),[]))},{id:"rel",name:"Rel",import:(()=>H(()=>import("./rel.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>H(()=>import("./riscv.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>H(()=>import("./rosmsg.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>H(()=>import("./rst.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>H(()=>import("./ruby.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>H(()=>import("./rust.js"),[]))},{id:"sas",name:"SAS",import:(()=>H(()=>import("./sas.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>H(()=>import("./sass.js"),[]))},{id:"scala",name:"Scala",import:(()=>H(()=>import("./scala.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>H(()=>import("./scheme.js"),[]))},{id:"scss",name:"SCSS",import:(()=>H(()=>import("./scss.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>H(()=>import("./sdbl.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>H(()=>import("./shaderlab.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>H(()=>import("./shellscript.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>H(()=>import("./shellsession.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>H(()=>import("./smalltalk.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>H(()=>import("./solidity.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>H(()=>import("./soy.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>H(()=>import("./sparql.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>H(()=>import("./splunk.js"),[]))},{id:"sql",name:"SQL",import:(()=>H(()=>import("./sql.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>H(()=>import("./ssh-config.js"),[]))},{id:"stata",name:"Stata",import:(()=>H(()=>import("./stata.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>H(()=>import("./stylus.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>H(()=>import("./svelte.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>H(()=>import("./swift.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>H(()=>import("./system-verilog.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>H(()=>import("./systemd.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>H(()=>import("./talonscript.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>H(()=>import("./tasl.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>H(()=>import("./tcl.js"),[]))},{id:"templ",name:"Templ",import:(()=>H(()=>import("./templ.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>H(()=>import("./terraform.js"),[]))},{id:"tex",name:"TeX",import:(()=>H(()=>import("./tex.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>H(()=>import("./toml.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>H(()=>import("./ts-tags.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>H(()=>import("./tsv.js"),[]))},{id:"tsx",name:"TSX",import:(()=>H(()=>import("./tsx.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>H(()=>import("./turtle.js"),[]))},{id:"twig",name:"Twig",import:(()=>H(()=>import("./twig.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>H(()=>import("./typescript.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>H(()=>import("./typespec.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>H(()=>import("./typst.js"),[]))},{id:"v",name:"V",import:(()=>H(()=>import("./v.js"),[]))},{id:"vala",name:"Vala",import:(()=>H(()=>import("./vala.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>H(()=>import("./vb.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>H(()=>import("./verilog.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>H(()=>import("./vhdl.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>H(()=>import("./viml.js"),[]))},{id:"vue",name:"Vue",import:(()=>H(()=>import("./vue.js"),__vite__mapDeps([92,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>H(()=>import("./vue-html.js"),__vite__mapDeps([93,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>H(()=>import("./vue-vine.js"),__vite__mapDeps([94,3,5,67,95,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>H(()=>import("./vyper.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>H(()=>import("./wasm.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>H(()=>import("./wenyan.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>H(()=>import("./wgsl.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>H(()=>import("./wikitext.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>H(()=>import("./wit.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>H(()=>import("./wolfram.js"),[]))},{id:"xml",name:"XML",import:(()=>H(()=>import("./xml.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>H(()=>import("./xsl.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>H(()=>import("./yaml.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>H(()=>import("./zenscript.js"),[]))},{id:"zig",name:"Zig",import:(()=>H(()=>import("./zig.js"),[]))}],QUe=Object.fromEntries(CW.map(t=>[t.id,t.import])),GUe=Object.fromEntries(CW.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),$Ue={...QUe,...GUe},WUe=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>H(()=>import("./andromeeda.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>H(()=>import("./aurora-x.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>H(()=>import("./ayu-dark.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>H(()=>import("./catppuccin-frappe.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>H(()=>import("./catppuccin-latte.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>H(()=>import("./catppuccin-macchiato.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>H(()=>import("./catppuccin-mocha.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>H(()=>import("./dark-plus.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>H(()=>import("./dracula.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>H(()=>import("./dracula-soft.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>H(()=>import("./everforest-dark.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>H(()=>import("./everforest-light.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>H(()=>import("./github-dark.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>H(()=>import("./github-dark-default.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>H(()=>import("./github-dark-dimmed.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>H(()=>import("./github-dark-high-contrast.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>H(()=>import("./github-light.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>H(()=>import("./github-light-default.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>H(()=>import("./github-light-high-contrast.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>H(()=>import("./gruvbox-dark-hard.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>H(()=>import("./gruvbox-dark-medium.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>H(()=>import("./gruvbox-dark-soft.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>H(()=>import("./gruvbox-light-hard.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>H(()=>import("./gruvbox-light-medium.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>H(()=>import("./gruvbox-light-soft.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>H(()=>import("./houston.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>H(()=>import("./kanagawa-dragon.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>H(()=>import("./kanagawa-lotus.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>H(()=>import("./kanagawa-wave.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>H(()=>import("./laserwave.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>H(()=>import("./light-plus.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>H(()=>import("./material-theme.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>H(()=>import("./material-theme-darker.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>H(()=>import("./material-theme-lighter.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>H(()=>import("./material-theme-ocean.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>H(()=>import("./material-theme-palenight.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>H(()=>import("./min-dark.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>H(()=>import("./min-light.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>H(()=>import("./monokai.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>H(()=>import("./night-owl.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>H(()=>import("./nord.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>H(()=>import("./one-dark-pro.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>H(()=>import("./one-light.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>H(()=>import("./plastic.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>H(()=>import("./poimandres.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>H(()=>import("./red.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>H(()=>import("./rose-pine.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>H(()=>import("./rose-pine-dawn.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>H(()=>import("./rose-pine-moon.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>H(()=>import("./slack-dark.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>H(()=>import("./slack-ochin.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>H(()=>import("./snazzy-light.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>H(()=>import("./solarized-dark.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>H(()=>import("./solarized-light.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>H(()=>import("./synthwave-84.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>H(()=>import("./tokyo-night.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>H(()=>import("./vesper.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>H(()=>import("./vitesse-black.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>H(()=>import("./vitesse-dark.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>H(()=>import("./vitesse-light.js"),[]))}],jUe=Object.fromEntries(WUe.map(t=>[t.id,t.import]));class Zk extends Error{constructor(e){super(e),this.name="ShikiError"}}function KUe(){return 2147483648}function YUe(){return typeof performance<"u"?performance.now():Date.now()}const qUe=(t,e)=>t+(e-t%e)%e;async function JUe(t){let e,n;const i={};function r(m){n=m,i.HEAPU8=new Uint8Array(m),i.HEAPU32=new Uint32Array(m)}function s(m,v,S){i.HEAPU8.copyWithin(m,v,v+S)}function o(m){try{return e.grow(m-n.byteLength+65535>>>16),r(e.buffer),1}catch{}}function a(m){const v=i.HEAPU8.length;m=m>>>0;const S=KUe();if(m>S)return!1;for(let C=1;C<=4;C*=2){let E=v*(1+.2/C);E=Math.min(E,m+100663296);const k=Math.min(S,qUe(Math.max(m,E),65536));if(o(k))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(m,v,S=1024){const C=v+S;let E=v;for(;m[E]&&!(E>=C);)++E;if(E-v>16&&m.buffer&&l)return l.decode(m.subarray(v,E));let k="";for(;v>10,56320|P&1023)}}return k}function d(m,v){return m?u(i.HEAPU8,m,v):""}const f={emscripten_get_now:YUe,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function g(){const v=await t({env:f,wasi_snapshot_preview1:f});e=v.memory,r(e.buffer),Object.assign(i,v),i.UTF8ToString=d}return await g(),i}var XUe=Object.defineProperty,ZUe=(t,e,n)=>e in t?XUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,On=(t,e,n)=>ZUe(t,typeof e!="symbol"?e+"":e,n);let zn=null;function e5e(t){throw new Zk(t.UTF8ToString(t.getLastOnigError()))}class Lw{constructor(e){On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16Value"),On(this,"utf8Value"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16");const n=e.length,i=Lw._utf8ByteLength(e),r=i!==n,s=r?new Uint32Array(n+1):null;r&&(s[n]=i);const o=r?new Uint32Array(i+1):null;r&&(o[i]=n);const a=new Uint8Array(i);let l=0;for(let u=0;u=55296&&d<=56319&&u+1=56320&&m<=57343&&(f=(d-55296<<10)+65536|m-56320,g=!0)}r&&(s[u]=l,g&&(s[u+1]=l),f<=127?o[l+0]=u:f<=2047?(o[l+0]=u,o[l+1]=u):f<=65535?(o[l+0]=u,o[l+1]=u,o[l+2]=u):(o[l+0]=u,o[l+1]=u,o[l+2]=u,o[l+3]=u)),f<=127?a[l++]=f:f<=2047?(a[l++]=192|(f&1984)>>>6,a[l++]=128|(f&63)>>>0):f<=65535?(a[l++]=224|(f&61440)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0):(a[l++]=240|(f&1835008)>>>18,a[l++]=128|(f&258048)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0),g&&u++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let i=0,r=e.length;i=55296&&s<=56319&&i+1=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&i++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const Uw=class eo{constructor(e){if(On(this,"id",++eo.LAST_ID),On(this,"_onigBinding"),On(this,"content"),On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16"),On(this,"ptr"),!zn)throw new Zk("Must invoke loadWasm first.");this._onigBinding=zn,this.content=e;const n=new Lw(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!eo._sharedPtrInUse?(eo._sharedPtr||(eo._sharedPtr=zn.omalloc(1e4)),eo._sharedPtrInUse=!0,zn.HEAPU8.set(n.utf8Value,eo._sharedPtr),this.ptr=eo._sharedPtr):this.ptr=n.createString(zn)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===eo._sharedPtr?eo._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};On(Uw,"LAST_ID",0);On(Uw,"_sharedPtr",0);On(Uw,"_sharedPtrInUse",!1);let xW=Uw;class t5e{constructor(e){if(On(this,"_onigBinding"),On(this,"_ptr"),!zn)throw new Zk("Must invoke loadWasm first.");const n=[],i=[];for(let a=0,l=e.length;a{let i=t;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),n5e(i)?i=await i.instantiator(n):i5e(i)?i=await i.default(n):(r5e(i)&&(i=i.data),s5e(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await l5e(i)(n):i=await c5e(i)(n):o5e(i)?i=await qE(i)(n):i instanceof WebAssembly.Module?i=await qE(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await qE(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return ey=e(),ey}function qE(t){return e=>WebAssembly.instantiate(t,e)}function l5e(t){return e=>WebAssembly.instantiateStreaming(t,e)}function c5e(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function u5e(t){return t&&await a5e(t),{createScanner(e){return new t5e(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new xW(e)}}}const d5e=FUe({langs:$Ue,themes:jUe,engine:()=>u5e(H(()=>import("./wasm2.js"),[]))}),{getSingletonHighlighter:Y5}=zUe(d5e,{guessEmbeddedLanguages:tUe});async function h5e(t,e){try{return await Y5({langs:[t],themes:e})}catch(n){if(n instanceof Error&&n.message.includes("Language"))return await Y5({langs:["plaintext"],themes:e});throw n}}var EW=(t,e,n,i={})=>sLe(t,e,n,h5e,i),f5e=aLe(EW),p5e=f5e;const _W=({code:t,language:e,theme:n={dark:"kanagawa-wave",light:"kanagawa-lotus"},className:i,addDefaultStyles:r=!0,showLanguage:s=!1,...o})=>{const a="aui-shiki-base [&_pre]:overflow-x-auto [&_pre]:rounded-b-lg [&_pre]:!bg-muted/75 [&_pre]:p-4";return EW(t,e,n)?_.jsx(p5e,{...o,language:e,theme:n,addDefaultStyles:r,showLanguage:s,defaultColor:"light-dark()",className:_e(a,i),children:t.trim()}):_.jsx("div",{className:"px-[12px] pb-[12px] bg-[var(--chat-message-code-block-background-color)] rounded-b-[12px]",children:_.jsx("pre",{className:_e("overflow-x-auto bg-[var(--chat-message-code-block-pre-background-color)] border border-[var(--chat-message-code-block-border-color)] rounded-[4px] p-[6px]",i),children:t.trim()})})};_W.displayName="SyntaxHighlighter";const g5e=({copiedDuration:t=3e3}={})=>{const[e,n]=T.useState(!1);return{isCopied:e,copyToClipboard:r=>{r&&navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),t)})}}},m5e=({language:t,code:e})=>{const{isCopied:n,copyToClipboard:i}=g5e(),{t:r}=Ct(),s=()=>{!e||n||i(e)};return _.jsxs("div",{className:"mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-[var(--chat-message-code-block-background-color)] text-[var(--chat-message-code-block-header-color)] text-[14px] leading-[20px] px-[12px] pt-[12px] pb-[8px]",children:[_.jsx("span",{className:"lowercase",children:t}),_.jsxs(ua,{tooltip:r("CopyToClipboard"),onClick:s,visible:!n,children:[!n&&_.jsx(gt,{iconName:"btn-copy",size:24}),n&&_.jsx(gt,{iconName:"checked",size:24,isStroke:!0,disableHover:!0})]})]})},TW=INe({SyntaxHighlighter:_W,h1:({className:t,...e})=>_.jsx("h1",{className:_e("mb-8 scroll-m-20 text-[28px] leading-[36px] font-bold last:mb-0 text-[var(--chat-message-color)]",t),...e}),h2:({className:t,...e})=>_.jsx("h2",{className:_e("mb-4 mt-8 scroll-m-20 text-[24px] leading-[32px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),h3:({className:t,...e})=>_.jsx("h3",{className:_e("mb-4 mt-6 scroll-m-20 text-[20px] leading-[28px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),h4:({className:t,...e})=>_.jsx("h4",{className:_e("mb-4 mt-6 scroll-m-20 text-[18px] leading-[24px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),h5:({className:t,...e})=>_.jsx("h5",{className:_e("my-4 text-[16px] leading-[22px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),h6:({className:t,...e})=>_.jsx("h6",{className:_e("my-4 text-[14px] leading-[20px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),p:({className:t,...e})=>_.jsx("p",{className:_e("mb-5 mt-5 text-[14px] font-normal leading-[20px] first:mt-0 last:mb-0 text-[var(--chat-message-color)]",t),...e}),a:({className:t,...e})=>_.jsx("a",{className:_e("text-[var(--chat-link-color)] font-medium underline underline-offset-4",t),...e,target:"_blank"}),blockquote:({className:t,...e})=>_.jsx("blockquote",{className:_e("border-l-2 pl-6 italic",t),...e}),ul:({className:t,...e})=>_.jsx("ul",{className:_e("my-5 ml-6 list-disc [&>li]:mt-[4px] text-[var(--chat-message-color)]",t),...e}),ol:({className:t,...e})=>_.jsx("ol",{className:_e("my-5 ml-6 list-decimal [&>li]:mt-[4px] text-[var(--chat-message-color)]",t),...e}),hr:({className:t,...e})=>_.jsx("hr",{className:_e("my-5 border-b border-[var(--chat-message-divider-color)]",t),...e}),table:({className:t,...e})=>_.jsx("table",{className:_e("my-5 w-full border-separate border-spacing-0 overflow-y-auto text-[var(--chat-message-color)]",t),...e}),th:({className:t,...e})=>_.jsx("th",{className:_e("px-4 py-2 border-b border-[var(--chat-message-divider-color)] text-left text-[var(--chat-message-th-color)] text-[14px] leading-[20px] font-bold [&[align=center]]:text-center [&[align=right]]:text-right",t),...e}),td:({className:t,...e})=>_.jsx("td",{className:_e("border-b border-[var(--chat-message-divider-color)] text-[var(--chat-message-td-color)] text-[14px] leading-[20px] px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right",t),...e}),tr:({className:t,...e})=>_.jsx("tr",{className:_e("m-0 border-b border-[var(--chat-message-divider-color)]",t),...e}),sup:({className:t,...e})=>_.jsx("sup",{className:_e("[&>a]:text-xs [&>a]:no-underline",t),...e}),pre:({className:t,...e})=>_.jsx("div",{className:"px-[12px] pb-[12px] bg-[var(--chat-message-code-block-background-color)] rounded-[12px]",children:_.jsx("pre",{className:_e("overflow-x-auto bg-[var(--chat-message-code-block-pre-background-color)] border border-[var(--chat-message-code-block-border-color)] rounded-[4px] p-[6px]",t),...e})}),code:function({className:e,...n}){const i=v$();return _.jsx("code",{className:_e(!i&&"font-bold italic",e),...n})},CodeHeader:m5e}),A5e=()=>_.jsx(WNe,{remarkPlugins:[$$],className:"aui-md",components:TW}),y5e=({children:t})=>_.jsx("div",{className:"aui-md",children:_.jsx(y$,{remarkPlugins:[$$],components:TW,children:t})}),v5e=T.memo(A5e),q5=T.memo(y5e),J5=({text:t,type:e,parentId:n})=>{const{t:i}=Ct(),[r,s]=T.useState(!0);return _.jsx(_.Fragment,{children:e==="reasoning"?_.jsxs("div",{className:"my-[8px] flex w-full flex-col",children:[_.jsxs("div",{className:"flex items-center gap-[10px] cursor-pointer mb-[8px]",onClick:()=>s(o=>!o),children:[n?_.jsx(wn,{name:"tool.called",size:16,noColor:!0}):_.jsx(wh,{size:16}),_.jsxs("div",{className:"flex items-center bg-[var(--background-normal-element)] rounded-[4px] gap-[8px] ps-[4px] pe-[8px]",children:[_.jsx(wn,{name:"btn-extended-thinking",size:24}),_.jsx("span",{className:"text-[14px] font-normal leading-[20px] text-[var(--chat-message-color)] ",children:i("Thinking")})]}),_.jsx(wn,{name:"arrow.right",size:16,width:8,height:8,isStroke:!0,isTransform:!r})]}),!r&&_.jsx("div",{className:"ps-[12px] ms-[13px] border-l-[var(--border-divider)] border-l-[1px]",children:_.jsx(q5,{children:t})})]}):_.jsx(q5,{children:t})})},b5e=()=>_.jsx($F,{children:_.jsx(JF,{className:"border border-[var(--chat-message-error-border-color)] rounded-[4px] p-[6px]",children:_.jsx(XF,{className:"text-[var(--chat-message-error-color)] text-[14px] leading-[20px] font-normal"})})}),w5e=()=>{const{t}=Ct(),{isStreamRunning:e,messages:n}=Sh(),i=U6();if(i.status?.type==="incomplete"&&i.status?.error)return;const r=()=>{const s=n[Number(i.parentId)],o=k8([s,i]),a=Ufe(o);window.AscDesktopEditor.SaveFilenameDialog(`${a}.docx`,l=>{l&&window.AscDesktopEditor.saveAndOpen(o,92,l,65,u=>{u||console.log("Conversion error")})})};return _.jsxs(K6,{hidden:e,className:"col-start-3 row-start-2 ml-3 mt-3 flex gap-[8px]",children:[_.jsx(Y6,{asChild:!0,children:_.jsxs(ua,{tooltip:t("CopyToClipboard"),children:[_.jsx(L1,{copied:!0,children:_.jsx(gt,{iconName:"checked",size:24,isStroke:!0,disabled:!0})}),_.jsx(L1,{copied:!1,children:_.jsx(gt,{iconName:"btn-copy",size:24})})]})}),_.jsx("div",{children:_.jsx(ua,{tooltip:t("Save"),children:_.jsx(gt,{iconName:"btn-save",size:24,onClick:r,isStroke:!0})})})]})},S5e=()=>_.jsx(FT,{asChild:!0,children:_.jsxs(xk.div,{className:"relative mx-auto grid w-full max-w-[var(--thread-max-width)] grid-cols-[auto_auto_1fr] grid-rows-[auto_1fr] px-[var(--thread-padding-x)] py-4",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":"assistant",children:[_.jsxs("div",{className:"leading-[20px] text-[14px] col-span-2 col-start-2 row-start-1 ml-4 break-words leading-7 text-[var(--chat-message-color)]",children:[_.jsx(HT,{components:{tools:{Fallback:Xz},Reasoning:J5,Text:J5}}),_.jsx(b5e,{})]}),_.jsx(w5e,{})]})}),C5e=(t,e,n,i)=>t?"pdf":e?"documents":n?"spreadsheets":i?"presentations":"unknown-format",y2=({file:t,withoutClose:e})=>{const{isRTL:n}=Wt(),{deleteAttachmentFile:i,deleteAttachmentImage:r}=Ew(),s=()=>{"path"in t&&t.path&&i(t.path),"name"in t&&t.name&&r(t.name)},o="path"in t?t.path.includes("\\")?t.path.split("\\").pop()??"":t.path.split("/").pop()??"":t.name,a=o.split(".").pop()??"",l=o.replace(`.${a}`,""),u="type"in t?M8(t.type):!1,d="type"in t?P8(t.type):!1,f="type"in t?Sv(t.type):!1,g="type"in t?D8(t.type):!1,m=C5e(d,u,f,g),v="base64"in t;return _.jsxs("div",{className:_e("w-fit flex flex-row items-center gap-[12px] h-[36px] rounded-[8px] box-border border-[var(--file-items-border-color)]",v?n?"p-0 pl-[4px]":"p-0 pr-[4px]":"p-[4px]",e?n?"cursor-pointer pl-[24px]":"cursor-pointer pr-[24px]":"",e?"bg-[var(--file-items-chat-background-color)]":"border bg-[var(--file-items-background-color)]",e?"hover:bg-[var(--file-items-chat-hover-background-color)]":"",e?"active:bg-[var(--file-items-chat-pressed-background-color)]":""),onClick:()=>{!e||!("path"in t)||window.AscDesktopEditor.openTemplate(t.path,o)},children:["base64"in t?_.jsx("img",{className:_e("w-[36px] h-[36px]",n?"rounded-r-[8px]":"rounded-l-[8px]"),src:t.base64,alt:""}):_.jsxs("div",{className:"flex flex-row items-center h-[24px] gap-[4px]",children:[_.jsx(wn,{name:m,size:24,noColor:!0}),_.jsxs("p",{className:"text-[var(--file-items-color)] font-normal text-[14px] leading-[20px] whitespace-nowrap overflow-hidden text-ellipsis",children:[l,_.jsxs("span",{className:"text-[var(--file-items-ext-color)]",children:[".",a]})]})]}),e?null:_.jsx(gt,{iconName:"btn-close.small",size:16,onClick:s})]})},x5e=t=>P8(t)?"pdf":Sv(t)?"spreadsheets":M8(t)?"documents":D8(t)?"presentations":"unknown-format",E5e=()=>{const[t,e]=me.useState(!1),n=me.useRef(null),{addAttachmentFile:i,addAttachmentImage:r}=Ew(),s=m=>{e(m)},o=(m,v)=>{const S=Sv(v);window.AscDesktopEditor.convertFileExternal(m,S?260:69,(C,E)=>{if(E){console.log("Error:",E);return}const k=new Uint8Array(C.content),M=new TextDecoder("utf-8").decode(k);i({path:m,content:M,type:v})})},a=()=>{window.AscDesktopEditor.OpenFilenameDialog("",!0,m=>{Array.isArray(m)&&m.forEach((v,S)=>{if(S>5)return;const C=window.AscDesktopEditor.getOfficeFileType(v),E=Sv(C);window.AscDesktopEditor.convertFileExternal(v,E?260:69,(k,R)=>{if(R){console.log("Error:",R);return}const M=new Uint8Array(k.content),P=new TextDecoder("utf-8").decode(M);i({path:v,content:P||"",type:C})})})})},l=JSON.parse(window.AscDesktopEditor?.callToolFunction("recent_files_reader")??"{}")?.files?.filter(m=>!m.url)?.map(m=>{const v=x5e(m.type);return{text:m.path.includes("\\")?m.path.split("\\").pop()??"":m.path.split("/").pop()??"",key:m.path,id:m.path,icon:_.jsx(gt,{iconName:v,size:24,disableHover:!0,noColor:!0}),onClick:()=>o(m.path,m.type)}}).filter(Boolean),{t:u}=Ct(),d=_.jsx(ua,{tooltip:u("Attachments"),visible:!t,children:_.jsx(gt,{iconName:"attachment",size:24,className:"cursor-pointer rounded-[4px] outline-none",isStroke:!0,isActive:t,"data-testid":"attachment-button"})}),f=[{text:u("AddLocalFile"),onClick:()=>a()},{text:u("AddLocalImage"),onClick:()=>n.current?.click()}];l.length>0&&(f.push({text:"",onClick:()=>{},isSeparator:!0}),f.push({text:u("RecentFiles"),onClick:()=>{},subMenu:l}));const g=m=>{const v=m.target.files;v&&(Array.from(v).forEach(S=>{const C=new FileReader;C.onload=E=>{const k=E.target?.result;r({name:S.name,base64:k})},C.readAsDataURL(S)}),m.target.value="")};return _.jsxs(_.Fragment,{children:[_.jsx("input",{ref:n,type:"file",accept:"image/*",multiple:!0,onChange:g,className:"hidden"}),_.jsx(Yc,{trigger:d,items:f,onOpenChange:s})]})},Vw=({placeholder:t,value:e,className:n,isError:i,withoutBg:r,items:s,"data-testid":o})=>{const{isRTL:a}=Wt(),[l,u]=me.useState(!1),d=me.useRef(null);return _.jsx(Yc,{onOpenChange:f=>u(f),trigger:_.jsxs("div",{ref:d,"data-testid":o,className:_e("h-[32px] rounded-[4px] ps-[12px] pe-[12px] box-border","cursor-pointer flex items-center justify-between","text-[var(--input-color)] text-[14px] leading-[16px]",a?"flex-row-reverse":"",l?"border bg-[var(--input-background-color)] border-[var(--input-active-border-color)]":r?"hover:bg-[var(--input-hover-background-color)) hover:border-[var(--input-hover-border-color)]":"border bg-[var(--input-background-color)] border-[var(--input-border-color)] hover:bg-[var(--input-hover-background-color)] hover:border-[var(--input-hover-border-color)]",n,s.length===0?"cursor-not-allowed pointer-events-none opacity-50":""),style:{borderColor:i?"var(--border-error)":void 0},children:[_.jsx("span",{className:_e(e?"text-[var(--input-color)]":"text-[var(--input-placeholder-color)]"),children:e||t}),_.jsx(wn,{name:"arrow.bottom",size:16,color:"var(--input-color)",width:8,height:8,isStroke:!0,className:_e("transition-transform","ms-[8px]",l?"rotate-180":"")})]}),align:"start",side:"bottom",containerRef:d.current,matchTriggerWidth:!0,items:s})},_5e=()=>{const{currentModel:t,selectModel:e}=vh(),{providers:n,providersModels:i,currentProvider:r,setCurrentProvider:s}=Tr(),{tools:o}=Ns(),{messages:a}=Sh(),{t:l}=Ct(),u=me.useCallback((g,m)=>{if(t?.id===m&&It.currentProviderInfo?.name===g.name)return;const v=i.get(g.name)?.find(S=>S.id===m);v&&(It.currentProviderInfo?.name!==g.name&&(s(g),It.setCurrentProviderModel(m),It.setCurrentProviderTools(o),It.setCurrentProviderPrevMessages(a)),e(v))},[i,a,o,t,e,s]),d=n.map(g=>({text:g.name,id:g.name,onClick:()=>{},subMenu:i.get(g.name)?.map(m=>({text:m.name,id:m.id,onClick:()=>u(g,m.id),isActive:!1,checked:m.id===t?.id&&g.name===It.currentProviderInfo?.name}))||[]})).filter(g=>g.subMenu.length>0),f=n.some(g=>g.name===r?.name);return me.useEffect(()=>{if((!t||!r)&&n.length>0){const g=n[0],m=i.get(g.name)?.[0];if(!m)return;u(g,m.id)}},[t,r,n,i,u]),_.jsx(Vw,{placeholder:l("SelectModel"),value:f&&t?.name||"",items:d,withoutBg:!0,"data-testid":"model-selector"})},X5="rounded-[4px] cursor-pointer disabled:cursor-not-allowed flex items-center justify-center bg-[var(--chat-composer-action-send-background-color)] hover:enabled:bg-[var(--chat-composer-action-send-background-hover-color)] active:enabled:bg-[var(--chat-composer-action-send-background-pressed-color)] disabled:opacity-[0.5]",T5e=()=>{const{isStreamRunning:t}=Sh(),{currentModel:e}=vh(),{currentProvider:n}=Tr();return t?_.jsx(bre,{asChild:!0,children:_.jsx(gt,{iconName:"stop",size:24,className:X5,width:12,height:12,"data-testid":"stop-button"})}):_.jsx(vv,{running:!1,children:_.jsx(nre,{asChild:!0,disabled:!e||!n,children:_.jsx(gt,{iconName:"arrow.top",size:24,width:12,height:14,color:"var(--chat-composer-action-send-color)",className:X5,"data-testid":"send-button"})})})},R5e=()=>{const{servers:t,changeToolStatus:e,webSearchEnabled:n,getWebSearchEnabled:i}=Ns(),{extendedThinking:r,toggleExtendedThinking:s}=vh(),[o,a]=T.useState(!1),{t:l}=Ct(),u=T.useMemo(()=>_.jsx(ua,{visible:!o,tooltip:l("MCPServers"),children:_.jsx(gt,{iconName:"tools",size:24,width:12,height:16,isActive:o})}),[o,l]),d=T.useMemo(()=>[{text:l("WebSearch"),onClick:()=>{},icon:_.jsx(gt,{iconName:"btn-web-search",size:24,disableHover:!0}),withToggle:!0,toggleChecked:i()?n:!1,toggleDisabled:!i(),tooltipText:i()?"":l("EnableWebSearch"),onToggleChange:()=>{e("web-search",t["web-search"][0].name,!n),window.dispatchEvent(new CustomEvent("tools-changed"))}},{text:l("ExtendedThinking"),icon:_.jsx(gt,{iconName:"btn-extended-thinking",size:24,disableHover:!0}),onClick:()=>{},withToggle:!0,toggleChecked:r,onToggleChange:s,withAbout:!0,aboutContent:_.jsx("p",{className:"p-[16px] text-[11px] leading-[16px] text-[var(--text-secondary)]",children:l("ExtendedThinkingDescription")})},{text:"",onClick:()=>{},isSeparator:!0},...Object.entries(t).map(([m,v])=>{if(m==="web-search")return{text:m,onClick:()=>{},subMenu:[]};const S=v.some(C=>C.enabled);return{text:m,onClick:()=>{},subMenu:[{text:"All tools",onClick:()=>{},withToggle:!0,toggleChecked:S,onToggleChange:()=>{S?v.forEach(C=>{e(m,C.name,!1)}):v.forEach(C=>{e(m,C.name,!0)})}},{text:"",onClick:()=>{},isSeparator:!0},...v.map(C=>({text:C.name,onClick:()=>{},withToggle:!0,toggleChecked:C.enabled,onToggleChange:E=>{e(m,C.name,E)}}))]}}).filter(m=>m.subMenu.length>2)],[t,e,l,n,i,s,r]),f=T.useMemo(()=>[...d],[d]);if(!t||!d.length)return null;const g=m=>{a(m)};return _.jsx(Yc,{trigger:u,items:f,onOpenChange:g})},k5e=()=>_.jsx("div",{className:"relative flex flex-col",children:_.jsxs("div",{className:"relative flex items-center justify-between h-[24px]",children:[_.jsxs("div",{className:"flex items-center gap-[12px] flex-row",children:[_.jsx(E5e,{}),_.jsx(R5e,{})]}),_.jsxs("div",{className:"flex items-center gap-[12px] flex-row",children:[_.jsx(_5e,{}),_.jsx(T5e,{})]})]})}),Z5=()=>{const{attachmentFiles:t,attachmentImages:e}=Ew(),{currentProvider:n}=Tr(),{currentModel:i}=vh(),{t:r}=Ct();return _.jsxs("div",{className:"relative mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-[8px] px-[var(--thread-padding-x)] pb-[16px]",children:[_.jsxs(jF,{className:"composer-root relative flex w-full flex-col gap-[16px] rounded-[16px] border px-[24px] py-[16px] box-border",children:[t.length||e.length?_.jsxs("div",{className:"flex flex-row gap-[8px] overflow-x-auto",children:[t.map(s=>_.jsx(y2,{file:s},s.path)),e.map(s=>_.jsx(y2,{file:s},s.name))]}):null,_.jsx(qF,{placeholder:r("AskAI"),className:"composer-input max-h-[calc(50vh)] min-h-[16px] w-full resize-none outline-none",rows:1,autoFocus:!0,"aria-label":"Message input",disabled:!n||!i,"data-testid":"composer-input"}),_.jsx(k5e,{})]}),_.jsx("p",{className:"text-center font-normal text-[12px] leading-[16px] text-[var(--text-tertiary)]",children:r("CheckInfo")})]})},I5e=()=>{const t=U6(),{isRTL:e}=Wt(),n=t.content.filter(r=>r.type==="image").map(r=>r.image),i=t.content.filter(r=>r.type==="file").map(r=>({type:JSON.parse(r.mimeType).type,content:r.data,path:JSON.parse(r.mimeType).path}));return _.jsx(FT,{asChild:!0,children:_.jsxs(xk.div,{dir:e?"rtl":"ltr",className:"mx-auto grid w-full max-w-[var(--thread-max-width)] auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-1 px-[var(--thread-padding-x)] py-4 [&:where(>*)]:col-start-2",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":"user",children:[n.length>0||i.length>0?_.jsx("div",{className:"col-span-full col-start-1 row-start-1 mb-[8px] overflow-x-auto",children:_.jsxs("div",{className:"flex flex-row gap-[8px] w-max justify-end ms-auto",children:[n.map(r=>_.jsx("img",{src:r,alt:"",className:"h-[72px] w-[72px] rounded-[8px] object-cover"},r)),i.map(r=>_.jsx(y2,{file:r,withoutClose:!0},r.path))]})}):null,_.jsx("div",{className:_e("bg-[var(--chat-user-message-background)] text-[var(--chat-user-message-color)] col-start-2 break-words rounded-[16px] px-[12px] py-[8px]",e?"rounded-bl-[0px]":"rounded-br-[0px]"),children:_.jsx(HT,{components:{Text:v5e,Image:()=>null}})})]})})},M5e=()=>{const{t}=Ct();return _.jsx(e8,{children:_.jsx("div",{className:"mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col px-[var(--thread-padding-x)] justify-center items-center mb-[16px]",children:_.jsxs("div",{className:"max-w-[490px] flex flex-col items-center gap-[16px] text-center",children:[_.jsx("p",{className:"font-[700] text-[32px] leading-[24px]",style:{color:"var(--chat-welcome-color)"},children:t("WelcomeTitle")}),_.jsx("p",{className:"text-[20px] leading-[20px]",style:{color:"var(--chat-welcome-description-color)"},children:t("WelcomeDescription")})]})})})},D5e=()=>{const{isStreamRunning:t,isRequestRunning:e}=Sh(),{t:n}=Ct();return _.jsxs(ZF,{className:"flex h-full flex-col",style:{"--thread-max-width":"687px","--thread-padding-x":"1rem"},children:[_.jsx(vv,{empty:!0,children:_.jsx(U1,{className:"relative flex min-w-0 flex-1 flex-col overflow-y-auto justify-center items-center",children:_.jsxs("div",{className:"flex flex-col gap-[24px] w-full",children:[_.jsx(M5e,{}),_.jsx(Z5,{})]})})}),_.jsxs(vv,{empty:!1,children:[_.jsxs(U1,{className:"relative flex min-w-0 flex-1 flex-col gap-6 overflow-y-auto",children:[_.jsx(Rre,{components:{UserMessage:I5e,AssistantMessage:S5e}}),!e&&t?_.jsx("div",{className:"flex items-center justify-center",children:_.jsxs("div",{className:"flex items-center gap-[8px] w-[var(--thread-max-width)] max-w-[var(--thread-max-width)] ps-[var(--thread-padding-x)]",children:[_.jsx(wh,{}),_.jsx("p",{className:"text-[14px] leading-[20px] font-normal text-[var(--chat-message-analyze-color)]",children:n("Analyzing")})]})}):null,_.jsx(xk.div,{className:"min-h-6 min-w-6 shrink-0"})]}),_.jsx(Z5,{})]})]})},P5e=()=>{const{t}=Ct(),{setCurrentPage:e}=qg();return _.jsx("div",{className:"flex items-center justify-center h-full",children:_.jsxs("div",{className:"max-w-[573px] text-center flex flex-col items-center gap-[40px]",children:[_.jsxs("div",{className:"flex flex-col gap-[16px]",children:[_.jsx("h1",{className:"select-none text-center text-[32px] font-bold leading-[36px] text-[var(--empty-screen-color)]",children:t("ConnectAIModel")}),_.jsx("p",{className:"select-none text-center text-[16px] font-normal leading-[24px] text-[var(--empty-screen-description-color)]",children:t("ConnectAIModelDescription")})]}),_.jsx(ln,{onClick:()=>e("settings"),children:t("ConnectAIModelBtn")})]})})};function N5e(t,e=[]){let n=[];function i(s,o){const a=T.createContext(o),l=n.length;n=[...n,o];const u=f=>{const{scope:g,children:m,...v}=f,S=g?.[t]?.[l]||a,C=T.useMemo(()=>v,Object.values(v));return _.jsx(S.Provider,{value:C,children:m})};u.displayName=s+"Provider";function d(f,g){const m=g?.[t]?.[l]||a,v=T.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(o=>T.createContext(o));return function(a){const l=a?.[t]||s;return T.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,O5e(r,...e)]}function O5e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function B5e(t){const e=L5e(t),n=T.forwardRef((i,r)=>{const{children:s,...o}=i,a=T.Children.toArray(s),l=a.find(V5e);if(l){const u=l.props.children,d=a.map(f=>f===l?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return _.jsx(e,{...o,ref:r,children:T.isValidElement(u)?T.cloneElement(u,void 0,d):null})}return _.jsx(e,{...o,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function L5e(t){const e=T.forwardRef((n,i)=>{const{children:r,...s}=n;if(T.isValidElement(r)){const o=H5e(r),a=F5e(s,r.props);return r.type!==T.Fragment&&(a.ref=i?Gn(i,o):o),T.cloneElement(r,a)}return T.Children.count(r)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var U5e=Symbol("radix.slottable");function V5e(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===U5e}function F5e(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{const l=s(...a);return r(...a),l}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function H5e(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var z5e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fw=z5e.reduce((t,e)=>{const n=B5e(`Primitive.${e}`),i=T.forwardRef((r,s)=>{const{asChild:o,...a}=r,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),Hw="Tabs",[Q5e]=N5e(Hw,[vw]),RW=vw(),[G5e,eI]=Q5e(Hw),kW=T.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:l="automatic",...u}=t,d=LR(a),[f,g]=dh({prop:i,onChange:r,defaultProp:s??"",caller:Hw});return _.jsx(G5e,{scope:n,baseId:Al(),value:f,onValueChange:g,orientation:o,dir:d,activationMode:l,children:_.jsx(Fw.div,{dir:d,"data-orientation":o,...u,ref:e})})});kW.displayName=Hw;var IW="TabsList",MW=T.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...r}=t,s=eI(IW,n),o=RW(n);return _.jsx(Z7,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:i,children:_.jsx(Fw.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});MW.displayName=IW;var DW="TabsTrigger",PW=T.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:r=!1,...s}=t,o=eI(DW,n),a=RW(n),l=BW(o.baseId,i),u=LW(o.baseId,i),d=i===o.value;return _.jsx(ez,{asChild:!0,...a,focusable:!r,active:d,children:_.jsx(Fw.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:Ve(t.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?o.onValueChange(i):f.preventDefault()}),onKeyDown:Ve(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(i)}),onFocus:Ve(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!r&&f&&o.onValueChange(i)})})})});PW.displayName=DW;var NW="TabsContent",OW=T.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:r,children:s,...o}=t,a=eI(NW,n),l=BW(a.baseId,i),u=LW(a.baseId,i),d=i===a.value,f=T.useRef(d);return T.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),_.jsx(_o,{present:r||d,children:({present:g})=>_.jsx(Fw.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:g&&s})})});OW.displayName=NW;function BW(t,e){return`${t}-trigger-${e}`}function LW(t,e){return`${t}-content-${e}`}var $5e=kW,W5e=MW,j5e=PW,K5e=OW;const Y5e=({items:t,defaultValue:e,value:n,onValueChange:i,className:r})=>{const{isRTL:s}=Wt();return _.jsxs($5e,{defaultValue:e||t[0]?.value,value:n,onValueChange:i,className:_e("w-full",r),children:[_.jsx(W5e,{className:_e("w-full inline-flex h-[32px] gap-[20px] items-center border-b-[1px] border-[var(--tabs-border-color)]",s?"flex-row-reverse":""),children:t.map(o=>_.jsx(j5e,{value:o.value,disabled:o.disabled,className:_e("font-normal text-[14px] leading-[20px] text-[var(--tabs-color)] cursor-pointer pb-[3px] relative","hover:enabled:data-[state=inactive]:after:content-[''] hover:enabled:data-[state=inactive]:after:absolute hover:enabled:data-[state=inactive]:after:bottom-[-5px] hover:enabled:data-[state=inactive]:after:left-1/2 hover:enabled:data-[state=inactive]:after:transform hover:enabled:data-[state=inactive]:after:-translate-x-1/2 hover:enabled:data-[state=inactive]:after:w-[24px] hover:enabled:data-[state=inactive]:after:h-[4px] hover:enabled:data-[state=inactive]:after:bg-[var(--tabs-hover-border-color)] hover:enabled:data-[state=inactive]:after:rounded-t-[3px]","data-[state=active]:font-bold data-[state=active]:after:content-[''] data-[state=active]:after:absolute data-[state=active]:after:bottom-[-5px] data-[state=active]:after:left-0 data-[state=active]:after:right-0 data-[state=active]:after:h-[4px] data-[state=active]:after:bg-[var(--tabs-active-border-color)] data-[state=active]:after:rounded-t-[3px]","disabled:opacity-50 disabled:cursor-not-allowed"),children:o.label},o.value))}),t.map(o=>_.jsx(K5e,{value:o.value,className:"mt-[24px]",children:o.content},o.value))]})},uo=({children:t,header:e,error:n})=>{const{isRTL:i}=Wt();return _.jsxs("div",{className:_e("flex flex-col gap-[4px]",i?"items-end":""),children:[_.jsx("p",{className:_e("select-none text-[14px] leading-[20px] text-[var(--field-container-header-color)]",i?"text-end":""),children:e}),t,n&&_.jsx("p",{className:_e("text-[var(--field-container-error-color)]",i?"text-end":""),children:n})]})},UW="flex flex-col justify-between h-full",VW="flex flex-col gap-[12px] mb-[32px]",FW="flex flex-row justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",HW="flex flex-row-reverse justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",e3=It.getProvidersInfo(),q5e=({onClose:t})=>{const{addProvider:e}=Tr(),{isRTL:n}=Wt(),{t:i}=Ct(),[r,s]=me.useState(e3[0]),[o,a]=me.useState({name:"",url:r.baseUrl,key:""}),[l,u]=me.useState({key:"",url:"",name:""}),[d,f]=me.useState(!1),g=me.useRef(d),m=me.useRef(null),v=me.useRef(null),[S,C]=me.useState(void 0),E=D=>{const{name:P,value:N}=D.target,B=P==="name"?I8(N):N;a(G=>({...G,[P]:B})),u(G=>({...G,[P]:""}))},k=o.name.trim(),R=!k||!o.url||!!l.key||!!l.url||!!l.name,M=me.useCallback(async()=>{if(g.current||R)return;g.current=!0,f(!0);const D=await e({type:r.type,name:k,key:o.key,baseUrl:o.url});typeof D=="boolean"&&D?t():D&&u(P=>({...P,[D.field]:D.message})),g.current=!1,f(!1)},[e,r,o,t,R,k]);return me.useEffect(()=>{a(D=>({...D,url:r.baseUrl,key:""})),u({key:"",url:"",name:""})},[r]),me.useEffect(()=>{if(v.current&&S===void 0){const D=v.current.offsetWidth+1;C(D)}},[S]),me.useEffect(()=>{const D=P=>{P.key==="Enter"&&(P.preventDefault(),M())};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[M]),_.jsx(Pl,{open:!0,children:_.jsx(Nl,{header:i("AddProvider"),onClose:t,ref:m,children:_.jsxs("div",{className:UW,children:[_.jsxs("div",{className:VW,children:[_.jsx(uo,{header:i("Provider"),children:_.jsx(Vw,{className:"w-full",value:r.name,items:e3.map(D=>({text:D.name,id:D.name,onClick:()=>s(D)}))})}),_.jsx(uo,{header:i("Name"),error:l.name,children:_.jsx(mo,{name:"name",onChange:E,value:o.name,isError:!!l.name,placeholder:i("EnterName"),className:"w-full",maxLength:128})}),_.jsx(uo,{header:i("URL"),error:l.url,children:_.jsx(mo,{name:"url",onChange:E,value:o.url,isError:!!l.url,placeholder:i("EnterURL"),className:"w-full"})}),_.jsx(uo,{header:i("APIKey"),error:l.key,children:_.jsx(mo,{name:"key",onChange:E,value:o.key,isError:!!l.key,placeholder:i("EnterKey"),className:"w-full",type:"password"})})]}),_.jsxs("div",{className:n?HW:FW,children:[_.jsx(ln,{variant:"default",onClick:t,children:i("Cancel")}),_.jsx(ln,{ref:v,onClick:M,disabled:R||d,style:S?{width:`${S}px`}:void 0,children:d?_.jsx(wh,{className:"border-[var(--text-contrast-background)] border-r-transparent"}):i("AddProvider")})]})]})})})},J5e=({name:t,onClose:e})=>{const{providers:n,deleteProvider:i}=Tr(),{isRTL:r}=Wt(),[s,o]=me.useState(()=>{const u=n.find(d=>d.name===t);return u||{name:"",type:"",icon:"",key:"",baseUrl:""}}),{t:a}=Ct();me.useEffect(()=>{const u=n.find(d=>d.name===t);u&&o(u)},[n,t]);const l=me.useCallback(async()=>{await i(s),e()},[i,s,e]);return me.useEffect(()=>{const u=d=>{d.key==="Enter"&&(d.preventDefault(),l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[l]),_.jsx(Pl,{open:!0,children:_.jsx(Nl,{header:a("Warning"),onClose:e,withWarningIcon:!0,children:_.jsxs("div",{className:"flex flex-col justify-between h-full",children:[_.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:a("WantDeleteProvider")}),_.jsxs("div",{className:r?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[_.jsx(ln,{variant:"default",onClick:e,children:a("No")}),_.jsx(ln,{onClick:l,children:a("Yes")})]})]})})})},X5e=({name:t,onClose:e})=>{const{t:n}=Ct(),{isRTL:i}=Wt(),{providers:r,editProvider:s,currentProvider:o,setCurrentProvider:a}=Tr(),[l,u]=me.useState(()=>{const $=r.find(K=>K.name===t);return $||{name:"",type:"",icon:"",key:"",baseUrl:""}}),[d,f]=me.useState({name:l?.name,url:l?.baseUrl,key:l?.key}),[g,m]=me.useState({key:"",url:"",name:""}),[v,S]=me.useState(!1),C=me.useRef(v),E=me.useRef(null),[k,R]=me.useState(void 0);me.useEffect(()=>{const $=r.find(K=>K.name===t);$&&(u($),f({name:$.name,url:$.baseUrl,key:$.key}))},[r,t]),me.useEffect(()=>{f({name:l.name,url:l.baseUrl,key:l.key})},[l]);const M=me.useRef(null),D=$=>{const{name:K,value:X}=$.target,J=K==="name"?I8(X):X;f(Z=>({...Z,[K]:J})),m(Z=>({...Z,[K]:""}))},P=d.name.trim(),N=P===l.name&&d.url===l.baseUrl,G=d.key===l.key&&N||!!g.key||!!g.url||!!g.name||!P,V=me.useCallback(async()=>{if(C.current||G)return;C.current=!0,S(!0);const $={type:l?.type,name:P,key:d.key,baseUrl:d.url},K=await s($,l.name);if(typeof K=="boolean"&&K){if(o?.name===l.name){const X={...l,...$};a(X),It.setCurrentProvider(X)}e()}else K&&m(X=>({...X,[K.field]:K.message}));C.current=!1,S(!1)},[G,s,l,d,e,o,a,P]);return me.useEffect(()=>{if(E.current&&k===void 0){const $=E.current.offsetWidth+1;R($)}},[k]),me.useEffect(()=>{const $=K=>{K.key==="Enter"&&(K.preventDefault(),V())};return window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}},[V]),_.jsx(Pl,{open:!0,children:_.jsx(Nl,{header:n("EditAIProvider"),onClose:e,ref:M,children:_.jsxs("div",{className:UW,children:[_.jsxs("div",{className:VW,children:[_.jsx(uo,{header:n("Provider"),children:_.jsx(Vw,{value:l.type,items:[],className:"w-full"})}),_.jsx(uo,{header:n("Name"),error:g.name,children:_.jsx(mo,{name:"name",onChange:D,value:d.name,isError:!!g.name,placeholder:n("EnterName"),className:"w-full"})}),_.jsx(uo,{header:n("URL"),error:g.url,children:_.jsx(mo,{name:"url",onChange:D,value:d.url,isError:!!g.url,placeholder:n("EnterURL"),className:"w-full"})}),_.jsx(uo,{header:n("APIKey"),error:g.key,children:_.jsx(mo,{name:"key",onChange:D,value:d.key,isError:!!g.key,placeholder:n("EnterKey"),className:"w-full",type:"password"})})]}),_.jsxs("div",{className:i?HW:FW,children:[_.jsx(ln,{variant:"default",onClick:e,children:n("Cancel")}),_.jsx(ln,{ref:E,onClick:V,disabled:G||v,style:k?{width:`${k}px`}:void 0,children:v?_.jsx(wh,{className:"border-[var(--text-contrast-background)] border-r-transparent"}):n("Save")})]})]})})})},Z5e=({provider:t})=>{const{providersModels:e}=Tr(),{isRTL:n}=Wt(),[i,r]=me.useState(!1),[s,o]=me.useState(!1),[a,l]=me.useState(null),[u,d]=me.useState(!1),f=me.useCallback(v=>{l(v)},[]),{t:g}=Ct(),m=!!e.get(t.name)?.length;return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:_e("flex justify-between gap-[12px] px-[16px] py-[12px] min-w-[274px] max-w-[312px] flex-1 rounded-[8px] bg-[var(--ai-provider-item-background-color)] shadow-[var(--ai-provider-item-shadow)]",n?"flex-row-reverse":"flex-row"),children:[_.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[_.jsxs("div",{className:_e("flex items-center gap-[4px]",n?"flex-row-reverse":"flex-row"),children:[_.jsxs(Kd,{children:[_.jsx(qd,{asChild:!0,children:_.jsx("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--ai-provider-item-color)] truncate w-fit",children:t.name})}),_.jsx(Yd,{side:"bottom",children:t.name})]}),!m&&_.jsxs(Kd,{children:[_.jsx(qd,{asChild:!0,children:_.jsx("div",{children:_.jsx(gt,{iconName:"status.error",size:16,disableHover:!0,noColor:!0})})}),_.jsx(Yd,{side:"bottom",children:g("NoModelsAvailable")})]})]}),_.jsxs("p",{className:_e("text-[12px] leading-[14px] text-[var(--ai-provider-item-description-color)]",n?"text-end":""),children:[t.type,_.jsx("br",{}),t.baseUrl]})]}),_.jsx("div",{className:"flex items-center justify-end",ref:f,children:_.jsx(Yc,{onOpenChange:d,trigger:_.jsx(gt,{iconName:"more",size:20,isActive:u}),items:[{icon:_.jsx(gt,{iconName:"btn-edit",size:20,disableHover:!0,isStroke:!0}),text:g("Edit"),onClick:()=>r(!0)},{text:"",onClick:()=>{},isSeparator:!0},{icon:_.jsx(gt,{iconName:"btn-remove",size:20,disableHover:!0}),text:g("Delete"),onClick:()=>o(!0)}],side:n?"left":"right",align:n?"end":"start",sideOffset:0,containerRef:a})})]}),i?_.jsx(X5e,{name:t.name,onClose:()=>r(!1)}):null,s?_.jsx(J5e,{name:t.name,onClose:()=>o(!1)}):null]})},e3e=({isActive:t})=>{const[e,n]=me.useState(!1),{providers:i}=Tr(),{isRTL:r}=Wt(),{t:s}=Ct();return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:_e("flex",r?"justify-end":"justify-start"),children:_.jsx(ln,{className:"max-w-[fit-content]",onClick:()=>n(!0),disabled:!t,children:s("AddProvider")})}),_.jsx("div",{className:_e("flex flex-wrap gap-[16px]",t?"":"opacity-70 pointer-events-none"),children:i.map(o=>_.jsx(Z5e,{provider:o},o.name))}),e?_.jsx(q5e,{onClose:()=>n(!1)}):null]})},t3e=({name:t,onClose:e})=>{const{t:n}=Ct(),{isRTL:i}=Wt(),{deleteCustomServer:r}=Ns(),s=me.useCallback(()=>{r(t),e()},[r,t,e]);return me.useEffect(()=>{const o=a=>{a.key==="Enter"&&(a.preventDefault(),s())};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[s]),_.jsx(Pl,{open:!0,children:_.jsx(Nl,{header:n("Warning"),onClose:e,withWarningIcon:!0,children:_.jsxs("div",{className:"flex flex-col justify-between h-full",children:[_.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:n("WantDeleteServer")}),_.jsxs("div",{className:i?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[_.jsx(ln,{variant:"default",onClick:e,children:n("No")}),_.jsx(ln,{onClick:s,children:n("Yes")})]})]})})})},n3e=({type:t,open:e,onClose:n})=>{const{t:i}=Ct(),{isRTL:r}=Wt(),[s,o]=me.useState([]),{getCustomServersLogs:a}=Ns();me.useEffect(()=>{const u=async()=>{const f=a();o(f[t])};u();const d=setInterval(()=>{u()},500);return()=>clearInterval(d)},[a,t]);const l=async()=>{await navigator.clipboard.writeText(s.join(` -`)),n()};return _.jsx(Pl,{open:e,children:_.jsxs(Nl,{header:`${t} ${i("logs").toLowerCase()}`,onClose:n,className:"w-[720px] h-[520px]",children:[_.jsx("div",{className:"flex flex-col gap-[8px] h-[400px] py-[8px]",children:_.jsx("div",{className:"flex flex-col border h-[384px] border-[var(--servers-logs-dialog-border-color)] overflow-y-auto rounded-[8px]",children:s.map(u=>_.jsx("p",{className:"text-[var(--servers-logs-dialog-log-color)] font-normal text-[14px] leading-[20px]",children:u},u))})}),_.jsxs("div",{className:_e("flex flex-row items-center justify-end gap-[16px] h-[64px] border-t border-[var(--servers-edit-config-buttons-border-color)] mx-[-32px] px-[32px]",r?"flex-row-reverse":""),children:[_.jsx(ln,{onClick:l,variant:"default",children:i("CopyToClipboard")}),_.jsx(ln,{onClick:n,children:i("Close")})]})]})})},t3=({name:t,mcpItems:e,isLoading:n,isSystem:i,disableEnable:r})=>{const{t:s}=Ct(),{isRTL:o}=Wt(),[a,l]=me.useState(!1),[u,d]=me.useState(!1),[f,g]=me.useState(!1),[m,v]=me.useState(!1),[S,C]=me.useState(!1),E=me.useRef(null),{changeToolStatus:k}=Ns(),R=T.useCallback(()=>{e.filter(B=>!B.enabled).forEach(B=>{k(t,B.name,!0)})},[e,t,k]),M=T.useCallback(()=>{e.filter(B=>B.enabled).forEach(B=>{k(t,B.name,!1)})},[e,t,k]),D=T.useCallback(()=>g(!0),[]);me.useEffect(()=>{n&&l(!1)},[n]),me.useEffect(()=>{const B=setInterval(()=>{v(sn.getCustomServersStoped().includes(t))},1e3);return()=>clearInterval(B)},[t]);const P=m?!1:n,N=T.useMemo(()=>{const B=[];return e.length>0&&(B.push({text:s("EnableAllTools"),onClick:R,withSpace:!i},{text:s("DisableAllTools"),onClick:M,withSpace:!i}),i||B.push({text:"",onClick:()=>{},isSeparator:!0})),i||B.push({icon:_.jsx(gt,{iconName:"btn-reset",size:20,disableHover:!0,isStroke:!0}),text:s("Restart"),onClick:()=>sn.restartCustomServer(t)},{icon:_.jsx(gt,{iconName:"btn-menu-navigation",size:20,disableHover:!0,isStroke:!0}),text:s("Logs"),onClick:D},{text:"",onClick:()=>{},isSeparator:!0},{icon:_.jsx(gt,{iconName:"btn-remove",size:20,disableHover:!0}),text:s("Delete"),onClick:()=>C(!0)}),B},[e.length,i,t,s,R,M,D]);return _.jsxs("div",{dir:o?"rtl":"ltr",className:"flex flex-col",children:[_.jsxs("div",{className:_e("h-[36px] px-[8px] rounded-[4px] flex items-center justify-between",P?"":"cursor-pointer",a?"bg-[var(--servers-available-tools-item-active-background-color)]":"bg-[var(--servers-available-tools-item-background-color)]",!n&&!a?"hover:bg-[var(--servers-available-tools-item-hover-background-color)]":""),onClick:()=>{n||u||e.length===0||l(B=>!B)},children:[_.jsxs("div",{className:"flex items-center gap-[8px]",children:[_.jsx(gt,{iconName:"arrow.right",size:24,width:8,height:8,disableHover:!0,isStroke:!0,isTransform:a,className:o?"rotate-180":""}),_.jsx("p",{className:"text-[var(--servers-available-tools-item-name-color)]",children:t}),!P&&m?_.jsx(gt,{iconName:"status.error",size:16,disableHover:!0,noColor:!0}):null,n?null:_.jsxs("p",{className:"font-normal text-[14px] text-[var(--servers-available-tools-sub-header-color)]",children:[_.jsx("span",{className:"text-[var(--servers-available-tools-current-tool-color)]",children:e.filter(B=>B.enabled).length}),"/",e.length," ",s("ToolsEnabled")]})]}),_.jsx("div",{ref:E,children:P?_.jsx(wh,{}):_.jsx(Yc,{onOpenChange:d,trigger:_.jsx(gt,{iconName:"more",size:20,isActive:u,insideElement:!0}),items:N,side:o?"left":"right",align:o?"end":"start",sideOffset:0,containerRef:E.current})})]}),a?_.jsx("div",{className:"flex flex-col gap-[12px] mt-[4px]",children:e.map(B=>{const G=i?`${B.description?.split(". ")[0]}.`:B.description;return _.jsxs("div",{className:_e("rounded-[4px] cursor-pointer flex flex-col hover:bg-[var(--servers-available-tools-item-hover-background-color)]",o?"pr-[40px] pl-[8px]":"pl-[40px] pr-[8px]"),onClick:()=>{k(t,B.name,!B.enabled)},children:[_.jsxs("div",{className:"flex items-center justify-between w-full",children:[_.jsx("p",{className:"text-[var(--servers-available-tools-item-name-color)]",children:B.name}),_.jsx(Bz,{checked:B.enabled??!1,disabled:r&&!B.enabled,onCheckedChange:()=>{}})]}),G&&_.jsxs(Kd,{children:[_.jsx(qd,{asChild:!0,children:_.jsx("p",{className:"text-[13px] leading-[18px] line-clamp-2 text-[var(--servers-available-tools-sub-header-color)]",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:G})}),_.jsx(Yd,{children:_.jsx("div",{className:"max-w-[300px]",children:G})})]})]},B.name)})}):null,f?_.jsx(n3e,{type:t,open:f,onClose:()=>g(!1)}):null,S?_.jsx(t3e,{name:t,onClose:()=>C(!1)}):null]})},i3e=()=>{const{t}=Ct(),{isRTL:e}=Wt(),[n,i]=me.useState({}),{servers:r,tools:s,webSearchEnabled:o}=Ns(),[a,l]=me.useState(o?s.length-2:s.length);me.useEffect(()=>{l(o?s.length-2:s.length),console.log(s.length)},[s.length,o]),me.useEffect(()=>{i(sn.getCustomServers());const d=setInterval(()=>{i(sn.getCustomServers())},1e3);return()=>clearInterval(d)},[]);const u=o?s.length>=Py:s.length>=kd;return _.jsxs("div",{className:"w-[640px] h-[560px] border border-[var(--servers-available-tools-border-color)] rounded-[8px] flex flex-col",children:[_.jsxs("div",{className:_e("min-h-[44px] h-[44px] flex items-center justify-between px-[16px] border-b border-[var(--servers-available-tools-border-color)]",e?"flex-row-reverse":""),children:[_.jsx("p",{className:"font-bold text-[14px] leading-[20px] text-[var(--servers-available-tools-header-color)]",children:t("AvailableTools")}),_.jsxs("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--servers-available-tools-sub-header-color)]",children:[_.jsx("span",{className:"text-[var(--servers-available-tools-current-tool-color)]",children:a}),"/",kd," ",t("Tools")]})]}),_.jsxs("div",{dir:e?"rtl":"ltr",className:"flex flex-col gap-[8px] pt-[12px] pb-[16px] px-[8px] overflow-y-auto",children:[_.jsx(t3,{name:"desktop-editor",mcpItems:r["desktop-editor"]??[],isLoading:!1,isSystem:!0,disableEnable:u}),Object.keys(n).map(d=>_.jsx(t3,{name:d,mcpItems:r[d]??[],isLoading:!r[d]?.length,isSystem:!1,disableEnable:u},d))]})]})},zW=1024;let r3e=0,JE=class{constructor(e,n){this.from=e,this.to=n}};class at{constructor(e={}){this.id=r3e++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=er.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:t=>t.split(" ")});at.openedBy=new at({deserialize:t=>t.split(" ")});at.group=new at({deserialize:t=>t.split(" ")});at.isolate=new at({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class Wp{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const s3e=Object.create(null);class er{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):s3e,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new er(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(at.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(at.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}er.none=new er("",Object.create(null),0,8);class tI{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(o|an.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=r&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&i&&(a||!l.type.isAnonymous)&&i(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:rI(er.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new fn(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new fn(er.none,n,i,r)))}static build(e){return c3e(e)}}fn.empty=new fn(er.none,[],[],0);class nI{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new nI(this.buffer,this.index)}}class _l{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return er.none}toString(){let e=[];for(let n=0;n0));l=o[l+3]);return a}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function Rg(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?l.length:-1;e!=d;e+=n){let f=l[e],g=u[e]+a.from;if(!(!(s&an.EnterBracketed&&f instanceof fn&&((o=Wp.get(f))===null||o===void 0?void 0:o.overlay)===null&&(g>=i||g+f.length<=i))&&!QW(r,i,g,g+f.length))){if(f instanceof _l){if(s&an.ExcludeBuffers)continue;let m=f.findChild(0,f.buffer.length,n,i-g,r);if(m>-1)return new gl(new o3e(a,f,e,g),null,m)}else if(s&an.IncludeAnonymous||!f.type.isAnonymous||iI(f)){let m;if(!(s&an.IgnoreMounts)&&(m=Wp.get(f))&&!m.overlay)return new es(m.tree,g,e,a);let v=new es(f,g,e,a);return s&an.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?f.children.length-1:0,n,i,r,s)}}}if(s&an.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&an.IgnoreOverlays)&&(r=Wp.get(this._tree))&&r.overlay){let s=e-this.from,o=i&an.EnterBracketed&&r.bracketed;for(let{from:a,to:l}of r.overlay)if((n>0||o?a<=s:a=s:l>s))return new es(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function i3(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function v2(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class o3e{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}}class gl extends GW{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new gl(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&an.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new gl(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new gl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new gl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new fn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function $W(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;sn.from||o.to=e){let a=new es(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Rg(a,e,n,!1))}}return r?$W(r):i}class b2{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~an.EnterBracketed,e instanceof es)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof es?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&an.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&an.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&an.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let a=i._tree.children[s];if(this.mode&an.IncludeAnonymous||a instanceof _l||!a.type.isAnonymous||iI(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return v2(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function iI(t){return t.children.some(e=>e instanceof _l||!e.type.isAnonymous||iI(e))}function c3e(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=zW,reused:s=[],minRepeatType:o=i.types.length}=t,a=Array.isArray(n)?new nI(n,n.length):n,l=i.types,u=0,d=0;function f(D,P,N,B,G,V){let{id:$,start:K,end:X,size:J}=a,Z=d,Q=u;if(J<0)if(a.next(),J==-1){let z=s[$];N.push(z),B.push(K-D);return}else if(J==-3){u=$;return}else if(J==-4){d=$;return}else throw new RangeError(`Unrecognized record size: ${J}`);let q=l[$],j,oe,L=K-D;if(X-K<=r&&(oe=C(a.pos-P,G))){let z=new Uint16Array(oe.size-oe.skip),te=a.pos-oe.size,U=z.length;for(;a.pos>te;)U=E(oe.start,z,U);j=new _l(z,X-oe.start,i),L=oe.start-D}else{let z=a.pos-J;a.next();let te=[],U=[],pe=$>=o?$:-1,xe=0,Ce=X;for(;a.pos>z;)pe>=0&&a.id==pe&&a.size>=0?(a.end<=Ce-r&&(v(te,U,K,xe,a.end,Ce,pe,Z,Q),xe=te.length,Ce=a.end),a.next()):V>2500?g(K,z,te,U):f(K,z,te,U,pe,V+1);if(pe>=0&&xe>0&&xe-1&&xe>0){let ve=m(q,Q);j=rI(q,te,U,0,te.length,0,X-K,ve,ve)}else j=S(q,te,U,X-K,Z-X,Q)}N.push(j),B.push(L)}function g(D,P,N,B){let G=[],V=0,$=-1;for(;a.pos>P;){let{id:K,start:X,end:J,size:Z}=a;if(Z>4)a.next();else{if($>-1&&X<$)break;$<0&&($=J-r),G.push(K,X,J),V++,a.next()}}if(V){let K=new Uint16Array(V*4),X=G[G.length-2];for(let J=G.length-3,Z=0;J>=0;J-=3)K[Z++]=G[J],K[Z++]=G[J+1]-X,K[Z++]=G[J+2]-X,K[Z++]=Z;N.push(new _l(K,G[2]-X,i)),B.push(X-D)}}function m(D,P){return(N,B,G)=>{let V=0,$=N.length-1,K,X;if($>=0&&(K=N[$])instanceof fn){if(!$&&K.type==D&&K.length==G)return K;(X=K.prop(at.lookAhead))&&(V=B[$]+K.length+X)}return S(D,N,B,G,V,P)}}function v(D,P,N,B,G,V,$,K,X){let J=[],Z=[];for(;D.length>B;)J.push(D.pop()),Z.push(P.pop()+N-G);D.push(S(i.types[$],J,Z,V-G,K-V,X)),P.push(G-N)}function S(D,P,N,B,G,V,$){if(V){let K=[at.contextHash,V];$=$?[K].concat($):[K]}if(G>25){let K=[at.lookAhead,G];$=$?[K].concat($):[K]}return new fn(D,P,N,B,$)}function C(D,P){let N=a.fork(),B=0,G=0,V=0,$=N.end-r,K={size:0,start:0,skip:0};e:for(let X=N.pos-D;N.pos>X;){let J=N.size;if(N.id==P&&J>=0){K.size=B,K.start=G,K.skip=V,V+=4,B+=4,N.next();continue}let Z=N.pos-J;if(J<0||Z=o?4:0,q=N.start;for(N.next();N.pos>Z;){if(N.size<0)if(N.size==-3||N.size==-4)Q+=4;else break e;else N.id>=o&&(Q+=4);N.next()}G=q,B+=J,V+=Q}return(P<0||B==D)&&(K.size=B,K.start=G,K.skip=V),K.size>4?K:void 0}function E(D,P,N){let{id:B,start:G,end:V,size:$}=a;if(a.next(),$>=0&&B4){let X=a.pos-($-4);for(;a.pos>X;)N=E(D,P,N)}P[--N]=K,P[--N]=V-D,P[--N]=G-D,P[--N]=B}else $==-3?u=B:$==-4&&(d=B);return N}let k=[],R=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,k,R,-1,0);let M=(e=t.length)!==null&&e!==void 0?e:k.length?R[0]+k[0].length:0;return new fn(l[t.topID],k.reverse(),R.reverse(),M)}const r3=new WeakMap;function ev(t,e){if(!t.isAnonymous||e instanceof _l||e.type!=t)return 1;let n=r3.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof fn)){n=1;break}n+=ev(t,i)}r3.set(e,n)}return n}function rI(t,e,n,i,r,s,o,a,l){let u=0;for(let v=i;v=d)break;P+=N}if(R==M+1){if(P>d){let N=v[M];m(N.children,N.positions,0,N.children.length,S[M]+k);continue}f.push(v[M])}else{let N=S[R-1]+v[R-1].length-D;f.push(rI(t,v,S,M,R,D,N,null,l))}g.push(D+k-s)}}return m(e,n,i,r,0),(a||l)(f,g,o)}class Nc{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new Nc(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,u=0;;a++){let d=a=i)for(;o&&o.from=g.from||f<=g.to||u){let m=Math.max(g.from,l)-u,v=Math.min(g.to,f)-u;g=m>=v?null:new Nc(m,v,g.tree,g.offset+u,a>0,!!d)}if(g&&r.push(g),o.to>f)break;o=snew JE(r.from,r.to)):[new JE(0,0)]:[new JE(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}}class u3e{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new at({perNode:!0});var s3={};class db{constructor(e,n,i,r,s,o,a,l,u,d=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new db(e,[],n,i,i,0,[],0,r?new o3(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,u)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(n==i)return;if(o.buffer[a-2]>=n){o.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>i;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r,!o.stateFlag(s,1)&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new db(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new d3e(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sl&1&&a==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=i(o,s+1);if(a!=null)return a}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class o3{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class d3e{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class hb{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new hb(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new hb(this.stack,this.pos,this.index)}}function ny(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[r++]=s:n=new e(s)}return n}class tv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const a3=new tv;class h3e{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=a3,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n=this.chunk2Pos&&ia.to&&(this.chunk2=this.chunk2.slice(0,a.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=a3,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}}class Bd{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;f3e(this.data,e,n,this.id,i.data,i.tokenPrecTable)}}Bd.prototype.contextual=Bd.prototype.fallback=Bd.prototype.extend=!1;Bd.prototype.fallback=Bd.prototype.extend=!1;function f3e(t,e,n,i,r,s){let o=0,a=1<0){let v=t[m];if(l.allows(v)&&(e.token.value==-1||e.token.value==v||p3e(v,e.token.value,r,s))){e.acceptToken(v);break}}let d=e.next,f=0,g=t[o+2];if(e.next<0&&g>f&&t[u+g*3-3]==65535){o=t[u+g*3-1];continue e}for(;f>1,v=u+m+(m<<1),S=t[v],C=t[v+1]||65536;if(d=C)f=m+1;else{o=t[v+2],e.advance();continue e}}break}}function l3(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function p3e(t,e,n,i){let r=l3(n,i,e);return r<0||l3(n,i,t)e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}class g3e{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?c3(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?c3(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof fn){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class m3e{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new tv)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;uf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let g=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!d.extend&&(i=f,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!i&&e.pos==this.stream.end&&(i=new tv,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new tv,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;se.bufferLength*4?new g3e(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(a);else{if(this.advanceStack(a,i,e))continue;{r||(r=[],s=[]),r.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!i.length){let o=r&&v3e(r);if(o)return hr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw hr&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return hr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((a,l)=>l.score-a.score);i.length>o;)i.pop();i.some(a=>a.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)i.splice(l--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,a)=>a.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,d=u?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let g=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(g>-1&&f.length&&(!u||(f.prop(at.contextHash)||0)==d))return e.useNode(f,g),hr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof fn)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof fn&&f.positions[0]==0)f=m;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),hr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ur?n.push(v):i.push(v)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return u3(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),hr&&console.log(d+this.stackID(a)+" (restarted)"),this.advanceFully(a,i))))continue;let f=a.split(),g=d;for(let m=0;m<10&&f.forceReduce()&&(hr&&console.log(g+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)hr&&(g=this.stackID(f)+" -> ");for(let m of a.recoverByInsert(l))hr&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),hr&&console.log(d+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),u3(a,i)):(!r||r.scoree.topRules[a][1]),r=[];for(let a=0;a=0)s(d,l,a[u++]);else{let f=a[u+-d];for(let g=-d;g>0;g--)s(a[u++],l,f);u++}}}this.nodeSet=new tI(n.map((a,l)=>er.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:i.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=zW;let o=ny(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new Bd(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,i){let r=new A3e(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],a=o&1,l=r[s++];if(a&&i)return l;for(let u=s+(o>>1);s0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ia(this.data,s+2);else break;r=n(ia(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=ia(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(fb.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(a=>a.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=d3(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,i)<<1|e}return t.get}let b3e=0;class $r{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=b3e++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof $r&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new $r(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new pb(e);return i=>i.modified.indexOf(n)>-1?i:pb.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}}let w3e=0;class pb{constructor(e){this.name=e,this.instances=[],this.id=w3e++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(a=>a.base==e&&S3e(n,a.modified));if(i)return i;let r=[],s=new $r(e.name,r,e,n);for(let a of n)a.instances.push(s);let o=C3e(n);for(let a of e.set)if(!a.modified.length)for(let l of o)r.push(pb.get(a,l));return s}}function S3e(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function C3e(t){let e=[[]];for(let n=0;ni.length-n.length)}function jW(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,a=r;for(let f=0;;){if(a=="..."&&f>0&&f+3==r.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!g)throw new RangeError("Invalid path: "+r);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),f+=g[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);a=r.slice(f)}let l=s.length-1,u=s[l];if(!u)throw new RangeError("Invalid path: "+r);let d=new kg(i,o,l>0?s.slice(0,l):null);e[u]=d.sort(e[u])}}return KW.add(e)}const KW=new at({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new kg(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});class kg{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let a of s)for(let l of a.set){let u=n[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function x3e(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function E3e(t,e,n,i=0,r=t.length){let s=new _3e(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}class _3e{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,s){let{type:o,from:a,to:l}=e;if(a>=i||l<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=T3e(e)||kg.empty,f=x3e(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,a),u),d.opaque)return;let g=e.tree&&e.tree.prop(at.mounted);if(g&&g.overlay){let m=e.node.enter(g.overlay[0].from+a,1),v=this.highlighters.filter(C=>!C.scope||C.scope(g.tree.type)),S=e.firstChild();for(let C=0,E=a;;C++){let k=C=R||!e.nextSibling())););if(!k||R>i)break;E=k.to+a,E>n&&(this.highlightRange(m.cursor(),Math.max(n,k.from+a),Math.min(i,E),"",v),this.startSpan(Math.min(i,E),u))}S&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),u)}while(e.nextSibling());e.parent()}}}function T3e(t){let e=t.type.prop(KW);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ee=$r.define,iy=Ee(),cl=Ee(),h3=Ee(cl),f3=Ee(cl),ul=Ee(),ry=Ee(ul),ZE=Ee(ul),to=Ee(),hc=Ee(to),qs=Ee(),Js=Ee(),w2=Ee(),ep=Ee(w2),sy=Ee(),Se={comment:iy,lineComment:Ee(iy),blockComment:Ee(iy),docComment:Ee(iy),name:cl,variableName:Ee(cl),typeName:h3,tagName:Ee(h3),propertyName:f3,attributeName:Ee(f3),className:Ee(cl),labelName:Ee(cl),namespace:Ee(cl),macroName:Ee(cl),literal:ul,string:ry,docString:Ee(ry),character:Ee(ry),attributeValue:Ee(ry),number:ZE,integer:Ee(ZE),float:Ee(ZE),bool:Ee(ul),regexp:Ee(ul),escape:Ee(ul),color:Ee(ul),url:Ee(ul),keyword:qs,self:Ee(qs),null:Ee(qs),atom:Ee(qs),unit:Ee(qs),modifier:Ee(qs),operatorKeyword:Ee(qs),controlKeyword:Ee(qs),definitionKeyword:Ee(qs),moduleKeyword:Ee(qs),operator:Js,derefOperator:Ee(Js),arithmeticOperator:Ee(Js),logicOperator:Ee(Js),bitwiseOperator:Ee(Js),compareOperator:Ee(Js),updateOperator:Ee(Js),definitionOperator:Ee(Js),typeOperator:Ee(Js),controlOperator:Ee(Js),punctuation:w2,separator:Ee(w2),bracket:ep,angleBracket:Ee(ep),squareBracket:Ee(ep),paren:Ee(ep),brace:Ee(ep),content:to,heading:hc,heading1:Ee(hc),heading2:Ee(hc),heading3:Ee(hc),heading4:Ee(hc),heading5:Ee(hc),heading6:Ee(hc),contentSeparator:Ee(to),list:Ee(to),quote:Ee(to),emphasis:Ee(to),strong:Ee(to),link:Ee(to),monospace:Ee(to),strikethrough:Ee(to),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:sy,documentMeta:Ee(sy),annotation:Ee(sy),processingInstruction:Ee(sy),definition:$r.defineModifier("definition"),constant:$r.defineModifier("constant"),function:$r.defineModifier("function"),standard:$r.defineModifier("standard"),local:$r.defineModifier("local"),special:$r.defineModifier("special")};for(let t in Se){let e=Se[t];e instanceof $r&&(e.name=t)}YW([{tag:Se.link,class:"tok-link"},{tag:Se.heading,class:"tok-heading"},{tag:Se.emphasis,class:"tok-emphasis"},{tag:Se.strong,class:"tok-strong"},{tag:Se.keyword,class:"tok-keyword"},{tag:Se.atom,class:"tok-atom"},{tag:Se.bool,class:"tok-bool"},{tag:Se.url,class:"tok-url"},{tag:Se.labelName,class:"tok-labelName"},{tag:Se.inserted,class:"tok-inserted"},{tag:Se.deleted,class:"tok-deleted"},{tag:Se.literal,class:"tok-literal"},{tag:Se.string,class:"tok-string"},{tag:Se.number,class:"tok-number"},{tag:[Se.regexp,Se.escape,Se.special(Se.string)],class:"tok-string2"},{tag:Se.variableName,class:"tok-variableName"},{tag:Se.local(Se.variableName),class:"tok-variableName tok-local"},{tag:Se.definition(Se.variableName),class:"tok-variableName tok-definition"},{tag:Se.special(Se.variableName),class:"tok-variableName2"},{tag:Se.definition(Se.propertyName),class:"tok-propertyName tok-definition"},{tag:Se.typeName,class:"tok-typeName"},{tag:Se.namespace,class:"tok-namespace"},{tag:Se.className,class:"tok-className"},{tag:Se.macroName,class:"tok-macroName"},{tag:Se.propertyName,class:"tok-propertyName"},{tag:Se.operator,class:"tok-operator"},{tag:Se.comment,class:"tok-comment"},{tag:Se.meta,class:"tok-meta"},{tag:Se.invalid,class:"tok-invalid"},{tag:Se.punctuation,class:"tok-punctuation"}]);const R3e=jW({String:Se.string,Number:Se.number,"True False":Se.bool,PropertyName:Se.propertyName,Null:Se.null,", :":Se.separator,"[ ]":Se.squareBracket,"{ }":Se.brace}),k3e=fb.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[R3e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let S2=[],qW=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=qW[i])e=i+1;else return!0;if(e==n)return!1}}function p3(t){return t>=127462&&t<=127487}const g3=8205;function M3e(t,e,n=!0,i=!0){return(n?JW:D3e)(t,e,i)}function JW(t,e,n){if(e==t.length)return e;e&&XW(t.charCodeAt(e))&&ZW(t.charCodeAt(e-1))&&e--;let i=e1(t,e);for(e+=m3(i);e=0&&p3(e1(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function D3e(t,e,n){for(;e>0;){let i=JW(t,e-2,n);if(i=56320&&t<57344}function ZW(t){return t>=55296&&t<56320}function m3(t){return t<65536?1:2}class wt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=th(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),so.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=th(this,e,n);let i=[];return this.decompose(e,n,i,0),so.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new jp(this),s=new jp(e);for(let o=n,a=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new jp(this,e)}iterRange(e,n=this.length){return new ej(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new tj(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?wt.empty:e.length<=32?new dn(e):so.from(dn.split(e,[]))}}class dn extends wt{constructor(e,n=P3e(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((n?i:a)>=e)return new N3e(r,a,i,o);r=a+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new dn(A3(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),a=nv(s.text,o.text.slice(),0,s.length);if(a.length<=32)i.push(new dn(a,o.length+s.length));else{let l=a.length>>1;i.push(new dn(a.slice(0,l)),new dn(a.slice(l)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof dn))return super.replace(e,n,i);[e,n]=th(this,e,n);let r=nv(this.text,nv(i.text,A3(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new dn(r,s):so.from(dn.split(r,[]),s)}sliceString(e,n=this.length,i=` -`){[e,n]=th(this,e,n);let r="";for(let s=0,o=0;s<=n&&oe&&o&&(r+=i),es&&(r+=a.slice(Math.max(0,e-s),n-s)),s=l+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new dn(i,r)),i=[],r=-1);return r>-1&&n.push(new dn(i,r)),n}}class so extends wt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,l=i+o.lines-1;if((n?l:a)>=e)return o.lineInner(e,n,i,r);r=a+1,i=l+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!u?i.push(a):a.decompose(e-o,n-o,i,u)}o=l+1}}replace(e,n,i){if([e,n]=th(this,e,n),i.lines=s&&n<=a){let l=o.replace(e-s,n-s,i),u=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>u>>6){let d=this.children.slice();return d[r]=l,new so(d,this.length-(n-e)+i.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=` -`){[e,n]=th(this,e,n);let r="";for(let s=0,o=0;se&&s&&(r+=i),eo&&(r+=a.sliceString(e-o,n-o,i)),o=l+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof so))return 0;let i=0,[r,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==a)return i;let l=this.children[r],u=e.children[s];if(l!=u)return i+l.scanIdentical(u,n);i+=l.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of e)i+=m.lines;if(i<32){let m=[];for(let v of e)v.flatten(m);return new dn(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,a=[],l=0,u=-1,d=[];function f(m){let v;if(m.lines>s&&m instanceof so)for(let S of m.children)f(S);else m.lines>o&&(l>o||!l)?(g(),a.push(m)):m instanceof dn&&l&&(v=d[d.length-1])instanceof dn&&m.lines+v.lines<=32?(l+=m.lines,u+=m.length+1,d[d.length-1]=new dn(v.text.concat(m.text),v.length+1+m.length)):(l+m.lines>r&&g(),l+=m.lines,u+=m.length+1,d.push(m))}function g(){l!=0&&(a.push(d.length==1?d[0]:so.from(d,u)),u=-1,l=d.length=0)}for(let m of e)f(m);return g(),a.length==1?a[0]:new so(a,n)}}wt.empty=new dn([""],0);function P3e(t){let e=-1;for(let n of t)e+=n.length+1;return e}function nv(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(l>i&&(a=a.slice(0,i-r)),r0?1:(e instanceof dn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,a=r instanceof dn?r.text.length:r.children.length;if(o==(n>0?a:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(r instanceof dn){let l=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof dn?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ej{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new jp(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class tj{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(wt.prototype[Symbol.iterator]=function(){return this.iter()},jp.prototype[Symbol.iterator]=ej.prototype[Symbol.iterator]=tj.prototype[Symbol.iterator]=function(){return this});class N3e{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}}function th(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Ln(t,e,n=!0,i=!0){return M3e(t,e,n,i)}function O3e(t){return t>=56320&&t<57344}function B3e(t){return t>=55296&&t<56320}function Ki(t,e){let n=t.charCodeAt(e);if(!B3e(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return O3e(i)?(n-55296<<10)+(i-56320)+65536:n}function sI(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function oo(t){return t<65536?1:2}const C2=/\r\n?|\n/;var Mi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Mi||(Mi={}));class yo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return s+(e-r);s+=a}else{if(i!=Mi.Simple&&u>=e&&(i==Mi.TrackDel&&re||i==Mi.TrackBefore&&re))return null;if(u>e||u==e&&n<0&&!a)return e==r||n<0?s:s+l;s+=l}r=u}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i=0&&r<=n&&a>=e)return rn?"cover":!0;r=a}return!1}toString(){let e="";for(let n=0;n=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new yo(e)}static create(e){return new yo(e)}}class Bn extends yo{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return x2(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return E2(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=a,n[r+1]=o;let l=r>>1;for(;i.length0&&ml(i,n,s.text),s.forward(d),a+=d}let u=e[o++];for(;a>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,a=null;function l(d=!1){if(!d&&!r.length)return;og||f<0||g>n)throw new RangeError(`Invalid change range ${f} to ${g} (in doc of length ${n})`);let v=m?typeof m=="string"?wt.of(m.split(i||C2)):m:wt.empty,S=v.length;if(f==g&&S==0)return;fo&&fi(r,f-o,-1),fi(r,g-f,S),ml(s,r,v),o=g}}return u(e),l(!a),a}static empty(e){return new Bn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;ra&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function ml(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(r,u,s,d,f),r=u,s=d}}}function E2(t,e,n,i=!1){let r=[],s=i?[]:null,o=new Ig(t),a=new Ig(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let u=Math.min(o.len,a.len);fi(r,u,-1),o.forward(u),a.forward(u)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let u=0,d=o.len;for(;d;)if(a.ins==-1){let f=Math.min(d,a.len);u+=f,d-=f,a.forward(f)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||i.length>u),s.forward2(l),o.forward(l)}}}}class Ig{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?wt.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?wt.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class kc{constructor(e,n,i){this.from=e,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new kc(i,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return fe.range(e,n);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return fe.range(this.anchor,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return fe.range(e.anchor,e.head)}static create(e,n,i){return new kc(e,n,i)}}class fe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:fe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new fe(e.ranges.map(n=>kc.fromJSON(n)),e.main)}static single(e,n=e){return new fe([fe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;re?8:0)|s)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;rs.head?fe.range(l,a):fe.range(a,l))}}return new fe(e,n)}}function ij(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let oI=0;class Me{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=oI++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Me(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:aI),!!e.static,e.enables)}of(e){return new iv([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new iv(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new iv(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function aI(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class iv{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=oI++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?u=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&d.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,g){if(l&&g.docChanged||u&&(g.docChanged||g.selection)||_2(f,d)){let m=i(f);if(a?!y3(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,g)=>{let m,v=g.config.address[s];if(v!=null){let S=mb(g,v);if(this.dependencies.every(C=>C instanceof Me?g.facet(C)===f.facet(C):C instanceof si?g.field(C,!1)==f.field(C,!1):!0)||(a?y3(m=i(f),S,r):r(m=i(f),S)))return f.values[o]=S,0}else m=i(f);return f.values[o]=m,1}}}}function y3(t,e,n){if(t.length!=e.length)return!1;for(let i=0;it[l.id]),r=n.map(l=>l.type),s=i.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let u=[];for(let d=0;di===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(oy).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(oy),o=r.facet(oy),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(i.values[n]=a.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,oy.of({field:this,create:e})]}get extension(){return this}}const wc={lowest:4,low:3,default:2,high:1,highest:0};function tp(t){return e=>new rj(e,t)}const Jc={highest:tp(wc.highest),high:tp(wc.high),default:tp(wc.default),low:tp(wc.low),lowest:tp(wc.lowest)};class rj{constructor(e,n){this.inner=e,this.prec=n}}class zw{of(e){return new T2(this,e)}reconfigure(e){return zw.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class T2{constructor(e,n){this.compartment=e,this.inner=n}}class gb{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let g of U3e(e,n,o))g instanceof si?r.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let a=Object.create(null),l=[],u=[];for(let g of r)a[g.id]=u.length<<1,u.push(m=>g.slot(m));let d=i?.config.facets;for(let g in s){let m=s[g],v=m[0].facet,S=d&&d[g]||[];if(m.every(C=>C.type==0))if(a[v.id]=l.length<<1|1,aI(S,m))l.push(i.facet(v));else{let C=v.combine(m.map(E=>E.value));l.push(i&&v.compare(C,i.facet(v))?i.facet(v):C)}else{for(let C of m)C.type==0?(a[C.id]=l.length<<1|1,l.push(C.value)):(a[C.id]=u.length<<1,u.push(E=>C.dynamicSlot(E)));a[v.id]=u.length<<1,u.push(C=>L3e(C,v,m))}}let f=u.map(g=>g(a));return new gb(e,o,f,a,l,s)}}function U3e(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,a){let l=r.get(o);if(l!=null){if(l<=a)return;let u=i[l].indexOf(o);u>-1&&i[l].splice(u,1),o instanceof T2&&n.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let u of o)s(u,a);else if(o instanceof T2){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,a)}else if(o instanceof rj)s(o.inner,o.prec);else if(o instanceof si)i[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof iv)i[a].push(o),o.facet.extensions&&s(o.facet.extensions,wc.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,a)}}return s(t,wc.default),i.reduce((o,a)=>o.concat(a))}function Kp(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function mb(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const sj=Me.define(),R2=Me.define({combine:t=>t.some(e=>e),static:!0}),oj=Me.define({combine:t=>t.length?t[0]:void 0,static:!0}),aj=Me.define(),lj=Me.define(),cj=Me.define(),uj=Me.define({combine:t=>t.length?t[0]:!1});class ba{constructor(e,n){this.type=e,this.value=n}static define(){return new V3e}}class V3e{of(e){return new ba(this,e)}}class F3e{constructor(e){this.map=e}of(e){return new et(this,e)}}class et{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new et(this.type,n)}is(e){return this.type==e}static define(e={}){return new F3e(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}}et.reconfigure=et.define();et.appendConfig=et.define();class Un{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ij(i,n.newLength),s.some(a=>a.type==Un.time)||(this.annotations=s.concat(Un.time.of(Date.now())))}static create(e,n,i,r,s,o){return new Un(e,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Un.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Un.time=ba.define();Un.userEvent=ba.define();Un.addToHistory=ba.define();Un.remote=ba.define();function H3e(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i=t[i]))s=t[i++],o=t[i++];else if(r=0;r--){let s=i[r](t);s instanceof Un?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Un?t=s[0]:t=hj(e,Ld(s),!1)}return t}function Q3e(t){let e=t.startState,n=e.facet(cj),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=dj(i,k2(e,s,t.changes.newLength),!0))}return i==t?t:Un.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const G3e=[];function Ld(t){return t==null?G3e:Array.isArray(t)?t:[t]}var Jt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Jt||(Jt={}));const $3e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let I2;try{I2=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function W3e(t){if(I2)return I2.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||$3e.test(n)))return!0}return!1}function j3e(t){return e=>{if(!/\S/.test(e))return Jt.Space;if(W3e(e))return Jt.Word;for(let n=0;n-1)return Jt.Word;return Jt.Other}}class At{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ar.set(u,l)),n=null),r.set(a.value.compartment,a.value.extension)):a.is(et.reconfigure)?(n=null,i=a.value):a.is(et.appendConfig)&&(n=null,i=Ld(i).concat(a.value));let s;n?s=e.startState.values.slice():(n=gb.resolve(i,r,this),s=new At(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(R2)?e.newSelection:e.newSelection.asSingle();new At(n,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:fe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=Ld(i.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return At.create({doc:e.doc,selection:fe.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=gb.resolve(e.extensions||[],new Map),i=e.doc instanceof wt?e.doc:wt.of((e.doc||"").split(n.staticFacet(At.lineSeparator)||C2)),r=e.selection?e.selection instanceof fe?e.selection:fe.single(e.selection.anchor,e.selection.head):fe.single(0);return ij(r,i.length),n.staticFacet(R2)||(r=r.asSingle()),new At(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(At.tabSize)}get lineBreak(){return this.facet(At.lineSeparator)||` -`}get readOnly(){return this.facet(uj)}phrase(e,...n){for(let i of this.facet(At.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(sj))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return j3e(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,a=e-i;for(;o>0;){let l=Ln(n,o,!1);if(s(n.slice(l,o))!=Jt.Word)break;o=l}for(;at.length?t[0]:4});At.lineSeparator=oj;At.readOnly=uj;At.phrases=Me.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});At.languageData=sj;At.changeFilter=aj;At.transactionFilter=lj;At.transactionExtender=cj;zw.reconfigure=et.define();function Ro(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],a=i[s];if(a===void 0)i[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Tl{eq(e){return this==e}range(e,n=e){return Mg.create(e,n,this)}}Tl.prototype.startSide=Tl.prototype.endSide=0;Tl.prototype.point=!1;Tl.prototype.mapMode=Mi.TrackDel;function lI(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}class Mg{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new Mg(e,n,i)}}function M2(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class cI{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let l=o+a>>1,u=s[l]-e||(i?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return u>=0?o:a;u>=0?a=l:o=l+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||g==m&&u.startSide>0&&u.endSide<=0)continue;(m-g||u.endSide-u.startSide)<0||(o<0&&(o=g),u.point&&(a=Math.max(a,m-g)),i.push(u),r.push(g-o),s.push(m-o))}return{mapped:i.length?new cI(r,s,i,a):null,pos:o}}}class ut{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new ut(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(M2)),this.isEmpty)return n.length?ut.of(n):this;let a=new fj(this,null,-1).goto(0),l=0,u=[],d=new fa;for(;a.value||l=0){let f=n[l++];d.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return Dg.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Dg.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=v3(o,a,i),u=new np(o,l,s),d=new np(a,l,s);i.iterGaps((f,g,m)=>b3(u,f,d,g,m,r)),i.empty&&i.length==0&&b3(u,0,d,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=v3(s,o),l=new np(s,a,0).goto(i),u=new np(o,a,0).goto(i);for(;;){if(l.to!=u.to||!D2(l.active,u.active)||l.point&&(!u.point||!lI(l.point,u.point)))return!1;if(l.to>r)return!0;l.next(),u.next()}}static spans(e,n,i,r,s=-1){let o=new np(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroma&&(r.span(a,u,o.active,l),l=o.openEnd(u));if(o.to>i)return l+(o.point&&o.to>i?1:0);a=o.to,o.next()}}static of(e,n=!1){let i=new fa;for(let r of e instanceof Mg?[e]:n?K3e(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return ut.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=ut.empty;r=r.nextLayer)n=new ut(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}ut.empty=new ut([],[],null,-1);function K3e(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(M2);e=i}return t}ut.empty.nextLayer=ut.empty;class fa{finishChunk(e){this.chunks.push(new cI(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new fa)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(ut.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ut.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function v3(t,e,n){let i=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new fj(o,n,i,s));return r.length==1?r[0]:new Dg(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)t1(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)t1(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),t1(this.heap,0)}}}function t1(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}class np{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Dg.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){ay(this.active,e),ay(this.activeTo,e),ay(this.activeRank,e),this.minActive=w3(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;ly(this.active,n,i),ly(this.activeTo,n,r),ly(this.activeRank,n,s),e&&ly(e,n,this.cursor.from),this.minActive=w3(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&ay(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function b3(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,a=i,l=i-e,u=!!s.boundChange;for(let d=!1;;){let f=t.to+l-n.to,g=f||t.endSide-n.endSide,m=g<0?t.to+l:n.to,v=Math.min(m,o);if(t.point||n.point?(t.point&&n.point&&lI(t.point,n.point)&&D2(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,v,t.point,n.point),d=!1):(d&&s.boundChange(a),v>a&&!D2(t.active,n.active)&&s.compareRange(a,v,t.active,n.active),u&&vo)break;a=m,g<=0&&t.next(),g>=0&&n.next()}}function D2(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;i--)t[i+1]=t[i];t[e]=n}function w3(t,e){let n=-1,i=1e9;for(let r=0;r=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=Ln(t,r)}return i===!0?-1:t.length}const N2="ͼ",S3=typeof Symbol>"u"?"__"+N2:Symbol.for(N2),O2=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),C3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Rl{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),g=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let m in a){let v=a[m];if(/&/.test(m))s(m.split(/,\s*/).map(S=>o.map(C=>S.replace(/&/,C))).reduce((S,C)=>S.concat(C)),v,l);else if(v&&typeof v=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),v,d,g)}else v!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+v+";")}(d.length||g)&&l.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=C3[S3]||1;return C3[S3]=e+1,N2+e.toString(36)}static mount(e,n,i){let r=e[O2],s=i&&i.nonce;r?s&&r.setNonce(s):r=new Y3e(e,s),r.mount(Array.isArray(n)?n:[n],e)}}let x3=new Map;class Y3e{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=x3.get(i);if(s)return e[O2]=s;this.sheet=new r.CSSStyleSheet,x3.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[O2]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},q3e=typeof navigator<"u"&&/Mac/.test(navigator.platform),J3e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ii=0;ii<10;ii++)kl[48+ii]=kl[96+ii]=String(ii);for(var ii=1;ii<=24;ii++)kl[ii+111]="F"+ii;for(var ii=65;ii<=90;ii++)kl[ii]=String.fromCharCode(ii+32),Pg[ii]=String.fromCharCode(ii);for(var n1 in kl)Pg.hasOwnProperty(n1)||(Pg[n1]=kl[n1]);function X3e(t){var e=q3e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||J3e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Pg:kl)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ot(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e2);var ke={mac:_3||/Mac/.test(ki.platform),windows:/Win/.test(ki.platform),linux:/Linux|X11/.test(ki.platform),ie:Qw,ie_version:gj?B2.documentMode||6:U2?+U2[1]:L2?+L2[1]:0,gecko:E3,gecko_version:E3?+(/Firefox\/(\d+)/.exec(ki.userAgent)||[0,0])[1]:0,chrome:!!i1,chrome_version:i1?+i1[1]:0,ios:_3,android:/Android\b/.test(ki.userAgent),webkit_version:Z3e?+(/\bAppleWebKit\/(\d+)/.exec(ki.userAgent)||[0,0])[1]:0,safari:V2,safari_version:V2?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ki.userAgent)||[0,0])[1]:0,tabSize:B2.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function uI(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Ab=Object.create(null);function dI(t,e,n){if(t==e)return!0;t||(t=Ab),e||(e=Ab);let i=Object.keys(t),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function eVe(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function T3(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function tVe(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Fc(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=mj(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new Fc(e,i,r,n,e.widget||null,!0)}static line(e){return new Sm(e)}static set(e,n=!1){return ut.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$e.none=ut.empty;class wm extends $e{constructor(e){let{start:n,end:i}=mj(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?uI(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ab}eq(e){return this==e||e instanceof wm&&this.tagName==e.tagName&&dI(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}wm.prototype.point=!1;class Sm extends $e{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Sm&&this.spec.class==e.spec.class&&dI(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Sm.prototype.mapMode=Mi.TrackBefore;Sm.prototype.point=!0;class Fc extends $e{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Mi.TrackBefore:Mi.TrackAfter:Mi.TrackDel}get type(){return this.startSide!=this.endSide?ri.WidgetRange:this.startSide<=0?ri.WidgetBefore:ri.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Fc&&nVe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Fc.prototype.point=!0;function mj(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function nVe(t,e){return t==e||!!(t&&e&&t.compare(e))}function Ud(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class Ng extends Tl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Ng&&this.tagName==e.tagName&&dI(this.attributes,e.attributes)}static create(e){return new Ng(e.tagName,e.attributes||Ab)}static set(e,n=!1){return ut.of(e,n)}}Ng.prototype.startSide=Ng.prototype.endSide=-1;function Og(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function F2(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function rv(t,e){if(!e.anchorNode)return!1;try{return F2(t,e.anchorNode)}catch{return!1}}function sv(t){return t.nodeType==3?Bg(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Yp(t,e,n,i){return n?R3(t,e,n,i,-1)||R3(t,e,n,i,1):!1}function Il(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function yb(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function R3(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:pa(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Il(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?pa(t):0}else return!1}}function pa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vb(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function iVe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Aj(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function rVe(t,e,n,i,r,s,o,a){let l=t.ownerDocument,u=l.defaultView||window;for(let d=t,f=!1;d&&!f;)if(d.nodeType==1){let g,m=d==l.body,v=1,S=1;if(m)g=iVe(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let k=d.getBoundingClientRect();({scaleX:v,scaleY:S}=Aj(d,k)),g={left:k.left,right:k.left+d.clientWidth*v,top:k.top,bottom:k.top+d.clientHeight*S}}let C=0,E=0;if(r=="nearest")e.top0&&e.bottom>g.bottom+E&&(E=e.bottom-g.bottom+o)):e.bottom>g.bottom&&(E=e.bottom-g.bottom+o,n<0&&e.top-E0&&e.right>g.right+C&&(C=e.right-g.right+s)):e.right>g.right&&(C=e.right-g.right+s,n<0&&e.leftg.bottom||e.leftg.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function sVe(t){let e=t.ownerDocument,n,i;for(let r=t.parentNode;r&&!(r==e.body||n&&i);)if(r.nodeType==1)!i&&r.scrollHeight>r.clientHeight&&(i=r),!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:n,y:i}}class oVe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?pa(n):0),i,Math.min(e.focusOffset,i?pa(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let yc=null;ke.safari&&ke.safari_version>=26&&(yc=!1);function yj(t){if(t.setActive)return t.setActive();if(yc)return t.focus(yc);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(yc==null?{get preventScroll(){return yc={preventScroll:!0},!0}}:void 0),!yc){yc=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function bj(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=pa(n)}else if(n.parentNode&&!yb(n))i=Il(n),n=n.parentNode;else return null}}function wj(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i=n){if(a.level==i)return o;(s<0||(r!=0?r<0?a.fromn:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function xj(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;S-=3)if(Xs[S+1]==-m){let C=Xs[S+2],E=C&2?r:C&4?C&1?s:r:0;E&&(Bt[f]=Bt[Xs[S]]=E),a=S;break}}else{if(Xs.length==189)break;Xs[a++]=f,Xs[a++]=g,Xs[a++]=l}else if((v=Bt[f])==2||v==1){let S=v==r;l=S?0:1;for(let C=a-3;C>=0;C-=3){let E=Xs[C+2];if(E&2)break;if(S)Xs[C+2]|=2;else{if(E&4)break;Xs[C+2]|=4}}}}}function pVe(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,a=rl;)v==C&&(v=n[--S].from,C=S?n[S-1].to:t),Bt[--v]=m;l=d}else s=u,l++}}}function z2(t,e,n,i,r,s,o){let a=i%2?2:1;if(i%2==r%2)for(let l=e,u=0;ll&&o.push(new oa(l,S.from,m));let C=S.direction==Hc!=!(m%2);Q2(t,C?i+1:i,r,S.inner,S.from,S.to,o),l=S.to}v=S.to}else{if(v==n||(d?Bt[v]!=a:Bt[v]==a))break;v++}g?z2(t,l,v,i+1,r,g,o):le;){let d=!0,f=!1;if(!u||l>s[u-1].to){let S=Bt[l-1];S!=a&&(d=!1,f=S==16)}let g=!d&&a==1?[]:null,m=d?i:i+1,v=l;e:for(;;)if(u&&v==s[u-1].to){if(f)break e;let S=s[--u];if(!d)for(let C=S.from,E=u;;){if(C==e)break e;if(E&&s[E-1].to==C)C=s[--E].from;else{if(Bt[C-1]==a)break e;break}}if(g)g.push(S);else{S.toBt.length;)Bt[Bt.length]=256;let i=[],r=e==Hc?0:1;return Q2(t,r,r,n,0,t.length,i),i}function Ej(t){return[new oa(0,t,0)]}let _j="";function mVe(t,e,n,i,r){var s;let o=i.head-t.from,a=oa.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),l=e[a],u=l.side(r,n);if(o==u){let g=a+=r?1:-1;if(g<0||g>=e.length)return null;l=e[a=g],o=l.side(!r,n),u=l.side(r,n)}let d=Ln(t.text,o,l.forward(r,n));(dl.to)&&(d=u),_j=t.text.slice(Math.min(o,d),Math.max(o,d));let f=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)t.some(e=>e)}),Nj=Me.define({combine:t=>t.some(e=>e)}),Oj=Me.define();class Fd{constructor(e,n="nearest",i="nearest",r=5,s=5,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Fd(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Fd(fe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const cy=et.define({map:(t,e)=>t.map(e)}),Bj=et.define();function Ji(t,e,n){let i=t.facet(Ij);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const sa=Me.define({combine:t=>t.length?t[0]:!0});let yVe=0;const Cd=Me.define({combine(t){return t.filter((e,n)=>{for(let i=0;i{let l=[];return o&&l.push(Gw.of(u=>{let d=u.plugin(a);return d?o(d):$e.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return En.define((i,r)=>new e(i,r),n)}}class r1{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Ji(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Ji(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Ji(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Lj=Me.define(),gI=Me.define(),Gw=Me.define(),Uj=Me.define(),mI=Me.define(),Cm=Me.define(),Vj=Me.define();function I3(t,e){let n=t.state.facet(Vj);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return ut.spans(i,e.from,e.to,{point(){},span(s,o,a,l){let u=s-e.from,d=o-e.from,f=r;for(let g=a.length-1;g>=0;g--,l--){let m=a[g].spec.bidiIsolate,v;if(m==null&&(m=AVe(e.text,u,d)),l>0&&f.length&&(v=f[f.length-1]).to==u&&v.direction==m)v.to=d,f=v.inner;else{let S={from:u,to:d,direction:m,inner:[]};f.push(S),f=S.inner}}}}),r}const Fj=Me.define();function AI(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(Fj)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}const _p=Me.define();class Kr{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new Kr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Kr(s,o,a,l))),this.changedRanges=r}static create(e,n,i){return new bb(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const vVe=[];class Cn{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return vVe}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&eVe(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let i=Il(this.dom),r=this.length?e>0:n>0;return new bs(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Ww)return e;return null}static get(e){return e.cmTile}}class $w extends Cn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=a.dom&&(s.written=!0),a.dom.parentNode==n)for(;r&&r!=a.dom;)r=M3(r);else n.insertBefore(a.dom,r);i=a.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=M3(r);this.length=o}}function M3(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Ww extends $w{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Cn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof vl)n.push(r),i=o,r=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((a,l)=>{let u=l+a.length;if(e>=l&&e<=u){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(i=void 0)}(le||e==l&&(n>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class vl extends $w{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new vl(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class nh extends $w{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new nh(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,a=-1;function l(d,f){for(let g=0,m=0;g=f&&(v.isComposite()?l(v,f-m):(!o||o.isHidden&&(n>0||i&&wVe(o,v)))&&(S>f||v.flags&32)?(o=v,a=f-m):(mi&&(e=i);let r=e,s=e,o=0;e==0&&n<0||e==i&&n>=0?ke.chrome||ke.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return ke.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,u=>u.width)||l),o?vb(l,o<0):l||null}static of(e,n){let i=new Ic(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class zc extends Cn{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return vb(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!a.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=a.pop(),s++}else{let l=r.children[s],u=l.breakAfter;(n>0?l.length<=e:l.length=0;a--){let l=n.marks[a],u=r.lastChild;if(u instanceof qi&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(s1(l.dom)),r=u;else{if(this.cache.reused.get(l)){let f=Cn.get(l.dom);f&&f.setDOM(s1(l.dom))}let d=qi.of(l.mark,l.dom);r.append(d),r=d}this.cache.reused.set(l,2)}let s=Cn.get(e.text);s&&this.cache.reused.set(s,2);let o=new Ic(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=Hj);let r=nh.start(e,n||((i=this.cache.find(nh))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(n>0&&(a=r.lastChild)&&a instanceof qi&&a.mark.eq(o))r=a,n--;else{let l=qi.of(o,(i=this.cache.find(qi,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(l),r=l,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!D3(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(ke.ios&&D3(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(o1,0,32)||new zc(o1.toDOM(),0,o1,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let n=new CVe(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(wb,void 0,1);return i&&(i.flags=n),i||new wb(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class EVe{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let a=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,a)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const Sb=[zc,nh,Ic,qi,wb,vl,Ww];for(let t=0;t[]),this.index=Sb.map(()=>0),this.reused=new Map}add(e){e.demo&&console.log("Add widget to cache");let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let a=s.length-1;a>=0;a--){let l=(a+o)%s.length,u=s[l];if((!n||n(u))&&!this.reused.has(u))return s.splice(l,1),l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let a=or){let u=l-r;this.preserve(u,!o,!a),r=l,s+=u}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=IVe(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let u=l>0||a{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof qi&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof qi&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=0,o=ut.spans(this.decorations,e,n,{point:(a,l,u,d,f,g)=>{if(u instanceof Fc){if(this.disallowBlockEffectsFor[g]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(l-a);else{let m=u.widget||(u.block?ih.block:ih.inline),v=RVe(u),S=this.cache.findWidget(m,l-a,v)||zc.of(m,this.view,l-a,v);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(S)):(r.ensureLine(i),r.addInlineWidget(S,d,f))}i=null}else i=kVe(i,u);l>a&&this.text.skip(l-a)},span:(a,l,u,d)=>{for(let f=a;fs,this.openMarks=o}forward(e,n){n-e<=10?this.old.advance(n-e,1,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,1,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=Cn.get(r);if(r==this.view.contentDOM)break;s instanceof qi?n.push(s):s?.isLine()?i=s:r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new nh(r,Hj):n.push(qi.of(new wm({tagName:r.nodeName.toLowerCase(),attributes:tVe(r)}),r))}return{line:i,marks:n}}}function D3(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function RVe(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const Hj={class:"cm-line"};function kVe(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&uI(n,t),i&&(t.class+=" "+i)),t}function IVe(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof qi&&e.push(i.mark)}return e}function s1(t){let e=Cn.get(t);return e&&e.setDOM(t.cloneNode()),t}class ih extends wa{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ih.inline=new ih("span");ih.block=new ih("div");const o1=new class extends wa{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class P3{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$e.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Ww(e,e.contentDOM),this.updateInner([new Kr(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!VVe(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?DVe(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Kr(d,f,e.changes.mapPos(d,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ke.ie||ke.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=OVe(o,this.decorations,e.changes);l.length&&(i=Kr.extendWithRanges(i,l));let u=LVe(a,this.blockWrappers,e.changes);return u.length&&(i=Kr.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,a=new TVe(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,n),$2(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=ke.chrome||ke.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&rv(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,d;if(l.empty?d=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(d=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),ke.gecko&&l.empty&&!this.hasComposition&&MVe(u)){let g=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(g,u.node.childNodes[u.offset]||null)),u=d=new bs(g,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!Yp(u.node,u.offset,f.anchorNode,f.anchorOffset)||!Yp(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{ke.android&&ke.chrome&&i.contains(f.focusNode)&&UVe(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=Og(this.view.root);if(g)if(l.empty){if(ke.gecko){let m=PVe(u.node,u.offset);if(m&&m!=3){let v=(m==1?bj:wj)(u.node,u.offset);v&&(u=new bs(v.node,v.offset))}}g.collapse(u.node,u.offset),l.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=l.bidiLevel)}else if(g.extend){g.collapse(u.node,u.offset);try{g.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();l.anchor>l.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),g.removeAllRanges(),g.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new bs(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new bs(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Yp(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Og(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!l||!u||l.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=pa(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==i.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Cn.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,a=r;;o++){let l=i.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(e,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=e&&(i=u,r=e-d,s=f=e&&!o&&(o=u,a=e-d,l=d>e),d>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:l&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(a,n))}coordsAt(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.widget instanceof a1?null:i.coordsInWidget(r,n,!0):i.coordsIn(r,n)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=r(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Lt.LTR,u=0,d=(f,g,m)=>{for(let v=0;vr);v++){let S=f.children[v],C=g+S.length,E=S.dom.getBoundingClientRect(),{height:k}=E;if(m&&!v&&(u+=E.top-m.top),S instanceof vl)C>i&&d(S,g,E);else if(g>=i&&(u>0&&n.push(-u),n.push(k+u),u=0,o)){let R=S.dom.lastChild,M=R?sv(R):[];if(M.length){let D=M[M.length-1],P=l?D.right-E.left:E.right-D.left;P>a&&(a=P,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=C)}}m&&v==f.children.length-1&&(u+=m.bottom-E.bottom),g=C+S.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Lt.RTL:Lt.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=sv(u.dom);if(d.length!=1)return;a+=d[0].width,l=d[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=sv(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push($e.replace({widget:new a1(a),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return $e.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Gw).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(mI).map((s,o)=>{let a=typeof s=="function";return a&&(i=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(ut.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(Oj))try{if(u(this.view,e.range,e))return!0}catch(d){Ji(this.view.state,d,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=AI(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;rVe(this.view.scrollDOM,o,n.headi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){$2(this.tile)}}function $2(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)$2(i,e)}}function MVe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function zj(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=bj(n.focusNode,n.focusOffset),r=wj(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let a=Cn.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let l=Cn.get(i.node);!l||l.isText()&&l.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function DVe(t,e,n){let i=zj(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,a=r.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(i.from,i.to)!=a)return null;let l=e.invertedDesc;return{range:new Kr(l.mapPos(s),l.mapPos(o),s,o),text:r}}function PVe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(n=!0)}),n}class a1 extends wa{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function FVe(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return fe.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,a=s;n<0?o=Ln(r.text,s,!1):a=Ln(r.text,s);let l=i(r.text.slice(o,a));for(;o>0;){let u=Ln(r.text,o,!1);if(i(r.text.slice(u,o))!=l)break;o=u}for(;at.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((r-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+P2(o,s,t.state.tabSize)}function W2(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==ri.Text&&(r.type!=s.type||(n<0?s.frome)))&&(r=s)}}return r||i}return i}function zVe(t,e,n,i){let r=W2(t,e.head,e.assoc||-1),s=!i||r.type!=ri.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(r.from),l=t.posAtCoords({x:n==(a==Lt.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return fe.cursor(l,n?-1:1)}return fe.cursor(n?r.to:r.from,n?-1:1)}function N3(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let a=e,l=null;;){let u=mVe(r,s,o,a,n),d=_j;if(!u){if(r.number==(n?t.state.doc.lines:1))return a;d=` -`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),u=t.visualLineSide(r,!n)}if(l){if(!l(d))return a}else{if(!i)return u;l=i(d)}a=u}}function QVe(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==Jt.Space&&(r=o),r==o}}function GVe(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return fe.cursor(r,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,e.assoc||-1),d=t.documentTop;if(u)o==null&&(o=u.left-l.left),a=s<0?u.top:u.bottom;else{let m=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-m.from))),a=(s<0?m.top:m.bottom)+d}let f=l.left+o,g=i??t.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let v=a+(g+m)*s,S=j2(t,{x:f,y:v},!1,s);return fe.cursor(S.pos,S.assoc,void 0,o)}}function qp(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,a)=>{if(e>s&&er(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:fe.cursor(i,it.viewState.docHeight)return new ao(t.state.doc.length,-1);if(u=t.elementAtHeight(l),i==null)break;if(u.type==ri.Text){let g=t.docView.coordsAt(i<0?u.from:u.to,i);if(g&&(i<0?g.top<=l+s:g.bottom>=l+s))break}let f=t.viewState.heightOracle.textHeight/2;l=i>0?u.bottom+f:u.top-f}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(n)return null;if(u.type==ri.Text){let f=HVe(t,r,u,o,a);return new ao(f,f==u.from?1:-1)}}if(u.type!=ri.Text)return l<(u.top+u.bottom)/2?new ao(u.from,1):new ao(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),Gj(t,d,u.from,o,a)}function Gj(t,e,n,i,r){let s=-1,o=null,a=1e9,l=1e9,u=r,d=r,f=(g,m)=>{for(let v=0;vi?S.left-i:S.rightr?S.top-r:S.bottom=u&&(u=Math.min(S.top,u),d=Math.max(S.bottom,d),E=0),(s<0||(E-l||C-a)<0)&&(s>=0&&l&&a=u+2?l=0:(s=m,a=C,l=E,o=S))}};if(e.isText()){for(let m=0;m(o.left+o.right)/2==(O3(t,s+n)==Lt.LTR)?new ao(n+Ln(e.text,s),-1):new ao(n+s,1)}else{if(!e.length)return new ao(n,1);for(let S=0;S(o.left+o.right)/2==(O3(t,s+n)==Lt.LTR)?new ao(m+g.length,-1):new ao(m,1)}}function O3(t,e){let n=t.state.doc.lineAt(e);return t.bidiSpans(n)[oa.find(t.bidiSpans(n),e-n.from,-1,1)].dir}const Tp="￿";class $Ve{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(At.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Tp}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=Cn.get(r),a=r.nextSibling;if(a==n){o?.breakAfter&&!a&&i!=this.view.contentDOM&&this.lineBreak();break}let l=Cn.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:yb(r))||yb(a)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!jVe(a,n)&&this.lineBreak(),r=a}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(a=r.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);i=s+o}}readNode(e){let n=Cn.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(WVe(e,i.node,i.offset)?n:0))}}function WVe(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=$j(e.docView.tile,n,i,0))){let a=s||o?[]:qVe(e),l=new $Ve(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=JVe(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!F2(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!F2(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),d=e.viewport;if((ke.ios||ke.chrome)&&e.state.selection.main.empty&&l!=u&&(d.from>0||d.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(fe.range(u,l)):this.newSel=fe.single(u,l)}}}function $j(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,a=-1;for(let l=0,u=i,d=i;ln)return $j(f,e,n,u);if(g>=e&&r==-1&&(r=l,s=u),u>n&&f.dom.parentNode==t.dom){o=l,a=d;break}d=g,u=g+f.breakAfter}return{from:s,to:a<0?i+t.length:a,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function Wj(t,e){let n,{newSel:i}=e,r=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=r.from,u=null;(s===8||ke.android&&e.text.length=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,r.to))}:t.state.doc.lineAt(r.from).toDate.now()-50?n={from:r.from,to:r.to,insert:t.state.toText(t.inputState.insertingText)}:ke.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==` - `&&t.lineWrapping&&(i&&(i=fe.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:wt.of([" "])}),n)return yI(t,n,i,s);if(i&&!i.main.eq(r)){let o=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=Qj(t.state.facet(Cm).map(l=>l(t)),i))),t.dispatch({selection:i,scrollIntoView:o,userEvent:a}),!0}else return!1}function yI(t,e,n,i=-1){if(ke.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(ke.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Vd(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.lengthr.head)&&Vd(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Vd(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=YVe(t,e,n));return t.state.facet(Mj).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function YVe(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromf(t)),u,l);e.from==d&&(o=d)}if(o>-1)i={changes:e,selection:fe.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=s.frome.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let l=r.changes(e),u=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=t.state.sliceDoc(e.from,e.to),f,g=n&&zj(t,n.main.head);if(g){let v=e.insert.length-(e.to-e.from);f={from:g.from,to:g.to-v}}else f=t.state.doc.lineAt(s.head);let m=s.to-e.to;i=r.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:l,range:u||v.map(l)};let S=v.to-m,C=S-d.length;if(t.state.sliceDoc(C,S)!=d||S>=f.from&&C<=f.to)return{range:v};let E=r.changes({from:C,to:S,insert:e.insert}),k=v.to-s.to;return{changes:E,range:u?fe.range(Math.max(0,u.anchor+k),Math.max(0,u.head+k)):v.map(E)}})}else i={changes:l,selection:u&&r.selection.replaceRange(u)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:a,scrollIntoView:!0})}function jj(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(i=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function qVe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new B3(n,i)),(r!=n||s!=i)&&e.push(new B3(r,s))),e}function JVe(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?fe.single(n+e,i+e):null}class XVe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ke.safari&&e.contentDOM.addEventListener("input",()=>null),ke.gecko&&f6e(e.contentDOM.ownerDocument)}handleEvent(e){!o6e(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=ZVe(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=i[s];a&&o!=!a.handlers.length&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Yj.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ke.android&&ke.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ke.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Kj.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||e6e.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:ke.safari&&!ke.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function L3(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){Ji(n.state,r)}}}function ZVe(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(L3(i.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(L3(i.value,l))}}for(let i in Is)n(i).handlers.push(Is[i]);for(let i in ns)n(i).observers.push(ns[i]);return e}const Kj=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],e6e="dthko",Yj=[16,17,18,20,91,92,224,225],uy=6;function dy(t){return Math.max(0,t)*.7+8}function t6e(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class n6e{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=sVe(e.contentDOM),this.atoms=e.state.facet(Cm).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(At.allowMultipleSelections)&&i6e(e,n),this.dragging=s6e(e,n)&&Xj(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&t6e(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=AI(this.view);e.clientX-l.left<=r+uy?n=-dy(r-e.clientX):e.clientX+l.right>=o-uy&&(n=dy(e.clientX-o)),e.clientY-l.top<=s+uy?i=-dy(s-e.clientY):e.clientY+l.bottom>=a-uy&&(i=dy(e.clientY-a)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=Qj(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function i6e(t,e){let n=t.state.facet(Tj);return n.length?n[0](e):ke.mac?e.metaKey:e.ctrlKey}function r6e(t,e){let n=t.state.facet(Rj);return n.length?n[0](e):ke.mac?!e.altKey:!e.ctrlKey}function s6e(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Og(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function o6e(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Cn.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const Is=Object.create(null),ns=Object.create(null),qj=ke.ie&&ke.ie_version<15||ke.ios&&ke.webkit_version<604;function a6e(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Jj(t,n.value)},50)}function jw(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function Jj(t,e){e=jw(t.state,fI,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(K2!=null&&n.selection.ranges.every(l=>l.empty)&&K2==s.toString()){let l=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==l)return{range:u};l=d.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:f},range:fe.cursor(u.from+f.length)}})}else o?i=n.changeByRange(l=>{let u=s.line(r++);return{changes:{from:l.from,to:l.to,insert:u.text},range:fe.cursor(l.from+u.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ns.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Is.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ns.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ns.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Is.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(kj))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=c6e(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new n6e(t,e,n,i)),i&&t.observer.ignore(()=>{yj(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function U3(t,e,n,i){if(i==1)return fe.cursor(e,n);if(i==2)return FVe(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return aDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(F3+1)%3:1}function c6e(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Xj(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,a){let l=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=U3(t,l.pos,l.assoc,i);if(n.pos!=l.pos&&!o){let f=U3(t,n.pos,n.assoc,i),g=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=g1&&(u=u6e(r,l.pos))?u:a?r.addRange(d):fe.create([d])}}}function u6e(t,e){for(let n=0;n=e)return fe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Is.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=fe.range(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",jw(t.state,pI,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Is.dragend=t=>(t.inputState.draggedContent=null,!1);function z3(t,e,n,i){if(n=jw(t.state,fI,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&r6e(t,e)?{from:s.from,to:s.to}:null,a={from:r,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Is.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&z3(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(i[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return z3(t,e,i,!0),!0}return!1};Is.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=qj?null:e.clipboardData;return n?(Jj(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(a6e(t),!1)};function d6e(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function h6e(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:jw(t,pI,e.join(t.lineBreak)),ranges:n,linewise:i}}let K2=null;Is.copy=Is.cut=(t,e)=>{let{text:n,ranges:i,linewise:r}=h6e(t.state);if(!n&&!r)return!1;K2=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=qj?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(d6e(t,n),!1)};const Zj=ba.define();function eK(t,e){let n=[];for(let i of t.facet(Dj)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:Zj.of(!0)}):null}function tK(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=eK(t.state,e);n?t.dispatch(n):t.update([])}},10)}ns.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),tK(t)};ns.blur=t=>{t.observer.clearSelectionRange(),tK(t)};ns.compositionstart=ns.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ns.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ke.chrome&&ke.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ns.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Is.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),u=t.posAtDOM(a.endContainer,a.endOffset);return yI(t,{from:l,to:u,insert:t.state.toText(s)},null),!0}}let r;if(ke.chrome&&ke.android&&(r=Kj.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ke.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ke.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ns.compositionend(t,e),20),!1};const Q3=new Set;function f6e(t){Q3.has(t)||(Q3.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const G3=["pre-wrap","normal","pre-line","break-spaces"];let rh=!1;function $3(){rh=!1}class p6e{constructor(e){this.lineWrapping=e,this.doc=wt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return G3.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ov&&(rh=!0),this.height=e)}replace(e,n,i){return Ni.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:d,toB:f}=r[a],g=s.lineAt(l,Ft.ByPosNoHeight,i.setDoc(n),0,0),m=g.to>=u?g:s.lineAt(u,Ft.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;a>0&&g.from<=r[a-1].toA;)l=r[a-1].fromA,d=r[a-1].fromB,a--,ls*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),i+=1+a.break,r-=a.size}else if(s>r*2){let a=e[i];a.break?e.splice(i,1,a.left,null,a.right):e.splice(i,1,a.left,a.right),i+=2+a.break,s-=a.size}else break;else if(r=s&&o(this.lineAt(0,Ft.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class br extends nK{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new As(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof br||r instanceof ni&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ni?r=new br(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Ni.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ni extends Ni{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:a}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(e0){let s=i[i.length-1];s instanceof ni?i[i.length-1]=new ni(s.length+r):i.push(null,new ni(r-1))}if(e>0){let s=i[0];s instanceof ni?i[0]=new ni(e+s.length):i.unshift(new ni(e-1),null)}return Ni.of(i)}decomposeLeft(e,n){n.push(new ni(e-1),null)}decomposeRight(e,n){n.push(null,new ni(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],a=Math.max(n,r.from),l=-1;for(r.from>n&&o.push(new ni(r.from-n-1).updateHeight(e,n));a<=s&&r.more;){let d=e.doc.lineAt(a).length;o.length&&o.push(null);let f=r.heights[r.index++],g=0;f<0&&(g=-f,f=r.heights[r.index++]),l==-1?l=f:Math.abs(f-l)>=ov&&(l=-2);let m=new br(d,f,g);m.outdated=!1,o.push(m),a+=d+1}a<=s&&o.push(null,new ni(s-a).updateHeight(e,a));let u=Ni.of(o);return(l<0||Math.abs(u.height-this.height)>=ov||Math.abs(l-this.heightMetrics(e,n).perLine)>=ov)&&(rh=!0),Cb(this,u)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class A6e extends Ni{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return ea))return u;let d=n==Ft.ByPosNoHeight?Ft.ByPosNoHeight:Ft.ByPos;return l?u.join(this.right.lineAt(a,d,i,o,a)):this.left.lineAt(a,d,i,r,s).join(u)}forEachLine(e,n,i,r,s,o){let a=r+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,i,a,l,o);else{let u=this.lineAt(l,Ft.ByPos,i,r,s);e=e&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,a,l,o)}}replace(e,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of i)s.push(a);if(e>0&&W3(s,o-1),n=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e2*n.size||n.size>2*e.size?Ni.of(this.break?[e,null,n]:[e,n]):(this.left=Cb(this.left,e),this.right=Cb(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,r){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return r&&r.from<=n+s.length&&r.more?l=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=a+o.length&&r.more?l=o=o.updateHeight(e,a,i,r):o.updateHeight(e,a,i),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function W3(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof ni&&(i=t[e+1])instanceof ni&&t.splice(e-1,3,new ni(n.length+1+i.length))}const y6e=5;class vI{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof br?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new br(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e=y6e)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new br(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new ni(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof br)return e;let n=new br(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof br)&&!this.isCovered?this.nodes.push(new br(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let g=d.getBoundingClientRect();s=Math.max(s,g.left),o=Math.min(o,g.right),a=Math.max(a,g.top),l=Math.min(u==t.parentNode?r.innerHeight:l,g.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function S6e(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function C6e(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class c1{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new p6e(n),this.stateDeco=Y3(e),this.heightMap=Ni.empty().applyChanges(this.stateDeco,wt.empty,this.heightOracle.setDoc(e.doc),[new Kr(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$e.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new hy(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?K3:new bI(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Rp(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Y3(this.state);let r=e.changedRanges,s=Kr.extendWithRanges(r,v6e(i,this.stateDeco,e?e.changes:Bn.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);$3(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||rh)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Nj)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Lt.RTL:Lt.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,d=0;if(a.width&&a.height){let{scaleX:M,scaleY:D}=Aj(n,a);(M>.005&&Math.abs(this.scaleX-M)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=M,this.scaleY=D,u|=16,o=l=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=g)&&(this.paddingTop=f,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=vj(e.scrollDOM);let v=(this.printing?C6e:w6e)(n,this.paddingTop),S=v.top-this.pixelViewport.top,C=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(l=!0)),!this.inView&&!this.scrollTarget&&!S6e(e.dom))return 0;let k=a.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let M=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(M)&&(o=!0),o||r.lineWrapping&&Math.abs(k-this.contentDOMWidth)>r.charWidth){let{lineHeight:D,charWidth:P,textHeight:N}=e.docView.measureTextSize();o=D>0&&r.refresh(s,D,P,N,Math.max(5,k/P),M),o&&(e.docView.minWidth=0,u|=16)}S>0&&C>0?d=Math.max(S,C):S<0&&C<0&&(d=Math.min(S,C)),$3();for(let D of this.viewports){let P=D.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(D);this.heightMap=(o?Ni.empty().applyChanges(this.stateDeco,wt.empty,this.heightOracle,[new Kr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new g6e(D.from,P))}rh&&(u|=2)}let R=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return R&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new hy(r.lineAt(o-i*1e3,Ft.ByHeight,s,0,0).from,r.lineAt(a+(1-i)*1e3,Ft.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(ul.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,Ft.ByPos,s,0,0),g;n.y=="center"?g=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=a+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=Lt.LTR&&!i)return[];let a=[],l=(d,f,g,m)=>{if(f-dd&&EE.from>=g.from&&E.to<=g.to&&Math.abs(E.from-d)E.fromk));if(!C){if(fR.from<=f&&R.to>=f)){let R=n.moveToLineBoundary(fe.cursor(f),!1,!0).head;R>d&&(f=R)}let E=this.gapSize(g,d,f,m),k=i||E<2e6?E:2e6;C=new c1(d,f,E,k)}a.push(C)},u=d=>{if(d.length2e6)for(let P of e)P.from>=d.from&&P.fromd.from&&l(d.from,m,d,f),vn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];ut.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Rp(this.heightMap.lineAt(e,Ft.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Rp(this.heightMap.lineAt(this.scaler.fromDOM(e),Ft.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Rp(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hy{constructor(e,n){this.from=e,this.to=n}}function E6e(t,e,n){let i=[],r=t,s=0;return ut.spans(n,t,e,{span(){},point(o,a){o>r&&(i.push({from:r,to:o}),s+=o-r),r=a}},20),r=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(i<=a)return s+i;i-=a}}function py(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function _6e(t,e){for(let n of t)if(e(n))return n}const K3={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Y3(t){let e=t.facet(Gw).filter(i=>typeof i!="function"),n=t.facet(mI).filter(i=>typeof i!="function");return n.length&&e.push(ut.join(n)),e}class bI{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:a,to:l})=>{let u=n.lineAt(a,Ft.ByPos,e,0,0).top,d=n.lineAt(l,Ft.ByPos,e,0,0).bottom;return r+=d-u,{from:a,to:l,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=nn.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function Rp(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new As(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Rp(r,e)):t._content)}const gy=Me.define({combine:t=>t.join(" ")}),Y2=Me.define({combine:t=>t.indexOf(!0)>-1}),q2=Rl.newName(),iK=Rl.newName(),rK=Rl.newName(),sK={"&light":"."+iK,"&dark":"."+rK};function J2(t,e,n){return new Rl(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}const T6e=J2("."+q2,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},sK),R6e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},u1=ke.ie&&ke.ie_version<=11;class k6e{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new oVe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(ke.ie&&ke.ie_version<=11||ke.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ke.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ke.chrome&&ke.chrome_version<126)&&(this.editContext=new M6e(e),e.state.facet(sa)&&(e.contentDOM.editContext=this.editContext.editContext)),u1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(sa)?i.root.activeElement!=this.dom:!rv(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ke.ie&&ke.ie_version<=11||ke.android&&ke.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Yp(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Og(e.root);if(!n)return!1;let i=ke.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&I6e(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=rv(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Vd(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&rv(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new KVe(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=Wj(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=q3(n,e.previousSibling||e.target.previousSibling,-1),r=q3(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sa)!=e.state.facet(sa)&&(e.view.contentDOM.editContext=e.state.facet(sa)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function q3(t,e,n){for(;e;){let i=Cn.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function J3(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Yp(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function I6e(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return J3(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?J3(t,n):null}class M6e{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,a=this.toEditorPos(i.updateRangeStart),l=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>i.text.length;a==this.from&&sthis.to&&(l=s);let d=jj(e.state.sliceDoc(a,l),i.text,(u?r.from:r.to)-a,u?"end":null);if(!d){let g=fe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));g.main.eq(r)||e.dispatch({selection:g,userEvent:"select"});return}let f={from:d.from+a,to:d.toA+a,insert:wt.of(i.text.slice(d.from,d.toB).split(` -`))};if((ke.mac||ke.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:wt.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let g=this.to-this.from+(f.to-f.from+f.insert.length);yI(e,f,fe.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Og(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ie{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||aVe(e.parent)||document,this.viewState=new j3(e.state||At.create(e)),e.scrollTo&&e.scrollTo.is(cy)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Cd).map(r=>new r1(r));for(let r of this.plugins)r.update(this);this.observer=new k6e(this),this.inputState=new XVe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new P3(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Un?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(g=>g.annotation(Zj))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=eK(s,o),l||(a=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(At.phrases)!=this.state.facet(At.phrases))return this.setState(s);r=bb.create(this,s,e),r.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(f&&(f=f.map(g.changes)),g.scrollIntoView){let{main:m}=g.state.selection;f=new Fd(m.empty?m:fe.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of g.effects)m.is(cy)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=xb.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(_p)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(gy)!=r.state.facet(gy)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(G2))try{g(r)}catch(m){Ji(this.state,m,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!Wj(this,d)&&u.force&&Vd(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new j3(e),this.plugins=e.facet(Cd).map(i=>new r1(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new P3(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Cd),i=e.state.facet(Cd);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new r1(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(vj(i))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(v){return Ji(this.state,v),X3}}),f=bb.create(this,this.state,[]),g=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),g=this.docView.update(f),g&&this.docViewUpdate());for(let m=0;m1||v<-1){r=r+v,i.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(G2))a(n)}get themeClasses(){return q2+" "+(this.state.facet(Y2)?rK:iK)+" "+this.state.facet(gy)}updateAttrs(){let e=Z3(this,Lj,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sa)?"true":"false",class:"cm-content",style:`${ke.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Z3(this,gI,n);let i=this.observer.ignore(()=>{let r=T3(this.contentDOM,this.contentAttrs,n),s=T3(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(Ie.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(_p);let e=this.state.facet(Ie.cspNonce);Rl.mount(this.root,this.styleModules.concat(T6e).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;ni.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return l1(this,e,N3(this,e,n,i))}moveByGroup(e,n){return l1(this,e,N3(this,e,n,i=>QVe(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return fe.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return zVe(this,e,n,i)}moveVertically(e,n,i){return l1(this,e,GVe(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=j2(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),j2(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.docView.coordsAt(e,n);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[oa.find(s,e-r.from,-1,n)];return vb(i,o.dir==Lt.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Pj)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>D6e)return Ej(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||xj(s.isolates,i=I3(this,e))))return s.order;i||(i=I3(this,e));let r=gVe(e.text,n,i);return this.bidiCache.push(new xb(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ke.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{yj(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return cy.of(new Fd(typeof e=="number"?fe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return cy.of(new Fd(fe.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return En.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return En.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Rl.newName(),r=[gy.of(i),_p.of(J2(`.${i}`,e))];return n&&n.dark&&r.push(Y2.of(!0)),r}static baseTheme(e){return Jc.lowest(_p.of(J2("."+q2,e,sK)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&Cn.get(i)||Cn.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}}Ie.styleModule=_p;Ie.inputHandler=Mj;Ie.clipboardInputFilter=fI;Ie.clipboardOutputFilter=pI;Ie.scrollHandler=Oj;Ie.focusChangeEffect=Dj;Ie.perLineTextDirection=Pj;Ie.exceptionSink=Ij;Ie.updateListener=G2;Ie.editable=sa;Ie.mouseSelectionStyle=kj;Ie.dragMovesSelection=Rj;Ie.clickAddsSelectionRange=Tj;Ie.decorations=Gw;Ie.blockWrappers=Uj;Ie.outerDecorations=mI;Ie.atomicRanges=Cm;Ie.bidiIsolatedRanges=Vj;Ie.scrollMargins=Fj;Ie.darkTheme=Y2;Ie.cspNonce=Me.define({combine:t=>t.length?t[0]:""});Ie.contentAttributes=gI;Ie.editorAttributes=Lj;Ie.lineWrapping=Ie.contentAttributes.of({class:"cm-lineWrapping"});Ie.announce=et.define();const D6e=4096,X3={};class xb{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Lt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&uI(o,n)}return n}const P6e=ke.mac?"mac":ke.windows?"win":ke.linux?"linux":"key";function N6e(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,a;for(let l=0;li.concat(r),[]))),n}function B6e(t,e,n){return aK(oK(t.state),e,t,n)}let hl=null;const L6e=4e3;function U6e(t,e=P6e){let n=Object.create(null),i=Object.create(null),r=(o,a)=>{let l=i[o];if(l==null)i[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,u,d)=>{var f,g;let m=n[o]||(n[o]=Object.create(null)),v=a.split(/ (?!$)/).map(E=>N6e(E,e));for(let E=1;E{let M=hl={view:R,prefix:k,scope:o};return setTimeout(()=>{hl==M&&(hl=null)},L6e),!0}]})}let S=v.join(" ");r(S,!1);let C=m[S]||(m[S]={preventDefault:!1,stopPropagation:!1,run:((g=(f=m._any)===null||f===void 0?void 0:f.run)===null||g===void 0?void 0:g.slice())||[]});l&&C.run.push(l),u&&(C.preventDefault=!0),d&&(C.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of a){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let g in d)d[g].run.push(m=>f(m,X2))}let l=o[e]||o.key;if(l)for(let u of a)s(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let X2=null;function aK(t,e,n,i){X2=e;let r=X3e(e),s=Ki(r,0),o=oo(s)==r.length&&r!=" ",a="",l=!1,u=!1,d=!1;hl&&hl.view==n&&hl.scope==i&&(a=hl.prefix+" ",Yj.indexOf(e.keyCode)<0&&(u=!0,hl=null));let f=new Set,g=C=>{if(C){for(let E of C.run)if(!f.has(E)&&(f.add(E),E(n)))return C.stopPropagation&&(d=!0),!0;C.preventDefault&&(C.stopPropagation&&(d=!0),u=!0)}return!1},m=t[i],v,S;return m&&(g(m[a+my(r,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ke.windows&&e.ctrlKey&&e.altKey)&&!(ke.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=kl[e.keyCode])&&v!=r?(g(m[a+my(v,e,!0)])||e.shiftKey&&(S=Pg[e.keyCode])!=r&&S!=v&&g(m[a+my(S,e,!1)]))&&(l=!0):o&&e.shiftKey&&g(m[a+my(r,e,!0)])&&(l=!0),!l&&g(m._any)&&(l=!0)),u&&(l=!0),l&&d&&e.stopPropagation(),X2=null,l}class xm{constructor(e,n,i,r,s){this.className=e,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=lK(e);return[new xm(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return V6e(e,n,i)}}function lK(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Lt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function tV(t,e,n,i){let r=t.coordsAtPos(e,n*2);if(!r)return i;let s=t.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?i:{from:Math.max(i.from,Math.min(a,l)),to:Math.min(i.to,Math.max(a,l))}}function V6e(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),r=Math.min(n.to,t.viewport.to),s=t.textDirection==Lt.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=lK(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=a.right-(d?parseInt(d.paddingRight):0),m=W2(t,i,1),v=W2(t,r,-1),S=m.type==ri.Text?m:null,C=v.type==ri.Text?v:null;if(S&&(t.lineWrapping||m.widgetLineBreaks)&&(S=tV(t,i,1,S)),C&&(t.lineWrapping||v.widgetLineBreaks)&&(C=tV(t,r,-1,C)),S&&C&&S.from==C.from&&S.to==C.to)return k(R(n.from,n.to,S));{let D=S?R(n.from,null,S):M(m,!1),P=C?R(null,n.to,C):M(v,!0),N=[];return(S||m).to<(C||v).from-(S&&C?1:0)||m.widgetLineBreaks>1&&D.bottom+t.defaultLineHeight/2K&&J.from=Q)break;L>Z&&$(Math.max(oe,Z),D==null&&oe<=K,Math.min(L,Q),P==null&&L>=X,j.dir)}if(Z=q.to+1,Z>=Q)break}return V.length==0&&$(K,D==null,X,P==null,t.textDirection),{top:B,bottom:G,horizontal:V}}function M(D,P){let N=a.top+(P?D.top:D.bottom);return{top:N,bottom:N,horizontal:[]}}}function F6e(t,e){return t.constructor==e.constructor&&t.eq(e)}class H6e{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(av)!=e.state.facet(av)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,i=e.facet(av);for(;n!F6e(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of e)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=e,ke.safari&&ke.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const av=Me.define();function cK(t){return[En.define(e=>new H6e(e,t)),av.of(t)]}const Lg=Me.define({combine(t){return Ro(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function z6e(t={}){return[Lg.of(t),Q6e,G6e,$6e,Nj.of(!0)]}function uK(t){return t.startState.facet(Lg)!=t.state.facet(Lg)}const Q6e=cK({above:!0,markers(t){let{state:e}=t,n=e.facet(Lg),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||n.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:fe.cursor(r.head,r.head>r.anchor?-1:1);for(let l of xm.forRange(t,o,a))i.push(l)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=uK(t);return n&&nV(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){nV(e.state,t)},class:"cm-cursorLayer"});function nV(t,e){e.style.animationDuration=t.facet(Lg).cursorBlinkRate+"ms"}const G6e=cK({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:xm.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||uK(t)},class:"cm-selectionLayer"}),$6e=Jc.highest(Ie.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),dK=et.define({map(t,e){return t==null?null:e.mapPos(t)}}),kp=si.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,i)=>i.is(dK)?i.value:n,t)}}),W6e=En.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(kp);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(kp)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(kp),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let i=t.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-i.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(kp)!=t&&this.view.dispatch({effects:dK.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function j6e(){return[kp,W6e]}function iV(t,e,n,i,r){e.lastIndex=0;for(let s=t.iterRange(n,i),o=n,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)r(o+a.index,a)}function K6e(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(t.state.doc.lineAt(r).from,r-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class Y6e{constructor(e){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(a,l,u,d)=>r(d,u,u+a[0].length,a,l);else if(typeof i=="function")this.addMatch=(a,l,u,d)=>{let f=i(a,l,u);f&&d(u,u+a[0].length,f)};else if(i)this.addMatch=(a,l,u,d)=>d(u,u+a[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new fa,i=n.add.bind(n);for(let{from:r,to:s}of K6e(e,this.maxLength))iV(e.state.doc,this.regexp,r,s,(o,a)=>this.addMatch(a,e,o,i));return n.finish()}updateDeco(e,n){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(i=Math.min(a,i),r=Math.max(l,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,n.map(e.changes),i,r):n}updateRange(e,n,i,r){for(let s of e.visibleRanges){let o=Math.max(s.from,i),a=Math.min(s.to,r);if(a>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){d=o;break}for(;ag.push(E.range(S,C));if(l==u)for(this.regexp.lastIndex=d-l.from;(m=this.regexp.exec(l.text))&&m.indexthis.addMatch(C,e,S,v));n=n.update({filterFrom:d,filterTo:f,filter:(S,C)=>Sf,add:g})}}return n}}const Z2=/x/.unicode!=null?"gu":"g",q6e=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Z2),J6e={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let d1=null;function X6e(){var t;if(d1==null&&typeof document<"u"&&document.body){let e=document.body.style;d1=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return d1||!1}const lv=Me.define({combine(t){let e=Ro(t,{render:null,specialChars:q6e,addSpecialChars:null});return(e.replaceTabs=!X6e())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Z2)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Z2)),e}});function Z6e(t={}){return[lv.of(t),eFe()]}let rV=null;function eFe(){return rV||(rV=En.fromClass(class{constructor(t){this.view=t,this.decorations=$e.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(lv)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Y6e({regexp:t.specialChars,decoration:(e,n,i)=>{let{doc:r}=n.state,s=Ki(e[0],0);if(s==9){let o=r.lineAt(i),a=n.state.tabSize,l=kh(o.text,a,i-o.from);return $e.replace({widget:new rFe((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=$e.replace({widget:new iFe(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(lv);t.startState.facet(lv)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const tFe="•";function nFe(t){return t>=32?tFe:t==10?"␤":String.fromCharCode(9216+t)}class iFe extends wa{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=nFe(this.code),i=e.state.phrase("Control character")+" "+(J6e[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class rFe extends wa{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function sFe(){return aFe}const oFe=$e.line({class:"cm-activeLine"}),aFe=En.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let i of t.state.selection.ranges){let r=t.lineBlockAt(i.head);r.from>e&&(n.push(oFe.range(r.from)),e=r.from)}return $e.set(n)}},{decorations:t=>t.decorations}),eT=2e3;function lFe(t,e,n){let i=Math.min(e.line,n.line),r=Math.max(e.line,n.line),s=[];if(e.off>eT||n.off>eT||e.col<0||n.col<0){let o=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=i;l<=r;l++){let u=t.doc.line(l);u.length<=a&&s.push(fe.range(u.from+o,u.to+a))}}else{let o=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=i;l<=r;l++){let u=t.doc.line(l),d=P2(u.text,o,t.tabSize,!0);if(d<0)s.push(fe.cursor(u.to));else{let f=P2(u.text,a,t.tabSize);s.push(fe.range(u.from+d,u.from+f))}}}return s}function cFe(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function sV(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),i=t.state.doc.lineAt(n),r=n-i.from,s=r>eT?-1:r==i.length?cFe(t,e.clientX):kh(i.text,t.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function uFe(t,e){let n=sV(t,e),i=t.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let a=sV(t,r);if(!a)return i;let l=lFe(t.state,n,a);return l.length?o?fe.create(l.concat(i.ranges)):fe.create(l):i}}:null}function dFe(t){let e=(n=>n.altKey&&n.button==0);return Ie.mouseSelectionStyle.of((n,i)=>e(i)?uFe(n,i):null)}const hFe={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},fFe={style:"cursor: crosshair"};function pFe(t={}){let[e,n]=hFe[t.key||"Alt"],i=En.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||n(r))},keyup(r){(r.keyCode==e||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Ie.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?fFe:null})]}const Ay="-10000px";class hK{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(l=>l);if(r===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=n?[]:null;for(let l=0;ln[u]=l),n.length=a.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function gFe(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const h1=Me.define({combine:t=>{var e,n,i;return{position:ke.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||gFe}}}),oV=new WeakMap,SI=En.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(h1);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new hK(t,CI,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(h1);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Ay,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(ke.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=AI(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(h1).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let a=0;a=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Ay;continue}let m=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,v=m?7:0,S=g.right-g.left,C=(e=oV.get(u))!==null&&e!==void 0?e:g.bottom-g.top,E=u.offset||AFe,k=this.view.textDirection==Lt.LTR,R=g.width>i.right-i.left?k?i.left:i.right-g.width:k?Math.max(i.left,Math.min(f.left-(m?14:0)+E.x,i.right-S)):Math.min(Math.max(i.left,f.left-S+(m?14:0)-E.x),i.right-S),M=this.above[a];!l.strictSide&&(M?f.top-C-v-E.yi.bottom)&&M==i.bottom-f.bottom>f.top-i.top&&(M=this.above[a]=!M);let D=(M?f.top-i.top:i.bottom-f.bottom)-v;if(DR&&B.topP&&(P=M?B.top-C-2-v:B.bottom+v+2);if(this.position=="absolute"?(d.style.top=(P-t.parent.top)/s+"px",aV(d,(R-t.parent.left)/r)):(d.style.top=P/s+"px",aV(d,R/r)),m){let B=f.left+(k?E.x:-E.x)-(R+14-7);m.style.left=B/r+"px"}u.overlap!==!0&&o.push({left:R,top:P,right:N,bottom:P+C}),d.classList.toggle("cm-tooltip-above",M),d.classList.toggle("cm-tooltip-below",!M),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Ay}},{eventObservers:{scroll(){this.maybeMeasure()}}});function aV(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const mFe=Ie.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),AFe={x:0,y:0},CI=Me.define({enables:[SI,mFe]}),Eb=Me.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Kw{static create(e){return new Kw(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new hK(e,Eb,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const yFe=CI.compute([Eb],t=>{let e=t.facet(Eb);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Kw.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class vFe{constructor(e,n,i,r,s){this.view=e,this.source=n,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||n.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(d=>d.from<=r&&d.to>=r),u=l&&l.dir==Lt.RTL?-1:1;s=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Ji(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(SI),n=e?e.manager.tooltips.findIndex(i=>i.create==Kw.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!bFe(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,a=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!wFe(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const yy=4;function bFe(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();r=Math.min(a.top,r),s=Math.max(a.bottom,s)}return e.clientX>=n-yy&&e.clientX<=i+yy&&e.clientY>=r-yy&&e.clientY<=s+yy}function wFe(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,a)=e&&l<=n}function SFe(t,e={}){let n=et.define(),i=si.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of r){let l=s.changes.mapPos(a.pos,-1,Mi.TrackDel);if(l!=null){let u=Object.assign(Object.create(null),a);u.pos=l,u.end!=null&&(u.end=s.changes.mapPos(u.end)),o.push(u)}}r=o}for(let o of s.effects)o.is(n)&&(r=o.value),o.is(CFe)&&(r=[]);return r},provide:r=>Eb.from(r)});return{active:i,extension:[i,En.define(r=>new vFe(r,t,i,n,e.hoverTime||300)),yFe]}}function fK(t,e){let n=t.plugin(SI);if(!n)return null;let i=n.manager.tooltips.indexOf(e);return i<0?null:n.manager.tooltipViews[i]}const CFe=et.define(),lV=Me.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Ug(t,e){let n=t.plugin(pK),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const pK=En.fromClass(class{constructor(t){this.input=t.state.facet(Vg),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(lV);this.top=new vy(t,!0,e.topContainer),this.bottom=new vy(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(lV);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new vy(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new vy(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Vg);if(n!=this.input){let i=n.filter(l=>l),r=[],s=[],o=[],a=[];for(let l of i){let u=this.specs.indexOf(l),d;u<0?(d=l(t.view),a.push(d)):(d=this.panels[u],d.update&&d.update(t)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ie.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class vy{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=cV(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=cV(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function cV(t){let e=t.nextSibling;return t.remove(),e}const Vg=Me.define({enables:pK});class ga extends Tl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ga.prototype.elementClass="";ga.prototype.toDOM=void 0;ga.prototype.mapMode=Mi.TrackBefore;ga.prototype.startSide=ga.prototype.endSide=-1;ga.prototype.point=!0;const cv=Me.define(),xFe=Me.define(),EFe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ut.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Jp=Me.define();function _Fe(t){return[gK(),Jp.of({...EFe,...t})]}const uV=Me.define({combine:t=>t.some(e=>e)});function gK(t){return[TFe]}const TFe=En.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Jp).map(e=>new hV(t,e)),this.fixed=!t.state.facet(uV);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(uV)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ut.iter(this.view.state.facet(cv),this.view.viewport.from),i=[],r=this.gutters.map(s=>new RFe(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==ri.Text&&o){tT(n,i,a.from);for(let l of r)l.line(this.view,a,i);o=!1}else if(a.widget)for(let l of r)l.widget(this.view,a)}else if(s.type==ri.Text){tT(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Jp),n=t.state.facet(Jp),i=t.docChanged||t.heightChanged||t.viewportChanged||!ut.eq(t.startState.facet(cv),t.state.facet(cv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new hV(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ie.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Lt.LTR?{left:i,right:r}:{right:i,left:r}})});function dV(t){return Array.isArray(t)?t:[t]}function tT(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class RFe{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ut.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let a=new mK(e,o,s,i);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];tT(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(xFe)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class hV{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,a,r)&&r.preventDefault()});this.markers=dV(n.markers(e)),n.initialSpacer&&(this.spacer=new mK(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=dV(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!ut.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class mK{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),kFe(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,u)||o(a,l,u):o}return i}})}});class f1 extends ga{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function p1(t,e){return t.state.facet(xd).formatNumber(e,t.state)}const DFe=Jp.compute([xd],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(IFe)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new f1(p1(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(MFe)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(xd)!=e.state.facet(xd),initialSpacer(e){return new f1(p1(e,fV(e.state.doc.lines)))},updateSpacer(e,n){let i=p1(n.view,fV(n.view.state.doc.lines));return i==e.number?e:new f1(i)},domEventHandlers:t.facet(xd).domEventHandlers,side:"before"}));function PFe(t={}){return[xd.of(t),gK(),DFe]}function fV(t){let e=9;for(;e{let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.head).from;r>n&&(n=r,e.push(NFe.range(r)))}return ut.of(e)});function BFe(){return OFe}var g1;const Ed=new at;function LFe(t){return Me.define({combine:t?e=>e.concat(t):void 0})}const UFe=new at;class ws{constructor(e,n,i=[],r=""){this.data=e,this.name=r,At.prototype.hasOwnProperty("tree")||Object.defineProperty(At.prototype,"tree",{get(){return yi(this)}}),this.parser=n,this.extension=[Ml.of(this),At.languageData.of((s,o,a)=>{let l=pV(s,o,a),u=l.type.prop(Ed);if(!u)return[];let d=s.facet(u),f=l.type.prop(UFe);if(f){let g=l.resolve(o-l.from,a);for(let m of f)if(m.test(g,s)){let v=s.facet(m.facet);return m.type=="replace"?v:v.concat(d)}}return d})].concat(i)}isActiveAt(e,n,i=-1){return pV(e,n,i).type.prop(Ed)==this.data}findRegions(e){let n=e.facet(Ml);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Ed)==this.data){i.push({from:o,to:o+s.length});return}let a=s.prop(at.mounted);if(a){if(a.tree.prop(Ed)==this.data){if(a.overlay)for(let l of a.overlay)i.push({from:l.from+o,to:l.to+o});else i.push({from:o,to:o+s.length});return}else if(a.overlay){let l=i.length;if(r(a.tree,a.overlay[0].from+o),i.length>l)return}}for(let l=0;li.isTop?n:void 0)]}),e.name)}configure(e,n){return new _b(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yi(t){let e=t.field(ws.state,!1);return e?e.tree:fn.empty}class VFe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let ip=null;class Tb{constructor(e,n,i=[],r,s,o,a,l){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new Tb(e,n,[],fn.empty,0,i,[],null)}startParse(){return this.parser.startParse(new VFe(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=fn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Nc.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=ip;ip=this;try{return e()}finally{ip=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=gV(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,d,f,g)=>l.push({fromA:u,toA:d,fromB:f,toB:g})),i=Nc.applyChanges(i,l),r=fn.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let d=e.mapPos(u.from,1),f=e.mapPos(u.to,-1);de.from&&(this.fragments=gV(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends WW{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let l=ip;if(l){for(let u of r)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new fn(er.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return ip}}function gV(t,e,n){return Nc.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class sh{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new sh(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=Tb.create(e.facet(Ml).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new sh(i)}}ws.state=si.define({create:sh.init,update(t,e){for(let n of e.effects)if(n.is(ws.setState))return n.value;return e.startState.facet(Ml)!=e.state.facet(Ml)?sh.init(e.state):t.apply(e)}});let AK=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(AK=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const m1=typeof navigator<"u"&&(!((g1=navigator.scheduling)===null||g1===void 0)&&g1.isInputPending)?()=>navigator.scheduling.isInputPending():null,FFe=En.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(ws.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(ws.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=AK(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,l=s.context.work(()=>m1&&m1()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ws.setState.of(new sh(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ji(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ml=Me.define({combine(t){return t.length?t[0]:null},enables:t=>[ws.state,FFe,Ie.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class HFe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const zFe=Me.define(),xI=Me.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Rb(t){let e=t.facet(xI);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Fg(t,e){let n="",i=t.tabSize,r=t.facet(xI)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s=e?QFe(t,n,e):null}class Yw{constructor(e,n={}){this.state=e,this.options=n,this.unit=Rb(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return kh(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const yK=new at;function QFe(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return vK(i,t,n)}function vK(t,e,n){for(let i=t;i;i=i.next){let r=$Fe(i.node);if(r)return r(_I.create(e,n,i))}return 0}function GFe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function $Fe(t){let e=t.type.prop(yK);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(at.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>YFe(o,!0,1,void 0,s&&!GFe(o)?r.from:void 0)}return t.parent==null?WFe:null}function WFe(){return 0}class _I extends Yw{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new _I(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(jFe(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return vK(this.context.next,this.base,this.pos)}}function jFe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function KFe(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==i)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}a=l.to}}function YFe(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=i&&s.slice(o,o+i.length)==i||r==t.pos+o,l=KFe(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function mV({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const qFe=200;function JFe(){return At.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:i}=t.newSelection.main,r=n.lineAt(i);if(i>r.from+qFe)return t;let s=n.sliceString(r.from,i);if(!e.some(u=>u.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==a)continue;a=d.from;let f=EI(o,d.from);if(f==null)continue;let g=/^\s*/.exec(d.text)[0],m=Fg(o,f);g!=m&&l.push({from:d.from,to:d.from+g.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const XFe=Me.define(),bK=new at;function ZFe(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(s&&a.from=e&&u.to>n&&(s=u)}}return s}function t8e(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function kb(t,e,n){for(let i of t.facet(XFe)){let r=i(t,e,n);if(r)return r}return e8e(t,e,n)}function wK(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const qw=et.define({map:wK}),Em=et.define({map:wK});function SK(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const Qc=si.define({create(){return $e.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=AV(t,n,i)),t=t.map(e.changes);for(let n of e.effects)if(n.is(qw)&&!n8e(t,n.value.from,n.value.to)){let{preparePlaceholder:i}=e.state.facet(EK),r=i?$e.replace({widget:new c8e(i(e.state,n.value))}):yV;t=t.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Em)&&(t=t.update({filter:(i,r)=>n.value.from!=i||n.value.to!=r,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=AV(t,e.selection.main.head)),t},provide:t=>Ie.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{re&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(r,s)=>r>=n||s<=e}):t}function Ib(t,e,n){var i;let r=null;return(i=t.field(Qc,!1))===null||i===void 0||i.between(e,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function n8e(t,e,n){let i=!1;return t.between(e,e,(r,s)=>{r==e&&s==n&&(i=!0)}),i}function CK(t,e){return t.field(Qc,!1)?e:e.concat(et.appendConfig.of(_K()))}const i8e=t=>{for(let e of SK(t)){let n=kb(t.state,e.from,e.to);if(n)return t.dispatch({effects:CK(t.state,[qw.of(n),xK(t,n)])}),!0}return!1},r8e=t=>{if(!t.state.field(Qc,!1))return!1;let e=[];for(let n of SK(t)){let i=Ib(t.state,n.from,n.to);i&&e.push(Em.of(i),xK(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function xK(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return Ie.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}const s8e=t=>{let{state:e}=t,n=[];for(let i=0;i{let e=t.state.field(Qc,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(i,r)=>{n.push(Em.of({from:i,to:r}))}),t.dispatch({effects:n}),!0},a8e=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:i8e},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:r8e},{key:"Ctrl-Alt-[",run:s8e},{key:"Ctrl-Alt-]",run:o8e}],l8e={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},EK=Me.define({combine(t){return Ro(t,l8e)}});function _K(t){return[Qc,h8e]}function TK(t,e){let{state:n}=t,i=n.facet(EK),r=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=Ib(t.state,a.from,a.to);l&&t.dispatch({effects:Em.of(l)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const yV=$e.replace({widget:new class extends wa{toDOM(t){return TK(t,null)}}});class c8e extends wa{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return TK(e,this.value)}}const u8e={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class A1 extends ga{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function d8e(t={}){let e={...u8e,...t},n=new A1(e,!0),i=new A1(e,!1),r=En.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ml)!=o.state.facet(Ml)||o.startState.field(Qc,!1)!=o.state.field(Qc,!1)||yi(o.startState)!=yi(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new fa;for(let l of o.viewportLineBlocks){let u=Ib(o.state,l.from,l.to)?i:kb(o.state,l.from,l.to)?n:null;u&&a.add(l.from,l.from,u)}return a.finish()}}),{domEventHandlers:s}=e;return[r,_Fe({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(r))===null||a===void 0?void 0:a.markers)||ut.empty},initialSpacer(){return new A1(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let u=Ib(o.state,a.from,a.to);if(u)return o.dispatch({effects:Em.of(u)}),!0;let d=kb(o.state,a.from,a.to);return d?(o.dispatch({effects:qw.of(d)}),!0):!1}}}),_K()]}const h8e=Ie.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Jw{constructor(e,n){this.specs=e;let i;function r(a){let l=Rl.newName();return(i||(i=Object.create(null)))["."+l]=a,l}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof ws?a=>a.prop(Ed)==o.data:o?a=>a==o:void 0,this.style=YW(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=i?new Rl(i):null,this.themeType=n.themeType}static define(e,n){return new Jw(e,n||{})}}const nT=Me.define(),RK=Me.define({combine(t){return t.length?[t[0]]:null}});function y1(t){let e=t.facet(nT);return e.length?e:t.facet(RK)}function f8e(t,e){let n=[g8e],i;return t instanceof Jw&&(t.module&&n.push(Ie.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(RK.of(t)):i?n.push(nT.computeN([Ie.darkTheme],r=>r.facet(Ie.darkTheme)==(i=="dark")?[t]:[])):n.push(nT.of(t)),n}class p8e{constructor(e){this.markCache=Object.create(null),this.tree=yi(e.state),this.decorations=this.buildDeco(e,y1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=yi(e.state),i=y1(e.state),r=i!=y1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return $e.none;let i=new fa;for(let{from:r,to:s}of e.visibleRanges)E3e(this.tree,n,(o,a,l)=>{i.add(o,a,this.markCache[l]||(this.markCache[l]=$e.mark({class:l})))},r,s);return i.finish()}}const g8e=Jc.high(En.fromClass(p8e,{decorations:t=>t.decorations})),m8e=Jw.define([{tag:Se.meta,color:"#404740"},{tag:Se.link,textDecoration:"underline"},{tag:Se.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Se.emphasis,fontStyle:"italic"},{tag:Se.strong,fontWeight:"bold"},{tag:Se.strikethrough,textDecoration:"line-through"},{tag:Se.keyword,color:"#708"},{tag:[Se.atom,Se.bool,Se.url,Se.contentSeparator,Se.labelName],color:"#219"},{tag:[Se.literal,Se.inserted],color:"#164"},{tag:[Se.string,Se.deleted],color:"#a11"},{tag:[Se.regexp,Se.escape,Se.special(Se.string)],color:"#e40"},{tag:Se.definition(Se.variableName),color:"#00f"},{tag:Se.local(Se.variableName),color:"#30a"},{tag:[Se.typeName,Se.namespace],color:"#085"},{tag:Se.className,color:"#167"},{tag:[Se.special(Se.variableName),Se.macroName],color:"#256"},{tag:Se.definition(Se.propertyName),color:"#00c"},{tag:Se.comment,color:"#940"},{tag:Se.invalid,color:"#f00"}]),A8e=Ie.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),kK=1e4,IK="()[]{}",MK=Me.define({combine(t){return Ro(t,{afterCursor:!0,brackets:IK,maxScanDistance:kK,renderMatch:b8e})}}),y8e=$e.mark({class:"cm-matchingBracket"}),v8e=$e.mark({class:"cm-nonmatchingBracket"});function b8e(t){let e=[],n=t.matched?y8e:v8e;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const w8e=si.define({create(){return $e.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],i=e.state.facet(MK);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=ho(e.state,r.head,-1,i)||r.head>0&&ho(e.state,r.head-1,1,i)||i.afterCursor&&(ho(e.state,r.head,1,i)||r.headIe.decorations.from(t)}),S8e=[w8e,A8e];function C8e(t={}){return[MK.of(t),S8e]}const x8e=new at;function iT(t,e,n){let i=t.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function rT(t){let e=t.type.prop(x8e);return e?e(t.node):t}function ho(t,e,n,i={}){let r=i.maxScanDistance||kK,s=i.brackets||IK,o=yi(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let u=iT(l.type,n,s);if(u&&l.from0?e>=d.from&&ed.from&&e<=d.to))return E8e(t,e,n,l,d,u,s)}}return _8e(t,e,n,o,a.type,r,s)}function E8e(t,e,n,i,r,s,o){let a=i.parent,l={from:r.from,to:r.to},u=0,d=a?.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let g=0;!d.next().done&&g<=s;){let m=d.value;n<0&&(g+=m.length);let v=e+g*n;for(let S=n>0?0:m.length-1,C=n>0?m.length:-1;S!=C;S+=n){let E=o.indexOf(m[S]);if(!(E<0||i.resolveInner(v+S,1).type!=r))if(E%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:v+S,to:v+S+1},matched:E>>1==l>>1};f--}}n>0&&(g+=m.length)}return d.done?{start:u,matched:!1}:null}const T8e=Object.create(null),vV=[er.none],bV=[],wV=Object.create(null),R8e=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])R8e[t]=k8e(T8e,e);function v1(t,e){bV.indexOf(t)>-1||(bV.push(t),console.warn(e))}function k8e(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let u of a.split(".")){let d=t[u]||Se[u];d?typeof d=="function"?l.length?l=l.map(d):v1(u,`Modifier ${u} used at start of tag`):l.length?v1(u,`Tag ${u} used as modifier`):l=Array.isArray(d)?d:[d]:v1(u,`Unknown highlighting tag ${u}`)}for(let u of l)n.push(u)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(a=>a.id),s=wV[r];if(s)return s.id;let o=wV[r]=er.define({id:vV.length,name:i,props:[jW({[i]:n})]});return vV.push(o),o.id}Lt.RTL,Lt.LTR;const I8e=_b.define({name:"json",parser:k3e.configure({props:[yK.add({Object:mV({except:/^\s*\}/}),Array:mV({except:/^\s*\]/})}),bK.add({"Object Array":ZFe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function M8e(){return new HFe(I8e)}const D8e=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=RI(t.state,n.from);return i.line?P8e(t):i.block?O8e(t):!1};function TI(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const P8e=TI(U8e,0),N8e=TI(DK,0),O8e=TI((t,e)=>DK(t,e,L8e(e)),0);function RI(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const rp=50;function B8e(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-rp,i),o=t.sliceDoc(r,r+rp),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,u=s.length-a;if(s.slice(u-e.length,u)==e&&o.slice(l,l+n.length)==n)return{open:{pos:i-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let d,f;r-i<=2*rp?d=f=t.sliceDoc(i,r):(d=t.sliceDoc(i,i+rp),f=t.sliceDoc(r-rp,r));let g=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,v=f.length-m-n.length;return d.slice(g,g+e.length)==e&&f.slice(v,v+n.length)==n?{open:{pos:i+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(v-1))?1:0}}:null}function L8e(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function DK(t,e,n=e.selection.ranges){let i=n.map(s=>RI(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>B8e(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,a;or&&(s==o||o>f.from)){r=f.from;let g=/^\s*/.exec(f.text)[0].length,m=g==f.length,v=f.text.slice(g,g+u.length)==u?g:-1;gs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:a.from+u,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of i)if(a>=0){let u=o.from+a,d=u+l.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const sT=ba.define(),V8e=ba.define(),F8e=Me.define(),PK=Me.define({combine(t){return Ro(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),NK=si.define({create(){return fo.empty},update(t,e){let n=e.state.facet(PK),i=e.annotation(sT);if(i){let l=Xi.fromTransaction(e,i.selection),u=i.side,d=u==0?t.undone:t.done;return l?d=Mb(d,d.length,n.minDepth,l):d=LK(d,e.startState.selection),new fo(u==0?i.rest:d,u==0?d:i.rest)}let r=e.annotation(V8e);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Un.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Xi.fromTransaction(e),o=e.annotation(Un.time),a=e.annotation(Un.userEvent);return s?t=t.addChanges(s,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new fo(t.done.map(Xi.fromJSON),t.undone.map(Xi.fromJSON))}});function H8e(t={}){return[NK,PK.of(t),Ie.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?OK:e.inputType=="historyRedo"?oT:null;return i?(e.preventDefault(),i(n)):!1}})]}function Xw(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(NK,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}const OK=Xw(0,!1),oT=Xw(1,!1),z8e=Xw(0,!0),Q8e=Xw(1,!0);class Xi{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new Xi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new Xi(e.changes&&Bn.fromJSON(e.changes),[],e.mapped&&yo.fromJSON(e.mapped),e.startSelection&&fe.fromJSON(e.startSelection),e.selectionsAfter.map(fe.fromJSON))}static fromTransaction(e,n){let i=Yr;for(let r of e.startState.facet(F8e)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new Xi(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Yr)}static selection(e){return new Xi(void 0,Yr,void 0,void 0,e)}}function Mb(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function G8e(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let l=0;l=u&&o<=d&&(i=!0)}}),i}function $8e(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function BK(t,e){return t.length?e.length?t.concat(e):t:e}const Yr=[],W8e=200;function LK(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-W8e));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Mb(t,t.length-1,1e9,n.setSelAfter(i)))}else return[Xi.selection([e])]}function j8e(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function b1(t,e){if(!t.length)return t;let n=t.length,i=Yr;for(;n;){let r=K8e(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[Xi.selection(i)]:Yr}function K8e(t,e,n){let i=BK(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Yr,n);if(!t.changes)return Xi.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Xi(r,et.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}const Y8e=/^(input\.type|delete)($|\.)/;class fo{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new fo(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!i||Y8e.test(i))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):Zw(n,e))}function bi(t){return t.textDirectionAt(t.state.selection.main.head)==Lt.LTR}const VK=t=>UK(t,!bi(t)),FK=t=>UK(t,bi(t));function HK(t,e){return Bs(t,n=>n.empty?t.moveByGroup(n,e):Zw(n,e))}const J8e=t=>HK(t,!bi(t)),X8e=t=>HK(t,bi(t));function Z8e(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function eS(t,e,n){let i=yi(t).resolveInner(e.head),r=n?at.closedBy:at.openedBy;for(let l=e.head;;){let u=n?i.childAfter(l):i.childBefore(l);if(!u)break;Z8e(t,u,r)?i=u:l=n?u.to:u.from}let s=i.type.prop(r),o,a;return s&&(o=n?ho(t,i.from,1):ho(t,i.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?i.to:i.from,fe.cursor(a,n?-1:1)}const e9e=t=>Bs(t,e=>eS(t.state,e,!bi(t))),t9e=t=>Bs(t,e=>eS(t.state,e,bi(t)));function zK(t,e){return Bs(t,n=>{if(!n.empty)return Zw(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const QK=t=>zK(t,!1),GK=t=>zK(t,!0);function $K(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,n.height):Zw(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,u=a.bottom-n.marginBottom;o&&o.top>l&&o.bottomWK(t,!1),aT=t=>WK(t,!0);function Ll(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=fe.cursor(i.from+s))}return r}const n9e=t=>Bs(t,e=>Ll(t,e,!0)),i9e=t=>Bs(t,e=>Ll(t,e,!1)),r9e=t=>Bs(t,e=>Ll(t,e,!bi(t))),s9e=t=>Bs(t,e=>Ll(t,e,bi(t))),o9e=t=>Bs(t,e=>fe.cursor(t.lineBlockAt(e.head).from,1)),a9e=t=>Bs(t,e=>fe.cursor(t.lineBlockAt(e.head).to,-1));function l9e(t,e,n){let i=!1,r=Ih(t.selection,s=>{let o=ho(t,s.head,-1)||ho(t,s.head,1)||s.head>0&&ho(t,s.head-1,1)||s.headl9e(t,e);function rs(t,e){let n=Ih(t.state.selection,i=>{let r=e(i);return fe.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Os(t.state,n)),!0)}function jK(t,e){return rs(t,n=>t.moveByChar(n,e))}const KK=t=>jK(t,!bi(t)),YK=t=>jK(t,bi(t));function qK(t,e){return rs(t,n=>t.moveByGroup(n,e))}const u9e=t=>qK(t,!bi(t)),d9e=t=>qK(t,bi(t)),h9e=t=>rs(t,e=>eS(t.state,e,!bi(t))),f9e=t=>rs(t,e=>eS(t.state,e,bi(t)));function JK(t,e){return rs(t,n=>t.moveVertically(n,e))}const XK=t=>JK(t,!1),ZK=t=>JK(t,!0);function eY(t,e){return rs(t,n=>t.moveVertically(n,e,$K(t).height))}const CV=t=>eY(t,!1),xV=t=>eY(t,!0),p9e=t=>rs(t,e=>Ll(t,e,!0)),g9e=t=>rs(t,e=>Ll(t,e,!1)),m9e=t=>rs(t,e=>Ll(t,e,!bi(t))),A9e=t=>rs(t,e=>Ll(t,e,bi(t))),y9e=t=>rs(t,e=>fe.cursor(t.lineBlockAt(e.head).from)),v9e=t=>rs(t,e=>fe.cursor(t.lineBlockAt(e.head).to)),EV=({state:t,dispatch:e})=>(e(Os(t,{anchor:0})),!0),_V=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.doc.length})),!0),TV=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.selection.main.anchor,head:0})),!0),RV=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),b9e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),w9e=({state:t,dispatch:e})=>{let n=tS(t).map(({from:i,to:r})=>fe.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:fe.create(n),userEvent:"select"})),!0},S9e=({state:t,dispatch:e})=>{let n=Ih(t.selection,i=>{let r=yi(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=i.to||a.to>i.to&&a.from<=i.from)&&o.next)return fe.range(a.to,a.from)}return i});return n.eq(t.selection)?!1:(e(Os(t,n)),!0)};function tY(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let l=t.moveVertically(a,e);if(l.heado.to){r.some(u=>u.head==l.head)||r.push(l);break}else{if(l.head==a.head)break;a=l}}}return r.length==i.ranges.length?!1:(t.dispatch(Os(n,fe.create(r,r.length-1))),!0)}const C9e=t=>tY(t,!1),x9e=t=>tY(t,!0),E9e=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=fe.create([n.main]):n.main.empty||(i=fe.create([fe.cursor(n.main.head)])),i?(e(Os(t,i)),!0):!1};function _m(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(n="delete.forward",l=by(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=by(t,o,!1),a=by(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:fe.cursor(o,or(t)))i.between(e,e,(r,s)=>{re&&(e=n?s:r)});return e}const nY=(t,e,n)=>_m(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),a,l;if(n&&!e&&r>o.from&&rnY(t,!1,!0),iY=t=>nY(t,!0,!1),rY=(t,e)=>_m(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let a=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let l=Ln(s.text,i-s.from,e)+s.from,u=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),d=o(u);if(a!=null&&d!=a)break;(u!=" "||i!=n.head)&&(a=d),i=l}return i}),sY=t=>rY(t,!1),_9e=t=>rY(t,!0),T9e=t=>_m(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head_m(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),k9e=t=>_m(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:wt.of(["",""])},range:fe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},M9e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:Ln(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:Ln(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(r,a).append(t.doc.slice(o,r))},range:fe.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function tS(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function oY(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of tS(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),a=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)r.push(fe.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)r.push(fe.range(l.anchor-a,l.head-a))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:fe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const D9e=({state:t,dispatch:e})=>oY(t,e,!1),P9e=({state:t,dispatch:e})=>oY(t,e,!0);function aY(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of tS(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const N9e=({state:t,dispatch:e})=>aY(t,e,!1),O9e=({state:t,dispatch:e})=>aY(t,e,!0),B9e=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(tS(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),a=t.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function L9e(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=yi(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(at.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const kV=lY(!1),U9e=lY(!0);function lY(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),l=!t&&s==o&&L9e(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let u=new Yw(e,{simulateBreak:s,simulateDoubleBreak:!!l}),d=EI(u,s);for(d==null&&(d=kh(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let r=[];for(let o=i.from;o<=i.to;){let a=t.doc.lineAt(o);a.number>n&&(i.empty||i.to>a.from)&&(e(a,r,i),n=a.number),o=a.to+1}let s=t.changes(r);return{changes:r,range:fe.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const V9e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new Yw(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=kI(t,(s,o,a)=>{let l=EI(i,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let u=/^\s*/.exec(s.text)[0],d=Fg(t,l);(u!=d||a.fromt.readOnly?!1:(e(t.update(kI(t,(n,i)=>{i.push({from:n.from,insert:t.facet(xI)})}),{userEvent:"input.indent"})),!0),H9e=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(kI(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=kh(r,t.tabSize),o=0,a=Fg(t,Math.max(0,s-Rb(t)));for(;o(t.setTabFocusMode(),!0),Q9e=[{key:"Ctrl-b",run:VK,shift:KK,preventDefault:!0},{key:"Ctrl-f",run:FK,shift:YK},{key:"Ctrl-p",run:QK,shift:XK},{key:"Ctrl-n",run:GK,shift:ZK},{key:"Ctrl-a",run:o9e,shift:y9e},{key:"Ctrl-e",run:a9e,shift:v9e},{key:"Ctrl-d",run:iY},{key:"Ctrl-h",run:lT},{key:"Ctrl-k",run:T9e},{key:"Ctrl-Alt-h",run:sY},{key:"Ctrl-o",run:I9e},{key:"Ctrl-t",run:M9e},{key:"Ctrl-v",run:aT}],G9e=[{key:"ArrowLeft",run:VK,shift:KK,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:J8e,shift:u9e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:r9e,shift:m9e,preventDefault:!0},{key:"ArrowRight",run:FK,shift:YK,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:X8e,shift:d9e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:s9e,shift:A9e,preventDefault:!0},{key:"ArrowUp",run:QK,shift:XK,preventDefault:!0},{mac:"Cmd-ArrowUp",run:EV,shift:TV},{mac:"Ctrl-ArrowUp",run:SV,shift:CV},{key:"ArrowDown",run:GK,shift:ZK,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_V,shift:RV},{mac:"Ctrl-ArrowDown",run:aT,shift:xV},{key:"PageUp",run:SV,shift:CV},{key:"PageDown",run:aT,shift:xV},{key:"Home",run:i9e,shift:g9e,preventDefault:!0},{key:"Mod-Home",run:EV,shift:TV},{key:"End",run:n9e,shift:p9e,preventDefault:!0},{key:"Mod-End",run:_V,shift:RV},{key:"Enter",run:kV,shift:kV},{key:"Mod-a",run:b9e},{key:"Backspace",run:lT,shift:lT,preventDefault:!0},{key:"Delete",run:iY,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sY,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:_9e,preventDefault:!0},{mac:"Mod-Backspace",run:R9e,preventDefault:!0},{mac:"Mod-Delete",run:k9e,preventDefault:!0}].concat(Q9e.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),$9e=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e9e,shift:h9e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t9e,shift:f9e},{key:"Alt-ArrowUp",run:D9e},{key:"Shift-Alt-ArrowUp",run:N9e},{key:"Alt-ArrowDown",run:P9e},{key:"Shift-Alt-ArrowDown",run:O9e},{key:"Mod-Alt-ArrowUp",run:C9e},{key:"Mod-Alt-ArrowDown",run:x9e},{key:"Escape",run:E9e},{key:"Mod-Enter",run:U9e},{key:"Alt-l",mac:"Ctrl-l",run:w9e},{key:"Mod-i",run:S9e,preventDefault:!0},{key:"Mod-[",run:H9e},{key:"Mod-]",run:F9e},{key:"Mod-Alt-\\",run:V9e},{key:"Shift-Mod-k",run:B9e},{key:"Shift-Mod-\\",run:c9e},{key:"Mod-/",run:D8e},{key:"Alt-A",run:N8e},{key:"Ctrl-m",mac:"Shift-Alt-m",run:z9e}].concat(G9e),IV=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class oh{constructor(e,n,i=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?a=>s(IV(a)):IV,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ki(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=sI(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=oo(e);let r=this.normalize(n);if(r.length)for(let s=0,o=i;;s++){let a=r.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(l)return this.value=l,this;break}o==i&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=Db(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let a=new Hd(n,e.sliceString(n,i));return w1.set(e,a),a}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=e.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,match:n},this.matchPos=Db(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hd.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(uY.prototype[Symbol.iterator]=dY.prototype[Symbol.iterator]=function(){return this});function W9e(t){try{return new RegExp(t,II),!0}catch{return!1}}function Db(t,e){if(e>=t.length)return e;let n=t.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function cT(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Ot("input",{class:"cm-textfield",name:"line",value:e}),i=Ot("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:Xp.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Ot("label",t.state.phrase("Go to line"),": ",n)," ",Ot("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Ot("button",{name:"close",onclick:()=>{t.dispatch({effects:Xp.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:o}=t,a=o.doc.lineAt(o.selection.main.head),[,l,u,d,f]=s,g=d?+d.slice(1):0,m=u?+u:a.number;if(u&&f){let C=m/100;l&&(C=C*(l=="-"?-1:1)+a.number/o.doc.lines),m=Math.round(o.doc.lines*C)}else u&&l&&(m=m*(l=="-"?-1:1)+a.number);let v=o.doc.line(Math.max(1,Math.min(o.doc.lines,m))),S=fe.cursor(v.from+Math.max(0,Math.min(g,v.length)));t.dispatch({effects:[Xp.of(!1),Ie.scrollIntoView(S.from,{y:"center"})],selection:S}),t.focus()}return{dom:i}}const Xp=et.define(),MV=si.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Xp)&&(t=n.value);return t},provide:t=>Vg.from(t,e=>e?cT:null)}),j9e=t=>{let e=Ug(t,cT);if(!e){let n=[Xp.of(!0)];t.state.field(MV,!1)==null&&n.push(et.appendConfig.of([MV,K9e])),t.dispatch({effects:n}),e=Ug(t,cT)}return e&&e.dom.querySelector("input").select(),!0},K9e=Ie.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Y9e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},q9e=Me.define({combine(t){return Ro(t,Y9e,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function J9e(t){return[nHe,tHe]}const X9e=$e.mark({class:"cm-selectionMatch"}),Z9e=$e.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function DV(t,e,n,i){return(n==0||t(e.sliceDoc(n-1,n))!=Jt.Word)&&(i==e.doc.length||t(e.sliceDoc(i,i+1))!=Jt.Word)}function eHe(t,e,n,i){return t(e.sliceDoc(n,n+1))==Jt.Word&&t(e.sliceDoc(i-1,i))==Jt.Word}const tHe=En.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(q9e),{state:n}=t,i=n.selection;if(i.ranges.length>1)return $e.none;let r=i.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return $e.none;let l=n.wordAt(r.head);if(!l)return $e.none;o=n.charCategorizer(r.head),s=n.sliceDoc(l.from,l.to)}else{let l=r.to-r.from;if(l200)return $e.none;if(e.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(DV(o,n,r.from,r.to)&&eHe(o,n,r.from,r.to)))return $e.none}else if(s=n.sliceDoc(r.from,r.to),!s)return $e.none}let a=[];for(let l of t.visibleRanges){let u=new oh(n.doc,s,l.from,l.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||DV(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?a.push(Z9e.range(d,f)):(d>=r.to||f<=r.from)&&a.push(X9e.range(d,f)),a.length>e.maxMatches))return $e.none}}return $e.set(a)}},{decorations:t=>t.decorations}),nHe=Ie.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),iHe=({state:t,dispatch:e})=>{let{selection:n}=t,i=fe.create(n.ranges.map(r=>t.wordAt(r.head)||fe.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(e(t.update({selection:i})),!0)};function rHe(t,e){let{main:n,ranges:i}=t.selection,r=t.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,a=new oh(t.doc,e,i[i.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new oh(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const sHe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return iHe({state:t,dispatch:e});let i=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=i))return!1;let r=rHe(t,i);return r?(e(t.update({selection:t.selection.addRange(fe.range(r.from,r.to),!1),effects:Ie.scrollIntoView(r.to)})),!0):!1},Mh=Me.define({combine(t){return Ro(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new AHe(e),scrollToMatch:e=>Ie.scrollIntoView(e)})}});class hY{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||W9e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new cHe(this):new aHe(this)}getCursor(e,n=0,i){let r=e.doc?e:At.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?pd(this,r,n,i):fd(this,r,n,i)}}class fY{constructor(e){this.spec=e}}function fd(t,e,n,i){return new oh(e.doc,t.unquoted,n,i,t.caseSensitive?void 0:r=>r.toLowerCase(),t.wholeWord?oHe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function oHe(t,e){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(e,n,i,r){let s=fd(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function pd(t,e,n,i){return new uY(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?lHe(e.charCategorizer(e.selection.main.head)):void 0},n,i)}function Pb(t,e){return t.slice(Ln(t,e,!1),e)}function Nb(t,e){return t.slice(e,Ln(t,e))}function lHe(t){return(e,n,i)=>!i[0].length||(t(Pb(i.input,i.index))!=Jt.Word||t(Nb(i.input,i.index))!=Jt.Word)&&(t(Nb(i.input,i.index+i[0].length))!=Jt.Word||t(Pb(i.input,i.index+i[0].length))!=Jt.Word)}class cHe extends fY{nextMatch(e,n,i){let r=pd(this.spec,e,i,e.doc.length).next();return r.done&&(r=pd(this.spec,e,0,n).next()),r.done?null:r.value}prevMatchInRange(e,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=pd(this.spec,e,s,i),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==n||a.from>s+10))return a;if(s==n)return null}}prevMatch(e,n,i){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(e,n,i,r){let s=pd(this.spec,e,Math.max(0,n-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Hg=et.define(),MI=et.define(),bl=si.define({create(t){return new S1(uT(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Hg)?t=new S1(n.value.create(),t.panel):n.is(MI)&&(t=new S1(t.query,n.value?DI:null));return t},provide:t=>Vg.from(t,e=>e.panel)});class S1{constructor(e,n){this.query=e,this.panel=n}}const uHe=$e.mark({class:"cm-searchMatch"}),dHe=$e.mark({class:"cm-searchMatch cm-searchMatch-selected"}),hHe=En.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(bl))}update(t){let e=t.state.field(bl);(e!=t.startState.field(bl)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return $e.none;let{view:n}=this,i=new fa;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-500;)l=s[++r].to;t.highlight(n.state,a,l,(u,d)=>{let f=n.state.selection.ranges.some(g=>g.from==u&&g.to==d);i.add(u,d,f?dHe:uHe)})}return i.finish()}},{decorations:t=>t.decorations});function Tm(t){return e=>{let n=e.state.field(bl,!1);return n&&n.query.spec.valid?t(e,n):mY(e)}}const Ob=Tm((t,{query:e})=>{let{to:n}=t.state.selection.main,i=e.nextMatch(t.state,n,n);if(!i)return!1;let r=fe.single(i.from,i.to),s=t.state.facet(Mh);return t.dispatch({selection:r,effects:[PI(t,i),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),gY(t),!0}),Bb=Tm((t,{query:e})=>{let{state:n}=t,{from:i}=n.selection.main,r=e.prevMatch(n,i,i);if(!r)return!1;let s=fe.single(r.from,r.to),o=t.state.facet(Mh);return t.dispatch({selection:s,effects:[PI(t,r),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),gY(t),!0}),fHe=Tm((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:fe.create(n.map(i=>fe.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),pHe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let a=new oh(t.doc,t.sliceDoc(i,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==i&&(o=s.length),s.push(fe.range(a.value.from,a.value.to))}return e(t.update({selection:fe.create(s,o),userEvent:"select.search.matches"})),!0},PV=Tm((t,{query:e})=>{let{state:n}=t,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,i,i);if(!s)return!1;let o=s,a=[],l,u,d=[];o.from==i&&o.to==r&&(u=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(n,o.from,o.to),d.push(Ie.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+".")));let f=t.state.changes(a);return o&&(l=fe.single(o.from,o.to).map(f),d.push(PI(t,o)),d.push(n.facet(Mh).scrollToMatch(l.main,t))),t.dispatch({changes:f,selection:l,effects:d,userEvent:"input.replace"}),!0}),gHe=Tm((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!n.length)return!1;let i=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ie.announce.of(i),userEvent:"input.replace.all"}),!0});function DI(t){return t.state.facet(Mh).createPanel(t)}function uT(t,e){var n,i,r,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let u=t.facet(Mh);return new hY({search:((n=e?.literal)!==null&&n!==void 0?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function pY(t){let e=Ug(t,DI);return e&&e.dom.querySelector("[main-field]")}function gY(t){let e=pY(t);e&&e==t.root.activeElement&&e.select()}const mY=t=>{let e=t.state.field(bl,!1);if(e&&e.panel){let n=pY(t);if(n&&n!=t.root.activeElement){let i=uT(t.state,e.query.spec);i.valid&&t.dispatch({effects:Hg.of(i)}),n.focus(),n.select()}}else t.dispatch({effects:[MI.of(!0),e?Hg.of(uT(t.state,e.query.spec)):et.appendConfig.of(vHe)]});return!0},AY=t=>{let e=t.state.field(bl,!1);if(!e||!e.panel)return!1;let n=Ug(t,DI);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:MI.of(!1)}),!0},mHe=[{key:"Mod-f",run:mY,scope:"editor search-panel"},{key:"F3",run:Ob,shift:Bb,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Ob,shift:Bb,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:AY,scope:"editor search-panel"},{key:"Mod-Shift-l",run:pHe},{key:"Mod-Alt-g",run:j9e},{key:"Mod-d",run:sHe,preventDefault:!0}];class AHe{constructor(e){this.view=e;let n=this.query=e.state.field(bl).query.spec;this.commit=this.commit.bind(this),this.searchField=Ot("input",{value:n.search,placeholder:fr(e,"Find"),"aria-label":fr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ot("input",{value:n.replace,placeholder:fr(e,"Replace"),"aria-label":fr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ot("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ot("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ot("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Ot("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Ot("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>Ob(e),[fr(e,"next")]),i("prev",()=>Bb(e),[fr(e,"previous")]),i("select",()=>fHe(e),[fr(e,"all")]),Ot("label",null,[this.caseField,fr(e,"match case")]),Ot("label",null,[this.reField,fr(e,"regexp")]),Ot("label",null,[this.wordField,fr(e,"by word")]),...e.state.readOnly?[]:[Ot("br"),this.replaceField,i("replace",()=>PV(e),[fr(e,"replace")]),i("replaceAll",()=>gHe(e),[fr(e,"replace all")])],Ot("button",{name:"close",onclick:()=>AY(e),"aria-label":fr(e,"close"),type:"button"},["×"])])}commit(){let e=new hY({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Hg.of(e)}))}keydown(e){B6e(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Bb:Ob)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),PV(this.view))}update(e){for(let n of e.transactions)for(let i of n.effects)i.is(Hg)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Mh).top}}function fr(t,e){return t.state.phrase(e)}const wy=30,Sy=/[\s\.,:;?!]/;function PI(t,{from:e,to:n}){let i=t.state.doc.lineAt(e),r=t.state.doc.lineAt(n).to,s=Math.max(i.from,e-wy),o=Math.min(r,n+wy),a=t.state.sliceDoc(s,o);if(s!=i.from){for(let l=0;la.length-wy;l--)if(!Sy.test(a[l-1])&&Sy.test(a[l])){a=a.slice(0,l);break}}return Ie.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${i.number}.`)}const yHe=Ie.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vHe=[bl,Jc.low(hHe),yHe];class yY{constructor(e,n,i,r){this.state=e,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=yi(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(vY(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function NV(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function bHe(t){let e=Object.create(null),n=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:bHe(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:n}:null}}class OV{constructor(e,n,i,r){this.completion=e,this.source=n,this.match=i,this.score=r}}function Oc(t){return t.selection.main.from}function vY(t,e){var n;let{source:i}=t,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?t:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const bY=ba.define();function SHe(t,e,n,i){let{main:r}=t.selection,s=n-r.from,o=i-r.from;return{...t.changeByRange(a=>{if(a!=r&&n!=i&&t.sliceDoc(a.from+s,a.from+o)!=t.sliceDoc(n,i))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:i==r.from?a.to:a.from+o,insert:l},range:fe.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const BV=new WeakMap;function CHe(t){if(!Array.isArray(t))return t;let e=BV.get(t);return e||BV.set(t,e=wHe(t)),e}const Lb=et.define(),zg=et.define();class xHe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(P=sI(D))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!k||N==1&&C||M==0&&N!=0)&&(n[f]==D||i[f]==D&&(g=!0)?o[f++]=k:o.length&&(E=!1)),M=N,k+=oo(D)}return f==l&&o[0]==0&&E?this.result(-100+(g?-200:0),o,e):m==l&&v==0?this.ret(-200-e.length+(S==e.length?0:-100),[0,S]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[v,S]):f==l?this.result(-100+(g?-200:0)+-700+(E?0:-1100),o,e):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,n,i){let r=[],s=0;for(let o of n){let a=o+(this.astral?oo(Ki(i,o)):1);s&&r[s-1]==o?r[s-1]=a:(r[s++]=o,r[s++]=a)}return this.ret(e-i.length,r)}}class EHe{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:_He,filterStrict:!1,compareCompletions:(e,n)=>(e.sortText||e.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>i=>LV(e(i),n(i)),optionClass:(e,n)=>i=>LV(e(i),n(i)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function LV(t,e){return t?e?t+" "+e:t:e}function _He(t,e,n,i,r,s){let o=t.textDirection==Lt.RTL,a=o,l=!1,u="top",d,f,g=e.left-r.left,m=r.right-e.right,v=i.right-i.left,S=i.bottom-i.top;if(a&&g=S||k>e.top?d=n.bottom-e.top:(u="bottom",d=e.bottom-n.top)}let C=(e.bottom-e.top)/s.offsetHeight,E=(e.right-e.left)/s.offsetWidth;return{style:`${u}: ${d/C}px; max-width: ${f/E}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function THe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let u=0;ul&&o.appendChild(document.createTextNode(a.slice(l,d)));let g=o.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(a.slice(d,f))),g.className="cm-completionMatchedText",l=f}return ln.position-i.position).map(n=>n.render)}function C1(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let r=Math.floor(e/n);return{from:r*n,to:(r+1)*n}}let i=Math.floor((t-e)/n);return{from:t-(i+1)*n,to:t-i*n}}class RHe{constructor(e,n,i){this.view=e,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let r=e.state.field(n),{options:s,selected:o}=r.open,a=e.state.facet(Qn);this.optionContent=THe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=C1(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=e.state.field(n).open;for(let d=l.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Qn).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:zg.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:o,disabled:a}=i.open;(!r.open||r.open.options!=s)&&(this.range=C1(s.length,o,e.state.facet(Qn).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),a!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=C1(n.options.length,n.selected,this.view.state.facet(Qn).maxRenderedOptions),this.showOptions(n.options,e.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ji(this.view.state,a,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&IHe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=g,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=g}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(a);f&&(d.className=f);for(let g of this.optionContent){let m=g(a,this.view.state,this.view,l);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew RHe(n,t,e)}function IHe(t,e){let n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=n.height/t.offsetHeight;i.topn.bottom&&(t.scrollTop+=(i.bottom-n.bottom)/r)}function UV(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function MHe(t,e){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let g=typeof f=="string"?f:f.name;i.some(m=>m.name==g)||i.push(typeof f=="string"?{name:g}:f)}},o=e.facet(Qn);for(let d of t)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)s(new OV(g,d.source,f?f(g):[],1e9-n.length));else{let g=e.sliceDoc(d.from,d.to),m,v=o.filterStrict?new EHe(g):new xHe(g);for(let S of d.result.options)if(m=v.match(S.label)){let C=S.displayLabel?f?f(S,m.matched):[]:m.matched,E=m.score+(S.boost||0);if(s(new OV(S,d.source,C,E)),typeof S.section=="object"&&S.section.rank==="dynamic"){let{name:k}=S.section;r||(r=Object.create(null)),r[k]=Math.max(E,r[k]||-1e9)}}}}if(i){let d=Object.create(null),f=0,g=(m,v)=>(m.rank==="dynamic"&&v.rank==="dynamic"?r[v.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof v.rank=="number"?v.rank:1e9)||(m.nameg.score-f.score||u(f.completion,g.completion))){let f=d.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(d):UV(d.completion)>UV(l)&&(a[a.length-1]=d),l=d.completion}return a}class _d{constructor(e,n,i,r,s,o){this.options=e,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new _d(this.options,VV(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,i,r,s,o){if(r&&!o&&e.some(u=>u.isPending))return r.setDisabled();let a=MHe(e,n);if(!a.length)return r&&e.some(u=>u.isPending)?r.setDisabled():null;let l=n.facet(Qn).selectOnOpen?0:-1;if(r&&r.selected!=l&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:LHe,above:s.aboveCursor},r?r.timestamp:Date.now(),l,!1)}map(e){return new _d(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new _d(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Ub{constructor(e,n,i){this.active=e,this.id=n,this.open=i}static start(){return new Ub(OHe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,i=n.facet(Qn),s=(i.override||n.languageDataAt("autocomplete",Oc(n)).map(CHe)).map(l=>(this.active.find(d=>d.source==l)||new qr(l,this.active.some(d=>d.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((l,u)=>l==this.active[u])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(NI));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!DHe(s,this.active)||a?o=_d.build(s,n,this.id,o,i,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new qr(l.source,0):l));for(let l of e.effects)l.is(SY)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Ub(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?PHe:NHe}}function DHe(t,e){if(t==e)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const OHe=[];function wY(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(bY);if(i&&e.activateOnCompletion(i))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class qr{constructor(e,n,i=!1){this.source=e,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let i=wY(e,n),r=this;(i&8||i&16&&this.touches(e))&&(r=new qr(r.source,0)),i&4&&r.state==0&&(r=new qr(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(Lb))r=new qr(r.source,1,s.value);else if(s.is(zg))r=new qr(r.source,0);else if(s.is(NI))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Oc(e.state))}}class zd extends qr{constructor(e,n,i,r,s,o){super(e,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,n){var i;if(!(n&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Oc(e.state);if(a>o||!r||n&2&&(Oc(e.startState)==this.from||an.map(e))}}),SY=et.define(),Yi=si.define({create(){return Ub.start()},update(t,e){return t.update(e)},provide:t=>[CI.from(t,e=>e.tooltip),Ie.contentAttributes.from(t,e=>e.attrs)]});function OI(t,e){const n=e.completion.apply||e.completion.label;let i=t.state.field(Yi).active.find(r=>r.source==e.source);return i instanceof zd?(typeof n=="string"?t.dispatch({...SHe(t.state,n,i.from,i.to),annotations:bY.of(e.completion)}):n(t,e.completion,i.from,i.to),!0):!1}const LHe=kHe(Yi,OI);function Cy(t,e="option"){return n=>{let i=n.state.field(Yi,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),n.dispatch({effects:SY.of(a)}),!0}}const UHe=t=>{let e=t.state.field(Yi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Yi,!1)?(t.dispatch({effects:Lb.of(!0)}),!0):!1,VHe=t=>{let e=t.state.field(Yi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:zg.of(null)}),!0)};class FHe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const HHe=50,zHe=1e3,QHe=En.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Yi).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Yi),n=t.state.facet(Qn);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Yi)==e)return;let i=t.transactions.some(s=>{let o=wY(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sHHe&&Date.now()-o.time>zHe){for(let a of o.context.abortListeners)try{a()}catch(l){Ji(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Lb)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Yi);for(let n of e.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Qn).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Oc(e),i=new yY(e,n,t.explicit,this.view),r=new FHe(t,i);this.running.push(r),Promise.resolve(t.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:zg.of(null)}),Ji(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Qn).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Qn),i=this.view.state.field(Yi);for(let r=0;ra.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new qr(s.active.source,0);for(let l of s.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:NI.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Yi,!1);if(e&&e.tooltip&&this.view.state.facet(Qn).closeOnBlur){let n=e.open&&fK(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:zg.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Lb.of(!1)}),20),this.composing=0}}}),GHe=typeof navigator=="object"&&/Win/.test(navigator.platform),$He=Jc.highest(Ie.domEventHandlers({keydown(t,e){let n=e.state.field(Yi,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(GHe&&t.altKey)||t.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&OI(e,i),!1}})),WHe=Ie.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Qg={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Mc=et.define({map(t,e){let n=e.mapPos(t,-1,Mi.TrackAfter);return n??void 0}}),BI=new class extends Tl{};BI.startSide=1;BI.endSide=-1;const CY=si.define({create(){return ut.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of e.effects)n.is(Mc)&&(t=t.update({add:[BI.range(n.value,n.value+1)]}));return t}});function jHe(){return[YHe,CY]}const E1="()[]{}<>«»»«[]{}";function xY(t){for(let e=0;e{if((KHe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(i.length>2||i.length==2&&oo(Ki(i,0))==1||e!=r.from||n!=r.to)return!1;let s=XHe(t.state,i);return s?(t.dispatch(s),!0):!1}),qHe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=EY(t,t.selection.main.head).brackets||Qg.brackets,r=null,s=t.changeByRange(o=>{if(o.empty){let a=ZHe(t.doc,o.head);for(let l of i)if(l==a&&nS(t.doc,o.head)==xY(Ki(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:fe.cursor(o.head-l.length)}}return{range:r=o}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},JHe=[{key:"Backspace",run:qHe}];function XHe(t,e){let n=EY(t,t.selection.main.head),i=n.brackets||Qg.brackets;for(let r of i){let s=xY(Ki(r,0));if(e==r)return s==r?n7e(t,r,i.indexOf(r+r+r)>-1,n):e7e(t,r,s,n.before||Qg.before);if(e==s&&_Y(t,t.selection.main.from))return t7e(t,r,s)}return null}function _Y(t,e){let n=!1;return t.field(CY).between(0,t.doc.length,i=>{i==e&&(n=!0)}),n}function nS(t,e){let n=t.sliceString(e,e+2);return n.slice(0,oo(Ki(n,0)))}function ZHe(t,e){let n=t.sliceString(e-2,e);return oo(Ki(n,0))==n.length?n:n.slice(1)}function e7e(t,e,n,i){let r=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:Mc.of(o.to+e.length),range:fe.range(o.anchor+e.length,o.head+e.length)};let a=nS(t.doc,o.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:Mc.of(o.head+e.length),range:fe.cursor(o.head+e.length)}:{range:r=o}});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function t7e(t,e,n){let i=null,r=t.changeByRange(s=>s.empty&&nS(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:fe.cursor(s.head+n.length)}:i={range:s});return i?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function n7e(t,e,n,i){let r=i.stringPrefixes||Qg.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Mc.of(a.to+e.length),range:fe.range(a.anchor+e.length,a.head+e.length)};let l=a.head,u=nS(t.doc,l),d;if(u==e){if(FV(t,l))return{changes:{insert:e+e,from:l},effects:Mc.of(l+e.length),range:fe.cursor(l+e.length)};if(_Y(t,l)){let g=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+g.length,insert:g},range:fe.cursor(l+g.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(d=HV(t,l-2*e.length,r))>-1&&FV(t,d))return{changes:{insert:e+e+e+e,from:l},effects:Mc.of(l+e.length),range:fe.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=Jt.Word&&HV(t,l,r)>-1&&!i7e(t,l,e,r))return{changes:{insert:e+e,from:l},effects:Mc.of(l+e.length),range:fe.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function FV(t,e){let n=yi(t).resolveInner(e+1);return n.parent&&n.from==e}function i7e(t,e,n,i){let r=yi(t).resolveInner(e,-1),s=i.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),l=a.indexOf(n);if(!l||l>-1&&i.indexOf(a.slice(0,l))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+l;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==e&&r.parent;if(!u)break;r=u}return!1}function HV(t,e,n){let i=t.charCategorizer(e);if(i(t.sliceDoc(e-1,e))!=Jt.Word)return e;for(let r of n){let s=e-r.length;if(t.sliceDoc(s,e)==r&&i(t.sliceDoc(s-1,s))!=Jt.Word)return s}return-1}function r7e(t={}){return[$He,Yi,Qn.of(t),QHe,s7e,WHe]}const TY=[{key:"Ctrl-Space",run:x1},{mac:"Alt-`",run:x1},{mac:"Alt-i",run:x1},{key:"Escape",run:VHe},{key:"ArrowDown",run:Cy(!0)},{key:"ArrowUp",run:Cy(!1)},{key:"PageDown",run:Cy(!0,"page")},{key:"PageUp",run:Cy(!1,"page")},{key:"Enter",run:UHe}],s7e=Jc.highest(wI.computeN([Qn],t=>t.facet(Qn).defaultKeymap?[TY]:[]));class zV{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}}class Sc{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(Gg).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((m,v)=>m.from-v.from||m.to-v.to),o=new fa,a=[],l=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let v=m==s.length?null:s[m];if(!v&&!a.length)break;let S,C;if(a.length)S=l,C=a.reduce((R,M)=>Math.min(R,M.to),v&&v.from>S?v.from:1e8);else{if(S=v.from,S>f)break;C=v.to,a.push(v),m++}for(;mR.from||R.to==S))a.push(R),m++,C=Math.min(R.to,C);else{C=Math.min(R.from,C);break}}C=Math.min(C,f);let E=!1;if(a.some(R=>R.from==S&&(R.to==C||C==f))&&(E=S==C,!E&&C-S<10)){let R=S-(d+u.value.length);R>0&&(u.next(R),d=S);for(let M=S;;){if(M>=C){E=!0;break}if(!u.lineBreak&&d+u.value.length>M)break;M=d+u.value.length,d+=u.value.length,u.next()}}let k=y7e(a);if(E)o.add(S,S,$e.widget({widget:new p7e(k),diagnostics:a.slice()}));else{let R=a.reduce((M,D)=>D.markClass?M+" "+D.markClass:M,"");o.add(S,C,$e.mark({class:"cm-lintRange cm-lintRange-"+k+R,diagnostics:a.slice(),inclusiveEnd:a.some(M=>M.to>C)}))}if(l=C,l==f)break;for(let R=0;R{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new zV(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new zV(i.from,s,i.diagnostic)}}),i}function o7e(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(Gg).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(RY))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function a7e(t,e){return t.field(Sr,!1)?e:e.concat(et.appendConfig.of(v7e))}const RY=et.define(),LI=et.define(),kY=et.define(),Sr=si.define({create(){return new Sc($e.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=ah(n,t.selected.diagnostic,s)||ah(n,null,s)}!n.size&&r&&e.state.facet(Gg).autoPanel&&(r=null),t=new Sc(n,r,i)}for(let n of e.effects)if(n.is(RY)){let i=e.state.facet(Gg).autoPanel?n.value.length?$g.open:null:t.panel;t=Sc.init(n.value,i,e.state)}else n.is(LI)?t=new Sc(t.diagnostics,n.value?$g.open:null,t.selected):n.is(kY)&&(t=new Sc(t.diagnostics,t.panel,n.value));return t},provide:t=>[Vg.from(t,e=>e.panel),Ie.decorations.from(t,e=>e.diagnostics)]}),l7e=$e.mark({class:"cm-lintRange cm-lintRange-active"});function c7e(t,e,n){let{diagnostics:i}=t.state.field(Sr),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(l,u,{spec:d})=>{if(e>=l&&e<=u&&(l==u||(e>l||n>0)&&(eMY(t,n,!1)))}const d7e=t=>{let e=t.state.field(Sr,!1);(!e||!e.panel)&&t.dispatch({effects:a7e(t.state,[LI.of(!0)])});let n=Ug(t,$g.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},QV=t=>{let e=t.state.field(Sr,!1);return!e||!e.panel?!1:(t.dispatch({effects:LI.of(!1)}),!0)},h7e=t=>{let e=t.state.field(Sr,!1);if(!e)return!1;let n=t.state.selection.main,i=e.diagnostics.iter(n.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==n.from&&i.to==n.to)?!1:(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},f7e=[{key:"Mod-Shift-m",run:d7e,preventDefault:!0},{key:"F8",run:h7e}],Gg=Me.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Ro(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:GV,tooltipFilter:GV,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function GV(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function IY(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;is.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function MY(t,e,n){var i;let r=n?IY(e.actions):[];return Ot("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ot("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let a=!1,l=m=>{if(m.preventDefault(),a)return;a=!0;let v=ah(t.state.field(Sr).diagnostics,e);v&&s.apply(t,v.from,v.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Ot("u",u.slice(d,d+1)),u.slice(d+1)],g=s.markClass?" "+s.markClass:"";return Ot("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&Ot("div",{class:"cm-diagnosticSource"},e.source))}class p7e extends wa{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ot("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class $V{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=MY(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class $g{constructor(e){this.view=e,this.items=[];let n=r=>{if(r.keyCode==27)QV(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=IY(s.actions);for(let a=0;a{for(let s=0;sQV(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Sr).selected;if(!e)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,g;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),s=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let u=l.height/this.list.offsetHeight;a.topl.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Sr),i=ah(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:kY.of(i)})}static open(e){return new $g(e)}}function g7e(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function xy(t){return g7e(``,'width="6" height="3"')}const m7e=Ie.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:xy("#d11")},".cm-lintRange-warning":{backgroundImage:xy("orange")},".cm-lintRange-info":{backgroundImage:xy("#999")},".cm-lintRange-hint":{backgroundImage:xy("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function A7e(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function y7e(t){let e="hint",n=1;for(let i of t){let r=A7e(i.severity);r>n&&(n=r,e=i.severity)}return e}const v7e=[Sr,Ie.decorations.compute([Sr],t=>{let{selected:e,panel:n}=t.field(Sr);return!e||!n||e.from==e.to?$e.none:$e.set([l7e.range(e.from,e.to)])}),SFe(c7e,{hideOn:o7e}),m7e],b7e=[PFe(),BFe(),Z6e(),H8e(),d8e(),z6e(),j6e(),At.allowMultipleSelections.of(!0),JFe(),f8e(m8e,{fallback:!0}),C8e(),jHe(),r7e(),dFe(),pFe(),sFe(),J9e(),wI.of([...JHe,...$9e,...mHe,...q8e,...a8e,...TY,...f7e])],w7e=({open:t,onClose:e})=>{const{t:n}=Ct(),{saveConfig:i,getConfig:r}=Ns(),s=me.useRef(null),o=me.useRef(null),[a,l]=me.useState(""),[u,d]=me.useState(""),[f,g]=me.useState(!0),m=me.useCallback(S=>{try{return JSON.parse(S).mcpServers?(g(!0),d(""),!0):(g(!1),d(n("ConfigurationError")),!1)}catch(C){return d(`Invalid JSON format - ${C instanceof Error?C.message:"Unknown error"}`),g(!1),!1}},[n]);me.useEffect(()=>{if(!t)return;const S=()=>{if(s.current&&!o.current){const C=JSON.stringify(r(),null,2);l(C),m(C);const E=At.create({doc:C,extensions:[b7e,M8e(),Ie.updateListener.of(k=>{if(k.docChanged){const R=k.state.doc.toString();l(R),m(R)}}),Ie.theme({"&":{height:"200px",maxHeight:"200px"},".cm-content":{padding:"10px"},".cm-focused":{outline:"none"},".cm-editor":{height:"200px",maxHeight:"200px"},".cm-scroller":{fontFamily:"monospace",height:"200px",maxHeight:"200px"},".cm-gutters":{height:"200px",maxHeight:"200px"}})]});o.current=new Ie({state:E,parent:s.current})}else setTimeout(S,100)};return setTimeout(S,50),()=>{o.current&&(o.current.destroy(),o.current=null)}},[t,m,r]);const v=me.useCallback(()=>{f&&(i(JSON.parse(a)),e())},[f,i,a,e]);return me.useEffect(()=>{if(!t)return;const S=C=>{C.key==="Enter"&&document.activeElement?.id==="dialog-content"&&(C.preventDefault(),v())};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[t,v]),_.jsx(Pl,{open:t,children:_.jsxs(Nl,{header:n("EditConfiguration"),onClose:e,className:"w-[564px] min-h-[400px]",children:[_.jsx("div",{className:"flex flex-col gap-[8px] min-h-[280px] pt-[8px] pb-[16px]",children:_.jsxs("div",{className:"flex flex-col gap-[8px] min-h-[256px] p-[12px] bg-[var(--servers-edit-config-json-background-color)] rounded-[12px]",children:[_.jsxs("div",{className:"flex flex-row justify-between",children:[_.jsx("p",{className:"font-bold text-[14px] leading-[20px] text-[var(--servers-edit-config-json-header-color)]",children:n("EnterYourJSONConfiguration")}),_.jsx("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--servers-edit-config-json-lang-color)]",children:"json"})]}),_.jsx("div",{ref:s,className:"border border-[var(--servers-edit-config-json-editor-border-color)] bg-[var(--servers-edit-config-json-editor-background-color)] rounded-[4px] overflow-hidden h-full max-h-full"}),u?_.jsx("p",{className:"text-[var(--text-negative)] font-normal text-[14px] leading-[20px] whitespace-pre-line",children:u}):null]})}),_.jsxs("div",{className:"flex flex-row items-center justify-end gap-[16px] h-[64px] border-t border-[var(--servers-edit-config-buttons-border-color)] mx-[-32px] px-[32px]",children:[_.jsx(ln,{onClick:e,variant:"default",children:n("Cancel")}),_.jsx(ln,{disabled:!f,onClick:v,children:n("Save")})]})]})})},S7e=()=>{const{t}=Ct(),{isRTL:e}=Wt(),[n,i]=me.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-col gap-[16px] mt-[16px] pb-[32px]",children:[_.jsx("p",{className:_e("font-normal text-[14px] leading-[20px] text-[var(--servers-description-color)]",e?"text-end":""),children:t("CustomServersDescription")}),_.jsx("div",{className:_e("flex",e?"justify-end":"justify-start"),children:_.jsx(ln,{className:"w-fit",onClick:()=>i(!0),children:t("EditConfiguration")})}),_.jsx(i3e,{})]}),_.jsx(w7e,{open:n,onClose:()=>i(!1)})]})},C7e=({isActive:t})=>{const{t:e}=Ct();return _.jsx(ln,{className:"max-w-[fit-content]",disabled:!t,children:e("RegisterConnectWallet")})},x7e=()=>{const{t}=Ct(),{isRTL:e}=Wt(),[n,i]=me.useState(""),[r,s]=me.useState(""),[o,a]=me.useState(!1);me.useEffect(()=>{const d=sn.getWebSearchData();d&&(i(d.provider),s(d.key),a(!0))},[]);const l=me.useCallback(()=>{!n||!r||(sn.setWebSearchData({provider:n,key:r}),a(!0))},[n,r]),u=()=>{i(""),s(""),a(!1),sn.setWebSearchData(null)};return me.useEffect(()=>{const d=f=>{f.key==="Enter"&&(f.preventDefault(),l())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[l]),_.jsxs("div",{className:"flex flex-col gap-[16px] mt-[16px]",children:[_.jsx("p",{className:_e("font-normal text-[14px] leading-[20px] text-[var(--servers-description-color)]",e?"text-end":""),children:t("WebSearchDescription")}),_.jsxs("div",{className:"flex flex-col gap-[16px]",children:[_.jsx(uo,{header:t("WebSearchEngine"),children:_.jsx(Vw,{className:"w-[260px]",value:n||t("SelectEngine"),items:o?[]:[{text:"Exa",id:"Exa",onClick:()=>i("Exa")}]})}),_.jsx(uo,{header:t("APIKey"),children:_.jsx(mo,{className:"w-[260px]",type:"password",value:r,disabled:o,onChange:d=>s(d.target.value)})})]}),_.jsxs("div",{className:_e("flex gap-[8px]",e?"flex-row-reverse":"flex-row"),children:[_.jsx(ln,{className:"w-fit",onClick:l,disabled:!n||!r||o,children:t("Save")}),_.jsx(ln,{className:"w-fit",disabled:!o,onClick:u,variant:"default",children:t("ResetSettings")})]})]})},E7e=()=>{const{t}=Ct(),{isRTL:e}=Wt(),[n,i]=me.useState("providers"),{providers:r}=Tr(),s=_.jsxs("div",{className:"flex flex-col gap-[16px] select-none",children:[null,["providers"].map(o=>{const a=o==="wallet";return _.jsxs("div",{className:"flex gap-[12px]",children:[null,_.jsxs("div",{className:"select-none flex flex-col gap-[12px]",children:[_.jsxs("div",{className:"flex flex-col gap-[4px]",children:[null,_.jsx("p",{className:_e("text-[14px] leading-[20px] text-[var(--settings-description-color)]",e?"text-end":""),children:t(a?"ONLYOFFICEWalletDescription":"AIProvidersDescription")})]}),a?_.jsx(C7e,{isActive:n===o}):_.jsx(e3e,{isActive:n===o})]})]},o)})]});return _.jsx("div",{className:"flex justify-center",children:_.jsxs("div",{className:"flex flex-col gap-[16px] box-border max-w-[640px] w-[640px] mx-[32px] mt-[32px]",children:[_.jsx("h1",{className:"select-none font-bold text-[20px] leading-[28px] text-[var(--settings-header-color)]",children:t("Settings")}),_.jsx(Y5e,{items:[{value:"ai-settings",label:t("Connection"),content:s},{value:"mcp-servers",label:t("MCPServers"),content:_.jsx(S7e,{}),disabled:!r.length},{value:"web-search",label:t("WebSearch"),content:_.jsx(x7e,{}),disabled:!r.length}]})]})})},je=t=>typeof t=="string",sp=()=>{let t,e;const n=new Promise((i,r)=>{t=i,e=r});return n.resolve=t,n.reject=e,n},WV=t=>t==null?"":""+t,_7e=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},T7e=/###/g,jV=t=>t&&t.indexOf("###")>-1?t.replace(T7e,"."):t,KV=t=>!t||je(t),Zp=(t,e,n)=>{const i=je(e)?e.split("."):e;let r=0;for(;r{const{obj:i,k:r}=Zp(t,e,Object);if(i!==void 0||e.length===1){i[r]=n;return}let s=e[e.length-1],o=e.slice(0,e.length-1),a=Zp(t,o,Object);for(;a.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=Zp(t,o,Object),a?.obj&&typeof a.obj[`${a.k}.${s}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=n},R7e=(t,e,n,i)=>{const{obj:r,k:s}=Zp(t,e,Object);r[s]=r[s]||[],r[s].push(n)},Vb=(t,e)=>{const{obj:n,k:i}=Zp(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},k7e=(t,e,n)=>{const i=Vb(t,n);return i!==void 0?i:Vb(e,n)},DY=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?je(t[i])||t[i]instanceof String||je(e[i])||e[i]instanceof String?n&&(t[i]=e[i]):DY(t[i],e[i],n):t[i]=e[i]);return t},rd=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var I7e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const M7e=t=>je(t)?t.replace(/[&<>"'\/]/g,e=>I7e[e]):t;class D7e{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const P7e=[" ",",","?","!",";"],N7e=new D7e(20),O7e=(t,e,n)=>{e=e||"",n=n||"";const i=P7e.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(i.length===0)return!0;const r=N7e.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(t);if(!s){const o=t.indexOf(n);o>0&&!r.test(t.substring(0,o))&&(s=!0)}return s},dT=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const i=e.split(n);let r=t;for(let s=0;s-1&&lt?.replace("_","-"),B7e={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Fb{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||B7e,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,i,r){return r&&!this.debug?null:(je(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Fb(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Fb(this.logger,e)}}var po=new Fb;class iS{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(e,n,i,r={}){const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],i&&(Array.isArray(i)?a.push(...i):je(i)&&s?a.push(...i.split(s)):a.push(i)));const l=Vb(this.data,a);return!l&&!n&&!i&&e.indexOf(".")>-1&&(e=a[0],n=a[1],i=a.slice(2).join(".")),l||!o||!je(i)?l:dT(this.data?.[e]?.[n],i,s)}addResource(e,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let a=[e,n];i&&(a=a.concat(o?i.split(o):i)),e.indexOf(".")>-1&&(a=e.split("."),r=n,n=a[1]),this.addNamespaces(n),YV(this.data,a,r),s.silent||this.emit("added",e,n,i,r)}addResources(e,n,i,r={silent:!1}){for(const s in i)(je(i[s])||Array.isArray(i[s]))&&this.addResource(e,n,s,i[s],{silent:!0});r.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,r,s,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),r=i,i=n,n=a[1]),this.addNamespaces(n);let l=Vb(this.data,a)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?DY(l,i,s):l={...l,...i},YV(this.data,a,l),o.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var PY={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,r){return t.forEach(s=>{e=this.processors[s]?.process(e,n,i,r)??e}),e}};const NY=Symbol("i18next/PATH_KEY");function L7e(){const t=[],e=Object.create(null);let n;return e.get=(i,r)=>(n?.revoke?.(),r===NY?t:(t.push(r),n=Proxy.revocable(i,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function hT(t,e){const{[NY]:n}=t(L7e());return n.join(e?.keySeparator??".")}const JV={},_1=t=>!je(t)&&typeof t!="boolean"&&typeof t!="number";class Hb extends iS{constructor(e,n={}){super(),_7e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=po.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const i={...n};if(e==null)return!1;const r=this.resolve(e,i);if(r?.res===void 0)return!1;const s=_1(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&e.indexOf(i)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!O7e(e,i,r);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:je(s)?[s]:s};const u=e.split(i);(i!==r||i===r&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),e=u.join(r)}return{key:e,namespaces:je(s)?[s]:s}}translate(e,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";typeof e=="function"&&(e=hT(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],r),u=l[l.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,g=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return g?s?{res:`${u}${d}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${a}`:s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:a;const m=this.resolve(e,r);let v=m?.res;const S=m?.usedKey||a,C=m?.exactUsedKey||a,E=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,M=r.count!==void 0&&!je(r.count),D=Hb.hasDefaultValue(r),P=M?this.pluralResolver.getSuffix(f,r.count,r):"",N=r.ordinal&&M?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",B=M&&!r.ordinal&&r.count===0,G=B&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${P}`]||r[`defaultValue${N}`]||r.defaultValue;let V=v;R&&!v&&D&&(V=G);const $=_1(V),K=Object.prototype.toString.apply(V);if(R&&V&&$&&E.indexOf(K)<0&&!(je(k)&&Array.isArray(V))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const X=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,V,{...r,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(m.res=X,m.usedParams=this.getUsedParamsDetails(r),m):X}if(o){const X=Array.isArray(V),J=X?[]:{},Z=X?C:S;for(const Q in V)if(Object.prototype.hasOwnProperty.call(V,Q)){const q=`${Z}${o}${Q}`;D&&!v?J[Q]=this.translate(q,{...r,defaultValue:_1(G)?G[Q]:void 0,joinArrays:!1,ns:l}):J[Q]=this.translate(q,{...r,joinArrays:!1,ns:l}),J[Q]===q&&(J[Q]=V[Q])}v=J}}else if(R&&je(k)&&Array.isArray(v))v=v.join(k),v&&(v=this.extendTranslation(v,e,r,i));else{let X=!1,J=!1;!this.isValidLookup(v)&&D&&(X=!0,v=G),this.isValidLookup(v)||(J=!0,v=a);const Q=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&J?void 0:v,q=D&&G!==v&&this.options.updateMissing;if(J||X||q){if(this.logger.log(q?"updateKey":"missingKey",f,u,a,q?G:v),o){const z=this.resolve(a,{...r,keySeparator:!1});z&&z.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 j=[];const oe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&oe&&oe[0])for(let z=0;z{const pe=D&&U!==v?U:Q;this.options.missingKeyHandler?this.options.missingKeyHandler(z,u,te,pe,q,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(z,u,te,pe,q,r),this.emit("missingKey",z,u,te,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?j.forEach(z=>{const te=this.pluralResolver.getSuffixes(z,r);B&&r[`defaultValue${this.options.pluralSeparator}zero`]&&te.indexOf(`${this.options.pluralSeparator}zero`)<0&&te.push(`${this.options.pluralSeparator}zero`),te.forEach(U=>{L([z],a+U,r[`defaultValue${U}`]||G)})}):L(j,a,G))}v=this.extendTranslation(v,e,r,m,i),J&&v===a&&this.options.appendNamespaceToMissingKey&&(v=`${u}${d}${a}`),(J||X)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${a}`:a,X?v:void 0,r))}return s?(m.res=v,m.usedParams=this.getUsedParamsDetails(r),m):v}extendTranslation(e,n,i,r,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const l=je(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let d=i.replace&&!je(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,i.lng||this.language||r.usedLng,i),l){const f=e.match(this.interpolator.nestingRegexp),g=f&&f.length;us?.[0]===f[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):this.translate(...f,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,a=je(o)?[o]:o;return e!=null&&a?.length&&i.applyPostProcessor!==!1&&(e=PY.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,n={}){let i,r,s,o,a;return je(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(l,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const g=n.count!==void 0&&!je(n.count),m=g&&!n.ordinal&&n.count===0,v=n.context!==void 0&&(je(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(C=>{this.isValidLookup(i)||(a=C,!JV[`${S[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(JV[`${S[0]}-${C}`]=!0,this.logger.warn(`key "${r}" for languages "${S.join(", ")}" won't get resolved as 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!!!")),S.forEach(E=>{if(this.isValidLookup(i))return;o=E;const k=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,d,E,C,n);else{let M;g&&(M=this.pluralResolver.getSuffix(E,n.count,n));const D=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(n.ordinal&&M.indexOf(P)===0&&k.push(d+M.replace(P,this.options.pluralSeparator)),k.push(d+M),m&&k.push(d+D)),v){const N=`${d}${this.options.contextSeparator||"_"}${n.context}`;k.push(N),g&&(n.ordinal&&M.indexOf(P)===0&&k.push(N+M.replace(P,this.options.pluralSeparator)),k.push(N+M),m&&k.push(N+D))}}let R;for(;R=k.pop();)this.isValidLookup(i)||(s=R,i=this.getResource(E,C,R,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,i,r):this.resourceStore.getResource(e,n,i,r)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!je(e.replace);let r=i?e.replace:e;if(i&&typeof e.count<"u"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}}class XV{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=po.create("languageUtils")}getScriptPartFromCode(e){if(e=Wg(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Wg(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(je(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),je(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),r=[],s=o=>{o&&(this.isSupportedCode(o)?r.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return je(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):je(e)&&s(this.formatLanguageCode(e)),i.forEach(o=>{r.indexOf(o)<0&&s(this.formatLanguageCode(o))}),r}}const ZV={zero:0,one:1,two:2,few:3,many:4,other:5},e6={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class U7e{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=po.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const i=Wg(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),e6;if(!e.match(/-|_/))return e6;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[s]=o,o}needsPlural(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,i={}){return this.getSuffixes(e,i).map(r=>`${n}${r}`)}getSuffixes(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>ZV[r]-ZV[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(e,n,i={}){const r=this.getRule(e,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,i))}}const t6=(t,e,n,i=".",r=!0)=>{let s=k7e(t,e,n);return!s&&r&&je(n)&&(s=dT(t,n,i),s===void 0&&(s=dT(e,n,i))),s},T1=t=>t.replace(/\$/g,"$$$$");class n6{constructor(e={}){this.logger=po.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:g,nestingPrefixEscaped:m,nestingSuffix:v,nestingSuffixEscaped:S,nestingOptionsSeparator:C,maxReplaces:E,alwaysFormat:k}=e.interpolation;this.escape=n!==void 0?n:M7e,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?rd(s):o||"{{",this.suffix=a?rd(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=g?rd(g):m||rd("$t("),this.nestingSuffix=v?rd(v):S||rd(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=E||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n?.source===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,i,r){let s,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const E=t6(n,l,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,i,{...r,...n,interpolationkey:m}):E}const v=m.split(this.formatSeparator),S=v.shift().trim(),C=v.join(this.formatSeparator).trim();return this.format(t6(n,l,S,this.options.keySeparator,this.options.ignoreJSONStructure),C,i,{...r,...n,interpolationkey:S})};this.resetRegExp();const d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>T1(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?T1(this.escape(m)):T1(m)}].forEach(m=>{for(a=0;s=m.regex.exec(e);){const v=s[1].trim();if(o=u(v),o===void 0)if(typeof d=="function"){const C=d(e,s,r);o=je(C)?C:""}else if(r&&Object.prototype.hasOwnProperty.call(r,v))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),o="";else!je(o)&&!this.useRawValueToEscape&&(o=WV(o));const S=m.safeValue(o);if(e=e.replace(s[0],S),f?(m.regex.lastIndex+=o.length,m.regex.lastIndex-=s[0].length):m.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,i={}){let r,s,o;const a=(l,u)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let g=`{${f[1]}`;l=f[0],g=this.interpolate(g,o);const m=g.match(/'/g),v=g.match(/"/g);((m?.length??0)%2===0&&!v||v.length%2!==0)&&(g=g.replace(/'/g,'"'));try{o=JSON.parse(g),u&&(o={...u,...o})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,S),`${l}${d}${g}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;r=this.nestingRegexp.exec(e);){let l=[];o={...i},o=o.replace&&!je(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(l=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(a.call(this,r[1].trim(),o),o),s&&r[0]===e&&!je(s))return s;je(s)||(s=WV(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),s=""),l.length&&(s=l.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),e=e.replace(r[0],s),this.regexp.lastIndex=0}return e}}const V7e=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const r=i[1].substring(0,i[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},i6=t=>{const e={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let a=e[o];return a||(a=t(Wg(i),r),e[o]=a),a(n)}},F7e=t=>(e,n,i)=>t(Wg(n),i)(e);class H7e{constructor(e={}){this.logger=po.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?i6:F7e;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return a=>o.format(a)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return a=>o.format(a)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return a=>o.format(a)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return a=>o.format(a,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=i6(n)}format(e,n,i,r={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(a=>a.indexOf(")")>-1)){const a=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,a)].join(this.formatSeparator)}return s.reduce((a,l)=>{const{formatName:u,formatOptions:d}=V7e(l);if(this.formats[u]){let f=a;try{const g=r?.formatParams?.[r.interpolationkey]||{},m=g.locale||g.lng||r.locale||r.lng||i;f=this.formats[u](a,m,{...d,...r,...g})}catch(g){this.logger.warn(g)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const z7e=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Q7e extends iS{constructor(e,n,i,r={}){super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=po.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,r.backend,r)}queueLoad(e,n,i,r){const s={},o={},a={},l={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const g=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?o[g]===void 0&&(o[g]=!0):(this.state[g]=1,d=!1,o[g]===void 0&&(o[g]=!0),s[g]===void 0&&(s[g]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(a[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,i){const r=e.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const a={};this.queue.forEach(l=>{R7e(l.loaded,[s],o),z7e(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const d=l.loaded[u];d.length&&d.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,i,r=0,s=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read.call(this,e,n,i,r+1,s*2,o)},s);return}o(u,d)},l=this.backend[i].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,n,a)}prepareLoading(e,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();je(e)&&(e=this.languageUtils.toResolveHierarchy(e)),je(n)&&(n=[n]);const s=this.queueLoad(e,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e,n=""){const i=e.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,a),this.loaded(e,o,a)})}saveMissing(e,n,i,r,s,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" 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(!(i==null||i==="")){if(this.backend?.create){const l={...o,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(e,n,i,r,l):d=u(e,n,i,r),d&&typeof d.then=="function"?d.then(f=>a(null,f)).catch(a):a(null,d)}catch(d){a(d)}else u(e,n,i,r,a,l)}!e||!e[0]||this.store.addResource(e[0],n,i,r)}}}const R1=()=>({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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),je(t[1])&&(e.defaultValue=t[1]),je(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),r6=t=>(je(t.ns)&&(t.ns=[t.ns]),je(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),je(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Ey=()=>{},G7e=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class eg extends iS{constructor(e={},n){if(super(),this.options=r6(e),this.services={},this.logger=po,this.modules={external:[]},G7e(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(je(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=R1();this.options={...i,...this.options,...r6(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?po.init(r(this.modules.logger),this.options):po.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=H7e;const d=new XV(this.options);this.store=new qV(this.options.resources,this.options);const f=this.services;f.logger=po,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new U7e(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new n6(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Q7e(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(m,...v)=>{this.emit(m,...v)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Hb(this.services,this.options),this.translator.on("*",(m,...v)=>{this.emit(m,...v)}),this.modules.external.forEach(m=>{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Ey),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const a=sp(),l=()=>{const u=(d,f)=>{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),a.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=Ey){let i=n;const r=je(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const s=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload?.forEach?.(a=>o(a)),this.services.backendConnector.load(s,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(a)})}else i(null)}reloadResources(e,n,i){const r=sp();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=Ey),this.services.backendConnector.reload(e,n,s=>{r.resolve(),i(s)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&PY.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const i=sp();this.emit("languageChanging",e);const r=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},s=(a,l)=>{l?this.isLanguageChangingTo===e&&(r(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(a,(...u)=>this.t(...u))},o=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const l=je(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(je(a)?[a]:a);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,d=>{s(d,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,n,i){const r=(s,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([s,o].concat(a)):l={...o},l.lng=l.lng||r.lng,l.lngs=l.lngs||r.lngs,l.ns=l.ns||r.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||i||r.keyPrefix);const u=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(s)?d=s.map(f=>(typeof f=="function"&&(f=hT(f,{...this.options,...o})),`${l.keyPrefix}${u}${f}`)):(typeof s=="function"&&(s=hT(s,{...this.options,...o})),d=l.keyPrefix?`${l.keyPrefix}${u}${s}`:s),this.t(d,l)};return je(e)?r.lng=e:r.lngs=e,r.ns=n,r.keyPrefix=i,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){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 i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,e)&&(!r||o(s,e)))}loadNamespaces(e,n){const i=sp();return this.options.ns?(je(e)&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=sp();je(e)&&(e=[e]);const r=this.options.preload||[],s=e.filter(o=>r.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const r=new Intl.Locale(e);if(r&&r.getTextInfo){const s=r.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["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"],i=this.services?.languageUtils||new XV(R1());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const i=new eg(e,n);return i.createInstance=eg.createInstance,i}cloneInstance(e={},n=Ey){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},s=new eg(r);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(a=>{s[a]=this[a]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const a=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,f)=>(d[f]={...l[u][f]},d),l[u]),l),{});s.store=new qV(a,r),s.services.resourceStore=s.store}if(e.interpolation){const l={...R1().interpolation,...this.options.interpolation,...e.interpolation},u={...r,interpolation:l};s.services.interpolator=new n6(u)}return s.translator=new Hb(s.services,r),s.translator.on("*",(a,...l)=>{s.emit(a,...l)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ui=eg.createInstance();Ui.createInstance;Ui.dir;Ui.init;Ui.loadResources;Ui.reloadResources;Ui.use;Ui.changeLanguage;Ui.getFixedT;Ui.t;Ui.exists;Ui.setDefaultNamespace;Ui.hasLoadedNamespace;Ui.loadNamespaces;Ui.loadLanguages;const $7e="وكيل الذكاء الاصطناعي",W7e="إعدادات وكيل الذكاء الاصطناعي",j7e="الإعدادات",K7e="قوموا بتوصيل نموذج ذكاء اصطناعي للبدء",Y7e=" لم يتم توصيل أي نموذج ذكاء اصطناعي بعد. قوموا بربط نموذج للبدء في التفاعل معه هنا مباشرة في الواجهة.",q7e="توصيل نموذج ذكاء اصطناعي",J7e="سجل المحادثة",X7e="لا يوجد سجل محادثة بعد...",Z7e="اختاروا كيفية توصيل الذكاء الاصطناعي",eze=" حددوا كيف تريدون تمكين ميزات الذكاء الاصطناعي فيONLYOFFICE.",tze="يمكنكم إما استخدام محفظة (Wallet) مدمجة لبداية سريعة أو توصيل نموذج الذكاء الاصطناعي الخاص بكم باستخدام مفتاح API أو نموذج مستضاف محلياً.",nze=" محفظةONLYOFFICE",ize=" قوموا بتعبئة رصيدكم ببطاقة واستخدموا جميع ميزات الذكاء الاصطناعي على الفور.",rze="مزود الذكاء الاصطناعي الخاص بكم",sze=" قوموا بتوصيل مصدر الذكاء الاصطناعي الخاص بكم — إما عبر مفتاحAPIمن مزود أو نموذج مستضاف محلياً.",oze="التسجيل وتوصيل المحفظة",aze="إضافة مزود",lze="الاتصال",cze="خوادم MCP",uze="مزود الذكاء الاصطناعي",dze="تحرير مزود الذكاء الاصطناعي",hze="المزود",fze="الاسم",pze="عنوان URL",gze="أدخلوا الاسم",mze="أدخلوا عنوان URL",Aze=" مفتاحAPI",yze=" أدخلوا مفتاحAPI",vze="إلغاء",bze="حفظ",wze="تحرير",Sze="حذف",Cze="تحذير",xze="هل أنتم متأكدون من أنكم تريدون حذف هذا المزود؟",Eze="هل أنتم متأكدون من أنكم تريدون حذف هذه المحادثة؟",_ze="نعم",Tze="لا",Rze="كيف يمكنني المساعدة؟",kze="دردشة ذكاء اصطناعي مجانية، ومساعد كتابة، ومولد أفكار",Ize="إعادة تسمية",Mze="تنزيل",Dze="بحث...",Pze="إضافة ملف محلي...",Nze="إضافة صورة محلية...",Oze="الملفات الحديثة",Bze="المرفقات",Lze="مفتاح API",Uze="محادثة جديدة",Vze="اسألوا الذكاء الاصطناعي",Fze="جارٍ التحليل...",Hze="يرغب الذكاء الاصطناعي في استخدام هذه الأداة: ",zze=`راجعوا كل إجراء بعناية قبل الموافقة -أو لا. لا يمكننا ضمان ممارسات الأمان أو الخصوصية لتكاملات الطرف الثالث.`,Qze="السماح دائماً لهذه الأداة بتنفيذ هذا الإجراء دون السؤال مرة أخرى",Gze="رفض",$ze="سماح",Wze="وسيطات استدعاء الأداة",jze="نتيجة استدعاء الأداة",Kze="تم تنفيذ الأداة",Yze="تأكيد",qze="تحديد النموذج",Jze=" يسمح لكم هذا القسم بتهيئة خوادمMCPللاستخدام داخل وكيل الذكاء الاصطناعي. يمكنكم تحرير التهيئة لإضافة خوادم MCP جديدة وتمكين الأدوات حسب الحاجة.",Xze="تحرير التهيئة",Zze=" أدخلوا تهيئةJSON الخاصة بكم:",eQe="الأدوات المتاحة",tQe="أدوات",nQe="أدوات مفعلة",iQe="تمكين جميع الأدوات",rQe="تعطيل جميع الأدوات",sQe="إعادة التشغيل",oQe="السجلات",aQe="نسخ إلى الحافظة",lQe="إغلاق",cQe="بحث الويب",uQe="قوموا بتوصيل محرك بحث ويب لتحسين محادثات الذكاء الاصطناعي بمعلومات آنية من الإنترنت.",dQe="إعادة تعيين الإعدادات",hQe="محرك بحث الويب",fQe="تحديد المحرك",pQe="جميع الأدوات",gQe="تمكين بحث الويب في الإعدادات",mQe="سيتم حذف هذا الخادم من قائمتكم. هل تودون المتابعة؟",AQe="المزود غير متاح",yQe="AI يمكن لدردشة الذكاء الاصطناعي أن ترتكب أخطاء. تحققوا من المعلومات المهمة.",vQe=" يجب وضع التهيئة داخل ملكية'mcpServers'",bQe="تفكير منطقي",wQe="تفكير موسع",SQe="يستخدم هذا النموذج تفكيراً منطقياً متقدماً، مما قد يزيد من التكاليف.",CQe={AIAgent:$7e,AIAgentSettings:W7e,Settings:j7e,ConnectAIModel:K7e,ConnectAIModelDescription:Y7e,ConnectAIModelBtn:q7e,ChatHistory:J7e,NoChatYet:X7e,ChooseHowConnect:Z7e,SelectHowConnect:eze,SelectHowConnectDescription:tze,ONLYOFFICEWallet:nze,ONLYOFFICEWalletDescription:ize,AIProviders:rze,AIProvidersDescription:sze,RegisterConnectWallet:oze,AddProvider:aze,Connection:lze,MCPServers:cze,AIProvider:uze,EditAIProvider:dze,Provider:hze,Name:fze,URL:pze,EnterName:gze,EnterURL:mze,Key:Aze,EnterKey:yze,Cancel:vze,Save:bze,Edit:wze,Delete:Sze,Warning:Cze,WantDeleteProvider:xze,WantDeleteChat:Eze,Yes:_ze,No:Tze,WelcomeTitle:Rze,WelcomeDescription:kze,Rename:Ize,Download:Mze,Search:Dze,AddLocalFile:Pze,AddLocalImage:Nze,RecentFiles:Oze,Attachments:Bze,APIKey:Lze,NewChat:Uze,AskAI:Vze,Analyzing:Fze,AIWouldLikeUseThisTool:Hze,ReviewEachAction:zze,AlwaysAllow:Qze,Deny:Gze,Allow:$ze,ToolCallArguments:Wze,ToolCallResult:jze,ToolExecuted:Kze,Confirmation:Yze,SelectModel:qze,CustomServersDescription:Jze,EditConfiguration:Xze,EnterYourJSONConfiguration:Zze,AvailableTools:eQe,Tools:tQe,ToolsEnabled:nQe,EnableAllTools:iQe,DisableAllTools:rQe,Restart:sQe,Logs:oQe,CopyToClipboard:aQe,Close:lQe,WebSearch:cQe,WebSearchDescription:uQe,ResetSettings:dQe,WebSearchEngine:hQe,SelectEngine:fQe,AllTools:pQe,EnableWebSearch:gQe,WantDeleteServer:mQe,NoModelsAvailable:AQe,CheckInfo:yQe,ConfigurationError:vQe,Thinking:bQe,ExtendedThinking:wQe,ExtendedThinkingDescription:SQe},xQe="Agent AI",EQe="Nastavení agenta AI",_Qe="Nastavení",TQe="Připojte model AI a začněte",RQe="Zatím není připojen žádný model AI. Propojte model a začněte s ním komunikovat přímo zde v rozhraní.",kQe="Připojit model AI",IQe="Historie chatu",MQe="Zatím neexistuje žádná historie chatu...",DQe="Vyberte způsob připojení AI",PQe="Vyberte, jak chcete povolit funkce AI v ONLYOFFICE.",NQe="Můžete buď použít vestavěnou peněženku pro rychlý start, nebo připojit svůj vlastní model AI pomocí klíče API nebo lokálně hostovaného modelu.",OQe="Peněženka ONLYOFFICE",BQe="Doplňte svůj zůstatek kartou a okamžitě používejte všechny funkce AI.",LQe="Váš poskytovatel AI",UQe="Připojte svůj vlastní zdroj AI – buď pomocí API klíče od poskytovatele, nebo lokálně hostovaného modelu.",VQe="Registrovat a připojit peněženku",FQe="Přidat poskytovatele",HQe="Připojení",zQe="Servery MCP",QQe="Poskytovatel AI",GQe="Upravit poskytovatele AI",$Qe="Poskytovatel",WQe="Název",jQe="URL",KQe="Zadat název",YQe="Zadat URL",qQe="API klíč",JQe="Zadat API klíč",XQe="Zrušit",ZQe="Uložit",eGe="Upravit",tGe="Odstranit",nGe="Varování",iGe="Opravdu chcete odstranit tohoto poskytovatele?",rGe="Opravdu chcete odstranit tento chat?",sGe="Ano",oGe="Ne",aGe="Jak vám mohu pomoci?",lGe="Bezplatný Al chat, pomocník při psaní a generátor nápadů",cGe="Přejmenovat",uGe="Stáhnout",dGe="Hledat...",hGe="Přidat místní soubor...",fGe="Přidat místní obrázek...",pGe="Poslední soubory",gGe="Přílohy",mGe="API klíč",AGe="Nový chat",yGe="Zeptejte se AI",vGe="Probíhá analýza...",bGe="Al by ráda použila tento nástroj:",wGe=`Před schválením pečlivě zkontrolujte každou akci. - Nemůžeme zaručit bezpečnost ani ochranu soukromí u integrací třetích stran.`,SGe="Vždy povolit tomuto nástroji provést tuto akci bez dalšího dotazu",CGe="Odmítnout",xGe="Povolit",EGe="Argumenty volání nástroje",_Ge="Výsledek volání nástroje",TGe="Nástroj proveden",RGe="Potvrzení",kGe="Vybrat model",IGe="V této části můžete nakonfigurovat servery MCP pro použití v rámci AI agenta. Konfiguraci můžete upravit tak, abyste přidali nové servery MCP a podle potřeby povolili nástroje.",MGe="Upravit konfiguraci",DGe="Zadejte svou konfiguraci JSON:",PGe="Dostupné nástroje",NGe="nástroje",OGe="povolené nástroje",BGe="Povolit všechny nástroje",LGe="Zakázat všechny nástroje",UGe="Restartovat",VGe="Protokoly",FGe="Kopírovat do schránky",HGe="Zavřít",zGe="Webové vyhledávání",QGe="Připojte webový vyhledávač a vylepšete AI chaty pomocí informací z internetu v reálném čase.",GGe="Obnovit nastavení",$Ge="Webový vyhledávač",WGe="Vybrat vyhledávač",jGe="Všechny nástroje",KGe="Povolit webové vyhledávání v nastavení",YGe="Tento server bude odstraněn z vašeho seznamu. Pokračovat?",qGe="Poskytovatel není k dispozici",JGe="AI chat může dělat chyby. Zkontrolujte důležité informace.",XGe="Konfigurace musí být umístěna uvnitř vlastnosti 'mcpServers'",ZGe="Uvažování",e$e="Rozšířené myšlení",t$e="Tento model používá pokročilé uvažování, což může zvýšit náklady.",n$e={AIAgent:xQe,AIAgentSettings:EQe,Settings:_Qe,ConnectAIModel:TQe,ConnectAIModelDescription:RQe,ConnectAIModelBtn:kQe,ChatHistory:IQe,NoChatYet:MQe,ChooseHowConnect:DQe,SelectHowConnect:PQe,SelectHowConnectDescription:NQe,ONLYOFFICEWallet:OQe,ONLYOFFICEWalletDescription:BQe,AIProviders:LQe,AIProvidersDescription:UQe,RegisterConnectWallet:VQe,AddProvider:FQe,Connection:HQe,MCPServers:zQe,AIProvider:QQe,EditAIProvider:GQe,Provider:$Qe,Name:WQe,URL:jQe,EnterName:KQe,EnterURL:YQe,Key:qQe,EnterKey:JQe,Cancel:XQe,Save:ZQe,Edit:eGe,Delete:tGe,Warning:nGe,WantDeleteProvider:iGe,WantDeleteChat:rGe,Yes:sGe,No:oGe,WelcomeTitle:aGe,WelcomeDescription:lGe,Rename:cGe,Download:uGe,Search:dGe,AddLocalFile:hGe,AddLocalImage:fGe,RecentFiles:pGe,Attachments:gGe,APIKey:mGe,NewChat:AGe,AskAI:yGe,Analyzing:vGe,AIWouldLikeUseThisTool:bGe,ReviewEachAction:wGe,AlwaysAllow:SGe,Deny:CGe,Allow:xGe,ToolCallArguments:EGe,ToolCallResult:_Ge,ToolExecuted:TGe,Confirmation:RGe,SelectModel:kGe,CustomServersDescription:IGe,EditConfiguration:MGe,EnterYourJSONConfiguration:DGe,AvailableTools:PGe,Tools:NGe,ToolsEnabled:OGe,EnableAllTools:BGe,DisableAllTools:LGe,Restart:UGe,Logs:VGe,CopyToClipboard:FGe,Close:HGe,WebSearch:zGe,WebSearchDescription:QGe,ResetSettings:GGe,WebSearchEngine:$Ge,SelectEngine:WGe,AllTools:jGe,EnableWebSearch:KGe,WantDeleteServer:YGe,NoModelsAvailable:qGe,CheckInfo:JGe,ConfigurationError:XGe,Thinking:ZGe,ExtendedThinking:e$e,ExtendedThinkingDescription:t$e},i$e="KI-Agent",r$e="Einstellungen des KI-Agenten",s$e="Einstellungen",o$e="Verbinden Sie ein KI-Modell, um loszulegen",a$e="Es ist noch kein KI-Modell verbunden. Verbinden Sie ein Modell, um direkt hier in der Benutzeroberfläche damit zu interagieren.",l$e="KI-Modell verbinden",c$e="Chatverlauf",u$e="Es gibt noch keinen Chatverlauf...",d$e="Wählen Sie aus, wie Sie die KI verbinden möchten",h$e="Wählen Sie aus, wie Sie die KI-Funktionen in ONLYOFFICE aktivieren möchten.",f$e="Sie können entweder die integrierte Wallet für einen schnellen Einstieg nutzen oder Ihr eigenes KI-Modell mithilfe eines API-Schlüssels oder eines lokal gehosteten Modells verbinden.",p$e="ONLYOFFICE Wallet",g$e="Laden Sie Ihr Guthaben mit einer Karte auf und nutzen Sie sofort alle KI-Funktionen.",m$e="Ihr KI-Anbieter",A$e="Verbinden Sie Ihre eigene KI-Quelle – entweder über einen API-Schlüssel eines Anbieters oder über ein lokal gehostetes Modell.",y$e="Registrieren und Wallet verbinden",v$e="Anbieter hinzufügen",b$e="Verbindung",w$e="MCP-Server",S$e="KI-Anbieter",C$e="KI-Anbieter bearbeiten",x$e="Anbieter",E$e="Name",_$e="URL",T$e="Name eingeben",R$e="URL eingeben",k$e="API-Schlüssel",I$e="API-Schlüssel eingeben",M$e="Abbrechen",D$e="Speichern",P$e="Bearbeiten",N$e="Löschen",O$e="Warnung",B$e="Möchten Sie diesen Anbieter wirklich löschen?",L$e="Möchten Sie diesen Chat wirklich löschen?",U$e="Ja",V$e="Nein",F$e="Wie kann ich helfen?",H$e="Kostenloser KI-Chat, Schreibassistent und Ideengenerator",z$e="Umbenennen",Q$e="Herunterladen",G$e="Suchen...",$$e="Lokale Datei hinzufügen...",W$e="Lokales Image hinzufügen...",j$e="Zuletzt verwendete Dateien",K$e="Anlagen",Y$e="API-Schlüssel",q$e="Neuer Chat",J$e="KI fragen",X$e="Analyse läuft...",Z$e="KI möchte dieses Tool verwenden:",eWe=`Prüfen Sie jede Aktion sorgfältig, bevor Sie sie genehmigen. - Wir können die Sicherheit und den Datenschutz bei Integrationen von Drittanbietern nicht garantieren.`,tWe="Diesem Tool immer erlauben, diese Aktion ohne erneute Nachfrage auszuführen.",nWe="Ablehnen",iWe="Erlauben",rWe="Argumente des Toolaufrufs",sWe="Ergebnis des Toolaufrufs",oWe="Tool ausgeführt",aWe="Bestätigung",lWe="Modell auswählen",cWe=" In diesem Abschnitt können Sie MCP-Server für die Verwendung im KI-Agenten konfigurieren. Sie können die Konfiguration bearbeiten, um neue MCP-Server hinzuzufügen und bei Bedarf Tools zu aktivieren.",uWe="Konfiguration bearbeiten",dWe="Geben Sie Ihre JSON-Konfiguration ein:",hWe="Verfügbare Tools",fWe="Tools",pWe="Tools aktiviert",gWe="Alle Tools aktivieren",mWe="Alle Tools deaktivieren",AWe="Neustart",yWe="Protokolle",vWe="In die Zwischenablage kopieren",bWe="Schließen",wWe="Websuche",SWe="Verbinden Sie eine Websuchmaschine, um KI-Chats mit Echtzeitinformationen aus dem Internet zu verbessern.",CWe="Einstellungen zurücksetzen",xWe="Web-Suchmaschine",EWe="Engine auswählen",_We="Alle Tools",TWe="Aktivieren Sie die Websuche in den Einstellungen",RWe="Dieser Server wird aus Ihrer Liste gelöscht. Weiter?",kWe="Anbieter nicht verfügbar",IWe="KI-Chat kann Fehler machen. Überprüfen Sie wichtige Informationen.",MWe="Die Konfiguration muss in der Eigenschaft 'mcpServers' platziert werden",DWe="Schlussfolgerung",PWe="Erweitertes Denken",NWe="Dieses Modell verwendet fortgeschrittene Schlussfolgerungen, was die Kosten erhöhen kann.",OWe={AIAgent:i$e,AIAgentSettings:r$e,Settings:s$e,ConnectAIModel:o$e,ConnectAIModelDescription:a$e,ConnectAIModelBtn:l$e,ChatHistory:c$e,NoChatYet:u$e,ChooseHowConnect:d$e,SelectHowConnect:h$e,SelectHowConnectDescription:f$e,ONLYOFFICEWallet:p$e,ONLYOFFICEWalletDescription:g$e,AIProviders:m$e,AIProvidersDescription:A$e,RegisterConnectWallet:y$e,AddProvider:v$e,Connection:b$e,MCPServers:w$e,AIProvider:S$e,EditAIProvider:C$e,Provider:x$e,Name:E$e,URL:_$e,EnterName:T$e,EnterURL:R$e,Key:k$e,EnterKey:I$e,Cancel:M$e,Save:D$e,Edit:P$e,Delete:N$e,Warning:O$e,WantDeleteProvider:B$e,WantDeleteChat:L$e,Yes:U$e,No:V$e,WelcomeTitle:F$e,WelcomeDescription:H$e,Rename:z$e,Download:Q$e,Search:G$e,AddLocalFile:$$e,AddLocalImage:W$e,RecentFiles:j$e,Attachments:K$e,APIKey:Y$e,NewChat:q$e,AskAI:J$e,Analyzing:X$e,AIWouldLikeUseThisTool:Z$e,ReviewEachAction:eWe,AlwaysAllow:tWe,Deny:nWe,Allow:iWe,ToolCallArguments:rWe,ToolCallResult:sWe,ToolExecuted:oWe,Confirmation:aWe,SelectModel:lWe,CustomServersDescription:cWe,EditConfiguration:uWe,EnterYourJSONConfiguration:dWe,AvailableTools:hWe,Tools:fWe,ToolsEnabled:pWe,EnableAllTools:gWe,DisableAllTools:mWe,Restart:AWe,Logs:yWe,CopyToClipboard:vWe,Close:bWe,WebSearch:wWe,WebSearchDescription:SWe,ResetSettings:CWe,WebSearchEngine:xWe,SelectEngine:EWe,AllTools:_We,EnableWebSearch:TWe,WantDeleteServer:RWe,NoModelsAvailable:kWe,CheckInfo:IWe,ConfigurationError:MWe,Thinking:DWe,ExtendedThinking:PWe,ExtendedThinkingDescription:NWe},BWe="AI agent",LWe="AI agent Settings",UWe="Settings",VWe="Connect an AI Model to Get Started",FWe="No AI model is connected yet. Link a model to start interacting with it right here in the interface.",HWe="Connect an AI Model",zWe="Chat history",QWe="There is no chat history yet...",GWe="Choose how to connect AI",$We="Select how you want to enable AI features in ONLYOFFICE.",WWe="You can either use the built-in Wallet for a quick start or connect your own AI model using an API key or a locally hosted model.",jWe="ONLYOFFICE Wallet",KWe="Top up your balance with a card and instantly use all AI features.",YWe="Your AI provider",qWe="Connect your own AI source — either via API key from a provider or a locally hosted model.",JWe="Register & Connect Wallet",XWe="Add provider",ZWe="Connection",eje="MCP Servers",tje="AI Provider",nje="Edit AI Provider",ije="Provider",rje="Name",sje="URL",oje="Enter name",aje="Enter URL",lje="API key",cje="Enter API key",uje="Cancel",dje="Save",hje="Edit",fje="Delete",pje="Warning",gje="Are you sure you want to delete this provider?",mje="Are you sure you want to delete this chat?",Aje="Yes",yje="No",vje="How can I help?",bje="Free Al chat, writing assistant & idea generator",wje="Rename",Sje="Download",Cje="Search...",xje="Add local file...",Eje="Add local image...",_je="Recent files",Tje="Attachments",Rje="API key",kje="New chat",Ije="Ask AI",Mje="Analyzing...",Dje="Al would like to use this tool:",Pje=`Review each action carefully before approving. - We cannot guarantee the security or privacy practices of third-party integrations.`,Nje="Always allow this tool to perform this action without asking again",Oje="Deny",Bje="Allow",Lje="Tool call arguments",Uje="Tool call result",Vje="Tool executed",Fje="Confirmation",Hje="Select model",zje="This section allows you to configure MCP servers for use within the AI agent. You can edit the configuration to add new MCP servers and enable tools as needed.",Qje="Edit configuration",Gje="Enter your JSON configuration:",$je="Available tools",Wje="tools",jje="tools enabled",Kje="Enable all tools",Yje="Disable all tools",qje="Restart",Jje="Logs",Xje="Copy to clipboard",Zje="Close",eKe="Web Search",tKe="Connect a web search engine to enhance AI chats with real-time information from the internet.",nKe="Reset settings",iKe="Web Search Engine",rKe="Select engine",sKe="All tools",oKe="Enable web search in settings",aKe="This server will be deleted from your list. Continue?",lKe="Provider not available",cKe="AI Chat can make mistakes. Check important info.",uKe="Configuration must be placed inside 'mcpServers' property",dKe="Reasoning",hKe="Extended Thinking",fKe="This model uses advanced reasoning, which may increase costs.",pKe={AIAgent:BWe,AIAgentSettings:LWe,Settings:UWe,ConnectAIModel:VWe,ConnectAIModelDescription:FWe,ConnectAIModelBtn:HWe,ChatHistory:zWe,NoChatYet:QWe,ChooseHowConnect:GWe,SelectHowConnect:$We,SelectHowConnectDescription:WWe,ONLYOFFICEWallet:jWe,ONLYOFFICEWalletDescription:KWe,AIProviders:YWe,AIProvidersDescription:qWe,RegisterConnectWallet:JWe,AddProvider:XWe,Connection:ZWe,MCPServers:eje,AIProvider:tje,EditAIProvider:nje,Provider:ije,Name:rje,URL:sje,EnterName:oje,EnterURL:aje,Key:lje,EnterKey:cje,Cancel:uje,Save:dje,Edit:hje,Delete:fje,Warning:pje,WantDeleteProvider:gje,WantDeleteChat:mje,Yes:Aje,No:yje,WelcomeTitle:vje,WelcomeDescription:bje,Rename:wje,Download:Sje,Search:Cje,AddLocalFile:xje,AddLocalImage:Eje,RecentFiles:_je,Attachments:Tje,APIKey:Rje,NewChat:kje,AskAI:Ije,Analyzing:Mje,AIWouldLikeUseThisTool:Dje,ReviewEachAction:Pje,AlwaysAllow:Nje,Deny:Oje,Allow:Bje,ToolCallArguments:Lje,ToolCallResult:Uje,ToolExecuted:Vje,Confirmation:Fje,SelectModel:Hje,CustomServersDescription:zje,EditConfiguration:Qje,EnterYourJSONConfiguration:Gje,AvailableTools:$je,Tools:Wje,ToolsEnabled:jje,EnableAllTools:Kje,DisableAllTools:Yje,Restart:qje,Logs:Jje,CopyToClipboard:Xje,Close:Zje,WebSearch:eKe,WebSearchDescription:tKe,ResetSettings:nKe,WebSearchEngine:iKe,SelectEngine:rKe,AllTools:sKe,EnableWebSearch:oKe,WantDeleteServer:aKe,NoModelsAvailable:lKe,CheckInfo:cKe,ConfigurationError:uKe,Thinking:dKe,ExtendedThinking:hKe,ExtendedThinkingDescription:fKe},gKe="Agente de IA",mKe="Configuración del agente de IA",AKe="Configuración",yKe="Conecte un modelo de IA para empezar",vKe="Aún no hay ningún modelo de IA conectado. Conecte un modelo para empezar a interactuar con él aquí mismo, en la interfaz.",bKe="Conectar un modelo de IA",wKe="Historial del chat",SKe="Todavía no hay historial de chat...",CKe="Elija cómo conectar la IA",xKe="Seleccione cómo desea activar las funciones de IA en ONLYOFFICE.",EKe="Puedes utilizar el Monedero incorporado para empezar rápidamente o conectar tu propio modelo de IA utilizando una clave de la API o un modelo alojado localmente.",_Ke="Monedero de ONLYOFFICE",TKe="Recargue su saldo con una tarjeta y utilice al instante todas las funciones de IA.",RKe="Su proveedor de IA",kKe="Conecte su propia fuente de IA, ya sea mediante una clave de la API de un proveedor o un modelo alojado localmente.",IKe="Regístrese y conecte su monedero",MKe="Añadir proveedor",DKe="Conexión",PKe="Servidores MCP",NKe="Proveedor de IA",OKe="Editar proveedor de IA",BKe="Proveedor",LKe="Nombre",UKe="URL",VKe="Introduzca el nombre",FKe="Introduzca la URL",HKe="Clave de la API",zKe="Introduzca la clave de la API",QKe="Cancelar",GKe="Guardar",$Ke="Editar",WKe="Eliminar",jKe="Advertencia",KKe="¿Está seguro de que desea eliminar este proveedor?",YKe="¿Está seguro de que desea eliminar este chat?",qKe="Sí",JKe="No",XKe="¿En qué puedo ayudarle?",ZKe="Chat gratuito, asistente de escritura y generador de ideas",eYe="Renombrar",tYe="Descargar",nYe="Búsqueda...",iYe="Añadir archivo local...",rYe="Añadir imagen local...",sYe="Archivos recientes",oYe="Archivos adjuntos",aYe="Clave de la API",lYe="Nuevo chat",cYe="Preguntarle a la IA",uYe="Analizando...",dYe="A la IA le gustaría utilizar esta herramienta:",hYe=`Revise cada acción cuidadosamente antes de aprobarla. - No podemos garantizar la seguridad o las prácticas de privacidad de las integraciones de terceros.`,fYe="Siempre permitir que esta herramienta realice esta acción sin preguntar de nuevo",pYe="Denegar",gYe="Permitir",mYe="Argumentos de la llamada a la herramienta",AYe="Resultado de la llamada a la herramienta",yYe="Herramienta ejecutada",vYe="Confirmación",bYe="Seleccionar modelo",wYe="Esta sección le permite configurar servidores MCP para su uso en el agente de IA. Puede editar la configuración para añadir nuevos servidores MCP y habilitar herramientas según sea necesario.",SYe="Editar configuración",CYe="Introduzca su configuración JSON:",xYe="Herramientas disponibles",EYe="herramientas",_Ye="herramientas habilitadas",TYe="Habilitar todas las herramientas",RYe="Deshabilitar todas las herramientas",kYe="Reiniciar",IYe="Registros",MYe="Copiar al portapapeles",DYe="Cerrar",PYe="Búsqueda en la Web",NYe="Conecte un motor de búsqueda web para mejorar los chats de IA con información en tiempo real procedente de Internet.",OYe="Restablecer configuración",BYe="Motor de búsqueda web",LYe="Seleccionar motor",UYe="Todas las herramientas",VYe="Habilite la búsqueda web en la configuración",FYe="Este servidor se eliminará de su lista. ¿Continuar?",HYe="Proveedor no disponible",zYe="El Chat de IA puede cometer errores. Compruebe la información importante.",QYe="La configuración debe colocarse dentro de la propiedad «mcpServers»",GYe="Razonamiento",$Ye="Pensamiento extendido",WYe="Este modelo utiliza un razonamiento avanzado, lo que puede aumentar los costes.",jYe={AIAgent:gKe,AIAgentSettings:mKe,Settings:AKe,ConnectAIModel:yKe,ConnectAIModelDescription:vKe,ConnectAIModelBtn:bKe,ChatHistory:wKe,NoChatYet:SKe,ChooseHowConnect:CKe,SelectHowConnect:xKe,SelectHowConnectDescription:EKe,ONLYOFFICEWallet:_Ke,ONLYOFFICEWalletDescription:TKe,AIProviders:RKe,AIProvidersDescription:kKe,RegisterConnectWallet:IKe,AddProvider:MKe,Connection:DKe,MCPServers:PKe,AIProvider:NKe,EditAIProvider:OKe,Provider:BKe,Name:LKe,URL:UKe,EnterName:VKe,EnterURL:FKe,Key:HKe,EnterKey:zKe,Cancel:QKe,Save:GKe,Edit:$Ke,Delete:WKe,Warning:jKe,WantDeleteProvider:KKe,WantDeleteChat:YKe,Yes:qKe,No:JKe,WelcomeTitle:XKe,WelcomeDescription:ZKe,Rename:eYe,Download:tYe,Search:nYe,AddLocalFile:iYe,AddLocalImage:rYe,RecentFiles:sYe,Attachments:oYe,APIKey:aYe,NewChat:lYe,AskAI:cYe,Analyzing:uYe,AIWouldLikeUseThisTool:dYe,ReviewEachAction:hYe,AlwaysAllow:fYe,Deny:pYe,Allow:gYe,ToolCallArguments:mYe,ToolCallResult:AYe,ToolExecuted:yYe,Confirmation:vYe,SelectModel:bYe,CustomServersDescription:wYe,EditConfiguration:SYe,EnterYourJSONConfiguration:CYe,AvailableTools:xYe,Tools:EYe,ToolsEnabled:_Ye,EnableAllTools:TYe,DisableAllTools:RYe,Restart:kYe,Logs:IYe,CopyToClipboard:MYe,Close:DYe,WebSearch:PYe,WebSearchDescription:NYe,ResetSettings:OYe,WebSearchEngine:BYe,SelectEngine:LYe,AllTools:UYe,EnableWebSearch:VYe,WantDeleteServer:FYe,NoModelsAvailable:HYe,CheckInfo:zYe,ConfigurationError:QYe,Thinking:GYe,ExtendedThinking:$Ye,ExtendedThinkingDescription:WYe},KYe="Agent IA",YYe="Paramètres de l'agent IA",qYe="Paramètres",JYe="Connectez un modèle d'IA pour commencer",XYe="Aucun modèle d'IA n'est encore connecté. Associez un modèle pour commencer à interagir avec lui directement dans l'interface.",ZYe="Connecter un modèle d'IA",eqe="Historique de chat",tqe="Il n'y a pas encore d'historique de chat...",nqe="Choisissez comment connecter l'IA",iqe="Sélectionnez comment vous souhaitez activer les fonctionnalités IA dans ONLYOFFICE.",rqe="Vous pouvez soit utiliser le Wallet intégré pour démarrer rapidement, soit connecter votre propre modèle d'IA à l'aide d'une clé API ou d'un modèle hébergé localement.",sqe="Wallet ONLYOFFICE",oqe="Rechargez votre solde avec une carte et utilisez instantanément toutes les fonctionnalités de l'IA.",aqe="Votre fournisseur d'IA",lqe="Connectez votre propre source d'IA, soit via une clé API fournie par un fournisseur, soit via un modèle hébergé localement.",cqe="Enregistrez et connectez votre Wallet",uqe="Ajouter un fournisseur",dqe="Connexion",hqe="Serveurs MCP",fqe="Fournisseur d'IA",pqe="Modifier le fournisseur d'IA",gqe="Fournisseur",mqe="Nom",Aqe="URL",yqe="Saisissez le nom",vqe="Saisissez l'URL",bqe="Clé API",wqe="Saisissez la clé API",Sqe="Annuler",Cqe="Enregistrer",xqe="Modifier",Eqe="Supprimer",_qe="Avertissement",Tqe="Souhaitez-vous vraiment supprimer ce fournisseur ?",Rqe="Souhaitez-vous vraiment supprimer ce chat ?",kqe="Oui",Iqe="Non",Mqe="Comment puis-je vous aider ?",Dqe="Chat Al gratuit, assistant de rédaction et générateur d'idées",Pqe="Renommer",Nqe="Télécharger",Oqe="Recherche...",Bqe="Ajouter un fichier local...",Lqe="Ajouter une image locale...",Uqe="Fichiers récents",Vqe="Pièces jointes",Fqe="Clé API",Hqe="Nouveau chat",zqe="Demander à l'IA",Qqe="Analyse en cours...",Gqe="lA aimerait utiliser cet outil :",$qe=`Examinez attentivement chaque action avant de l'approuver. - Nous ne pouvons garantir la sécurité ou les pratiques de confidentialité des intégrations tierces.`,Wqe="Toujours autoriser cet outil à effectuer cette action sans demander à nouveau",jqe="Refuser",Kqe="Autoriser",Yqe="Arguments d'appel d'outil",qqe="Résultat de l'appel de l'outil",Jqe="Outil exécuté",Xqe="Confirmation",Zqe="Sélectionner le modèle",eJe=" Cette section vous permet de configurer les serveurs MCP à utiliser dans l'agent IA. Vous pouvez modifier la configuration pour ajouter de nouveaux serveurs MCP et activer les outils selon vos besoins.",tJe="Modifier la configuration",nJe="Entrez votre configuration JSON :",iJe="Outils disponibles",rJe="outils",sJe="outils activés",oJe="Activer tous les outils",aJe="Désactiver tous les outils",lJe="Redémarrer",cJe="Logs",uJe="Copier dans le presse-papiers",dJe="Fermer",hJe="Recherche sur le Web",fJe="Connectez un moteur de recherche Web pour améliorer les conversations IA grâce à des informations en temps réel provenant d'Internet.",pJe="Réinitialiser les paramètres",gJe="Moteur de recherche Web",mJe="Sélectionner le moteur",AJe="Tous les outils",yJe="Activer la recherche Web dans les paramètres",vJe="Ce serveur sera supprimé de votre liste. Continuer ?",bJe="Fournisseur indisponible",wJe="Le chatbot IA peut faire des erreurs. Vérifiez les informations importantes.",SJe="La configuration doit être placée dans la propriété « mcpServers »",CJe="Raisonnement",xJe="Raisonnement étendu",EJe="Ce modèle utilise un raisonnement avancé, ce qui peut augmenter les coûts.",_Je={AIAgent:KYe,AIAgentSettings:YYe,Settings:qYe,ConnectAIModel:JYe,ConnectAIModelDescription:XYe,ConnectAIModelBtn:ZYe,ChatHistory:eqe,NoChatYet:tqe,ChooseHowConnect:nqe,SelectHowConnect:iqe,SelectHowConnectDescription:rqe,ONLYOFFICEWallet:sqe,ONLYOFFICEWalletDescription:oqe,AIProviders:aqe,AIProvidersDescription:lqe,RegisterConnectWallet:cqe,AddProvider:uqe,Connection:dqe,MCPServers:hqe,AIProvider:fqe,EditAIProvider:pqe,Provider:gqe,Name:mqe,URL:Aqe,EnterName:yqe,EnterURL:vqe,Key:bqe,EnterKey:wqe,Cancel:Sqe,Save:Cqe,Edit:xqe,Delete:Eqe,Warning:_qe,WantDeleteProvider:Tqe,WantDeleteChat:Rqe,Yes:kqe,No:Iqe,WelcomeTitle:Mqe,WelcomeDescription:Dqe,Rename:Pqe,Download:Nqe,Search:Oqe,AddLocalFile:Bqe,AddLocalImage:Lqe,RecentFiles:Uqe,Attachments:Vqe,APIKey:Fqe,NewChat:Hqe,AskAI:zqe,Analyzing:Qqe,AIWouldLikeUseThisTool:Gqe,ReviewEachAction:$qe,AlwaysAllow:Wqe,Deny:jqe,Allow:Kqe,ToolCallArguments:Yqe,ToolCallResult:qqe,ToolExecuted:Jqe,Confirmation:Xqe,SelectModel:Zqe,CustomServersDescription:eJe,EditConfiguration:tJe,EnterYourJSONConfiguration:nJe,AvailableTools:iJe,Tools:rJe,ToolsEnabled:sJe,EnableAllTools:oJe,DisableAllTools:aJe,Restart:lJe,Logs:cJe,CopyToClipboard:uJe,Close:dJe,WebSearch:hJe,WebSearchDescription:fJe,ResetSettings:pJe,WebSearchEngine:gJe,SelectEngine:mJe,AllTools:AJe,EnableWebSearch:yJe,WantDeleteServer:vJe,NoModelsAvailable:bJe,CheckInfo:wJe,ConfigurationError:SJe,Thinking:CJe,ExtendedThinking:xJe,ExtendedThinkingDescription:EJe},TJe="Agente AI",RJe="Impostazioni agente AI",kJe="Impostazioni",IJe="Collega un modello AI per iniziare",MJe="Nessun modello AI è stato collegato. Collega un modello per iniziare a interagire direttamente da questa interfaccia.",DJe="Collega un modello AI",PJe="Cronologia chat",NJe="Non c'è ancora alcuna cronologia chat...",OJe="Scegli come collegare l'AI",BJe="Scegli come desideri abilitare le funzionalità AI in ONLYOFFICE.",LJe="Puoi usare il Wallet integrato per iniziare subito oppure collegare il tuo modello AI tramite una chiave API o un modello ospitato localmente.",UJe="Wallet ONLYOFFICE",VJe="Ricarica il saldo con una carta e usa subito tutte le funzioni AI.",FJe="Il tuo provider AI",HJe="Collega la tua fonte AI tramite chiave API di un provider o modello ospitato localmente.",zJe="Registrati e collega il Wallet",QJe="Aggiungi provider",GJe="Connessione",$Je="Server MCP",WJe="Provider AI",jJe="Modifica provider AI",KJe="Provider",YJe="Nome",qJe="URL",JJe="Inserisci nome",XJe="Inserisci URL",ZJe="Chiave API",eXe="Inserisci chiave API",tXe="Annulla",nXe="Salva",iXe="Modifica",rXe="Elimina",sXe="Avviso",oXe="Vuoi davvero eliminare questo provider?",aXe="Vuoi davvero eliminare questa chat?",lXe="Sì",cXe="No",uXe="Come posso aiutarti?",dXe="Chat AI gratuita, assistente di scrittura e generatore di idee",hXe="Rinomina",fXe="Scarica",pXe="Cerca...",gXe="Aggiungi file locale...",mXe="Aggiungi immagine locale...",AXe="File recenti",yXe="Allegati",vXe="Chiave API",bXe="Nuova chat",wXe="Chiedi all'AI",SXe="Analisi in corso...",CXe="L'AI vorrebbe usare questo strumento:",xXe=`Controlla attentamente ogni azione prima di approvarla. - Non possiamo garantire la sicurezza o le pratiche sulla privacy delle integrazioni di terze parti.`,EXe="Consenti sempre a questo strumento di eseguire questa azione senza chiedere di nuovo",_Xe="Nega",TXe="Consenti",RXe="Argomenti della chiamata dello strumento",kXe="Risultato della chiamata dello strumento",IXe="Strumento eseguito",MXe="Conferma",DXe="Seleziona modello",PXe="Questa sezione consente di configurare i server MCP da usare con l'agente AI. Puoi modificare la configurazione per aggiungere nuovi server MCP e abilitare gli strumenti necessari.",NXe="Modifica configurazione",OXe="Inserisci la tua configurazione JSON:",BXe="Strumenti disponibili",LXe="strumenti",UXe="strumenti abilitati",VXe="Abilita tutti gli strumenti",FXe="Disabilita tutti gli strumenti",HXe="Riavvia",zXe="Log",QXe="Copia negli appunti",GXe="Chiudi",$Xe="Ricerca web",WXe="Collega un motore di ricerca web per arricchire le chat AI con informazioni aggiornate da Internet.",jXe="Reimposta impostazioni",KXe="Motore di ricerca web",YXe="Seleziona motore",qXe="Tutti gli strumenti",JXe="Abilita la ricerca web nelle impostazioni",XXe="Questo server verrà rimosso dall'elenco. Continuare?",ZXe="Provider non disponibile",eZe="L'AI può commettere errori. Verifica le informazioni importanti.",tZe="La configurazione deve essere inserita all'interno della proprietà 'mcpServers'",nZe="Ragionamento",iZe="Ragionamento esteso",rZe="Questo modello utilizza un ragionamento avanzato che potrebbe aumentare i costi.",sZe={AIAgent:TJe,AIAgentSettings:RJe,Settings:kJe,ConnectAIModel:IJe,ConnectAIModelDescription:MJe,ConnectAIModelBtn:DJe,ChatHistory:PJe,NoChatYet:NJe,ChooseHowConnect:OJe,SelectHowConnect:BJe,SelectHowConnectDescription:LJe,ONLYOFFICEWallet:UJe,ONLYOFFICEWalletDescription:VJe,AIProviders:FJe,AIProvidersDescription:HJe,RegisterConnectWallet:zJe,AddProvider:QJe,Connection:GJe,MCPServers:$Je,AIProvider:WJe,EditAIProvider:jJe,Provider:KJe,Name:YJe,URL:qJe,EnterName:JJe,EnterURL:XJe,Key:ZJe,EnterKey:eXe,Cancel:tXe,Save:nXe,Edit:iXe,Delete:rXe,Warning:sXe,WantDeleteProvider:oXe,WantDeleteChat:aXe,Yes:lXe,No:cXe,WelcomeTitle:uXe,WelcomeDescription:dXe,Rename:hXe,Download:fXe,Search:pXe,AddLocalFile:gXe,AddLocalImage:mXe,RecentFiles:AXe,Attachments:yXe,APIKey:vXe,NewChat:bXe,AskAI:wXe,Analyzing:SXe,AIWouldLikeUseThisTool:CXe,ReviewEachAction:xXe,AlwaysAllow:EXe,Deny:_Xe,Allow:TXe,ToolCallArguments:RXe,ToolCallResult:kXe,ToolExecuted:IXe,Confirmation:MXe,SelectModel:DXe,CustomServersDescription:PXe,EditConfiguration:NXe,EnterYourJSONConfiguration:OXe,AvailableTools:BXe,Tools:LXe,ToolsEnabled:UXe,EnableAllTools:VXe,DisableAllTools:FXe,Restart:HXe,Logs:zXe,CopyToClipboard:QXe,Close:GXe,WebSearch:$Xe,WebSearchDescription:WXe,ResetSettings:jXe,WebSearchEngine:KXe,SelectEngine:YXe,AllTools:qXe,EnableWebSearch:JXe,WantDeleteServer:XXe,NoModelsAvailable:ZXe,CheckInfo:eZe,ConfigurationError:tZe,Thinking:nZe,ExtendedThinking:iZe,ExtendedThinkingDescription:rZe},oZe="AIエージェント",aZe="AIエージェントの設定",lZe="設定",cZe="AIモデルを接続して始める",uZe="AIモデルがまだ接続されていません。モデルを接続して、このインターフェースでチャットを開始してください。",dZe="AIモデルを接続",hZe="チャット履歴",fZe="チャット履歴はまだありません...",pZe="AIの接続方法を選択",gZe="ONLYOFFICEでAI機能を有効にする方法を選択してください。",mZe="クイックスタート用の組み込みウォレットを使用するか、APIキーまたはローカルホストモデルを使用して独自のAIモデルを接続できます。",AZe="ONLYOFFICEウォレット",yZe="カードで残高をチャージして、すべてのAI機能を即座に使用できます。",vZe="お使いのAIプロバイダー",bZe="独自のAIソースを接続:プロバイダーのAPIキーまたはローカルホストモデル経由。",wZe="登録してウォレットを接続",SZe="プロバイダーを追加",CZe="接続",xZe="MCPサーバー",EZe="AIプロバイダー",_Ze=" AIプロバイダーを編集",TZe="プロバイダー",RZe="名前",kZe="URL",IZe="名前を入力",MZe="URLを入力",DZe="APIキー",PZe="APIキーを入力",NZe="キャンセル",OZe="保存",BZe="編集",LZe="削除",UZe="警告",VZe="このプロバイダーを削除してもよろしいですか?",FZe="このチャットを削除してもよろしいですか?",HZe="はい",zZe="いいえ",QZe="どのようにお手伝いしましょうか?",GZe="無料のAIチャット、ライティングアシスタント、アイデアジェネレーター",$Ze="名前を変更",WZe="ダウンロード",jZe="検索...",KZe="ローカルファイルを追加...",YZe="ローカル画像を追加...",qZe="最近使用したファイル",JZe="添付ファイル",XZe="APIキー",ZZe="新規チャット",eet="AIに聞く",tet="分析中...",net=" AIがこのツールを使用したいと要求しています:",iet=`承認する前に各アクションを慎重にご確認ください。 -サードパーティ統合のセキュリティやプライバシー慣行を保証することはできません。`,ret="このツールが再度確認することなくこのアクションを実行することを常に許可する",set="拒否",oet="許可",aet="ツール呼び出し引数",cet="ツール呼び出し結果",uet="ツール実行完了",det="確認",het="モデルを選択",fet="このセクションでは、AIエージェント内で使用するMCPサーバーを設定できます。設定を編集して新しいMCPサーバーを追加し、必要に応じてツールを有効にできます。",pet="設定を編集",get=" JSON設定を入力してください:",met="利用可能なツール",Aet="ツール",yet="ツールが有効",vet="すべてのツールを有効にする",bet="すべてのツールを無効にする",wet="再起動",Cet="ログ",xet="クリップボードにコピー",Eet="閉じる",_et="Web検索",Tet=" Web検索エンジンを接続して、インターネットからのリアルタイム情報でAIチャットを強化します。",Ret="設定をリセット",ket=" Web検索エンジン",Iet="エンジンを選択",Met="すべてのツール",Det="設定でWeb検索を有効にする",Pet="このサーバーはリストから削除されます。続行しますか?",Net="プロバイダーが利用できません",Oet=" AIチャットは間違いを犯す可能性があります。重要な情報を確認してください。",Bet="設定は'mcpServers'プロパティ内に配置する必要があります",Let="推論中",Uet="拡張思考",Vet="このモデルは高度な推論を使用するため、コストが増加する可能性があります。",Fet={AIAgent:oZe,AIAgentSettings:aZe,Settings:lZe,ConnectAIModel:cZe,ConnectAIModelDescription:uZe,ConnectAIModelBtn:dZe,ChatHistory:hZe,NoChatYet:fZe,ChooseHowConnect:pZe,SelectHowConnect:gZe,SelectHowConnectDescription:mZe,ONLYOFFICEWallet:AZe,ONLYOFFICEWalletDescription:yZe,AIProviders:vZe,AIProvidersDescription:bZe,RegisterConnectWallet:wZe,AddProvider:SZe,Connection:CZe,MCPServers:xZe,AIProvider:EZe,EditAIProvider:_Ze,Provider:TZe,Name:RZe,URL:kZe,EnterName:IZe,EnterURL:MZe,Key:DZe,EnterKey:PZe,Cancel:NZe,Save:OZe,Edit:BZe,Delete:LZe,Warning:UZe,WantDeleteProvider:VZe,WantDeleteChat:FZe,Yes:HZe,No:zZe,WelcomeTitle:QZe,WelcomeDescription:GZe,Rename:$Ze,Download:WZe,Search:jZe,AddLocalFile:KZe,AddLocalImage:YZe,RecentFiles:qZe,Attachments:JZe,APIKey:XZe,NewChat:ZZe,AskAI:eet,Analyzing:tet,AIWouldLikeUseThisTool:net,ReviewEachAction:iet,AlwaysAllow:ret,Deny:set,Allow:oet,ToolCallArguments:aet,ToolCallResult:cet,ToolExecuted:uet,Confirmation:det,SelectModel:het,CustomServersDescription:fet,EditConfiguration:pet,EnterYourJSONConfiguration:get,AvailableTools:met,Tools:Aet,ToolsEnabled:yet,EnableAllTools:vet,DisableAllTools:bet,Restart:wet,Logs:Cet,CopyToClipboard:xet,Close:Eet,WebSearch:_et,WebSearchDescription:Tet,ResetSettings:Ret,WebSearchEngine:ket,SelectEngine:Iet,AllTools:Met,EnableWebSearch:Det,WantDeleteServer:Pet,NoModelsAvailable:Net,CheckInfo:Oet,ConfigurationError:Bet,Thinking:Let,ExtendedThinking:Uet,ExtendedThinkingDescription:Vet},Het="Asystent AI",zet="Ustawienia asystenta AI",Qet="Ustawienia",Get="Podłącz model AI, aby rozpocząć",$et="Nie podłączono jeszcze żadnego modelu AI. Podłącz model, aby rozpocząć interakcje z nim bezpośrednio w interfejsie.",Wet="Podłącz model AI",jet="Historia czatów",Ket="Nie ma jeszcze historii czatów...",Yet="Wybierz, jak podłączyć AI",qet="Wybierz, jak chcesz włączyć funkcje AI w ONLYOFFICE.",Jet="Użyj wbudowanego Portfela, aby szybko rozpocząć pracę bądź skonfiguruj własny model AI za pomocą klucza API lub lokalnie hostowanego modelu.",Xet="Portfel ONLYOFFICE",Zet="Zasil saldo kartą, aby uzyskać natychmiastowy dostęp do wszystkich funkcji AI.",ett="Twój dostawca AI",ttt="Skonfiguruj własne źródło AI za pomocą klucza API od usługodawcy lub łącząc się z lokalnie hostowanym modelem.",ntt="Zarejestruj się i Podłącz Portfel",itt="Dodaj dostawcę",rtt="Połączenie",stt="Serwery MCP",ott="Dostawca AI",att="Edytuj dostawcę AI",ltt="Dostawca",ctt="Nazwa",utt="URL",dtt="Wpisz nazwę",htt="Wpisz adres URL",ftt="Klucz API",ptt="Wpisz klucz API",gtt="Anuluj",mtt="Zapisz",Att="Edytuj",ytt="Usuń",vtt="Uwaga",btt="Czy na pewno chcesz usunąć tego dostawcę?",wtt="Czy na pewno chcesz usunąć ten czat?",Stt="Tak",Ctt="Nie",xtt="Jak mogę pomóc?",Ett="Darmowy czat AI, asystent pisania i generator pomysłów",_tt="Zmień nazwę",Ttt="Pobierz",Rtt="Wyszukaj...",ktt="Dodaj plik lokalny...",Itt="Dodaj obraz lokalny...",Mtt="Ostatnie pliki",Dtt="Załączniki",Ptt="Klucz API",Ntt="Nowy czat",Ott="Zapytaj AI",Btt="Analizowanie...",Ltt="AI chce skorzystać z tego narzędzia:",Utt=`Sprawdź każde działanie przed zatwierdzeniem. - Nie gwarantujemy bezpieczeństwa ani prywatności w integracjach z podmiotami trzecimi.`,Vtt="Zawsze zezwalaj narzędziu na to działanie bez ponownego pytania",Ftt="Odmów",Htt="Zezwól",ztt="Parametry wywołania narzędzia",Qtt="Rezultat wywołania narzędzia",Gtt="Działanie narzędzia zakończone",$tt="Potwierdzenie",Wtt="Wybierz model",jtt="Dana sekcja umożliwia konfigurację serwerów MCP dla asystenta AI. Możesz edytować konfigurację, dodając nowe serwery MCP i włączając potrzebne narzędzia.",Ktt="Edytuj konfigurację",Ytt="Wpisz swoją konfigurację JSON:",qtt="Dostępne narzędzia",Jtt="narzędzia",Xtt="włączone narzędzia",Ztt="Włącz wszystkie narzędzia",ent="Wyłącz wszystkie narzędzia",tnt="Uruchom ponownie",nnt="Logi",int="Skopiuj do schowka",rnt="Zamknij",snt="Wyszukiwanie w internecie",ont="Podłącz wyszukiwarkę, aby wzbogacić czat AI o najnowsze informacje z internetu.",ant="Resetuj ustawienia",lnt="Wyszukiwarka internetowa",cnt="Wybierz wyszukiwarkę",unt="Wszystkie narzędzia",dnt="Włącz wyszukiwanie w internecie w ustawieniach",hnt="Serwer zostanie usunięty z Twojej listy. Kontynuować?",fnt="Dostawca jest niedostępny",pnt="Czat AI może popełniać błędy. Sprawdź ważne informacje.",gnt="Konfiguracja musi być umieszczona w właściwości 'mcpServers'",mnt="Rozumowanie",Ant="Rozszerzone myślenie",ynt="Ten model wykorzystuje zaawansowane rozumowanie, co może zwiększyć koszty.",vnt={AIAgent:Het,AIAgentSettings:zet,Settings:Qet,ConnectAIModel:Get,ConnectAIModelDescription:$et,ConnectAIModelBtn:Wet,ChatHistory:jet,NoChatYet:Ket,ChooseHowConnect:Yet,SelectHowConnect:qet,SelectHowConnectDescription:Jet,ONLYOFFICEWallet:Xet,ONLYOFFICEWalletDescription:Zet,AIProviders:ett,AIProvidersDescription:ttt,RegisterConnectWallet:ntt,AddProvider:itt,Connection:rtt,MCPServers:stt,AIProvider:ott,EditAIProvider:att,Provider:ltt,Name:ctt,URL:utt,EnterName:dtt,EnterURL:htt,Key:ftt,EnterKey:ptt,Cancel:gtt,Save:mtt,Edit:Att,Delete:ytt,Warning:vtt,WantDeleteProvider:btt,WantDeleteChat:wtt,Yes:Stt,No:Ctt,WelcomeTitle:xtt,WelcomeDescription:Ett,Rename:_tt,Download:Ttt,Search:Rtt,AddLocalFile:ktt,AddLocalImage:Itt,RecentFiles:Mtt,Attachments:Dtt,APIKey:Ptt,NewChat:Ntt,AskAI:Ott,Analyzing:Btt,AIWouldLikeUseThisTool:Ltt,ReviewEachAction:Utt,AlwaysAllow:Vtt,Deny:Ftt,Allow:Htt,ToolCallArguments:ztt,ToolCallResult:Qtt,ToolExecuted:Gtt,Confirmation:$tt,SelectModel:Wtt,CustomServersDescription:jtt,EditConfiguration:Ktt,EnterYourJSONConfiguration:Ytt,AvailableTools:qtt,Tools:Jtt,ToolsEnabled:Xtt,EnableAllTools:Ztt,DisableAllTools:ent,Restart:tnt,Logs:nnt,CopyToClipboard:int,Close:rnt,WebSearch:snt,WebSearchDescription:ont,ResetSettings:ant,WebSearchEngine:lnt,SelectEngine:cnt,AllTools:unt,EnableWebSearch:dnt,WantDeleteServer:hnt,NoModelsAvailable:fnt,CheckInfo:pnt,ConfigurationError:gnt,Thinking:mnt,ExtendedThinking:Ant,ExtendedThinkingDescription:ynt},bnt="Agente de IA",wnt="Configurações do agente de IA",Snt="Configurações",Cnt="Conecte um modelo de IA para começar",xnt="Nenhum modelo de IA está conectado ainda. Conecte um modelo para começar a interagir com ele aqui mesmo na interface.",Ent="Conectar um modelo de IA",_nt="Histórico do bate-papo",Tnt="Ainda não há histórico de bate-papo...",Rnt="Escolha como conectar a IA",knt="Selecione como deseja ativar os recursos de IA no ONLYOFFICE.",Int="Você pode usar a carteira integrada para começar rapidamente ou conectar seu próprio modelo de IA usando uma chave de API ou um modelo hospedado localmente.",Mnt="Carteira ONLYOFFICE",Dnt="Recarregue seu saldo com um cartão e use instantaneamente todos os recursos de IA.",Pnt="Seu provedor de IA",Nnt="Conecte sua própria fonte de IA — seja por meio de uma chave de API de um provedor ou um modelo hospedado localmente.",Ont="Registre e conecte sua carteira",Bnt="Adicionar provedor",Lnt="Conexão",Unt="Servidores MCP",Vnt="Provedor de IA",Fnt="Editar provedor de IA",Hnt="Fornecedor",znt="Nome",Qnt="URL",Gnt="Digite o nome",$nt="Inserir URL",Wnt="Chave de API",jnt="Cancelar",Knt="Salvar",Ynt="Editar",qnt="Excluir",Jnt="Aviso",Xnt="Tem certeza de que deseja excluir este provedor?",Znt="Tem certeza de que deseja excluir este chat?",eit="Sim",tit="Não",nit="Como posso ajudar?",iit="Chat gratuito com IA, assistente de escrita e gerador de ideias",rit="Renomear",sit="Baixar",oit="Pesquisar...",ait="Adicionar arquivo local...",lit="Adicionar imagem local...",cit="Arquivos recentes",uit="Anexos",dit="Chave de API",hit="Novo bate-papo",fit="Pergunte à IA",pit="Analisando...",git="Al gostaria de usar esta ferramenta:",mit=`Analise cada ação cuidadosamente antes de aprová-la. - Não podemos garantir a segurança ou as práticas de privacidade de integrações de terceiros.`,Ait="Permitir que esta ferramenta execute esta ação sem perguntar novamente",yit="Negar",vit="Permitir",bit="Argumentos da chamada da ferramenta",wit="Resultado da chamada da ferramenta",Sit="Ferramenta executada",Cit="Confirmação",xit="Selecionar modelo",Eit="Esta seção permite configurar servidores MCP para uso no agente de IA. Você pode editar a configuração para adicionar novos servidores MCP e habilitar ferramentas conforme necessário.",_it="Editar configuração",Tit="Digite sua configuração JSON:",Rit="Ferramentas disponíveis",kit="ferramentas",Iit="ferramentas ativadas",Mit="Ativar todas as ferramentas",Dit="Desativar todas as ferramentas",Pit="Reiniciar",Nit="Registros",Oit="Copiar para a área de transferência",Bit="Fechar",Lit="Busca na Web",Uit="Conecte um mecanismo de busca na web para aprimorar bate-papos com IA com informações em tempo real da internet.",Vit="Redefinir configurações",Fit="Mecanismo de busca na Web",Hit="Selecionar motor",zit="Todas as ferramentas",Qit="Ativar pesquisa na Web nas configurações",Git="Este servidor será removido da sua lista. Deseja continuar ?",$it="Fornecedor não disponível",Wit="IA Bater papo Podem ocorrer erros. Verifique informações importantes.",jit="A configuração deve ser colocada dentro da propriedade 'mcpServers'",Kit="Raciocínio",Yit="Raciocínio Avançado",qit="Este modelo usa raciocínio avançado, o que pode aumentar os custos.",Jit={AIAgent:bnt,AIAgentSettings:wnt,Settings:Snt,ConnectAIModel:Cnt,ConnectAIModelDescription:xnt,ConnectAIModelBtn:Ent,ChatHistory:_nt,NoChatYet:Tnt,ChooseHowConnect:Rnt,SelectHowConnect:knt,SelectHowConnectDescription:Int,ONLYOFFICEWallet:Mnt,ONLYOFFICEWalletDescription:Dnt,AIProviders:Pnt,AIProvidersDescription:Nnt,RegisterConnectWallet:Ont,AddProvider:Bnt,Connection:Lnt,MCPServers:Unt,AIProvider:Vnt,EditAIProvider:Fnt,Provider:Hnt,Name:znt,URL:Qnt,EnterName:Gnt,EnterURL:$nt,Key:Wnt,"EnterKey ":"Insira a chave da API",Cancel:jnt,Save:Knt,Edit:Ynt,Delete:qnt,Warning:Jnt,WantDeleteProvider:Xnt,WantDeleteChat:Znt,Yes:eit,No:tit,WelcomeTitle:nit,WelcomeDescription:iit,Rename:rit,Download:sit,Search:oit,AddLocalFile:ait,AddLocalImage:lit,RecentFiles:cit,Anexos:uit,APIKey:dit,Attachments:hit,AskAI:fit,Analyzing:pit,AIWouldLikeUseThisTool:git,ReviewEachAction:mit,AlwaysAllow:Ait,Deny:yit,Allow:vit,ToolCallArguments:bit,ToolCallResult:wit,ToolExecuted:Sit,Confirmation:Cit,SelectModel:xit,CustomServersDescription:Eit,EditConfiguration:_it,EnterYourJSONConfiguration:Tit,AvailableTools:Rit,Tools:kit,ToolsEnabled:Iit,EnableAllTools:Mit,DisableAllTools:Dit,Restart:Pit,Logs:Nit,CopyToClipboard:Oit,Close:Bit,WebSearch:Lit,WebSearchDescription:Uit,ResetSettings:Vit,WebSearchEngine:Fit,SelectEngine:Hit,AllTools:zit,EnableWebSearch:Qit,WantDeleteServer:Git,NoModelsAvailable:$it,CheckInfo:Wit,ConfigurationError:jit,Thinking:Kit,ExtendedThinking:Yit,ExtendedThinkingDescription:qit},Xit="ИИ-агент",Zit="Настройки ИИ-агента",ert="Настройки",trt="Чтобы начать, подключите ИИ-модель",nrt="Нет подключенных ИИ-моделей. Подключите модель, чтобы начать работать с ней прямо в интерфейсе.",irt="Подключить ИИ-модель",rrt="История чатов",srt="Здесь пока нет истории чатов...",ort="Выберите, как вы хотите включить искусственный интеллект",art="Выберите, как вы хотите включить функции искусственного интеллекта в ONLYOFFICE.",lrt="Вы можете использовать встроенный кошелек для быстрого запуска или подключить собственную ИИ-модель с помощью ключа API или модели, размещенной локально.",crt="Кошелек ONLYOFFICE",urt="Пополните баланс с помощью карты и сразу используйте все функциональные возможности искусственного интеллекта.",drt="Ваш ИИ-провайдер",hrt="Подключите собственный источник искусственного интеллекта с помощью ключа API провайдера или модели, размещенной локально.",frt="Зарегистрируйтесь и подключите кошелек",prt="Добавить провайдера",grt="Подключение",mrt="MCP-серверы",Art="ИИ-провайдер",yrt="Изменить ИИ-провайдера",vrt="Провайдер",brt="Название",wrt="URL-адрес",Srt="Введите название",Crt="Введите URL-адрес",xrt="Ключ API",Ert="Введите ключ API",_rt="Отменить",Trt="Сохранить",Rrt="Редактировать",krt="Удалить",Irt="Предупреждение",Mrt="Вы уверены, что хотите удалить этого провайдера?",Drt="Вы уверены, что хотите удалить этот чат?",Prt="Да",Nrt="Нет",Ort="Чем я могу помочь?",Brt="Бесплатный ИИ-чат, помощник в создании документов и генератор идей",Lrt="Переименовать",Urt="Загрузить",Vrt="Поиск...",Frt="Добавить локальный файл...",Hrt="Добавить локальное изображение...",zrt="Недавние файлы",Qrt="Вложения",Grt="Ключ API",$rt="Новый чат",Wrt="Спросить ИИ",jrt="Анализ...",Krt="Искусственный интеллект хочет использовать этот инструмент:",Yrt=`Внимательно проверяйте каждое действие перед подтверждением. - Мы не можем гарантировать соответствие правил обеспечения безопасности и конфиденциальности сторонних интеграций.`,qrt="Всегда разрешать этому инструменту выполнять данное действие без повторного запроса",Jrt="Отклонить",Xrt="Разрешить",Zrt="Аргументы вызова инструмента",est="Результат вызова инструмента",tst="Работа с инструментом завершена",nst="Подтверждение",ist="Выбрать модель",rst="В этом разделе можно настроить MCP-серверы для использования в ИИ-агенте. Вы можете редактировать конфигурацию, чтобы добавлять новые MCP-серверы и включать необходимые инструменты.",sst="Редактировать конфигурацию",ost="Введите конфигурацию JSON:",ast="Доступные инструменты",lst="инструменты",cst="включенные инструменты",ust="Включить все инструменты",dst="Отключить все инструменты",hst="Перезапустить",fst="Журналы",pst="Копировать в буфер обмена",gst="Закрыть",mst="Веб-поиск",Ast="Включите поисковую систему, чтобы дополнять ИИ-чаты информацией из Интернета в режиме реального времени.",yst="Сбросить настройки",vst="Поисковая система",bst="Выберите движок",wst="Все инструменты",Sst="Включить веб-поиск в настройках",Cst="Этот сервер будет удален из вашего списка. Продолжить?",xst="Поставщик недоступен",Est="ИИ-чат может ошибаться. Проверьте важную информацию.",_st="Конфигурацию необходимо разместить внутри свойства 'mcpServers'",Tst="Логическое рассуждение",Rst="Расширенная обработка",kst="Данная модель использует сложные логические рассуждения, что может привести к увеличению затрат.",Ist={AIAgent:Xit,AIAgentSettings:Zit,Settings:ert,ConnectAIModel:trt,ConnectAIModelDescription:nrt,ConnectAIModelBtn:irt,ChatHistory:rrt,NoChatYet:srt,ChooseHowConnect:ort,SelectHowConnect:art,SelectHowConnectDescription:lrt,ONLYOFFICEWallet:crt,ONLYOFFICEWalletDescription:urt,AIProviders:drt,AIProvidersDescription:hrt,RegisterConnectWallet:frt,AddProvider:prt,Connection:grt,MCPServers:mrt,AIProvider:Art,EditAIProvider:yrt,Provider:vrt,Name:brt,URL:wrt,EnterName:Srt,EnterURL:Crt,Key:xrt,EnterKey:Ert,Cancel:_rt,Save:Trt,Edit:Rrt,Delete:krt,Warning:Irt,WantDeleteProvider:Mrt,WantDeleteChat:Drt,Yes:Prt,No:Nrt,WelcomeTitle:Ort,WelcomeDescription:Brt,Rename:Lrt,Download:Urt,Search:Vrt,AddLocalFile:Frt,AddLocalImage:Hrt,RecentFiles:zrt,Attachments:Qrt,APIKey:Grt,NewChat:$rt,AskAI:Wrt,Analyzing:jrt,AIWouldLikeUseThisTool:Krt,ReviewEachAction:Yrt,AlwaysAllow:qrt,Deny:Jrt,Allow:Xrt,ToolCallArguments:Zrt,ToolCallResult:est,ToolExecuted:tst,Confirmation:nst,SelectModel:ist,CustomServersDescription:rst,EditConfiguration:sst,EnterYourJSONConfiguration:ost,AvailableTools:ast,Tools:lst,ToolsEnabled:cst,EnableAllTools:ust,DisableAllTools:dst,Restart:hst,Logs:fst,CopyToClipboard:pst,Close:gst,WebSearch:mst,WebSearchDescription:Ast,ResetSettings:yst,WebSearchEngine:vst,SelectEngine:bst,AllTools:wst,EnableWebSearch:Sst,WantDeleteServer:Cst,NoModelsAvailable:xst,CheckInfo:Est,ConfigurationError:_st,Thinking:Tst,ExtendedThinking:Rst,ExtendedThinkingDescription:kst},Mst="Agent AI",Dst="Nastavenia agenta AI",Pst="Nastavenia",Nst="Pripojte model AI, aby ste mohli začať",Ost="Zatiaľ nie je pripojený žiadny model AI. Pripojte model AI, aby ste s ním mohli komunikovať priamo v tomto rozhraní.",Bst="Pripojiť model AI",Lst="História chatu",Ust="Zatiaľ tu nie je žiadna história chatu...",Vst="Vyberte spôsob pripojenia AI",Fst="Vyberte, ako chcete povoliť funkcie AI v ONLYOFFICE.",Hst="Môžete použiť ONLYOFFICE Peňaženku pre rýchly začiatok alebo pripojiť vlastný model AI pomocou API kľúča či nainštalovať lokálny model AI.",zst="ONLYOFFICE Peňaženka",Qst="Dobíjajte svoj kredit pomocou karty a okamžite využívajte všetky funkcie AI.",Gst="Váš provider pre AI",$st="Pripojte svoj vlastný model AI – buď prostredníctvom API kľúča od providera, alebo nainštalujte lokálny model AI",Wst="Registrovať a pripojiť Peňaženku",jst="Pridať providera",Kst="Pripojenie",Yst="MCP Servery",qst="AI Provider",Jst="Upraviť AI Providera",Xst="Provider",Zst="Názov",eot="URL",tot="Zadať názov",not="Zadať URL",iot="API kľúč",rot="Zadať API kľúč",sot="Zrušiť",oot="Uložiť",aot="Upraviť",lot="Vymazať",cot="Upozornenie",uot="Naozaj chcete vymazať tohto providera?",dot="Naozaj chcete vymazať tento chat?",hot="Áno",fot="Nie",pot="Ako môžem pomôcť?",got="Bezplatný AI chat, asistent na písanie textov a generátor nápadov.",mot="Premenovať",Aot="Stiahnuť",yot="Hľadať...",vot="Pridať lokálny súbor...",bot="Pridať lokálny obrázok...",wot="Nedávne súbory",Sot="Prílohy",Cot="API kľúč",xot="Nový chat",Eot="Opýtať sa AI",_ot="Prebieha analýza...",Tot="Al by chcel použiť tento nástroj:",Rot=`Pred schválením starostlivo skontrolujte každú akciu. - Nemôžeme zaručiť bezpečnosť ani dodržiavanie zásad ochrany osobných údajov v prípade integrovaného softvéru od tretích strán.`,kot="Vždy povoliť tomuto nástroju vykonať túto akciu bez opýtania",Iot="Odmietnuť",Mot="Povoliť",Dot="Argumenty volania nástroja",Pot="Výsledok volania nástroja",Not="Nástroj vykonaný",Oot="Potvrdenie",Bot="Vybrať model",Lot="V tejto sekcii môžete nakonfigurovať servery MCP, ktoré sa budú používať v AI agente. Môžete upraviť konfiguráciu, pridať nové servery MCP a zapnúť potrebné nástroje.",Uot="Upraviť konfiguráciu",Vot="Zadajte svoju konfiguráciu JSON:",Fot="Dostupné nástroje",Hot="nástroje",zot="povolené nástroje",Qot="Povoliť všetky nástroje",Got="Vypnúť všetky nástroje",$ot="Reštartovať",Wot="Protokoly",jot="Kopírovať do schránky",Kot="Zatvoriť",Yot="Hľadať na webe",qot="Pripojte webový vyhľadávač, aby mohol AI chat využívať aktuálne údaje z internetu v reálnom čase.",Jot="Obnoviť nastavenia",Xot="Webový vyhľadávač",Zot="Vybrať vyhľadávač",eat="Všetky nástroje",tat="Povoliť vyhľadávanie na webe v nastaveniach",nat="Tento server bude odstránený z vášho zoznamu. Pokračovať?",iat="Provider nie je dostupný",rat="AI chat môže robiť chyby. Kontrolujte dôležité informácie.",sat="Konfigurácia musí byť umiestnená vo vlastníctve 'mcpServers'",oat="Uvažovanie",aat="Rozšírené myslenie",lat="Tento model využíva pokročilé uvažovanie, čo môže zvýšiť náklady.",cat={AIAgent:Mst,AIAgentSettings:Dst,Settings:Pst,ConnectAIModel:Nst,ConnectAIModelDescription:Ost,ConnectAIModelBtn:Bst,ChatHistory:Lst,NoChatYet:Ust,ChooseHowConnect:Vst,SelectHowConnect:Fst,SelectHowConnectDescription:Hst,ONLYOFFICEWallet:zst,ONLYOFFICEWalletDescription:Qst,AIProviders:Gst,AIProvidersDescription:$st,RegisterConnectWallet:Wst,AddProvider:jst,Connection:Kst,MCPServers:Yst,AIProvider:qst,EditAIProvider:Jst,Provider:Xst,Name:Zst,URL:eot,EnterName:tot,EnterURL:not,Key:iot,EnterKey:rot,Cancel:sot,Save:oot,Edit:aot,Delete:lot,Warning:cot,WantDeleteProvider:uot,WantDeleteChat:dot,Yes:hot,No:fot,WelcomeTitle:pot,WelcomeDescription:got,Rename:mot,Download:Aot,Search:yot,AddLocalFile:vot,AddLocalImage:bot,RecentFiles:wot,Attachments:Sot,APIKey:Cot,NewChat:xot,AskAI:Eot,Analyzing:_ot,AIWouldLikeUseThisTool:Tot,ReviewEachAction:Rot,AlwaysAllow:kot,Deny:Iot,Allow:Mot,ToolCallArguments:Dot,ToolCallResult:Pot,ToolExecuted:Not,Confirmation:Oot,SelectModel:Bot,CustomServersDescription:Lot,EditConfiguration:Uot,EnterYourJSONConfiguration:Vot,AvailableTools:Fot,Tools:Hot,ToolsEnabled:zot,EnableAllTools:Qot,DisableAllTools:Got,Restart:$ot,Logs:Wot,CopyToClipboard:jot,Close:Kot,WebSearch:Yot,WebSearchDescription:qot,ResetSettings:Jot,WebSearchEngine:Xot,SelectEngine:Zot,AllTools:eat,EnableWebSearch:tat,WantDeleteServer:nat,NoModelsAvailable:iat,CheckInfo:rat,ConfigurationError:sat,Thinking:oat,ExtendedThinking:aat,ExtendedThinkingDescription:lat},uat="ВИ агент",dat="Подешавања ВИ агента",hat="Подешавања",fat="Повежите ВИ модел да бисте започели",pat="Још увек није повезан ниједан ВИ модел. Повежите модел да бисте почели да комуницирате са њим директно у интерфејсу.",gat="Повежи ВИ модел",mat="Историја чета",Aat="Још увек нема историје чета...",yat="Изаберите начин повезивања са ВИ",vat="Изаберите како желите да омогућите ВИ функције у ONLYOFFICE-у.",bat="Можете користити уграђени новчаник за брз почетак или повезати сопствени ВИ модел помоћу API кључа или локално хостованог модела.",wat="ONLYOFFICE Wallet",Sat="Допуните стање картицом и одмах користите све ВИ функције.",Cat="Ваш ВИ провајдер",xat="Повежите сопствени ВИ извор — путем API кључа провајдера или локално хостованог модела.",Eat="Региструј се и повежи новчаник",_at="Додај провајдера",Tat="Повезивање",Rat="MCP Сервери",kat="ВИ Провајдер",Iat="Измени ВИ Провајдер",Mat="Провајдер",Dat="Назив",Pat="URL",Nat="Унесите назив",Oat="Унесите URL",Bat="API кључ",Lat="Унесите API кључ",Uat="Откажи",Vat="Сачувај",Fat="Измени",Hat="Обриши",zat="Упозорење",Qat="Да ли сте сигурни да желите да обришете овог провајдера?",Gat="Да ли сте сигурни да желите да обришете овај чет?",$at="Да",Wat="Не",jat="Како могу да помогнем?",Kat="Бесплатан ВИ чет, асистент за писање и генератор идеја",Yat="Преименуј",qat="Преузми",Jat="Претрага...",Xat="Додај локални фајл...",Zat="Додај локалну слику...",elt="Недавни фајлови",tlt="Прилози",nlt="API кључ",ilt="Нови чет",rlt="Питај ВИ",slt="Анализа у току...",olt="ВИ жели да користи овај алат:",alt=`Пажљиво прегледајте сваку радњу пре одобравања. - Не можемо гарантовати безбедност или праксу приватности интеграција трећих страна.`,llt="Увек дозволи овом алату да извршава ову радњу без поновног питања",clt="Одбиј",ult="Дозволи",dlt="Аргументи позива алата",hlt="Резултат позива алата",flt="Алат извршен",plt="Потврда",glt="Изабери модел",mlt="Овај одељак вам омогућава да конфигуришете MCP сервере за коришћење унутар ВИ агента. Можете изменити конфигурацију да додате нове MCP сервере и омогућите алате по потреби.",Alt="Измени конфигурацију",ylt="Унесите своју JSON конфигурацију:",vlt="Доступни алати",blt="алати",wlt="омогућени алати",Slt="Омогући све алате",Clt="Онемогући све алате",xlt="Рестартуј",Elt="Логови",_lt="Копирај у привремену меморију",Tlt="Затвори",Rlt="Веб претрага",klt="Повежите претраживач веба да бисте обогатили ВИ ћаскања информацијама у реалном времену са интернета.",Ilt="Ресетуј подешавања",Mlt="Веб претраживач",Dlt="Изабери претраживач",Plt="Сви алати",Nlt="Омогући веб претрагу у подешавањима",Olt="Овај сервер ће бити обрисан са ваше листе. Наставити?",Blt="Провајдер није доступан",Llt="ВИ ћет може правити грешке. Проверите важне информације.",Ult="Конфигурација мора бити смештена унутар својства 'mcpServers'",Vlt="Размишљање",Flt="Проширено размишљање",Hlt="Овај модел користи напредно резоновање, што може повећати трошкове.",zlt={AIAgent:uat,AIAgentSettings:dat,Settings:hat,ConnectAIModel:fat,ConnectAIModelDescription:pat,ConnectAIModelBtn:gat,ChatHistory:mat,NoChatYet:Aat,ChooseHowConnect:yat,SelectHowConnect:vat,SelectHowConnectDescription:bat,ONLYOFFICEWallet:wat,ONLYOFFICEWalletDescription:Sat,AIProviders:Cat,AIProvidersDescription:xat,RegisterConnectWallet:Eat,AddProvider:_at,Connection:Tat,MCPServers:Rat,AIProvider:kat,EditAIProvider:Iat,Provider:Mat,Name:Dat,URL:Pat,EnterName:Nat,EnterURL:Oat,Key:Bat,EnterKey:Lat,Cancel:Uat,Save:Vat,Edit:Fat,Delete:Hat,Warning:zat,WantDeleteProvider:Qat,WantDeleteChat:Gat,Yes:$at,No:Wat,WelcomeTitle:jat,WelcomeDescription:Kat,Rename:Yat,Download:qat,Search:Jat,AddLocalFile:Xat,AddLocalImage:Zat,RecentFiles:elt,Attachments:tlt,APIKey:nlt,NewChat:ilt,AskAI:rlt,Analyzing:slt,AIWouldLikeUseThisTool:olt,ReviewEachAction:alt,AlwaysAllow:llt,Deny:clt,Allow:ult,ToolCallArguments:dlt,ToolCallResult:hlt,ToolExecuted:flt,Confirmation:plt,SelectModel:glt,CustomServersDescription:mlt,EditConfiguration:Alt,EnterYourJSONConfiguration:ylt,AvailableTools:vlt,Tools:blt,ToolsEnabled:wlt,EnableAllTools:Slt,DisableAllTools:Clt,Restart:xlt,Logs:Elt,CopyToClipboard:_lt,Close:Tlt,WebSearch:Rlt,WebSearchDescription:klt,ResetSettings:Ilt,WebSearchEngine:Mlt,SelectEngine:Dlt,AllTools:Plt,EnableWebSearch:Nlt,WantDeleteServer:Olt,NoModelsAvailable:Blt,CheckInfo:Llt,ConfigurationError:Ult,Thinking:Vlt,ExtendedThinking:Flt,ExtendedThinkingDescription:Hlt},Qlt="AI agent",Glt="Podešavanja AI agenta",$lt="Podešavanja",Wlt="Povežite AI model da biste započeli",jlt="Još uvek nije povezan nijedan AI model. Povežite model da biste počeli da komunicirate sa njim direktno u interfejsu.",Klt="Poveži AI model",Ylt="Istorija četa",qlt="Još uvek nema istorije četa...",Jlt="Izaberite način povezivanja sa AI",Xlt="Izaberite kako želite da omogućite AI funkcije u ONLYOFFICE-u.",Zlt="Možete koristiti ugrađeni novčanik za brz početak ili povezati sopstveni AI model pomoću API ključa ili lokalno hostovanog modela.",ect="ONLYOFFICE Wallet",tct="Dopunite stanje karticom i odmah koristite sve AI funkcije.",nct="Vaš AI provajder",ict="Povežite sopstveni AI izvor — putem API ključa provajdera ili lokalno hostovanog modela.",rct="Registruj se i poveži novčanik",sct="Dodaj provajdera",oct="Povezivanje",act="MCP Serveri",lct="AI Provajder",cct="Izmeni AI Provajder",uct="Provajder",dct="Naziv",hct="URL",fct="Unesite naziv",pct="Unesite URL",gct="API ključ",mct="Unesite API ključ",Act="Otkaži",yct="Sačuvaj",vct="Izmeni",bct="Obriši",wct="Upozorenje",Sct="Da li ste sigurni da želite da obrišete ovog provajdera?",Cct="Da li ste sigurni da želite da obrišete ovaj čet?",xct="Da",Ect="Ne",_ct="Kako mogu da pomognem?",Tct="Besplatan AI čet, asistent za pisanje i generator ideja",Rct="Preimenuj",kct="Preuzmi",Ict="Pretraga...",Mct="Dodaj lokalni fajl...",Dct="Dodaj lokalnu sliku...",Pct="Nedavni fajlovi",Nct="Prilozi",Oct="API ključ",Bct="Novi čet",Lct="Pitaj AI",Uct="Analiza u toku...",Vct="AI želi da koristi ovaj alat:",Fct=`Pažljivo pregledajte svaku radnju pre odobravanja. - Ne možemo garantovati bezbednost ili praksu privatnosti integracija trećih strana.`,Hct="Uvek dozvoli ovom alatu da izvršava ovu radnju bez ponovnog pitanja",zct="Odbij",Qct="Dozvoli",Gct="Argumenti poziva alata",$ct="Rezultat poziva alata",Wct="Alat izvršen",jct="Potvrda",Kct="Izaberi model",Yct="Ovaj odeljak vam omogućava da konfigurišete MCP servere za korišćenje unutar AI agenta. Možete izmeniti konfiguraciju da dodate nove MCP servere i omogućite alate po potrebi.",qct="Izmeni konfiguraciju",Jct="Unesite svoju JSON konfiguraciju:",Xct="Dostupni alati",Zct="alati",eut="omogućeni alati",tut="Omogući sve alate",nut="Onemogući sve alate",iut="Restartuj",rut="Logovi",sut="Kopiraj u privremenu memoriju",out="Zatvori",aut="Veb pretraga",lut="Povežite pretraživač veba da biste obogatili AI četove informacijama u realnom vremenu sa internet.",cut="Resetuj podešavanja",uut="Veb pretraživač",dut="Izaberi pretraživač",hut="Svi alati",fut="Omogući veb pretragu u podešavanjima",put="Ovaj server će biti obrisan sa vaše liste. Nastaviti?",gut="Provajder nije dostupan",mut="AI čet može praviti greške. Proverite važne informacije.",Aut="Konfiguracija mora biti smeštena unutar svojstva 'mcpServers'",yut="Razmišljanje",vut="Prošireno razmišljanje",but="Ovaj model koristi napredno rezonovanje, što može povećati troškove.",wut={AIAgent:Qlt,AIAgentSettings:Glt,Settings:$lt,ConnectAIModel:Wlt,ConnectAIModelDescription:jlt,ConnectAIModelBtn:Klt,ChatHistory:Ylt,NoChatYet:qlt,ChooseHowConnect:Jlt,SelectHowConnect:Xlt,SelectHowConnectDescription:Zlt,ONLYOFFICEWallet:ect,ONLYOFFICEWalletDescription:tct,AIProviders:nct,AIProvidersDescription:ict,RegisterConnectWallet:rct,AddProvider:sct,Connection:oct,MCPServers:act,AIProvider:lct,EditAIProvider:cct,Provider:uct,Name:dct,URL:hct,EnterName:fct,EnterURL:pct,Key:gct,EnterKey:mct,Cancel:Act,Save:yct,Edit:vct,Delete:bct,Warning:wct,WantDeleteProvider:Sct,WantDeleteChat:Cct,Yes:xct,No:Ect,WelcomeTitle:_ct,WelcomeDescription:Tct,Rename:Rct,Download:kct,Search:Ict,AddLocalFile:Mct,AddLocalImage:Dct,RecentFiles:Pct,Attachments:Nct,APIKey:Oct,NewChat:Bct,AskAI:Lct,Analyzing:Uct,AIWouldLikeUseThisTool:Vct,ReviewEachAction:Fct,AlwaysAllow:Hct,Deny:zct,Allow:Qct,ToolCallArguments:Gct,ToolCallResult:$ct,ToolExecuted:Wct,Confirmation:jct,SelectModel:Kct,CustomServersDescription:Yct,EditConfiguration:qct,EnterYourJSONConfiguration:Jct,AvailableTools:Xct,Tools:Zct,ToolsEnabled:eut,EnableAllTools:tut,DisableAllTools:nut,Restart:iut,Logs:rut,CopyToClipboard:sut,Close:out,WebSearch:aut,WebSearchDescription:lut,ResetSettings:cut,WebSearchEngine:uut,SelectEngine:dut,AllTools:hut,EnableWebSearch:fut,WantDeleteServer:put,NoModelsAvailable:gut,CheckInfo:mut,ConfigurationError:Aut,Thinking:yut,ExtendedThinking:vut,ExtendedThinkingDescription:but},Sut="AI 智能体",Cut="AI 智能体设置",xut="设置",Eut="连接一个 AI 模型开始使用",_ut="尚未连接任何 AI 模型。连接一个模型,即可在此界面中开始与之交互。",Tut="连接 AI 模型",Rut="历史对话",kut="暂无历史对话...",Iut="选择如何连接 AI",Mut="选择您希望在 ONLYOFFICE 中启用 AI 功能的方式。",Dut="您可以使用内置的钱包快速开始,也可以通过 API 密钥或本地托管模型连接您自己的 AI 模型。",Put="ONLYOFFICE 钱包",Nut="使用银行卡充值余额,即刻使用所有 AI 功能。",Out="您的 AI 提供商",But="连接您自己的 AI 来源,可使用提供商的 API 密钥,或接入本地部署的模型。",Lut="注册并连接钱包",Uut="添加提供商",Vut="连接",Fut="MCP 服务器",Hut="AI 提供商",zut="编辑 AI 提供商",Qut="提供商",Gut="名称",$ut="URL",Wut="请输入名称",jut="请输入 URL",Kut="API 密钥",Yut="请输入 API 密钥",qut="取消",Jut="保存",Xut="编辑",Zut="删除",edt="警告",tdt="您确定要删除此提供商吗?",ndt="您确定要删除此对话吗?",idt="是",rdt="否",sdt="我能帮您什么?",odt="免费 AI 对话、写作和创意工具",adt="重命名",ldt="下载",cdt="搜索...",udt="添加本地文件...",ddt="添加本地图片...",hdt="最近的文件",fdt="附件",pdt="API 密钥",gdt="新建对话",mdt="询问 AI",Adt="正在分析...",ydt="AI 希望使用此工具:",vdt=`请仔细审阅每个操作后再批准。 - 我们无法保证第三方集成的安全性或隐私保护措施。`,bdt="始终允许此工具执行此操作,无需再次询问",wdt="拒绝",Sdt="允许",Cdt="工具调用参数",xdt="工具调用结果",Edt="工具已执行",_dt="确认",Tdt="选择模型",Rdt="此部分允许您配置 MCP 服务器以供 AI 智能体内部使用。您可以编辑配置以添加新的 MCP 服务器并按需启用工具。",kdt="编辑配置",Idt="请输入您的 JSON 配置:",Mdt="可用工具",Ddt="工具",Pdt="工具已启用",Ndt="启用所有工具",Odt="禁用所有工具",Bdt="重启",Ldt="日志",Udt="复制到剪贴板",Vdt="关闭",Fdt="联网搜索",Hdt="连接网络搜索引擎,通过来自互联网的实时信息增强 AI 对话。",zdt="重置设置",Qdt="网络搜索引擎",Gdt="选择引擎",$dt="所有工具",Wdt="在设置中启用网络搜索",jdt="此服务器将从您的列表中删除。是否继续?",Kdt="提供商不可用",Ydt="AI 可能会出错。请核对重要信息。",qdt="配置必须放置在 'mcpServers' 属性内",Jdt="思考中",Xdt="深度思考",Zdt="此模型采用深度推理,可能会增加成本。",eht={AIAgent:Sut,AIAgentSettings:Cut,Settings:xut,ConnectAIModel:Eut,ConnectAIModelDescription:_ut,ConnectAIModelBtn:Tut,ChatHistory:Rut,NoChatYet:kut,ChooseHowConnect:Iut,SelectHowConnect:Mut,SelectHowConnectDescription:Dut,ONLYOFFICEWallet:Put,ONLYOFFICEWalletDescription:Nut,AIProviders:Out,AIProvidersDescription:But,RegisterConnectWallet:Lut,AddProvider:Uut,Connection:Vut,MCPServers:Fut,AIProvider:Hut,EditAIProvider:zut,Provider:Qut,Name:Gut,URL:$ut,EnterName:Wut,EnterURL:jut,Key:Kut,EnterKey:Yut,Cancel:qut,Save:Jut,Edit:Xut,Delete:Zut,Warning:edt,WantDeleteProvider:tdt,WantDeleteChat:ndt,Yes:idt,No:rdt,WelcomeTitle:sdt,WelcomeDescription:odt,Rename:adt,Download:ldt,Search:cdt,AddLocalFile:udt,AddLocalImage:ddt,RecentFiles:hdt,Attachments:fdt,APIKey:pdt,NewChat:gdt,AskAI:mdt,Analyzing:Adt,AIWouldLikeUseThisTool:ydt,ReviewEachAction:vdt,AlwaysAllow:bdt,Deny:wdt,Allow:Sdt,ToolCallArguments:Cdt,ToolCallResult:xdt,ToolExecuted:Edt,Confirmation:_dt,SelectModel:Tdt,CustomServersDescription:Rdt,EditConfiguration:kdt,EnterYourJSONConfiguration:Idt,AvailableTools:Mdt,Tools:Ddt,ToolsEnabled:Pdt,EnableAllTools:Ndt,DisableAllTools:Odt,Restart:Bdt,Logs:Ldt,CopyToClipboard:Udt,Close:Vdt,WebSearch:Fdt,WebSearchDescription:Hdt,ResetSettings:zdt,WebSearchEngine:Qdt,SelectEngine:Gdt,AllTools:$dt,EnableWebSearch:Wdt,WantDeleteServer:jdt,NoModelsAvailable:Kdt,CheckInfo:Ydt,ConfigurationError:qdt,Thinking:Jdt,ExtendedThinking:Xdt,ExtendedThinkingDescription:Zdt};Ui.use(Fre).init({resources:{"ar-SA":{translation:CQe},"cs-CZ":{translation:n$e},de:{translation:OWe},en:{translation:pKe},es:{translation:jYe},fr:{translation:_Je},it:{translation:sZe},"ja-JP":{translation:Fet},pl:{translation:vnt},"pt-BR":{translation:Jit},ru:{translation:Ist},"sk-SK":{translation:cat},"sr-Cyrl-RS":{translation:zlt},"sr-Latn-RS":{translation:wut},"zh-CN":{translation:eht}},fallbackLng:"en",interpolation:{escapeValue:!1}});const tht=()=>{const[t,e]=T.useState(!1),[n,i]=T.useState(!1),{messages:r,stopMessage:s}=Sh(),{providers:o,fetchProvidersModels:a}=Tr(),{currentPage:l}=qg(),{manageToolData:u}=Ns();Q_e({isReady:t}),z_e({isReady:t});const{onNew:d,convertMessage:f,approveToolCall:g,denyToolCall:m}=H_e({isReady:t});T.useEffect(()=>{o.length&&a()},[o.length,a]),T.useEffect(()=>{u&&i(!0)},[u]),T.useEffect(()=>(kpe().then(()=>e(!0)),()=>{is.close()}),[]);const v=rZ({messages:r,onNew:d,onCancel:async()=>{s()},convertMessage:f,adapters:{attachments:new WX([new zX,new GX])}});return l!=="settings"&&!o.length&&!r.length?_.jsx(v4,{children:_.jsx(P5e,{})}):_.jsxs(v4,{children:[_.jsx(see,{runtime:v,children:l==="settings"?_.jsx(E7e,{}):_.jsx(D5e,{})}),n?_.jsx(V_e,{onAllow:g,onDeny:m,onClose:()=>i(!1)}):null]})},s6=()=>{let t=document.getElementById("root");if(!t){const e=window.parent.document.querySelector('iframe[name="system_asc.{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}"]');e?.contentDocument&&(t=e.contentDocument.getElementById("root"))}t||(t=document.createElement("div"),t.id="root",document.body.appendChild(t)),t&&!t.hasAttribute("data-react-root")&&(t.setAttribute("data-react-root","true"),QJ.createRoot(t).render(_.jsx(T.StrictMode,{children:_.jsx(tht,{})})))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s6):s6(); +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Att(e,t,n,o){const r=o.schema,i=r.space==="svg"?!1:o.settings.omitOptionalTags;let s=r.space==="svg"?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const a=[];let c;r.space==="html"&&e.tagName==="svg"&&(o.schema=nw);const p=_tt(o,e.properties),u=o.all(r.space==="html"&&e.tagName==="template"?e.content:e);return o.schema=r,u&&(s=!1),(p||!i||!htt(e,t,n))&&(a.push("<",e.tagName,p?" "+p:""),s&&(r.space==="svg"||o.settings.closeSelfClosing)&&(c=p.charAt(p.length-1),(!o.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!s&&(!i||!Ck(e,t,n))&&a.push(""),a.join("")}function _tt(e,t){const n=[];let o=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=vtt(e,r,t[r]);i&&n.push(i)}}for(;++oFE(n,e.alternative)&&(s=e.alternative),a=s+nA(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?LT.single:LT.double)[r][i],attribute:!0}))+s),c+(a&&"="+a))}const Stt=["<","&"];function Mde(e,t,n,o){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:nA(e.value,Object.assign({},o.settings.characterReferences,{subset:Stt}))}function Ctt(e,t,n,o){return o.settings.allowDangerousHtml?e.value:Mde(e,t,n,o)}function wtt(e,t,n,o){return o.all(e)}const Ott=cXe("type",{invalid:Ttt,unknown:Rtt,handlers:{comment:Yet,doctype:Xet,element:Att,raw:Ctt,root:wtt,text:Mde}});function Ttt(e){throw new Error("Expected node, not `"+e+"`")}function Rtt(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Ett={},Mtt={},Ptt=[];function Itt(e,t){const n=t||Ett,o=n.quote||'"',r=o==='"'?"'":'"';if(o!=='"'&&o!=="'")throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:jtt,all:Dtt,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Iet,characterReferences:n.characterReferences||Mtt,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nw:oce,quote:o,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function jtt(e,t,n){return Ott(e,t,n,this)}function Dtt(e){const t=[],n=e&&e.children||Ptt;let o=-1;for(;++ot.default||t)}function wk(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ide(e){return e==="ansi"||wk(e)}function Ok(e){return e==="none"}function jde(e){return Ok(e)}function Dde(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function DP(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let o=0;const r=[];for(let i=0;ir);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const a of t){if(ii&&r[i])}const Tk="light-dark()",xtt=["color","background-color"];function Btt(e,t){let n=0;const o=[];for(const r of t)r>n&&o.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return no-r);return n.length?e.map(o=>o.flatMap(r=>{const i=n.filter(s=>r.offsets-r.offset).sort((s,a)=>s-a);return i.length?Btt(r,i):r})):e}function Utt(e,t,n,o,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>HE(e.variants[u])),a=new Set(s.flatMap(u=>Object.keys(u))),c={},p=(u,l)=>{const d=l==="color"?"":l==="background-color"?"-bg":`-${l}`;return n+t[u]+(l==="color"?"":d)};return s.forEach((u,l)=>{for(const d of a){const f=u[d]||"inherit";if(l===0&&o&&xtt.includes(d))if(o===Tk&&s.length>1){const h=t.findIndex(_=>_==="light"),m=t.findIndex(_=>_==="dark");if(h===-1||m===-1)throw new nr('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const g=s[h][d]||"inherit",y=s[m][d]||"inherit";c[d]=`light-dark(${g}, ${y})`,r==="css-vars"&&(c[p(l,d)]=f)}else c[d]=f;else r==="css-vars"&&(c[p(l,d)]=f)}}),i.htmlStyle=c,i}function HE(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&eo.Italic&&(t["font-style"]="italic"),e.fontStyle&eo.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&eo.Underline&&n.push("underline"),e.fontStyle&eo.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function yL(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Nde=new WeakMap;function NP(e,t){Nde.set(e,t)}function oC(e){return Nde.get(e)}class e_{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e_(Object.fromEntries(Ntt(n).map(o=>[o,gL])),t)}constructor(...t){if(t.length===2){const[n,o]=t;this.lang=o,this._stacks=n}else{const[n,o,r]=t;this.lang=o,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return qtt(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function qtt(e){const t=[],n=new Set;function o(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&o(r.parent)}return o(e),t}function Jtt(e,t){if(!(e instanceof e_))throw new nr("Invalid grammar state");return e.getInternalStack(t)}function Vtt(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new nr(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new nr(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let c=s.character;if(c<0&&(c=a.length+c),c<0||c>a.length)throw new nr(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:c,offset:r.posToIndex(s.line,c)}}};const r=Ltt(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:o(s.start),end:o(s.end)}));Htt(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return ktt(n,r)},code(n){if(!this.options.decorations?.length)return;const o=t(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==o.converter.lines.length)throw new nr(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${o.converter.lines.length}). Failed to apply decorations.`);function i(u,l,d,f){const h=r[u];let m="",g=-1,y=-1;if(l===0&&(g=0),d===0&&(y=0),d===Number.POSITIVE_INFINITY&&(y=h.children.length),g===-1||y===-1)for(let S=0;Sm);return u.tagName=l.tagName||"span",u.properties={...u.properties,...f,class:u.properties.class},l.properties?.class&&Dde(u,l.properties.class),u=h(u,d)||u,u}const c=[],p=o.decorations.sort((u,l)=>l.start.offset-u.start.offset||u.end.offset-l.end.offset);for(const u of p){const{start:l,end:d}=u;if(l.line===d.line)i(l.line,l.character,d.character,u);else if(l.lines(f,u));i(d.line,0,d.character,u)}}c.forEach(u=>u())}}}function Htt(e){for(let t=0;tn.end.offset)throw new nr(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let o=t+1;oNumber.parseInt(o));return n.length!==3||n.some(o=>Number.isNaN(o))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Qtt(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const o=Number.parseInt(n);if(!Number.isNaN(o))if(o===0)t.push({type:"resetAll"});else if(o<=9)WN[o]&&t.push({type:"setDecoration",value:WN[o]});else if(o<=29){const r=WN[o-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(o<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ng[o-30]}});else if(o===38){const r=uY(e);r&&t.push({type:"setForegroundColor",value:r})}else if(o===39)t.push({type:"resetForegroundColor"});else if(o<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ng[o-40]}});else if(o===48){const r=uY(e);r&&t.push({type:"setBackgroundColor",value:r})}else o===49?t.push({type:"resetBackgroundColor"}):o===53?t.push({type:"setDecoration",value:"overline"}):o===55?t.push({type:"resetDecoration",value:"overline"}):o>=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ng[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ng[o-100+8]}})}return t}function $tt(){let e=null,t=null,n=new Set;return{parse(o){const r=[];let i=0;do{const s=Ktt(o,i),a=s.sequence?o.substring(i,s.startPosition):o.substring(i);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const c=Qtt(s.sequence);for(const p of c)p.type==="resetAll"?(e=null,t=null,n.clear()):p.type==="resetForegroundColor"?e=null:p.type==="resetBackgroundColor"?t=null:p.type==="resetDecoration"&&n.delete(p.value);for(const p of c)p.type==="setForegroundColor"?e=p.value:p.type==="setBackgroundColor"?t=p.value:p.type==="setDecoration"&&n.add(p.value)}i=s.position}while(iMath.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let o;function r(){if(o)return o;o=[];for(let p=0;p{const p=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,u=e.colors?.[p];return[c,u||Xtt[c]]})),s=Ytt(i),a=$tt();return r.map(c=>a.parse(c[0]).map(p=>{let u,l;p.decorations.has("reverse")?(u=p.background?s.value(p.background):e.bg,l=p.foreground?s.value(p.foreground):e.fg):(u=p.foreground?s.value(p.foreground):e.fg,l=p.background?s.value(p.background):void 0),u=pm(u,o),l=pm(l,o),p.decorations.has("dim")&&(u=ent(u));let d=eo.None;return p.decorations.has("bold")&&(d|=eo.Bold),p.decorations.has("italic")&&(d|=eo.Italic),p.decorations.has("underline")&&(d|=eo.Underline),p.decorations.has("strikethrough")&&(d|=eo.Strikethrough),{content:p.value,offset:c[1],color:u,bgColor:l,fontStyle:d}}))}function ent(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const o=t[1];if(o.length===8){const r=Math.round(Number.parseInt(o.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${o.slice(0,6)}${r}`}else{if(o.length===6)return`#${o}80`;if(o.length===4){const r=o[0],i=o[1],s=o[2],a=o[3],c=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${i}${i}${s}${s}${c}`}else if(o.length===3){const r=o[0],i=o[1],s=o[2];return`#${r}${r}${i}${i}${s}${s}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Rk(e,t,n={}){const{theme:o=e.getLoadedThemes()[0]}=n,r=e.resolveLangAlias(n.lang||"text");if(wk(r)||Ok(o))return DP(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:i,colorMap:s}=e.setTheme(o);if(r==="ansi")return Ztt(i,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new nr(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(i.name))throw new nr(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return nnt(t,a,i,s,n)}function tnt(...e){if(e.length===2)return oC(e[1]);const[t,n,o={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=o;if(wk(r)||Ok(i))throw new nr("Plain language does not have grammar state");if(r==="ansi")throw new nr("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(i),c=t.getLanguage(r);return new e_(Ek(n,c,s,a,o).stateStack,c.name,s.name)}function nnt(e,t,n,o,r){const i=Ek(e,t,n,o,r),s=new e_(i.stateStack,t.name,n.name);return NP(i.tokens,s),i.tokens}function Ek(e,t,n,o,r){const i=VE(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=r,c=DP(e);let p=r.grammarState?Jtt(r.grammarState,n.name)??gL:r.grammarContextCode!=null?Ek(r.grammarContextCode,t,n,o,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:gL,u=[];const l=[];for(let d=0,f=c.length;d0&&h.length>=s){u=[],l.push([{content:h,offset:m,color:"",fontStyle:0}]);continue}let g,y,_;r.includeExplanation&&(g=t.tokenizeLine(h,p,a),y=g.tokens,_=0);const S=t.tokenizeLine2(h,p,a),w=S.tokens.length/2;for(let R=0;RV.trim());break;case"object":J=U.scope;break;default:continue}q.push({settings:U,selectors:J.map(V=>V.split(/ /))})}L.explanation=[];let I=0;for(;E+I({scopeName:t}))}function ont(e,t){const n=[];for(let o=0,r=t.length;o=0&&r>=0;)cY(e[o],n[r])&&(o-=1),r-=1;return o===-1}function snt(e,t,n){const o=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(int(s,t,n)){o.push(i);break}return o}function Fde(e,t,n){const o=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),r=o.map(c=>{const p=Rk(e,t,{...n,theme:c.theme}),u=oC(p),l=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:p,state:u,theme:l}}),i=ant(...r.map(c=>c.tokens)),s=i[0].map((c,p)=>c.map((u,l)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((f,h)=>{const{content:m,explanation:g,offset:y,..._}=f[p][l];d.variants[o[h].color]=_}),d})),a=r[0].state?new e_(Object.fromEntries(r.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),r[0].state.lang):void 0;return a&&NP(s,a),s}function ant(...e){const t=e.map(()=>[]),n=e.length;for(let o=0;oc[o]),i=t.map(()=>[]);t.forEach((c,p)=>c.push(i[p]));const s=r.map(()=>0),a=r.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(p=>p.content.length));for(let p=0;py[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,_)=>y.color===p?-1:_.color===p?1:0);if(d.length===0)throw new nr("`themes` option must not be empty");const f=Fde(e,t,n);if(c=oC(f),p&&Tk!==p&&!d.find(y=>y.color===p))throw new nr(`\`themes\` option must contain the defaultColor key \`${p}\``);const h=d.map(y=>e.getTheme(y.theme)),m=d.map(y=>y.color);i=f.map(y=>y.map(_=>Utt(_,m,u,p,l))),c&&NP(i,c);const g=d.map(y=>VE(y.theme,n));r=dY(d,h,g,u,p,"fg",l),o=dY(d,h,g,u,p,"bg",l),s=`shiki-themes ${h.map(y=>y.name).join(" ")}`,a=p?void 0:[r,o].join(";")}else if("theme"in n){const p=VE(n.theme,n);i=Rk(e,t,n);const u=e.getTheme(n.theme);o=pm(u.bg,p),r=pm(u.fg,p),s=u.name,c=oC(i)}else throw new nr("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:o,themeName:s,rootStyle:a,grammarState:c}}function dY(e,t,n,o,r,i,s){return e.map((a,c)=>{const p=pm(t[c][i],n[c])||"inherit",u=`${o+a.color}${i==="bg"?"-bg":""}:${p}`;if(c===0&&r){if(r===Tk&&e.length>1){const l=e.findIndex(m=>m.color==="light"),d=e.findIndex(m=>m.color==="dark");if(l===-1||d===-1)throw new nr('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=pm(t[l][i],n[l])||"inherit",h=pm(t[d][i],n[d])||"inherit";return`light-dark(${f}, ${h});${u}`}return p}return s==="css-vars"?u:null}).filter(a=>!!a).join(";")}function KE(e,t,n,o={meta:{},options:n,codeToHast:(r,i)=>KE(e,r,i),codeToTokens:(r,i)=>zE(e,r,i)}){let r=t;for(const h of GE(n))r=h.preprocess?.call(o,r,n)||r;let{tokens:i,fg:s,bg:a,themeName:c,rootStyle:p,grammarState:u}=zE(e,r,n);const{mergeWhitespaces:l=!0,mergeSameStyleTokens:d=!1}=n;l===!0?i=unt(i):l==="never"&&(i=cnt(i)),d&&(i=dnt(i));const f={...o,get source(){return r}};for(const h of GE(n))i=h.tokens?.call(f,i)||i;return lnt(i,{...n,fg:s,bg:a,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??p},f,u)}function lnt(e,t,n,o=oC(e)){const r=GE(t),i=[],s={type:"root",children:[]},{structure:a="classic",tabindex:c="0"}=t,p={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?p.style=t.rootStyle:p.style=`background-color:${t.bg};color:${t.fg}`),c!==!1&&c!=null&&(p.tabindex=c.toString());for(const[m,g]of Object.entries(t.meta||{}))m.startsWith("_")||(p[m]=g);let u={type:"element",tagName:"pre",properties:p,children:[],data:t.data},l={type:"element",tagName:"code",properties:{},children:i};const d=[],f={...n,structure:a,addClassToHast:Dde,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return l},get lines(){return d}};if(e.forEach((m,g)=>{g&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:` +`}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const S of m){let w={type:"element",tagName:"span",properties:{...S.htmlAttrs},children:[{type:"text",value:S.content}]};const R=yL(S.htmlStyle||HE(S));R&&(w.properties.style=R);for(const E of r)w=E?.span?.call(f,w,g+1,_,y,S)||w;a==="inline"?s.children.push(w):a==="classic"&&y.children.push(w),_+=S.content.length}if(a==="classic"){for(const S of r)y=S?.line?.call(f,y,g+1)||y;d.push(y),i.push(y)}else a==="inline"&&d.push(y)}),a==="classic"){for(const m of r)l=m?.code?.call(f,l)||l;u.children.push(l);for(const m of r)u=m?.pre?.call(f,u)||u;s.children.push(u)}else if(a==="inline"){const m=[];let g={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const S of s.children)S.type==="element"&&S.tagName==="br"?(m.push(g),g={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(S.type==="element"||S.type==="text")&&g.children.push(S);m.push(g);let _={type:"element",tagName:"code",properties:{},children:m};for(const S of r)_=S?.code?.call(f,_)||_;s.children=[];for(let S=0;S<_.children.length;S++){S>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=_.children[S];w.type==="element"&&s.children.push(...w.children)}}let h=s;for(const m of r)h=m?.root?.call(f,h)||h;return o&&NP(h,o),h}function unt(e){return e.map(t=>{const n=[];let o="",r;return t.forEach((i,s)=>{const c=!(i.fontStyle&&(i.fontStyle&eo.Underline||i.fontStyle&eo.Strikethrough));c&&i.content.match(/^\s+$/)&&t[s+1]?(r===void 0&&(r=i.offset),o+=i.content):o?(c?n.push({...i,offset:r,content:o+i.content}):n.push({content:o,offset:r},i),r=void 0,o=""):n.push(i)}),n})}function cnt(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const o=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!o)return n;const[,r,i,s]=o;if(!r&&!s)return n;const a=[{...n,offset:n.offset+r.length,content:i}];return r&&a.unshift({content:r,offset:n.offset}),s&&a.push({content:s,offset:n.offset+r.length+i.length}),a}))}function dnt(e){return e.map(t=>{const n=[];for(const o of t){if(n.length===0){n.push({...o});continue}const r=n[n.length-1],i=yL(r.htmlStyle||HE(r)),s=yL(o.htmlStyle||HE(o)),a=r.fontStyle&&(r.fontStyle&eo.Underline||r.fontStyle&eo.Strikethrough),c=o.fontStyle&&(o.fontStyle&eo.Underline||o.fontStyle&eo.Strikethrough);!a&&!c&&i===s?r.content+=o.content:n.push({...o})}return n})}const fnt=Itt;function hnt(e,t,n){const o={meta:{},options:n,codeToHast:(i,s)=>KE(e,i,s),codeToTokens:(i,s)=>zE(e,i,s)};let r=fnt(KE(e,t,n,o));for(const i of GE(n))r=i.postprocess?.call(o,r,n)||r;return r}const fY={light:"#333333",dark:"#bbbbbb"},hY={light:"#fffffe",dark:"#1e1e1e"},pY="__shiki_resolved";function Mk(e){if(e?.[pY])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:o}=t;if(!n||!o){const a=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;a?.settings?.foreground&&(o=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!o&&t?.colors?.["editor.foreground"]&&(o=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),o||(o=t.type==="light"?fY.light:fY.dark),n||(n=t.type==="light"?hY.light:hY.dark),t.fg=o,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const i=new Map;function s(a){if(i.has(a))return i.get(a);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?s(a):(i.set(a,c),c)}t.settings=t.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),p=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!p)return a;const u={...a,settings:{...a.settings}};if(c){const l=s(a.settings.foreground);t.colorReplacements[l]=a.settings.foreground,u.settings.foreground=l}if(p){const l=s(a.settings.background);t.colorReplacements[l]=a.settings.background,u.settings.background=l}return u});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const c=s(t.colors[a]);t.colorReplacements[c]=t.colors[a],t.colors[a]=c}return Object.defineProperty(t,pY,{enumerable:!1,writable:!1,value:!0}),t}async function xde(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ide(t)).map(async t=>await Pde(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Bde(e){return(await Promise.all(e.map(async n=>jde(n)?null:Mk(await Pde(n))))).filter(n=>!!n)}let pnt=3;function mnt(e,t=3){t>pnt||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Vy=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function kde(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Vy(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class gnt extends Pet{constructor(t,n,o,r={}){super(t),this._resolver=t,this._themes=n,this._langs=o,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Mk(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=BE.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=kde(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const o={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,o);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),o=n.filter(([r,i])=>!i);if(o.length){const r=n.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(c=>o.map(([p])=>p).includes(c)):!1).filter(i=>!o.includes(i));throw new Vy(`Missing languages ${o.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const o of n)this._langGraph.set(o,this._langMap.get(o))}}class bnt{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:o=>t.createScanner(o),createOnigString:o=>t.createString(o)},n.forEach(o=>this.addLanguage(o))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let o=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");o=[...o,...this._injections.get(i)||[]]}return o}}let PS=0;function ynt(e){PS+=1,e.warnings!==!1&&PS>=10&&PS%10===0&&console.warn(`[Shiki] ${PS} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Vy("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),o=(e.themes||[]).flat(1).map(Mk),r=new bnt(e.engine,n),i=new gnt(r,o,n,e.langAlias);let s;function a(S){return kde(S,e.langAlias)}function c(S){y();const w=i.getGrammar(typeof S=="string"?S:S.name);if(!w)throw new Vy(`Language \`${S}\` not found, you may need to load it first`);return w}function p(S){if(S==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=i.getTheme(S);if(!w)throw new Vy(`Theme \`${S}\` not found, you may need to load it first`);return w}function u(S){y();const w=p(S);s!==S&&(i.setTheme(w),s=S);const R=i.getColorMap();return{theme:w,colorMap:R}}function l(){return y(),i.getLoadedThemes()}function d(){return y(),i.getLoadedLanguages()}function f(...S){y(),i.loadLanguages(S.flat(1))}async function h(...S){return f(await xde(S))}function m(...S){y();for(const w of S.flat(1))i.loadTheme(w)}async function g(...S){return y(),m(await Bde(S))}function y(){if(t)throw new Vy("Shiki instance has been disposed")}function _(){t||(t=!0,i.dispose(),PS-=1)}return{setTheme:u,getTheme:p,getLanguage:c,getLoadedThemes:l,getLoadedLanguages:d,resolveLangAlias:a,loadLanguage:h,loadLanguageSync:f,loadTheme:g,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ant(e){e.engine||mnt("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,o]=await Promise.all([Bde(e.themes||[]),xde(e.langs||[]),e.engine]);return ynt({...e,themes:t,langs:n,engine:o})}async function _nt(e){const t=await Ant(e);return{getLastGrammarState:(...n)=>tnt(t,...n),codeToTokensBase:(n,o)=>Rk(t,n,o),codeToTokensWithThemes:(n,o)=>Fde(t,n,o),codeToTokens:(n,o)=>zE(t,n,o),codeToHast:(n,o)=>KE(t,n,o),codeToHtml:(n,o)=>hnt(t,n,o),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function vnt(e){const t=e.langs,n=e.themes,o=e.engine;async function r(i){function s(l){if(typeof l=="string"){if(l=i.langAlias?.[l]||l,Ide(l))return[];const d=t[l];if(!d)throw new nr(`Language \`${l}\` is not included in this bundle. You may want to load it from external source.`);return d}return l}function a(l){if(jde(l))return"none";if(typeof l=="string"){const d=n[l];if(!d)throw new nr(`Theme \`${l}\` is not included in this bundle. You may want to load it from external source.`);return d}return l}const c=(i.themes??[]).map(l=>a(l)),p=(i.langs??[]).map(l=>s(l)),u=await _nt({engine:i.engine??o(),...i,themes:c,langs:p});return{...u,loadLanguage(...l){return u.loadLanguage(...l.map(s))},loadTheme(...l){return u.loadTheme(...l.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}function Snt(e){let t;async function n(o={}){if(t){const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}else{t=e({...o,themes:[],langs:[]});const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}}return n}function Cnt(e,t){const n=Snt(e);async function o(r,i){const s=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),a=await t?.guessEmbeddedLanguages?.(r,i.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,i){return(await o(r,i)).codeToHtml(r,i)},async codeToHast(r,i){return(await o(r,i)).codeToHast(r,i)},async codeToTokens(r,i){return(await o(r,i)).codeToTokens(r,i)},async codeToTokensBase(r,i){return(await o(r,i)).codeToTokensBase(r,i)},async codeToTokensWithThemes(r,i){return(await o(r,i)).codeToTokensWithThemes(r,i)},async getLastGrammarState(r,i){return(await n({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(r,i)}}}const Ude=[{id:"abap",name:"ABAP",import:(()=>te(()=>import("./abap.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>te(()=>import("./actionscript-3.js"),[]))},{id:"ada",name:"Ada",import:(()=>te(()=>import("./ada.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>te(()=>import("./angular-html.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>te(()=>import("./angular-ts.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>te(()=>import("./apache.js"),[]))},{id:"apex",name:"Apex",import:(()=>te(()=>import("./apex.js"),[]))},{id:"apl",name:"APL",import:(()=>te(()=>import("./apl.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>te(()=>import("./applescript.js"),[]))},{id:"ara",name:"Ara",import:(()=>te(()=>import("./ara.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>te(()=>import("./asciidoc.js"),[]))},{id:"asm",name:"Assembly",import:(()=>te(()=>import("./asm.js"),[]))},{id:"astro",name:"Astro",import:(()=>te(()=>import("./astro.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>te(()=>import("./awk.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>te(()=>import("./ballerina.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>te(()=>import("./bat.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>te(()=>import("./beancount.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>te(()=>import("./berry.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>te(()=>import("./bibtex.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>te(()=>import("./bicep.js"),[]))},{id:"blade",name:"Blade",import:(()=>te(()=>import("./blade.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>te(()=>import("./bsl.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>te(()=>import("./c.js"),[]))},{id:"c3",name:"C3",import:(()=>te(()=>import("./c3.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>te(()=>import("./cadence.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>te(()=>import("./cairo.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>te(()=>import("./clarity.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>te(()=>import("./clojure.js"),[]))},{id:"cmake",name:"CMake",import:(()=>te(()=>import("./cmake.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>te(()=>import("./cobol.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>te(()=>import("./codeowners.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>te(()=>import("./codeql.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>te(()=>import("./coffee.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>te(()=>import("./common-lisp.js"),[]))},{id:"coq",name:"Coq",import:(()=>te(()=>import("./coq.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>te(()=>import("./cpp.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>te(()=>import("./crystal.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>te(()=>import("./csharp.js"),[]))},{id:"css",name:"CSS",import:(()=>te(()=>import("./css.js"),[]))},{id:"csv",name:"CSV",import:(()=>te(()=>import("./csv.js"),[]))},{id:"cue",name:"CUE",import:(()=>te(()=>import("./cue.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>te(()=>import("./cypher.js"),[]))},{id:"d",name:"D",import:(()=>te(()=>import("./d.js"),[]))},{id:"dart",name:"Dart",import:(()=>te(()=>import("./dart.js"),[]))},{id:"dax",name:"DAX",import:(()=>te(()=>import("./dax.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>te(()=>import("./desktop.js"),[]))},{id:"diff",name:"Diff",import:(()=>te(()=>import("./diff.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>te(()=>import("./docker.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>te(()=>import("./dotenv.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>te(()=>import("./dream-maker.js"),[]))},{id:"edge",name:"Edge",import:(()=>te(()=>import("./edge.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>te(()=>import("./elixir.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>te(()=>import("./elm.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>te(()=>import("./emacs-lisp.js"),[]))},{id:"erb",name:"ERB",import:(()=>te(()=>import("./erb.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>te(()=>import("./erlang.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>te(()=>import("./fennel.js"),[]))},{id:"fish",name:"Fish",import:(()=>te(()=>import("./fish.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>te(()=>import("./fluent.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>te(()=>import("./fortran-fixed-form.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>te(()=>import("./fortran-free-form.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>te(()=>import("./fsharp.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>te(()=>import("./gdresource.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>te(()=>import("./gdscript.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>te(()=>import("./gdshader.js"),[]))},{id:"genie",name:"Genie",import:(()=>te(()=>import("./genie.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>te(()=>import("./gherkin.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>te(()=>import("./git-commit.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>te(()=>import("./git-rebase.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>te(()=>import("./gleam.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>te(()=>import("./glimmer-js.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>te(()=>import("./glimmer-ts.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>te(()=>import("./glsl.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>te(()=>import("./gn.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>te(()=>import("./gnuplot.js"),[]))},{id:"go",name:"Go",import:(()=>te(()=>import("./go.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>te(()=>import("./graphql.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>te(()=>import("./groovy.js"),[]))},{id:"hack",name:"Hack",import:(()=>te(()=>import("./hack.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>te(()=>import("./haml.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>te(()=>import("./handlebars.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>te(()=>import("./haskell.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>te(()=>import("./haxe.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>te(()=>import("./hcl.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>te(()=>import("./hjson.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>te(()=>import("./hlsl.js"),[]))},{id:"html",name:"HTML",import:(()=>te(()=>import("./html.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>te(()=>import("./html-derivative.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>te(()=>import("./http.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>te(()=>import("./hurl.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>te(()=>import("./hxml.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>te(()=>import("./hy.js"),[]))},{id:"imba",name:"Imba",import:(()=>te(()=>import("./imba.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>te(()=>import("./ini.js"),[]))},{id:"java",name:"Java",import:(()=>te(()=>import("./java.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>te(()=>import("./javascript.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>te(()=>import("./jinja.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>te(()=>import("./jison.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>te(()=>import("./json.js"),[]))},{id:"json5",name:"JSON5",import:(()=>te(()=>import("./json5.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>te(()=>import("./jsonc.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>te(()=>import("./jsonl.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>te(()=>import("./jsonnet.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>te(()=>import("./jssm.js"),[]))},{id:"jsx",name:"JSX",import:(()=>te(()=>import("./jsx.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>te(()=>import("./julia.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>te(()=>import("./kdl.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>te(()=>import("./kotlin.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>te(()=>import("./kusto.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>te(()=>import("./latex.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>te(()=>import("./lean.js"),[]))},{id:"less",name:"Less",import:(()=>te(()=>import("./less.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>te(()=>import("./liquid.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>te(()=>import("./llvm.js"),[]))},{id:"log",name:"Log file",import:(()=>te(()=>import("./log.js"),[]))},{id:"logo",name:"Logo",import:(()=>te(()=>import("./logo.js"),[]))},{id:"lua",name:"Lua",import:(()=>te(()=>import("./lua.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>te(()=>import("./luau.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>te(()=>import("./make.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>te(()=>import("./markdown.js"),[]))},{id:"marko",name:"Marko",import:(()=>te(()=>import("./marko.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>te(()=>import("./matlab.js"),[]))},{id:"mdc",name:"MDC",import:(()=>te(()=>import("./mdc.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>te(()=>import("./mdx.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>te(()=>import("./mermaid.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>te(()=>import("./mipsasm.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>te(()=>import("./mojo.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>te(()=>import("./moonbit.js"),[]))},{id:"move",name:"Move",import:(()=>te(()=>import("./move.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>te(()=>import("./narrat.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>te(()=>import("./nextflow.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>te(()=>import("./nginx.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>te(()=>import("./nim.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>te(()=>import("./nix.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>te(()=>import("./nushell.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>te(()=>import("./objective-c.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>te(()=>import("./objective-cpp.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>te(()=>import("./ocaml.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>te(()=>import("./openscad.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>te(()=>import("./pascal.js"),[]))},{id:"perl",name:"Perl",import:(()=>te(()=>import("./perl.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>te(()=>import("./php.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>te(()=>import("./pkl.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>te(()=>import("./plsql.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>te(()=>import("./po.js"),[]))},{id:"polar",name:"Polar",import:(()=>te(()=>import("./polar.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>te(()=>import("./postcss.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>te(()=>import("./powerquery.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>te(()=>import("./powershell.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>te(()=>import("./prisma.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>te(()=>import("./prolog.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>te(()=>import("./proto.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>te(()=>import("./pug.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>te(()=>import("./puppet.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>te(()=>import("./purescript.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>te(()=>import("./python.js"),[]))},{id:"qml",name:"QML",import:(()=>te(()=>import("./qml.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>te(()=>import("./qmldir.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>te(()=>import("./qss.js"),[]))},{id:"r",name:"R",import:(()=>te(()=>import("./r.js"),[]))},{id:"racket",name:"Racket",import:(()=>te(()=>import("./racket.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>te(()=>import("./raku.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>te(()=>import("./razor.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>te(()=>import("./reg.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>te(()=>import("./regexp.js"),[]))},{id:"rel",name:"Rel",import:(()=>te(()=>import("./rel.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>te(()=>import("./riscv.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>te(()=>import("./rosmsg.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>te(()=>import("./rst.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>te(()=>import("./ruby.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>te(()=>import("./rust.js"),[]))},{id:"sas",name:"SAS",import:(()=>te(()=>import("./sas.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>te(()=>import("./sass.js"),[]))},{id:"scala",name:"Scala",import:(()=>te(()=>import("./scala.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>te(()=>import("./scheme.js"),[]))},{id:"scss",name:"SCSS",import:(()=>te(()=>import("./scss.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>te(()=>import("./sdbl.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>te(()=>import("./shaderlab.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>te(()=>import("./shellscript.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>te(()=>import("./shellsession.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>te(()=>import("./smalltalk.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>te(()=>import("./solidity.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>te(()=>import("./soy.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>te(()=>import("./sparql.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>te(()=>import("./splunk.js"),[]))},{id:"sql",name:"SQL",import:(()=>te(()=>import("./sql.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>te(()=>import("./ssh-config.js"),[]))},{id:"stata",name:"Stata",import:(()=>te(()=>import("./stata.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>te(()=>import("./stylus.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>te(()=>import("./svelte.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>te(()=>import("./swift.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>te(()=>import("./system-verilog.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>te(()=>import("./systemd.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>te(()=>import("./talonscript.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>te(()=>import("./tasl.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>te(()=>import("./tcl.js"),[]))},{id:"templ",name:"Templ",import:(()=>te(()=>import("./templ.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>te(()=>import("./terraform.js"),[]))},{id:"tex",name:"TeX",import:(()=>te(()=>import("./tex.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>te(()=>import("./toml.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>te(()=>import("./ts-tags.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>te(()=>import("./tsv.js"),[]))},{id:"tsx",name:"TSX",import:(()=>te(()=>import("./tsx.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>te(()=>import("./turtle.js"),[]))},{id:"twig",name:"Twig",import:(()=>te(()=>import("./twig.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>te(()=>import("./typescript.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>te(()=>import("./typespec.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>te(()=>import("./typst.js"),[]))},{id:"v",name:"V",import:(()=>te(()=>import("./v.js"),[]))},{id:"vala",name:"Vala",import:(()=>te(()=>import("./vala.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>te(()=>import("./vb.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>te(()=>import("./verilog.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>te(()=>import("./vhdl.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>te(()=>import("./viml.js"),[]))},{id:"vue",name:"Vue",import:(()=>te(()=>import("./vue.js"),__vite__mapDeps([92,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>te(()=>import("./vue-html.js"),__vite__mapDeps([93,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>te(()=>import("./vue-vine.js"),__vite__mapDeps([94,3,5,67,95,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>te(()=>import("./vyper.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>te(()=>import("./wasm.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>te(()=>import("./wenyan.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>te(()=>import("./wgsl.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>te(()=>import("./wikitext.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>te(()=>import("./wit.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>te(()=>import("./wolfram.js"),[]))},{id:"xml",name:"XML",import:(()=>te(()=>import("./xml.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>te(()=>import("./xsl.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>te(()=>import("./yaml.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>te(()=>import("./zenscript.js"),[]))},{id:"zig",name:"Zig",import:(()=>te(()=>import("./zig.js"),[]))}],wnt=Object.fromEntries(Ude.map(e=>[e.id,e.import])),Ont=Object.fromEntries(Ude.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Tnt={...wnt,...Ont},Rnt=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>te(()=>import("./andromeeda.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>te(()=>import("./aurora-x.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>te(()=>import("./ayu-dark.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>te(()=>import("./catppuccin-frappe.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>te(()=>import("./catppuccin-latte.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>te(()=>import("./catppuccin-macchiato.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>te(()=>import("./catppuccin-mocha.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>te(()=>import("./dark-plus.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>te(()=>import("./dracula.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>te(()=>import("./dracula-soft.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>te(()=>import("./everforest-dark.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>te(()=>import("./everforest-light.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>te(()=>import("./github-dark.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>te(()=>import("./github-dark-default.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>te(()=>import("./github-dark-dimmed.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>te(()=>import("./github-dark-high-contrast.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>te(()=>import("./github-light.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>te(()=>import("./github-light-default.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>te(()=>import("./github-light-high-contrast.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-hard.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-medium.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-soft.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>te(()=>import("./gruvbox-light-hard.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>te(()=>import("./gruvbox-light-medium.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>te(()=>import("./gruvbox-light-soft.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>te(()=>import("./houston.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>te(()=>import("./kanagawa-dragon.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>te(()=>import("./kanagawa-lotus.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>te(()=>import("./kanagawa-wave.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>te(()=>import("./laserwave.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>te(()=>import("./light-plus.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>te(()=>import("./material-theme.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>te(()=>import("./material-theme-darker.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>te(()=>import("./material-theme-lighter.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>te(()=>import("./material-theme-ocean.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>te(()=>import("./material-theme-palenight.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>te(()=>import("./min-dark.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>te(()=>import("./min-light.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>te(()=>import("./monokai.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>te(()=>import("./night-owl.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>te(()=>import("./nord.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>te(()=>import("./one-dark-pro.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>te(()=>import("./one-light.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>te(()=>import("./plastic.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>te(()=>import("./poimandres.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>te(()=>import("./red.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>te(()=>import("./rose-pine.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>te(()=>import("./rose-pine-dawn.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>te(()=>import("./rose-pine-moon.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>te(()=>import("./slack-dark.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>te(()=>import("./slack-ochin.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>te(()=>import("./snazzy-light.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>te(()=>import("./solarized-dark.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>te(()=>import("./solarized-light.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>te(()=>import("./synthwave-84.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>te(()=>import("./tokyo-night.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>te(()=>import("./vesper.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>te(()=>import("./vitesse-black.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>te(()=>import("./vitesse-dark.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>te(()=>import("./vitesse-light.js"),[]))}],Ent=Object.fromEntries(Rnt.map(e=>[e.id,e.import]));class Pk extends Error{constructor(t){super(t),this.name="ShikiError"}}function Mnt(){return 2147483648}function Pnt(){return typeof performance<"u"?performance.now():Date.now()}const Int=(e,t)=>e+(t-e%t)%t;async function jnt(e){let t,n;const o={};function r(f){n=f,o.HEAPU8=new Uint8Array(f),o.HEAPU32=new Uint32Array(f)}function i(f,h,m){o.HEAPU8.copyWithin(f,h,h+m)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function a(f){const h=o.HEAPU8.length;f=f>>>0;const m=Mnt();if(f>m)return!1;for(let g=1;g<=4;g*=2){let y=h*(1+.2/g);y=Math.min(y,f+100663296);const _=Math.min(m,Int(Math.max(f,y),65536));if(s(_))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function p(f,h,m=1024){const g=h+m;let y=h;for(;f[y]&&!(y>=g);)++y;if(y-h>16&&f.buffer&&c)return c.decode(f.subarray(h,y));let _="";for(;h>10,56320|E&1023)}}return _}function u(f,h){return f?p(o.HEAPU8,f,h):""}const l={emscripten_get_now:Pnt,emscripten_memcpy_big:i,emscripten_resize_heap:a,fd_write:()=>0};async function d(){const h=await e({env:l,wasi_snapshot_preview1:l});t=h.memory,r(t.buffer),Object.assign(o,h),o.UTF8ToString=u}return await d(),o}var Dnt=Object.defineProperty,Nnt=(e,t,n)=>t in e?Dnt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mr=(e,t,n)=>Nnt(e,typeof t!="symbol"?t+"":t,n);let Tr=null;function Lnt(e){throw new Pk(e.UTF8ToString(e.getLastOnigError()))}class LP{constructor(t){mr(this,"utf16Length"),mr(this,"utf8Length"),mr(this,"utf16Value"),mr(this,"utf8Value"),mr(this,"utf16OffsetToUtf8"),mr(this,"utf8OffsetToUtf16");const n=t.length,o=LP._utf8ByteLength(t),r=o!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=o);const s=r?new Uint32Array(o+1):null;r&&(s[o]=n);const a=new Uint8Array(o);let c=0;for(let p=0;p=55296&&u<=56319&&p+1=56320&&f<=57343&&(l=(u-55296<<10)+65536|f-56320,d=!0)}r&&(i[p]=c,d&&(i[p+1]=c),l<=127?s[c+0]=p:l<=2047?(s[c+0]=p,s[c+1]=p):l<=65535?(s[c+0]=p,s[c+1]=p,s[c+2]=p):(s[c+0]=p,s[c+1]=p,s[c+2]=p,s[c+3]=p)),l<=127?a[c++]=l:l<=2047?(a[c++]=192|(l&1984)>>>6,a[c++]=128|(l&63)>>>0):l<=65535?(a[c++]=224|(l&61440)>>>12,a[c++]=128|(l&4032)>>>6,a[c++]=128|(l&63)>>>0):(a[c++]=240|(l&1835008)>>>18,a[c++]=128|(l&258048)>>>12,a[c++]=128|(l&4032)>>>6,a[c++]=128|(l&63)>>>0),d&&p++}this.utf16Length=n,this.utf8Length=o,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let o=0,r=t.length;o=55296&&i<=56319&&o+1=56320&&c<=57343&&(s=(i-55296<<10)+65536|c-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&o++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const FP=class gl{constructor(t){if(mr(this,"id",++gl.LAST_ID),mr(this,"_onigBinding"),mr(this,"content"),mr(this,"utf16Length"),mr(this,"utf8Length"),mr(this,"utf16OffsetToUtf8"),mr(this,"utf8OffsetToUtf16"),mr(this,"ptr"),!Tr)throw new Pk("Must invoke loadWasm first.");this._onigBinding=Tr,this.content=t;const n=new LP(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!gl._sharedPtrInUse?(gl._sharedPtr||(gl._sharedPtr=Tr.omalloc(1e4)),gl._sharedPtrInUse=!0,Tr.HEAPU8.set(n.utf8Value,gl._sharedPtr),this.ptr=gl._sharedPtr):this.ptr=n.createString(Tr)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===gl._sharedPtr?gl._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};mr(FP,"LAST_ID",0);mr(FP,"_sharedPtr",0);mr(FP,"_sharedPtrInUse",!1);let qde=FP;class Fnt{constructor(t){if(mr(this,"_onigBinding"),mr(this,"_ptr"),!Tr)throw new Pk("Must invoke loadWasm first.");const n=[],o=[];for(let a=0,c=t.length;a{let o=e;return o=await o,typeof o=="function"&&(o=await o(n)),typeof o=="function"&&(o=await o(n)),xnt(o)?o=await o.instantiator(n):Bnt(o)?o=await o.default(n):(knt(o)&&(o=o.data),Unt(o)?typeof WebAssembly.instantiateStreaming=="function"?o=await Vnt(o)(n):o=await Hnt(o)(n):qnt(o)?o=await YN(o)(n):o instanceof WebAssembly.Module?o=await YN(o)(n):"default"in o&&o.default instanceof WebAssembly.Module&&(o=await YN(o.default)(n))),"instance"in o&&(o=o.instance),"exports"in o&&(o=o.exports),o})}return FT=t(),FT}function YN(e){return t=>WebAssembly.instantiate(e,t)}function Vnt(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Hnt(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Gnt(e){return e&&await Jnt(e),{createScanner(t){return new Fnt(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new qde(t)}}}const znt=vnt({langs:Tnt,themes:Ent,engine:()=>Gnt(te(()=>import("./wasm2.js"),[]))}),{getSingletonHighlighter:mY}=Cnt(znt,{guessEmbeddedLanguages:Ftt});async function Knt(e,t){try{return await mY({langs:[e],themes:t})}catch(n){if(n instanceof Error&&n.message.includes("Language"))return await mY({langs:["plaintext"],themes:t});throw n}}var Jde=(e,t,n,o={})=>BZe(e,t,n,Knt,o),Qnt=UZe(Jde),$nt=Qnt;const Vde=({code:e,language:t,theme:n={dark:"kanagawa-wave",light:"kanagawa-lotus"},className:o,addDefaultStyles:r=!0,showLanguage:i=!1,...s})=>{const a="aui-shiki-base [&_pre]:overflow-x-auto [&_pre]:rounded-b-lg [&_pre]:!bg-muted/75 [&_pre]:p-4";return Jde(e,t,n)?F.jsx($nt,{...s,language:t,theme:n,addDefaultStyles:r,showLanguage:i,defaultColor:"light-dark()",className:ke(a,o),children:e.trim()}):F.jsx("div",{className:"px-[12px] pb-[12px] bg-[var(--chat-message-code-block-background-color)] rounded-b-[12px]",children:F.jsx("pre",{className:ke("overflow-x-auto bg-[var(--chat-message-code-block-pre-background-color)] border border-[var(--chat-message-code-block-border-color)] rounded-[4px] p-[6px]",o),children:e.trim()})})};Vde.displayName="SyntaxHighlighter";const Wnt=({copiedDuration:e=3e3}={})=>{const[t,n]=x.useState(!1);return{isCopied:t,copyToClipboard:r=>{r&&navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},Ynt=({language:e,code:t})=>{const{isCopied:n,copyToClipboard:o}=Wnt(),{t:r}=Wt(),i=()=>{!t||n||o(t)};return F.jsxs("div",{className:"mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-[var(--chat-message-code-block-background-color)] text-[var(--chat-message-code-block-header-color)] text-[14px] leading-[20px] px-[12px] pt-[12px] pb-[8px]",children:[F.jsx("span",{className:"lowercase",children:e}),F.jsxs(lp,{tooltip:r("CopyToClipboard"),onClick:i,visible:!n,children:[!n&&F.jsx(Vt,{iconName:"btn-copy",size:24}),n&&F.jsx(Vt,{iconName:"checked",size:24,isStroke:!0,disableHover:!0})]})]})},Hde=uYe({SyntaxHighlighter:Vde,h1:({className:e,...t})=>F.jsx("h1",{className:ke("mb-8 scroll-m-20 text-[28px] leading-[36px] font-bold last:mb-0 text-[var(--chat-message-color)]",e),...t}),h2:({className:e,...t})=>F.jsx("h2",{className:ke("mb-4 mt-8 scroll-m-20 text-[24px] leading-[32px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),h3:({className:e,...t})=>F.jsx("h3",{className:ke("mb-4 mt-6 scroll-m-20 text-[20px] leading-[28px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),h4:({className:e,...t})=>F.jsx("h4",{className:ke("mb-4 mt-6 scroll-m-20 text-[18px] leading-[24px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),h5:({className:e,...t})=>F.jsx("h5",{className:ke("my-4 text-[16px] leading-[22px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),h6:({className:e,...t})=>F.jsx("h6",{className:ke("my-4 text-[14px] leading-[20px] font-bold first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),p:({className:e,...t})=>F.jsx("p",{className:ke("mb-5 mt-5 text-[14px] font-normal leading-[20px] first:mt-0 last:mb-0 text-[var(--chat-message-color)]",e),...t}),a:({className:e,...t})=>F.jsx("a",{className:ke("text-[var(--chat-link-color)] font-medium underline underline-offset-4",e),...t,target:"_blank"}),blockquote:({className:e,...t})=>F.jsx("blockquote",{className:ke("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>F.jsx("ul",{className:ke("my-5 ml-6 list-disc [&>li]:mt-[4px] text-[var(--chat-message-color)]",e),...t}),ol:({className:e,...t})=>F.jsx("ol",{className:ke("my-5 ml-6 list-decimal [&>li]:mt-[4px] text-[var(--chat-message-color)]",e),...t}),hr:({className:e,...t})=>F.jsx("hr",{className:ke("my-5 border-b border-[var(--chat-message-divider-color)]",e),...t}),table:({className:e,...t})=>F.jsx("table",{className:ke("my-5 w-full border-separate border-spacing-0 overflow-y-auto text-[var(--chat-message-color)]",e),...t}),th:({className:e,...t})=>F.jsx("th",{className:ke("px-4 py-2 border-b border-[var(--chat-message-divider-color)] text-left text-[var(--chat-message-th-color)] text-[14px] leading-[20px] font-bold [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),td:({className:e,...t})=>F.jsx("td",{className:ke("border-b border-[var(--chat-message-divider-color)] text-[var(--chat-message-td-color)] text-[14px] leading-[20px] px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),tr:({className:e,...t})=>F.jsx("tr",{className:ke("m-0 border-b border-[var(--chat-message-divider-color)]",e),...t}),sup:({className:e,...t})=>F.jsx("sup",{className:ke("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>F.jsx("div",{className:"px-[12px] pb-[12px] bg-[var(--chat-message-code-block-background-color)] rounded-[12px]",children:F.jsx("pre",{className:ke("overflow-x-auto bg-[var(--chat-message-code-block-pre-background-color)] border border-[var(--chat-message-code-block-border-color)] rounded-[4px] p-[6px]",e),...t})}),code:function({className:t,...n}){const o=Fce();return F.jsx("code",{className:ke(!o&&"font-bold italic",t),...n})},CodeHeader:Ynt}),Xnt=()=>F.jsx(OYe,{remarkPlugins:[lde],className:"aui-md",components:Hde}),Znt=({children:e})=>F.jsx("div",{className:"aui-md",children:F.jsx(Lce,{remarkPlugins:[lde],components:Hde,children:e})}),ert=x.memo(Xnt),gY=x.memo(Znt),bY=({text:e,type:t,parentId:n})=>{const{t:o}=Wt(),[r,i]=x.useState(!0);return F.jsx(F.Fragment,{children:t==="reasoning"?F.jsxs("div",{className:"my-[8px] flex w-full flex-col",children:[F.jsxs("div",{className:"flex items-center gap-[10px] cursor-pointer mb-[8px]",onClick:()=>i(s=>!s),children:[n?F.jsx(tr,{name:"tool.called",size:16,noColor:!0}):F.jsx(KA,{size:16}),F.jsxs("div",{className:"flex items-center bg-[var(--background-normal-element)] rounded-[4px] gap-[8px] ps-[4px] pe-[8px]",children:[F.jsx(tr,{name:"btn-extended-thinking",size:24}),F.jsx("span",{className:"text-[14px] font-normal leading-[20px] text-[var(--chat-message-color)] ",children:o("Thinking")})]}),F.jsx(tr,{name:"arrow.right",size:16,width:8,height:8,isStroke:!0,isTransform:!r})]}),!r&&F.jsx("div",{className:"ps-[12px] ms-[13px] border-l-[var(--border-divider)] border-l-[1px]",children:F.jsx(gY,{children:e})})]}):F.jsx(gY,{children:e})})},trt=()=>F.jsx(dte,{children:F.jsx(bte,{className:"border border-[var(--chat-message-error-border-color)] rounded-[4px] p-[6px]",children:F.jsx(yte,{className:"text-[var(--chat-message-error-color)] text-[14px] leading-[20px] font-normal"})})}),nrt=()=>{const{t:e}=Wt(),{isStreamRunning:t,messages:n}=QA(),o=oee();if(o.status?.type==="incomplete"&&o.status?.error)return;const r=()=>{const i=n[Number(o.parentId)],s=$te([i,o]),a=tje(s);window.AscDesktopEditor.SaveFilenameDialog(`${a}.docx`,c=>{c&&window.AscDesktopEditor.saveAndOpen(s,92,c,65,p=>{p||console.log("Conversion error")})})};return F.jsxs(pee,{hidden:t,className:"col-start-3 row-start-2 ml-3 mt-3 flex gap-[8px]",children:[F.jsx(mee,{asChild:!0,children:F.jsxs(lp,{tooltip:e("CopyToClipboard"),children:[F.jsx(B2,{copied:!0,children:F.jsx(Vt,{iconName:"checked",size:24,isStroke:!0,disabled:!0})}),F.jsx(B2,{copied:!1,children:F.jsx(Vt,{iconName:"btn-copy",size:24})})]})}),F.jsx("div",{children:F.jsx(lp,{tooltip:e("Save"),children:F.jsx(Vt,{iconName:"btn-save",size:24,onClick:r,isStroke:!0})})})]})},rrt=()=>F.jsx(qF,{asChild:!0,children:F.jsxs(tk.div,{className:"relative mx-auto grid w-full max-w-[var(--thread-max-width)] grid-cols-[auto_auto_1fr] grid-rows-[auto_1fr] px-[var(--thread-padding-x)] py-4",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":"assistant",children:[F.jsxs("div",{className:"leading-[20px] text-[14px] col-span-2 col-start-2 row-start-1 ml-4 break-words leading-7 text-[var(--chat-message-color)]",children:[F.jsx(JF,{components:{tools:{Fallback:mle},Reasoning:bY,Text:bY}}),F.jsx(trt,{})]}),F.jsx(nrt,{})]})}),ort=(e,t,n,o)=>e?"pdf":t?"documents":n?"spreadsheets":o?"presentations":"unknown-format",AL=({file:e,withoutClose:t})=>{const{isRTL:n}=wn(),{deleteAttachmentFile:o,deleteAttachmentImage:r}=CP(),i=()=>{"path"in e&&e.path&&o(e.path),"name"in e&&e.name&&r(e.name)},s="path"in e?e.path.includes("\\")?e.path.split("\\").pop()??"":e.path.split("/").pop()??"":e.name,a=s.split(".").pop()??"",c=s.replace(`.${a}`,""),p="type"in e?Yte(e.type):!1,u="type"in e?Zte(e.type):!1,l="type"in e?oE(e.type):!1,d="type"in e?Xte(e.type):!1,f=ort(u,p,l,d),h="base64"in e;return F.jsxs("div",{className:ke("w-fit flex flex-row items-center gap-[12px] h-[36px] rounded-[8px] box-border border-[var(--file-items-border-color)]",h?n?"p-0 pl-[4px]":"p-0 pr-[4px]":"p-[4px]",t?n?"cursor-pointer pl-[24px]":"cursor-pointer pr-[24px]":"",t?"bg-[var(--file-items-chat-background-color)]":"border bg-[var(--file-items-background-color)]",t?"hover:bg-[var(--file-items-chat-hover-background-color)]":"",t?"active:bg-[var(--file-items-chat-pressed-background-color)]":""),onClick:()=>{!t||!("path"in e)||window.AscDesktopEditor.openTemplate(e.path,s)},children:["base64"in e?F.jsx("img",{className:ke("w-[36px] h-[36px]",n?"rounded-r-[8px]":"rounded-l-[8px]"),src:e.base64,alt:""}):F.jsxs("div",{className:"flex flex-row items-center h-[24px] gap-[4px]",children:[F.jsx(tr,{name:f,size:24,noColor:!0}),F.jsxs("p",{className:"text-[var(--file-items-color)] font-normal text-[14px] leading-[20px] whitespace-nowrap overflow-hidden text-ellipsis",children:[c,F.jsxs("span",{className:"text-[var(--file-items-ext-color)]",children:[".",a]})]})]}),t?null:F.jsx(Vt,{iconName:"btn-close.small",size:16,onClick:i})]})},irt=e=>Zte(e)?"pdf":oE(e)?"spreadsheets":Yte(e)?"documents":Xte(e)?"presentations":"unknown-format",srt=()=>{const[e,t]=Re.useState(!1),n=Re.useRef(null),{addAttachmentFile:o,addAttachmentImage:r}=CP(),i=f=>{t(f)},s=(f,h)=>{const m=oE(h);window.AscDesktopEditor.convertFileExternal(f,m?260:69,(g,y)=>{if(y){console.log("Error:",y);return}const _=new Uint8Array(g.content),w=new TextDecoder("utf-8").decode(_);o({path:f,content:w,type:h})})},a=()=>{window.AscDesktopEditor.OpenFilenameDialog("",!0,f=>{Array.isArray(f)&&f.forEach((h,m)=>{if(m>5)return;const g=window.AscDesktopEditor.getOfficeFileType(h),y=oE(g);window.AscDesktopEditor.convertFileExternal(h,y?260:69,(_,S)=>{if(S){console.log("Error:",S);return}const w=new Uint8Array(_.content),E=new TextDecoder("utf-8").decode(w);o({path:h,content:E||"",type:g})})})})},c=JSON.parse(window.AscDesktopEditor?.callToolFunction("recent_files_reader")??"{}")?.files?.filter(f=>!f.url)?.map(f=>{const h=irt(f.type);return{text:f.path.includes("\\")?f.path.split("\\").pop()??"":f.path.split("/").pop()??"",key:f.path,id:f.path,icon:F.jsx(Vt,{iconName:h,size:24,disableHover:!0,noColor:!0}),onClick:()=>s(f.path,f.type)}}).filter(Boolean),{t:p}=Wt(),u=F.jsx(lp,{tooltip:p("Attachments"),visible:!e,children:F.jsx(Vt,{iconName:"attachment",size:24,className:"cursor-pointer rounded-[4px] outline-none",isStroke:!0,isActive:e,"data-testid":"attachment-button"})}),l=[{text:p("AddLocalFile"),onClick:()=>a()},{text:p("AddLocalImage"),onClick:()=>n.current?.click()}];c.length>0&&(l.push({text:"",onClick:()=>{},isSeparator:!0}),l.push({text:p("RecentFiles"),onClick:()=>{},subMenu:c}));const d=f=>{const h=f.target.files;h&&(Array.from(h).forEach(m=>{const g=new FileReader;g.onload=y=>{const _=y.target?.result;r({name:m.name,base64:_})},g.readAsDataURL(m)}),f.target.value="")};return F.jsxs(F.Fragment,{children:[F.jsx("input",{ref:n,type:"file",accept:"image/*",multiple:!0,onChange:d,className:"hidden"}),F.jsx(pb,{trigger:u,items:l,onOpenChange:i})]})},xP=({placeholder:e,value:t,className:n,isError:o,withoutBg:r,items:i,"data-testid":s})=>{const{isRTL:a}=wn(),[c,p]=Re.useState(!1),u=Re.useRef(null);return F.jsx(pb,{onOpenChange:l=>p(l),trigger:F.jsxs("div",{ref:u,"data-testid":s,className:ke("h-[32px] rounded-[4px] ps-[12px] pe-[12px] box-border","cursor-pointer flex items-center justify-between","text-[var(--input-color)] text-[14px] leading-[16px]",a?"flex-row-reverse":"",c?"border bg-[var(--input-background-color)] border-[var(--input-active-border-color)]":r?"hover:bg-[var(--input-hover-background-color)) hover:border-[var(--input-hover-border-color)]":"border bg-[var(--input-background-color)] border-[var(--input-border-color)] hover:bg-[var(--input-hover-background-color)] hover:border-[var(--input-hover-border-color)]",n,i.length===0?"cursor-not-allowed pointer-events-none opacity-50":""),style:{borderColor:o?"var(--border-error)":void 0},children:[F.jsx("span",{className:ke(t?"text-[var(--input-color)]":"text-[var(--input-placeholder-color)]"),children:t||e}),F.jsx(tr,{name:"arrow.bottom",size:16,color:"var(--input-color)",width:8,height:8,isStroke:!0,className:ke("transition-transform","ms-[8px]",c?"rotate-180":"")})]}),align:"start",side:"bottom",containerRef:u.current,matchTriggerWidth:!0,items:i})},art=()=>{const{currentModel:e,selectModel:t}=GA(),{providers:n,providersModels:o,currentProvider:r,setCurrentProvider:i}=gi(),{tools:s}=Ds(),{messages:a}=QA(),{t:c}=Wt(),p=Re.useCallback((d,f)=>{if(e?.id===f&&on.currentProviderInfo?.name===d.name)return;const h=o.get(d.name)?.find(m=>m.id===f);h&&(on.currentProviderInfo?.name!==d.name&&(i(d),on.setCurrentProviderModel(f),on.setCurrentProviderTools(s),on.setCurrentProviderPrevMessages(a)),t(h))},[o,a,s,e,t,i]),u=n.map(d=>({text:d.name,id:d.name,onClick:()=>{},subMenu:o.get(d.name)?.map(f=>({text:f.name,id:f.id,onClick:()=>p(d,f.id),isActive:!1,checked:f.id===e?.id&&d.name===on.currentProviderInfo?.name}))||[]})).filter(d=>d.subMenu.length>0),l=n.some(d=>d.name===r?.name);return Re.useEffect(()=>{if((!e||!r)&&n.length>0){const d=n[0],f=o.get(d.name)?.[0];if(!f)return;p(d,f.id)}},[e,r,n,o,p]),F.jsx(xP,{placeholder:c("SelectModel"),value:l&&e?.name||"",items:u,withoutBg:!0,"data-testid":"model-selector"})},yY="rounded-[4px] cursor-pointer disabled:cursor-not-allowed flex items-center justify-center bg-[var(--chat-composer-action-send-background-color)] hover:enabled:bg-[var(--chat-composer-action-send-background-hover-color)] active:enabled:bg-[var(--chat-composer-action-send-background-pressed-color)] disabled:opacity-[0.5]",lrt=()=>{const{isStreamRunning:e}=QA(),{currentModel:t}=GA(),{currentProvider:n}=gi();return e?F.jsx(x0e,{asChild:!0,children:F.jsx(Vt,{iconName:"stop",size:24,className:yY,width:12,height:12,"data-testid":"stop-button"})}):F.jsx(tE,{running:!1,children:F.jsx(A0e,{asChild:!0,disabled:!t||!n,children:F.jsx(Vt,{iconName:"arrow.top",size:24,width:12,height:14,color:"var(--chat-composer-action-send-color)",className:yY,"data-testid":"send-button"})})})},urt=()=>{const{servers:e,changeToolStatus:t,webSearchEnabled:n,getWebSearchEnabled:o}=Ds(),{extendedThinking:r,toggleExtendedThinking:i}=GA(),[s,a]=x.useState(!1),{t:c}=Wt(),p=x.useMemo(()=>F.jsx(lp,{visible:!s,tooltip:c("MCPServers"),children:F.jsx(Vt,{iconName:"tools",size:24,width:12,height:16,isActive:s})}),[s,c]),u=x.useMemo(()=>[{text:c("WebSearch"),onClick:()=>{},icon:F.jsx(Vt,{iconName:"btn-web-search",size:24,disableHover:!0}),withToggle:!0,toggleChecked:o()?n:!1,toggleDisabled:!o(),tooltipText:o()?"":c("EnableWebSearch"),onToggleChange:()=>{t("web-search",e["web-search"][0].name,!n),window.dispatchEvent(new CustomEvent("tools-changed"))}},{text:c("ExtendedThinking"),icon:F.jsx(Vt,{iconName:"btn-extended-thinking",size:24,disableHover:!0}),onClick:()=>{},withToggle:!0,toggleChecked:r,onToggleChange:i,withAbout:!0,aboutContent:F.jsx("p",{className:"p-[16px] text-[11px] leading-[16px] text-[var(--text-secondary)]",children:c("ExtendedThinkingDescription")})},{text:"",onClick:()=>{},isSeparator:!0},...Object.entries(e).map(([f,h])=>{if(f==="web-search")return{text:f,onClick:()=>{},subMenu:[]};const m=h.some(g=>g.enabled);return{text:f,onClick:()=>{},subMenu:[{text:"All tools",onClick:()=>{},withToggle:!0,toggleChecked:m,onToggleChange:()=>{m?h.forEach(g=>{t(f,g.name,!1)}):h.forEach(g=>{t(f,g.name,!0)})}},{text:"",onClick:()=>{},isSeparator:!0},...h.map(g=>({text:g.name,onClick:()=>{},withToggle:!0,toggleChecked:g.enabled,onToggleChange:y=>{t(f,g.name,y)}}))]}}).filter(f=>f.subMenu.length>2)],[e,t,c,n,o,i,r]),l=x.useMemo(()=>[...u],[u]);if(!e||!u.length)return null;const d=f=>{a(f)};return F.jsx(pb,{trigger:p,items:l,onOpenChange:d})},crt=()=>F.jsx("div",{className:"relative flex flex-col",children:F.jsxs("div",{className:"relative flex items-center justify-between h-[24px]",children:[F.jsxs("div",{className:"flex items-center gap-[12px] flex-row",children:[F.jsx(srt,{}),F.jsx(urt,{})]}),F.jsxs("div",{className:"flex items-center gap-[12px] flex-row",children:[F.jsx(art,{}),F.jsx(lrt,{})]})]})}),AY=()=>{const{attachmentFiles:e,attachmentImages:t}=CP(),{currentProvider:n}=gi(),{currentModel:o}=GA(),{t:r}=Wt();return F.jsxs("div",{className:"relative mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-[8px] px-[var(--thread-padding-x)] pb-[16px]",children:[F.jsxs(hte,{className:"composer-root relative flex w-full flex-col gap-[16px] rounded-[16px] border px-[24px] py-[16px] box-border",children:[e.length||t.length?F.jsxs("div",{className:"flex flex-row gap-[8px] overflow-x-auto",children:[e.map(i=>F.jsx(AL,{file:i},i.path)),t.map(i=>F.jsx(AL,{file:i},i.name))]}):null,F.jsx(gte,{placeholder:r("AskAI"),className:"composer-input max-h-[calc(50vh)] min-h-[16px] w-full resize-none outline-none",rows:1,autoFocus:!0,"aria-label":"Message input",disabled:!n||!o,"data-testid":"composer-input"}),F.jsx(crt,{})]}),F.jsx("p",{className:"text-center font-normal text-[12px] leading-[16px] text-[var(--text-tertiary)]",children:r("CheckInfo")})]})},drt=()=>{const e=oee(),{isRTL:t}=wn(),n=e.content.filter(r=>r.type==="image").map(r=>r.image),o=e.content.filter(r=>r.type==="file").map(r=>({type:JSON.parse(r.mimeType).type,content:r.data,path:JSON.parse(r.mimeType).path}));return F.jsx(qF,{asChild:!0,children:F.jsxs(tk.div,{dir:t?"rtl":"ltr",className:"mx-auto grid w-full max-w-[var(--thread-max-width)] auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-1 px-[var(--thread-padding-x)] py-4 [&:where(>*)]:col-start-2",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":"user",children:[n.length>0||o.length>0?F.jsx("div",{className:"col-span-full col-start-1 row-start-1 mb-[8px] overflow-x-auto",children:F.jsxs("div",{className:"flex flex-row gap-[8px] w-max justify-end ms-auto",children:[n.map(r=>F.jsx("img",{src:r,alt:"",className:"h-[72px] w-[72px] rounded-[8px] object-cover"},r)),o.map(r=>F.jsx(AL,{file:r,withoutClose:!0},r.path))]})}):null,F.jsx("div",{className:ke("bg-[var(--chat-user-message-background)] text-[var(--chat-user-message-color)] col-start-2 break-words rounded-[16px] px-[12px] py-[8px]",t?"rounded-bl-[0px]":"rounded-br-[0px]"),children:F.jsx(JF,{components:{Text:ert,Image:()=>null}})})]})})},frt=()=>{const{t:e}=Wt();return F.jsx(_te,{children:F.jsx("div",{className:"mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col px-[var(--thread-padding-x)] justify-center items-center mb-[16px]",children:F.jsxs("div",{className:"max-w-[490px] flex flex-col items-center gap-[16px] text-center",children:[F.jsx("p",{className:"font-[700] text-[32px] leading-[24px]",style:{color:"var(--chat-welcome-color)"},children:e("WelcomeTitle")}),F.jsx("p",{className:"text-[20px] leading-[20px]",style:{color:"var(--chat-welcome-description-color)"},children:e("WelcomeDescription")})]})})})},hrt=()=>{const{isStreamRunning:e,isRequestRunning:t}=QA(),{t:n}=Wt();return F.jsxs(Ate,{className:"flex h-full flex-col",style:{"--thread-max-width":"687px","--thread-padding-x":"1rem"},children:[F.jsx(tE,{empty:!0,children:F.jsx(k2,{className:"relative flex min-w-0 flex-1 flex-col overflow-y-auto justify-center items-center",children:F.jsxs("div",{className:"flex flex-col gap-[24px] w-full",children:[F.jsx(frt,{}),F.jsx(AY,{})]})})}),F.jsxs(tE,{empty:!1,children:[F.jsxs(k2,{className:"relative flex min-w-0 flex-1 flex-col gap-6 overflow-y-auto",children:[F.jsx(G0e,{components:{UserMessage:drt,AssistantMessage:rrt}}),!t&&e?F.jsx("div",{className:"flex items-center justify-center",children:F.jsxs("div",{className:"flex items-center gap-[8px] w-[var(--thread-max-width)] max-w-[var(--thread-max-width)] ps-[var(--thread-padding-x)]",children:[F.jsx(KA,{}),F.jsx("p",{className:"text-[14px] leading-[20px] font-normal text-[var(--chat-message-analyze-color)]",children:n("Analyzing")})]})}):null,F.jsx(tk.div,{className:"min-h-6 min-w-6 shrink-0"})]}),F.jsx(AY,{})]})]})},prt=()=>{const{t:e}=Wt(),{setCurrentPage:t}=RC();return F.jsx("div",{className:"flex items-center justify-center h-full",children:F.jsxs("div",{className:"max-w-[573px] text-center flex flex-col items-center gap-[40px]",children:[F.jsxs("div",{className:"flex flex-col gap-[16px]",children:[F.jsx("h1",{className:"select-none text-center text-[32px] font-bold leading-[36px] text-[var(--empty-screen-color)]",children:e("ConnectAIModel")}),F.jsx("p",{className:"select-none text-center text-[16px] font-normal leading-[24px] text-[var(--empty-screen-description-color)]",children:e("ConnectAIModelDescription")})]}),F.jsx(Bn,{onClick:()=>t("settings"),children:e("ConnectAIModelBtn")})]})})};function mrt(e,t=[]){let n=[];function o(i,s){const a=x.createContext(s),c=n.length;n=[...n,s];const p=l=>{const{scope:d,children:f,...h}=l,m=d?.[e]?.[c]||a,g=x.useMemo(()=>h,Object.values(h));return F.jsx(m.Provider,{value:g,children:f})};p.displayName=i+"Provider";function u(l,d){const f=d?.[e]?.[c]||a,h=x.useContext(f);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[p,u]}const r=()=>{const i=n.map(s=>x.createContext(s));return function(a){const c=a?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,grt(r,...t)]}function grt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:p})=>{const l=c(i)[`__scope${p}`];return{...a,...l}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function brt(e){const t=yrt(e),n=x.forwardRef((o,r)=>{const{children:i,...s}=o,a=x.Children.toArray(i),c=a.find(_rt);if(c){const p=c.props.children,u=a.map(l=>l===c?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:l);return F.jsx(t,{...s,ref:r,children:x.isValidElement(p)?x.cloneElement(p,void 0,u):null})}return F.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function yrt(e){const t=x.forwardRef((n,o)=>{const{children:r,...i}=n;if(x.isValidElement(r)){const s=Srt(r),a=vrt(i,r.props);return r.type!==x.Fragment&&(a.ref=o?Er(o,s):s),x.cloneElement(r,a)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Art=Symbol("radix.slottable");function _rt(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Art}function vrt(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Srt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Crt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],BP=Crt.reduce((e,t)=>{const n=brt(`Primitive.${t}`),o=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),kP="Tabs",[wrt]=mrt(kP,[bP]),Gde=bP(),[Ort,Ik]=wrt(kP),zde=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:c="automatic",...p}=e,u=pB(a),[l,d]=jA({prop:o,onChange:r,defaultProp:i??"",caller:kP});return F.jsx(Ort,{scope:n,baseId:hm(),value:l,onValueChange:d,orientation:s,dir:u,activationMode:c,children:F.jsx(BP.div,{dir:u,"data-orientation":s,...p,ref:t})})});zde.displayName=kP;var Kde="TabsList",Qde=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=Ik(Kde,n),s=Gde(n);return F.jsx(gae,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:o,children:F.jsx(BP.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});Qde.displayName=Kde;var $de="TabsTrigger",Wde=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,s=Ik($de,n),a=Gde(n),c=Zde(s.baseId,o),p=efe(s.baseId,o),u=o===s.value;return F.jsx(bae,{asChild:!0,...a,focusable:!r,active:u,children:F.jsx(BP.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":p,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...i,ref:t,onMouseDown:lt(e.onMouseDown,l=>{!r&&l.button===0&&l.ctrlKey===!1?s.onValueChange(o):l.preventDefault()}),onKeyDown:lt(e.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&s.onValueChange(o)}),onFocus:lt(e.onFocus,()=>{const l=s.activationMode!=="manual";!u&&!r&&l&&s.onValueChange(o)})})})});Wde.displayName=$de;var Yde="TabsContent",Xde=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...s}=e,a=Ik(Yde,n),c=Zde(a.baseId,o),p=efe(a.baseId,o),u=o===a.value,l=x.useRef(u);return x.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),F.jsx(ql,{present:r||u,children:({present:d})=>F.jsx(BP.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:p,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});Xde.displayName=Yde;function Zde(e,t){return`${e}-trigger-${t}`}function efe(e,t){return`${e}-content-${t}`}var Trt=zde,Rrt=Qde,Ert=Wde,Mrt=Xde;const Prt=({items:e,defaultValue:t,value:n,onValueChange:o,className:r})=>{const{isRTL:i}=wn();return F.jsxs(Trt,{defaultValue:t||e[0]?.value,value:n,onValueChange:o,className:ke("w-full",r),children:[F.jsx(Rrt,{className:ke("w-full inline-flex h-[32px] gap-[20px] items-center border-b-[1px] border-[var(--tabs-border-color)]",i?"flex-row-reverse":""),children:e.map(s=>F.jsx(Ert,{value:s.value,disabled:s.disabled,className:ke("font-normal text-[14px] leading-[20px] text-[var(--tabs-color)] cursor-pointer pb-[3px] relative","hover:enabled:data-[state=inactive]:after:content-[''] hover:enabled:data-[state=inactive]:after:absolute hover:enabled:data-[state=inactive]:after:bottom-[-5px] hover:enabled:data-[state=inactive]:after:left-1/2 hover:enabled:data-[state=inactive]:after:transform hover:enabled:data-[state=inactive]:after:-translate-x-1/2 hover:enabled:data-[state=inactive]:after:w-[24px] hover:enabled:data-[state=inactive]:after:h-[4px] hover:enabled:data-[state=inactive]:after:bg-[var(--tabs-hover-border-color)] hover:enabled:data-[state=inactive]:after:rounded-t-[3px]","data-[state=active]:font-bold data-[state=active]:after:content-[''] data-[state=active]:after:absolute data-[state=active]:after:bottom-[-5px] data-[state=active]:after:left-0 data-[state=active]:after:right-0 data-[state=active]:after:h-[4px] data-[state=active]:after:bg-[var(--tabs-active-border-color)] data-[state=active]:after:rounded-t-[3px]","disabled:opacity-50 disabled:cursor-not-allowed"),children:s.label},s.value))}),e.map(s=>F.jsx(Mrt,{value:s.value,className:"mt-[24px]",children:s.content},s.value))]})},Tl=({children:e,header:t,error:n})=>{const{isRTL:o}=wn();return F.jsxs("div",{className:ke("flex flex-col gap-[4px]",o?"items-end":""),children:[F.jsx("p",{className:ke("select-none text-[14px] leading-[20px] text-[var(--field-container-header-color)]",o?"text-end":""),children:t}),e,n&&F.jsx("p",{className:ke("text-[var(--field-container-error-color)]",o?"text-end":""),children:n})]})},tfe="flex flex-col justify-between h-full",nfe="flex flex-col gap-[12px] mb-[32px]",rfe="flex flex-row justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",ofe="flex flex-row-reverse justify-end items-center gap-[8px] h-[64px] border-t-[1px] border-[var(--border-divider)] mx-[-32px] px-[32px]",_Y=on.getProvidersInfo(),Irt=({onClose:e})=>{const{addProvider:t}=gi(),{isRTL:n}=wn(),{t:o}=Wt(),[r,i]=Re.useState(_Y[0]),[s,a]=Re.useState({name:"",url:r.baseUrl,key:""}),[c,p]=Re.useState({key:"",url:"",name:""}),[u,l]=Re.useState(!1),d=Re.useRef(u),f=Re.useRef(null),h=Re.useRef(null),[m,g]=Re.useState(void 0),y=R=>{const{name:E,value:T}=R.target,D=E==="name"?Wte(T):T;a(B=>({...B,[E]:D})),p(B=>({...B,[E]:""}))},_=s.name.trim(),S=!_||!s.url||!!c.key||!!c.url||!!c.name,w=Re.useCallback(async()=>{if(d.current||S)return;d.current=!0,l(!0);const R=await t({type:r.type,name:_,key:s.key,baseUrl:s.url});typeof R=="boolean"&&R?e():R&&p(E=>({...E,[R.field]:R.message})),d.current=!1,l(!1)},[t,r,s,e,S,_]);return Re.useEffect(()=>{a(R=>({...R,url:r.baseUrl,key:""})),p({key:"",url:"",name:""})},[r]),Re.useEffect(()=>{if(h.current&&m===void 0){const R=h.current.offsetWidth+1;g(R)}},[m]),Re.useEffect(()=>{const R=E=>{E.key==="Enter"&&(E.preventDefault(),w())};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[w]),F.jsx(Dm,{open:!0,children:F.jsx(Nm,{header:o("AddProvider"),onClose:e,ref:f,children:F.jsxs("div",{className:tfe,children:[F.jsxs("div",{className:nfe,children:[F.jsx(Tl,{header:o("Provider"),children:F.jsx(xP,{className:"w-full",value:r.name,items:_Y.map(R=>({text:R.name,id:R.name,onClick:()=>i(R)}))})}),F.jsx(Tl,{header:o("Name"),error:c.name,children:F.jsx(Il,{name:"name",onChange:y,value:s.name,isError:!!c.name,placeholder:o("EnterName"),className:"w-full",maxLength:128})}),F.jsx(Tl,{header:o("URL"),error:c.url,children:F.jsx(Il,{name:"url",onChange:y,value:s.url,isError:!!c.url,placeholder:o("EnterURL"),className:"w-full"})}),F.jsx(Tl,{header:o("APIKey"),error:c.key,children:F.jsx(Il,{name:"key",onChange:y,value:s.key,isError:!!c.key,placeholder:o("EnterKey"),className:"w-full",type:"password"})})]}),F.jsxs("div",{className:n?ofe:rfe,children:[F.jsx(Bn,{variant:"default",onClick:e,children:o("Cancel")}),F.jsx(Bn,{ref:h,onClick:w,disabled:S||u,style:m?{width:`${m}px`}:void 0,children:u?F.jsx(KA,{className:"border-[var(--text-contrast-background)] border-r-transparent"}):o("AddProvider")})]})]})})})},jrt=({name:e,onClose:t})=>{const{providers:n,deleteProvider:o}=gi(),{isRTL:r}=wn(),[i,s]=Re.useState(()=>{const p=n.find(u=>u.name===e);return p||{name:"",type:"",icon:"",key:"",baseUrl:""}}),{t:a}=Wt();Re.useEffect(()=>{const p=n.find(u=>u.name===e);p&&s(p)},[n,e]);const c=Re.useCallback(async()=>{await o(i),t()},[o,i,t]);return Re.useEffect(()=>{const p=u=>{u.key==="Enter"&&(u.preventDefault(),c())};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[c]),F.jsx(Dm,{open:!0,children:F.jsx(Nm,{header:a("Warning"),onClose:t,withWarningIcon:!0,children:F.jsxs("div",{className:"flex flex-col justify-between h-full",children:[F.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:a("WantDeleteProvider")}),F.jsxs("div",{className:r?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[F.jsx(Bn,{variant:"default",onClick:t,children:a("No")}),F.jsx(Bn,{onClick:c,children:a("Yes")})]})]})})})},Drt=({name:e,onClose:t})=>{const{t:n}=Wt(),{isRTL:o}=wn(),{providers:r,editProvider:i,currentProvider:s,setCurrentProvider:a}=gi(),[c,p]=Re.useState(()=>{const L=r.find(q=>q.name===e);return L||{name:"",type:"",icon:"",key:"",baseUrl:""}}),[u,l]=Re.useState({name:c?.name,url:c?.baseUrl,key:c?.key}),[d,f]=Re.useState({key:"",url:"",name:""}),[h,m]=Re.useState(!1),g=Re.useRef(h),y=Re.useRef(null),[_,S]=Re.useState(void 0);Re.useEffect(()=>{const L=r.find(q=>q.name===e);L&&(p(L),l({name:L.name,url:L.baseUrl,key:L.key}))},[r,e]),Re.useEffect(()=>{l({name:c.name,url:c.baseUrl,key:c.key})},[c]);const w=Re.useRef(null),R=L=>{const{name:q,value:I}=L.target,U=q==="name"?Wte(I):I;l(J=>({...J,[q]:U})),f(J=>({...J,[q]:""}))},E=u.name.trim(),T=E===c.name&&u.url===c.baseUrl,B=u.key===c.key&&T||!!d.key||!!d.url||!!d.name||!E,N=Re.useCallback(async()=>{if(g.current||B)return;g.current=!0,m(!0);const L={type:c?.type,name:E,key:u.key,baseUrl:u.url},q=await i(L,c.name);if(typeof q=="boolean"&&q){if(s?.name===c.name){const I={...c,...L};a(I),on.setCurrentProvider(I)}t()}else q&&f(I=>({...I,[q.field]:q.message}));g.current=!1,m(!1)},[B,i,c,u,t,s,a,E]);return Re.useEffect(()=>{if(y.current&&_===void 0){const L=y.current.offsetWidth+1;S(L)}},[_]),Re.useEffect(()=>{const L=q=>{q.key==="Enter"&&(q.preventDefault(),N())};return window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}},[N]),F.jsx(Dm,{open:!0,children:F.jsx(Nm,{header:n("EditAIProvider"),onClose:t,ref:w,children:F.jsxs("div",{className:tfe,children:[F.jsxs("div",{className:nfe,children:[F.jsx(Tl,{header:n("Provider"),children:F.jsx(xP,{value:c.type,items:[],className:"w-full"})}),F.jsx(Tl,{header:n("Name"),error:d.name,children:F.jsx(Il,{name:"name",onChange:R,value:u.name,isError:!!d.name,placeholder:n("EnterName"),className:"w-full"})}),F.jsx(Tl,{header:n("URL"),error:d.url,children:F.jsx(Il,{name:"url",onChange:R,value:u.url,isError:!!d.url,placeholder:n("EnterURL"),className:"w-full"})}),F.jsx(Tl,{header:n("APIKey"),error:d.key,children:F.jsx(Il,{name:"key",onChange:R,value:u.key,isError:!!d.key,placeholder:n("EnterKey"),className:"w-full",type:"password"})})]}),F.jsxs("div",{className:o?ofe:rfe,children:[F.jsx(Bn,{variant:"default",onClick:t,children:n("Cancel")}),F.jsx(Bn,{ref:y,onClick:N,disabled:B||h,style:_?{width:`${_}px`}:void 0,children:h?F.jsx(KA,{className:"border-[var(--text-contrast-background)] border-r-transparent"}):n("Save")})]})]})})})},Nrt=({provider:e})=>{const{providersModels:t}=gi(),{isRTL:n}=wn(),[o,r]=Re.useState(!1),[i,s]=Re.useState(!1),[a,c]=Re.useState(null),[p,u]=Re.useState(!1),l=Re.useCallback(h=>{c(h)},[]),{t:d}=Wt(),f=!!t.get(e.name)?.length;return F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:ke("flex justify-between gap-[12px] px-[16px] py-[12px] min-w-[274px] max-w-[312px] flex-1 rounded-[8px] bg-[var(--ai-provider-item-background-color)] shadow-[var(--ai-provider-item-shadow)]",n?"flex-row-reverse":"flex-row"),children:[F.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[F.jsxs("div",{className:ke("flex items-center gap-[4px]",n?"flex-row-reverse":"flex-row"),children:[F.jsxs(mA,{children:[F.jsx(bA,{asChild:!0,children:F.jsx("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--ai-provider-item-color)] truncate w-fit",children:e.name})}),F.jsx(gA,{side:"bottom",children:e.name})]}),!f&&F.jsxs(mA,{children:[F.jsx(bA,{asChild:!0,children:F.jsx("div",{children:F.jsx(Vt,{iconName:"status.error",size:16,disableHover:!0,noColor:!0})})}),F.jsx(gA,{side:"bottom",children:d("NoModelsAvailable")})]})]}),F.jsxs("p",{className:ke("text-[12px] leading-[14px] text-[var(--ai-provider-item-description-color)]",n?"text-end":""),children:[e.type,F.jsx("br",{}),e.baseUrl]})]}),F.jsx("div",{className:"flex items-center justify-end",ref:l,children:F.jsx(pb,{onOpenChange:u,trigger:F.jsx(Vt,{iconName:"more",size:20,isActive:p}),items:[{icon:F.jsx(Vt,{iconName:"btn-edit",size:20,disableHover:!0,isStroke:!0}),text:d("Edit"),onClick:()=>r(!0)},{text:"",onClick:()=>{},isSeparator:!0},{icon:F.jsx(Vt,{iconName:"btn-remove",size:20,disableHover:!0}),text:d("Delete"),onClick:()=>s(!0)}],side:n?"left":"right",align:n?"end":"start",sideOffset:0,containerRef:a})})]}),o?F.jsx(Drt,{name:e.name,onClose:()=>r(!1)}):null,i?F.jsx(jrt,{name:e.name,onClose:()=>s(!1)}):null]})},Lrt=({isActive:e})=>{const[t,n]=Re.useState(!1),{providers:o}=gi(),{isRTL:r}=wn(),{t:i}=Wt();return F.jsxs(F.Fragment,{children:[F.jsx("div",{className:ke("flex",r?"justify-end":"justify-start"),children:F.jsx(Bn,{className:"max-w-[fit-content]",onClick:()=>n(!0),disabled:!e,children:i("AddProvider")})}),F.jsx("div",{className:ke("flex flex-wrap gap-[16px]",e?"":"opacity-70 pointer-events-none"),children:o.map(s=>F.jsx(Nrt,{provider:s},s.name))}),t?F.jsx(Irt,{onClose:()=>n(!1)}):null]})},Frt=({name:e,onClose:t})=>{const{t:n}=Wt(),{isRTL:o}=wn(),{deleteCustomServer:r}=Ds(),i=Re.useCallback(()=>{r(e),t()},[r,e,t]);return Re.useEffect(()=>{const s=a=>{a.key==="Enter"&&(a.preventDefault(),i())};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[i]),F.jsx(Dm,{open:!0,children:F.jsx(Nm,{header:n("Warning"),onClose:t,withWarningIcon:!0,children:F.jsxs("div",{className:"flex flex-col justify-between h-full",children:[F.jsx("p",{className:"select-none h-[40px] flex items-center text-[12px] leading-[16px] text-[var(--text-normal)]",children:n("WantDeleteServer")}),F.jsxs("div",{className:o?"flex flex-row-reverse justify-end items-center gap-[8px] h-[48px]":"flex flex-row justify-end items-center gap-[8px] h-[48px]",children:[F.jsx(Bn,{variant:"default",onClick:t,children:n("No")}),F.jsx(Bn,{onClick:i,children:n("Yes")})]})]})})})},xrt=({type:e,open:t,onClose:n})=>{const{t:o}=Wt(),{isRTL:r}=wn(),[i,s]=Re.useState([]),{getCustomServersLogs:a}=Ds();Re.useEffect(()=>{const p=async()=>{const l=a();s(l[e])};p();const u=setInterval(()=>{p()},500);return()=>clearInterval(u)},[a,e]);const c=async()=>{await navigator.clipboard.writeText(i.join(` +`)),n()};return F.jsx(Dm,{open:t,children:F.jsxs(Nm,{header:`${e} ${o("logs").toLowerCase()}`,onClose:n,className:"w-[720px] h-[520px]",children:[F.jsx("div",{className:"flex flex-col gap-[8px] h-[400px] py-[8px]",children:F.jsx("div",{className:"flex flex-col border h-[384px] border-[var(--servers-logs-dialog-border-color)] overflow-y-auto rounded-[8px]",children:i.map(p=>F.jsx("p",{className:"text-[var(--servers-logs-dialog-log-color)] font-normal text-[14px] leading-[20px]",children:p},p))})}),F.jsxs("div",{className:ke("flex flex-row items-center justify-end gap-[16px] h-[64px] border-t border-[var(--servers-edit-config-buttons-border-color)] mx-[-32px] px-[32px]",r?"flex-row-reverse":""),children:[F.jsx(Bn,{onClick:c,variant:"default",children:o("CopyToClipboard")}),F.jsx(Bn,{onClick:n,children:o("Close")})]})]})})},vY=({name:e,mcpItems:t,isLoading:n,isSystem:o,disableEnable:r})=>{const{t:i}=Wt(),{isRTL:s}=wn(),[a,c]=Re.useState(!1),[p,u]=Re.useState(!1),[l,d]=Re.useState(!1),[f,h]=Re.useState(!1),[m,g]=Re.useState(!1),y=Re.useRef(null),{changeToolStatus:_}=Ds(),S=x.useCallback(()=>{t.filter(D=>!D.enabled).forEach(D=>{_(e,D.name,!0)})},[t,e,_]),w=x.useCallback(()=>{t.filter(D=>D.enabled).forEach(D=>{_(e,D.name,!1)})},[t,e,_]),R=x.useCallback(()=>d(!0),[]);Re.useEffect(()=>{n&&c(!1)},[n]),Re.useEffect(()=>{const D=setInterval(()=>{h(Ln.getCustomServersStoped().includes(e))},1e3);return()=>clearInterval(D)},[e]);const E=f?!1:n,T=x.useMemo(()=>{const D=[];return t.length>0&&(D.push({text:i("EnableAllTools"),onClick:S,withSpace:!o},{text:i("DisableAllTools"),onClick:w,withSpace:!o}),o||D.push({text:"",onClick:()=>{},isSeparator:!0})),o||D.push({icon:F.jsx(Vt,{iconName:"btn-reset",size:20,disableHover:!0,isStroke:!0}),text:i("Restart"),onClick:()=>Ln.restartCustomServer(e)},{icon:F.jsx(Vt,{iconName:"btn-menu-navigation",size:20,disableHover:!0,isStroke:!0}),text:i("Logs"),onClick:R},{text:"",onClick:()=>{},isSeparator:!0},{icon:F.jsx(Vt,{iconName:"btn-remove",size:20,disableHover:!0}),text:i("Delete"),onClick:()=>g(!0)}),D},[t.length,o,e,i,S,w,R]);return F.jsxs("div",{dir:s?"rtl":"ltr",className:"flex flex-col",children:[F.jsxs("div",{className:ke("h-[36px] px-[8px] rounded-[4px] flex items-center justify-between",E?"":"cursor-pointer",a?"bg-[var(--servers-available-tools-item-active-background-color)]":"bg-[var(--servers-available-tools-item-background-color)]",!n&&!a?"hover:bg-[var(--servers-available-tools-item-hover-background-color)]":""),onClick:()=>{n||p||t.length===0||c(D=>!D)},children:[F.jsxs("div",{className:"flex items-center gap-[8px]",children:[F.jsx(Vt,{iconName:"arrow.right",size:24,width:8,height:8,disableHover:!0,isStroke:!0,isTransform:a,className:s?"rotate-180":""}),F.jsx("p",{className:"text-[var(--servers-available-tools-item-name-color)]",children:e}),!E&&f?F.jsx(Vt,{iconName:"status.error",size:16,disableHover:!0,noColor:!0}):null,n?null:F.jsxs("p",{className:"font-normal text-[14px] text-[var(--servers-available-tools-sub-header-color)]",children:[F.jsx("span",{className:"text-[var(--servers-available-tools-current-tool-color)]",children:t.filter(D=>D.enabled).length}),"/",t.length," ",i("ToolsEnabled")]})]}),F.jsx("div",{ref:y,children:E?F.jsx(KA,{}):F.jsx(pb,{onOpenChange:u,trigger:F.jsx(Vt,{iconName:"more",size:20,isActive:p,insideElement:!0}),items:T,side:s?"left":"right",align:s?"end":"start",sideOffset:0,containerRef:y.current})})]}),a?F.jsx("div",{className:"flex flex-col gap-[12px] mt-[4px]",children:t.map(D=>{const B=o?`${D.description?.split(". ")[0]}.`:D.description;return F.jsxs("div",{className:ke("rounded-[4px] cursor-pointer flex flex-col hover:bg-[var(--servers-available-tools-item-hover-background-color)]",s?"pr-[40px] pl-[8px]":"pl-[40px] pr-[8px]"),onClick:()=>{_(e,D.name,!D.enabled)},children:[F.jsxs("div",{className:"flex items-center justify-between w-full",children:[F.jsx("p",{className:"text-[var(--servers-available-tools-item-name-color)]",children:D.name}),F.jsx(Zae,{checked:D.enabled??!1,disabled:r&&!D.enabled,onCheckedChange:()=>{}})]}),B&&F.jsxs(mA,{children:[F.jsx(bA,{asChild:!0,children:F.jsx("p",{className:"text-[13px] leading-[18px] line-clamp-2 text-[var(--servers-available-tools-sub-header-color)]",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:B})}),F.jsx(gA,{children:F.jsx("div",{className:"max-w-[300px]",children:B})})]})]},D.name)})}):null,l?F.jsx(xrt,{type:e,open:l,onClose:()=>d(!1)}):null,m?F.jsx(Frt,{name:e,onClose:()=>g(!1)}):null]})},Brt=()=>{const{t:e}=Wt(),{isRTL:t}=wn(),[n,o]=Re.useState({}),{servers:r,tools:i,webSearchEnabled:s}=Ds(),[a,c]=Re.useState(s?i.length-2:i.length);Re.useEffect(()=>{c(s?i.length-2:i.length)},[i.length,s]),Re.useEffect(()=>{o(Ln.getCustomServers());const u=setInterval(()=>{o(Ln.getCustomServers())},1e3);return()=>clearInterval(u)},[]);const p=s?i.length>=mR:i.length>=Wy;return F.jsxs("div",{className:"w-[640px] h-[560px] border border-[var(--servers-available-tools-border-color)] rounded-[8px] flex flex-col",children:[F.jsxs("div",{className:ke("min-h-[44px] h-[44px] flex items-center justify-between px-[16px] border-b border-[var(--servers-available-tools-border-color)]",t?"flex-row-reverse":""),children:[F.jsx("p",{className:"font-bold text-[14px] leading-[20px] text-[var(--servers-available-tools-header-color)]",children:e("AvailableTools")}),F.jsxs("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--servers-available-tools-sub-header-color)]",children:[F.jsx("span",{className:"text-[var(--servers-available-tools-current-tool-color)]",children:a}),"/",Wy," ",e("Tools")]})]}),F.jsxs("div",{dir:t?"rtl":"ltr",className:"flex flex-col gap-[8px] pt-[12px] pb-[16px] px-[8px] overflow-y-auto",children:[F.jsx(vY,{name:"desktop-editor",mcpItems:r["desktop-editor"]??[],isLoading:!1,isSystem:!0,disableEnable:p}),Object.keys(n).map(u=>F.jsx(vY,{name:u,mcpItems:r[u]??[],isLoading:!r[u]?.length,isSystem:!1,disableEnable:p},u))]})]})},ife=1024;let krt=0,XN=class{constructor(t,n){this.from=t,this.to=n}};class Nt{constructor(t={}){this.id=krt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=qo.match(t)),n=>{let o=t(n);return o===void 0?null:[this,o]}}}Nt.closedBy=new Nt({deserialize:e=>e.split(" ")});Nt.openedBy=new Nt({deserialize:e=>e.split(" ")});Nt.group=new Nt({deserialize:e=>e.split(" ")});Nt.isolate=new Nt({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Nt.contextHash=new Nt({perNode:!0});Nt.lookAhead=new Nt({perNode:!0});Nt.mounted=new Nt({perNode:!0});class C0{constructor(t,n,o,r=!1){this.tree=t,this.overlay=n,this.parser=o,this.bracketed=r}static get(t){return t&&t.props&&t.props[Nt.mounted.id]}}const Urt=Object.create(null);class qo{constructor(t,n,o,r=0){this.name=t,this.props=n,this.id=o,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Urt,o=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new qo(t.name||"",n,t.id,o);if(t.props){for(let i of t.props)if(Array.isArray(i)||(i=i(r)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Nt.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let o in t)for(let r of o.split(" "))n[r]=t[o];return o=>{for(let r=o.prop(Nt.group),i=-1;i<(r?r.length:0);i++){let s=n[i<0?o.name:r[i]];if(s)return s}}}}qo.none=new qo("",Object.create(null),0,8);class jk{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(s|xn.IncludeAnonymous);;){let p=!1;if(c.from<=i&&c.to>=r&&(!a&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;p=!0}for(;p&&o&&(a||!c.type.isAnonymous)&&o(c),!c.nextSibling();){if(!c.parent())return;p=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Lk(qo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,o,r)=>new Hn(this.type,n,o,r,this.propValues),t.makeTree||((n,o,r)=>new Hn(qo.none,n,o,r)))}static build(t){return Hrt(t)}}Hn.empty=new Hn(qo.none,[],[],0);class Dk{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Dk(this.buffer,this.index)}}class Sm{constructor(t,n,o){this.buffer=t,this.length=n,this.set=o}get type(){return qo.none}toString(){let t=[];for(let n=0;n0));c=s[c+3]);return a}slice(t,n,o){let r=this.buffer,i=new Uint16Array(n-t),s=0;for(let a=t,c=0;a=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function iC(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?c.length:-1;t!=u;t+=n){let l=c[t],d=p[t]+a.from;if(!(!(i&xn.EnterBracketed&&l instanceof Hn&&((s=C0.get(l))===null||s===void 0?void 0:s.overlay)===null&&(d>=o||d+l.length<=o))&&!sfe(r,o,d,d+l.length))){if(l instanceof Sm){if(i&xn.ExcludeBuffers)continue;let f=l.findChild(0,l.buffer.length,n,o-d,r);if(f>-1)return new dm(new qrt(a,l,t,d),null,f)}else if(i&xn.IncludeAnonymous||!l.type.isAnonymous||Nk(l)){let f;if(!(i&xn.IgnoreMounts)&&(f=C0.get(l))&&!f.overlay)return new Qi(f.tree,d,t,a);let h=new Qi(l,d,t,a);return i&xn.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?l.children.length-1:0,n,o,r,i)}}}if(i&xn.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,o=0){let r;if(!(o&xn.IgnoreOverlays)&&(r=C0.get(this._tree))&&r.overlay){let i=t-this.from,s=o&xn.EnterBracketed&&r.bracketed;for(let{from:a,to:c}of r.overlay)if((n>0||s?a<=i:a=i:c>i))return new Qi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,o)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function CY(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=r.type.is(n),!r.nextSibling())return i}for(;;){if(o!=null&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return o==null?i:[]}}function _L(e,t,n=t.length-1){for(let o=e;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class qrt{constructor(t,n,o,r){this.parent=t,this.buffer=n,this.index=o,this.start=r}}class dm extends afe{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,o){super(),this.context=t,this._parent=n,this.index=o,this.type=t.buffer.set.types[t.buffer.buffer[o]]}child(t,n,o){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,o);return i<0?null:new dm(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,o=0){if(o&xn.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return i<0?null:new dm(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new dm(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new dm(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:o}=this.context,r=this.index+4,i=o.buffer[this.index+3];if(i>r){let s=o.buffer[this.index+1];t.push(o.slice(r,i,s)),n.push(0)}return new Hn(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function lfe(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||s.to=t){let a=new Qi(s.tree,s.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(iC(a,t,n,!1))}}return r?lfe(r):o}class vL{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~xn.EnterBracketed,t instanceof Qi)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let o=t._parent;o;o=o._parent)this.stack.unshift(o.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:o,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=o+r.buffer[t+1],this.to=o+r.buffer[t+2],!0}yield(t){return t?t instanceof Qi?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,o){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,o,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,o);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,o=this.mode){return this.buffer?o&xn.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,o))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&xn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,o=this.stack.length-1;if(t<0){let r=o<0?0:this.stack[o]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(o<0?n.buffer.length:n.buffer[this.stack[o]+3]))return this.yieldBuf(r)}return o<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,o,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let i=n+t,s=t<0?-1:o._tree.children.length;i!=s;i+=t){let a=o._tree.children[i];if(this.mode&xn.IncludeAnonymous||a instanceof Sm||!a.type.isAnonymous||Nk(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let s=t;s;s=s._parent)if(s.index==r){if(r==this.index)return s;n=s,o=i+1;break e}r=this.stack[--i]}for(let r=o;r=0;i--){if(i<0)return _L(this._tree,t,r);let s=o[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(t[r]&&t[r]!=s.name)return!1;r--}}return!0}}function Nk(e){return e.children.some(t=>t instanceof Sm||!t.type.isAnonymous||Nk(t))}function Hrt(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=ife,reused:i=[],minRepeatType:s=o.types.length}=e,a=Array.isArray(n)?new Dk(n,n.length):n,c=o.types,p=0,u=0;function l(R,E,T,D,B,N){let{id:L,start:q,end:I,size:U}=a,J=u,V=p;if(U<0)if(a.next(),U==-1){let X=i[L];T.push(X),D.push(q-R);return}else if(U==-3){p=L;return}else if(U==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${U}`);let G=c[L],Q,le,K=q-R;if(I-q<=r&&(le=g(a.pos-E,B))){let X=new Uint16Array(le.size-le.skip),ce=a.pos-le.size,W=X.length;for(;a.pos>ce;)W=y(le.start,X,W);Q=new Sm(X,I-le.start,o),K=le.start-R}else{let X=a.pos-U;a.next();let ce=[],W=[],_e=L>=s?L:-1,Ne=0,Ie=I;for(;a.pos>X;)_e>=0&&a.id==_e&&a.size>=0?(a.end<=Ie-r&&(h(ce,W,q,Ne,a.end,Ie,_e,J,V),Ne=ce.length,Ie=a.end),a.next()):N>2500?d(q,X,ce,W):l(q,X,ce,W,_e,N+1);if(_e>=0&&Ne>0&&Ne-1&&Ne>0){let Me=f(G,V);Q=Lk(G,ce,W,0,ce.length,0,I-q,Me,Me)}else Q=m(G,ce,W,I-q,J-I,V)}T.push(Q),D.push(K)}function d(R,E,T,D){let B=[],N=0,L=-1;for(;a.pos>E;){let{id:q,start:I,end:U,size:J}=a;if(J>4)a.next();else{if(L>-1&&I=0;U-=3)q[J++]=B[U],q[J++]=B[U+1]-I,q[J++]=B[U+2]-I,q[J++]=J;T.push(new Sm(q,B[2]-I,o)),D.push(I-R)}}function f(R,E){return(T,D,B)=>{let N=0,L=T.length-1,q,I;if(L>=0&&(q=T[L])instanceof Hn){if(!L&&q.type==R&&q.length==B)return q;(I=q.prop(Nt.lookAhead))&&(N=D[L]+q.length+I)}return m(R,T,D,B,N,E)}}function h(R,E,T,D,B,N,L,q,I){let U=[],J=[];for(;R.length>D;)U.push(R.pop()),J.push(E.pop()+T-B);R.push(m(o.types[L],U,J,N-B,q-N,I)),E.push(B-T)}function m(R,E,T,D,B,N,L){if(N){let q=[Nt.contextHash,N];L=L?[q].concat(L):[q]}if(B>25){let q=[Nt.lookAhead,B];L=L?[q].concat(L):[q]}return new Hn(R,E,T,D,L)}function g(R,E){let T=a.fork(),D=0,B=0,N=0,L=T.end-r,q={size:0,start:0,skip:0};e:for(let I=T.pos-R;T.pos>I;){let U=T.size;if(T.id==E&&U>=0){q.size=D,q.start=B,q.skip=N,N+=4,D+=4,T.next();continue}let J=T.pos-U;if(U<0||J=s?4:0,G=T.start;for(T.next();T.pos>J;){if(T.size<0)if(T.size==-3||T.size==-4)V+=4;else break e;else T.id>=s&&(V+=4);T.next()}B=G,D+=U,N+=V}return(E<0||D==R)&&(q.size=D,q.start=B,q.skip=N),q.size>4?q:void 0}function y(R,E,T){let{id:D,start:B,end:N,size:L}=a;if(a.next(),L>=0&&D4){let I=a.pos-(L-4);for(;a.pos>I;)T=y(R,E,T)}E[--T]=q,E[--T]=N-R,E[--T]=B-R,E[--T]=D}else L==-3?p=D:L==-4&&(u=D);return T}let _=[],S=[];for(;a.pos>0;)l(e.start||0,e.bufferStart||0,_,S,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:_.length?S[0]+_[0].length:0;return new Hn(c[e.topID],_.reverse(),S.reverse(),w)}const wY=new WeakMap;function FR(e,t){if(!e.isAnonymous||t instanceof Sm||t.type!=e)return 1;let n=wY.get(t);if(n==null){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof Hn)){n=1;break}n+=FR(e,o)}wY.set(t,n)}return n}function Lk(e,t,n,o,r,i,s,a,c){let p=0;for(let h=o;h=u)break;E+=T}if(S==w+1){if(E>u){let T=h[w];f(T.children,T.positions,0,T.children.length,m[w]+_);continue}l.push(h[w])}else{let T=m[S-1]+h[S-1].length-R;l.push(Lk(e,h,m,w,S,R,T,null,c))}d.push(R+_-i)}}return f(t,n,o,r,0),(a||c)(l,d,s)}class Ug{constructor(t,n,o,r,i=!1,s=!1){this.from=t,this.to=n,this.tree=o,this.offset=r,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],o=!1){let r=[new Ug(0,t.length,t,0,!1,o)];for(let i of n)i.to>t.length&&r.push(i);return r}static applyChanges(t,n,o=128){if(!n.length)return t;let r=[],i=1,s=t.length?t[0]:null;for(let a=0,c=0,p=0;;a++){let u=a=o)for(;s&&s.from=d.from||l<=d.to||p){let f=Math.max(d.from,c)-p,h=Math.min(d.to,l)-p;d=f>=h?null:new Ug(f,h,d.tree,d.offset+p,a>0,!!u)}if(d&&r.push(d),s.to>l)break;s=inew XN(r.from,r.to)):[new XN(0,0)]:[new XN(0,t.length)],this.createParse(t,n||[],o)}parse(t,n,o){let r=this.startParse(t,n,o);for(;;){let i=r.advance();if(i)return i}}}class Grt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new Nt({perNode:!0});var OY={};class QE{constructor(t,n,o,r,i,s,a,c,p,u=0,l){this.p=t,this.stack=n,this.state=o,this.reducePos=r,this.pos=i,this.score=s,this.buffer=a,this.bufferBase=c,this.curContext=p,this.lookAhead=u,this.parent=l}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,o=0){let r=t.parser.context;return new QE(t,[],n,o,o,0,[],0,r?new TY(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let o=t>>19,r=t&65535,{parser:i}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(p==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,p)}storeNode(t,n,o,r=4,i=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==o)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=o;return}}}if(!i||this.pos==o)this.buffer.push(t,n,o,r);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let c=s;c>0&&this.buffer[c-2]>o;c-=4)if(this.buffer[c-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>o;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=o,this.buffer[s+3]=r}}shift(t,n,o,r){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let i=t,{parser:s}=this.p;this.pos=r,!s.stateFlag(i,1)&&(r>o||n<=s.maxNode)&&(this.reducePos=r),this.pushState(i,Math.min(o,this.reducePos)),this.shiftContext(n,o),n<=s.maxNode&&this.buffer.push(n,o,r,4)}else this.pos=r,this.shiftContext(n,o),n<=this.p.parser.maxNode&&this.buffer.push(n,o,r,4)}apply(t,n,o,r){t&65536?this.reduce(t):this.shift(t,n,o,r)}useNode(t,n){let o=this.p.reused.length-1;(o<0||this.p.reused[o]!=t)&&(this.p.reused.push(t),o++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(o,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let o=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new QE(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,o,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let o=t<=this.p.parser.maxNode;o&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,o?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new zrt(this);;){let o=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(o==0)return!1;if((o&65536)==0)return!0;n.reduce(o)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let i=0,s;ic&1&&a==s)||r.push(n[i],s)}n=r}let o=[];for(let r=0;r>19,r=n&65535,i=this.stack.length-o*3;if(i<0||t.getGoto(this.stack[i],r,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],o=(r,i)=>{if(!n.includes(r))return n.push(r),t.allActions(r,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-i;if(a>1){let c=s&65535,p=this.stack.length-a*3;if(p>=0&&t.getGoto(this.stack[p],c,!1)>=0)return a<<19|65536|c}}else{let a=o(s,i+1);if(a!=null)return a}})};return o(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class TY{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class zrt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,o=t>>19;o==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(o-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class $E{constructor(t,n,o){this.stack=t,this.pos=n,this.index=o,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new $E(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new $E(this.stack,this.pos,this.index)}}function BT(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let o=0,r=0;o=92&&s--,s>=34&&s--;let c=s-32;if(c>=46&&(c-=46,a=!0),i+=c,a)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class xR{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const RY=new xR;class Krt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=RY,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let o=this.range,r=this.rangeIndex,i=this.pos+t;for(;io.to:i>=o.to;){if(r==this.ranges.length-1)return null;let s=this.ranges[++r];i+=s.from-o.to,o=s}return i}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,o,r;if(n>=0&&n=this.chunk2Pos&&oa.to&&(this.chunk2=this.chunk2.slice(0,a.to-o)),r=this.chunk2.charCodeAt(0)}}return o>=this.token.lookAhead&&(this.token.lookAhead=o+1),r}acceptToken(t,n=0){let o=n?this.resolveOffset(n,-1):this.pos;if(o==null||o=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=RY,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let o="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(o+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return o}}class rA{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:o}=n.p;Qrt(this.data,t,n,this.id,o.data,o.tokenPrecTable)}}rA.prototype.contextual=rA.prototype.fallback=rA.prototype.extend=!1;rA.prototype.fallback=rA.prototype.extend=!1;function Qrt(e,t,n,o,r,i){let s=0,a=1<0){let h=e[f];if(c.allows(h)&&(t.token.value==-1||t.token.value==h||$rt(h,t.token.value,r,i))){t.acceptToken(h);break}}let u=t.next,l=0,d=e[s+2];if(t.next<0&&d>l&&e[p+d*3-3]==65535){s=e[p+d*3-1];continue e}for(;l>1,h=p+f+(f<<1),m=e[h],g=e[h+1]||65536;if(u=g)l=f+1;else{s=e[h+2],t.advance();continue e}}break}}function EY(e,t,n){for(let o=t,r;(r=e[o])!=65535;o++)if(r==n)return o-t;return-1}function $rt(e,t,n,o){let r=EY(n,o,t);return r<0||EY(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class Wrt{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?MY(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?MY(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=s,null;if(i instanceof Hn){if(s==t){if(s=Math.max(this.safeFrom,t)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class Yrt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(o=>new xR)}getActions(t){let n=0,o=null,{parser:r}=t.p,{tokenizers:i}=r,s=r.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,c=0;for(let p=0;pl.end+25&&(c=Math.max(l.lookAhead,c)),l.value!=0)){let d=n;if(l.extended>-1&&(n=this.addActions(t,l.extended,l.end,n)),n=this.addActions(t,l.value,l.end,n),!u.extend&&(o=l,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!o&&t.pos==this.stream.end&&(o=new xR,o.value=t.p.parser.eofTerm,o.start=o.end=t.pos,n=this.addActions(t,o.value,o.end,n)),this.mainToken=o,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new xR,{pos:o,p:r}=t;return n.start=o,n.end=Math.min(o+1,r.stream.end),n.value=o==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,o){let r=this.stream.clipPos(o.pos);if(n.token(this.stream.reset(r,t),o),t.value>-1){let{parser:i}=o.p;for(let s=0;s=0&&o.p.parser.dialect.allows(a>>1)){(a&1)==0?t.value=a>>1:t.extended=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,o,r){for(let i=0;it.bufferLength*4?new Wrt(o,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,o=this.stacks=[],r,i;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)o.push(a);else{if(this.advanceStack(a,o,t))continue;{r||(r=[],i=[]),r.push(a);let c=this.tokens.getMainToken(a);i.push(c.value,c.end)}}break}}if(!o.length){let s=r&&eot(r);if(s)return ti&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw ti&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let s=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,o);if(s)return ti&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(o.length>s)for(o.sort((a,c)=>c.score-a.score);o.length>s;)o.pop();o.some(a=>a.reducePos>n)&&this.recovering--}else if(o.length>1){e:for(let s=0;s500&&p.buffer.length>500)if((a.score-p.score||a.buffer.length-p.buffer.length)>0)o.splice(c--,1);else{o.splice(s--,1);continue e}}}o.length>12&&(o.sort((s,a)=>a.score-s.score),o.splice(12,o.length-12))}this.minStackPos=o[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let p=t.curContext&&t.curContext.tracker.strict,u=p?t.curContext.hash:0;for(let l=this.fragments.nodeAt(r);l;){let d=this.parser.nodeSet.types[l.type.id]==l.type?i.getGoto(t.state,l.type.id):-1;if(d>-1&&l.length&&(!p||(l.prop(Nt.contextHash)||0)==u))return t.useNode(l,d),ti&&console.log(s+this.stackID(t)+` (via reuse of ${i.getName(l.type.id)})`),!0;if(!(l instanceof Hn)||l.children.length==0||l.positions[0]>0)break;let f=l.children[0];if(f instanceof Hn&&l.positions[0]==0)l=f;else break}}let a=i.stateSlot(t.state,4);if(a>0)return t.reduce(a),ti&&console.log(s+this.stackID(t)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let p=0;pr?n.push(h):o.push(h)}return!1}advanceFully(t,n){let o=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>o)return PY(t,n),!0}}runRecovery(t,n,o){let r=null,i=!1;for(let s=0;s ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),ti&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,o))))continue;let l=a.split(),d=u;for(let f=0;f<10&&l.forceReduce()&&(ti&&console.log(d+this.stackID(l)+" (via force-reduce)"),!this.advanceFully(l,o));f++)ti&&(d=this.stackID(l)+" -> ");for(let f of a.recoverByInsert(c))ti&&console.log(u+this.stackID(f)+" (via recover-insert)"),this.advanceFully(f,o);this.stream.end>a.pos?(p==a.pos&&(p++,c=0),a.recoverByDelete(c,p),ti&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(c)})`),PY(a,o)):(!r||r.scoret.topRules[a][1]),r=[];for(let a=0;a=0)i(u,c,a[p++]);else{let l=a[p+-u];for(let d=-u;d>0;d--)i(a[p++],c,l);p++}}}this.nodeSet=new jk(n.map((a,c)=>qo.define({name:c>=this.minRepeatTerm?void 0:a,id:c,props:r[c],top:o.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=ife;let s=BT(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new rA(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,o){let r=new Xrt(this,t,n,o);for(let i of this.wrappers)r=i(r,t,n,o);return r}getGoto(t,n,o=!1){let r=this.goto;if(n>=r[0])return-1;for(let i=r[n+1];;){let s=r[i++],a=s&1,c=r[i++];if(a&&o)return c;for(let p=i+(s>>1);i0}validAction(t,n){return!!this.allActions(t,o=>o==n?!0:null)}allActions(t,n){let o=this.stateSlot(t,4),r=o?n(o):void 0;for(let i=this.stateSlot(t,1);r==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=tp(this.data,i+2);else break;r=n(tp(this.data,i+1))}return r}nextStates(t){let n=[];for(let o=this.stateSlot(t,1);;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=tp(this.data,o+2);else break;if((this.data[o+2]&1)==0){let r=this.data[o+1];n.some((i,s)=>s&1&&i==r)||n.push(this.data[o],r)}}return n}configure(t){let n=Object.assign(Object.create(WE.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let o=this.topRules[t.top];if(!o)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=o}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(o=>{let r=t.tokenizers.find(i=>i.from==o);return r?r.to:o})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((o,r)=>{let i=t.specializers.find(a=>a.from==o.external);if(!i)return o;let s=Object.assign(Object.assign({},o),{external:i.to});return n.specializers[r]=IY(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),o=n.map(()=>!1);if(t)for(let i of t.split(" ")){let s=n.indexOf(i);s>=0&&(o[s]=!0)}let r=null;for(let i=0;io)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,o)<<1|t}return e.get}let tot=0;class ki{constructor(t,n,o,r){this.name=t,this.set=n,this.base=o,this.modified=r,this.id=tot++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let o=typeof t=="string"?t:"?";if(t instanceof ki&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let r=new ki(o,[],null,[]);if(r.set.push(r),n)for(let i of n.set)r.set.push(i);return r}static defineModifier(t){let n=new YE(t);return o=>o.modified.indexOf(n)>-1?o:YE.get(o.base||o,o.modified.concat(n).sort((r,i)=>r.id-i.id))}}let not=0;class YE{constructor(t){this.name=t,this.instances=[],this.id=not++}static get(t,n){if(!n.length)return t;let o=n[0].instances.find(a=>a.base==t&&rot(n,a.modified));if(o)return o;let r=[],i=new ki(t.name,r,t,n);for(let a of n)a.instances.push(i);let s=oot(n);for(let a of t.set)if(!a.modified.length)for(let c of s)r.push(YE.get(a,c));return i}}function rot(e,t){return e.length==t.length&&e.every((n,o)=>n==t[o])}function oot(e){let t=[[]];for(let n=0;no.length-n.length)}function cfe(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let r of n.split(" "))if(r){let i=[],s=2,a=r;for(let l=0;;){if(a=="..."&&l>0&&l+3==r.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+r);if(i.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),l+=d[0].length,l==r.length)break;let f=r[l++];if(l==r.length&&f=="!"){s=0;break}if(f!="/")throw new RangeError("Invalid path: "+r);a=r.slice(l)}let c=i.length-1,p=i[c];if(!p)throw new RangeError("Invalid path: "+r);let u=new sC(o,s,c>0?i.slice(0,c):null);t[p]=u.sort(t[p])}}return dfe.add(t)}const dfe=new Nt({combine(e,t){let n,o,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let i=new sC(r.tags,r.mode,r.context);n?n.next=i:o=i,n=i}return o}});class sC{constructor(t,n,o,r){this.tags=t,this.mode=n,this.context=o,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let s=r;for(let a of i)for(let c of a.set){let p=n[c.id];if(p){s=s?s+" "+p:p;break}}return s},scope:o}}function iot(e,t){let n=null;for(let o of e){let r=o.style(t);r&&(n=n?n+" "+r:r)}return n}function sot(e,t,n,o=0,r=e.length){let i=new aot(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}class aot{constructor(t,n,o){this.at=t,this.highlighters=n,this.span=o,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,o,r,i){let{type:s,from:a,to:c}=t;if(a>=o||c<=n)return;s.isTop&&(i=this.highlighters.filter(f=>!f.scope||f.scope(s)));let p=r,u=lot(t)||sC.empty,l=iot(i,u.tags);if(l&&(p&&(p+=" "),p+=l,u.mode==1&&(r+=(r?" ":"")+l)),this.startSpan(Math.max(n,a),p),u.opaque)return;let d=t.tree&&t.tree.prop(Nt.mounted);if(d&&d.overlay){let f=t.node.enter(d.overlay[0].from+a,1),h=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=t.firstChild();for(let g=0,y=a;;g++){let _=g=S||!t.nextSibling())););if(!_||S>o)break;y=_.to+a,y>n&&(this.highlightRange(f.cursor(),Math.max(n,_.from+a),Math.min(o,y),"",h),this.startSpan(Math.min(o,y),p))}m&&t.parent()}else if(t.firstChild()){d&&(r="");do if(!(t.to<=n)){if(t.from>=o)break;this.highlightRange(t,n,o,r,i),this.startSpan(Math.min(o,t.to),p)}while(t.nextSibling());t.parent()}}}function lot(e){let t=e.type.prop(dfe);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const Be=ki.define,kT=Be(),im=Be(),jY=Be(im),DY=Be(im),sm=Be(),UT=Be(sm),e2=Be(sm),bl=Be(),yg=Be(bl),fl=Be(),hl=Be(),SL=Be(),IS=Be(SL),qT=Be(),Fe={comment:kT,lineComment:Be(kT),blockComment:Be(kT),docComment:Be(kT),name:im,variableName:Be(im),typeName:jY,tagName:Be(jY),propertyName:DY,attributeName:Be(DY),className:Be(im),labelName:Be(im),namespace:Be(im),macroName:Be(im),literal:sm,string:UT,docString:Be(UT),character:Be(UT),attributeValue:Be(UT),number:e2,integer:Be(e2),float:Be(e2),bool:Be(sm),regexp:Be(sm),escape:Be(sm),color:Be(sm),url:Be(sm),keyword:fl,self:Be(fl),null:Be(fl),atom:Be(fl),unit:Be(fl),modifier:Be(fl),operatorKeyword:Be(fl),controlKeyword:Be(fl),definitionKeyword:Be(fl),moduleKeyword:Be(fl),operator:hl,derefOperator:Be(hl),arithmeticOperator:Be(hl),logicOperator:Be(hl),bitwiseOperator:Be(hl),compareOperator:Be(hl),updateOperator:Be(hl),definitionOperator:Be(hl),typeOperator:Be(hl),controlOperator:Be(hl),punctuation:SL,separator:Be(SL),bracket:IS,angleBracket:Be(IS),squareBracket:Be(IS),paren:Be(IS),brace:Be(IS),content:bl,heading:yg,heading1:Be(yg),heading2:Be(yg),heading3:Be(yg),heading4:Be(yg),heading5:Be(yg),heading6:Be(yg),contentSeparator:Be(bl),list:Be(bl),quote:Be(bl),emphasis:Be(bl),strong:Be(bl),link:Be(bl),monospace:Be(bl),strikethrough:Be(bl),inserted:Be(),deleted:Be(),changed:Be(),invalid:Be(),meta:qT,documentMeta:Be(qT),annotation:Be(qT),processingInstruction:Be(qT),definition:ki.defineModifier("definition"),constant:ki.defineModifier("constant"),function:ki.defineModifier("function"),standard:ki.defineModifier("standard"),local:ki.defineModifier("local"),special:ki.defineModifier("special")};for(let e in Fe){let t=Fe[e];t instanceof ki&&(t.name=e)}ffe([{tag:Fe.link,class:"tok-link"},{tag:Fe.heading,class:"tok-heading"},{tag:Fe.emphasis,class:"tok-emphasis"},{tag:Fe.strong,class:"tok-strong"},{tag:Fe.keyword,class:"tok-keyword"},{tag:Fe.atom,class:"tok-atom"},{tag:Fe.bool,class:"tok-bool"},{tag:Fe.url,class:"tok-url"},{tag:Fe.labelName,class:"tok-labelName"},{tag:Fe.inserted,class:"tok-inserted"},{tag:Fe.deleted,class:"tok-deleted"},{tag:Fe.literal,class:"tok-literal"},{tag:Fe.string,class:"tok-string"},{tag:Fe.number,class:"tok-number"},{tag:[Fe.regexp,Fe.escape,Fe.special(Fe.string)],class:"tok-string2"},{tag:Fe.variableName,class:"tok-variableName"},{tag:Fe.local(Fe.variableName),class:"tok-variableName tok-local"},{tag:Fe.definition(Fe.variableName),class:"tok-variableName tok-definition"},{tag:Fe.special(Fe.variableName),class:"tok-variableName2"},{tag:Fe.definition(Fe.propertyName),class:"tok-propertyName tok-definition"},{tag:Fe.typeName,class:"tok-typeName"},{tag:Fe.namespace,class:"tok-namespace"},{tag:Fe.className,class:"tok-className"},{tag:Fe.macroName,class:"tok-macroName"},{tag:Fe.propertyName,class:"tok-propertyName"},{tag:Fe.operator,class:"tok-operator"},{tag:Fe.comment,class:"tok-comment"},{tag:Fe.meta,class:"tok-meta"},{tag:Fe.invalid,class:"tok-invalid"},{tag:Fe.punctuation,class:"tok-punctuation"}]);const uot=cfe({String:Fe.string,Number:Fe.number,"True False":Fe.bool,PropertyName:Fe.propertyName,Null:Fe.null,", :":Fe.separator,"[ ]":Fe.squareBracket,"{ }":Fe.brace}),cot=WE.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[uot],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let CL=[],hfe=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=hfe[o])t=o+1;else return!0;if(t==n)return!1}}function NY(e){return e>=127462&&e<=127487}const LY=8205;function fot(e,t,n=!0,o=!0){return(n?pfe:hot)(e,t,o)}function pfe(e,t,n){if(t==e.length)return t;t&&mfe(e.charCodeAt(t))&&gfe(e.charCodeAt(t-1))&&t--;let o=t2(e,t);for(t+=FY(o);t=0&&NY(t2(e,s));)i++,s-=2;if(i%2==0)break;t+=2}else break}return t}function hot(e,t,n){for(;t>0;){let o=pfe(e,t-2,n);if(o=56320&&e<57344}function gfe(e){return e>=55296&&e<56320}function FY(e){return e<65536?1:2}class Qt{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,o){[t,n]=SA(this,t,n);let r=[];return this.decompose(0,t,r,2),o.length&&o.decompose(0,o.length,r,3),this.decompose(n,this.length,r,1),vl.from(r,this.length-(n-t)+o.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=SA(this,t,n);let o=[];return this.decompose(t,n,o,0),vl.from(o,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),o=this.length-this.scanIdentical(t,-1),r=new w0(this),i=new w0(t);for(let s=n,a=n;;){if(r.next(s),i.next(s),s=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=o)return!0}}iter(t=1){return new w0(this,t)}iterRange(t,n=this.length){return new bfe(this,t,n)}iterLines(t,n){let o;if(t==null)o=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;o=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new yfe(o)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Qt.empty:t.length<=32?new Vn(t):vl.from(Vn.split(t,[]))}}class Vn extends Qt{constructor(t,n=pot(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,o,r){for(let i=0;;i++){let s=this.text[i],a=r+s.length;if((n?o:a)>=t)return new mot(r,a,o,s);r=a+1,o++}}decompose(t,n,o,r){let i=t<=0&&n>=this.length?this:new Vn(xY(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let s=o.pop(),a=BR(i.text,s.text.slice(),0,i.length);if(a.length<=32)o.push(new Vn(a,s.length+i.length));else{let c=a.length>>1;o.push(new Vn(a.slice(0,c)),new Vn(a.slice(c)))}}else o.push(i)}replace(t,n,o){if(!(o instanceof Vn))return super.replace(t,n,o);[t,n]=SA(this,t,n);let r=BR(this.text,BR(o.text,xY(this.text,0,t)),n),i=this.length+o.length-(n-t);return r.length<=32?new Vn(r,i):vl.from(Vn.split(r,[]),i)}sliceString(t,n=this.length,o=` +`){[t,n]=SA(this,t,n);let r="";for(let i=0,s=0;i<=n&&st&&s&&(r+=o),ti&&(r+=a.slice(Math.max(0,t-i),n-i)),i=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let o=[],r=-1;for(let i of t)o.push(i),r+=i.length+1,o.length==32&&(n.push(new Vn(o,r)),o=[],r=-1);return r>-1&&n.push(new Vn(o,r)),n}}class vl extends Qt{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let o of t)this.lines+=o.lines}lineInner(t,n,o,r){for(let i=0;;i++){let s=this.children[i],a=r+s.length,c=o+s.lines-1;if((n?c:a)>=t)return s.lineInner(t,n,o,r);r=a+1,o=c+1}}decompose(t,n,o,r){for(let i=0,s=0;s<=n&&i=s){let p=r&((s<=t?1:0)|(c>=n?2:0));s>=t&&c<=n&&!p?o.push(a):a.decompose(t-s,n-s,o,p)}s=c+1}}replace(t,n,o){if([t,n]=SA(this,t,n),o.lines=i&&n<=a){let c=s.replace(t-i,n-i,o),p=this.lines-s.lines+c.lines;if(c.lines

>4&&c.lines>p>>6){let u=this.children.slice();return u[r]=c,new vl(u,this.length-(n-t)+o.length)}return super.replace(i,a,c)}i=a+1}return super.replace(t,n,o)}sliceString(t,n=this.length,o=` +`){[t,n]=SA(this,t,n);let r="";for(let i=0,s=0;it&&i&&(r+=o),ts&&(r+=a.sliceString(t-s,n-s,o)),s=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof vl))return 0;let o=0,[r,i,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,i+=n){if(r==s||i==a)return o;let c=this.children[r],p=t.children[i];if(c!=p)return o+c.scanIdentical(p,n);o+=c.length+1}}static from(t,n=t.reduce((o,r)=>o+r.length+1,-1)){let o=0;for(let f of t)o+=f.lines;if(o<32){let f=[];for(let h of t)h.flatten(f);return new Vn(f,n)}let r=Math.max(32,o>>5),i=r<<1,s=r>>1,a=[],c=0,p=-1,u=[];function l(f){let h;if(f.lines>i&&f instanceof vl)for(let m of f.children)l(m);else f.lines>s&&(c>s||!c)?(d(),a.push(f)):f instanceof Vn&&c&&(h=u[u.length-1])instanceof Vn&&f.lines+h.lines<=32?(c+=f.lines,p+=f.length+1,u[u.length-1]=new Vn(h.text.concat(f.text),h.length+1+f.length)):(c+f.lines>r&&d(),c+=f.lines,p+=f.length+1,u.push(f))}function d(){c!=0&&(a.push(u.length==1?u[0]:vl.from(u,p)),p=-1,c=u.length=0)}for(let f of t)l(f);return d(),a.length==1?a[0]:new vl(a,n)}}Qt.empty=new Vn([""],0);function pot(e){let t=-1;for(let n of e)t+=n.length+1;return t}function BR(e,t,n=0,o=1e9){for(let r=0,i=0,s=!0;i=n&&(c>o&&(a=a.slice(0,o-r)),r0?1:(t instanceof Vn?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let o=this.nodes.length-1,r=this.nodes[o],i=this.offsets[o],s=i>>1,a=r instanceof Vn?r.text.length:r.children.length;if(s==(n>0?a:0)){if(o==0)return this.done=!0,this.value="",this;n>0&&this.offsets[o-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[o]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(r instanceof Vn){let c=r.text[s+(n<0?-1:0)];if(this.offsets[o]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[s+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[o]+=n):(n<0&&this.offsets[o]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Vn?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class bfe{constructor(t,n,o){this.value="",this.done=!1,this.cursor=new w0(t,n>o?-1:1),this.pos=n>o?t.length:0,this.from=Math.min(n,o),this.to=Math.max(n,o)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let o=n<0?this.pos-this.from:this.to-this.pos;t>o&&(t=o),o-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=o?r:n<0?r.slice(r.length-o):r.slice(0,o),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class yfe{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:o,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):o?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Qt.prototype[Symbol.iterator]=function(){return this.iter()},w0.prototype[Symbol.iterator]=bfe.prototype[Symbol.iterator]=yfe.prototype[Symbol.iterator]=function(){return this});class mot{constructor(t,n,o,r){this.from=t,this.to=n,this.number=o,this.text=r}get length(){return this.to-this.from}}function SA(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function br(e,t,n=!0,o=!0){return fot(e,t,n,o)}function got(e){return e>=56320&&e<57344}function bot(e){return e>=55296&&e<56320}function Lo(e,t){let n=e.charCodeAt(t);if(!bot(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return got(o)?(n-55296<<10)+(o-56320)+65536:n}function Fk(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Sl(e){return e<65536?1:2}const wL=/\r\n?|\n/;var yo=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(yo||(yo={}));class Dl{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return i+(t-r);i+=a}else{if(o!=yo.Simple&&p>=t&&(o==yo.TrackDel&&rt||o==yo.TrackBefore&&rt))return null;if(p>t||p==t&&n<0&&!a)return t==r||n<0?i:i+c;i+=c}r=p}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return i}touchesRange(t,n=t){for(let o=0,r=0;o=0&&r<=n&&a>=t)return rn?"cover":!0;r=a}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Dl(t)}static create(t){return new Dl(t)}}class gr extends Dl{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return OL(this,(n,o,r,i,s)=>t=t.replace(r,r+(o-n),s),!1),t}mapDesc(t,n=!1){return TL(this,t,n,!0)}invert(t){let n=this.sections.slice(),o=[];for(let r=0,i=0;r=0){n[r]=a,n[r+1]=s;let c=r>>1;for(;o.length0&&fm(o,n,i.text),i.forward(u),a+=u}let p=t[s++];for(;a>1].toJSON()))}return t}static of(t,n,o){let r=[],i=[],s=0,a=null;function c(u=!1){if(!u&&!r.length)return;sd||l<0||d>n)throw new RangeError(`Invalid change range ${l} to ${d} (in doc of length ${n})`);let h=f?typeof f=="string"?Qt.of(f.split(o||wL)):f:Qt.empty,m=h.length;if(l==d&&m==0)return;ls&&Zr(r,l-s,-1),Zr(r,d-l,m),fm(i,r,h),s=d}}return p(t),c(!a),a}static empty(t){return new gr(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],o=[];for(let r=0;ra&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;o.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function fm(e,t,n){if(n.length==0)return;let o=t.length-2>>1;if(o>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],c=e.sections[s++];t(r,p,i,u,l),r=p,i=u}}}function TL(e,t,n,o=!1){let r=[],i=o?[]:null,s=new aC(e),a=new aC(t);for(let c=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let p=Math.min(s.len,a.len);Zr(r,p,-1),s.forward(p),a.forward(p)}else if(a.ins>=0&&(s.ins<0||c==s.i||s.off==0&&(a.len=0&&c=0){let p=0,u=s.len;for(;u;)if(a.ins==-1){let l=Math.min(u,a.len);p+=l,u-=l,a.forward(l)}else if(a.ins==0&&a.lenc||s.ins>=0&&s.len>c)&&(a||o.length>p),i.forward2(c),s.forward(c)}}}}class aC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Qt.empty:t[n]}textBit(t){let{inserted:n}=this.set,o=this.i-2>>1;return o>=n.length&&!t?Qt.empty:n[o].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Lg{constructor(t,n,o){this.from=t,this.to=n,this.flags=o}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let o,r;return this.empty?o=r=t.mapPos(this.from,n):(o=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),o==this.from&&r==this.to?this:new Lg(o,r,this.flags)}extend(t,n=t){if(t<=this.anchor&&n>=this.anchor)return Oe.range(t,n);let o=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return Oe.range(this.anchor,o)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Oe.range(t.anchor,t.head)}static create(t,n,o){return new Lg(t,n,o)}}class Oe{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:Oe.create(this.ranges.map(o=>o.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let o=0;ot.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Oe(t.ranges.map(n=>Lg.fromJSON(n)),t.main)}static single(t,n=t){return new Oe([Oe.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let o=0,r=0;rt?8:0)|i)}static normalized(t,n=0){let o=t[n];t.sort((r,i)=>r.from-i.from),n=t.indexOf(o);for(let r=1;ri.head?Oe.range(c,a):Oe.range(a,c))}}return new Oe(t,n)}}function _fe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let xk=0;class Qe{constructor(t,n,o,r,i){this.combine=t,this.compareInput=n,this.compare=o,this.isStatic=r,this.id=xk++,this.default=t([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(t={}){return new Qe(t.combine||(n=>n),t.compareInput||((n,o)=>n===o),t.compare||(t.combine?(n,o)=>n===o:Bk),!!t.static,t.enables)}of(t){return new kR([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new kR(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new kR(t,this,2,n)}from(t,n){return n||(n=o=>o),this.compute([t],o=>n(o.field(t)))}}function Bk(e,t){return e==t||e.length==t.length&&e.every((n,o)=>n===t[o])}class kR{constructor(t,n,o,r){this.dependencies=t,this.facet=n,this.type=o,this.value=r,this.id=xk++}dynamicSlot(t){var n;let o=this.value,r=this.facet.compareInput,i=this.id,s=t[i]>>1,a=this.type==2,c=!1,p=!1,u=[];for(let l of this.dependencies)l=="doc"?c=!0:l=="selection"?p=!0:(((n=t[l.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(t[l.id]);return{create(l){return l.values[s]=o(l),1},update(l,d){if(c&&d.docChanged||p&&(d.docChanged||d.selection)||RL(l,u)){let f=o(l);if(a?!BY(f,l.values[s],r):!r(f,l.values[s]))return l.values[s]=f,1}return 0},reconfigure:(l,d)=>{let f,h=d.config.address[i];if(h!=null){let m=ZE(d,h);if(this.dependencies.every(g=>g instanceof Qe?d.facet(g)===l.facet(g):g instanceof Gr?d.field(g,!1)==l.field(g,!1):!0)||(a?BY(f=o(l),m,r):r(f=o(l),m)))return l.values[s]=m,0}else f=o(l);return l.values[s]=f,1}}}}function BY(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[c.id]),r=n.map(c=>c.type),i=o.filter(c=>!(c&1)),s=e[t.id]>>1;function a(c){let p=[];for(let u=0;uo===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(JT).find(o=>o.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:o=>(o.values[n]=this.create(o),1),update:(o,r)=>{let i=o.values[n],s=this.updateF(i,r);return this.compareF(i,s)?0:(o.values[n]=s,1)},reconfigure:(o,r)=>{let i=o.facet(JT),s=r.facet(JT),a;return(a=i.find(c=>c.field==this))&&a!=s.find(c=>c.field==this)?(o.values[n]=a.create(o),1):r.config.address[this.id]!=null?(o.values[n]=r.field(this),0):(o.values[n]=this.create(o),1)}}}init(t){return[this,JT.of({field:this,create:t})]}get extension(){return this}}const Rg={lowest:4,low:3,default:2,high:1,highest:0};function jS(e){return t=>new vfe(t,e)}const gb={highest:jS(Rg.highest),high:jS(Rg.high),default:jS(Rg.default),low:jS(Rg.low),lowest:jS(Rg.lowest)};class vfe{constructor(t,n){this.inner=t,this.prec=n}}class UP{of(t){return new EL(this,t)}reconfigure(t){return UP.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class EL{constructor(t,n){this.compartment=t,this.inner=n}}class XE{constructor(t,n,o,r,i,s){for(this.base=t,this.compartments=n,this.dynamicSlots=o,this.address=r,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,o){let r=[],i=Object.create(null),s=new Map;for(let d of Aot(t,n,s))d instanceof Gr?r.push(d):(i[d.facet.id]||(i[d.facet.id]=[])).push(d);let a=Object.create(null),c=[],p=[];for(let d of r)a[d.id]=p.length<<1,p.push(f=>d.slot(f));let u=o?.config.facets;for(let d in i){let f=i[d],h=f[0].facet,m=u&&u[d]||[];if(f.every(g=>g.type==0))if(a[h.id]=c.length<<1|1,Bk(m,f))c.push(o.facet(h));else{let g=h.combine(f.map(y=>y.value));c.push(o&&h.compare(g,o.facet(h))?o.facet(h):g)}else{for(let g of f)g.type==0?(a[g.id]=c.length<<1|1,c.push(g.value)):(a[g.id]=p.length<<1,p.push(y=>g.dynamicSlot(y)));a[h.id]=p.length<<1,p.push(g=>yot(g,h,f))}}let l=p.map(d=>d(a));return new XE(t,s,l,a,c,i)}}function Aot(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(s,a){let c=r.get(s);if(c!=null){if(c<=a)return;let p=o[c].indexOf(s);p>-1&&o[c].splice(p,1),s instanceof EL&&n.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let p of s)i(p,a);else if(s instanceof EL){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let p=t.get(s.compartment)||s.inner;n.set(s.compartment,p),i(p,a)}else if(s instanceof vfe)i(s.inner,s.prec);else if(s instanceof Gr)o[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof kR)o[a].push(s),s.facet.extensions&&i(s.facet.extensions,Rg.default);else{let p=s.extension;if(!p)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(p,a)}}return i(e,Rg.default),o.reduce((s,a)=>s.concat(a))}function O0(e,t){if(t&1)return 2;let n=t>>1,o=e.status[n];if(o==4)throw new Error("Cyclic dependency between fields and/or facets");if(o&2)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function ZE(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const Sfe=Qe.define(),ML=Qe.define({combine:e=>e.some(t=>t),static:!0}),Cfe=Qe.define({combine:e=>e.length?e[0]:void 0,static:!0}),wfe=Qe.define(),Ofe=Qe.define(),Tfe=Qe.define(),Rfe=Qe.define({combine:e=>e.length?e[0]:!1});class Ap{constructor(t,n){this.type=t,this.value=n}static define(){return new _ot}}class _ot{of(t){return new Ap(this,t)}}class vot{constructor(t){this.map=t}of(t){return new Et(this,t)}}class Et{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Et(this.type,n)}is(t){return this.type==t}static define(t={}){return new vot(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let o=[];for(let r of t){let i=r.map(n);i&&o.push(i)}return o}}Et.reconfigure=Et.define();Et.appendConfig=Et.define();class yr{constructor(t,n,o,r,i,s){this.startState=t,this.changes=n,this.selection=o,this.effects=r,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,o&&_fe(o,n.newLength),i.some(a=>a.type==yr.time)||(this.annotations=i.concat(yr.time.of(Date.now())))}static create(t,n,o,r,i,s){return new yr(t,n,o,r,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(yr.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}yr.time=Ap.define();yr.userEvent=Ap.define();yr.addToHistory=Ap.define();yr.remote=Ap.define();function Sot(e,t){let n=[];for(let o=0,r=0;;){let i,s;if(o=e[o]))i=e[o++],s=e[o++];else if(r=0;r--){let i=o[r](e);i instanceof yr?e=i:Array.isArray(i)&&i.length==1&&i[0]instanceof yr?e=i[0]:e=Mfe(t,oA(i),!1)}return e}function wot(e){let t=e.startState,n=t.facet(Tfe),o=e;for(let r=n.length-1;r>=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=Efe(o,PL(t,i,e.changes.newLength),!0))}return o==e?e:yr.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}const Oot=[];function oA(e){return e==null?Oot:Array.isArray(e)?e:[e]}var En=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(En||(En={}));const Tot=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let IL;try{IL=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Rot(e){if(IL)return IL.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||Tot.test(n)))return!0}return!1}function Eot(e){return t=>{if(!/\S/.test(t))return En.Space;if(Rot(t))return En.Word;for(let n=0;n-1)return En.Word;return En.Other}}class Gt{constructor(t,n,o,r,i,s){this.config=t,this.doc=n,this.selection=o,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let a=0;ar.set(p,c)),n=null),r.set(a.value.compartment,a.value.extension)):a.is(Et.reconfigure)?(n=null,o=a.value):a.is(Et.appendConfig)&&(n=null,o=oA(o).concat(a.value));let i;n?i=t.startState.values.slice():(n=XE.resolve(o,r,this),i=new Gt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,p)=>p.reconfigure(c,this),null).values);let s=t.startState.facet(ML)?t.newSelection:t.newSelection.asSingle();new Gt(n,t.newDoc,s,i,(a,c)=>c.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:Oe.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,o=t(n.ranges[0]),r=this.changes(o.changes),i=[o.range],s=oA(o.effects);for(let a=1;as.spec.fromJSON(a,c)))}}return Gt.create({doc:t.doc,selection:Oe.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=XE.resolve(t.extensions||[],new Map),o=t.doc instanceof Qt?t.doc:Qt.of((t.doc||"").split(n.staticFacet(Gt.lineSeparator)||wL)),r=t.selection?t.selection instanceof Oe?t.selection:Oe.single(t.selection.anchor,t.selection.head):Oe.single(0);return _fe(r,o.length),n.staticFacet(ML)||(r=r.asSingle()),new Gt(n,o,r,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(Gt.tabSize)}get lineBreak(){return this.facet(Gt.lineSeparator)||` +`}get readOnly(){return this.facet(Rfe)}phrase(t,...n){for(let o of this.facet(Gt.phrases))if(Object.prototype.hasOwnProperty.call(o,t)){t=o[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(o,r)=>{if(r=="$")return"$";let i=+(r||1);return!i||i>n.length?o:n[i-1]})),t}languageDataAt(t,n,o=-1){let r=[];for(let i of this.facet(Sfe))for(let s of i(this,n,o))Object.prototype.hasOwnProperty.call(s,t)&&r.push(s[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return Eot(n.length?n[0]:"")}wordAt(t){let{text:n,from:o,length:r}=this.doc.lineAt(t),i=this.charCategorizer(t),s=t-o,a=t-o;for(;s>0;){let c=br(n,s,!1);if(i(n.slice(c,s))!=En.Word)break;s=c}for(;ae.length?e[0]:4});Gt.lineSeparator=Cfe;Gt.readOnly=Rfe;Gt.phrases=Qe.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every(r=>e[r]==t[r])}});Gt.languageData=Sfe;Gt.changeFilter=wfe;Gt.transactionFilter=Ofe;Gt.transactionExtender=Tfe;UP.reconfigure=Et.define();function Hl(e,t,n={}){let o={};for(let r of e)for(let i of Object.keys(r)){let s=r[i],a=o[i];if(a===void 0)o[i]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,i))o[i]=n[i](a,s);else throw new Error("Config merge conflict for field "+i)}for(let r in t)o[r]===void 0&&(o[r]=t[r]);return o}class Cm{eq(t){return this==t}range(t,n=t){return lC.create(t,n,this)}}Cm.prototype.startSide=Cm.prototype.endSide=0;Cm.prototype.point=!1;Cm.prototype.mapMode=yo.TrackDel;function kk(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class lC{constructor(t,n,o){this.from=t,this.to=n,this.value=o}static create(t,n,o){return new lC(t,n,o)}}function jL(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uk{constructor(t,n,o,r){this.from=t,this.to=n,this.value=o,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,o,r=0){let i=o?this.to:this.from;for(let s=r,a=i.length;;){if(s==a)return s;let c=s+a>>1,p=i[c]-t||(o?this.value[c].endSide:this.value[c].startSide)-n;if(c==s)return p>=0?s:a;p>=0?a=c:s=c+1}}between(t,n,o,r){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(o,1e9,!1,i);if||d==f&&p.startSide>0&&p.endSide<=0)continue;(f-d||p.endSide-p.startSide)<0||(s<0&&(s=d),p.point&&(a=Math.max(a,f-d)),o.push(p),r.push(d-s),i.push(f-s))}return{mapped:o.length?new Uk(r,i,o,a):null,pos:s}}}class xt{constructor(t,n,o,r){this.chunkPos=t,this.chunk=n,this.nextLayer=o,this.maxPoint=r}static create(t,n,o,r){return new xt(t,n,o,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:o=!1,filterFrom:r=0,filterTo:i=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(o&&(n=n.slice().sort(jL)),this.isEmpty)return n.length?xt.of(n):this;let a=new Pfe(this,null,-1).goto(0),c=0,p=[],u=new dp;for(;a.value||c=0){let l=n[c++];u.addInner(l.from,l.to,l.value)||p.push(l)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||ia.to||i=i&&t<=i+s.length&&s.between(i,t-i,n-i,o)===!1)return}this.nextLayer.between(t,n,o)}}iter(t=0){return uC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return uC.from(t).goto(n)}static compare(t,n,o,r,i=-1){let s=t.filter(l=>l.maxPoint>0||!l.isEmpty&&l.maxPoint>=i),a=n.filter(l=>l.maxPoint>0||!l.isEmpty&&l.maxPoint>=i),c=kY(s,a,o),p=new DS(s,c,i),u=new DS(a,c,i);o.iterGaps((l,d,f)=>UY(p,l,u,d,f,r)),o.empty&&o.length==0&&UY(p,0,u,0,0,r)}static eq(t,n,o=0,r){r==null&&(r=999999999);let i=t.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&t.indexOf(u)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let a=kY(i,s),c=new DS(i,a,0).goto(o),p=new DS(s,a,0).goto(o);for(;;){if(c.to!=p.to||!DL(c.active,p.active)||c.point&&(!p.point||!kk(c.point,p.point)))return!1;if(c.to>r)return!0;c.next(),p.next()}}static spans(t,n,o,r,i=-1){let s=new DS(t,null,i).goto(n),a=n,c=s.openStart;for(;;){let p=Math.min(s.to,o);if(s.point){let u=s.activeForPoint(s.to),l=s.pointFroma&&(r.span(a,p,s.active,c),c=s.openEnd(p));if(s.to>o)return c+(s.point&&s.to>o?1:0);a=s.to,s.next()}}static of(t,n=!1){let o=new dp;for(let r of t instanceof lC?[t]:n?Mot(t):t)o.add(r.from,r.to,r.value);return o.finish()}static join(t){if(!t.length)return xt.empty;let n=t[t.length-1];for(let o=t.length-2;o>=0;o--)for(let r=t[o];r!=xt.empty;r=r.nextLayer)n=new xt(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}xt.empty=new xt([],[],null,-1);function Mot(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(jL);t=o}return e}xt.empty.nextLayer=xt.empty;class dp{finishChunk(t){this.chunks.push(new Uk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,o){this.addInner(t,n,o)||(this.nextLayer||(this.nextLayer=new dp)).add(t,n,o)}addInner(t,n,o){let r=t-this.lastTo||o.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||o.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=o,this.lastFrom=t,this.lastTo=n,this.value.push(o),o.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let o=n.value.length-1;return this.last=n.value[o],this.lastFrom=n.from[o]+t,this.lastTo=n.to[o]+t,!0}finish(){return this.finishInner(xt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=xt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function kY(e,t,n){let o=new Map;for(let i of e)for(let s=0;s=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=o&&r.push(new Pfe(s,n,o,i));return r.length==1?r[0]:new uC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let o of this.heap)o.goto(t,n);for(let o=this.heap.length>>1;o>=0;o--)n2(this.heap,o);return this.next(),this}forward(t,n){for(let o of this.heap)o.forward(t,n);for(let o=this.heap.length>>1;o>=0;o--)n2(this.heap,o);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),n2(this.heap,0)}}}function n2(e,t){for(let n=e[t];;){let o=(t<<1)+1;if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class DS{constructor(t,n,o){this.minPoint=o,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=uC.from(t,n,o)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){VT(this.active,t),VT(this.activeTo,t),VT(this.activeRank,t),this.minActive=qY(this.active,this.activeTo)}addActive(t){let n=0,{value:o,to:r,rank:i}=this.cursor;for(;n0;)n++;HT(this.active,n,o),HT(this.activeTo,n,r),HT(this.activeRank,n,i),t&&HT(t,n,this.cursor.from),this.minActive=qY(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let o=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),o&&VT(o,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(o),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&o[r]=0&&!(this.activeRank[o]t||this.activeTo[o]==t&&this.active[o].endSide>=this.point.endSide)&&n.push(this.active[o]);return n.reverse()}openEnd(t){let n=0;for(let o=this.activeTo.length-1;o>=0&&this.activeTo[o]>t;o--)n++;return n}}function UY(e,t,n,o,r,i){e.goto(t),n.goto(o);let s=o+r,a=o,c=o-t,p=!!i.boundChange;for(let u=!1;;){let l=e.to+c-n.to,d=l||e.endSide-n.endSide,f=d<0?e.to+c:n.to,h=Math.min(f,s);if(e.point||n.point?(e.point&&n.point&&kk(e.point,n.point)&&DL(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,h,e.point,n.point),u=!1):(u&&i.boundChange(a),h>a&&!DL(e.active,n.active)&&i.compareRange(a,h,e.active,n.active),p&&hs)break;a=f,d<=0&&e.next(),d>=0&&n.next()}}function DL(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function qY(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=br(e,r)}return o===!0?-1:e.length}const LL="ͼ",JY=typeof Symbol>"u"?"__"+LL:Symbol.for(LL),FL=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),VY=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class wm{constructor(t,n){this.rules=[];let{finish:o}=n||{};function r(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,a,c,p){let u=[],l=/^@(\w+)\b/.exec(s[0]),d=l&&l[1]=="keyframes";if(l&&a==null)return c.push(s[0]+";");for(let f in a){let h=a[f];if(/&/.test(f))i(f.split(/,\s*/).map(m=>s.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),h,c);else if(h&&typeof h=="object"){if(!l)throw new RangeError("The value of a property ("+f+") should be a primitive value.");i(r(f),h,u,d)}else h!=null&&u.push(f.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+h+";")}(u.length||d)&&c.push((o&&!l&&!p?s.map(o):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in t)i(r(s),t[s],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=VY[JY]||1;return VY[JY]=t+1,LL+t.toString(36)}static mount(t,n,o){let r=t[FL],i=o&&o.nonce;r?i&&r.setNonce(i):r=new Pot(t,i),r.mount(Array.isArray(n)?n:[n],t)}}let HY=new Map;class Pot{constructor(t,n){let o=t.ownerDocument||t,r=o.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let i=HY.get(o);if(i)return t[FL]=i;this.sheet=new r.CSSStyleSheet,HY.set(o,this)}else this.styleTag=o.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[FL]=this}mount(t,n){let o=this.sheet,r=0,i=0;for(let s=0;s-1&&(this.modules.splice(c,1),i--,c=-1),c==-1){if(this.modules.splice(i++,0,a),o)for(let p=0;p",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Iot=typeof navigator<"u"&&/Mac/.test(navigator.platform),jot=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Vr=0;Vr<10;Vr++)Om[48+Vr]=Om[96+Vr]=String(Vr);for(var Vr=1;Vr<=24;Vr++)Om[Vr+111]="F"+Vr;for(var Vr=65;Vr<=90;Vr++)Om[Vr]=String.fromCharCode(Vr+32),cC[Vr]=String.fromCharCode(Vr);for(var r2 in Om)cC.hasOwnProperty(r2)||(cC[r2]=Om[r2]);function Dot(e){var t=Iot&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jot&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?cC:Om)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function fn(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];typeof r=="string"?e.setAttribute(o,r):r!=null&&(e[o]=r)}t++}for(;t2);var Ve={mac:zY||/Mac/.test(go.platform),windows:/Win/.test(go.platform),linux:/Linux|X11/.test(go.platform),ie:qP,ie_version:jfe?xL.documentMode||6:kL?+kL[1]:BL?+BL[1]:0,gecko:GY,gecko_version:GY?+(/Firefox\/(\d+)/.exec(go.userAgent)||[0,0])[1]:0,chrome:!!o2,chrome_version:o2?+o2[1]:0,ios:zY,android:/Android\b/.test(go.userAgent),webkit_version:Not?+(/\bAppleWebKit\/(\d+)/.exec(go.userAgent)||[0,0])[1]:0,safari:UL,safari_version:UL?+(/\bVersion\/(\d+(\.\d+)?)/.exec(go.userAgent)||[0,0])[1]:0,tabSize:xL.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function qk(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const eM=Object.create(null);function Jk(e,t,n){if(e==t)return!0;e||(e=eM),t||(t=eM);let o=Object.keys(e),r=Object.keys(t);if(o.length-0!=r.length-0)return!1;for(let i of o)if(i!=n&&(r.indexOf(i)==-1||e[i]!==t[i]))return!1;return!0}function Lot(e,t){for(let n=e.attributes.length-1;n>=0;n--){let o=e.attributes[n].name;t[o]==null&&e.removeAttribute(o)}for(let n in t){let o=t[n];n=="style"?e.style.cssText=o:e.getAttribute(n)!=o&&e.setAttribute(n,o)}}function KY(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function Fot(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new zg(t,n,n,o,t.widget||null,!1)}static replace(t){let n=!!t.block,o,r;if(t.isBlockGap)o=-5e8,r=4e8;else{let{start:i,end:s}=Dfe(t,n);o=(i?n?-3e8:-1:5e8)-1,r=(s?n?2e8:1:-6e8)+1}return new zg(t,o,r,n,t.widget||null,!0)}static line(t){return new aw(t)}static set(t,n=!1){return xt.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}mt.none=xt.empty;class sw extends mt{constructor(t){let{start:n,end:o}=Dfe(t);super(n?-1:5e8,o?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?qk(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||eM}eq(t){return this==t||t instanceof sw&&this.tagName==t.tagName&&Jk(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}sw.prototype.point=!1;class aw extends mt{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof aw&&this.spec.class==t.spec.class&&Jk(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}aw.prototype.mapMode=yo.TrackBefore;aw.prototype.point=!0;class zg extends mt{constructor(t,n,o,r,i,s){super(n,o,i,t),this.block=r,this.isReplace=s,this.mapMode=r?n<=0?yo.TrackBefore:yo.TrackAfter:yo.TrackDel}get type(){return this.startSide!=this.endSide?Hr.WidgetRange:this.startSide<=0?Hr.WidgetBefore:Hr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof zg&&xot(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}zg.prototype.point=!0;function Dfe(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return n==null&&(n=e.inclusive),o==null&&(o=e.inclusive),{start:n??t,end:o??t}}function xot(e,t){return e==t||!!(e&&t&&e.compare(t))}function iA(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class dC extends Cm{constructor(t,n){super(),this.tagName=t,this.attributes=n}eq(t){return t==this||t instanceof dC&&this.tagName==t.tagName&&Jk(this.attributes,t.attributes)}static create(t){return new dC(t.tagName,t.attributes||eM)}static set(t,n=!1){return xt.of(t,n)}}dC.prototype.startSide=dC.prototype.endSide=-1;function fC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function qL(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function UR(e,t){if(!t.anchorNode)return!1;try{return qL(e,t.anchorNode)}catch{return!1}}function qR(e){return e.nodeType==3?hC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function T0(e,t,n,o){return n?QY(e,t,n,o,-1)||QY(e,t,n,o,1):!1}function Tm(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function tM(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function QY(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:fp(e))){if(e.nodeName=="DIV")return!1;let i=e.parentNode;if(!i||i.nodeType!=1)return!1;t=Tm(e)+(r<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?fp(e):0}else return!1}}function fp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function nM(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Bot(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Nfe(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}function kot(e,t,n,o,r,i,s,a){let c=e.ownerDocument,p=c.defaultView||window;for(let u=e,l=!1;u&&!l;)if(u.nodeType==1){let d,f=u==c.body,h=1,m=1;if(f)d=Bot(p);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(l=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let _=u.getBoundingClientRect();({scaleX:h,scaleY:m}=Nfe(u,_)),d={left:_.left,right:_.left+u.clientWidth*h,top:_.top,bottom:_.top+u.clientHeight*m}}let g=0,y=0;if(r=="nearest")t.top0&&t.bottom>d.bottom+y&&(y=t.bottom-d.bottom+s)):t.bottom>d.bottom&&(y=t.bottom-d.bottom+s,n<0&&t.top-y0&&t.right>d.right+g&&(g=t.right-d.right+i)):t.right>d.right&&(g=t.right-d.right+i,n<0&&t.leftd.bottom||t.leftd.right)&&(t={left:Math.max(t.left,d.left),right:Math.min(t.right,d.right),top:Math.max(t.top,d.top),bottom:Math.min(t.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Uot(e){let t=e.ownerDocument,n,o;for(let r=e.parentNode;r&&!(r==t.body||n&&o);)if(r.nodeType==1)!o&&r.scrollHeight>r.clientHeight&&(o=r),!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:n,y:o}}class qot{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:o}=t;this.set(n,Math.min(t.anchorOffset,n?fp(n):0),o,Math.min(t.focusOffset,o?fp(o):0))}set(t,n,o,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=o,this.focusOffset=r}}let wg=null;Ve.safari&&Ve.safari_version>=26&&(wg=!1);function Lfe(e){if(e.setActive)return e.setActive();if(wg)return e.focus(wg);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(wg==null?{get preventScroll(){return wg={preventScroll:!0},!0}}:void 0),!wg){wg=!1;for(let n=0;nMath.max(1,e.scrollHeight-e.clientHeight-4)}function xfe(e,t){for(let n=e,o=t;;){if(n.nodeType==3&&o>0)return{node:n,offset:o};if(n.nodeType==1&&o>0){if(n.contentEditable=="false")return null;n=n.childNodes[o-1],o=fp(n)}else if(n.parentNode&&!tM(n))o=Tm(n),n=n.parentNode;else return null}}function Bfe(e,t){for(let n=e,o=t;;){if(n.nodeType==3&&o=n){if(a.level==o)return s;(i<0||(r!=0?r<0?a.fromn:t[i].level>a.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function qfe(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;m-=3)if(pl[m+1]==-f){let g=pl[m+2],y=g&2?r:g&4?g&1?i:r:0;y&&(hn[l]=hn[pl[m]]=y),a=m;break}}else{if(pl.length==189)break;pl[a++]=l,pl[a++]=d,pl[a++]=c}else if((h=hn[l])==2||h==1){let m=h==r;c=m?0:1;for(let g=a-3;g>=0;g-=3){let y=pl[g+2];if(y&2)break;if(m)pl[g+2]|=2;else{if(y&4)break;pl[g+2]|=4}}}}}function $ot(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let s=r?n[r-1].to:e,a=rc;)h==g&&(h=n[--m].from,g=m?n[m-1].to:e),hn[--h]=f;c=u}else i=p,c++}}}function VL(e,t,n,o,r,i,s){let a=o%2?2:1;if(o%2==r%2)for(let c=t,p=0;cc&&s.push(new op(c,m.from,f));let g=m.direction==Kg!=!(f%2);HL(e,g?o+1:o,r,m.inner,m.from,m.to,s),c=m.to}h=m.to}else{if(h==n||(u?hn[h]!=a:hn[h]==a))break;h++}d?VL(e,c,h,o+1,r,d,s):ct;){let u=!0,l=!1;if(!p||c>i[p-1].to){let m=hn[c-1];m!=a&&(u=!1,l=m==16)}let d=!u&&a==1?[]:null,f=u?o:o+1,h=c;e:for(;;)if(p&&h==i[p-1].to){if(l)break e;let m=i[--p];if(!u)for(let g=m.from,y=p;;){if(g==t)break e;if(y&&i[y-1].to==g)g=i[--y].from;else{if(hn[g-1]==a)break e;break}}if(d)d.push(m);else{m.tohn.length;)hn[hn.length]=256;let o=[],r=t==Kg?0:1;return HL(e,r,r,n,0,e.length,o),o}function Jfe(e){return[new op(0,e,0)]}let Vfe="";function Yot(e,t,n,o,r){var i;let s=o.head-e.from,a=op.find(t,s,(i=o.bidiLevel)!==null&&i!==void 0?i:-1,o.assoc),c=t[a],p=c.side(r,n);if(s==p){let d=a+=r?1:-1;if(d<0||d>=t.length)return null;c=t[a=d],s=c.side(!r,n),p=c.side(r,n)}let u=br(e.text,s,c.forward(r,n));(uc.to)&&(u=p),Vfe=e.text.slice(Math.min(s,u),Math.max(s,u));let l=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return l&&u==p&&l.level+(r?0:1)e.some(t=>t)}),Yfe=Qe.define({combine:e=>e.some(t=>t)}),Xfe=Qe.define();class aA{constructor(t,n="nearest",o="nearest",r=5,i=5,s=!1){this.range=t,this.y=n,this.x=o,this.yMargin=r,this.xMargin=i,this.isSnapshot=s}map(t){return t.empty?this:new aA(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new aA(Oe.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const GT=Et.define({map:(e,t)=>e.map(t)}),Zfe=Et.define();function Bo(e,t,n){let o=e.facet(Kfe);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const rp=Qe.define({combine:e=>e.length?e[0]:!0});let Zot=0;const Hy=Qe.define({combine(e){return e.filter((t,n)=>{for(let o=0;o{let c=[];return s&&c.push(JP.of(p=>{let u=p.plugin(a);return u?s(u):mt.none})),i&&c.push(i(a)),c})}static fromClass(t,n){return ir.define((o,r)=>new t(o,r),n)}}class i2{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(o){if(Bo(n.state,o,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Bo(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(o){Bo(t.state,o,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ehe=Qe.define(),zk=Qe.define(),JP=Qe.define(),the=Qe.define(),Kk=Qe.define(),lw=Qe.define(),nhe=Qe.define();function WY(e,t){let n=e.state.facet(nhe);if(!n.length)return n;let o=n.map(i=>i instanceof Function?i(e):i),r=[];return xt.spans(o,t.from,t.to,{point(){},span(i,s,a,c){let p=i-t.from,u=s-t.from,l=r;for(let d=a.length-1;d>=0;d--,c--){let f=a[d].spec.bidiIsolate,h;if(f==null&&(f=Xot(t.text,p,u)),c>0&&l.length&&(h=l[l.length-1]).to==p&&h.direction==f)h.to=u,l=h.inner;else{let m={from:p,to:u,direction:f,inner:[]};l.push(m),l=m.inner}}}}),r}const rhe=Qe.define();function Qk(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(rhe)){let s=i(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(o=Math.max(o,s.top)),s.bottom!=null&&(r=Math.max(r,s.bottom)))}return{left:t,right:n,top:o,bottom:r}}const r0=Qe.define();class Ji{constructor(t,n,o,r){this.fromA=t,this.toA=n,this.fromB=o,this.toB=r}join(t){return new Ji(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,o=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>o.toA)){if(r.toAr.push(new Ji(i,s,a,c))),this.changedRanges=r}static create(t,n,o){return new rM(t,n,o)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const eit=[];class rr{constructor(t,n,o=0){this.dom=t,this.length=n,this.flags=o,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return eit}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&Lot(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let o=n;for(let r of this.children){if(r==t)return o;o+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n){return null}domPosFor(t,n){let o=Tm(this.dom),r=this.length?t>0:n>0;return new bs(this.parent.dom,o+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof HP)return t;return null}static get(t){return t.cmTile}}class VP extends rr{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,o=null,r,i=t?.node==n?t:null,s=0;for(let a of this.children){if(a.sync(t),s+=a.length+a.breakAfter,r=o?o.nextSibling:n.firstChild,i&&r!=a.dom&&(i.written=!0),a.dom.parentNode==n)for(;r&&r!=a.dom;)r=YY(r);else n.insertBefore(a.dom,r);o=a.dom}for(r=o?o.nextSibling:n.firstChild,i&&r&&(i.written=!0);r;)r=YY(r);this.length=s}}function YY(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class HP extends VP{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=rr.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],o=this,r=0,i=0;;)if(r==o.children.length){if(!n.length)return;o=o.parent,o.breakAfter&&i++,r=n.pop()}else{let s=o.children[r++];if(s instanceof mm)n.push(r),o=s,r=0;else{let a=i+s.length,c=t(s,i);if(c!==void 0)return c;i=a+s.breakAfter}}}resolveBlock(t,n){let o,r=-1,i,s=-1;if(this.blockTiles((a,c)=>{let p=c+a.length;if(t>=c&&t<=p){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(o=void 0)}(ct||t==c&&(n>1?a.length:a.covers(-1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,s=t-c)}}),!o&&!i)throw new Error("No tile at position "+t);return o&&n<0||!i?{tile:o,offset:r}:{tile:i,offset:s}}}class mm extends VP{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let o=new mm(n||document.createElement(t.tagName),t);return n||(o.flags|=4),o}}class CA extends VP{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,o){let r=new CA(n||document.createElement("div"),t);return(!n||!o)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,o){let r=null,i=-1,s=null,a=-1;function c(u,l){for(let d=0,f=0;d=l&&(h.isComposite()?c(h,l-f):(!s||s.isHidden&&(n>0||o&&nit(s,h)))&&(m>l||h.flags&32)?(s=h,a=l-f):(fo&&(t=o);let r=t,i=t,s=0;t==0&&n<0||t==o&&n>=0?Ve.chrome||Ve.gecko||(t?(r--,s=1):i=0)?0:a.length-1];return Ve.safari&&!s&&c.width==0&&(c=Array.prototype.find.call(a,p=>p.width)||c),s?nM(c,s<0):c||null}static of(t,n){let o=new Fg(n||document.createTextNode(t),t);return n||(o.flags|=2),o}}class Qg extends rr{constructor(t,n,o,r){super(t,n,r),this.widget=o}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,o){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(o)return nM(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let a=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=a?i.length-1:0;s=i[c],!(t>0?c==0:c==i.length-1||s.top0;)if(r.isComposite())if(s){if(!t)break;o&&o.break(),t--,s=!1}else if(i==r.children.length){if(!t&&!a.length)break;o&&o.leave(r),s=!!r.breakAfter,{tile:r,index:i}=a.pop(),i++}else{let c=r.children[i],p=c.breakAfter;(n>0?c.length<=t:c.length=0;a--){let c=n.marks[a],p=r.lastChild;if(p instanceof xo&&p.mark.eq(c.mark))p.dom!=c.dom&&p.setDOM(s2(c.dom)),r=p;else{if(this.cache.reused.get(c)){let l=rr.get(c.dom);l&&l.setDOM(s2(c.dom))}let u=xo.of(c.mark,c.dom);r.append(u),r=u}this.cache.reused.set(c,2)}let i=rr.get(t.text);i&&this.cache.reused.set(i,2);let s=new Fg(t.text,t.text.nodeValue);s.flags|=8,r.append(s)}addInlineWidget(t,n,o){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let i=this.ensureMarks(n,o);!r&&!(t.flags&16)&&i.append(this.getBuffer(1)),i.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,o){this.flushBuffer(),this.ensureMarks(n,o).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var o;t||(t=ohe);let r=CA.start(t,n||((o=this.cache.find(CA))===null||o===void 0?void 0:o.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var o;let r=this.curLine;for(let i=t.length-1;i>=0;i--){let s=t[i],a;if(n>0&&(a=r.lastChild)&&a instanceof xo&&a.mark.eq(s))r=a,n--;else{let c=xo.of(s,(o=this.cache.find(xo,p=>p.mark.eq(s)))===null||o===void 0?void 0:o.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!XY(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Ve.ios&&XY(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(a2,0,32)||new Qg(a2.toDOM(),0,a2,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=new oit(t.from,t.to,t.value,t.rank),o=this.wrappers.length;for(;o>0&&(this.wrappers[o-1].rank-n.rank||this.wrappers[o-1].to-n.to)<0;)o--;this.wrappers.splice(o,0,n)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let o of this.wrappers){let r=n.lastChild;if(o.froms.wrapper.eq(o.wrapper)))===null||t===void 0?void 0:t.dom);n.append(i),n=i}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),o=this.cache.find(oM,void 0,1);return o&&(o.flags=n),o||new oM(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class sit{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:i,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=r;let a=this.textOff=Math.min(t,r.length);return i?null:r.slice(0,a)}let n=Math.min(this.text.length,this.textOff+t),o=this.text.slice(this.textOff,n);return this.textOff=n,o}}const iM=[Qg,CA,Fg,xo,oM,mm,HP];for(let e=0;e[]),this.index=iM.map(()=>0),this.reused=new Map}add(t){t.demo&&console.log("Add widget to cache");let n=t.constructor.bucket,o=this.buckets[n];o.length<6?o.push(t):o[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,o=2){let r=t.bucket,i=this.buckets[r],s=this.index[r];for(let a=i.length-1;a>=0;a--){let c=(a+s)%i.length,p=i[c];if((!n||n(p))&&!this.reused.has(p))return i.splice(c,1),c{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(t,n){let o=n&&this.getCompositionContext(n.text);for(let r=0,i=0,s=0;;){let a=sr){let p=c-r;this.preserve(p,!s,!a),r=c,i+=p}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA),this.emit(i,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,o),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(i,a.toB)),i=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,o){let r=dit(this.old),i=this.openMarks;this.old.advance(t,o?1:-1,{skip:(s,a,c)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(c-a);else{let p=c>0||a{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof xo&&r.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?r.length&&(r.length=i=0):s instanceof xo&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let o=null,r=this.builder,i=0,s=xt.spans(this.decorations,t,n,{point:(a,c,p,u,l,d)=>{if(p instanceof zg){if(this.disallowBlockEffectsFor[d]){if(p.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=u.length,l>u.length)r.continueWidget(c-a);else{let f=p.widget||(p.block?wA.block:wA.inline),h=uit(p),m=this.cache.findWidget(f,c-a,h)||Qg.of(f,this.view,c-a,h);p.block?(p.startSide>0&&r.addLineStartIfNotCovered(o),r.addBlockWidget(m)):(r.ensureLine(o),r.addInlineWidget(m,u,l))}o=null}else o=cit(o,p);c>a&&this.text.skip(c-a)},span:(a,c,p,u)=>{for(let l=a;li,this.openMarks=s}forward(t,n){n-t<=10?this.old.advance(n-t,1,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,1,this.reuseWalker))}getCompositionContext(t){let n=[],o=null;for(let r=t.parentNode;;r=r.parentNode){let i=rr.get(r);if(r==this.view.contentDOM)break;i instanceof xo?n.push(i):i?.isLine()?o=i:r.nodeName=="DIV"&&!o&&r!=this.view.contentDOM?o=new CA(r,ohe):n.push(xo.of(new sw({tagName:r.nodeName.toLowerCase(),attributes:Fot(r)}),r))}return{line:o,marks:n}}}function XY(e,t){let n=o=>{for(let r of o.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function uit(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const ohe={class:"cm-line"};function cit(e,t){let n=t.spec.attributes,o=t.spec.class;return!n&&!o||(e||(e={class:"cm-line"}),n&&qk(n,e),o&&(e.class+=" "+o)),e}function dit(e){let t=[];for(let n=e.parents.length;n>1;n--){let o=n==e.parents.length?e.tile:e.parents[n].tile;o instanceof xo&&t.push(o.mark)}return t}function s2(e){let t=rr.get(e);return t&&t.setDOM(e.cloneNode()),e}class wA extends _p{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}wA.inline=new wA("span");wA.block=new wA("div");const a2=new class extends _p{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ZY{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=mt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new HP(t,t.contentDOM),this.updateInner([new Ji(0,0,0,t.state.doc.length)],null)}update(t){var n;let o=t.changedRanges;this.minWidth>0&&o.length&&(o.every(({fromA:u,toA:l})=>lthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!_it(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let i=r>-1?hit(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:l}=this.hasComposition;o=new Ji(u,l,t.changes.mapPos(u,-1),t.changes.mapPos(l,1)).addToSet(o.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(Ve.ie||Ve.chrome)&&!i&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let c=git(s,this.decorations,t.changes);c.length&&(o=Ji.extendWithRanges(o,c));let p=yit(a,this.blockWrappers,t.changes);return p.length&&(o=Ji.extendWithRanges(o,p)),i&&!o.some(u=>u.fromA<=i.range.fromA&&u.toA>=i.range.toA)&&(o=i.range.addToSet(o.slice())),this.tile.flags&2&&o.length==0?!1:(this.updateInner(o,i),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:o}=this.view;o.ignore(()=>{if(n||t.length){let s=this.tile,a=new lit(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(t,n),zL(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=Ve.chrome||Ve.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||o.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&UR(o,this.view.observer.selectionRange)&&!(r&&o.contains(r));if(!(i||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,p,u;if(c.empty?u=p=this.inlineDOMNearPos(c.anchor,c.assoc||1):(u=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),p=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Ve.gecko&&c.empty&&!this.hasComposition&&fit(p)){let d=document.createTextNode("");this.view.observer.ignore(()=>p.node.insertBefore(d,p.node.childNodes[p.offset]||null)),p=u=new bs(d,0),a=!0}let l=this.view.observer.selectionRange;(a||!l.focusNode||(!T0(p.node,p.offset,l.anchorNode,l.anchorOffset)||!T0(u.node,u.offset,l.focusNode,l.focusOffset))&&!this.suppressWidgetCursorChange(l,c))&&(this.view.observer.ignore(()=>{Ve.android&&Ve.chrome&&o.contains(l.focusNode)&&Ait(l.focusNode,o)&&(o.blur(),o.focus({preventScroll:!0}));let d=fC(this.view.root);if(d)if(c.empty){if(Ve.gecko){let f=pit(p.node,p.offset);if(f&&f!=3){let h=(f==1?xfe:Bfe)(p.node,p.offset);h&&(p=new bs(h.node,h.offset))}}d.collapse(p.node,p.offset),c.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=c.bidiLevel)}else if(d.extend){d.collapse(p.node,p.offset);try{d.extend(u.node,u.offset)}catch{}}else{let f=document.createRange();c.anchor>c.head&&([p,u]=[u,p]),f.setEnd(u.node,u.offset),f.setStart(p.node,p.offset),d.removeAllRanges(),d.addRange(f)}s&&this.view.root.activeElement==o&&(o.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(p,u)),this.impreciseAnchor=p.precise?null:new bs(l.anchorNode,l.anchorOffset),this.impreciseHead=u.precise?null:new bs(l.focusNode,l.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&T0(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,o=fC(t.root),{anchorNode:r,anchorOffset:i}=t.observer.selectionRange;if(!o||!n.empty||!n.assoc||!o.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let c=this.coordsAt(n.head,-1),p=this.coordsAt(n.head,1);if(!c||!p||c.bottom>p.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);o.collapse(u.node,u.offset),o.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let l=t.observer.selectionRange;t.docView.posFromDOM(l.anchorNode,l.anchorOffset)!=n.from&&o.collapse(r,i)}posFromDOM(t,n){let o=this.tile.nearest(t);if(!o)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=o.posAtStart;if(o.isComposite()){let i;if(t==o.dom)i=o.dom.childNodes[n];else{let s=fp(t)==0?0:n==0?-1:1;for(;;){let a=t.parentNode;if(a==o.dom)break;s==0&&a.firstChild!=a.lastChild&&(t==a.firstChild?s=-1:s=1),t=a}s<0?i=t:i=t.nextSibling}if(i==o.dom.firstChild)return r;for(;i&&!rr.get(i);)i=i.nextSibling;if(!i)return r+o.length;for(let s=0,a=r;;s++){let c=o.children[s];if(c.dom==i)return a;a+=c.length+c.breakAfter}}else return o.isText()?t==o.dom?r+n:r+(n?o.length:0):r}domAtPos(t,n){let{tile:o,offset:r}=this.tile.resolveBlock(t,n);return o.isWidget()?o.domPosFor(t,n):o.domIn(r,n)}inlineDOMNearPos(t,n){let o,r=-1,i=!1,s,a=-1,c=!1;return this.tile.blockTiles((p,u)=>{if(p.isWidget()){if(p.flags&32&&u>=t)return!0;p.flags&16&&(i=!0)}else{let l=u+p.length;if(u<=t&&(o=p,r=t-u,i=l=t&&!s&&(s=p,a=t-u,c=u>t),u>t&&s)return!0}}),!o&&!s?this.domAtPos(t,n):(i&&s?o=null:c&&o&&(s=null),o&&n<0||!s?o.domIn(r,n):s.domIn(a,n))}coordsAt(t,n){let{tile:o,offset:r}=this.tile.resolveBlock(t,n);return o.isWidget()?o.widget instanceof l2?null:o.coordsInWidget(r,n,!0):o.coordsIn(r,n)}lineAt(t,n){let{tile:o}=this.tile.resolveBlock(t,n);return o.isLine()?o:null}coordsForChar(t){let{tile:n,offset:o}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(i,s){if(i.isComposite())for(let a of i.children){if(a.length>=s){let c=r(a,s);if(c)return c}if(s-=a.length,s<0)break}else if(i.isText()&&sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,c=this.view.textDirection==pn.LTR,p=0,u=(l,d,f)=>{for(let h=0;hr);h++){let m=l.children[h],g=d+m.length,y=m.dom.getBoundingClientRect(),{height:_}=y;if(f&&!h&&(p+=y.top-f.top),m instanceof mm)g>o&&u(m,d,y);else if(d>=o&&(p>0&&n.push(-p),n.push(_+p),p=0,s)){let S=m.dom.lastChild,w=S?qR(S):[];if(w.length){let R=w[w.length-1],E=c?R.right-y.left:y.right-R.left;E>a&&(a=E,this.minWidth=i,this.minWidthFrom=d,this.minWidthTo=g)}}f&&h==l.children.length-1&&(p+=f.bottom-y.bottom),d=g+m.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?pn.RTL:pn.LTR}measureTextSize(){let t=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,c;for(let p of s.children){if(!p.isText()||/[^ -~]/.test(p.text))return;let u=qR(p.dom);if(u.length!=1)return;a+=u[0].width,c=u[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),o,r,i;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=qR(n.firstChild)[0];o=n.getBoundingClientRect().height,r=s&&s.width?s.width/27:7,i=s&&s.height?s.height:o,n.remove()}),{lineHeight:o,charWidth:r,textHeight:i}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let o=0,r=0;;r++){let i=r==n.viewports.length?null:n.viewports[r],s=i?i.from-1:this.view.state.doc.length;if(s>o){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(o).top)/this.view.scaleY;t.push(mt.replace({widget:new l2(a),block:!0,inclusive:!0,isBlockGap:!0}).range(o,s))}if(!i)break;o=i.to+1}return mt.set(t)}updateDeco(){let t=1,n=this.view.state.facet(JP).map(i=>(this.dynamicDecorationMap[t++]=typeof i=="function")?i(this.view):i),o=!1,r=this.view.state.facet(Kk).map((i,s)=>{let a=typeof i=="function";return a&&(o=!0),a?i(this.view):i});for(r.length&&(this.dynamicDecorationMap[t++]=o,n.push(xt.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof i=="function"?i(this.view):i)}scrollIntoView(t){if(t.isSnapshot){let p=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=p.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let p of this.view.state.facet(Xfe))try{if(p(this.view,t.range,t))return!0}catch(u){Bo(this.view.state,u,"scroll handler")}let{range:n}=t,o=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),r;if(!o)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,r.left),top:Math.min(o.top,r.top),right:Math.max(o.right,r.right),bottom:Math.max(o.bottom,r.bottom)});let i=Qk(this.view),s={left:o.left-i.left,top:o.top-i.top,right:o.right+i.right,bottom:o.bottom+i.bottom},{offsetWidth:a,offsetHeight:c}=this.view.scrollDOM;kot(this.view.scrollDOM,s,n.heado.isWidget()||o.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){zL(this.tile)}}function zL(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let o of e.children)zL(o,t)}}function fit(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function ihe(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let o=xfe(n.focusNode,n.focusOffset),r=Bfe(n.focusNode,n.focusOffset),i=o||r;if(r&&o&&r.node!=o.node){let a=rr.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)i=r;else if(e.docView.lastCompositionAfterCursor){let c=rr.get(o.node);!c||c.isText()&&c.text!=o.node.nodeValue||(i=r)}}if(e.docView.lastCompositionAfterCursor=i!=o,!i)return null;let s=t-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function hit(e,t,n){let o=ihe(e,n);if(!o)return null;let{node:r,from:i,to:s}=o,a=r.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(o.from,o.to)!=a)return null;let c=t.invertedDesc;return{range:new Ji(c.mapPos(i),c.mapPos(s),i,s),text:r}}function pit(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{ot.from&&(n=!0)}),n}class l2 extends _p{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function vit(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(r.length==0)return Oe.cursor(t);i==0?n=1:i==r.length&&(n=-1);let s=i,a=i;n<0?s=br(r.text,i,!1):a=br(r.text,i);let c=o(r.text.slice(s,a));for(;s>0;){let p=br(r.text,s,!1);if(o(r.text.slice(p,s))!=c)break;s=p}for(;ae.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-a)*.5)/a);i+=c*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+NL(s,i,e.state.tabSize)}function KL(e,t,n){let o=e.lineBlockAt(t);if(Array.isArray(o.type)){let r;for(let i of o.type){if(i.from>t)break;if(!(i.tot)return i;(!r||i.type==Hr.Text&&(r.type!=i.type||(n<0?i.fromt)))&&(r=i)}}return r||o}return o}function Cit(e,t,n,o){let r=KL(e,t.head,t.assoc||-1),i=!o||r.type!=Hr.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(i){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(a==pn.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(c!=null)return Oe.cursor(c,n?-1:1)}return Oe.cursor(n?r.to:r.from,n?-1:1)}function eX(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let a=t,c=null;;){let p=Yot(r,i,s,a,n),u=Vfe;if(!p){if(r.number==(n?e.state.doc.lines:1))return a;u=` +`,r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),p=e.visualLineSide(r,!n)}if(c){if(!c(u))return a}else{if(!o)return p;c=o(u)}a=p}}function wit(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return i=>{let s=o(i);return r==En.Space&&(r=s),r==s}}function Oit(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return Oe.cursor(r,t.assoc);let s=t.goalColumn,a,c=e.contentDOM.getBoundingClientRect(),p=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(p)s==null&&(s=p.left-c.left),a=i<0?p.top:p.bottom;else{let f=e.viewState.lineBlockAt(r);s==null&&(s=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-f.from))),a=(i<0?f.top:f.bottom)+u}let l=c.left+s,d=o??e.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let h=a+(d+f)*i,m=QL(e,{x:l,y:h},!1,i);return Oe.cursor(m.pos,m.assoc,void 0,s)}}function R0(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,(i,s,a)=>{if(t>i&&tr(e)),n.from,t.head>n.from?-1:1);return o==n.from?n:Oe.cursor(o,oe.viewState.docHeight)return new Cl(e.state.doc.length,-1);if(p=e.elementAtHeight(c),o==null)break;if(p.type==Hr.Text){let d=e.docView.coordsAt(o<0?p.from:p.to,o);if(d&&(o<0?d.top<=c+i:d.bottom>=c+i))break}let l=e.viewState.heightOracle.textHeight/2;c=o>0?p.bottom+l:p.top-l}if(e.viewport.from>=p.to||e.viewport.to<=p.from){if(n)return null;if(p.type==Hr.Text){let l=Sit(e,r,p,s,a);return new Cl(l,l==p.from?1:-1)}}if(p.type!=Hr.Text)return c<(p.top+p.bottom)/2?new Cl(p.from,1):new Cl(p.to,-1);let u=e.docView.lineAt(p.from,2);return(!u||u.length!=p.length)&&(u=e.docView.lineAt(p.from,-2)),ahe(e,u,p.from,s,a)}function ahe(e,t,n,o,r){let i=-1,s=null,a=1e9,c=1e9,p=r,u=r,l=(d,f)=>{for(let h=0;ho?m.left-o:m.rightr?m.top-r:m.bottom=p&&(p=Math.min(m.top,p),u=Math.max(m.bottom,u),y=0),(i<0||(y-c||g-a)<0)&&(i>=0&&c&&a=p+2?c=0:(i=f,a=g,c=y,s=m))}};if(t.isText()){for(let f=0;f(s.left+s.right)/2==(tX(e,i+n)==pn.LTR)?new Cl(n+br(t.text,i),-1):new Cl(n+i,1)}else{if(!t.length)return new Cl(n,1);for(let m=0;m(s.left+s.right)/2==(tX(e,i+n)==pn.LTR)?new Cl(f+d.length,-1):new Cl(f,1)}}function tX(e,t){let n=e.state.doc.lineAt(t);return e.bidiSpans(n)[op.find(e.bidiSpans(n),t-n.from,-1,1)].dir}const o0="￿";class Tit{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Gt.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=o0}readRange(t,n){if(!t)return this;let o=t.parentNode;for(let r=t;;){this.findPointBefore(o,r);let i=this.text.length;this.readNode(r);let s=rr.get(r),a=r.nextSibling;if(a==n){s?.breakAfter&&!a&&o!=this.view.contentDOM&&this.lineBreak();break}let c=rr.get(a);(s&&c?s.breakAfter:(s?s.breakAfter:tM(r))||tM(a)&&(r.nodeName!="BR"||s?.isWidget())&&this.text.length>i)&&!Eit(a,n)&&this.lineBreak(),r=a}return this.findPointBefore(o,n),this}readTextNode(t){let n=t.nodeValue;for(let o of this.points)o.node==t&&(o.pos=this.text.length+Math.min(o.offset,n.length));for(let o=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,s=1,a;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,o),s=this.lineSeparator.length):(a=r.exec(n))&&(i=a.index,s=a[0].length),this.append(n.slice(o,i<0?n.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=s-1);o=i+s}}readNode(t){let n=rr.get(t),o=n&&n.overrideDOMText;if(o!=null){this.findPointInside(t,o.length);for(let r=o.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let o of this.points)o.node==t&&t.childNodes[o.offset]==n&&(o.pos=this.text.length)}findPointInside(t,n){for(let o of this.points)(t.nodeType==3?o.node==t:t.contains(o.node))&&(o.pos=this.text.length+(Rit(t,o.node,o.offset)?n:0))}}function Rit(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:i,impreciseAnchor:s}=t.docView;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=lhe(t.docView.tile,n,o,0))){let a=i||s?[]:Iit(t),c=new Tit(a,t);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=jit(a,this.bounds.from)}else{let a=t.observer.selectionRange,c=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!qL(t.contentDOM,a.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(a.focusNode,a.focusOffset),p=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!qL(t.contentDOM,a.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=t.viewport;if((Ve.ios||Ve.chrome)&&t.state.selection.main.empty&&c!=p&&(u.from>0||u.to-1&&t.state.selection.ranges.length>1?this.newSel=t.state.selection.replaceRange(Oe.range(p,c)):this.newSel=Oe.single(p,c)}}}function lhe(e,t,n,o){if(e.isComposite()){let r=-1,i=-1,s=-1,a=-1;for(let c=0,p=o,u=o;cn)return lhe(l,t,n,p);if(d>=t&&r==-1&&(r=c,i=p),p>n&&l.dom.parentNode==e.dom){s=c,a=u;break}u=d,p=d+l.breakAfter}return{from:i,to:a<0?o+e.length:a,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s=0?e.children[s].dom:null}}else return e.isText()?{from:o,to:o+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function uhe(e,t){let n,{newSel:o}=t,r=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:s,to:a}=t.bounds,c=r.from,p=null;(i===8||Ve.android&&t.text.length=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:e.state.doc.lineAt(r.from).toDate.now()-50?n={from:r.from,to:r.to,insert:e.state.toText(e.inputState.insertingText)}:Ve.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==` + `&&e.lineWrapping&&(o&&(o=Oe.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:Qt.of([" "])}),n)return $k(e,n,o,i);if(o&&!o.main.eq(r)){let s=!1,a="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(s=!0),a=e.inputState.lastSelectionOrigin,a=="select.pointer"&&(o=she(e.state.facet(lw).map(c=>c(e)),o))),e.dispatch({selection:o,scrollIntoView:s,userEvent:a}),!0}else return!1}function $k(e,t,n,o=-1){if(Ve.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Ve.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&sA(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||o==8&&t.insert.lengthr.head)&&sA(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&sA(e.contentDOM,"Delete",46)))return!0;let i=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s,a=()=>s||(s=Pit(e,t,n));return e.state.facet(Qfe).some(c=>c(e,t.from,t.to,i,a))||e.dispatch(a()),!0}function Pit(e,t,n){let o,r=e.state,i=r.selection.main,s=-1;if(t.from==t.to&&t.fromi.to){let c=t.froml(e)),p,c);t.from==u&&(s=u)}if(s>-1)o={changes:t,selection:Oe.cursor(t.from+t.insert.length,-1)};else if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+p))}else{let c=r.changes(t),p=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=i.to+10&&t.to>=i.to-10){let u=e.state.sliceDoc(t.from,t.to),l,d=n&&ihe(e,n.main.head);if(d){let h=t.insert.length-(t.to-t.from);l={from:d.from,to:d.to-h}}else l=e.state.doc.lineAt(i.head);let f=i.to-t.to;o=r.changeByRange(h=>{if(h.from==i.from&&h.to==i.to)return{changes:c,range:p||h.map(c)};let m=h.to-f,g=m-u.length;if(e.state.sliceDoc(g,m)!=u||m>=l.from&&g<=l.to)return{range:h};let y=r.changes({from:g,to:m,insert:t.insert}),_=h.to-i.to;return{changes:y,range:p?Oe.range(Math.max(0,p.anchor+_),Math.max(0,p.head+_)):h.map(y)}})}else o={changes:c,selection:p&&r.selection.replaceRange(p)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:a,scrollIntoView:!0})}function che(e,t,n,o){let r=Math.min(e.length,t.length),i=0;for(;i0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(o=="end"){let c=Math.max(0,i-Math.min(s,a));n-=s+c-i}if(s=s?i-n:0;i-=c,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=c,s=i+(s-a),a=i}return{from:i,toA:s,toB:a}}function Iit(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new nX(n,o)),(r!=n||i!=o)&&t.push(new nX(r,i))),t}function jit(e,t){if(e.length==0)return null;let n=e[0].pos,o=e.length==2?e[1].pos:n;return n>-1&&o>-1?Oe.single(n+t,o+t):null}class Dit{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Ve.safari&&t.contentDOM.addEventListener("input",()=>null),Ve.gecko&&Qit(t.contentDOM.ownerDocument)}handleEvent(t){!qit(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let o=this.handlers[t];if(o){for(let r of o.observers)r(this.view,n);for(let r of o.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=Nit(t),o=this.handlers,r=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,a=o[i];a&&s!=!a.handlers.length&&(r.removeEventListener(i,this.handleEvent),a=null),a||r.addEventListener(i,this.handleEvent,{passive:s})}for(let i in o)i!="scroll"&&!n[i]&&r.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&fhe.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Ve.android&&Ve.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return Ve.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((n=dhe.find(o=>o.keyCode==t.keyCode))&&!t.ctrlKey||Lit.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Ve.safari&&!Ve.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function rX(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(r){Bo(n.state,r)}}}function Nit(e){let t=Object.create(null);function n(o){return t[o]||(t[o]={observers:[],handlers:[]})}for(let o of e){let r=o.spec,i=r&&r.plugin.domEventHandlers,s=r&&r.plugin.domEventObservers;if(i)for(let a in i){let c=i[a];c&&n(a).handlers.push(rX(o.value,c))}if(s)for(let a in s){let c=s[a];c&&n(a).observers.push(rX(o.value,c))}}for(let o in Rs)n(o).handlers.push(Rs[o]);for(let o in Wi)n(o).observers.push(Wi[o]);return t}const dhe=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Lit="dthko",fhe=[16,17,18,20,91,92,224,225],zT=6;function KT(e){return Math.max(0,e)*.7+8}function Fit(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class xit{constructor(t,n,o,r){this.view=t,this.startEvent=n,this.style=o,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Uot(t.contentDOM),this.atoms=t.state.facet(lw).map(s=>s(t));let i=t.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Gt.allowMultipleSelections)&&Bit(t,n),this.dragging=Uit(t,n)&&mhe(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Fit(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,o=0,r=0,i=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let c=Qk(this.view);t.clientX-c.left<=r+zT?n=-KT(r-t.clientX):t.clientX+c.right>=s-zT&&(n=KT(t.clientX-s)),t.clientY-c.top<=i+zT?o=-KT(i-t.clientY):t.clientY+c.bottom>=a-zT&&(o=KT(t.clientY-a)),this.setScrollSpeed(n,o)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,o=she(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!o.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:o,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Bit(e,t){let n=e.state.facet(Hfe);return n.length?n[0](t):Ve.mac?t.metaKey:t.ctrlKey}function kit(e,t){let n=e.state.facet(Gfe);return n.length?n[0](t):Ve.mac?!t.altKey:!t.ctrlKey}function Uit(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=fC(e.root);if(!o||o.rangeCount==0)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function qit(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,o;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(o=rr.get(n))&&o.isWidget()&&!o.isHidden&&o.widget.ignoreEvent(t))return!1;return!0}const Rs=Object.create(null),Wi=Object.create(null),hhe=Ve.ie&&Ve.ie_version<15||Ve.ios&&Ve.webkit_version<604;function Jit(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),phe(e,n.value)},50)}function GP(e,t,n){for(let o of e.facet(t))n=o(n,e);return n}function phe(e,t){t=GP(e.state,Hk,t);let{state:n}=e,o,r=1,i=n.toText(t),s=i.lines==n.selection.ranges.length;if($L!=null&&n.selection.ranges.every(c=>c.empty)&&$L==i.toString()){let c=-1;o=n.changeByRange(p=>{let u=n.doc.lineAt(p.from);if(u.from==c)return{range:p};c=u.from;let l=n.toText((s?i.line(r++).text:t)+n.lineBreak);return{changes:{from:u.from,insert:l},range:Oe.cursor(p.from+l.length)}})}else s?o=n.changeByRange(c=>{let p=i.line(r++);return{changes:{from:c.from,to:c.to,insert:p.text},range:Oe.cursor(c.from+p.length)}}):o=n.replaceSelection(i);e.dispatch(o,{userEvent:"input.paste",scrollIntoView:!0})}Wi.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};Rs.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Wi.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")};Wi.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Rs.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(zfe))if(n=o(e,t),n)break;if(!n&&t.button==0&&(n=Hit(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new xit(e,t,n,o)),o&&e.observer.ignore(()=>{Lfe(e.contentDOM);let i=e.root.activeElement;i&&!i.contains(e.contentDOM)&&i.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function oX(e,t,n,o){if(o==1)return Oe.cursor(t,n);if(o==2)return vit(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),s=r?r.posAtStart:i.from,a=r?r.posAtEnd:i.to;return aDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(sX+1)%3:1}function Hit(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),o=mhe(t),r=e.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),r=r.map(i.changes))},get(i,s,a){let c=e.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),p,u=oX(e,c.pos,c.assoc,o);if(n.pos!=c.pos&&!s){let l=oX(e,n.pos,n.assoc,o),d=Math.min(l.from,u.from),f=Math.max(l.to,u.to);u=d1&&(p=Git(r,c.pos))?p:a?r.addRange(u):Oe.create([u])}}}function Git(e,t){for(let n=0;n=t)return Oe.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Rs.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let i=r.posAtStart,s=i+r.length;(i>=n.to||s<=n.from)&&(n=Oe.range(i,s))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",GP(e.state,Gk,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Rs.dragend=e=>(e.inputState.draggedContent=null,!1);function lX(e,t,n,o){if(n=GP(e.state,Hk,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,s=o&&i&&kit(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},c=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Rs.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&lX(e,t,o.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(o[s]=a.result),i()},a.readAsText(n[s])}return!0}else{let o=t.dataTransfer.getData("Text");if(o)return lX(e,t,o,!0),!0}return!1};Rs.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=hhe?null:t.clipboardData;return n?(phe(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Jit(e),!1)};function zit(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout(()=>{o.remove(),e.focus()},50)}function Kit(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let s=e.doc.lineAt(i);s.number>r&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),r=s.number}o=!0}return{text:GP(e,Gk,t.join(e.lineBreak)),ranges:n,linewise:o}}let $L=null;Rs.copy=Rs.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=Kit(e.state);if(!n&&!r)return!1;$L=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=hhe?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(zit(e,n),!1)};const ghe=Ap.define();function bhe(e,t){let n=[];for(let o of e.facet($fe)){let r=o(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:ghe.of(!0)}):null}function yhe(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=bhe(e.state,t);n?e.dispatch(n):e.update([])}},10)}Wi.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),yhe(e)};Wi.blur=e=>{e.observer.clearSelectionRange(),yhe(e)};Wi.compositionstart=Wi.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Wi.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Ve.chrome&&Ve.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Wi.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Rs.beforeinput=(e,t)=>{var n,o;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let i=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=t.getTargetRanges();if(i&&s.length){let a=s[0],c=e.posAtDOM(a.startContainer,a.startOffset),p=e.posAtDOM(a.endContainer,a.endOffset);return $k(e,{from:c,to:p,insert:e.state.toText(i)},null),!0}}let r;if(Ve.chrome&&Ve.android&&(r=dhe.find(i=>i.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Ve.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Ve.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Wi.compositionend(e,t),20),!1};const uX=new Set;function Qit(e){uX.has(e)||(uX.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const cX=["pre-wrap","normal","pre-line","break-spaces"];let OA=!1;function dX(){OA=!1}class $it{constructor(t){this.lineWrapping=t,this.doc=Qt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let o=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(o+=Math.max(0,Math.ceil((n-t-o*this.lineLength*.5)/this.lineLength))),this.lineHeight*o}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return cX.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let o=0;o-1,c=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=o,this.textHeight=r,this.lineLength=i,c){this.heightSamples={};for(let p=0;p0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>JR&&(OA=!0),this.height=t)}replace(t,n,o){return vo.of(o)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,o,r){let i=this,s=o.doc;for(let a=r.length-1;a>=0;a--){let{fromA:c,toA:p,fromB:u,toB:l}=r[a],d=i.lineAt(c,bn.ByPosNoHeight,o.setDoc(n),0,0),f=d.to>=p?d:i.lineAt(p,bn.ByPosNoHeight,o,0,0);for(l+=f.to-p,p=f.to;a>0&&d.from<=r[a-1].toA;)c=r[a-1].fromA,u=r[a-1].fromB,a--,ci*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),o+=1+a.break,r-=a.size}else if(i>r*2){let a=t[o];a.break?t.splice(o,1,a.left,null,a.right):t.splice(o,1,a.left,a.right),o+=2+a.break,i-=a.size}else break;else if(r=i&&s(this.lineAt(0,bn.ByPos,o,r,i))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,o=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ui extends Ahe{constructor(t,n,o){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=o}mainBlock(t,n){return new ps(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,o){let r=o[0];return o.length==1&&(r instanceof ui||r instanceof Jr&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Jr?r=new ui(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):vo.of(o)}updateHeight(t,n=0,o=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(o||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Jr extends vo{constructor(t){super(t,0)}heightMetrics(t,n){let o=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,i=r-o+1,s,a=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*i);s=c/i,this.length>i+1&&(a=(this.height-c)/(this.length-i-1))}else s=this.height/i;return{firstLine:o,lastLine:r,perLine:s,perChar:a}}blockAt(t,n,o,r){let{firstLine:i,lastLine:s,perLine:a,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let p=r+(t0){let i=o[o.length-1];i instanceof Jr?o[o.length-1]=new Jr(i.length+r):o.push(null,new Jr(r-1))}if(t>0){let i=o[0];i instanceof Jr?o[0]=new Jr(t+i.length):o.unshift(new Jr(t-1),null)}return vo.of(o)}decomposeLeft(t,n){n.push(new Jr(t-1),null)}decomposeRight(t,n){n.push(null,new Jr(this.length-t-1))}updateHeight(t,n=0,o=!1,r){let i=n+this.length;if(r&&r.from<=n+this.length&&r.more){let s=[],a=Math.max(n,r.from),c=-1;for(r.from>n&&s.push(new Jr(r.from-n-1).updateHeight(t,n));a<=i&&r.more;){let u=t.doc.lineAt(a).length;s.length&&s.push(null);let l=r.heights[r.index++],d=0;l<0&&(d=-l,l=r.heights[r.index++]),c==-1?c=l:Math.abs(l-c)>=JR&&(c=-2);let f=new ui(u,l,d);f.outdated=!1,s.push(f),a+=u+1}a<=i&&s.push(null,new Jr(i-a).updateHeight(t,a));let p=vo.of(s);return(c<0||Math.abs(p.height-this.height)>=JR||Math.abs(c-this.heightMetrics(t,n).perLine)>=JR)&&(OA=!0),sM(this,p)}else(o||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Xit extends vo{constructor(t,n,o){super(t.length+n+o.length,t.height+o.height,n|(t.outdated||o.outdated?2:0)),this.left=t,this.right=o,this.size=t.size+o.size}get break(){return this.flags&1}blockAt(t,n,o,r){let i=o+this.left.height;return ta))return p;let u=n==bn.ByPosNoHeight?bn.ByPosNoHeight:bn.ByPos;return c?p.join(this.right.lineAt(a,u,o,s,a)):this.left.lineAt(a,u,o,r,i).join(p)}forEachLine(t,n,o,r,i,s){let a=r+this.left.height,c=i+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,o,a,c,s);else{let p=this.lineAt(c,bn.ByPos,o,r,i);t=t&&p.from<=n&&s(p),n>p.to&&this.right.forEachLine(p.to+1,n,o,a,c,s)}}replace(t,n,o){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,o));let i=[];t>0&&this.decomposeLeft(t,i);let s=i.length;for(let a of o)i.push(a);if(t>0&&fX(i,s-1),n=o&&n.push(null)),t>o&&this.right.decomposeLeft(t-o,n)}decomposeRight(t,n){let o=this.left.length,r=o+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?vo.of(this.break?[t,null,n]:[t,n]):(this.left=sM(this.left,t),this.right=sM(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,o=!1,r){let{left:i,right:s}=this,a=n+i.length+this.break,c=null;return r&&r.from<=n+i.length&&r.more?c=i=i.updateHeight(t,n,o,r):i.updateHeight(t,n,o),r&&r.from<=a+s.length&&r.more?c=s=s.updateHeight(t,a,o,r):s.updateHeight(t,a,o),c?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function fX(e,t){let n,o;e[t]==null&&(n=e[t-1])instanceof Jr&&(o=e[t+1])instanceof Jr&&e.splice(t-1,3,new Jr(n.length+1+o.length))}const Zit=5;class Wk{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let o=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof ui?r.length+=o-this.pos:(o>this.pos||!this.isCovered)&&this.nodes.push(new ui(o-this.pos,-1,0)),this.writtenTo=o,n>o&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,o){if(t=Zit)&&this.addLineDeco(r,i,s)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new ui(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let o=new Jr(n-t);return this.oracle.doc.lineAt(t).to==n&&(o.flags|=4),o}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof ui)return t;let n=new ui(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,o){let r=this.ensureLine();r.length+=o,r.collapsed+=o,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+o}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ui)&&!this.isCovered?this.nodes.push(new ui(0,-1,0)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&l.overflow!="visible"){let d=u.getBoundingClientRect();i=Math.max(i,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),c=Math.min(p==e.parentNode?r.innerHeight:c,d.bottom)}p=l.position=="absolute"||l.position=="fixed"?u.offsetParent:u.parentNode}else if(p.nodeType==11)p=p.host;else break;return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,c)-(n.top+t)}}function rst(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function ost(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class c2{constructor(t,n,o,r){this.from=t,this.to=n,this.size=o,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let o=0;otypeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new $it(n),this.stateDeco=mX(t),this.heightMap=vo.empty().applyChanges(this.stateDeco,Qt.empty,this.heightOracle.setDoc(t.doc),[new Ji(0,0,0,t.doc.length)]);for(let o=0;o<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());o++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=mt.set(this.lineGaps.map(o=>o.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let o=0;o<=1;o++){let r=o?n.head:n.anchor;if(!t.some(({from:i,to:s})=>r>=i&&r<=s)){let{from:i,to:s}=this.lineBlockAt(r);t.push(new QT(i,s))}}return this.viewports=t.sort((o,r)=>o.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?pX:new Yk(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(i0(t,this.scaler))})}update(t,n=null){this.state=t.state;let o=this.stateDeco;this.stateDeco=mX(this.state);let r=t.changedRanges,i=Ji.extendWithRanges(r,est(o,this.stateDeco,t?t.changes:gr.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);dX(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||OA)&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let c=i.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let p=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(p||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Yfe)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let n=t.contentDOM,o=window.getComputedStyle(n),r=this.heightOracle,i=o.whiteSpace;this.defaultTextDirection=o.direction=="rtl"?pn.RTL:pn.LTR;let s=this.heightOracle.mustRefreshForWrapping(i),a=n.getBoundingClientRect(),c=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let p=0,u=0;if(a.width&&a.height){let{scaleX:w,scaleY:R}=Nfe(n,a);(w>.005&&Math.abs(this.scaleX-w)>.005||R>.005&&Math.abs(this.scaleY-R)>.005)&&(this.scaleX=w,this.scaleY=R,p|=16,s=c=!0)}let l=(parseInt(o.paddingTop)||0)*this.scaleY,d=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=l||this.paddingBottom!=d)&&(this.paddingTop=l,this.paddingBottom=d,p|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,p|=16);let f=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=Ffe(t.scrollDOM);let h=(this.printing?ost:nst)(n,this.paddingTop),m=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(c=!0)),!this.inView&&!this.scrollTarget&&!rst(t.dom))return 0;let _=a.width;if((this.contentDOMWidth!=_||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,p|=16),c){let w=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(s=!0),s||r.lineWrapping&&Math.abs(_-this.contentDOMWidth)>r.charWidth){let{lineHeight:R,charWidth:E,textHeight:T}=t.docView.measureTextSize();s=R>0&&r.refresh(i,R,E,T,Math.max(5,_/E),w),s&&(t.docView.minWidth=0,p|=16)}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),dX();for(let R of this.viewports){let E=R.from==this.viewport.from?w:t.docView.measureVisibleLineHeights(R);this.heightMap=(s?vo.empty().applyChanges(this.stateDeco,Qt.empty,this.heightOracle,[new Ji(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new Wit(R.from,E))}OA&&(p|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(p&2&&(p|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),p|=this.updateForViewport()),(p&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),p|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),p}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let o=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,c=new QT(r.lineAt(s-o*1e3,bn.ByHeight,i,0,0).from,r.lineAt(a+(1-o)*1e3,bn.ByHeight,i,0,0).to);if(n){let{head:p}=n.range;if(pc.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=r.lineAt(p,bn.ByPos,i,0,0),d;n.y=="center"?d=(l.top+l.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&p=a+Math.max(10,Math.min(o,250)))&&r>s-2*1e3&&i>1,s=r<<1;if(this.defaultTextDirection!=pn.LTR&&!o)return[];let a=[],c=(u,l,d,f)=>{if(l-uu&&yy.from>=d.from&&y.to<=d.to&&Math.abs(y.from-u)y.from<_&&y.to>_));if(!g){if(lS.from<=l&&S.to>=l)){let S=n.moveToLineBoundary(Oe.cursor(l),!1,!0).head;S>u&&(l=S)}let y=this.gapSize(d,u,l,f),_=o||y<2e6?y:2e6;g=new c2(u,l,y,_)}a.push(g)},p=u=>{if(u.length2e6)for(let E of t)E.from>=u.from&&E.fromu.from&&c(u.from,f,u,l),hn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let o=[];xt.spans(n,this.viewport.from,this.viewport.to,{span(i,s){o.push({from:i,to:s})},point(){}},20);let r=0;if(o.length!=this.visibleRanges.length)r=12;else for(let i=0;i=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||i0(this.heightMap.lineAt(t,bn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||i0(this.heightMap.lineAt(this.scaler.fromDOM(t),bn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return i0(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class QT{constructor(t,n){this.from=t,this.to=n}}function sst(e,t,n){let o=[],r=e,i=0;return xt.spans(n,e,t,{span(){},point(s,a){s>r&&(o.push({from:r,to:s}),i+=s-r),r=a}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:i,to:s}=t[r],a=s-i;if(o<=a)return i+o;o-=a}}function WT(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}function ast(e,t){for(let n of e)if(t(n))return n}const pX={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function mX(e){let t=e.facet(JP).filter(o=>typeof o!="function"),n=e.facet(Kk).filter(o=>typeof o!="function");return n.length&&t.push(xt.join(n)),t}class Yk{constructor(t,n,o){let r=0,i=0,s=0;this.viewports=o.map(({from:a,to:c})=>{let p=n.lineAt(a,bn.ByPos,t,0,0).top,u=n.lineAt(c,bn.ByPos,t,0,0).bottom;return r+=u-p,{from:a,to:c,top:p,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let a of this.viewports)a.domTop=s+(a.top-i)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(t){for(let n=0,o=0,r=0;;n++){let i=nn.from==t.viewports[o].from&&n.to==t.viewports[o].to):!1}}function i0(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),o=t.toDOM(e.bottom);return new ps(e.from,e.length,n,o-n,Array.isArray(e._content)?e._content.map(r=>i0(r,t)):e._content)}const YT=Qe.define({combine:e=>e.join(" ")}),WL=Qe.define({combine:e=>e.indexOf(!0)>-1}),YL=wm.newName(),_he=wm.newName(),vhe=wm.newName(),She={"&light":"."+_he,"&dark":"."+vhe};function XL(e,t,n){return new wm(t,{finish(o){return/&/.test(o)?o.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+o}})}const lst=XL("."+YL,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},She),ust={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},d2=Ve.ie&&Ve.ie_version<=11;class cst{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new qot,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let o of n)this.queue.push(o);(Ve.ie&&Ve.ie_version<=11||Ve.ios&&t.composing)&&n.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ve.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Ve.chrome&&Ve.chrome_version<126)&&(this.editContext=new fst(t),t.state.facet(rp)&&(t.contentDOM.editContext=this.editContext.editContext)),d2&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,o)=>n!=t[o]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:o}=this,r=this.selectionRange;if(o.state.facet(rp)?o.root.activeElement!=this.dom:!UR(this.dom,r))return;let i=r.anchorNode&&o.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Ve.ie&&Ve.ie_version<=11||Ve.android&&Ve.chrome)&&!o.state.selection.main.empty&&r.focusNode&&T0(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=fC(t.root);if(!n)return!1;let o=Ve.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&dst(this.view,n)||n;if(!o||this.selectionRange.eq(o))return!1;let r=UR(this.dom,o);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&sA(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,o=-1,r=!1;for(let i of t){let s=this.readMutation(i);s&&(s.typeOver&&(r=!0),n==-1?{from:n,to:o}=s:(n=Math.min(s.from,n),o=Math.max(s.to,o)))}return{from:n,to:o,typeOver:r}}readChange(){let{from:t,to:n,typeOver:o}=this.processRecords(),r=this.selectionChanged&&UR(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Mit(this.view,t,n,o);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let o=this.view.state,r=uhe(this.view,n);return this.view.state==o&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let o=gX(n,t.previousSibling||t.target.previousSibling,-1),r=gX(n,t.nextSibling||t.target.nextSibling,1);return{from:o?n.posAfter(o):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(rp)!=t.state.facet(rp)&&(t.view.contentDOM.editContext=t.state.facet(rp)?this.editContext.editContext:null))}destroy(){var t,n,o;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(o=this.resizeScroll)===null||o===void 0||o.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function gX(e,t,n){for(;t;){let o=rr.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function bX(e,t){let n=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return T0(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function dst(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return bX(e,r)}let n=null;function o(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",o,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",o,!0),n?bX(e,n):null}class fst{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=o=>{let r=t.state.selection.main,{anchor:i,head:s}=r,a=this.toEditorPos(o.updateRangeStart),c=this.toEditorPos(o.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:o.updateRangeStart,editorBase:a,drifted:!1});let p=c-a>o.text.length;a==this.from&&ithis.to&&(c=i);let u=che(t.state.sliceDoc(a,c),o.text,(p?r.from:r.to)-a,p?"end":null);if(!u){let d=Oe.single(this.toEditorPos(o.selectionStart),this.toEditorPos(o.selectionEnd));d.main.eq(r)||t.dispatch({selection:d,userEvent:"select"});return}let l={from:u.from+a,to:u.toA+a,insert:Qt.of(o.text.slice(u.from,u.toB).split(` +`))};if((Ve.mac||Ve.android)&&l.from==s-1&&/^\. ?$/.test(o.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:c,insert:Qt.of([o.text.replace("."," ")])}),this.pendingContextChange=l,!t.state.readOnly){let d=this.to-this.from+(l.to-l.from+l.insert.length);$k(t,l,Oe.single(this.toEditorPos(o.selectionStart,d),this.toEditorPos(o.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),l.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,o.updateRangeStart-1),Math.min(n.text.length,o.updateRangeStart+1)))&&this.handlers.compositionend(o)},this.handlers.characterboundsupdate=o=>{let r=[],i=null;for(let s=this.toEditorPos(o.rangeStart),a=this.toEditorPos(o.rangeEnd);s{let r=[];for(let i of o.getTextFormats()){let s=i.underlineStyle,a=i.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let c=this.toEditorPos(i.rangeStart),p=this.toEditorPos(i.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:o}=this.composing;this.composing=null,o&&this.reset(t.state)}};for(let o in this.handlers)n.addEventListener(o,this.handlers[o]);this.measureReq={read:o=>{this.editContext.updateControlBounds(o.contentDOM.getBoundingClientRect());let r=fC(o.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,o=!1,r=this.pendingContextChange;return t.changes.iterChanges((i,s,a,c,p)=>{if(o)return;let u=p.length-(s-i);if(r&&s>=r.to)if(r.from==i&&r.to==s&&r.insert.eq(p)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(t.state);if(i+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(ithis.to||this.to-this.from+p.length>3e4){o=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(s),p.toString()),this.to+=u}n+=u}),r&&!o&&this.revertPending(t.state),!o}update(t){let n=this.pendingContextChange,o=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(o.from,o.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,o=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=o||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(o,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let o=this.composing;return o&&o.drifted?o.editorBase+(t-o.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class He{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:o}=t;this.dispatchTransactions=t.dispatchTransactions||o&&(r=>r.forEach(i=>o(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Jot(t.parent)||document,this.viewState=new hX(t.state||Gt.create(t)),t.scrollTo&&t.scrollTo.is(GT)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Hy).map(r=>new i2(r));for(let r of this.plugins)r.update(this);this.observer=new cst(this),this.inputState=new Dit(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ZY(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let n=t.length==1&&t[0]instanceof yr?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,o=!1,r,i=this.state;for(let d of t){if(d.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=d.state}if(this.destroyed){this.viewState.state=i;return}let s=this.hasFocus,a=0,c=null;t.some(d=>d.annotation(ghe))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,c=bhe(i,s),c||(a=1));let p=this.observer.delayedAndroidKey,u=null;if(p?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(Gt.phrases)!=this.state.facet(Gt.phrases))return this.setState(i);r=rM.create(this,i,t),r.flags|=a;let l=this.viewState.scrollTarget;try{this.updateState=2;for(let d of t){if(l&&(l=l.map(d.changes)),d.scrollIntoView){let{main:f}=d.state.selection;l=new aA(f.empty?f:Oe.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of d.effects)f.is(GT)&&(l=f.value.clip(this.state))}this.viewState.update(r,l),this.bidiCache=aM.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(r0)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(YT)!=r.state.facet(YT)&&(this.viewState.mustMeasureContent=!0),(n||o||l||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let d of this.state.facet(GL))try{d(r)}catch(f){Bo(this.state,f,"update listener")}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!uhe(this,u)&&p.force&&sA(this.contentDOM,p.key,p.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let o of this.plugins)o.destroy(this);this.viewState=new hX(t),this.plugins=t.facet(Hy).map(o=>new i2(o)),this.pluginMap.clear();for(let o of this.plugins)o.update(this);this.docView.destroy(),this.docView=new ZY(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Hy),o=t.state.facet(Hy);if(n!=o){let r=[];for(let i of o){let s=n.indexOf(i);if(s<0)r.push(new i2(i));else{let a=this.plugins[s];a.mustUpdate=t,r.push(a)}}for(let i of this.plugins)i.mustUpdate!=t&&i.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,o=this.scrollDOM,r=o.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:s}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Ffe(o))i=-1,s=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(r);i=f.from,s=f.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let p=[];c&4||([this.measureRequests,p]=[p,this.measureRequests]);let u=p.map(f=>{try{return f.read(this)}catch(h){return Bo(this.state,h),yX}}),l=rM.create(this,this.state,[]),d=!1;l.flags|=c,n?n.flags|=c:n=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),d=this.docView.update(l),d&&this.docViewUpdate());for(let f=0;f1||h<-1){r=r+h,o.scrollTop=r/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(GL))a(n)}get themeClasses(){return YL+" "+(this.state.facet(WL)?vhe:_he)+" "+this.state.facet(YT)}updateAttrs(){let t=AX(this,ehe,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(rp)?"true":"false",class:"cm-content",style:`${Ve.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),AX(this,zk,n);let o=this.observer.ignore(()=>{let r=KY(this.contentDOM,this.contentAttrs,n),i=KY(this.dom,this.editorAttrs,t);return r||i});return this.editorAttrs=t,this.contentAttrs=n,o}showAnnouncements(t){let n=!0;for(let o of t)for(let r of o.effects)if(r.is(He.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(r0);let t=this.state.facet(He.cspNonce);wm.mount(this.root,this.styleModules.concat(lst).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;no.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,o){return u2(this,t,eX(this,t,n,o))}moveByGroup(t,n){return u2(this,t,eX(this,t,n,o=>wit(this,t.head,o)))}visualLineSide(t,n){let o=this.bidiSpans(t),r=this.textDirectionAt(t.from),i=o[n?o.length-1:0];return Oe.cursor(i.side(n,r)+t.from,i.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,o=!0){return Cit(this,t,n,o)}moveVertically(t,n,o){return u2(this,t,Oit(this,t,n,o))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let o=QL(this,t,n);return o&&o.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),QL(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let o=this.docView.coordsAt(t,n);if(!o||o.left==o.right)return o;let r=this.state.doc.lineAt(t),i=this.bidiSpans(r),s=i[op.find(i,t-r.from,-1,n)];return nM(o,s.dir==pn.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Wfe)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>hst)return Jfe(t.length);let n=this.textDirectionAt(t.from),o;for(let i of this.bidiCache)if(i.from==t.from&&i.dir==n&&(i.fresh||qfe(i.isolates,o=WY(this,t))))return i.order;o||(o=WY(this,t));let r=Wot(t.text,n,o);return this.bidiCache.push(new aM(t.from,t.to,n,o,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Ve.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Lfe(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){return GT.of(new aA(typeof t=="number"?Oe.cursor(t):t,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,o=this.viewState.scrollAnchorAt(t);return GT.of(new aA(Oe.cursor(o.from),"start","start",o.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ir.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ir.define(()=>({}),{eventObservers:t})}static theme(t,n){let o=wm.newName(),r=[YT.of(o),r0.of(XL(`.${o}`,t))];return n&&n.dark&&r.push(WL.of(!0)),r}static baseTheme(t){return gb.lowest(r0.of(XL("."+YL,t,She)))}static findFromDOM(t){var n;let o=t.querySelector(".cm-content"),r=o&&rr.get(o)||rr.get(t);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}}He.styleModule=r0;He.inputHandler=Qfe;He.clipboardInputFilter=Hk;He.clipboardOutputFilter=Gk;He.scrollHandler=Xfe;He.focusChangeEffect=$fe;He.perLineTextDirection=Wfe;He.exceptionSink=Kfe;He.updateListener=GL;He.editable=rp;He.mouseSelectionStyle=zfe;He.dragMovesSelection=Gfe;He.clickAddsSelectionRange=Hfe;He.decorations=JP;He.blockWrappers=the;He.outerDecorations=Kk;He.atomicRanges=lw;He.bidiIsolatedRanges=nhe;He.scrollMargins=rhe;He.darkTheme=WL;He.cspNonce=Qe.define({combine:e=>e.length?e[0]:""});He.contentAttributes=zk;He.editorAttributes=ehe;He.lineWrapping=He.contentAttributes.of({class:"cm-lineWrapping"});He.announce=Et.define();const hst=4096,yX={};class aM{constructor(t,n,o,r,i,s){this.from=t,this.to=n,this.dir=o,this.isolates=r,this.fresh=i,this.order=s}static update(t,n){if(n.empty&&!t.some(i=>i.fresh))return t;let o=[],r=t.length?t[t.length-1].dir:pn.LTR;for(let i=Math.max(0,t.length-10);i=0;r--){let i=o[r],s=typeof i=="function"?i(e):i;s&&qk(s,n)}return n}const pst=Ve.mac?"mac":Ve.windows?"win":Ve.linux?"linux":"key";function mst(e,t){const n=e.split(/-(?!$)/);let o=n[n.length-1];o=="Space"&&(o=" ");let r,i,s,a;for(let c=0;co.concat(r),[]))),n}function bst(e,t,n){return whe(Che(e.state),t,e,n)}let lm=null;const yst=4e3;function Ast(e,t=pst){let n=Object.create(null),o=Object.create(null),r=(s,a)=>{let c=o[s];if(c==null)o[s]=a;else if(c!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},i=(s,a,c,p,u)=>{var l,d;let f=n[s]||(n[s]=Object.create(null)),h=a.split(/ (?!$)/).map(y=>mst(y,t));for(let y=1;y{let w=lm={view:S,prefix:_,scope:s};return setTimeout(()=>{lm==w&&(lm=null)},yst),!0}]})}let m=h.join(" ");r(m,!1);let g=f[m]||(f[m]={preventDefault:!1,stopPropagation:!1,run:((d=(l=f._any)===null||l===void 0?void 0:l.run)===null||d===void 0?void 0:d.slice())||[]});c&&g.run.push(c),p&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let p of a){let u=n[p]||(n[p]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:l}=s;for(let d in u)u[d].run.push(f=>l(f,ZL))}let c=s[t]||s.key;if(c)for(let p of a)i(p,c,s.run,s.preventDefault,s.stopPropagation),s.shift&&i(p,"Shift-"+c,s.shift,s.preventDefault,s.stopPropagation)}return n}let ZL=null;function whe(e,t,n,o){ZL=t;let r=Dot(t),i=Lo(r,0),s=Sl(i)==r.length&&r!=" ",a="",c=!1,p=!1,u=!1;lm&&lm.view==n&&lm.scope==o&&(a=lm.prefix+" ",fhe.indexOf(t.keyCode)<0&&(p=!0,lm=null));let l=new Set,d=g=>{if(g){for(let y of g.run)if(!l.has(y)&&(l.add(y),y(n)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),p=!0)}return!1},f=e[o],h,m;return f&&(d(f[a+XT(r,t,!s)])?c=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Ve.windows&&t.ctrlKey&&t.altKey)&&!(Ve.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(h=Om[t.keyCode])&&h!=r?(d(f[a+XT(h,t,!0)])||t.shiftKey&&(m=cC[t.keyCode])!=r&&m!=h&&d(f[a+XT(m,t,!1)]))&&(c=!0):s&&t.shiftKey&&d(f[a+XT(r,t,!0)])&&(c=!0),!c&&d(f._any)&&(c=!0)),p&&(c=!0),c&&u&&t.stopPropagation(),ZL=null,c}class uw{constructor(t,n,o,r,i){this.className=t,this.left=n,this.top=o,this.width=r,this.height=i}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,o){if(o.empty){let r=t.coordsAtPos(o.head,o.assoc||1);if(!r)return[];let i=Ohe(t);return[new uw(n,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}else return _st(t,n,o)}}function Ohe(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==pn.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function vX(e,t,n,o){let r=e.coordsAtPos(t,n*2);if(!r)return o;let i=e.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,a=e.posAtCoords({x:i.left+1,y:s}),c=e.posAtCoords({x:i.right-1,y:s});return a==null||c==null?o:{from:Math.max(o.from,Math.min(a,c)),to:Math.min(o.to,Math.max(a,c))}}function _st(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==pn.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),c=Ohe(e),p=s.querySelector(".cm-line"),u=p&&window.getComputedStyle(p),l=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),f=KL(e,o,1),h=KL(e,r,-1),m=f.type==Hr.Text?f:null,g=h.type==Hr.Text?h:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=vX(e,o,1,m)),g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=vX(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return _(S(n.from,n.to,m));{let R=m?S(n.from,null,m):w(f,!1),E=g?S(null,n.to,g):w(h,!0),T=[];return(m||f).to<(g||h).from-(m&&g?1:0)||f.widgetLineBreaks>1&&R.bottom+e.defaultLineHeight/2q&&U.from=V)break;K>J&&L(Math.max(le,J),R==null&&le<=q,Math.min(K,V),E==null&&K>=I,Q.dir)}if(J=G.to+1,J>=V)break}return N.length==0&&L(q,R==null,I,E==null,e.textDirection),{top:D,bottom:B,horizontal:N}}function w(R,E){let T=a.top+(E?R.top:R.bottom);return{top:T,bottom:T,horizontal:[]}}}function vst(e,t){return e.constructor==t.constructor&&e.eq(t)}class Sst{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(VR)!=t.state.facet(VR)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,o=t.facet(VR);for(;n!vst(n,this.drawn[o]))){let n=this.dom.firstChild,o=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[o].constructor&&r.update(n,this.drawn[o])?(n=n.nextSibling,o++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,Ve.safari&&Ve.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const VR=Qe.define();function The(e){return[ir.define(t=>new Sst(t,e)),VR.of(e)]}const pC=Qe.define({combine(e){return Hl(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function Cst(e={}){return[pC.of(e),wst,Ost,Tst,Yfe.of(!0)]}function Rhe(e){return e.startState.facet(pC)!=e.state.facet(pC)}const wst=The({above:!0,markers(e){let{state:t}=e,n=t.facet(pC),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty||n.drawRangeCursor){let s=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:Oe.cursor(r.head,r.head>r.anchor?-1:1);for(let c of uw.forRange(e,s,a))o.push(c)}}return o},update(e,t){e.transactions.some(o=>o.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Rhe(e);return n&&SX(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){SX(t.state,e)},class:"cm-cursorLayer"});function SX(e,t){t.style.animationDuration=e.facet(pC).cursorBlinkRate+"ms"}const Ost=The({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:uw.forRange(e,"cm-selectionBackground",t)).reduce((t,n)=>t.concat(n))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||Rhe(e)},class:"cm-selectionLayer"}),Tst=gb.highest(He.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Ehe=Et.define({map(e,t){return e==null?null:t.mapPos(e)}}),s0=Gr.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,o)=>o.is(Ehe)?o.value:n,e)}}),Rst=ir.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(s0);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(s0)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(s0),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(s0)!=e&&this.view.dispatch({effects:Ehe.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Est(){return[s0,Rst]}function CX(e,t,n,o,r){t.lastIndex=0;for(let i=e.iterRange(n,o),s=n,a;!i.next().done;s+=i.value.length)if(!i.lineBreak)for(;a=t.exec(i.value);)r(s+a.index,a)}function Mst(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}class Pst{constructor(t){const{regexp:n,decoration:o,decorate:r,boundary:i,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(a,c,p,u)=>r(u,p,p+a[0].length,a,c);else if(typeof o=="function")this.addMatch=(a,c,p,u)=>{let l=o(a,c,p);l&&u(p,p+a[0].length,l)};else if(o)this.addMatch=(a,c,p,u)=>u(p,p+a[0].length,o);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=s}createDeco(t){let n=new dp,o=n.add.bind(n);for(let{from:r,to:i}of Mst(t,this.maxLength))CX(t.state.doc,this.regexp,r,i,(s,a)=>this.addMatch(a,t,s,o));return n.finish()}updateDeco(t,n){let o=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((i,s,a,c)=>{c>=t.view.viewport.from&&a<=t.view.viewport.to&&(o=Math.min(a,o),r=Math.max(c,r))}),t.viewportMoved||r-o>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),o,r):n}updateRange(t,n,o,r){for(let i of t.visibleRanges){let s=Math.max(i.from,o),a=Math.min(i.to,r);if(a>=s){let c=t.state.doc.lineAt(s),p=c.toc.from;s--)if(this.boundary.test(c.text[s-1-c.from])){u=s;break}for(;ad.push(y.range(m,g));if(c==p)for(this.regexp.lastIndex=u-c.from;(f=this.regexp.exec(c.text))&&f.indexthis.addMatch(g,t,m,h));n=n.update({filterFrom:u,filterTo:l,filter:(m,g)=>ml,add:d})}}return n}}const eF=/x/.unicode!=null?"gu":"g",Ist=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,eF),jst={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let f2=null;function Dst(){var e;if(f2==null&&typeof document<"u"&&document.body){let t=document.body.style;f2=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return f2||!1}const HR=Qe.define({combine(e){let t=Hl(e,{render:null,specialChars:Ist,addSpecialChars:null});return(t.replaceTabs=!Dst())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,eF)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,eF)),t}});function Nst(e={}){return[HR.of(e),Lst()]}let wX=null;function Lst(){return wX||(wX=ir.fromClass(class{constructor(e){this.view=e,this.decorations=mt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(HR)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Pst({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=Lo(t[0],0);if(i==9){let s=r.lineAt(o),a=n.state.tabSize,c=t_(s.text,a,o-s.from);return mt.replace({widget:new kst((a-c%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=mt.replace({widget:new Bst(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(HR);e.startState.facet(HR)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const Fst="•";function xst(e){return e>=32?Fst:e==10?"␤":String.fromCharCode(9216+e)}class Bst extends _p{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=xst(this.code),o=t.state.phrase("Control character")+" "+(jst[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,n);if(r)return r;let i=document.createElement("span");return i.textContent=n,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class kst extends _p{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function Ust(){return Jst}const qst=mt.line({class:"cm-activeLine"}),Jst=ir.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(qst.range(r.from)),t=r.from)}return mt.set(n)}},{decorations:e=>e.decorations}),tF=2e3;function Vst(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>tF||n.off>tF||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let c=o;c<=r;c++){let p=e.doc.line(c);p.length<=a&&i.push(Oe.range(p.from+s,p.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let c=o;c<=r;c++){let p=e.doc.line(c),u=NL(p.text,s,e.tabSize,!0);if(u<0)i.push(Oe.cursor(p.to));else{let l=NL(p.text,a,e.tabSize);i.push(Oe.range(p.from+u,p.from+l))}}}return i}function Hst(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function OX(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>tF?-1:r==o.length?Hst(e,t.clientX):t_(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function Gst(e,t){let n=OX(e,t),o=e.state.selection;return n?{update(r){if(r.docChanged){let i=r.changes.mapPos(r.startState.doc.line(n.line).from),s=r.state.doc.lineAt(i);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},o=o.map(r.changes)}},get(r,i,s){let a=OX(e,r);if(!a)return o;let c=Vst(e.state,n,a);return c.length?s?Oe.create(c.concat(o.ranges)):Oe.create(c):o}}:null}function zst(e){let t=(n=>n.altKey&&n.button==0);return He.mouseSelectionStyle.of((n,o)=>t(o)?Gst(n,o):null)}const Kst={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Qst={style:"cursor: crosshair"};function $st(e={}){let[t,n]=Kst[e.key||"Alt"],o=ir.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[o,He.contentAttributes.of(r=>{var i;return!((i=r.plugin(o))===null||i===void 0)&&i.isDown?Qst:null})]}const ZT="-10000px";class Mhe{constructor(t,n,o,r){this.facet=n,this.createTooltipView=o,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let i=null;this.tooltipViews=this.tooltips.map(s=>i=o(s,i))}update(t,n){var o;let r=t.state.facet(this.facet),i=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let s=[],a=n?[]:null;for(let c=0;cn[p]=c),n.length=a.length),this.input=r,this.tooltips=i,this.tooltipViews=s,!0}}function Wst(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const h2=Qe.define({combine:e=>{var t,n,o;return{position:Ve.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((o=e.find(r=>r.tooltipSpace))===null||o===void 0?void 0:o.tooltipSpace)||Wst}}}),TX=new WeakMap,Zk=ir.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(h2);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Mhe(e,eU,(n,o)=>this.createTooltip(n,o),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(h2);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),o=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=ZT,n.dom.style.left="0px",this.container.insertBefore(n.dom,o),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let o of this.manager.tooltipViews)o.dom.remove(),(e=o.destroy)===null||e===void 0||e.call(o);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(Ve.safari){let s=i.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let o=this.view.scrollDOM.getBoundingClientRect(),r=Qk(this.view);return{visible:{left:o.left+r.left,top:o.top+r.top,right:o.right-r.right,bottom:o.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(h2).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:o,scaleX:r,scaleY:i}=e,s=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||l.rightMath.min(n.right,o.right)+.1)){u.style.top=ZT;continue}let f=c.arrow?p.dom.querySelector(".cm-tooltip-arrow"):null,h=f?7:0,m=d.right-d.left,g=(t=TX.get(p))!==null&&t!==void 0?t:d.bottom-d.top,y=p.offset||Xst,_=this.view.textDirection==pn.LTR,S=d.width>o.right-o.left?_?o.left:o.right-d.width:_?Math.max(o.left,Math.min(l.left-(f?14:0)+y.x,o.right-m)):Math.min(Math.max(o.left,l.left-m+(f?14:0)-y.x),o.right-m),w=this.above[a];!c.strictSide&&(w?l.top-g-h-y.yo.bottom)&&w==o.bottom-l.bottom>l.top-o.top&&(w=this.above[a]=!w);let R=(w?l.top-o.top:o.bottom-l.bottom)-h;if(RS&&D.topE&&(E=w?D.top-g-2-h:D.bottom+h+2);if(this.position=="absolute"?(u.style.top=(E-e.parent.top)/i+"px",RX(u,(S-e.parent.left)/r)):(u.style.top=E/i+"px",RX(u,S/r)),f){let D=l.left+(_?y.x:-y.x)-(S+14-7);f.style.left=D/r+"px"}p.overlap!==!0&&s.push({left:S,top:E,right:T,bottom:E+g}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),p.positioned&&p.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=ZT}},{eventObservers:{scroll(){this.maybeMeasure()}}});function RX(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const Yst=He.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Xst={x:0,y:0},eU=Qe.define({enables:[Zk,Yst]}),lM=Qe.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class zP{static create(t){return new zP(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Mhe(t,lM,(n,o)=>this.createHostedView(n,o),n=>n.dom.remove())}createHostedView(t,n){let o=t.create(this.view);return o.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(o.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&o.mount&&o.mount(this.view),o}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let o of this.manager.tooltipViews){let r=o[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Zst=eU.compute([lM],e=>{let t=e.facet(lM);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var o;return(o=n.end)!==null&&o!==void 0?o:n.pos})),create:zP.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class eat{constructor(t,n,o,r,i){this.view=t,this.source=n,this.field=o,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let c=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),p=c&&c.dir==pn.RTL?-1:1;i=n.x{this.pending==a&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>Bo(t.state,c,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(Zk),n=t?t.manager.tooltips.findIndex(o=>o.create==zP.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,o;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r.length&&i&&!tat(i.dom,t)||this.pending){let{pos:s}=r[0]||this.pending,a=(o=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&o!==void 0?o:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!nat(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:o}=this;o&&o.dom.contains(t.relatedTarget)?this.watchTooltipLeave(o.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=o=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(o.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const eR=4;function tat(e,t){let{left:n,right:o,top:r,bottom:i}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();r=Math.min(a.top,r),i=Math.max(a.bottom,i)}return t.clientX>=n-eR&&t.clientX<=o+eR&&t.clientY>=r-eR&&t.clientY<=i+eR}function nat(e,t,n,o,r,i){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>o||s.rightr||Math.min(s.bottom,a)=t&&c<=n}function rat(e,t={}){let n=Et.define(),o=Gr.define({create(){return[]},update(r,i){if(r.length&&(t.hideOnChange&&(i.docChanged||i.selection)?r=[]:t.hideOn&&(r=r.filter(s=>!t.hideOn(i,s))),i.docChanged)){let s=[];for(let a of r){let c=i.changes.mapPos(a.pos,-1,yo.TrackDel);if(c!=null){let p=Object.assign(Object.create(null),a);p.pos=c,p.end!=null&&(p.end=i.changes.mapPos(p.end)),s.push(p)}}r=s}for(let s of i.effects)s.is(n)&&(r=s.value),s.is(oat)&&(r=[]);return r},provide:r=>lM.from(r)});return{active:o,extension:[o,ir.define(r=>new eat(r,e,o,n,t.hoverTime||300)),Zst]}}function Phe(e,t){let n=e.plugin(Zk);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const oat=Et.define(),EX=Qe.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function mC(e,t){let n=e.plugin(Ihe),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const Ihe=ir.fromClass(class{constructor(e){this.input=e.state.facet(gC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(EX);this.top=new tR(e,!0,t.topContainer),this.bottom=new tR(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(EX);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new tR(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new tR(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(gC);if(n!=this.input){let o=n.filter(c=>c),r=[],i=[],s=[],a=[];for(let c of o){let p=this.specs.indexOf(c),u;p<0?(u=c(e.view),a.push(u)):(u=this.panels[p],u.update&&u.update(e)),r.push(u),(u.top?i:s).push(u)}this.specs=o,this.panels=r,this.top.sync(i),this.bottom.sync(s);for(let c of a)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>He.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class tR{constructor(t,n,o){this.view=t,this.top=n,this.container=o,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=MX(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=MX(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function MX(e){let t=e.nextSibling;return e.remove(),t}const gC=Qe.define({enables:Ihe});class hp extends Cm{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}hp.prototype.elementClass="";hp.prototype.toDOM=void 0;hp.prototype.mapMode=yo.TrackBefore;hp.prototype.startSide=hp.prototype.endSide=-1;hp.prototype.point=!0;const GR=Qe.define(),iat=Qe.define(),sat={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>xt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},E0=Qe.define();function aat(e){return[jhe(),E0.of({...sat,...e})]}const PX=Qe.define({combine:e=>e.some(t=>t)});function jhe(e){return[lat]}const lat=ir.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(E0).map(t=>new jX(e,t)),this.fixed=!e.state.facet(PX);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(PX)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=xt.iter(this.view.state.facet(GR),this.view.viewport.from),o=[],r=this.gutters.map(i=>new uat(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let s=!0;for(let a of i.type)if(a.type==Hr.Text&&s){nF(n,o,a.from);for(let c of r)c.line(this.view,a,o);s=!1}else if(a.widget)for(let c of r)c.widget(this.view,a)}else if(i.type==Hr.Text){nF(n,o,i.from);for(let s of r)s.line(this.view,i,o)}else if(i.widget)for(let s of r)s.widget(this.view,i);for(let i of r)i.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(E0),n=e.state.facet(E0),o=e.docChanged||e.heightChanged||e.viewportChanged||!xt.eq(e.startState.facet(GR),e.state.facet(GR),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let i of n){let s=t.indexOf(i);s<0?r.push(new jX(this.view,i)):(this.gutters[s].update(e),r.push(this.gutters[s]))}for(let i of this.gutters)i.dom.remove(),r.indexOf(i)<0&&i.destroy();for(let i of r)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>He.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let o=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==pn.LTR?{left:o,right:r}:{right:o,left:r}})});function IX(e){return Array.isArray(e)?e:[e]}function nF(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class uat{constructor(t,n,o){this.gutter=t,this.height=o,this.i=0,this.cursor=xt.iter(t.markers,n.from)}addElement(t,n,o){let{gutter:r}=this,i=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==r.elements.length){let a=new Dhe(t,s,i,o);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(t,s,i,o);this.height=n.bottom,this.i++}line(t,n,o){let r=[];nF(this.cursor,r,n.from),o.length&&(r=r.concat(o));let i=this.gutter.config.lineMarker(t,n,r);i&&r.unshift(i);let s=this.gutter;r.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let o=this.gutter.config.widgetMarker(t,n.widget,n),r=o?[o]:null;for(let i of t.state.facet(iat)){let s=i(t,n.widget,n);s&&(r||(r=[])).push(s)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class jX{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let o in n.domEventHandlers)this.dom.addEventListener(o,r=>{let i=r.target,s;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let c=i.getBoundingClientRect();s=(c.top+c.bottom)/2}else s=r.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[o](t,a,r)&&r.preventDefault()});this.markers=IX(n.markers(t)),n.initialSpacer&&(this.spacer=new Dhe(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=IX(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let o=t.view.viewport;return!xt.eq(this.markers,n,o.from,o.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class Dhe{constructor(t,n,o,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,o,r)}update(t,n,o,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=o&&(this.dom.style.marginTop=(this.above=o)?o+"px":""),cat(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let o="cm-gutterElement",r=this.dom.firstChild;for(let i=0,s=0;;){let a=s,c=ii(a,c,p)||s(a,c,p):s}return o}})}});class p2 extends hp{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function m2(e,t){return e.state.facet(Gy).formatNumber(t,e.state)}const hat=E0.compute([Gy],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(dat)},lineMarker(t,n,o){return o.some(r=>r.toDOM)?null:new p2(m2(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,o)=>{for(let r of t.state.facet(fat)){let i=r(t,n,o);if(i)return i}return null},lineMarkerChange:t=>t.startState.facet(Gy)!=t.state.facet(Gy),initialSpacer(t){return new p2(m2(t,DX(t.state.doc.lines)))},updateSpacer(t,n){let o=m2(n.view,DX(n.view.state.doc.lines));return o==t.number?t:new p2(o)},domEventHandlers:e.facet(Gy).domEventHandlers,side:"before"}));function pat(e={}){return[Gy.of(e),jhe(),hat]}function DX(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(mat.range(r)))}return xt.of(t)});function bat(){return gat}var g2;const zy=new Nt;function yat(e){return Qe.define({combine:e?t=>t.concat(e):void 0})}const Aat=new Nt;class ys{constructor(t,n,o=[],r=""){this.data=t,this.name=r,Gt.prototype.hasOwnProperty("tree")||Object.defineProperty(Gt.prototype,"tree",{get(){return oo(this)}}),this.parser=n,this.extension=[Rm.of(this),Gt.languageData.of((i,s,a)=>{let c=NX(i,s,a),p=c.type.prop(zy);if(!p)return[];let u=i.facet(p),l=c.type.prop(Aat);if(l){let d=c.resolve(s-c.from,a);for(let f of l)if(f.test(d,i)){let h=i.facet(f.facet);return f.type=="replace"?h:h.concat(u)}}return u})].concat(o)}isActiveAt(t,n,o=-1){return NX(t,n,o).type.prop(zy)==this.data}findRegions(t){let n=t.facet(Rm);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let o=[],r=(i,s)=>{if(i.prop(zy)==this.data){o.push({from:s,to:s+i.length});return}let a=i.prop(Nt.mounted);if(a){if(a.tree.prop(zy)==this.data){if(a.overlay)for(let c of a.overlay)o.push({from:c.from+s,to:c.to+s});else o.push({from:s,to:s+i.length});return}else if(a.overlay){let c=o.length;if(r(a.tree,a.overlay[0].from+s),o.length>c)return}}for(let c=0;co.isTop?n:void 0)]}),t.name)}configure(t,n){return new uM(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function oo(e){let t=e.field(ys.state,!1);return t?t.tree:Hn.empty}class _at{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let o=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-o,n-o)}}let NS=null;class cM{constructor(t,n,o=[],r,i,s,a,c){this.parser=t,this.state=n,this.fragments=o,this.tree=r,this.treeLen=i,this.viewport=s,this.skipped=a,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,o){return new cM(t,n,[],Hn.empty,0,o,[],null)}startParse(){return this.parser.startParse(new _at(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Hn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var o;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Ug.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=NS;NS=this;try{return t()}finally{NS=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=LX(t,n.from,n.to);return t}changes(t,n){let{fragments:o,tree:r,treeLen:i,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((p,u,l,d)=>c.push({fromA:p,toA:u,fromB:l,toB:d})),o=Ug.applyChanges(o,c),r=Hn.empty,i=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let p of this.skipped){let u=t.mapPos(p.from,1),l=t.mapPos(p.to,-1);ut.from&&(this.fragments=LX(this.fragments,r,i),this.skipped.splice(o--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends ufe{createParse(n,o,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let c=NS;if(c){for(let p of r)c.tempSkipped.push(p);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=s,new Hn(qo.none,[],[],s-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return NS}}function LX(e,t,n){return Ug.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class TA{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),o=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,o)||n.takeTree(),new TA(n)}static init(t){let n=Math.min(3e3,t.doc.length),o=cM.create(t.facet(Rm).parser,t,{from:0,to:n});return o.work(20,n)||o.takeTree(),new TA(o)}}ys.state=Gr.define({create:TA.init,update(e,t){for(let n of t.effects)if(n.is(ys.setState))return n.value;return t.startState.facet(Rm)!=t.state.facet(Rm)?TA.init(t.state):e.apply(t)}});let Nhe=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Nhe=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const b2=typeof navigator<"u"&&(!((g2=navigator.scheduling)===null||g2===void 0)&&g2.isInputPending)?()=>navigator.scheduling.isInputPending():null,vat=ir.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ys.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ys.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=Nhe(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=i.context.work(()=>b2&&b2()||Date.now()>s,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:ys.setState.of(new TA(i.context))})),this.chunkBudget>0&&!(c&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Bo(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Rm=Qe.define({combine(e){return e.length?e[0]:null},enables:e=>[ys.state,vat,He.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Sat{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const Cat=Qe.define(),tU=Qe.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function dM(e){let t=e.facet(tU);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function bC(e,t){let n="",o=e.tabSize,r=e.facet(tU)[0];if(r==" "){for(;t>=o;)n+=" ",t-=o;r=" "}for(let i=0;i=t?wat(e,n,t):null}class KP{constructor(t,n={}){this.state=t,this.options=n,this.unit=dM(t)}lineAt(t,n=1){let o=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=o.from&&r<=o.to?i&&r==t?{text:"",from:t}:(n<0?r-1&&(i+=s-this.countColumn(o,o.search(/\S|$/))),i}countColumn(t,n=t.length){return t_(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:o,from:r}=this.lineAt(t,n),i=this.options.overrideIndentation;if(i){let s=i(r);if(s>-1)return s}return this.countColumn(o,o.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Lhe=new Nt;function wat(e,t,n){let o=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=o.node){let i=[];for(let s=r;s&&!(s.fromo.node.to||s.from==o.node.from&&s.type==o.node.type);s=s.parent)i.push(s);for(let s=i.length-1;s>=0;s--)o={node:i[s],next:o}}return Fhe(o,e,n)}function Fhe(e,t,n){for(let o=e;o;o=o.next){let r=Tat(o.node);if(r)return r(rU.create(t,n,o))}return 0}function Oat(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Tat(e){let t=e.type.prop(Lhe);if(t)return t;let n=e.firstChild,o;if(n&&(o=n.type.prop(Nt.closedBy))){let r=e.lastChild,i=r&&o.indexOf(r.name)>-1;return s=>Pat(s,!0,1,void 0,i&&!Oat(s)?r.from:void 0)}return e.parent==null?Rat:null}function Rat(){return 0}class rU extends KP{constructor(t,n,o){super(t.state,t.options),this.base=t,this.pos=n,this.context=o}get node(){return this.context.node}static create(t,n,o){return new rU(t,n,o)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let o=t.resolve(n.from);for(;o.parent&&o.parent.from==o.from;)o=o.parent;if(Eat(o,t))break;n=this.state.doc.lineAt(o.from)}return this.lineIndent(n.from)}continue(){return Fhe(this.context.next,this.base,this.pos)}}function Eat(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Mat(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),s=r==null||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let c=t.childAfter(a);if(!c||c==o)return null;if(!c.type.isSkipped){if(c.from>=s)return null;let p=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+p}}a=c.to}}function Pat(e,t,n,o,r){let i=e.textAfter,s=i.match(/^\s*/)[0].length,a=o&&i.slice(s,s+o.length)==o||r==e.pos+s,c=Mat(e);return c?a?e.column(c.from):e.column(c.to):e.baseIndent+(a?0:e.unit*n)}function FX({except:e,units:t=1}={}){return n=>{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const Iat=200;function jat(){return Gt.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+Iat)return e;let i=n.sliceString(r.from,o);if(!t.some(p=>p.test(i)))return e;let{state:s}=e,a=-1,c=[];for(let{head:p}of s.selection.ranges){let u=s.doc.lineAt(p);if(u.from==a)continue;a=u.from;let l=nU(s,u.from);if(l==null)continue;let d=/^\s*/.exec(u.text)[0],f=bC(s,l);d!=f&&c.push({from:u.from,to:u.from+d.length,insert:f})}return c.length?[e,{changes:c,sequential:!0}]:e})}const Dat=Qe.define(),xhe=new Nt;function Nat(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(i&&a.from=t&&p.to>n&&(i=p)}}return i}function Fat(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function fM(e,t,n){for(let o of e.facet(Dat)){let r=o(e,t,n);if(r)return r}return Lat(e,t,n)}function Bhe(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const QP=Et.define({map:Bhe}),cw=Et.define({map:Bhe});function khe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(o=>o.from<=n&&o.to>=n)||t.push(e.lineBlockAt(n));return t}const $g=Gr.define({create(){return mt.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,o)=>e=xX(e,n,o)),e=e.map(t.changes);for(let n of t.effects)if(n.is(QP)&&!xat(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Jhe),r=o?mt.replace({widget:new Hat(o(t.state,n.value))}):BX;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(cw)&&(e=e.update({filter:(o,r)=>n.value.from!=o||n.value.to!=r,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=xX(e,t.selection.main.head)),e},provide:e=>He.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(o,r)=>{n.push(o,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(o=!0)}),o?e.update({filterFrom:t,filterTo:n,filter:(r,i)=>r>=n||i<=t}):e}function hM(e,t,n){var o;let r=null;return(o=e.field($g,!1))===null||o===void 0||o.between(t,n,(i,s)=>{(!r||r.from>i)&&(r={from:i,to:s})}),r}function xat(e,t,n){let o=!1;return e.between(t,t,(r,i)=>{r==t&&i==n&&(o=!0)}),o}function Uhe(e,t){return e.field($g,!1)?t:t.concat(Et.appendConfig.of(Vhe()))}const Bat=e=>{for(let t of khe(e)){let n=fM(e.state,t.from,t.to);if(n)return e.dispatch({effects:Uhe(e.state,[QP.of(n),qhe(e,n)])}),!0}return!1},kat=e=>{if(!e.state.field($g,!1))return!1;let t=[];for(let n of khe(e)){let o=hM(e.state,n.from,n.to);o&&t.push(cw.of(o),qhe(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function qhe(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return He.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const Uat=e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field($g,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(o,r)=>{n.push(cw.of({from:o,to:r}))}),e.dispatch({effects:n}),!0},Jat=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Bat},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:kat},{key:"Ctrl-Alt-[",run:Uat},{key:"Ctrl-Alt-]",run:qat}],Vat={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jhe=Qe.define({combine(e){return Hl(e,Vat)}});function Vhe(e){return[$g,Kat]}function Hhe(e,t){let{state:n}=e,o=n.facet(Jhe),r=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),c=hM(e.state,a.from,a.to);c&&e.dispatch({effects:cw.of(c)}),s.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const BX=mt.replace({widget:new class extends _p{toDOM(e){return Hhe(e,null)}}});class Hat extends _p{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Hhe(t,this.value)}}const Gat={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class y2 extends hp{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function zat(e={}){let t={...Gat,...e},n=new y2(t,!0),o=new y2(t,!1),r=ir.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Rm)!=s.state.facet(Rm)||s.startState.field($g,!1)!=s.state.field($g,!1)||oo(s.startState)!=oo(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new dp;for(let c of s.viewportLineBlocks){let p=hM(s.state,c.from,c.to)?o:fM(s.state,c.from,c.to)?n:null;p&&a.add(c.from,c.from,p)}return a.finish()}}),{domEventHandlers:i}=t;return[r,aat({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(r))===null||a===void 0?void 0:a.markers)||xt.empty},initialSpacer(){return new y2(t,!1)},domEventHandlers:{...i,click:(s,a,c)=>{if(i.click&&i.click(s,a,c))return!0;let p=hM(s.state,a.from,a.to);if(p)return s.dispatch({effects:cw.of(p)}),!0;let u=fM(s.state,a.from,a.to);return u?(s.dispatch({effects:QP.of(u)}),!0):!1}}}),Vhe()]}const Kat=He.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class $P{constructor(t,n){this.specs=t;let o;function r(a){let c=wm.newName();return(o||(o=Object.create(null)))["."+c]=a,c}const i=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,s=n.scope;this.scope=s instanceof ys?a=>a.prop(zy)==s.data:s?a=>a==s:void 0,this.style=ffe(t.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=o?new wm(o):null,this.themeType=n.themeType}static define(t,n){return new $P(t,n||{})}}const rF=Qe.define(),Ghe=Qe.define({combine(e){return e.length?[e[0]]:null}});function A2(e){let t=e.facet(rF);return t.length?t:e.facet(Ghe)}function Qat(e,t){let n=[Wat],o;return e instanceof $P&&(e.module&&n.push(He.styleModule.of(e.module)),o=e.themeType),t?.fallback?n.push(Ghe.of(e)):o?n.push(rF.computeN([He.darkTheme],r=>r.facet(He.darkTheme)==(o=="dark")?[e]:[])):n.push(rF.of(e)),n}class $at{constructor(t){this.markCache=Object.create(null),this.tree=oo(t.state),this.decorations=this.buildDeco(t,A2(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=oo(t.state),o=A2(t.state),r=o!=A2(t.startState),{viewport:i}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length=i.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,o),this.decoratedTo=i.to)}buildDeco(t,n){if(!n||!this.tree.length)return mt.none;let o=new dp;for(let{from:r,to:i}of t.visibleRanges)sot(this.tree,n,(s,a,c)=>{o.add(s,a,this.markCache[c]||(this.markCache[c]=mt.mark({class:c})))},r,i);return o.finish()}}const Wat=gb.high(ir.fromClass($at,{decorations:e=>e.decorations})),Yat=$P.define([{tag:Fe.meta,color:"#404740"},{tag:Fe.link,textDecoration:"underline"},{tag:Fe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Fe.emphasis,fontStyle:"italic"},{tag:Fe.strong,fontWeight:"bold"},{tag:Fe.strikethrough,textDecoration:"line-through"},{tag:Fe.keyword,color:"#708"},{tag:[Fe.atom,Fe.bool,Fe.url,Fe.contentSeparator,Fe.labelName],color:"#219"},{tag:[Fe.literal,Fe.inserted],color:"#164"},{tag:[Fe.string,Fe.deleted],color:"#a11"},{tag:[Fe.regexp,Fe.escape,Fe.special(Fe.string)],color:"#e40"},{tag:Fe.definition(Fe.variableName),color:"#00f"},{tag:Fe.local(Fe.variableName),color:"#30a"},{tag:[Fe.typeName,Fe.namespace],color:"#085"},{tag:Fe.className,color:"#167"},{tag:[Fe.special(Fe.variableName),Fe.macroName],color:"#256"},{tag:Fe.definition(Fe.propertyName),color:"#00c"},{tag:Fe.comment,color:"#940"},{tag:Fe.invalid,color:"#f00"}]),Xat=He.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),zhe=1e4,Khe="()[]{}",Qhe=Qe.define({combine(e){return Hl(e,{afterCursor:!0,brackets:Khe,maxScanDistance:zhe,renderMatch:tlt})}}),Zat=mt.mark({class:"cm-matchingBracket"}),elt=mt.mark({class:"cm-nonmatchingBracket"});function tlt(e){let t=[],n=e.matched?Zat:elt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const nlt=Gr.define({create(){return mt.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(Qhe);for(let r of t.state.selection.ranges){if(!r.empty)continue;let i=Rl(t.state,r.head,-1,o)||r.head>0&&Rl(t.state,r.head-1,1,o)||o.afterCursor&&(Rl(t.state,r.head,1,o)||r.headHe.decorations.from(e)}),rlt=[nlt,Xat];function olt(e={}){return[Qhe.of(e),rlt]}const ilt=new Nt;function oF(e,t,n){let o=e.prop(t<0?Nt.openedBy:Nt.closedBy);if(o)return o;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function iF(e){let t=e.type.prop(ilt);return t?t(e.node):e}function Rl(e,t,n,o={}){let r=o.maxScanDistance||zhe,i=o.brackets||Khe,s=oo(e),a=s.resolveInner(t,n);for(let c=a;c;c=c.parent){let p=oF(c.type,n,i);if(p&&c.from0?t>=u.from&&tu.from&&t<=u.to))return slt(e,t,n,c,u,p,i)}}return alt(e,t,n,s,a.type,r,i)}function slt(e,t,n,o,r,i,s){let a=o.parent,c={from:r.from,to:r.to},p=0,u=a?.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do if(n<0?u.to<=o.from:u.from>=o.to){if(p==0&&i.indexOf(u.type.name)>-1&&u.from0)return null;let p={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),l=0;for(let d=0;!u.next().done&&d<=i;){let f=u.value;n<0&&(d+=f.length);let h=t+d*n;for(let m=n>0?0:f.length-1,g=n>0?f.length:-1;m!=g;m+=n){let y=s.indexOf(f[m]);if(!(y<0||o.resolveInner(h+m,1).type!=r))if(y%2==0==n>0)l++;else{if(l==1)return{start:p,end:{from:h+m,to:h+m+1},matched:y>>1==c>>1};l--}}n>0&&(d+=f.length)}return u.done?{start:p,matched:!1}:null}const llt=Object.create(null),kX=[qo.none],UX=[],qX=Object.create(null),ult=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ult[e]=clt(llt,t);function _2(e,t){UX.indexOf(e)>-1||(UX.push(e),console.warn(t))}function clt(e,t){let n=[];for(let a of t.split(" ")){let c=[];for(let p of a.split(".")){let u=e[p]||Fe[p];u?typeof u=="function"?c.length?c=c.map(u):_2(p,`Modifier ${p} used at start of tag`):c.length?_2(p,`Tag ${p} used as modifier`):c=Array.isArray(u)?u:[u]:_2(p,`Unknown highlighting tag ${p}`)}for(let p of c)n.push(p)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map(a=>a.id),i=qX[r];if(i)return i.id;let s=qX[r]=qo.define({id:kX.length,name:o,props:[cfe({[o]:n})]});return kX.push(s),s.id}pn.RTL,pn.LTR;const dlt=uM.define({name:"json",parser:cot.configure({props:[Lhe.add({Object:FX({except:/^\s*\}/}),Array:FX({except:/^\s*\]/})}),xhe.add({"Object Array":Nat})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function flt(){return new Sat(dlt)}const hlt=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=iU(e.state,n.from);return o.line?plt(e):o.block?glt(e):!1};function oU(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(o(n.update(r)),!0):!1}}const plt=oU(Alt,0),mlt=oU($he,0),glt=oU((e,t)=>$he(e,t,ylt(t)),0);function iU(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const LS=50;function blt(e,{open:t,close:n},o,r){let i=e.sliceDoc(o-LS,o),s=e.sliceDoc(r,r+LS),a=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(s)[0].length,p=i.length-a;if(i.slice(p-t.length,p)==t&&s.slice(c,c+n.length)==n)return{open:{pos:o-a,margin:a&&1},close:{pos:r+c,margin:c&&1}};let u,l;r-o<=2*LS?u=l=e.sliceDoc(o,r):(u=e.sliceDoc(o,o+LS),l=e.sliceDoc(r-LS,r));let d=/^\s*/.exec(u)[0].length,f=/\s*$/.exec(l)[0].length,h=l.length-f-n.length;return u.slice(d,d+t.length)==t&&l.slice(h,h+n.length)==n?{open:{pos:o+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:r-f-n.length,margin:/\s/.test(l.charAt(h-1))?1:0}}:null}function ylt(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to);r.from>o.from&&r.from==n.to&&(r=n.to==o.to+1?o:e.doc.lineAt(n.to-1));let i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}function $he(e,t,n=t.selection.ranges){let o=n.map(i=>iU(t,i.from).block);if(!o.every(i=>i))return null;let r=n.map((i,s)=>blt(t,o[s],i.from,i.to));if(e!=2&&!r.every(i=>i))return{changes:t.changes(n.map((i,s)=>r[s]?[]:[{from:i.from,insert:o[s].open+" "},{from:i.to,insert:" "+o[s].close}]))};if(e!=1&&r.some(i=>i)){let i=[];for(let s=0,a;sr&&(i==s||s>l.from)){r=l.from;let d=/^\s*/.exec(l.text)[0].length,f=d==l.length,h=l.text.slice(d,d+p.length)==p?d:-1;di.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:c,indent:p,empty:u,single:l}of o)(l||!u)&&i.push({from:a.from+p,insert:c+" "});let s=t.changes(i);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&o.some(i=>i.comment>=0)){let i=[];for(let{line:s,comment:a,token:c}of o)if(a>=0){let p=s.from+a,u=p+c.length;s.text[u-s.from]==" "&&u++,i.push({from:p,to:u})}return{changes:i}}return null}const sF=Ap.define(),_lt=Ap.define(),vlt=Qe.define(),Whe=Qe.define({combine(e){return Hl(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(o,r)=>t(o,r)||n(o,r)})}}),Yhe=Gr.define({create(){return El.empty},update(e,t){let n=t.state.facet(Whe),o=t.annotation(sF);if(o){let c=ko.fromTransaction(t,o.selection),p=o.side,u=p==0?e.undone:e.done;return c?u=pM(u,u.length,n.minDepth,c):u=epe(u,t.startState.selection),new El(p==0?o.rest:u,p==0?u:o.rest)}let r=t.annotation(_lt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(yr.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let i=ko.fromTransaction(t),s=t.annotation(yr.time),a=t.annotation(yr.userEvent);return i?e=e.addChanges(i,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new El(e.done.map(ko.fromJSON),e.undone.map(ko.fromJSON))}});function Slt(e={}){return[Yhe,Whe.of(e),He.domEventHandlers({beforeinput(t,n){let o=t.inputType=="historyUndo"?Xhe:t.inputType=="historyRedo"?aF:null;return o?(t.preventDefault(),o(n)):!1}})]}function WP(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(Yhe,!1);if(!r)return!1;let i=r.pop(e,n,t);return i?(o(i),!0):!1}}const Xhe=WP(0,!1),aF=WP(1,!1),Clt=WP(0,!0),wlt=WP(1,!0);class ko{constructor(t,n,o,r,i){this.changes=t,this.effects=n,this.mapped=o,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new ko(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,o;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(o=this.startSelection)===null||o===void 0?void 0:o.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new ko(t.changes&&gr.fromJSON(t.changes),[],t.mapped&&Dl.fromJSON(t.mapped),t.startSelection&&Oe.fromJSON(t.startSelection),t.selectionsAfter.map(Oe.fromJSON))}static fromTransaction(t,n){let o=Vi;for(let r of t.startState.facet(vlt)){let i=r(t);i.length&&(o=o.concat(i))}return!o.length&&t.changes.empty?null:new ko(t.changes.invert(t.startState.doc),o,void 0,n||t.startState.selection,Vi)}static selection(t){return new ko(void 0,Vi,void 0,void 0,t)}}function pM(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Olt(e,t){let n=[],o=!1;return e.iterChangedRanges((r,i)=>n.push(r,i)),t.iterChangedRanges((r,i,s,a)=>{for(let c=0;c=p&&s<=u&&(o=!0)}}),o}function Tlt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,o)=>n.empty!=t.ranges[o].empty).length===0}function Zhe(e,t){return e.length?t.length?e.concat(t):e:t}const Vi=[],Rlt=200;function epe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Rlt));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),pM(e,e.length-1,1e9,n.setSelAfter(o)))}else return[ko.selection([t])]}function Elt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function v2(e,t){if(!e.length)return e;let n=e.length,o=Vi;for(;n;){let r=Mlt(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let i=e.slice(0,n);return i[n-1]=r,i}else t=r.mapped,n--,o=r.selectionsAfter}return o.length?[ko.selection(o)]:Vi}function Mlt(e,t,n){let o=Zhe(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Vi,n);if(!e.changes)return ko.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(i):i;return new ko(r,Et.mapEffects(e.effects,t),s,e.startSelection.map(i),o)}const Plt=/^(input\.type|delete)($|\.)/;class El{constructor(t,n,o=0,r=void 0){this.done=t,this.undone=n,this.prevTime=o,this.prevUserEvent=r}isolate(){return this.prevTime?new El(this.done,this.undone):this}addChanges(t,n,o,r,i){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!o||Plt.test(o))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):YP(n,t))}function so(e){return e.textDirectionAt(e.state.selection.main.head)==pn.LTR}const npe=e=>tpe(e,!so(e)),rpe=e=>tpe(e,so(e));function ope(e,t){return Ls(e,n=>n.empty?e.moveByGroup(n,t):YP(n,t))}const jlt=e=>ope(e,!so(e)),Dlt=e=>ope(e,so(e));function Nlt(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function XP(e,t,n){let o=oo(e).resolveInner(t.head),r=n?Nt.closedBy:Nt.openedBy;for(let c=t.head;;){let p=n?o.childAfter(c):o.childBefore(c);if(!p)break;Nlt(e,p,r)?o=p:c=n?p.to:p.from}let i=o.type.prop(r),s,a;return i&&(s=n?Rl(e,o.from,1):Rl(e,o.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?o.to:o.from,Oe.cursor(a,n?-1:1)}const Llt=e=>Ls(e,t=>XP(e.state,t,!so(e))),Flt=e=>Ls(e,t=>XP(e.state,t,so(e)));function ipe(e,t){return Ls(e,n=>{if(!n.empty)return YP(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)})}const spe=e=>ipe(e,!1),ape=e=>ipe(e,!0);function lpe(e){let t=e.scrollDOM.clientHeights.empty?e.moveVertically(s,t,n.height):YP(s,t));if(r.eq(o.selection))return!1;let i;if(n.selfScroll){let s=e.coordsAtPos(o.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),c=a.top+n.marginTop,p=a.bottom-n.marginBottom;s&&s.top>c&&s.bottomupe(e,!1),lF=e=>upe(e,!0);function xm(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let i=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;i&&t.head!=o.from+i&&(r=Oe.cursor(o.from+i))}return r}const xlt=e=>Ls(e,t=>xm(e,t,!0)),Blt=e=>Ls(e,t=>xm(e,t,!1)),klt=e=>Ls(e,t=>xm(e,t,!so(e))),Ult=e=>Ls(e,t=>xm(e,t,so(e))),qlt=e=>Ls(e,t=>Oe.cursor(e.lineBlockAt(t.head).from,1)),Jlt=e=>Ls(e,t=>Oe.cursor(e.lineBlockAt(t.head).to,-1));function Vlt(e,t,n){let o=!1,r=n_(e.selection,i=>{let s=Rl(e,i.head,-1)||Rl(e,i.head,1)||i.head>0&&Rl(e,i.head-1,1)||i.headVlt(e,t);function Xi(e,t){let n=n_(e.state.selection,o=>{let r=t(o);return Oe.range(o.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Ns(e.state,n)),!0)}function cpe(e,t){return Xi(e,n=>e.moveByChar(n,t))}const dpe=e=>cpe(e,!so(e)),fpe=e=>cpe(e,so(e));function hpe(e,t){return Xi(e,n=>e.moveByGroup(n,t))}const Glt=e=>hpe(e,!so(e)),zlt=e=>hpe(e,so(e)),Klt=e=>Xi(e,t=>XP(e.state,t,!so(e))),Qlt=e=>Xi(e,t=>XP(e.state,t,so(e)));function ppe(e,t){return Xi(e,n=>e.moveVertically(n,t))}const mpe=e=>ppe(e,!1),gpe=e=>ppe(e,!0);function bpe(e,t){return Xi(e,n=>e.moveVertically(n,t,lpe(e).height))}const VX=e=>bpe(e,!1),HX=e=>bpe(e,!0),$lt=e=>Xi(e,t=>xm(e,t,!0)),Wlt=e=>Xi(e,t=>xm(e,t,!1)),Ylt=e=>Xi(e,t=>xm(e,t,!so(e))),Xlt=e=>Xi(e,t=>xm(e,t,so(e))),Zlt=e=>Xi(e,t=>Oe.cursor(e.lineBlockAt(t.head).from)),eut=e=>Xi(e,t=>Oe.cursor(e.lineBlockAt(t.head).to)),GX=({state:e,dispatch:t})=>(t(Ns(e,{anchor:0})),!0),zX=({state:e,dispatch:t})=>(t(Ns(e,{anchor:e.doc.length})),!0),KX=({state:e,dispatch:t})=>(t(Ns(e,{anchor:e.selection.main.anchor,head:0})),!0),QX=({state:e,dispatch:t})=>(t(Ns(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),tut=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),nut=({state:e,dispatch:t})=>{let n=ZP(e).map(({from:o,to:r})=>Oe.range(o,Math.min(r+1,e.doc.length)));return t(e.update({selection:Oe.create(n),userEvent:"select"})),!0},rut=({state:e,dispatch:t})=>{let n=n_(e.selection,o=>{let r=oo(e),i=r.resolveStack(o.from,1);if(o.empty){let s=r.resolveStack(o.from,-1);s.node.from>=i.node.from&&s.node.to<=i.node.to&&(i=s)}for(let s=i;s;s=s.next){let{node:a}=s;if((a.from=o.to||a.to>o.to&&a.from<=o.from)&&s.next)return Oe.range(a.to,a.from)}return o});return n.eq(e.selection)?!1:(t(Ns(e,n)),!0)};function ype(e,t){let{state:n}=e,o=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head);if(t?s.to0)for(let a=i;;){let c=e.moveVertically(a,t);if(c.heads.to){r.some(p=>p.head==c.head)||r.push(c);break}else{if(c.head==a.head)break;a=c}}}return r.length==o.ranges.length?!1:(e.dispatch(Ns(n,Oe.create(r,r.length-1))),!0)}const out=e=>ype(e,!1),iut=e=>ype(e,!0),sut=({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=Oe.create([n.main]):n.main.empty||(o=Oe.create([Oe.cursor(n.main.head)])),o?(t(Ns(e,o)),!0):!1};function dw(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange(i=>{let{from:s,to:a}=i;if(s==a){let c=t(i);cs&&(n="delete.forward",c=nR(e,c,!0)),s=Math.min(s,c),a=Math.max(a,c)}else s=nR(e,s,!1),a=nR(e,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:Oe.cursor(s,sr(e)))o.between(t,t,(r,i)=>{rt&&(t=n?i:r)});return t}const Ape=(e,t,n)=>dw(e,o=>{let r=o.from,{state:i}=e,s=i.doc.lineAt(r),a,c;if(n&&!t&&r>s.from&&rApe(e,!1,!0),_pe=e=>Ape(e,!0,!1),vpe=(e,t)=>dw(e,n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),s=r.charCategorizer(o);for(let a=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let c=br(i.text,o-i.from,t)+i.from,p=i.text.slice(Math.min(o,c)-i.from,Math.max(o,c)-i.from),u=s(p);if(a!=null&&u!=a)break;(p!=" "||o!=n.head)&&(a=u),o=c}return o}),Spe=e=>vpe(e,!1),aut=e=>vpe(e,!0),lut=e=>dw(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headdw(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),cut=e=>dw(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(o=>({changes:{from:o.from,to:o.to,insert:Qt.of(["",""])},range:Oe.cursor(o.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},fut=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(o=>{if(!o.empty||o.from==0||o.from==e.doc.length)return{range:o};let r=o.from,i=e.doc.lineAt(r),s=r==i.from?r-1:br(i.text,r-i.from,!1)+i.from,a=r==i.to?r+1:br(i.text,r-i.from,!0)+i.from;return{changes:{from:s,to:a,insert:e.doc.slice(r,a).append(e.doc.slice(s,r))},range:Oe.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ZP(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(!o.empty&&o.to==i.from&&(i=e.doc.lineAt(o.to-1)),n>=r.number){let s=t[t.length-1];s.to=i.to,s.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Cpe(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of ZP(e)){if(n?i.to==e.doc.length:i.from==0)continue;let s=e.doc.lineAt(n?i.to+1:i.from-1),a=s.length+1;if(n){o.push({from:i.to,to:s.to},{from:i.from,insert:s.text+e.lineBreak});for(let c of i.ranges)r.push(Oe.range(Math.min(e.doc.length,c.anchor+a),Math.min(e.doc.length,c.head+a)))}else{o.push({from:s.from,to:i.from},{from:i.to,insert:e.lineBreak+s.text});for(let c of i.ranges)r.push(Oe.range(c.anchor-a,c.head-a))}}return o.length?(t(e.update({changes:o,scrollIntoView:!0,selection:Oe.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hut=({state:e,dispatch:t})=>Cpe(e,t,!1),put=({state:e,dispatch:t})=>Cpe(e,t,!0);function wpe(e,t,n){if(e.readOnly)return!1;let o=[];for(let i of ZP(e))n?o.push({from:i.from,insert:e.doc.slice(i.from,i.to)+e.lineBreak}):o.push({from:i.to,insert:e.lineBreak+e.doc.slice(i.from,i.to)});let r=e.changes(o);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const mut=({state:e,dispatch:t})=>wpe(e,t,!1),gut=({state:e,dispatch:t})=>wpe(e,t,!0),but=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ZP(t).map(({from:r,to:i})=>(r>0?r--:i{let i;if(e.lineWrapping){let s=e.lineBlockAt(r.head),a=e.coordsAtPos(r.head,r.assoc||1);a&&(i=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,i)}).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0};function yut(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=oo(e).resolveInner(t),o=n.childBefore(t),r=n.childAfter(t),i;return o&&r&&o.to<=t&&r.from>=t&&(i=o.type.prop(Nt.closedBy))&&i.indexOf(r.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(o.to,r.from))?{from:o.to,to:r.from}:null}const $X=Ope(!1),Aut=Ope(!0);function Ope(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange(r=>{let{from:i,to:s}=r,a=t.doc.lineAt(i),c=!e&&i==s&&yut(t,i);e&&(i=s=(s<=a.to?a:t.doc.lineAt(s)).to);let p=new KP(t,{simulateBreak:i,simulateDoubleBreak:!!c}),u=nU(p,i);for(u==null&&(u=t_(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));sa.from&&i{let r=[];for(let s=o.from;s<=o.to;){let a=e.doc.lineAt(s);a.number>n&&(o.empty||o.to>a.from)&&(t(a,r,o),n=a.number),s=a.to+1}let i=e.changes(r);return{changes:r,range:Oe.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}})}const _ut=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new KP(e,{overrideIndentation:i=>{let s=n[i];return s??-1}}),r=sU(e,(i,s,a)=>{let c=nU(o,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let p=/^\s*/.exec(i.text)[0],u=bC(e,c);(p!=u||a.frome.readOnly?!1:(t(e.update(sU(e,(n,o)=>{o.push({from:n.from,insert:e.facet(tU)})}),{userEvent:"input.indent"})),!0),Sut=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(sU(e,(n,o)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let i=t_(r,e.tabSize),s=0,a=bC(e,Math.max(0,i-dM(e)));for(;s(e.setTabFocusMode(),!0),wut=[{key:"Ctrl-b",run:npe,shift:dpe,preventDefault:!0},{key:"Ctrl-f",run:rpe,shift:fpe},{key:"Ctrl-p",run:spe,shift:mpe},{key:"Ctrl-n",run:ape,shift:gpe},{key:"Ctrl-a",run:qlt,shift:Zlt},{key:"Ctrl-e",run:Jlt,shift:eut},{key:"Ctrl-d",run:_pe},{key:"Ctrl-h",run:uF},{key:"Ctrl-k",run:lut},{key:"Ctrl-Alt-h",run:Spe},{key:"Ctrl-o",run:dut},{key:"Ctrl-t",run:fut},{key:"Ctrl-v",run:lF}],Out=[{key:"ArrowLeft",run:npe,shift:dpe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:jlt,shift:Glt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:klt,shift:Ylt,preventDefault:!0},{key:"ArrowRight",run:rpe,shift:fpe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Dlt,shift:zlt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Ult,shift:Xlt,preventDefault:!0},{key:"ArrowUp",run:spe,shift:mpe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GX,shift:KX},{mac:"Ctrl-ArrowUp",run:JX,shift:VX},{key:"ArrowDown",run:ape,shift:gpe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:zX,shift:QX},{mac:"Ctrl-ArrowDown",run:lF,shift:HX},{key:"PageUp",run:JX,shift:VX},{key:"PageDown",run:lF,shift:HX},{key:"Home",run:Blt,shift:Wlt,preventDefault:!0},{key:"Mod-Home",run:GX,shift:KX},{key:"End",run:xlt,shift:$lt,preventDefault:!0},{key:"Mod-End",run:zX,shift:QX},{key:"Enter",run:$X,shift:$X},{key:"Mod-a",run:tut},{key:"Backspace",run:uF,shift:uF,preventDefault:!0},{key:"Delete",run:_pe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Spe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:aut,preventDefault:!0},{mac:"Mod-Backspace",run:uut,preventDefault:!0},{mac:"Mod-Delete",run:cut,preventDefault:!0}].concat(wut.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Tut=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Llt,shift:Klt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Flt,shift:Qlt},{key:"Alt-ArrowUp",run:hut},{key:"Shift-Alt-ArrowUp",run:mut},{key:"Alt-ArrowDown",run:put},{key:"Shift-Alt-ArrowDown",run:gut},{key:"Mod-Alt-ArrowUp",run:out},{key:"Mod-Alt-ArrowDown",run:iut},{key:"Escape",run:sut},{key:"Mod-Enter",run:Aut},{key:"Alt-l",mac:"Ctrl-l",run:nut},{key:"Mod-i",run:rut,preventDefault:!0},{key:"Mod-[",run:Sut},{key:"Mod-]",run:vut},{key:"Mod-Alt-\\",run:_ut},{key:"Shift-Mod-k",run:but},{key:"Shift-Mod-\\",run:Hlt},{key:"Mod-/",run:hlt},{key:"Alt-A",run:mlt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Cut}].concat(Out),WX=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class RA{constructor(t,n,o=0,r=t.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(o,r),this.bufferStart=o,this.normalize=i?a=>i(WX(a)):WX,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Lo(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Fk(t),o=this.bufferStart+this.bufferPos;this.bufferPos+=Sl(t);let r=this.normalize(n);if(r.length)for(let i=0,s=o;;i++){let a=r.charCodeAt(i),c=this.match(a,s,this.bufferPos+this.bufferStart);if(i==r.length-1){if(c)return this.value=c,this;break}s==o&&ithis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let o=this.curLineStart+n.index,r=o+n[0].length;if(this.matchPos=mM(this.text,r+(o==r?1:0)),o==this.curLineStart+this.curLine.length&&this.nextLine(),(othis.value.to)&&(!this.test||this.test(o,r,n)))return this.value={from:o,to:r,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=o||r.to<=n){let a=new lA(n,t.sliceString(n,o));return S2.set(t,a),a}if(r.from==n&&r.to==o)return r;let{text:i,from:s}=r;return s>n&&(i=t.sliceString(n,s)+i,s=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let o=this.flat.from+n.index,r=o+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(o,r,n)))return this.value={from:o,to:r,match:n},this.matchPos=mM(this.text,r+(o==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=lA.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Rpe.prototype[Symbol.iterator]=Epe.prototype[Symbol.iterator]=function(){return this});function Rut(e){try{return new RegExp(e,aU),!0}catch{return!1}}function mM(e,t){if(t>=e.length)return t;let n=e.lineAt(t),o;for(;t=56320&&o<57344;)t++;return t}function cF(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=fn("input",{class:"cm-textfield",name:"line",value:t}),o=fn("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),e.dispatch({effects:M0.of(!1)}),e.focus()):i.keyCode==13&&(i.preventDefault(),r())},onsubmit:i=>{i.preventDefault(),r()}},fn("label",e.state.phrase("Go to line"),": ",n)," ",fn("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),fn("button",{name:"close",onclick:()=>{e.dispatch({effects:M0.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function r(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:s}=e,a=s.doc.lineAt(s.selection.main.head),[,c,p,u,l]=i,d=u?+u.slice(1):0,f=p?+p:a.number;if(p&&l){let g=f/100;c&&(g=g*(c=="-"?-1:1)+a.number/s.doc.lines),f=Math.round(s.doc.lines*g)}else p&&c&&(f=f*(c=="-"?-1:1)+a.number);let h=s.doc.line(Math.max(1,Math.min(s.doc.lines,f))),m=Oe.cursor(h.from+Math.max(0,Math.min(d,h.length)));e.dispatch({effects:[M0.of(!1),He.scrollIntoView(m.from,{y:"center"})],selection:m}),e.focus()}return{dom:o}}const M0=Et.define(),YX=Gr.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(M0)&&(e=n.value);return e},provide:e=>gC.from(e,t=>t?cF:null)}),Eut=e=>{let t=mC(e,cF);if(!t){let n=[M0.of(!0)];e.state.field(YX,!1)==null&&n.push(Et.appendConfig.of([YX,Mut])),e.dispatch({effects:n}),t=mC(e,cF)}return t&&t.dom.querySelector("input").select(),!0},Mut=He.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Put={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Iut=Qe.define({combine(e){return Hl(e,Put,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function jut(e){return[xut,Fut]}const Dut=mt.mark({class:"cm-selectionMatch"}),Nut=mt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function XX(e,t,n,o){return(n==0||e(t.sliceDoc(n-1,n))!=En.Word)&&(o==t.doc.length||e(t.sliceDoc(o,o+1))!=En.Word)}function Lut(e,t,n,o){return e(t.sliceDoc(n,n+1))==En.Word&&e(t.sliceDoc(o-1,o))==En.Word}const Fut=ir.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Iut),{state:n}=e,o=n.selection;if(o.ranges.length>1)return mt.none;let r=o.main,i,s=null;if(r.empty){if(!t.highlightWordAroundCursor)return mt.none;let c=n.wordAt(r.head);if(!c)return mt.none;s=n.charCategorizer(r.head),i=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return mt.none;if(t.wholeWords){if(i=n.sliceDoc(r.from,r.to),s=n.charCategorizer(r.head),!(XX(s,n,r.from,r.to)&&Lut(s,n,r.from,r.to)))return mt.none}else if(i=n.sliceDoc(r.from,r.to),!i)return mt.none}let a=[];for(let c of e.visibleRanges){let p=new RA(n.doc,i,c.from,c.to);for(;!p.next().done;){let{from:u,to:l}=p.value;if((!s||XX(s,n,u,l))&&(r.empty&&u<=r.from&&l>=r.to?a.push(Nut.range(u,l)):(u>=r.to||l<=r.from)&&a.push(Dut.range(u,l)),a.length>t.maxMatches))return mt.none}}return mt.set(a)}},{decorations:e=>e.decorations}),xut=He.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),But=({state:e,dispatch:t})=>{let{selection:n}=e,o=Oe.create(n.ranges.map(r=>e.wordAt(r.head)||Oe.cursor(r.head)),n.mainIndex);return o.eq(n)?!1:(t(e.update({selection:o})),!0)};function kut(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let s=!1,a=new RA(e.doc,t,o[o.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new RA(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),s=!0}else{if(s&&o.some(c=>c.from==a.value.from))continue;if(i){let c=e.wordAt(a.value.from);if(!c||c.from!=a.value.from||c.to!=a.value.to)continue}return a.value}}const Uut=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(i=>i.from===i.to))return But({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(i=>e.sliceDoc(i.from,i.to)!=o))return!1;let r=kut(e,o);return r?(t(e.update({selection:e.selection.addRange(Oe.range(r.from,r.to),!1),effects:He.scrollIntoView(r.to)})),!0):!1},r_=Qe.define({combine(e){return Hl(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Xut(t),scrollToMatch:t=>He.scrollIntoView(t)})}});class Mpe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Rut(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,o)=>o=="n"?` +`:o=="r"?"\r":o=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Hut(this):new Jut(this)}getCursor(t,n=0,o){let r=t.doc?t:Gt.create({doc:t});return o==null&&(o=r.doc.length),this.regexp?Ly(this,r,n,o):Ny(this,r,n,o)}}class Ppe{constructor(t){this.spec=t}}function Ny(e,t,n,o){return new RA(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:r=>r.toLowerCase(),e.wholeWord?qut(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function qut(e,t){return(n,o,r,i)=>((i>n||i+r.length=n)return null;r.push(o.value)}return r}highlight(t,n,o,r){let i=Ny(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(o+this.spec.unquoted.length,t.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function Ly(e,t,n,o){return new Rpe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?Vut(t.charCategorizer(t.selection.main.head)):void 0},n,o)}function gM(e,t){return e.slice(br(e,t,!1),t)}function bM(e,t){return e.slice(t,br(e,t))}function Vut(e){return(t,n,o)=>!o[0].length||(e(gM(o.input,o.index))!=En.Word||e(bM(o.input,o.index))!=En.Word)&&(e(bM(o.input,o.index+o[0].length))!=En.Word||e(gM(o.input,o.index+o[0].length))!=En.Word)}class Hut extends Ppe{nextMatch(t,n,o){let r=Ly(this.spec,t,o,t.doc.length).next();return r.done&&(r=Ly(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,o){for(let r=1;;r++){let i=Math.max(n,o-r*1e4),s=Ly(this.spec,t,i,o),a=null;for(;!s.next().done;)a=s.value;if(a&&(i==n||a.from>i+10))return a;if(i==n)return null}}prevMatch(t,n,o){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,o,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,o)=>{if(o=="&")return t.match[0];if(o=="$")return"$";for(let r=o.length;r>0;r--){let i=+o.slice(0,r);if(i>0&&i=n)return null;r.push(o.value)}return r}highlight(t,n,o,r){let i=Ly(this.spec,t,Math.max(0,n-250),Math.min(o+250,t.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}const yC=Et.define(),lU=Et.define(),gm=Gr.define({create(e){return new C2(dF(e).create(),null)},update(e,t){for(let n of t.effects)n.is(yC)?e=new C2(n.value.create(),e.panel):n.is(lU)&&(e=new C2(e.query,n.value?uU:null));return e},provide:e=>gC.from(e,t=>t.panel)});class C2{constructor(t,n){this.query=t,this.panel=n}}const Gut=mt.mark({class:"cm-searchMatch"}),zut=mt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Kut=ir.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(gm))}update(e){let t=e.state.field(gm);(t!=e.startState.field(gm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return mt.none;let{view:n}=this,o=new dp;for(let r=0,i=n.visibleRanges,s=i.length;ri[r+1].from-500;)c=i[++r].to;e.highlight(n.state,a,c,(p,u)=>{let l=n.state.selection.ranges.some(d=>d.from==p&&d.to==u);o.add(p,u,l?zut:Gut)})}return o.finish()}},{decorations:e=>e.decorations});function fw(e){return t=>{let n=t.state.field(gm,!1);return n&&n.query.spec.valid?e(t,n):Dpe(t)}}const yM=fw((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=Oe.single(o.from,o.to),i=e.state.facet(r_);return e.dispatch({selection:r,effects:[cU(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),jpe(e),!0}),AM=fw((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=Oe.single(r.from,r.to),s=e.state.facet(r_);return e.dispatch({selection:i,effects:[cU(e,r),s.scrollToMatch(i.main,e)],userEvent:"select.search"}),jpe(e),!0}),Qut=fw((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Oe.create(n.map(o=>Oe.range(o.from,o.to))),userEvent:"select.search.matches"}),!0)}),$ut=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],s=0;for(let a=new RA(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(s=i.length),i.push(Oe.range(a.value.from,a.value.to))}return t(e.update({selection:Oe.create(i,s),userEvent:"select.search.matches"})),!0},ZX=fw((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let s=i,a=[],c,p,u=[];s.from==o&&s.to==r&&(p=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:p}),s=t.nextMatch(n,s.from,s.to),u.push(He.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+".")));let l=e.state.changes(a);return s&&(c=Oe.single(s.from,s.to).map(l),u.push(cU(e,s)),u.push(n.facet(r_).scrollToMatch(c.main,e))),e.dispatch({changes:l,selection:c,effects:u,userEvent:"input.replace"}),!0}),Wut=fw((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(r=>{let{from:i,to:s}=r;return{from:i,to:s,insert:t.getReplacement(r)}});if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:He.announce.of(o),userEvent:"input.replace.all"}),!0});function uU(e){return e.state.facet(r_).createPanel(e)}function dF(e,t){var n,o,r,i,s;let a=e.selection.main,c=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!c)return t;let p=e.facet(r_);return new Mpe({search:((n=t?.literal)!==null&&n!==void 0?n:p.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(o=t?.caseSensitive)!==null&&o!==void 0?o:p.caseSensitive,literal:(r=t?.literal)!==null&&r!==void 0?r:p.literal,regexp:(i=t?.regexp)!==null&&i!==void 0?i:p.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:p.wholeWord})}function Ipe(e){let t=mC(e,uU);return t&&t.dom.querySelector("[main-field]")}function jpe(e){let t=Ipe(e);t&&t==e.root.activeElement&&t.select()}const Dpe=e=>{let t=e.state.field(gm,!1);if(t&&t.panel){let n=Ipe(e);if(n&&n!=e.root.activeElement){let o=dF(e.state,t.query.spec);o.valid&&e.dispatch({effects:yC.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[lU.of(!0),t?yC.of(dF(e.state,t.query.spec)):Et.appendConfig.of(ect)]});return!0},Npe=e=>{let t=e.state.field(gm,!1);if(!t||!t.panel)return!1;let n=mC(e,uU);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:lU.of(!1)}),!0},Yut=[{key:"Mod-f",run:Dpe,scope:"editor search-panel"},{key:"F3",run:yM,shift:AM,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:yM,shift:AM,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Npe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:$ut},{key:"Mod-Alt-g",run:Eut},{key:"Mod-d",run:Uut,preventDefault:!0}];class Xut{constructor(t){this.view=t;let n=this.query=t.state.field(gm).query.spec;this.commit=this.commit.bind(this),this.searchField=fn("input",{value:n.search,placeholder:ni(t,"Find"),"aria-label":ni(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=fn("input",{value:n.replace,placeholder:ni(t,"Replace"),"aria-label":ni(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=fn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=fn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=fn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function o(r,i,s){return fn("button",{class:"cm-button",name:r,onclick:i,type:"button"},s)}this.dom=fn("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,o("next",()=>yM(t),[ni(t,"next")]),o("prev",()=>AM(t),[ni(t,"previous")]),o("select",()=>Qut(t),[ni(t,"all")]),fn("label",null,[this.caseField,ni(t,"match case")]),fn("label",null,[this.reField,ni(t,"regexp")]),fn("label",null,[this.wordField,ni(t,"by word")]),...t.state.readOnly?[]:[fn("br"),this.replaceField,o("replace",()=>ZX(t),[ni(t,"replace")]),o("replaceAll",()=>Wut(t),[ni(t,"replace all")])],fn("button",{name:"close",onclick:()=>Npe(t),"aria-label":ni(t,"close"),type:"button"},["×"])])}commit(){let t=new Mpe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:yC.of(t)}))}keydown(t){bst(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?AM:yM)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),ZX(this.view))}update(t){for(let n of t.transactions)for(let o of n.effects)o.is(yC)&&!o.value.eq(this.query)&&this.setQuery(o.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(r_).top}}function ni(e,t){return e.state.phrase(t)}const rR=30,oR=/[\s\.,:;?!]/;function cU(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-rR),s=Math.min(r,n+rR),a=e.state.sliceDoc(i,s);if(i!=o.from){for(let c=0;ca.length-rR;c--)if(!oR.test(a[c-1])&&oR.test(a[c])){a=a.slice(0,c);break}}return He.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const Zut=He.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ect=[gm,gb.low(Kut),Zut];class Lpe{constructor(t,n,o,r){this.state=t,this.pos=n,this.explicit=o,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=oo(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),o=Math.max(n.from,this.pos-250),r=n.text.slice(o-n.from,this.pos-n.from),i=r.search(Fpe(t,!1));return i<0?null:{from:o+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,o){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),o&&o.onDocChange&&(this.abortOnDocChange=!0))}}function eZ(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function tct(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let i=1;itypeof r=="string"?{label:r}:r),[n,o]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:tct(t);return r=>{let i=r.matchBefore(o);return i||r.explicit?{from:i?i.from:r.pos,options:t,validFor:n}:null}}class tZ{constructor(t,n,o,r){this.completion=t,this.source=n,this.match=o,this.score=r}}function qg(e){return e.selection.main.from}function Fpe(e,t){var n;let{source:o}=e,r=t&&o[0]!="^",i=o[o.length-1]!="$";return!r&&!i?e:new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const xpe=Ap.define();function rct(e,t,n,o){let{main:r}=e.selection,i=n-r.from,s=o-r.from;return{...e.changeByRange(a=>{if(a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+s)!=e.sliceDoc(n,o))return{range:a};let c=e.toText(t);return{changes:{from:a.from+i,to:o==r.from?a.to:a.from+s,insert:c},range:Oe.cursor(a.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const nZ=new WeakMap;function oct(e){if(!Array.isArray(e))return e;let t=nZ.get(e);return t||nZ.set(e,t=nct(e)),t}const _M=Et.define(),AC=Et.define();class ict{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&R<=57||R>=97&&R<=122?2:R>=65&&R<=90?1:0:(E=Fk(R))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!_||T==1&&g||w==0&&T!=0)&&(n[l]==R||o[l]==R&&(d=!0)?s[l++]=_:s.length&&(y=!1)),w=T,_+=Sl(R)}return l==c&&s[0]==0&&y?this.result(-100+(d?-200:0),s,t):f==c&&h==0?this.ret(-200-t.length+(m==t.length?0:-100),[0,m]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):f==c?this.ret(-900-t.length,[h,m]):l==c?this.result(-100+(d?-200:0)+-700+(y?0:-1100),s,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,o){let r=[],i=0;for(let s of n){let a=s+(this.astral?Sl(Lo(o,s)):1);i&&r[i-1]==s?r[i-1]=a:(r[i++]=s,r[i++]=a)}return this.ret(t-o.length,r)}}class sct{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:act,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>o=>rZ(t(o),n(o)),optionClass:(t,n)=>o=>rZ(t(o),n(o)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function rZ(e,t){return e?t?e+" "+t:e:t}function act(e,t,n,o,r,i){let s=e.textDirection==pn.RTL,a=s,c=!1,p="top",u,l,d=t.left-r.left,f=r.right-t.right,h=o.right-o.left,m=o.bottom-o.top;if(a&&d=m||_>t.top?u=n.bottom-t.top:(p="bottom",u=t.bottom-n.top)}let g=(t.bottom-t.top)/i.offsetHeight,y=(t.right-t.left)/i.offsetWidth;return{style:`${p}: ${u/g}px; max-width: ${l/y}px`,class:"cm-completionInfo-"+(c?s?"left-narrow":"right-narrow":a?"left":"right")}}function lct(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let o=document.createElement("div");return o.classList.add("cm-completionIcon"),n.type&&o.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),o.setAttribute("aria-hidden","true"),o},position:20}),t.push({render(n,o,r,i){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,c=0;for(let p=0;pc&&s.appendChild(document.createTextNode(a.slice(c,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,l))),d.className="cm-completionMatchedText",c=l}return cn.position-o.position).map(n=>n.render)}function w2(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class uct{constructor(t,n,o){this.view=t,this.stateField=n,this.applyCompletion=o,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:i,selected:s}=r.open,a=t.state.facet(Rr);this.optionContent=lct(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=w2(i.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:p}=t.state.field(n).open;for(let u=c.target,l;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(l=/-(\d+)$/.exec(u.id))&&+l[1]{let p=t.state.field(this.stateField,!1);p&&p.tooltip&&t.state.facet(Rr).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:AC.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let o=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),o!=r){let{options:i,selected:s,disabled:a}=o.open;(!r.open||r.open.options!=i)&&(this.range=w2(i.length,s,t.state.facet(Rr).maxRenderedOptions),this.showOptions(i,o.id)),this.updateSel(),a!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let o of this.currentClass.split(" "))o&&this.dom.classList.remove(o);for(let o of n.split(" "))o&&this.dom.classList.add(o);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=w2(n.options.length,n.selected,this.view.state.facet(Rr).maxRenderedOptions),this.showOptions(n.options,t.id));let o=this.updateSelectedOption(n.selected);if(o){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(a=>{a&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(a,r)}).catch(a=>Bo(this.view.state,a,"completion info")):(this.addInfoPane(s,r),o.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let o=this.info=document.createElement("div");if(o.className="cm-tooltip cm-completionInfo",o.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)o.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:i}=t;o.appendChild(r),this.infoDestroy=i||null}this.dom.appendChild(o),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let o=this.list.firstChild,r=this.range.from;o;o=o.nextSibling,r++)o.nodeName!="LI"||!o.id?r--:r==t?o.hasAttribute("aria-selected")||(o.setAttribute("aria-selected","true"),n=o):o.hasAttribute("aria-selected")&&(o.removeAttribute("aria-selected"),o.removeAttribute("aria-describedby"));return n&&dct(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),o=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),i=this.space;if(!i){let s=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return r.top>Math.min(i.bottom,n.bottom)-10||r.bottom{s.target==r&&s.preventDefault()});let i=null;for(let s=o.from;so.from||o.from==0))if(i=d,typeof p!="string"&&p.header)r.appendChild(p.header(p));else{let f=r.appendChild(document.createElement("completion-section"));f.textContent=d}}const u=r.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let l=this.optionClass(a);l&&(u.className=l);for(let d of this.optionContent){let f=d(a,this.view.state,this.view,c);f&&u.appendChild(f)}}return o.from&&r.classList.add("cm-completionListIncompleteTop"),o.tonew uct(n,e,t)}function dct(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}function oZ(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function fct(e,t){let n=[],o=null,r=null,i=u=>{n.push(u);let{section:l}=u.completion;if(l){o||(o=[]);let d=typeof l=="string"?l:l.name;o.some(f=>f.name==d)||o.push(typeof l=="string"?{name:d}:l)}},s=t.facet(Rr);for(let u of e)if(u.hasResult()){let l=u.result.getMatch;if(u.result.filter===!1)for(let d of u.result.options)i(new tZ(d,u.source,l?l(d):[],1e9-n.length));else{let d=t.sliceDoc(u.from,u.to),f,h=s.filterStrict?new sct(d):new ict(d);for(let m of u.result.options)if(f=h.match(m.label)){let g=m.displayLabel?l?l(m,f.matched):[]:f.matched,y=f.score+(m.boost||0);if(i(new tZ(m,u.source,g,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:_}=m.section;r||(r=Object.create(null)),r[_]=Math.max(y,r[_]||-1e9)}}}}if(o){let u=Object.create(null),l=0,d=(f,h)=>(f.rank==="dynamic"&&h.rank==="dynamic"?r[h.name]-r[f.name]:0)||(typeof f.rank=="number"?f.rank:1e9)-(typeof h.rank=="number"?h.rank:1e9)||(f.named.score-l.score||p(l.completion,d.completion))){let l=u.completion;!c||c.label!=l.label||c.detail!=l.detail||c.type!=null&&l.type!=null&&c.type!=l.type||c.apply!=l.apply||c.boost!=l.boost?a.push(u):oZ(u.completion)>oZ(c)&&(a[a.length-1]=u),c=u.completion}return a}class Ky{constructor(t,n,o,r,i,s){this.options=t,this.attrs=n,this.tooltip=o,this.timestamp=r,this.selected=i,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Ky(this.options,iZ(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,o,r,i,s){if(r&&!s&&t.some(p=>p.isPending))return r.setDisabled();let a=fct(t,n);if(!a.length)return r&&t.some(p=>p.isPending)?r.setDisabled():null;let c=n.facet(Rr).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let p=r.options[r.selected].completion;for(let u=0;uu.hasResult()?Math.min(p,u.from):p,1e8),create:yct,above:i.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Ky(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ky(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class vM{constructor(t,n,o){this.active=t,this.id=n,this.open=o}static start(){return new vM(gct,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,o=n.facet(Rr),i=(o.override||n.languageDataAt("autocomplete",qg(n)).map(oct)).map(c=>(this.active.find(u=>u.source==c)||new Hi(c,this.active.some(u=>u.state!=0)?1:0)).update(t,o));i.length==this.active.length&&i.every((c,p)=>c==this.active[p])&&(i=this.active);let s=this.open,a=t.effects.some(c=>c.is(dU));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||i.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!hct(i,this.active)||a?s=Ky.build(i,n,this.id,s,o,a):s&&s.disabled&&!i.some(c=>c.isPending)&&(s=null),!s&&i.every(c=>!c.isPending)&&i.some(c=>c.hasResult())&&(i=i.map(c=>c.hasResult()?new Hi(c.source,0):c));for(let c of t.effects)c.is(kpe)&&(s=s&&s.setSelected(c.value,this.id));return i==this.active&&s==this.open?this:new vM(i,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?pct:mct}}function hct(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const gct=[];function Bpe(e,t){if(e.isUserEvent("input.complete")){let o=e.annotation(xpe);if(o&&t.activateOnCompletion(o))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Hi{constructor(t,n,o=!1){this.source=t,this.state=n,this.explicit=o}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let o=Bpe(t,n),r=this;(o&8||o&16&&this.touches(t))&&(r=new Hi(r.source,0)),o&4&&r.state==0&&(r=new Hi(this.source,1)),r=r.updateFor(t,o);for(let i of t.effects)if(i.is(_M))r=new Hi(r.source,1,i.value);else if(i.is(AC))r=new Hi(r.source,0);else if(i.is(dU))for(let s of i.value)s.source==r.source&&(r=s);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(qg(t.state))}}class uA extends Hi{constructor(t,n,o,r,i,s){super(t,3,n),this.limit=o,this.result=r,this.from=i,this.to=s}hasResult(){return!0}updateFor(t,n){var o;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),a=qg(t.state);if(a>s||!r||n&2&&(qg(t.startState)==this.from||an.map(t))}}),kpe=Et.define(),Fo=Gr.define({create(){return vM.start()},update(e,t){return e.update(t)},provide:e=>[eU.from(e,t=>t.tooltip),He.contentAttributes.from(e,t=>t.attrs)]});function fU(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(Fo).active.find(r=>r.source==t.source);return o instanceof uA?(typeof n=="string"?e.dispatch({...rct(e.state,n,o.from,o.to),annotations:xpe.of(t.completion)}):n(e,t.completion,o.from,o.to),!0):!1}const yct=cct(Fo,fU);function iR(e,t="option"){return n=>{let o=n.state.field(Fo,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+r*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:kpe.of(a)}),!0}}const Act=e=>{let t=e.state.field(Fo,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Fo,!1)?(e.dispatch({effects:_M.of(!0)}),!0):!1,_ct=e=>{let t=e.state.field(Fo,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:AC.of(null)}),!0)};class vct{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Sct=50,Cct=1e3,wct=ir.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Fo).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Fo),n=e.state.facet(Rr);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Fo)==t)return;let o=e.transactions.some(i=>{let s=Bpe(i,n);return s&8||(i.selection||i.docChanged)&&!(s&3)});for(let i=0;iSct&&Date.now()-s.time>Cct){for(let a of s.context.abortListeners)try{a()}catch(c){Bo(this.view.state,c)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(i=>i.effects.some(s=>s.is(_M)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(i=>i.isPending&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of e.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Fo);for(let n of t.active)n.isPending&&!this.running.some(o=>o.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Rr).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=qg(t),o=new Lpe(t,n,e.explicit,this.view),r=new vct(e,o);this.running.push(r),Promise.resolve(e.source(o)).then(i=>{r.context.aborted||(r.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:AC.of(null)}),Bo(this.view.state,i)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Rr).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Rr),o=this.view.state.field(Fo);for(let r=0;ra.source==i.active.source);if(s&&s.isPending)if(i.done==null){let a=new Hi(i.active.source,0);for(let c of i.updates)a=a.update(c,n);a.isPending||t.push(a)}else this.startQuery(s)}(t.length||o.open&&o.open.disabled)&&this.view.dispatch({effects:dU.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Fo,!1);if(t&&t.tooltip&&this.view.state.facet(Rr).closeOnBlur){let n=t.open&&Phe(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:AC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_M.of(!1)}),20),this.composing=0}}}),Oct=typeof navigator=="object"&&/Win/.test(navigator.platform),Tct=gb.highest(He.domEventHandlers({keydown(e,t){let n=t.state.field(Fo,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Oct&&e.altKey)||e.metaKey)return!1;let o=n.open.options[n.open.selected],r=n.active.find(s=>s.source==o.source),i=o.completion.commitCharacters||r.result.commitCharacters;return i&&i.indexOf(e.key)>-1&&fU(t,o),!1}})),Rct=He.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),_C={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xg=Et.define({map(e,t){let n=t.mapPos(e,-1,yo.TrackAfter);return n??void 0}}),hU=new class extends Cm{};hU.startSide=1;hU.endSide=-1;const Upe=Gr.define({create(){return xt.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:o=>o>=n.from&&o<=n.to})}for(let n of t.effects)n.is(xg)&&(e=e.update({add:[hU.range(n.value,n.value+1)]}));return e}});function Ect(){return[Pct,Upe]}const T2="()[]{}<>«»»«[]{}";function qpe(e){for(let t=0;t{if((Mct?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||o.length==2&&Sl(Lo(o,0))==1||t!=r.from||n!=r.to)return!1;let i=Dct(e.state,o);return i?(e.dispatch(i),!0):!1}),Ict=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let o=Jpe(e,e.selection.main.head).brackets||_C.brackets,r=null,i=e.changeByRange(s=>{if(s.empty){let a=Nct(e.doc,s.head);for(let c of o)if(c==a&&eI(e.doc,s.head)==qpe(Lo(c,0)))return{changes:{from:s.head-c.length,to:s.head+c.length},range:Oe.cursor(s.head-c.length)}}return{range:r=s}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},jct=[{key:"Backspace",run:Ict}];function Dct(e,t){let n=Jpe(e,e.selection.main.head),o=n.brackets||_C.brackets;for(let r of o){let i=qpe(Lo(r,0));if(t==r)return i==r?xct(e,r,o.indexOf(r+r+r)>-1,n):Lct(e,r,i,n.before||_C.before);if(t==i&&Vpe(e,e.selection.main.from))return Fct(e,r,i)}return null}function Vpe(e,t){let n=!1;return e.field(Upe).between(0,e.doc.length,o=>{o==t&&(n=!0)}),n}function eI(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Sl(Lo(n,0)))}function Nct(e,t){let n=e.sliceString(t-2,t);return Sl(Lo(n,0))==n.length?n:n.slice(1)}function Lct(e,t,n,o){let r=null,i=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:xg.of(s.to+t.length),range:Oe.range(s.anchor+t.length,s.head+t.length)};let a=eI(e.doc,s.head);return!a||/\s/.test(a)||o.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:xg.of(s.head+t.length),range:Oe.cursor(s.head+t.length)}:{range:r=s}});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Fct(e,t,n){let o=null,r=e.changeByRange(i=>i.empty&&eI(e.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Oe.cursor(i.head+n.length)}:o={range:i});return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function xct(e,t,n,o){let r=o.stringPrefixes||_C.stringPrefixes,i=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:xg.of(a.to+t.length),range:Oe.range(a.anchor+t.length,a.head+t.length)};let c=a.head,p=eI(e.doc,c),u;if(p==t){if(sZ(e,c))return{changes:{insert:t+t,from:c},effects:xg.of(c+t.length),range:Oe.cursor(c+t.length)};if(Vpe(e,c)){let d=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+d.length,insert:d},range:Oe.cursor(c+d.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(u=aZ(e,c-2*t.length,r))>-1&&sZ(e,u))return{changes:{insert:t+t+t+t,from:c},effects:xg.of(c+t.length),range:Oe.cursor(c+t.length)};if(e.charCategorizer(c)(p)!=En.Word&&aZ(e,c,r)>-1&&!Bct(e,c,t,r))return{changes:{insert:t+t,from:c},effects:xg.of(c+t.length),range:Oe.cursor(c+t.length)}}return{range:i=a}});return i?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function sZ(e,t){let n=oo(e).resolveInner(t+1);return n.parent&&n.from==t}function Bct(e,t,n,o){let r=oo(e).resolveInner(t,-1),i=o.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),c=a.indexOf(n);if(!c||c>-1&&o.indexOf(a.slice(0,c))>-1){let u=r.firstChild;for(;u&&u.from==r.from&&u.to-u.from>n.length+c;){if(e.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let p=r.to==t&&r.parent;if(!p)break;r=p}return!1}function aZ(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=En.Word)return t;for(let r of n){let i=t-r.length;if(e.sliceDoc(i,t)==r&&o(e.sliceDoc(i-1,i))!=En.Word)return i}return-1}function kct(e={}){return[Tct,Fo,Rr.of(e),wct,Uct,Rct]}const Hpe=[{key:"Ctrl-Space",run:O2},{mac:"Alt-`",run:O2},{mac:"Alt-i",run:O2},{key:"Escape",run:_ct},{key:"ArrowDown",run:iR(!0)},{key:"ArrowUp",run:iR(!1)},{key:"PageDown",run:iR(!0,"page")},{key:"PageUp",run:iR(!1,"page")},{key:"Enter",run:Act}],Uct=gb.highest(Xk.computeN([Rr],e=>e.facet(Rr).defaultKeymap?[Hpe]:[]));class lZ{constructor(t,n,o){this.from=t,this.to=n,this.diagnostic=o}}class Eg{constructor(t,n,o){this.diagnostics=t,this.panel=n,this.selected=o}static init(t,n,o){let r=o.facet(vC).markerFilter;r&&(t=r(t,o));let i=t.slice().sort((f,h)=>f.from-h.from||f.to-h.to),s=new dp,a=[],c=0,p=o.doc.iter(),u=0,l=o.doc.length;for(let f=0;;){let h=f==i.length?null:i[f];if(!h&&!a.length)break;let m,g;if(a.length)m=c,g=a.reduce((S,w)=>Math.min(S,w.to),h&&h.from>m?h.from:1e8);else{if(m=h.from,m>l)break;g=h.to,a.push(h),f++}for(;fS.from||S.to==m))a.push(S),f++,g=Math.min(S.to,g);else{g=Math.min(S.from,g);break}}g=Math.min(g,l);let y=!1;if(a.some(S=>S.from==m&&(S.to==g||g==l))&&(y=m==g,!y&&g-m<10)){let S=m-(u+p.value.length);S>0&&(p.next(S),u=m);for(let w=m;;){if(w>=g){y=!0;break}if(!p.lineBreak&&u+p.value.length>w)break;w=u+p.value.length,u+=p.value.length,p.next()}}let _=Zct(a);if(y)s.add(m,m,mt.widget({widget:new $ct(_),diagnostics:a.slice()}));else{let S=a.reduce((w,R)=>R.markClass?w+" "+R.markClass:w,"");s.add(m,g,mt.mark({class:"cm-lintRange cm-lintRange-"+_+S,diagnostics:a.slice(),inclusiveEnd:a.some(w=>w.to>g)}))}if(c=g,c==l)break;for(let S=0;S{if(!(t&&s.diagnostics.indexOf(t)<0))if(!o)o=new lZ(r,i,t||s.diagnostics[0]);else{if(s.diagnostics.indexOf(o.diagnostic)<0)return!1;o=new lZ(o.from,i,o.diagnostic)}}),o}function qct(e,t){let n=t.pos,o=t.end||n,r=e.state.facet(vC).hideOn(e,n,o);if(r!=null)return r;let i=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(s=>s.is(Gpe))||e.changes.touchesRange(i.from,Math.max(i.to,o)))}function Jct(e,t){return e.field(di,!1)?t:t.concat(Et.appendConfig.of(edt))}const Gpe=Et.define(),pU=Et.define(),zpe=Et.define(),di=Gr.define({create(){return new Eg(mt.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),o=null,r=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);o=EA(n,e.selected.diagnostic,i)||EA(n,null,i)}!n.size&&r&&t.state.facet(vC).autoPanel&&(r=null),e=new Eg(n,r,o)}for(let n of t.effects)if(n.is(Gpe)){let o=t.state.facet(vC).autoPanel?n.value.length?SC.open:null:e.panel;e=Eg.init(n.value,o,t.state)}else n.is(pU)?e=new Eg(e.diagnostics,n.value?SC.open:null,e.selected):n.is(zpe)&&(e=new Eg(e.diagnostics,e.panel,n.value));return e},provide:e=>[gC.from(e,t=>t.panel),He.decorations.from(e,t=>t.diagnostics)]}),Vct=mt.mark({class:"cm-lintRange cm-lintRange-active"});function Hct(e,t,n){let{diagnostics:o}=e.state.field(di),r,i=-1,s=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(c,p,{spec:u})=>{if(t>=c&&t<=p&&(c==p||(t>c||n>0)&&(tQpe(e,n,!1)))}const zct=e=>{let t=e.state.field(di,!1);(!t||!t.panel)&&e.dispatch({effects:Jct(e.state,[pU.of(!0)])});let n=mC(e,SC.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},uZ=e=>{let t=e.state.field(di,!1);return!t||!t.panel?!1:(e.dispatch({effects:pU.of(!1)}),!0)},Kct=e=>{let t=e.state.field(di,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)?!1:(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),!0)},Qct=[{key:"Mod-Shift-m",run:zct,preventDefault:!0},{key:"F8",run:Kct}],vC=Qe.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Hl(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:cZ,tooltipFilter:cZ,needsRefresh:(t,n)=>t?n?o=>t(o)||n(o):t:n,hideOn:(t,n)=>t?n?(o,r,i)=>t(o,r,i)||n(o,r,i):t:n,autoPanel:(t,n)=>t||n})}}});function cZ(e,t){return e?t?(n,o)=>t(e(n,o),o):e:t}function Kpe(e){let t=[];if(e)e:for(let{name:n}of e){for(let o=0;oi.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function Qpe(e,t,n){var o;let r=n?Kpe(t.actions):[];return fn("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},fn("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(o=t.actions)===null||o===void 0?void 0:o.map((i,s)=>{let a=!1,c=f=>{if(f.preventDefault(),a)return;a=!0;let h=EA(e.state.field(di).diagnostics,t);h&&i.apply(e,h.from,h.to)},{name:p}=i,u=r[s]?p.indexOf(r[s]):-1,l=u<0?p:[p.slice(0,u),fn("u",p.slice(u,u+1)),p.slice(u+1)],d=i.markClass?" "+i.markClass:"";return fn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:c,onmousedown:c,"aria-label":` Action: ${p}${u<0?"":` (access key "${r[s]})"`}.`},l)}),t.source&&fn("div",{class:"cm-diagnosticSource"},t.source))}class $ct extends _p{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return fn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class dZ{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Qpe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SC{constructor(t){this.view=t,this.items=[];let n=r=>{if(r.keyCode==27)uZ(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],s=Kpe(i.actions);for(let a=0;a{for(let i=0;iuZ(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(di).selected;if(!t)return-1;for(let n=0;n{for(let u of p.diagnostics){if(s.has(u))continue;s.add(u);let l=-1,d;for(let f=o;fo&&(this.items.splice(o,l-o),r=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),i=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),o++}});o({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:c})=>{let p=c.height/this.list.offsetHeight;a.topc.bottom&&(this.list.scrollTop+=(a.bottom-c.bottom)/p)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let o=t;t=o.nextSibling,o.remove()}for(let o of this.items)if(o.dom.parentNode==this.list){for(;t!=o.dom;)n();t=o.dom.nextSibling}else this.list.insertBefore(o.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(di),o=EA(n.diagnostics,this.items[t].diagnostic);o&&this.view.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0,effects:zpe.of(o)})}static open(t){return new SC(t)}}function Wct(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function sR(e){return Wct(``,'width="6" height="3"')}const Yct=He.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:sR("#d11")},".cm-lintRange-warning":{backgroundImage:sR("orange")},".cm-lintRange-info":{backgroundImage:sR("#999")},".cm-lintRange-hint":{backgroundImage:sR("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Xct(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function Zct(e){let t="hint",n=1;for(let o of e){let r=Xct(o.severity);r>n&&(n=r,t=o.severity)}return t}const edt=[di,He.decorations.compute([di],e=>{let{selected:t,panel:n}=e.field(di);return!t||!n||t.from==t.to?mt.none:mt.set([Vct.range(t.from,t.to)])}),rat(Hct,{hideOn:qct}),Yct],tdt=[pat(),bat(),Nst(),Slt(),zat(),Cst(),Est(),Gt.allowMultipleSelections.of(!0),jat(),Qat(Yat,{fallback:!0}),olt(),Ect(),kct(),zst(),$st(),Ust(),jut(),Xk.of([...jct,...Tut,...Yut,...Ilt,...Jat,...Hpe,...Qct])],ndt=({open:e,onClose:t})=>{const{t:n}=Wt(),{saveConfig:o,getConfig:r}=Ds(),i=Re.useRef(null),s=Re.useRef(null),[a,c]=Re.useState(""),[p,u]=Re.useState(""),[l,d]=Re.useState(!0),f=Re.useCallback(m=>{try{return JSON.parse(m).mcpServers?(d(!0),u(""),!0):(d(!1),u(n("ConfigurationError")),!1)}catch(g){return u(`Invalid JSON format + ${g instanceof Error?g.message:"Unknown error"}`),d(!1),!1}},[n]);Re.useEffect(()=>{if(!e)return;const m=()=>{if(i.current&&!s.current){const g=JSON.stringify(r(),null,2);c(g),f(g);const y=Gt.create({doc:g,extensions:[tdt,flt(),He.updateListener.of(_=>{if(_.docChanged){const S=_.state.doc.toString();c(S),f(S)}}),He.theme({"&":{height:"200px",maxHeight:"200px"},".cm-content":{padding:"10px"},".cm-focused":{outline:"none"},".cm-editor":{height:"200px",maxHeight:"200px"},".cm-scroller":{fontFamily:"monospace",height:"200px",maxHeight:"200px"},".cm-gutters":{height:"200px",maxHeight:"200px"}})]});s.current=new He({state:y,parent:i.current})}else setTimeout(m,100)};return setTimeout(m,50),()=>{s.current&&(s.current.destroy(),s.current=null)}},[e,f,r]);const h=Re.useCallback(()=>{l&&(o(JSON.parse(a)),t())},[l,o,a,t]);return Re.useEffect(()=>{if(!e)return;const m=g=>{g.key==="Enter"&&document.activeElement?.id==="dialog-content"&&(g.preventDefault(),h())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[e,h]),F.jsx(Dm,{open:e,children:F.jsxs(Nm,{header:n("EditConfiguration"),onClose:t,className:"w-[564px] min-h-[400px]",children:[F.jsx("div",{className:"flex flex-col gap-[8px] min-h-[280px] pt-[8px] pb-[16px]",children:F.jsxs("div",{className:"flex flex-col gap-[8px] min-h-[256px] p-[12px] bg-[var(--servers-edit-config-json-background-color)] rounded-[12px]",children:[F.jsxs("div",{className:"flex flex-row justify-between",children:[F.jsx("p",{className:"font-bold text-[14px] leading-[20px] text-[var(--servers-edit-config-json-header-color)]",children:n("EnterYourJSONConfiguration")}),F.jsx("p",{className:"font-normal text-[14px] leading-[20px] text-[var(--servers-edit-config-json-lang-color)]",children:"json"})]}),F.jsx("div",{ref:i,className:"border border-[var(--servers-edit-config-json-editor-border-color)] bg-[var(--servers-edit-config-json-editor-background-color)] rounded-[4px] overflow-hidden h-full max-h-full"}),p?F.jsx("p",{className:"text-[var(--text-negative)] font-normal text-[14px] leading-[20px] whitespace-pre-line",children:p}):null]})}),F.jsxs("div",{className:"flex flex-row items-center justify-end gap-[16px] h-[64px] border-t border-[var(--servers-edit-config-buttons-border-color)] mx-[-32px] px-[32px]",children:[F.jsx(Bn,{onClick:t,variant:"default",children:n("Cancel")}),F.jsx(Bn,{disabled:!l,onClick:h,children:n("Save")})]})]})})},rdt=()=>{const{t:e}=Wt(),{isRTL:t}=wn(),[n,o]=Re.useState(!1);return F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"flex flex-col gap-[16px] mt-[16px] pb-[32px]",children:[F.jsx("p",{className:ke("font-normal text-[14px] leading-[20px] text-[var(--servers-description-color)]",t?"text-end":""),children:e("CustomServersDescription")}),F.jsx("div",{className:ke("flex",t?"justify-end":"justify-start"),children:F.jsx(Bn,{className:"w-fit",onClick:()=>o(!0),children:e("EditConfiguration")})}),F.jsx(Brt,{})]}),F.jsx(ndt,{open:n,onClose:()=>o(!1)})]})},odt=({isActive:e})=>{const{t}=Wt();return F.jsx(Bn,{className:"max-w-[fit-content]",disabled:!e,children:t("RegisterConnectWallet")})},idt=()=>{const{t:e}=Wt(),{isRTL:t}=wn(),[n,o]=Re.useState(""),[r,i]=Re.useState(""),[s,a]=Re.useState(!1);Re.useEffect(()=>{const u=Ln.getWebSearchData();u&&(o(u.provider),i(u.key),a(!0))},[]);const c=Re.useCallback(()=>{!n||!r||(Ln.setWebSearchData({provider:n,key:r}),a(!0))},[n,r]),p=()=>{o(""),i(""),a(!1),Ln.setWebSearchData(null)};return Re.useEffect(()=>{const u=l=>{l.key==="Enter"&&(l.preventDefault(),c())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[c]),F.jsxs("div",{className:"flex flex-col gap-[16px] mt-[16px]",children:[F.jsx("p",{className:ke("font-normal text-[14px] leading-[20px] text-[var(--servers-description-color)]",t?"text-end":""),children:e("WebSearchDescription")}),F.jsxs("div",{className:"flex flex-col gap-[16px]",children:[F.jsx(Tl,{header:e("WebSearchEngine"),children:F.jsx(xP,{className:"w-[260px]",value:n||e("SelectEngine"),items:s?[]:[{text:"Exa",id:"Exa",onClick:()=>o("Exa")}]})}),F.jsx(Tl,{header:e("APIKey"),children:F.jsx(Il,{className:"w-[260px]",type:"password",value:r,disabled:s,onChange:u=>i(u.target.value)})})]}),F.jsxs("div",{className:ke("flex gap-[8px]",t?"flex-row-reverse":"flex-row"),children:[F.jsx(Bn,{className:"w-fit",onClick:c,disabled:!n||!r||s,children:e("Save")}),F.jsx(Bn,{className:"w-fit",disabled:!s,onClick:p,variant:"default",children:e("ResetSettings")})]})]})},sdt=()=>{const{t:e}=Wt(),{isRTL:t}=wn(),[n,o]=Re.useState("providers"),{providers:r}=gi(),i=F.jsxs("div",{className:"flex flex-col gap-[16px] select-none",children:[null,["providers"].map(s=>{const a=s==="wallet";return F.jsxs("div",{className:"flex gap-[12px]",children:[null,F.jsxs("div",{className:"select-none flex flex-col gap-[12px]",children:[F.jsxs("div",{className:"flex flex-col gap-[4px]",children:[null,F.jsx("p",{className:ke("text-[14px] leading-[20px] text-[var(--settings-description-color)]",t?"text-end":""),children:e(a?"ONLYOFFICEWalletDescription":"AIProvidersDescription")})]}),a?F.jsx(odt,{isActive:n===s}):F.jsx(Lrt,{isActive:n===s})]})]},s)})]});return F.jsx("div",{className:"flex justify-center",children:F.jsxs("div",{className:"flex flex-col gap-[16px] box-border max-w-[640px] w-[640px] mx-[32px] mt-[32px]",children:[F.jsx("h1",{className:"select-none font-bold text-[20px] leading-[28px] text-[var(--settings-header-color)]",children:e("Settings")}),F.jsx(Prt,{items:[{value:"ai-settings",label:e("Connection"),content:i},{value:"mcp-servers",label:e("MCPServers"),content:F.jsx(rdt,{}),disabled:!r.length},{value:"web-search",label:e("WebSearch"),content:F.jsx(idt,{}),disabled:!r.length}]})]})})},At=e=>typeof e=="string",FS=()=>{let e,t;const n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n},fZ=e=>e==null?"":""+e,adt=(e,t,n)=>{e.forEach(o=>{t[o]&&(n[o]=t[o])})},ldt=/###/g,hZ=e=>e&&e.indexOf("###")>-1?e.replace(ldt,"."):e,pZ=e=>!e||At(e),P0=(e,t,n)=>{const o=At(t)?t.split("."):t;let r=0;for(;r{const{obj:o,k:r}=P0(e,t,Object);if(o!==void 0||t.length===1){o[r]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=P0(e,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=P0(e,s,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},udt=(e,t,n,o)=>{const{obj:r,k:i}=P0(e,t,Object);r[i]=r[i]||[],r[i].push(n)},SM=(e,t)=>{const{obj:n,k:o}=P0(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},cdt=(e,t,n)=>{const o=SM(e,n);return o!==void 0?o:SM(t,n)},$pe=(e,t,n)=>{for(const o in t)o!=="__proto__"&&o!=="constructor"&&(o in e?At(e[o])||e[o]instanceof String||At(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):$pe(e[o],t[o],n):e[o]=t[o]);return e},Oy=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ddt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const fdt=e=>At(e)?e.replace(/[&<>"'\/]/g,t=>ddt[t]):e;class hdt{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const o=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,o),this.regExpQueue.push(t),o}}const pdt=[" ",",","?","!",";"],mdt=new hdt(20),gdt=(e,t,n)=>{t=t||"",n=n||"";const o=pdt.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(o.length===0)return!0;const r=mdt.getRegExp(`(${o.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!r.test(e);if(!i){const s=e.indexOf(n);s>0&&!r.test(e.substring(0,s))&&(i=!0)}return i},fF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const o=t.split(n);let r=e;for(let i=0;i-1&&ce?.replace("_","-"),bdt={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 CM{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||bdt,this.options=n,this.debug=n.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,n,o,r){return r&&!this.debug?null:(At(t[0])&&(t[0]=`${o}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new CM(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new CM(this.logger,t)}}var Ml=new CM;class tI{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const r=this.observers[o].get(n)||0;this.observers[o].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,i])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,o,r={}){const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],o&&(Array.isArray(o)?a.push(...o):At(o)&&i?a.push(...o.split(i)):a.push(o)));const c=SM(this.data,a);return!c&&!n&&!o&&t.indexOf(".")>-1&&(t=a[0],n=a[1],o=a.slice(2).join(".")),c||!s||!At(o)?c:fF(this.data?.[t]?.[n],o,i)}addResource(t,n,o,r,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];o&&(a=a.concat(s?o.split(s):o)),t.indexOf(".")>-1&&(a=t.split("."),r=n,n=a[1]),this.addNamespaces(n),mZ(this.data,a,r),i.silent||this.emit("added",t,n,o,r)}addResources(t,n,o,r={silent:!1}){for(const i in o)(At(o[i])||Array.isArray(o[i]))&&this.addResource(t,n,i,o[i],{silent:!0});r.silent||this.emit("added",t,n,o)}addResourceBundle(t,n,o,r,i,s={silent:!1,skipCopy:!1}){let a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),r=o,o=n,n=a[1]),this.addNamespaces(n);let c=SM(this.data,a)||{};s.skipCopy||(o=JSON.parse(JSON.stringify(o))),r?$pe(c,o,i):c={...c,...o},mZ(this.data,a,c),s.silent||this.emit("added",t,n,o)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Wpe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,r){return e.forEach(i=>{t=this.processors[i]?.process(t,n,o,r)??t}),t}};const Ype=Symbol("i18next/PATH_KEY");function ydt(){const e=[],t=Object.create(null);let n;return t.get=(o,r)=>(n?.revoke?.(),r===Ype?e:(e.push(r),n=Proxy.revocable(o,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function hF(e,t){const{[Ype]:n}=e(ydt());return n.join(t?.keySeparator??".")}const bZ={},R2=e=>!At(e)&&typeof e!="boolean"&&typeof e!="number";class wM extends tI{constructor(t,n={}){super(),adt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ml.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const o={...n};if(t==null)return!1;const r=this.resolve(t,o);if(r?.res===void 0)return!1;const i=R2(r.res);return!(o.returnObjects===!1&&i)}extractFromKey(t,n){let o=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=o&&t.indexOf(o)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!gdt(t,o,r);if(s&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:At(i)?[i]:i};const p=t.split(o);(o!==r||o===r&&this.options.ns.indexOf(p[0])>-1)&&(i=p.shift()),t=p.join(r)}return{key:t,namespaces:At(i)?[i]:i}}translate(t,n,o){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=hF(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(t[t.length-1],r),p=c[c.length-1];let u=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const l=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l?.toLowerCase()==="cimode")return d?i?{res:`${p}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:`${p}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:a;const f=this.resolve(t,r);let h=f?.res;const m=f?.usedKey||a,g=f?.exactUsedKey||a,y=["[object Number]","[object Function]","[object RegExp]"],_=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,w=r.count!==void 0&&!At(r.count),R=wM.hasDefaultValue(r),E=w?this.pluralResolver.getSuffix(l,r.count,r):"",T=r.ordinal&&w?this.pluralResolver.getSuffix(l,r.count,{ordinal:!1}):"",D=w&&!r.ordinal&&r.count===0,B=D&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${E}`]||r[`defaultValue${T}`]||r.defaultValue;let N=h;S&&!h&&R&&(N=B);const L=R2(N),q=Object.prototype.toString.apply(N);if(S&&N&&L&&y.indexOf(q)<0&&!(At(_)&&Array.isArray(N))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,N,{...r,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(f.res=I,f.usedParams=this.getUsedParamsDetails(r),f):I}if(s){const I=Array.isArray(N),U=I?[]:{},J=I?g:m;for(const V in N)if(Object.prototype.hasOwnProperty.call(N,V)){const G=`${J}${s}${V}`;R&&!h?U[V]=this.translate(G,{...r,defaultValue:R2(B)?B[V]:void 0,joinArrays:!1,ns:c}):U[V]=this.translate(G,{...r,joinArrays:!1,ns:c}),U[V]===G&&(U[V]=N[V])}h=U}}else if(S&&At(_)&&Array.isArray(h))h=h.join(_),h&&(h=this.extendTranslation(h,t,r,o));else{let I=!1,U=!1;!this.isValidLookup(h)&&R&&(I=!0,h=B),this.isValidLookup(h)||(U=!0,h=a);const V=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&U?void 0:h,G=R&&B!==h&&this.options.updateMissing;if(U||I||G){if(this.logger.log(G?"updateKey":"missingKey",l,p,a,G?B:h),s){const X=this.resolve(a,{...r,keySeparator:!1});X&&X.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,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&le&&le[0])for(let X=0;X{const _e=R&&W!==h?W:V;this.options.missingKeyHandler?this.options.missingKeyHandler(X,p,ce,_e,G,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(X,p,ce,_e,G,r),this.emit("missingKey",X,p,ce,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?Q.forEach(X=>{const ce=this.pluralResolver.getSuffixes(X,r);D&&r[`defaultValue${this.options.pluralSeparator}zero`]&&ce.indexOf(`${this.options.pluralSeparator}zero`)<0&&ce.push(`${this.options.pluralSeparator}zero`),ce.forEach(W=>{K([X],a+W,r[`defaultValue${W}`]||B)})}):K(Q,a,B))}h=this.extendTranslation(h,t,r,f,o),U&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${p}${u}${a}`),(U||I)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${u}${a}`:a,I?h:void 0,r))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(r),f):h}extendTranslation(t,n,o,r,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const c=At(t)&&(o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(c){const l=t.match(this.interpolator.nestingRegexp);p=l&&l.length}let u=o.replace&&!At(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,o.lng||this.language||r.usedLng,o),c){const l=t.match(this.interpolator.nestingRegexp),d=l&&l.length;pi?.[0]===l[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${l[0]} in key: ${n[0]}`),null):this.translate(...l,n),o)),o.interpolation&&this.interpolator.reset()}const s=o.postProcess||this.options.postProcess,a=At(s)?[s]:s;return t!=null&&a?.length&&o.applyPostProcessor!==!1&&(t=Wpe.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),t}resolve(t,n={}){let o,r,i,s,a;return At(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(o))return;const p=this.extractFromKey(c,n),u=p.key;r=u;let l=p.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=n.count!==void 0&&!At(n.count),f=d&&!n.ordinal&&n.count===0,h=n.context!==void 0&&(At(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(g=>{this.isValidLookup(o)||(a=g,!bZ[`${m[0]}-${g}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(bZ[`${m[0]}-${g}`]=!0,this.logger.warn(`key "${r}" for languages "${m.join(", ")}" won't get resolved as 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!!!")),m.forEach(y=>{if(this.isValidLookup(o))return;s=y;const _=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(_,u,y,g,n);else{let w;d&&(w=this.pluralResolver.getSuffix(y,n.count,n));const R=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(n.ordinal&&w.indexOf(E)===0&&_.push(u+w.replace(E,this.options.pluralSeparator)),_.push(u+w),f&&_.push(u+R)),h){const T=`${u}${this.options.contextSeparator||"_"}${n.context}`;_.push(T),d&&(n.ordinal&&w.indexOf(E)===0&&_.push(T+w.replace(E,this.options.pluralSeparator)),_.push(T+w),f&&_.push(T+R))}}let S;for(;S=_.pop();)this.isValidLookup(o)||(i=S,o=this.getResource(y,g,S,n))}))})}),{res:o,usedKey:r,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,o,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,o,r):this.resourceStore.getResource(t,n,o,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=t.replace&&!At(t.replace);let r=o?t.replace:t;if(o&&typeof t.count<"u"&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!o){r={...r};for(const i of n)delete r[i]}return r}static hasDefaultValue(t){const n="defaultValue";for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n===o.substring(0,n.length)&&t[o]!==void 0)return!0;return!1}}class yZ{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ml.create("languageUtils")}getScriptPartFromCode(t){if(t=CC(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=CC(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(At(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(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 n;return t.forEach(o=>{if(n)return;const r=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(o=>{if(n)return;const r=this.getScriptPartFromCode(o);if(this.isSupportedCode(r))return n=r;const i=this.getLanguagePartFromCode(o);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),At(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let o=t[n];return o||(o=t[this.getScriptPartFromCode(n)]),o||(o=t[this.formatLanguageCode(n)]),o||(o=t[this.getLanguagePartFromCode(n)]),o||(o=t.default),o||[]}toResolveHierarchy(t,n){const o=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),r=[],i=s=>{s&&(this.isSupportedCode(s)?r.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return At(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):At(t)&&i(this.formatLanguageCode(t)),o.forEach(s=>{r.indexOf(s)<0&&i(this.formatLanguageCode(s))}),r}}const AZ={zero:0,one:1,two:2,few:3,many:4,other:5},_Z={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Adt{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Ml.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const o=CC(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:o,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(o,{type:r})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),_Z;if(!t.match(/-|_/))return _Z;const c=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(c,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let o=this.getRule(t,n);return o||(o=this.getRule("dev",n)),o?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,o={}){return this.getSuffixes(t,o).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let o=this.getRule(t,n);return o||(o=this.getRule("dev",n)),o?o.resolvedOptions().pluralCategories.sort((r,i)=>AZ[r]-AZ[i]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,o={}){const r=this.getRule(t,o);return r?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,o))}}const vZ=(e,t,n,o=".",r=!0)=>{let i=cdt(e,t,n);return!i&&r&&At(n)&&(i=fF(e,n,o),i===void 0&&(i=fF(t,n,o))),i},E2=e=>e.replace(/\$/g,"$$$$");class SZ{constructor(t={}){this.logger=Ml.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:o,useRawValueToEscape:r,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:c,formatSeparator:p,unescapeSuffix:u,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:_}=t.interpolation;this.escape=n!==void 0?n:fdt,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=i?Oy(i):s||"{{",this.suffix=a?Oy(a):c||"}}",this.formatSeparator=p||",",this.unescapePrefix=u?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Oy(d):f||Oy("$t("),this.nestingSuffix=h?Oy(h):m||Oy(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,o)=>n?.source===o?(n.lastIndex=0,n):new RegExp(o,"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,n,o,r){let i,s,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=f=>{if(f.indexOf(this.formatSeparator)<0){const y=vZ(n,c,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,o,{...r,...n,interpolationkey:f}):y}const h=f.split(this.formatSeparator),m=h.shift().trim(),g=h.join(this.formatSeparator).trim();return this.format(vZ(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure),g,o,{...r,...n,interpolationkey:m})};this.resetRegExp();const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,l=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>E2(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?E2(this.escape(f)):E2(f)}].forEach(f=>{for(a=0;i=f.regex.exec(t);){const h=i[1].trim();if(s=p(h),s===void 0)if(typeof u=="function"){const g=u(t,i,r);s=At(g)?g:""}else if(r&&Object.prototype.hasOwnProperty.call(r,h))s="";else if(l){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${t}`),s="";else!At(s)&&!this.useRawValueToEscape&&(s=fZ(s));const m=f.safeValue(s);if(t=t.replace(i[0],m),l?(f.regex.lastIndex+=s.length,f.regex.lastIndex-=i[0].length):f.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n,o={}){let r,i,s;const a=(c,p)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const l=c.split(new RegExp(`${u}[ ]*{`));let d=`{${l[1]}`;c=l[0],d=this.interpolate(d,s);const f=d.match(/'/g),h=d.match(/"/g);((f?.length??0)%2===0&&!h||h.length%2!==0)&&(d=d.replace(/'/g,'"'));try{s=JSON.parse(d),p&&(s={...p,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${u}${d}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];s={...o},s=s.replace&&!At(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const p=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(p!==-1&&(c=r[1].slice(p).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),r[1]=r[1].slice(0,p)),i=n(a.call(this,r[1].trim(),s),s),i&&r[0]===t&&!At(i))return i;At(i)||(i=fZ(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),i=""),c.length&&(i=c.reduce((u,l)=>this.format(u,l,o.lng,{...o,interpolationkey:r[1].trim()}),i.trim())),t=t.replace(r[0],i),this.regexp.lastIndex=0}return t}}const _dt=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);t==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):t==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(s=>{if(s){const[a,...c]=s.split(":"),p=c.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=p),p==="false"&&(n[u]=!1),p==="true"&&(n[u]=!0),isNaN(p)||(n[u]=parseInt(p,10))}})}return{formatName:t,formatOptions:n}},CZ=e=>{const t={};return(n,o,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(CC(o),r),t[s]=a),a(n)}},vdt=e=>(t,n,o)=>e(CC(n),o)(t);class Sdt{constructor(t={}){this.logger=Ml.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const o=n.cacheInBuiltFormats?CZ:vdt;this.formats={number:o((r,i)=>{const s=new Intl.NumberFormat(r,{...i});return a=>s.format(a)}),currency:o((r,i)=>{const s=new Intl.NumberFormat(r,{...i,style:"currency"});return a=>s.format(a)}),datetime:o((r,i)=>{const s=new Intl.DateTimeFormat(r,{...i});return a=>s.format(a)}),relativetime:o((r,i)=>{const s=new Intl.RelativeTimeFormat(r,{...i});return a=>s.format(a,i.range||"day")}),list:o((r,i)=>{const s=new Intl.ListFormat(r,{...i});return a=>s.format(a)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=CZ(n)}format(t,n,o,r={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{const{formatName:p,formatOptions:u}=_dt(c);if(this.formats[p]){let l=a;try{const d=r?.formatParams?.[r.interpolationkey]||{},f=d.locale||d.lng||r.locale||r.lng||o;l=this.formats[p](a,f,{...u,...r,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${p}`);return a},t)}}const Cdt=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class wdt extends tI{constructor(t,n,o,r={}){super(),this.backend=t,this.store=n,this.services=o,this.languageUtils=o.languageUtils,this.options=r,this.logger=Ml.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(o,r.backend,r)}queueLoad(t,n,o,r){const i={},s={},a={},c={};return t.forEach(p=>{let u=!0;n.forEach(l=>{const d=`${p}|${l}`;!o.reload&&this.store.hasResourceBundle(p,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?s[d]===void 0&&(s[d]=!0):(this.state[d]=1,u=!1,s[d]===void 0&&(s[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),u||(a[p]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,o){const r=t.split("|"),i=r[0],s=r[1];n&&this.emit("failedLoading",i,s,n),!n&&o&&this.store.addResourceBundle(i,s,o,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&o&&(this.state[t]=0);const a={};this.queue.forEach(c=>{udt(c.loaded,[i],s),Cdt(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(p=>{a[p]||(a[p]={});const u=c.loaded[p];u.length&&u.forEach(l=>{a[p][l]===void 0&&(a[p][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,o,r=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:o,tried:r,wait:i,callback:s});return}this.readingCalls++;const a=(p,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(p&&u&&r{this.read.call(this,t,n,o,r+1,i*2,s)},i);return}s(p,u)},c=this.backend[o].bind(this.backend);if(c.length===2){try{const p=c(t,n);p&&typeof p.then=="function"?p.then(u=>a(null,u)).catch(a):a(null,p)}catch(p){a(p)}return}return c(t,n,a)}prepareLoading(t,n,o={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();At(t)&&(t=this.languageUtils.toResolveHierarchy(t)),At(n)&&(n=[n]);const i=this.queueLoad(t,n,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,o){this.prepareLoading(t,n,{},o)}reload(t,n,o){this.prepareLoading(t,n,{reload:!0},o)}loadOne(t,n=""){const o=t.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${r} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${r}`,a),this.loaded(t,s,a)})}saveMissing(t,n,o,r,i,s={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${o}" as the namespace "${n}" 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(!(o==null||o==="")){if(this.backend?.create){const c={...s,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let u;p.length===5?u=p(t,n,o,r,c):u=p(t,n,o,r),u&&typeof u.then=="function"?u.then(l=>a(null,l)).catch(a):a(null,u)}catch(u){a(u)}else p(t,n,o,r,a,c)}!t||!t[0]||this.store.addResource(t[0],n,o,r)}}}const M2=()=>({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]),At(e[1])&&(t.defaultValue=e[1]),At(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(o=>{t[o]=n[o]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),wZ=e=>(At(e.ns)&&(e.ns=[e.ns]),At(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),At(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),aR=()=>{},Odt=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class I0 extends tI{constructor(t={},n){if(super(),this.options=wZ(t),this.services={},this.logger=Ml,this.modules={external:[]},Odt(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(At(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const o=M2();this.options={...o,...this.options,...wZ(t)},this.options.interpolation={...o.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler);const r=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ml.init(r(this.modules.logger),this.options):Ml.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=Sdt;const u=new yZ(this.options);this.store=new gZ(this.options.resources,this.options);const l=this.services;l.logger=Ml,l.resourceStore=this.store,l.languageUtils=u,l.pluralResolver=new Adt(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("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===o.interpolation.format)&&(l.formatter=r(p),l.formatter.init&&l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new SZ(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new wdt(r(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.languageDetector&&(l.languageDetector=r(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=r(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new wM(this.services,this.options),this.translator.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=aR),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]=(...u)=>this.store[p](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...u)=>(this.store[p](...u),this)});const a=FS(),c=()=>{const p=(u,l)=>{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),a.resolve(l),n(u,l)};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?c():setTimeout(c,0),a}loadResources(t,n=aR){let o=n;const r=At(t)?t:this.language;if(typeof t=="function"&&(o=t),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(p=>{p!=="cimode"&&i.indexOf(p)<0&&i.push(p)})};r?s(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>s(c)),this.options.preload?.forEach?.(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(a)})}else o(null)}reloadResources(t,n,o){const r=FS();return typeof t=="function"&&(o=t,t=void 0),typeof n=="function"&&(o=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),o||(o=aR),this.services.backendConnector.reload(t,n,i=>{r.resolve(),o(i)}),r}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"&&Wpe.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 n=0;n-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const o=FS();this.emit("languageChanging",t);const r=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,o.resolve((...p)=>this.t(...p)),n&&n(a,(...p)=>this.t(...p))},s=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const c=At(a)?a:a&&a[0],p=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(At(a)?[a]:a);p&&(this.language||r(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,u=>{i(u,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),o}getFixedT(t,n,o){const r=(i,s,...a)=>{let c;typeof s!="object"?c=this.options.overloadTranslationOptionHandler([i,s].concat(a)):c={...s},c.lng=c.lng||r.lng,c.lngs=c.lngs||r.lngs,c.ns=c.ns||r.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||o||r.keyPrefix);const p=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(i)?u=i.map(l=>(typeof l=="function"&&(l=hF(l,{...this.options,...s})),`${c.keyPrefix}${p}${l}`)):(typeof i=="function"&&(i=hF(i,{...this.options,...s})),u=c.keyPrefix?`${c.keyPrefix}${p}${i}`:i),this.t(u,c)};return At(t)?r.lng=t:r.lngs=t,r.ns=n,r.keyPrefix=o,r}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){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 o=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const p=this.services.backendConnector.state[`${a}|${c}`];return p===-1||p===0||p===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(o,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(o,t)&&(!r||s(i,t)))}loadNamespaces(t,n){const o=FS();return this.options.ns?(At(t)&&(t=[t]),t.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{o.resolve(),n&&n(r)}),o):(n&&n(),Promise.resolve())}loadLanguages(t,n){const o=FS();At(t)&&(t=[t]);const r=this.options.preload||[],i=t.filter(s=>r.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=r.concat(i),this.loadResources(s=>{o.resolve(),n&&n(s)}),o):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const r=new Intl.Locale(t);if(r&&r.getTextInfo){const i=r.getTextInfo();if(i&&i.direction)return i.direction}}catch{}const n=["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"],o=this.services?.languageUtils||new yZ(M2());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(o.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const o=new I0(t,n);return o.createInstance=I0.createInstance,o}cloneInstance(t={},n=aR){const o=t.forkResourceStore;o&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},i=new I0(r);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},o){const a=Object.keys(this.store.data).reduce((c,p)=>(c[p]={...this.store.data[p]},c[p]=Object.keys(c[p]).reduce((u,l)=>(u[l]={...c[p][l]},u),c[p]),c),{});i.store=new gZ(a,r),i.services.resourceStore=i.store}if(t.interpolation){const c={...M2().interpolation,...this.options.interpolation,...t.interpolation},p={...r,interpolation:c};i.services.interpolator=new SZ(p)}return i.translator=new wM(i.services,r),i.translator.on("*",(a,...c)=>{i.emit(a,...c)}),i.init(r,n),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Oo=I0.createInstance();Oo.createInstance;Oo.dir;Oo.init;Oo.loadResources;Oo.reloadResources;Oo.use;Oo.changeLanguage;Oo.getFixedT;Oo.t;Oo.exists;Oo.setDefaultNamespace;Oo.hasLoadedNamespace;Oo.loadNamespaces;Oo.loadLanguages;const Tdt="وكيل الذكاء الاصطناعي",Rdt="إعدادات وكيل الذكاء الاصطناعي",Edt="الإعدادات",Mdt="قوموا بتوصيل نموذج ذكاء اصطناعي للبدء",Pdt=" لم يتم توصيل أي نموذج ذكاء اصطناعي بعد. قوموا بربط نموذج للبدء في التفاعل معه هنا مباشرة في الواجهة.",Idt="توصيل نموذج ذكاء اصطناعي",jdt="سجل المحادثة",Ddt="لا يوجد سجل محادثة بعد...",Ndt="اختاروا كيفية توصيل الذكاء الاصطناعي",Ldt=" حددوا كيف تريدون تمكين ميزات الذكاء الاصطناعي فيONLYOFFICE.",Fdt="يمكنكم إما استخدام محفظة (Wallet) مدمجة لبداية سريعة أو توصيل نموذج الذكاء الاصطناعي الخاص بكم باستخدام مفتاح API أو نموذج مستضاف محلياً.",xdt=" محفظةONLYOFFICE",Bdt=" قوموا بتعبئة رصيدكم ببطاقة واستخدموا جميع ميزات الذكاء الاصطناعي على الفور.",kdt="مزود الذكاء الاصطناعي الخاص بكم",Udt=" قوموا بتوصيل مصدر الذكاء الاصطناعي الخاص بكم — إما عبر مفتاحAPIمن مزود أو نموذج مستضاف محلياً.",qdt="التسجيل وتوصيل المحفظة",Jdt="إضافة مزود",Vdt="الاتصال",Hdt="خوادم MCP",Gdt="مزود الذكاء الاصطناعي",zdt="تحرير مزود الذكاء الاصطناعي",Kdt="المزود",Qdt="الاسم",$dt="عنوان URL",Wdt="أدخلوا الاسم",Ydt="أدخلوا عنوان URL",Xdt=" مفتاحAPI",Zdt=" أدخلوا مفتاحAPI",eft="إلغاء",tft="حفظ",nft="تحرير",rft="حذف",oft="تحذير",ift="هل أنتم متأكدون من أنكم تريدون حذف هذا المزود؟",sft="هل أنتم متأكدون من أنكم تريدون حذف هذه المحادثة؟",aft="نعم",lft="لا",uft="كيف يمكنني المساعدة؟",cft="دردشة ذكاء اصطناعي مجانية، ومساعد كتابة، ومولد أفكار",dft="إعادة تسمية",fft="تنزيل",hft="بحث...",pft="إضافة ملف محلي...",mft="إضافة صورة محلية...",gft="الملفات الحديثة",bft="المرفقات",yft="مفتاح API",Aft="محادثة جديدة",_ft="اسألوا الذكاء الاصطناعي",vft="جارٍ التحليل...",Sft="يرغب الذكاء الاصطناعي في استخدام هذه الأداة: ",Cft=`راجعوا كل إجراء بعناية قبل الموافقة +أو لا. لا يمكننا ضمان ممارسات الأمان أو الخصوصية لتكاملات الطرف الثالث.`,wft="السماح دائماً لهذه الأداة بتنفيذ هذا الإجراء دون السؤال مرة أخرى",Oft="رفض",Tft="سماح",Rft="وسيطات استدعاء الأداة",Eft="نتيجة استدعاء الأداة",Mft="تم تنفيذ الأداة",Pft="تأكيد",Ift="تحديد النموذج",jft=" يسمح لكم هذا القسم بتهيئة خوادمMCPللاستخدام داخل وكيل الذكاء الاصطناعي. يمكنكم تحرير التهيئة لإضافة خوادم MCP جديدة وتمكين الأدوات حسب الحاجة.",Dft="تحرير التهيئة",Nft=" أدخلوا تهيئةJSON الخاصة بكم:",Lft="الأدوات المتاحة",Fft="أدوات",xft="أدوات مفعلة",Bft="تمكين جميع الأدوات",kft="تعطيل جميع الأدوات",Uft="إعادة التشغيل",qft="السجلات",Jft="نسخ إلى الحافظة",Vft="إغلاق",Hft="بحث الويب",Gft="قوموا بتوصيل محرك بحث ويب لتحسين محادثات الذكاء الاصطناعي بمعلومات آنية من الإنترنت.",zft="إعادة تعيين الإعدادات",Kft="محرك بحث الويب",Qft="تحديد المحرك",$ft="جميع الأدوات",Wft="تمكين بحث الويب في الإعدادات",Yft="سيتم حذف هذا الخادم من قائمتكم. هل تودون المتابعة؟",Xft="المزود غير متاح",Zft="AI يمكن لدردشة الذكاء الاصطناعي أن ترتكب أخطاء. تحققوا من المعلومات المهمة.",eht=" يجب وضع التهيئة داخل ملكية'mcpServers'",tht="تفكير منطقي",nht="تفكير موسع",rht="يستخدم هذا النموذج تفكيراً منطقياً متقدماً، مما قد يزيد من التكاليف.",oht={AIAgent:Tdt,AIAgentSettings:Rdt,Settings:Edt,ConnectAIModel:Mdt,ConnectAIModelDescription:Pdt,ConnectAIModelBtn:Idt,ChatHistory:jdt,NoChatYet:Ddt,ChooseHowConnect:Ndt,SelectHowConnect:Ldt,SelectHowConnectDescription:Fdt,ONLYOFFICEWallet:xdt,ONLYOFFICEWalletDescription:Bdt,AIProviders:kdt,AIProvidersDescription:Udt,RegisterConnectWallet:qdt,AddProvider:Jdt,Connection:Vdt,MCPServers:Hdt,AIProvider:Gdt,EditAIProvider:zdt,Provider:Kdt,Name:Qdt,URL:$dt,EnterName:Wdt,EnterURL:Ydt,Key:Xdt,EnterKey:Zdt,Cancel:eft,Save:tft,Edit:nft,Delete:rft,Warning:oft,WantDeleteProvider:ift,WantDeleteChat:sft,Yes:aft,No:lft,WelcomeTitle:uft,WelcomeDescription:cft,Rename:dft,Download:fft,Search:hft,AddLocalFile:pft,AddLocalImage:mft,RecentFiles:gft,Attachments:bft,APIKey:yft,NewChat:Aft,AskAI:_ft,Analyzing:vft,AIWouldLikeUseThisTool:Sft,ReviewEachAction:Cft,AlwaysAllow:wft,Deny:Oft,Allow:Tft,ToolCallArguments:Rft,ToolCallResult:Eft,ToolExecuted:Mft,Confirmation:Pft,SelectModel:Ift,CustomServersDescription:jft,EditConfiguration:Dft,EnterYourJSONConfiguration:Nft,AvailableTools:Lft,Tools:Fft,ToolsEnabled:xft,EnableAllTools:Bft,DisableAllTools:kft,Restart:Uft,Logs:qft,CopyToClipboard:Jft,Close:Vft,WebSearch:Hft,WebSearchDescription:Gft,ResetSettings:zft,WebSearchEngine:Kft,SelectEngine:Qft,AllTools:$ft,EnableWebSearch:Wft,WantDeleteServer:Yft,NoModelsAvailable:Xft,CheckInfo:Zft,ConfigurationError:eht,Thinking:tht,ExtendedThinking:nht,ExtendedThinkingDescription:rht},iht="Agent AI",sht="Nastavení agenta AI",aht="Nastavení",lht="Připojte model AI a začněte",uht="Zatím není připojen žádný model AI. Propojte model a začněte s ním komunikovat přímo zde v rozhraní.",cht="Připojit model AI",dht="Historie chatu",fht="Zatím neexistuje žádná historie chatu...",hht="Vyberte způsob připojení AI",pht="Vyberte, jak chcete povolit funkce AI v ONLYOFFICE.",mht="Můžete buď použít vestavěnou peněženku pro rychlý start, nebo připojit svůj vlastní model AI pomocí klíče API nebo lokálně hostovaného modelu.",ght="Peněženka ONLYOFFICE",bht="Doplňte svůj zůstatek kartou a okamžitě používejte všechny funkce AI.",yht="Váš poskytovatel AI",Aht="Připojte svůj vlastní zdroj AI – buď pomocí API klíče od poskytovatele, nebo lokálně hostovaného modelu.",_ht="Registrovat a připojit peněženku",vht="Přidat poskytovatele",Sht="Připojení",Cht="Servery MCP",wht="Poskytovatel AI",Oht="Upravit poskytovatele AI",Tht="Poskytovatel",Rht="Název",Eht="URL",Mht="Zadat název",Pht="Zadat URL",Iht="API klíč",jht="Zadat API klíč",Dht="Zrušit",Nht="Uložit",Lht="Upravit",Fht="Odstranit",xht="Varování",Bht="Opravdu chcete odstranit tohoto poskytovatele?",kht="Opravdu chcete odstranit tento chat?",Uht="Ano",qht="Ne",Jht="Jak vám mohu pomoci?",Vht="Bezplatný Al chat, pomocník při psaní a generátor nápadů",Hht="Přejmenovat",Ght="Stáhnout",zht="Hledat...",Kht="Přidat místní soubor...",Qht="Přidat místní obrázek...",$ht="Poslední soubory",Wht="Přílohy",Yht="API klíč",Xht="Nový chat",Zht="Zeptejte se AI",ept="Probíhá analýza...",tpt="Al by ráda použila tento nástroj:",npt=`Před schválením pečlivě zkontrolujte každou akci. + Nemůžeme zaručit bezpečnost ani ochranu soukromí u integrací třetích stran.`,rpt="Vždy povolit tomuto nástroji provést tuto akci bez dalšího dotazu",opt="Odmítnout",ipt="Povolit",spt="Argumenty volání nástroje",apt="Výsledek volání nástroje",lpt="Nástroj proveden",upt="Potvrzení",cpt="Vybrat model",dpt="V této části můžete nakonfigurovat servery MCP pro použití v rámci AI agenta. Konfiguraci můžete upravit tak, abyste přidali nové servery MCP a podle potřeby povolili nástroje.",fpt="Upravit konfiguraci",hpt="Zadejte svou konfiguraci JSON:",ppt="Dostupné nástroje",mpt="nástroje",gpt="povolené nástroje",bpt="Povolit všechny nástroje",ypt="Zakázat všechny nástroje",Apt="Restartovat",_pt="Protokoly",vpt="Kopírovat do schránky",Spt="Zavřít",Cpt="Webové vyhledávání",wpt="Připojte webový vyhledávač a vylepšete AI chaty pomocí informací z internetu v reálném čase.",Opt="Obnovit nastavení",Tpt="Webový vyhledávač",Rpt="Vybrat vyhledávač",Ept="Všechny nástroje",Mpt="Povolit webové vyhledávání v nastavení",Ppt="Tento server bude odstraněn z vašeho seznamu. Pokračovat?",Ipt="Poskytovatel není k dispozici",jpt="AI chat může dělat chyby. Zkontrolujte důležité informace.",Dpt="Konfigurace musí být umístěna uvnitř vlastnosti 'mcpServers'",Npt="Uvažování",Lpt="Rozšířené myšlení",Fpt="Tento model používá pokročilé uvažování, což může zvýšit náklady.",xpt={AIAgent:iht,AIAgentSettings:sht,Settings:aht,ConnectAIModel:lht,ConnectAIModelDescription:uht,ConnectAIModelBtn:cht,ChatHistory:dht,NoChatYet:fht,ChooseHowConnect:hht,SelectHowConnect:pht,SelectHowConnectDescription:mht,ONLYOFFICEWallet:ght,ONLYOFFICEWalletDescription:bht,AIProviders:yht,AIProvidersDescription:Aht,RegisterConnectWallet:_ht,AddProvider:vht,Connection:Sht,MCPServers:Cht,AIProvider:wht,EditAIProvider:Oht,Provider:Tht,Name:Rht,URL:Eht,EnterName:Mht,EnterURL:Pht,Key:Iht,EnterKey:jht,Cancel:Dht,Save:Nht,Edit:Lht,Delete:Fht,Warning:xht,WantDeleteProvider:Bht,WantDeleteChat:kht,Yes:Uht,No:qht,WelcomeTitle:Jht,WelcomeDescription:Vht,Rename:Hht,Download:Ght,Search:zht,AddLocalFile:Kht,AddLocalImage:Qht,RecentFiles:$ht,Attachments:Wht,APIKey:Yht,NewChat:Xht,AskAI:Zht,Analyzing:ept,AIWouldLikeUseThisTool:tpt,ReviewEachAction:npt,AlwaysAllow:rpt,Deny:opt,Allow:ipt,ToolCallArguments:spt,ToolCallResult:apt,ToolExecuted:lpt,Confirmation:upt,SelectModel:cpt,CustomServersDescription:dpt,EditConfiguration:fpt,EnterYourJSONConfiguration:hpt,AvailableTools:ppt,Tools:mpt,ToolsEnabled:gpt,EnableAllTools:bpt,DisableAllTools:ypt,Restart:Apt,Logs:_pt,CopyToClipboard:vpt,Close:Spt,WebSearch:Cpt,WebSearchDescription:wpt,ResetSettings:Opt,WebSearchEngine:Tpt,SelectEngine:Rpt,AllTools:Ept,EnableWebSearch:Mpt,WantDeleteServer:Ppt,NoModelsAvailable:Ipt,CheckInfo:jpt,ConfigurationError:Dpt,Thinking:Npt,ExtendedThinking:Lpt,ExtendedThinkingDescription:Fpt},Bpt="KI-Agent",kpt="Einstellungen des KI-Agenten",Upt="Einstellungen",qpt="Verbinden Sie ein KI-Modell, um loszulegen",Jpt="Es ist noch kein KI-Modell verbunden. Verbinden Sie ein Modell, um direkt hier in der Benutzeroberfläche damit zu interagieren.",Vpt="KI-Modell verbinden",Hpt="Chatverlauf",Gpt="Es gibt noch keinen Chatverlauf...",zpt="Wählen Sie aus, wie Sie die KI verbinden möchten",Kpt="Wählen Sie aus, wie Sie die KI-Funktionen in ONLYOFFICE aktivieren möchten.",Qpt="Sie können entweder die integrierte Wallet für einen schnellen Einstieg nutzen oder Ihr eigenes KI-Modell mithilfe eines API-Schlüssels oder eines lokal gehosteten Modells verbinden.",$pt="ONLYOFFICE Wallet",Wpt="Laden Sie Ihr Guthaben mit einer Karte auf und nutzen Sie sofort alle KI-Funktionen.",Ypt="Ihr KI-Anbieter",Xpt="Verbinden Sie Ihre eigene KI-Quelle – entweder über einen API-Schlüssel eines Anbieters oder über ein lokal gehostetes Modell.",Zpt="Registrieren und Wallet verbinden",emt="Anbieter hinzufügen",tmt="Verbindung",nmt="MCP-Server",rmt="KI-Anbieter",omt="KI-Anbieter bearbeiten",imt="Anbieter",smt="Name",amt="URL",lmt="Name eingeben",umt="URL eingeben",cmt="API-Schlüssel",dmt="API-Schlüssel eingeben",fmt="Abbrechen",hmt="Speichern",pmt="Bearbeiten",mmt="Löschen",gmt="Warnung",bmt="Möchten Sie diesen Anbieter wirklich löschen?",ymt="Möchten Sie diesen Chat wirklich löschen?",Amt="Ja",_mt="Nein",vmt="Wie kann ich helfen?",Smt="Kostenloser KI-Chat, Schreibassistent und Ideengenerator",Cmt="Umbenennen",wmt="Herunterladen",Omt="Suchen...",Tmt="Lokale Datei hinzufügen...",Rmt="Lokales Image hinzufügen...",Emt="Zuletzt verwendete Dateien",Mmt="Anlagen",Pmt="API-Schlüssel",Imt="Neuer Chat",jmt="KI fragen",Dmt="Analyse läuft...",Nmt="KI möchte dieses Tool verwenden:",Lmt=`Prüfen Sie jede Aktion sorgfältig, bevor Sie sie genehmigen. + Wir können die Sicherheit und den Datenschutz bei Integrationen von Drittanbietern nicht garantieren.`,Fmt="Diesem Tool immer erlauben, diese Aktion ohne erneute Nachfrage auszuführen.",xmt="Ablehnen",Bmt="Erlauben",kmt="Argumente des Toolaufrufs",Umt="Ergebnis des Toolaufrufs",qmt="Tool ausgeführt",Jmt="Bestätigung",Vmt="Modell auswählen",Hmt=" In diesem Abschnitt können Sie MCP-Server für die Verwendung im KI-Agenten konfigurieren. Sie können die Konfiguration bearbeiten, um neue MCP-Server hinzuzufügen und bei Bedarf Tools zu aktivieren.",Gmt="Konfiguration bearbeiten",zmt="Geben Sie Ihre JSON-Konfiguration ein:",Kmt="Verfügbare Tools",Qmt="Tools",$mt="Tools aktiviert",Wmt="Alle Tools aktivieren",Ymt="Alle Tools deaktivieren",Xmt="Neustart",Zmt="Protokolle",egt="In die Zwischenablage kopieren",tgt="Schließen",ngt="Websuche",rgt="Verbinden Sie eine Websuchmaschine, um KI-Chats mit Echtzeitinformationen aus dem Internet zu verbessern.",ogt="Einstellungen zurücksetzen",igt="Web-Suchmaschine",sgt="Engine auswählen",agt="Alle Tools",lgt="Aktivieren Sie die Websuche in den Einstellungen",ugt="Dieser Server wird aus Ihrer Liste gelöscht. Weiter?",cgt="Anbieter nicht verfügbar",dgt="KI-Chat kann Fehler machen. Überprüfen Sie wichtige Informationen.",fgt="Die Konfiguration muss in der Eigenschaft 'mcpServers' platziert werden",hgt="Schlussfolgerung",pgt="Erweitertes Denken",mgt="Dieses Modell verwendet fortgeschrittene Schlussfolgerungen, was die Kosten erhöhen kann.",ggt={AIAgent:Bpt,AIAgentSettings:kpt,Settings:Upt,ConnectAIModel:qpt,ConnectAIModelDescription:Jpt,ConnectAIModelBtn:Vpt,ChatHistory:Hpt,NoChatYet:Gpt,ChooseHowConnect:zpt,SelectHowConnect:Kpt,SelectHowConnectDescription:Qpt,ONLYOFFICEWallet:$pt,ONLYOFFICEWalletDescription:Wpt,AIProviders:Ypt,AIProvidersDescription:Xpt,RegisterConnectWallet:Zpt,AddProvider:emt,Connection:tmt,MCPServers:nmt,AIProvider:rmt,EditAIProvider:omt,Provider:imt,Name:smt,URL:amt,EnterName:lmt,EnterURL:umt,Key:cmt,EnterKey:dmt,Cancel:fmt,Save:hmt,Edit:pmt,Delete:mmt,Warning:gmt,WantDeleteProvider:bmt,WantDeleteChat:ymt,Yes:Amt,No:_mt,WelcomeTitle:vmt,WelcomeDescription:Smt,Rename:Cmt,Download:wmt,Search:Omt,AddLocalFile:Tmt,AddLocalImage:Rmt,RecentFiles:Emt,Attachments:Mmt,APIKey:Pmt,NewChat:Imt,AskAI:jmt,Analyzing:Dmt,AIWouldLikeUseThisTool:Nmt,ReviewEachAction:Lmt,AlwaysAllow:Fmt,Deny:xmt,Allow:Bmt,ToolCallArguments:kmt,ToolCallResult:Umt,ToolExecuted:qmt,Confirmation:Jmt,SelectModel:Vmt,CustomServersDescription:Hmt,EditConfiguration:Gmt,EnterYourJSONConfiguration:zmt,AvailableTools:Kmt,Tools:Qmt,ToolsEnabled:$mt,EnableAllTools:Wmt,DisableAllTools:Ymt,Restart:Xmt,Logs:Zmt,CopyToClipboard:egt,Close:tgt,WebSearch:ngt,WebSearchDescription:rgt,ResetSettings:ogt,WebSearchEngine:igt,SelectEngine:sgt,AllTools:agt,EnableWebSearch:lgt,WantDeleteServer:ugt,NoModelsAvailable:cgt,CheckInfo:dgt,ConfigurationError:fgt,Thinking:hgt,ExtendedThinking:pgt,ExtendedThinkingDescription:mgt},bgt="AI agent",ygt="AI agent Settings",Agt="Settings",_gt="Connect an AI Model to Get Started",vgt="No AI model is connected yet. Link a model to start interacting with it right here in the interface.",Sgt="Connect an AI Model",Cgt="Chat history",wgt="There is no chat history yet...",Ogt="Choose how to connect AI",Tgt="Select how you want to enable AI features in ONLYOFFICE.",Rgt="You can either use the built-in Wallet for a quick start or connect your own AI model using an API key or a locally hosted model.",Egt="ONLYOFFICE Wallet",Mgt="Top up your balance with a card and instantly use all AI features.",Pgt="Your AI provider",Igt="Connect your own AI source — either via API key from a provider or a locally hosted model.",jgt="Register & Connect Wallet",Dgt="Add provider",Ngt="Connection",Lgt="MCP Servers",Fgt="AI Provider",xgt="Edit AI Provider",Bgt="Provider",kgt="Name",Ugt="URL",qgt="Enter name",Jgt="Enter URL",Vgt="API key",Hgt="Enter API key",Ggt="Cancel",zgt="Save",Kgt="Edit",Qgt="Delete",$gt="Warning",Wgt="Are you sure you want to delete this provider?",Ygt="Are you sure you want to delete this chat?",Xgt="Yes",Zgt="No",ebt="How can I help?",tbt="Free Al chat, writing assistant & idea generator",nbt="Rename",rbt="Download",obt="Search...",ibt="Add local file...",sbt="Add local image...",abt="Recent files",lbt="Attachments",ubt="API key",cbt="New chat",dbt="Ask AI",fbt="Analyzing...",hbt="Al would like to use this tool:",pbt=`Review each action carefully before approving. + We cannot guarantee the security or privacy practices of third-party integrations.`,mbt="Always allow this tool to perform this action without asking again",gbt="Deny",bbt="Allow",ybt="Tool call arguments",Abt="Tool call result",_bt="Tool executed",vbt="Confirmation",Sbt="Select model",Cbt="This section allows you to configure MCP servers for use within the AI agent. You can edit the configuration to add new MCP servers and enable tools as needed.",wbt="Edit configuration",Obt="Enter your JSON configuration:",Tbt="Available tools",Rbt="tools",Ebt="tools enabled",Mbt="Enable all tools",Pbt="Disable all tools",Ibt="Restart",jbt="Logs",Dbt="Copy to clipboard",Nbt="Close",Lbt="Web Search",Fbt="Connect a web search engine to enhance AI chats with real-time information from the internet.",xbt="Reset settings",Bbt="Web Search Engine",kbt="Select engine",Ubt="All tools",qbt="Enable web search in settings",Jbt="This server will be deleted from your list. Continue?",Vbt="Provider not available",Hbt="AI Chat can make mistakes. Check important info.",Gbt="Configuration must be placed inside 'mcpServers' property",zbt="Reasoning",Kbt="Extended Thinking",Qbt="This model uses advanced reasoning, which may increase costs.",$bt={AIAgent:bgt,AIAgentSettings:ygt,Settings:Agt,ConnectAIModel:_gt,ConnectAIModelDescription:vgt,ConnectAIModelBtn:Sgt,ChatHistory:Cgt,NoChatYet:wgt,ChooseHowConnect:Ogt,SelectHowConnect:Tgt,SelectHowConnectDescription:Rgt,ONLYOFFICEWallet:Egt,ONLYOFFICEWalletDescription:Mgt,AIProviders:Pgt,AIProvidersDescription:Igt,RegisterConnectWallet:jgt,AddProvider:Dgt,Connection:Ngt,MCPServers:Lgt,AIProvider:Fgt,EditAIProvider:xgt,Provider:Bgt,Name:kgt,URL:Ugt,EnterName:qgt,EnterURL:Jgt,Key:Vgt,EnterKey:Hgt,Cancel:Ggt,Save:zgt,Edit:Kgt,Delete:Qgt,Warning:$gt,WantDeleteProvider:Wgt,WantDeleteChat:Ygt,Yes:Xgt,No:Zgt,WelcomeTitle:ebt,WelcomeDescription:tbt,Rename:nbt,Download:rbt,Search:obt,AddLocalFile:ibt,AddLocalImage:sbt,RecentFiles:abt,Attachments:lbt,APIKey:ubt,NewChat:cbt,AskAI:dbt,Analyzing:fbt,AIWouldLikeUseThisTool:hbt,ReviewEachAction:pbt,AlwaysAllow:mbt,Deny:gbt,Allow:bbt,ToolCallArguments:ybt,ToolCallResult:Abt,ToolExecuted:_bt,Confirmation:vbt,SelectModel:Sbt,CustomServersDescription:Cbt,EditConfiguration:wbt,EnterYourJSONConfiguration:Obt,AvailableTools:Tbt,Tools:Rbt,ToolsEnabled:Ebt,EnableAllTools:Mbt,DisableAllTools:Pbt,Restart:Ibt,Logs:jbt,CopyToClipboard:Dbt,Close:Nbt,WebSearch:Lbt,WebSearchDescription:Fbt,ResetSettings:xbt,WebSearchEngine:Bbt,SelectEngine:kbt,AllTools:Ubt,EnableWebSearch:qbt,WantDeleteServer:Jbt,NoModelsAvailable:Vbt,CheckInfo:Hbt,ConfigurationError:Gbt,Thinking:zbt,ExtendedThinking:Kbt,ExtendedThinkingDescription:Qbt},Wbt="Agente de IA",Ybt="Configuración del agente de IA",Xbt="Configuración",Zbt="Conecte un modelo de IA para empezar",eyt="Aún no hay ningún modelo de IA conectado. Conecte un modelo para empezar a interactuar con él aquí mismo, en la interfaz.",tyt="Conectar un modelo de IA",nyt="Historial del chat",ryt="Todavía no hay historial de chat...",oyt="Elija cómo conectar la IA",iyt="Seleccione cómo desea activar las funciones de IA en ONLYOFFICE.",syt="Puedes utilizar el Monedero incorporado para empezar rápidamente o conectar tu propio modelo de IA utilizando una clave de la API o un modelo alojado localmente.",ayt="Monedero de ONLYOFFICE",lyt="Recargue su saldo con una tarjeta y utilice al instante todas las funciones de IA.",uyt="Su proveedor de IA",cyt="Conecte su propia fuente de IA, ya sea mediante una clave de la API de un proveedor o un modelo alojado localmente.",dyt="Regístrese y conecte su monedero",fyt="Añadir proveedor",hyt="Conexión",pyt="Servidores MCP",myt="Proveedor de IA",gyt="Editar proveedor de IA",byt="Proveedor",yyt="Nombre",Ayt="URL",_yt="Introduzca el nombre",vyt="Introduzca la URL",Syt="Clave de la API",Cyt="Introduzca la clave de la API",wyt="Cancelar",Oyt="Guardar",Tyt="Editar",Ryt="Eliminar",Eyt="Advertencia",Myt="¿Está seguro de que desea eliminar este proveedor?",Pyt="¿Está seguro de que desea eliminar este chat?",Iyt="Sí",jyt="No",Dyt="¿En qué puedo ayudarle?",Nyt="Chat gratuito, asistente de escritura y generador de ideas",Lyt="Renombrar",Fyt="Descargar",xyt="Búsqueda...",Byt="Añadir archivo local...",kyt="Añadir imagen local...",Uyt="Archivos recientes",qyt="Archivos adjuntos",Jyt="Clave de la API",Vyt="Nuevo chat",Hyt="Preguntarle a la IA",Gyt="Analizando...",zyt="A la IA le gustaría utilizar esta herramienta:",Kyt=`Revise cada acción cuidadosamente antes de aprobarla. + No podemos garantizar la seguridad o las prácticas de privacidad de las integraciones de terceros.`,Qyt="Siempre permitir que esta herramienta realice esta acción sin preguntar de nuevo",$yt="Denegar",Wyt="Permitir",Yyt="Argumentos de la llamada a la herramienta",Xyt="Resultado de la llamada a la herramienta",Zyt="Herramienta ejecutada",eAt="Confirmación",tAt="Seleccionar modelo",nAt="Esta sección le permite configurar servidores MCP para su uso en el agente de IA. Puede editar la configuración para añadir nuevos servidores MCP y habilitar herramientas según sea necesario.",rAt="Editar configuración",oAt="Introduzca su configuración JSON:",iAt="Herramientas disponibles",sAt="herramientas",aAt="herramientas habilitadas",lAt="Habilitar todas las herramientas",uAt="Deshabilitar todas las herramientas",cAt="Reiniciar",dAt="Registros",fAt="Copiar al portapapeles",hAt="Cerrar",pAt="Búsqueda en la Web",mAt="Conecte un motor de búsqueda web para mejorar los chats de IA con información en tiempo real procedente de Internet.",gAt="Restablecer configuración",bAt="Motor de búsqueda web",yAt="Seleccionar motor",AAt="Todas las herramientas",_At="Habilite la búsqueda web en la configuración",vAt="Este servidor se eliminará de su lista. ¿Continuar?",SAt="Proveedor no disponible",CAt="El Chat de IA puede cometer errores. Compruebe la información importante.",wAt="La configuración debe colocarse dentro de la propiedad «mcpServers»",OAt="Razonamiento",TAt="Pensamiento extendido",RAt="Este modelo utiliza un razonamiento avanzado, lo que puede aumentar los costes.",EAt={AIAgent:Wbt,AIAgentSettings:Ybt,Settings:Xbt,ConnectAIModel:Zbt,ConnectAIModelDescription:eyt,ConnectAIModelBtn:tyt,ChatHistory:nyt,NoChatYet:ryt,ChooseHowConnect:oyt,SelectHowConnect:iyt,SelectHowConnectDescription:syt,ONLYOFFICEWallet:ayt,ONLYOFFICEWalletDescription:lyt,AIProviders:uyt,AIProvidersDescription:cyt,RegisterConnectWallet:dyt,AddProvider:fyt,Connection:hyt,MCPServers:pyt,AIProvider:myt,EditAIProvider:gyt,Provider:byt,Name:yyt,URL:Ayt,EnterName:_yt,EnterURL:vyt,Key:Syt,EnterKey:Cyt,Cancel:wyt,Save:Oyt,Edit:Tyt,Delete:Ryt,Warning:Eyt,WantDeleteProvider:Myt,WantDeleteChat:Pyt,Yes:Iyt,No:jyt,WelcomeTitle:Dyt,WelcomeDescription:Nyt,Rename:Lyt,Download:Fyt,Search:xyt,AddLocalFile:Byt,AddLocalImage:kyt,RecentFiles:Uyt,Attachments:qyt,APIKey:Jyt,NewChat:Vyt,AskAI:Hyt,Analyzing:Gyt,AIWouldLikeUseThisTool:zyt,ReviewEachAction:Kyt,AlwaysAllow:Qyt,Deny:$yt,Allow:Wyt,ToolCallArguments:Yyt,ToolCallResult:Xyt,ToolExecuted:Zyt,Confirmation:eAt,SelectModel:tAt,CustomServersDescription:nAt,EditConfiguration:rAt,EnterYourJSONConfiguration:oAt,AvailableTools:iAt,Tools:sAt,ToolsEnabled:aAt,EnableAllTools:lAt,DisableAllTools:uAt,Restart:cAt,Logs:dAt,CopyToClipboard:fAt,Close:hAt,WebSearch:pAt,WebSearchDescription:mAt,ResetSettings:gAt,WebSearchEngine:bAt,SelectEngine:yAt,AllTools:AAt,EnableWebSearch:_At,WantDeleteServer:vAt,NoModelsAvailable:SAt,CheckInfo:CAt,ConfigurationError:wAt,Thinking:OAt,ExtendedThinking:TAt,ExtendedThinkingDescription:RAt},MAt="Agent IA",PAt="Paramètres de l'agent IA",IAt="Paramètres",jAt="Connectez un modèle d'IA pour commencer",DAt="Aucun modèle d'IA n'est encore connecté. Associez un modèle pour commencer à interagir avec lui directement dans l'interface.",NAt="Connecter un modèle d'IA",LAt="Historique de chat",FAt="Il n'y a pas encore d'historique de chat...",xAt="Choisissez comment connecter l'IA",BAt="Sélectionnez comment vous souhaitez activer les fonctionnalités IA dans ONLYOFFICE.",kAt="Vous pouvez soit utiliser le Wallet intégré pour démarrer rapidement, soit connecter votre propre modèle d'IA à l'aide d'une clé API ou d'un modèle hébergé localement.",UAt="Wallet ONLYOFFICE",qAt="Rechargez votre solde avec une carte et utilisez instantanément toutes les fonctionnalités de l'IA.",JAt="Votre fournisseur d'IA",VAt="Connectez votre propre source d'IA, soit via une clé API fournie par un fournisseur, soit via un modèle hébergé localement.",HAt="Enregistrez et connectez votre Wallet",GAt="Ajouter un fournisseur",zAt="Connexion",KAt="Serveurs MCP",QAt="Fournisseur d'IA",$At="Modifier le fournisseur d'IA",WAt="Fournisseur",YAt="Nom",XAt="URL",ZAt="Saisissez le nom",e_t="Saisissez l'URL",t_t="Clé API",n_t="Saisissez la clé API",r_t="Annuler",o_t="Enregistrer",i_t="Modifier",s_t="Supprimer",a_t="Avertissement",l_t="Souhaitez-vous vraiment supprimer ce fournisseur ?",u_t="Souhaitez-vous vraiment supprimer ce chat ?",c_t="Oui",d_t="Non",f_t="Comment puis-je vous aider ?",h_t="Chat Al gratuit, assistant de rédaction et générateur d'idées",p_t="Renommer",m_t="Télécharger",g_t="Recherche...",b_t="Ajouter un fichier local...",y_t="Ajouter une image locale...",A_t="Fichiers récents",__t="Pièces jointes",v_t="Clé API",S_t="Nouveau chat",C_t="Demander à l'IA",w_t="Analyse en cours...",O_t="lA aimerait utiliser cet outil :",T_t=`Examinez attentivement chaque action avant de l'approuver. + Nous ne pouvons garantir la sécurité ou les pratiques de confidentialité des intégrations tierces.`,R_t="Toujours autoriser cet outil à effectuer cette action sans demander à nouveau",E_t="Refuser",M_t="Autoriser",P_t="Arguments d'appel d'outil",I_t="Résultat de l'appel de l'outil",j_t="Outil exécuté",D_t="Confirmation",N_t="Sélectionner le modèle",L_t=" Cette section vous permet de configurer les serveurs MCP à utiliser dans l'agent IA. Vous pouvez modifier la configuration pour ajouter de nouveaux serveurs MCP et activer les outils selon vos besoins.",F_t="Modifier la configuration",x_t="Entrez votre configuration JSON :",B_t="Outils disponibles",k_t="outils",U_t="outils activés",q_t="Activer tous les outils",J_t="Désactiver tous les outils",V_t="Redémarrer",H_t="Logs",G_t="Copier dans le presse-papiers",z_t="Fermer",K_t="Recherche sur le Web",Q_t="Connectez un moteur de recherche Web pour améliorer les conversations IA grâce à des informations en temps réel provenant d'Internet.",$_t="Réinitialiser les paramètres",W_t="Moteur de recherche Web",Y_t="Sélectionner le moteur",X_t="Tous les outils",Z_t="Activer la recherche Web dans les paramètres",evt="Ce serveur sera supprimé de votre liste. Continuer ?",tvt="Fournisseur indisponible",nvt="Le chatbot IA peut faire des erreurs. Vérifiez les informations importantes.",rvt="La configuration doit être placée dans la propriété « mcpServers »",ovt="Raisonnement",ivt="Raisonnement étendu",svt="Ce modèle utilise un raisonnement avancé, ce qui peut augmenter les coûts.",avt={AIAgent:MAt,AIAgentSettings:PAt,Settings:IAt,ConnectAIModel:jAt,ConnectAIModelDescription:DAt,ConnectAIModelBtn:NAt,ChatHistory:LAt,NoChatYet:FAt,ChooseHowConnect:xAt,SelectHowConnect:BAt,SelectHowConnectDescription:kAt,ONLYOFFICEWallet:UAt,ONLYOFFICEWalletDescription:qAt,AIProviders:JAt,AIProvidersDescription:VAt,RegisterConnectWallet:HAt,AddProvider:GAt,Connection:zAt,MCPServers:KAt,AIProvider:QAt,EditAIProvider:$At,Provider:WAt,Name:YAt,URL:XAt,EnterName:ZAt,EnterURL:e_t,Key:t_t,EnterKey:n_t,Cancel:r_t,Save:o_t,Edit:i_t,Delete:s_t,Warning:a_t,WantDeleteProvider:l_t,WantDeleteChat:u_t,Yes:c_t,No:d_t,WelcomeTitle:f_t,WelcomeDescription:h_t,Rename:p_t,Download:m_t,Search:g_t,AddLocalFile:b_t,AddLocalImage:y_t,RecentFiles:A_t,Attachments:__t,APIKey:v_t,NewChat:S_t,AskAI:C_t,Analyzing:w_t,AIWouldLikeUseThisTool:O_t,ReviewEachAction:T_t,AlwaysAllow:R_t,Deny:E_t,Allow:M_t,ToolCallArguments:P_t,ToolCallResult:I_t,ToolExecuted:j_t,Confirmation:D_t,SelectModel:N_t,CustomServersDescription:L_t,EditConfiguration:F_t,EnterYourJSONConfiguration:x_t,AvailableTools:B_t,Tools:k_t,ToolsEnabled:U_t,EnableAllTools:q_t,DisableAllTools:J_t,Restart:V_t,Logs:H_t,CopyToClipboard:G_t,Close:z_t,WebSearch:K_t,WebSearchDescription:Q_t,ResetSettings:$_t,WebSearchEngine:W_t,SelectEngine:Y_t,AllTools:X_t,EnableWebSearch:Z_t,WantDeleteServer:evt,NoModelsAvailable:tvt,CheckInfo:nvt,ConfigurationError:rvt,Thinking:ovt,ExtendedThinking:ivt,ExtendedThinkingDescription:svt},lvt="Agente AI",uvt="Impostazioni agente AI",cvt="Impostazioni",dvt="Collega un modello AI per iniziare",fvt="Nessun modello AI è stato collegato. Collega un modello per iniziare a interagire direttamente da questa interfaccia.",hvt="Collega un modello AI",pvt="Cronologia chat",mvt="Non c'è ancora alcuna cronologia chat...",gvt="Scegli come collegare l'AI",bvt="Scegli come desideri abilitare le funzionalità AI in ONLYOFFICE.",yvt="Puoi usare il Wallet integrato per iniziare subito oppure collegare il tuo modello AI tramite una chiave API o un modello ospitato localmente.",Avt="Wallet ONLYOFFICE",_vt="Ricarica il saldo con una carta e usa subito tutte le funzioni AI.",vvt="Il tuo provider AI",Svt="Collega la tua fonte AI tramite chiave API di un provider o modello ospitato localmente.",Cvt="Registrati e collega il Wallet",wvt="Aggiungi provider",Ovt="Connessione",Tvt="Server MCP",Rvt="Provider AI",Evt="Modifica provider AI",Mvt="Provider",Pvt="Nome",Ivt="URL",jvt="Inserisci nome",Dvt="Inserisci URL",Nvt="Chiave API",Lvt="Inserisci chiave API",Fvt="Annulla",xvt="Salva",Bvt="Modifica",kvt="Elimina",Uvt="Avviso",qvt="Vuoi davvero eliminare questo provider?",Jvt="Vuoi davvero eliminare questa chat?",Vvt="Sì",Hvt="No",Gvt="Come posso aiutarti?",zvt="Chat AI gratuita, assistente di scrittura e generatore di idee",Kvt="Rinomina",Qvt="Scarica",$vt="Cerca...",Wvt="Aggiungi file locale...",Yvt="Aggiungi immagine locale...",Xvt="File recenti",Zvt="Allegati",eSt="Chiave API",tSt="Nuova chat",nSt="Chiedi all'AI",rSt="Analisi in corso...",oSt="L'AI vorrebbe usare questo strumento:",iSt=`Controlla attentamente ogni azione prima di approvarla. + Non possiamo garantire la sicurezza o le pratiche sulla privacy delle integrazioni di terze parti.`,sSt="Consenti sempre a questo strumento di eseguire questa azione senza chiedere di nuovo",aSt="Nega",lSt="Consenti",uSt="Argomenti della chiamata dello strumento",cSt="Risultato della chiamata dello strumento",dSt="Strumento eseguito",fSt="Conferma",hSt="Seleziona modello",pSt="Questa sezione consente di configurare i server MCP da usare con l'agente AI. Puoi modificare la configurazione per aggiungere nuovi server MCP e abilitare gli strumenti necessari.",mSt="Modifica configurazione",gSt="Inserisci la tua configurazione JSON:",bSt="Strumenti disponibili",ySt="strumenti",ASt="strumenti abilitati",_St="Abilita tutti gli strumenti",vSt="Disabilita tutti gli strumenti",SSt="Riavvia",CSt="Log",wSt="Copia negli appunti",OSt="Chiudi",TSt="Ricerca web",RSt="Collega un motore di ricerca web per arricchire le chat AI con informazioni aggiornate da Internet.",ESt="Reimposta impostazioni",MSt="Motore di ricerca web",PSt="Seleziona motore",ISt="Tutti gli strumenti",jSt="Abilita la ricerca web nelle impostazioni",DSt="Questo server verrà rimosso dall'elenco. Continuare?",NSt="Provider non disponibile",LSt="L'AI può commettere errori. Verifica le informazioni importanti.",FSt="La configurazione deve essere inserita all'interno della proprietà 'mcpServers'",xSt="Ragionamento",BSt="Ragionamento esteso",kSt="Questo modello utilizza un ragionamento avanzato che potrebbe aumentare i costi.",USt={AIAgent:lvt,AIAgentSettings:uvt,Settings:cvt,ConnectAIModel:dvt,ConnectAIModelDescription:fvt,ConnectAIModelBtn:hvt,ChatHistory:pvt,NoChatYet:mvt,ChooseHowConnect:gvt,SelectHowConnect:bvt,SelectHowConnectDescription:yvt,ONLYOFFICEWallet:Avt,ONLYOFFICEWalletDescription:_vt,AIProviders:vvt,AIProvidersDescription:Svt,RegisterConnectWallet:Cvt,AddProvider:wvt,Connection:Ovt,MCPServers:Tvt,AIProvider:Rvt,EditAIProvider:Evt,Provider:Mvt,Name:Pvt,URL:Ivt,EnterName:jvt,EnterURL:Dvt,Key:Nvt,EnterKey:Lvt,Cancel:Fvt,Save:xvt,Edit:Bvt,Delete:kvt,Warning:Uvt,WantDeleteProvider:qvt,WantDeleteChat:Jvt,Yes:Vvt,No:Hvt,WelcomeTitle:Gvt,WelcomeDescription:zvt,Rename:Kvt,Download:Qvt,Search:$vt,AddLocalFile:Wvt,AddLocalImage:Yvt,RecentFiles:Xvt,Attachments:Zvt,APIKey:eSt,NewChat:tSt,AskAI:nSt,Analyzing:rSt,AIWouldLikeUseThisTool:oSt,ReviewEachAction:iSt,AlwaysAllow:sSt,Deny:aSt,Allow:lSt,ToolCallArguments:uSt,ToolCallResult:cSt,ToolExecuted:dSt,Confirmation:fSt,SelectModel:hSt,CustomServersDescription:pSt,EditConfiguration:mSt,EnterYourJSONConfiguration:gSt,AvailableTools:bSt,Tools:ySt,ToolsEnabled:ASt,EnableAllTools:_St,DisableAllTools:vSt,Restart:SSt,Logs:CSt,CopyToClipboard:wSt,Close:OSt,WebSearch:TSt,WebSearchDescription:RSt,ResetSettings:ESt,WebSearchEngine:MSt,SelectEngine:PSt,AllTools:ISt,EnableWebSearch:jSt,WantDeleteServer:DSt,NoModelsAvailable:NSt,CheckInfo:LSt,ConfigurationError:FSt,Thinking:xSt,ExtendedThinking:BSt,ExtendedThinkingDescription:kSt},qSt="AIエージェント",JSt="AIエージェントの設定",VSt="設定",HSt="AIモデルを接続して始める",GSt="AIモデルがまだ接続されていません。モデルを接続して、このインターフェースでチャットを開始してください。",zSt="AIモデルを接続",KSt="チャット履歴",QSt="チャット履歴はまだありません...",$St="AIの接続方法を選択",WSt="ONLYOFFICEでAI機能を有効にする方法を選択してください。",YSt="クイックスタート用の組み込みウォレットを使用するか、APIキーまたはローカルホストモデルを使用して独自のAIモデルを接続できます。",XSt="ONLYOFFICEウォレット",ZSt="カードで残高をチャージして、すべてのAI機能を即座に使用できます。",e0t="お使いのAIプロバイダー",t0t="独自のAIソースを接続:プロバイダーのAPIキーまたはローカルホストモデル経由。",n0t="登録してウォレットを接続",r0t="プロバイダーを追加",o0t="接続",i0t="MCPサーバー",s0t="AIプロバイダー",a0t=" AIプロバイダーを編集",l0t="プロバイダー",u0t="名前",c0t="URL",d0t="名前を入力",f0t="URLを入力",h0t="APIキー",p0t="APIキーを入力",m0t="キャンセル",g0t="保存",b0t="編集",y0t="削除",A0t="警告",_0t="このプロバイダーを削除してもよろしいですか?",v0t="このチャットを削除してもよろしいですか?",S0t="はい",C0t="いいえ",w0t="どのようにお手伝いしましょうか?",O0t="無料のAIチャット、ライティングアシスタント、アイデアジェネレーター",T0t="名前を変更",R0t="ダウンロード",E0t="検索...",M0t="ローカルファイルを追加...",P0t="ローカル画像を追加...",I0t="最近使用したファイル",j0t="添付ファイル",D0t="APIキー",N0t="新規チャット",L0t="AIに聞く",F0t="分析中...",x0t=" AIがこのツールを使用したいと要求しています:",B0t=`承認する前に各アクションを慎重にご確認ください。 +サードパーティ統合のセキュリティやプライバシー慣行を保証することはできません。`,k0t="このツールが再度確認することなくこのアクションを実行することを常に許可する",U0t="拒否",q0t="許可",J0t="ツール呼び出し引数",V0t="ツール呼び出し結果",H0t="ツール実行完了",G0t="確認",z0t="モデルを選択",K0t="このセクションでは、AIエージェント内で使用するMCPサーバーを設定できます。設定を編集して新しいMCPサーバーを追加し、必要に応じてツールを有効にできます。",Q0t="設定を編集",$0t=" JSON設定を入力してください:",W0t="利用可能なツール",Y0t="ツール",X0t="ツールが有効",Z0t="すべてのツールを有効にする",eCt="すべてのツールを無効にする",tCt="再起動",nCt="ログ",rCt="クリップボードにコピー",oCt="閉じる",iCt="Web検索",sCt=" Web検索エンジンを接続して、インターネットからのリアルタイム情報でAIチャットを強化します。",aCt="設定をリセット",lCt=" Web検索エンジン",uCt="エンジンを選択",cCt="すべてのツール",dCt="設定でWeb検索を有効にする",fCt="このサーバーはリストから削除されます。続行しますか?",hCt="プロバイダーが利用できません",pCt=" AIチャットは間違いを犯す可能性があります。重要な情報を確認してください。",mCt="設定は'mcpServers'プロパティ内に配置する必要があります",gCt="推論中",bCt="拡張思考",yCt="このモデルは高度な推論を使用するため、コストが増加する可能性があります。",ACt={AIAgent:qSt,AIAgentSettings:JSt,Settings:VSt,ConnectAIModel:HSt,ConnectAIModelDescription:GSt,ConnectAIModelBtn:zSt,ChatHistory:KSt,NoChatYet:QSt,ChooseHowConnect:$St,SelectHowConnect:WSt,SelectHowConnectDescription:YSt,ONLYOFFICEWallet:XSt,ONLYOFFICEWalletDescription:ZSt,AIProviders:e0t,AIProvidersDescription:t0t,RegisterConnectWallet:n0t,AddProvider:r0t,Connection:o0t,MCPServers:i0t,AIProvider:s0t,EditAIProvider:a0t,Provider:l0t,Name:u0t,URL:c0t,EnterName:d0t,EnterURL:f0t,Key:h0t,EnterKey:p0t,Cancel:m0t,Save:g0t,Edit:b0t,Delete:y0t,Warning:A0t,WantDeleteProvider:_0t,WantDeleteChat:v0t,Yes:S0t,No:C0t,WelcomeTitle:w0t,WelcomeDescription:O0t,Rename:T0t,Download:R0t,Search:E0t,AddLocalFile:M0t,AddLocalImage:P0t,RecentFiles:I0t,Attachments:j0t,APIKey:D0t,NewChat:N0t,AskAI:L0t,Analyzing:F0t,AIWouldLikeUseThisTool:x0t,ReviewEachAction:B0t,AlwaysAllow:k0t,Deny:U0t,Allow:q0t,ToolCallArguments:J0t,ToolCallResult:V0t,ToolExecuted:H0t,Confirmation:G0t,SelectModel:z0t,CustomServersDescription:K0t,EditConfiguration:Q0t,EnterYourJSONConfiguration:$0t,AvailableTools:W0t,Tools:Y0t,ToolsEnabled:X0t,EnableAllTools:Z0t,DisableAllTools:eCt,Restart:tCt,Logs:nCt,CopyToClipboard:rCt,Close:oCt,WebSearch:iCt,WebSearchDescription:sCt,ResetSettings:aCt,WebSearchEngine:lCt,SelectEngine:uCt,AllTools:cCt,EnableWebSearch:dCt,WantDeleteServer:fCt,NoModelsAvailable:hCt,CheckInfo:pCt,ConfigurationError:mCt,Thinking:gCt,ExtendedThinking:bCt,ExtendedThinkingDescription:yCt},_Ct="Asystent AI",vCt="Ustawienia asystenta AI",SCt="Ustawienia",CCt="Podłącz model AI, aby rozpocząć",wCt="Nie podłączono jeszcze żadnego modelu AI. Podłącz model, aby rozpocząć interakcje z nim bezpośrednio w interfejsie.",OCt="Podłącz model AI",TCt="Historia czatów",RCt="Nie ma jeszcze historii czatów...",ECt="Wybierz, jak podłączyć AI",MCt="Wybierz, jak chcesz włączyć funkcje AI w ONLYOFFICE.",PCt="Użyj wbudowanego Portfela, aby szybko rozpocząć pracę bądź skonfiguruj własny model AI za pomocą klucza API lub lokalnie hostowanego modelu.",ICt="Portfel ONLYOFFICE",jCt="Zasil saldo kartą, aby uzyskać natychmiastowy dostęp do wszystkich funkcji AI.",DCt="Twój dostawca AI",NCt="Skonfiguruj własne źródło AI za pomocą klucza API od usługodawcy lub łącząc się z lokalnie hostowanym modelem.",LCt="Zarejestruj się i Podłącz Portfel",FCt="Dodaj dostawcę",xCt="Połączenie",BCt="Serwery MCP",kCt="Dostawca AI",UCt="Edytuj dostawcę AI",qCt="Dostawca",JCt="Nazwa",VCt="URL",HCt="Wpisz nazwę",GCt="Wpisz adres URL",zCt="Klucz API",KCt="Wpisz klucz API",QCt="Anuluj",$Ct="Zapisz",WCt="Edytuj",YCt="Usuń",XCt="Uwaga",ZCt="Czy na pewno chcesz usunąć tego dostawcę?",ewt="Czy na pewno chcesz usunąć ten czat?",twt="Tak",nwt="Nie",rwt="Jak mogę pomóc?",owt="Darmowy czat AI, asystent pisania i generator pomysłów",iwt="Zmień nazwę",swt="Pobierz",awt="Wyszukaj...",lwt="Dodaj plik lokalny...",uwt="Dodaj obraz lokalny...",cwt="Ostatnie pliki",dwt="Załączniki",fwt="Klucz API",hwt="Nowy czat",pwt="Zapytaj AI",mwt="Analizowanie...",gwt="AI chce skorzystać z tego narzędzia:",bwt=`Sprawdź każde działanie przed zatwierdzeniem. + Nie gwarantujemy bezpieczeństwa ani prywatności w integracjach z podmiotami trzecimi.`,ywt="Zawsze zezwalaj narzędziu na to działanie bez ponownego pytania",Awt="Odmów",_wt="Zezwól",vwt="Parametry wywołania narzędzia",Swt="Rezultat wywołania narzędzia",Cwt="Działanie narzędzia zakończone",wwt="Potwierdzenie",Owt="Wybierz model",Twt="Dana sekcja umożliwia konfigurację serwerów MCP dla asystenta AI. Możesz edytować konfigurację, dodając nowe serwery MCP i włączając potrzebne narzędzia.",Rwt="Edytuj konfigurację",Ewt="Wpisz swoją konfigurację JSON:",Mwt="Dostępne narzędzia",Pwt="narzędzia",Iwt="włączone narzędzia",jwt="Włącz wszystkie narzędzia",Dwt="Wyłącz wszystkie narzędzia",Nwt="Uruchom ponownie",Lwt="Logi",Fwt="Skopiuj do schowka",xwt="Zamknij",Bwt="Wyszukiwanie w internecie",kwt="Podłącz wyszukiwarkę, aby wzbogacić czat AI o najnowsze informacje z internetu.",Uwt="Resetuj ustawienia",qwt="Wyszukiwarka internetowa",Jwt="Wybierz wyszukiwarkę",Vwt="Wszystkie narzędzia",Hwt="Włącz wyszukiwanie w internecie w ustawieniach",Gwt="Serwer zostanie usunięty z Twojej listy. Kontynuować?",zwt="Dostawca jest niedostępny",Kwt="Czat AI może popełniać błędy. Sprawdź ważne informacje.",Qwt="Konfiguracja musi być umieszczona w właściwości 'mcpServers'",$wt="Rozumowanie",Wwt="Rozszerzone myślenie",Ywt="Ten model wykorzystuje zaawansowane rozumowanie, co może zwiększyć koszty.",Xwt={AIAgent:_Ct,AIAgentSettings:vCt,Settings:SCt,ConnectAIModel:CCt,ConnectAIModelDescription:wCt,ConnectAIModelBtn:OCt,ChatHistory:TCt,NoChatYet:RCt,ChooseHowConnect:ECt,SelectHowConnect:MCt,SelectHowConnectDescription:PCt,ONLYOFFICEWallet:ICt,ONLYOFFICEWalletDescription:jCt,AIProviders:DCt,AIProvidersDescription:NCt,RegisterConnectWallet:LCt,AddProvider:FCt,Connection:xCt,MCPServers:BCt,AIProvider:kCt,EditAIProvider:UCt,Provider:qCt,Name:JCt,URL:VCt,EnterName:HCt,EnterURL:GCt,Key:zCt,EnterKey:KCt,Cancel:QCt,Save:$Ct,Edit:WCt,Delete:YCt,Warning:XCt,WantDeleteProvider:ZCt,WantDeleteChat:ewt,Yes:twt,No:nwt,WelcomeTitle:rwt,WelcomeDescription:owt,Rename:iwt,Download:swt,Search:awt,AddLocalFile:lwt,AddLocalImage:uwt,RecentFiles:cwt,Attachments:dwt,APIKey:fwt,NewChat:hwt,AskAI:pwt,Analyzing:mwt,AIWouldLikeUseThisTool:gwt,ReviewEachAction:bwt,AlwaysAllow:ywt,Deny:Awt,Allow:_wt,ToolCallArguments:vwt,ToolCallResult:Swt,ToolExecuted:Cwt,Confirmation:wwt,SelectModel:Owt,CustomServersDescription:Twt,EditConfiguration:Rwt,EnterYourJSONConfiguration:Ewt,AvailableTools:Mwt,Tools:Pwt,ToolsEnabled:Iwt,EnableAllTools:jwt,DisableAllTools:Dwt,Restart:Nwt,Logs:Lwt,CopyToClipboard:Fwt,Close:xwt,WebSearch:Bwt,WebSearchDescription:kwt,ResetSettings:Uwt,WebSearchEngine:qwt,SelectEngine:Jwt,AllTools:Vwt,EnableWebSearch:Hwt,WantDeleteServer:Gwt,NoModelsAvailable:zwt,CheckInfo:Kwt,ConfigurationError:Qwt,Thinking:$wt,ExtendedThinking:Wwt,ExtendedThinkingDescription:Ywt},Zwt="Agente de IA",eOt="Configurações do agente de IA",tOt="Configurações",nOt="Conecte um modelo de IA para começar",rOt="Nenhum modelo de IA está conectado ainda. Conecte um modelo para começar a interagir com ele aqui mesmo na interface.",oOt="Conectar um modelo de IA",iOt="Histórico do bate-papo",sOt="Ainda não há histórico de bate-papo...",aOt="Escolha como conectar a IA",lOt="Selecione como deseja ativar os recursos de IA no ONLYOFFICE.",uOt="Você pode usar a carteira integrada para começar rapidamente ou conectar seu próprio modelo de IA usando uma chave de API ou um modelo hospedado localmente.",cOt="Carteira ONLYOFFICE",dOt="Recarregue seu saldo com um cartão e use instantaneamente todos os recursos de IA.",fOt="Seu provedor de IA",hOt="Conecte sua própria fonte de IA — seja por meio de uma chave de API de um provedor ou um modelo hospedado localmente.",pOt="Registre e conecte sua carteira",mOt="Adicionar provedor",gOt="Conexão",bOt="Servidores MCP",yOt="Provedor de IA",AOt="Editar provedor de IA",_Ot="Fornecedor",vOt="Nome",SOt="URL",COt="Digite o nome",wOt="Inserir URL",OOt="Chave de API",TOt="Cancelar",ROt="Salvar",EOt="Editar",MOt="Excluir",POt="Aviso",IOt="Tem certeza de que deseja excluir este provedor?",jOt="Tem certeza de que deseja excluir este chat?",DOt="Sim",NOt="Não",LOt="Como posso ajudar?",FOt="Chat gratuito com IA, assistente de escrita e gerador de ideias",xOt="Renomear",BOt="Baixar",kOt="Pesquisar...",UOt="Adicionar arquivo local...",qOt="Adicionar imagem local...",JOt="Arquivos recentes",VOt="Anexos",HOt="Chave de API",GOt="Novo bate-papo",zOt="Pergunte à IA",KOt="Analisando...",QOt="Al gostaria de usar esta ferramenta:",$Ot=`Analise cada ação cuidadosamente antes de aprová-la. + Não podemos garantir a segurança ou as práticas de privacidade de integrações de terceiros.`,WOt="Permitir que esta ferramenta execute esta ação sem perguntar novamente",YOt="Negar",XOt="Permitir",ZOt="Argumentos da chamada da ferramenta",eTt="Resultado da chamada da ferramenta",tTt="Ferramenta executada",nTt="Confirmação",rTt="Selecionar modelo",oTt="Esta seção permite configurar servidores MCP para uso no agente de IA. Você pode editar a configuração para adicionar novos servidores MCP e habilitar ferramentas conforme necessário.",iTt="Editar configuração",sTt="Digite sua configuração JSON:",aTt="Ferramentas disponíveis",lTt="ferramentas",uTt="ferramentas ativadas",cTt="Ativar todas as ferramentas",dTt="Desativar todas as ferramentas",fTt="Reiniciar",hTt="Registros",pTt="Copiar para a área de transferência",mTt="Fechar",gTt="Busca na Web",bTt="Conecte um mecanismo de busca na web para aprimorar bate-papos com IA com informações em tempo real da internet.",yTt="Redefinir configurações",ATt="Mecanismo de busca na Web",_Tt="Selecionar motor",vTt="Todas as ferramentas",STt="Ativar pesquisa na Web nas configurações",CTt="Este servidor será removido da sua lista. Deseja continuar ?",wTt="Fornecedor não disponível",OTt="IA Bater papo Podem ocorrer erros. Verifique informações importantes.",TTt="A configuração deve ser colocada dentro da propriedade 'mcpServers'",RTt="Raciocínio",ETt="Raciocínio Avançado",MTt="Este modelo usa raciocínio avançado, o que pode aumentar os custos.",PTt={AIAgent:Zwt,AIAgentSettings:eOt,Settings:tOt,ConnectAIModel:nOt,ConnectAIModelDescription:rOt,ConnectAIModelBtn:oOt,ChatHistory:iOt,NoChatYet:sOt,ChooseHowConnect:aOt,SelectHowConnect:lOt,SelectHowConnectDescription:uOt,ONLYOFFICEWallet:cOt,ONLYOFFICEWalletDescription:dOt,AIProviders:fOt,AIProvidersDescription:hOt,RegisterConnectWallet:pOt,AddProvider:mOt,Connection:gOt,MCPServers:bOt,AIProvider:yOt,EditAIProvider:AOt,Provider:_Ot,Name:vOt,URL:SOt,EnterName:COt,EnterURL:wOt,Key:OOt,"EnterKey ":"Insira a chave da API",Cancel:TOt,Save:ROt,Edit:EOt,Delete:MOt,Warning:POt,WantDeleteProvider:IOt,WantDeleteChat:jOt,Yes:DOt,No:NOt,WelcomeTitle:LOt,WelcomeDescription:FOt,Rename:xOt,Download:BOt,Search:kOt,AddLocalFile:UOt,AddLocalImage:qOt,RecentFiles:JOt,Anexos:VOt,APIKey:HOt,Attachments:GOt,AskAI:zOt,Analyzing:KOt,AIWouldLikeUseThisTool:QOt,ReviewEachAction:$Ot,AlwaysAllow:WOt,Deny:YOt,Allow:XOt,ToolCallArguments:ZOt,ToolCallResult:eTt,ToolExecuted:tTt,Confirmation:nTt,SelectModel:rTt,CustomServersDescription:oTt,EditConfiguration:iTt,EnterYourJSONConfiguration:sTt,AvailableTools:aTt,Tools:lTt,ToolsEnabled:uTt,EnableAllTools:cTt,DisableAllTools:dTt,Restart:fTt,Logs:hTt,CopyToClipboard:pTt,Close:mTt,WebSearch:gTt,WebSearchDescription:bTt,ResetSettings:yTt,WebSearchEngine:ATt,SelectEngine:_Tt,AllTools:vTt,EnableWebSearch:STt,WantDeleteServer:CTt,NoModelsAvailable:wTt,CheckInfo:OTt,ConfigurationError:TTt,Thinking:RTt,ExtendedThinking:ETt,ExtendedThinkingDescription:MTt},ITt="ИИ-агент",jTt="Настройки ИИ-агента",DTt="Настройки",NTt="Чтобы начать, подключите ИИ-модель",LTt="Нет подключенных ИИ-моделей. Подключите модель, чтобы начать работать с ней прямо в интерфейсе.",FTt="Подключить ИИ-модель",xTt="История чатов",BTt="Здесь пока нет истории чатов...",kTt="Выберите, как вы хотите включить искусственный интеллект",UTt="Выберите, как вы хотите включить функции искусственного интеллекта в ONLYOFFICE.",qTt="Вы можете использовать встроенный кошелек для быстрого запуска или подключить собственную ИИ-модель с помощью ключа API или модели, размещенной локально.",JTt="Кошелек ONLYOFFICE",VTt="Пополните баланс с помощью карты и сразу используйте все функциональные возможности искусственного интеллекта.",HTt="Ваш ИИ-провайдер",GTt="Подключите собственный источник искусственного интеллекта с помощью ключа API провайдера или модели, размещенной локально.",zTt="Зарегистрируйтесь и подключите кошелек",KTt="Добавить провайдера",QTt="Подключение",$Tt="MCP-серверы",WTt="ИИ-провайдер",YTt="Изменить ИИ-провайдера",XTt="Провайдер",ZTt="Название",eRt="URL-адрес",tRt="Введите название",nRt="Введите URL-адрес",rRt="Ключ API",oRt="Введите ключ API",iRt="Отменить",sRt="Сохранить",aRt="Редактировать",lRt="Удалить",uRt="Предупреждение",cRt="Вы уверены, что хотите удалить этого провайдера?",dRt="Вы уверены, что хотите удалить этот чат?",fRt="Да",hRt="Нет",pRt="Чем я могу помочь?",mRt="Бесплатный ИИ-чат, помощник в создании документов и генератор идей",gRt="Переименовать",bRt="Загрузить",yRt="Поиск...",ARt="Добавить локальный файл...",_Rt="Добавить локальное изображение...",vRt="Недавние файлы",SRt="Вложения",CRt="Ключ API",wRt="Новый чат",ORt="Спросить ИИ",TRt="Анализ...",RRt="Искусственный интеллект хочет использовать этот инструмент:",ERt=`Внимательно проверяйте каждое действие перед подтверждением. + Мы не можем гарантировать соответствие правил обеспечения безопасности и конфиденциальности сторонних интеграций.`,MRt="Всегда разрешать этому инструменту выполнять данное действие без повторного запроса",PRt="Отклонить",IRt="Разрешить",jRt="Аргументы вызова инструмента",DRt="Результат вызова инструмента",NRt="Работа с инструментом завершена",LRt="Подтверждение",FRt="Выбрать модель",xRt="В этом разделе можно настроить MCP-серверы для использования в ИИ-агенте. Вы можете редактировать конфигурацию, чтобы добавлять новые MCP-серверы и включать необходимые инструменты.",BRt="Редактировать конфигурацию",kRt="Введите конфигурацию JSON:",URt="Доступные инструменты",qRt="инструменты",JRt="включенные инструменты",VRt="Включить все инструменты",HRt="Отключить все инструменты",GRt="Перезапустить",zRt="Журналы",KRt="Копировать в буфер обмена",QRt="Закрыть",$Rt="Веб-поиск",WRt="Включите поисковую систему, чтобы дополнять ИИ-чаты информацией из Интернета в режиме реального времени.",YRt="Сбросить настройки",XRt="Поисковая система",ZRt="Выберите движок",eEt="Все инструменты",tEt="Включить веб-поиск в настройках",nEt="Этот сервер будет удален из вашего списка. Продолжить?",rEt="Поставщик недоступен",oEt="ИИ-чат может ошибаться. Проверьте важную информацию.",iEt="Конфигурацию необходимо разместить внутри свойства 'mcpServers'",sEt="Логическое рассуждение",aEt="Расширенная обработка",lEt="Данная модель использует сложные логические рассуждения, что может привести к увеличению затрат.",uEt={AIAgent:ITt,AIAgentSettings:jTt,Settings:DTt,ConnectAIModel:NTt,ConnectAIModelDescription:LTt,ConnectAIModelBtn:FTt,ChatHistory:xTt,NoChatYet:BTt,ChooseHowConnect:kTt,SelectHowConnect:UTt,SelectHowConnectDescription:qTt,ONLYOFFICEWallet:JTt,ONLYOFFICEWalletDescription:VTt,AIProviders:HTt,AIProvidersDescription:GTt,RegisterConnectWallet:zTt,AddProvider:KTt,Connection:QTt,MCPServers:$Tt,AIProvider:WTt,EditAIProvider:YTt,Provider:XTt,Name:ZTt,URL:eRt,EnterName:tRt,EnterURL:nRt,Key:rRt,EnterKey:oRt,Cancel:iRt,Save:sRt,Edit:aRt,Delete:lRt,Warning:uRt,WantDeleteProvider:cRt,WantDeleteChat:dRt,Yes:fRt,No:hRt,WelcomeTitle:pRt,WelcomeDescription:mRt,Rename:gRt,Download:bRt,Search:yRt,AddLocalFile:ARt,AddLocalImage:_Rt,RecentFiles:vRt,Attachments:SRt,APIKey:CRt,NewChat:wRt,AskAI:ORt,Analyzing:TRt,AIWouldLikeUseThisTool:RRt,ReviewEachAction:ERt,AlwaysAllow:MRt,Deny:PRt,Allow:IRt,ToolCallArguments:jRt,ToolCallResult:DRt,ToolExecuted:NRt,Confirmation:LRt,SelectModel:FRt,CustomServersDescription:xRt,EditConfiguration:BRt,EnterYourJSONConfiguration:kRt,AvailableTools:URt,Tools:qRt,ToolsEnabled:JRt,EnableAllTools:VRt,DisableAllTools:HRt,Restart:GRt,Logs:zRt,CopyToClipboard:KRt,Close:QRt,WebSearch:$Rt,WebSearchDescription:WRt,ResetSettings:YRt,WebSearchEngine:XRt,SelectEngine:ZRt,AllTools:eEt,EnableWebSearch:tEt,WantDeleteServer:nEt,NoModelsAvailable:rEt,CheckInfo:oEt,ConfigurationError:iEt,Thinking:sEt,ExtendedThinking:aEt,ExtendedThinkingDescription:lEt},cEt="Agent AI",dEt="Nastavenia agenta AI",fEt="Nastavenia",hEt="Pripojte model AI, aby ste mohli začať",pEt="Zatiaľ nie je pripojený žiadny model AI. Pripojte model AI, aby ste s ním mohli komunikovať priamo v tomto rozhraní.",mEt="Pripojiť model AI",gEt="História chatu",bEt="Zatiaľ tu nie je žiadna história chatu...",yEt="Vyberte spôsob pripojenia AI",AEt="Vyberte, ako chcete povoliť funkcie AI v ONLYOFFICE.",_Et="Môžete použiť ONLYOFFICE Peňaženku pre rýchly začiatok alebo pripojiť vlastný model AI pomocou API kľúča či nainštalovať lokálny model AI.",vEt="ONLYOFFICE Peňaženka",SEt="Dobíjajte svoj kredit pomocou karty a okamžite využívajte všetky funkcie AI.",CEt="Váš provider pre AI",wEt="Pripojte svoj vlastný model AI – buď prostredníctvom API kľúča od providera, alebo nainštalujte lokálny model AI",OEt="Registrovať a pripojiť Peňaženku",TEt="Pridať providera",REt="Pripojenie",EEt="MCP Servery",MEt="AI Provider",PEt="Upraviť AI Providera",IEt="Provider",jEt="Názov",DEt="URL",NEt="Zadať názov",LEt="Zadať URL",FEt="API kľúč",xEt="Zadať API kľúč",BEt="Zrušiť",kEt="Uložiť",UEt="Upraviť",qEt="Vymazať",JEt="Upozornenie",VEt="Naozaj chcete vymazať tohto providera?",HEt="Naozaj chcete vymazať tento chat?",GEt="Áno",zEt="Nie",KEt="Ako môžem pomôcť?",QEt="Bezplatný AI chat, asistent na písanie textov a generátor nápadov.",$Et="Premenovať",WEt="Stiahnuť",YEt="Hľadať...",XEt="Pridať lokálny súbor...",ZEt="Pridať lokálny obrázok...",eMt="Nedávne súbory",tMt="Prílohy",nMt="API kľúč",rMt="Nový chat",oMt="Opýtať sa AI",iMt="Prebieha analýza...",sMt="Al by chcel použiť tento nástroj:",aMt=`Pred schválením starostlivo skontrolujte každú akciu. + Nemôžeme zaručiť bezpečnosť ani dodržiavanie zásad ochrany osobných údajov v prípade integrovaného softvéru od tretích strán.`,lMt="Vždy povoliť tomuto nástroju vykonať túto akciu bez opýtania",uMt="Odmietnuť",cMt="Povoliť",dMt="Argumenty volania nástroja",fMt="Výsledok volania nástroja",hMt="Nástroj vykonaný",pMt="Potvrdenie",mMt="Vybrať model",gMt="V tejto sekcii môžete nakonfigurovať servery MCP, ktoré sa budú používať v AI agente. Môžete upraviť konfiguráciu, pridať nové servery MCP a zapnúť potrebné nástroje.",bMt="Upraviť konfiguráciu",yMt="Zadajte svoju konfiguráciu JSON:",AMt="Dostupné nástroje",_Mt="nástroje",vMt="povolené nástroje",SMt="Povoliť všetky nástroje",CMt="Vypnúť všetky nástroje",wMt="Reštartovať",OMt="Protokoly",TMt="Kopírovať do schránky",RMt="Zatvoriť",EMt="Hľadať na webe",MMt="Pripojte webový vyhľadávač, aby mohol AI chat využívať aktuálne údaje z internetu v reálnom čase.",PMt="Obnoviť nastavenia",IMt="Webový vyhľadávač",jMt="Vybrať vyhľadávač",DMt="Všetky nástroje",NMt="Povoliť vyhľadávanie na webe v nastaveniach",LMt="Tento server bude odstránený z vášho zoznamu. Pokračovať?",FMt="Provider nie je dostupný",xMt="AI chat môže robiť chyby. Kontrolujte dôležité informácie.",BMt="Konfigurácia musí byť umiestnená vo vlastníctve 'mcpServers'",kMt="Uvažovanie",UMt="Rozšírené myslenie",qMt="Tento model využíva pokročilé uvažovanie, čo môže zvýšiť náklady.",JMt={AIAgent:cEt,AIAgentSettings:dEt,Settings:fEt,ConnectAIModel:hEt,ConnectAIModelDescription:pEt,ConnectAIModelBtn:mEt,ChatHistory:gEt,NoChatYet:bEt,ChooseHowConnect:yEt,SelectHowConnect:AEt,SelectHowConnectDescription:_Et,ONLYOFFICEWallet:vEt,ONLYOFFICEWalletDescription:SEt,AIProviders:CEt,AIProvidersDescription:wEt,RegisterConnectWallet:OEt,AddProvider:TEt,Connection:REt,MCPServers:EEt,AIProvider:MEt,EditAIProvider:PEt,Provider:IEt,Name:jEt,URL:DEt,EnterName:NEt,EnterURL:LEt,Key:FEt,EnterKey:xEt,Cancel:BEt,Save:kEt,Edit:UEt,Delete:qEt,Warning:JEt,WantDeleteProvider:VEt,WantDeleteChat:HEt,Yes:GEt,No:zEt,WelcomeTitle:KEt,WelcomeDescription:QEt,Rename:$Et,Download:WEt,Search:YEt,AddLocalFile:XEt,AddLocalImage:ZEt,RecentFiles:eMt,Attachments:tMt,APIKey:nMt,NewChat:rMt,AskAI:oMt,Analyzing:iMt,AIWouldLikeUseThisTool:sMt,ReviewEachAction:aMt,AlwaysAllow:lMt,Deny:uMt,Allow:cMt,ToolCallArguments:dMt,ToolCallResult:fMt,ToolExecuted:hMt,Confirmation:pMt,SelectModel:mMt,CustomServersDescription:gMt,EditConfiguration:bMt,EnterYourJSONConfiguration:yMt,AvailableTools:AMt,Tools:_Mt,ToolsEnabled:vMt,EnableAllTools:SMt,DisableAllTools:CMt,Restart:wMt,Logs:OMt,CopyToClipboard:TMt,Close:RMt,WebSearch:EMt,WebSearchDescription:MMt,ResetSettings:PMt,WebSearchEngine:IMt,SelectEngine:jMt,AllTools:DMt,EnableWebSearch:NMt,WantDeleteServer:LMt,NoModelsAvailable:FMt,CheckInfo:xMt,ConfigurationError:BMt,Thinking:kMt,ExtendedThinking:UMt,ExtendedThinkingDescription:qMt},VMt="ВИ агент",HMt="Подешавања ВИ агента",GMt="Подешавања",zMt="Повежите ВИ модел да бисте започели",KMt="Још увек није повезан ниједан ВИ модел. Повежите модел да бисте почели да комуницирате са њим директно у интерфејсу.",QMt="Повежи ВИ модел",$Mt="Историја чета",WMt="Још увек нема историје чета...",YMt="Изаберите начин повезивања са ВИ",XMt="Изаберите како желите да омогућите ВИ функције у ONLYOFFICE-у.",ZMt="Можете користити уграђени новчаник за брз почетак или повезати сопствени ВИ модел помоћу API кључа или локално хостованог модела.",ePt="ONLYOFFICE Wallet",tPt="Допуните стање картицом и одмах користите све ВИ функције.",nPt="Ваш ВИ провајдер",rPt="Повежите сопствени ВИ извор — путем API кључа провајдера или локално хостованог модела.",oPt="Региструј се и повежи новчаник",iPt="Додај провајдера",sPt="Повезивање",aPt="MCP Сервери",lPt="ВИ Провајдер",uPt="Измени ВИ Провајдер",cPt="Провајдер",dPt="Назив",fPt="URL",hPt="Унесите назив",pPt="Унесите URL",mPt="API кључ",gPt="Унесите API кључ",bPt="Откажи",yPt="Сачувај",APt="Измени",_Pt="Обриши",vPt="Упозорење",SPt="Да ли сте сигурни да желите да обришете овог провајдера?",CPt="Да ли сте сигурни да желите да обришете овај чет?",wPt="Да",OPt="Не",TPt="Како могу да помогнем?",RPt="Бесплатан ВИ чет, асистент за писање и генератор идеја",EPt="Преименуј",MPt="Преузми",PPt="Претрага...",IPt="Додај локални фајл...",jPt="Додај локалну слику...",DPt="Недавни фајлови",NPt="Прилози",LPt="API кључ",FPt="Нови чет",xPt="Питај ВИ",BPt="Анализа у току...",kPt="ВИ жели да користи овај алат:",UPt=`Пажљиво прегледајте сваку радњу пре одобравања. + Не можемо гарантовати безбедност или праксу приватности интеграција трећих страна.`,qPt="Увек дозволи овом алату да извршава ову радњу без поновног питања",JPt="Одбиј",VPt="Дозволи",HPt="Аргументи позива алата",GPt="Резултат позива алата",zPt="Алат извршен",KPt="Потврда",QPt="Изабери модел",$Pt="Овај одељак вам омогућава да конфигуришете MCP сервере за коришћење унутар ВИ агента. Можете изменити конфигурацију да додате нове MCP сервере и омогућите алате по потреби.",WPt="Измени конфигурацију",YPt="Унесите своју JSON конфигурацију:",XPt="Доступни алати",ZPt="алати",eIt="омогућени алати",tIt="Омогући све алате",nIt="Онемогући све алате",rIt="Рестартуј",oIt="Логови",iIt="Копирај у привремену меморију",sIt="Затвори",aIt="Веб претрага",lIt="Повежите претраживач веба да бисте обогатили ВИ ћаскања информацијама у реалном времену са интернета.",uIt="Ресетуј подешавања",cIt="Веб претраживач",dIt="Изабери претраживач",fIt="Сви алати",hIt="Омогући веб претрагу у подешавањима",pIt="Овај сервер ће бити обрисан са ваше листе. Наставити?",mIt="Провајдер није доступан",gIt="ВИ ћет може правити грешке. Проверите важне информације.",bIt="Конфигурација мора бити смештена унутар својства 'mcpServers'",yIt="Размишљање",AIt="Проширено размишљање",_It="Овај модел користи напредно резоновање, што може повећати трошкове.",vIt={AIAgent:VMt,AIAgentSettings:HMt,Settings:GMt,ConnectAIModel:zMt,ConnectAIModelDescription:KMt,ConnectAIModelBtn:QMt,ChatHistory:$Mt,NoChatYet:WMt,ChooseHowConnect:YMt,SelectHowConnect:XMt,SelectHowConnectDescription:ZMt,ONLYOFFICEWallet:ePt,ONLYOFFICEWalletDescription:tPt,AIProviders:nPt,AIProvidersDescription:rPt,RegisterConnectWallet:oPt,AddProvider:iPt,Connection:sPt,MCPServers:aPt,AIProvider:lPt,EditAIProvider:uPt,Provider:cPt,Name:dPt,URL:fPt,EnterName:hPt,EnterURL:pPt,Key:mPt,EnterKey:gPt,Cancel:bPt,Save:yPt,Edit:APt,Delete:_Pt,Warning:vPt,WantDeleteProvider:SPt,WantDeleteChat:CPt,Yes:wPt,No:OPt,WelcomeTitle:TPt,WelcomeDescription:RPt,Rename:EPt,Download:MPt,Search:PPt,AddLocalFile:IPt,AddLocalImage:jPt,RecentFiles:DPt,Attachments:NPt,APIKey:LPt,NewChat:FPt,AskAI:xPt,Analyzing:BPt,AIWouldLikeUseThisTool:kPt,ReviewEachAction:UPt,AlwaysAllow:qPt,Deny:JPt,Allow:VPt,ToolCallArguments:HPt,ToolCallResult:GPt,ToolExecuted:zPt,Confirmation:KPt,SelectModel:QPt,CustomServersDescription:$Pt,EditConfiguration:WPt,EnterYourJSONConfiguration:YPt,AvailableTools:XPt,Tools:ZPt,ToolsEnabled:eIt,EnableAllTools:tIt,DisableAllTools:nIt,Restart:rIt,Logs:oIt,CopyToClipboard:iIt,Close:sIt,WebSearch:aIt,WebSearchDescription:lIt,ResetSettings:uIt,WebSearchEngine:cIt,SelectEngine:dIt,AllTools:fIt,EnableWebSearch:hIt,WantDeleteServer:pIt,NoModelsAvailable:mIt,CheckInfo:gIt,ConfigurationError:bIt,Thinking:yIt,ExtendedThinking:AIt,ExtendedThinkingDescription:_It},SIt="AI agent",CIt="Podešavanja AI agenta",wIt="Podešavanja",OIt="Povežite AI model da biste započeli",TIt="Još uvek nije povezan nijedan AI model. Povežite model da biste počeli da komunicirate sa njim direktno u interfejsu.",RIt="Poveži AI model",EIt="Istorija četa",MIt="Još uvek nema istorije četa...",PIt="Izaberite način povezivanja sa AI",IIt="Izaberite kako želite da omogućite AI funkcije u ONLYOFFICE-u.",jIt="Možete koristiti ugrađeni novčanik za brz početak ili povezati sopstveni AI model pomoću API ključa ili lokalno hostovanog modela.",DIt="ONLYOFFICE Wallet",NIt="Dopunite stanje karticom i odmah koristite sve AI funkcije.",LIt="Vaš AI provajder",FIt="Povežite sopstveni AI izvor — putem API ključa provajdera ili lokalno hostovanog modela.",xIt="Registruj se i poveži novčanik",BIt="Dodaj provajdera",kIt="Povezivanje",UIt="MCP Serveri",qIt="AI Provajder",JIt="Izmeni AI Provajder",VIt="Provajder",HIt="Naziv",GIt="URL",zIt="Unesite naziv",KIt="Unesite URL",QIt="API ključ",$It="Unesite API ključ",WIt="Otkaži",YIt="Sačuvaj",XIt="Izmeni",ZIt="Obriši",ejt="Upozorenje",tjt="Da li ste sigurni da želite da obrišete ovog provajdera?",njt="Da li ste sigurni da želite da obrišete ovaj čet?",rjt="Da",ojt="Ne",ijt="Kako mogu da pomognem?",sjt="Besplatan AI čet, asistent za pisanje i generator ideja",ajt="Preimenuj",ljt="Preuzmi",ujt="Pretraga...",cjt="Dodaj lokalni fajl...",djt="Dodaj lokalnu sliku...",fjt="Nedavni fajlovi",hjt="Prilozi",pjt="API ključ",mjt="Novi čet",gjt="Pitaj AI",bjt="Analiza u toku...",yjt="AI želi da koristi ovaj alat:",Ajt=`Pažljivo pregledajte svaku radnju pre odobravanja. + Ne možemo garantovati bezbednost ili praksu privatnosti integracija trećih strana.`,_jt="Uvek dozvoli ovom alatu da izvršava ovu radnju bez ponovnog pitanja",vjt="Odbij",Sjt="Dozvoli",Cjt="Argumenti poziva alata",wjt="Rezultat poziva alata",Ojt="Alat izvršen",Tjt="Potvrda",Rjt="Izaberi model",Ejt="Ovaj odeljak vam omogućava da konfigurišete MCP servere za korišćenje unutar AI agenta. Možete izmeniti konfiguraciju da dodate nove MCP servere i omogućite alate po potrebi.",Mjt="Izmeni konfiguraciju",Pjt="Unesite svoju JSON konfiguraciju:",Ijt="Dostupni alati",jjt="alati",Djt="omogućeni alati",Njt="Omogući sve alate",Ljt="Onemogući sve alate",Fjt="Restartuj",xjt="Logovi",Bjt="Kopiraj u privremenu memoriju",kjt="Zatvori",Ujt="Veb pretraga",qjt="Povežite pretraživač veba da biste obogatili AI četove informacijama u realnom vremenu sa internet.",Jjt="Resetuj podešavanja",Vjt="Veb pretraživač",Hjt="Izaberi pretraživač",Gjt="Svi alati",zjt="Omogući veb pretragu u podešavanjima",Kjt="Ovaj server će biti obrisan sa vaše liste. Nastaviti?",Qjt="Provajder nije dostupan",$jt="AI čet može praviti greške. Proverite važne informacije.",Wjt="Konfiguracija mora biti smeštena unutar svojstva 'mcpServers'",Yjt="Razmišljanje",Xjt="Prošireno razmišljanje",Zjt="Ovaj model koristi napredno rezonovanje, što može povećati troškove.",eDt={AIAgent:SIt,AIAgentSettings:CIt,Settings:wIt,ConnectAIModel:OIt,ConnectAIModelDescription:TIt,ConnectAIModelBtn:RIt,ChatHistory:EIt,NoChatYet:MIt,ChooseHowConnect:PIt,SelectHowConnect:IIt,SelectHowConnectDescription:jIt,ONLYOFFICEWallet:DIt,ONLYOFFICEWalletDescription:NIt,AIProviders:LIt,AIProvidersDescription:FIt,RegisterConnectWallet:xIt,AddProvider:BIt,Connection:kIt,MCPServers:UIt,AIProvider:qIt,EditAIProvider:JIt,Provider:VIt,Name:HIt,URL:GIt,EnterName:zIt,EnterURL:KIt,Key:QIt,EnterKey:$It,Cancel:WIt,Save:YIt,Edit:XIt,Delete:ZIt,Warning:ejt,WantDeleteProvider:tjt,WantDeleteChat:njt,Yes:rjt,No:ojt,WelcomeTitle:ijt,WelcomeDescription:sjt,Rename:ajt,Download:ljt,Search:ujt,AddLocalFile:cjt,AddLocalImage:djt,RecentFiles:fjt,Attachments:hjt,APIKey:pjt,NewChat:mjt,AskAI:gjt,Analyzing:bjt,AIWouldLikeUseThisTool:yjt,ReviewEachAction:Ajt,AlwaysAllow:_jt,Deny:vjt,Allow:Sjt,ToolCallArguments:Cjt,ToolCallResult:wjt,ToolExecuted:Ojt,Confirmation:Tjt,SelectModel:Rjt,CustomServersDescription:Ejt,EditConfiguration:Mjt,EnterYourJSONConfiguration:Pjt,AvailableTools:Ijt,Tools:jjt,ToolsEnabled:Djt,EnableAllTools:Njt,DisableAllTools:Ljt,Restart:Fjt,Logs:xjt,CopyToClipboard:Bjt,Close:kjt,WebSearch:Ujt,WebSearchDescription:qjt,ResetSettings:Jjt,WebSearchEngine:Vjt,SelectEngine:Hjt,AllTools:Gjt,EnableWebSearch:zjt,WantDeleteServer:Kjt,NoModelsAvailable:Qjt,CheckInfo:$jt,ConfigurationError:Wjt,Thinking:Yjt,ExtendedThinking:Xjt,ExtendedThinkingDescription:Zjt},tDt="AI 智能体",nDt="AI 智能体设置",rDt="设置",oDt="连接一个 AI 模型开始使用",iDt="尚未连接任何 AI 模型。连接一个模型,即可在此界面中开始与之交互。",sDt="连接 AI 模型",aDt="历史对话",lDt="暂无历史对话...",uDt="选择如何连接 AI",cDt="选择您希望在 ONLYOFFICE 中启用 AI 功能的方式。",dDt="您可以使用内置的钱包快速开始,也可以通过 API 密钥或本地托管模型连接您自己的 AI 模型。",fDt="ONLYOFFICE 钱包",hDt="使用银行卡充值余额,即刻使用所有 AI 功能。",pDt="您的 AI 提供商",mDt="连接您自己的 AI 来源,可使用提供商的 API 密钥,或接入本地部署的模型。",gDt="注册并连接钱包",bDt="添加提供商",yDt="连接",ADt="MCP 服务器",_Dt="AI 提供商",vDt="编辑 AI 提供商",SDt="提供商",CDt="名称",wDt="URL",ODt="请输入名称",TDt="请输入 URL",RDt="API 密钥",EDt="请输入 API 密钥",MDt="取消",PDt="保存",IDt="编辑",jDt="删除",DDt="警告",NDt="您确定要删除此提供商吗?",LDt="您确定要删除此对话吗?",FDt="是",xDt="否",BDt="我能帮您什么?",kDt="免费 AI 对话、写作和创意工具",UDt="重命名",qDt="下载",JDt="搜索...",VDt="添加本地文件...",HDt="添加本地图片...",GDt="最近的文件",zDt="附件",KDt="API 密钥",QDt="新建对话",$Dt="询问 AI",WDt="正在分析...",YDt="AI 希望使用此工具:",XDt=`请仔细审阅每个操作后再批准。 + 我们无法保证第三方集成的安全性或隐私保护措施。`,ZDt="始终允许此工具执行此操作,无需再次询问",eNt="拒绝",tNt="允许",nNt="工具调用参数",rNt="工具调用结果",oNt="工具已执行",iNt="确认",sNt="选择模型",aNt="此部分允许您配置 MCP 服务器以供 AI 智能体内部使用。您可以编辑配置以添加新的 MCP 服务器并按需启用工具。",lNt="编辑配置",uNt="请输入您的 JSON 配置:",cNt="可用工具",dNt="工具",fNt="工具已启用",hNt="启用所有工具",pNt="禁用所有工具",mNt="重启",gNt="日志",bNt="复制到剪贴板",yNt="关闭",ANt="联网搜索",_Nt="连接网络搜索引擎,通过来自互联网的实时信息增强 AI 对话。",vNt="重置设置",SNt="网络搜索引擎",CNt="选择引擎",wNt="所有工具",ONt="在设置中启用网络搜索",TNt="此服务器将从您的列表中删除。是否继续?",RNt="提供商不可用",ENt="AI 可能会出错。请核对重要信息。",MNt="配置必须放置在 'mcpServers' 属性内",PNt="思考中",INt="深度思考",jNt="此模型采用深度推理,可能会增加成本。",DNt={AIAgent:tDt,AIAgentSettings:nDt,Settings:rDt,ConnectAIModel:oDt,ConnectAIModelDescription:iDt,ConnectAIModelBtn:sDt,ChatHistory:aDt,NoChatYet:lDt,ChooseHowConnect:uDt,SelectHowConnect:cDt,SelectHowConnectDescription:dDt,ONLYOFFICEWallet:fDt,ONLYOFFICEWalletDescription:hDt,AIProviders:pDt,AIProvidersDescription:mDt,RegisterConnectWallet:gDt,AddProvider:bDt,Connection:yDt,MCPServers:ADt,AIProvider:_Dt,EditAIProvider:vDt,Provider:SDt,Name:CDt,URL:wDt,EnterName:ODt,EnterURL:TDt,Key:RDt,EnterKey:EDt,Cancel:MDt,Save:PDt,Edit:IDt,Delete:jDt,Warning:DDt,WantDeleteProvider:NDt,WantDeleteChat:LDt,Yes:FDt,No:xDt,WelcomeTitle:BDt,WelcomeDescription:kDt,Rename:UDt,Download:qDt,Search:JDt,AddLocalFile:VDt,AddLocalImage:HDt,RecentFiles:GDt,Attachments:zDt,APIKey:KDt,NewChat:QDt,AskAI:$Dt,Analyzing:WDt,AIWouldLikeUseThisTool:YDt,ReviewEachAction:XDt,AlwaysAllow:ZDt,Deny:eNt,Allow:tNt,ToolCallArguments:nNt,ToolCallResult:rNt,ToolExecuted:oNt,Confirmation:iNt,SelectModel:sNt,CustomServersDescription:aNt,EditConfiguration:lNt,EnterYourJSONConfiguration:uNt,AvailableTools:cNt,Tools:dNt,ToolsEnabled:fNt,EnableAllTools:hNt,DisableAllTools:pNt,Restart:mNt,Logs:gNt,CopyToClipboard:bNt,Close:yNt,WebSearch:ANt,WebSearchDescription:_Nt,ResetSettings:vNt,WebSearchEngine:SNt,SelectEngine:CNt,AllTools:wNt,EnableWebSearch:ONt,WantDeleteServer:TNt,NoModelsAvailable:RNt,CheckInfo:ENt,ConfigurationError:MNt,Thinking:PNt,ExtendedThinking:INt,ExtendedThinkingDescription:jNt};Oo.use(rCe).init({resources:{"ar-SA":{translation:oht},"cs-CZ":{translation:xpt},de:{translation:ggt},en:{translation:$bt},es:{translation:EAt},fr:{translation:avt},it:{translation:USt},"ja-JP":{translation:ACt},pl:{translation:Xwt},"pt-BR":{translation:PTt},ru:{translation:uEt},"sk-SK":{translation:JMt},"sr-Cyrl-RS":{translation:vIt},"sr-Latn-RS":{translation:eDt},"zh-CN":{translation:DNt}},fallbackLng:"en",interpolation:{escapeValue:!1}});const NNt=()=>{const[e,t]=x.useState(!1),[n,o]=x.useState(!1),{messages:r,stopMessage:i}=QA(),{providers:s,fetchProvidersModels:a}=gi(),{currentPage:c}=RC(),{manageToolData:p}=Ds();S8e({isReady:e}),v8e({isReady:e});const{onNew:u,convertMessage:l,approveToolCall:d,denyToolCall:f}=_8e({isReady:e});x.useEffect(()=>{s.length&&a()},[s.length,a]),x.useEffect(()=>{p&&o(!0)},[p]),x.useEffect(()=>(zje().then(()=>t(!0)),()=>{Yi.close()}),[]);const h=vye({messages:r,onNew:u,onCancel:async()=>{i()},convertMessage:l,adapters:{attachments:new uye([new iye,new aye])}});return c!=="settings"&&!s.length&&!r.length?F.jsx(kQ,{children:F.jsx(prt,{})}):F.jsxs(kQ,{children:[F.jsx(SAe,{runtime:h,children:c==="settings"?F.jsx(sdt,{}):F.jsx(hrt,{})}),n?F.jsx(y8e,{onAllow:d,onDeny:f,onClose:()=>o(!1)}):null]})},OZ=()=>{let e=document.getElementById("root");if(!e){const t=window.parent.document.querySelector('iframe[name="system_asc.{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}"]');t?.contentDocument&&(e=t.contentDocument.getElementById("root"))}e||(e=document.createElement("div"),e.id="root",document.body.appendChild(e)),e&&!e.hasAttribute("data-react-root")&&(e.setAttribute("data-react-root","true"),sbe.createRoot(e).render(F.jsx(x.StrictMode,{children:F.jsx(NNt,{})})))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",OZ):OZ(); diff --git a/ChromiumBasedEditors/plugins/ai-agent/package-lock.json b/ChromiumBasedEditors/plugins/ai-agent/package-lock.json index d0f49de7..94ff8f58 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/package-lock.json +++ b/ChromiumBasedEditors/plugins/ai-agent/package-lock.json @@ -17,6 +17,7 @@ "@codemirror/view": "^6.38.2", "@google/genai": "^1.30.0", "@lmstudio/sdk": "^1.5.0", + "@mistralai/mistralai": "^1.11.0", "@openrouter/ai-sdk-provider": "^1.2.3", "@radix-ui/react-avatar": "^1.1.10", "@radix-ui/react-dialog": "^1.1.15", @@ -1420,6 +1421,15 @@ "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", "license": "MIT" }, + "node_modules/@mistralai/mistralai": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-1.11.0.tgz", + "integrity": "sha512-6/BVj2mcaggYbpMzNSxtqtM2Tv/Jb5845XFd2CMYFO+O5VBkX70iLjtkBBTI4JFhh1l9vTCIMYXBVOjLoBVHGQ==", + "dependencies": { + "zod": "^3.20.0", + "zod-to-json-schema": "^3.24.1" + } + }, "node_modules/@openrouter/ai-sdk-provider": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/@openrouter/ai-sdk-provider/-/ai-sdk-provider-1.5.4.tgz", diff --git a/ChromiumBasedEditors/plugins/ai-agent/package.json b/ChromiumBasedEditors/plugins/ai-agent/package.json index aea82915..0359311b 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/package.json +++ b/ChromiumBasedEditors/plugins/ai-agent/package.json @@ -30,6 +30,7 @@ "@codemirror/view": "^6.38.2", "@google/genai": "^1.30.0", "@lmstudio/sdk": "^1.5.0", + "@mistralai/mistralai": "^1.11.0", "@openrouter/ai-sdk-provider": "^1.2.3", "@radix-ui/react-avatar": "^1.1.10", "@radix-ui/react-dialog": "^1.1.15", diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/lib/types.ts b/ChromiumBasedEditors/plugins/ai-agent/src/lib/types.ts index 978b4bb5..53a3f621 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/src/lib/types.ts +++ b/ChromiumBasedEditors/plugins/ai-agent/src/lib/types.ts @@ -22,7 +22,8 @@ export type ProviderType = | "genai" | "deepseek" | "xai" - | "lm-studio"; + | "lm-studio" + | "mistral"; export type Model = { id: string; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/pages/settings/sub-components/servers/AvailableTools.tsx b/ChromiumBasedEditors/plugins/ai-agent/src/pages/settings/sub-components/servers/AvailableTools.tsx index 3d521571..eec4aa55 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/src/pages/settings/sub-components/servers/AvailableTools.tsx +++ b/ChromiumBasedEditors/plugins/ai-agent/src/pages/settings/sub-components/servers/AvailableTools.tsx @@ -24,8 +24,6 @@ const AvailableTools = () => { React.useEffect(() => { setAllToolsCount(webSearchEnabled ? tools.length - 2 : tools.length); - - console.log(tools.length); }, [tools.length, webSearchEnabled]); React.useEffect(() => { diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/handlers.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/handlers.ts new file mode 100644 index 00000000..bfb304dd --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/handlers.ts @@ -0,0 +1,78 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import type { + CompletionEvent, + DeltaMessage, +} from "@mistralai/mistralai/models/components"; + +export const handleToolCall = ( + delta: DeltaMessage, + responseMessage: ThreadMessageLike +): ThreadMessageLike => { + if (!delta.toolCalls?.length) return responseMessage; + + const toolCall = delta.toolCalls[0]; + const toolCallId = toolCall.id || ""; + const toolCallArgs = toolCall.function?.arguments || "{}"; + const toolCallContent: ThreadMessageLike["content"] = [ + { + type: "tool-call", + toolCallId, + toolName: toolCall.function?.name || "", + args: + typeof toolCallArgs === "string" + ? JSON.parse(toolCallArgs) + : toolCallArgs, + argsText: + typeof toolCallArgs === "string" + ? toolCallArgs + : JSON.stringify(toolCallArgs), + result: "", + parentId: toolCallId, + }, + ]; + + if (typeof responseMessage.content !== "string") { + return { + ...responseMessage, + content: [...responseMessage.content, ...toolCallContent], + }; + } + + return responseMessage; +}; + +export const handleTextContent = ( + delta: DeltaMessage, + responseMessage: ThreadMessageLike +): ThreadMessageLike => { + if ( + typeof delta?.content !== "string" || + typeof responseMessage.content === "string" + ) { + return responseMessage; + } + + const content = delta.content; + const lastContent = responseMessage.content.at(-1); + + if (lastContent && lastContent.type === "text") { + return { + ...responseMessage, + content: [ + ...responseMessage.content.slice(0, -1), + { ...lastContent, text: lastContent.text + content }, + ], + }; + } + + return { + ...responseMessage, + content: [...responseMessage.content, { type: "text", text: content }], + }; +}; + +export const getChoiceFromEvent = ( + event: CompletionEvent +): CompletionEvent["data"]["choices"][number] | undefined => { + return event.data?.choices?.[0]; +}; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/helpers.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/helpers.ts new file mode 100644 index 00000000..aeccef58 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/helpers.ts @@ -0,0 +1,50 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import { Mistral } from "@mistralai/mistralai"; +import cloneDeep from "lodash.clonedeep"; +import type { ToolCallPart } from "./types"; + +export const createClient = (apiKey?: string, baseUrl?: string): Mistral => { + return new Mistral({ + apiKey: apiKey ?? "", + serverURL: baseUrl, + }); +}; + +export const createEmptyResponse = (): ThreadMessageLike => ({ + role: "assistant", + content: [], +}); + +export const createErrorResponse = (error: unknown): ThreadMessageLike => ({ + role: "assistant", + content: [ + { + type: "text", + text: `Error: ${error instanceof Error ? error.message : String(error)}`, + }, + ], +}); + +export const createResponseShell = ( + afterToolCall?: boolean, + existingMessage?: ThreadMessageLike +): ThreadMessageLike => { + if (afterToolCall && existingMessage) { + return cloneDeep(existingMessage); + } + return createEmptyResponse(); +}; + +export const getLastToolCall = ( + message: ThreadMessageLike +): ToolCallPart | undefined => { + if (typeof message.content === "string") return undefined; + + for (let i = message.content.length - 1; i >= 0; i -= 1) { + const part = message.content[i]; + if (part.type === "tool-call") { + return part as ToolCallPart; + } + } + return undefined; +}; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/index.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/index.ts new file mode 100644 index 00000000..ba898f5b --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/index.ts @@ -0,0 +1,252 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import type { Mistral } from "@mistralai/mistralai"; +import type { Messages, Tool } from "@mistralai/mistralai/models/components"; +import type { Model, TMCPItem, TProvider } from "@/lib/types"; +import { AbstractBaseProvider, type TData, type TErrorData } from "../base"; +import { extractErrorMessage, getErrorStatus, ProviderErrors } from "../errors"; +import { CREATE_TITLE_SYSTEM_PROMPT } from "../prompts"; +import { + getChoiceFromEvent, + handleTextContent, + handleToolCall, +} from "./handlers"; +import { + createClient, + createErrorResponse, + createResponseShell, + getLastToolCall, +} from "./helpers"; +import { mistralInfo } from "./info"; +import type { StreamResult } from "./types"; +import { + convertMessagesToModelFormat, + convertToolsToModelFormat, +} from "./utils"; + +class MistralProvider extends AbstractBaseProvider { + setProvider = (provider: TProvider): void => { + this.provider = provider; + this.client = createClient(provider.key, provider.baseUrl); + + if (provider.key) this.setApiKey(provider.key); + if (provider.baseUrl) this.setUrl(provider.baseUrl); + }; + + setPrevMessages = (prevMessages: ThreadMessageLike[]): void => { + this.prevMessages = convertMessagesToModelFormat(prevMessages); + }; + + setTools = (tools: TMCPItem[]): void => { + this.tools = convertToolsToModelFormat(tools); + }; + + private pushToHistory = (message: ThreadMessageLike): void => { + const converted = convertMessagesToModelFormat([message]); + this.prevMessages.push(...converted); + }; + + private pushToHistorySliced = ( + responseMessage: ThreadMessageLike, + originalMessage: ThreadMessageLike + ): void => { + if (typeof responseMessage.content === "string") return; + if (typeof originalMessage.content === "string") return; + + const newContent = responseMessage.content.slice( + originalMessage.content.length + ); + this.pushToHistory({ ...responseMessage, content: newContent }); + }; + + async createChatName(message: string): Promise { + if (!this.client) return ""; + + try { + const response = await this.client.chat.complete({ + model: this.modelKey, + messages: [ + { role: "system", content: CREATE_TITLE_SYSTEM_PROMPT }, + { role: "user", content: message }, + ], + }); + + const content = response.choices?.[0]?.message?.content; + if (typeof content === "string") { + return content.substring(0, 25); + } + + return message.substring(0, 25); + } catch { + return ""; + } + } + + private getModelKey = (withThinking?: boolean): string => { + if (!withThinking) return this.modelKey; + + const reasoningModel = mistralInfo.reasoningModels.find( + ([level, _modelKeyy]) => this.modelKey.includes(level) + ); + + return reasoningModel ? reasoningModel[1] : this.modelKey; + }; + + async *sendMessage( + messages: ThreadMessageLike[], + afterToolCall?: boolean, + previousMessage?: ThreadMessageLike, + withThinking?: boolean + ): AsyncGenerator { + if (!this.client) return; + + try { + const convertedMessages = convertMessagesToModelFormat(messages); + this.prevMessages.push(...convertedMessages); + + const model = this.getModelKey(withThinking); + + const allMessages: Messages[] = [ + { role: "system", content: this.systemPrompt }, + ...this.prevMessages, + ]; + + const stream = await this.client.chat.stream({ + model, + messages: allMessages, + tools: this.tools.length > 0 ? this.tools : undefined, + }); + + let responseMessage = createResponseShell(afterToolCall, previousMessage); + + for await (const event of stream) { + // Handle stop flag + if (this.stopFlag) { + this.stopFlag = false; + this.pushToHistory(responseMessage); + yield { isEnd: true, responseMessage }; + return; + } + + const choice = getChoiceFromEvent(event); + if (!choice) continue; + + const delta = choice.delta; + + // Handle tool call + responseMessage = handleToolCall(delta, responseMessage); + + // Handle text content + responseMessage = handleTextContent(delta, responseMessage); + + // Handle finish + if (choice.finishReason) { + if (afterToolCall && previousMessage) { + this.pushToHistorySliced(responseMessage, previousMessage); + } else { + this.pushToHistory(responseMessage); + } + yield { isEnd: true, responseMessage }; + return; + } + + yield responseMessage; + } + } catch (_error) { + console.error("Mistral sendMessage error:", _error); + yield { isEnd: true, responseMessage: createErrorResponse(_error) }; + } + } + + async *sendMessageAfterToolCall( + message: ThreadMessageLike, + withThinking?: boolean + ): AsyncGenerator { + if (typeof message.content === "string") return message; + + const lastToolCall = getLastToolCall(message); + if (!lastToolCall) return message; + + const toolResult = { + role: "tool" as const, + content: + typeof lastToolCall.result === "string" + ? lastToolCall.result + : JSON.stringify(lastToolCall.result), + toolCallId: lastToolCall.toolCallId ?? "", + name: lastToolCall.toolName, + }; + + this.prevMessages.push(toolResult as Messages); + yield* this.sendMessage([], true, message, withThinking); + } + + getBaseUrl = (): string => mistralInfo.baseUrl; + + getName = (): string => mistralInfo.name; + + checkProvider = async (data: TData): Promise => { + const client = createClient(data.apiKey, data.url); + + try { + await client.models.list(); + return true; + } catch (error) { + const status = getErrorStatus(error); + + if ( + status === 0 || + (error && typeof error === "object" && "cause" in error) + ) { + return ProviderErrors.invalidUrl(); + } + + if (status === 401) { + return ProviderErrors.invalidKey(extractErrorMessage(error)); + } + + if (status === 404) { + return ProviderErrors.invalidUrl(); + } + + return data.apiKey + ? ProviderErrors.invalidKey() + : ProviderErrors.emptyKey(); + } + }; + + getProviderModels = async (data: TData): Promise => { + const client = createClient(data.apiKey, data.url); + + try { + const response = await client.models.list(); + const models = response.data ?? []; + + const result: Model[] = []; + + for (const model of models) { + const matchesFilter = + mistralInfo.modelFilters.length === 0 || + mistralInfo.modelFilters.some((f) => model.id?.includes(f)); + + if (!matchesFilter) continue; + + const displayName = + mistralInfo.modelNames[model.id ?? ""] ?? model.id ?? "Unknown"; + + result.push({ + id: model.id ?? "", + name: displayName, + provider: "mistral" as const, + }); + } + + return result; + } catch { + return []; + } + }; +} + +const mistralProvider = new MistralProvider(); + +export { MistralProvider, mistralProvider }; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/info.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/info.ts new file mode 100644 index 00000000..cacf60b0 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/info.ts @@ -0,0 +1,19 @@ +export const mistralInfo = { + name: "Mistral", + baseUrl: "https://api.mistral.ai", + modelFilters: [ + "mistral-large-latest", + "mistral-medium-latest", + "mistral-small-latest", + ] as string[], + modelNames: { + "mistral-large-latest": "Mistral Large", + "mistral-medium-latest": "Mistral Medium", + "mistral-small-latest": "Mistral Small", + } as Record, + reasoningModels: [ + ["small", "magistral-small-latest"], + ["medium", "magistral-medium-latest"], + ["large", "magistral-medium-latest"], + ] as [string, string][], +}; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/handlers.test.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/handlers.test.ts new file mode 100644 index 00000000..34f7f284 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/handlers.test.ts @@ -0,0 +1,399 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import type { + CompletionEvent, + DeltaMessage, +} from "@mistralai/mistralai/models/components"; +import { describe, expect, it } from "vitest"; +import { + getChoiceFromEvent, + handleTextContent, + handleToolCall, +} from "../handlers"; + +// Helper to create partial event objects for testing +const createEvent = (partial: Partial) => partial as T; + +describe("mistral handlers", () => { + // ========================================================================== + // handleToolCall + // ========================================================================== + + describe("handleToolCall", () => { + it("should return unchanged message when no tool calls", () => { + const delta = createEvent({ + toolCalls: undefined, + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result).toEqual(prevMessage); + }); + + it("should return unchanged message when tool calls array is empty", () => { + const delta = createEvent({ + toolCalls: [], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result).toEqual(prevMessage); + }); + + it("should add tool call to message content", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_123", + function: { + name: "get_weather", + arguments: '{"city": "NYC"}', + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result.content).toHaveLength(1); + expect(result.content).toEqual([ + { + type: "tool-call", + toolCallId: "tool_123", + toolName: "get_weather", + args: { city: "NYC" }, + argsText: '{"city": "NYC"}', + result: "", + parentId: "tool_123", + }, + ]); + }); + + it("should handle tool call with empty arguments", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_456", + function: { + name: "no_args_tool", + arguments: "", + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result.content).toHaveLength(1); + expect( + (result.content as unknown as Array<{ args: unknown }>)[0].args + ).toEqual({}); + }); + + it("should handle tool call with undefined id", () => { + const delta = createEvent({ + toolCalls: [ + { + id: undefined, + function: { + name: "test_tool", + arguments: "{}", + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect( + (result.content as unknown as Array<{ toolCallId: string }>)[0] + .toolCallId + ).toBe(""); + }); + + it("should handle tool call with undefined function name", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_789", + function: { + name: undefined as unknown as string, + arguments: "{}", + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect( + (result.content as unknown as Array<{ toolName: string }>)[0].toolName + ).toBe(""); + }); + + it("should append tool call to existing content", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_new", + function: { + name: "new_tool", + arguments: "{}", + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Let me check that" }], + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result.content).toHaveLength(2); + expect( + (result.content as unknown as Array<{ type: string }>)[0].type + ).toBe("text"); + expect( + (result.content as unknown as Array<{ type: string }>)[1].type + ).toBe("tool-call"); + }); + + it("should return unchanged message when content is string", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_123", + function: { + name: "test_tool", + arguments: "{}", + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: "string content", + }; + + const result = handleToolCall(delta, prevMessage); + + expect(result).toEqual(prevMessage); + }); + + it("should handle object arguments", () => { + const delta = createEvent({ + toolCalls: [ + { + id: "tool_obj", + function: { + name: "obj_args_tool", + arguments: { key: "value" } as unknown as string, + }, + }, + ], + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleToolCall(delta, prevMessage); + + expect( + (result.content as unknown as Array<{ args: unknown }>)[0].args + ).toEqual({ + key: "value", + }); + }); + }); + + // ========================================================================== + // handleTextContent + // ========================================================================== + + describe("handleTextContent", () => { + it("should return unchanged message when delta content is not string", () => { + const delta = createEvent({ + content: undefined, + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleTextContent(delta, prevMessage); + + expect(result).toEqual(prevMessage); + }); + + it("should return unchanged message when response content is string", () => { + const delta = createEvent({ + content: "new text", + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: "string content", + }; + + const result = handleTextContent(delta, prevMessage); + + expect(result).toEqual(prevMessage); + }); + + it("should add new text part when content is empty", () => { + const delta = createEvent({ + content: "Hello", + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = handleTextContent(delta, prevMessage); + + expect(result.content).toEqual([{ type: "text", text: "Hello" }]); + }); + + it("should append to existing text part", () => { + const delta = createEvent({ + content: " world", + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Hello" }], + }; + + const result = handleTextContent(delta, prevMessage); + + expect(result.content).toEqual([{ type: "text", text: "Hello world" }]); + }); + + it("should add new text part when last content is not text", () => { + const delta = createEvent({ + content: "New text", + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_123", + toolName: "test", + args: {}, + argsText: "{}", + }, + ], + }; + + const result = handleTextContent(delta, prevMessage); + + expect(result.content).toHaveLength(2); + expect( + (result.content as unknown as Array<{ type: string }>)[1].type + ).toBe("text"); + expect( + (result.content as unknown as Array<{ text?: string }>)[1].text + ).toBe("New text"); + }); + + it("should not mutate original message", () => { + const delta = createEvent({ + content: " world", + }); + + const prevMessage: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Hello" }], + }; + + handleTextContent(delta, prevMessage); + + expect(prevMessage.content).toEqual([{ type: "text", text: "Hello" }]); + }); + }); + + // ========================================================================== + // getChoiceFromEvent + // ========================================================================== + + describe("getChoiceFromEvent", () => { + it("should return first choice from event", () => { + const event = createEvent({ + data: { + id: "test-id", + model: "mistral-small", + choices: [ + { index: 0, delta: { content: "Hello" }, finishReason: null }, + { index: 1, delta: { content: "World" }, finishReason: null }, + ], + }, + }); + + const result = getChoiceFromEvent(event); + + expect(result?.delta.content).toBe("Hello"); + }); + + it("should return undefined when no choices", () => { + const event = createEvent({ + data: { + id: "test-id", + model: "mistral-small", + choices: [], + }, + }); + + const result = getChoiceFromEvent(event); + + expect(result).toBeUndefined(); + }); + + it("should return undefined when data is undefined", () => { + const event = createEvent({ + data: undefined, + }); + + const result = getChoiceFromEvent(event); + + expect(result).toBeUndefined(); + }); + }); +}); diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/helpers.test.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/helpers.test.ts new file mode 100644 index 00000000..b3532505 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/helpers.test.ts @@ -0,0 +1,277 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import { describe, expect, it, vi } from "vitest"; +import { + createClient, + createEmptyResponse, + createErrorResponse, + createResponseShell, + getLastToolCall, +} from "../helpers"; + +// Mock the Mistral SDK +vi.mock("@mistralai/mistralai", () => { + return { + Mistral: class MockMistral { + apiKey: string; + serverURL: string | undefined; + constructor(config: { apiKey: string; serverURL?: string }) { + this.apiKey = config.apiKey; + this.serverURL = config.serverURL; + } + }, + }; +}); + +describe("mistral helpers", () => { + // ========================================================================== + // createClient + // ========================================================================== + + describe("createClient", () => { + it("should create client with apiKey and baseUrl", () => { + const client = createClient("test-api-key", "https://api.mistral.ai"); + + expect(client).toBeDefined(); + }); + + it("should create client with empty apiKey when not provided", () => { + const client = createClient(undefined, "https://api.mistral.ai"); + + expect(client).toBeDefined(); + }); + + it("should create client with undefined serverURL", () => { + const client = createClient("test-key", undefined); + + expect(client).toBeDefined(); + }); + + it("should create client with no arguments", () => { + const client = createClient(); + + expect(client).toBeDefined(); + }); + }); + + // ========================================================================== + // createEmptyResponse + // ========================================================================== + + describe("createEmptyResponse", () => { + it("should create empty assistant response", () => { + const result = createEmptyResponse(); + + expect(result).toEqual({ + role: "assistant", + content: [], + }); + }); + }); + + // ========================================================================== + // createErrorResponse + // ========================================================================== + + describe("createErrorResponse", () => { + it("should create error response from Error instance", () => { + const error = new Error("Something went wrong"); + const result = createErrorResponse(error); + + expect(result).toEqual({ + role: "assistant", + content: [ + { + type: "text", + text: "Error: Something went wrong", + }, + ], + }); + }); + + it("should create error response from string", () => { + const result = createErrorResponse("String error"); + + expect(result).toEqual({ + role: "assistant", + content: [ + { + type: "text", + text: "Error: String error", + }, + ], + }); + }); + + it("should create error response from object", () => { + const result = createErrorResponse({ + code: 500, + message: "Server error", + }); + + expect(result.content).toHaveLength(1); + expect( + (result.content as unknown as Array<{ text: string }>)[0].text + ).toContain("Error:"); + }); + + it("should create error response from null", () => { + const result = createErrorResponse(null); + + expect(result).toEqual({ + role: "assistant", + content: [ + { + type: "text", + text: "Error: null", + }, + ], + }); + }); + + it("should create error response from undefined", () => { + const result = createErrorResponse(undefined); + + expect(result).toEqual({ + role: "assistant", + content: [ + { + type: "text", + text: "Error: undefined", + }, + ], + }); + }); + }); + + // ========================================================================== + // createResponseShell + // ========================================================================== + + describe("createResponseShell", () => { + it("should return empty response when afterToolCall is false", () => { + const result = createResponseShell(false, undefined); + + expect(result).toEqual({ + role: "assistant", + content: [], + }); + }); + + it("should return empty response when existingMessage is undefined", () => { + const result = createResponseShell(true, undefined); + + expect(result).toEqual({ + role: "assistant", + content: [], + }); + }); + + it("should return cloned existing message when afterToolCall and existingMessage provided", () => { + const existingMessage: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Hello" }], + }; + + const result = createResponseShell(true, existingMessage); + + expect(result).toEqual(existingMessage); + expect(result).not.toBe(existingMessage); // Should be a clone + }); + + it("should return empty response when called with no arguments", () => { + const result = createResponseShell(); + + expect(result).toEqual({ + role: "assistant", + content: [], + }); + }); + }); + + // ========================================================================== + // getLastToolCall + // ========================================================================== + + describe("getLastToolCall", () => { + it("should return undefined for string content", () => { + const message: ThreadMessageLike = { + role: "assistant", + content: "Just text", + }; + + const result = getLastToolCall(message); + + expect(result).toBeUndefined(); + }); + + it("should return undefined when no tool calls exist", () => { + const message: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Hello" }], + }; + + const result = getLastToolCall(message); + + expect(result).toBeUndefined(); + }); + + it("should return the last tool call", () => { + const message: ThreadMessageLike = { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_1", + toolName: "first_tool", + args: {}, + argsText: "{}", + }, + { type: "text", text: "Some text" }, + { + type: "tool-call", + toolCallId: "tool_2", + toolName: "last_tool", + args: { key: "value" }, + argsText: '{"key":"value"}', + }, + ], + }; + + const result = getLastToolCall(message); + + expect(result).toBeDefined(); + expect(result?.toolCallId).toBe("tool_2"); + expect(result?.toolName).toBe("last_tool"); + }); + + it("should return tool call when it is the only content", () => { + const message: ThreadMessageLike = { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_only", + toolName: "single_tool", + args: {}, + argsText: "{}", + }, + ], + }; + + const result = getLastToolCall(message); + + expect(result?.toolCallId).toBe("tool_only"); + }); + + it("should return undefined for empty content array", () => { + const message: ThreadMessageLike = { + role: "assistant", + content: [], + }; + + const result = getLastToolCall(message); + + expect(result).toBeUndefined(); + }); + }); +}); diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/index.test.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/index.test.ts new file mode 100644 index 00000000..c1814b49 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/index.test.ts @@ -0,0 +1,1096 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { TProvider } from "@/lib/types"; +import { + createAsyncGenerator, + createMessage, + createMistralFinishEvent, + createMistralTextDeltaEvent, + createMistralToolCallEvent, + createTestProvider, + createToolCallPart, +} from "@/providers/tests/test-utils"; +import { MistralProvider } from "../index"; +import { mistralInfo } from "../info"; + +// ============================================================================= +// Mock Setup +// ============================================================================= + +let _mockClient = {} as MockClient; + +type MockClient = { + chat: { + stream: ReturnType; + complete: ReturnType; + }; + models: { list: ReturnType }; +}; + +const modelsListMock = vi.fn(); +const chatStreamMock = vi.fn(); +const chatCompleteMock = vi.fn(); + +// Mock the Mistral SDK +vi.mock("@mistralai/mistralai", () => ({ + Mistral: vi.fn(function (this: MockClient) { + this.chat = { + stream: chatStreamMock, + complete: chatCompleteMock, + }; + this.models = { list: modelsListMock }; + _mockClient = this; + }), +})); + +describe("MistralProvider", () => { + let provider: MistralProvider; + + beforeEach(() => { + provider = new MistralProvider(); + vi.clearAllMocks(); + modelsListMock.mockReset(); + chatStreamMock.mockReset(); + chatCompleteMock.mockReset(); + }); + + // ========================================================================== + // Provider Info + // ========================================================================== + + describe("getBaseUrl", () => { + it("should return Mistral base URL", () => { + expect(provider.getBaseUrl()).toBe(mistralInfo.baseUrl); + }); + }); + + describe("getName", () => { + it("should return Mistral name", () => { + expect(provider.getName()).toBe(mistralInfo.name); + }); + }); + + // ========================================================================== + // Setup Methods + // ========================================================================== + + describe("setProvider", () => { + it("should set provider with key and baseUrl", () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + + provider.setProvider(testProvider); + + expect(provider.url).toBe("https://api.mistral.ai"); + expect(provider.apiKey).toBe("test-key"); + }); + + it("should create client when setting provider", () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + + provider.setProvider(testProvider); + + expect(provider.client).toBeDefined(); + }); + + it("should handle provider without key", () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "", + baseUrl: "https://api.mistral.ai", + }; + + provider.setProvider(testProvider); + + expect(provider.client).toBeDefined(); + expect(provider.apiKey).toBeUndefined(); + }); + + it("should handle provider without baseUrl", () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "", + }; + + provider.setProvider(testProvider); + + expect(provider.client).toBeDefined(); + expect(provider.url).toBeUndefined(); + }); + }); + + describe("setPrevMessages", () => { + it("should convert and set previous messages", () => { + const messages: ThreadMessageLike[] = [ + createMessage("user", "Hello"), + createMessage("assistant", "Hi there!"), + ]; + + provider.setPrevMessages(messages); + + expect(provider.prevMessages).toHaveLength(2); + }); + }); + + describe("setTools", () => { + it("should convert and set tools", () => { + const tools = [ + { + name: "test_tool", + description: "A test tool", + inputSchema: { properties: {} }, + }, + ]; + + provider.setTools(tools); + + expect(provider.tools).toHaveLength(1); + expect(provider.tools[0]).toMatchObject({ + type: "function", + function: { + name: "test_tool", + description: "A test tool", + }, + }); + }); + }); + + // ========================================================================== + // Model & System Prompt + // ========================================================================== + + describe("setModelKey", () => { + it("should set model key", () => { + provider.setModelKey("mistral-large-latest"); + + expect(provider.modelKey).toBe("mistral-large-latest"); + }); + }); + + describe("setSystemPrompt", () => { + it("should set system prompt", () => { + provider.setSystemPrompt("You are a helpful assistant"); + + expect(provider.systemPrompt).toBe("You are a helpful assistant"); + }); + }); + + // ========================================================================== + // Stop Flag + // ========================================================================== + + describe("stopMessage", () => { + it("should not throw when called", () => { + expect(() => provider.stopMessage()).not.toThrow(); + }); + }); + + // ========================================================================== + // sendMessage + // ========================================================================== + + describe("sendMessage", () => { + it("should return early if no client", async () => { + const gen = provider.sendMessage([{ role: "user", content: "Hi" }]); + const result = await gen.next(); + + expect(result.done).toBe(true); + }); + + it("should stream text response", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const events = [ + createMistralTextDeltaEvent("Hello"), + createMistralTextDeltaEvent(" world"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: ThreadMessageLike[] = []; + for await (const msg of provider.sendMessage([ + { role: "user", content: "Hi" }, + ])) { + if ("isEnd" in msg && msg.isEnd) { + results.push(msg.responseMessage); + } else { + results.push(msg as ThreadMessageLike); + } + } + + expect(results.length).toBeGreaterThan(0); + expect(chatStreamMock).toHaveBeenCalledOnce(); + }); + + it("should handle tool call in stream", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setTools([ + { + name: "get_weather", + description: "Get weather", + inputSchema: { properties: {} }, + }, + ]); + + const events = [ + createMistralToolCallEvent("tool_123", "get_weather", '{"city":"NYC"}'), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([ + { role: "user", content: "What's the weather?" }, + ])) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + + const lastResult = results[results.length - 1] as { + isEnd?: boolean; + responseMessage?: { content: Array<{ type: string }> }; + }; + + if (lastResult.isEnd && lastResult.responseMessage) { + const toolCall = lastResult.responseMessage.content.find( + (c) => c.type === "tool-call" + ); + expect(toolCall).toBeDefined(); + } + }); + + it("should handle stop flag during stream", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield createMistralTextDeltaEvent("Hello"); + yield createMistralTextDeltaEvent(" there"); + }, + }; + + chatStreamMock.mockResolvedValue(mockStream); + + const results: unknown[] = []; + let eventCount = 0; + + for await (const msg of provider.sendMessage([ + { role: "user", content: "Hi" }, + ])) { + results.push(msg); + eventCount++; + if (eventCount === 1) { + provider.stopMessage(); + } + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should handle afterToolCall flow", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const events = [ + createMistralTextDeltaEvent("Based on the weather"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const existingMessage: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Let me check" }], + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([], true, existingMessage)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should handle afterToolCall with string responseMessage content", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const events = [createMistralFinishEvent()]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const existingMessage: ThreadMessageLike = { + role: "assistant", + content: "string content", + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([], true, existingMessage)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should handle afterToolCall with string originalMessage content", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const events = [ + createMistralTextDeltaEvent("New content"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const existingMessage: ThreadMessageLike = { + role: "assistant", + content: "string content", + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([], true, existingMessage)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should handle errors gracefully", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + chatStreamMock.mockRejectedValue(new Error("API Error")); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([ + { role: "user", content: "Hi" }, + ])) { + results.push(msg); + } + + expect(results).toHaveLength(1); + const errorResult = results[0] as { + isEnd: boolean; + responseMessage: ThreadMessageLike; + }; + expect(errorResult.isEnd).toBe(true); + }); + + it("should skip events without choices", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + const events = [ + { data: { choices: [] } }, + { data: {} }, + createMistralTextDeltaEvent("Hello"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage([ + { role: "user", content: "Hi" }, + ])) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should use reasoning model when withThinking is true and model matches", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setModelKey("mistral-small-latest"); + + const events = [ + createMistralTextDeltaEvent("Thinking..."), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage( + [{ role: "user", content: "Think about this" }], + false, + undefined, + true // withThinking=true + )) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + expect(chatStreamMock).toHaveBeenCalledWith( + expect.objectContaining({ + model: "magistral-small-latest", + }) + ); + }); + + it("should use original model when withThinking is true but model does not match reasoning levels", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setModelKey("mistral-custom-model"); + + const events = [ + createMistralTextDeltaEvent("Response"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage( + [{ role: "user", content: "Question" }], + false, + undefined, + true // withThinking=true + )) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + expect(chatStreamMock).toHaveBeenCalledWith( + expect.objectContaining({ + model: "mistral-custom-model", + }) + ); + }); + + it("should use original model when withThinking is false", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setModelKey("mistral-small-latest"); + + const events = [ + createMistralTextDeltaEvent("Response"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage( + [{ role: "user", content: "Hi" }], + false, + undefined, + false // withThinking=false + )) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + expect(chatStreamMock).toHaveBeenCalledWith( + expect.objectContaining({ + model: "mistral-small-latest", + }) + ); + }); + + it("should use medium reasoning model when model includes medium", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setModelKey("mistral-medium-latest"); + + const events = [ + createMistralTextDeltaEvent("Response"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage( + [{ role: "user", content: "Hi" }], + false, + undefined, + true // withThinking=true + )) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + expect(chatStreamMock).toHaveBeenCalledWith( + expect.objectContaining({ + model: "magistral-medium-latest", + }) + ); + }); + + it("should use large reasoning model when model includes large", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + provider.setModelKey("mistral-large-latest"); + + const events = [ + createMistralTextDeltaEvent("Response"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const results: unknown[] = []; + for await (const msg of provider.sendMessage( + [{ role: "user", content: "Hi" }], + false, + undefined, + true // withThinking=true + )) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + // large maps to magistral-medium-latest based on info.ts + expect(chatStreamMock).toHaveBeenCalledWith( + expect.objectContaining({ + model: "magistral-medium-latest", + }) + ); + }); + }); + + // ========================================================================== + // sendMessageAfterToolCall + // ========================================================================== + + describe("sendMessageAfterToolCall", () => { + it("should return early for string content", async () => { + const message: ThreadMessageLike = { + role: "assistant", + content: "Just text", + }; + + const generator = provider.sendMessageAfterToolCall(message); + const result = await generator.next(); + + expect(result.done).toBe(true); + }); + + it("should return early when no tool calls exist", async () => { + const message: ThreadMessageLike = { + role: "assistant", + content: [{ type: "text", text: "Just text" }], + }; + + const generator = provider.sendMessageAfterToolCall(message); + const result = await generator.next(); + + expect(result.done).toBe(true); + }); + + it("should process tool call result and continue stream", async () => { + provider.setProvider( + createTestProvider("mistral", { + baseUrl: "https://api.mistral.ai", + }) as TProvider + ); + + const events = [ + createMistralTextDeltaEvent("The weather is sunny"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const message = { + role: "assistant" as const, + content: [ + { type: "text" as const, text: "Let me check" }, + createToolCallPart({ + toolCallId: "tool_abc123", + toolName: "get_weather", + args: { city: "NYC" }, + argsText: '{"city":"NYC"}', + result: "Sunny, 72F", + }), + ], + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessageAfterToolCall(message)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + expect(provider.prevMessages.length).toBeGreaterThan(0); + }); + + it("should handle tool call with object result", async () => { + provider.setProvider( + createTestProvider("mistral", { + baseUrl: "https://api.mistral.ai", + }) as TProvider + ); + + const events = [ + createMistralTextDeltaEvent("Done"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const message = { + role: "assistant" as const, + content: [ + createToolCallPart({ + toolCallId: "tool_obj", + toolName: "get_data", + result: { temperature: 72, condition: "sunny" }, + }), + ], + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessageAfterToolCall(message)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + + it("should handle tool call with undefined toolCallId", async () => { + provider.setProvider( + createTestProvider("mistral", { + baseUrl: "https://api.mistral.ai", + }) as TProvider + ); + + const events = [ + createMistralTextDeltaEvent("Response"), + createMistralFinishEvent(), + ]; + + chatStreamMock.mockResolvedValue(createAsyncGenerator(events)); + + const message = { + role: "assistant" as const, + content: [ + { + ...createToolCallPart({ result: "result" }), + toolCallId: undefined as unknown as string, + }, + ], + }; + + const results: unknown[] = []; + for await (const msg of provider.sendMessageAfterToolCall(message)) { + results.push(msg); + } + + expect(results.length).toBeGreaterThan(0); + }); + }); + + // ========================================================================== + // createChatName + // ========================================================================== + + describe("createChatName", () => { + it("should return empty string if no client", async () => { + const result = await provider.createChatName("test message"); + + expect(result).toBe(""); + }); + + it("should return title from API response", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + chatCompleteMock.mockResolvedValue({ + choices: [{ message: { content: "Generated Title" } }], + }); + + const result = await provider.createChatName("test message"); + + expect(result).toBe("Generated Title"); + }); + + it("should truncate long titles to 25 characters", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + chatCompleteMock.mockResolvedValue({ + choices: [ + { + message: { + content: "This is a very long title that exceeds 25 characters", + }, + }, + ], + }); + + const result = await provider.createChatName("test message"); + + expect(result.length).toBeLessThanOrEqual(25); + }); + + it("should fallback to truncated message when no content", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + chatCompleteMock.mockResolvedValue({ + choices: [{ message: { content: null } }], + }); + + const longMessage = "This is a very long message that exceeds 25 chars"; + const result = await provider.createChatName(longMessage); + + expect(result).toBe(longMessage.substring(0, 25)); + }); + + it("should return empty string on error", async () => { + const testProvider: TProvider = { + type: "mistral", + name: "Mistral", + key: "test-key", + baseUrl: "https://api.mistral.ai", + }; + provider.setProvider(testProvider); + + chatCompleteMock.mockRejectedValue(new Error("API Error")); + + const result = await provider.createChatName("test message"); + + expect(result).toBe(""); + }); + }); + + // ========================================================================== + // checkProvider + // ========================================================================== + + describe("checkProvider", () => { + it("should return true on successful API call", async () => { + modelsListMock.mockResolvedValue({ data: [] }); + + const result = await provider.checkProvider({ + apiKey: "valid-key", + url: "https://api.mistral.ai", + }); + + expect(result).toBe(true); + }); + + it("should return invalidKey error on 401", async () => { + modelsListMock.mockRejectedValue({ + status: 401, + message: "Unauthorized", + }); + + const result = await provider.checkProvider({ + apiKey: "invalid-key", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual({ + field: "key", + message: expect.any(String), + }); + }); + + it("should return invalidUrl error on 404", async () => { + modelsListMock.mockRejectedValue({ status: 404, message: "Not Found" }); + + const result = await provider.checkProvider({ + apiKey: "valid-key", + url: "https://invalid.url.com", + }); + + expect(result).toEqual({ + field: "url", + message: expect.any(String), + }); + }); + + it("should return emptyKey error when no API key provided", async () => { + modelsListMock.mockRejectedValue(new Error("Generic error")); + + const result = await provider.checkProvider({ + apiKey: "", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual({ + field: "key", + message: "Empty key", + }); + }); + + it("should return invalidKey error for unknown errors with key", async () => { + modelsListMock.mockRejectedValue(new Error("Unknown error")); + + const result = await provider.checkProvider({ + apiKey: "some-key", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual({ + field: "key", + message: expect.any(String), + }); + }); + + it("should return invalidUrl error on network error with cause", async () => { + modelsListMock.mockRejectedValue({ cause: {} }); + + const result = await provider.checkProvider({ + apiKey: "valid-key", + url: "https://unreachable.invalid", + }); + + expect(result).toEqual({ + field: "url", + message: expect.any(String), + }); + }); + + it("should return invalidUrl error on status 0", async () => { + modelsListMock.mockRejectedValue({ status: 0 }); + + const result = await provider.checkProvider({ + apiKey: "valid-key", + url: "https://unreachable.invalid", + }); + + expect(result).toEqual({ + field: "url", + message: expect.any(String), + }); + }); + }); + + // ========================================================================== + // getProviderModels + // ========================================================================== + + describe("getProviderModels", () => { + it("should return filtered and mapped models", async () => { + modelsListMock.mockResolvedValue({ + data: [ + { id: "mistral-large-latest" }, + { id: "mistral-small-latest" }, + { id: "other-model" }, + ], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result.length).toBe(2); + expect(result.every((m) => m.provider === "mistral")).toBe(true); + expect(result.map((m) => m.id)).toContain("mistral-large-latest"); + expect(result.map((m) => m.id)).toContain("mistral-small-latest"); + expect(result.map((m) => m.id)).not.toContain("other-model"); + }); + + it("should use modelNames mapping for display names", async () => { + modelsListMock.mockResolvedValue({ + data: [{ id: "mistral-large-latest" }], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result[0].name).toBe("Mistral Large"); + }); + + it("should handle API errors gracefully", async () => { + modelsListMock.mockRejectedValue(new Error("API Error")); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual([]); + }); + + it("should return empty array when no models match filters", async () => { + modelsListMock.mockResolvedValue({ + data: [{ id: "unknown-model-1" }, { id: "unknown-model-2" }], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual([]); + }); + + it("should handle empty response data", async () => { + modelsListMock.mockResolvedValue({ data: null }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result).toEqual([]); + }); + + it("should return all models when filters are empty", async () => { + const originalFilters = [...mistralInfo.modelFilters]; + mistralInfo.modelFilters.length = 0; + + modelsListMock.mockResolvedValue({ + data: [{ id: "any-model-1" }, { id: "any-model-2" }], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result).toHaveLength(2); + + // Restore filters + mistralInfo.modelFilters.push(...originalFilters); + }); + + it("should use model id as name when not in modelNames", async () => { + const originalFilters = [...mistralInfo.modelFilters]; + mistralInfo.modelFilters.length = 0; + + modelsListMock.mockResolvedValue({ + data: [{ id: "custom-model-id" }], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result[0].name).toBe("custom-model-id"); + + // Restore filters + mistralInfo.modelFilters.push(...originalFilters); + }); + + it("should handle model with undefined id", async () => { + const originalFilters = [...mistralInfo.modelFilters]; + mistralInfo.modelFilters.length = 0; + + modelsListMock.mockResolvedValue({ + data: [{ id: undefined }], + }); + + const result = await provider.getProviderModels({ + apiKey: "test-key", + url: "https://api.mistral.ai", + }); + + expect(result).toHaveLength(1); + expect(result[0].id).toBe(""); + expect(result[0].name).toBe("Unknown"); + + // Restore filters + mistralInfo.modelFilters.push(...originalFilters); + }); + }); +}); diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/utils.test.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/utils.test.ts new file mode 100644 index 00000000..985dde81 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/tests/utils.test.ts @@ -0,0 +1,415 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import { describe, expect, it } from "vitest"; +import { + convertMessagesToModelFormat, + convertToolsToModelFormat, +} from "../utils"; + +describe("mistral utils", () => { + // ========================================================================== + // convertToolsToModelFormat + // ========================================================================== + + describe("convertToolsToModelFormat", () => { + it("should convert tools to Mistral format", () => { + const tools = [ + { + name: "get_weather", + description: "Get current weather", + inputSchema: { + type: "object", + properties: { + city: { type: "string" }, + }, + required: ["city"], + }, + }, + ]; + + const result = convertToolsToModelFormat(tools); + + expect(result).toHaveLength(1); + expect(result[0]).toEqual({ + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + city: { type: "string" }, + }, + required: ["city"], + }, + }, + }); + }); + + it("should handle empty tools array", () => { + const result = convertToolsToModelFormat([]); + + expect(result).toEqual([]); + }); + + it("should convert multiple tools", () => { + const tools = [ + { + name: "tool_1", + description: "First tool", + inputSchema: { properties: {} }, + }, + { + name: "tool_2", + description: "Second tool", + inputSchema: { properties: {} }, + }, + ]; + + const result = convertToolsToModelFormat(tools); + + expect(result).toHaveLength(2); + expect(result[0].function.name).toBe("tool_1"); + expect(result[1].function.name).toBe("tool_2"); + }); + }); + + // ========================================================================== + // convertMessagesToModelFormat + // ========================================================================== + + describe("convertMessagesToModelFormat", () => { + describe("user messages", () => { + it("should convert user message with string content", () => { + const messages: ThreadMessageLike[] = [ + { role: "user", content: "Hello" }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toEqual([ + { + role: "user", + content: [{ type: "text", text: "Hello" }], + }, + ]); + }); + + it("should convert user message with text parts", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: [{ type: "text", text: "Hello world" }], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toEqual([ + { + role: "user", + content: [{ type: "text", text: "Hello world" }], + }, + ]); + }); + + it("should convert user message with file attachments", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: "Check this file", + attachments: [ + { + type: "file", + name: "test.txt", + content: "file content", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].content).toContainEqual({ + type: "text", + text: "File: test.txt: file content", + }); + }); + + it("should convert user message with image attachments", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: "Check this image", + attachments: [ + { + type: "image", + name: "photo.png", + content: "base64data", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].content).toContainEqual({ + type: "text", + text: "Image: photo.png: base64data", + }); + }); + + it("should handle user message with image content part", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: [ + { type: "text", text: "Look at this" }, + { + type: "image", + image: "base64imagedata", + filename: "screenshot.png", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].content).toContainEqual({ + type: "text", + text: "Image: screenshot.png: base64imagedata", + }); + }); + + it("should handle user message with file content part", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: [ + { type: "text", text: "Check this" }, + { + type: "file", + data: "file data here", + filename: "doc.txt", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].content).toContainEqual({ + type: "text", + text: "File: doc.txt: file data here", + }); + }); + + it("should handle tool result in user message", () => { + const messages: ThreadMessageLike[] = [ + { + role: "user", + content: [ + { + type: "tool-call", + toolCallId: "tool_123", + toolName: "get_weather", + args: {}, + argsText: "{}", + result: "Sunny, 72F", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + // Should have user message and tool message + expect(result).toHaveLength(2); + expect(result[1]).toEqual({ + role: "tool", + content: "Sunny, 72F", + name: "get_weather", + toolCallId: "tool_123", + }); + }); + }); + + describe("assistant messages", () => { + it("should convert assistant message with string content", () => { + const messages: ThreadMessageLike[] = [ + { role: "assistant", content: "Hello!" }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "Hello!" }], + toolCalls: undefined, + }, + ]); + }); + + it("should convert assistant message with text parts", () => { + const messages: ThreadMessageLike[] = [ + { + role: "assistant", + content: [{ type: "text", text: "Response" }], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "Response" }], + toolCalls: undefined, + }, + ]); + }); + + it("should convert assistant message with tool call", () => { + const messages: ThreadMessageLike[] = [ + { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_123", + toolName: "get_weather", + args: { city: "NYC" }, + argsText: '{"city":"NYC"}', + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toEqual([ + { + role: "assistant", + content: [], + toolCalls: [ + { + type: "function", + function: { + name: "get_weather", + arguments: '{"city":"NYC"}', + }, + }, + ], + }, + ]); + }); + + it("should convert assistant message with reasoning part", () => { + const messages: ThreadMessageLike[] = [ + { + role: "assistant", + content: [ + { + type: "reasoning", + text: "Let me think about this", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].content).toContainEqual({ + type: "thinking", + thinking: [{ type: "text", text: "Let me think about this" }], + }); + }); + + it("should handle tool call with args object when argsText is empty", () => { + const messages: ThreadMessageLike[] = [ + { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_456", + toolName: "test_tool", + args: { key: "value" }, + argsText: "", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].toolCalls[0].function.arguments).toBe( + '{"key":"value"}' + ); + }); + + it("should handle tool call with empty args", () => { + const messages: ThreadMessageLike[] = [ + { + role: "assistant", + content: [ + { + type: "tool-call", + toolCallId: "tool_789", + toolName: "no_args", + args: undefined, + argsText: "", + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result[0].toolCalls[0].function.arguments).toBe(""); + }); + }); + + describe("multiple messages", () => { + it("should convert conversation with multiple messages", () => { + const messages: ThreadMessageLike[] = [ + { role: "user", content: "Hi" }, + { role: "assistant", content: "Hello!" }, + { role: "user", content: "How are you?" }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toHaveLength(3); + expect(result[0].role).toBe("user"); + expect(result[1].role).toBe("assistant"); + expect(result[2].role).toBe("user"); + }); + + it("should handle mixed content types in conversation", () => { + const messages: ThreadMessageLike[] = [ + { role: "user", content: "Check the weather" }, + { + role: "assistant", + content: [ + { type: "text", text: "Let me check" }, + { + type: "tool-call", + toolCallId: "tool_1", + toolName: "get_weather", + args: { city: "NYC" }, + argsText: '{"city":"NYC"}', + }, + ], + }, + ]; + + const result = convertMessagesToModelFormat(messages); + + expect(result).toHaveLength(2); + expect(result[1].toolCalls).toHaveLength(1); + }); + }); + }); +}); diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/types.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/types.ts new file mode 100644 index 00000000..0f59115a --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/types.ts @@ -0,0 +1,11 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; + +export type StreamResult = + | ThreadMessageLike + | { isEnd: true; responseMessage: ThreadMessageLike }; + +export type MessageArray = Exclude; +export type ToolCallElement = MessageArray extends ReadonlyArray + ? T + : never; +export type ToolCallPart = Extract; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/utils.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/utils.ts new file mode 100644 index 00000000..cfde2352 --- /dev/null +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/mistral/utils.ts @@ -0,0 +1,134 @@ +import type { ThreadMessageLike } from "@assistant-ui/react"; +import type { + AssistantMessage, + Messages, + Tool, + ToolMessage, + UserMessage, +} from "@mistralai/mistralai/models/components"; +import type { TMCPItem } from "@/lib/types"; + +export const convertToolsToModelFormat = (tools: TMCPItem[]): Tool[] => { + return tools.map((tool) => ({ + type: "function", + function: { + name: tool.name, + description: tool.description, + parameters: tool.inputSchema, + }, + })); +}; + +export const convertMessagesToModelFormat = ( + messages: ThreadMessageLike[] +): Messages[] => { + const result: Messages[] = []; + + for (const msg of messages) { + if (msg.role === "user") { + const content: UserMessage["content"] = []; + const toolContent: ToolMessage = { content: null }; + if (msg.attachments && msg.attachments.length > 0) { + msg.attachments.forEach((attachment) => { + if (attachment.type === "file") { + content.push({ + type: "text", + text: `File: ${attachment.name}: ${attachment.content}`, + }); + } + + if (attachment.type === "image") { + content.push({ + type: "text", + text: `Image: ${attachment.name}: ${attachment.content}`, + }); + } + }); + } + + if (typeof msg.content === "string") { + content.push({ type: "text", text: msg.content }); + } else { + msg.content.forEach((part) => { + if (part.type === "text") { + content.push({ type: "text", text: part.text }); + } + + if (part.type === "tool-call") { + toolContent.content = part.result || null; + toolContent.name = part.toolName; + toolContent.toolCallId = part.toolCallId; + } + + if (part.type === "image") { + content.push({ + type: "text", + text: `Image: ${part.filename}: ${part.image}`, + }); + } + + if (part.type === "file") { + content.push({ + type: "text", + text: `File: ${part.filename}: ${part.data}`, + }); + } + }); + } + + result.push({ + role: "user", + content, + }); + + if (toolContent.content) { + result.push({ + role: "tool", + ...toolContent, + }); + } + continue; + } + + if (msg.role === "assistant") { + const content: AssistantMessage["content"] = []; + const toolCalls: AssistantMessage["toolCalls"] = []; + if (typeof msg.content === "string") { + content.push({ type: "text", text: msg.content }); + } else { + msg.content.forEach((part) => { + if (part.type === "text") { + content.push({ type: "text", text: part.text }); + } + + if (part.type === "reasoning") { + content.push({ + type: "thinking", + thinking: [{ type: "text", text: part.text }], + }); + } + + if (part.type === "tool-call") { + toolCalls.push({ + type: "function", + id: part.parentId, + function: { + name: part.toolName, + arguments: + part.argsText || part.args ? JSON.stringify(part.args) : "", + }, + }); + } + }); + } + + result.push({ + role: "assistant", + content, + toolCalls: toolCalls.length > 0 ? toolCalls : undefined, + }); + } + } + + return result; +}; diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/registry.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/registry.ts index 3d10ff1d..823efd3b 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/src/providers/registry.ts +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/registry.ts @@ -3,6 +3,7 @@ import { type AnthropicProvider, anthropicProvider } from "./anthropic"; import { type DeepSeekProvider, deepseekProvider } from "./deepseek"; import { type GenAIProvider, genaiProvider } from "./genai"; import { type LMStudioProvider, lmStudioProvider } from "./lm-studio"; +import { type MistralProvider, mistralProvider } from "./mistral"; import { type OllamaProvider, ollamaProvider } from "./ollama"; import { type OpenAIProvider, openaiProvider } from "./openai"; import { type OpenRouterProvider, openrouterProvider } from "./openrouter"; @@ -18,7 +19,8 @@ export type BaseProvider = | GenAIProvider | DeepSeekProvider | XAIProvider - | LMStudioProvider; + | LMStudioProvider + | MistralProvider; /** * Registry mapping provider types to their singleton instances. @@ -34,6 +36,7 @@ export const providerRegistry: Record = { deepseek: deepseekProvider, xai: xaiProvider, "lm-studio": lmStudioProvider, + mistral: mistralProvider, }; /** diff --git a/ChromiumBasedEditors/plugins/ai-agent/src/providers/tests/test-utils.ts b/ChromiumBasedEditors/plugins/ai-agent/src/providers/tests/test-utils.ts index 2289811e..aef92fe0 100644 --- a/ChromiumBasedEditors/plugins/ai-agent/src/providers/tests/test-utils.ts +++ b/ChromiumBasedEditors/plugins/ai-agent/src/providers/tests/test-utils.ts @@ -168,6 +168,70 @@ export const createReasoningChunk = ( ], }) as unknown as ChatCompletionChunk; +// ============================================================================ +// Mistral Chunk Factories +// ============================================================================ + +/** + * Creates a Mistral text delta event for streaming. + */ +export const createMistralTextDeltaEvent = ( + content: string, + finishReason?: string +) => ({ + data: { + choices: [ + { + index: 0, + delta: { content }, + finishReason: finishReason ?? null, + }, + ], + }, +}); + +/** + * Creates a Mistral tool call event for streaming. + */ +export const createMistralToolCallEvent = ( + id: string, + name: string, + args: string, + finishReason?: string +) => ({ + data: { + choices: [ + { + index: 0, + delta: { + toolCalls: [ + { + id, + function: { name, arguments: args }, + }, + ], + }, + finishReason: finishReason ?? null, + }, + ], + }, +}); + +/** + * Creates a Mistral finish event to end the stream. + */ +export const createMistralFinishEvent = () => ({ + data: { + choices: [ + { + index: 0, + delta: {}, + finishReason: "stop", + }, + ], + }, +}); + // ============================================================================ // Message Factories // ============================================================================ @@ -197,17 +261,18 @@ export const createMessage = ( export const createToolCallPart = (overrides?: { toolCallId?: string; toolName?: string; - args?: Record; + args?: Record; argsText?: string; result?: unknown; -}) => ({ - type: "tool-call" as const, - toolCallId: overrides?.toolCallId ?? "call_123", - toolName: overrides?.toolName ?? "test_tool", - args: overrides?.args ?? {}, - argsText: overrides?.argsText ?? "{}", - ...(overrides?.result !== undefined && { result: overrides.result }), -}); +}) => + ({ + type: "tool-call" as const, + toolCallId: overrides?.toolCallId ?? "call_123", + toolName: overrides?.toolName ?? "test_tool", + args: overrides?.args ?? {}, + argsText: overrides?.argsText ?? "{}", + ...(overrides?.result !== undefined && { result: overrides.result }), + }) as const; /** * Creates a text content part. @@ -241,7 +306,17 @@ export const createTestProvider = ( baseUrl?: string; } ) => ({ - type: type as "openai" | "anthropic" | "genai", + type: type as + | "openai" + | "anthropic" + | "genai" + | "mistral" + | "deepseek" + | "together" + | "xai" + | "openrouter" + | "ollama" + | "lm-studio", name: overrides?.name ?? type, key: overrides?.key ?? "test-key", baseUrl: overrides?.baseUrl ?? `https://api.${type}.com/v1`,