@argon-router/react 0.1.0
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/LICENSE.MD +21 -0
- package/README.md +0 -0
- package/dist/index.cjs +30 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +688 -0
- package/package.json +64 -0
package/LICENSE.MD
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Edward Gigolaev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
File without changes
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),re=require("effector-react");var ee={exports:{}},$={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Se;function pr(){if(Se)return $;Se=1;var d=K,g=Symbol.for("react.element"),E=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,v=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function h(m,s,x){var b,O={},S=null,V=null;x!==void 0&&(S=""+x),s.key!==void 0&&(S=""+s.key),s.ref!==void 0&&(V=s.ref);for(b in s)y.call(s,b)&&!w.hasOwnProperty(b)&&(O[b]=s[b]);if(m&&m.defaultProps)for(b in s=m.defaultProps,s)O[b]===void 0&&(O[b]=s[b]);return{$$typeof:g,type:m,key:S,ref:V,props:O,_owner:v.current}}return $.Fragment=E,$.jsx=h,$.jsxs=h,$}var L={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var je;function yr(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var d=K,g=Symbol.for("react.element"),E=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),m=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),te=Symbol.iterator,ke="@@iterator";function De(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[ke];return typeof r=="function"?r:null}var k=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ae=!1,Ie=!1,We=!1,$e=!1,Le=!1,ne;ne=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===w||Le||e===v||e===x||e===b||$e||e===V||Ae||Ie||We||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===O||e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===ne||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ae(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case E:return"Portal";case w:return"Profiler";case v:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ae(r)+".Consumer";case h:var t=e;return ae(t._context)+".Provider";case s:return Ye(e,e.render,"ForwardRef");case O:var n=e.displayName||null;return n!==null?n:T(e.type)||"Memo";case S:{var i=e,u=i._payload,o=i._init;try{return T(o(u))}catch{return null}}}return null}var j=Object.assign,A=0,oe,ie,ue,se,fe,le,ce;function de(){}de.__reactDisabledLog=!0;function Ue(){{if(A===0){oe=console.log,ie=console.info,ue=console.warn,se=console.error,fe=console.group,le=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Me(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:oe}),info:j({},e,{value:ie}),warn:j({},e,{value:ue}),error:j({},e,{value:se}),group:j({},e,{value:fe}),groupCollapsed:j({},e,{value:le}),groupEnd:j({},e,{value:ce})})}A<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,B;function Y(e,r,t){{if(B===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
|
|
18
|
+
`+B+e}}var J=!1,U;{var Ne=typeof WeakMap=="function"?WeakMap:Map;U=new Ne}function ve(e,r){if(!e||J)return"";{var t=U.get(e);if(t!==void 0)return t}var n;J=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=q.current,q.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(R){n=R}Reflect.construct(e,[],o)}else{try{o.call()}catch(R){n=R}e.call(o.prototype)}}else{try{throw Error()}catch(R){n=R}e()}}catch(R){if(R&&n&&typeof R.stack=="string"){for(var a=R.stack.split(`
|
|
19
|
+
`),p=n.stack.split(`
|
|
20
|
+
`),f=a.length-1,l=p.length-1;f>=1&&l>=0&&a[f]!==p[l];)l--;for(;f>=1&&l>=0;f--,l--)if(a[f]!==p[l]){if(f!==1||l!==1)do if(f--,l--,l<0||a[f]!==p[l]){var _=`
|
|
21
|
+
`+a[f].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,_),_}while(f>=1&&l>=0);break}}}finally{J=!1,q.current=u,Me(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",C=F?Y(F):"";return typeof e=="function"&&U.set(e,C),C}function Ke(e,r,t){return ve(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,qe(e));if(typeof e=="string")return Y(e);switch(e){case x:return Y("Suspense");case b:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return Ke(e.render);case O:return M(e.type,r,t);case S:{var n=e,i=n._payload,u=n._init;try{return M(u(i),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,pe={},ye=k.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Be(e,r,t,n,i){{var u=Function.call.bind(I);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){a=f}a&&!(a instanceof Error)&&(N(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),N(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,N(i),c("Failed %s type: %s",t,a.message),N(null))}}}var Je=Array.isArray;function G(e){return Je(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return Re(e),!1}catch{return!0}}function Re(e){return""+e}function ge(e){if(ze(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),Re(e)}var W=k.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},he,be,z;z={};function He(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&W.current&&r&&W.current.stateNode!==r){var t=T(W.current.type);z[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(W.current.type),e.ref),z[t]=!0)}}function er(e,r){{var t=function(){he||(he=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){be||(be=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,i,u,o){var a={$$typeof:g,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(ge(t),a=""+t),Ze(r)&&(ge(r.key),a=""+r.key),He(r)&&(p=r.ref,Qe(r,i));for(u in r)I.call(r,u)&&!Xe.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var f=e.defaultProps;for(u in f)o[u]===void 0&&(o[u]=f[u])}if(a||p){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(o,l),p&&rr(o,l)}return tr(e,a,p,i,n,W.current,o)}}var X=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function _e(){{if(X.current){var e=T(X.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var me={};function or(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+T(e._owner.type)+"."),D(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Te(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&we(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=De(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Z(o.value)&&we(o.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===s||r.$$typeof===O))t=r.propTypes;else return;if(t){var n=T(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var i=T(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Oe={};function Pe(e,r,t,n,i,u){{var o=Ve(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=ar();p?a+=p:a+=_e();var f;e===null?f="null":G(e)?f="array":e!==void 0&&e.$$typeof===g?(f="<"+(T(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,a)}var l=nr(e,r,t,i,u);if(l==null)return l;if(o){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Te(_[F],e);Object.freeze&&Object.freeze(_)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(_,e)}if(I.call(r,"key")){var C=T(e),R=Object.keys(r).filter(function(vr){return vr!=="key"}),Q=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[C+Q]){var dr=R.length>0?"{"+R.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,Q,C,dr,C),Oe[C+Q]=!0}}return e===y?ur(l):ir(l),l}}function sr(e,r,t){return Pe(e,r,t,!0)}function fr(e,r,t){return Pe(e,r,t,!1)}var lr=fr,cr=sr;L.Fragment=y,L.jsx=lr,L.jsxs=cr}()),L}process.env.NODE_ENV==="production"?ee.exports=pr():ee.exports=yr();var P=ee.exports;const Ce=K.createContext(null),Rr=d=>P.jsx(Ce.Provider,{value:d.router,children:d.children});function xe(){const d=K.useContext(Ce);if(!d)throw new Error("[useRouter] Router not found. Insert RouterProvider in app root");return d}function gr(d){const{to:g,params:E,onClick:y,...v}=d,h=xe().mappedRoutes.find(({route:s})=>s===g),{onOpen:m}=re.useUnit(g);if(!h)throw new Error("[Link] Route not found. Maybe it is not passed into createRouter?");return P.jsx("a",{...v,href:h.toPath(E??void 0),onClick:s=>{y==null||y(s),!s.defaultPrevented&&(v.target&&v.target!=="_self"||s.metaKey||s.altKey||s.ctrlKey||s.shiftKey||(s.preventDefault(),m({params:E||{}})))}})}const hr=d=>()=>{const{view:g,layout:E,route:y}=d,{isOpened:v}=re.useUnit(y);return v?E?P.jsx(E,{children:P.jsx(g,{})}):P.jsx(g,{}):null},br=d=>{const{routes:g,otherwise:E}=d;return()=>{const y=g.map(({route:v,view:w,layout:h})=>{const{isOpened:m}=re.useUnit(v);return{view:w,layout:h,isOpened:m}});for(const v of y){if(!v.isOpened)continue;const{view:w,layout:h}=v;return h?P.jsx(h,{children:P.jsx(w,{})}):P.jsx(w,{})}return E?P.jsx(E,{}):null}};exports.Link=gr;exports.RouterProvider=Rr;exports.createRouteView=hr;exports.createRoutesView=br;exports.useRouter=xe;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { Route } from '@argon-router/core';
|
|
6
|
+
import { Router } from '@argon-router/core';
|
|
7
|
+
|
|
8
|
+
declare type AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
|
|
9
|
+
|
|
10
|
+
export declare const createRoutesView: (props: CreateRoutesViewProps) => () => JSX_2.Element | null;
|
|
11
|
+
|
|
12
|
+
declare interface CreateRoutesViewProps {
|
|
13
|
+
routes: CreateRouteViewProps[];
|
|
14
|
+
otherwise?: ComponentType;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare const createRouteView: (props: CreateRouteViewProps) => () => JSX_2.Element | null;
|
|
18
|
+
|
|
19
|
+
declare interface CreateRouteViewProps {
|
|
20
|
+
route: Route<any>;
|
|
21
|
+
view: ComponentType;
|
|
22
|
+
layout?: ComponentType<{
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare function Link<Params = void>(props: LinkProps<Params>): JSX_2.Element;
|
|
28
|
+
|
|
29
|
+
declare interface LinkProps<Params> extends AnchorProps {
|
|
30
|
+
to: Route<Params>;
|
|
31
|
+
params: Params;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare const RouterProvider: (props: RouterProviderProps) => JSX_2.Element;
|
|
36
|
+
|
|
37
|
+
declare interface RouterProviderProps {
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
router: Router;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare function useRouter(): Router;
|
|
43
|
+
|
|
44
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import Ce, { createContext as vr, useContext as pr } from "react";
|
|
2
|
+
import { useUnit as ee } from "effector-react";
|
|
3
|
+
var Q = { exports: {} }, $ = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var Pe;
|
|
14
|
+
function yr() {
|
|
15
|
+
if (Pe) return $;
|
|
16
|
+
Pe = 1;
|
|
17
|
+
var d = Ce, g = Symbol.for("react.element"), E = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, v = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function R(m, s, x) {
|
|
19
|
+
var b, O = {}, j = null, L = null;
|
|
20
|
+
x !== void 0 && (j = "" + x), s.key !== void 0 && (j = "" + s.key), s.ref !== void 0 && (L = s.ref);
|
|
21
|
+
for (b in s) y.call(s, b) && !T.hasOwnProperty(b) && (O[b] = s[b]);
|
|
22
|
+
if (m && m.defaultProps) for (b in s = m.defaultProps, s) O[b] === void 0 && (O[b] = s[b]);
|
|
23
|
+
return { $$typeof: g, type: m, key: j, ref: L, props: O, _owner: v.current };
|
|
24
|
+
}
|
|
25
|
+
return $.Fragment = E, $.jsx = R, $.jsxs = R, $;
|
|
26
|
+
}
|
|
27
|
+
var Y = {};
|
|
28
|
+
/**
|
|
29
|
+
* @license React
|
|
30
|
+
* react-jsx-runtime.development.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
var je;
|
|
38
|
+
function hr() {
|
|
39
|
+
return je || (je = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
+
var d = Ce, g = Symbol.for("react.element"), E = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), m = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), re = Symbol.iterator, xe = "@@iterator";
|
|
41
|
+
function ke(e) {
|
|
42
|
+
if (e === null || typeof e != "object")
|
|
43
|
+
return null;
|
|
44
|
+
var r = re && e[re] || e[xe];
|
|
45
|
+
return typeof r == "function" ? r : null;
|
|
46
|
+
}
|
|
47
|
+
var k = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function c(e) {
|
|
49
|
+
{
|
|
50
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
51
|
+
t[n - 1] = arguments[n];
|
|
52
|
+
De("error", e, t);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function De(e, r, t) {
|
|
56
|
+
{
|
|
57
|
+
var n = k.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
58
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
59
|
+
var u = t.map(function(o) {
|
|
60
|
+
return String(o);
|
|
61
|
+
});
|
|
62
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var Fe = !1, Ae = !1, Ie = !1, We = !1, $e = !1, te;
|
|
66
|
+
te = Symbol.for("react.module.reference");
|
|
67
|
+
function Ye(e) {
|
|
68
|
+
return !!(typeof e == "string" || typeof e == "function" || e === y || e === T || $e || e === v || e === x || e === b || We || e === L || Fe || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === O || e.$$typeof === R || e.$$typeof === m || e.$$typeof === s || // This needs to include all possible module reference object
|
|
69
|
+
// types supported by any Flight configuration anywhere since
|
|
70
|
+
// we don't know which Flight build this will end up being used
|
|
71
|
+
// with.
|
|
72
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
73
|
+
}
|
|
74
|
+
function Le(e, r, t) {
|
|
75
|
+
var n = e.displayName;
|
|
76
|
+
if (n)
|
|
77
|
+
return n;
|
|
78
|
+
var i = r.displayName || r.name || "";
|
|
79
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
80
|
+
}
|
|
81
|
+
function ne(e) {
|
|
82
|
+
return e.displayName || "Context";
|
|
83
|
+
}
|
|
84
|
+
function w(e) {
|
|
85
|
+
if (e == null)
|
|
86
|
+
return null;
|
|
87
|
+
if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
+
return e.displayName || e.name || null;
|
|
89
|
+
if (typeof e == "string")
|
|
90
|
+
return e;
|
|
91
|
+
switch (e) {
|
|
92
|
+
case y:
|
|
93
|
+
return "Fragment";
|
|
94
|
+
case E:
|
|
95
|
+
return "Portal";
|
|
96
|
+
case T:
|
|
97
|
+
return "Profiler";
|
|
98
|
+
case v:
|
|
99
|
+
return "StrictMode";
|
|
100
|
+
case x:
|
|
101
|
+
return "Suspense";
|
|
102
|
+
case b:
|
|
103
|
+
return "SuspenseList";
|
|
104
|
+
}
|
|
105
|
+
if (typeof e == "object")
|
|
106
|
+
switch (e.$$typeof) {
|
|
107
|
+
case m:
|
|
108
|
+
var r = e;
|
|
109
|
+
return ne(r) + ".Consumer";
|
|
110
|
+
case R:
|
|
111
|
+
var t = e;
|
|
112
|
+
return ne(t._context) + ".Provider";
|
|
113
|
+
case s:
|
|
114
|
+
return Le(e, e.render, "ForwardRef");
|
|
115
|
+
case O:
|
|
116
|
+
var n = e.displayName || null;
|
|
117
|
+
return n !== null ? n : w(e.type) || "Memo";
|
|
118
|
+
case j: {
|
|
119
|
+
var i = e, u = i._payload, o = i._init;
|
|
120
|
+
try {
|
|
121
|
+
return w(o(u));
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
var C = Object.assign, A = 0, ae, oe, ie, ue, se, fe, le;
|
|
130
|
+
function ce() {
|
|
131
|
+
}
|
|
132
|
+
ce.__reactDisabledLog = !0;
|
|
133
|
+
function Ve() {
|
|
134
|
+
{
|
|
135
|
+
if (A === 0) {
|
|
136
|
+
ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, fe = console.groupCollapsed, le = console.groupEnd;
|
|
137
|
+
var e = {
|
|
138
|
+
configurable: !0,
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
value: ce,
|
|
141
|
+
writable: !0
|
|
142
|
+
};
|
|
143
|
+
Object.defineProperties(console, {
|
|
144
|
+
info: e,
|
|
145
|
+
log: e,
|
|
146
|
+
warn: e,
|
|
147
|
+
error: e,
|
|
148
|
+
group: e,
|
|
149
|
+
groupCollapsed: e,
|
|
150
|
+
groupEnd: e
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
A++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function Me() {
|
|
157
|
+
{
|
|
158
|
+
if (A--, A === 0) {
|
|
159
|
+
var e = {
|
|
160
|
+
configurable: !0,
|
|
161
|
+
enumerable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
};
|
|
164
|
+
Object.defineProperties(console, {
|
|
165
|
+
log: C({}, e, {
|
|
166
|
+
value: ae
|
|
167
|
+
}),
|
|
168
|
+
info: C({}, e, {
|
|
169
|
+
value: oe
|
|
170
|
+
}),
|
|
171
|
+
warn: C({}, e, {
|
|
172
|
+
value: ie
|
|
173
|
+
}),
|
|
174
|
+
error: C({}, e, {
|
|
175
|
+
value: ue
|
|
176
|
+
}),
|
|
177
|
+
group: C({}, e, {
|
|
178
|
+
value: se
|
|
179
|
+
}),
|
|
180
|
+
groupCollapsed: C({}, e, {
|
|
181
|
+
value: fe
|
|
182
|
+
}),
|
|
183
|
+
groupEnd: C({}, e, {
|
|
184
|
+
value: le
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
A < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var K = k.ReactCurrentDispatcher, B;
|
|
192
|
+
function V(e, r, t) {
|
|
193
|
+
{
|
|
194
|
+
if (B === void 0)
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (i) {
|
|
198
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
B = n && n[1] || "";
|
|
200
|
+
}
|
|
201
|
+
return `
|
|
202
|
+
` + B + e;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var J = !1, M;
|
|
206
|
+
{
|
|
207
|
+
var Ue = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
+
M = new Ue();
|
|
209
|
+
}
|
|
210
|
+
function de(e, r) {
|
|
211
|
+
if (!e || J)
|
|
212
|
+
return "";
|
|
213
|
+
{
|
|
214
|
+
var t = M.get(e);
|
|
215
|
+
if (t !== void 0)
|
|
216
|
+
return t;
|
|
217
|
+
}
|
|
218
|
+
var n;
|
|
219
|
+
J = !0;
|
|
220
|
+
var i = Error.prepareStackTrace;
|
|
221
|
+
Error.prepareStackTrace = void 0;
|
|
222
|
+
var u;
|
|
223
|
+
u = K.current, K.current = null, Ve();
|
|
224
|
+
try {
|
|
225
|
+
if (r) {
|
|
226
|
+
var o = function() {
|
|
227
|
+
throw Error();
|
|
228
|
+
};
|
|
229
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
230
|
+
set: function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
}
|
|
233
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
+
try {
|
|
235
|
+
Reflect.construct(o, []);
|
|
236
|
+
} catch (h) {
|
|
237
|
+
n = h;
|
|
238
|
+
}
|
|
239
|
+
Reflect.construct(e, [], o);
|
|
240
|
+
} else {
|
|
241
|
+
try {
|
|
242
|
+
o.call();
|
|
243
|
+
} catch (h) {
|
|
244
|
+
n = h;
|
|
245
|
+
}
|
|
246
|
+
e.call(o.prototype);
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
try {
|
|
250
|
+
throw Error();
|
|
251
|
+
} catch (h) {
|
|
252
|
+
n = h;
|
|
253
|
+
}
|
|
254
|
+
e();
|
|
255
|
+
}
|
|
256
|
+
} catch (h) {
|
|
257
|
+
if (h && n && typeof h.stack == "string") {
|
|
258
|
+
for (var a = h.stack.split(`
|
|
259
|
+
`), p = n.stack.split(`
|
|
260
|
+
`), f = a.length - 1, l = p.length - 1; f >= 1 && l >= 0 && a[f] !== p[l]; )
|
|
261
|
+
l--;
|
|
262
|
+
for (; f >= 1 && l >= 0; f--, l--)
|
|
263
|
+
if (a[f] !== p[l]) {
|
|
264
|
+
if (f !== 1 || l !== 1)
|
|
265
|
+
do
|
|
266
|
+
if (f--, l--, l < 0 || a[f] !== p[l]) {
|
|
267
|
+
var _ = `
|
|
268
|
+
` + a[f].replace(" at new ", " at ");
|
|
269
|
+
return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, _), _;
|
|
270
|
+
}
|
|
271
|
+
while (f >= 1 && l >= 0);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} finally {
|
|
276
|
+
J = !1, K.current = u, Me(), Error.prepareStackTrace = i;
|
|
277
|
+
}
|
|
278
|
+
var F = e ? e.displayName || e.name : "", S = F ? V(F) : "";
|
|
279
|
+
return typeof e == "function" && M.set(e, S), S;
|
|
280
|
+
}
|
|
281
|
+
function Ne(e, r, t) {
|
|
282
|
+
return de(e, !1);
|
|
283
|
+
}
|
|
284
|
+
function Ke(e) {
|
|
285
|
+
var r = e.prototype;
|
|
286
|
+
return !!(r && r.isReactComponent);
|
|
287
|
+
}
|
|
288
|
+
function U(e, r, t) {
|
|
289
|
+
if (e == null)
|
|
290
|
+
return "";
|
|
291
|
+
if (typeof e == "function")
|
|
292
|
+
return de(e, Ke(e));
|
|
293
|
+
if (typeof e == "string")
|
|
294
|
+
return V(e);
|
|
295
|
+
switch (e) {
|
|
296
|
+
case x:
|
|
297
|
+
return V("Suspense");
|
|
298
|
+
case b:
|
|
299
|
+
return V("SuspenseList");
|
|
300
|
+
}
|
|
301
|
+
if (typeof e == "object")
|
|
302
|
+
switch (e.$$typeof) {
|
|
303
|
+
case s:
|
|
304
|
+
return Ne(e.render);
|
|
305
|
+
case O:
|
|
306
|
+
return U(e.type, r, t);
|
|
307
|
+
case j: {
|
|
308
|
+
var n = e, i = n._payload, u = n._init;
|
|
309
|
+
try {
|
|
310
|
+
return U(u(i), r, t);
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
var I = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
|
|
318
|
+
function N(e) {
|
|
319
|
+
if (e) {
|
|
320
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
321
|
+
pe.setExtraStackFrame(t);
|
|
322
|
+
} else
|
|
323
|
+
pe.setExtraStackFrame(null);
|
|
324
|
+
}
|
|
325
|
+
function Be(e, r, t, n, i) {
|
|
326
|
+
{
|
|
327
|
+
var u = Function.call.bind(I);
|
|
328
|
+
for (var o in e)
|
|
329
|
+
if (u(e, o)) {
|
|
330
|
+
var a = void 0;
|
|
331
|
+
try {
|
|
332
|
+
if (typeof e[o] != "function") {
|
|
333
|
+
var p = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
+
throw p.name = "Invariant Violation", p;
|
|
335
|
+
}
|
|
336
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
+
} catch (f) {
|
|
338
|
+
a = f;
|
|
339
|
+
}
|
|
340
|
+
a && !(a instanceof Error) && (N(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), N(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, N(i), c("Failed %s type: %s", t, a.message), N(null));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var Je = Array.isArray;
|
|
345
|
+
function q(e) {
|
|
346
|
+
return Je(e);
|
|
347
|
+
}
|
|
348
|
+
function qe(e) {
|
|
349
|
+
{
|
|
350
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
+
return t;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function Ge(e) {
|
|
355
|
+
try {
|
|
356
|
+
return ye(e), !1;
|
|
357
|
+
} catch {
|
|
358
|
+
return !0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function ye(e) {
|
|
362
|
+
return "" + e;
|
|
363
|
+
}
|
|
364
|
+
function he(e) {
|
|
365
|
+
if (Ge(e))
|
|
366
|
+
return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ye(e);
|
|
367
|
+
}
|
|
368
|
+
var W = k.ReactCurrentOwner, ze = {
|
|
369
|
+
key: !0,
|
|
370
|
+
ref: !0,
|
|
371
|
+
__self: !0,
|
|
372
|
+
__source: !0
|
|
373
|
+
}, ge, Re, G;
|
|
374
|
+
G = {};
|
|
375
|
+
function Xe(e) {
|
|
376
|
+
if (I.call(e, "ref")) {
|
|
377
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
378
|
+
if (r && r.isReactWarning)
|
|
379
|
+
return !1;
|
|
380
|
+
}
|
|
381
|
+
return e.ref !== void 0;
|
|
382
|
+
}
|
|
383
|
+
function He(e) {
|
|
384
|
+
if (I.call(e, "key")) {
|
|
385
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
386
|
+
if (r && r.isReactWarning)
|
|
387
|
+
return !1;
|
|
388
|
+
}
|
|
389
|
+
return e.key !== void 0;
|
|
390
|
+
}
|
|
391
|
+
function Ze(e, r) {
|
|
392
|
+
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
|
|
393
|
+
var t = w(W.current.type);
|
|
394
|
+
G[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(W.current.type), e.ref), G[t] = !0);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function Qe(e, r) {
|
|
398
|
+
{
|
|
399
|
+
var t = function() {
|
|
400
|
+
ge || (ge = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
401
|
+
};
|
|
402
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
403
|
+
get: t,
|
|
404
|
+
configurable: !0
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function er(e, r) {
|
|
409
|
+
{
|
|
410
|
+
var t = function() {
|
|
411
|
+
Re || (Re = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
412
|
+
};
|
|
413
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
414
|
+
get: t,
|
|
415
|
+
configurable: !0
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
var rr = function(e, r, t, n, i, u, o) {
|
|
420
|
+
var a = {
|
|
421
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
422
|
+
$$typeof: g,
|
|
423
|
+
// Built-in properties that belong on the element
|
|
424
|
+
type: e,
|
|
425
|
+
key: r,
|
|
426
|
+
ref: t,
|
|
427
|
+
props: o,
|
|
428
|
+
// Record the component responsible for creating this element.
|
|
429
|
+
_owner: u
|
|
430
|
+
};
|
|
431
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
432
|
+
configurable: !1,
|
|
433
|
+
enumerable: !1,
|
|
434
|
+
writable: !0,
|
|
435
|
+
value: !1
|
|
436
|
+
}), Object.defineProperty(a, "_self", {
|
|
437
|
+
configurable: !1,
|
|
438
|
+
enumerable: !1,
|
|
439
|
+
writable: !1,
|
|
440
|
+
value: n
|
|
441
|
+
}), Object.defineProperty(a, "_source", {
|
|
442
|
+
configurable: !1,
|
|
443
|
+
enumerable: !1,
|
|
444
|
+
writable: !1,
|
|
445
|
+
value: i
|
|
446
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
447
|
+
};
|
|
448
|
+
function tr(e, r, t, n, i) {
|
|
449
|
+
{
|
|
450
|
+
var u, o = {}, a = null, p = null;
|
|
451
|
+
t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Xe(r) && (p = r.ref, Ze(r, i));
|
|
452
|
+
for (u in r)
|
|
453
|
+
I.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
|
|
454
|
+
if (e && e.defaultProps) {
|
|
455
|
+
var f = e.defaultProps;
|
|
456
|
+
for (u in f)
|
|
457
|
+
o[u] === void 0 && (o[u] = f[u]);
|
|
458
|
+
}
|
|
459
|
+
if (a || p) {
|
|
460
|
+
var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
461
|
+
a && Qe(o, l), p && er(o, l);
|
|
462
|
+
}
|
|
463
|
+
return rr(e, a, p, i, n, W.current, o);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
var z = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame;
|
|
467
|
+
function D(e) {
|
|
468
|
+
if (e) {
|
|
469
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
470
|
+
be.setExtraStackFrame(t);
|
|
471
|
+
} else
|
|
472
|
+
be.setExtraStackFrame(null);
|
|
473
|
+
}
|
|
474
|
+
var X;
|
|
475
|
+
X = !1;
|
|
476
|
+
function H(e) {
|
|
477
|
+
return typeof e == "object" && e !== null && e.$$typeof === g;
|
|
478
|
+
}
|
|
479
|
+
function Ee() {
|
|
480
|
+
{
|
|
481
|
+
if (z.current) {
|
|
482
|
+
var e = w(z.current.type);
|
|
483
|
+
if (e)
|
|
484
|
+
return `
|
|
485
|
+
|
|
486
|
+
Check the render method of \`` + e + "`.";
|
|
487
|
+
}
|
|
488
|
+
return "";
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function nr(e) {
|
|
492
|
+
return "";
|
|
493
|
+
}
|
|
494
|
+
var _e = {};
|
|
495
|
+
function ar(e) {
|
|
496
|
+
{
|
|
497
|
+
var r = Ee();
|
|
498
|
+
if (!r) {
|
|
499
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
500
|
+
t && (r = `
|
|
501
|
+
|
|
502
|
+
Check the top-level render call using <` + t + ">.");
|
|
503
|
+
}
|
|
504
|
+
return r;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function me(e, r) {
|
|
508
|
+
{
|
|
509
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
510
|
+
return;
|
|
511
|
+
e._store.validated = !0;
|
|
512
|
+
var t = ar(r);
|
|
513
|
+
if (_e[t])
|
|
514
|
+
return;
|
|
515
|
+
_e[t] = !0;
|
|
516
|
+
var n = "";
|
|
517
|
+
e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + w(e._owner.type) + "."), D(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function Te(e, r) {
|
|
521
|
+
{
|
|
522
|
+
if (typeof e != "object")
|
|
523
|
+
return;
|
|
524
|
+
if (q(e))
|
|
525
|
+
for (var t = 0; t < e.length; t++) {
|
|
526
|
+
var n = e[t];
|
|
527
|
+
H(n) && me(n, r);
|
|
528
|
+
}
|
|
529
|
+
else if (H(e))
|
|
530
|
+
e._store && (e._store.validated = !0);
|
|
531
|
+
else if (e) {
|
|
532
|
+
var i = ke(e);
|
|
533
|
+
if (typeof i == "function" && i !== e.entries)
|
|
534
|
+
for (var u = i.call(e), o; !(o = u.next()).done; )
|
|
535
|
+
H(o.value) && me(o.value, r);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function or(e) {
|
|
540
|
+
{
|
|
541
|
+
var r = e.type;
|
|
542
|
+
if (r == null || typeof r == "string")
|
|
543
|
+
return;
|
|
544
|
+
var t;
|
|
545
|
+
if (typeof r == "function")
|
|
546
|
+
t = r.propTypes;
|
|
547
|
+
else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
|
|
548
|
+
// Inner props are checked in the reconciler.
|
|
549
|
+
r.$$typeof === O))
|
|
550
|
+
t = r.propTypes;
|
|
551
|
+
else
|
|
552
|
+
return;
|
|
553
|
+
if (t) {
|
|
554
|
+
var n = w(r);
|
|
555
|
+
Be(t, e.props, "prop", n, e);
|
|
556
|
+
} else if (r.PropTypes !== void 0 && !X) {
|
|
557
|
+
X = !0;
|
|
558
|
+
var i = w(r);
|
|
559
|
+
c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
560
|
+
}
|
|
561
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
function ir(e) {
|
|
565
|
+
{
|
|
566
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
567
|
+
var n = r[t];
|
|
568
|
+
if (n !== "children" && n !== "key") {
|
|
569
|
+
D(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
e.ref !== null && (D(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
var we = {};
|
|
577
|
+
function Oe(e, r, t, n, i, u) {
|
|
578
|
+
{
|
|
579
|
+
var o = Ye(e);
|
|
580
|
+
if (!o) {
|
|
581
|
+
var a = "";
|
|
582
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
583
|
+
var p = nr();
|
|
584
|
+
p ? a += p : a += Ee();
|
|
585
|
+
var f;
|
|
586
|
+
e === null ? f = "null" : q(e) ? f = "array" : e !== void 0 && e.$$typeof === g ? (f = "<" + (w(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
|
|
587
|
+
}
|
|
588
|
+
var l = tr(e, r, t, i, u);
|
|
589
|
+
if (l == null)
|
|
590
|
+
return l;
|
|
591
|
+
if (o) {
|
|
592
|
+
var _ = r.children;
|
|
593
|
+
if (_ !== void 0)
|
|
594
|
+
if (n)
|
|
595
|
+
if (q(_)) {
|
|
596
|
+
for (var F = 0; F < _.length; F++)
|
|
597
|
+
Te(_[F], e);
|
|
598
|
+
Object.freeze && Object.freeze(_);
|
|
599
|
+
} else
|
|
600
|
+
c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
601
|
+
else
|
|
602
|
+
Te(_, e);
|
|
603
|
+
}
|
|
604
|
+
if (I.call(r, "key")) {
|
|
605
|
+
var S = w(e), h = Object.keys(r).filter(function(dr) {
|
|
606
|
+
return dr !== "key";
|
|
607
|
+
}), Z = h.length > 0 ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
608
|
+
if (!we[S + Z]) {
|
|
609
|
+
var cr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
|
|
610
|
+
c(`A props object containing a "key" prop is being spread into JSX:
|
|
611
|
+
let props = %s;
|
|
612
|
+
<%s {...props} />
|
|
613
|
+
React keys must be passed directly to JSX without using spread:
|
|
614
|
+
let props = %s;
|
|
615
|
+
<%s key={someKey} {...props} />`, Z, S, cr, S), we[S + Z] = !0;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return e === y ? ir(l) : or(l), l;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
function ur(e, r, t) {
|
|
622
|
+
return Oe(e, r, t, !0);
|
|
623
|
+
}
|
|
624
|
+
function sr(e, r, t) {
|
|
625
|
+
return Oe(e, r, t, !1);
|
|
626
|
+
}
|
|
627
|
+
var fr = sr, lr = ur;
|
|
628
|
+
Y.Fragment = y, Y.jsx = fr, Y.jsxs = lr;
|
|
629
|
+
}()), Y;
|
|
630
|
+
}
|
|
631
|
+
process.env.NODE_ENV === "production" ? Q.exports = yr() : Q.exports = hr();
|
|
632
|
+
var P = Q.exports;
|
|
633
|
+
const Se = vr(null), Er = (d) => /* @__PURE__ */ P.jsx(Se.Provider, { value: d.router, children: d.children });
|
|
634
|
+
function gr() {
|
|
635
|
+
const d = pr(Se);
|
|
636
|
+
if (!d)
|
|
637
|
+
throw new Error(
|
|
638
|
+
"[useRouter] Router not found. Insert RouterProvider in app root"
|
|
639
|
+
);
|
|
640
|
+
return d;
|
|
641
|
+
}
|
|
642
|
+
function _r(d) {
|
|
643
|
+
const { to: g, params: E, onClick: y, ...v } = d, R = gr().mappedRoutes.find(({ route: s }) => s === g), { onOpen: m } = ee(g);
|
|
644
|
+
if (!R)
|
|
645
|
+
throw new Error(
|
|
646
|
+
"[Link] Route not found. Maybe it is not passed into createRouter?"
|
|
647
|
+
);
|
|
648
|
+
return /* @__PURE__ */ P.jsx(
|
|
649
|
+
"a",
|
|
650
|
+
{
|
|
651
|
+
...v,
|
|
652
|
+
href: R.toPath(E ?? void 0),
|
|
653
|
+
onClick: (s) => {
|
|
654
|
+
y == null || y(s), !s.defaultPrevented && (v.target && v.target !== "_self" || s.metaKey || s.altKey || s.ctrlKey || s.shiftKey || (s.preventDefault(), m({ params: E || {} })));
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
const mr = (d) => () => {
|
|
660
|
+
const { view: g, layout: E, route: y } = d, { isOpened: v } = ee(y);
|
|
661
|
+
return v ? E ? /* @__PURE__ */ P.jsx(E, { children: /* @__PURE__ */ P.jsx(g, {}) }) : /* @__PURE__ */ P.jsx(g, {}) : null;
|
|
662
|
+
}, Tr = (d) => {
|
|
663
|
+
const { routes: g, otherwise: E } = d;
|
|
664
|
+
return () => {
|
|
665
|
+
const y = g.map(({ route: v, view: T, layout: R }) => {
|
|
666
|
+
const { isOpened: m } = ee(v);
|
|
667
|
+
return {
|
|
668
|
+
view: T,
|
|
669
|
+
layout: R,
|
|
670
|
+
isOpened: m
|
|
671
|
+
};
|
|
672
|
+
});
|
|
673
|
+
for (const v of y) {
|
|
674
|
+
if (!v.isOpened)
|
|
675
|
+
continue;
|
|
676
|
+
const { view: T, layout: R } = v;
|
|
677
|
+
return R ? /* @__PURE__ */ P.jsx(R, { children: /* @__PURE__ */ P.jsx(T, {}) }) : /* @__PURE__ */ P.jsx(T, {});
|
|
678
|
+
}
|
|
679
|
+
return E ? /* @__PURE__ */ P.jsx(E, {}) : null;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
export {
|
|
683
|
+
_r as Link,
|
|
684
|
+
Er as RouterProvider,
|
|
685
|
+
mr as createRouteView,
|
|
686
|
+
Tr as createRoutesView,
|
|
687
|
+
gr as useRouter
|
|
688
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@argon-router/react",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public",
|
|
5
|
+
"registry": "https://registry.npmjs.org/"
|
|
6
|
+
},
|
|
7
|
+
"private": false,
|
|
8
|
+
"version": "0.1.0",
|
|
9
|
+
"description": "React bindings for argon router",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"effector",
|
|
12
|
+
"argon",
|
|
13
|
+
"router",
|
|
14
|
+
"argon-router",
|
|
15
|
+
"react"
|
|
16
|
+
],
|
|
17
|
+
"author": "movpushmov",
|
|
18
|
+
"homepage": "https://github.com/movpushmov/argon-router#readme",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"module": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"require": "./dist/index.cjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"directories": {
|
|
30
|
+
"lib": "lib"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/movpushmov/argon-router.git"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "vite build",
|
|
41
|
+
"test": "vitest run"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/movpushmov/argon-router/issues"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@argon-router/core": "^0.1.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@babel/preset-react": "^7.24.1",
|
|
51
|
+
"@testing-library/react": "^14.2.2",
|
|
52
|
+
"@testing-library/user-event": "^14.5.2",
|
|
53
|
+
"@types/react": "^18.2.56",
|
|
54
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
55
|
+
"jsdom": "^24.1.1",
|
|
56
|
+
"react": "^18.2.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"effector": "^23.2.2",
|
|
60
|
+
"effector-react": "^23.2.1",
|
|
61
|
+
"react": "^18.2.0"
|
|
62
|
+
},
|
|
63
|
+
"gitHead": "59ab2eda9dffd095ffe5c4625b6a40cd71487410"
|
|
64
|
+
}
|