@dr.pogodin/react-utils 1.41.11 → 1.41.13

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,7 +1,7 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=Launch;require("react");var _client=require("react-dom/client");var _reactHelmetAsync=require("react-helmet-async");var _reactRouter=require("react-router");var _reactGlobalState=require("@dr.pogodin/react-global-state");var _getInj=_interopRequireDefault(require("./getInj"));var _jsxRuntime=require("react/jsx-runtime");// Initialization of client-side code.
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=Launch;require("react");var _client=require("react-dom/client");var _reactHelmet=require("@dr.pogodin/react-helmet");var _reactRouter=require("react-router");var _reactGlobalState=require("@dr.pogodin/react-global-state");var _getInj=_interopRequireDefault(require("./getInj"));var _jsxRuntime=require("react/jsx-runtime");// Initialization of client-side code.
2
2
  /* global document *//**
3
3
  * Prepares and launches the app at client side.
4
4
  * @param Application Root application component
5
5
  * @param [options={}] Optional. Additional settings.
6
- */function Launch(Application){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const container=document.getElementById("react-view");if(!container)throw Error("Failed to find container for React app");const scene=/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:(0,_getInj.default)().ISTATE||options.initialState,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouter.BrowserRouter,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactHelmetAsync.HelmetProvider,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(Application,{})})})});if(options.dontHydrate){const root=(0,_client.createRoot)(container);root.render(scene)}else(0,_client.hydrateRoot)(container,scene)}
6
+ */function Launch(Application){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const container=document.getElementById("react-view");if(!container)throw Error("Failed to find container for React app");const scene=/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:(0,_getInj.default)().ISTATE||options.initialState,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouter.BrowserRouter,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactHelmet.HelmetProvider,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(Application,{})})})});if(options.dontHydrate){const root=(0,_client.createRoot)(container);root.render(scene)}else(0,_client.hydrateRoot)(container,scene)}
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require","_client","_reactHelmetAsync","_reactRouter","_reactGlobalState","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","Error","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","HelmetProvider","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { type ComponentType } from 'react';\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { HelmetProvider } from 'react-helmet-async';\nimport { BrowserRouter } from 'react-router';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: any;\n};\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nexport default function Launch(\n Application: ComponentType,\n options: OptionsT = {},\n) {\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE || options.initialState}>\n <BrowserRouter>\n <HelmetProvider>\n <Application />\n </HelmetProvider>\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings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_client","_reactHelmet","_reactRouter","_reactGlobalState","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","Error","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","HelmetProvider","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { type ComponentType } from 'react';\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { HelmetProvider } from '@dr.pogodin/react-helmet';\nimport { BrowserRouter } from 'react-router';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: any;\n};\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nexport default function Launch(\n Application: ComponentType,\n options: OptionsT = {},\n) {\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE || options.initialState}>\n <BrowserRouter>\n <HelmetProvider>\n <Application />\n </HelmetProvider>\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings":"gLAGAA,OAAA,UACA,IAAAC,OAAA,CAAAD,OAAA,qBACA,IAAAE,YAAA,CAAAF,OAAA,6BACA,IAAAG,YAAA,CAAAH,OAAA,iBAEA,IAAAI,iBAAA,CAAAJ,OAAA,mCAEA,IAAAK,OAAA,CAAAC,sBAAA,CAAAN,OAAA,cAA8B,IAAAO,WAAA,CAAAP,OAAA,sBAV9B;AACA,qBAgBA;AACA;AACA;AACA;AACA,GACe,QAAS,CAAAQ,MAAMA,CAC5BC,WAA0B,CAE1B,IADA,CAAAC,OAAiB,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAEtB,KAAM,CAAAG,SAAS,CAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC,CACvD,GAAI,CAACF,SAAS,CAAE,KAAM,CAAAG,KAAK,CAAC,wCAAwC,CAAC,CACrE,KAAM,CAAAC,KAAK,cACT,GAAAX,WAAA,CAAAY,GAAA,EAACf,iBAAA,CAAAgB,mBAAmB,EAACC,YAAY,CAAE,GAAAC,eAAM,EAAC,CAAC,CAACC,MAAM,EAAIb,OAAO,CAACW,YAAa,CAAAG,QAAA,cACzE,GAAAjB,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAAsB,aAAa,EAAAD,QAAA,cACZ,GAAAjB,WAAA,CAAAY,GAAA,EAACjB,YAAA,CAAAwB,cAAc,EAAAF,QAAA,cACb,GAAAjB,WAAA,CAAAY,GAAA,EAACV,WAAW,GAAE,CAAC,CACD,CAAC,CACJ,CAAC,CACG,CACtB,CAED,GAAIC,OAAO,CAACiB,WAAW,CAAE,CACvB,KAAM,CAAAC,IAAI,CAAG,GAAAC,kBAAU,EAACf,SAAS,CAAC,CAClCc,IAAI,CAACE,MAAM,CAACZ,KAAK,CACnB,CAAC,IAAM,GAAAa,mBAAW,EAACjB,SAAS,CAAEI,KAAK,CACrC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ServerSsrContext=exports.SCRIPT_LOCATIONS=void 0;exports.default=factory;exports.isBrotliAcceptable=isBrotliAcceptable;exports.newDefaultLogger=newDefaultLogger;var _fs=_interopRequireDefault(require("fs"));var _path=_interopRequireDefault(require("path"));require("express");require("react");var _stream=require("stream");var _zlib=require("zlib");var _winston=_interopRequireDefault(require("winston"));var _reactGlobalState=require("@dr.pogodin/react-global-state");var _jsUtils=require("@dr.pogodin/js-utils");var _lodash=require("lodash");var _config=_interopRequireDefault(require("config"));var _nodeForge=_interopRequireDefault(require("node-forge"));var _static=require("react-dom/static");var _reactHelmetAsync=require("react-helmet-async");var _reactRouter=require("react-router");var _serializeJavascript=_interopRequireDefault(require("serialize-javascript"));var _buildInfo=require("../shared/utils/isomorphy/buildInfo");require("../shared/utils/globalState");require("webpack");var _Cache=_interopRequireDefault(require("./Cache"));var _jsxRuntime=require("react/jsx-runtime");/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ServerSsrContext=exports.SCRIPT_LOCATIONS=void 0;exports.default=factory;exports.isBrotliAcceptable=isBrotliAcceptable;exports.newDefaultLogger=newDefaultLogger;var _fs=_interopRequireDefault(require("fs"));var _path=_interopRequireDefault(require("path"));require("express");require("react");var _stream=require("stream");var _zlib=require("zlib");var _winston=_interopRequireDefault(require("winston"));var _reactGlobalState=require("@dr.pogodin/react-global-state");var _jsUtils=require("@dr.pogodin/js-utils");var _lodash=require("lodash");var _config=_interopRequireDefault(require("config"));var _nodeForge=_interopRequireDefault(require("node-forge"));var _static=require("react-dom/static");var _reactHelmet=require("@dr.pogodin/react-helmet");var _reactRouter=require("react-router");var _serializeJavascript=_interopRequireDefault(require("serialize-javascript"));var _buildInfo=require("../shared/utils/isomorphy/buildInfo");require("../shared/utils/globalState");require("webpack");var _Cache=_interopRequireDefault(require("./Cache"));var _jsxRuntime=require("react/jsx-runtime");/**
2
2
  * ExpressJS middleware for server-side rendering of a ReactJS app.
3
3
  */const sanitizedConfig=(0,_lodash.omit)(_config.default,"SECRET");// Note: These type definitions for logger are copied from Winston logger,
4
4
  // then simplified to make it easier to fit an alternative logger into this
