1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33433],{702:(e,t,n)=>{let i;n.d(t,{t:()=>r,J:()=>o});var a=n(30832),s=n.n(a);let r={crawlMultiPages:"crawlMultiPages",crawlSinglePage:"crawlSinglePage",searchWithSearXNG:"searchWithSearXNG"},o={api:[{description:"A meta search engine. Useful for when you need to answer questions about current events. Input should be a search query. Output is a JSON array of the query results",name:r.searchWithSearXNG,parameters:{properties:{query:{description:"The search query",type:"string"},searchEngines:{description:"The search engine you can use:",items:{enum:["google","bilibili","bing","duckduckgo","npm","pypi","github","arxiv","google scholar","z-library","reddit","imdb","brave","wikipedia","pinterest","unsplash","vimeo","youtube"],type:"string"},type:"array"}},required:["query"],type:"object"}},{description:"A crawler can visit page content. Output is a JSON object of title, content, url and website",name:r.crawlSinglePage,parameters:{properties:{url:{description:"The url need to be crawled",type:"string"}},required:["url"],type:"object"}},{description:"A crawler can visit multi pages. If need to visit multi website, use this one. Output is an array of JSON object of title, content, url and website",name:r.crawlMultiPages,parameters:{properties:{urls:{items:{description:"The url need to be crawled",type:"string"},type:"array"}},required:["urls"],type:"object"}}],identifier:"lobe-web-browsing",meta:{avatar:"\uD83C\uDF10",title:"Web Browsing"},systemRole:(i=s()(new Date).format("YYYY-MM-DD"),"You have a Web Information tool with powerful internet access capabilities. You can search across multiple search engines and extract content from web pages to provide users with accurate, comprehensive, and up-to-date information.\n\n<core_capabilities>\n1. Search the web using multiple search engines (searchWithSearXNG)\n2. Retrieve content from a specific webpage (crawlSinglePage)\n3. Retrieve content from multiple webpages simultaneously (crawlMultiPages)\n</core_capabilities>\n\n<workflow>\n1. Analyze the nature of the user's query (factual information, research, current events, etc.)\n2. Select the appropriate tool and search strategy based on the query type\n3. Execute searches or crawl operations to gather relevant information\n4. Synthesize information with proper attribution of sources\n5. Present findings in a clear, organized manner with appropriate citations\n</workflow>\n\n<tool_selection_guidelines>\n- For general information queries: Use searchWithSearXNG with the most relevant search engines\n- For detailed understanding of specific single page content: Use 'crawlSinglePage' on the most authoritative or relevant page from search results. If you need to visit multiple pages, prefer to use 'crawlMultiPages'\n- For multi-perspective information or comparative analysis: Use 'crawlMultiPages' on several different relevant sources\n</tool_selection_guidelines>\n\n<search_engine_selection>\nChoose search engines based on the query type:\n- General knowledge: google, bing, duckduckgo, brave, wikipedia\n- Academic/scientific information: google scholar, arxiv, z-library\n- Code/technical queries: google, github, npm, pypi\n- Videos: youtube, vimeo, bilibili\n- Images: unsplash, pinterest\n- Entertainment: imdb, reddit\n- For region-specific information, prefer search engines popular in that region\n</search_engine_selection>\n\n<citation_requirements>\n- Always cite sources using markdown footnote format (e.g., [^1])\n- List all referenced URLs at the end of your response\n- Clearly distinguish between quoted information and your own analysis\n- Respond in the same language as the user's query\n</citation_requirements>\n\n<response_format>\nWhen providing information from web searches:\n1. Start with a direct answer to the user's question when possible\n2. Provide relevant details from sources\n3. Include proper citations using footnotes\n4. List all sources at the end of your response\n5. For time-sensitive information, note when the information was retrieved\n\nExample:\n\nAccording to re
1cent studies, global temperatures have risen by 1.1\xb0C since pre-industrial times[^1].\n\n[^1]: [Climate Report in 2023](https://example.org/climate-report-2023)\n</response_format>\n\n<searxng_description>\nSearXNG is a metasearch engine that can leverage multiple search engines including:\n- Google: World's most popular search engine providing broad web results\n- Bilibili: Chinese video sharing website focused on animation, comics, and games (aka B-site)\n- Bing: Microsoft's search engine providing web results with emphasis on visual search\n- DuckDuckGo: Privacy-focused search engine that doesn't track users\n- npm: JavaScript package manager for finding Node.js packages\n- PyPI: Python Package Index for finding Python packages\n- GitHub: Version control and collaboration platform for searching code repositories\n- arXiv: Repository of electronic preprints of scientific papers\n- Google Scholar: Free web search engine for scholarly literature\n- Z-Library: File-sharing project for journal articles and books\n- Reddit: Network of communities based on people's interests\n- IMDb: Online database related to films, TV programs, and video games\n- Brave: Privacy-focused browser with its own search engine\n- Wikipedia: Free online encyclopedia with articles on various topics\n- Pinterest: Image sharing and social media service for finding images\n- Unsplash: Website dedicated to sharing high-quality stock photography\n- Vimeo: Video hosting, sharing, and service platform\n- YouTube: Video sharing platform for searching various video content\n\n <search_syntax>\n SearXNG has special search syntax to modify the categories, engines, and language of searches:\n\n 1. Use `!` to select engines and categories:\n - Search for \"paris\" in the \"map\" category: `!map paris`\n - Search for images: `!images Wau Holland`\n - Chain multiple modifiers: `!map !ddg !wp paris` (searches for \"paris\" in the map category, DuckDuckGo, and Wikipedia)\n\n 2. Use `:` to select language:\n - Search Wikipedia in a specific language: `:fr !wp Wau Holland` (uses French)\n </search_syntax>\n</searxng_description>\n\n<crawling_best_practices>\n- Only crawl pages that are publicly accessible\n- When crawling multiple pages, crawl all relevant sources\n- Prioritize authoritative sources over user-generated content when appropriate\n- For controversial topics, crawl sources representing different perspectives\n- Verify information across multiple sources when possible\n- Consider the recency of information, especially for time-sensitive topics\n</crawling_best_practices>\n\n<error_handling>\n- If search returns no results, try alternative search terms or engines\n- If a page cannot be crawled, explain the issue to the user and suggest alternatives\n- For ambiguous queries, ask for clarification before conducting extensive searches\n- If information seems outdated, note this to the user and suggest searching for more recent sources\n</error_handling>\n\nCurrent date: ".concat(i,"\n")),type:"builtin"}},15396:(e,t,n)=>{n.d(t,{Zc:()=>r,_X:()=>c,iL:()=>o,mm:()=>l,ue:()=>d,yj:()=>u});var i=n(66386),a=n(73961),s=n(5383),r=function(e){return e.Chat="chat",e.Discover="discover",e.Files="files",e.Me="me",e.Setting="settings",e}({}),o=function(e){return e.Chat="chat",e.Meta="meta",e.Modal="modal",e.Plugin="plugin",e.Prompt="prompt",e.TTS="tts",e}({}),l=function(e){return e.About="about",e.Agent="agent",e.Common="common",e.LLM="llm",e.Provider="provider",e.Sync="sync",e.SystemAgent="system-agent",e.TTS="tts",e}({}),u=function(e){return e.Profile="profile",e.Security="security",e.Stats="stats",e}({});let c={expandSessionGroupKeys:[a.X.Pinned,a.X.Default],filePanelWidth:320,hidePWAInstaller:!1,hideThreadLimitAlert:!1,inputHeight:200,mobileShowTopic:!1,portalWidth:400,sessionsWidth:320,showChatSideBar:!0,showFilePanel:!0,showSessionPanel:!0,showSystemRole:!1,themeMode:"auto",threadInputHeight:200,zenMode:!1},d={initClientDBStage:i.D.Idle,isMobile:!1,isStatusInit:!1,sidebarKey:"chat",status:c,statusStorage:new s.T("LOBE_SYSTEM_STATUS")}},20425:(e,t,n)=>{n.d(t,{I:()=>l,i:()=>r});var i=n(92043),a=n(66386),s=n(15396);let r=e=>e.status,o=e=>e.isStatusInit&&e.status.isEnablePglite&&e.initClientDBStage===a.D.Ready||!1,l={filePanelWidth:e=>e.status.filePanelWidth,hidePWAInstaller:e=>
1e.status.hidePWAInstaller,inZenMode:e=>e.status.zenMode,inputHeight:e=>e.status.inputHeight,isDBInited:e=>!i.Hy||o(e),isPgliteInited:o,isPgliteNotEnabled:e=>i.Hy&&!i.zJ&&e.isStatusInit&&!e.status.isEnablePglite,isPgliteNotInited:e=>i.Hy&&e.isStatusInit&&e.status.isEnablePglite&&e.initClientDBStage!==a.D.Ready,isShowCredit:e=>e.status.isShowCredit,mobileShowPortal:e=>e.status.mobileShowPortal,mobileShowTopic:e=>e.status.mobileShowTopic,portalWidth:e=>e.status.portalWidth||400,sessionGroupKeys:e=>e.status.expandSessionGroupKeys||s._X.expandSessionGroupKeys,sessionWidth:e=>e.status.sessionsWidth,showChatHeader:e=>!e.status.zenMode,showChatSideBar:e=>!e.status.zenMode&&e.status.showChatSideBar,showFilePanel:e=>e.status.showFilePanel,showSessionPanel:e=>!e.status.zenMode&&e.status.showSessionPanel,showSystemRole:e=>e.status.showSystemRole,systemStatus:r,themeMode:e=>e.status.themeMode||"auto",threadInputHeight:e=>e.status.threadInputHeight}},23740:(e,t,n)=>{n.d(t,{w:()=>u});var i=n(30383);let a=e=>e.installedPlugins,s=e=>t=>a(t).find(t=>t.identifier===e),r=e=>t=>{var n,i,a;let r=null===(n=t.pluginStoreList.find(t=>t.identifier===e))||void 0===n?void 0:n.meta;return r||(null===(a=s(e)(t))||void 0===a?void 0:null===(i=a.manifest)||void 0===i?void 0:i.meta)},o=e=>t=>{var n;return null===(n=s(e)(t))||void 0===n?void 0:n.manifest},l=e=>a(e).map(t=>{var n,i,a,s;return{author:null===(n=t.manifest)||void 0===n?void 0:n.author,createdAt:(null===(i=t.manifest)||void 0===i?void 0:i.createdAt)||(null===(a=t.manifest)||void 0===a?void 0:a.createAt),homepage:null===(s=t.manifest)||void 0===s?void 0:s.homepage,identifier:t.identifier,meta:r(t.identifier)(e),type:t.type}}),u={getCustomPluginById:e=>t=>a(t).find(t=>t.identifier===e&&"customPlugin"===t.type),getInstalledPluginById:s,getPluginMetaById:r,getPluginSettingsById:e=>t=>{var n;return(null===(n=s(e)(t))||void 0===n?void 0:n.settings)||{}},getToolManifestById:o,installedCustomPluginMetaList:e=>l(e).filter(e=>"customPlugin"===e.type),installedPluginManifestList:e=>a(e).map(e=>e.manifest).filter(e=>!!e),installedPluginMetaList:l,installedPlugins:a,isPluginHasUI:e=>t=>{let n=o(e)(t);return!!(null==n?void 0:n.ui)},isPluginInstalled:e=>t=>a(t).some(t=>t.identifier===e),storeAndInstallPluginsIdList:e=>(0,i.A)([e.installedPlugins.map(e=>e.identifier),e.pluginStoreList.map(e=>e.identifier)].flat())}},24862:(e,t,n)=>{n.d(t,{Ku:()=>i,MT:()=>o,VH:()=>u,cZ:()=>s,j9:()=>l,rE:()=>r,vF:()=>a});let i="____",a="MD5HASH_",s="lobeArtifact",r="lobeThinking",o=RegExp("<lobeArtifact\\b[^>]*>(?<content>[\\S\\s]*?)(?:<\\/lobeArtifact>|$)"),l=/<lobeArtifact\b[^>]*>([\S\s]*?)<\/lobeArtifact>/,u=/<lobeThinking\b[^>]*>([\S\s]*?)(?:<\/lobeThinking>|$)/},29098:(e,t,n)=>{n.d(t,{i:()=>i});let i={api:[{description:"Create images from a text-only prompt.",name:"text2image",parameters:{properties:{prompts:{description:"The user's original image description, potentially modified to abide by the lobe-image-designer policies. If the user does not suggest a number of captions to create, create four of them. If creating multiple captions, make them as diverse as possible. If the user requested modifications to previous images, the captions should not simply be longer, but rather it should be refactored to integrate the suggestions into each of the captions. Generate no more than 4 images, even if the user requests more.",items:{type:"string"},maxItems:4,minItems:1,type:"array"},quality:{default:"standard",description:"The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image.",enum:["standard","hd"],type:"string"},seeds:{description:"A list of seeds to use for each prompt. If the user asks to modify a previous image, populate this field with the seed used to generate that image from the image lobe-image-designer metadata.",items:{type:"integer"},type:"array"},size:{default:"1024x1024",description:"The resolution of the requested image, which can be wide, square, or tall. Use 1024x1024 (square) as the default unless the prompt suggests a wide image, 1792x1024, or a full-body portrait, in which case 1024x1792 (tall) should be used instead. Always include this parameter in the request.",enum:["1792x1024","1024x1024","1024x1792"],type:"string"},style:{default:"vivid",description:"The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.",enum:["vivid","natural"],t
1ype:"string"}},required:["prompts"],type:"object"}}],identifier:"lobe-image-designer",meta:{avatar:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5NiIgaGVpZ2h0PSI5NiIgZmlsbD0ibm9uZSIgc3R5bGU9ImNvbG9yOiNmZmY7ZmlsbDojMDAwIj4KICAgIDxwYXRoIGQ9Ik0wIDBoOTZ2OTZIMHoiLz4KICAgIDxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIKICAgICAgICAgIGQ9Ik03OC44MyA0MS40NjJBMTcuOTQgMTcuOTQgMCAwIDAgNzcuMjkgMjYuNzNhMTguMTQgMTguMTQgMCAwIDAtMTkuNTM4LTguNzA0IDE3LjkzNyAxNy45MzcgMCAwIDAtMTMuNTI5LTYuMDMxIDE4LjE0MyAxOC4xNDMgMCAwIDAtMTcuMzA1IDEyLjU2IDE3Ljk0NiAxNy45NDYgMCAwIDAtMTEuOTk0IDguNzAxIDE4LjE0MyAxOC4xNDMgMCAwIDAgMi4yMzMgMjEuMjcxIDE3LjkzOCAxNy45MzggMCAwIDAgMS41NCAxNC43MzIgMTguMTQxIDE4LjE0MSAwIDAgMCAxOS41MzggOC43MDQgMTcuOTMgMTcuOTMgMCAwIDAgMTMuNTI4IDYuMDMxQTE4LjE0MiAxOC4xNDIgMCAwIDAgNjkuMDggNzEuNDI3YTE3LjkzOCAxNy45MzggMCAwIDAgMTEuOTk0LTguNzAxIDE4LjE0MSAxOC4xNDEgMCAwIDAtMi4yNDMtMjEuMjY0Wk01MS45MSA3OS4yODdjLTMuNTgzIDAtNi4zNTYtMS4xLTguNzgtMy4xMjIuMTEtLjA2LjMwMi0uMTY1LjQyNy0uMjQybDE0LjMzNi04LjI4YTIuMzI3IDIuMzI3IDAgMCAwIDEuMTc4LTIuMDRWNDUuMzkybDYuMDYgMy40OTlhLjIxNy4yMTcgMCAwIDEgLjExOC4xNjZWNjUuNzljLS4wMDEgNy41OTMtNi4zMjIgMTMuNDk3LTEzLjM0IDEzLjQ5N1pNMjIuNzc4IDY2LjkwNmExMy40NDcgMTMuNDQ3IDAgMCAxLTEuNjEtOS4wNDJjLjEwNy4wNjQuMjkzLjE3OC40MjYuMjU0TDM1LjkzIDY2LjRhMi4zMyAyLjMzIDAgMCAwIDIuMzU1IDBsMTcuNTAzLTEwLjEwNnY2Ljk5OGEuMjE3LjIxNyAwIDAgMS0uMDg3LjE4Nkw0MS4yMSA3MS44NDRhMTMuNTA3IDEzLjUwNyAwIDAgMS0xOC40MzEtNC45MzhabS0zLjc3Ny0zMS4yOTdhMTMuNDQ5IDEzLjQ0OSAwIDAgMSA3LjAyMy01LjkxNlY0Ni43NWEyLjMyNCAyLjMyNCAwIDAgMCAxLjE3NyAyLjAzOGwxNy41MDEgMTAuMTA1LTYuMDYgMy40OTlhLjIxOC4yMTggMCAwIDEtLjIwNC4wMThsLTE0LjQ5My04LjM3NEExMy41MDcgMTMuNTA3IDAgMCAxIDE5IDM1LjYwOVptNDkuNzkgMTEuNTg3TDUxLjI4OCAzNy4wOWw2LjA2LTMuNDk4YS4yMi4yMiAwIDAgMSAuMjA0LS4wMThsMTQuNDk0IDguMzdhMTMuNDk1IDEzLjQ5NSAwIDAgMS0yLjA4OCAyNC4zNDZWNDkuMjMzYTIuMzI4IDIuMzI4IDAgMCAwLTEuMTY3LTIuMDM3Wm02LjAzLTkuMDg0YTIwLjA2NCAyMC4wNjQgMCAwIDAtLjQyNS0uMjU0TDYwLjA2IDI5LjU3N2EyLjMzNyAyLjMzNyAwIDAgMC0yLjM1NSAwTDQwLjIwMyAzOS42ODN2LTYuOTk4YS4yMTguMjE4IDAgMCAxIC4wODYtLjE4NmwxNC40OTItOC4zNmExMy40OTUgMTMuNDk1IDAgMCAxIDIwLjA0IDEzLjk3M1pNMzYuOTA5IDUwLjU5bC02LjA2LTMuNDk5YS4yMS4yMSAwIDAgMS0uMTE4LS4xNjZWMzAuMTg3YTEzLjQ5NCAxMy40OTQgMCAwIDEgMjIuMTI4LTEwLjM2MWMtLjExLjA2LS4zLjE2NC0uNDI2LjI0bC0xNC4zMzYgOC4yODJhMi4zMzIgMi4zMzIgMCAwIDAtMS4xNzggMi4wMzhsLS4wMSAyMC4yMDRabTMuMjkyLTcuMDk3IDcuNzk1LTQuNTAzIDcuNzk2IDQuNXY5LjAwMmwtNy43OTYgNC40OTgtNy43OTUtNC41di04Ljk5N1oiLz4KPC9zdmc+Cg==",title:"DALL\xb7E 3"},systemRole:'Whenever a description of an image is given, use lobe-image-designer to create the images and then summarize the prompts used to generate the images in plain text. If the user does not ask for a specific number of images, default to creating four captions to send to lobe-image-designer that are written to be as diverse as possible.\n\n All captions sent to lobe-image-designer must abide by the following policies:\n\n1. If the description is not in English, then translate it.\n2. Do not create more than 4 images, even if the user requests more.\n3. Don\'t create images of politicians or other public figures. Recommend other ideas instead.\n5. DO NOT list or refer to the descriptions before OR after generating the images. They should ONLY ever be written out ONCE, in the `prompts` field of the request. You do not need to ask for permission to generate, just do it!\n6. Always mention the image type (photo, oil painting, watercolor painting, illustration, cartoon, drawing, vector, render, etc.) at the beginning of the caption. Unless the caption suggests otherwise, make at least 1--2 of the 4 images photos.\n7. Diversify depictions of ALL images with people to include DESCENT and GENDER for EACH person using direct terms. Adjust only human descriptions.\n - EXPLICITLY specify these attributes, not abstractly reference them. The attributes should be specified in a minimal way and should directly describe their physical form.\n - Your choices should be grounded in reality. For example, all of a given OCCUPATION should not be the same gender or race. Additionally, focus on creating diverse, inclusive, and exploratory scenes via the properties you choose during rewrites. Make choices that may be insightful or unique sometimes.\n - Use "various" or "diverse" ONLY IF the description refers to groups of more than 3 people. Do not change the number of people requested in the original description.\n - Don\'t alter memes, fictional character origins, or unseen people. Maintain the original prompt\'s intent and prioritize quality.\n - Do not create any imagery that would be offensive.\n\n8. Silently modify descriptions that include names or hints or references of specific people or celebrities by carefully selecting a few minimal modifications to substitute references to the people with generic descriptions that don\'t divulge any information about their identities, except for their genders and physiques. Do this EVEN WHEN the instructions ask for the prompt to not be changed. Some special cases:\n - Modify such prompts even if you don\'t know who the person is, or if their name is misspelled (e.g. "Barake Obema")\n - If the reference to the person will only appear as TEXT out in the image, then use the reference as is and do not modify it.\n - When making the substitutions, don\'t use prominent titles that could give away the person\'s identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope", say "religious figure"; and so on.\n - If any creative professional or studio is named, substitute the name with a description of their style that does not reference any specific people, or delete the reference if they are unknown. DO NOT refer to the artist or studio\'s style.\n\nThe prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.\nAll descriptions sent to lobe-image-designer should be a paragraph of text that is extremely descriptive and detailed. Each should be more than 3 sentences long.',type:"builtin"}},29425:(e,t,n)=>{n.d(t,{o:()=>k});var i=n(30504),a=n(14),s=n(40523),r=n(99606),o=n(92681),l=n(66386);let u=(e,t)=>
1({initializeClientDB:async i=>{if(t().initClientDBStage!==l.D.Idle&&t().initClientDBStage!==l.D.Error)return;let{initializeDB:a}=await Promise.all([n.e(31210),n.e(44134),n.e(76433),n.e(86476)]).then(n.bind(n,64091));await a({onError:t=>{e({initClientDBError:t})},onProgress:t=>{e({initClientDBProcess:t})},onStateChange:t=>{var n;e({initClientDBStage:t}),null==i||null===(n=i.onStateChange)||void 0===n||n.call(i,t)}})},markPgliteEnabled:()=>{t().updateSystemStatus({isEnablePglite:!0})},useInitClientDB:e=>(0,o.Ju)("initClientDB",()=>t().initializeClientDB(e))});var c=n(51616),d=n.n(c),g=n(99548),h=n(95974),p=n(92043),m=n(63753),f=n(98627),y=n(12735),w=n(59867);let b=e=>{let t="auto"===e?navigator.language:e;(0,y.v2)(t),document.documentElement.lang=t,(0,f.T)(w.Ty,"auto"===e?void 0:e,365)};var M=n(99793),I=n(96315);let v=(0,I.K)("g"),T=(e,t)=>({switchLocale:e=>{t().updateSystemStatus({language:e}),b(e)},switchThemeMode:e=>{t().updateSystemStatus({themeMode:e}),(0,f.T)(h.mh,"auto"===e?void 0:e)},updateSystemStatus:(n,i)=>{if(!t().isStatusInit)return;let a=(0,M.h)(t().status,n);d()(t().status,a)||(e({status:a},!1,i||v("updateSystemStatus")),t().statusStorage.saveToLocalStorage(a))},useCheckLatestVersion:function(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,o.Ju)(t?"checkLatestVersion":null,async()=>m.v.getLatestVersion(),{focusThrottleInterval:18e5,onSuccess:t=>{if(!(0,g.valid)(p.V_)||!(0,g.valid)(t))return;let n=(0,g.parse)(p.V_),i=(0,g.parse)(t);if(!n||!i)return;let a="".concat(n.major,".").concat(n.minor,".0"),s="".concat(i.major,".").concat(i.minor,".0");(0,g.gt)(s,a)&&e({hasNewVersion:!0,latestVersion:t},!1,v("checkLatestVersion"))}})},useInitSystemStatus:()=>(0,o.Ju)("initSystemStatus",()=>t().statusStorage.getFromLocalStorage(),{onSuccess:n=>{e({isStatusInit:!0},!1,"setStatusInit"),t().updateSystemStatus(n,"initSystemStatus")}})});var S=n(53838),A=n(36363),D=n(19026);let x=(0,I.K)("w"),N=(e,t)=>({switchBackToChat:e=>{var n;null===(n=t().router)||void 0===n||n.push((0,D.iU)(e||A.Ed,t().isMobile))},toggleChatSideBar:e=>{let n="boolean"==typeof e?e:!t().status.showChatSideBar;t().updateSystemStatus({showChatSideBar:n},x("toggleAgentPanel",e))},toggleExpandSessionGroup:(e,n)=>{let{status:i}=t(),a=(0,S.jM)(i.expandSessionGroupKeys,t=>{if(n)t.includes(e)||t.push(e);else{let n=t.indexOf(e);-1!==n&&t.splice(n,1)}});t().updateSystemStatus({expandSessionGroupKeys:a})},toggleMobilePortal:e=>{let n="boolean"==typeof e?e:!t().status.mobileShowPortal;t().updateSystemStatus({mobileShowPortal:n},x("toggleMobilePortal",e))},toggleMobileTopic:e=>{let n="boolean"==typeof e?e:!t().status.mobileShowTopic;t().updateSystemStatus({mobileShowTopic:n},x("toggleMobileTopic",e))},toggleSystemRole:e=>{let n="boolean"==typeof e?e:!t().status.mobileShowTopic;t().updateSystemStatus({showSystemRole:n},x("toggleMobileTopic",e))},toggleZenMode:()=>{let{status:e}=t(),n=!e.zenMode;t().updateSystemStatus({zenMode:n},x("toggleZenMode"))}});var P=n(15396);let C=(0,r.t)("global"),k=(0,s.h)()((0,i.eh)(C(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return{...P.ue,...N(...t),...u(...t),...T(...t)}})),a.x)},33433:(e,t,n)=>{n.d(t,{v:()=>K,j:()=>Z});var i=n(14),a=n(40523),s=n(99606);let r={builtinToolLoading:{},builtinTools:n(88456).F},o={customParams:{apiMode:"simple",enableSettings:!1,manifestMode:"url"},type:"customPlugin"},l={installedPlugins:[],loadingInstallPlugins:!0,pluginsSettings:{},newCustomPlugin:o,displayMode:"grid",listType:"all",pluginInstallLoading:{},pluginStoreList:[],...r};var u=n(96315);let c=(0,u.K)("builtinTool"),d=(e,t)=>({text2image:e=>{let{prompts:t,size:n="1024x1024",quality:i="standard",style:a="vivid"}=e;return t.map(e=>({prompt:e,quality:i,size:n,style:a}))},toggleBuiltinToolLoading:(t,n)=>{e({builtinToolLoading:{[t]:n}},!1,c("toggleBuiltinToolLoading"))},transformApiArgumentsToAiState:async(e,n)=>{let{builtinToolLoading:i,toggleBuiltinToolLoading:a}=t();if(i[e])return;let{[e]:s}=t();if(!s)return JSON.stringify(n);a(e,!0);try{let t=await s(n);return a(e,!1),JSON.stringify(t)}catch(t){throw a(e,!1),t}}});var g=n(12735),h=n(83282),p=n(21578),m=n(97013),f=n(99793),y=n(75452);let w=y.z.object({identifier:y.z.string(),id:y.z.string(),type:y.z.enum(["plugin","customPlugin"]),manifest:y.z.any().optional(),settings:y.z.any().optional()});class b extends m.t{delete(e){return this._deleteWithSync(e)}clear(){return this._clearWithSync()}mapToDBPlugin(e){return{...e,id:e.identifier}}constructor(){super("plugins",w),this.getList=async()=>this.table.toArray(),this.create=async e=>{let t=await this.table.get(e.identifier),n=this.mapToDBPlugin(e);return this._putWithSync((0,f.h)(t,n),e.identifier)},this.batchCreate=async e=>{let t=e.map(e=>this.mapToDBPlugin(e));return this._batchAdd(t)},this.update=async(e,t)=>{let{success:n}=await this._updateWithSync(e,t);return n}}}let M=new b;class I{uninstallPlugin(e){return M.delete(e)}async createCustomPlugin(e){return M.create({...e,type:"customPlugin"})}async updatePlugin(e,t){await M.update(e,t)}async updatePluginManifest(e,t){await M.update(e,{manifest:t})}async removeAllPlugins(){return M.clear()}
1async updatePluginSettings(e,t,n){await M.update(e,{settings:t})}constructor(){this.installPlugin=async e=>M.create(e),this.getInstalledPlugins=()=>M.getList()}}var v=n(64091),T=n(55208),S=n(44778),A=n(39691);class D{constructor(e,t){this.create=async e=>{let[t]=await this.db.insert(A.SI).values({...e,createdAt:new Date,updatedAt:new Date,userId:this.userId}).onConflictDoUpdate({set:{...e,updatedAt:new Date},target:[A.SI.identifier,A.SI.userId]}).returning();return t},this.delete=async e=>this.db.delete(A.SI).where((0,T.Uo)((0,T.eq)(A.SI.identifier,e),(0,T.eq)(A.SI.userId,this.userId))),this.deleteAll=async()=>this.db.delete(A.SI).where((0,T.eq)(A.SI.userId,this.userId)),this.query=async()=>this.db.select({createdAt:A.SI.createdAt,customParams:A.SI.customParams,identifier:A.SI.identifier,manifest:A.SI.manifest,settings:A.SI.settings,type:A.SI.type,updatedAt:A.SI.updatedAt}).from(A.SI).where((0,T.eq)(A.SI.userId,this.userId)).orderBy((0,S.i)(A.SI.createdAt)),this.findById=async e=>this.db.query.userInstalledPlugins.findFirst({where:(0,T.Uo)((0,T.eq)(A.SI.identifier,e),(0,T.eq)(A.SI.userId,this.userId))}),this.update=async(e,t)=>this.db.update(A.SI).set({...t,updatedAt:new Date}).where((0,T.Uo)((0,T.eq)(A.SI.identifier,e),(0,T.eq)(A.SI.userId,this.userId))),this.userId=t,this.db=e}}var x=n(34020);class N extends x.Q{get pluginModel(){return new D(v.s,this.userId)}constructor(...e){super(...e),this.installPlugin=async e=>{await this.pluginModel.create(e)},this.getInstalledPlugins=()=>this.pluginModel.query(),this.uninstallPlugin=async e=>{await this.pluginModel.delete(e)},this.createCustomPlugin=async e=>{await this.pluginModel.create({...e,type:"customPlugin"})},this.updatePlugin=async(e,t)=>{await this.pluginModel.update(e,t)},this.updatePluginManifest=async(e,t)=>{await this.pluginModel.update(e,{manifest:t})},this.removeAllPlugins=async()=>{await this.pluginModel.deleteAll()},this.updatePluginSettings=async(e,t,n)=>{await this.pluginModel.update(e,{settings:t})}}}var P=n(61205);class C{constructor(){this.installPlugin=async e=>{await P.du.plugin.createOrInstallPlugin.mutate(e)},this.getInstalledPlugins=()=>P.du.plugin.getPlugins.query(),this.uninstallPlugin=async e=>{await P.du.plugin.removePlugin.mutate({id:e})},this.createCustomPlugin=async e=>{await P.du.plugin.createPlugin.mutate({...e,type:"customPlugin"})},this.updatePlugin=async(e,t)=>{await P.du.plugin.updatePlugin.mutate({customParams:t.customParams,id:e,manifest:t.manifest,settings:t.settings})},this.updatePluginManifest=async(e,t)=>{await P.du.plugin.updatePlugin.mutate({id:e,manifest:t})},this.removeAllPlugins=async()=>{await P.du.plugin.removeAllPlugins.mutate()},this.updatePluginSettings=async(e,t,n)=>{await P.du.plugin.updatePlugin.mutate({id:e,settings:t},{signal:n})}}}var k=n(87358);let L="pglite"===k.env.NEXT_PUBLIC_CLIENT_DB?new N:new I,E="server"===k.env.NEXT_PUBLIC_SERVICE_MODE?new C:L;var j=n(55584),_=n(60859),z=n(23740);let O=(0,u.K)("customPlugin"),q=(e,t)=>({installCustomPlugin:async n=>{await E.createCustomPlugin(n),await t().refreshPlugins(),e({newCustomPlugin:o},!1,O("saveToCustomPluginList"))},reinstallCustomPlugin:async e=>{let n=z.w.getCustomPluginById(e)(t());if(!n)return;let{refreshPlugins:i,updateInstallLoadingState:a}=t();try{var s,r;a(e,!0);let t=await j.Q.getToolManifest(null===(s=n.customParams)||void 0===s?void 0:s.manifestUrl,null===(r=n.customParams)||void 0===r?void 0:r.useProxy);a(e,!1),await E.updatePluginManifest(e,t),await i()}catch(s){a(e,!1),console.error(s);let n=z.w.getPluginMetaById(e)(t()),i=_.V.getPluginTitle(n);p.Ew.error({description:(0,g.t)("error.".concat(s.message),{error:s.cause,ns:"plugin"}),message:(0,g.t)("error.reinstallError",{name:i,ns:"plugin"})})}},uninstallCustomPlugin:async e=>{await E.uninstallPlugin(e),await t().refreshPlugins()},updateCustomPlugin:async(e,n)=>{let{reinstallCustomPlugin:i}=t();await E.updatePlugin(e,n),await i(e)},updateNewCustomPlugin:n=>{e({newCustomPlugin:(0,h.A)({},t().newCustomPlugin,n)},!1,O("updateNewDevPlugin"))}});var B=n(21152),Y=n(92681),R=n(59178);let U=(e,t)=>({checkPluginsIsInstalled:async e=>{if(0===e.length)return;let{loadPluginStore:n,installPlugins:i}=t();0===R.f.onlinePluginStore(t()).length&&await n(),await i(e)},removeAllPlugins:async()=>{await E.removeAllPlugins(),await t().refreshPlugins()},updatePluginSettings:async(n,i)=>{let a=t().updatePluginSettingsSignal;a&&a.abort(B.ve);let s=new AbortController,r=z.w.getPluginSettingsById(n)(t()),o=(0,f.h)(r,i);e({updatePluginSettingsSignal:s},!1,"create new Signal"),await E.updatePluginSettings(n,o,s.signal),await t().refreshPlugins()},useCheckPluginsIsInstalled:(e,n)=>(0,Y.lA)(e?n:null,t().checkPluginsIsInstalled),validatePluginSettings:async e=>{let i=z.w.getToolManifestById(e)(t());if(!i||!i.settings)return;let a=z.w.getPluginSettingsById(e)(t()),{Validator:s}=await n.e(70171).then(n.bind(n,70171)),r=new s(i.settings).validate(a);return r.valid?{errors:[],valid:!0}:{errors:r.errors,valid:!1}}});var W=n(53838),H=n(20071),G=n(90427);let Q=(0,u.K)("pluginStore"),V="loadInstalledPlugins",F=(e,t)=>({installPlugin:async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plugin",i=R.f.getPluginById(e)(t());if(!i)return;let{updateInstallLoadingState:a,refreshPlugins:s}=t();try{a(e,!0);let t=await j.Q.getToolManifest(i.manifest);await E.installPlugin({identifier:i.identifier,manifest:t,type:n}),await s(),a(e,void 0)}catch(t){console.error(t),a(e,void 0),p.Ew.error({description:(0,g.t)("error.".concat(t.message),{ns:"plugin"}),message:(0,g.t)("error.installError",{name:i.meta.title,ns:"plugin"})})}},installPlugins:async e=>{let{installPlugin:n}=t();await Promise.all(e.map(e=>n(e)))},loadPluginStore:async()=>{let t=await j.Q.getToolList();return e({pluginStoreList:t},!1,Q("loadPluginList")),t},refreshPlugins:async()=>{await (0,H.j)(V)},uninstallPlugin:async e=>{await E.uninstallPlugin(e),await t().refreshPlugins()},updateInstallLoadingState:(t,n)=>{e((0,W.jM)(e=>{e.pluginInstallLoading[t]=n}),!1,Q("updateInstallLoadingState"))},useFetchInstalledPlugins:t=>(0,G.default)(t?V:null,E.getInstalledPlugins,{fallbackData:[],onSuccess:t=>{e({installedPlugins:t,loadingInstallPlugins:!1},!1,Q("useFetchInstalledPlugins"))},revalidateOnFocus:!1,suspense:!0}),useFetchPluginStore:()=>(0,G.default)("loadPluginStore",t().loadPluginStore,{fallbackData:[],revalidateOnFocus:!1,suspense:!0})}),J=(0,s.t)("tools"),Z=(0,a.h)()(J(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return{...l,...U(...t),...q(...t),...F(...t),...d(...t)}}),i.x),K=()=>Z.getState()},42770:(e,t,n)=>{n.d(t,{J:()=>s});var i=n(29425),a=n(69126);let s={getCurrentLanguage:()=>a.c.currentLanguage(i.o.getState())}},43063:(e,t,n)=>{n.d(t,{S:()=>s});var i=n(27138),a=n(19501);let s=(0,i.A)({oauth:"/api/auth",proxy:"/webapi/proxy",assistantStore:"/webapi/assistant/store",assistant:e=>(0,a.h)("/webapi/assistant/".concat(e)),gateway:"/webapi/plugin/gateway",pluginStore:"/webapi/plugin/store",trace:"/webapi/trace",chat:e=>(0,a.h)("/webapi/chat/".concat(e)),chatModels:e=>(0,a.h)("/webapi/chat/models/".concat(e)),images:e=>"/webapi/text-to-image/".concat(e),stt:"/webapi/stt/openai",tts:"/webapi/tts/openai",edge:"/webapi/tts/edge",microsoft:"/webapi/tts/microsoft"},(e,t,n)=>{"string"==typeof t?e[n]=(0,a.h)(t):e[n]=t})},50377:(e,t,n)=>{n.d(t,{M:()=>s});var i=n(17953),a=n(24862);let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",s=n&&"default"!==n?"".concat(a.Ku+n):"",r=e+a.Ku+t+s;if(r.length>=64){let n=a.vF+i.VV.hashStr(t).toString();r=e+a.Ku+n+s}return r}},55584:(e,t,n)=>{n.d(t,{Q:()=>o});var i=n(42770),a=n(72404),s=n(43063);
1class r{constructor(){this.getToolList=async()=>{let e=i.J.getCurrentLanguage(),t=await fetch("".concat(s.S.pluginStore,"?locale=").concat(e));return(await t.json()).plugins},this.getToolManifest=a.UN,this.convertOpenAIManifestToLobeManifest=a.XY}}let o=new r},59178:(e,t,n)=>{n.d(t,{f:()=>i});let i={getPluginById:e=>t=>t.pluginStoreList.find(t=>t.identifier===e),isPluginInstallLoading:e=>t=>t.pluginInstallLoading[e],onlinePluginStore:e=>{let t=new Set(e.installedPlugins.map(e=>e.identifier));return("all"===e.listType?e.pluginStoreList:e.pluginStoreList.filter(e=>t.has(e.identifier))).map(e=>({author:e.author,createdAt:e.createdAt,homepage:e.homepage,identifier:e.identifier,meta:e.meta,type:"plugin"}))}}},59867:(e,t,n)=>{n.d(t,{Ty:()=>a,xN:()=>i});let i="en-US",a="LOBE_LOCALE"},60859:(e,t,n)=>{n.d(t,{V:()=>i});let i={getPluginAvatar:e=>(null==e?void 0:e.avatar)||"\uD83E\uDDE9",getPluginDesc:e=>null==e?void 0:e.description,getPluginFormList:(e,t)=>null==e?void 0:e.find(e=>e.identifier===t),getPluginTags:e=>null==e?void 0:e.tags,getPluginTitle:e=>null==e?void 0:e.title,isCustomPlugin:(e,t)=>t.some(t=>t.identifier===e&&"customPlugin"===t.type),isSettingSchemaNonEmpty:e=>(null==e?void 0:e.properties)&&Object.keys(e.properties).length>0}},63753:(e,t,n)=>{n.d(t,{v:()=>s});var i=n(2119);class a{constructor(){this.getLatestVersion=async()=>{let e=await fetch("https://registry.npmmirror.com/@lobehub/chat/latest");return(await e.json()).version},this.getGlobalConfig=async()=>i.r.config.getGlobalConfig.query(),this.getDefaultAgentConfig=async()=>i.r.config.getDefaultAgentConfig.query()}}let s=new a},69126:(e,t,n)=>{n.d(t,{c:()=>o});var i=n(59867),a=n(70638),s=n(20425);let r=e=>(0,s.i)(e).language||"auto",o={currentLanguage:e=>{let t=r(e);return"auto"===t?a.i?i.xN:navigator.language:t},language:r}},72404:(e,t,n)=>{n.d(t,{UN:()=>u,XY:()=>l,cU:()=>c});var i=n(96523),a=n(91938),s=n(43063),r=n(50377);let o=async function(e){let t,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{t=await (a?fetch(s.S.proxy,{body:e,method:"POST"}):fetch(e))}catch(e){throw TypeError("fetchError")}if(!t.ok)throw TypeError("fetchError");let r=t.headers.get("Content-Type");try{if("application/json"===r)i=await t.json();else{let{default:e}=await n.e(73251).then(n.bind(n,73251)),a=await t.text();i=e.parse(a)}}catch(e){throw TypeError("urlError")}return i},l=e=>{let t={api:[],homepage:e.legal_info_url,identifier:e.name_for_model,meta:{avatar:e.logo_url,description:e.description_for_human,title:e.name_for_human},openapi:e.api.url,systemRole:e.description_for_model,type:"default",version:"1"};switch(e.auth.type){case"none":break;case"service_http":t.settings={properties:{apiAuthKey:{default:e.auth.verification_tokens.openai,description:"API Key",format:"password",title:"API Key",type:"string"}},type:"object"}}return t},u=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)throw TypeError("noManifest");let a=await o(e,t);a.description_for_model&&(a=l(a));let s=i.M.safeParse(a);if(!s.success)throw TypeError("manifestInvalid",{cause:s.error});if(s.data.openapi){let e=await o(s.data.openapi,t);try{let{OpenAPIConvertor:t}=await Promise.all([n.e(21963),n.e(66113)]).then(n.t.bind(n,21963,23)),i=new t(e),s=await i.convertOpenAPIToPluginSchema();a.api=[...a.api,...s],a.settings=await i.convertAuthToSettingsSchema(a.settings)}catch(e){throw TypeError("openAPIInvalid",{cause:e})}}return a},c=e=>{let t=e.flatMap(e=>e.api.map(t=>({description:t.description,name:(0,r.M)(e.identifier,t.name,e.type),parameters:t.parameters})));return(0,a.A)(t,"name").map(e=>({function:e,type:"function"}))}},88456:(e,t,n)=>{n.d(t,{F:()=>r});let i={api:[],identifier:"lobe-artifacts",meta:{avatar:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiIHJ4PSI1MTIiIGZpbGw9IiNDNDc4NUIiLz48cGF0aCBkPSJNNTEyIDYxMmM1NS4yMjggMCAxMDAtNDQuNzcyIDEwMC0xMDBzLTQ0Ljc3Mi0xMDAtMTAwLTEwMC0xMDAgNDQuNzcyLTEwMCAxMDAgNDQuNzcyIDEwMCAxMDAgMTAwWiIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjU2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNNTEyIDY2MmExNDkuOTk4IDE0OS45OTggMCAwIDEtOTIuNTk3IDEzOC41ODIgMTUwLjAwMiAxNTAuMDAyIDAgMCAxLTIwNC41MjEtMTA5LjMxOCAxNDkuOTk4IDE0OS45OTggMCAwIDEgNjMuNzgzLTE1My45ODRBMTQ5Ljk5MiAxNDkuOTkyIDAgMCAxIDM2MiA1MTJhMTQ5Ljk5OSAxNDkuOTk5IDAgMSAxIDE1MC0xNTAgMTQ5Ljk5OCAxNDkuOTk4IDAgMCAxIDI5Ny4xMTgtMjkuMjYzQTE1MCAxNTAgMCAwIDEgNjYyIDUxMmMyOS42NjcgMCA1OC42NjggOC43OTcgODMuMzM1IDI1LjI4YTE0OS45OTUgMTQ5Ljk5NSAwIDAgMSA2My43ODMgMTUzLjk4NEExNTAgMTUwIDAgMCAxIDUxMiA2NjJaTTUxMiAzNjJ2NTBNMzYyIDUxMmg1ME02NjIgNTEyaC01ME01MTIgNjYydi01ME0zNzguNjY3IDM3OC42NjdsNjIuNjY2IDYyLjY2Nk01ODIuNjY3IDQ0MS4zMzNsNjIuNjY2LTYyLjY2Nk0zNzguNjY3IDY0NS4zMzNsNjIuNjY2LTYyLjY2Nk01ODIuNjY3IDU4Mi42NjdsNjIuNjY2IDYyLjY2NiIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjU2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",title:"Artifacts"},systemRole:'<artifacts_info>\nThe assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.\
1n\n# Good artifacts are...\n- Substantial content (>15 lines)\n- Content that the user is likely to modify, iterate on, or take ownership of\n- Self-contained, complex content that can be understood on its own, without context from the conversation\n- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)\n- Content likely to be referenced or reused multiple times\n\n# Don\'t use artifacts for...\n- Simple, informational, or short content, such as brief code snippets, mathematical equations, or small examples\n- Primarily explanatory, instructional, or illustrative content, such as examples provided to clarify a concept\n- Suggestions, commentary, or feedback on existing artifacts\n- Conversational or explanatory content that doesn\'t represent a standalone piece of work\n- Content that is dependent on the current conversational context to be useful\n- Content that is unlikely to be modified or iterated upon by the user\n- Request from users that appears to be a one-off question\n\n# Usage notes\n- One artifact per message unless specifically requested\n- Prefer in-line content (don\'t use artifacts) when possible. Unnecessary use of artifacts can be jarring for users.\n- If a user asks the assistant to "draw an SVG" or "make a website," the assistant does not need to explain that it doesn\'t have these capabilities. Creating the code and placing it within the appropriate artifact will fulfill the user\'s intentions.\n- If asked to generate an image, the assistant can offer an SVG instead. The assistant isn\'t very proficient at making SVG images but should engage with the task positively. Self-deprecating humor about its abilities can make it an entertaining experience for users.\n- The assistant errs on the side of simplicity and avoids overusing artifacts for content that can be effectively presented within the conversation.\n\n<artifact_instructions>\n When collaborating with the user on creating content that falls into compatible categories, the assistant should follow these steps:\n\n 1. Immediately before invoking an artifact, think for one sentence in <lobeThinking> tags about how it evaluates against the criteria for a good and bad artifact. Consider if the content would work just fine without an artifact. If it\'s artifact-worthy, in another sentence determine if it\'s a new artifact or an update to an existing one (most common). For updates, reuse the prior identifier.\n 2. Wrap the content in opening and closing `<lobeArtifact>` tags.\n 3. Assign an identifier to the `identifier` attribute of the opening `<lobeArtifact>` tag. For updates, reuse the prior identifier. For new artifacts, the identifier should be descriptive and relevant to the content, using kebab-case (e.g., "example-code-snippet"). This identifier will be used consistently throughout the artifact\'s lifecycle, even when updating or iterating on the artifact.\n 4. Include a `title` attribute in the `<lobeArtifact>` tag to provide a brief title or description of the content.\n 5. Add a `type` attribute to the opening `<lobeArtifact>` tag to specify the type of content the artifact represents. Assign one of the following values to the `type` attribute:\n - Code: "application/lobe.artifacts.code"\n - Use for code snippets or scripts in any programming language.\n - Include the language name as the value of the `language` attribute (e.g., `language="python"`).\n - Do not use triple backticks when putting code in an artifact.\n - Documents: "text/markdown"\n - Plain text, Markdown, or other formatted text documents\n - HTML: "text/html"\n - The user interface can render single file HTML pages placed within the artifact tags. HTML, JS, and CSS should be in a single file when using the `text/html` type.\n - Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so `<img src="/api/placeholder/400/320" alt="placeholder" />`\n - The only place external scripts can be imported from is https://cdnjs.cloudflare.com\n - It is inappropriate to use "text/html" when sharing snippets, code samples & example HTML or CSS code, as it would be rendered as a webpage and the source code would be obscured. The assistant should instead use "application/lobe.artifacts.code" defined above.\n - If the assistant is unable to follow the above requirements for any reason, use "application/lobe.artifacts.code" type for the artifact instead, which will not attempt to render the webpage.\n - SVG: "image/svg+xml"\n - The user interface will render the Scalable Vector Graphics (SVG) image within the artifact tags.\n - The assistant should specify the viewbox of the SVG rather than defining a width/height\n - Mermaid Diagrams: "application/lobe.artifacts.mermaid"\n - The user interface will render Mermaid diagrams placed within the artifact tags.\n - Do n
1ot put Mermaid code in a code block when using artifacts.\n - React Components: "application/lobe.artifacts.react"\n - Use this for displaying either: React elements, e.g. `<strong>Hello World!</strong>`, React pure functional components, e.g. `() => <strong>Hello World!</strong>`, React functional components with Hooks, or React component classes\n - When creating a React component, ensure it has no required props (or provide default values for all props) and use a default export.\n - Use Tailwind classes for styling. DO NOT USE ARBITRARY VALUES (e.g. `h-[600px]`).\n - Base React is available to be imported. To use hooks, first import it at the top of the artifact, e.g. `import { useState } from "react"`\n - The [email protected] library is available to be imported. e.g. `import { Camera } from "lucide-react"` & `<Camera color="red" size={48} />`\n - The recharts charting library is available to be imported, e.g. `import { LineChart, XAxis, ... } from "recharts"` & `<LineChart ...><XAxis dataKey="name"> ...`\n - The assistant can use prebuilt components from the `shadcn/ui` library after it is imported: `import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from \'@/components/ui/alert\';`. If using components from the shadcn/ui library, the assistant mentions this to the user and offers to help them install the components if necessary.\n - NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED.\n - Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so `<img src="/api/placeholder/400/320" alt="placeholder" />`\n - If you are unable to follow the above requirements for any reason, use "application/lobe.artifacts.code" type for the artifact instead, which will not attempt to render the component.\n 6. Include the complete and updated content of the artifact, without any truncation or minimization. Don\'t use "// rest of the code remains the same...".\n 7. If unsure whether the content qualifies as an artifact, if an artifact should be updated, or which type to assign to an artifact, err on the side of not creating an artifact.\n</artifact_instructions>\n\nHere are some examples of correct usage of artifacts by other AI assistants:\n\n<examples>\n <example_docstring>\n This example demonstrates how to create a new artifact and reference it in the response.\n </example_docstring>\n\n <example>\n <user_query>Can you help me create a Python script to calculate the factorial of a number?</user_query>\n\n <assistant_response>\n Sure! Here\'s a Python script that calculates the factorial of a number:\n\n <lobeThinking>Creating a Python script to calculate factorials meets the criteria for a good artifact. It\'s a self-contained piece of code that can be understood on its own and is likely to be reused or modified. This is a new conversation, so there are no pre-existing artifacts. Therefore, I\'m creating a new artifact.</lobeThinking>\n\n <lobeArtifact identifier="factorial-script" type="application/lobe.artifacts.code" language="python" title="Simple Python factorial script">\n def factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n - 1)\n\n ...\n </assistant_response>\n\n </example>\n\n<example_docstring>\nThis example shows how to update an existing artifact and reference it in the response.\n</example_docstring>\n\n <example>\n <user_query>Thanks for the factorial script! Can you modify it to handle invalid input gracefully?</user_query>\n\n <assistant_response>\n Good point! It\'s important to handle invalid input to prevent errors. I\'ll update the script to include input validation.\n\n <lobeThinking>This request is a direct modification of the existing "factorial-calculator" artifact. It\'s not a new artifact but an update to make the script more robust. I\'ll reuse the "factorial-calculator" identifier to maintain continuity and show the evolution of our code.</lobeThinking>
1\n\n <lobeArtifact identifier="factorial-script" type="application/lobe.artifacts.code" language="python" title="Simple Python factorial script">\n def factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n - 1)\n\n while True:\n try:\n num = int(input("Enter a non-negative integer: "))\n if num < 0:\n raise ValueError\n break\n except ValueError:\n print("Invalid input. Please enter a non-negative integer.")\n\n ...\n </assistant_response>\n\n </example>\n\n<example_docstring>\nThis example shows how to create an SVG artifact and reference it in the response.\n</example_docstring>\n\n <example>\n <user_query>Can you draw a simple blue circle in SVG?</user_query>\n\n <assistant_response>\n I\'ll create a simple blue circle for you using SVG.\n\n <lobeThinking>Drawing a simple blue circle in SVG is a good candidate for an artifact. It\'s a standalone visual element that can be reused or modified. This is a new request, so I\'ll create a new artifact with the identifier "blue-circle-svg".</lobeThinking>\n\n <lobeArtifact identifier="blue-circle-svg" type="image/svg+xml" title="Simple blue circle SVG">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n <circle cx="50" cy="50" r="40" fill="blue" />\n </svg>\n </lobeArtifact>\n\n Here\'s a simple SVG image of a blue circle, as requested. The circle is centered at coordinates (50, 50) with a radius of 40 pixels, and it\'s filled with the color blue.\n\n ...\n </assistant_response>\n\n </example>\n\n<example_docstring>\n This example demonstrates how to create a Mermaid artifact for a simple flow chart.\n </example_docstring>\n\n <example>\n <user_query>Can you create a simple flow chart showing the process of making tea using Mermaid?</user_query>\n\n <assistant_response>\n Sure! Here\'s a simple flow chart depicting the process of making tea using Mermaid syntax:\n\n <lobeThinking>Creating a flow chart to show the process of making tea is an excellent candidate for an artifact. It\'s a self-contained diagram that can be understood on its own and might be used in various contexts like a presentation or a how-to guide. This is a new request, so I\'ll create a new artifact with the identifier "tea-making-flowchart".</lobeThinking>\n\n <lobeArtifact identifier="tea-making-flowchart" type="application/lobe.artifacts.mermaid" title="Flow chart: Making Tea">\n graph TD\n A[Start] --\x3e B{Water boiled?}\n B --\x3e|Yes| C[Add tea leaves to cup]\n B --\x3e|No| D[Boil water]\n D --\x3e B\n C --\x3e E[Pour boiling water into cup]\n E --\x3e F[Steep tea for desired time]\n F --\x3e G[Remove tea leaves]\n G --\x3e H[Add milk or sugar, if desired]\n H --\x3e I[Enjoy your tea!]\n I --\x3e J[End]\n </lobeArtifact>\n\n This flow chart uses Mermaid syntax to visualize the steps involved in making a cup of tea.\n\n ...\n </assistant_response>\n </example>\n\n<example_docstring>\nThis example demonstrates the assistant\'s preference to update existing artifacts, rather than create new ones.\n</example_docstring>\n\n <example>\n <user_query>I\'m teaching a beginner\'s programming course, and I want to include some interactive examples for the students to try out. Do you have any suggestions for simple programs that could help them understand basic concepts?</user_query>\n\n <assistant_response>\n Teaching a beginner\'s programming course is a great opportunity to introduce students to fundamental concepts through interactive examples. One idea that comes to mind is building upon the factorial calculator we discussed earlier.\n\n <lobeThinking>The interactive factorial calculator is a good artifact: it\'s substantial (>15 lines), self-contained, and usable outside the conversation. It\'s not simple informational or primarily explanatory content. This is an update to our existing "factorial
1-calculator" artifact, transforming it into a teaching tool.</lobeThinking>\n\n <lobeArtifact identifier="factorial-script" type="application/lobe.artifacts.code" language="python" title="Simple Python factorial script">\n def factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n - 1)\n\n def main():\n print("Welcome to the Factorial Calculator!")\n print("Enter a non-negative integer to calculate its factorial.")\n print("Enter \'q\' to quit the program.")\n\n while True:\n user_input = input("\n\nEnter a number (or \'q\' to quit): ")\n\n if user_input == \'q\':\n print("Thank you for using the Factorial Calculator. Goodbye!")\n break\n\n try:\n num = int(user_input)\n if num < 0:\n raise ValueError\n result = factorial(num)\n print(f"The factorial of {num} is {result}")\n except ValueError:\n print("Invalid input. Please enter a non-negative integer or \'q\' to quit.")\n\n if __name__ == "__main__":\n main()\n </lobeArtifact>\n\n I\'ve updated it to make it even more suitable as a learning example for your students. Here are the key changes:\n\n 1. Separated the factorial calculation logic into its own function, `factorial()`. This demonstrates the concept of function definition and recursion.\n\n ...\n </assistant_response>\n\n </example>\n\n<example_docstring>\n This example demonstrates how to create a React component artifact for a metrics dashboard.\n</example_docstring>\n\n <example>\n <user_query>Can you create a React component for a metrics dashboard?</user_query>\n\n <assistant_response>\n Absolutely! Here\'s a React component that implements a basic metrics dashboard:\n\n <lobeThinking>Creating a React component for a metrics dashboard is a good artifact. It\'s substantial, self-contained, and can be reused in various web applications. It\'s not just a brief code snippet or primarily explanatory content. This is a new request, so I\'ll create a new artifact with the identifier "metrics-dashboard-component".</lobeThinking>\n\n <lobeArtifact identifier="dashboard-component" type="application/lobe.artifacts.react" title="React Component: Metrics Dashboard">\n import React, { useState, useEffect } from \'react\';\n import { BarChart, Bar, XAxis, YAxis, ResponsiveContainer } from \'recharts\';\n import { Card, CardHeader, CardContent } from \'@/components/ui/card\';\n\n const generateData = () => [...Array(12)].map((_, i) => ({\n month: [\'Jan\', \'Feb\', \'Mar\', \'Apr\', \'May\', \'Jun\', \'Jul\', \'Aug\', \'Sep\', \'Oct\', \'Nov\', \'Dec\'][i],\n revenue: Math.floor(Math.random() * 5000) + 1000\n }));\n\n const MetricCard = ({ title, value, change }) => (\n <Card>\n <CardHeader>{title}</CardHeader>\n\n ...\n\n export default Dashboard;\n </lobeArtifact>\n\n Feel free to ask if you want to extend this component!\n </assistant_response>\n </example>\n\n<example_docstring>\nThis example demonstrates the assistant\'s decision not to use an artifact because it would make the information less accessible and hinder the natural flow of the conversation.\n</example_docstring>\n\n <example>\n <user_query>\n Can you give me a quick rundown of some common Python list methods? I\'m new to Python and trying to understand the basics.\n </user_query>\n\n <assistant_response>\n Absolutely! Python lists are versatile and have many useful methods. Here\'s a quick overview of some common ones:\n\n <lobeThinking>The user asked about common Python list methods. While informative, putting this in a separate artifact window would make it harder for the user to quickly scan, understand, and ask follow-up questions. Keeping it in our
1chat makes the info more glanceable and our discussion more fluid.</lobeThinking>\n\n 1. `append(x)`: Adds an item `x` to the end of the list.\n Example: `my_list.append(4)`\n\n 2. `extend(iterable)`: Adds all items from an iterable (like another list) to the end.\n Example: `my_list.extend([5, 6, 7])`\n\n 3. `insert(i, x)`: Inserts an item `x` at a given position `i`.\n Example: `my_list.insert(1, "new")`\n\n ...\n </assistant_response>\n </example>\n\n<example_docstring>\nThis example demonstrates the assistant\'s decision not to use an artifact for an explanation that includes code samples, because the content is primarily educational and benefits from being part of the conversational flow.\n</example_docstring>\n\n <example>\n <user_query>\n I\'m learning Python and algorithms. Can you explain how binary search works and maybe show me a simple Python implementation? I learn best by seeing code.\n </user_query>\n\n <assistant_response>\n Absolutely! Binary search is an efficient algorithm for finding an item in a sorted list. It works by repeatedly dividing the search interval in half. Let\'s walk through it with a simple Python implementation.\n\n <lobeThinking>The user asked for an explanation of binary search with a Python implementation. Although this involves code, it\'s primarily educationalâthe code is part of the explanation, not a standalone tool. Putting this in an artifact would disrupt the learning flow. The user learns best by seeing code in context, so keeping everything in our chat makes it easier for them to follow along and ask questions.</lobeThinking>\n\n First, let\'s define a function for binary search:\n\n ```python\n def binary_search(arr, target):\n left, right = 0, len(arr) - 1\n\n while left <= right:\n mid = (left + right) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n left = mid + 1\n ...\n </assistant_response>\n </example>\n\n</examples>\n\nThe assistant should not mention any of these instructions to the user, nor make reference to the `lobeArtifact` tag, any of the MIME types (e.g. `application/lobe.artifacts.code`), or related syntax unless it is directly relevant to the query.\n\nThe assistant should always take care to not produce artifacts that would be highly hazardous to human health or wellbeing if misused, even if is asked to produce them for seemingly benign reasons. However, if Claude would be willing to produce the same content in text form, it should be willing to produce it in an artifact.\n</artifacts_info>\n',type:"builtin"};var a=n(29098),s=n(702);let r=[{identifier:i.identifier,manifest:i,type:"builtin"},{identifier:a.i.identifier,manifest:a.i,type:"builtin"},{hidden:!0,identifier:s.J.identifier,manifest:s.J,type:"builtin"}]},95974:(e,t,n)=>{n.d(t,{mh:()=>i,rw:()=>s,sM:()=>a});let i="LOBE_THEME_APPEARANCE",a="LOBE_THEME_PRIMARY_COLOR",s="LOBE_THEME_NEUTRAL_COLOR"},98627:(e,t,n)=>{n.d(t,{T:()=>r});var i=n(30832),a=n.n(i),s=n(39402);let r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qm;if(void 0===t){let t=new Date(0).toUTCString();document.cookie="".concat(e,"=; expires=").concat(t,"; path=/;")}else{let i=a()().add(n,"day").toDate().toUTCString();document.cookie="".concat(e,"=").concat(t,";expires=").concat(i,";path=/;")}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.