libre-webui 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{j as e,a as J}from"./markdown-vendor-D-79K2xZ.js";import{r as p}from"./router-vendor-B-t91v39.js";import{u as O,c as T,B as t}from"../assets/index-D2xXFYj3.js";import{v as w,a2 as v,C as y,J as j,d as C,au as S,av as N,E as U,a3 as z,a6 as R,y as V,H as M}from"./ui-vendor-VxSCY_bv.js";const _={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},$={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},q={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#1a1b26",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.5rem"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},constant:{color:"#bd93f9"},symbol:{color:"#bd93f9"},deleted:{color:"#ff5555"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#f1fa8c"},char:{color:"#f1fa8c"},builtin:{color:"#8be9fd"},inserted:{color:"#50fa7b"},operator:{color:"#ff79c6"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#8be9fd"},".language-css .token.string":{color:"#f1fa8c"},".style .token.string":{color:"#f1fa8c"},atrule:{color:"#ff79c6"},"attr-value":{color:"#f1fa8c"},keyword:{color:"#ff79c6"},function:{color:"#50fa7b"},"class-name":{color:"#8be9fd"},regex:{color:"#f1fa8c"},important:{color:"#ff5555",fontWeight:"bold"},variable:{color:"#f8f8f2"}},I={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",c:"cpp","c++":"cpp"},P=["javascript","typescript","python","java","cpp","bash","json","markdown","css","html","jsx","xml"],H=({children:o,language:i,isDark:n=!1,className:a=""})=>{const{theme:c}=O(),l=c.mode==="ophelia",s=I[i.toLowerCase()]||i.toLowerCase();if(!P.includes(s))return e.jsx("pre",{className:`bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1b26] p-3 rounded-lg overflow-x-auto text-sm font-mono ${a}`,children:e.jsx("code",{className:"ophelia:text-[#f8f8f2]",children:o})});const d=l?q:n?_:$;return e.jsx(J,{language:s,style:d,className:a,customStyle:{margin:0,padding:"0.75rem",borderRadius:"0.5rem",fontSize:"0.875rem",...l&&{background:"#1a1b26"}},showLineNumbers:!1,children:o})},G=({artifact:o,className:i,isFullscreen:n=!1,onFullscreenToggle:a})=>{const[c,l]=p.useState(!1),[s,d]=p.useState("preview"),F=p.useRef(null),{theme:m}=O(),b=async r=>{try{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)}catch(h){console.error("Failed to copy:",h)}},u=()=>{const r=new Blob([o.content],{type:A(o.type)}),h=URL.createObjectURL(r),g=document.createElement("a");g.href=h,g.download=`${o.title}.${B(o.type)}`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(h)},A=r=>{switch(r){case"html":return"text/html";case"react":return"text/javascript";case"svg":return"image/svg+xml";case"css":return"text/css";case"json":return"application/json";default:return"text/plain"}},B=r=>{switch(r){case"html":return"html";case"react":return"jsx";case"svg":return"svg";case"css":return"css";case"json":return"json";default:return"txt"}},k=()=>{switch(o.type){case"html":return e.jsx(V,{className:"h-4 w-4"});case"react":return e.jsx(R,{className:"h-4 w-4"});case"svg":return e.jsx(z,{className:"h-4 w-4"});case"code":return e.jsx(R,{className:"h-4 w-4"});default:return e.jsx(z,{className:"h-4 w-4"})}},L=()=>{const r=`
1
+ import{j as e,a as J}from"./markdown-vendor-D-79K2xZ.js";import{r as p}from"./router-vendor-B-t91v39.js";import{u as O,c as T,B as t}from"../assets/index-CE4fvnod.js";import{v as w,a2 as v,C as y,J as j,d as C,au as S,av as N,E as U,a3 as z,a6 as R,y as V,H as M}from"./ui-vendor-VxSCY_bv.js";const _={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},$={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},q={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#1a1b26",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.5rem"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},constant:{color:"#bd93f9"},symbol:{color:"#bd93f9"},deleted:{color:"#ff5555"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#f1fa8c"},char:{color:"#f1fa8c"},builtin:{color:"#8be9fd"},inserted:{color:"#50fa7b"},operator:{color:"#ff79c6"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#8be9fd"},".language-css .token.string":{color:"#f1fa8c"},".style .token.string":{color:"#f1fa8c"},atrule:{color:"#ff79c6"},"attr-value":{color:"#f1fa8c"},keyword:{color:"#ff79c6"},function:{color:"#50fa7b"},"class-name":{color:"#8be9fd"},regex:{color:"#f1fa8c"},important:{color:"#ff5555",fontWeight:"bold"},variable:{color:"#f8f8f2"}},I={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",c:"cpp","c++":"cpp"},P=["javascript","typescript","python","java","cpp","bash","json","markdown","css","html","jsx","xml"],H=({children:o,language:i,isDark:n=!1,className:a=""})=>{const{theme:c}=O(),l=c.mode==="ophelia",s=I[i.toLowerCase()]||i.toLowerCase();if(!P.includes(s))return e.jsx("pre",{className:`bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1b26] p-3 rounded-lg overflow-x-auto text-sm font-mono ${a}`,children:e.jsx("code",{className:"ophelia:text-[#f8f8f2]",children:o})});const d=l?q:n?_:$;return e.jsx(J,{language:s,style:d,className:a,customStyle:{margin:0,padding:"0.75rem",borderRadius:"0.5rem",fontSize:"0.875rem",...l&&{background:"#1a1b26"}},showLineNumbers:!1,children:o})},G=({artifact:o,className:i,isFullscreen:n=!1,onFullscreenToggle:a})=>{const[c,l]=p.useState(!1),[s,d]=p.useState("preview"),F=p.useRef(null),{theme:m}=O(),b=async r=>{try{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)}catch(h){console.error("Failed to copy:",h)}},u=()=>{const r=new Blob([o.content],{type:A(o.type)}),h=URL.createObjectURL(r),g=document.createElement("a");g.href=h,g.download=`${o.title}.${B(o.type)}`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(h)},A=r=>{switch(r){case"html":return"text/html";case"react":return"text/javascript";case"svg":return"image/svg+xml";case"css":return"text/css";case"json":return"application/json";default:return"text/plain"}},B=r=>{switch(r){case"html":return"html";case"react":return"jsx";case"svg":return"svg";case"css":return"css";case"json":return"json";default:return"txt"}},k=()=>{switch(o.type){case"html":return e.jsx(V,{className:"h-4 w-4"});case"react":return e.jsx(R,{className:"h-4 w-4"});case"svg":return e.jsx(z,{className:"h-4 w-4"});case"code":return e.jsx(R,{className:"h-4 w-4"});default:return e.jsx(z,{className:"h-4 w-4"})}},L=()=>{const r=`
2
2
  <!DOCTYPE html>
3
3
  <html>
4
4
  <head>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./markdown-vendor-D-79K2xZ.js";import{r as d}from"./router-vendor-B-t91v39.js";import{A as c}from"./ArtifactContainer-ejQccmTT.js";import{B as l}from"../assets/index-D2xXFYj3.js";import"./react-vendor-N--QU9DW.js";import"./ui-vendor-VxSCY_bv.js";import"./utils-vendor-DNzxLBGx.js";const i=[{id:"demo-html-1",type:"html",title:"Interactive Button Demo",description:"A simple HTML page with interactive elements",content:`<div style="text-align: center; padding: 20px;">
1
+ import{j as e}from"./markdown-vendor-D-79K2xZ.js";import{r as d}from"./router-vendor-B-t91v39.js";import{A as c}from"./ArtifactContainer-BoHnMmlC.js";import{B as l}from"../assets/index-CE4fvnod.js";import"./react-vendor-N--QU9DW.js";import"./ui-vendor-VxSCY_bv.js";import"./utils-vendor-DNzxLBGx.js";const i=[{id:"demo-html-1",type:"html",title:"Interactive Button Demo",description:"A simple HTML page with interactive elements",content:`<div style="text-align: center; padding: 20px;">
2
2
  <h1 style="color: #333; font-family: Arial, sans-serif;">Welcome to Libre WebUI!</h1>
3
3
  <p style="color: #666; font-size: 16px;">This is an interactive HTML artifact.</p>
4
4
  <button
@@ -1,4 +1,4 @@
1
- import{o as k0,f as q0,m as u0,s as Cn,h as jn,c as Dn,v as Bn,S as In,j as d,M as En}from"./markdown-vendor-D-79K2xZ.js";import{R as Bt,r as R,c as Xt,b as Fn,a as qn,u as Rn}from"./router-vendor-B-t91v39.js";import{u as g0,c as K,t as Yt,a as pa,b as be,p as br,f as On,d as It,S as Ln,T as Pn,B as Ve,e as yr,g as J0,w as ge,h as wr}from"../assets/index-D2xXFYj3.js";import{O as Hn,A as $n}from"./ArtifactContainer-ejQccmTT.js";import{C as nt,J as fa,b as Gn,O as z0,m as Vn,L as ga,e as va,Q as Un,V as Wn,k as Et,W as Xn,p as xa,Y as Yn,X as v0,o as Kn,_ as kr,$ as Z0,a0 as Jn,a1 as Zn,a2 as Qn,U as ba,a3 as ya,a4 as _n,z as de,a5 as es,a6 as ts,B as ft,Z as Ft,g as rs,j as wa,a7 as ka,a8 as Sa,n as Ma,a9 as Na,t as R0,aa as as,c as ns,I as ss}from"./ui-vendor-VxSCY_bv.js";import"./react-vendor-N--QU9DW.js";import"./utils-vendor-DNzxLBGx.js";function is(r,e){const t=String(r);let a=t.indexOf(e),n=a,s=0,l=0;for(;a!==-1;)a===n?++s>l&&(l=s):s=1,n=a+e.length,a=t.indexOf(e,n);return l}function ls(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:n,mathFlowFence:a,mathFlowFenceMeta:t,mathFlowValue:u,mathText:l,mathTextData:u}};function r(c){const p={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[p]}},c)}function e(){this.buffer()}function t(){const c=this.resume(),p=this.stack[this.stack.length-1];k0(p.type==="math"),p.meta=c}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function n(c){const p=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];k0(f.type==="math"),this.exit(c),f.value=p;const g=f.data.hChildren[0];k0(g.type==="element"),k0(g.tagName==="code"),g.children.push({type:"text",value:p}),this.data.mathFlowInside=void 0}function s(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function l(c){const p=this.resume(),f=this.stack[this.stack.length-1];k0(f.type==="inlineMath"),this.exit(c),f.value=p,f.data.hChildren.push({type:"text",value:p})}function u(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function os(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),a.peek=n,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
1
+ import{o as k0,f as q0,m as u0,s as Cn,h as jn,c as Dn,v as Bn,S as In,j as d,M as En}from"./markdown-vendor-D-79K2xZ.js";import{R as Bt,r as R,c as Xt,b as Fn,a as qn,u as Rn}from"./router-vendor-B-t91v39.js";import{u as g0,c as K,t as Yt,a as pa,b as be,p as br,f as On,d as It,S as Ln,T as Pn,B as Ve,e as yr,g as J0,w as ge,h as wr}from"../assets/index-CE4fvnod.js";import{O as Hn,A as $n}from"./ArtifactContainer-BoHnMmlC.js";import{C as nt,J as fa,b as Gn,O as z0,m as Vn,L as ga,e as va,Q as Un,V as Wn,k as Et,W as Xn,p as xa,Y as Yn,X as v0,o as Kn,_ as kr,$ as Z0,a0 as Jn,a1 as Zn,a2 as Qn,U as ba,a3 as ya,a4 as _n,z as de,a5 as es,a6 as ts,B as ft,Z as Ft,g as rs,j as wa,a7 as ka,a8 as Sa,n as Ma,a9 as Na,t as R0,aa as as,c as ns,I as ss}from"./ui-vendor-VxSCY_bv.js";import"./react-vendor-N--QU9DW.js";import"./utils-vendor-DNzxLBGx.js";function is(r,e){const t=String(r);let a=t.indexOf(e),n=a,s=0,l=0;for(;a!==-1;)a===n?++s>l&&(l=s):s=1,n=a+e.length,a=t.indexOf(e,n);return l}function ls(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:n,mathFlowFence:a,mathFlowFenceMeta:t,mathFlowValue:u,mathText:l,mathTextData:u}};function r(c){const p={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[p]}},c)}function e(){this.buffer()}function t(){const c=this.resume(),p=this.stack[this.stack.length-1];k0(p.type==="math"),p.meta=c}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function n(c){const p=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];k0(f.type==="math"),this.exit(c),f.value=p;const g=f.data.hChildren[0];k0(g.type==="element"),k0(g.tagName==="code"),g.children.push({type:"text",value:p}),this.data.mathFlowInside=void 0}function s(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function l(c){const p=this.resume(),f=this.stack[this.stack.length-1];k0(f.type==="inlineMath"),this.exit(c),f.value=p,f.data.hChildren.push({type:"text",value:p})}function u(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function os(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),a.peek=n,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
2
2
  `,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:a}};function t(s,l,u,c){const p=s.value||"",f=u.createTracker(c),g="$".repeat(Math.max(is(p,"$")+1,2)),b=u.enter("mathFlow");let w=f.move(g);if(s.meta){const M=u.enter("mathFlowMeta");w+=f.move(u.safe(s.meta,{after:`
3
3
  `,before:w,encode:["$"],...f.current()})),M()}return w+=f.move(`
4
4
  `),p&&(w+=f.move(p+`
@@ -278,4 +278,4 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
278
278
  "field2": { "type": "number" }
279
279
  },
280
280
  "required": ["field1"]
281
- }`,rows:8,className:"font-mono text-sm"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ve,{onClick:p,size:"sm",disabled:!s.trim(),children:"Apply Schema"}),d.jsx(Ve,{onClick:()=>{n(!1),l("")},variant:"outline",size:"sm",children:"Cancel"})]})]}),f(),r&&d.jsxs("div",{className:"flex items-center text-xs text-green-600 dark:text-green-400",children:[d.jsx(ya,{className:"h-3 w-3 mr-1"}),"Structured output enabled"]})]})},at=({models:r,selectedModel:e,onModelChange:t,currentPersona:a,className:n,disabled:s=!1,compact:l=!1})=>{const[u,c]=R.useState(!1),[p,f]=R.useState(""),g=R.useRef(null),b=R.useRef(null),M=[{type:"personas",label:"Personas",icon:d.jsx(Et,{className:"h-4 w-4 text-purple-600 dark:text-purple-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>z.isPersona),color:"purple"},{type:"ollama",label:"Ollama Models",icon:d.jsx(ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>!z.isPersona&&!z.isPlugin),color:"green"},{type:"plugins",label:"Plugin Models",icon:d.jsx(Ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>z.isPlugin),color:"green"}].filter(z=>z.models.length>0).map(z=>({...z,models:z.models.filter(C=>C.name.toLowerCase().includes(p.toLowerCase())||C.personaName&&C.personaName.toLowerCase().includes(p.toLowerCase())||C.pluginName&&C.pluginName.toLowerCase().includes(p.toLowerCase()))})).filter(z=>z.models.length>0),k=r.find(z=>z.name===e||e.startsWith("persona:")&&z.name===e);R.useEffect(()=>{const z=C=>{g.current&&!g.current.contains(C.target)&&(c(!1),f(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]),R.useEffect(()=>{u&&b.current&&b.current.focus()},[u]);const D=z=>{t({target:{value:z}}),c(!1),f("")},I=z=>z.isPersona?d.jsx(Et,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}):z.isPlugin?d.jsx(Ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}):d.jsx(ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),N=z=>z.isPersona?z.personaName||z.name:z.isPlugin?`${z.name}`:z.name,B=z=>z.isPersona?`via ${z.model}`:z.isPlugin?`via ${z.pluginName}`:null,L=()=>{if(!k)return l?d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(ft,{className:"h-4 w-4"}),d.jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 truncate",children:"Select Model"})]}):"Select Model";if(l){const j=N(k);return d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I(k),d.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-200 ophelia:text-[#e5e5e5] truncate",children:j})]})}const z=N(k),C=B(k);return d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I(k),d.jsxs("div",{className:"flex flex-col min-w-0",children:[d.jsx("span",{className:"text-sm font-medium truncate",children:z}),C&&d.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:C})]}),k.isPersona&&a&&d.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[d.jsx(Z0,{className:"h-3 w-3 text-purple-600 dark:text-purple-400"}),a.embedding_model&&d.jsx(wa,{className:"h-3 w-3 text-purple-500 dark:text-purple-300"})]})]})};return d.jsxs("div",{className:K("relative",n),ref:g,children:[d.jsxs("button",{type:"button",onClick:()=>!s&&c(!u),disabled:s,className:K(l?"h-[44px] sm:h-[52px] px-3 flex items-center justify-between text-left w-full ":"w-full flex items-center justify-between gap-2 px-3 py-2 text-left ","bg-gray-50 dark:bg-dark-200 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626]","rounded-lg text-sm hover:bg-gray-100 dark:hover:bg-dark-100 ophelia:hover:bg-[#1a1a1a]","focus:outline-none focus:ring-2 focus:ring-primary-500/20 ophelia:focus:ring-[#9333ea]/20 focus:border-primary-500 ophelia:focus:border-[#9333ea]",s?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:l?k?N(k):"Select Model":void 0,children:[L(),d.jsx(z0,{className:K(l?"h-3 w-3":"h-4 w-4","text-gray-400 flex-shrink-0",u&&"rotate-180")})]}),u&&Xt.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[999999] flex items-start sm:items-center justify-center p-2 sm:p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>c(!1)}),d.jsxs("div",{className:K("relative bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a] border border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a] shadow-2xl","w-full max-w-sm sm:w-96 sm:max-w-[90vw]","mt-2 sm:mt-0 rounded-xl sm:rounded-xl","max-h-[85vh] sm:max-h-none flex flex-col"),onClick:z=>z.stopPropagation(),children:[d.jsx("div",{className:"p-3 sm:p-4 border-b border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a] flex-shrink-0",children:d.jsx("input",{ref:b,type:"text",placeholder:"Search models...",value:p,onChange:z=>f(z.target.value),onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation(),className:K("w-full px-3 py-2.5 sm:py-2 text-sm bg-gray-50 dark:bg-dark-200 ophelia:bg-[#121212] ophelia:text-[#fafafa] ophelia:placeholder-[#737373]","border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-lg","focus:outline-none focus:ring-2 focus:ring-primary-500/20 ophelia:focus:ring-[#9333ea]/20 focus:border-primary-500 ophelia:focus:border-[#9333ea]","touch-manipulation")})}),d.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 max-h-80 sm:max-h-80",children:M.length>0?M.map(z=>d.jsxs("div",{children:[d.jsx("div",{className:"px-3 sm:px-3 py-2.5 sm:py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 ophelia:text-[#a3a3a3] bg-gray-100 dark:bg-dark-300 ophelia:bg-[#0a0a0a] border-b border-gray-200 dark:border-dark-400 ophelia:border-[#1a1a1a] sticky top-0",children:d.jsxs("div",{className:"flex items-center gap-2",children:[z.icon,z.label," (",z.models.length,")"]})}),z.models.map(C=>d.jsx("div",{onMouseDown:j=>{j.preventDefault(),D(C.name)},onTouchStart:j=>{j.preventDefault(),D(C.name)},className:K("px-3 sm:px-4 py-3.5 sm:py-3 cursor-pointer border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] last:border-b-0","hover:bg-gray-50 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212] active:bg-gray-100 dark:active:bg-dark-100 ophelia:active:bg-[#1a1a1a]","bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a] touch-manipulation","transition-colors duration-150 ease-in-out",(e===C.name||e.startsWith("persona:")&&C.name===e)&&"bg-primary-50 dark:bg-primary-900 ophelia:bg-[rgba(147,51,234,0.15)] border-l-4 border-primary-500 ophelia:border-l-[#9333ea]"),children:d.jsxs("div",{className:"flex items-center gap-3",children:[I(C),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa] truncate",children:N(C)}),B(C)&&d.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#737373] truncate",children:B(C)})]}),(e===C.name||e.startsWith("persona:")&&C.name===e)&&d.jsx(nt,{className:"h-4 w-4 text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7] flex-shrink-0"})]})},C.name))]},z.type)):d.jsxs("div",{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400 ophelia:text-[#737373] bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a]",children:[d.jsx(rs,{className:"h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600 ophelia:text-[#525252]"}),d.jsx("p",{className:"text-sm",children:"No models found"})]})})]})]}),document.body),d.jsx("select",{value:e,onChange:t,className:"sr-only",tabIndex:-1,children:r.map(z=>d.jsx("option",{value:z.name,children:N(z)},z.name))})]})},s1=({onSendMessage:r,onStopGeneration:e,disabled:t=!1})=>{const[a,n]=R.useState(""),[s,l]=R.useState([]),[u,c]=R.useState(null),[p,f]=R.useState(!1),[g,b]=R.useState(null),{isGenerating:w,setBackgroundImage:M}=g0(),{currentSession:k,models:D}=be(),I=R.useRef(null),N=j=>{j.preventDefault(),!(!a.trim()||w)&&(r(a.trim(),s.length>0?s:void 0,u||void 0),n(""),l([]))},B=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),N(j))},L=()=>{e()};R.useEffect(()=>{const j=I.current;j&&(j.style.height="auto",j.style.height=Math.min(j.scrollHeight,200)+"px")},[a]),R.useEffect(()=>{(async()=>{if(k?.personaId)try{const A=await yr.getPersona(k.personaId);if(A.success&&A.data)b(A.data);else{console.warn(`Persona ${k.personaId} not found, clearing reference`),b(null);const{setCurrentSession:T}=be.getState();T({...k,personaId:void 0})}}catch(A){if(console.error("Failed to load current persona:",A),b(null),k){const{setCurrentSession:T}=be.getState();T({...k,personaId:void 0})}}else b(null)})()},[k?.personaId]);const z=async j=>{const A=j.target.value;if(k)try{if(A.startsWith("persona:")){const T=A.replace("persona:",""),$=await yr.getPersona(T);if(!$.success||!$.data){R0.error("Failed to load persona details");return}const W=$.data,G=await J0.updateSession(k.id,{personaId:T,model:A});if(G.success&&G.data){const{sessions:Y}=be.getState(),re=Y.map(Q=>Q.id===k.id?G.data:Q);be.setState({sessions:re,currentSession:G.data}),W.background&&M(W.background),R0.success("Persona applied")}}else{const T=await J0.updateSession(k.id,{model:A,personaId:void 0});if(T.success&&T.data){const{sessions:$}=be.getState(),W=$.map(G=>G.id===k.id?T.data:G);be.setState({sessions:W,currentSession:T.data}),M(null),R0.success("Model updated")}}}catch(T){console.error("Failed to update session:",T),R0.error("Failed to update session")}},C=s.length>0||u!==null;return d.jsx("div",{className:"pointer-events-none",children:d.jsxs("div",{className:"max-w-5xl mx-auto px-3 sm:px-4 md:px-6 w-full pointer-events-auto",children:[p&&d.jsxs("div",{className:"mb-2 p-3 rounded-2xl bg-white/95 dark:bg-dark-100/95 ophelia:bg-[#0a0a0a]/95 backdrop-blur-md border border-gray-200/50 dark:border-dark-300/50 ophelia:border-[#262626]/50 shadow-lg",children:[d.jsx(r1,{images:s,onImagesChange:l,maxImages:5,sessionId:k?.id,disabled:t}),d.jsx(n1,{format:u,onFormatChange:c})]}),d.jsxs("div",{className:"py-2 sm:py-3",children:[d.jsx("form",{onSubmit:N,children:d.jsxs("div",{className:K("flex items-center gap-2 p-2 sm:p-3 rounded-2xl sm:rounded-3xl border transition-all duration-300 ease-out shadow-lg","bg-white/95 dark:bg-dark-100/95 ophelia:bg-[#0a0a0a]/95 backdrop-blur-md","border-gray-200/50 dark:border-dark-300/50 ophelia:border-[#262626]/60","hover:border-gray-300/70 dark:hover:border-dark-400/70 ophelia:hover:border-[#3f3f46]/80","focus-within:border-primary-400/70 dark:focus-within:border-primary-500/70 ophelia:focus-within:border-[#9333ea]/70","focus-within:shadow-xl"),children:[d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(!p),className:K("h-8 w-8 sm:h-9 sm:w-9 !p-0 rounded-full flex-shrink-0","hover:bg-gray-100 dark:hover:bg-dark-200/80 ophelia:hover:bg-[#1a1a1a]","transition-all duration-200 touch-manipulation","hover:scale-105 active:scale-95",C&&"text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]",p&&"bg-gray-100 dark:bg-dark-200/80 ophelia:bg-[#1a1a1a]"),title:"Attachments and advanced features",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},children:C?d.jsxs("div",{className:"relative flex items-center justify-center",children:[d.jsx(ka,{className:"h-4 w-4"}),d.jsx("div",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 bg-primary-500 dark:bg-primary-400 ophelia:bg-[#a855f7] rounded-full ring-2 ring-white dark:ring-dark-50 ophelia:ring-[#0a0a0a]"})]}):p?d.jsx(Sa,{className:"h-4 w-4"}):d.jsx(Ma,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(gr,{ref:I,value:a,onChange:j=>n(j.target.value),onKeyDown:B,placeholder:"Send a message",disabled:t,className:"!border-0 !bg-transparent !shadow-none !p-0 !m-0 !rounded-none !focus:ring-0 !focus:border-0 !focus:shadow-none !focus:bg-transparent min-h-[32px] sm:min-h-[36px] max-h-[120px] resize-none scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 focus:outline-none placeholder:text-gray-500 dark:placeholder:text-dark-500 text-base sm:text-sm leading-none touch-manipulation",rows:1,style:{boxShadow:"none !important",border:"none !important",outline:"none !important",padding:"0 !important",margin:"0 !important",lineHeight:"1.2 !important",verticalAlign:"middle"}})}),d.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 flex-shrink-0",children:[k&&D.length>0&&d.jsx("div",{className:"hidden sm:block",children:d.jsx(at,{models:D,selectedModel:k.personaId?`persona:${k.personaId}`:k.model,onModelChange:z,currentPersona:g,className:"min-w-[160px] max-w-[240px] border-0 bg-gray-100/80 dark:bg-dark-100/80 ophelia:bg-[#1a1a1a]/80 rounded-xl text-sm hover:bg-gray-200/80 dark:hover:bg-dark-200/60 ophelia:hover:bg-[#262626]/80 transition-colors duration-200",compact:!0})}),w?d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:L,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","bg-red-50 dark:bg-red-900/20 ophelia:bg-red-900/30","text-red-500 dark:text-red-400 ophelia:text-red-400","hover:bg-red-100 dark:hover:bg-red-900/30 ophelia:hover:bg-red-900/40","transition-all duration-200 touch-manipulation","hover:scale-105 active:scale-95"),title:"Stop generation",children:d.jsx(va,{className:"h-4 w-4"})}):d.jsx(Ve,{type:"submit",variant:"ghost",size:"sm",disabled:!a.trim()||t,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","text-gray-400 dark:text-dark-500 ophelia:text-[#525252]","disabled:opacity-40 disabled:hover:bg-transparent disabled:cursor-not-allowed","transition-all duration-200 touch-manipulation",a.trim()&&!t&&["bg-primary-500 dark:bg-primary-600 ophelia:bg-[#9333ea]","text-white dark:text-white ophelia:text-white","hover:bg-primary-600 dark:hover:bg-primary-500 ophelia:hover:bg-[#a855f7]","shadow-md hover:shadow-lg","hover:scale-105 active:scale-95"]),title:"Send message",children:d.jsx(Na,{className:"h-4 w-4"})})]})]})}),k&&D.length>0&&d.jsx("div",{className:"sm:hidden mt-3",children:d.jsx(at,{models:D,selectedModel:k.personaId?`persona:${k.personaId}`:k.model,onModelChange:z,currentPersona:g,className:"w-full rounded-xl bg-gray-100/80 dark:bg-dark-100/80 ophelia:bg-[#1a1a1a]/80 border-0 transition-colors duration-200",compact:!0})}),d.jsxs("div",{className:"mt-2 flex items-center justify-center gap-2 text-xs text-gray-500 dark:text-dark-600",children:[d.jsx(a1,{sessionId:k?.id}),d.jsxs("div",{className:"text-center",children:[d.jsx("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"libre-brand underline hover:text-primary-600 dark:hover:text-primary-400 transition-colors",style:{fontSize:"1.1em",lineHeight:1},children:"Libre WebUI"})," ",d.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",style:{fontSize:"0.55rem"},children:["v","0.2.6"]})," ",d.jsx("span",{className:"text-gray-300 dark:text-gray-600 opacity-50",children:"•"})," ",d.jsx("span",{className:"text-gray-400 dark:text-gray-500",style:{fontSize:"0.55rem"},children:"LLM can make mistakes - verify important information"}),C&&d.jsxs("span",{className:"ml-2 text-primary-600 dark:text-primary-400",children:["•"," ",s.length>0&&`${s.length} image${s.length>1?"s":""}`,s.length>0&&u&&" • ",u&&"Structured output"]})]})]})]})]})})},i1=({persona:r,onClear:e,className:t})=>{const[a,n]=R.useState(!1),s=R.useRef(null),[l,u]=R.useState({top:0,left:0});R.useEffect(()=>{if(a&&s.current){const f=s.current.getBoundingClientRect();u({top:f.bottom+8,left:f.left})}},[a]);const c=!!(r.memory_settings?.enabled||r.mutation_settings?.enabled),p=()=>r.avatar?r.avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(r.name)}&background=6366f1&color=fff&size=64`;return d.jsxs("div",{className:K("relative",t),children:[d.jsxs("button",{ref:s,onClick:()=>n(!a),className:K("flex items-center gap-2 px-3 py-1.5 rounded-full transition-all duration-200","bg-primary-50 dark:bg-primary-900/30 ophelia:bg-[#9333ea]/15","border border-primary-200 dark:border-primary-700/50 ophelia:border-[#7c3aed]/30","hover:bg-primary-100 dark:hover:bg-primary-900/40 ophelia:hover:bg-[#9333ea]/20","text-primary-700 dark:text-primary-300 ophelia:text-[#c084fc]"),children:[d.jsx("img",{src:p(),alt:r.name,className:"w-5 h-5 rounded-full object-cover"}),d.jsx("span",{className:"text-sm font-medium max-w-[120px] truncate",children:r.name}),c&&d.jsx(wa,{className:"h-3 w-3 text-purple-500 dark:text-purple-400"}),d.jsx(z0,{className:K("h-3.5 w-3.5 transition-transform duration-200",a&&"rotate-180")})]}),a&&Xt.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>n(!1)}),d.jsx("div",{className:"fixed w-72 z-[9999]",style:{top:l.top,left:l.left},children:d.jsxs("div",{className:K("rounded-xl overflow-hidden shadow-xl","bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a]","border border-gray-200 dark:border-dark-300 ophelia:border-[#262626]"),children:[d.jsxs("div",{className:"relative h-16",children:[r.background?d.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${r.background})`}}):d.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary-400 via-primary-500 to-purple-600 dark:from-primary-600 dark:via-primary-700 dark:to-purple-800 ophelia:from-[#9333ea] ophelia:via-[#7c3aed] ophelia:to-[#6d28d9]"}),d.jsx("div",{className:"absolute inset-0 bg-black/10"}),e&&d.jsx("button",{onClick:f=>{f.stopPropagation(),e(),n(!1)},className:"absolute top-2 right-2 p-1 rounded-full bg-white/20 hover:bg-white/30 backdrop-blur-sm transition-colors",title:"Remove persona",children:d.jsx(v0,{className:"h-3.5 w-3.5 text-white"})}),c&&d.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/20 backdrop-blur-sm text-white text-[10px] font-medium",children:[d.jsx(Z0,{className:"h-3 w-3"}),"Enhanced"]})]}),d.jsx("div",{className:"relative px-4 -mt-6",children:d.jsx("img",{src:p(),alt:r.name,className:"w-12 h-12 rounded-lg object-cover ring-3 ring-white dark:ring-dark-100 ophelia:ring-[#0a0a0a] shadow-md"})}),d.jsxs("div",{className:"px-4 pt-2 pb-4",children:[d.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa]",children:r.name}),d.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#a3a3a3] flex items-center gap-1 mt-0.5",children:[d.jsx(as,{className:"h-3 w-3"}),r.model]}),r.description&&d.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] mt-2 line-clamp-2",children:r.description}),r.parameters.system_prompt&&d.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-gray-50 dark:bg-dark-50 ophelia:bg-[#121212] border border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:[d.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[d.jsx(ns,{className:"h-2.5 w-2.5 text-gray-400"}),d.jsx("span",{className:"text-[9px] uppercase tracking-wider font-medium text-gray-400",children:"System"})]}),d.jsxs("p",{className:"text-[11px] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] line-clamp-2 italic",children:["“",r.parameters.system_prompt,"”"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-1 mt-3",children:[d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1a1a] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:[d.jsx(Ft,{className:"h-2.5 w-2.5"}),r.parameters.temperature?.toFixed(1)||"0.7"]}),d.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1a1a] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:["Top-P ",r.parameters.top_p?.toFixed(1)||"0.9"]}),r.memory_settings?.enabled&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-purple-100 dark:bg-purple-900/30 ophelia:bg-[#9333ea]/20 text-purple-700 dark:text-purple-300 ophelia:text-[#c084fc]",children:[d.jsx(Z0,{className:"h-2.5 w-2.5"}),"Memory"]})]})]})]})})]}),document.body)]})},l1=({images:r,onImagesChange:e,maxImages:t=5,className:a})=>{const n=R.useRef(null),[s,l]=R.useState(!1),u=w=>{if(!w)return;const M=[],k=t-r.length;for(let D=0;D<Math.min(w.length,k);D++){const I=w[D];if(!I.type.startsWith("image/")){de.error(`File ${I.name} is not an image`);continue}if(I.size>10*1024*1024){de.error(`Image ${I.name} is too large (max 10MB)`);continue}const N=new FileReader;N.onload=B=>{B.target?.result&&(M.push(B.target.result),M.length===Math.min(w.length,k)&&e([...r,...M]))},N.readAsDataURL(I)}w.length>k&&de.error(`Only ${k} more images can be added`)},c=w=>{w.preventDefault(),l(!0)},p=w=>{w.preventDefault(),l(!1)},f=w=>{w.preventDefault(),l(!1),u(w.dataTransfer.files)},g=w=>{const M=r.filter((k,D)=>D!==w);e(M)},b=r.length<t;return d.jsxs("div",{className:K("space-y-3",a),children:[b&&d.jsxs("div",{className:K("border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 transition-colors","hover:border-primary-400 dark:hover:border-primary-500",s&&"border-primary-500 bg-primary-50 dark:bg-primary-900/20"),onDragOver:c,onDragLeave:p,onDrop:f,children:[d.jsx("input",{ref:n,type:"file",multiple:!0,accept:"image/*",onChange:w=>u(w.target.files),className:"hidden"}),d.jsxs("div",{className:"flex flex-col items-center text-center",children:[d.jsx(ba,{className:"h-8 w-8 text-gray-400 dark:text-gray-500 mb-2"}),d.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300 mb-2",children:["Drop images here or"," ",d.jsx("button",{onClick:()=>n.current?.click(),className:"text-primary-600 dark:text-primary-400 hover:underline font-medium",children:"browse"})]}),d.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Supports: JPG, PNG, GIF, WebP (max 10MB each)"})]})]}),r.length>0&&d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:r.map((w,M)=>d.jsxs("div",{className:"relative group aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700",children:[d.jsx("img",{src:w,alt:`Upload ${M+1}`,className:"w-full h-full object-cover"}),d.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-50 transition-all duration-200 flex items-center justify-center",children:d.jsx(Ve,{variant:"ghost",size:"sm",onClick:()=>g(M),className:"opacity-0 group-hover:opacity-100 transition-opacity bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 hover:bg-red-100 dark:hover:bg-red-900/20 hover:text-red-600 dark:hover:text-red-400 p-1 rounded-full",children:d.jsx(v0,{className:"h-4 w-4"})})})]},M))}),b&&r.length>0&&d.jsxs(Ve,{variant:"outline",size:"sm",onClick:()=>n.current?.click(),className:"w-full sm:w-auto",children:[d.jsx(ss,{className:"h-4 w-4 mr-2"}),"Add More Images (",r.length,"/",t,")"]})]})},o1=r=>{const[e,t]=R.useState(""),[a,n]=R.useState(null),[s,l]=R.useState(!1),{addMessage:u,updateMessage:c,updateMessageWithStatistics:p,updateSessionTitle:f,setGeneratingTitleForSession:g}=be(),{setIsGenerating:b,preferences:w}=g0(),M=R.useRef(null),k=R.useRef(null),D=R.useRef(""),I=R.useRef(0),N=R.useRef();R.useEffect(()=>()=>{ge.offMessage("user_message"),ge.offMessage("assistant_chunk"),ge.offMessage("assistant_complete"),ge.offMessage("error")},[r]),R.useEffect(()=>{if(!r){ge.offMessage("user_message"),ge.offMessage("assistant_chunk"),ge.offMessage("assistant_complete"),ge.offMessage("error");return}return ge.onMessage("user_message",()=>{}),ge.onMessage("assistant_chunk",A=>{const T=A,$=T.messageId||M.current;$&&(D.current=T.total,t(T.total),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{c(r,$,D.current),I.current=Date.now()},T.done?0:200))}),ge.onMessage("assistant_complete",A=>{const T=A;console.log("Hook: Received assistant_complete for session:",r,"messageId:",T.messageId,"with statistics:",!!T.statistics),l(!1),t(""),b(!1);const $=T.messageId||M.current;if(T&&$){const Q=D.current||T.content;p(r,$,Q,T.statistics)}const G=g0.getState().preferences.titleSettings,Y=be.getState().currentSession,re=k.current;console.log("Auto-title check:",{firstMessage:re,autoTitle:G?.autoTitle,taskModel:G?.taskModel,sessionTitle:Y?.title}),re&&G?.autoTitle&&G?.taskModel&&Y?.title==="New Chat"&&(console.log("Triggering auto-title generation..."),g(r),J0.generateTitle(r,G.taskModel,re).then(Q=>{console.log("Title generation response:",Q),Q.success&&Q.data?.title&&f(r,Q.data.title)}).catch(Q=>{console.error("Failed to generate title:",Q)}).finally(()=>{g(null)}),k.current=null),M.current=null,D.current="",N.current&&clearTimeout(N.current),I.current=0}),ge.onMessage("error",A=>{const T=A;if(l(!1),t(""),b(!1),M.current=null,T.code==="SESSION_NOT_FOUND"){console.warn("Session not found, redirecting to create new session..."),de.error("Session not found. Creating a new session..."),window.location.href="/";return}de.error(T.error)}),l(!1),t(""),M.current=null,()=>{N.current&&clearTimeout(N.current)}},[r,c,p,b,f,g]);const B=R.useCallback(async(j,A,T)=>{if(!(!r||!j.trim()))try{b(!0),l(!0),t(""),N.current&&clearTimeout(N.current),I.current=Date.now();const $=be.getState().currentSession;!$?.messages?.some(Y=>Y.role==="user")&&$?.title==="New Chat"&&(k.current=j.trim()),u(r,{role:"user",content:j.trim(),images:A});const G=wr();M.current=G,n(G),u(r,{role:"assistant",content:"",id:G}),ge.isConnected||await ge.connect(),ge.send({type:"chat_stream",data:{sessionId:r,content:j.trim(),images:A,format:T,options:w.generationOptions,assistantMessageId:G}})}catch($){console.error("Failed to send message:",$),l(!1),t(""),n(null),b(!1),M.current=null,de.error("Failed to send message")}},[r,u,b,w.generationOptions]),L=R.useCallback(()=>{l(!1),t(""),n(null),b(!1),M.current=null},[b]),z=R.useCallback(async()=>{const j=be.getState().currentSession;if(!j||!r)return;const A=j.messages;let T=-1,$=-1;for(let Y=A.length-1;Y>=0;Y--)if(A[Y].role==="assistant"){$=Y;break}if($>0){for(let Y=$-1;Y>=0;Y--)if(A[Y].role==="user"){T=Y;break}}if(T===-1||$===-1){de.error("No message to regenerate");return}const W=A[T],G=A[$];try{b(!0),l(!0),t(""),N.current&&clearTimeout(N.current),I.current=Date.now();const Y=wr();M.current=Y,n(Y),u(r,{role:"assistant",content:"",id:Y,parentId:G.parentId||G.id,branchIndex:G.siblingCount||1,isActive:!0}),ge.isConnected||await ge.connect(),ge.send({type:"chat_stream",data:{sessionId:r,content:W.content,images:W.images,options:w.generationOptions,assistantMessageId:Y,regenerate:!0,originalMessageId:G.id}})}catch(Y){console.error("Failed to regenerate message:",Y),l(!1),t(""),b(!1),M.current=null,de.error("Failed to regenerate message")}},[r,b,u,w.generationOptions]),C=R.useCallback(async j=>{const T=be.getState().currentSession;if(!T||!r)return;const $=T.messages.find(Y=>Y.id===j);if(!$){de.error("Message not found");return}if($.isActive!==!1)return;const W=$.parentId||$.id,G=$.branchIndex||0;try{const Y=await J0.switchMessageBranch(r,j,G);if(Y.success&&Y.data){const re=T.messages.map(ce=>ce.id===W||ce.parentId===W?{...ce,isActive:ce.id===j}:ce),Q={...T,messages:re,updatedAt:Date.now()};be.setState(ce=>({sessions:ce.sessions.map(ye=>ye.id===r?Q:ye),currentSession:Q})),de.success(`Switched to variant ${G+1}`)}else de.error(Y.error||"Failed to select branch")}catch(Y){console.error("Failed to select branch:",Y),de.error("Failed to select branch")}},[r]);return{sendMessage:B,stopGeneration:L,regenerateLastMessage:z,selectBranch:C,isStreaming:s,streamingMessage:e,streamingMessageId:a}},u1=r=>{const e=new Date().getHours(),t=r?`, ${r}`:"";return e>=5&&e<12?{greeting:`Good morning${t}`,timeSuffix:"today"}:e>=12&&e<17?{greeting:`Good afternoon${t}`,timeSuffix:"today"}:e>=17&&e<21?{greeting:`Good evening${t}`,timeSuffix:"tonight"}:{greeting:`Good night${t}`,timeSuffix:"tonight"}},v1=()=>{const{sessionId:r}=Fn(),e=qn(),t=Rn(),{currentSession:a,sessions:n,models:s,selectedModel:l,setSelectedModel:u,createSession:c,setCurrentSession:p,loadSessions:f,getCurrentPersona:g}=be(),{user:b}=pa(),{sendMessage:w,stopGeneration:M,regenerateLastMessage:k,selectBranch:D,isStreaming:I,streamingMessage:N,streamingMessageId:B}=o1(a?.id||""),L=g(),{greeting:z,timeSuffix:C}=R.useMemo(()=>u1(b?.username),[b?.username]),[j,A]=R.useState(""),[T,$]=R.useState([]),[W,G]=R.useState(!1),Y=R.useRef(null);R.useEffect(()=>{n.length===0&&f()},[f,n.length]),R.useEffect(()=>{(()=>{if(sessionStorage.getItem("forceWelcomeScreen")){sessionStorage.removeItem("forceWelcomeScreen");return}if(n.length!==0)if(r){const le=n.find(we=>we.id===r);le&&le.id!==a?.id?p(le):le||(console.warn(`Session ${r} not found for current user, redirecting...`),n.length>0?e(`/c/${n[0].id}`,{replace:!0}):e("/",{replace:!0}))}else!r&&n.length>0&&t.pathname==="/"&&e(`/c/${n[0].id}`,{replace:!0})})()},[r,n,p,e,a?.id,t.pathname]),R.useEffect(()=>{if(a?.id){const Z=sessionStorage.getItem("pendingMessage");if(Z){sessionStorage.removeItem("pendingMessage");try{const ie=JSON.parse(Z);setTimeout(()=>{w(ie.content,ie.images)},100)}catch(ie){console.error("Failed to parse pending message:",ie)}}}},[a?.id,w]),R.useEffect(()=>{const Z=Y.current;Z&&(Z.style.height="auto",Z.style.height=Math.min(Z.scrollHeight,200)+"px")},[j]);const re=async Z=>{if(Z.preventDefault(),!j.trim()||!l)return;const ie={content:j.trim(),images:T.length>0?T:void 0};sessionStorage.setItem("pendingMessage",JSON.stringify(ie)),A(""),$([]);const le=await c(l);le&&e(`/c/${le.id}`,{replace:!0})},Q=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),re(Z))},ce=async Z=>{const ie=Z.target.value;u(ie)},ye=(Z,ie,le)=>{a&&w(Z,ie,le)};if(!a){const Z=T.length>0;return d.jsx("div",{className:"h-full flex-1 flex flex-col items-center justify-center p-4 sm:p-8",children:d.jsxs("div",{className:"w-full max-w-2xl mx-auto flex flex-col items-center justify-center",children:[d.jsx("h1",{className:"text-2xl sm:text-3xl font-medium text-gray-800 dark:text-gray-100 ophelia:text-[#fafafa] mb-2 text-center",style:{fontWeight:400},children:z}),d.jsxs("p",{className:"text-base sm:text-lg text-gray-500 dark:text-gray-400 ophelia:text-[#737373] mb-8 text-center",children:["What can I help with ",C,"?"]}),s.length>0?d.jsxs("div",{className:"w-full",children:[W&&d.jsx("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-dark-100 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-2xl",children:d.jsx(l1,{images:T,onImagesChange:$,maxImages:5})}),d.jsx("form",{onSubmit:re,children:d.jsxs("div",{className:K("flex items-center gap-2 p-2 sm:p-3 rounded-2xl sm:rounded-3xl border transition-all duration-200","bg-gray-50 dark:bg-dark-50 ophelia:bg-[#0a0a0a] border-gray-200 dark:border-dark-300 ophelia:border-[#262626]","hover:border-gray-300 dark:hover:border-dark-400 ophelia:hover:border-[#3f3f46]","focus-within:border-primary-400 dark:focus-within:border-primary-500 ophelia:focus-within:border-[#9333ea] focus-within:bg-white dark:focus-within:bg-dark-50 ophelia:focus-within:bg-[#0a0a0a]","shadow-sm hover:shadow-md focus-within:shadow-lg"),children:[d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>G(!W),className:K("h-8 w-8 sm:h-9 sm:w-9 !p-0 rounded-full flex-shrink-0","hover:bg-gray-200 dark:hover:bg-dark-200 ophelia:hover:bg-[#1a1a1a] transition-colors touch-manipulation",Z&&"text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]",W&&"bg-gray-200 dark:bg-dark-200 ophelia:bg-[#1a1a1a]"),title:"Attach images",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},children:Z?d.jsxs("div",{className:"relative flex items-center justify-center",children:[d.jsx(ka,{className:"h-4 w-4"}),d.jsx("div",{className:"absolute -top-0.5 -right-0.5 h-1.5 w-1.5 bg-primary-500 ophelia:bg-[#9333ea] rounded-full"})]}):W?d.jsx(Sa,{className:"h-4 w-4"}):d.jsx(Ma,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(gr,{ref:Y,value:j,onChange:ie=>A(ie.target.value),onKeyDown:Q,placeholder:"Message...",className:"!border-0 !bg-transparent !shadow-none !p-0 !m-0 !rounded-none !focus:ring-0 !focus:border-0 !focus:shadow-none !focus:bg-transparent min-h-[32px] sm:min-h-[36px] max-h-[120px] resize-none scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 ophelia:scrollbar-thumb-[#3f3f46] focus:outline-none placeholder:text-gray-500 dark:placeholder:text-dark-500 ophelia:placeholder:text-[#737373] text-base sm:text-sm leading-none touch-manipulation",rows:1,style:{boxShadow:"none !important",border:"none !important",outline:"none !important",padding:"0 !important",margin:"0 !important",lineHeight:"1.2 !important",verticalAlign:"middle"}})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx(at,{models:s,selectedModel:l,onModelChange:ce,className:"min-w-[140px] max-w-[200px] border-0 bg-gray-100 dark:bg-dark-100 ophelia:bg-[#121212] rounded-xl text-sm",compact:!0})}),d.jsx(Ve,{type:"submit",variant:"ghost",size:"sm",disabled:!j.trim()||!l,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","hover:bg-primary-100 dark:hover:bg-primary-900/30 ophelia:hover:bg-[rgba(147,51,234,0.2)] text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]","disabled:text-gray-400 dark:disabled:text-dark-500 ophelia:disabled:text-[#525252] disabled:hover:bg-transparent","transition-all duration-150 touch-manipulation",j.trim()&&l&&"hover:scale-105 active:scale-95"),title:"Send message",children:d.jsx(Na,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"sm:hidden mt-4",children:d.jsx(at,{models:s,selectedModel:l,onModelChange:ce,className:"w-full rounded-xl bg-gray-100 dark:bg-dark-100 ophelia:bg-[#121212] border-0",compact:!0})}),d.jsxs("div",{className:"mt-4 text-center",children:[d.jsx("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"libre-brand underline hover:text-primary-600 dark:hover:text-primary-400 ophelia:hover:text-[#a855f7] transition-colors text-gray-500 dark:text-gray-400 ophelia:text-[#737373]",style:{fontSize:"0.75rem",lineHeight:1},children:"Libre WebUI"})," ",d.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ophelia:text-[#525252]",style:{fontSize:"0.55rem"},children:["v","0.2.6"]})," ",d.jsx("span",{className:"text-gray-300 dark:text-gray-600 ophelia:text-[#3f3f46] opacity-50",children:"•"})," ",d.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 ophelia:text-[#525252]",children:"LLM can make mistakes - verify important information"})]})]}):d.jsx("div",{className:"w-full max-w-md",children:d.jsxs("div",{className:"p-6 bg-gray-50 dark:bg-dark-100 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-xl",children:[d.jsx("p",{className:"text-sm text-gray-700 dark:text-dark-700 ophelia:text-[#a3a3a3] mb-4",children:"No models available. Make sure Ollama is running and has models installed."}),d.jsx("code",{className:"block text-xs bg-gray-100 dark:bg-dark-200 ophelia:bg-[#0a0a0a] p-3 rounded-lg font-mono text-gray-800 dark:text-dark-600 ophelia:text-[#737373]",children:"ollama pull llama3.2:3b"})]})})]})})}return d.jsxs("div",{className:"flex flex-col h-full relative",style:L?.background?{backgroundImage:`url(${L.background})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0,children:[L?.background&&d.jsx("div",{className:"absolute inset-0 bg-white/80 dark:bg-black/80 backdrop-blur-sm"}),d.jsxs("div",{className:"flex flex-col h-full relative z-10",children:[L&&d.jsx("div",{className:"flex-shrink-0 px-4 py-2 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#262626] bg-white/50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]/50 backdrop-blur-sm",children:d.jsx(i1,{persona:L,onClear:()=>{if(a){const{sessions:Z}=be.getState(),ie={...a,model:L.model,personaId:void 0},le=Z.map(we=>we.id===a.id?ie:we);be.setState({sessions:le,currentSession:ie})}}})}),d.jsx(e1,{messages:a.messages,streamingMessage:N,streamingMessageId:B,isStreaming:I,onRegenerate:k,onSelectBranch:D,className:"flex-1"}),d.jsx(s1,{onSendMessage:ye,onStopGeneration:M,disabled:!a})]})]})};export{v1 as ChatPage,v1 as default};
281
+ }`,rows:8,className:"font-mono text-sm"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ve,{onClick:p,size:"sm",disabled:!s.trim(),children:"Apply Schema"}),d.jsx(Ve,{onClick:()=>{n(!1),l("")},variant:"outline",size:"sm",children:"Cancel"})]})]}),f(),r&&d.jsxs("div",{className:"flex items-center text-xs text-green-600 dark:text-green-400",children:[d.jsx(ya,{className:"h-3 w-3 mr-1"}),"Structured output enabled"]})]})},at=({models:r,selectedModel:e,onModelChange:t,currentPersona:a,className:n,disabled:s=!1,compact:l=!1})=>{const[u,c]=R.useState(!1),[p,f]=R.useState(""),g=R.useRef(null),b=R.useRef(null),M=[{type:"personas",label:"Personas",icon:d.jsx(Et,{className:"h-4 w-4 text-purple-600 dark:text-purple-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>z.isPersona),color:"purple"},{type:"ollama",label:"Ollama Models",icon:d.jsx(ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>!z.isPersona&&!z.isPlugin),color:"green"},{type:"plugins",label:"Plugin Models",icon:d.jsx(Ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),models:r.filter(z=>z.isPlugin),color:"green"}].filter(z=>z.models.length>0).map(z=>({...z,models:z.models.filter(C=>C.name.toLowerCase().includes(p.toLowerCase())||C.personaName&&C.personaName.toLowerCase().includes(p.toLowerCase())||C.pluginName&&C.pluginName.toLowerCase().includes(p.toLowerCase()))})).filter(z=>z.models.length>0),k=r.find(z=>z.name===e||e.startsWith("persona:")&&z.name===e);R.useEffect(()=>{const z=C=>{g.current&&!g.current.contains(C.target)&&(c(!1),f(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]),R.useEffect(()=>{u&&b.current&&b.current.focus()},[u]);const D=z=>{t({target:{value:z}}),c(!1),f("")},I=z=>z.isPersona?d.jsx(Et,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}):z.isPlugin?d.jsx(Ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}):d.jsx(ft,{className:"h-4 w-4 text-green-600 dark:text-green-400 ophelia:text-[#a855f7]"}),N=z=>z.isPersona?z.personaName||z.name:z.isPlugin?`${z.name}`:z.name,B=z=>z.isPersona?`via ${z.model}`:z.isPlugin?`via ${z.pluginName}`:null,L=()=>{if(!k)return l?d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(ft,{className:"h-4 w-4"}),d.jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 truncate",children:"Select Model"})]}):"Select Model";if(l){const j=N(k);return d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I(k),d.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-200 ophelia:text-[#e5e5e5] truncate",children:j})]})}const z=N(k),C=B(k);return d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I(k),d.jsxs("div",{className:"flex flex-col min-w-0",children:[d.jsx("span",{className:"text-sm font-medium truncate",children:z}),C&&d.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:C})]}),k.isPersona&&a&&d.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[d.jsx(Z0,{className:"h-3 w-3 text-purple-600 dark:text-purple-400"}),a.embedding_model&&d.jsx(wa,{className:"h-3 w-3 text-purple-500 dark:text-purple-300"})]})]})};return d.jsxs("div",{className:K("relative",n),ref:g,children:[d.jsxs("button",{type:"button",onClick:()=>!s&&c(!u),disabled:s,className:K(l?"h-[44px] sm:h-[52px] px-3 flex items-center justify-between text-left w-full ":"w-full flex items-center justify-between gap-2 px-3 py-2 text-left ","bg-gray-50 dark:bg-dark-200 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626]","rounded-lg text-sm hover:bg-gray-100 dark:hover:bg-dark-100 ophelia:hover:bg-[#1a1a1a]","focus:outline-none focus:ring-2 focus:ring-primary-500/20 ophelia:focus:ring-[#9333ea]/20 focus:border-primary-500 ophelia:focus:border-[#9333ea]",s?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:l?k?N(k):"Select Model":void 0,children:[L(),d.jsx(z0,{className:K(l?"h-3 w-3":"h-4 w-4","text-gray-400 flex-shrink-0",u&&"rotate-180")})]}),u&&Xt.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[999999] flex items-start sm:items-center justify-center p-2 sm:p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>c(!1)}),d.jsxs("div",{className:K("relative bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a] border border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a] shadow-2xl","w-full max-w-sm sm:w-96 sm:max-w-[90vw]","mt-2 sm:mt-0 rounded-xl sm:rounded-xl","max-h-[85vh] sm:max-h-none flex flex-col"),onClick:z=>z.stopPropagation(),children:[d.jsx("div",{className:"p-3 sm:p-4 border-b border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a] flex-shrink-0",children:d.jsx("input",{ref:b,type:"text",placeholder:"Search models...",value:p,onChange:z=>f(z.target.value),onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation(),className:K("w-full px-3 py-2.5 sm:py-2 text-sm bg-gray-50 dark:bg-dark-200 ophelia:bg-[#121212] ophelia:text-[#fafafa] ophelia:placeholder-[#737373]","border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-lg","focus:outline-none focus:ring-2 focus:ring-primary-500/20 ophelia:focus:ring-[#9333ea]/20 focus:border-primary-500 ophelia:focus:border-[#9333ea]","touch-manipulation")})}),d.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 max-h-80 sm:max-h-80",children:M.length>0?M.map(z=>d.jsxs("div",{children:[d.jsx("div",{className:"px-3 sm:px-3 py-2.5 sm:py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 ophelia:text-[#a3a3a3] bg-gray-100 dark:bg-dark-300 ophelia:bg-[#0a0a0a] border-b border-gray-200 dark:border-dark-400 ophelia:border-[#1a1a1a] sticky top-0",children:d.jsxs("div",{className:"flex items-center gap-2",children:[z.icon,z.label," (",z.models.length,")"]})}),z.models.map(C=>d.jsx("div",{onMouseDown:j=>{j.preventDefault(),D(C.name)},onTouchStart:j=>{j.preventDefault(),D(C.name)},className:K("px-3 sm:px-4 py-3.5 sm:py-3 cursor-pointer border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] last:border-b-0","hover:bg-gray-50 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212] active:bg-gray-100 dark:active:bg-dark-100 ophelia:active:bg-[#1a1a1a]","bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a] touch-manipulation","transition-colors duration-150 ease-in-out",(e===C.name||e.startsWith("persona:")&&C.name===e)&&"bg-primary-50 dark:bg-primary-900 ophelia:bg-[rgba(147,51,234,0.15)] border-l-4 border-primary-500 ophelia:border-l-[#9333ea]"),children:d.jsxs("div",{className:"flex items-center gap-3",children:[I(C),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa] truncate",children:N(C)}),B(C)&&d.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#737373] truncate",children:B(C)})]}),(e===C.name||e.startsWith("persona:")&&C.name===e)&&d.jsx(nt,{className:"h-4 w-4 text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7] flex-shrink-0"})]})},C.name))]},z.type)):d.jsxs("div",{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400 ophelia:text-[#737373] bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a]",children:[d.jsx(rs,{className:"h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600 ophelia:text-[#525252]"}),d.jsx("p",{className:"text-sm",children:"No models found"})]})})]})]}),document.body),d.jsx("select",{value:e,onChange:t,className:"sr-only",tabIndex:-1,children:r.map(z=>d.jsx("option",{value:z.name,children:N(z)},z.name))})]})},s1=({onSendMessage:r,onStopGeneration:e,disabled:t=!1})=>{const[a,n]=R.useState(""),[s,l]=R.useState([]),[u,c]=R.useState(null),[p,f]=R.useState(!1),[g,b]=R.useState(null),{isGenerating:w,setBackgroundImage:M}=g0(),{currentSession:k,models:D}=be(),I=R.useRef(null),N=j=>{j.preventDefault(),!(!a.trim()||w)&&(r(a.trim(),s.length>0?s:void 0,u||void 0),n(""),l([]))},B=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),N(j))},L=()=>{e()};R.useEffect(()=>{const j=I.current;j&&(j.style.height="auto",j.style.height=Math.min(j.scrollHeight,200)+"px")},[a]),R.useEffect(()=>{(async()=>{if(k?.personaId)try{const A=await yr.getPersona(k.personaId);if(A.success&&A.data)b(A.data);else{console.warn(`Persona ${k.personaId} not found, clearing reference`),b(null);const{setCurrentSession:T}=be.getState();T({...k,personaId:void 0})}}catch(A){if(console.error("Failed to load current persona:",A),b(null),k){const{setCurrentSession:T}=be.getState();T({...k,personaId:void 0})}}else b(null)})()},[k?.personaId]);const z=async j=>{const A=j.target.value;if(k)try{if(A.startsWith("persona:")){const T=A.replace("persona:",""),$=await yr.getPersona(T);if(!$.success||!$.data){R0.error("Failed to load persona details");return}const W=$.data,G=await J0.updateSession(k.id,{personaId:T,model:A});if(G.success&&G.data){const{sessions:Y}=be.getState(),re=Y.map(Q=>Q.id===k.id?G.data:Q);be.setState({sessions:re,currentSession:G.data}),W.background&&M(W.background),R0.success("Persona applied")}}else{const T=await J0.updateSession(k.id,{model:A,personaId:void 0});if(T.success&&T.data){const{sessions:$}=be.getState(),W=$.map(G=>G.id===k.id?T.data:G);be.setState({sessions:W,currentSession:T.data}),M(null),R0.success("Model updated")}}}catch(T){console.error("Failed to update session:",T),R0.error("Failed to update session")}},C=s.length>0||u!==null;return d.jsx("div",{className:"pointer-events-none",children:d.jsxs("div",{className:"max-w-5xl mx-auto px-3 sm:px-4 md:px-6 w-full pointer-events-auto",children:[p&&d.jsxs("div",{className:"mb-2 p-3 rounded-2xl bg-white/95 dark:bg-dark-100/95 ophelia:bg-[#0a0a0a]/95 backdrop-blur-md border border-gray-200/50 dark:border-dark-300/50 ophelia:border-[#262626]/50 shadow-lg",children:[d.jsx(r1,{images:s,onImagesChange:l,maxImages:5,sessionId:k?.id,disabled:t}),d.jsx(n1,{format:u,onFormatChange:c})]}),d.jsxs("div",{className:"py-2 sm:py-3",children:[d.jsx("form",{onSubmit:N,children:d.jsxs("div",{className:K("flex items-center gap-2 p-2 sm:p-3 rounded-2xl sm:rounded-3xl border transition-all duration-300 ease-out shadow-lg","bg-white/95 dark:bg-dark-100/95 ophelia:bg-[#0a0a0a]/95 backdrop-blur-md","border-gray-200/50 dark:border-dark-300/50 ophelia:border-[#262626]/60","hover:border-gray-300/70 dark:hover:border-dark-400/70 ophelia:hover:border-[#3f3f46]/80","focus-within:border-primary-400/70 dark:focus-within:border-primary-500/70 ophelia:focus-within:border-[#9333ea]/70","focus-within:shadow-xl"),children:[d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(!p),className:K("h-8 w-8 sm:h-9 sm:w-9 !p-0 rounded-full flex-shrink-0","hover:bg-gray-100 dark:hover:bg-dark-200/80 ophelia:hover:bg-[#1a1a1a]","transition-all duration-200 touch-manipulation","hover:scale-105 active:scale-95",C&&"text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]",p&&"bg-gray-100 dark:bg-dark-200/80 ophelia:bg-[#1a1a1a]"),title:"Attachments and advanced features",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},children:C?d.jsxs("div",{className:"relative flex items-center justify-center",children:[d.jsx(ka,{className:"h-4 w-4"}),d.jsx("div",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 bg-primary-500 dark:bg-primary-400 ophelia:bg-[#a855f7] rounded-full ring-2 ring-white dark:ring-dark-50 ophelia:ring-[#0a0a0a]"})]}):p?d.jsx(Sa,{className:"h-4 w-4"}):d.jsx(Ma,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(gr,{ref:I,value:a,onChange:j=>n(j.target.value),onKeyDown:B,placeholder:"Send a message",disabled:t,className:"!border-0 !bg-transparent !shadow-none !p-0 !m-0 !rounded-none !focus:ring-0 !focus:border-0 !focus:shadow-none !focus:bg-transparent min-h-[32px] sm:min-h-[36px] max-h-[120px] resize-none scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 focus:outline-none placeholder:text-gray-500 dark:placeholder:text-dark-500 text-base sm:text-sm leading-none touch-manipulation",rows:1,style:{boxShadow:"none !important",border:"none !important",outline:"none !important",padding:"0 !important",margin:"0 !important",lineHeight:"1.2 !important",verticalAlign:"middle"}})}),d.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 flex-shrink-0",children:[k&&D.length>0&&d.jsx("div",{className:"hidden sm:block",children:d.jsx(at,{models:D,selectedModel:k.personaId?`persona:${k.personaId}`:k.model,onModelChange:z,currentPersona:g,className:"min-w-[160px] max-w-[240px] border-0 bg-gray-100/80 dark:bg-dark-100/80 ophelia:bg-[#1a1a1a]/80 rounded-xl text-sm hover:bg-gray-200/80 dark:hover:bg-dark-200/60 ophelia:hover:bg-[#262626]/80 transition-colors duration-200",compact:!0})}),w?d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:L,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","bg-red-50 dark:bg-red-900/20 ophelia:bg-red-900/30","text-red-500 dark:text-red-400 ophelia:text-red-400","hover:bg-red-100 dark:hover:bg-red-900/30 ophelia:hover:bg-red-900/40","transition-all duration-200 touch-manipulation","hover:scale-105 active:scale-95"),title:"Stop generation",children:d.jsx(va,{className:"h-4 w-4"})}):d.jsx(Ve,{type:"submit",variant:"ghost",size:"sm",disabled:!a.trim()||t,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","text-gray-400 dark:text-dark-500 ophelia:text-[#525252]","disabled:opacity-40 disabled:hover:bg-transparent disabled:cursor-not-allowed","transition-all duration-200 touch-manipulation",a.trim()&&!t&&["bg-primary-500 dark:bg-primary-600 ophelia:bg-[#9333ea]","text-white dark:text-white ophelia:text-white","hover:bg-primary-600 dark:hover:bg-primary-500 ophelia:hover:bg-[#a855f7]","shadow-md hover:shadow-lg","hover:scale-105 active:scale-95"]),title:"Send message",children:d.jsx(Na,{className:"h-4 w-4"})})]})]})}),k&&D.length>0&&d.jsx("div",{className:"sm:hidden mt-3",children:d.jsx(at,{models:D,selectedModel:k.personaId?`persona:${k.personaId}`:k.model,onModelChange:z,currentPersona:g,className:"w-full rounded-xl bg-gray-100/80 dark:bg-dark-100/80 ophelia:bg-[#1a1a1a]/80 border-0 transition-colors duration-200",compact:!0})}),d.jsxs("div",{className:"mt-2 flex items-center justify-center gap-2 text-xs text-gray-500 dark:text-dark-600",children:[d.jsx(a1,{sessionId:k?.id}),d.jsxs("div",{className:"text-center",children:[d.jsx("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"libre-brand underline hover:text-primary-600 dark:hover:text-primary-400 transition-colors",style:{fontSize:"1.1em",lineHeight:1},children:"Libre WebUI"})," ",d.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",style:{fontSize:"0.55rem"},children:["v","0.2.7"]})," ",d.jsx("span",{className:"text-gray-300 dark:text-gray-600 opacity-50",children:"•"})," ",d.jsx("span",{className:"text-gray-400 dark:text-gray-500",style:{fontSize:"0.55rem"},children:"LLM can make mistakes - verify important information"}),C&&d.jsxs("span",{className:"ml-2 text-primary-600 dark:text-primary-400",children:["•"," ",s.length>0&&`${s.length} image${s.length>1?"s":""}`,s.length>0&&u&&" • ",u&&"Structured output"]})]})]})]})]})})},i1=({persona:r,onClear:e,className:t})=>{const[a,n]=R.useState(!1),s=R.useRef(null),[l,u]=R.useState({top:0,left:0});R.useEffect(()=>{if(a&&s.current){const f=s.current.getBoundingClientRect();u({top:f.bottom+8,left:f.left})}},[a]);const c=!!(r.memory_settings?.enabled||r.mutation_settings?.enabled),p=()=>r.avatar?r.avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(r.name)}&background=6366f1&color=fff&size=64`;return d.jsxs("div",{className:K("relative",t),children:[d.jsxs("button",{ref:s,onClick:()=>n(!a),className:K("flex items-center gap-2 px-3 py-1.5 rounded-full transition-all duration-200","bg-primary-50 dark:bg-primary-900/30 ophelia:bg-[#9333ea]/15","border border-primary-200 dark:border-primary-700/50 ophelia:border-[#7c3aed]/30","hover:bg-primary-100 dark:hover:bg-primary-900/40 ophelia:hover:bg-[#9333ea]/20","text-primary-700 dark:text-primary-300 ophelia:text-[#c084fc]"),children:[d.jsx("img",{src:p(),alt:r.name,className:"w-5 h-5 rounded-full object-cover"}),d.jsx("span",{className:"text-sm font-medium max-w-[120px] truncate",children:r.name}),c&&d.jsx(wa,{className:"h-3 w-3 text-purple-500 dark:text-purple-400"}),d.jsx(z0,{className:K("h-3.5 w-3.5 transition-transform duration-200",a&&"rotate-180")})]}),a&&Xt.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>n(!1)}),d.jsx("div",{className:"fixed w-72 z-[9999]",style:{top:l.top,left:l.left},children:d.jsxs("div",{className:K("rounded-xl overflow-hidden shadow-xl","bg-white dark:bg-dark-100 ophelia:bg-[#0a0a0a]","border border-gray-200 dark:border-dark-300 ophelia:border-[#262626]"),children:[d.jsxs("div",{className:"relative h-16",children:[r.background?d.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${r.background})`}}):d.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary-400 via-primary-500 to-purple-600 dark:from-primary-600 dark:via-primary-700 dark:to-purple-800 ophelia:from-[#9333ea] ophelia:via-[#7c3aed] ophelia:to-[#6d28d9]"}),d.jsx("div",{className:"absolute inset-0 bg-black/10"}),e&&d.jsx("button",{onClick:f=>{f.stopPropagation(),e(),n(!1)},className:"absolute top-2 right-2 p-1 rounded-full bg-white/20 hover:bg-white/30 backdrop-blur-sm transition-colors",title:"Remove persona",children:d.jsx(v0,{className:"h-3.5 w-3.5 text-white"})}),c&&d.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/20 backdrop-blur-sm text-white text-[10px] font-medium",children:[d.jsx(Z0,{className:"h-3 w-3"}),"Enhanced"]})]}),d.jsx("div",{className:"relative px-4 -mt-6",children:d.jsx("img",{src:p(),alt:r.name,className:"w-12 h-12 rounded-lg object-cover ring-3 ring-white dark:ring-dark-100 ophelia:ring-[#0a0a0a] shadow-md"})}),d.jsxs("div",{className:"px-4 pt-2 pb-4",children:[d.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa]",children:r.name}),d.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#a3a3a3] flex items-center gap-1 mt-0.5",children:[d.jsx(as,{className:"h-3 w-3"}),r.model]}),r.description&&d.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] mt-2 line-clamp-2",children:r.description}),r.parameters.system_prompt&&d.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-gray-50 dark:bg-dark-50 ophelia:bg-[#121212] border border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:[d.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[d.jsx(ns,{className:"h-2.5 w-2.5 text-gray-400"}),d.jsx("span",{className:"text-[9px] uppercase tracking-wider font-medium text-gray-400",children:"System"})]}),d.jsxs("p",{className:"text-[11px] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] line-clamp-2 italic",children:["“",r.parameters.system_prompt,"”"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-1 mt-3",children:[d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1a1a] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:[d.jsx(Ft,{className:"h-2.5 w-2.5"}),r.parameters.temperature?.toFixed(1)||"0.7"]}),d.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1a1a] text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:["Top-P ",r.parameters.top_p?.toFixed(1)||"0.9"]}),r.memory_settings?.enabled&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-purple-100 dark:bg-purple-900/30 ophelia:bg-[#9333ea]/20 text-purple-700 dark:text-purple-300 ophelia:text-[#c084fc]",children:[d.jsx(Z0,{className:"h-2.5 w-2.5"}),"Memory"]})]})]})]})})]}),document.body)]})},l1=({images:r,onImagesChange:e,maxImages:t=5,className:a})=>{const n=R.useRef(null),[s,l]=R.useState(!1),u=w=>{if(!w)return;const M=[],k=t-r.length;for(let D=0;D<Math.min(w.length,k);D++){const I=w[D];if(!I.type.startsWith("image/")){de.error(`File ${I.name} is not an image`);continue}if(I.size>10*1024*1024){de.error(`Image ${I.name} is too large (max 10MB)`);continue}const N=new FileReader;N.onload=B=>{B.target?.result&&(M.push(B.target.result),M.length===Math.min(w.length,k)&&e([...r,...M]))},N.readAsDataURL(I)}w.length>k&&de.error(`Only ${k} more images can be added`)},c=w=>{w.preventDefault(),l(!0)},p=w=>{w.preventDefault(),l(!1)},f=w=>{w.preventDefault(),l(!1),u(w.dataTransfer.files)},g=w=>{const M=r.filter((k,D)=>D!==w);e(M)},b=r.length<t;return d.jsxs("div",{className:K("space-y-3",a),children:[b&&d.jsxs("div",{className:K("border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 transition-colors","hover:border-primary-400 dark:hover:border-primary-500",s&&"border-primary-500 bg-primary-50 dark:bg-primary-900/20"),onDragOver:c,onDragLeave:p,onDrop:f,children:[d.jsx("input",{ref:n,type:"file",multiple:!0,accept:"image/*",onChange:w=>u(w.target.files),className:"hidden"}),d.jsxs("div",{className:"flex flex-col items-center text-center",children:[d.jsx(ba,{className:"h-8 w-8 text-gray-400 dark:text-gray-500 mb-2"}),d.jsxs("p",{className:"text-sm text-gray-700 dark:text-gray-300 mb-2",children:["Drop images here or"," ",d.jsx("button",{onClick:()=>n.current?.click(),className:"text-primary-600 dark:text-primary-400 hover:underline font-medium",children:"browse"})]}),d.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Supports: JPG, PNG, GIF, WebP (max 10MB each)"})]})]}),r.length>0&&d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:r.map((w,M)=>d.jsxs("div",{className:"relative group aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700",children:[d.jsx("img",{src:w,alt:`Upload ${M+1}`,className:"w-full h-full object-cover"}),d.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-50 transition-all duration-200 flex items-center justify-center",children:d.jsx(Ve,{variant:"ghost",size:"sm",onClick:()=>g(M),className:"opacity-0 group-hover:opacity-100 transition-opacity bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 hover:bg-red-100 dark:hover:bg-red-900/20 hover:text-red-600 dark:hover:text-red-400 p-1 rounded-full",children:d.jsx(v0,{className:"h-4 w-4"})})})]},M))}),b&&r.length>0&&d.jsxs(Ve,{variant:"outline",size:"sm",onClick:()=>n.current?.click(),className:"w-full sm:w-auto",children:[d.jsx(ss,{className:"h-4 w-4 mr-2"}),"Add More Images (",r.length,"/",t,")"]})]})},o1=r=>{const[e,t]=R.useState(""),[a,n]=R.useState(null),[s,l]=R.useState(!1),{addMessage:u,updateMessage:c,updateMessageWithStatistics:p,updateSessionTitle:f,setGeneratingTitleForSession:g}=be(),{setIsGenerating:b,preferences:w}=g0(),M=R.useRef(null),k=R.useRef(null),D=R.useRef(""),I=R.useRef(0),N=R.useRef();R.useEffect(()=>()=>{ge.offMessage("user_message"),ge.offMessage("assistant_chunk"),ge.offMessage("assistant_complete"),ge.offMessage("error")},[r]),R.useEffect(()=>{if(!r){ge.offMessage("user_message"),ge.offMessage("assistant_chunk"),ge.offMessage("assistant_complete"),ge.offMessage("error");return}return ge.onMessage("user_message",()=>{}),ge.onMessage("assistant_chunk",A=>{const T=A,$=T.messageId||M.current;$&&(D.current=T.total,t(T.total),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{c(r,$,D.current),I.current=Date.now()},T.done?0:200))}),ge.onMessage("assistant_complete",A=>{const T=A;console.log("Hook: Received assistant_complete for session:",r,"messageId:",T.messageId,"with statistics:",!!T.statistics),l(!1),t(""),b(!1);const $=T.messageId||M.current;if(T&&$){const Q=D.current||T.content;p(r,$,Q,T.statistics)}const G=g0.getState().preferences.titleSettings,Y=be.getState().currentSession,re=k.current;console.log("Auto-title check:",{firstMessage:re,autoTitle:G?.autoTitle,taskModel:G?.taskModel,sessionTitle:Y?.title}),re&&G?.autoTitle&&G?.taskModel&&Y?.title==="New Chat"&&(console.log("Triggering auto-title generation..."),g(r),J0.generateTitle(r,G.taskModel,re).then(Q=>{console.log("Title generation response:",Q),Q.success&&Q.data?.title&&f(r,Q.data.title)}).catch(Q=>{console.error("Failed to generate title:",Q)}).finally(()=>{g(null)}),k.current=null),M.current=null,D.current="",N.current&&clearTimeout(N.current),I.current=0}),ge.onMessage("error",A=>{const T=A;if(l(!1),t(""),b(!1),M.current=null,T.code==="SESSION_NOT_FOUND"){console.warn("Session not found, redirecting to create new session..."),de.error("Session not found. Creating a new session..."),window.location.href="/";return}de.error(T.error)}),l(!1),t(""),M.current=null,()=>{N.current&&clearTimeout(N.current)}},[r,c,p,b,f,g]);const B=R.useCallback(async(j,A,T)=>{if(!(!r||!j.trim()))try{b(!0),l(!0),t(""),N.current&&clearTimeout(N.current),I.current=Date.now();const $=be.getState().currentSession;!$?.messages?.some(Y=>Y.role==="user")&&$?.title==="New Chat"&&(k.current=j.trim()),u(r,{role:"user",content:j.trim(),images:A});const G=wr();M.current=G,n(G),u(r,{role:"assistant",content:"",id:G}),ge.isConnected||await ge.connect(),ge.send({type:"chat_stream",data:{sessionId:r,content:j.trim(),images:A,format:T,options:w.generationOptions,assistantMessageId:G}})}catch($){console.error("Failed to send message:",$),l(!1),t(""),n(null),b(!1),M.current=null,de.error("Failed to send message")}},[r,u,b,w.generationOptions]),L=R.useCallback(()=>{l(!1),t(""),n(null),b(!1),M.current=null},[b]),z=R.useCallback(async()=>{const j=be.getState().currentSession;if(!j||!r)return;const A=j.messages;let T=-1,$=-1;for(let Y=A.length-1;Y>=0;Y--)if(A[Y].role==="assistant"){$=Y;break}if($>0){for(let Y=$-1;Y>=0;Y--)if(A[Y].role==="user"){T=Y;break}}if(T===-1||$===-1){de.error("No message to regenerate");return}const W=A[T],G=A[$];try{b(!0),l(!0),t(""),N.current&&clearTimeout(N.current),I.current=Date.now();const Y=wr();M.current=Y,n(Y),u(r,{role:"assistant",content:"",id:Y,parentId:G.parentId||G.id,branchIndex:G.siblingCount||1,isActive:!0}),ge.isConnected||await ge.connect(),ge.send({type:"chat_stream",data:{sessionId:r,content:W.content,images:W.images,options:w.generationOptions,assistantMessageId:Y,regenerate:!0,originalMessageId:G.id}})}catch(Y){console.error("Failed to regenerate message:",Y),l(!1),t(""),b(!1),M.current=null,de.error("Failed to regenerate message")}},[r,b,u,w.generationOptions]),C=R.useCallback(async j=>{const T=be.getState().currentSession;if(!T||!r)return;const $=T.messages.find(Y=>Y.id===j);if(!$){de.error("Message not found");return}if($.isActive!==!1)return;const W=$.parentId||$.id,G=$.branchIndex||0;try{const Y=await J0.switchMessageBranch(r,j,G);if(Y.success&&Y.data){const re=T.messages.map(ce=>ce.id===W||ce.parentId===W?{...ce,isActive:ce.id===j}:ce),Q={...T,messages:re,updatedAt:Date.now()};be.setState(ce=>({sessions:ce.sessions.map(ye=>ye.id===r?Q:ye),currentSession:Q})),de.success(`Switched to variant ${G+1}`)}else de.error(Y.error||"Failed to select branch")}catch(Y){console.error("Failed to select branch:",Y),de.error("Failed to select branch")}},[r]);return{sendMessage:B,stopGeneration:L,regenerateLastMessage:z,selectBranch:C,isStreaming:s,streamingMessage:e,streamingMessageId:a}},u1=r=>{const e=new Date().getHours(),t=r?`, ${r}`:"";return e>=5&&e<12?{greeting:`Good morning${t}`,timeSuffix:"today"}:e>=12&&e<17?{greeting:`Good afternoon${t}`,timeSuffix:"today"}:e>=17&&e<21?{greeting:`Good evening${t}`,timeSuffix:"tonight"}:{greeting:`Good night${t}`,timeSuffix:"tonight"}},v1=()=>{const{sessionId:r}=Fn(),e=qn(),t=Rn(),{currentSession:a,sessions:n,models:s,selectedModel:l,setSelectedModel:u,createSession:c,setCurrentSession:p,loadSessions:f,getCurrentPersona:g}=be(),{user:b}=pa(),{sendMessage:w,stopGeneration:M,regenerateLastMessage:k,selectBranch:D,isStreaming:I,streamingMessage:N,streamingMessageId:B}=o1(a?.id||""),L=g(),{greeting:z,timeSuffix:C}=R.useMemo(()=>u1(b?.username),[b?.username]),[j,A]=R.useState(""),[T,$]=R.useState([]),[W,G]=R.useState(!1),Y=R.useRef(null);R.useEffect(()=>{n.length===0&&f()},[f,n.length]),R.useEffect(()=>{(()=>{if(sessionStorage.getItem("forceWelcomeScreen")){sessionStorage.removeItem("forceWelcomeScreen");return}if(n.length!==0)if(r){const le=n.find(we=>we.id===r);le&&le.id!==a?.id?p(le):le||(console.warn(`Session ${r} not found for current user, redirecting...`),n.length>0?e(`/c/${n[0].id}`,{replace:!0}):e("/",{replace:!0}))}else!r&&n.length>0&&t.pathname==="/"&&e(`/c/${n[0].id}`,{replace:!0})})()},[r,n,p,e,a?.id,t.pathname]),R.useEffect(()=>{if(a?.id){const Z=sessionStorage.getItem("pendingMessage");if(Z){sessionStorage.removeItem("pendingMessage");try{const ie=JSON.parse(Z);setTimeout(()=>{w(ie.content,ie.images)},100)}catch(ie){console.error("Failed to parse pending message:",ie)}}}},[a?.id,w]),R.useEffect(()=>{const Z=Y.current;Z&&(Z.style.height="auto",Z.style.height=Math.min(Z.scrollHeight,200)+"px")},[j]);const re=async Z=>{if(Z.preventDefault(),!j.trim()||!l)return;const ie={content:j.trim(),images:T.length>0?T:void 0};sessionStorage.setItem("pendingMessage",JSON.stringify(ie)),A(""),$([]);const le=await c(l);le&&e(`/c/${le.id}`,{replace:!0})},Q=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),re(Z))},ce=async Z=>{const ie=Z.target.value;u(ie)},ye=(Z,ie,le)=>{a&&w(Z,ie,le)};if(!a){const Z=T.length>0;return d.jsx("div",{className:"h-full flex-1 flex flex-col items-center justify-center p-4 sm:p-8",children:d.jsxs("div",{className:"w-full max-w-2xl mx-auto flex flex-col items-center justify-center",children:[d.jsx("h1",{className:"text-2xl sm:text-3xl font-medium text-gray-800 dark:text-gray-100 ophelia:text-[#fafafa] mb-2 text-center",style:{fontWeight:400},children:z}),d.jsxs("p",{className:"text-base sm:text-lg text-gray-500 dark:text-gray-400 ophelia:text-[#737373] mb-8 text-center",children:["What can I help with ",C,"?"]}),s.length>0?d.jsxs("div",{className:"w-full",children:[W&&d.jsx("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-dark-100 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-2xl",children:d.jsx(l1,{images:T,onImagesChange:$,maxImages:5})}),d.jsx("form",{onSubmit:re,children:d.jsxs("div",{className:K("flex items-center gap-2 p-2 sm:p-3 rounded-2xl sm:rounded-3xl border transition-all duration-200","bg-gray-50 dark:bg-dark-50 ophelia:bg-[#0a0a0a] border-gray-200 dark:border-dark-300 ophelia:border-[#262626]","hover:border-gray-300 dark:hover:border-dark-400 ophelia:hover:border-[#3f3f46]","focus-within:border-primary-400 dark:focus-within:border-primary-500 ophelia:focus-within:border-[#9333ea] focus-within:bg-white dark:focus-within:bg-dark-50 ophelia:focus-within:bg-[#0a0a0a]","shadow-sm hover:shadow-md focus-within:shadow-lg"),children:[d.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>G(!W),className:K("h-8 w-8 sm:h-9 sm:w-9 !p-0 rounded-full flex-shrink-0","hover:bg-gray-200 dark:hover:bg-dark-200 ophelia:hover:bg-[#1a1a1a] transition-colors touch-manipulation",Z&&"text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]",W&&"bg-gray-200 dark:bg-dark-200 ophelia:bg-[#1a1a1a]"),title:"Attach images",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},children:Z?d.jsxs("div",{className:"relative flex items-center justify-center",children:[d.jsx(ka,{className:"h-4 w-4"}),d.jsx("div",{className:"absolute -top-0.5 -right-0.5 h-1.5 w-1.5 bg-primary-500 ophelia:bg-[#9333ea] rounded-full"})]}):W?d.jsx(Sa,{className:"h-4 w-4"}):d.jsx(Ma,{className:"h-4 w-4"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(gr,{ref:Y,value:j,onChange:ie=>A(ie.target.value),onKeyDown:Q,placeholder:"Message...",className:"!border-0 !bg-transparent !shadow-none !p-0 !m-0 !rounded-none !focus:ring-0 !focus:border-0 !focus:shadow-none !focus:bg-transparent min-h-[32px] sm:min-h-[36px] max-h-[120px] resize-none scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400 ophelia:scrollbar-thumb-[#3f3f46] focus:outline-none placeholder:text-gray-500 dark:placeholder:text-dark-500 ophelia:placeholder:text-[#737373] text-base sm:text-sm leading-none touch-manipulation",rows:1,style:{boxShadow:"none !important",border:"none !important",outline:"none !important",padding:"0 !important",margin:"0 !important",lineHeight:"1.2 !important",verticalAlign:"middle"}})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx(at,{models:s,selectedModel:l,onModelChange:ce,className:"min-w-[140px] max-w-[200px] border-0 bg-gray-100 dark:bg-dark-100 ophelia:bg-[#121212] rounded-xl text-sm",compact:!0})}),d.jsx(Ve,{type:"submit",variant:"ghost",size:"sm",disabled:!j.trim()||!l,className:K("h-8 w-8 sm:h-9 sm:w-9 p-0 rounded-full flex-shrink-0 flex items-center justify-center","hover:bg-primary-100 dark:hover:bg-primary-900/30 ophelia:hover:bg-[rgba(147,51,234,0.2)] text-primary-600 dark:text-primary-400 ophelia:text-[#a855f7]","disabled:text-gray-400 dark:disabled:text-dark-500 ophelia:disabled:text-[#525252] disabled:hover:bg-transparent","transition-all duration-150 touch-manipulation",j.trim()&&l&&"hover:scale-105 active:scale-95"),title:"Send message",children:d.jsx(Na,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"sm:hidden mt-4",children:d.jsx(at,{models:s,selectedModel:l,onModelChange:ce,className:"w-full rounded-xl bg-gray-100 dark:bg-dark-100 ophelia:bg-[#121212] border-0",compact:!0})}),d.jsxs("div",{className:"mt-4 text-center",children:[d.jsx("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"libre-brand underline hover:text-primary-600 dark:hover:text-primary-400 ophelia:hover:text-[#a855f7] transition-colors text-gray-500 dark:text-gray-400 ophelia:text-[#737373]",style:{fontSize:"0.75rem",lineHeight:1},children:"Libre WebUI"})," ",d.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ophelia:text-[#525252]",style:{fontSize:"0.55rem"},children:["v","0.2.7"]})," ",d.jsx("span",{className:"text-gray-300 dark:text-gray-600 ophelia:text-[#3f3f46] opacity-50",children:"•"})," ",d.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 ophelia:text-[#525252]",children:"LLM can make mistakes - verify important information"})]})]}):d.jsx("div",{className:"w-full max-w-md",children:d.jsxs("div",{className:"p-6 bg-gray-50 dark:bg-dark-100 ophelia:bg-[#121212] border border-gray-200 dark:border-dark-300 ophelia:border-[#262626] rounded-xl",children:[d.jsx("p",{className:"text-sm text-gray-700 dark:text-dark-700 ophelia:text-[#a3a3a3] mb-4",children:"No models available. Make sure Ollama is running and has models installed."}),d.jsx("code",{className:"block text-xs bg-gray-100 dark:bg-dark-200 ophelia:bg-[#0a0a0a] p-3 rounded-lg font-mono text-gray-800 dark:text-dark-600 ophelia:text-[#737373]",children:"ollama pull llama3.2:3b"})]})})]})})}return d.jsxs("div",{className:"flex flex-col h-full relative",style:L?.background?{backgroundImage:`url(${L.background})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0,children:[L?.background&&d.jsx("div",{className:"absolute inset-0 bg-white/80 dark:bg-black/80 backdrop-blur-sm"}),d.jsxs("div",{className:"flex flex-col h-full relative z-10",children:[L&&d.jsx("div",{className:"flex-shrink-0 px-4 py-2 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#262626] bg-white/50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]/50 backdrop-blur-sm",children:d.jsx(i1,{persona:L,onClear:()=>{if(a){const{sessions:Z}=be.getState(),ie={...a,model:L.model,personaId:void 0},le=Z.map(we=>we.id===a.id?ie:we);be.setState({sessions:le,currentSession:ie})}}})}),d.jsx(e1,{messages:a.messages,streamingMessage:N,streamingMessageId:B,isStreaming:I,onRegenerate:k,onSelectBranch:D,className:"flex-1"}),d.jsx(s1,{onSendMessage:ye,onStopGeneration:M,disabled:!a})]})]})};export{v1 as ChatPage,v1 as default};