@rekayasa/erica-bubble 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- :root{--copilot-kit-primary-color:#1c1c1c;--copilot-kit-contrast-color:#fff;--copilot-kit-background-color:#fff;--copilot-kit-input-background-color:#fbfbfb;--copilot-kit-secondary-color:#fff;--copilot-kit-secondary-contrast-color:#1c1c1c;--copilot-kit-separator-color:#c8c8c8;--copilot-kit-muted-color:#c8c8c8;--copilot-kit-error-background:#fef2f2;--copilot-kit-error-border:#fecaca;--copilot-kit-error-text:#dc2626;--copilot-kit-shadow-sm:0 1px 2px 0 #0000000d;--copilot-kit-shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;--copilot-kit-shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -2px #0000000d;--copilot-kit-dev-console-bg:#f8f8fa;--copilot-kit-dev-console-text:black}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] :root{--copilot-kit-primary-color:#fff;--copilot-kit-contrast-color:#1c1c1c;--copilot-kit-background-color:#111;--copilot-kit-input-background-color:#2c2c2c;--copilot-kit-secondary-color:#1c1c1c;--copilot-kit-secondary-contrast-color:#fff;--copilot-kit-separator-color:#2d2d2d;--copilot-kit-muted-color:#2d2d2d;--copilot-kit-error-background:#7f1d1d;--copilot-kit-error-border:#dc2626;--copilot-kit-error-text:#fca5a5;--copilot-kit-shadow-sm:0 1px 2px 0 #0000004d;--copilot-kit-shadow-md:0 4px 6px -1px #0006, 0 2px 4px -1px #0000004d;--copilot-kit-shadow-lg:0 10px 15px -3px #0006, 0 4px 6px -2px #0000004d}.copilotKitPopup{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;position:fixed;bottom:1rem;right:1rem}.copilotKitPopup svg{vertical-align:middle;display:inline-block}.copilotKitSidebar{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;position:fixed;bottom:1rem;right:1rem}.copilotKitSidebar svg{vertical-align:middle;display:inline-block}.copilotKitSidebarContentWrapper{margin-right:0;transition:margin-right .3s;overflow:visible}@media (width>=640px){.copilotKitSidebarContentWrapper.sidebarExpanded{margin-right:28rem}}.copilotKitButton{border:1px solid var(--copilot-kit-primary-color);background-color:var(--copilot-kit-primary-color);width:3.5rem;height:3.5rem;color:var(--copilot-kit-contrast-color);cursor:pointer;box-shadow:var(--copilot-kit-shadow-sm);border-radius:50%;outline:none;justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative;transform:scale(1)}.copilotKitButton:hover{box-shadow:var(--copilot-kit-shadow-md);transform:scale(1.05)}.copilotKitButton:active{box-shadow:var(--copilot-kit-shadow-sm);transform:scale(.95)}.copilotKitButtonIcon{justify-content:center;align-items:center;transition:opacity .1s,transform .3s;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.copilotKitButtonIcon svg{width:1.5rem;height:1.5rem}.copilotKitButton.open .copilotKitButtonIconOpen{opacity:0;transform:translate(-50%,-50%)scale(0)rotate(90deg)}.copilotKitButton.open .copilotKitButtonIconClose,.copilotKitButton:not(.open) .copilotKitButtonIconOpen{opacity:1;transform:translate(-50%,-50%)scale(1)rotate(0)}.copilotKitButton:not(.open) .copilotKitButtonIconClose{opacity:0;transform:translate(-50%,-50%)scale(0)rotate(-90deg)}.copilotKitHeader{height:56px;color:var(--copilot-kit-primary-color);border-bottom:1px solid var(--copilot-kit-separator-color);background-color:var(--copilot-kit-contrast-color);z-index:2;border-top-left-radius:0;border-top-right-radius:0;justify-content:space-between;align-items:center;padding-left:1.5rem;font-weight:500;display:flex;position:relative}.copilotKitSidebar .copilotKitHeader{border-radius:0}.copilotKitHeaderControls{display:flex}.copilotKitHeaderCloseButton{background:0 0;border:none}@media (width>=640px){.copilotKitHeader{border-top-left-radius:8px;border-top-right-radius:8px;padding-left:1.5rem;padding-right:24px}}.copilotKitHeader>button{color:var(--copilot-kit-muted-color);cursor:pointer;background-color:#0000;border:0;border-radius:50%;outline:none;justify-content:center;align-items:center;width:35px;height:35px;padding:8px;transition:background-color .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.copilotKitHeader>button:hover{color:color-mix(in srgb, var(--copilot-kit-muted-color) 80%, black)}.copilotKitHeader>button:focus{outline:none}.copilotKitInput{cursor:text;background-color:var(--copilot-kit-input-background-color);border:1px solid var(--copilot-kit-separator-color);border-radius:20px;width:95%;min-height:75px;margin:0 auto;padding:12px 14px;position:relative}.copilotKitInputContainer{background:var(--copilot-kit-background-color);border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem;width:100%;padding:0 0 15px}.copilotKitSidebar .copilotKitInputContainer{border-bottom-right-radius:0;border-bottom-left-radius:0}.copilotKitInputControlButton{cursor:pointer;color:#00000040;appearance:button;text-transform:none;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;text-indent:0;text-shadow:none;text-align:center;background-color:#0000;background-image:none;border:0;width:24px;height:24px;margin:0;padding:0;transition-property:transform;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-block;transform:scale(1)}.copilotKitInputControlButton:not([disabled]){color:var(--copilot-kit-primary-color)}.copilotKitInputControlButton:not([disabled]):hover{color:color-mix(in srgb, var(--copilot-kit-primary-color) 80%, black);transform:scale(1.05)}.copilotKitInputControlButton[disabled]{color:var(--copilot-kit-muted-color);cursor:default}.copilotKitInputControls{gap:3px;display:flex}.copilotKitInput>textarea{outline-offset:2px;resize:none;white-space:pre-wrap;overflow-wrap:break-word;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;cursor:text;font-family:inherit;font-size:.875rem;line-height:1.5rem;font-weight:inherit;color:var(--copilot-kit-secondary-contrast-color);background-color:#0000;border:0;outline:2px solid #0000;flex:1;width:100%;margin:0;padding:0}.copilotKitInput>textarea::placeholder{color:gray;opacity:1}.copilotKitInputControlButton.copilotKitPushToTalkRecording{color:#fff;background-color:#ec0000;border-radius:50%;animation:2s cubic-bezier(.4,0,.6,1) infinite copilotKitPulseAnimation}.copilotKitInput textarea::-webkit-scrollbar{width:9px}.copilotKitInput textarea::-webkit-scrollbar-track{background:0 0}.copilotKitInput textarea::-webkit-scrollbar-thumb{cursor:pointer;background-color:#c8c8c8;background-clip:content-box;border:2px solid #0000;border-radius:10px}.copilotKitInput textarea::-webkit-scrollbar-thumb:hover{background-color:#a0a0a0}.poweredByContainer{padding:0}.poweredBy{background:var(--copilot-kit-background-color)!important;visibility:visible!important;text-align:center!important;color:#d6d6d6!important;margin:0!important;padding:3px 0!important;font-size:12px!important;display:block!important;position:static!important}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .poweredBy{color:#454545!important}.copilotKitMessages{background-color:var(--copilot-kit-background-color);color:var(--copilot-kit-secondary-contrast-color);z-index:1;flex-direction:column;flex:1;justify-content:space-between;display:flex;overflow-y:scroll}.copilotKitMessagesContainer{flex-direction:column;padding:1rem 24px;display:flex}.copilotKitMessagesFooter{flex-direction:column;justify-content:flex-start;width:97%;margin:8px auto 0;padding:.5rem .75rem;display:flex}.copilotKitMessages::-webkit-scrollbar{width:6px}.copilotKitMessages::-webkit-scrollbar-thumb{background-color:var(--copilot-kit-separator-color);border:2px solid var(--copilot-kit-background-color);border-radius:10rem}.copilotKitMessages::-webkit-scrollbar-track-piece:start{background:0 0}.copilotKitMessages::-webkit-scrollbar-track-piece:end{background:0 0}.copilotKitMessage{overflow-wrap:break-word;border-radius:15px;max-width:80%;margin-bottom:.5rem;padding:8px 12px;font-size:1rem;line-height:1.5}.copilotKitMessage.copilotKitUserMessage{background:var(--copilot-kit-primary-color);color:var(--copilot-kit-contrast-color);white-space:pre-wrap;margin-left:auto;font-size:1rem;line-height:1.75}.copilotKitMessage.copilotKitAssistantMessage{max-width:100%;color:var(--copilot-kit-secondary-contrast-color);background:0 0;margin-right:auto;padding-left:0;position:relative}.copilotKitMessage.copilotKitAssistantMessage .copilotKitMessageControls{opacity:0;gap:1rem;padding:5px 0 0;transition:opacity .2s;display:flex;position:absolute;left:0}.copilotKitMessageControls.currentMessage{opacity:1!important}.copilotKitMessage.copilotKitAssistantMessage:hover .copilotKitMessageControls{opacity:1}@media (width<=768px){.copilotKitMessage.copilotKitAssistantMessage .copilotKitMessageControls{opacity:1}}.copilotKitMessageControlButton{width:20px;height:20px;color:var(--copilot-kit-primary-color);cursor:pointer;z-index:10;background:0 0;border:none;border-radius:.5rem;justify-content:center;align-items:center;margin:0;padding:0;transition:all .2s;display:flex}.copilotKitMessageControlButton:hover,.copilotKitMessageControlButton:active{color:color-mix(in srgb, var(--copilot-kit-primary-color) 80%, black);transform:scale(1.05)}.copilotKitMessageControlButton.active{background-color:var(--copilot-kit-primary-color);color:var(--copilot-kit-contrast-color)}.copilotKitMessageControlButton.active:hover{background-color:color-mix(in srgb, var(--copilot-kit-primary-color) 90%, black);color:var(--copilot-kit-contrast-color)}.copilotKitMessageControlButton svg{pointer-events:none;width:1rem;height:1rem;display:block}.copilotKitMessage.copilotKitAssistantMessage+.copilotKitMessage.copilotKitUserMessage{margin-top:1.5rem}.copilotKitCustomAssistantMessage{margin-top:1.5rem;margin-bottom:1.5rem}.copilotKitMessage .inProgressLabel{opacity:.7;margin-left:10px}@keyframes copilotKitSpinAnimation{to{transform:rotate(360deg)}}.copilotKitSpinner{border:2px solid var(--copilot-kit-contrast-color);border-top-color:var(--copilot-kit-primary-color);border-radius:50%;width:16px;height:16px;animation:1s linear infinite copilotKitSpinAnimation;display:inline-block}@keyframes copilotKitActivityDotAnimation{0%,80%,to{opacity:.5;transform:scale(.5)}40%{opacity:1;transform:scale(1)}}.copilotKitActivityDot{background-color:var(--copilot-kit-primary-color);border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite both copilotKitActivityDotAnimation;display:inline-block}.copilotKitImageRendering{flex-direction:column;gap:8px;display:flex}.copilotKitImageRenderingImage{max-width:100%;height:auto;box-shadow:var(--copilot-kit-shadow-sm);border-radius:8px}.copilotKitImageRenderingContent{color:var(--copilot-kit-secondary-contrast-color);margin-top:8px;padding:0 16px;font-size:.875rem;line-height:1.5}.copilotKitImageRenderingError{border:1px solid var(--copilot-kit-separator-color);background-color:var(--copilot-kit-input-background-color);border-radius:8px;flex-direction:column;gap:8px;padding:12px;display:flex}.copilotKitImageRenderingErrorMessage{background-color:var(--copilot-kit-error-background);border:1px solid var(--copilot-kit-error-border);color:var(--copilot-kit-error-text);border-radius:6px;align-items:center;gap:8px;padding:8px 12px;font-size:.875rem;font-weight:500;display:flex}.copilotKitImageRenderingErrorMessage:before{content:"⚠️";font-size:1rem}.copilotKitAttachmentQueue{flex-wrap:wrap;gap:8px;margin:8px;padding:8px;display:flex}.copilotKitAttachmentQueueItem{border:1px solid var(--copilot-kit-separator-color);background:var(--copilot-kit-input-background-color);border-radius:8px;display:inline-flex;position:relative;overflow:hidden}.copilotKitAttachmentQueueItem--image,.copilotKitAttachmentQueueItem--video{width:72px;height:72px}.copilotKitAttachmentQueueItem--audio{flex-direction:column;min-width:200px;max-width:280px;padding:4px}.copilotKitAttachmentQueueItem--document{max-width:200px;padding:8px 12px}.copilotKitAttachmentQueueOverlay{z-index:1;background:#0006;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.copilotKitAttachmentQueueSpinner{border:2px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:20px;height:20px;animation:.6s linear infinite copilotKitSpin}@keyframes copilotKitSpin{to{transform:rotate(360deg)}}.copilotKitAttachmentQueueRemoveButton{color:#fff;cursor:pointer;z-index:2;background:#0009;border:none;border-radius:50%;justify-content:center;align-items:center;width:20px;height:20px;padding:0;font-size:10px;line-height:1;display:flex;position:absolute;top:4px;right:4px}.copilotKitAttachmentQueueRemoveButton:hover{background:#000c}.copilotKitAttachmentQueuePreviewPlaceholder{background:var(--copilot-kit-input-background-color);width:100%;height:100%}.copilotKitAttachmentQueuePreviewImage{object-fit:cover;width:100%;height:100%}.copilotKitAttachmentQueuePreviewAudio{flex-direction:column;gap:4px;width:100%;display:flex}.copilotKitAttachmentQueuePreviewAudio audio{width:100%;height:32px}.copilotKitAttachmentQueuePreviewVideo{width:100%;height:100%}.copilotKitAttachmentQueuePreviewDocument{align-items:center;gap:8px;display:flex}.copilotKitAttachmentQueueDocIcon{background:var(--copilot-kit-primary-color,#6366f1);color:#fff;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:10px;font-weight:600;display:flex}.copilotKitAttachmentQueueDocInfo{flex-direction:column;gap:2px;min-width:0;display:flex}.copilotKitAttachmentQueueFilename{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;overflow:hidden}.copilotKitAttachmentQueueFileSize{color:var(--copilot-kit-secondary-contrast-color);font-size:11px}.copilotKitDragOver{outline:2px dashed var(--copilot-kit-primary-color,#6366f1);outline-offset:-4px;border-radius:8px}.copilotKitAttachment{flex-direction:column;gap:4px;max-width:100%;display:inline-flex}.copilotKitAttachmentAudio audio{width:100%;max-width:300px;height:40px}.copilotKitAttachmentVideo video{border-radius:8px;width:100%;max-width:400px}.copilotKitAttachmentDocument{border:1px solid var(--copilot-kit-separator-color);background:var(--copilot-kit-input-background-color);border-radius:8px;align-items:center;gap:8px;padding:8px 12px;display:inline-flex}.copilotKitAttachmentDocIcon{background:var(--copilot-kit-primary-color,#6366f1);color:#fff;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;font-size:9px;font-weight:600;display:flex}.copilotKitAttachmentDocInfo{flex-direction:column;gap:1px;min-width:0;display:flex}.copilotKitAttachmentDocName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;overflow:hidden}.copilotKitAttachmentDocMeta{color:var(--copilot-kit-secondary-contrast-color);font-size:11px}.copilotKitWindow{transform-origin:bottom;background-color:var(--copilot-kit-background-color);opacity:0;pointer-events:none;border-color:#e5e7eb;border-radius:.75rem;flex-direction:column;transition:opacity .1s ease-out,transform .2s ease-out;display:flex;position:fixed;inset:0;transform:scale(.95)translateY(20px);box-shadow:0 5px 40px #00000029}.copilotKitSidebar .copilotKitWindow{opacity:1;border-radius:0;transform:translate(100%)}.copilotKitWindow.open{opacity:1;pointer-events:auto;transform:scale(1)translateY(0)}.copilotKitSidebar .copilotKitWindow.open{transform:translate(0)}.copilotKitChatBody{flex-direction:column;flex:1;min-height:0;display:flex}@media (width>=640px){.copilotKitWindow{transform-origin:100% 100%;border-width:0;width:24rem;height:600px;min-height:200px;max-height:calc(100% - 6rem);margin-bottom:1rem;inset:auto 1rem 5rem auto}.copilotKitSidebar .copilotKitWindow{width:28rem;min-height:100%;max-height:none;margin-bottom:0;inset:auto 0 0 auto}}.copilotKitActivityDot1{animation:1.05s infinite copilotKitActivityDotsAnimation}.copilotKitActivityDot2{animation-delay:.1s}.copilotKitActivityDot3{animation-delay:.2s}@keyframes copilotKitActivityDotsAnimation{0%,57.14%{animation-timing-function:cubic-bezier(.33,.66,.66,1);transform:translate(0)}28.57%{animation-timing-function:cubic-bezier(.33,0,.66,.33);transform:translateY(-6px)}to{transform:translate(0)}}@keyframes copilotKitPulseAnimation{50%{opacity:.5}}h1.copilotKitMarkdownElement,h2.copilotKitMarkdownElement,h3.copilotKitMarkdownElement,h4.copilotKitMarkdownElement,h5.copilotKitMarkdownElement,h6.copilotKitMarkdownElement{font-weight:700;line-height:1.2}h1.copilotKitMarkdownElement:not(:last-child),h2.copilotKitMarkdownElement:not(:last-child),h3.copilotKitMarkdownElement:not(:last-child),h4.copilotKitMarkdownElement:not(:last-child),h5.copilotKitMarkdownElement:not(:last-child),h6.copilotKitMarkdownElement:not(:last-child){margin-bottom:1rem}h1.copilotKitMarkdownElement{font-size:1.5em}h2.copilotKitMarkdownElement{font-size:1.25em;font-weight:600}h3.copilotKitMarkdownElement{font-size:1.1em}h4.copilotKitMarkdownElement{font-size:1em}h5.copilotKitMarkdownElement{font-size:.9em}h6.copilotKitMarkdownElement{font-size:.8em}a.copilotKitMarkdownElement{color:#00f;text-decoration:underline}p.copilotKitMarkdownElement{margin:0;padding:0;font-size:1rem;line-height:1.75}p.copilotKitMarkdownElement:not(:last-child),pre.copilotKitMarkdownElement:not(:last-child),ol.copilotKitMarkdownElement:not(:last-child),ul.copilotKitMarkdownElement:not(:last-child),blockquote.copilotKitMarkdownElement:not(:last-child){margin-bottom:1.25em}blockquote.copilotKitMarkdownElement{border-color:#8e8ea0;border-left-style:solid;border-left-width:2px;padding-left:10px;line-height:1.2}blockquote.copilotKitMarkdownElement p{padding:.7em 0}ul.copilotKitMarkdownElement{padding-left:20px;list-style-type:disc;overflow:visible}li.copilotKitMarkdownElement{list-style-type:inherit;margin-left:0;padding-left:0;list-style-position:outside;position:relative;overflow:visible}.copilotKitCodeBlock{background-color:#09090b;border-radius:.375rem;width:100%;position:relative}.copilotKitCodeBlockToolbar{color:#e4e4e4;background-color:#27272a;border-top-left-radius:.375rem;border-top-right-radius:.375rem;justify-content:space-between;align-items:center;width:100%;padding-top:.09rem;padding-bottom:.09rem;padding-left:1rem;font-family:sans-serif;display:flex}.copilotKitCodeBlockToolbarLanguage{text-transform:lowercase;font-size:.75rem;line-height:1rem}.copilotKitCodeBlockToolbarButtons{align-items:center;margin-left:.25rem;margin-right:.25rem;display:flex}.copilotKitCodeBlockToolbarButton{border-radius:.375rem;justify-content:center;align-items:center;height:2.5rem;margin:2px;padding:3px;font-size:.875rem;font-weight:500;line-height:1.25rem;display:inline-flex}.copilotKitCodeBlockToolbarButton:hover{background-color:#37373a}.copilotKitInlineCode{background-color:var(--copilot-kit-input-background-color);border:1px solid var(--copilot-kit-separator-color);border-radius:.375rem;padding:.05rem .4rem;font-size:15px}.copilotKitMessages footer .suggestions{flex-wrap:wrap;gap:6px;display:flex}.copilotKitMessages footer h6{margin-bottom:8px;font-size:.7rem;font-weight:500}.copilotKitMessages footer .suggestions .suggestion{border:1px solid var(--copilot-kit-muted-color);color:var(--copilot-kit-secondary-contrast-color);border-radius:15px;padding:6px 10px;font-size:.7rem;box-shadow:0 5px 5px #00000003,0 2px 3px #00000005}.copilotKitMessages footer .suggestions .suggestion.loading{color:var(--copilot-kit-secondary-contrast-color);border:none;padding:0;font-size:.7rem}.copilotKitMessages footer .suggestions button{transition:transform .3s}.copilotKitMessages footer .suggestions button:not(:disabled):hover{transform:scale(1.03)}.copilotKitMessages footer .suggestions button:disabled{cursor:wait}.copilotKitMessages footer .suggestions button svg{margin-right:6px}.copilotKitChat{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;background:var(--copilot-kit-background-color);font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;flex-direction:column;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;display:flex}.copilotKitChat svg{vertical-align:middle;display:inline-block}.copilotKitChat .copilotKitMessages{flex-grow:1}.copilotKitDevConsole{align-items:center;gap:5px;margin:0 15px;display:flex}.copilotKitDevConsole.copilotKitDevConsoleWarnOutdated{background-color:var(--copilot-kit-dev-console-bg)}.copilotKitDevConsole .copilotKitVersionInfo{background:#ebb305;justify-content:center;align-items:center;gap:10px;width:100%;padding:3px 5px;font-size:.8rem;display:flex;position:absolute;bottom:-25px;left:0}.copilotKitDevConsole .copilotKitVersionInfo button{background-color:var(--copilot-kit-dev-console-bg);text-align:left;white-space:nowrap;text-overflow:ellipsis;border:1px solid #979797;border-radius:4px;width:260px;padding:1px 12px 1px 5px;font-family:monospace;font-size:11px;font-weight:400;display:inline-block;overflow:hidden}.copilotKitDevConsole .copilotKitVersionInfo aside{color:#7f7a7a;margin-left:5px;font-weight:400;display:inline}.copilotKitDevConsole .copilotKitVersionInfo svg{margin-top:-3px;margin-left:3px}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton{border:1px solid var(--copilot-kit-muted-color);background-color:#0000;border-radius:20px;outline:none;justify-content:center;align-items:center;height:30px;padding:0 10px;font-size:11px;font-weight:700;display:flex}.copilotKitDebugMenuTriggerButton.compact{width:35px;color:var(--copilot-kit-dev-console-bg);outline:none;justify-content:center;font-size:8px}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 85%, black);color:var(--copilot-kit-dev-console-text)}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .copilotKitDevConsole .copilotKitDebugMenuTriggerButton{color:#fff}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .copilotKitDevConsole .copilotKitDebugMenuTriggerButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 20%, black)}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton>svg{margin-left:10px}.copilotKitDebugMenu{--copilot-kit-dev-console-border:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 80%, black);background-color:var(--copilot-kit-dev-console-bg);border:1px solid var(--copilot-kit-dev-console-border);border-radius:6px;outline:none;margin-top:2px;padding:.25rem;font-size:13px}.copilotKitDebugMenuItem{text-align:left;cursor:pointer;width:100%;color:var(--copilot-kit-dev-console-text);background:0 0;border:none;padding:3px 10px;display:block}.copilotKitDebugMenuItem:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 95%, black);border-radius:4px}.copilotKitDebugMenu[data-closed]{opacity:0;transform:scale(.95)}.copilotKitDebugMenu hr{background-color:var(--copilot-kit-dev-console-border);border:none;height:1px;margin:.25rem}.copilotKitHelpModal{background-color:var(--copilot-kit-dev-console-bg);color:var(--copilot-kit-dev-console-text)}.copilotKitHelpItemButton{text-align:center;border:1px solid var(--copilot-kit-muted-color);width:100%;color:var(--copilot-kit-dev-console-text);background-color:var(--copilot-kit-dev-console-bg);border-radius:15px;padding:4px 6px;font-size:.8rem;display:block;box-shadow:0 5px 5px #00000003,0 2px 3px #00000005}.copilotKitHelpItemButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 95%, black)}.copilotkit-response{text-align:right}.copilotkit-response-content{color:#4b5563;text-align:left;background-color:#f9fafb;border-radius:.25rem;margin-bottom:.5rem;padding:.5rem;font-size:.875rem}.copilotkit-response-actions{flex-direction:column;align-items:flex-end;display:inline-flex}.copilotkit-response-label{color:#6b7280;align-items:center;margin-bottom:.25rem;font-size:.75rem;display:flex}.copilotkit-toggle-button{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin-right:.25rem;padding:0;display:flex}.copilotkit-icon{color:#6b7280;width:.75rem;height:.75rem}.copilotkit-response-buttons{gap:.5rem;display:flex}.copilotkit-response-button{color:#4b5563;cursor:pointer;background-color:#f3f4f6;border:none;border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;transition:background-color .2s}.copilotkit-response-button:hover{background-color:#e5e7eb}.copilotkit-response-button:focus{outline:none}.copilotkit-response-completed-feedback{background-color:#f9fafb;border-radius:.375rem;align-items:center;padding:.5rem;display:inline-flex}.copilotkit-response-completed-feedback span{color:#4b5563;font-size:.75rem;font-weight:500}.copilotkit-state{margin-bottom:1rem;font-size:.875rem}.copilotkit-state-header{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:.25rem;margin-bottom:.25rem;display:flex}.copilotkit-state-label{color:#4b5563;font-size:.875rem}.copilotkit-state-label-loading{align-items:center;animation:1.5s infinite pulse;display:inline-flex}.copilotkit-state-content{border-left:1px solid #e5e7eb;max-height:250px;margin-left:.375rem;padding-top:.375rem;padding-left:1rem;overflow:auto}.copilotkit-state-item{margin-bottom:.25rem;padding:.25rem 0;transition:all .3s}.copilotkit-state-item-newest{animation:.5s ease-out appear}.copilotkit-state-item-header{opacity:.7;font-size:.75rem}.copilotkit-state-item-thought{opacity:.8;margin-top:.125rem;font-size:.75rem}.copilotkit-state-item-result{margin-top:.125rem;font-size:.75rem}.copilotkit-state-item-description{opacity:.8;margin-top:.125rem;font-size:.75rem}.copilotkit-state-empty{opacity:.7;padding:.25rem 0;font-size:.75rem}.copilotkit-skeleton{padding:.125rem 0;animation:1.5s infinite pulse}.copilotkit-skeleton-header{justify-content:space-between;display:flex}.copilotkit-skeleton-title{background-color:#e5e7eb;border-radius:.25rem;width:4rem;height:.625rem}.copilotkit-skeleton-subtitle{background-color:#e5e7eb;border-radius:.25rem;width:2rem;height:.5rem}.copilotkit-skeleton-content{background-color:#e5e7eb;border-radius:.25rem;height:1.5rem;margin-top:.125rem}.copilotkit-loader,.copilotkit-spinner{animation:1.5s linear infinite spin}@keyframes appear{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes pulse{0%,to{opacity:.4}50%{opacity:1}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-color-scheme:dark){.copilotkit-response-content{color:#9ca3af;background-color:#1f2937}.copilotkit-response-label,.copilotkit-icon{color:#9ca3af}.copilotkit-response-button{color:#d1d5db;background-color:#1f2937}.copilotkit-response-button:hover{background-color:#374151}.copilotkit-response-completed-feedback{background-color:#1f2937}.copilotkit-response-completed-feedback span{color:#e5e7eb}.copilotkit-state-label{color:#d1d5db}.copilotkit-state-content{border-left-color:#374151}.copilotkit-skeleton-title,.copilotkit-skeleton-subtitle,.copilotkit-skeleton-content{background-color:#374151}}
1
+ :root{--copilot-kit-primary-color:#1c1c1c;--copilot-kit-contrast-color:#fff;--copilot-kit-background-color:#fff;--copilot-kit-input-background-color:#fbfbfb;--copilot-kit-secondary-color:#fff;--copilot-kit-secondary-contrast-color:#1c1c1c;--copilot-kit-separator-color:#c8c8c8;--copilot-kit-muted-color:#c8c8c8;--copilot-kit-error-background:#fef2f2;--copilot-kit-error-border:#fecaca;--copilot-kit-error-text:#dc2626;--copilot-kit-shadow-sm:0 1px 2px 0 #0000000d;--copilot-kit-shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;--copilot-kit-shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -2px #0000000d;--copilot-kit-dev-console-bg:#f8f8fa;--copilot-kit-dev-console-text:black}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] :root{--copilot-kit-primary-color:#fff;--copilot-kit-contrast-color:#1c1c1c;--copilot-kit-background-color:#111;--copilot-kit-input-background-color:#2c2c2c;--copilot-kit-secondary-color:#1c1c1c;--copilot-kit-secondary-contrast-color:#fff;--copilot-kit-separator-color:#2d2d2d;--copilot-kit-muted-color:#2d2d2d;--copilot-kit-error-background:#7f1d1d;--copilot-kit-error-border:#dc2626;--copilot-kit-error-text:#fca5a5;--copilot-kit-shadow-sm:0 1px 2px 0 #0000004d;--copilot-kit-shadow-md:0 4px 6px -1px #0006, 0 2px 4px -1px #0000004d;--copilot-kit-shadow-lg:0 10px 15px -3px #0006, 0 4px 6px -2px #0000004d}.copilotKitPopup{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;position:fixed;bottom:1rem;right:1rem}.copilotKitPopup svg{vertical-align:middle;display:inline-block}.copilotKitSidebar{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;position:fixed;bottom:1rem;right:1rem}.copilotKitSidebar svg{vertical-align:middle;display:inline-block}.copilotKitSidebarContentWrapper{margin-right:0;transition:margin-right .3s;overflow:visible}@media (width>=640px){.copilotKitSidebarContentWrapper.sidebarExpanded{margin-right:28rem}}.copilotKitButton{border:1px solid var(--copilot-kit-primary-color);background-color:var(--copilot-kit-primary-color);width:3.5rem;height:3.5rem;color:var(--copilot-kit-contrast-color);cursor:pointer;box-shadow:var(--copilot-kit-shadow-sm);border-radius:50%;outline:none;justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative;transform:scale(1)}.copilotKitButton:hover{box-shadow:var(--copilot-kit-shadow-md);transform:scale(1.05)}.copilotKitButton:active{box-shadow:var(--copilot-kit-shadow-sm);transform:scale(.95)}.copilotKitButtonIcon{justify-content:center;align-items:center;transition:opacity .1s,transform .3s;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.copilotKitButtonIcon svg{width:1.5rem;height:1.5rem}.copilotKitButton.open .copilotKitButtonIconOpen{opacity:0;transform:translate(-50%,-50%)scale(0)rotate(90deg)}.copilotKitButton.open .copilotKitButtonIconClose,.copilotKitButton:not(.open) .copilotKitButtonIconOpen{opacity:1;transform:translate(-50%,-50%)scale(1)rotate(0)}.copilotKitButton:not(.open) .copilotKitButtonIconClose{opacity:0;transform:translate(-50%,-50%)scale(0)rotate(-90deg)}.copilotKitHeader{height:56px;color:var(--copilot-kit-primary-color);border-bottom:1px solid var(--copilot-kit-separator-color);background-color:var(--copilot-kit-contrast-color);z-index:2;border-top-left-radius:0;border-top-right-radius:0;justify-content:space-between;align-items:center;padding-left:1.5rem;font-weight:500;display:flex;position:relative}.copilotKitSidebar .copilotKitHeader{border-radius:0}.copilotKitHeaderControls{display:flex}.copilotKitHeaderCloseButton{background:0 0;border:none}@media (width>=640px){.copilotKitHeader{border-top-left-radius:8px;border-top-right-radius:8px;padding-left:1.5rem;padding-right:24px}}.copilotKitHeader>button{color:var(--copilot-kit-muted-color);cursor:pointer;background-color:#0000;border:0;border-radius:50%;outline:none;justify-content:center;align-items:center;width:35px;height:35px;padding:8px;transition:background-color .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.copilotKitHeader>button:hover{color:color-mix(in srgb, var(--copilot-kit-muted-color) 80%, black)}.copilotKitHeader>button:focus{outline:none}.copilotKitInput{cursor:text;background-color:var(--copilot-kit-input-background-color);border:1px solid var(--copilot-kit-separator-color);border-radius:20px;width:95%;min-height:75px;margin:0 auto;padding:12px 14px;position:relative}.copilotKitInputContainer{background:var(--copilot-kit-background-color);border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem;width:100%;padding:0 0 15px}.copilotKitSidebar .copilotKitInputContainer{border-bottom-right-radius:0;border-bottom-left-radius:0}.copilotKitInputControlButton{cursor:pointer;color:#00000040;appearance:button;text-transform:none;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;text-indent:0;text-shadow:none;text-align:center;background-color:#0000;background-image:none;border:0;width:24px;height:24px;margin:0;padding:0;transition-property:transform;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-block;transform:scale(1)}.copilotKitInputControlButton:not([disabled]){color:var(--copilot-kit-primary-color)}.copilotKitInputControlButton:not([disabled]):hover{color:color-mix(in srgb, var(--copilot-kit-primary-color) 80%, black);transform:scale(1.05)}.copilotKitInputControlButton[disabled]{color:var(--copilot-kit-muted-color);cursor:default}.copilotKitInputControls{gap:3px;display:flex}.copilotKitInput>textarea{outline-offset:2px;resize:none;white-space:pre-wrap;overflow-wrap:break-word;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;cursor:text;font-family:inherit;font-size:.875rem;line-height:1.5rem;font-weight:inherit;color:var(--copilot-kit-secondary-contrast-color);background-color:#0000;border:0;outline:2px solid #0000;flex:1;width:100%;margin:0;padding:0}.copilotKitInput>textarea::placeholder{color:gray;opacity:1}.copilotKitInputControlButton.copilotKitPushToTalkRecording{color:#fff;background-color:#ec0000;border-radius:50%;animation:2s cubic-bezier(.4,0,.6,1) infinite copilotKitPulseAnimation}.copilotKitInput textarea::-webkit-scrollbar{width:9px}.copilotKitInput textarea::-webkit-scrollbar-track{background:0 0}.copilotKitInput textarea::-webkit-scrollbar-thumb{cursor:pointer;background-color:#c8c8c8;background-clip:content-box;border:2px solid #0000;border-radius:10px}.copilotKitInput textarea::-webkit-scrollbar-thumb:hover{background-color:#a0a0a0}.poweredByContainer{padding:0}.poweredBy{background:var(--copilot-kit-background-color)!important;visibility:visible!important;text-align:center!important;color:#d6d6d6!important;margin:0!important;padding:3px 0!important;font-size:12px!important;display:block!important;position:static!important}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .poweredBy{color:#454545!important}.copilotKitMessages{background-color:var(--copilot-kit-background-color);color:var(--copilot-kit-secondary-contrast-color);z-index:1;flex-direction:column;flex:1;justify-content:space-between;display:flex;overflow-y:scroll}.copilotKitMessagesContainer{flex-direction:column;padding:1rem 24px;display:flex}.copilotKitMessagesFooter{flex-direction:column;justify-content:flex-start;width:97%;margin:8px auto 0;padding:.5rem .75rem;display:flex}.copilotKitMessages::-webkit-scrollbar{width:6px}.copilotKitMessages::-webkit-scrollbar-thumb{background-color:var(--copilot-kit-separator-color);border:2px solid var(--copilot-kit-background-color);border-radius:10rem}.copilotKitMessages::-webkit-scrollbar-track-piece:start{background:0 0}.copilotKitMessages::-webkit-scrollbar-track-piece:end{background:0 0}.copilotKitMessage{overflow-wrap:break-word;border-radius:15px;max-width:80%;margin-bottom:.5rem;padding:8px 12px;font-size:1rem;line-height:1.5}.copilotKitMessage.copilotKitUserMessage{background:var(--copilot-kit-primary-color);color:var(--copilot-kit-contrast-color);white-space:pre-wrap;margin-left:auto;font-size:1rem;line-height:1.75}.copilotKitMessage.copilotKitAssistantMessage{max-width:100%;color:var(--copilot-kit-secondary-contrast-color);background:0 0;margin-right:auto;padding-left:0;position:relative}.copilotKitMessage.copilotKitAssistantMessage .copilotKitMessageControls{opacity:0;gap:1rem;padding:5px 0 0;transition:opacity .2s;display:flex;position:absolute;left:0}.copilotKitMessageControls.currentMessage{opacity:1!important}.copilotKitMessage.copilotKitAssistantMessage:hover .copilotKitMessageControls{opacity:1}@media (width<=768px){.copilotKitMessage.copilotKitAssistantMessage .copilotKitMessageControls{opacity:1}}.copilotKitMessageControlButton{width:20px;height:20px;color:var(--copilot-kit-primary-color);cursor:pointer;z-index:10;background:0 0;border:none;border-radius:.5rem;justify-content:center;align-items:center;margin:0;padding:0;transition:all .2s;display:flex}.copilotKitMessageControlButton:hover,.copilotKitMessageControlButton:active{color:color-mix(in srgb, var(--copilot-kit-primary-color) 80%, black);transform:scale(1.05)}.copilotKitMessageControlButton.active{background-color:var(--copilot-kit-primary-color);color:var(--copilot-kit-contrast-color)}.copilotKitMessageControlButton.active:hover{background-color:color-mix(in srgb, var(--copilot-kit-primary-color) 90%, black);color:var(--copilot-kit-contrast-color)}.copilotKitMessageControlButton svg{pointer-events:none;width:1rem;height:1rem;display:block}.copilotKitMessage.copilotKitAssistantMessage+.copilotKitMessage.copilotKitUserMessage{margin-top:1.5rem}.copilotKitCustomAssistantMessage{margin-top:1.5rem;margin-bottom:1.5rem}.copilotKitMessage .inProgressLabel{opacity:.7;margin-left:10px}@keyframes copilotKitSpinAnimation{to{transform:rotate(360deg)}}.copilotKitSpinner{border:2px solid var(--copilot-kit-contrast-color);border-top-color:var(--copilot-kit-primary-color);border-radius:50%;width:16px;height:16px;animation:1s linear infinite copilotKitSpinAnimation;display:inline-block}@keyframes copilotKitActivityDotAnimation{0%,80%,to{opacity:.5;transform:scale(.5)}40%{opacity:1;transform:scale(1)}}.copilotKitActivityDot{background-color:var(--copilot-kit-primary-color);border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite both copilotKitActivityDotAnimation;display:inline-block}.copilotKitImageRendering{flex-direction:column;gap:8px;display:flex}.copilotKitImageRenderingImage{max-width:100%;height:auto;box-shadow:var(--copilot-kit-shadow-sm);border-radius:8px}.copilotKitImageRenderingContent{color:var(--copilot-kit-secondary-contrast-color);margin-top:8px;padding:0 16px;font-size:.875rem;line-height:1.5}.copilotKitImageRenderingError{border:1px solid var(--copilot-kit-separator-color);background-color:var(--copilot-kit-input-background-color);border-radius:8px;flex-direction:column;gap:8px;padding:12px;display:flex}.copilotKitImageRenderingErrorMessage{background-color:var(--copilot-kit-error-background);border:1px solid var(--copilot-kit-error-border);color:var(--copilot-kit-error-text);border-radius:6px;align-items:center;gap:8px;padding:8px 12px;font-size:.875rem;font-weight:500;display:flex}.copilotKitImageRenderingErrorMessage:before{content:"⚠️";font-size:1rem}.copilotKitAttachmentQueue{flex-wrap:wrap;gap:8px;margin:8px;padding:8px;display:flex}.copilotKitAttachmentQueueItem{border:1px solid var(--copilot-kit-separator-color);background:var(--copilot-kit-input-background-color);border-radius:8px;display:inline-flex;position:relative;overflow:hidden}.copilotKitAttachmentQueueItem--image,.copilotKitAttachmentQueueItem--video{width:72px;height:72px}.copilotKitAttachmentQueueItem--audio{flex-direction:column;min-width:200px;max-width:280px;padding:4px}.copilotKitAttachmentQueueItem--document{max-width:200px;padding:8px 12px}.copilotKitAttachmentQueueOverlay{z-index:1;background:#0006;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.copilotKitAttachmentQueueSpinner{border:2px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:20px;height:20px;animation:.6s linear infinite copilotKitSpin}@keyframes copilotKitSpin{to{transform:rotate(360deg)}}.copilotKitAttachmentQueueRemoveButton{color:#fff;cursor:pointer;z-index:2;background:#0009;border:none;border-radius:50%;justify-content:center;align-items:center;width:20px;height:20px;padding:0;font-size:10px;line-height:1;display:flex;position:absolute;top:4px;right:4px}.copilotKitAttachmentQueueRemoveButton:hover{background:#000c}.copilotKitAttachmentQueuePreviewPlaceholder{background:var(--copilot-kit-input-background-color);width:100%;height:100%}.copilotKitAttachmentQueuePreviewImage{object-fit:cover;width:100%;height:100%}.copilotKitAttachmentQueuePreviewAudio{flex-direction:column;gap:4px;width:100%;display:flex}.copilotKitAttachmentQueuePreviewAudio audio{width:100%;height:32px}.copilotKitAttachmentQueuePreviewVideo{width:100%;height:100%}.copilotKitAttachmentQueuePreviewDocument{align-items:center;gap:8px;display:flex}.copilotKitAttachmentQueueDocIcon{background:var(--copilot-kit-primary-color,#6366f1);color:#fff;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:10px;font-weight:600;display:flex}.copilotKitAttachmentQueueDocInfo{flex-direction:column;gap:2px;min-width:0;display:flex}.copilotKitAttachmentQueueFilename{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;overflow:hidden}.copilotKitAttachmentQueueFileSize{color:var(--copilot-kit-secondary-contrast-color);font-size:11px}.copilotKitDragOver{outline:2px dashed var(--copilot-kit-primary-color,#6366f1);outline-offset:-4px;border-radius:8px}.copilotKitAttachment{flex-direction:column;gap:4px;max-width:100%;display:inline-flex}.copilotKitAttachmentAudio audio{width:100%;max-width:300px;height:40px}.copilotKitAttachmentVideo video{border-radius:8px;width:100%;max-width:400px}.copilotKitAttachmentDocument{border:1px solid var(--copilot-kit-separator-color);background:var(--copilot-kit-input-background-color);border-radius:8px;align-items:center;gap:8px;padding:8px 12px;display:inline-flex}.copilotKitAttachmentDocIcon{background:var(--copilot-kit-primary-color,#6366f1);color:#fff;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;font-size:9px;font-weight:600;display:flex}.copilotKitAttachmentDocInfo{flex-direction:column;gap:1px;min-width:0;display:flex}.copilotKitAttachmentDocName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;overflow:hidden}.copilotKitAttachmentDocMeta{color:var(--copilot-kit-secondary-contrast-color);font-size:11px}.copilotKitWindow{transform-origin:bottom;background-color:var(--copilot-kit-background-color);opacity:0;pointer-events:none;border-color:#e5e7eb;border-radius:.75rem;flex-direction:column;transition:opacity .1s ease-out,transform .2s ease-out;display:flex;position:fixed;inset:0;transform:scale(.95)translateY(20px);box-shadow:0 5px 40px #00000029}.copilotKitSidebar .copilotKitWindow{opacity:1;border-radius:0;transform:translate(100%)}.copilotKitWindow.open{opacity:1;pointer-events:auto;transform:scale(1)translateY(0)}.copilotKitSidebar .copilotKitWindow.open{transform:translate(0)}.copilotKitChatBody{flex-direction:column;flex:1;min-height:0;display:flex}@media (width>=640px){.copilotKitWindow{transform-origin:100% 100%;border-width:0;width:24rem;height:600px;min-height:200px;max-height:calc(100% - 6rem);margin-bottom:1rem;inset:auto 1rem 5rem auto}.copilotKitSidebar .copilotKitWindow{width:28rem;min-height:100%;max-height:none;margin-bottom:0;inset:auto 0 0 auto}}.copilotKitActivityDot1{animation:1.05s infinite copilotKitActivityDotsAnimation}.copilotKitActivityDot2{animation-delay:.1s}.copilotKitActivityDot3{animation-delay:.2s}@keyframes copilotKitActivityDotsAnimation{0%,57.14%{animation-timing-function:cubic-bezier(.33,.66,.66,1);transform:translate(0)}28.57%{animation-timing-function:cubic-bezier(.33,0,.66,.33);transform:translateY(-6px)}to{transform:translate(0)}}@keyframes copilotKitPulseAnimation{50%{opacity:.5}}h1.copilotKitMarkdownElement,h2.copilotKitMarkdownElement,h3.copilotKitMarkdownElement,h4.copilotKitMarkdownElement,h5.copilotKitMarkdownElement,h6.copilotKitMarkdownElement{font-weight:700;line-height:1.2}h1.copilotKitMarkdownElement:not(:last-child),h2.copilotKitMarkdownElement:not(:last-child),h3.copilotKitMarkdownElement:not(:last-child),h4.copilotKitMarkdownElement:not(:last-child),h5.copilotKitMarkdownElement:not(:last-child),h6.copilotKitMarkdownElement:not(:last-child){margin-bottom:1rem}h1.copilotKitMarkdownElement{font-size:1.5em}h2.copilotKitMarkdownElement{font-size:1.25em;font-weight:600}h3.copilotKitMarkdownElement{font-size:1.1em}h4.copilotKitMarkdownElement{font-size:1em}h5.copilotKitMarkdownElement{font-size:.9em}h6.copilotKitMarkdownElement{font-size:.8em}a.copilotKitMarkdownElement{color:#00f;text-decoration:underline}p.copilotKitMarkdownElement{margin:0;padding:0;font-size:1rem;line-height:1.75}p.copilotKitMarkdownElement:not(:last-child),pre.copilotKitMarkdownElement:not(:last-child),ol.copilotKitMarkdownElement:not(:last-child),ul.copilotKitMarkdownElement:not(:last-child),blockquote.copilotKitMarkdownElement:not(:last-child){margin-bottom:1.25em}blockquote.copilotKitMarkdownElement{border-color:#8e8ea0;border-left-style:solid;border-left-width:2px;padding-left:10px;line-height:1.2}blockquote.copilotKitMarkdownElement p{padding:.7em 0}ul.copilotKitMarkdownElement{padding-left:20px;list-style-type:disc;overflow:visible}li.copilotKitMarkdownElement{list-style-type:inherit;margin-left:0;padding-left:0;list-style-position:outside;position:relative;overflow:visible}.copilotKitCodeBlock{background-color:#09090b;border-radius:.375rem;width:100%;position:relative}.copilotKitCodeBlockToolbar{color:#e4e4e4;background-color:#27272a;border-top-left-radius:.375rem;border-top-right-radius:.375rem;justify-content:space-between;align-items:center;width:100%;padding-top:.09rem;padding-bottom:.09rem;padding-left:1rem;font-family:sans-serif;display:flex}.copilotKitCodeBlockToolbarLanguage{text-transform:lowercase;font-size:.75rem;line-height:1rem}.copilotKitCodeBlockToolbarButtons{align-items:center;margin-left:.25rem;margin-right:.25rem;display:flex}.copilotKitCodeBlockToolbarButton{border-radius:.375rem;justify-content:center;align-items:center;height:2.5rem;margin:2px;padding:3px;font-size:.875rem;font-weight:500;line-height:1.25rem;display:inline-flex}.copilotKitCodeBlockToolbarButton:hover{background-color:#37373a}.copilotKitInlineCode{background-color:var(--copilot-kit-input-background-color);border:1px solid var(--copilot-kit-separator-color);border-radius:.375rem;padding:.05rem .4rem;font-size:15px}.copilotKitMessages footer .suggestions{flex-wrap:wrap;gap:6px;display:flex}.copilotKitMessages footer h6{margin-bottom:8px;font-size:.7rem;font-weight:500}.copilotKitMessages footer .suggestions .suggestion{border:1px solid var(--copilot-kit-muted-color);color:var(--copilot-kit-secondary-contrast-color);border-radius:15px;padding:6px 10px;font-size:.7rem;box-shadow:0 5px 5px #00000003,0 2px 3px #00000005}.copilotKitMessages footer .suggestions .suggestion.loading{color:var(--copilot-kit-secondary-contrast-color);border:none;padding:0;font-size:.7rem}.copilotKitMessages footer .suggestions button{transition:transform .3s}.copilotKitMessages footer .suggestions button:not(:disabled):hover{transform:scale(1.03)}.copilotKitMessages footer .suggestions button:disabled{cursor:wait}.copilotKitMessages footer .suggestions button svg{margin-right:6px}.copilotKitChat{z-index:30;-webkit-text-size-adjust:100%;tab-size:4;background:var(--copilot-kit-background-color);font-feature-settings:normal;font-variation-settings:normal;touch-action:manipulation;flex-direction:column;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;display:flex}.copilotKitChat svg{vertical-align:middle;display:inline-block}.copilotKitChat .copilotKitMessages{flex-grow:1}.copilotKitDevConsole{align-items:center;gap:5px;margin:0 15px;display:flex}.copilotKitDevConsole.copilotKitDevConsoleWarnOutdated{background-color:var(--copilot-kit-dev-console-bg)}.copilotKitDevConsole .copilotKitVersionInfo{background:#ebb305;justify-content:center;align-items:center;gap:10px;width:100%;padding:3px 5px;font-size:.8rem;display:flex;position:absolute;bottom:-25px;left:0}.copilotKitDevConsole .copilotKitVersionInfo button{background-color:var(--copilot-kit-dev-console-bg);text-align:left;white-space:nowrap;text-overflow:ellipsis;border:1px solid #979797;border-radius:4px;width:260px;padding:1px 12px 1px 5px;font-family:monospace;font-size:11px;font-weight:400;display:inline-block;overflow:hidden}.copilotKitDevConsole .copilotKitVersionInfo aside{color:#7f7a7a;margin-left:5px;font-weight:400;display:inline}.copilotKitDevConsole .copilotKitVersionInfo svg{margin-top:-3px;margin-left:3px}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton{border:1px solid var(--copilot-kit-muted-color);background-color:#0000;border-radius:20px;outline:none;justify-content:center;align-items:center;height:30px;padding:0 10px;font-size:11px;font-weight:700;display:flex}.copilotKitDebugMenuTriggerButton.compact{width:35px;color:var(--copilot-kit-dev-console-bg);outline:none;justify-content:center;font-size:8px}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 85%, black);color:var(--copilot-kit-dev-console-text)}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .copilotKitDevConsole .copilotKitDebugMenuTriggerButton{color:#fff}.dark,html.dark,body.dark,[data-theme=dark],html[style*="color-scheme: dark"],body[style*="color-scheme: dark"] .copilotKitDevConsole .copilotKitDebugMenuTriggerButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 20%, black)}.copilotKitDevConsole .copilotKitDebugMenuTriggerButton>svg{margin-left:10px}.copilotKitDebugMenu{--copilot-kit-dev-console-border:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 80%, black);background-color:var(--copilot-kit-dev-console-bg);border:1px solid var(--copilot-kit-dev-console-border);border-radius:6px;outline:none;margin-top:2px;padding:.25rem;font-size:13px}.copilotKitDebugMenuItem{text-align:left;cursor:pointer;width:100%;color:var(--copilot-kit-dev-console-text);background:0 0;border:none;padding:3px 10px;display:block}.copilotKitDebugMenuItem:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 95%, black);border-radius:4px}.copilotKitDebugMenu[data-closed]{opacity:0;transform:scale(.95)}.copilotKitDebugMenu hr{background-color:var(--copilot-kit-dev-console-border);border:none;height:1px;margin:.25rem}.copilotKitHelpModal{background-color:var(--copilot-kit-dev-console-bg);color:var(--copilot-kit-dev-console-text)}.copilotKitHelpItemButton{text-align:center;border:1px solid var(--copilot-kit-muted-color);width:100%;color:var(--copilot-kit-dev-console-text);background-color:var(--copilot-kit-dev-console-bg);border-radius:15px;padding:4px 6px;font-size:.8rem;display:block;box-shadow:0 5px 5px #00000003,0 2px 3px #00000005}.copilotKitHelpItemButton:hover{background-color:color-mix(in srgb, var(--copilot-kit-dev-console-bg) 95%, black)}.copilotkit-response{text-align:right}.copilotkit-response-content{color:#4b5563;text-align:left;background-color:#f9fafb;border-radius:.25rem;margin-bottom:.5rem;padding:.5rem;font-size:.875rem}.copilotkit-response-actions{flex-direction:column;align-items:flex-end;display:inline-flex}.copilotkit-response-label{color:#6b7280;align-items:center;margin-bottom:.25rem;font-size:.75rem;display:flex}.copilotkit-toggle-button{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin-right:.25rem;padding:0;display:flex}.copilotkit-icon{color:#6b7280;width:.75rem;height:.75rem}.copilotkit-response-buttons{gap:.5rem;display:flex}.copilotkit-response-button{color:#4b5563;cursor:pointer;background-color:#f3f4f6;border:none;border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;transition:background-color .2s}.copilotkit-response-button:hover{background-color:#e5e7eb}.copilotkit-response-button:focus{outline:none}.copilotkit-response-completed-feedback{background-color:#f9fafb;border-radius:.375rem;align-items:center;padding:.5rem;display:inline-flex}.copilotkit-response-completed-feedback span{color:#4b5563;font-size:.75rem;font-weight:500}.copilotkit-state{margin-bottom:1rem;font-size:.875rem}.copilotkit-state-header{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:.25rem;margin-bottom:.25rem;display:flex}.copilotkit-state-label{color:#4b5563;font-size:.875rem}.copilotkit-state-label-loading{align-items:center;animation:1.5s infinite pulse;display:inline-flex}.copilotkit-state-content{border-left:1px solid #e5e7eb;max-height:250px;margin-left:.375rem;padding-top:.375rem;padding-left:1rem;overflow:auto}.copilotkit-state-item{margin-bottom:.25rem;padding:.25rem 0;transition:all .3s}.copilotkit-state-item-newest{animation:.5s ease-out appear}.copilotkit-state-item-header{opacity:.7;font-size:.75rem}.copilotkit-state-item-thought{opacity:.8;margin-top:.125rem;font-size:.75rem}.copilotkit-state-item-result{margin-top:.125rem;font-size:.75rem}.copilotkit-state-item-description{opacity:.8;margin-top:.125rem;font-size:.75rem}.copilotkit-state-empty{opacity:.7;padding:.25rem 0;font-size:.75rem}.copilotkit-skeleton{padding:.125rem 0;animation:1.5s infinite pulse}.copilotkit-skeleton-header{justify-content:space-between;display:flex}.copilotkit-skeleton-title{background-color:#e5e7eb;border-radius:.25rem;width:4rem;height:.625rem}.copilotkit-skeleton-subtitle{background-color:#e5e7eb;border-radius:.25rem;width:2rem;height:.5rem}.copilotkit-skeleton-content{background-color:#e5e7eb;border-radius:.25rem;height:1.5rem;margin-top:.125rem}.copilotkit-loader,.copilotkit-spinner{animation:1.5s linear infinite spin}@keyframes appear{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes pulse{0%,to{opacity:.4}50%{opacity:1}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-color-scheme:dark){.copilotkit-response-content{color:#9ca3af;background-color:#1f2937}.copilotkit-response-label,.copilotkit-icon{color:#9ca3af}.copilotkit-response-button{color:#d1d5db;background-color:#1f2937}.copilotkit-response-button:hover{background-color:#374151}.copilotkit-response-completed-feedback{background-color:#1f2937}.copilotkit-response-completed-feedback span{color:#e5e7eb}.copilotkit-state-label{color:#d1d5db}.copilotkit-state-content{border-left-color:#374151}.copilotkit-skeleton-title,.copilotkit-skeleton-subtitle,.copilotkit-skeleton-content{background-color:#374151}}.erica-drag-overlay{z-index:50;pointer-events:none;background-color:#f0fdfae6;border-radius:.5rem;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.erica-drag-overlay-text{color:#0d9488;font-size:.875rem;font-weight:500}.erica-file-list{flex-direction:column;gap:.5rem;margin-bottom:.5rem;display:flex}.erica-file-item{border-radius:.5rem;justify-content:space-between;align-items:center;padding:.5rem .75rem;display:flex}.erica-file-item--error{background-color:#fef2f2}.erica-file-item--done{background-color:#f0fdf4}.erica-file-item--uploading{background-color:#f3f4f6}.erica-file-content{border-radius:.5rem;flex:1;align-items:center;gap:.5rem;transition:background-color .2s;display:flex}.erica-file-content--clickable{cursor:pointer;margin:-.5rem -.75rem;padding:.5rem .75rem}.erica-file-content--clickable:hover{background-color:#dcfce7}.erica-spinner{border:2px solid;border-top-color:#0000;border-radius:9999px;width:1rem;height:1rem;animation:1s linear infinite erica-spin}.erica-spinner--gray{border-color:#6b7280}.erica-spinner--green{border-color:#22c55e}@keyframes erica-spin{to{transform:rotate(360deg)}}.erica-icon-sm{width:1rem;height:1rem}.erica-icon-md{width:1.25rem;height:1.25rem}.erica-icon-green{color:#16a34a}.erica-icon-red{color:#dc2626}.erica-icon-gray{color:#6b7280}.erica-file-info{flex:1;min-width:0}.erica-file-name{text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:500;overflow:hidden}.erica-file-name--error{color:#b91c1c}.erica-file-name--done{color:#15803d}.erica-file-name--uploading{color:#374151}.erica-file-status{color:#6b7280;font-size:.75rem}.erica-downloading-badge{color:#16a34a;margin-left:.5rem;font-size:.75rem}.erica-download-icon{color:#16a34a;opacity:0;width:1rem;height:1rem;transition:opacity .2s}.erica-file-content--clickable:hover .erica-download-icon{opacity:1}.erica-remove-button{cursor:pointer;background:0 0;border:none;border-radius:.25rem;margin-left:.5rem;padding:.25rem;transition:background-color .2s}.erica-remove-button:hover{background-color:#0000001a}.erica-remove-button:disabled{opacity:.5;cursor:not-allowed}.erica-textarea{resize:none;overflow:auto}.erica-file-input{display:none}.erica-attach-button{margin-right:.5rem}.erica-spacer{flex-grow:1}.erica-header{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:.75rem 1rem;display:flex}.erica-header-title{color:#111827;font-size:1.125rem;font-weight:600}.erica-header-controls{align-items:center;gap:.5rem;display:flex;position:relative}.erica-new-chat-button{color:#fff;cursor:pointer;background-color:#111827;border:none;border-radius:.5rem;padding:.5rem;transition:background-color .2s}.erica-new-chat-button:hover{background-color:#374151}.erica-threads-toggle{cursor:pointer;background:0 0;border:none;border-radius:.5rem;align-items:center;gap:.375rem;padding:.5rem .75rem;transition:background-color .2s;display:flex}.erica-threads-toggle:hover{background-color:#f3f4f6}.erica-threads-toggle-text{color:#374151;font-size:.875rem;font-weight:500}.erica-threads-toggle-icon{color:#6b7280;width:1rem;height:1rem;transition:transform .2s}.erica-threads-toggle-icon--open{transform:rotate(180deg)}.erica-threads-dropdown{z-index:50;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;width:18rem;max-height:20rem;margin-top:.25rem;position:absolute;top:100%;right:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.erica-threads-dropdown-content{padding:.5rem}.erica-threads-dropdown-header{color:#6b7280;text-transform:uppercase;padding:.5rem .75rem;font-size:.75rem;font-weight:600}.erica-threads-empty{text-align:center;color:#6b7280;padding:1rem .75rem;font-size:.875rem}.erica-thread-item{text-align:left;cursor:pointer;background:0 0;border:none;border-radius:.5rem;width:100%;padding:.5rem .75rem;transition:background-color .2s}.erica-thread-item:hover{background-color:#f3f4f6}.erica-thread-item-content{flex-direction:column;gap:.25rem;display:flex}.erica-thread-title{color:#111827;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:500;overflow:hidden}.erica-thread-meta{justify-content:space-between;align-items:center;gap:.5rem;display:flex}.erica-thread-agent{color:#6b7280;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:.75rem;overflow:hidden}.erica-thread-time{color:#9ca3af;flex-shrink:0;font-size:.75rem}
2
2
  /*$vite$:1*/
package/dist/index.cjs CHANGED
@@ -3,16 +3,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
3
3
 
4
4
  `);p=a.pop()??``;for(let e of a){let t=e.split(`
5
5
  `),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
6
- `);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var ot=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},st=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},ct=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},lt=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(st(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=ot(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):X({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},X=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},ut=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=ct(r),s=Object.entries(i).map(([t,i])=>X({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},dt=/\{[^{}]+\}/g,ft=({path:e,url:t})=>{let n=t,r=t.match(dt);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,lt({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,ut({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${X({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},pt=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=ft({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function mt(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var ht=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},gt=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=lt({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=ut({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=X({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},_t=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},vt=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,yt=async({security:e,...t})=>{for(let n of e){if(vt(t,n.name))continue;let e=await ht(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},bt=e=>pt({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:gt(e.querySerializer),url:e.url}),xt=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Ct(e.headers,t.headers),n},St=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},Ct=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?St(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},Z=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},wt=()=>({error:new Z,request:new Z,response:new Z}),Tt=gt({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),Et={"Content-Type":`application/json`},Dt=(e={})=>({...it,headers:Et,parseAs:`auto`,querySerializer:Tt,...e}),Q=((e={})=>{let t=xt(Dt(),e),n=()=>({...t}),r=e=>(t=xt(t,e),n()),i=wt(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:Ct(t.headers,e.headers),serializedBody:void 0};n.security&&await yt({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:bt(r)}},o=async e=>{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:mt(t)},o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let s=t.fetch,c;try{c=await s(o)}catch(e){let n=e;for(let r of i.error.fns)r&&(n=await r(e,void 0,o,t));if(n||={},t.throwOnError)throw n;return t.responseStyle===`data`?void 0:{error:n,request:o,response:void 0}}for(let e of i.response.fns)e&&(c=await e(c,o,t));let l={request:o,response:c};if(c.ok){let e=(t.parseAs===`auto`?_t(c.headers.get(`Content-Type`)):t.parseAs)??`json`;if(c.status===204||c.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await c[e]();break;case`formData`:n=new FormData;break;case`stream`:n=c.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await c[e]();break;case`json`:{let e=await c.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?c.body:{data:c.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await c.text(),d;try{d=JSON.parse(u)}catch{}let f=d??u,p=f;for(let e of i.error.fns)e&&(p=await e(f,c,o,t));if(p||={},t.throwOnError)throw p;return t.responseStyle===`data`?void 0:{error:p,...l}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return at({...n,body:n.body,headers:n.headers,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:mt(n),url:r})};return{buildUrl:e=>bt({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(Dt({baseUrl:`http://localhost:9000/api/widget`}));function Ot(e,t){Q.setConfig({baseUrl:e,headers:t?{Authorization:`Bearer ${t}`}:void 0})}var kt=e=>(e?.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/threads`,...e}),At=e=>(e.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/threads/{threadUid}`,...e}),jt=e=>(e.client??Q).post({...rt,security:[{scheme:`bearer`,type:`http`}],url:`/attachments/upload`,...e,headers:{"Content-Type":null,...e.headers}}),Mt=e=>(e.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/attachments/{filename}`,...e}),$={upload:async(e,t,n)=>{let{data:r}=await jt({body:{file:e,prefix:t,ocr:n},throwOnError:!0});return r.data},download:async(e,t)=>{let n=e.split(`/`),r=n[n.length-1],i=n.slice(-3,-1).join(`/`),{data:a}=await Mt({path:{filename:r},query:i?{prefix:i}:{},parseAs:`blob`,throwOnError:!0}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}};function Nt({onSend:e,inProgress:t,threadId:n}){let[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)([]),[s,u]=(0,c.useState)(!1),[d,f]=(0,c.useState)(null),p=(0,c.useRef)(null),m=(0,c.useRef)(null),h=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=p.current;if(e){e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`}},[r]);async function g(e){let t=`${e.name}-${Date.now()}`;o(n=>[...n,{id:t,name:e.name,mimeType:e.type||`application/octet-stream`,status:`uploading`}]);try{let r=await $.upload(e,`thread/${n||crypto.randomUUID()}`,!0);o(e=>e.map(e=>e.id===t?{...e,status:`done`,response:r}:e))}catch(e){let n=e instanceof Error?e.message:`Upload failed`;o(e=>e.map(e=>e.id===t?{...e,status:`error`,errorMessage:n}:e))}}function _(e){let t=e.target.files;if(!t||t.length===0)return;let n=new Set(a.map(e=>e.name));Array.from(t).filter(e=>!n.has(e.name)).forEach(g),e.target.value=``}function v(e){o(t=>t.filter(t=>t.id!==e))}async function y(e){if(e.response){f(e.id);try{await $.download(e.response.file_path,e.response.original_name)}catch(t){console.error(`Download failed:`,t),alert(`Failed to download ${e.name}`)}finally{f(null)}}}function b(e){e.preventDefault(),h.current+=1,e.dataTransfer.types.includes(`Files`)&&u(!0)}function x(e){e.preventDefault(),--h.current,h.current===0&&u(!1)}function S(e){e.preventDefault()}function C(e){e.preventDefault(),h.current=0,u(!1);let t=Array.from(e.dataTransfer.files);if(t.length===0)return;let n=new Set(a.map(e=>e.name));t.filter(e=>!n.has(e.name)).forEach(g)}function w(){if(!r.trim()&&a.length===0)return;let t=a.filter(e=>e.status===`done`).filter(e=>e.response!==null).map(e=>e.response).map(({ocr_result:e,...t})=>({...t,ocr_result:e?.markdown_files})),n=r;t.length>0&&(n+=`\n\n\`\`\`attachments\n${JSON.stringify(t,null,2)}\n\`\`\``),e(n),i(``),o([])}function T(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),w())}function E(){p.current?.focus()}return(0,l.jsxs)(`div`,{className:`copilotKitInputContainer relative`,onDragEnter:b,onDragLeave:x,onDragOver:S,onDrop:C,children:[s&&(0,l.jsx)(`div`,{className:`absolute inset-0 z-50 bg-teal-50/90 rounded-lg flex items-center justify-center pointer-events-none`,children:(0,l.jsx)(`p`,{className:`text-sm font-medium text-teal-600`,children:`Drop files to attach`})}),a.length>0&&(0,l.jsx)(`div`,{className:`flex flex-col gap-2 mb-2`,children:a.map(e=>(0,l.jsxs)(`div`,{className:`
7
- px-3 py-2 rounded-lg flex items-center justify-between
8
- ${e.status===`error`?`bg-red-50`:e.status===`done`?`bg-green-50`:`bg-gray-100`}
9
- `,children:[(0,l.jsxs)(`div`,{className:`
10
- flex items-center gap-2 flex-1 rounded-lg transition-colors
11
- ${e.status===`done`?`cursor-pointer hover:bg-green-100 -mx-3 -my-2 px-3 py-2`:``}
12
- `,onClick:()=>e.status===`done`&&y(e),role:e.status===`done`?`button`:void 0,tabIndex:e.status===`done`?0:void 0,children:[e.status===`uploading`?(0,l.jsx)(`div`,{className:`w-4 h-4 border-2 border-gray-500 border-t-transparent rounded-full animate-spin`}):d===e.id?(0,l.jsx)(`div`,{className:`w-4 h-4 border-2 border-green-500 border-t-transparent rounded-full animate-spin`}):e.status===`done`?(0,l.jsx)(Y,{className:`w-4 h-4 text-green-600`}):(0,l.jsx)(Y,{className:`w-4 h-4 text-red-600`}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`
13
- text-sm font-medium truncate
14
- ${e.status===`error`?`text-red-700`:e.status===`done`?`text-green-700`:`text-gray-700`}
15
- `,children:[e.name,d===e.id&&(0,l.jsx)(`span`,{className:`ml-2 text-xs text-green-600`,children:`Downloading...`})]}),(0,l.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[e.status===`uploading`&&`Uploading...`,e.status===`done`&&`Ready · Click to download`,e.status===`error`&&(e.errorMessage||`Upload failed`)]})]}),e.status===`done`&&!d&&(0,l.jsx)($e,{className:`w-4 h-4 text-green-600 opacity-0 group-hover:opacity-100 transition-opacity`})]}),(0,l.jsx)(`button`,{onClick:t=>{t.stopPropagation(),v(e.id)},disabled:e.status===`uploading`,className:`ml-2 p-1 hover:bg-black/10 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Remove ${e.name}`,children:(0,l.jsx)(tt,{className:`w-4 h-4 text-gray-500`})})]},e.id))}),(0,l.jsxs)(`div`,{className:`copilotKitInput`,onClick:E,children:[(0,l.jsx)(`textarea`,{ref:p,value:r,onChange:e=>i(e.target.value),onKeyDown:T,placeholder:a.length>0?`Ask about ${a.length} file${a.length>1?`s`:``}...`:`Type a message or attach files...`,className:`overflow-auto resize-none`,rows:1,disabled:t}),(0,l.jsxs)(`div`,{className:`copilotKitInputControls`,children:[(0,l.jsx)(`input`,{ref:m,type:`file`,onChange:_,className:`hidden`,disabled:t,multiple:!0}),(0,l.jsx)(`button`,{onClick:()=>m.current?.click(),disabled:t,className:`copilotKitInputControlButton mr-2`,"aria-label":`Attach files`,title:`Attach files (drag & drop supported)`,children:(0,l.jsx)(Y,{className:`w-5 h-5`})}),(0,l.jsx)(`div`,{className:`grow`}),(0,l.jsx)(`button`,{onClick:w,disabled:t||!r.trim()&&a.filter(e=>e.status===`done`).length===0,"data-copilotkit-in-progress":t,className:`copilotKitInputControlButton`,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:`1.5`,stroke:`currentColor`,width:`24`,height:`24`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 19V5m0 0l-7 7m7-7l7 7`})})})]})]})]})}var Pt={list:async(e=15)=>{let{data:t}=await kt({query:{page:1,page_size:e},throwOnError:!0});return t.data??[]},get:async e=>{let{data:t}=await At({path:{threadUid:e},throwOnError:!0});return t.data}},Ft={all:()=>[`widget-threads`],detail:e=>[`widget-threads`,e]},It=(e=15)=>Ue({queryKey:Ft.all(),queryFn:()=>Pt.list(e),staleTime:15e3,refetchOnWindowFocus:!0});function Lt(e){if(!e)return``;let t=e.split(`:`);return(t.length>1?t.slice(1).join(` `):e).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Rt(e){if(!e)return``;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:i<7?`${i}d ago`:new Date(e).toLocaleDateString()}function zt({onNewChat:e,onThreadSelect:t}){let[n,r]=(0,c.useState)(!1),i=(0,c.useRef)(null),{data:a=[],isLoading:o}=It();(0,c.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r(!1)}if(n)return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[n]);function s(e){r(!1),t?.(e)}return(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-gray-200`,children:[(0,l.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:`Erica Assistant`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 relative`,ref:i,children:[(0,l.jsx)(`button`,{onClick:e,className:`p-2 bg-gray-900 hover:bg-gray-700 text-white rounded-lg transition-colors`,title:`Start new chat`,children:(0,l.jsx)(et,{className:`w-4 h-4`})}),(0,l.jsxs)(`button`,{onClick:()=>r(!n),className:`flex items-center gap-1.5 px-3 py-2 hover:bg-gray-100 rounded-lg transition-colors`,title:`Recent threads`,children:[(0,l.jsxs)(`span`,{className:`text-sm font-medium text-gray-700`,children:[`Threads `,a.length>0&&`(${a.length})`]}),(0,l.jsx)(Qe,{className:`w-4 h-4 text-gray-500 transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,l.jsx)(`div`,{className:`absolute top-full right-0 mt-1 w-72 bg-white rounded-lg shadow-lg border border-gray-200 z-50 max-h-80 overflow-y-auto`,children:(0,l.jsxs)(`div`,{className:`p-2`,children:[(0,l.jsx)(`div`,{className:`px-3 py-2 text-xs font-semibold text-gray-500 uppercase`,children:`Recent Threads`}),o&&(0,l.jsx)(`div`,{className:`px-3 py-4 text-center text-sm text-gray-500`,children:`Loading threads...`}),!o&&a.length===0&&(0,l.jsx)(`div`,{className:`px-3 py-4 text-center text-sm text-gray-500`,children:`No conversations yet`}),!o&&a.map(e=>{let t=Lt(e.agent),n=Rt(e.last_run_at??e.created_at);return(0,l.jsx)(`button`,{onClick:()=>s(e.uid),className:`w-full text-left px-3 py-2 hover:bg-gray-100 rounded-lg transition-colors`,children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,l.jsx)(`span`,{className:`text-sm font-medium text-gray-900 truncate`,children:typeof e.thread_metadata?.title==`string`?e.thread_metadata.title:e.last_message??`New conversation`}),(0,l.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[t&&(0,l.jsx)(`span`,{className:`text-xs text-gray-500 truncate flex-1`,children:t}),n&&(0,l.jsx)(`span`,{className:`text-xs text-gray-400 shrink-0`,children:n})]})]})},e.uid)})]})})]})]})}var Bt=new Ee({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});function Vt({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,c.useState)(void 0),i=(0,c.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,c.useMemo)(()=>{Ot(i,t)},[i,t]);let a=(0,c.useCallback)(()=>{r(void 0),console.log(`New chat started`)},[]),o=(0,c.useCallback)(e=>{r(e),console.log(`Thread selected:`,e)},[]),s=(0,c.useCallback)(e=>(0,l.jsx)(Nt,{...e,threadId:n}),[n]),f=(0,c.useCallback)(()=>(0,l.jsx)(zt,{onNewChat:a,onThreadSelect:o}),[a,o]);return(0,l.jsx)(ke,{client:Bt,children:(0,l.jsx)(`div`,{className:`h-full w-full`,children:(0,l.jsx)(u.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`platform:ultimate`},threadId:n,children:(0,l.jsx)(d.CopilotSidebar,{labels:{initial:`Hi! How can I help you today?
6
+ `);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var ot=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},st=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},ct=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},lt=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(st(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=ot(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):X({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},X=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},ut=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=ct(r),s=Object.entries(i).map(([t,i])=>X({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},dt=/\{[^{}]+\}/g,ft=({path:e,url:t})=>{let n=t,r=t.match(dt);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,lt({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,ut({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${X({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},pt=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=ft({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function mt(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var ht=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},gt=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=lt({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=ut({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=X({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},_t=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},vt=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,yt=async({security:e,...t})=>{for(let n of e){if(vt(t,n.name))continue;let e=await ht(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},bt=e=>pt({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:gt(e.querySerializer),url:e.url}),xt=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Ct(e.headers,t.headers),n},St=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},Ct=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?St(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},Z=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},wt=()=>({error:new Z,request:new Z,response:new Z}),Tt=gt({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),Et={"Content-Type":`application/json`},Dt=(e={})=>({...it,headers:Et,parseAs:`auto`,querySerializer:Tt,...e}),Q=((e={})=>{let t=xt(Dt(),e),n=()=>({...t}),r=e=>(t=xt(t,e),n()),i=wt(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:Ct(t.headers,e.headers),serializedBody:void 0};n.security&&await yt({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:bt(r)}},o=async e=>{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:mt(t)},o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let s=t.fetch,c;try{c=await s(o)}catch(e){let n=e;for(let r of i.error.fns)r&&(n=await r(e,void 0,o,t));if(n||={},t.throwOnError)throw n;return t.responseStyle===`data`?void 0:{error:n,request:o,response:void 0}}for(let e of i.response.fns)e&&(c=await e(c,o,t));let l={request:o,response:c};if(c.ok){let e=(t.parseAs===`auto`?_t(c.headers.get(`Content-Type`)):t.parseAs)??`json`;if(c.status===204||c.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await c[e]();break;case`formData`:n=new FormData;break;case`stream`:n=c.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await c[e]();break;case`json`:{let e=await c.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?c.body:{data:c.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await c.text(),d;try{d=JSON.parse(u)}catch{}let f=d??u,p=f;for(let e of i.error.fns)e&&(p=await e(f,c,o,t));if(p||={},t.throwOnError)throw p;return t.responseStyle===`data`?void 0:{error:p,...l}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return at({...n,body:n.body,headers:n.headers,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:mt(n),url:r})};return{buildUrl:e=>bt({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(Dt({baseUrl:`http://localhost:9000/api/widget`}));function Ot(e,t){Q.setConfig({baseUrl:e,headers:t?{Authorization:`Bearer ${t}`}:void 0})}var kt=e=>(e?.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/threads`,...e}),At=e=>(e.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/threads/{threadUid}`,...e}),jt=e=>(e.client??Q).post({...rt,security:[{scheme:`bearer`,type:`http`}],url:`/attachments/upload`,...e,headers:{"Content-Type":null,...e.headers}}),Mt=e=>(e.client??Q).get({security:[{scheme:`bearer`,type:`http`}],url:`/attachments/{filename}`,...e}),$={upload:async(e,t,n)=>{let{data:r}=await jt({body:{file:e,prefix:t,ocr:n},throwOnError:!0});return r.data},download:async(e,t)=>{let n=e.split(`/`),r=n[n.length-1],i=n.slice(-3,-1).join(`/`),{data:a}=await Mt({path:{filename:r},query:i?{prefix:i}:{},parseAs:`blob`,throwOnError:!0}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}};function Nt({onSend:e,inProgress:t,threadId:n}){let[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)([]),[s,u]=(0,c.useState)(!1),[d,f]=(0,c.useState)(null),p=(0,c.useRef)(null),m=(0,c.useRef)(null),h=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=p.current;if(e){e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`}},[r]);async function g(e){let t=`${e.name}-${Date.now()}`;o(n=>[...n,{id:t,name:e.name,mimeType:e.type||`application/octet-stream`,status:`uploading`}]);try{let r=await $.upload(e,`thread/${n||crypto.randomUUID()}`,!0);o(e=>e.map(e=>e.id===t?{...e,status:`done`,response:r}:e))}catch(e){let n=e instanceof Error?e.message:`Upload failed`;o(e=>e.map(e=>e.id===t?{...e,status:`error`,errorMessage:n}:e))}}function _(e){let t=e.target.files;if(!t||t.length===0)return;let n=new Set(a.map(e=>e.name));Array.from(t).filter(e=>!n.has(e.name)).forEach(g),e.target.value=``}function v(e){o(t=>t.filter(t=>t.id!==e))}async function y(e){if(e.response){f(e.id);try{await $.download(e.response.file_path,e.response.original_name)}catch(t){console.error(`Download failed:`,t),alert(`Failed to download ${e.name}`)}finally{f(null)}}}function b(e){e.preventDefault(),h.current+=1,e.dataTransfer.types.includes(`Files`)&&u(!0)}function x(e){e.preventDefault(),--h.current,h.current===0&&u(!1)}function S(e){e.preventDefault()}function C(e){e.preventDefault(),h.current=0,u(!1);let t=Array.from(e.dataTransfer.files);if(t.length===0)return;let n=new Set(a.map(e=>e.name));t.filter(e=>!n.has(e.name)).forEach(g)}function w(){if(!r.trim()&&a.length===0)return;let t=a.filter(e=>e.status===`done`).filter(e=>e.response!==null).map(e=>e.response).map(({ocr_result:e,...t})=>({...t,ocr_result:e?.markdown_files})),n=r;t.length>0&&(n+=`\n\n\`\`\`attachments\n${JSON.stringify(t,null,2)}\n\`\`\``),e(n),i(``),o([])}function T(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),w())}function E(){p.current?.focus()}return(0,l.jsxs)(`div`,{className:`copilotKitInputContainer relative`,onDragEnter:b,onDragLeave:x,onDragOver:S,onDrop:C,children:[s&&(0,l.jsx)(`div`,{className:`erica-drag-overlay`,children:(0,l.jsx)(`p`,{className:`erica-drag-overlay-text`,children:`Drop files to attach`})}),a.length>0&&(0,l.jsx)(`div`,{className:`erica-file-list`,children:a.map(e=>(0,l.jsxs)(`div`,{className:`erica-file-item ${e.status===`error`?`erica-file-item--error`:e.status===`done`?`erica-file-item--done`:`erica-file-item--uploading`}`,children:[(0,l.jsxs)(`div`,{className:`erica-file-content ${e.status===`done`?`erica-file-content--clickable`:``}`,onClick:()=>e.status===`done`&&y(e),role:e.status===`done`?`button`:void 0,tabIndex:e.status===`done`?0:void 0,children:[e.status===`uploading`?(0,l.jsx)(`div`,{className:`erica-spinner erica-spinner--gray`}):d===e.id?(0,l.jsx)(`div`,{className:`erica-spinner erica-spinner--green`}):e.status===`done`?(0,l.jsx)(Y,{className:`erica-icon-sm erica-icon-green`}):(0,l.jsx)(Y,{className:`erica-icon-sm erica-icon-red`}),(0,l.jsxs)(`div`,{className:`erica-file-info`,children:[(0,l.jsxs)(`div`,{className:`erica-file-name ${e.status===`error`?`erica-file-name--error`:e.status===`done`?`erica-file-name--done`:`erica-file-name--uploading`}`,children:[e.name,d===e.id&&(0,l.jsx)(`span`,{className:`erica-downloading-badge`,children:`Downloading...`})]}),(0,l.jsxs)(`div`,{className:`erica-file-status`,children:[e.status===`uploading`&&`Uploading...`,e.status===`done`&&`Ready · Click to download`,e.status===`error`&&(e.errorMessage||`Upload failed`)]})]}),e.status===`done`&&!d&&(0,l.jsx)($e,{className:`erica-download-icon`})]}),(0,l.jsx)(`button`,{onClick:t=>{t.stopPropagation(),v(e.id)},disabled:e.status===`uploading`,className:`erica-remove-button`,"aria-label":`Remove ${e.name}`,children:(0,l.jsx)(tt,{className:`erica-icon-sm erica-icon-gray`})})]},e.id))}),(0,l.jsxs)(`div`,{className:`copilotKitInput`,onClick:E,children:[(0,l.jsx)(`textarea`,{ref:p,value:r,onChange:e=>i(e.target.value),onKeyDown:T,placeholder:a.length>0?`Ask about ${a.length} file${a.length>1?`s`:``}...`:`Type a message or attach files...`,className:`erica-textarea`,rows:1,disabled:t}),(0,l.jsxs)(`div`,{className:`copilotKitInputControls`,children:[(0,l.jsx)(`input`,{ref:m,type:`file`,onChange:_,className:`erica-file-input`,disabled:t,multiple:!0}),(0,l.jsx)(`button`,{onClick:()=>m.current?.click(),disabled:t,className:`copilotKitInputControlButton erica-attach-button`,"aria-label":`Attach files`,title:`Attach files (drag & drop supported)`,children:(0,l.jsx)(Y,{className:`erica-icon-md`})}),(0,l.jsx)(`div`,{className:`erica-spacer`}),(0,l.jsx)(`button`,{onClick:w,disabled:t||!r.trim()&&a.filter(e=>e.status===`done`).length===0,"data-copilotkit-in-progress":t,className:`copilotKitInputControlButton`,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:`1.5`,stroke:`currentColor`,width:`24`,height:`24`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 19V5m0 0l-7 7m7-7l7 7`})})})]})]})]})}var Pt={list:async(e=15)=>{let{data:t}=await kt({query:{page:1,page_size:e},throwOnError:!0});return t.data??[]},get:async e=>{let{data:t}=await At({path:{threadUid:e},throwOnError:!0});return t.data}},Ft={all:()=>[`widget-threads`],detail:e=>[`widget-threads`,e]},It=(e=15)=>Ue({queryKey:Ft.all(),queryFn:()=>Pt.list(e),staleTime:15e3,refetchOnWindowFocus:!0});function Lt(e){if(!e)return``;let t=e.split(`:`);return(t.length>1?t.slice(1).join(` `):e).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Rt(e){if(!e)return``;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:i<7?`${i}d ago`:new Date(e).toLocaleDateString()}function zt({onNewChat:e,onThreadSelect:t}){let[n,r]=(0,c.useState)(!1),i=(0,c.useRef)(null),{data:a=[],isLoading:o}=It();(0,c.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r(!1)}if(n)return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[n]);function s(e){r(!1),t?.(e)}return(0,l.jsxs)(`div`,{className:`erica-header`,children:[(0,l.jsx)(`h2`,{className:`erica-header-title`,children:`Erica Assistant`}),(0,l.jsxs)(`div`,{className:`erica-header-controls`,ref:i,children:[(0,l.jsx)(`button`,{onClick:e,className:`erica-new-chat-button`,title:`Start new chat`,children:(0,l.jsx)(et,{className:`erica-icon-sm`})}),(0,l.jsxs)(`button`,{onClick:()=>r(!n),className:`erica-threads-toggle`,title:`Recent threads`,children:[(0,l.jsxs)(`span`,{className:`erica-threads-toggle-text`,children:[`Threads `,a.length>0&&`(${a.length})`]}),(0,l.jsx)(Qe,{className:`erica-threads-toggle-icon ${n?`erica-threads-toggle-icon--open`:``}`})]}),n&&(0,l.jsx)(`div`,{className:`erica-threads-dropdown`,children:(0,l.jsxs)(`div`,{className:`erica-threads-dropdown-content`,children:[(0,l.jsx)(`div`,{className:`erica-threads-dropdown-header`,children:`Recent Threads`}),o&&(0,l.jsx)(`div`,{className:`erica-threads-empty`,children:`Loading threads...`}),!o&&a.length===0&&(0,l.jsx)(`div`,{className:`erica-threads-empty`,children:`No conversations yet`}),!o&&a.map(e=>{let t=Lt(e.agent),n=Rt(e.last_run_at??e.created_at);return(0,l.jsx)(`button`,{onClick:()=>s(e.uid),className:`erica-thread-item`,children:(0,l.jsxs)(`div`,{className:`erica-thread-item-content`,children:[(0,l.jsx)(`span`,{className:`erica-thread-title`,children:typeof e.thread_metadata?.title==`string`?e.thread_metadata.title:e.last_message??`New conversation`}),(0,l.jsxs)(`div`,{className:`erica-thread-meta`,children:[t&&(0,l.jsx)(`span`,{className:`erica-thread-agent`,children:t}),n&&(0,l.jsx)(`span`,{className:`erica-thread-time`,children:n})]})]})},e.uid)})]})})]})]})}var Bt=new Ee({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});function Vt({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,c.useState)(void 0),i=(0,c.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,c.useMemo)(()=>{Ot(i,t)},[i,t]);let a=(0,c.useCallback)(()=>{r(void 0),console.log(`New chat started`)},[]),o=(0,c.useCallback)(e=>{r(e),console.log(`Thread selected:`,e)},[]),s=(0,c.useCallback)(e=>(0,l.jsx)(Nt,{...e,threadId:n}),[n]),f=(0,c.useCallback)(()=>(0,l.jsx)(zt,{onNewChat:a,onThreadSelect:o}),[a,o]);return(0,l.jsx)(ke,{client:Bt,children:(0,l.jsx)(`div`,{className:`h-full w-full`,children:(0,l.jsx)(u.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`platform:ultimate`},threadId:n,children:(0,l.jsx)(d.CopilotSidebar,{labels:{initial:`Hi! How can I help you today?
16
7
 
17
8
  You can:
18
9
  - Ask me questions