| 
									
										
										
										
											2024-01-09 13:46:02 +08:00
										 |  |  | import type { Viewport } from 'next' | 
					
						
							| 
									
										
										
										
											2025-04-15 17:05:50 +08:00
										 |  |  | import RoutePrefixHandle from './routePrefixHandle' | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | import I18nServer from './components/i18n-server' | 
					
						
							| 
									
										
										
										
											2024-09-08 12:14:11 +07:00
										 |  |  | import BrowserInitor from './components/browser-initor' | 
					
						
							| 
									
										
										
										
											2023-06-29 15:30:12 +08:00
										 |  |  | import SentryInitor from './components/sentry-initor' | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | import { getLocaleOnServer } from '@/i18n/server' | 
					
						
							| 
									
										
										
										
											2024-12-30 13:39:26 +08:00
										 |  |  | import { TanstackQueryIniter } from '@/context/query-client' | 
					
						
							| 
									
										
										
										
											2025-02-25 12:09:37 +08:00
										 |  |  | import { ThemeProvider } from 'next-themes' | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | import './styles/globals.css' | 
					
						
							|  |  |  | import './styles/markdown.scss' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const metadata = { | 
					
						
							|  |  |  |   title: 'Dify', | 
					
						
							| 
									
										
										
										
											2024-01-09 13:46:02 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const viewport: Viewport = { | 
					
						
							|  |  |  |   width: 'device-width', | 
					
						
							|  |  |  |   initialScale: 1, | 
					
						
							|  |  |  |   maximumScale: 1, | 
					
						
							|  |  |  |   viewportFit: 'cover', | 
					
						
							|  |  |  |   userScalable: false, | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  | const LocaleLayout = async ({ | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   children, | 
					
						
							|  |  |  | }: { | 
					
						
							|  |  |  |   children: React.ReactNode | 
					
						
							|  |  |  | }) => { | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |   const locale = await getLocaleOnServer() | 
					
						
							| 
									
										
										
										
											2023-06-29 15:30:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   return ( | 
					
						
							| 
									
										
										
										
											2025-02-25 12:09:37 +08:00
										 |  |  |     <html lang={locale ?? 'en'} className="h-full" suppressHydrationWarning> | 
					
						
							| 
									
										
										
										
											2023-11-28 20:05:19 +08:00
										 |  |  |       <head> | 
					
						
							|  |  |  |         <meta name="theme-color" content="#FFFFFF" /> | 
					
						
							|  |  |  |         <meta name="mobile-web-app-capable" content="yes" /> | 
					
						
							|  |  |  |         <meta name="apple-mobile-web-app-capable" content="yes" /> | 
					
						
							|  |  |  |         <meta name="apple-mobile-web-app-status-bar-style" content="default" /> | 
					
						
							|  |  |  |       </head> | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |       <body | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         className="color-scheme h-full select-auto" | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |         data-api-prefix={process.env.NEXT_PUBLIC_API_PREFIX} | 
					
						
							| 
									
										
										
										
											2025-05-12 13:44:41 +08:00
										 |  |  |         data-web-prefix={process.env.NEXT_PUBLIC_WEB_PREFIX} | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |         data-pubic-api-prefix={process.env.NEXT_PUBLIC_PUBLIC_API_PREFIX} | 
					
						
							| 
									
										
										
										
											2025-05-12 13:44:41 +08:00
										 |  |  |         data-pubic-web-prefix={process.env.NEXT_PUBLIC_PUBLIC_WEB_PREFIX} | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |         data-marketplace-api-prefix={process.env.NEXT_PUBLIC_MARKETPLACE_API_PREFIX} | 
					
						
							|  |  |  |         data-marketplace-url-prefix={process.env.NEXT_PUBLIC_MARKETPLACE_URL_PREFIX} | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |         data-public-edition={process.env.NEXT_PUBLIC_EDITION} | 
					
						
							| 
									
										
										
										
											2024-06-06 15:01:58 +08:00
										 |  |  |         data-public-support-mail-login={process.env.NEXT_PUBLIC_SUPPORT_MAIL_LOGIN} | 
					
						
							| 
									
										
										
										
											2023-06-13 16:04:54 +08:00
										 |  |  |         data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN} | 
					
						
							| 
									
										
										
										
											2023-08-25 19:38:52 +08:00
										 |  |  |         data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE} | 
					
						
							| 
									
										
										
										
											2023-10-16 15:26:25 +08:00
										 |  |  |         data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT} | 
					
						
							| 
									
										
										
										
											2024-09-14 15:11:45 +09:00
										 |  |  |         data-public-text-generation-timeout-ms={process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS} | 
					
						
							| 
									
										
										
										
											2025-03-12 01:57:05 -03:00
										 |  |  |         data-public-max-tools-num={process.env.NEXT_PUBLIC_MAX_TOOLS_NUM} | 
					
						
							| 
									
										
										
										
											2025-03-18 09:32:47 +08:00
										 |  |  |         data-public-max-parallel-limit={process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT} | 
					
						
							| 
									
										
										
										
											2025-01-06 10:38:14 +08:00
										 |  |  |         data-public-top-k-max-value={process.env.NEXT_PUBLIC_TOP_K_MAX_VALUE} | 
					
						
							| 
									
										
										
										
											2025-01-22 10:43:40 +08:00
										 |  |  |         data-public-indexing-max-segmentation-tokens-length={process.env.NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH} | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |         data-public-loop-node-max-count={process.env.NEXT_PUBLIC_LOOP_NODE_MAX_COUNT} | 
					
						
							| 
									
										
										
										
											2025-03-26 14:17:59 +08:00
										 |  |  |         data-public-max-iterations-num={process.env.NEXT_PUBLIC_MAX_ITERATIONS_NUM} | 
					
						
							| 
									
										
										
										
											2025-04-23 18:02:18 +08:00
										 |  |  |         data-public-enable-website-jinareader={process.env.NEXT_PUBLIC_ENABLE_WEBSITE_JINAREADER} | 
					
						
							|  |  |  |         data-public-enable-website-firecrawl={process.env.NEXT_PUBLIC_ENABLE_WEBSITE_FIRECRAWL} | 
					
						
							|  |  |  |         data-public-enable-website-watercrawl={process.env.NEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL} | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |       > | 
					
						
							| 
									
										
										
										
											2024-09-08 12:14:11 +07:00
										 |  |  |         <BrowserInitor> | 
					
						
							| 
									
										
										
										
											2023-07-18 09:45:17 +08:00
										 |  |  |           <SentryInitor> | 
					
						
							| 
									
										
										
										
											2024-12-30 13:39:26 +08:00
										 |  |  |             <TanstackQueryIniter> | 
					
						
							| 
									
										
										
										
											2025-02-25 12:09:37 +08:00
										 |  |  |               <ThemeProvider | 
					
						
							|  |  |  |                 attribute='data-theme' | 
					
						
							| 
									
										
										
										
											2025-05-14 09:06:14 +08:00
										 |  |  |                 defaultTheme='system' | 
					
						
							| 
									
										
										
										
											2025-02-25 12:09:37 +08:00
										 |  |  |                 enableSystem | 
					
						
							|  |  |  |                 disableTransitionOnChange | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 <I18nServer> | 
					
						
							|  |  |  |                   {children} | 
					
						
							|  |  |  |                 </I18nServer> | 
					
						
							|  |  |  |               </ThemeProvider> | 
					
						
							| 
									
										
										
										
											2024-12-30 13:39:26 +08:00
										 |  |  |             </TanstackQueryIniter> | 
					
						
							| 
									
										
										
										
											2023-07-18 09:45:17 +08:00
										 |  |  |           </SentryInitor> | 
					
						
							| 
									
										
										
										
											2024-09-08 12:14:11 +07:00
										 |  |  |         </BrowserInitor> | 
					
						
							| 
									
										
										
										
											2025-04-15 17:05:50 +08:00
										 |  |  |         <RoutePrefixHandle /> | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |       </body> | 
					
						
							|  |  |  |     </html> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default LocaleLayout |