@dr.pogodin/react-utils 1.35.3 → 1.35.5
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.
- package/bin/build.js +7 -6
- package/build/development/client/getInj.js +3 -10
- package/build/development/client/getInj.js.map +1 -1
- package/build/development/client/index.js +2 -9
- package/build/development/client/index.js.map +1 -1
- package/build/development/index.js +1 -9
- package/build/development/index.js.map +1 -1
- package/build/development/shared/components/selectors/common.js.map +1 -1
- package/build/development/shared/utils/globalState.js.map +1 -1
- package/build/development/shared/utils/splitComponent.js +10 -16
- package/build/development/shared/utils/splitComponent.js.map +1 -1
- package/build/development/web.bundle.js +4 -4
- package/build/production/client/getInj.js +3 -7
- package/build/production/client/getInj.js.map +1 -1
- package/build/production/client/index.js +1 -1
- package/build/production/client/index.js.map +1 -1
- package/build/production/index.js +1 -4
- package/build/production/index.js.map +1 -1
- package/build/production/shared/components/selectors/common.js.map +1 -1
- package/build/production/shared/utils/globalState.js.map +1 -1
- package/build/production/shared/utils/splitComponent.js +7 -9
- package/build/production/shared/utils/splitComponent.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/client/getInj.d.ts +0 -6
- package/build/types-code/client/index.d.ts +1 -2
- package/build/types-code/index.d.ts +1 -1
- package/build/types-code/shared/components/selectors/common.d.ts +1 -1
- package/build/types-code/shared/utils/globalState.d.ts +5 -0
- package/package.json +15 -15
- package/src/client/getInj.ts +3 -9
- package/src/client/index.tsx +1 -3
- package/src/index.ts +1 -9
- package/src/shared/components/selectors/common.ts +1 -1
- package/src/shared/utils/globalState.ts +6 -0
- package/src/shared/utils/splitComponent.tsx +10 -18
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={client:true,server:true,config:true,Barrier:true,Emitter:true,isomorphy:true,getSsrContext:true,Semaphore:true,splitComponent:true,themed:true,ThemeProvider:true,time:true,webpack:true,withRetries:true,api:true,PT:true,getGlobalState:true,GlobalStateProvider:true,newAsyncDataEnvelope:true,useAsyncCollection:true,useAsyncData:true,useGlobalState:true,withGlobalStateType:true};Object.defineProperty(exports,"Barrier",{enumerable:true,get:function(){return _utils.Barrier}});Object.defineProperty(exports,"Emitter",{enumerable:true,get:function(){return _utils.Emitter}});Object.defineProperty(exports,"GlobalStateProvider",{enumerable:true,get:function(){return _reactGlobalState.GlobalStateProvider}});exports.PT=void 0;Object.defineProperty(exports,"Semaphore",{enumerable:true,get:function(){return _utils.Semaphore}});Object.defineProperty(exports,"ThemeProvider",{enumerable:true,get:function(){return _utils.ThemeProvider}});Object.defineProperty(exports,"api",{enumerable:true,get:function(){return _axios.default}});exports.client=void 0;Object.defineProperty(exports,"config",{enumerable:true,get:function(){return _utils.config}});Object.defineProperty(exports,"getGlobalState",{enumerable:true,get:function(){return _reactGlobalState.getGlobalState}});Object.defineProperty(exports,"getSsrContext",{enumerable:true,get:function(){return _utils.getSsrContext}});Object.defineProperty(exports,"isomorphy",{enumerable:true,get:function(){return _utils.isomorphy}});Object.defineProperty(exports,"newAsyncDataEnvelope",{enumerable:true,get:function(){return _reactGlobalState.newAsyncDataEnvelope}});exports.server=void 0;Object.defineProperty(exports,"splitComponent",{enumerable:true,get:function(){return _utils.splitComponent}});Object.defineProperty(exports,"themed",{enumerable:true,get:function(){return _utils.themed}});Object.defineProperty(exports,"time",{enumerable:true,get:function(){return _utils.time}});Object.defineProperty(exports,"useAsyncCollection",{enumerable:true,get:function(){return _reactGlobalState.useAsyncCollection}});Object.defineProperty(exports,"useAsyncData",{enumerable:true,get:function(){return _reactGlobalState.useAsyncData}});Object.defineProperty(exports,"useGlobalState",{enumerable:true,get:function(){return _reactGlobalState.useGlobalState}});Object.defineProperty(exports,"webpack",{enumerable:true,get:function(){return _utils.webpack}});Object.defineProperty(exports,"withGlobalStateType",{enumerable:true,get:function(){return _reactGlobalState.withGlobalStateType}});Object.defineProperty(exports,"withRetries",{enumerable:true,get:function(){return _utils.withRetries}});var _utils=require("./shared/utils");var _axios=_interopRequireDefault(require("axios"));var _PT=_interopRequireWildcard(require("prop-types"));exports.PT=_PT;var _reactGlobalState=require("@dr.pogodin/react-global-state");var _components=require("./shared/components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function(){return _components[key]}})});function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}const server=exports.server=_utils.webpack.requireWeak("./server",__dirname)
|
|
2
|
-
// for this scenario.
|
|
3
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
4
|
-
let client=exports.client=server?undefined:require("./client");if(client){client.default.setInj=client.setInj;exports.client=client=client.default}
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={client:true,server:true,config:true,Barrier:true,Emitter:true,isomorphy:true,getSsrContext:true,Semaphore:true,splitComponent:true,themed:true,ThemeProvider:true,time:true,webpack:true,withRetries:true,api:true,PT:true,getGlobalState:true,GlobalStateProvider:true,newAsyncDataEnvelope:true,useAsyncCollection:true,useAsyncData:true,useGlobalState:true,withGlobalStateType:true};Object.defineProperty(exports,"Barrier",{enumerable:true,get:function(){return _utils.Barrier}});Object.defineProperty(exports,"Emitter",{enumerable:true,get:function(){return _utils.Emitter}});Object.defineProperty(exports,"GlobalStateProvider",{enumerable:true,get:function(){return _reactGlobalState.GlobalStateProvider}});exports.PT=void 0;Object.defineProperty(exports,"Semaphore",{enumerable:true,get:function(){return _utils.Semaphore}});Object.defineProperty(exports,"ThemeProvider",{enumerable:true,get:function(){return _utils.ThemeProvider}});Object.defineProperty(exports,"api",{enumerable:true,get:function(){return _axios.default}});exports.client=void 0;Object.defineProperty(exports,"config",{enumerable:true,get:function(){return _utils.config}});Object.defineProperty(exports,"getGlobalState",{enumerable:true,get:function(){return _reactGlobalState.getGlobalState}});Object.defineProperty(exports,"getSsrContext",{enumerable:true,get:function(){return _utils.getSsrContext}});Object.defineProperty(exports,"isomorphy",{enumerable:true,get:function(){return _utils.isomorphy}});Object.defineProperty(exports,"newAsyncDataEnvelope",{enumerable:true,get:function(){return _reactGlobalState.newAsyncDataEnvelope}});exports.server=void 0;Object.defineProperty(exports,"splitComponent",{enumerable:true,get:function(){return _utils.splitComponent}});Object.defineProperty(exports,"themed",{enumerable:true,get:function(){return _utils.themed}});Object.defineProperty(exports,"time",{enumerable:true,get:function(){return _utils.time}});Object.defineProperty(exports,"useAsyncCollection",{enumerable:true,get:function(){return _reactGlobalState.useAsyncCollection}});Object.defineProperty(exports,"useAsyncData",{enumerable:true,get:function(){return _reactGlobalState.useAsyncData}});Object.defineProperty(exports,"useGlobalState",{enumerable:true,get:function(){return _reactGlobalState.useGlobalState}});Object.defineProperty(exports,"webpack",{enumerable:true,get:function(){return _utils.webpack}});Object.defineProperty(exports,"withGlobalStateType",{enumerable:true,get:function(){return _reactGlobalState.withGlobalStateType}});Object.defineProperty(exports,"withRetries",{enumerable:true,get:function(){return _utils.withRetries}});var _utils=require("./shared/utils");var _axios=_interopRequireDefault(require("axios"));var _PT=_interopRequireWildcard(require("prop-types"));exports.PT=_PT;var _reactGlobalState=require("@dr.pogodin/react-global-state");var _components=require("./shared/components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function(){return _components[key]}})});function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}const server=exports.server=_utils.webpack.requireWeak("./server",__dirname);const client=exports.client=server?undefined:require("./client").default;
|
|
5
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_utils","require","_axios","_interopRequireDefault","_PT","_interopRequireWildcard","exports","PT","_reactGlobalState","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","server","webpack","requireWeak","__dirname","client","undefined"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_utils","require","_axios","_interopRequireDefault","_PT","_interopRequireWildcard","exports","PT","_reactGlobalState","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","server","webpack","requireWeak","__dirname","client","undefined"],"sources":["../../src/index.ts"],"sourcesContent":["import 'styles/global.scss';\n\nimport { webpack } from 'utils';\n\nimport type ServerT from './server';\n\nconst server = webpack.requireWeak('./server', __dirname) as (typeof ServerT) | null;\n\nconst client = server ? undefined : require('./client').default;\n\nexport { default as api } from 'axios';\nexport * as PT from 'prop-types';\n\nexport {\n type AsyncCollectionLoaderT,\n type AsyncDataEnvelopeT,\n type AsyncDataLoaderT,\n type ForceT,\n type UseAsyncDataOptionsT,\n type UseAsyncDataResT,\n type UseGlobalStateResT,\n type ValueOrInitializerT,\n getGlobalState,\n GlobalStateProvider,\n newAsyncDataEnvelope,\n useAsyncCollection,\n useAsyncData,\n useGlobalState,\n withGlobalStateType,\n} from '@dr.pogodin/react-global-state';\n\nexport * from 'components';\n\nexport {\n type Listener,\n type Theme,\n config,\n Barrier,\n Emitter,\n isomorphy,\n getSsrContext,\n Semaphore,\n splitComponent,\n themed,\n ThemeProvider,\n time,\n webpack,\n withRetries,\n} from 'utils';\n\nexport { client, server };\n"],"mappings":"kvFAEA,IAAAA,MAAA,CAAAC,OAAA,mBAQA,IAAAC,MAAA,CAAAC,sBAAA,CAAAF,OAAA,WAAuC,IAAAG,GAAA,CAAAC,uBAAA,CAAAJ,OAAA,gBAAAK,OAAA,CAAAC,EAAA,CAAAH,GAAA,CAGvC,IAAAI,iBAAA,CAAAP,OAAA,mCAkBA,IAAAQ,WAAA,CAAAR,OAAA,wBAAAS,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAP,OAAA,EAAAA,OAAA,CAAAO,GAAA,IAAAJ,WAAA,CAAAI,GAAA,SAAAH,MAAA,CAAAQ,cAAA,CAAAZ,OAAA,CAAAO,GAAA,EAAAM,UAAA,MAAAC,GAAA,SAAAA,CAAA,SAAAX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,OAAA,CAAAkC,MAAA,CAAGJ,MAAM,CAAGK,SAAS,CAAGxC,OAAO,WAAW,CAAC,CAAC0B,OAAO","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":["_propTypes","_interopRequireDefault","require","validThemeKeys","exports","valueValidator","PT","oneOfType","number","isRequired","string","optionValidator","shape","name","node","value","optionsValidator","arrayOf","stringOptionValidator","stringOptionsValidator","isValue","x","type","optionValueName","option"],"sources":["../../../../../src/shared/components/selectors/common.ts"],"sourcesContent":["// The stuff common between different dropdown implementations.\n\nimport PT from 'prop-types';\n\nimport type { Theme } from '@dr.pogodin/react-themes';\n\nexport const validThemeKeys = [\n 'active',\n 'arrow',\n 'container',\n 'dropdown',\n 'hiddenOption',\n 'label',\n 'option',\n 'select',\n\n // TODO: This is only valid for <CustomDropdown>, thus we need to re-factor it\n // into a separate theme spec for that component.\n 'upward',\n] as const;\n\nexport type ValueT = number | string;\n\nexport const valueValidator: PT.Requireable<ValueT> = PT.oneOfType([\n PT.number.isRequired,\n PT.string.isRequired,\n]);\n\nexport type OptionT<NameT> = {\n name?: NameT | null;\n value: ValueT;\n};\n\nexport type OptionsT<NameT> = Array<OptionT<NameT> | ValueT
|
|
1
|
+
{"version":3,"file":"common.js","names":["_propTypes","_interopRequireDefault","require","validThemeKeys","exports","valueValidator","PT","oneOfType","number","isRequired","string","optionValidator","shape","name","node","value","optionsValidator","arrayOf","stringOptionValidator","stringOptionsValidator","isValue","x","type","optionValueName","option"],"sources":["../../../../../src/shared/components/selectors/common.ts"],"sourcesContent":["// The stuff common between different dropdown implementations.\n\nimport PT from 'prop-types';\n\nimport type { Theme } from '@dr.pogodin/react-themes';\n\nexport const validThemeKeys = [\n 'active',\n 'arrow',\n 'container',\n 'dropdown',\n 'hiddenOption',\n 'label',\n 'option',\n 'select',\n\n // TODO: This is only valid for <CustomDropdown>, thus we need to re-factor it\n // into a separate theme spec for that component.\n 'upward',\n] as const;\n\nexport type ValueT = number | string;\n\nexport const valueValidator: PT.Requireable<ValueT> = PT.oneOfType([\n PT.number.isRequired,\n PT.string.isRequired,\n]);\n\nexport type OptionT<NameT> = {\n name?: NameT | null;\n value: ValueT;\n};\n\nexport type OptionsT<NameT> = Readonly<Array<OptionT<NameT> | ValueT>>;\n\nexport type PropsT<\n NameT,\n OnChangeT = React.ChangeEventHandler<HTMLSelectElement>,\n> = {\n filter?: (item: OptionT<NameT> | ValueT) => boolean;\n label?: React.ReactNode;\n onChange?: OnChangeT;\n options?: OptionsT<NameT>;\n theme: Theme<typeof validThemeKeys>;\n value?: ValueT;\n};\n\nexport const optionValidator:\nPT.Requireable<OptionT<React.ReactNode> | ValueT> = PT.oneOfType([\n PT.shape({\n name: PT.node,\n value: valueValidator.isRequired,\n }).isRequired,\n PT.number.isRequired,\n PT.string.isRequired,\n]);\n\nexport const optionsValidator = PT.arrayOf(optionValidator.isRequired);\n\nexport const stringOptionValidator:\nPT.Requireable<OptionT<string> | ValueT> = PT.oneOfType([\n PT.shape({\n name: PT.string,\n value: valueValidator.isRequired,\n }).isRequired,\n PT.number.isRequired,\n PT.string.isRequired,\n]);\n\nexport const stringOptionsValidator = PT.arrayOf(stringOptionValidator.isRequired);\n\nfunction isValue<T>(x: OptionT<T> | ValueT): x is ValueT {\n const type = typeof x;\n return type === 'number' || type === 'string';\n}\n\n/** Returns option value and name as a tuple. */\nexport function optionValueName<NameT>(\n option: OptionT<NameT> | ValueT,\n): [ValueT, NameT | ValueT] {\n return isValue(option)\n ? [option, option]\n : [option.value, option.name ?? option.value];\n}\n"],"mappings":"2WAEA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBAFA;AAMO,KAAM,CAAAC,cAAc,CAAAC,OAAA,CAAAD,cAAA,CAAG,CAC5B,QAAQ,CACR,OAAO,CACP,WAAW,CACX,UAAU,CACV,cAAc,CACd,OAAO,CACP,QAAQ,CACR,QAAQ,CAER;AACA;AACA,QAAQ,CACA,CAIH,KAAM,CAAAE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AJ,OAAO,CAACI,MAAM,CAAC,CAClB,CAACA,MAAM,CAAEA,MAAM,CAAC,CAChB,CAACA,MAAM,CAACT,KAAK,CAAES,MAAM,CAACX,IAAI,EAAIW,MAAM,CAACT,KAAK,CAChD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalState.js","names":["_reactGlobalState","require","getSsrContext","withGlobalStateType","exports"],"sources":["../../../../src/shared/utils/globalState.ts"],"sourcesContent":["import type { Request } from 'express';\n\nimport { type SsrContext, withGlobalStateType } from '@dr.pogodin/react-global-state';\n\nexport type ChunkGroupsT = {\n [chunkName: string]: string[];\n};\n\n// The type of data object injected by server into generated markup.\nexport type InjT = {\n CHUNK_GROUPS?: ChunkGroupsT;\n CONFIG?: { [key: string]: any },\n ISTATE?: unknown;\n};\n\nexport interface SsrContextT<StateT> extends SsrContext<StateT> {\n chunkGroups: ChunkGroupsT;\n chunks: string[];\n req: Request,\n status: number;\n}\n\nconst {\n getSsrContext,\n} = withGlobalStateType<unknown, SsrContextT<unknown>>();\n\nexport {\n getSsrContext,\n};\n"],"mappings":"mGAEA,IAAAA,iBAAA,CAAAC,OAAA,mCAMA;
|
|
1
|
+
{"version":3,"file":"globalState.js","names":["_reactGlobalState","require","getSsrContext","withGlobalStateType","exports"],"sources":["../../../../src/shared/utils/globalState.ts"],"sourcesContent":["import type { Request } from 'express';\n\nimport { type SsrContext, withGlobalStateType } from '@dr.pogodin/react-global-state';\n\nexport type ChunkGroupsT = {\n [chunkName: string]: string[];\n};\n\n// The type of data object injected by server into generated markup.\nexport type InjT = {\n CHUNK_GROUPS?: ChunkGroupsT;\n CONFIG?: { [key: string]: any },\n ISTATE?: unknown;\n};\n\ndeclare global {\n interface Window {\n REACT_UTILS_INJECTION?: InjT;\n }\n}\n\nexport interface SsrContextT<StateT> extends SsrContext<StateT> {\n chunkGroups: ChunkGroupsT;\n chunks: string[];\n req: Request,\n status: number;\n}\n\nconst {\n getSsrContext,\n} = withGlobalStateType<unknown, SsrContextT<unknown>>();\n\nexport {\n getSsrContext,\n};\n"],"mappings":"mGAEA,IAAAA,iBAAA,CAAAC,OAAA,mCAMA;AAoBA,KAAM,CACJC,aACF,CAAC,CAAG,GAAAC,qCAAmB,EAAgC,CAAC,CAACC,OAAA,CAAAF,aAAA,CAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.bookStyleSheets=bookStyleSheets;exports.default=splitComponent;exports.freeStyleSheets=freeStyleSheets;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _jsUtils=require("@dr.pogodin/js-utils");var _globalState=require("./globalState");var _isomorphy=require("./isomorphy");var _jsxRuntime=require("react/jsx-runtime");/* eslint-disable react/jsx-props-no-spreading */ /* global document */ //
|
|
2
|
-
//
|
|
3
|
-
// alongside custom chunk info injection in server-less scenario);
|
|
4
|
-
// at the server-side we only can get them within React render flow.
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.bookStyleSheets=bookStyleSheets;exports.default=splitComponent;exports.freeStyleSheets=freeStyleSheets;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _jsUtils=require("@dr.pogodin/js-utils");var _globalState=require("./globalState");var _isomorphy=require("./isomorphy");var _jsxRuntime=require("react/jsx-runtime");/* eslint-disable react/jsx-props-no-spreading */ /* global document */ // Note: At the client side we can get chunk groups immediately when loading
|
|
2
|
+
// the module; at the server-side we only can get them within React render flow.
|
|
5
3
|
// Thus, we set and use the following variable at the client-side, and then when
|
|
6
4
|
// needed on the server side, we'll fetch it differently.
|
|
7
|
-
let
|
|
8
|
-
|
|
5
|
+
let clientChunkGroups;if(_isomorphy.IS_CLIENT_SIDE){// eslint-disable-next-line global-require
|
|
6
|
+
clientChunkGroups=require("../../client/getInj").default().CHUNK_GROUPS||{}}const refCounts={};function getPublicPath(){return(0,_isomorphy.getBuildInfo)().publicPath}/**
|
|
9
7
|
* Client-side only! Ensures the specified CSS stylesheet is loaded into
|
|
10
8
|
* the document; loads if it is missing; and does simple reference counting
|
|
11
9
|
* to facilitate future clean-up.
|
|
@@ -41,13 +39,13 @@ const usedChunkNames=new Set;/**
|
|
|
41
39
|
* @param {React.Element} [options.placeholder]
|
|
42
40
|
* @return {React.ElementType}
|
|
43
41
|
*/function splitComponent({chunkName,getComponent,placeholder}){// On the client side we can check right away if the chunk name is known.
|
|
44
|
-
if(_isomorphy.IS_CLIENT_SIDE)assertChunkName(chunkName,
|
|
42
|
+
if(_isomorphy.IS_CLIENT_SIDE)assertChunkName(chunkName,clientChunkGroups);// The correct usage of splitComponent() assumes a single call per chunk.
|
|
45
43
|
if(usedChunkNames.has(chunkName)){throw Error(`Repeated splitComponent() call for the chunk "${chunkName}"`)}else usedChunkNames.add(chunkName);const LazyComponent=/*#__PURE__*/(0,_react.lazy)(async()=>{const resolved=await getComponent();const Component="default"in resolved?resolved.default:resolved;// This pre-loads necessary stylesheets prior to the first mount of
|
|
46
44
|
// the component (the lazy load function is executed by React one at
|
|
47
45
|
// the frist mount).
|
|
48
|
-
if(_isomorphy.IS_CLIENT_SIDE){await bookStyleSheets(chunkName,
|
|
46
|
+
if(_isomorphy.IS_CLIENT_SIDE){await bookStyleSheets(chunkName,clientChunkGroups,false)}const Wrapper=/*#__PURE__*/(0,_react.forwardRef)(({children,...rest},ref)=>{// On the server side we'll assert the chunk name here,
|
|
49
47
|
// and also push it to the SSR chunks array.
|
|
50
48
|
if(_isomorphy.IS_SERVER_SIDE){const{chunkGroups,chunks}=(0,_globalState.getSsrContext)();assertChunkName(chunkName,chunkGroups);if(!chunks.includes(chunkName))chunks.push(chunkName)}// This takes care about stylesheets management every time an instance of
|
|
51
49
|
// this component is mounted / unmounted.
|
|
52
|
-
(0,_react.useInsertionEffect)(()=>{bookStyleSheets(chunkName,
|
|
50
|
+
(0,_react.useInsertionEffect)(()=>{bookStyleSheets(chunkName,clientChunkGroups,true);return()=>freeStyleSheets(chunkName,clientChunkGroups)},[]);return/*#__PURE__*/(0,_jsxRuntime.jsx)(Component,{ref:ref,...rest,children:children})});return{default:Wrapper}});const CodeSplit=({children,...rest})=>/*#__PURE__*/(0,_jsxRuntime.jsx)(_react.Suspense,{fallback:placeholder,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(LazyComponent,{...rest,children:children})});CodeSplit.propTypes={children:_propTypes.default.node};return CodeSplit}
|
|
53
51
|
//# sourceMappingURL=splitComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitComponent.js","names":["_propTypes","_interopRequireDefault","require","_react","_jsUtils","_globalState","_isomorphy","_jsxRuntime","cachedClientChunkGroups","getClientChunkGroups","IS_CLIENT_SIDE","default","CHUNK_GROUPS","Error","refCounts","getPublicPath","getBuildInfo","publicPath","bookStyleSheet","name","loadedSheets","refCount","res","path","fullPath","document","location","origin","has","link","querySelector","createElement","setAttribute","head","appendChild","Barrier","addEventListener","resolve","current","getLoadedStyleSheets","Set","styleSheets","i","length","href","add","assertChunkName","chunkName","chunkGroups","bookStyleSheets","promises","assets","asset","endsWith","promise","push","Promise","allSettled","then","freeStyleSheets","remove","usedChunkNames","splitComponent","getComponent","placeholder","LazyComponent","lazy","resolved","Component","Wrapper","forwardRef","children","rest","ref","IS_SERVER_SIDE","chunks","getSsrContext","includes","useInsertionEffect","jsx","CodeSplit","Suspense","fallback","propTypes","PT","node"],"sources":["../../../../src/shared/utils/splitComponent.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* global document */\n\nimport PT from 'prop-types';\n\nimport {\n type ComponentType,\n type ReactNode,\n forwardRef,\n lazy,\n Suspense,\n useInsertionEffect,\n} from 'react';\n\nimport { Barrier } from '@dr.pogodin/js-utils';\n\nimport { type ChunkGroupsT, getSsrContext } from './globalState';\n\nimport {\n IS_CLIENT_SIDE,\n IS_SERVER_SIDE,\n getBuildInfo,\n} from './isomorphy';\n\n// NOTE: At the client-side we get chunk groups the first time they are needed\n// (we used to get them eagerly when this module loaded, but it did not work well\n// alongside custom chunk info injection in server-less scenario);\n// at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\nlet cachedClientChunkGroups: ChunkGroupsT | undefined;\n\nfunction getClientChunkGroups(): ChunkGroupsT {\n if (IS_CLIENT_SIDE && !cachedClientChunkGroups) {\n // eslint-disable-next-line global-require\n cachedClientChunkGroups = require('client/getInj').default().CHUNK_GROUPS || {};\n }\n\n if (!cachedClientChunkGroups) throw Error('Internal error');\n\n return cachedClientChunkGroups;\n}\n\nconst refCounts: { [path: string]: number } = {};\n\nfunction getPublicPath() {\n return getBuildInfo().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(\n name: string,\n loadedSheets: Set<string>,\n refCount: boolean,\n): Promise<void> | undefined {\n let res: Barrier<void> | undefined;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n\n res = new Barrier<void>();\n link.addEventListener('load', () => res!.resolve());\n link.addEventListener('error', () => res!.resolve());\n }\n\n if (refCount) {\n const current = refCounts[path] || 0;\n refCounts[path] = 1 + current;\n }\n\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets(): Set<string> {\n const res = new Set<string>();\n const { styleSheets } = document;\n for (let i = 0; i < styleSheets.length; ++i) {\n const { href } = styleSheets[i];\n if (href) res.add(href);\n }\n return res;\n}\n\nfunction assertChunkName(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nexport function bookStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n refCount: boolean,\n): Promise<void> {\n const promises = [];\n const assets = chunkGroups[chunkName];\n const loadedSheets = getLoadedStyleSheets();\n\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n\n return promises.length\n ? Promise.allSettled(promises).then()\n : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nexport function freeStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n const assets = chunkGroups[chunkName];\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n if (--refCounts[path] <= 0) {\n document.head.querySelector(`link[href=\"${path}\"]`)!.remove();\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n\ntype ComponentOrModule<PropsT> = ComponentType<PropsT> | {\n default: ComponentType<PropsT>,\n};\n\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nexport default function splitComponent<\n ComponentPropsT extends { children?: ReactNode },\n>({\n chunkName,\n getComponent,\n placeholder,\n}: {\n chunkName: string;\n getComponent: () => Promise<ComponentOrModule<ComponentPropsT>>,\n placeholder?: ReactNode,\n}) {\n // On the client side we can check right away if the chunk name is known.\n if (IS_CLIENT_SIDE) assertChunkName(chunkName, getClientChunkGroups());\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n\n const LazyComponent = lazy(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, getClientChunkGroups(), false);\n }\n\n const Wrapper = forwardRef((\n { children, ...rest }: ComponentPropsT,\n ref,\n ) => {\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (IS_SERVER_SIDE) {\n const { chunkGroups, chunks } = getSsrContext()!;\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n useInsertionEffect(() => {\n bookStyleSheets(chunkName, getClientChunkGroups(), true);\n return () => freeStyleSheets(chunkName, getClientChunkGroups());\n }, []);\n\n return (\n <Component ref={ref} {...rest as ComponentPropsT}>\n {children}\n </Component>\n );\n });\n\n return { default: Wrapper };\n });\n\n const CodeSplit: React.FunctionComponent<ComponentPropsT> = ({\n children,\n ...rest\n }: ComponentPropsT) => (\n <Suspense fallback={placeholder}>\n <LazyComponent {...rest as Parameters<typeof LazyComponent>[0]}>\n {children}\n </LazyComponent>\n </Suspense>\n );\n\n CodeSplit.propTypes = {\n children: PT.node,\n } as PT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AAG,GAAAC,0BAAa,EAAC,CAAE,CAChD9B,eAAe,CAACC,SAAS,CAAEC,WAAW,CAAC,CACvC,GAAI,CAAC2B,MAAM,CAACE,QAAQ,CAAC9B,SAAS,CAAC,CAAE4B,MAAM,CAACpB,IAAI,CAACR,SAAS,CACxD,CAEA;AACA;AACA,GAAA+B,yBAAkB,EAAC,IAAM,CACvB7B,eAAe,CAACF,SAAS,CAAEtC,oBAAoB,CAAC,CAAC,CAAE,IAAI,CAAC,CACxD,MAAO,IAAMkD,eAAe,CAACZ,SAAS,CAAEtC,oBAAoB,CAAC,CAAC,CAChE,CAAC,CAAE,EAAE,CAAC,CAEN,mBACE,GAAAF,WAAA,CAAAwE,GAAA,EAACX,SAAS,EAACK,GAAG,CAAEA,GAAI,IAAKD,IAAI,CAAAD,QAAA,CAC1BA,QAAQ,CACA,CAEf,CAAC,CAAC,CAEF,MAAO,CAAE5D,OAAO,CAAE0D,OAAQ,CAC5B,CAAC,CAAC,CAEF,KAAM,CAAAW,SAAmD,CAAGA,CAAC,CAC3DT,QAAQ,CACR,GAAGC,IACY,CAAC,gBAChB,GAAAjE,WAAA,CAAAwE,GAAA,EAAC5E,MAAA,CAAA8E,QAAQ,EAACC,QAAQ,CAAElB,WAAY,CAAAO,QAAA,cAC9B,GAAAhE,WAAA,CAAAwE,GAAA,EAACd,aAAa,KAAKO,IAAI,CAAAD,QAAA,CACpBA,QAAQ,CACI,CAAC,CACR,CACX,CAEDS,SAAS,CAACG,SAAS,CAAG,CACpBZ,QAAQ,CAAEa,kBAAE,CAACC,IACf,CAA0C,CAE1C,MAAO,CAAAL,SACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"splitComponent.js","names":["_propTypes","_interopRequireDefault","require","_react","_jsUtils","_globalState","_isomorphy","_jsxRuntime","clientChunkGroups","IS_CLIENT_SIDE","default","CHUNK_GROUPS","refCounts","getPublicPath","getBuildInfo","publicPath","bookStyleSheet","name","loadedSheets","refCount","res","path","fullPath","document","location","origin","has","link","querySelector","createElement","setAttribute","head","appendChild","Barrier","addEventListener","resolve","current","getLoadedStyleSheets","Set","styleSheets","i","length","href","add","assertChunkName","chunkName","chunkGroups","Error","bookStyleSheets","promises","assets","asset","endsWith","promise","push","Promise","allSettled","then","freeStyleSheets","remove","usedChunkNames","splitComponent","getComponent","placeholder","LazyComponent","lazy","resolved","Component","Wrapper","forwardRef","children","rest","ref","IS_SERVER_SIDE","chunks","getSsrContext","includes","useInsertionEffect","jsx","CodeSplit","Suspense","fallback","propTypes","PT","node"],"sources":["../../../../src/shared/utils/splitComponent.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* global document */\n\nimport PT from 'prop-types';\n\nimport {\n type ComponentType,\n type ReactNode,\n forwardRef,\n lazy,\n Suspense,\n useInsertionEffect,\n} from 'react';\n\nimport { Barrier } from '@dr.pogodin/js-utils';\n\nimport { type ChunkGroupsT, getSsrContext } from './globalState';\n\nimport {\n IS_CLIENT_SIDE,\n IS_SERVER_SIDE,\n getBuildInfo,\n} from './isomorphy';\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\nlet clientChunkGroups: ChunkGroupsT;\n\nif (IS_CLIENT_SIDE) {\n // eslint-disable-next-line global-require\n clientChunkGroups = require('client/getInj').default().CHUNK_GROUPS || {};\n}\n\nconst refCounts: { [path: string]: number } = {};\n\nfunction getPublicPath() {\n return getBuildInfo().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(\n name: string,\n loadedSheets: Set<string>,\n refCount: boolean,\n): Promise<void> | undefined {\n let res: Barrier<void> | undefined;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n\n res = new Barrier<void>();\n link.addEventListener('load', () => res!.resolve());\n link.addEventListener('error', () => res!.resolve());\n }\n\n if (refCount) {\n const current = refCounts[path] || 0;\n refCounts[path] = 1 + current;\n }\n\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets(): Set<string> {\n const res = new Set<string>();\n const { styleSheets } = document;\n for (let i = 0; i < styleSheets.length; ++i) {\n const { href } = styleSheets[i];\n if (href) res.add(href);\n }\n return res;\n}\n\nfunction assertChunkName(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nexport function bookStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n refCount: boolean,\n): Promise<void> {\n const promises = [];\n const assets = chunkGroups[chunkName];\n const loadedSheets = getLoadedStyleSheets();\n\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n\n return promises.length\n ? Promise.allSettled(promises).then()\n : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nexport function freeStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n const assets = chunkGroups[chunkName];\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n if (--refCounts[path] <= 0) {\n document.head.querySelector(`link[href=\"${path}\"]`)!.remove();\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n\ntype ComponentOrModule<PropsT> = ComponentType<PropsT> | {\n default: ComponentType<PropsT>,\n};\n\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nexport default function splitComponent<\n ComponentPropsT extends { children?: ReactNode },\n>({\n chunkName,\n getComponent,\n placeholder,\n}: {\n chunkName: string;\n getComponent: () => Promise<ComponentOrModule<ComponentPropsT>>,\n placeholder?: ReactNode,\n}) {\n // On the client side we can check right away if the chunk name is known.\n if (IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n\n const LazyComponent = lazy(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, clientChunkGroups, false);\n }\n\n const Wrapper = forwardRef((\n { children, ...rest }: ComponentPropsT,\n ref,\n ) => {\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (IS_SERVER_SIDE) {\n const { chunkGroups, chunks } = getSsrContext()!;\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n useInsertionEffect(() => {\n bookStyleSheets(chunkName, clientChunkGroups, true);\n return () => freeStyleSheets(chunkName, clientChunkGroups);\n }, []);\n\n return (\n <Component ref={ref} {...rest as ComponentPropsT}>\n {children}\n </Component>\n );\n });\n\n return { default: Wrapper };\n });\n\n const CodeSplit: React.FunctionComponent<ComponentPropsT> = ({\n children,\n ...rest\n }: ComponentPropsT) => (\n <Suspense fallback={placeholder}>\n <LazyComponent {...rest as Parameters<typeof LazyComponent>[0]}>\n {children}\n </LazyComponent>\n </Suspense>\n );\n\n CodeSplit.propTypes = {\n children: PT.node,\n } as PT.WeakValidationMap<ComponentPropsT>;\n\n return CodeSplit;\n}\n"],"mappings":"wQAGA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBAEA,IAAAC,MAAA,CAAAD,OAAA,UASA,IAAAE,QAAA,CAAAF,OAAA,yBAEA,IAAAG,YAAA,CAAAH,OAAA,kBAEA,IAAAI,UAAA,CAAAJ,OAAA,gBAIqB,IAAAK,WAAA,CAAAL,OAAA,sBAtBrB,kDACA,sBAuBA;AACA;AACA;AACA;AACA,GAAI,CAAAM,iBAA+B,CAEnC,GAAIC,yBAAc,CAAE,CAClB;AACAD,iBAAiB,CAAGN,OAAO,sBAAgB,CAAC,CAACQ,OAAO,CAAC,CAAC,CAACC,YAAY,EAAI,CAAC,CAC1E,CAEA,KAAM,CAAAC,SAAqC,CAAG,CAAC,CAAC,CAEhD,QAAS,CAAAC,aAAaA,CAAA,CAAG,CACvB,MAAO,GAAAC,uBAAY,EAAC,CAAC,CAACC,UACxB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAAS,CAAAC,cAAcA,CACrBC,IAAY,CACZC,YAAyB,CACzBC,QAAiB,CACU,CAC3B,GAAI,CAAAC,GAA8B,CAClC,KAAM,CAAAC,IAAI,CAAG,GAAGR,aAAa,CAAC,CAAC,IAAII,IAAI,EAAE,CACzC,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|
/*! 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("axios"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("prop-types"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","axios","dayjs","node-forge/lib/aes","node-forge/lib/forge","prop-types","qs","react","react-dom","react-dom/client","react-helmet","react-router-dom"],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("axios"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("prop-types"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet"),require("react-router-dom")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.axios,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e["prop-types"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-helmet"],e["react-router-dom"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__742__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__949__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__883__,__WEBPACK_EXTERNAL_MODULE__442__){return function(){"use strict";var __webpack_modules__={227:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:function(){return getInj},Q:function(){return setInj}});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__(445);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 inj={};function getInj(){return inj}function setInj(e){inj=e}},662:function(e,t,n){n.r(t),n.d(t,{default:function(){return l},setInj:function(){return a.Q}}),n(155);var r=n(126),o=n(236),i=n(442),a=n(227),c=n(848);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,c.jsx)(r.GlobalStateProvider,{initialState:(0,a.A)().ISTATE||t.initialState,children:(0,c.jsx)(i.BrowserRouter,{future:{v7_relativeSplatPath:!0},children:(0,c.jsx)(e,{})})});t.dontHydrate?(0,o.createRoot)(n).render(l):(0,o.hydrateRoot)(n,l)}},445: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)},965: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},333: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 c},getBuildInfo:function(){return r.F},isDevBuild:function(){return i},isProdBuild:function(){return a}});var r=n(445),o=n(965);function i(){return!1}function a(){return!0}function c(){return(0,r.F)().timestamp}},969: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__(333);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,{default:def,...named}=eval("require")(path);return def?(Object.entries(named).forEach((e=>{let[t,n]=e;if(def[t]){if(def[t]!==n)throw Error("Conflict between default and named exports")}else def[t]=n})),def):named}catch{return null}}function resolveWeak(e){return e}},427:function(e,t){t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=(t||{}).decode||o,i=0;i<e.length;){var c=e.indexOf("=",i);if(-1===c)break;var l=e.indexOf(";",i);if(-1===l)l=e.length;else if(l<c){i=e.lastIndexOf(";",c-1)+1;continue}var s=e.slice(i,c).trim();if(void 0===n[s]){var u=e.slice(c+1,l).trim();34===u.charCodeAt(0)&&(u=u.slice(1,-1)),n[s]=a(u,r)}i=l+1}return n},t.serialize=function(e,t,o){var a=o||{},c=a.encode||i;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!r.test(e))throw new TypeError("argument name is invalid");var l=c(t);if(l&&!r.test(l))throw new TypeError("argument val is invalid");var s=e+"="+l;if(null!=a.maxAge){var u=a.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(u)}if(a.domain){if(!r.test(a.domain))throw new TypeError("option domain is invalid");s+="; Domain="+a.domain}if(a.path){if(!r.test(a.path))throw new TypeError("option path is invalid");s+="; Path="+a.path}if(a.expires){var _=a.expires;if(!function(e){return"[object Date]"===n.call(e)||e instanceof Date}(_)||isNaN(_.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+_.toUTCString()}if(a.httpOnly&&(s+="; HttpOnly"),a.secure&&(s+="; Secure"),a.partitioned&&(s+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s};var n=Object.prototype.toString,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}function a(e,t){try{return t(e)}catch(t){return e}}},20:function(e,t,n){var r=n(155),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,u=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:s,ref:u,props:i,_owner:c.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},848:function(e,t,n){e.exports=n(20)},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__},742:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__742__},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__},949:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__949__},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__},883:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__883__},442:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__442__}},__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__={};return function(){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return _.Barrier},BaseButton:function(){return ie},BaseModal:function(){return L},Button:function(){return ce},Checkbox:function(){return ue},CustomDropdown:function(){return H},Dropdown:function(){return Q},Emitter:function(){return _.Emitter},GlobalStateProvider:function(){return d.GlobalStateProvider},Input:function(){return pe},Link:function(){return oe},MetaTags:function(){return ve},Modal:function(){return D},NavLink:function(){return ge},PT:function(){return m},PageLayout:function(){return me},Semaphore:function(){return _.Semaphore},Switch:function(){return ee},TextArea:function(){return Xe},ThemeProvider:function(){return e.ThemeProvider},Throbber:function(){return Te},WithTooltip:function(){return Le},YouTubeVideo:function(){return Ue},api:function(){return O()},client:function(){return Fe},config:function(){return i},getGlobalState:function(){return d.getGlobalState},getSsrContext:function(){return p},isomorphy:function(){return a},newAsyncDataEnvelope:function(){return d.newAsyncDataEnvelope},optionValidator:function(){return B},optionsValidator:function(){return U},server:function(){return Ye},splitComponent:function(){return R},themed:function(){return P},time:function(){return h},useAsyncCollection:function(){return d.useAsyncCollection},useAsyncData:function(){return d.useAsyncData},useGlobalState:function(){return d.useGlobalState},webpack:function(){return r},withGlobalStateType:function(){return d.withGlobalStateType},withRetries:function(){return _.withRetries}});var e=__webpack_require__(859),t=__webpack_require__.n(e),n=__webpack_require__(965),r=__webpack_require__(969);const o=(n.B?__webpack_require__(227).A().CONFIG:(0,r.requireWeak)("config"))||{};if(n.B&&"undefined"!=typeof document){const e=__webpack_require__(427);o.CSRF=e.parse(document.cookie).csrfToken}var i=o,a=__webpack_require__(333),c=__webpack_require__(427),l=__webpack_require__(185),s=__webpack_require__.n(l),u=__webpack_require__(155),_=__webpack_require__(864),d=__webpack_require__(126);const{getSsrContext:p}=(0,d.withGlobalStateType)(),f={DAY_MS:_.DAY_MS,HOUR_MS:_.HOUR_MS,MIN_MS:_.MIN_MS,SEC_MS:_.SEC_MS,YEAR_MS:_.YEAR_MS,now:Date.now,timer:_.timer,useCurrent:function(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[r,o]=(0,d.useGlobalState)(t,Date.now);return(0,u.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},useTimezoneOffset:function(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=p(!1),[r,o]=(0,d.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,u.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=c.serialize(e,t.toString(),{path:"/"}))}),[e,o]),r}};var h=Object.assign(s(),f),m=__webpack_require__(949),b=__webpack_require__.n(m),E=__webpack_require__(848);let w;function v(){if(a.IS_CLIENT_SIDE&&!w&&(w=__webpack_require__(227).A().CHUNK_GROUPS||{}),!w)throw Error("Internal error");return w}const g={};function y(){return(0,a.getBuildInfo)().publicPath}function x(e,t,n){let r;const o=`${y()}/${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)),r=new _.Barrier,e.addEventListener("load",(()=>r.resolve())),e.addEventListener("error",(()=>r.resolve()))}if(n){const e=g[o]||0;g[o]=1+e}return r}function T(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function C(e,t,n){const r=[],o=t[e],i=function(){const e=new Set,{styleSheets:t}=document;for(let n=0;n<t.length;++n){const{href:r}=t[n];r&&e.add(r)}return e}();for(let e=0;e<o.length;++e){const t=o[e];if(t.endsWith(".css")){const e=x(t,i,n);e&&r.push(e)}}return r.length?Promise.allSettled(r).then():Promise.resolve()}const k=new Set;function R(e){let{chunkName:t,getComponent:n,placeholder:r}=e;if(a.IS_CLIENT_SIDE&&T(t,v()),k.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);k.add(t);const o=(0,u.lazy)((async()=>{const e=await n(),r="default"in e?e.default:e;a.IS_CLIENT_SIDE&&await C(t,v(),!1);const o=(0,u.forwardRef)(((e,n)=>{let{children:o,...i}=e;if(a.IS_SERVER_SIDE){const{chunkGroups:e,chunks:n}=p();T(t,e),n.includes(t)||n.push(t)}return(0,u.useInsertionEffect)((()=>(C(t,v(),!0),()=>function(e,t){const n=t[e];for(let e=0;e<n.length;++e){const t=n[e];if(t.endsWith(".css")){const e=`${y()}/${t}`;--g[e]<=0&&document.head.querySelector(`link[href="${e}"]`).remove()}}}(t,v()))),[]),(0,E.jsx)(r,{ref:n,...i,children:o})}));return{default:o}})),i=e=>{let{children:t,...n}=e;return(0,E.jsx)(u.Suspense,{fallback:r,children:(0,E.jsx)(o,{...n,children:t})})};return i.propTypes={children:b().node},i}const P=t();P.COMPOSE=e.COMPOSE,P.PRIORITY=e.PRIORITY;var S=__webpack_require__(742),O=__webpack_require__.n(S),q=__webpack_require__(514),A=__webpack_require__.n(q),j="_5fRFtF";const L=e=>{let{cancelOnScrolling:t,children:n,containerStyle:r,dontDisableScrolling:o,onCancel:i,theme:a}=e;const c=(0,u.useRef)(null),l=(0,u.useRef)(null),[s,_]=(0,u.useState)();(0,u.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),_(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(j),()=>{o||document.body.classList.remove(j)})),[o]);const d=(0,u.useMemo)((()=>(0,E.jsx)("div",{onFocus:()=>{var e,t;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=n.length-1;e>=0;--e)if(n[e].focus(),document.activeElement===n[e])return;null===(t=l.current)||void 0===t||t.focus()},tabIndex:0})),[]);return s?A().createPortal((0,E.jsxs)(E.Fragment,{children:[d,(0,E.jsx)("div",{"aria-label":"Cancel",className:a.overlay,onClick:e=>{i&&(i(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&i&&(i(),e.stopPropagation())},ref:e=>{e&&e!==l.current&&(l.current=e,e.focus())},role:"button",tabIndex:0}),(0,E.jsx)("div",{"aria-modal":"true",className:a.container,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:c,role:"dialog",style:r,children:n}),(0,E.jsx)("div",{onFocus:()=>{var e;null===(e=l.current)||void 0===e||e.focus()},tabIndex:0}),d]}),s):null},N=t()(L,"Modal",["container","overlay"],{overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"});L.propTypes={cancelOnScrolling:b().bool,children:b().node,containerStyle:b().shape({}),dontDisableScrolling:b().bool,onCancel:b().func,theme:N.themeType.isRequired};var D=N;const M=["active","arrow","container","dropdown","hiddenOption","label","option","select","upward"],I=b().oneOfType([b().number.isRequired,b().string.isRequired]),B=b().oneOfType([b().shape({name:b().node,value:I.isRequired}).isRequired,b().number.isRequired,b().string.isRequired]),U=b().arrayOf(B.isRequired),W=b().oneOfType([b().shape({name:b().string,value:I.isRequired}).isRequired,b().number.isRequired,b().string.isRequired]),K=b().arrayOf(W.isRequired);function X(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]}const Y=(0,u.forwardRef)(((e,t)=>{let{containerClass:n,containerStyle:r,filter:o,onCancel:i,onChange:a,optionClass:c,options:l}=e;const s=(0,u.useRef)(null);(0,u.useImperativeHandle)(t,(()=>({measure:()=>{var e,t;const n=null===(e=s.current)||void 0===e?void 0:e.parentElement;if(!n)return;const r=null===(t=s.current)||void 0===t?void 0:t.getBoundingClientRect(),o=window.getComputedStyle(n),i=parseFloat(o.marginBottom),a=parseFloat(o.marginTop);return r.height+=i+a,r}})),[]);const _=[];for(let e=0;e<l.length;++e){const t=l[e];if(!o||o(t)){const[e,n]=X(t);_.push((0,E.jsx)("div",{className:c,onClick:t=>{a(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(a(e),t.stopPropagation())},role:"button",tabIndex:0,children:n},e))}}return(0,E.jsx)(L,{cancelOnScrolling:!0,containerStyle:r,dontDisableScrolling:!0,onCancel:i,theme:{ad:"",hoc:"",container:n,context:"",overlay:"jKsMKG"},children:(0,E.jsx)("div",{ref:s,children:_})})}));Y.propTypes={containerClass:b().string.isRequired,containerStyle:b().shape({left:b().number.isRequired,top:b().number.isRequired,width:b().number.isRequired}),filter:b().func,onCancel:b().func.isRequired,onChange:b().func.isRequired,optionClass:b().string.isRequired,options:U.isRequired};var F=Y;const $=e=>{let{filter:t,label:n,onChange:r,options:o,theme:i,value:a}=e;if(!o)throw Error("Internal error");const[c,l]=(0,u.useState)(!1),s=(0,u.useRef)(null),_=(0,u.useRef)(null),[d,p]=(0,u.useState)(),[f,h]=(0,u.useState)(!1);(0,u.useEffect)((()=>{if(!c)return;let e;const t=()=>{var n,r;const o=null===(n=s.current)||void 0===n?void 0:n.getBoundingClientRect(),i=null===(r=_.current)||void 0===r?void 0:r.measure();if(o&&i){var a,c;const e=o.bottom+i.height<(null!==(a=null===(c=window.visualViewport)||void 0===c?void 0:c.height)&&void 0!==a?a:0),t=o.top-i.height>0,n=!e&&t;h(n);const r=n?{top:o.top-i.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};p((e=>{return n=r,(null==(t=e)?void 0:t.left)===(null==n?void 0:n.left)&&(null==t?void 0:t.top)===(null==n?void 0:n.top)&&(null==t?void 0:t.width)===(null==n?void 0:n.width)?e:r;var t,n}))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[c]);const m=e=>{const t=window.visualViewport,n=s.current.getBoundingClientRect();l(!0),p({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:n.width}),e.stopPropagation()};let b=(0,E.jsx)(E.Fragment,{children:""});for(let e=0;e<o.length;++e){const n=o[e];if(!t||t(n)){const[e,t]=X(n);if(e===a){b=t;break}}}let w=i.container;c&&(w+=` ${i.active}`);let v=i.select||"";return f&&(w+=` ${i.upward}`,v+=` ${i.upward}`),(0,E.jsxs)("div",{className:w,children:[void 0===n?null:(0,E.jsx)("div",{className:i.label,children:n}),(0,E.jsxs)("div",{className:i.dropdown,onClick:m,onKeyDown:e=>{"Enter"===e.key&&m(e)},ref:s,role:"listbox",tabIndex:0,children:[b,(0,E.jsx)("div",{className:i.arrow})]}),c?(0,E.jsx)(F,{containerClass:v,containerStyle:d,onCancel:()=>{l(!1)},onChange:e=>{l(!1),r&&r(e)},optionClass:i.option||"",options:o,ref:_}):null]})},z=t()($,"CustomDropdown",M,{container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"});$.propTypes={filter:b().func,label:b().node,onChange:b().func,options:b().arrayOf(B.isRequired),theme:z.themeType.isRequired,value:I};var H=z;const G=e=>{let{filter:t,label:n,onChange:r,options:o,theme:i,value:a}=e;if(!o)throw Error("Internal error");let c=!1;const l=[];for(let e=0;e<o.length;++e){const n=o[e];if(!t||t(n)){const[e,t]=X(n);c||(c=e===a),l.push((0,E.jsx)("option",{className:i.option,value:e,children:t},e))}}const s=c?null:(0,E.jsx)("option",{disabled:!0,className:i.hiddenOption,value:a,children:a},"__reactUtilsHiddenOption");return(0,E.jsxs)("div",{className:i.container,children:[void 0===n?null:(0,E.jsx)("div",{className:i.label,children:n}),(0,E.jsxs)("div",{className:i.dropdown,children:[(0,E.jsxs)("select",{className:i.select,onChange:r,value:a,children:[s,l]}),(0,E.jsx)("div",{className:i.arrow})]})]})},V=t()(G,"Dropdown",M,{dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",hiddenOption:"clAKFJ",select:"N0Fc14"});G.propTypes={filter:b().func,label:b().node,onChange:b().func,options:K,theme:V.themeType.isRequired,value:I};var Q=V;const Z=e=>{let{label:t,onChange:n,options:r,theme:o,value:i}=e;if(!r||!o.option)throw Error("Internal error");const a=[];for(let e=0;e<(null==r?void 0:r.length);++e){const[t,c]=X(r[e]);let l,s=o.option;t===i?s+=` ${o.selected}`:n&&(l=()=>n(t)),a.push(l?(0,E.jsx)("div",{className:s,onClick:l,onKeyDown:e=>{l&&"Enter"===e.key&&l()},role:"button",tabIndex:0,children:c},t):(0,E.jsx)("div",{className:s,children:c},t))}return(0,E.jsxs)("div",{className:o.container,children:[t?(0,E.jsx)("div",{className:o.label,children:t}):null,(0,E.jsx)("div",{className:o.options,children:a})]})},J=t()(Z,"Switch",["container","label","option","options","selected"],{container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"});Z.propTypes={label:b().node,onChange:b().func,options:U,theme:J.themeType.isRequired,value:I};var ee=J,te=__webpack_require__(442);const ne=e=>{let{children:t,className:n,disabled:r,enforceA:o,keepScrollPosition:i,onClick:a,onMouseDown:c,openNewTab:l,replace:s,routerLinkType:u,to:_,...d}=e;if(r||o||l||null!=_&&_.match(/^(#|(https?|mailto):)/))return(0,E.jsx)("a",{className:(n?n+" ":"")+"zH52sA",href:_,onClick:r?e=>e.preventDefault():a,onMouseDown:r?e=>e.preventDefault():c,rel:"noopener noreferrer",target:l?"_blank":"",children:t});const p=u;return(0,E.jsx)(p,{className:n,onMouseDown:c,replace:s,to:_,onClick:e=>{a&&a(e),i||window.scroll(0,0)},...d,children:t})};ne.propTypes={children:b().node,className:b().string,disabled:b().bool,enforceA:b().bool,keepScrollPosition:b().bool,onClick:b().func,onMouseDown:b().func,openNewTab:b().bool,replace:b().bool,routerLinkType:b().elementType.isRequired,to:b().oneOfType([b().object,b().string])};var re=ne,oe=e=>(0,E.jsx)(re,{...e,routerLinkType:te.Link});const ie=e=>{let{active:t,children:n,disabled:r,enforceA:o,onClick:i,onMouseDown:a,openNewTab:c,replace:l,theme:s,to:u}=e,_=s.button;return t&&s.active&&(_+=` ${s.active}`),r?(s.disabled&&(_+=` ${s.disabled}`),(0,E.jsx)("div",{className:_,children:n})):u?(0,E.jsx)(oe,{className:_,enforceA:o,onClick:i,onMouseDown:a,openNewTab:c,replace:l,to:u,children:n}):(0,E.jsx)("div",{className:_,onClick:i,onKeyDown:i&&(e=>{"Enter"===e.key&&i(e)}),onMouseDown:a,role:"button",tabIndex:0,children:n})},ae=t()(ie,"Button",["active","button","disabled"],{button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"});ie.propTypes={active:b().bool,children:b().node,disabled:b().bool,enforceA:b().bool,onClick:b().func,onMouseDown:b().func,openNewTab:b().bool,replace:b().bool,theme:ae.themeType.isRequired,to:b().oneOfType([b().object,b().string])};var ce=ae;const le=e=>{let{checked:t,label:n,onChange:r,theme:o}=e;return(0,E.jsxs)("div",{className:o.container,children:[void 0===n?null:(0,E.jsx)("div",{className:o.label,children:n}),(0,E.jsx)("input",{checked:t,className:o.checkbox,onChange:r,onClick:e=>e.stopPropagation(),type:"checkbox"})]})},se=t()(le,"Checkbox",["checkbox","container","label"],{checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",container:"Kr0g3M",label:"_3dML-O"});le.propTypes={checked:b().bool,label:b().node,onChange:b().func,theme:se.themeType.isRequired};var ue=se;const _e=(0,u.forwardRef)(((e,t)=>{let{label:n,theme:r,...o}=e;return(0,E.jsxs)("span",{className:r.container,children:[void 0===n?null:(0,E.jsx)("div",{className:r.label,children:n}),(0,E.jsx)("input",{className:r.input,ref:t,...o})]})})),de=t()(_e,"Input",["container","input","label"],{container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"});_e.propTypes={label:b().node,theme:de.themeType.isRequired};var pe=de;const fe=e=>{let{children:t,leftSidePanelContent:n,rightSidePanelContent:r,theme:o}=e;return(0,E.jsxs)("div",{className:o.container,children:[(0,E.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:n}),(0,E.jsx)("div",{className:o.mainPanel,children:t}),(0,E.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:r})]})},he=t()(fe,"PageLayout",["container","leftSidePanel","mainPanel","rightSidePanel","sidePanel"],{container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"});fe.propTypes={children:b().node,leftSidePanelContent:b().node,rightSidePanelContent:b().node,theme:he.themeType.isRequired};var me=he,be=__webpack_require__(883);const Ee=(0,u.createContext)({description:"",title:""}),we=e=>{let{children:t,description:n,image:r,siteName:o,socialDescription:i,socialTitle:a,title:c,url:l}=e;const s=a||c,_=i||n,d=(0,u.useMemo)((()=>({description:n,image:r,siteName:o,socialDescription:i,socialTitle:a,title:c,url:l})),[n,r,o,i,a,c,l]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(be.Helmet,{children:[(0,E.jsx)("title",{children:c}),(0,E.jsx)("meta",{name:"description",content:n}),(0,E.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,E.jsx)("meta",{name:"twitter:title",content:s}),(0,E.jsx)("meta",{name:"twitter:description",content:_}),r?(0,E.jsx)("meta",{name:"twitter:image",content:r}):null,o?(0,E.jsx)("meta",{name:"twitter:site",content:`@${o}`}):null,(0,E.jsx)("meta",{name:"og:title",content:s}),r?(0,E.jsx)("meta",{name:"og:image",content:r}):null,r?(0,E.jsx)("meta",{name:"og:image:alt",content:s}):null,(0,E.jsx)("meta",{name:"og:description",content:_}),o?(0,E.jsx)("meta",{name:"og:sitename",content:o}):null,l?(0,E.jsx)("meta",{name:"og:url",content:l}):null]}),t?(0,E.jsx)(Ee.Provider,{value:d,children:t}):null]})};we.Context=Ee,we.propTypes={children:b().node,description:b().string.isRequired,image:b().string,siteName:b().string,socialDescription:b().string,socialTitle:b().string,title:b().string.isRequired,url:b().string};var ve=we,ge=e=>(0,E.jsx)(re,{...e,routerLinkType:te.NavLink});const ye=e=>{let{theme:t}=e;return(0,E.jsxs)("span",{className:t.container,children:[(0,E.jsx)("span",{className:t.circle}),(0,E.jsx)("span",{className:t.circle}),(0,E.jsx)("span",{className:t.circle})]})},xe=t()(ye,"Throbber",["bouncing","circle","container"],{container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"});ye.propTypes={theme:xe.themeType.isRequired};var Te=xe;let Ce=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 ke=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),Re=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function Pe(e,t,n,r,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:n,clientWidth:r}}=document;return{left:e,right:e+r,top:t,bottom:t+n}}(),c=function(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:ke}}(e,t,i);if(c.containerX<a.left+6)c.containerX=a.left+6,c.arrowX=Math.max(6,e-c.containerX-i.arrow.width/2);else{const t=a.right-6-i.container.width;c.containerX>t&&(c.containerX=t,c.arrowX=Math.min(i.container.width-6,e-c.containerX-i.arrow.width/2))}c.containerY<a.top+6&&(c.containerY+=i.container.height+2*i.arrow.height,c.arrowY-=i.container.height+i.arrow.height,c.baseArrowStyle=Re);const l=`left:${c.containerX}px;top:${c.containerY}px`;o.container.setAttribute("style",l);const s=`${c.baseArrowStyle};left:${c.arrowX}px;top:${c.arrowY}px`;o.arrow.setAttribute("style",s)}const Se=(0,u.forwardRef)(((e,t)=>{let{children:n,theme:r}=e;const{current:o}=(0,u.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[i,a]=(0,u.useState)(null),c=(e,t,n,r)=>{o.lastElement=r,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=n,i&&Pe(e,t,0,0,i)};return(0,u.useImperativeHandle)(t,(()=>({pointTo:c}))),(0,u.useEffect)((()=>{const e=function(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}}(r);return a(e),()=>{document.body.removeChild(e.container),a(null)}}),[r]),(0,u.useEffect)((()=>{i&&Pe(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,i)}),[i,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),i?(0,q.createPortal)(n,i.content):null}));Se.propTypes={children:b().node,theme:b().shape({}).isRequired};var Oe=Se;const qe=e=>{let{children:t,placement:n=Ce.ABOVE_CURSOR,tip:r,theme:o}=e;const{current:i}=(0,u.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),a=(0,u.useRef)(),c=(0,u.useRef)(null),[l,s]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{if(l&&null!==r){a.current&&a.current.pointTo(i.lastCursorX+window.scrollX,i.lastCursorY+window.scrollY,n,c.current);const e=()=>s(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[i.lastCursorX,i.lastCursorY,n,l,r]),(0,E.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>s(!1),onMouseMove:e=>((e,t)=>{if(l){const r=c.current.getBoundingClientRect();e<r.left||e>r.right||t<r.top||t>r.bottom?s(!1):a.current&&a.current.pointTo(e+window.scrollX,t+window.scrollY,n,c.current)}else i.lastCursorX=e,i.lastCursorY=t,i.triggeredByTouch?i.timerId||(i.timerId=setTimeout((()=>{i.triggeredByTouch=!1,i.timerId=void 0,s(!0)}),300)):s(!0)})(e.clientX,e.clientY),onClick:()=>{i.timerId&&(clearTimeout(i.timerId),i.timerId=void 0,i.triggeredByTouch=!1)},onTouchStart:()=>{i.triggeredByTouch=!0},ref:c,role:"presentation",children:[l&&null!==r?(0,E.jsx)(Oe,{ref:a,theme:o,children:r}):null,t]})},Ae=t()(qe,"WithTooltip",["appearance","arrow","container","content","wrapper"],{arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"}),je=Ae;je.PLACEMENTS=Ce,qe.propTypes={children:b().node,placement:b().oneOf(Object.values(Ce)),theme:Ae.themeType.isRequired,tip:b().node};var Le=je,Ne=__webpack_require__(360),De=__webpack_require__.n(Ne),Me={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const Ie=e=>{var t;let{autoplay:n,src:r,theme:o,title:i}=e;const a=r.split("?");let c=a[0];const l=a[1],s=l?De().parse(l):{},u=s.v||(null===(t=c.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1]);return c=`https://www.youtube.com/embed/${u}`,delete s.v,s.autoplay=n?"1":"0",c+=`?${De().stringify(s)}`,(0,E.jsxs)("div",{className:o.container,children:[(0,E.jsx)(Te,{theme:Me}),(0,E.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:c,title:i})]})},Be=t()(Ie,"YouTubeVideo",["container","video"],{container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"});Ie.propTypes={autoplay:b().bool,src:b().string.isRequired,theme:Be.themeType.isRequired,title:b().string};var Ue=Be;const We=e=>{let{disabled:t,onChange:n,onKeyDown:r,placeholder:o,theme:i,value:a}=e;const c=(0,u.useRef)(null),[l,s]=(0,u.useState)(),[_,d]=(0,u.useState)(a||"");return void 0!==a&&_!==a&&d(a),(0,u.useEffect)((()=>{const e=c.current;if(!e)return;const t=new ResizeObserver((()=>{s(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,u.useEffect)((()=>{const e=c.current;e&&s(e.scrollHeight)}),[_]),(0,E.jsxs)("div",{className:i.container,children:[(0,E.jsx)("textarea",{readOnly:!0,ref:c,className:`${i.textarea} ${i.hidden}`,value:_}),(0,E.jsx)("textarea",{disabled:t,onChange:void 0===a?e=>{d(e.target.value)}:n,onKeyDown:r,placeholder:o,style:{height:l},className:i.textarea,value:_})]})},Ke=t()(We,"TextArea",["container","hidden","textarea"],{container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"});We.propTypes={disabled:b().bool,onChange:b().func,onKeyDown:b().func,placeholder:b().string,theme:Ke.themeType.isRequired,value:b().string};var Xe=Ke;const Ye=r.requireWeak("./server","/");let Fe=Ye?void 0:__webpack_require__(662);Fe&&(Fe.default.setInj=Fe.setInj,Fe=Fe.default)}(),__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("axios"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("prop-types"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","axios","dayjs","node-forge/lib/aes","node-forge/lib/forge","prop-types","qs","react","react-dom","react-dom/client","react-helmet","react-router-dom"],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("axios"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("prop-types"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet"),require("react-router-dom")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.axios,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e["prop-types"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-helmet"],e["react-router-dom"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__742__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__949__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__883__,__WEBPACK_EXTERNAL_MODULE__442__){return function(){"use strict";var __webpack_modules__={227: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__(445);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}},662:function(e,t,n){n.d(t,{A:function(){return l}}),n(155);var r=n(126),o=n(236),i=n(442),a=n(227),c=n(848);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,c.jsx)(r.GlobalStateProvider,{initialState:(0,a.A)().ISTATE||t.initialState,children:(0,c.jsx)(i.BrowserRouter,{future:{v7_relativeSplatPath:!0},children:(0,c.jsx)(e,{})})});t.dontHydrate?(0,o.createRoot)(n).render(l):(0,o.hydrateRoot)(n,l)}},445: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)},965: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},333: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 c},getBuildInfo:function(){return r.F},isDevBuild:function(){return i},isProdBuild:function(){return a}});var r=n(445),o=n(965);function i(){return!1}function a(){return!0}function c(){return(0,r.F)().timestamp}},969: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__(333);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,{default:def,...named}=eval("require")(path);return def?(Object.entries(named).forEach((e=>{let[t,n]=e;if(def[t]){if(def[t]!==n)throw Error("Conflict between default and named exports")}else def[t]=n})),def):named}catch{return null}}function resolveWeak(e){return e}},427:function(e,t){t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=(t||{}).decode||o,i=0;i<e.length;){var c=e.indexOf("=",i);if(-1===c)break;var l=e.indexOf(";",i);if(-1===l)l=e.length;else if(l<c){i=e.lastIndexOf(";",c-1)+1;continue}var s=e.slice(i,c).trim();if(void 0===n[s]){var u=e.slice(c+1,l).trim();34===u.charCodeAt(0)&&(u=u.slice(1,-1)),n[s]=a(u,r)}i=l+1}return n},t.serialize=function(e,t,o){var a=o||{},c=a.encode||i;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!r.test(e))throw new TypeError("argument name is invalid");var l=c(t);if(l&&!r.test(l))throw new TypeError("argument val is invalid");var s=e+"="+l;if(null!=a.maxAge){var u=a.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(u)}if(a.domain){if(!r.test(a.domain))throw new TypeError("option domain is invalid");s+="; Domain="+a.domain}if(a.path){if(!r.test(a.path))throw new TypeError("option path is invalid");s+="; Path="+a.path}if(a.expires){var _=a.expires;if(!function(e){return"[object Date]"===n.call(e)||e instanceof Date}(_)||isNaN(_.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+_.toUTCString()}if(a.httpOnly&&(s+="; HttpOnly"),a.secure&&(s+="; Secure"),a.partitioned&&(s+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s};var n=Object.prototype.toString,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}function a(e,t){try{return t(e)}catch(t){return e}}},20:function(e,t,n){var r=n(155),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,u=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:s,ref:u,props:i,_owner:c.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},848:function(e,t,n){e.exports=n(20)},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__},742:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__742__},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__},949:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__949__},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__},883:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__883__},442:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__442__}},__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__={};return function(){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return _.Barrier},BaseButton:function(){return oe},BaseModal:function(){return L},Button:function(){return ae},Checkbox:function(){return se},CustomDropdown:function(){return z},Dropdown:function(){return V},Emitter:function(){return _.Emitter},GlobalStateProvider:function(){return d.GlobalStateProvider},Input:function(){return de},Link:function(){return re},MetaTags:function(){return we},Modal:function(){return j},NavLink:function(){return ve},PT:function(){return m},PageLayout:function(){return he},Semaphore:function(){return _.Semaphore},Switch:function(){return Q},TextArea:function(){return Ke},ThemeProvider:function(){return e.ThemeProvider},Throbber:function(){return xe},WithTooltip:function(){return Le},YouTubeVideo:function(){return Be},api:function(){return P()},client:function(){return Ye},config:function(){return i},getGlobalState:function(){return d.getGlobalState},getSsrContext:function(){return p},isomorphy:function(){return a},newAsyncDataEnvelope:function(){return d.newAsyncDataEnvelope},optionValidator:function(){return I},optionsValidator:function(){return B},server:function(){return Xe},splitComponent:function(){return R},themed:function(){return k},time:function(){return h},useAsyncCollection:function(){return d.useAsyncCollection},useAsyncData:function(){return d.useAsyncData},useGlobalState:function(){return d.useGlobalState},webpack:function(){return r},withGlobalStateType:function(){return d.withGlobalStateType},withRetries:function(){return _.withRetries}});var e=__webpack_require__(859),t=__webpack_require__.n(e),n=__webpack_require__(965),r=__webpack_require__(969);const o=(n.B?__webpack_require__(227).A().CONFIG:(0,r.requireWeak)("config"))||{};if(n.B&&"undefined"!=typeof document){const e=__webpack_require__(427);o.CSRF=e.parse(document.cookie).csrfToken}var i=o,a=__webpack_require__(333),c=__webpack_require__(427),l=__webpack_require__(185),s=__webpack_require__.n(l),u=__webpack_require__(155),_=__webpack_require__(864),d=__webpack_require__(126);const{getSsrContext:p}=(0,d.withGlobalStateType)(),f={DAY_MS:_.DAY_MS,HOUR_MS:_.HOUR_MS,MIN_MS:_.MIN_MS,SEC_MS:_.SEC_MS,YEAR_MS:_.YEAR_MS,now:Date.now,timer:_.timer,useCurrent:function(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[r,o]=(0,d.useGlobalState)(t,Date.now);return(0,u.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},useTimezoneOffset:function(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=p(!1),[r,o]=(0,d.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,u.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=c.serialize(e,t.toString(),{path:"/"}))}),[e,o]),r}};var h=Object.assign(s(),f),m=__webpack_require__(949),E=__webpack_require__.n(m),b=__webpack_require__(848);let w;a.IS_CLIENT_SIDE&&(w=__webpack_require__(227).A().CHUNK_GROUPS||{});const v={};function g(){return(0,a.getBuildInfo)().publicPath}function y(e,t,n){let r;const o=`${g()}/${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)),r=new _.Barrier,e.addEventListener("load",(()=>r.resolve())),e.addEventListener("error",(()=>r.resolve()))}if(n){const e=v[o]||0;v[o]=1+e}return r}function x(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function T(e,t,n){const r=[],o=t[e],i=function(){const e=new Set,{styleSheets:t}=document;for(let n=0;n<t.length;++n){const{href:r}=t[n];r&&e.add(r)}return e}();for(let e=0;e<o.length;++e){const t=o[e];if(t.endsWith(".css")){const e=y(t,i,n);e&&r.push(e)}}return r.length?Promise.allSettled(r).then():Promise.resolve()}const C=new Set;function R(e){let{chunkName:t,getComponent:n,placeholder:r}=e;if(a.IS_CLIENT_SIDE&&x(t,w),C.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);C.add(t);const o=(0,u.lazy)((async()=>{const e=await n(),r="default"in e?e.default:e;a.IS_CLIENT_SIDE&&await T(t,w,!1);const o=(0,u.forwardRef)(((e,n)=>{let{children:o,...i}=e;if(a.IS_SERVER_SIDE){const{chunkGroups:e,chunks:n}=p();x(t,e),n.includes(t)||n.push(t)}return(0,u.useInsertionEffect)((()=>(T(t,w,!0),()=>function(e,t){const n=t[e];for(let e=0;e<n.length;++e){const t=n[e];if(t.endsWith(".css")){const e=`${g()}/${t}`;--v[e]<=0&&document.head.querySelector(`link[href="${e}"]`).remove()}}}(t,w))),[]),(0,b.jsx)(r,{ref:n,...i,children:o})}));return{default:o}})),i=e=>{let{children:t,...n}=e;return(0,b.jsx)(u.Suspense,{fallback:r,children:(0,b.jsx)(o,{...n,children:t})})};return i.propTypes={children:E().node},i}const k=t();k.COMPOSE=e.COMPOSE,k.PRIORITY=e.PRIORITY;var S=__webpack_require__(742),P=__webpack_require__.n(S),O=__webpack_require__(514),A=__webpack_require__.n(O),q="_5fRFtF";const L=e=>{let{cancelOnScrolling:t,children:n,containerStyle:r,dontDisableScrolling:o,onCancel:i,theme:a}=e;const c=(0,u.useRef)(null),l=(0,u.useRef)(null),[s,_]=(0,u.useState)();(0,u.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),_(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(q),()=>{o||document.body.classList.remove(q)})),[o]);const d=(0,u.useMemo)((()=>(0,b.jsx)("div",{onFocus:()=>{var e,t;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=n.length-1;e>=0;--e)if(n[e].focus(),document.activeElement===n[e])return;null===(t=l.current)||void 0===t||t.focus()},tabIndex:0})),[]);return s?A().createPortal((0,b.jsxs)(b.Fragment,{children:[d,(0,b.jsx)("div",{"aria-label":"Cancel",className:a.overlay,onClick:e=>{i&&(i(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&i&&(i(),e.stopPropagation())},ref:e=>{e&&e!==l.current&&(l.current=e,e.focus())},role:"button",tabIndex:0}),(0,b.jsx)("div",{"aria-modal":"true",className:a.container,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:c,role:"dialog",style:r,children:n}),(0,b.jsx)("div",{onFocus:()=>{var e;null===(e=l.current)||void 0===e||e.focus()},tabIndex:0}),d]}),s):null},N=t()(L,"Modal",["container","overlay"],{overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"});L.propTypes={cancelOnScrolling:E().bool,children:E().node,containerStyle:E().shape({}),dontDisableScrolling:E().bool,onCancel:E().func,theme:N.themeType.isRequired};var j=N;const D=["active","arrow","container","dropdown","hiddenOption","label","option","select","upward"],M=E().oneOfType([E().number.isRequired,E().string.isRequired]),I=E().oneOfType([E().shape({name:E().node,value:M.isRequired}).isRequired,E().number.isRequired,E().string.isRequired]),B=E().arrayOf(I.isRequired),U=E().oneOfType([E().shape({name:E().string,value:M.isRequired}).isRequired,E().number.isRequired,E().string.isRequired]),W=E().arrayOf(U.isRequired);function K(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]}const X=(0,u.forwardRef)(((e,t)=>{let{containerClass:n,containerStyle:r,filter:o,onCancel:i,onChange:a,optionClass:c,options:l}=e;const s=(0,u.useRef)(null);(0,u.useImperativeHandle)(t,(()=>({measure:()=>{var e,t;const n=null===(e=s.current)||void 0===e?void 0:e.parentElement;if(!n)return;const r=null===(t=s.current)||void 0===t?void 0:t.getBoundingClientRect(),o=window.getComputedStyle(n),i=parseFloat(o.marginBottom),a=parseFloat(o.marginTop);return r.height+=i+a,r}})),[]);const _=[];for(let e=0;e<l.length;++e){const t=l[e];if(!o||o(t)){const[e,n]=K(t);_.push((0,b.jsx)("div",{className:c,onClick:t=>{a(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(a(e),t.stopPropagation())},role:"button",tabIndex:0,children:n},e))}}return(0,b.jsx)(L,{cancelOnScrolling:!0,containerStyle:r,dontDisableScrolling:!0,onCancel:i,theme:{ad:"",hoc:"",container:n,context:"",overlay:"jKsMKG"},children:(0,b.jsx)("div",{ref:s,children:_})})}));X.propTypes={containerClass:E().string.isRequired,containerStyle:E().shape({left:E().number.isRequired,top:E().number.isRequired,width:E().number.isRequired}),filter:E().func,onCancel:E().func.isRequired,onChange:E().func.isRequired,optionClass:E().string.isRequired,options:B.isRequired};var Y=X;const F=e=>{let{filter:t,label:n,onChange:r,options:o,theme:i,value:a}=e;if(!o)throw Error("Internal error");const[c,l]=(0,u.useState)(!1),s=(0,u.useRef)(null),_=(0,u.useRef)(null),[d,p]=(0,u.useState)(),[f,h]=(0,u.useState)(!1);(0,u.useEffect)((()=>{if(!c)return;let e;const t=()=>{var n,r;const o=null===(n=s.current)||void 0===n?void 0:n.getBoundingClientRect(),i=null===(r=_.current)||void 0===r?void 0:r.measure();if(o&&i){var a,c;const e=o.bottom+i.height<(null!==(a=null===(c=window.visualViewport)||void 0===c?void 0:c.height)&&void 0!==a?a:0),t=o.top-i.height>0,n=!e&&t;h(n);const r=n?{top:o.top-i.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};p((e=>{return n=r,(null==(t=e)?void 0:t.left)===(null==n?void 0:n.left)&&(null==t?void 0:t.top)===(null==n?void 0:n.top)&&(null==t?void 0:t.width)===(null==n?void 0:n.width)?e:r;var t,n}))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[c]);const m=e=>{const t=window.visualViewport,n=s.current.getBoundingClientRect();l(!0),p({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:n.width}),e.stopPropagation()};let E=(0,b.jsx)(b.Fragment,{children:""});for(let e=0;e<o.length;++e){const n=o[e];if(!t||t(n)){const[e,t]=K(n);if(e===a){E=t;break}}}let w=i.container;c&&(w+=` ${i.active}`);let v=i.select||"";return f&&(w+=` ${i.upward}`,v+=` ${i.upward}`),(0,b.jsxs)("div",{className:w,children:[void 0===n?null:(0,b.jsx)("div",{className:i.label,children:n}),(0,b.jsxs)("div",{className:i.dropdown,onClick:m,onKeyDown:e=>{"Enter"===e.key&&m(e)},ref:s,role:"listbox",tabIndex:0,children:[E,(0,b.jsx)("div",{className:i.arrow})]}),c?(0,b.jsx)(Y,{containerClass:v,containerStyle:d,onCancel:()=>{l(!1)},onChange:e=>{l(!1),r&&r(e)},optionClass:i.option||"",options:o,ref:_}):null]})},$=t()(F,"CustomDropdown",D,{container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"});F.propTypes={filter:E().func,label:E().node,onChange:E().func,options:E().arrayOf(I.isRequired),theme:$.themeType.isRequired,value:M};var z=$;const H=e=>{let{filter:t,label:n,onChange:r,options:o,theme:i,value:a}=e;if(!o)throw Error("Internal error");let c=!1;const l=[];for(let e=0;e<o.length;++e){const n=o[e];if(!t||t(n)){const[e,t]=K(n);c||(c=e===a),l.push((0,b.jsx)("option",{className:i.option,value:e,children:t},e))}}const s=c?null:(0,b.jsx)("option",{disabled:!0,className:i.hiddenOption,value:a,children:a},"__reactUtilsHiddenOption");return(0,b.jsxs)("div",{className:i.container,children:[void 0===n?null:(0,b.jsx)("div",{className:i.label,children:n}),(0,b.jsxs)("div",{className:i.dropdown,children:[(0,b.jsxs)("select",{className:i.select,onChange:r,value:a,children:[s,l]}),(0,b.jsx)("div",{className:i.arrow})]})]})},G=t()(H,"Dropdown",D,{dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",hiddenOption:"clAKFJ",select:"N0Fc14"});H.propTypes={filter:E().func,label:E().node,onChange:E().func,options:W,theme:G.themeType.isRequired,value:M};var V=G;const Z=e=>{let{label:t,onChange:n,options:r,theme:o,value:i}=e;if(!r||!o.option)throw Error("Internal error");const a=[];for(let e=0;e<(null==r?void 0:r.length);++e){const[t,c]=K(r[e]);let l,s=o.option;t===i?s+=` ${o.selected}`:n&&(l=()=>n(t)),a.push(l?(0,b.jsx)("div",{className:s,onClick:l,onKeyDown:e=>{l&&"Enter"===e.key&&l()},role:"button",tabIndex:0,children:c},t):(0,b.jsx)("div",{className:s,children:c},t))}return(0,b.jsxs)("div",{className:o.container,children:[t?(0,b.jsx)("div",{className:o.label,children:t}):null,(0,b.jsx)("div",{className:o.options,children:a})]})},J=t()(Z,"Switch",["container","label","option","options","selected"],{container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"});Z.propTypes={label:E().node,onChange:E().func,options:B,theme:J.themeType.isRequired,value:M};var Q=J,ee=__webpack_require__(442);const te=e=>{let{children:t,className:n,disabled:r,enforceA:o,keepScrollPosition:i,onClick:a,onMouseDown:c,openNewTab:l,replace:s,routerLinkType:u,to:_,...d}=e;if(r||o||l||null!=_&&_.match(/^(#|(https?|mailto):)/))return(0,b.jsx)("a",{className:(n?n+" ":"")+"zH52sA",href:_,onClick:r?e=>e.preventDefault():a,onMouseDown:r?e=>e.preventDefault():c,rel:"noopener noreferrer",target:l?"_blank":"",children:t});const p=u;return(0,b.jsx)(p,{className:n,onMouseDown:c,replace:s,to:_,onClick:e=>{a&&a(e),i||window.scroll(0,0)},...d,children:t})};te.propTypes={children:E().node,className:E().string,disabled:E().bool,enforceA:E().bool,keepScrollPosition:E().bool,onClick:E().func,onMouseDown:E().func,openNewTab:E().bool,replace:E().bool,routerLinkType:E().elementType.isRequired,to:E().oneOfType([E().object,E().string])};var ne=te,re=e=>(0,b.jsx)(ne,{...e,routerLinkType:ee.Link});const oe=e=>{let{active:t,children:n,disabled:r,enforceA:o,onClick:i,onMouseDown:a,openNewTab:c,replace:l,theme:s,to:u}=e,_=s.button;return t&&s.active&&(_+=` ${s.active}`),r?(s.disabled&&(_+=` ${s.disabled}`),(0,b.jsx)("div",{className:_,children:n})):u?(0,b.jsx)(re,{className:_,enforceA:o,onClick:i,onMouseDown:a,openNewTab:c,replace:l,to:u,children:n}):(0,b.jsx)("div",{className:_,onClick:i,onKeyDown:i&&(e=>{"Enter"===e.key&&i(e)}),onMouseDown:a,role:"button",tabIndex:0,children:n})},ie=t()(oe,"Button",["active","button","disabled"],{button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"});oe.propTypes={active:E().bool,children:E().node,disabled:E().bool,enforceA:E().bool,onClick:E().func,onMouseDown:E().func,openNewTab:E().bool,replace:E().bool,theme:ie.themeType.isRequired,to:E().oneOfType([E().object,E().string])};var ae=ie;const ce=e=>{let{checked:t,label:n,onChange:r,theme:o}=e;return(0,b.jsxs)("div",{className:o.container,children:[void 0===n?null:(0,b.jsx)("div",{className:o.label,children:n}),(0,b.jsx)("input",{checked:t,className:o.checkbox,onChange:r,onClick:e=>e.stopPropagation(),type:"checkbox"})]})},le=t()(ce,"Checkbox",["checkbox","container","label"],{checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",container:"Kr0g3M",label:"_3dML-O"});ce.propTypes={checked:E().bool,label:E().node,onChange:E().func,theme:le.themeType.isRequired};var se=le;const ue=(0,u.forwardRef)(((e,t)=>{let{label:n,theme:r,...o}=e;return(0,b.jsxs)("span",{className:r.container,children:[void 0===n?null:(0,b.jsx)("div",{className:r.label,children:n}),(0,b.jsx)("input",{className:r.input,ref:t,...o})]})})),_e=t()(ue,"Input",["container","input","label"],{container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"});ue.propTypes={label:E().node,theme:_e.themeType.isRequired};var de=_e;const pe=e=>{let{children:t,leftSidePanelContent:n,rightSidePanelContent:r,theme:o}=e;return(0,b.jsxs)("div",{className:o.container,children:[(0,b.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:n}),(0,b.jsx)("div",{className:o.mainPanel,children:t}),(0,b.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:r})]})},fe=t()(pe,"PageLayout",["container","leftSidePanel","mainPanel","rightSidePanel","sidePanel"],{container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"});pe.propTypes={children:E().node,leftSidePanelContent:E().node,rightSidePanelContent:E().node,theme:fe.themeType.isRequired};var he=fe,me=__webpack_require__(883);const Ee=(0,u.createContext)({description:"",title:""}),be=e=>{let{children:t,description:n,image:r,siteName:o,socialDescription:i,socialTitle:a,title:c,url:l}=e;const s=a||c,_=i||n,d=(0,u.useMemo)((()=>({description:n,image:r,siteName:o,socialDescription:i,socialTitle:a,title:c,url:l})),[n,r,o,i,a,c,l]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(me.Helmet,{children:[(0,b.jsx)("title",{children:c}),(0,b.jsx)("meta",{name:"description",content:n}),(0,b.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,b.jsx)("meta",{name:"twitter:title",content:s}),(0,b.jsx)("meta",{name:"twitter:description",content:_}),r?(0,b.jsx)("meta",{name:"twitter:image",content:r}):null,o?(0,b.jsx)("meta",{name:"twitter:site",content:`@${o}`}):null,(0,b.jsx)("meta",{name:"og:title",content:s}),r?(0,b.jsx)("meta",{name:"og:image",content:r}):null,r?(0,b.jsx)("meta",{name:"og:image:alt",content:s}):null,(0,b.jsx)("meta",{name:"og:description",content:_}),o?(0,b.jsx)("meta",{name:"og:sitename",content:o}):null,l?(0,b.jsx)("meta",{name:"og:url",content:l}):null]}),t?(0,b.jsx)(Ee.Provider,{value:d,children:t}):null]})};be.Context=Ee,be.propTypes={children:E().node,description:E().string.isRequired,image:E().string,siteName:E().string,socialDescription:E().string,socialTitle:E().string,title:E().string.isRequired,url:E().string};var we=be,ve=e=>(0,b.jsx)(ne,{...e,routerLinkType:ee.NavLink});const ge=e=>{let{theme:t}=e;return(0,b.jsxs)("span",{className:t.container,children:[(0,b.jsx)("span",{className:t.circle}),(0,b.jsx)("span",{className:t.circle}),(0,b.jsx)("span",{className:t.circle})]})},ye=t()(ge,"Throbber",["bouncing","circle","container"],{container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"});ge.propTypes={theme:ye.themeType.isRequired};var xe=ye;let Te=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 Ce=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),Re=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function ke(e,t,n,r,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:n,clientWidth:r}}=document;return{left:e,right:e+r,top:t,bottom:t+n}}(),c=function(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:Ce}}(e,t,i);if(c.containerX<a.left+6)c.containerX=a.left+6,c.arrowX=Math.max(6,e-c.containerX-i.arrow.width/2);else{const t=a.right-6-i.container.width;c.containerX>t&&(c.containerX=t,c.arrowX=Math.min(i.container.width-6,e-c.containerX-i.arrow.width/2))}c.containerY<a.top+6&&(c.containerY+=i.container.height+2*i.arrow.height,c.arrowY-=i.container.height+i.arrow.height,c.baseArrowStyle=Re);const l=`left:${c.containerX}px;top:${c.containerY}px`;o.container.setAttribute("style",l);const s=`${c.baseArrowStyle};left:${c.arrowX}px;top:${c.arrowY}px`;o.arrow.setAttribute("style",s)}const Se=(0,u.forwardRef)(((e,t)=>{let{children:n,theme:r}=e;const{current:o}=(0,u.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[i,a]=(0,u.useState)(null),c=(e,t,n,r)=>{o.lastElement=r,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=n,i&&ke(e,t,0,0,i)};return(0,u.useImperativeHandle)(t,(()=>({pointTo:c}))),(0,u.useEffect)((()=>{const e=function(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}}(r);return a(e),()=>{document.body.removeChild(e.container),a(null)}}),[r]),(0,u.useEffect)((()=>{i&&ke(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,i)}),[i,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),i?(0,O.createPortal)(n,i.content):null}));Se.propTypes={children:E().node,theme:E().shape({}).isRequired};var Pe=Se;const Oe=e=>{let{children:t,placement:n=Te.ABOVE_CURSOR,tip:r,theme:o}=e;const{current:i}=(0,u.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),a=(0,u.useRef)(),c=(0,u.useRef)(null),[l,s]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{if(l&&null!==r){a.current&&a.current.pointTo(i.lastCursorX+window.scrollX,i.lastCursorY+window.scrollY,n,c.current);const e=()=>s(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[i.lastCursorX,i.lastCursorY,n,l,r]),(0,b.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>s(!1),onMouseMove:e=>((e,t)=>{if(l){const r=c.current.getBoundingClientRect();e<r.left||e>r.right||t<r.top||t>r.bottom?s(!1):a.current&&a.current.pointTo(e+window.scrollX,t+window.scrollY,n,c.current)}else i.lastCursorX=e,i.lastCursorY=t,i.triggeredByTouch?i.timerId||(i.timerId=setTimeout((()=>{i.triggeredByTouch=!1,i.timerId=void 0,s(!0)}),300)):s(!0)})(e.clientX,e.clientY),onClick:()=>{i.timerId&&(clearTimeout(i.timerId),i.timerId=void 0,i.triggeredByTouch=!1)},onTouchStart:()=>{i.triggeredByTouch=!0},ref:c,role:"presentation",children:[l&&null!==r?(0,b.jsx)(Pe,{ref:a,theme:o,children:r}):null,t]})},Ae=t()(Oe,"WithTooltip",["appearance","arrow","container","content","wrapper"],{arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"}),qe=Ae;qe.PLACEMENTS=Te,Oe.propTypes={children:E().node,placement:E().oneOf(Object.values(Te)),theme:Ae.themeType.isRequired,tip:E().node};var Le=qe,Ne=__webpack_require__(360),je=__webpack_require__.n(Ne),De={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const Me=e=>{var t;let{autoplay:n,src:r,theme:o,title:i}=e;const a=r.split("?");let c=a[0];const l=a[1],s=l?je().parse(l):{},u=s.v||(null===(t=c.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1]);return c=`https://www.youtube.com/embed/${u}`,delete s.v,s.autoplay=n?"1":"0",c+=`?${je().stringify(s)}`,(0,b.jsxs)("div",{className:o.container,children:[(0,b.jsx)(xe,{theme:De}),(0,b.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:c,title:i})]})},Ie=t()(Me,"YouTubeVideo",["container","video"],{container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"});Me.propTypes={autoplay:E().bool,src:E().string.isRequired,theme:Ie.themeType.isRequired,title:E().string};var Be=Ie;const Ue=e=>{let{disabled:t,onChange:n,onKeyDown:r,placeholder:o,theme:i,value:a}=e;const c=(0,u.useRef)(null),[l,s]=(0,u.useState)(),[_,d]=(0,u.useState)(a||"");return void 0!==a&&_!==a&&d(a),(0,u.useEffect)((()=>{const e=c.current;if(!e)return;const t=new ResizeObserver((()=>{s(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,u.useEffect)((()=>{const e=c.current;e&&s(e.scrollHeight)}),[_]),(0,b.jsxs)("div",{className:i.container,children:[(0,b.jsx)("textarea",{readOnly:!0,ref:c,className:`${i.textarea} ${i.hidden}`,value:_}),(0,b.jsx)("textarea",{disabled:t,onChange:void 0===a?e=>{d(e.target.value)}:n,onKeyDown:r,placeholder:o,style:{height:l},className:i.textarea,value:_})]})},We=t()(Ue,"TextArea",["container","hidden","textarea"],{container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"});Ue.propTypes={disabled:E().bool,onChange:E().func,onKeyDown:E().func,placeholder:E().string,theme:We.themeType.isRequired,value:E().string};var Ke=We;const Xe=r.requireWeak("./server","/"),Ye=Xe?void 0:__webpack_require__(662).A}(),__webpack_exports__}()}));
|
|
3
3
|
//# sourceMappingURL=web.bundle.js.map
|