@@ -96,7 +96,7 @@ let chunkGroups;const webpackStats=(0,_lodash.get)(res.locals,"webpack.devMiddle
96
96
  // App has been checked to exist.
97
97
  const App2=App;const renderPass=async()=>{ssrContext.chunks=[];// TODO: prerenderToNodeStream has (abort) "signal" option,
98
98
  // and we should wire it up to the SSR timeout below.
99
- const helmetContext={};const{prelude}=await(0,_static.prerenderToNodeStream)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:ssrContext.state,ssrContext:ssrContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouter.StaticRouter,{location:req.url,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactHelmetAsync.HelmetProvider,{context:helmetContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(App2,{})})})}),{onError:error=>{throw error}});({helmet}=helmetContext);return prelude};let ssrRound=0;let bailed=false;for(;ssrRound<ops.maxSsrRounds;++ssrRound){stream=await renderPass();// eslint-disable-line no-await-in-loop
99
+ const helmetContext={};const{prelude}=await(0,_static.prerenderToNodeStream)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:ssrContext.state,ssrContext:ssrContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouter.StaticRouter,{location:req.url,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactHelmet.HelmetProvider,{context:helmetContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(App2,{})})})}),{onError:error=>{throw error}});({helmet}=helmetContext);return prelude};let ssrRound=0;let bailed=false;for(;ssrRound<ops.maxSsrRounds;++ssrRound){stream=await renderPass();// eslint-disable-line no-await-in-loop
100
100
  if(!ssrContext.dirty)break;/* eslint-disable no-await-in-loop */const timeout=ops.ssrTimeout+ssrStart-Date.now();bailed=timeout<=0||!(await Promise.race([Promise.allSettled(ssrContext.pending),(0,_jsUtils.timer)(timeout).then(()=>false)]));if(bailed)break;/* eslint-enable no-await-in-loop */}let logMsg;if(ssrContext.dirty){// NOTE: In the case of incomplete SSR one more round is necessary
101
101
  // to ensure the correct hydration when some pending promises have
102
102
  // resolved and placed their data into the initial global state.
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","names":["_fs","_interopRequireDefault","require","_path","_stream","_zlib","_winston","_reactGlobalState","_jsUtils","_lodash","_config","_nodeForge","_static","_reactHelmetAsync","_reactRouter","_serializeJavascript","_buildInfo","_Cache","_jsxRuntime","sanitizedConfig","omit","config","SCRIPT_LOCATIONS","exports","ServerSsrContext","SsrContext","chunks","status","constructor","req","chunkGroups","initialState","cloneDeep","getBuildInfo","context","url","path","resolve","JSON","parse","fs","readFileSync","readChunkGroupsJson","buildDir","res","err","prepareCipher","key","Promise","reject","forge","random","getBytes","iv","cipher","createCipher","start","isBrotliAcceptable","acceptable","get","ops","split","i","length","op","type","priority","trim","parseFloat","groupExtraScripts","scripts","BODY_OPEN","DEFAULT","HEAD_OPEN","script","isString","code","location","undefined","Error","newDefaultLogger","defaultLogLevel","format","transports","winston","createLogger","level","combine","splat","timestamp","colorize","printf","message","stack","rest","Object","keys","stringify","Console","factory","webpackConfig","options","defaults","clone","beforeRender","maxSsrRounds","ssrTimeout","staticCacheSize","logger","defaultLoggerLogLevel","buildInfo","setBuildInfo","publicPath","outputPath","output","manifestLink","existsSync","cache","staticCacheController","Cache","CHUNK_GROUPS","next","set","cookie","csrfToken","cacheRef","data","buffer","noCsp","send","done","failed","brotliDecompress","error","html","h","toString","regex","RegExp","nonce","replace","configToInject","extraScripts","all","helmet","webpackStats","locals","mapValues","toJson","namedChunkGroups","item","assets","map","name","App","Application","appHtmlMarkup","ssrContext","stream","ssrStart","Date","now","App2","renderPass","helmetContext","prelude","prerenderToNodeStream","jsx","GlobalStateProvider","state","children","StaticRouter","HelmetProvider","onError","ssrRound","bailed","dirty","timeout","race","allSettled","pending","timer","then","logMsg","log","ready","pipe","Writable","destroy","write","chunk","_","payload","serializeJs","CONFIG","ISTATE","ignoreFunction","unsafe","update","util","createBuffer","finish","INJ","encode64","chunkSet","Set","forEach","asset","add","styleChunkString","scriptChunkString","endsWith","grouppedExtraScripts","faviconLink","favicon","title","meta","brotliCompress","b"],"sources":["../../../src/server/renderer.tsx"],"sourcesContent":["/**\n * ExpressJS middleware for server-side rendering of a ReactJS app.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type Request, type RequestHandler } from 'express';\nimport { type ComponentType } from 'react';\nimport { Writable } from 'stream';\nimport { brotliCompress, brotliDecompress } from 'zlib';\nimport winston from 'winston';\n\nimport { GlobalStateProvider, SsrContext } from '@dr.pogodin/react-global-state';\nimport { timer } from '@dr.pogodin/js-utils';\n\nimport {\n clone,\n cloneDeep,\n defaults,\n isString,\n get,\n mapValues,\n omit,\n} from 'lodash';\n\nimport config from 'config';\nimport forge from 'node-forge';\n\nimport { prerenderToNodeStream } from 'react-dom/static';\nimport { HelmetProvider } from 'react-helmet-async';\nimport { StaticRouter } from 'react-router';\nimport serializeJs from 'serialize-javascript';\nimport { type BuildInfoT, setBuildInfo } from 'utils/isomorphy/buildInfo';\n\nimport { type ChunkGroupsT, type SsrContextT } from 'utils/globalState';\n\nimport { type Configuration } from 'webpack';\n\nimport Cache from './Cache';\n\nconst sanitizedConfig = omit(config, 'SECRET');\n\n// Note: These type definitions for logger are copied from Winston logger,\n// then simplified to make it easier to fit an alternative logger into this\n// interface.\ninterface LogMethodI {\n (level: string, message: string, ...meta: any[]): void;\n}\ninterface LeveledLogMethodI {\n (message: string, ...meta: any[]): void;\n}\n\nexport interface LoggerI {\n debug: LeveledLogMethodI;\n error: LeveledLogMethodI;\n info: LeveledLogMethodI;\n log: LogMethodI;\n warn: LeveledLogMethodI;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum SCRIPT_LOCATIONS {\n BODY_OPEN = 'BODY_OPEN',\n DEFAULT = 'DEFAULT',\n HEAD_OPEN = 'HEAD_OPEN',\n}\n\nexport class ServerSsrContext<StateT>\n extends SsrContext<StateT>\n implements SsrContextT<StateT> {\n chunkGroups: ChunkGroupsT;\n\n chunks: string[] = [];\n\n req: Request;\n\n status: number = 200;\n\n constructor(\n req: Request,\n chunkGroups: ChunkGroupsT,\n initialState?: StateT,\n ) {\n super(cloneDeep(initialState) || ({} as StateT));\n this.chunkGroups = chunkGroups;\n this.req = req;\n }\n}\n\ntype ScriptT = {\n code: string;\n location: SCRIPT_LOCATIONS;\n};\n\n/**\n * Reads build-time information about the app. This information is generated\n * by our standard Webpack config for apps, and it is written into\n * \".build-info\" file in the context folder specified in Webpack config.\n * At the moment, that file contains build timestamp and a random 32-bit key,\n * suitable for cryptographical use.\n * @param context Webpack context path used during the build.\n * @return Resolves to the build-time information.\n */\nfunction getBuildInfo(context: string) {\n const url = path.resolve(context, '.build-info');\n return JSON.parse(fs.readFileSync(url, 'utf8'));\n}\n\n/**\n * Attempts to read from disk the named chunk groups mapping generated\n * by Webpack during the compilation.\n * It will not work for development builds, where these stats should be captured\n * via compilator callback.\n * @param buildDir\n * @return\n */\nfunction readChunkGroupsJson(buildDir: string) {\n const url = path.resolve(buildDir, '__chunk_groups__.json');\n let res;\n try {\n res = JSON.parse(fs.readFileSync(url, 'utf8'));\n } catch (err) {\n res = null;\n }\n return res;\n}\n\n/**\n * Prepares a new Cipher for data encryption.\n * @param key Encryption key (32-bit random key is expected, see\n * node-forge documentation, in case of doubts).\n * @return Resolves to the object with two fields:\n * 1. cipher - a new Cipher, ready for encryption;\n * 2. iv - initial vector used by the cipher.\n */\nfunction prepareCipher(key: string) {\n return new Promise((resolve, reject) => {\n forge.random.getBytes(32, (err, iv) => {\n if (err) reject(err);\n else {\n const cipher = forge.cipher.createCipher('AES-CBC', key);\n cipher.start({ iv });\n resolve({ cipher, iv });\n }\n });\n });\n}\n\n/**\n * Given an incoming HTTP requests, it deduces whether Brotli-encoded responses\n * are acceptable to the caller.\n * @param {object} req\n * @return {boolean}\n * @ignore\n */\nexport function isBrotliAcceptable(req: Request) {\n const acceptable = req.get('accept-encoding');\n if (acceptable) {\n const ops = acceptable.split(',');\n for (let i = 0; i < ops.length; ++i) {\n const op = ops[i];\n if (op) {\n const [type, priority] = op.trim().split(';q=');\n if ((type === '*' || type === 'br')\n && (!priority || parseFloat(priority) > 0)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Given an array of extra script strings / objects, it returns an object with\n * arrays of scripts to inject in different HTML template locations. During\n * the script groupping it also filters out any empty scripts.\n * @param {({\n * code: string;\n * location: string;\n * }|string)[]} [scripts=[]]\n * @return {{\n * BODY_OPEN: string[];\n * DEFAULT: string[];\n * HEAD_OPEN: string[];\n * }}\n */\nfunction groupExtraScripts(scripts: Array<string | ScriptT> = []) {\n const res = {\n [SCRIPT_LOCATIONS.BODY_OPEN]: '',\n [SCRIPT_LOCATIONS.DEFAULT]: '',\n [SCRIPT_LOCATIONS.HEAD_OPEN]: '',\n };\n for (let i = 0; i < scripts.length; ++i) {\n const script = scripts[i];\n if (isString(script)) {\n if (script) res[SCRIPT_LOCATIONS.DEFAULT] += script;\n } else if (script?.code) {\n if (res[script.location] !== undefined) {\n res[script.location] += script.code;\n } else throw Error(`Invalid location \"${script.location}\"`);\n }\n }\n return res;\n}\n\n/**\n * Creates a new default (Winston) logger.\n * @param {object} [options={}]\n * @param {string} [options.defaultLogLevel='info']\n * @return {object}\n */\nexport function newDefaultLogger({\n defaultLogLevel = 'info',\n} = {}) {\n const { format, transports } = winston;\n return winston.createLogger({\n level: defaultLogLevel,\n format: format.combine(\n format.splat(),\n format.timestamp(),\n format.colorize(),\n format.printf(\n ({\n level,\n message,\n timestamp,\n stack,\n ...rest\n }) => {\n let res = `${level}\\t(at ${timestamp}):\\t${message}`;\n if (Object.keys(rest).length) {\n res += `\\n${JSON.stringify(rest, null, 2)}`;\n }\n if (stack) res += `\\n${stack}`;\n return res;\n },\n ),\n ),\n transports: [new transports.Console()],\n });\n}\n\nexport type ConfigT = {\n [key: string]: ConfigT | string;\n};\n\nexport type BeforeRenderResT = {\n configToInject?: ConfigT;\n extraScripts?: Array<ScriptT | string>;\n initialState?: any;\n};\n\nexport type BeforeRenderT =\n(req: Request, config: ConfigT) => BeforeRenderResT | Promise<BeforeRenderResT>;\n\ntype CacheRefT = {\n key: string;\n maxage?: number;\n};\n\nexport type OptionsT = {\n Application?: ComponentType;\n beforeRender?: BeforeRenderT;\n buildInfo?: BuildInfoT;\n defaultLoggerLogLevel?: string;\n favicon?: string;\n logger?: LoggerI;\n maxSsrRounds?: number;\n noCsp?: boolean;\n staticCacheSize?: number;\n ssrTimeout?: number;\n staticCacheController?: (req: Request) => CacheRefT | null | undefined;\n};\n\n/**\n * Creates the middleware.\n * @param webpackConfig\n * @param options Additional options:\n * @param [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param [options.buildInfo] \"Build info\" object to use. If provided,\n * it will be used, instead of trying to load from the filesystem the one\n * generated by the Webpack build. It is intended for test environments,\n * where passing this stuff via file system is no bueno.\n * @param [options.favicon] `true` will include favicon\n * link into the rendered HTML templates.\n * @param [options.noCsp] `true` means that no\n * Content-Security-Policy (CSP) is used by server, thus the renderer\n * may cut a few corners.\n * @param [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @param [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @return Created middleware.\n */\nexport default function factory(\n webpackConfig: Configuration,\n options: OptionsT,\n): RequestHandler {\n const ops: OptionsT = defaults(clone(options), {\n beforeRender: () => Promise.resolve({}),\n maxSsrRounds: 10,\n ssrTimeout: 1000,\n staticCacheSize: 1.e7,\n });\n\n // Note: in normal use the default logger is created and set in the root\n // server function, and this initialization is for testing uses, where\n // renderer is imported directly.\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n const buildInfo = ops.buildInfo || getBuildInfo(webpackConfig.context!);\n setBuildInfo(buildInfo);\n\n // publicPath from webpack.output has a trailing slash at the end.\n const { publicPath, path: outputPath } = webpackConfig.output!;\n\n const manifestLink = fs.existsSync(`${outputPath}/manifest.json`)\n ? `<link rel=\"manifest\" href=\"${publicPath}manifest.json\">` : '';\n\n interface BufferWithNonce extends Buffer {\n nonce: string;\n }\n\n const cache = ops.staticCacheController\n ? new Cache<{\n buffer: BufferWithNonce;\n status: number;\n }>(ops.staticCacheSize!)\n : null;\n\n const CHUNK_GROUPS = readChunkGroupsJson(outputPath!);\n\n return async (req, res, next) => {\n try {\n // Ensures any caches always revalidate HTML markup before reuse.\n res.set('Cache-Control', 'no-cache');\n\n res.cookie('csrfToken', req.csrfToken());\n\n let cacheRef: CacheRefT | null | undefined;\n if (cache) {\n cacheRef = ops.staticCacheController!(req);\n if (cacheRef) {\n const data = cache.get(cacheRef);\n if (data !== null) {\n const { buffer, status } = data;\n if (ops.noCsp && isBrotliAcceptable(req)) {\n res.set('Content-Type', 'text/html');\n res.set('Content-Encoding', 'br');\n if (status !== 200) res.status(status);\n res.send(buffer);\n } else {\n await new Promise<void>((done, failed) => {\n brotliDecompress(buffer, (error, html) => {\n if (error) failed(error);\n else {\n let h = html.toString();\n if (!ops.noCsp) {\n // TODO: Starting from Node v15 we'll be able to use string's\n // .replaceAll() method instead relying on reg. expression for\n // global matching.\n const regex = new RegExp(buffer.nonce, 'g');\n h = h.replace(regex, (req as any).nonce);\n }\n if (status !== 200) res.status(status);\n res.send(h);\n done();\n }\n });\n });\n }\n return;\n }\n }\n }\n\n const [{\n configToInject,\n extraScripts,\n initialState,\n }, {\n cipher,\n iv,\n }] = await Promise.all([\n ops.beforeRender!(req, sanitizedConfig as any),\n prepareCipher(buildInfo.key) as Promise<any>,\n ]);\n\n let helmet: any;\n\n // Gets the mapping between code chunk names and their asset files.\n // These data come from the Webpack compilation, either from the stats\n // attached to the request (in dev mode), or from a file output during\n // the build (in prod mode).\n let chunkGroups: ChunkGroupsT;\n const webpackStats = get(res.locals, 'webpack.devMiddleware.stats');\n if (webpackStats) {\n chunkGroups = mapValues(\n webpackStats.toJson({\n all: false,\n chunkGroups: true,\n }).namedChunkGroups,\n (item) => item.assets.map(({ name }: { name: string }) => name),\n );\n } else if (CHUNK_GROUPS) chunkGroups = CHUNK_GROUPS;\n else chunkGroups = {};\n\n /* Optional server-side rendering. */\n const App = ops.Application;\n let appHtmlMarkup: string = '';\n const ssrContext = new ServerSsrContext(req, chunkGroups, initialState);\n let stream: NodeJS.ReadableStream;\n if (App) {\n const ssrStart = Date.now();\n\n // TODO: Somehow, without it TS does not realise that\n // App has been checked to exist.\n const App2 = App;\n\n const renderPass = async () => {\n ssrContext.chunks = [];\n\n // TODO: prerenderToNodeStream has (abort) \"signal\" option,\n // and we should wire it up to the SSR timeout below.\n const helmetContext = {};\n const { prelude } = await prerenderToNodeStream(\n <GlobalStateProvider\n initialState={ssrContext.state}\n ssrContext={ssrContext}\n >\n <StaticRouter location={req.url}>\n <HelmetProvider context={helmetContext}>\n <App2 />\n </HelmetProvider>\n </StaticRouter>\n </GlobalStateProvider>,\n { onError: (error) => { throw error; } },\n );\n ({ helmet } = helmetContext as any);\n\n return prelude;\n };\n\n let ssrRound = 0;\n let bailed = false;\n for (; ssrRound < ops.maxSsrRounds!; ++ssrRound) {\n stream = await renderPass(); // eslint-disable-line no-await-in-loop\n\n if (!ssrContext.dirty) break;\n\n /* eslint-disable no-await-in-loop */\n const timeout = ops.ssrTimeout! + ssrStart - Date.now();\n bailed = timeout <= 0 || !await Promise.race([\n Promise.allSettled(ssrContext.pending),\n timer(timeout).then(() => false),\n ]);\n if (bailed) break;\n /* eslint-enable no-await-in-loop */\n }\n\n let logMsg;\n if (ssrContext.dirty) {\n // NOTE: In the case of incomplete SSR one more round is necessary\n // to ensure the correct hydration when some pending promises have\n // resolved and placed their data into the initial global state.\n stream = await renderPass();\n\n logMsg = bailed ? `SSR timed out after ${ops.ssrTimeout} second(s)`\n : `SSR bailed out after ${ops.maxSsrRounds} round(s)`;\n } else logMsg = `SSR completed in ${ssrRound + 1} round(s)`;\n\n ops.logger!.log(ssrContext.dirty ? 'warn' : 'info', logMsg);\n\n await new Promise((ready) => {\n stream!.pipe(new Writable({\n destroy: ready,\n write: (chunk, _, done) => {\n appHtmlMarkup += chunk.toString();\n done();\n },\n }));\n });\n }\n\n /* Encrypts data to be injected into HTML.\n * Keep in mind, that this encryption is no way secure: as the JS bundle\n * contains decryption key and is able to decode it at the client side.\n * Hovewer, for a number of reasons, encryption of injected data is still\n * better than injection of a plain text. */\n const payload = serializeJs({\n CHUNK_GROUPS: chunkGroups,\n CONFIG: configToInject || sanitizedConfig,\n ISTATE: ssrContext.state,\n }, {\n ignoreFunction: true,\n unsafe: true,\n });\n cipher.update(forge.util.createBuffer(payload, 'utf8'));\n cipher.finish();\n const INJ = forge.util.encode64(`${iv}${cipher.output.data}`);\n\n const chunkSet = new Set<string>();\n\n // TODO: \"main\" chunk has to be added explicitly,\n // because unlike all other chunks they are not managed by <CodeSplit>\n // component, thus they are not added to the ssrContext.chunks\n // automatically. Actually, names of these entry chunks should be\n // read from Wepback config, as the end user may customize them,\n // remove or add other entry points, but it requires additional\n // efforts to figure out how to automatically order them right,\n // thus for now this handles the default config.\n [\n 'main',\n ...ssrContext.chunks,\n ].forEach((chunk) => {\n const assets = chunkGroups[chunk];\n if (assets) assets.forEach((asset) => chunkSet.add(asset));\n });\n\n let styleChunkString = '';\n let scriptChunkString = '';\n chunkSet.forEach((chunk) => {\n if (chunk.endsWith('.css')) {\n styleChunkString += `<link href=\"${publicPath}${chunk}\" rel=\"stylesheet\">`;\n } else if (\n chunk.endsWith('.js')\n // In dev mode HMR adds JS updates into asset arrays,\n // and they (updates) should be ignored.\n && !chunk.endsWith('.hot-update.js')\n ) {\n scriptChunkString += `<script src=\"${publicPath}${chunk}\" type=\"application/javascript\"></script>`;\n }\n });\n\n const grouppedExtraScripts = groupExtraScripts(extraScripts);\n\n const faviconLink = ops.favicon ? (\n '<link rel=\"shortcut icon\" href=\"/favicon.ico\">'\n ) : '';\n\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.HEAD_OPEN]}\n ${helmet ? helmet.title.toString() : ''}\n ${helmet ? helmet.meta.toString() : ''}\n <meta name=\"theme-color\" content=\"#FFFFFF\">\n ${manifestLink}\n ${styleChunkString}\n ${faviconLink}\n <meta charset=\"utf-8\">\n <meta\n content=\"width=device-width,initial-scale=1.0\"\n name=\"viewport\"\n >\n <meta itemprop=\"drpruinj\" content=\"${INJ}\">\n </head>\n <body>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.BODY_OPEN]}\n <div id=\"react-view\">${appHtmlMarkup}</div>\n ${scriptChunkString}\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.DEFAULT]}\n </body>\n </html>`;\n\n const status = ssrContext.status || 200;\n if (status !== 200) res.status(status);\n\n if (cacheRef && status < 500) {\n // Note: waiting for the caching to complete is not strictly necessary,\n // but it greately simplifies testing, and error reporting.\n await new Promise<void>((done, failed) => {\n brotliCompress(html, (error, buffer) => {\n const b = buffer as BufferWithNonce;\n if (error) failed(error);\n else {\n b.nonce = (req as any).nonce; // eslint-disable-line no-param-reassign\n cache!.add({ buffer: b, status }, cacheRef!.key, buffer.length);\n done();\n }\n });\n });\n }\n\n // Note: as caching code above may throw in some cases, sending response\n // before it completes will likely hide the error, making it difficult\n // to debug. Thus, at least for now, lets send response after it.\n res.send(html);\n } catch (error) {\n next(error);\n }\n };\n}\n"],"mappings":"kUAIA,IAAAA,GAAA,CAAAC,sBAAA,CAAAC,OAAA,QACA,IAAAC,KAAA,CAAAF,sBAAA,CAAAC,OAAA,UAEAA,OAAA,YACAA,OAAA,UACA,IAAAE,OAAA,CAAAF,OAAA,WACA,IAAAG,KAAA,CAAAH,OAAA,SACA,IAAAI,QAAA,CAAAL,sBAAA,CAAAC,OAAA,aAEA,IAAAK,iBAAA,CAAAL,OAAA,mCACA,IAAAM,QAAA,CAAAN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CAACE,KAAK,CAAC,CAAC,IACpB,CACHqF,CAAC,CAAC/E,KAAK,CAAI9G,GAAG,CAAS8G,KAAK,CAAE;AAC9BtB,KAAK,CAAE2F,GAAG,CAAC,CAAEjF,MAAM,CAAE2F,CAAC,CAAE/L,MAAO,CAAC,CAAEkG,QAAQ,CAAE9E,GAAG,CAAEgF,MAAM,CAAChE,MAAM,CAAC,CAC/DmE,IAAI,CAAC,CACP,CACF,CAAC,CACH,CAAC,CACH,CAEA;AACA;AACA;AACAtF,GAAG,CAACqF,IAAI,CAACK,IAAI,CACf,CAAE,MAAOD,KAAK,CAAE,CACdZ,IAAI,CAACY,KAAK,CACZ,CACF,CACF","ignoreList":[]}
1
+ {"version":3,"file":"renderer.js","names":["_fs","_interopRequireDefault","require","_path","_stream","_zlib","_winston","_reactGlobalState","_jsUtils","_lodash","_config","_nodeForge","_static","_reactHelmet","_reactRouter","_serializeJavascript","_buildInfo","_Cache","_jsxRuntime","sanitizedConfig","omit","config","SCRIPT_LOCATIONS","exports","ServerSsrContext","SsrContext","chunks","status","constructor","req","chunkGroups","initialState","cloneDeep","getBuildInfo","context","url","path","resolve","JSON","parse","fs","readFileSync","readChunkGroupsJson","buildDir","res","err","prepareCipher","key","Promise","reject","forge","random","getBytes","iv","cipher","createCipher","start","isBrotliAcceptable","acceptable","get","ops","split","i","length","op","type","priority","trim","parseFloat","groupExtraScripts","scripts","BODY_OPEN","DEFAULT","HEAD_OPEN","script","isString","code","location","undefined","Error","newDefaultLogger","defaultLogLevel","format","transports","winston","createLogger","level","combine","splat","timestamp","colorize","printf","message","stack","rest","Object","keys","stringify","Console","factory","webpackConfig","options","defaults","clone","beforeRender","maxSsrRounds","ssrTimeout","staticCacheSize","logger","defaultLoggerLogLevel","buildInfo","setBuildInfo","publicPath","outputPath","output","manifestLink","existsSync","cache","staticCacheController","Cache","CHUNK_GROUPS","next","set","cookie","csrfToken","cacheRef","data","buffer","noCsp","send","done","failed","brotliDecompress","error","html","h","toString","regex","RegExp","nonce","replace","configToInject","extraScripts","all","helmet","webpackStats","locals","mapValues","toJson","namedChunkGroups","item","assets","map","name","App","Application","appHtmlMarkup","ssrContext","stream","ssrStart","Date","now","App2","renderPass","helmetContext","prelude","prerenderToNodeStream","jsx","GlobalStateProvider","state","children","StaticRouter","HelmetProvider","onError","ssrRound","bailed","dirty","timeout","race","allSettled","pending","timer","then","logMsg","log","ready","pipe","Writable","destroy","write","chunk","_","payload","serializeJs","CONFIG","ISTATE","ignoreFunction","unsafe","update","util","createBuffer","finish","INJ","encode64","chunkSet","Set","forEach","asset","add","styleChunkString","scriptChunkString","endsWith","grouppedExtraScripts","faviconLink","favicon","title","meta","brotliCompress","b"],"sources":["../../../src/server/renderer.tsx"],"sourcesContent":["/**\n * ExpressJS middleware for server-side rendering of a ReactJS app.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type Request, type RequestHandler } from 'express';\nimport { type ComponentType } from 'react';\nimport { Writable } from 'stream';\nimport { brotliCompress, brotliDecompress } from 'zlib';\nimport winston from 'winston';\n\nimport { GlobalStateProvider, SsrContext } from '@dr.pogodin/react-global-state';\nimport { timer } from '@dr.pogodin/js-utils';\n\nimport {\n clone,\n cloneDeep,\n defaults,\n isString,\n get,\n mapValues,\n omit,\n} from 'lodash';\n\nimport config from 'config';\nimport forge from 'node-forge';\n\nimport { prerenderToNodeStream } from 'react-dom/static';\nimport { HelmetProvider } from '@dr.pogodin/react-helmet';\nimport { StaticRouter } from 'react-router';\nimport serializeJs from 'serialize-javascript';\nimport { type BuildInfoT, setBuildInfo } from 'utils/isomorphy/buildInfo';\n\nimport { type ChunkGroupsT, type SsrContextT } from 'utils/globalState';\n\nimport { type Configuration } from 'webpack';\n\nimport Cache from './Cache';\n\nconst sanitizedConfig = omit(config, 'SECRET');\n\n// Note: These type definitions for logger are copied from Winston logger,\n// then simplified to make it easier to fit an alternative logger into this\n// interface.\ninterface LogMethodI {\n (level: string, message: string, ...meta: any[]): void;\n}\ninterface LeveledLogMethodI {\n (message: string, ...meta: any[]): void;\n}\n\nexport interface LoggerI {\n debug: LeveledLogMethodI;\n error: LeveledLogMethodI;\n info: LeveledLogMethodI;\n log: LogMethodI;\n warn: LeveledLogMethodI;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum SCRIPT_LOCATIONS {\n BODY_OPEN = 'BODY_OPEN',\n DEFAULT = 'DEFAULT',\n HEAD_OPEN = 'HEAD_OPEN',\n}\n\nexport class ServerSsrContext<StateT>\n extends SsrContext<StateT>\n implements SsrContextT<StateT> {\n chunkGroups: ChunkGroupsT;\n\n chunks: string[] = [];\n\n req: Request;\n\n status: number = 200;\n\n constructor(\n req: Request,\n chunkGroups: ChunkGroupsT,\n initialState?: StateT,\n ) {\n super(cloneDeep(initialState) || ({} as StateT));\n this.chunkGroups = chunkGroups;\n this.req = req;\n }\n}\n\ntype ScriptT = {\n code: string;\n location: SCRIPT_LOCATIONS;\n};\n\n/**\n * Reads build-time information about the app. This information is generated\n * by our standard Webpack config for apps, and it is written into\n * \".build-info\" file in the context folder specified in Webpack config.\n * At the moment, that file contains build timestamp and a random 32-bit key,\n * suitable for cryptographical use.\n * @param context Webpack context path used during the build.\n * @return Resolves to the build-time information.\n */\nfunction getBuildInfo(context: string) {\n const url = path.resolve(context, '.build-info');\n return JSON.parse(fs.readFileSync(url, 'utf8'));\n}\n\n/**\n * Attempts to read from disk the named chunk groups mapping generated\n * by Webpack during the compilation.\n * It will not work for development builds, where these stats should be captured\n * via compilator callback.\n * @param buildDir\n * @return\n */\nfunction readChunkGroupsJson(buildDir: string) {\n const url = path.resolve(buildDir, '__chunk_groups__.json');\n let res;\n try {\n res = JSON.parse(fs.readFileSync(url, 'utf8'));\n } catch (err) {\n res = null;\n }\n return res;\n}\n\n/**\n * Prepares a new Cipher for data encryption.\n * @param key Encryption key (32-bit random key is expected, see\n * node-forge documentation, in case of doubts).\n * @return Resolves to the object with two fields:\n * 1. cipher - a new Cipher, ready for encryption;\n * 2. iv - initial vector used by the cipher.\n */\nfunction prepareCipher(key: string) {\n return new Promise((resolve, reject) => {\n forge.random.getBytes(32, (err, iv) => {\n if (err) reject(err);\n else {\n const cipher = forge.cipher.createCipher('AES-CBC', key);\n cipher.start({ iv });\n resolve({ cipher, iv });\n }\n });\n });\n}\n\n/**\n * Given an incoming HTTP requests, it deduces whether Brotli-encoded responses\n * are acceptable to the caller.\n * @param {object} req\n * @return {boolean}\n * @ignore\n */\nexport function isBrotliAcceptable(req: Request) {\n const acceptable = req.get('accept-encoding');\n if (acceptable) {\n const ops = acceptable.split(',');\n for (let i = 0; i < ops.length; ++i) {\n const op = ops[i];\n if (op) {\n const [type, priority] = op.trim().split(';q=');\n if ((type === '*' || type === 'br')\n && (!priority || parseFloat(priority) > 0)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Given an array of extra script strings / objects, it returns an object with\n * arrays of scripts to inject in different HTML template locations. During\n * the script groupping it also filters out any empty scripts.\n * @param {({\n * code: string;\n * location: string;\n * }|string)[]} [scripts=[]]\n * @return {{\n * BODY_OPEN: string[];\n * DEFAULT: string[];\n * HEAD_OPEN: string[];\n * }}\n */\nfunction groupExtraScripts(scripts: Array<string | ScriptT> = []) {\n const res = {\n [SCRIPT_LOCATIONS.BODY_OPEN]: '',\n [SCRIPT_LOCATIONS.DEFAULT]: '',\n [SCRIPT_LOCATIONS.HEAD_OPEN]: '',\n };\n for (let i = 0; i < scripts.length; ++i) {\n const script = scripts[i];\n if (isString(script)) {\n if (script) res[SCRIPT_LOCATIONS.DEFAULT] += script;\n } else if (script?.code) {\n if (res[script.location] !== undefined) {\n res[script.location] += script.code;\n } else throw Error(`Invalid location \"${script.location}\"`);\n }\n }\n return res;\n}\n\n/**\n * Creates a new default (Winston) logger.\n * @param {object} [options={}]\n * @param {string} [options.defaultLogLevel='info']\n * @return {object}\n */\nexport function newDefaultLogger({\n defaultLogLevel = 'info',\n} = {}) {\n const { format, transports } = winston;\n return winston.createLogger({\n level: defaultLogLevel,\n format: format.combine(\n format.splat(),\n format.timestamp(),\n format.colorize(),\n format.printf(\n ({\n level,\n message,\n timestamp,\n stack,\n ...rest\n }) => {\n let res = `${level}\\t(at ${timestamp}):\\t${message}`;\n if (Object.keys(rest).length) {\n res += `\\n${JSON.stringify(rest, null, 2)}`;\n }\n if (stack) res += `\\n${stack}`;\n return res;\n },\n ),\n ),\n transports: [new transports.Console()],\n });\n}\n\nexport type ConfigT = {\n [key: string]: ConfigT | string;\n};\n\nexport type BeforeRenderResT = {\n configToInject?: ConfigT;\n extraScripts?: Array<ScriptT | string>;\n initialState?: any;\n};\n\nexport type BeforeRenderT =\n(req: Request, config: ConfigT) => BeforeRenderResT | Promise<BeforeRenderResT>;\n\ntype CacheRefT = {\n key: string;\n maxage?: number;\n};\n\nexport type OptionsT = {\n Application?: ComponentType;\n beforeRender?: BeforeRenderT;\n buildInfo?: BuildInfoT;\n defaultLoggerLogLevel?: string;\n favicon?: string;\n logger?: LoggerI;\n maxSsrRounds?: number;\n noCsp?: boolean;\n staticCacheSize?: number;\n ssrTimeout?: number;\n staticCacheController?: (req: Request) => CacheRefT | null | undefined;\n};\n\n/**\n * Creates the middleware.\n * @param webpackConfig\n * @param options Additional options:\n * @param [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param [options.buildInfo] \"Build info\" object to use. If provided,\n * it will be used, instead of trying to load from the filesystem the one\n * generated by the Webpack build. It is intended for test environments,\n * where passing this stuff via file system is no bueno.\n * @param [options.favicon] `true` will include favicon\n * link into the rendered HTML templates.\n * @param [options.noCsp] `true` means that no\n * Content-Security-Policy (CSP) is used by server, thus the renderer\n * may cut a few corners.\n * @param [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @param [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @return Created middleware.\n */\nexport default function factory(\n webpackConfig: Configuration,\n options: OptionsT,\n): RequestHandler {\n const ops: OptionsT = defaults(clone(options), {\n beforeRender: () => Promise.resolve({}),\n maxSsrRounds: 10,\n ssrTimeout: 1000,\n staticCacheSize: 1.e7,\n });\n\n // Note: in normal use the default logger is created and set in the root\n // server function, and this initialization is for testing uses, where\n // renderer is imported directly.\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n const buildInfo = ops.buildInfo || getBuildInfo(webpackConfig.context!);\n setBuildInfo(buildInfo);\n\n // publicPath from webpack.output has a trailing slash at the end.\n const { publicPath, path: outputPath } = webpackConfig.output!;\n\n const manifestLink = fs.existsSync(`${outputPath}/manifest.json`)\n ? `<link rel=\"manifest\" href=\"${publicPath}manifest.json\">` : '';\n\n interface BufferWithNonce extends Buffer {\n nonce: string;\n }\n\n const cache = ops.staticCacheController\n ? new Cache<{\n buffer: BufferWithNonce;\n status: number;\n }>(ops.staticCacheSize!)\n : null;\n\n const CHUNK_GROUPS = readChunkGroupsJson(outputPath!);\n\n return async (req, res, next) => {\n try {\n // Ensures any caches always revalidate HTML markup before reuse.\n res.set('Cache-Control', 'no-cache');\n\n res.cookie('csrfToken', req.csrfToken());\n\n let cacheRef: CacheRefT | null | undefined;\n if (cache) {\n cacheRef = ops.staticCacheController!(req);\n if (cacheRef) {\n const data = cache.get(cacheRef);\n if (data !== null) {\n const { buffer, status } = data;\n if (ops.noCsp && isBrotliAcceptable(req)) {\n res.set('Content-Type', 'text/html');\n res.set('Content-Encoding', 'br');\n if (status !== 200) res.status(status);\n res.send(buffer);\n } else {\n await new Promise<void>((done, failed) => {\n brotliDecompress(buffer, (error, html) => {\n if (error) failed(error);\n else {\n let h = html.toString();\n if (!ops.noCsp) {\n // TODO: Starting from Node v15 we'll be able to use string's\n // .replaceAll() method instead relying on reg. expression for\n // global matching.\n const regex = new RegExp(buffer.nonce, 'g');\n h = h.replace(regex, (req as any).nonce);\n }\n if (status !== 200) res.status(status);\n res.send(h);\n done();\n }\n });\n });\n }\n return;\n }\n }\n }\n\n const [{\n configToInject,\n extraScripts,\n initialState,\n }, {\n cipher,\n iv,\n }] = await Promise.all([\n ops.beforeRender!(req, sanitizedConfig as any),\n prepareCipher(buildInfo.key) as Promise<any>,\n ]);\n\n let helmet: any;\n\n // Gets the mapping between code chunk names and their asset files.\n // These data come from the Webpack compilation, either from the stats\n // attached to the request (in dev mode), or from a file output during\n // the build (in prod mode).\n let chunkGroups: ChunkGroupsT;\n const webpackStats = get(res.locals, 'webpack.devMiddleware.stats');\n if (webpackStats) {\n chunkGroups = mapValues(\n webpackStats.toJson({\n all: false,\n chunkGroups: true,\n }).namedChunkGroups,\n (item) => item.assets.map(({ name }: { name: string }) => name),\n );\n } else if (CHUNK_GROUPS) chunkGroups = CHUNK_GROUPS;\n else chunkGroups = {};\n\n /* Optional server-side rendering. */\n const App = ops.Application;\n let appHtmlMarkup: string = '';\n const ssrContext = new ServerSsrContext(req, chunkGroups, initialState);\n let stream: NodeJS.ReadableStream;\n if (App) {\n const ssrStart = Date.now();\n\n // TODO: Somehow, without it TS does not realise that\n // App has been checked to exist.\n const App2 = App;\n\n const renderPass = async () => {\n ssrContext.chunks = [];\n\n // TODO: prerenderToNodeStream has (abort) \"signal\" option,\n // and we should wire it up to the SSR timeout below.\n const helmetContext = {};\n const { prelude } = await prerenderToNodeStream(\n <GlobalStateProvider\n initialState={ssrContext.state}\n ssrContext={ssrContext}\n >\n <StaticRouter location={req.url}>\n <HelmetProvider context={helmetContext}>\n <App2 />\n </HelmetProvider>\n </StaticRouter>\n </GlobalStateProvider>,\n { onError: (error) => { throw error; } },\n );\n ({ helmet } = helmetContext as any);\n\n return prelude;\n };\n\n let ssrRound = 0;\n let bailed = false;\n for (; ssrRound < ops.maxSsrRounds!; ++ssrRound) {\n stream = await renderPass(); // eslint-disable-line no-await-in-loop\n\n if (!ssrContext.dirty) break;\n\n /* eslint-disable no-await-in-loop */\n const timeout = ops.ssrTimeout! + ssrStart - Date.now();\n bailed = timeout <= 0 || !await Promise.race([\n Promise.allSettled(ssrContext.pending),\n timer(timeout).then(() => false),\n ]);\n if (bailed) break;\n /* eslint-enable no-await-in-loop */\n }\n\n let logMsg;\n if (ssrContext.dirty) {\n // NOTE: In the case of incomplete SSR one more round is necessary\n // to ensure the correct hydration when some pending promises have\n // resolved and placed their data into the initial global state.\n stream = await renderPass();\n\n logMsg = bailed ? `SSR timed out after ${ops.ssrTimeout} second(s)`\n : `SSR bailed out after ${ops.maxSsrRounds} round(s)`;\n } else logMsg = `SSR completed in ${ssrRound + 1} round(s)`;\n\n ops.logger!.log(ssrContext.dirty ? 'warn' : 'info', logMsg);\n\n await new Promise((ready) => {\n stream!.pipe(new Writable({\n destroy: ready,\n write: (chunk, _, done) => {\n appHtmlMarkup += chunk.toString();\n done();\n },\n }));\n });\n }\n\n /* Encrypts data to be injected into HTML.\n * Keep in mind, that this encryption is no way secure: as the JS bundle\n * contains decryption key and is able to decode it at the client side.\n * Hovewer, for a number of reasons, encryption of injected data is still\n * better than injection of a plain text. */\n const payload = serializeJs({\n CHUNK_GROUPS: chunkGroups,\n CONFIG: configToInject || sanitizedConfig,\n ISTATE: ssrContext.state,\n }, {\n ignoreFunction: true,\n unsafe: true,\n });\n cipher.update(forge.util.createBuffer(payload, 'utf8'));\n cipher.finish();\n const INJ = forge.util.encode64(`${iv}${cipher.output.data}`);\n\n const chunkSet = new Set<string>();\n\n // TODO: \"main\" chunk has to be added explicitly,\n // because unlike all other chunks they are not managed by <CodeSplit>\n // component, thus they are not added to the ssrContext.chunks\n // automatically. Actually, names of these entry chunks should be\n // read from Wepback config, as the end user may customize them,\n // remove or add other entry points, but it requires additional\n // efforts to figure out how to automatically order them right,\n // thus for now this handles the default config.\n [\n 'main',\n ...ssrContext.chunks,\n ].forEach((chunk) => {\n const assets = chunkGroups[chunk];\n if (assets) assets.forEach((asset) => chunkSet.add(asset));\n });\n\n let styleChunkString = '';\n let scriptChunkString = '';\n chunkSet.forEach((chunk) => {\n if (chunk.endsWith('.css')) {\n styleChunkString += `<link href=\"${publicPath}${chunk}\" rel=\"stylesheet\">`;\n } else if (\n chunk.endsWith('.js')\n // In dev mode HMR adds JS updates into asset arrays,\n // and they (updates) should be ignored.\n && !chunk.endsWith('.hot-update.js')\n ) {\n scriptChunkString += `<script src=\"${publicPath}${chunk}\" type=\"application/javascript\"></script>`;\n }\n });\n\n const grouppedExtraScripts = groupExtraScripts(extraScripts);\n\n const faviconLink = ops.favicon ? (\n '<link rel=\"shortcut icon\" href=\"/favicon.ico\">'\n ) : '';\n\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.HEAD_OPEN]}\n ${helmet ? helmet.title.toString() : ''}\n ${helmet ? helmet.meta.toString() : ''}\n <meta name=\"theme-color\" content=\"#FFFFFF\">\n ${manifestLink}\n ${styleChunkString}\n ${faviconLink}\n <meta charset=\"utf-8\">\n <meta\n content=\"width=device-width,initial-scale=1.0\"\n name=\"viewport\"\n >\n <meta itemprop=\"drpruinj\" content=\"${INJ}\">\n </head>\n <body>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.BODY_OPEN]}\n <div id=\"react-view\">${appHtmlMarkup}</div>\n ${scriptChunkString}\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.DEFAULT]}\n </body>\n </html>`;\n\n const status = ssrContext.status || 200;\n if (status !== 200) res.status(status);\n\n if (cacheRef && status < 500) {\n // Note: waiting for the caching to complete is not strictly necessary,\n // but it greately simplifies testing, and error reporting.\n await new Promise<void>((done, failed) => {\n brotliCompress(html, (error, buffer) => {\n const b = buffer as BufferWithNonce;\n if (error) failed(error);\n else {\n b.nonce = (req as any).nonce; // eslint-disable-line no-param-reassign\n cache!.add({ buffer: b, status }, cacheRef!.key, buffer.length);\n done();\n }\n });\n });\n }\n\n // Note: as caching code above may throw in some cases, sending response\n // before it completes will likely hide the error, making it difficult\n // to debug. Thus, at least for now, lets send response after it.\n res.send(html);\n } catch (error) {\n next(error);\n }\n };\n}\n"],"mappings":"kUAIA,IAAAA,GAAA,CAAAC,sBAAA,CAAAC,OAAA,QACA,IAAAC,KAAA,CAAAF,sBAAA,CAAAC,OAAA,UAEAA,OAAA,YACAA,OAAA,UACA,IAAAE,OAAA,CAAAF,OAAA,WACA,IAAAG,KAAA,CAAAH,OAAA,SACA,IAAAI,QAAA,CAAAL,sBAAA,CAAAC,OAAA,aAEA,IAAAK,iBAAA,CAAAL,OAAA,mCACA,IAAAM,QAAA,CAAAN,OAAA,yBAEA,IAAAO,OAAA,CAAAP,OAAA,WAUA,IAAAQ,OAAA,CAAAT,sBAAA,CAAAC,OAAA,YACA,IAAAS,UAAA,CAAAV,sBAAA,CAAAC,OAAA,gBAEA,IAAAU,OAAA,CAAAV,OAAA,qBACA,IAAAW,YAAA,CAAAX,OAAA,6BACA,IAAAY,YAAA,CAAAZ,OAAA,iBACA,IAAAa,oBAAA,CAAAd,sBAAA,CAAAC,OAAA,0BACA,IAAAc,UAAA,CAAAd,OAAA,wCAEAA,OAAA,gCAEAA,OAAA,YAEA,IAAAe,MAAA,CAAAhB,sBAAA,CAAAC,OAAA,aAA4B,IAAAgB,WAAA,CAAAhB,OAAA,sBAvC5B;AACA;AACA,GAuCA,KAAM,CAAAiB,eAAe,CAAG,GAAAC,YAAI,EAACC,eAAM,CAAE,QAAQ,CAAC,CAE9C;AACA;AACA;AAgBA;AAAA,GACY,CAAAC,gBAAgB,CAAAC,OAAA,CAAAD,gBAAA,uBAAhBA,gBAAgB,EAAhBA,gBAAgB,0BAAhBA,gBAAgB,sBAAhBA,gBAAgB,gCAAhB,CAAAA,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qF,aAAa;AAChD,cAAcsD,iBAAiB;AAC/B,cAAcE,oBAAoB,CAAC9L,gBAAgB,CAACkD,OAAO,CAAC;AAC5D;AACA,gBAAgB,CAEV,KAAM,CAAA7C,MAAM,CAAGkI,UAAU,CAAClI,MAAM,EAAI,GAAG,CACvC,GAAIA,MAAM,GAAK,GAAG,CAAEiB,GAAG,CAACjB,MAAM,CAACA,MAAM,CAAC,CAEtC,GAAIkG,QAAQ,EAAIlG,MAAM,CAAG,GAAG,CAAE,CAC5B;AACA;AACA,KAAM,IAAI,CAAAqB,OAAO,CAAO,CAACkF,IAAI,CAAEC,MAAM,GAAK,CACxC,GAAAsF,oBAAc,EAACnF,IAAI,CAAE,CAACD,KAAK,CAAEN,MAAM,GAAK,CACtC,KAAM,CAAA2F,CAAC,CAAG3F,MAAyB,CACnC,GAAIM,KAAK,CAAEF,MAAM,CAACE,KAAK,CAAC,CAAC,IACpB,CACHqF,CAAC,CAAC/E,KAAK,CAAI9G,GAAG,CAAS8G,KAAK,CAAE;AAC9BtB,KAAK,CAAE2F,GAAG,CAAC,CAAEjF,MAAM,CAAE2F,CAAC,CAAE/L,MAAO,CAAC,CAAEkG,QAAQ,CAAE9E,GAAG,CAAEgF,MAAM,CAAChE,MAAM,CAAC,CAC/DmE,IAAI,CAAC,CACP,CACF,CAAC,CACH,CAAC,CACH,CAEA;AACA;AACA;AACAtF,GAAG,CAACqF,IAAI,CAACK,IAAI,CACf,CAAE,MAAOD,KAAK,CAAE,CACdZ,IAAI,CAACY,KAAK,CACZ,CACF,CACF","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=require("react");var _reactHelmetAsync=require("react-helmet-async");var _jsxRuntime=require("react/jsx-runtime");const Context=/*#__PURE__*/(0,_react.createContext)({description:"",title:""});/**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=require("react");var _reactHelmet=require("@dr.pogodin/react-helmet");var _jsxRuntime=require("react/jsx-runtime");const Context=/*#__PURE__*/(0,_react.createContext)({description:"",title:""});/**
2
2
  * Auxiliary wrapper around "react-helmet", which helps to inject meta tags
3
3
  * (page title, a brief content description, and social media thumbnails) into
4
4
  * generated pages.
5
- */const MetaTags=({children,description,extraMetaTags,image,siteName,socialDescription,socialTitle,title,url})=>{const socTitle=socialTitle||title;const socDesc=socialDescription||description;const context=(0,_react.useMemo)(()=>({description,image,siteName,socialDescription,socialTitle,title,url}),[description,image,siteName,socialDescription,socialTitle,title,url]);const extra=[];if(extraMetaTags?.length){for(let i=0;i<extraMetaTags.length;++i){const{content,name}=extraMetaTags[i];extra.push(/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{content:content,name:name},`extra-meta-tag-${i}`))}}return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_reactHelmetAsync.Helmet,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("title",{children:title}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"description",content:description}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:title",content:socTitle}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:description",content:socDesc}),image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:image",content:image}):null,siteName?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:site",content:`@${siteName}`}):null,/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:title",content:socTitle}),image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:image",content:image}):null,image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:image:alt",content:socTitle}):null,/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:description",content:socDesc}),siteName?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:sitename",content:siteName}):null,url?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:url",content:url}):null,extra]}),children?/*#__PURE__*/(0,_jsxRuntime.jsx)(Context.Provider,{value:context,children:children}):null]})};MetaTags.Context=Context;var _default=exports.default=MetaTags;
5
+ */const MetaTags=({children,description,extraMetaTags,image,siteName,socialDescription,socialTitle,title,url})=>{const socTitle=socialTitle||title;const socDesc=socialDescription||description;const context=(0,_react.useMemo)(()=>({description,image,siteName,socialDescription,socialTitle,title,url}),[description,image,siteName,socialDescription,socialTitle,title,url]);const extra=[];if(extraMetaTags?.length){for(let i=0;i<extraMetaTags.length;++i){const{content,name}=extraMetaTags[i];extra.push(/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{content:content,name:name},`extra-meta-tag-${i}`))}}return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_reactHelmet.Helmet,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("title",{children:title}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"description",content:description}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:title",content:socTitle}),/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:description",content:socDesc}),image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:image",content:image}):null,siteName?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"twitter:site",content:`@${siteName}`}):null,/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:title",content:socTitle}),image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:image",content:image}):null,image?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:image:alt",content:socTitle}):null,/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:description",content:socDesc}),siteName?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:sitename",content:siteName}):null,url?/*#__PURE__*/(0,_jsxRuntime.jsx)("meta",{name:"og:url",content:url}):null,extra]}),children?/*#__PURE__*/(0,_jsxRuntime.jsx)(Context.Provider,{value:context,children:children}):null]})};MetaTags.Context=Context;var _default=exports.default=MetaTags;
6
6
  //# sourceMappingURL=MetaTags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MetaTags.js","names":["_react","require","_reactHelmetAsync","_jsxRuntime","Context","createContext","description","title","MetaTags","children","extraMetaTags","image","siteName","socialDescription","socialTitle","url","socTitle","socDesc","context","useMemo","extra","length","i","content","name","push","jsx","jsxs","Fragment","Helmet","Provider","value","_default","exports","default"],"sources":["../../../../src/shared/components/MetaTags.tsx"],"sourcesContent":["import {\n type Context as ContextT,\n type FunctionComponent,\n type ReactNode,\n createContext,\n useMemo,\n} from 'react';\n\nimport { Helmet } from 'react-helmet-async';\n\ntype PropsT = {\n children?: ReactNode;\n description: string;\n extraMetaTags?: Array<{\n content: string;\n name: string;\n }>;\n image?: string;\n siteName?: string;\n socialDescription?: string;\n socialTitle?: string;\n title: string;\n url?: string;\n};\n\nconst Context = createContext<PropsT>({\n description: '',\n title: '',\n});\n\n/**\n * Auxiliary wrapper around \"react-helmet\", which helps to inject meta tags\n * (page title, a brief content description, and social media thumbnails) into\n * generated pages.\n */\nconst MetaTags: FunctionComponent<PropsT> & {\n Context: ContextT<PropsT>;\n} = ({\n children,\n description,\n extraMetaTags,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n}) => {\n const socTitle = socialTitle || title;\n const socDesc = socialDescription || description;\n\n const context = useMemo(() => ({\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n }), [\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n ]);\n\n const extra: ReactNode[] = [];\n if (extraMetaTags?.length) {\n for (let i = 0; i < extraMetaTags.length; ++i) {\n const { content, name } = extraMetaTags[i]!;\n extra.push(\n <meta\n content={content}\n name={name}\n key={`extra-meta-tag-${i}`}\n />,\n );\n }\n }\n\n return (\n <>\n <Helmet>\n {/* General tags. */}\n <title>\n {title}\n </title>\n <meta name=\"description\" content={description} />\n\n {/* Twitter cards. */}\n <meta name=\"twitter:card\" content=\"summary_large_image\" />\n <meta name=\"twitter:title\" content={socTitle} />\n <meta name=\"twitter:description\" content={socDesc} />\n { image ? <meta name=\"twitter:image\" content={image} /> : null }\n {\n siteName ? (\n <meta name=\"twitter:site\" content={`@${siteName}`} />\n ) : null\n }\n\n {/* Open Graph data. */}\n <meta name=\"og:title\" content={socTitle} />\n { image ? <meta name=\"og:image\" content={image} /> : null }\n { image ? <meta name=\"og:image:alt\" content={socTitle} /> : null }\n <meta name=\"og:description\" content={socDesc} />\n {\n siteName ? (<meta name=\"og:sitename\" content={siteName} />) : null\n }\n { url ? (<meta name=\"og:url\" content={url} />) : null }\n {extra}\n </Helmet>\n {\n children ? (\n <Context.Provider value={context}>\n {children}\n </Context.Provider>\n ) : null\n }\n </>\n );\n};\n\nMetaTags.Context = Context;\n\nexport default MetaTags;\n"],"mappings":"6FAAA,IAAAA,MAAA,CAAAC,OAAA,UAQA,IAAAC,iBAAA,CAAAD,OAAA,uBAA4C,IAAAE,WAAA,CAAAF,OAAA,sBAiB5C,KAAM,CAAAG,OAAO,cAAG,GAAAC,oBAAa,EAAS,CACpCC,WAAW,CAAE,EAAE,CACfC,KAAK,CAAE,EACT,CAAC,CAAC,CAEF;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,QAEL,CAAGA,CAAC,CACHC,QAAQ,CACRH,WAAW,CACXI,aAAa,CACbC,KAAK,CACLC,QAAQ,CACRC,iBAAiB,CACjBC,WAAW,CACXP,KAAK,CACLQ,GACF,CAAC,GAAK,CACJ,KAAM,CAAAC,QAAQ,CAAGF,WAAW,EAAIP,KAAK,CACrC,KAAM,C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,CACjB,IAAI,EAEV,CAEN,CAAC,CAEDD,QAAQ,CAACJ,OAAO,CAAGA,OAAO,CAAC,IAAA4B,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEZ1B,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"MetaTags.js","names":["_react","require","_reactHelmet","_jsxRuntime","Context","createContext","description","title","MetaTags","children","extraMetaTags","image","siteName","socialDescription","socialTitle","url","socTitle","socDesc","context","useMemo","extra","length","i","content","name","push","jsx","jsxs","Fragment","Helmet","Provider","value","_default","exports","default"],"sources":["../../../../src/shared/components/MetaTags.tsx"],"sourcesContent":["import {\n type Context as ContextT,\n type FunctionComponent,\n type ReactNode,\n createContext,\n useMemo,\n} from 'react';\n\nimport { Helmet } from '@dr.pogodin/react-helmet';\n\ntype PropsT = {\n children?: ReactNode;\n description: string;\n extraMetaTags?: Array<{\n content: string;\n name: string;\n }>;\n image?: string;\n siteName?: string;\n socialDescription?: string;\n socialTitle?: string;\n title: string;\n url?: string;\n};\n\nconst Context = createContext<PropsT>({\n description: '',\n title: '',\n});\n\n/**\n * Auxiliary wrapper around \"react-helmet\", which helps to inject meta tags\n * (page title, a brief content description, and social media thumbnails) into\n * generated pages.\n */\nconst MetaTags: FunctionComponent<PropsT> & {\n Context: ContextT<PropsT>;\n} = ({\n children,\n description,\n extraMetaTags,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n}) => {\n const socTitle = socialTitle || title;\n const socDesc = socialDescription || description;\n\n const context = useMemo(() => ({\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n }), [\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url,\n ]);\n\n const extra: ReactNode[] = [];\n if (extraMetaTags?.length) {\n for (let i = 0; i < extraMetaTags.length; ++i) {\n const { content, name } = extraMetaTags[i]!;\n extra.push(\n <meta\n content={content}\n name={name}\n key={`extra-meta-tag-${i}`}\n />,\n );\n }\n }\n\n return (\n <>\n <Helmet>\n {/* General tags. */}\n <title>\n {title}\n </title>\n <meta name=\"description\" content={description} />\n\n {/* Twitter cards. */}\n <meta name=\"twitter:card\" content=\"summary_large_image\" />\n <meta name=\"twitter:title\" content={socTitle} />\n <meta name=\"twitter:description\" content={socDesc} />\n { image ? <meta name=\"twitter:image\" content={image} /> : null }\n {\n siteName ? (\n <meta name=\"twitter:site\" content={`@${siteName}`} />\n ) : null\n }\n\n {/* Open Graph data. */}\n <meta name=\"og:title\" content={socTitle} />\n { image ? <meta name=\"og:image\" content={image} /> : null }\n { image ? <meta name=\"og:image:alt\" content={socTitle} /> : null }\n <meta name=\"og:description\" content={socDesc} />\n {\n siteName ? (<meta name=\"og:sitename\" content={siteName} />) : null\n }\n { url ? (<meta name=\"og:url\" content={url} />) : null }\n {extra}\n </Helmet>\n {\n children ? (\n <Context.Provider value={context}>\n {children}\n </Context.Provider>\n ) : null\n }\n </>\n );\n};\n\nMetaTags.Context = Context;\n\nexport default MetaTags;\n"],"mappings":"6FAAA,IAAAA,MAAA,CAAAC,OAAA,UAQA,IAAAC,YAAA,CAAAD,OAAA,6BAAkD,IAAAE,WAAA,CAAAF,OAAA,sBAiBlD,KAAM,CAAAG,OAAO,cAAG,GAAAC,oBAAa,EAAS,CACpCC,WAAW,CAAE,EAAE,CACfC,KAAK,CAAE,EACT,CAAC,CAAC,CAEF;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,QAEL,CAAGA,CAAC,CACHC,QAAQ,CACRH,WAAW,CACXI,aAAa,CACbC,KAAK,CACLC,QAAQ,CACRC,iBAAiB,CACjBC,WAAW,CACXP,KAAK,CACLQ,GACF,CAAC,GAAK,CACJ,KAAM,CAAAC,QAAQ,CAAGF,WAAW,EAAIP,KAAK,CACrC,KAAM,CAAAU,OAAO,CAAGJ,iBAAiB,EAAIP,WAAW,CAEhD,KAAM,CAAAY,OAAO,CAAG,GAAAC,cAAO,EAAC,KAAO,CAC7Bb,WAAW,CACXK,KAAK,CACLC,QAAQ,CACRC,iBAAiB,C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+1,3 @@
1
1
  /*! For license information please see web.bundle.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","react-helmet-async","react-router"],t):"object"==typeof exports?exports["@dr.pogodin/react-utils"]=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.cookie,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-helmet-async"],e["react-router"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__462__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__474__,__WEBPACK_EXTERNAL_MODULE__707__){return function(){"use strict";var __webpack_modules__={668:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:function(){return getInj}});var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(814),node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(958),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__),_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(540);let inj={};const metaElement="undefined"!=typeof document?document.querySelector('meta[itemprop="drpruinj"]'):null;if(metaElement){metaElement.remove();let data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);const{key:key}=(0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.F)(),d=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher("AES-CBC",key);d.start({iv:data.slice(0,key.length)}),d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length))),d.finish(),data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data),inj=eval(`(${data})`)}else"undefined"!=typeof window&&window.REACT_UTILS_INJECTION?(inj=window.REACT_UTILS_INJECTION,delete window.REACT_UTILS_INJECTION):inj={};function getInj(){return inj}},969:function(e,t,n){n.d(t,{A:function(){return l}}),n(155);var r=n(236),o=n(474),a=n(707),i=n(126),_=n(668),s=n(922);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=document.getElementById("react-view");if(!n)throw Error("Failed to find container for React app");const l=(0,s.jsx)(i.GlobalStateProvider,{initialState:(0,_.A)().ISTATE||t.initialState,children:(0,s.jsx)(a.BrowserRouter,{children:(0,s.jsx)(o.HelmetProvider,{children:(0,s.jsx)(e,{})})})});t.dontHydrate?(0,r.createRoot)(n).render(l):(0,r.hydrateRoot)(n,l)}},540:function(e,t,n){let r;function o(){if(void 0===r)throw Error('"Build Info" has not been initialized yet');return r}n.d(t,{F:function(){return o}}),"undefined"!=typeof BUILD_INFO&&(r=BUILD_INFO)},48:function(e,t,n){n.d(t,{B:function(){return r},p:function(){return o}});const r="object"!=typeof process||!process.versions||!process.versions.node||!!n.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!r},724:function(e,t,n){n.r(t),n.d(t,{IS_CLIENT_SIDE:function(){return o.B},IS_SERVER_SIDE:function(){return o.p},buildTimestamp:function(){return _},getBuildInfo:function(){return r.F},isDevBuild:function(){return a},isProdBuild:function(){return i}});var r=n(540),o=n(48);function a(){return!1}function i(){return!0}function _(){return(0,r.F)().timestamp}},148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{requireWeak:function(){return requireWeak},resolveWeak:function(){return resolveWeak}});var _isomorphy__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(724);function requireWeak(modulePath,basePath){if(_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE)return null;try{const{resolve:resolve}=eval("require")("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=eval("require")(path);if(!("default"in module))return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach((e=>{let[t,n]=e;const r=res[t];if(void 0!==r){if(r!==n)throw Error("Conflict between default and named exports")}else res[t]=n})),res}catch{return null}}function resolveWeak(e){return e}},208:function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},922:function(e,t,n){e.exports=n(208)},864:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__864__},126:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__126__},859:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__859__},462:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__462__},185:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__185__},958:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__958__},814:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__814__},360:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__360__},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__},514:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__514__},236:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__236__},474:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__474__},707:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__707__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return js_utils_.Barrier},BaseButton:function(){return BaseButton},BaseModal:function(){return BaseModal},Button:function(){return Button},Checkbox:function(){return components_Checkbox},CustomDropdown:function(){return CustomDropdown},Dropdown:function(){return NativeDropdown},Emitter:function(){return js_utils_.Emitter},GlobalStateProvider:function(){return react_global_state_.GlobalStateProvider},Input:function(){return components_Input},Link:function(){return components_Link},MetaTags:function(){return components_MetaTags},Modal:function(){return Modal},NavLink:function(){return components_NavLink},PageLayout:function(){return components_PageLayout},Semaphore:function(){return js_utils_.Semaphore},Switch:function(){return Switch},TextArea:function(){return components_TextArea},ThemeProvider:function(){return react_themes_.ThemeProvider},Throbber:function(){return components_Throbber},WithTooltip:function(){return WithTooltip},YouTubeVideo:function(){return components_YouTubeVideo},client:function(){return client},config:function(){return utils_config},getGlobalState:function(){return react_global_state_.getGlobalState},getSsrContext:function(){return getSsrContext},isomorphy:function(){return isomorphy},newAsyncDataEnvelope:function(){return react_global_state_.newAsyncDataEnvelope},server:function(){return server},splitComponent:function(){return splitComponent},themed:function(){return themed},time:function(){return utils_time},useAsyncCollection:function(){return react_global_state_.useAsyncCollection},useAsyncData:function(){return react_global_state_.useAsyncData},useGlobalState:function(){return react_global_state_.useGlobalState},webpack:function(){return webpack},withGlobalStateType:function(){return react_global_state_.withGlobalStateType},withRetries:function(){return js_utils_.withRetries}});var global={},react_themes_=__webpack_require__(859),react_themes_default=__webpack_require__.n(react_themes_),environment_check=__webpack_require__(48),webpack=__webpack_require__(148);const config=(environment_check.B?__webpack_require__(668).A().CONFIG:(0,webpack.requireWeak)("config"))||{};if(environment_check.B&&"undefined"!=typeof document){const e=__webpack_require__(462);config.CSRF=e.parse(document.cookie).csrfToken}var utils_config=config,isomorphy=__webpack_require__(724),external_cookie_=__webpack_require__(462),external_dayjs_=__webpack_require__(185),external_dayjs_default=__webpack_require__.n(external_dayjs_),external_react_=__webpack_require__(155),js_utils_=__webpack_require__(864),react_global_state_=__webpack_require__(126);const{getSsrContext:getSsrContext}=(0,react_global_state_.withGlobalStateType)();function useCurrent(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*js_utils_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[r,o]=(0,react_global_state_.useGlobalState)(t,Date.now);return(0,external_react_.useEffect)((()=>{let t;const r=()=>{o((e=>{const t=Date.now();return Math.abs(t-e)>n?t:e})),e&&(t=setTimeout(r,n))};return r(),()=>{t&&clearTimeout(t)}}),[e,n,o]),r}function useTimezoneOffset(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=getSsrContext(!1),[r,o]=(0,react_global_state_.useGlobalState)(t,(()=>{var t;const r=e&&(null==n||null===(t=n.req)||void 0===t||null===(t=t.cookies)||void 0===t?void 0:t[e]);return r?parseInt(r,10):0}));return(0,external_react_.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=(0,external_cookie_.serialize)(e,t.toString(),{path:"/"}))}),[e,o]),r}const time={DAY_MS:js_utils_.DAY_MS,HOUR_MS:js_utils_.HOUR_MS,MIN_MS:js_utils_.MIN_MS,SEC_MS:js_utils_.SEC_MS,YEAR_MS:js_utils_.YEAR_MS,now:Date.now,timer:js_utils_.timer,useCurrent:useCurrent,useTimezoneOffset:useTimezoneOffset};var utils_time=Object.assign(external_dayjs_default(),time),jsx_runtime=__webpack_require__(922);let clientChunkGroups;isomorphy.IS_CLIENT_SIDE&&(clientChunkGroups=__webpack_require__(668).A().CHUNK_GROUPS||{});const refCounts={};function getPublicPath(){return(0,isomorphy.getBuildInfo)().publicPath}function bookStyleSheet(e,t,n){let r;const o=`${getPublicPath()}/${e}`,a=`${document.location.origin}${o}`;if(!t.has(a)){let e=document.querySelector(`link[href="${o}"]`);e||(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",o),document.head.appendChild(e)),r=new js_utils_.Barrier,e.addEventListener("load",(()=>r.resolve())),e.addEventListener("error",(()=>r.resolve()))}if(n){const e=refCounts[o]||0;refCounts[o]=1+e}return r}function getLoadedStyleSheets(){const e=new Set,{styleSheets:t}=document;for(let r=0;r<t.length;++r){var n;const o=null===(n=t[r])||void 0===n?void 0:n.href;o&&e.add(o)}return e}function assertChunkName(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function bookStyleSheets(e,t,n){const r=[],o=t[e];if(!o)return Promise.resolve();const a=getLoadedStyleSheets();for(let e=0;e<o.length;++e){const t=o[e];if(null!=t&&t.endsWith(".css")){const e=bookStyleSheet(t,a,n);e&&r.push(e)}}return r.length?Promise.allSettled(r).then():Promise.resolve()}function freeStyleSheets(e,t){const n=t[e];if(n)for(let e=0;e<n.length;++e){const t=n[e];if(null!=t&&t.endsWith(".css")){const e=`${getPublicPath()}/${t}`,n=refCounts[e];n&&(n<=1?(document.head.querySelector(`link[href="${e}"]`).remove(),delete refCounts[e]):refCounts[e]=n-1)}}}const usedChunkNames=new Set;function splitComponent(e){let{chunkName:t,getComponent:n,placeholder:r}=e;if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(t,clientChunkGroups),usedChunkNames.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);usedChunkNames.add(t);const o=(0,external_react_.lazy)((async()=>{const e=await n(),r="default"in e?e.default:e;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(t,clientChunkGroups,!1),{default:e=>{let{children:n,ref:o,...a}=e;if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:e,chunks:n}=getSsrContext();assertChunkName(t,e),n.includes(t)||n.push(t)}return(0,external_react_.useInsertionEffect)((()=>(bookStyleSheets(t,clientChunkGroups,!0),()=>freeStyleSheets(t,clientChunkGroups))),[]),(0,jsx_runtime.jsx)(r,{...a,ref:o,children:n})}}}));return e=>{let{children:t,...n}=e;return(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:r,children:(0,jsx_runtime.jsx)(o,{...n,children:t})})}}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var external_react_dom_=__webpack_require__(514),external_react_dom_default=__webpack_require__.n(external_react_dom_),base_theme={overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"},styles={scrollingDisabledByModal:"_5fRFtF"};const BaseModal=e=>{let{cancelOnScrolling:t,children:n,containerStyle:r,dontDisableScrolling:o,onCancel:a,overlayStyle:i,style:_,testId:s,testIdForOverlay:l,theme:c}=e;const u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)();(0,external_react_.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),p(e),()=>{document.body.removeChild(e)}}),[]),(0,external_react_.useEffect)((()=>(t&&a&&(window.addEventListener("scroll",a),window.addEventListener("wheel",a)),()=>{t&&a&&(window.removeEventListener("scroll",a),window.removeEventListener("wheel",a))})),[t,a]),(0,external_react_.useEffect)((()=>(o||document.body.classList.add(styles.scrollingDisabledByModal),()=>{o||document.body.classList.remove(styles.scrollingDisabledByModal)})),[o]);const h=(0,external_react_.useMemo)((()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e,t;const n=null===(e=u.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=n.length-1;e>=0;--e){var r;if(null===(r=n[e])||void 0===r||r.focus(),document.activeElement===n[e])return}null===(t=d.current)||void 0===t||t.focus()},tabIndex:0})),[]);return m?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[h,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{a&&(a(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&a&&(a(),e.stopPropagation())},ref:e=>{e&&e!==d.current&&(d.current=e,e.focus())},role:"button",style:i,tabIndex:0}),(0,jsx_runtime.jsx)("div",{"aria-modal":"true",className:c.container,"data-testid":void 0,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:u,role:"dialog",style:null!=_?_:r,children:n}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0}),h]}),m):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){var t;return isValue(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t:e.value]}function areEqual(e,t){return(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)}const Options=e=>{let{containerClass:t,containerStyle:n,filter:r,onCancel:o,onChange:a,optionClass:i,options:_,ref:s}=e;const l=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(s,(()=>({measure:()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.parentElement;if(!t)return;const n=l.current.getBoundingClientRect(),r=window.getComputedStyle(t),o=parseFloat(r.marginBottom),a=parseFloat(r.marginTop);return n.height+=o+a,n}})),[]);const c=[];for(let e=0;e<_.length;++e){const t=_[e];if(void 0!==t&&(!r||r(t))){const[e,n]=optionValueName(t);c.push((0,jsx_runtime.jsx)("div",{className:i,onClick:t=>{a(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(a(e),t.stopPropagation())},role:"button",tabIndex:0,children:n},e))}}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,style:n,dontDisableScrolling:!0,onCancel:o,theme:{ad:"",hoc:"",container:t,context:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:l,children:c})})};var CustomDropdown_Options=Options,theme={container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"};const BaseCustomDropdown=e=>{let{filter:t,label:n,onChange:r,options:o,theme:a,value:i}=e;if(!o)throw Error("Internal error");const[_,s]=(0,external_react_.useState)(!1),l=(0,external_react_.useRef)(null),c=(0,external_react_.useRef)(null),[u,d]=(0,external_react_.useState)(),[m,p]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)((()=>{if(!_)return;let e;const t=()=>{var n,r;const o=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect(),a=null===(r=c.current)||void 0===r?void 0:r.measure();if(o&&a){var i,_;const e=o.bottom+a.height<(null!==(i=null===(_=window.visualViewport)||void 0===_?void 0:_.height)&&void 0!==i?i:0),t=o.top-a.height>0,n=!e&&t;p(n);const r=n?{top:o.top-a.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};d((e=>areEqual(e,r)?e:r))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[_]);const h=e=>{const t=window.visualViewport,n=l.current.getBoundingClientRect();s(!0),d({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:n.width}),e.stopPropagation()};let f=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"‌"});for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);if(e===i){f=t;break}}}let x=a.container;_&&(x+=` ${a.active}`);let b=a.select||"";return m&&(x+=` ${a.upward}`,b+=` ${a.upward}`),(0,jsx_runtime.jsxs)("div",{className:x,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:a.dropdown,onClick:h,onKeyDown:e=>{"Enter"===e.key&&h(e)},ref:l,role:"listbox",tabIndex:0,children:[f,(0,jsx_runtime.jsx)("div",{className:a.arrow})]}),_?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:b,containerStyle:u,onCancel:()=>{s(!1)},onChange:e=>{s(!1),r&&r(e)},optionClass:a.option||"",options:o,ref:c}):null]})};var CustomDropdown=react_themes_default()(BaseCustomDropdown,"CustomDropdown",theme),NativeDropdown_theme={dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"};const Dropdown=e=>{let{filter:t,label:n,onChange:r,options:o,testId:a,theme:i,value:_}=e;if(!o)throw Error("Internal error");let s=!1;const l=[];for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);s||(s=e===_),l.push((0,jsx_runtime.jsx)("option",{className:i.option,value:e,children:t},e))}}const c=s?null:(0,jsx_runtime.jsx)("option",{disabled:!0,className:i.hiddenOption,value:_,children:_},"__reactUtilsHiddenOption");let u=i.select;return s||(u+=` ${i.invalid}`),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:i.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:u,"data-testid":void 0,onChange:r,value:_,children:[c,l]}),(0,jsx_runtime.jsx)("div",{className:i.arrow})]})]})};var NativeDropdown=react_themes_default()(Dropdown,"Dropdown",NativeDropdown_theme),Switch_theme={container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"};const BaseSwitch=e=>{let{label:t,onChange:n,options:r,theme:o,value:a}=e;if(!r||!o.option)throw Error("Internal error");const i=[];for(let e=0;e<(null==r?void 0:r.length);++e){const t=r[e];if(void 0!==t){const[e,r]=optionValueName(t);let _,s=o.option;e===a?s+=` ${o.selected}`:n&&(_=()=>n(e)),i.push(_?(0,jsx_runtime.jsx)("div",{className:s,onClick:_,onKeyDown:e=>{_&&"Enter"===e.key&&_()},role:"button",tabIndex:0,children:r},e):(0,jsx_runtime.jsx)("div",{className:s,children:r},e))}}return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[t?(0,jsx_runtime.jsx)("div",{className:o.label,children:t}):null,(0,jsx_runtime.jsx)("div",{className:o.options,children:i})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=e=>{let{children:t,className:n,disabled:r,enforceA:o,keepScrollPosition:a,onClick:i,onMouseDown:_,openNewTab:s,replace:l,routerLinkType:c,to:u,...d}=e;if(r||o||s||null!=u&&u.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(n?n+" ":"")+"zH52sA",href:u,onClick:r?e=>e.preventDefault():i,onMouseDown:r?e=>e.preventDefault():_,rel:"noopener noreferrer",target:s?"_blank":"",children:t});const m=c;return(0,jsx_runtime.jsx)(m,{className:n,discover:"none",onMouseDown:_,replace:l,to:u,onClick:e=>{i&&i(e),a||window.scroll(0,0)},...d,children:t})};var components_GenericLink=GenericLink;const Link=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.Link});var components_Link=Link,Button_style={button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"};const BaseButton=e=>{let{active:t,children:n,disabled:r,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,testId:c,theme:u,to:d}=e,m=u.button;return t&&u.active&&(m+=` ${u.active}`),r?(u.disabled&&(m+=` ${u.disabled}`),(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,children:n})):d?(0,jsx_runtime.jsx)(components_Link,{className:m,"data-testid":void 0,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,to:d,children:n}):(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,onClick:a,onKeyDown:a&&(e=>{"Enter"===e.key&&a(e)}),onMouseDown:i,onPointerDown:_,role:"button",tabIndex:0,children:n})};var Button=react_themes_default()(BaseButton,"Button",Button_style),Checkbox_theme={checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"};const Checkbox=e=>{let{checked:t,disabled:n,label:r,onChange:o,testId:a,theme:i}=e,_=i.container;n&&(_+=` ${i.disabled}`);let s=i.checkbox;return"indeterminate"===t&&(s+=` ${i.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:r}),(0,jsx_runtime.jsx)("input",{checked:void 0===t?void 0:!0===t,className:s,"data-testid":void 0,disabled:n,onChange:o,onClick:e=>e.stopPropagation(),type:"checkbox"})]})};var components_Checkbox=react_themes_default()(Checkbox,"Checkbox",Checkbox_theme),Input_theme={container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"};const Input=e=>{let{label:t,ref:n,testId:r,theme:o,...a}=e;return(0,jsx_runtime.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsx)("input",{className:o.input,"data-testid":void 0,ref:n,...a})]})};var components_Input=react_themes_default()(Input,"Input",Input_theme),PageLayout_base_theme={container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"};const PageLayout=e=>{let{children:t,leftSidePanelContent:n,rightSidePanelContent:r,theme:o}=e;return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:n}),(0,jsx_runtime.jsx)("div",{className:o.mainPanel,children:t}),(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:r})]})};var components_PageLayout=react_themes_default()(PageLayout,"PageLayout",PageLayout_base_theme),external_react_helmet_async_=__webpack_require__(474);const Context=(0,external_react_.createContext)({description:"",title:""}),MetaTags=e=>{let{children:t,description:n,extraMetaTags:r,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l}=e;const c=_||s,u=i||n,d=(0,external_react_.useMemo)((()=>({description:n,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l})),[n,o,a,i,_,s,l]),m=[];if(null!=r&&r.length)for(let e=0;e<r.length;++e){const{content:t,name:n}=r[e];m.push((0,jsx_runtime.jsx)("meta",{content:t,name:n},`extra-meta-tag-${e}`))}return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(external_react_helmet_async_.Helmet,{children:[(0,jsx_runtime.jsx)("title",{children:s}),(0,jsx_runtime.jsx)("meta",{name:"description",content:n}),(0,jsx_runtime.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,jsx_runtime.jsx)("meta",{name:"twitter:title",content:c}),(0,jsx_runtime.jsx)("meta",{name:"twitter:description",content:u}),o?(0,jsx_runtime.jsx)("meta",{name:"twitter:image",content:o}):null,a?(0,jsx_runtime.jsx)("meta",{name:"twitter:site",content:`@${a}`}):null,(0,jsx_runtime.jsx)("meta",{name:"og:title",content:c}),o?(0,jsx_runtime.jsx)("meta",{name:"og:image",content:o}):null,o?(0,jsx_runtime.jsx)("meta",{name:"og:image:alt",content:c}):null,(0,jsx_runtime.jsx)("meta",{name:"og:description",content:u}),a?(0,jsx_runtime.jsx)("meta",{name:"og:sitename",content:a}):null,l?(0,jsx_runtime.jsx)("meta",{name:"og:url",content:l}):null,m]}),t?(0,jsx_runtime.jsx)(Context.Provider,{value:d,children:t}):null]})};MetaTags.Context=Context;var components_MetaTags=MetaTags;const NavLink=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.NavLink});var components_NavLink=NavLink,Throbber_theme={container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"};const Throbber=e=>{let{theme:t}=e;return(0,jsx_runtime.jsxs)("span",{className:t.container,children:[(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle})]})};var components_Throbber=react_themes_default()(Throbber,"Throbber",Throbber_theme);let PLACEMENTS=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const ARROW_STYLE_DOWN=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),ARROW_STYLE_UP=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function createTooltipComponents(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const n=document.createElement("div");e.content&&n.setAttribute("class",e.content);const r=document.createElement("div");return e.container&&r.setAttribute("class",e.container),r.appendChild(t),r.appendChild(n),document.body.appendChild(r),{container:r,arrow:t,content:n}}function calcTooltipRects(e){return{arrow:e.arrow.getBoundingClientRect(),container:e.container.getBoundingClientRect()}}function calcViewportRect(){const{scrollX:e,scrollY:t}=window,{documentElement:{clientHeight:n,clientWidth:r}}=document;return{left:e,right:e+r,top:t,bottom:t+n}}function calcPositionAboveXY(e,t,n){const{arrow:r,container:o}=n;return{arrowX:.5*(o.width-r.width),arrowY:o.height,containerX:e-o.width/2,containerY:t-o.height-r.height/1.5,baseArrowStyle:ARROW_STYLE_DOWN}}function setComponentPositions(e,t,n,r,o){const a=calcTooltipRects(o),i=calcViewportRect(),_=calcPositionAboveXY(e,t,a);if(_.containerX<i.left+6)_.containerX=i.left+6,_.arrowX=Math.max(6,e-_.containerX-a.arrow.width/2);else{const t=i.right-6-a.container.width;_.containerX>t&&(_.containerX=t,_.arrowX=Math.min(a.container.width-6,e-_.containerX-a.arrow.width/2))}_.containerY<i.top+6&&(_.containerY+=a.container.height+2*a.arrow.height,_.arrowY-=a.container.height+a.arrow.height,_.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${_.containerX}px;top:${_.containerY}px`;o.container.setAttribute("style",s);const l=`${_.baseArrowStyle};left:${_.arrowX}px;top:${_.arrowY}px`;o.arrow.setAttribute("style",l)}const Tooltip=e=>{let{children:t,ref:n,theme:r}=e;const{current:o}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[a,i]=(0,external_react_.useState)(null),_=(e,t,n,r)=>{o.lastElement=r,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=n,a&&setComponentPositions(e,t,n,r,a)};return(0,external_react_.useImperativeHandle)(n,(()=>({pointTo:_}))),(0,external_react_.useEffect)((()=>{const e=createTooltipComponents(r);return i(e),()=>{document.body.removeChild(e.container),i(null)}}),[r]),(0,external_react_.useEffect)((()=>{a&&setComponentPositions(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,a)}),[a,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),a?(0,external_react_dom_.createPortal)(t,a.content):null};var WithTooltip_Tooltip=Tooltip,default_theme={arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"};const Wrapper=e=>{let{children:t,placement:n=PLACEMENTS.ABOVE_CURSOR,tip:r,theme:o}=e;const{current:a}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),i=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[s,l]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)((()=>{if(s&&null!==r){i.current&&i.current.pointTo(a.lastCursorX+window.scrollX,a.lastCursorY+window.scrollY,n,_.current);const e=()=>l(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[a.lastCursorX,a.lastCursorY,n,s,r]),(0,jsx_runtime.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>l(!1),onMouseMove:e=>((e,t)=>{if(s){const r=_.current.getBoundingClientRect();e<r.left||e>r.right||t<r.top||t>r.bottom?l(!1):i.current&&i.current.pointTo(e+window.scrollX,t+window.scrollY,n,_.current)}else a.lastCursorX=e,a.lastCursorY=t,a.triggeredByTouch?a.timerId||(a.timerId=setTimeout((()=>{a.triggeredByTouch=!1,a.timerId=void 0,l(!0)}),300)):l(!0)})(e.clientX,e.clientY),onClick:()=>{a.timerId&&(clearTimeout(a.timerId),a.timerId=void 0,a.triggeredByTouch=!1)},onTouchStart:()=>{a.triggeredByTouch=!0},ref:_,role:"presentation",children:[s&&null!==r?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:i,theme:o,children:r}):null,t]})},ThemedWrapper=react_themes_default()(Wrapper,"WithTooltip",default_theme),e=ThemedWrapper;e.PLACEMENTS=PLACEMENTS;var WithTooltip=e,external_qs_=__webpack_require__(360),external_qs_default=__webpack_require__.n(external_qs_),base={container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"},throbber={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const YouTubeVideo=e=>{var t;let{autoplay:n,src:r,theme:o,title:a}=e;const i=r.split("?");let _=i[0];const s=i[1],l=s?external_qs_default().parse(s):{};return _=`https://www.youtube.com/embed/${l.v||(null===(t=_)||void 0===t||null===(t=t.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1])}`,delete l.v,l.autoplay=n?"1":"0",_+=`?${external_qs_default().stringify(l)}`,(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:_,title:a})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=e=>{let{disabled:t,onBlur:n,onChange:r,onKeyDown:o,placeholder:a,theme:i,value:_}=e;const s=(0,external_react_.useRef)(null),[l,c]=(0,external_react_.useState)(),[u,d]=(0,external_react_.useState)(_||"");return void 0!==_&&u!==_&&d(_),(0,external_react_.useEffect)((()=>{const e=s.current;if(!e)return;const t=new ResizeObserver((()=>{c(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,external_react_.useEffect)((()=>{const e=s.current;e&&c(e.scrollHeight)}),[u]),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[(0,jsx_runtime.jsx)("textarea",{readOnly:!0,ref:s,className:`${i.textarea} ${i.hidden}`,value:u}),(0,jsx_runtime.jsx)("textarea",{disabled:t,onBlur:n,onChange:void 0===_?e=>{d(e.target.value)}:r,onKeyDown:o,placeholder:a,style:{height:l},className:i.textarea,value:u})]})};var components_TextArea=react_themes_default()(TextArea,"TextArea",TextArea_style),src_dirname="/";const server=webpack.requireWeak("./server",src_dirname),client=server?void 0:__webpack_require__(969).A;return __webpack_exports__}()}));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","react-router"],t):"object"==typeof exports?exports["@dr.pogodin/react-utils"]=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.cookie,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-router"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__462__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__707__){return function(){var __webpack_modules__={48:function(e,t,r){"use strict";r.d(t,{B:function(){return n},p:function(){return o}});const n="object"!=typeof process||!process.versions||!process.versions.node||!!r.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!n},126:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__126__},148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{requireWeak:function(){return requireWeak},resolveWeak:function(){return resolveWeak}});var _isomorphy__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(724);function requireWeak(modulePath,basePath){if(_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE)return null;try{const{resolve:resolve}=eval("require")("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=eval("require")(path);if(!("default"in module))return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach((e=>{let[t,r]=e;const n=res[t];if(void 0!==n){if(n!==r)throw Error("Conflict between default and named exports")}else res[t]=r})),res}catch{return null}}function resolveWeak(e){return e}},155:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__155__},169:function(e){var t="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,c,l,u;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(!i(e[c],a[c]))return!1;return!0}if(r&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(e[c]!==a[c])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((s=(l=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(t&&e instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!e.$$typeof)&&!i(e[l[c]],a[l[c]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},185:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__185__},208:function(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function o(e,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in n={},t)"key"!==i&&(n[i]=t[i]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:o,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=o,t.jsxs=o},236:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__236__},338:function(e,t,r){"use strict";r.d(t,{mg:function(){return Y},vd:function(){return U}});var n=r(155),o=r.n(n),i=r(169),a=r.n(i),s=r(705),c=r.n(s),l=r(647),u=r.n(l),d=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(d||{}),_={rel:["amphtml","canonical","alternate"]},p={type:["application/ld+json"]},f={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},h=Object.values(d),m={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},g=Object.entries(m).reduce(((e,[t,r])=>(e[r]=t,e)),{}),b="data-rh",v=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},E=e=>{let t=v(e,"title");const r=v(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,(()=>t));const n=v(e,"defaultTitle");return t||n||void 0},y=e=>v(e,"onChangeClientState")||(()=>{}),w=(e,t)=>t.filter((t=>void 0!==t[e])).map((t=>t[e])).reduce(((e,t)=>({...e,...t})),{}),T=(e,t)=>t.filter((e=>void 0!==e.base)).map((e=>e.base)).reverse().reduce(((t,r)=>{if(!t.length){const n=Object.keys(r);for(let o=0;o<n.length;o+=1){const i=n[o].toLowerCase();if(-1!==e.indexOf(i)&&r[i])return t.concat(r)}}return t}),[]),x=(e,t,r)=>{const n={};return r.filter((t=>{return!!Array.isArray(t[e])||(void 0!==t[e]&&(r=`Helmet: ${e} should be of type "Array". Instead found type "${typeof t[e]}"`,console&&"function"==typeof console.warn&&console.warn(r)),!1);var r})).map((t=>t[e])).reverse().reduce(((e,r)=>{const o={};r.filter((e=>{let r;const i=Object.keys(e);for(let n=0;n<i.length;n+=1){const o=i[n],a=o.toLowerCase();-1===t.indexOf(a)||"rel"===r&&"canonical"===e[r].toLowerCase()||"rel"===a&&"stylesheet"===e[a].toLowerCase()||(r=a),-1===t.indexOf(o)||"innerHTML"!==o&&"cssText"!==o&&"itemprop"!==o||(r=o)}if(!r||!e[r])return!1;const a=e[r].toLowerCase();return n[r]||(n[r]={}),o[r]||(o[r]={}),!n[r][a]&&(o[r][a]=!0,!0)})).reverse().forEach((t=>e.push(t)));const i=Object.keys(o);for(let e=0;e<i.length;e+=1){const t=i[e],r={...n[t],...o[t]};n[t]=r}return e}),[]).reverse()},C=(e,t)=>{if(Array.isArray(e)&&e.length)for(let r=0;r<e.length;r+=1)if(e[r][t])return!0;return!1},A=e=>Array.isArray(e)?e.join(""):e,k=(e,t)=>Array.isArray(e)?e.reduce(((e,r)=>(((e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1})(r,t)?e.priority.push(r):e.default.push(r),e)),{priority:[],default:[]}):{default:e,priority:[]},O=(e,t)=>({...e,[t]:void 0}),j=["noscript","script","style"],S=(e,t=!0)=>!1===t?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),P=e=>Object.keys(e).reduce(((t,r)=>{const n=void 0!==e[r]?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n}),""),M=(e,t={})=>Object.keys(e).reduce(((t,r)=>(t[m[r]||r]=e[r],t)),t),L=(e,t)=>t.map(((t,r)=>{const n={key:r,[b]:!0};return Object.keys(t).forEach((e=>{const r=m[e]||e;if("innerHTML"===r||"cssText"===r){const e=t.innerHTML||t.cssText;n.dangerouslySetInnerHTML={__html:e}}else n[r]=t[e]})),o().createElement(e,n)})),D=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>((e,t,r)=>{const n=M(r,{key:t,[b]:!0});return[o().createElement("title",n,t)]})(0,t.title,t.titleAttributes),toString:()=>((e,t,r,n)=>{const o=P(r),i=A(t);return o?`<${e} ${b}="true" ${o}>${S(i,n)}</${e}>`:`<${e} ${b}="true">${S(i,n)}</${e}>`})(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>M(t),toString:()=>P(t)};default:return{toComponent:()=>L(e,t),toString:()=>((e,t,r=!0)=>t.reduce(((t,n)=>{const o=n,i=Object.keys(o).filter((e=>!("innerHTML"===e||"cssText"===e))).reduce(((e,t)=>{const n=void 0===o[t]?t:`${t}="${S(o[t],r)}"`;return e?`${e} ${n}`:n}),""),a=o.innerHTML||o.cssText||"",s=-1===j.indexOf(e);return`${t}<${e} ${b}="true" ${i}${s?"/>":`>${a}</${e}>`}`}),""))(e,t,r)}}},I=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:o,noscriptTags:i,styleTags:a,title:s="",titleAttributes:c,prioritizeSeoTags:l}=e;let{linkTags:u,metaTags:d,scriptTags:h}=e,m={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:m,linkTags:u,metaTags:d,scriptTags:h}=(({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const o=k(e,f),i=k(t,_),a=k(r,p);return{priorityMethods:{toComponent:()=>[...L("meta",o.priority),...L("link",i.priority),...L("script",a.priority)],toString:()=>`${D("meta",o.priority,n)} ${D("link",i.priority,n)} ${D("script",a.priority,n)}`},metaTags:o.default,linkTags:i.default,scriptTags:a.default}})(e)),{priority:m,base:D("base",t,n),bodyAttributes:D("bodyAttributes",r,n),htmlAttributes:D("htmlAttributes",o,n),link:D("link",u,n),meta:D("meta",d,n),noscript:D("noscript",i,n),script:D("script",h,n),style:D("style",a,n),title:D("title",{title:s,titleAttributes:c},n)}},N=[],R=!("undefined"==typeof window||!window.document||!window.document.createElement),q=class{instances=[];canUseDOM=R;context;value={setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?N:this.instances,add:e=>{(this.canUseDOM?N:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?N:this.instances).indexOf(e);(this.canUseDOM?N:this.instances).splice(t,1)}}};constructor(e,t){this.context=e,this.canUseDOM=t||!1,t||(e.helmet=I({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},B=o().createContext({}),U=class e extends n.Component{static canUseDOM=R;helmetData;constructor(t){super(t),this.helmetData=new q(this.props.context||{},e.canUseDOM)}render(){return o().createElement(B.Provider,{value:this.helmetData.value},this.props.children)}},$=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${b}]`),o=[].slice.call(n),i=[];let a;return t&&t.length&&t.forEach((t=>{const r=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)r.innerHTML=t.innerHTML;else if("cssText"===e)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{const n=e,o=void 0===t[n]?"":t[n];r.setAttribute(e,o)}r.setAttribute(b,"true"),o.some(((e,t)=>(a=t,r.isEqualNode(e))))?o.splice(a,1):i.push(r)})),o.forEach((e=>e.parentNode?.removeChild(e))),i.forEach((e=>r.appendChild(e))),{oldTags:o,newTags:i}},W=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(b),o=n?n.split(","):[],i=[...o],a=Object.keys(t);for(const e of a){const n=t[e]||"";r.getAttribute(e)!==n&&r.setAttribute(e,n),-1===o.indexOf(e)&&o.push(e);const a=i.indexOf(e);-1!==a&&i.splice(a,1)}for(let e=i.length-1;e>=0;e-=1)r.removeAttribute(i[e]);o.length===i.length?r.removeAttribute(b):r.getAttribute(b)!==a.join(",")&&r.setAttribute(b,a.join(","))},K=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:o,linkTags:i,metaTags:a,noscriptTags:s,onChangeClientState:c,scriptTags:l,styleTags:u,title:d,titleAttributes:_}=e;W("body",n),W("html",o),((e,t)=>{void 0!==e&&document.title!==e&&(document.title=A(e)),W("title",t)})(d,_);const p={baseTag:$("base",r),linkTags:$("link",i),metaTags:$("meta",a),noscriptTags:$("noscript",s),scriptTags:$("script",l),styleTags:$("style",u)},f={},h={};Object.keys(p).forEach((e=>{const{newTags:t,oldTags:r}=p[e];t.length&&(f[e]=t),r.length&&(h[e]=p[e].oldTags)})),t&&t(),c(e,f,h)},X=null,H=class extends n.Component{rendered=!1;shouldComponentUpdate(e){return!u()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let r=null;const n=(o=e.get().map((e=>{const t={...e.props};return delete t.context,t})),{baseTag:T(["href"],o),bodyAttributes:w("bodyAttributes",o),defer:v(o,"defer"),encode:v(o,"encodeSpecialCharacters"),htmlAttributes:w("htmlAttributes",o),linkTags:x("link",["rel","href"],o),metaTags:x("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:x("noscript",["innerHTML"],o),onChangeClientState:y(o),scriptTags:x("script",["src","innerHTML"],o),styleTags:x("style",["cssText"],o),title:E(o),titleAttributes:w("titleAttributes",o),prioritizeSeoTags:C(o,"prioritizeSeoTags")});var o,i;U.canUseDOM?(i=n,X&&cancelAnimationFrame(X),i.defer?X=requestAnimationFrame((()=>{K(i,(()=>{X=null}))})):(K(i),X=null)):I&&(r=I(n)),t(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},Y=class extends n.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(e){return!a()(O(this.props,"helmetData"),O(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach((t=>{r={...r,[t]:e[t]}})),r}warnOnInvalidChildren(e,t){return c()(h.some((t=>e.type===t)),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${h.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((e=>"string"!=typeof e)),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return o().Children.forEach(e,(e=>{if(!e||!e.props)return;const{children:n,...o}=e.props,i=Object.keys(o).reduce(((e,t)=>(e[g[t]||t]=o[t],e)),{});let{type:a}=e;switch("symbol"==typeof a?a=a.toString():this.warnOnInvalidChildren(e,n),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(n,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(e,r,i,n);break;default:t=this.mapObjectTypeChildren(e,t,i,n)}})),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;return e&&(r=this.mapChildrenToProps(e,r)),!n||n instanceof q||(n=new q(n.context,!0),delete r.helmetData),n?o().createElement(H,{...r,context:n.value}):o().createElement(B.Consumer,null,(e=>o().createElement(H,{...r,context:e})))}}},360:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__360__},462:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__462__},514:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__514__},540:function(e,t,r){"use strict";let n;function o(){if(void 0===n)throw Error('"Build Info" has not been initialized yet');return n}r.d(t,{F:function(){return o}}),"undefined"!=typeof BUILD_INFO&&(n=BUILD_INFO)},647:function(e){e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<i.length;c++){var l=i[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=r?r.call(n,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},668:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{A:function(){return getInj}});var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(814),node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(958),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__),_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(540);let inj={};const metaElement="undefined"!=typeof document?document.querySelector('meta[itemprop="drpruinj"]'):null;if(metaElement){metaElement.remove();let data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);const{key:key}=(0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.F)(),d=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher("AES-CBC",key);d.start({iv:data.slice(0,key.length)}),d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length))),d.finish(),data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data),inj=eval(`(${data})`)}else"undefined"!=typeof window&&window.REACT_UTILS_INJECTION?(inj=window.REACT_UTILS_INJECTION,delete window.REACT_UTILS_INJECTION):inj={};function getInj(){return inj}},705:function(e){"use strict";e.exports=function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,i,a,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},707:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__707__},724:function(e,t,r){"use strict";r.r(t),r.d(t,{IS_CLIENT_SIDE:function(){return o.B},IS_SERVER_SIDE:function(){return o.p},buildTimestamp:function(){return s},getBuildInfo:function(){return n.F},isDevBuild:function(){return i},isProdBuild:function(){return a}});var n=r(540),o=r(48);function i(){return!1}function a(){return!0}function s(){return(0,n.F)().timestamp}},814:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__814__},859:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__859__},864:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__864__},922:function(e,t,r){"use strict";e.exports=r(208)},958:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__958__},969:function(e,t,r){"use strict";r.d(t,{A:function(){return l}}),r(155);var n=r(236),o=r(338),i=r(707),a=r(126),s=r(668),c=r(922);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=document.getElementById("react-view");if(!r)throw Error("Failed to find container for React app");const l=(0,c.jsx)(a.GlobalStateProvider,{initialState:(0,s.A)().ISTATE||t.initialState,children:(0,c.jsx)(i.BrowserRouter,{children:(0,c.jsx)(o.vd,{children:(0,c.jsx)(e,{})})})});t.dontHydrate?(0,n.createRoot)(r).render(l):(0,n.hydrateRoot)(r,l)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return d.Barrier},BaseButton:function(){return B},BaseModal:function(){return j},Button:function(){return U},Checkbox:function(){return $},CustomDropdown:function(){return L},Dropdown:function(){return D},Emitter:function(){return d.Emitter},GlobalStateProvider:function(){return _.GlobalStateProvider},Input:function(){return W},Link:function(){return q},MetaTags:function(){return F},Modal:function(){return S},NavLink:function(){return z},PageLayout:function(){return K},Semaphore:function(){return d.Semaphore},Switch:function(){return I},TextArea:function(){return ce},ThemeProvider:function(){return e.ThemeProvider},Throbber:function(){return G},WithTooltip:function(){return ne},YouTubeVideo:function(){return se},client:function(){return ue},config:function(){return i},getGlobalState:function(){return _.getGlobalState},getSsrContext:function(){return p},isomorphy:function(){return a},newAsyncDataEnvelope:function(){return _.newAsyncDataEnvelope},server:function(){return le},splitComponent:function(){return x},themed:function(){return C},time:function(){return h},useAsyncCollection:function(){return _.useAsyncCollection},useAsyncData:function(){return _.useAsyncData},useGlobalState:function(){return _.useGlobalState},webpack:function(){return n},withGlobalStateType:function(){return _.withGlobalStateType},withRetries:function(){return d.withRetries}});var e=__webpack_require__(859),t=__webpack_require__.n(e),r=__webpack_require__(48),n=__webpack_require__(148);const o=(r.B?__webpack_require__(668).A().CONFIG:(0,n.requireWeak)("config"))||{};if(r.B&&"undefined"!=typeof document){const e=__webpack_require__(462);o.CSRF=e.parse(document.cookie).csrfToken}var i=o,a=__webpack_require__(724),s=__webpack_require__(462),c=__webpack_require__(185),l=__webpack_require__.n(c),u=__webpack_require__(155),d=__webpack_require__(864),_=__webpack_require__(126);const{getSsrContext:p}=(0,_.withGlobalStateType)(),f={DAY_MS:d.DAY_MS,HOUR_MS:d.HOUR_MS,MIN_MS:d.MIN_MS,SEC_MS:d.SEC_MS,YEAR_MS:d.YEAR_MS,now:Date.now,timer:d.timer,useCurrent:function(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:r=5*d.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[n,o]=(0,_.useGlobalState)(t,Date.now);return(0,u.useEffect)((()=>{let t;const n=()=>{o((e=>{const t=Date.now();return Math.abs(t-e)>r?t:e})),e&&(t=setTimeout(n,r))};return n(),()=>{t&&clearTimeout(t)}}),[e,r,o]),n},useTimezoneOffset:function(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=p(!1),[n,o]=(0,_.useGlobalState)(t,(()=>{var t;const n=e&&(null==r||null===(t=r.req)||void 0===t||null===(t=t.cookies)||void 0===t?void 0:t[e]);return n?parseInt(n,10):0}));return(0,u.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=(0,s.serialize)(e,t.toString(),{path:"/"}))}),[e,o]),n}};var h=Object.assign(l(),f),m=__webpack_require__(922);let g;a.IS_CLIENT_SIDE&&(g=__webpack_require__(668).A().CHUNK_GROUPS||{});const b={};function v(){return(0,a.getBuildInfo)().publicPath}function E(e,t,r){let n;const o=`${v()}/${e}`,i=`${document.location.origin}${o}`;if(!t.has(i)){let e=document.querySelector(`link[href="${o}"]`);e||(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",o),document.head.appendChild(e)),n=new d.Barrier,e.addEventListener("load",(()=>n.resolve())),e.addEventListener("error",(()=>n.resolve()))}if(r){const e=b[o]||0;b[o]=1+e}return n}function y(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function w(e,t,r){const n=[],o=t[e];if(!o)return Promise.resolve();const i=function(){const e=new Set,{styleSheets:t}=document;for(let n=0;n<t.length;++n){var r;const o=null===(r=t[n])||void 0===r?void 0:r.href;o&&e.add(o)}return e}();for(let e=0;e<o.length;++e){const t=o[e];if(null!=t&&t.endsWith(".css")){const e=E(t,i,r);e&&n.push(e)}}return n.length?Promise.allSettled(n).then():Promise.resolve()}const T=new Set;function x(e){let{chunkName:t,getComponent:r,placeholder:n}=e;if(a.IS_CLIENT_SIDE&&y(t,g),T.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);T.add(t);const o=(0,u.lazy)((async()=>{const e=await r(),n="default"in e?e.default:e;return a.IS_CLIENT_SIDE&&await w(t,g,!1),{default:e=>{let{children:r,ref:o,...i}=e;if(a.IS_SERVER_SIDE){const{chunkGroups:e,chunks:r}=p();y(t,e),r.includes(t)||r.push(t)}return(0,u.useInsertionEffect)((()=>(w(t,g,!0),()=>function(e,t){const r=t[e];if(r)for(let e=0;e<r.length;++e){const t=r[e];if(null!=t&&t.endsWith(".css")){const e=`${v()}/${t}`,r=b[e];r&&(r<=1?(document.head.querySelector(`link[href="${e}"]`).remove(),delete b[e]):b[e]=r-1)}}}(t,g))),[]),(0,m.jsx)(n,{...i,ref:o,children:r})}}}));return e=>{let{children:t,...r}=e;return(0,m.jsx)(u.Suspense,{fallback:n,children:(0,m.jsx)(o,{...r,children:t})})}}const C=t();C.COMPOSE=e.COMPOSE,C.PRIORITY=e.PRIORITY;var A=__webpack_require__(514),k=__webpack_require__.n(A),O="_5fRFtF";const j=e=>{let{cancelOnScrolling:t,children:r,containerStyle:n,dontDisableScrolling:o,onCancel:i,overlayStyle:a,style:s,testId:c,testIdForOverlay:l,theme:d}=e;const _=(0,u.useRef)(null),p=(0,u.useRef)(null),[f,h]=(0,u.useState)();(0,u.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),h(e),()=>{document.body.removeChild(e)}}),[]),(0,u.useEffect)((()=>(t&&i&&(window.addEventListener("scroll",i),window.addEventListener("wheel",i)),()=>{t&&i&&(window.removeEventListener("scroll",i),window.removeEventListener("wheel",i))})),[t,i]),(0,u.useEffect)((()=>(o||document.body.classList.add(O),()=>{o||document.body.classList.remove(O)})),[o]);const g=(0,u.useMemo)((()=>(0,m.jsx)("div",{onFocus:()=>{var e,t;const r=null===(e=_.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=r.length-1;e>=0;--e){var n;if(null===(n=r[e])||void 0===n||n.focus(),document.activeElement===r[e])return}null===(t=p.current)||void 0===t||t.focus()},tabIndex:0})),[]);return f?k().createPortal((0,m.jsxs)(m.Fragment,{children:[g,(0,m.jsx)("div",{"aria-label":"Cancel",className:d.overlay,"data-testid":void 0,onClick:e=>{i&&(i(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&i&&(i(),e.stopPropagation())},ref:e=>{e&&e!==p.current&&(p.current=e,e.focus())},role:"button",style:a,tabIndex:0}),(0,m.jsx)("div",{"aria-modal":"true",className:d.container,"data-testid":void 0,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:_,role:"dialog",style:null!=s?s:n,children:r}),(0,m.jsx)("div",{onFocus:()=>{var e;null===(e=p.current)||void 0===e||e.focus()},tabIndex:0}),g]}),f):null};var S=t()(j,"Modal",{overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"});function P(e){var t;return function(e){const t=typeof e;return"number"===t||"string"===t}(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t:e.value]}var M=e=>{let{containerClass:t,containerStyle:r,filter:n,onCancel:o,onChange:i,optionClass:a,options:s,ref:c}=e;const l=(0,u.useRef)(null);(0,u.useImperativeHandle)(c,(()=>({measure:()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.parentElement;if(!t)return;const r=l.current.getBoundingClientRect(),n=window.getComputedStyle(t),o=parseFloat(n.marginBottom),i=parseFloat(n.marginTop);return r.height+=o+i,r}})),[]);const d=[];for(let e=0;e<s.length;++e){const t=s[e];if(void 0!==t&&(!n||n(t))){const[e,r]=P(t);d.push((0,m.jsx)("div",{className:a,onClick:t=>{i(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(i(e),t.stopPropagation())},role:"button",tabIndex:0,children:r},e))}}return(0,m.jsx)(j,{cancelOnScrolling:!0,style:r,dontDisableScrolling:!0,onCancel:o,theme:{ad:"",hoc:"",container:t,context:"",overlay:"jKsMKG"},children:(0,m.jsx)("div",{ref:l,children:d})})},L=t()((e=>{let{filter:t,label:r,onChange:n,options:o,theme:i,value:a}=e;if(!o)throw Error("Internal error");const[s,c]=(0,u.useState)(!1),l=(0,u.useRef)(null),d=(0,u.useRef)(null),[_,p]=(0,u.useState)(),[f,h]=(0,u.useState)(!1);(0,u.useEffect)((()=>{if(!s)return;let e;const t=()=>{var r,n;const o=null===(r=l.current)||void 0===r?void 0:r.getBoundingClientRect(),i=null===(n=d.current)||void 0===n?void 0:n.measure();if(o&&i){var a,s;const e=o.bottom+i.height<(null!==(a=null===(s=window.visualViewport)||void 0===s?void 0:s.height)&&void 0!==a?a:0),t=o.top-i.height>0,r=!e&&t;h(r);const n=r?{top:o.top-i.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};p((e=>{return r=n,(null==(t=e)?void 0:t.left)===(null==r?void 0:r.left)&&(null==t?void 0:t.top)===(null==r?void 0:r.top)&&(null==t?void 0:t.width)===(null==r?void 0:r.width)?e:n;var t,r}))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[s]);const g=e=>{const t=window.visualViewport,r=l.current.getBoundingClientRect();c(!0),p({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:r.width}),e.stopPropagation()};let b=(0,m.jsx)(m.Fragment,{children:"‌"});for(let e=0;e<o.length;++e){const r=o[e];if(void 0!==r&&(!t||t(r))){const[e,t]=P(r);if(e===a){b=t;break}}}let v=i.container;s&&(v+=` ${i.active}`);let E=i.select||"";return f&&(v+=` ${i.upward}`,E+=` ${i.upward}`),(0,m.jsxs)("div",{className:v,children:[void 0===r?null:(0,m.jsx)("div",{className:i.label,children:r}),(0,m.jsxs)("div",{className:i.dropdown,onClick:g,onKeyDown:e=>{"Enter"===e.key&&g(e)},ref:l,role:"listbox",tabIndex:0,children:[b,(0,m.jsx)("div",{className:i.arrow})]}),s?(0,m.jsx)(M,{containerClass:E,containerStyle:_,onCancel:()=>{c(!1)},onChange:e=>{c(!1),n&&n(e)},optionClass:i.option||"",options:o,ref:d}):null]})}),"CustomDropdown",{container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"}),D=t()((e=>{let{filter:t,label:r,onChange:n,options:o,testId:i,theme:a,value:s}=e;if(!o)throw Error("Internal error");let c=!1;const l=[];for(let e=0;e<o.length;++e){const r=o[e];if(void 0!==r&&(!t||t(r))){const[e,t]=P(r);c||(c=e===s),l.push((0,m.jsx)("option",{className:a.option,value:e,children:t},e))}}const u=c?null:(0,m.jsx)("option",{disabled:!0,className:a.hiddenOption,value:s,children:s},"__reactUtilsHiddenOption");let d=a.select;return c||(d+=` ${a.invalid}`),(0,m.jsxs)("div",{className:a.container,children:[void 0===r?null:(0,m.jsx)("div",{className:a.label,children:r}),(0,m.jsxs)("div",{className:a.dropdown,children:[(0,m.jsxs)("select",{className:d,"data-testid":void 0,onChange:n,value:s,children:[u,l]}),(0,m.jsx)("div",{className:a.arrow})]})]})}),"Dropdown",{dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"}),I=t()((e=>{let{label:t,onChange:r,options:n,theme:o,value:i}=e;if(!n||!o.option)throw Error("Internal error");const a=[];for(let e=0;e<(null==n?void 0:n.length);++e){const t=n[e];if(void 0!==t){const[e,n]=P(t);let s,c=o.option;e===i?c+=` ${o.selected}`:r&&(s=()=>r(e)),a.push(s?(0,m.jsx)("div",{className:c,onClick:s,onKeyDown:e=>{s&&"Enter"===e.key&&s()},role:"button",tabIndex:0,children:n},e):(0,m.jsx)("div",{className:c,children:n},e))}}return(0,m.jsxs)("div",{className:o.container,children:[t?(0,m.jsx)("div",{className:o.label,children:t}):null,(0,m.jsx)("div",{className:o.options,children:a})]})}),"Switch",{container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"}),N=__webpack_require__(707),R=e=>{let{children:t,className:r,disabled:n,enforceA:o,keepScrollPosition:i,onClick:a,onMouseDown:s,openNewTab:c,replace:l,routerLinkType:u,to:d,..._}=e;if(n||o||c||null!=d&&d.match(/^(#|(https?|mailto):)/))return(0,m.jsx)("a",{className:(r?r+" ":"")+"zH52sA",href:d,onClick:n?e=>e.preventDefault():a,onMouseDown:n?e=>e.preventDefault():s,rel:"noopener noreferrer",target:c?"_blank":"",children:t});const p=u;return(0,m.jsx)(p,{className:r,discover:"none",onMouseDown:s,replace:l,to:d,onClick:e=>{a&&a(e),i||window.scroll(0,0)},..._,children:t})},q=e=>(0,m.jsx)(R,{...e,routerLinkType:N.Link});const B=e=>{let{active:t,children:r,disabled:n,enforceA:o,onClick:i,onMouseDown:a,onPointerDown:s,openNewTab:c,replace:l,testId:u,theme:d,to:_}=e,p=d.button;return t&&d.active&&(p+=` ${d.active}`),n?(d.disabled&&(p+=` ${d.disabled}`),(0,m.jsx)("div",{className:p,"data-testid":void 0,children:r})):_?(0,m.jsx)(q,{className:p,"data-testid":void 0,enforceA:o,onClick:i,onMouseDown:a,onPointerDown:s,openNewTab:c,replace:l,to:_,children:r}):(0,m.jsx)("div",{className:p,"data-testid":void 0,onClick:i,onKeyDown:i&&(e=>{"Enter"===e.key&&i(e)}),onMouseDown:a,onPointerDown:s,role:"button",tabIndex:0,children:r})};var U=t()(B,"Button",{button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"}),$=t()((e=>{let{checked:t,disabled:r,label:n,onChange:o,testId:i,theme:a}=e,s=a.container;r&&(s+=` ${a.disabled}`);let c=a.checkbox;return"indeterminate"===t&&(c+=` ${a.indeterminate}`),(0,m.jsxs)("div",{className:s,children:[void 0===n?null:(0,m.jsx)("div",{className:a.label,children:n}),(0,m.jsx)("input",{checked:void 0===t?void 0:!0===t,className:c,"data-testid":void 0,disabled:r,onChange:o,onClick:e=>e.stopPropagation(),type:"checkbox"})]})}),"Checkbox",{checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"}),W=t()((e=>{let{label:t,ref:r,testId:n,theme:o,...i}=e;return(0,m.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,m.jsx)("div",{className:o.label,children:t}),(0,m.jsx)("input",{className:o.input,"data-testid":void 0,ref:r,...i})]})}),"Input",{container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"}),K=t()((e=>{let{children:t,leftSidePanelContent:r,rightSidePanelContent:n,theme:o}=e;return(0,m.jsxs)("div",{className:o.container,children:[(0,m.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:r}),(0,m.jsx)("div",{className:o.mainPanel,children:t}),(0,m.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:n})]})}),"PageLayout",{container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"}),X=__webpack_require__(338);const H=(0,u.createContext)({description:"",title:""}),Y=e=>{let{children:t,description:r,extraMetaTags:n,image:o,siteName:i,socialDescription:a,socialTitle:s,title:c,url:l}=e;const d=s||c,_=a||r,p=(0,u.useMemo)((()=>({description:r,image:o,siteName:i,socialDescription:a,socialTitle:s,title:c,url:l})),[r,o,i,a,s,c,l]),f=[];if(null!=n&&n.length)for(let e=0;e<n.length;++e){const{content:t,name:r}=n[e];f.push((0,m.jsx)("meta",{content:t,name:r},`extra-meta-tag-${e}`))}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(X.mg,{children:[(0,m.jsx)("title",{children:c}),(0,m.jsx)("meta",{name:"description",content:r}),(0,m.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,m.jsx)("meta",{name:"twitter:title",content:d}),(0,m.jsx)("meta",{name:"twitter:description",content:_}),o?(0,m.jsx)("meta",{name:"twitter:image",content:o}):null,i?(0,m.jsx)("meta",{name:"twitter:site",content:`@${i}`}):null,(0,m.jsx)("meta",{name:"og:title",content:d}),o?(0,m.jsx)("meta",{name:"og:image",content:o}):null,o?(0,m.jsx)("meta",{name:"og:image:alt",content:d}):null,(0,m.jsx)("meta",{name:"og:description",content:_}),i?(0,m.jsx)("meta",{name:"og:sitename",content:i}):null,l?(0,m.jsx)("meta",{name:"og:url",content:l}):null,f]}),t?(0,m.jsx)(H.Provider,{value:p,children:t}):null]})};Y.Context=H;var F=Y,z=e=>(0,m.jsx)(R,{...e,routerLinkType:N.NavLink}),G=t()((e=>{let{theme:t}=e;return(0,m.jsxs)("span",{className:t.container,children:[(0,m.jsx)("span",{className:t.circle}),(0,m.jsx)("span",{className:t.circle}),(0,m.jsx)("span",{className:t.circle})]})}),"Throbber",{container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"});let V=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const Z=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),Q=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function J(e,t,r,n,o){const i=function(e){return{arrow:e.arrow.getBoundingClientRect(),container:e.container.getBoundingClientRect()}}(o),a=function(){const{scrollX:e,scrollY:t}=window,{documentElement:{clientHeight:r,clientWidth:n}}=document;return{left:e,right:e+n,top:t,bottom:t+r}}(),s=function(e,t,r){const{arrow:n,container:o}=r;return{arrowX:.5*(o.width-n.width),arrowY:o.height,containerX:e-o.width/2,containerY:t-o.height-n.height/1.5,baseArrowStyle:Z}}(e,t,i);if(s.containerX<a.left+6)s.containerX=a.left+6,s.arrowX=Math.max(6,e-s.containerX-i.arrow.width/2);else{const t=a.right-6-i.container.width;s.containerX>t&&(s.containerX=t,s.arrowX=Math.min(i.container.width-6,e-s.containerX-i.arrow.width/2))}s.containerY<a.top+6&&(s.containerY+=i.container.height+2*i.arrow.height,s.arrowY-=i.container.height+i.arrow.height,s.baseArrowStyle=Q);const c=`left:${s.containerX}px;top:${s.containerY}px`;o.container.setAttribute("style",c);const l=`${s.baseArrowStyle};left:${s.arrowX}px;top:${s.arrowY}px`;o.arrow.setAttribute("style",l)}var ee=e=>{let{children:t,ref:r,theme:n}=e;const{current:o}=(0,u.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[i,a]=(0,u.useState)(null),s=(e,t,r,n)=>{o.lastElement=n,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=r,i&&J(e,t,0,0,i)};return(0,u.useImperativeHandle)(r,(()=>({pointTo:s}))),(0,u.useEffect)((()=>{const e=function(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const r=document.createElement("div");e.content&&r.setAttribute("class",e.content);const n=document.createElement("div");return e.container&&n.setAttribute("class",e.container),n.appendChild(t),n.appendChild(r),document.body.appendChild(n),{container:n,arrow:t,content:r}}(n);return a(e),()=>{document.body.removeChild(e.container),a(null)}}),[n]),(0,u.useEffect)((()=>{i&&J(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,i)}),[i,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),i?(0,A.createPortal)(t,i.content):null};const te=t()((e=>{let{children:t,placement:r=V.ABOVE_CURSOR,tip:n,theme:o}=e;const{current:i}=(0,u.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),a=(0,u.useRef)(null),s=(0,u.useRef)(null),[c,l]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{if(c&&null!==n){a.current&&a.current.pointTo(i.lastCursorX+window.scrollX,i.lastCursorY+window.scrollY,r,s.current);const e=()=>l(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[i.lastCursorX,i.lastCursorY,r,c,n]),(0,m.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>l(!1),onMouseMove:e=>((e,t)=>{if(c){const n=s.current.getBoundingClientRect();e<n.left||e>n.right||t<n.top||t>n.bottom?l(!1):a.current&&a.current.pointTo(e+window.scrollX,t+window.scrollY,r,s.current)}else i.lastCursorX=e,i.lastCursorY=t,i.triggeredByTouch?i.timerId||(i.timerId=setTimeout((()=>{i.triggeredByTouch=!1,i.timerId=void 0,l(!0)}),300)):l(!0)})(e.clientX,e.clientY),onClick:()=>{i.timerId&&(clearTimeout(i.timerId),i.timerId=void 0,i.triggeredByTouch=!1)},onTouchStart:()=>{i.triggeredByTouch=!0},ref:s,role:"presentation",children:[c&&null!==n?(0,m.jsx)(ee,{ref:a,theme:o,children:n}):null,t]})}),"WithTooltip",{arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"}),re=te;re.PLACEMENTS=V;var ne=re,oe=__webpack_require__(360),ie=__webpack_require__.n(oe),ae={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"},se=t()((e=>{var t;let{autoplay:r,src:n,theme:o,title:i}=e;const a=n.split("?");let s=a[0];const c=a[1],l=c?ie().parse(c):{};return s=`https://www.youtube.com/embed/${l.v||(null===(t=s)||void 0===t||null===(t=t.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1])}`,delete l.v,l.autoplay=r?"1":"0",s+=`?${ie().stringify(l)}`,(0,m.jsxs)("div",{className:o.container,children:[(0,m.jsx)(G,{theme:ae}),(0,m.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:s,title:i})]})}),"YouTubeVideo",{container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"}),ce=t()((e=>{let{disabled:t,onBlur:r,onChange:n,onKeyDown:o,placeholder:i,theme:a,value:s}=e;const c=(0,u.useRef)(null),[l,d]=(0,u.useState)(),[_,p]=(0,u.useState)(s||"");return void 0!==s&&_!==s&&p(s),(0,u.useEffect)((()=>{const e=c.current;if(!e)return;const t=new ResizeObserver((()=>{d(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,u.useEffect)((()=>{const e=c.current;e&&d(e.scrollHeight)}),[_]),(0,m.jsxs)("div",{className:a.container,children:[(0,m.jsx)("textarea",{readOnly:!0,ref:c,className:`${a.textarea} ${a.hidden}`,value:_}),(0,m.jsx)("textarea",{disabled:t,onBlur:r,onChange:void 0===s?e=>{p(e.target.value)}:n,onKeyDown:o,placeholder:i,style:{height:l},className:a.textarea,value:_})]})}),"TextArea",{container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"});const le=n.requireWeak("./server","/"),ue=le?void 0:__webpack_require__(969).A}(),__webpack_exports__}()}));
3
3
  //# sourceMappingURL=web.bundle.js.map