react-show-more-text 1.7.2-rc.0 → 1.7.2-rc.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # React Show More Text 1.7.1
1
+ # React Show More Text 1.7.2
2
2
 
3
3
  [![NPM version][npm-image]][npm-url]
4
4
  [![Downloads][downloads-image]][npm-url]
@@ -100,28 +100,64 @@ Install development dependencies
100
100
  $ npm install
101
101
  ```
102
102
 
103
+ ### Build & Compilation
104
+
105
+ Build the library (ESM and CJS bundles with Vite)
106
+
107
+ ```
108
+ $ npm run build
109
+ ```
110
+
111
+ Watch for changes and rebuild automatically
112
+
113
+ ```
114
+ $ npm run build:watch
115
+ ```
116
+
117
+ Start development server (Vite)
118
+
119
+ ```
120
+ $ npm run dev
121
+ ```
122
+
123
+ Clean the dist folder
124
+
125
+ ```
126
+ $ npm run clean
127
+ ```
128
+
129
+ ### Testing & Quality
130
+
103
131
  Run tests
104
132
 
105
133
  ```
106
134
  $ npm test
107
135
  ```
108
136
 
137
+ Run tests in watch mode
138
+
139
+ ```
140
+ $ npm test:watch
141
+ ```
142
+
109
143
  Run code linter
110
144
 
111
145
  ```
112
146
  $ npm run lint
113
147
  ```
114
148
 
115
- Compile to ES5 from /src to /lib
149
+ ### Storybook
150
+
151
+ Interactive component documentation and sandbox
116
152
 
117
153
  ```
118
- $ npm run compile
154
+ $ npm run storybook
119
155
  ```
120
156
 
121
- Storybook usage
157
+ Build static Storybook site
122
158
 
123
159
  ```
124
- $ npm run storybook --legacy-peer-deps=true
160
+ $ npm run build-storybook
125
161
  ```
126
162
 
127
163
  [npm-url]: https://npmjs.org/package/react-show-more-text
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=(i,a,l)=>(l=null!=i?e(o(i)):{},((e,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(var l,c=n(o),p=0,u=c.length;p<u;p++)l=c[p],s.call(e,l)||l===i||t(e,l,{get:(e=>o[e]).bind(null,l),enumerable:!(a=r(o,l))||a.enumerable});return e})(!a&&i&&i.__esModule?l:t(l,"default",{value:i,enumerable:!0}),i));let l=require("react");l=a(l,1);let c=require("prop-types");c=a(c,1);var p=i(e=>{var t=require("react"),r=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;r=n("react.element"),e.Fragment=n("react.fragment")}var o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,n){var a,l={},c=null,p=null;for(a in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)s.call(t,a)&&!i.hasOwnProperty(a)&&(l[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===l[a]&&(l[a]=t[a]);return{$$typeof:r,type:e,key:c,ref:p,props:l,_owner:o.current}}e.jsx=a,e.jsxs=a}),u=i(e=>{"production"!==process.env.NODE_ENV&&function(){"use strict";var t=require("react"),r=60103,n=60106;e.Fragment=60107;var o=60108,s=60114,i=60109,a=60110,l=60112,c=60113,p=60120,u=60115,f=60116,d=60121,h=60122,y=60117,m=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;r=v("react.element"),n=v("react.portal"),e.Fragment=v("react.fragment"),o=v("react.strict_mode"),s=v("react.profiler"),i=v("react.provider"),a=v("react.context"),l=v("react.forward_ref"),c=v("react.suspense"),p=v("react.suspense_list"),u=v("react.memo"),f=v("react.lazy"),d=v("react.block"),h=v("react.server.block"),y=v("react.fundamental"),v("react.scope"),v("react.opaque.id"),m=v("react.debug_trace_mode"),v("react.offscreen"),g=v("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];!function(e,t,r){var n=x.ReactDebugCurrentFrame,o="";if(O){var s=k(O.type),i=O._owner;o+=function(e,t,r){var n="";if(t){var o=t.fileName,s=o.replace(_,"");if(/^index\./.test(s)){var i=o.match(_);if(i){var a=i[1];a&&(s=a.replace(_,"")+"/"+s)}}n=" (at "+s+":"+t.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(e||"Unknown")+n}(s,O._source,i&&k(i.type))}""!==(o+=n.getStackAddendum())&&(t+="%s",r=r.concat([o]));var a=r.map(function(e){return""+e});a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,r)}var _=/^(.*)[\\\/]/;var T=1;function k(t){if(null==t)return null;if("number"==typeof t.tag&&w("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case p:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case a:return"Context.Consumer";case i:return"Context.Provider";case l:return y=t,m=t.render,g="ForwardRef",v=m.displayName||m.name||"",y.displayName||(""!==v?g+"("+v+")":g);case u:return k(t.type);case d:return k(t.render);case f:var r=(h=t)._status===T?h._result:null;if(r)return k(r)}var h,y,m,g,v;return null}var j={};x.ReactDebugCurrentFrame;var O=null;function P(e){O=e}var R,C,E=x.ReactCurrentOwner,L=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0},N={};function $(e,t,n,o,s){var i,a={},l=null,c=null;for(i in void 0!==n&&(l=""+n),function(e){if(L.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(l=""+t.key),function(e){if(L.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&E.current&&t&&E.current.stateNode!==t){var r=k(E.current.type);N[r]||(w('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',k(E.current.type),e.ref),N[r]=!0)}}(t,s)),t)L.call(t,i)&&!S.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var p=e.defaultProps;for(i in p)void 0===a[i]&&(a[i]=p[i])}if(l||c){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var r=function(){R||(R=!0,w("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(a,u),c&&function(e,t){var r=function(){C||(C=!0,w("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(a,u)}return function(e,t,n,o,s,i,a){var l={$$typeof:r,type:e,key:t,ref:n,props:a,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,c,s,o,E.current,a)}var W=x.ReactCurrentOwner;function D(e){O=e}x.ReactDebugCurrentFrame;var F=!1;function M(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function A(){if(W.current){var e=k(W.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var I={};function U(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=A();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!I[r]){I[r]=!0;var n="";e&&e._owner&&e._owner!==W.current&&(n=" It was passed a child from "+k(e._owner.type)+"."),D(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),D(null)}}}function z(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];M(n)&&U(n,t)}else if(M(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=b&&e[b]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var s,i=o.call(e);!(s=i.next()).done;)M(s.value)&&U(s.value,t)}}function H(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r;if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==l&&t.$$typeof!==u)return;r=t.propTypes}if(r){var n=k(t);!function(e,t,r,n,o){var s=Function.call.bind(Object.prototype.hasOwnProperty);for(var i in e)if(s(e,i)){var a=void 0;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}!a||a instanceof Error||(P(o),w("%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",r,i,typeof a),P(null)),a instanceof Error&&!(a.message in j)&&(j[a.message]=!0,P(o),w("Failed %s type: %s",r,a.message),P(null))}}(r,e.props,"prop",n,e)}else void 0===t.PropTypes||F||(F=!0,w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",k(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function q(t,n,v,b,x,_){var T=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===s||t===m||t===o||t===c||t===p||t===g||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===u||t.$$typeof===i||t.$$typeof===a||t.$$typeof===l||t.$$typeof===y||t.$$typeof===d||t[0]===h)}(t);if(!T){var j="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(j+=" 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 O,P=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(x);j+=P||A(),null===t?O="null":Array.isArray(t)?O="array":void 0!==t&&t.$$typeof===r?(O="<"+(k(t.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):O=typeof t,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,j)}var R=$(t,n,v,x,_);if(null==R)return R;if(T){var C=n.children;if(void 0!==C)if(b)if(Array.isArray(C)){for(var E=0;E<C.length;E++)z(C[E],t);Object.freeze&&Object.freeze(C)}else w("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 z(C,t)}return t===e.Fragment?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){D(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}null!==e.ref&&(D(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}(R):H(R),R}var B=function(e,t,r){return q(e,t,r,!1)},Y=function(e,t,r){return q(e,t,r,!0)};e.jsx=B,e.jsxs=Y}()}),f=i((e,t)=>{"production"===process.env.NODE_ENV?t.exports=p():t.exports=u()})(),d=class extends l.default.Component{static propTypes={children:c.default.node,ellipsis:c.default.node,lines:c.default.oneOfType([c.default.oneOf([!1]),c.default.number]),trimWhitespace:c.default.bool,width:c.default.number,onTruncate:c.default.func};static defaultProps={children:"",ellipsis:"…",lines:1,trimWhitespace:!1,width:0};state={};constructor(...e){super(...e),this.elements={},this.replacedLinks=[]}componentDidMount(){const{elements:{text:e},calcTargetWidth:t,onResize:r}=this;this.canvasContext=document.createElement("canvas").getContext("2d"),t(()=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),window.addEventListener("resize",r)}componentDidUpdate(e){this.props.children!==e.children&&this.forceUpdate(),this.props.width!==e.width&&this.calcTargetWidth()}componentWillUnmount(){const{elements:{ellipsis:e},onResize:t,timeout:r}=this;e.parentNode&&e.parentNode.removeChild(e),window.removeEventListener("resize",t),window.cancelAnimationFrame(r)}extractReplaceLinksKeys=e=>{var t=this,r=0;return this.replacedLinks=[],e.replace(/(<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>)/g,function(){const n=Array.prototype.slice.call(arguments,1,4);n.key="["+"@".repeat(n[2].length-1)+"="+r+++"]",t.replacedLinks.push(n),e=e.replace(n[0],n.key)}),e};restoreReplacedLinks=e=>{const t={};this.replacedLinks.forEach(e=>{t[e.key]=e[0]});let r=this.escapeHtmlEntities(e);return this.replacedLinks.forEach(e=>{const t=this.escapeHtmlEntities(e.key);r=r.replace(t,e[0])}),this.createMarkup(r)};stripHtmlTags=e=>e.replace(/<[^>]*>/g," ");escapeHtmlEntities=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,e=>t[e])};innerText=e=>{const t=document.createElement("div"),r="innerText"in window.HTMLElement.prototype?"innerText":"textContent",n=e.innerHTML.replace(/\r\n|\r|\n/g," ");t.innerHTML=this.extractReplaceLinksKeys(n);let o=t[r];const s=document.createElement("div");return s.innerHTML="foo<br/>bar","foo\nbar"!==s[r].replace(/\r\n|\r/g,"\n")&&(t.innerHTML=t.innerHTML.replace(/<br.*?[\/]?>/gi,"\n"),o=t[r]),o};onResize=()=>{this.calcTargetWidth()};onTruncate=e=>{const{onTruncate:t}=this.props;"function"==typeof t&&(this.timeout=window.requestAnimationFrame(()=>{t(e)}))};calcTargetWidth=e=>{const{elements:{target:t},calcTargetWidth:r,canvasContext:n,props:{width:o}}=this;if(!t)return;const s=o||Math.floor(t.parentNode.getBoundingClientRect().width);if(!s)return window.requestAnimationFrame(()=>r(e));const i=window.getComputedStyle(t);n.font=[i["font-weight"],i["font-style"],i["font-size"],i["font-family"]].join(" "),this.setState({targetWidth:s},e)};measureWidth=e=>this.canvasContext.measureText(this.stripHtmlTags(e)).width;ellipsisWidth=e=>e.offsetWidth;trimRight=e=>e.replace(/\s+$/,"");createMarkup=e=>(0,f.jsx)("span",{dangerouslySetInnerHTML:{__html:e}});getLines=()=>{const{elements:e,props:{lines:t,ellipsis:r,trimWhitespace:n},state:{targetWidth:o},innerText:s,measureWidth:i,onTruncate:a,trimRight:l,renderLine:c,restoreReplacedLinks:p}=this,u=[],d=s(e.text).split("\n").map(e=>e.split(" "));let h=!0;const y=this.ellipsisWidth(this.elements.ellipsis);for(let m=1;m<=t;m++){const e=d[0];if(0===e.length){u.push(),d.shift(),m--;continue}let s=e.join(" ");if(i(s)<=o&&1===d.length){h=!1,s=p(s),u.push(s);break}if(m===t){const t=e.join(" ");let a=0,c=t.length-1;for(;a<=c;){const e=Math.floor((a+c)/2);i(t.slice(0,e+1))+y<=o?a=e+1:c=e-1}let d=t.slice(0,a);if(n)for(d=l(d);!d.length&&u.length;)d=l(u.pop());"]["===d.substr(d.length-2)&&(d=d.substring(0,d.length-1)),d=d.replace(/\[@+$/,""),d=p(d),s=(0,f.jsxs)("span",{children:[d,r]})}else{let r=0,n=e.length-1;for(;r<=n;){const t=Math.floor((r+n)/2);i(e.slice(0,t+1).join(" "))<=o?r=t+1:n=t-1}if(0===r){m=t-1;continue}s=e.slice(0,r).join(" "),s=p(s),d[0].splice(0,r)}u.push(s)}return a(h),u.map(c)};renderLine=(e,t,r)=>{if(t===r.length-1)return(0,f.jsx)("span",{children:e},t);{const r=(0,f.jsx)("br",{},t+"br");return e?[(0,f.jsx)("span",{children:e},t),r]:r}};render(){const{elements:{target:e},props:{children:t,ellipsis:r,lines:n,...o},state:{targetWidth:s},getLines:i,onTruncate:a}=this;let l;return"undefined"!=typeof window&&e&&s&&(n>0?l=i():(l=t,a(!1))),delete o.onTruncate,delete o.trimWhitespace,(0,f.jsxs)("span",{...o,ref:e=>{this.elements.target=e},children:[(0,f.jsx)("span",{style:{display:"block",maxWidth:o.width>0?`${o.width}px`:"unset"},children:l}),(0,f.jsx)("span",{ref:e=>{this.elements.text=e},children:t}),(0,f.jsx)("span",{ref:e=>{this.elements.ellipsis=e},style:this.styles.ellipsis,children:r})]})}styles={ellipsis:{position:"fixed",visibility:"hidden",top:0,left:0}}},h=class extends l.Component{_isMounted=!1;constructor(e){super(e),this.state={expanded:!1,truncated:!1}}static defaultProps={lines:3,more:"Show more",less:"Show less",anchorClass:"show-more-less-clickable",onClick:void 0,expanded:!1,width:0,keepNewLines:!1,truncatedEndingComponent:"... ",expandByClick:!0,onTruncate:void 0};static propTypes={children:c.PropTypes.node,lines:c.PropTypes.number,more:c.PropTypes.node,less:c.PropTypes.node,anchorClass:c.PropTypes.string,className:c.PropTypes.string,onClick:c.PropTypes.func,expanded:c.PropTypes.bool,width:c.PropTypes.number,keepNewLines:c.PropTypes.bool,truncatedEndingComponent:c.PropTypes.node,expandByClick:c.PropTypes.bool,onTruncate:c.PropTypes.func};componentDidMount(){this._isMounted=!0;this._isMounted&&this.setState({expanded:this.props.expanded})}componentWillUnmount(){this._isMounted=!1}handleTruncate=e=>{this._isMounted&&e!==this.state.truncated&&(this.setState({truncated:e}),e&&this.truncateRef.onResize(),this.props.onTruncate&&this.props.onTruncate())};toggleLines=e=>{e.preventDefault();var t=this;t.props.expandByClick?this._isMounted&&this.setState({expanded:!this.state.expanded},()=>{t.props.onClick&&t.props.onClick(t.state.expanded,e)}):t.props.onClick&&t.props.onClick(t.state.expanded,e)};render(){const{children:e,more:t,less:r,lines:n,anchorClass:o,className:s,width:i,keepNewLines:a,truncatedEndingComponent:l,onTruncate:c}=this.props,{expanded:p,truncated:u}=this.state;return(0,f.jsx)("div",{className:s,children:(0,f.jsxs)(d,{width:i,lines:!p&&n,ellipsis:(0,f.jsxs)("span",{children:[l,(0,f.jsx)("span",{className:o,onClick:this.toggleLines,children:t})]}),onTruncate:this.handleTruncate,ref:e=>this.truncateRef=e,children:[a&&"string"==typeof e?e.split("\n").map((e,t,r)=>(e=(0,f.jsx)("span",{children:e},t),t===r.length-1?e:[e,(0,f.jsx)("br",{},t+"br")])):e,!u&&p&&(0,f.jsxs)("span",{children:[" ",(0,f.jsx)("span",{className:o,onClick:this.toggleLines,children:r})]})]})})}};exports.ShowMoreText=h,exports.Truncate=d;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","names":[],"sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/Truncate.jsx","../src/ShowMoreText.jsx"],"sourcesContent":["/** @license React v16.14.0\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),g=60103;exports.Fragment=60107;if(\"function\"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h(\"react.element\");exports.Fragment=h(\"react.fragment\")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=\"\"+k);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;\n","/** @license React v16.14.0\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nexports.Fragment = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n exports.Fragment = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = '';\n\n if (currentlyValidatingElement) {\n var name = getComponentName(currentlyValidatingElement.type);\n var owner = currentlyValidatingElement._owner;\n stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));\n }\n\n stack += ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {\n return true;\n }\n }\n\n return false;\n}\n\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\nvar Resolved = 1;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case exports.Fragment:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar currentlyValidatingElement = null;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n currentlyValidatingElement = element;\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%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).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentName(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('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', getComponentName(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n currentlyValidatingElement = element;\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentName(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentName(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (Array.isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentName(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentName(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (Array.isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentName(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === exports.Fragment) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * LICENSE\n * https://github.com/pablosichert/react-truncate/blob/master/LICENSE.md\n *\n * ISC License\nCopyright (c) 2016, One.com\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is\nhereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE\nFOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\nDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\nCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n// Initial version of react-truncate module (v2.4.0)\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default class Truncate extends React.Component {\n static propTypes = {\n children: PropTypes.node,\n ellipsis: PropTypes.node,\n lines: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.number,\n ]),\n trimWhitespace: PropTypes.bool,\n width: PropTypes.number,\n onTruncate: PropTypes.func,\n };\n\n static defaultProps = {\n children: \"\",\n ellipsis: \"…\",\n lines: 1,\n trimWhitespace: false,\n width: 0,\n };\n\n state = {};\n\n constructor(...args) {\n super(...args);\n\n this.elements = {};\n this.replacedLinks = [];\n }\n\n componentDidMount() {\n const {\n elements: { text },\n calcTargetWidth,\n onResize,\n } = this;\n\n const canvas = document.createElement(\"canvas\");\n this.canvasContext = canvas.getContext(\"2d\");\n\n calcTargetWidth(() => {\n // Node not needed in document tree to read its content\n if (text && text.parentNode) {\n text.parentNode.removeChild(text);\n }\n });\n\n window.addEventListener(\"resize\", onResize);\n }\n\n componentDidUpdate(prevProps) {\n // Render was based on outdated refs and needs to be rerun\n if (this.props.children !== prevProps.children) {\n this.forceUpdate();\n }\n\n // If the width prop has changed, recalculate size of contents\n if (this.props.width !== prevProps.width) {\n this.calcTargetWidth();\n }\n }\n\n componentWillUnmount() {\n const {\n elements: { ellipsis },\n onResize,\n timeout,\n } = this;\n\n if (ellipsis.parentNode) {\n ellipsis.parentNode.removeChild(ellipsis);\n }\n\n window.removeEventListener(\"resize\", onResize);\n\n window.cancelAnimationFrame(timeout);\n }\n\n extractReplaceLinksKeys = (content) => {\n var _self = this,\n i = 0;\n this.replacedLinks = [];\n\n content.replace(\n /(<a[\\s]+([^>]+)>((?:.(?!\\<\\/a\\>))*.)<\\/a>)/g,\n function () {\n const item = Array.prototype.slice.call(arguments, 1, 4);\n item.key =\n \"[\" + \"@\".repeat(item[2].length - 1) + \"=\" + i++ + \"]\";\n _self.replacedLinks.push(item);\n\n content = content.replace(item[0], item.key);\n }\n );\n\n return content;\n };\n\n restoreReplacedLinks = (content) => {\n // This method restores the <a> tags that were extracted earlier\n // We need to be careful to:\n // 1. Keep actual <a> tags unescaped (they should render as HTML)\n // 2. Escape all other HTML-like content to prevent rendering of non-link HTML tags\n \n // Build a map of placeholders and their corresponding link HTML\n const linkMap = {};\n this.replacedLinks.forEach((item) => {\n linkMap[item.key] = item[0];\n });\n \n // Escape all HTML entities first\n let escapedContent = this.escapeHtmlEntities(content);\n \n // Now replace the escaped placeholders with the unescaped link HTML\n this.replacedLinks.forEach((item) => {\n const escapedKey = this.escapeHtmlEntities(item.key);\n escapedContent = escapedContent.replace(escapedKey, item[0]);\n });\n\n return this.createMarkup(escapedContent);\n };\n\n stripHtmlTags = (str) => {\n return str.replace(/<[^>]*>/g, \" \");\n }\n\n escapeHtmlEntities = (text) => {\n const map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n return text.replace(/[&<>\"']/g, char => map[char]);\n }\n\n // Shim innerText to consistently break lines at <br/> but not at \\n\n innerText = (node) => {\n const div = document.createElement(\"div\");\n const contentKey =\n \"innerText\" in window.HTMLElement.prototype\n ? \"innerText\"\n : \"textContent\";\n\n const content = node.innerHTML.replace(/\\r\\n|\\r|\\n/g, \" \");\n div.innerHTML = this.extractReplaceLinksKeys(content);\n\n let text = div[contentKey];\n\n const test = document.createElement(\"div\");\n test.innerHTML = \"foo<br/>bar\";\n\n if (test[contentKey].replace(/\\r\\n|\\r/g, \"\\n\") !== \"foo\\nbar\") {\n div.innerHTML = div.innerHTML.replace(/<br.*?[\\/]?>/gi, \"\\n\");\n text = div[contentKey];\n }\n\n return text;\n };\n\n onResize = () => {\n this.calcTargetWidth();\n };\n\n onTruncate = (didTruncate) => {\n const { onTruncate } = this.props;\n\n if (typeof onTruncate === \"function\") {\n this.timeout = window.requestAnimationFrame(() => {\n onTruncate(didTruncate);\n });\n }\n };\n\n calcTargetWidth = (callback) => {\n const {\n elements: { target },\n calcTargetWidth,\n canvasContext,\n props: { width },\n } = this;\n\n // Calculation is no longer relevant, since node has been removed\n if (!target) {\n return;\n }\n\n const targetWidth =\n width ||\n // Floor the result to deal with browser subpixel precision\n Math.floor(target.parentNode.getBoundingClientRect().width);\n\n // Delay calculation until parent node is inserted to the document\n // Mounting order in React is ChildComponent, ParentComponent\n if (!targetWidth) {\n return window.requestAnimationFrame(() =>\n calcTargetWidth(callback)\n );\n }\n\n const style = window.getComputedStyle(target);\n\n const font = [\n style[\"font-weight\"],\n style[\"font-style\"],\n style[\"font-size\"],\n style[\"font-family\"],\n ].join(\" \");\n\n canvasContext.font = font;\n\n this.setState(\n {\n targetWidth,\n },\n callback\n );\n };\n\n measureWidth = (text) => {\n return this.canvasContext.measureText(this.stripHtmlTags(text)).width;\n };\n\n ellipsisWidth = (node) => {\n return node.offsetWidth;\n };\n\n trimRight = (text) => {\n return text.replace(/\\s+$/, \"\");\n };\n\n createMarkup = (str) => {\n return <span dangerouslySetInnerHTML={{ __html: str }} />;\n };\n\n getLines = () => {\n const {\n elements,\n props: { lines: numLines, ellipsis, trimWhitespace },\n state: { targetWidth },\n innerText,\n measureWidth,\n onTruncate,\n trimRight,\n renderLine,\n restoreReplacedLinks,\n } = this;\n\n const lines = [];\n const text = innerText(elements.text);\n const textLines = text.split(\"\\n\").map((line) => line.split(\" \"));\n let didTruncate = true;\n const ellipsisWidth = this.ellipsisWidth(this.elements.ellipsis);\n\n for (let line = 1; line <= numLines; line++) {\n const textWords = textLines[0];\n\n // Handle newline\n if (textWords.length === 0) {\n lines.push();\n textLines.shift();\n line--;\n continue;\n }\n\n let resultLine = textWords.join(\" \");\n\n if (measureWidth(resultLine) <= targetWidth) {\n if (textLines.length === 1) {\n // Line is end of text and fits without truncating\n didTruncate = false;\n\n resultLine = restoreReplacedLinks(resultLine);\n lines.push(resultLine);\n\n break;\n }\n }\n\n if (line === numLines) {\n // Binary search determining the longest possible line inluding truncate string\n const textRest = textWords.join(\" \");\n\n let lower = 0;\n let upper = textRest.length - 1;\n\n while (lower <= upper) {\n const middle = Math.floor((lower + upper) / 2);\n\n const testLine = textRest.slice(0, middle + 1);\n\n if (measureWidth(testLine) + ellipsisWidth <= targetWidth) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n\n let lastLineText = textRest.slice(0, lower);\n\n if (trimWhitespace) {\n lastLineText = trimRight(lastLineText);\n\n // Remove blank lines from the end of text\n while (!lastLineText.length && lines.length) {\n const prevLine = lines.pop();\n\n lastLineText = trimRight(prevLine);\n }\n }\n\n if (lastLineText.substr(lastLineText.length - 2) === \"][\") {\n lastLineText = lastLineText.substring(\n 0,\n lastLineText.length - 1\n );\n }\n\n lastLineText = lastLineText.replace(/\\[@+$/, \"\");\n lastLineText = restoreReplacedLinks(lastLineText);\n\n resultLine = (\n <span>\n {lastLineText}\n {ellipsis}\n </span>\n );\n } else {\n // Binary search determining when the line breaks\n let lower = 0;\n let upper = textWords.length - 1;\n\n while (lower <= upper) {\n const middle = Math.floor((lower + upper) / 2);\n\n const testLine = textWords.slice(0, middle + 1).join(\" \");\n\n if (measureWidth(testLine) <= targetWidth) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n\n // The first word of this line is too long to fit it\n if (lower === 0) {\n // Jump to processing of last line\n line = numLines - 1;\n continue;\n }\n\n resultLine = textWords.slice(0, lower).join(\" \");\n\n resultLine = restoreReplacedLinks(resultLine);\n\n textLines[0].splice(0, lower);\n }\n\n lines.push(resultLine);\n }\n\n onTruncate(didTruncate);\n\n return lines.map(renderLine);\n };\n\n renderLine = (line, i, arr) => {\n if (i === arr.length - 1) {\n return <span key={i}>{line}</span>;\n } else {\n const br = <br key={i + \"br\"} />;\n\n if (line) {\n return [<span key={i}>{line}</span>, br];\n } else {\n return br;\n }\n }\n };\n\n render() {\n const {\n elements: { target },\n props: { children, ellipsis, lines, ...spanProps },\n state: { targetWidth },\n getLines,\n onTruncate,\n } = this;\n\n let text;\n\n const mounted = !!(target && targetWidth);\n\n if (typeof window !== \"undefined\" && mounted) {\n if (lines > 0) {\n text = getLines();\n } else {\n text = children;\n\n onTruncate(false);\n }\n }\n\n delete spanProps.onTruncate;\n delete spanProps.trimWhitespace;\n\n return (\n <span\n {...spanProps}\n ref={(targetEl) => {\n this.elements.target = targetEl;\n }}\n >\n <span\n style={{\n display: \"block\",\n maxWidth: spanProps.width > 0 ? `${spanProps.width}px` : \"unset\",\n }}\n >\n {text}\n </span>\n <span\n ref={(textEl) => {\n this.elements.text = textEl;\n }}\n >\n {children}\n </span>\n <span\n ref={(ellipsisEl) => {\n this.elements.ellipsis = ellipsisEl;\n }}\n style={this.styles.ellipsis}\n >\n {ellipsis}\n </span>\n </span>\n );\n }\n\n styles = {\n ellipsis: {\n position: \"fixed\",\n visibility: \"hidden\",\n top: 0,\n left: 0,\n },\n };\n}\n","import React, { Component } from \"react\";\nimport { PropTypes } from \"prop-types\";\nimport Truncate from \"./Truncate\";\n\nclass ShowMoreText extends Component {\n _isMounted = false;\n\n constructor(props) {\n super(props);\n\n this.state = {\n expanded: false,\n truncated: false,\n };\n }\n\n static defaultProps = {\n lines: 3,\n more: \"Show more\",\n less: \"Show less\",\n anchorClass: \"show-more-less-clickable\",\n onClick: undefined,\n expanded: false,\n width: 0,\n keepNewLines: false,\n truncatedEndingComponent: \"... \",\n expandByClick: true,\n onTruncate: undefined,\n };\n\n static propTypes = {\n children: PropTypes.node,\n lines: PropTypes.number,\n more: PropTypes.node,\n less: PropTypes.node,\n anchorClass: PropTypes.string,\n className: PropTypes.string,\n onClick: PropTypes.func,\n expanded: PropTypes.bool,\n width: PropTypes.number,\n keepNewLines: PropTypes.bool,\n truncatedEndingComponent: PropTypes.node,\n expandByClick: PropTypes.bool,\n onTruncate: PropTypes.func,\n };\n\n componentDidMount() {\n this._isMounted = true;\n\n var _self = this;\n if (this._isMounted) {\n this.setState({\n expanded: _self.props.expanded,\n });\n }\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n }\n\n handleTruncate = (truncated) => {\n if (this._isMounted && truncated !== this.state.truncated) {\n this.setState({\n truncated,\n });\n if (truncated) {\n this.truncateRef.onResize();\n }\n this.props.onTruncate && this.props.onTruncate();\n }\n };\n\n toggleLines = (event) => {\n event.preventDefault();\n var _self = this;\n\n if (!_self.props.expandByClick) {\n if (_self.props.onClick) {\n _self.props.onClick(_self.state.expanded, event);\n }\n\n return;\n }\n\n if (this._isMounted) {\n this.setState(\n {\n expanded: !this.state.expanded,\n },\n () => {\n if (_self.props.onClick) {\n _self.props.onClick(_self.state.expanded, event);\n }\n }\n );\n }\n };\n\n render() {\n const {\n children,\n more,\n less,\n lines,\n anchorClass,\n className,\n width,\n keepNewLines,\n truncatedEndingComponent,\n onTruncate,\n } = this.props;\n\n const { expanded, truncated } = this.state;\n\n return (\n <div className={className}>\n <Truncate\n width={width}\n lines={!expanded && lines}\n ellipsis={\n <span>\n {truncatedEndingComponent}\n <span\n className={anchorClass}\n onClick={this.toggleLines}\n >\n {more}\n </span>\n </span>\n }\n onTruncate={this.handleTruncate}\n ref={(ref) => (this.truncateRef = ref)}\n >\n {keepNewLines && typeof children === \"string\"\n ? children.split(\"\\n\").map((line, i, arr) => {\n line = <span key={i}>{line}</span>;\n\n if (i === arr.length - 1) {\n return line;\n } else {\n return [line, <br key={i + \"br\"} />];\n }\n })\n : children}\n {!truncated && expanded && (\n <span>\n {\" \"}\n <span\n className={anchorClass}\n onClick={this.toggleLines}\n >\n {less}\n </span>\n </span>\n )}\n </Truncate>\n </div>\n );\n }\n}\n\nexport default ShowMoreText;\n"],"x_google_ignoreList":[0,1,2],"mappings":"wqBAQa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KAdlD,EAAM,MAAM,SACZ,EAAM,MAAM,QAAQ,EAAM,MAAM,SAAU,IAoBtD,MAAA,GACI,MAAM,SACF,EAAA,KACA,EAAA,KACA,EAAA,MACA,EAAA,YACA,EAAA,UACA,EAAA,MACA,EAAA,aACA,EAAA,yBACA,EAAA,WACA,GACA,KAAK,OAEH,SAAE,EAAA,UAAU,GAAc,KAAK,MAErC,OACI,EAAA,EAAA,KAAC,MAAD,CAAgB,sBACZ,EAAA,EAAA,MAAC,EAAD,CACW,QACP,OAAQ,GAAY,EACpB,UACI,EAAA,EAAA,MAAC,OAAD,CAAA,SAAA,CACK,GACD,EAAA,EAAA,KAAC,OAAD,CACI,UAAW,EACX,QAAS,KAAK,qBAEb,OAIb,WAAY,KAAK,eACjB,IAAM,GAAS,KAAK,YAAc,WAftC,CAiBK,GAAoC,iBAAb,EAClB,EAAS,MAAM,MAAM,IAAA,CAAK,EAAM,EAAG,KAC/B,GAAO,EAAA,EAAA,KAAC,OAAD,CAAA,SAAe,GAAJ,GAEd,IAAM,EAAI,OAAS,EACZ,EAEA,CAAC,GAAM,EAAA,EAAA,KAAC,KAAD,CAAA,EAAS,EAAI,SAGnC,GACJ,GAAa,IACX,EAAA,EAAA,MAAC,OAAD,CAAA,SAAA,CACK,KACD,EAAA,EAAA,KAAC,OAAD,CACI,UAAW,EACX,QAAS,KAAK,qBAEb"}
@@ -0,0 +1,9 @@
1
+ import e,{Component as t}from"react";import n,{PropTypes as r}from"prop-types";var i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=/* @__PURE__ */(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)(function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")}),s=/* @__PURE__ */i(e=>{var t=o("react"),n=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;n=r("react.element"),e.Fragment=r("react.fragment")}var i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var o,c={},l=null,p=null;for(o in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(p=t.ref),t)s.call(t,o)&&!a.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:l,ref:p,props:c,_owner:i.current}}e.jsx=c,e.jsxs=c}),a=/* @__PURE__ */i(e=>{"production"!==process.env.NODE_ENV&&function(){var t=o("react"),n=60103,r=60106;e.Fragment=60107;var i=60108,s=60114,a=60109,c=60110,l=60112,p=60113,u=60120,f=60115,d=60116,h=60121,y=60122,m=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),e.Fragment=b("react.fragment"),i=b("react.strict_mode"),s=b("react.profiler"),a=b("react.provider"),c=b("react.context"),l=b("react.forward_ref"),p=b("react.suspense"),u=b("react.suspense_list"),f=b("react.memo"),d=b("react.lazy"),h=b("react.block"),y=b("react.server.block"),m=b("react.fundamental"),b("react.scope"),b("react.opaque.id"),g=b("react.debug_trace_mode"),b("react.offscreen"),v=b("react.legacy_hidden")}var x="function"==typeof Symbol&&Symbol.iterator;var w=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=w.ReactDebugCurrentFrame,i="";if(C){var o=T(C.type),s=C._owner;i+=function(e,t,n){var r="";if(t){var i=t.fileName,o=i.replace(_,"");if(/^index\./.test(o)){var s=i.match(_);if(s){var a=s[1];a&&(o=a.replace(_,"")+"/"+o)}}r=" (at "+o+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(o,C._source,s&&T(s.type))}""!==(i+=r.getStackAddendum())&&(t+="%s",n=n.concat([i]));var a=n.map(function(e){return""+e});a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,n)}var _=/^(.*)[\\\/]/;var j=1;function T(t){if(null==t)return null;if("number"==typeof t.tag&&k("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case p:return"Suspense";case u:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case c:return"Context.Consumer";case a:return"Context.Provider";case l:return y=t,m=t.render,g="ForwardRef",v=m.displayName||m.name||"",y.displayName||(""!==v?g+"("+v+")":g);case f:return T(t.type);case h:return T(t.render);case d:var n=(o=t)._status===j?o._result:null;if(n)return T(n)}var o,y,m,g,v;return null}var R={};w.ReactDebugCurrentFrame;var C=null;function O(e){C=e}var E,L,N=w.ReactCurrentOwner,S=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0},$={};function W(e,t,r,i,o){var s,a={},c=null,l=null;for(s in void 0!==r&&(c=""+r),function(e){if(S.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(c=""+t.key),function(e){if(S.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(l=t.ref,function(e,t){if("string"==typeof e.ref&&N.current&&t&&N.current.stateNode!==t){var n=T(N.current.type);$[n]||(k('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(N.current.type),e.ref),$[n]=!0)}}(t,o)),t)S.call(t,s)&&!P.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps){var p=e.defaultProps;for(s in p)void 0===a[s]&&(a[s]=p[s])}if(c||l){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){E||(E=!0,k("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),l&&function(e,t){var n=function(){L||(L=!0,k("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return function(e,t,r,i,o,s,a){var c={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:s,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,l,o,i,N.current,a)}var F=w.ReactCurrentOwner;function D(e){C=e}w.ReactDebugCurrentFrame;var M=!1;function A(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function I(){if(F.current){var e=T(F.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var q={};function U(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=I();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!q[n]){q[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+T(e._owner.type)+"."),D(e),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),D(null)}}}function z(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];A(r)&&U(r,t)}else if(A(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=x&&e[x]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)A(o.value)&&U(o.value,t)}}function H(e){var t=e.type;if(null!=t&&"string"!=typeof t){var n;if("function"==typeof t)n=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==l&&t.$$typeof!==f)return;n=t.propTypes}if(n){var r=T(t);!function(e,t,n,r,i){var o=Function.call.bind(Object.prototype.hasOwnProperty);for(var s in e)if(o(e,s)){var a=void 0;try{if("function"!=typeof e[s]){var c=Error((r||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}a=e[s](t,s,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}!a||a instanceof Error||(O(i),k("%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).",r||"React class",n,s,typeof a),O(null)),a instanceof Error&&!(a.message in R)&&(R[a.message]=!0,O(i),k("Failed %s type: %s",n,a.message),O(null))}}(n,e.props,"prop",r,e)}else void 0===t.PropTypes||M||(M=!0,k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function B(t,r,o,b,x,w){var _=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===s||t===g||t===i||t===p||t===u||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===f||t.$$typeof===a||t.$$typeof===c||t.$$typeof===l||t.$$typeof===m||t.$$typeof===h||t[0]===y)}(t);if(!_){var j="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(j+=" 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 R,C=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(x);j+=C||I(),null===t?R="null":Array.isArray(t)?R="array":void 0!==t&&t.$$typeof===n?(R="<"+(T(t.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):R=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,j)}var O=W(t,r,o,x,w);if(null==O)return O;if(_){var E=r.children;if(void 0!==E)if(b)if(Array.isArray(E)){for(var L=0;L<E.length;L++)z(E[L],t);Object.freeze&&Object.freeze(E)}else k("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 z(E,t)}return t===e.Fragment?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){D(e),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),D(null);break}}null!==e.ref&&(D(e),k("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}(O):H(O),O}var Y=function(e,t,n){return B(e,t,n,!1)},V=function(e,t,n){return B(e,t,n,!0)};e.jsx=Y,e.jsxs=V}()}),c=/* @__PURE__ */i((e,t)=>{"production"===process.env.NODE_ENV?t.exports=s():t.exports=a()})(),l=class extends e.Component{static propTypes={children:n.node,ellipsis:n.node,lines:n.oneOfType([n.oneOf([!1]),n.number]),trimWhitespace:n.bool,width:n.number,onTruncate:n.func};static defaultProps={children:"",ellipsis:"…",lines:1,trimWhitespace:!1,width:0};state={};constructor(...e){super(...e),this.elements={},this.replacedLinks=[]}componentDidMount(){const{elements:{text:e},calcTargetWidth:t,onResize:n}=this;this.canvasContext=document.createElement("canvas").getContext("2d"),t(()=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),window.addEventListener("resize",n)}componentDidUpdate(e){this.props.children!==e.children&&this.forceUpdate(),this.props.width!==e.width&&this.calcTargetWidth()}componentWillUnmount(){const{elements:{ellipsis:e},onResize:t,timeout:n}=this;e.parentNode&&e.parentNode.removeChild(e),window.removeEventListener("resize",t),window.cancelAnimationFrame(n)}extractReplaceLinksKeys=e=>{var t=this,n=0;return this.replacedLinks=[],e.replace(/(<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>)/g,function(){const r=Array.prototype.slice.call(arguments,1,4);r.key="["+"@".repeat(r[2].length-1)+"="+n+++"]",t.replacedLinks.push(r),e=e.replace(r[0],r.key)}),e};restoreReplacedLinks=e=>{const t={};this.replacedLinks.forEach(e=>{t[e.key]=e[0]});let n=this.escapeHtmlEntities(e);return this.replacedLinks.forEach(e=>{const t=this.escapeHtmlEntities(e.key);n=n.replace(t,e[0])}),this.createMarkup(n)};stripHtmlTags=e=>e.replace(/<[^>]*>/g," ");escapeHtmlEntities=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,e=>t[e])};innerText=e=>{const t=document.createElement("div"),n="innerText"in window.HTMLElement.prototype?"innerText":"textContent",r=e.innerHTML.replace(/\r\n|\r|\n/g," ");t.innerHTML=this.extractReplaceLinksKeys(r);let i=t[n];const o=document.createElement("div");return o.innerHTML="foo<br/>bar","foo\nbar"!==o[n].replace(/\r\n|\r/g,"\n")&&(t.innerHTML=t.innerHTML.replace(/<br.*?[\/]?>/gi,"\n"),i=t[n]),i};onResize=()=>{this.calcTargetWidth()};onTruncate=e=>{const{onTruncate:t}=this.props;"function"==typeof t&&(this.timeout=window.requestAnimationFrame(()=>{t(e)}))};calcTargetWidth=e=>{const{elements:{target:t},calcTargetWidth:n,canvasContext:r,props:{width:i}}=this;if(!t)return;const o=i||Math.floor(t.parentNode.getBoundingClientRect().width);if(!o)return window.requestAnimationFrame(()=>n(e));const s=window.getComputedStyle(t);r.font=[s["font-weight"],s["font-style"],s["font-size"],s["font-family"]].join(" "),this.setState({targetWidth:o},e)};measureWidth=e=>this.canvasContext.measureText(this.stripHtmlTags(e)).width;ellipsisWidth=e=>e.offsetWidth;trimRight=e=>e.replace(/\s+$/,"");createMarkup=e=>/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("span",{dangerouslySetInnerHTML:{__html:e}});getLines=()=>{const{elements:e,props:{lines:t,ellipsis:n,trimWhitespace:r},state:{targetWidth:i},innerText:o,measureWidth:s,onTruncate:a,trimRight:l,renderLine:p,restoreReplacedLinks:u}=this,f=[],d=o(e.text).split("\n").map(e=>e.split(" "));let h=!0;const y=this.ellipsisWidth(this.elements.ellipsis);for(let m=1;m<=t;m++){const e=d[0];if(0===e.length){f.push(),d.shift(),m--;continue}let o=e.join(" ");if(s(o)<=i&&1===d.length){h=!1,o=u(o),f.push(o);break}if(m===t){const t=e.join(" ");let a=0,p=t.length-1;for(;a<=p;){const e=Math.floor((a+p)/2);s(t.slice(0,e+1))+y<=i?a=e+1:p=e-1}let d=t.slice(0,a);if(r)for(d=l(d);!d.length&&f.length;)d=l(f.pop());"]["===d.substr(d.length-2)&&(d=d.substring(0,d.length-1)),d=d.replace(/\[@+$/,""),d=u(d),o=/* @__PURE__ */ /* @__PURE__ */(0,c.jsxs)("span",{children:[d,n]})}else{let n=0,r=e.length-1;for(;n<=r;){const t=Math.floor((n+r)/2);s(e.slice(0,t+1).join(" "))<=i?n=t+1:r=t-1}if(0===n){m=t-1;continue}o=e.slice(0,n).join(" "),o=u(o),d[0].splice(0,n)}f.push(o)}return a(h),f.map(p)};renderLine=(e,t,n)=>{if(t===n.length-1)/* @__PURE__ */ /* @__PURE__ */return(0,c.jsx)("span",{children:e},t);{const n=/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("br",{},t+"br");return e?[/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("span",{children:e},t),n]:n}};render(){const{elements:{target:e},props:{children:t,ellipsis:n,lines:r,...i},state:{targetWidth:o},getLines:s,onTruncate:a}=this;let l;return"undefined"!=typeof window&&e&&o&&(r>0?l=s():(l=t,a(!1))),delete i.onTruncate,delete i.trimWhitespace,/* @__PURE__ */ /* @__PURE__ */(0,c.jsxs)("span",{...i,ref:e=>{this.elements.target=e},children:[
2
+ /* @__PURE__ */
3
+ /* @__PURE__ */(0,c.jsx)("span",{style:{display:"block",maxWidth:i.width>0?`${i.width}px`:"unset"},children:l}),
4
+ /* @__PURE__ */
5
+ /* @__PURE__ */(0,c.jsx)("span",{ref:e=>{this.elements.text=e},children:t}),
6
+ /* @__PURE__ */
7
+ /* @__PURE__ */(0,c.jsx)("span",{ref:e=>{this.elements.ellipsis=e},style:this.styles.ellipsis,children:n})]})}styles={ellipsis:{position:"fixed",visibility:"hidden",top:0,left:0}}},p=class extends t{_isMounted=!1;constructor(e){super(e),this.state={expanded:!1,truncated:!1}}static defaultProps={lines:3,more:"Show more",less:"Show less",anchorClass:"show-more-less-clickable",onClick:void 0,expanded:!1,width:0,keepNewLines:!1,truncatedEndingComponent:"... ",expandByClick:!0,onTruncate:void 0};static propTypes={children:r.node,lines:r.number,more:r.node,less:r.node,anchorClass:r.string,className:r.string,onClick:r.func,expanded:r.bool,width:r.number,keepNewLines:r.bool,truncatedEndingComponent:r.node,expandByClick:r.bool,onTruncate:r.func};componentDidMount(){this._isMounted=!0;this._isMounted&&this.setState({expanded:this.props.expanded})}componentWillUnmount(){this._isMounted=!1}handleTruncate=e=>{this._isMounted&&e!==this.state.truncated&&(this.setState({truncated:e}),e&&this.truncateRef.onResize(),this.props.onTruncate&&this.props.onTruncate())};toggleLines=e=>{e.preventDefault();var t=this;t.props.expandByClick?this._isMounted&&this.setState({expanded:!this.state.expanded},()=>{t.props.onClick&&t.props.onClick(t.state.expanded,e)}):t.props.onClick&&t.props.onClick(t.state.expanded,e)};render(){const{children:e,more:t,less:n,lines:r,anchorClass:i,className:o,width:s,keepNewLines:a,truncatedEndingComponent:p,onTruncate:u}=this.props,{expanded:f,truncated:d}=this.state;/* @__PURE__ */ /* @__PURE__ */
8
+ return(0,c.jsx)("div",{className:o,children:/* @__PURE__ */ /* @__PURE__ */(0,c.jsxs)(l,{width:s,lines:!f&&r,ellipsis:/* @__PURE__ */ /* @__PURE__ */(0,c.jsxs)("span",{children:[p,/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("span",{className:i,onClick:this.toggleLines,children:t})]}),onTruncate:this.handleTruncate,ref:e=>this.truncateRef=e,children:[a&&"string"==typeof e?e.split("\n").map((e,t,n)=>(e=/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("span",{children:e},t),t===n.length-1?e:[e,/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("br",{},t+"br")])):e,!d&&f&&/* @__PURE__ */ /* @__PURE__ */(0,c.jsxs)("span",{children:[" ",/* @__PURE__ */ /* @__PURE__ */(0,c.jsx)("span",{className:i,onClick:this.toggleLines,children:n})]})]})})}};export{p as ShowMoreText,l as Truncate};
9
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","names":[],"sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/Truncate.jsx","../src/ShowMoreText.jsx"],"sourcesContent":["/** @license React v16.14.0\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),g=60103;exports.Fragment=60107;if(\"function\"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h(\"react.element\");exports.Fragment=h(\"react.fragment\")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=\"\"+k);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;\n","/** @license React v16.14.0\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nexports.Fragment = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n exports.Fragment = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = '';\n\n if (currentlyValidatingElement) {\n var name = getComponentName(currentlyValidatingElement.type);\n var owner = currentlyValidatingElement._owner;\n stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));\n }\n\n stack += ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {\n return true;\n }\n }\n\n return false;\n}\n\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n}\n\nvar Resolved = 1;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case exports.Fragment:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type.render);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar currentlyValidatingElement = null;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n currentlyValidatingElement = element;\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%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).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentName(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('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', getComponentName(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n currentlyValidatingElement = element;\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentName(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentName(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (Array.isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentName(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentName(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (Array.isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentName(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === exports.Fragment) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * LICENSE\n * https://github.com/pablosichert/react-truncate/blob/master/LICENSE.md\n *\n * ISC License\nCopyright (c) 2016, One.com\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is\nhereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE\nFOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\nDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\nCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n// Initial version of react-truncate module (v2.4.0)\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default class Truncate extends React.Component {\n static propTypes = {\n children: PropTypes.node,\n ellipsis: PropTypes.node,\n lines: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.number,\n ]),\n trimWhitespace: PropTypes.bool,\n width: PropTypes.number,\n onTruncate: PropTypes.func,\n };\n\n static defaultProps = {\n children: \"\",\n ellipsis: \"…\",\n lines: 1,\n trimWhitespace: false,\n width: 0,\n };\n\n state = {};\n\n constructor(...args) {\n super(...args);\n\n this.elements = {};\n this.replacedLinks = [];\n }\n\n componentDidMount() {\n const {\n elements: { text },\n calcTargetWidth,\n onResize,\n } = this;\n\n const canvas = document.createElement(\"canvas\");\n this.canvasContext = canvas.getContext(\"2d\");\n\n calcTargetWidth(() => {\n // Node not needed in document tree to read its content\n if (text && text.parentNode) {\n text.parentNode.removeChild(text);\n }\n });\n\n window.addEventListener(\"resize\", onResize);\n }\n\n componentDidUpdate(prevProps) {\n // Render was based on outdated refs and needs to be rerun\n if (this.props.children !== prevProps.children) {\n this.forceUpdate();\n }\n\n // If the width prop has changed, recalculate size of contents\n if (this.props.width !== prevProps.width) {\n this.calcTargetWidth();\n }\n }\n\n componentWillUnmount() {\n const {\n elements: { ellipsis },\n onResize,\n timeout,\n } = this;\n\n if (ellipsis.parentNode) {\n ellipsis.parentNode.removeChild(ellipsis);\n }\n\n window.removeEventListener(\"resize\", onResize);\n\n window.cancelAnimationFrame(timeout);\n }\n\n extractReplaceLinksKeys = (content) => {\n var _self = this,\n i = 0;\n this.replacedLinks = [];\n\n content.replace(\n /(<a[\\s]+([^>]+)>((?:.(?!\\<\\/a\\>))*.)<\\/a>)/g,\n function () {\n const item = Array.prototype.slice.call(arguments, 1, 4);\n item.key =\n \"[\" + \"@\".repeat(item[2].length - 1) + \"=\" + i++ + \"]\";\n _self.replacedLinks.push(item);\n\n content = content.replace(item[0], item.key);\n }\n );\n\n return content;\n };\n\n restoreReplacedLinks = (content) => {\n // This method restores the <a> tags that were extracted earlier\n // We need to be careful to:\n // 1. Keep actual <a> tags unescaped (they should render as HTML)\n // 2. Escape all other HTML-like content to prevent rendering of non-link HTML tags\n \n // Build a map of placeholders and their corresponding link HTML\n const linkMap = {};\n this.replacedLinks.forEach((item) => {\n linkMap[item.key] = item[0];\n });\n \n // Escape all HTML entities first\n let escapedContent = this.escapeHtmlEntities(content);\n \n // Now replace the escaped placeholders with the unescaped link HTML\n this.replacedLinks.forEach((item) => {\n const escapedKey = this.escapeHtmlEntities(item.key);\n escapedContent = escapedContent.replace(escapedKey, item[0]);\n });\n\n return this.createMarkup(escapedContent);\n };\n\n stripHtmlTags = (str) => {\n return str.replace(/<[^>]*>/g, \" \");\n }\n\n escapeHtmlEntities = (text) => {\n const map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n return text.replace(/[&<>\"']/g, char => map[char]);\n }\n\n // Shim innerText to consistently break lines at <br/> but not at \\n\n innerText = (node) => {\n const div = document.createElement(\"div\");\n const contentKey =\n \"innerText\" in window.HTMLElement.prototype\n ? \"innerText\"\n : \"textContent\";\n\n const content = node.innerHTML.replace(/\\r\\n|\\r|\\n/g, \" \");\n div.innerHTML = this.extractReplaceLinksKeys(content);\n\n let text = div[contentKey];\n\n const test = document.createElement(\"div\");\n test.innerHTML = \"foo<br/>bar\";\n\n if (test[contentKey].replace(/\\r\\n|\\r/g, \"\\n\") !== \"foo\\nbar\") {\n div.innerHTML = div.innerHTML.replace(/<br.*?[\\/]?>/gi, \"\\n\");\n text = div[contentKey];\n }\n\n return text;\n };\n\n onResize = () => {\n this.calcTargetWidth();\n };\n\n onTruncate = (didTruncate) => {\n const { onTruncate } = this.props;\n\n if (typeof onTruncate === \"function\") {\n this.timeout = window.requestAnimationFrame(() => {\n onTruncate(didTruncate);\n });\n }\n };\n\n calcTargetWidth = (callback) => {\n const {\n elements: { target },\n calcTargetWidth,\n canvasContext,\n props: { width },\n } = this;\n\n // Calculation is no longer relevant, since node has been removed\n if (!target) {\n return;\n }\n\n const targetWidth =\n width ||\n // Floor the result to deal with browser subpixel precision\n Math.floor(target.parentNode.getBoundingClientRect().width);\n\n // Delay calculation until parent node is inserted to the document\n // Mounting order in React is ChildComponent, ParentComponent\n if (!targetWidth) {\n return window.requestAnimationFrame(() =>\n calcTargetWidth(callback)\n );\n }\n\n const style = window.getComputedStyle(target);\n\n const font = [\n style[\"font-weight\"],\n style[\"font-style\"],\n style[\"font-size\"],\n style[\"font-family\"],\n ].join(\" \");\n\n canvasContext.font = font;\n\n this.setState(\n {\n targetWidth,\n },\n callback\n );\n };\n\n measureWidth = (text) => {\n return this.canvasContext.measureText(this.stripHtmlTags(text)).width;\n };\n\n ellipsisWidth = (node) => {\n return node.offsetWidth;\n };\n\n trimRight = (text) => {\n return text.replace(/\\s+$/, \"\");\n };\n\n createMarkup = (str) => {\n return <span dangerouslySetInnerHTML={{ __html: str }} />;\n };\n\n getLines = () => {\n const {\n elements,\n props: { lines: numLines, ellipsis, trimWhitespace },\n state: { targetWidth },\n innerText,\n measureWidth,\n onTruncate,\n trimRight,\n renderLine,\n restoreReplacedLinks,\n } = this;\n\n const lines = [];\n const text = innerText(elements.text);\n const textLines = text.split(\"\\n\").map((line) => line.split(\" \"));\n let didTruncate = true;\n const ellipsisWidth = this.ellipsisWidth(this.elements.ellipsis);\n\n for (let line = 1; line <= numLines; line++) {\n const textWords = textLines[0];\n\n // Handle newline\n if (textWords.length === 0) {\n lines.push();\n textLines.shift();\n line--;\n continue;\n }\n\n let resultLine = textWords.join(\" \");\n\n if (measureWidth(resultLine) <= targetWidth) {\n if (textLines.length === 1) {\n // Line is end of text and fits without truncating\n didTruncate = false;\n\n resultLine = restoreReplacedLinks(resultLine);\n lines.push(resultLine);\n\n break;\n }\n }\n\n if (line === numLines) {\n // Binary search determining the longest possible line inluding truncate string\n const textRest = textWords.join(\" \");\n\n let lower = 0;\n let upper = textRest.length - 1;\n\n while (lower <= upper) {\n const middle = Math.floor((lower + upper) / 2);\n\n const testLine = textRest.slice(0, middle + 1);\n\n if (measureWidth(testLine) + ellipsisWidth <= targetWidth) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n\n let lastLineText = textRest.slice(0, lower);\n\n if (trimWhitespace) {\n lastLineText = trimRight(lastLineText);\n\n // Remove blank lines from the end of text\n while (!lastLineText.length && lines.length) {\n const prevLine = lines.pop();\n\n lastLineText = trimRight(prevLine);\n }\n }\n\n if (lastLineText.substr(lastLineText.length - 2) === \"][\") {\n lastLineText = lastLineText.substring(\n 0,\n lastLineText.length - 1\n );\n }\n\n lastLineText = lastLineText.replace(/\\[@+$/, \"\");\n lastLineText = restoreReplacedLinks(lastLineText);\n\n resultLine = (\n <span>\n {lastLineText}\n {ellipsis}\n </span>\n );\n } else {\n // Binary search determining when the line breaks\n let lower = 0;\n let upper = textWords.length - 1;\n\n while (lower <= upper) {\n const middle = Math.floor((lower + upper) / 2);\n\n const testLine = textWords.slice(0, middle + 1).join(\" \");\n\n if (measureWidth(testLine) <= targetWidth) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n\n // The first word of this line is too long to fit it\n if (lower === 0) {\n // Jump to processing of last line\n line = numLines - 1;\n continue;\n }\n\n resultLine = textWords.slice(0, lower).join(\" \");\n\n resultLine = restoreReplacedLinks(resultLine);\n\n textLines[0].splice(0, lower);\n }\n\n lines.push(resultLine);\n }\n\n onTruncate(didTruncate);\n\n return lines.map(renderLine);\n };\n\n renderLine = (line, i, arr) => {\n if (i === arr.length - 1) {\n return <span key={i}>{line}</span>;\n } else {\n const br = <br key={i + \"br\"} />;\n\n if (line) {\n return [<span key={i}>{line}</span>, br];\n } else {\n return br;\n }\n }\n };\n\n render() {\n const {\n elements: { target },\n props: { children, ellipsis, lines, ...spanProps },\n state: { targetWidth },\n getLines,\n onTruncate,\n } = this;\n\n let text;\n\n const mounted = !!(target && targetWidth);\n\n if (typeof window !== \"undefined\" && mounted) {\n if (lines > 0) {\n text = getLines();\n } else {\n text = children;\n\n onTruncate(false);\n }\n }\n\n delete spanProps.onTruncate;\n delete spanProps.trimWhitespace;\n\n return (\n <span\n {...spanProps}\n ref={(targetEl) => {\n this.elements.target = targetEl;\n }}\n >\n <span\n style={{\n display: \"block\",\n maxWidth: spanProps.width > 0 ? `${spanProps.width}px` : \"unset\",\n }}\n >\n {text}\n </span>\n <span\n ref={(textEl) => {\n this.elements.text = textEl;\n }}\n >\n {children}\n </span>\n <span\n ref={(ellipsisEl) => {\n this.elements.ellipsis = ellipsisEl;\n }}\n style={this.styles.ellipsis}\n >\n {ellipsis}\n </span>\n </span>\n );\n }\n\n styles = {\n ellipsis: {\n position: \"fixed\",\n visibility: \"hidden\",\n top: 0,\n left: 0,\n },\n };\n}\n","import React, { Component } from \"react\";\nimport { PropTypes } from \"prop-types\";\nimport Truncate from \"./Truncate\";\n\nclass ShowMoreText extends Component {\n _isMounted = false;\n\n constructor(props) {\n super(props);\n\n this.state = {\n expanded: false,\n truncated: false,\n };\n }\n\n static defaultProps = {\n lines: 3,\n more: \"Show more\",\n less: \"Show less\",\n anchorClass: \"show-more-less-clickable\",\n onClick: undefined,\n expanded: false,\n width: 0,\n keepNewLines: false,\n truncatedEndingComponent: \"... \",\n expandByClick: true,\n onTruncate: undefined,\n };\n\n static propTypes = {\n children: PropTypes.node,\n lines: PropTypes.number,\n more: PropTypes.node,\n less: PropTypes.node,\n anchorClass: PropTypes.string,\n className: PropTypes.string,\n onClick: PropTypes.func,\n expanded: PropTypes.bool,\n width: PropTypes.number,\n keepNewLines: PropTypes.bool,\n truncatedEndingComponent: PropTypes.node,\n expandByClick: PropTypes.bool,\n onTruncate: PropTypes.func,\n };\n\n componentDidMount() {\n this._isMounted = true;\n\n var _self = this;\n if (this._isMounted) {\n this.setState({\n expanded: _self.props.expanded,\n });\n }\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n }\n\n handleTruncate = (truncated) => {\n if (this._isMounted && truncated !== this.state.truncated) {\n this.setState({\n truncated,\n });\n if (truncated) {\n this.truncateRef.onResize();\n }\n this.props.onTruncate && this.props.onTruncate();\n }\n };\n\n toggleLines = (event) => {\n event.preventDefault();\n var _self = this;\n\n if (!_self.props.expandByClick) {\n if (_self.props.onClick) {\n _self.props.onClick(_self.state.expanded, event);\n }\n\n return;\n }\n\n if (this._isMounted) {\n this.setState(\n {\n expanded: !this.state.expanded,\n },\n () => {\n if (_self.props.onClick) {\n _self.props.onClick(_self.state.expanded, event);\n }\n }\n );\n }\n };\n\n render() {\n const {\n children,\n more,\n less,\n lines,\n anchorClass,\n className,\n width,\n keepNewLines,\n truncatedEndingComponent,\n onTruncate,\n } = this.props;\n\n const { expanded, truncated } = this.state;\n\n return (\n <div className={className}>\n <Truncate\n width={width}\n lines={!expanded && lines}\n ellipsis={\n <span>\n {truncatedEndingComponent}\n <span\n className={anchorClass}\n onClick={this.toggleLines}\n >\n {more}\n </span>\n </span>\n }\n onTruncate={this.handleTruncate}\n ref={(ref) => (this.truncateRef = ref)}\n >\n {keepNewLines && typeof children === \"string\"\n ? children.split(\"\\n\").map((line, i, arr) => {\n line = <span key={i}>{line}</span>;\n\n if (i === arr.length - 1) {\n return line;\n } else {\n return [line, <br key={i + \"br\"} />];\n }\n })\n : children}\n {!truncated && expanded && (\n <span>\n {\" \"}\n <span\n className={anchorClass}\n onClick={this.toggleLines}\n >\n {less}\n </span>\n </span>\n )}\n </Truncate>\n </div>\n );\n }\n}\n\nexport default ShowMoreText;\n"],"x_google_ignoreList":[0,1,2],"mappings":"slBAQa,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ACA,EAAA,UACA,EAAA,MACA,EAAA,aACA,EAAA,yBACA,EAAA,WACA,GACA,KAAK,OAEH,SAAE,EAAA,UAAU,GAAc,KAAK;AAErC,OACI,EAAA,EAAA,KAAC,MAAD,CAAgB,qDACZ,EAAA,EAAA,MAAC,EAAD,CACW,QACP,OAAQ,GAAY,EACpB,yCACI,EAAA,EAAA,MAAC,OAAD,CAAA,SAAA,CACK,kCACD,EAAA,EAAA,KAAC,OAAD,CACI,UAAW,EACX,QAAS,KAAK,qBAEb,OAIb,WAAY,KAAK,eACjB,IAAM,GAAS,KAAK,YAAc,WAftC,CAiBK,GAAoC,iBAAb,EAClB,EAAS,MAAM,MAAM,IAAA,CAAK,EAAM,EAAG,KAC/B,kCAAO,EAAA,EAAA,KAAC,OAAD,CAAA,SAAe,GAAJ,GAEd,IAAM,EAAI,OAAS,EACZ,EAEA,CAAC,kCAAM,EAAA,EAAA,KAAC,KAAD,CAAA,EAAS,EAAI,SAGnC,GACJ,GAAa,mCACX,EAAA,EAAA,MAAC,OAAD,CAAA,SAAA,CACK,oCACD,EAAA,EAAA,KAAC,OAAD,CACI,UAAW,EACX,QAAS,KAAK,qBAEb"}
package/package.json CHANGED
@@ -1,25 +1,39 @@
1
1
  {
2
2
  "name": "react-show-more-text",
3
- "version": "1.7.2-rc.0",
3
+ "version": "1.7.2-rc.2",
4
+ "type": "module",
4
5
  "description": "The text surrounded by the component will be truncated. Anything surrounded by the component could be evaluated as text. The component react-show-more-text/ShowMoreText is fork of react-show-more/ShowMore, applied improvements, works with React 16.x.x, added onClick event.",
5
- "main": "lib/ShowMoreText.js",
6
+ "main": "dist/index.cjs.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
6
16
  "files": [
7
- "lib"
17
+ "dist"
8
18
  ],
9
19
  "scripts": {
10
- "compile": "babel src/ShowMoreText.js src/Truncate.js --out-dir lib",
11
- "compile:watch": "onchange \"src/**/*.js\" -- npm run compile --silent --source-maps",
12
- "coverage": "nyc npm test && nyc report --reporter=text-lcov",
20
+ "build": "vite build",
21
+ "build:watch": "vite build --watch",
22
+ "dev": "vite",
23
+ "clean": "rm -rf dist",
24
+ "compile": "npm run build",
25
+ "compile:watch": "npm run build:watch",
26
+ "coverage": "vitest --coverage",
13
27
  "lint": "eslint .",
14
- "preversion": "npm run test",
28
+ "preversion": "npm run test && npm run build",
15
29
  "report-coverage": "npm run coverage | coveralls",
16
- "test": "jest --runInBand",
17
- "test:watch": "jest --watch --runInBand",
18
- "travis": "npm run compile && npm run test"
30
+ "test": "vitest",
31
+ "test:watch": "vitest --watch",
32
+ "travis": "npm run build && npm run test"
19
33
  },
20
34
  "repository": {
21
35
  "type": "git",
22
- "url": "git@github.com:devzonetech/react-show-more-text.git"
36
+ "url": "git+ssh://git@github.com/devzonetech/react-show-more-text.git"
23
37
  },
24
38
  "homepage": "https://github.com/devzonetech/react-show-more-text",
25
39
  "keywords": [
@@ -46,24 +60,25 @@
46
60
  "@babel/plugin-proposal-class-properties": "^7.12.1",
47
61
  "@babel/preset-env": "^7.22.10",
48
62
  "@babel/preset-react": "^7.22.10",
49
- "babel-jest": "^29.6.4",
50
- "cheerio": "0.22.0",
51
- "enzyme": "^3.11.0",
52
- "enzyme-adapter-react-16": "^1.15.5",
63
+ "@testing-library/jest-dom": "^5.16.5",
64
+ "@testing-library/react": "^12.1.5",
65
+ "@vitejs/plugin-react": "^4.2.0",
66
+ "@vitest/coverage-v8": "^4.1.4",
67
+ "@vitest/ui": "^1.0.0",
68
+ "cheerio": "^1.0.0-rc.12",
53
69
  "eslint": "^8.50.0",
54
- "jest": "^29.6.4",
55
- "jest-environment-jsdom": "^30.2.0",
70
+ "happy-dom": "^20.9.0",
71
+ "jsdom": "^29.0.2",
56
72
  "onchange": "^7.0.0",
57
73
  "react": "^16.14.0",
58
74
  "react-dom": "^16.14.0",
59
- "react-test-renderer": "^16.14.0"
75
+ "react-test-renderer": "^16.14.0",
76
+ "terser": "^5.30.0",
77
+ "vite": "^8.0.8",
78
+ "vitest": "^4.1.4"
60
79
  },
61
80
  "dependencies": {
62
81
  "prop-types": "^15.7.2"
63
82
  },
64
83
  "browserslist": "> 0.25%, not dead"
65
- ,
66
- "overrides": {
67
- "cheerio": "0.22.0"
68
- }
69
84
  }
@@ -1,139 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _propTypes = require("prop-types");
9
- var _Truncate = _interopRequireDefault(require("./Truncate"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
- class ShowMoreText extends _react.Component {
16
- constructor(props) {
17
- super(props);
18
- _defineProperty(this, "_isMounted", false);
19
- _defineProperty(this, "handleTruncate", truncated => {
20
- if (this._isMounted && truncated !== this.state.truncated) {
21
- this.setState({
22
- truncated
23
- });
24
- if (truncated) {
25
- this.truncateRef.onResize();
26
- }
27
- this.props.onTruncate && this.props.onTruncate();
28
- }
29
- });
30
- _defineProperty(this, "toggleLines", event => {
31
- event.preventDefault();
32
- var _self = this;
33
- if (!_self.props.expandByClick) {
34
- if (_self.props.onClick) {
35
- _self.props.onClick(_self.state.expanded, event);
36
- }
37
- return;
38
- }
39
- if (this._isMounted) {
40
- this.setState({
41
- expanded: !this.state.expanded
42
- }, () => {
43
- if (_self.props.onClick) {
44
- _self.props.onClick(_self.state.expanded, event);
45
- }
46
- });
47
- }
48
- });
49
- this.state = {
50
- expanded: false,
51
- truncated: false
52
- };
53
- }
54
- componentDidMount() {
55
- this._isMounted = true;
56
- var _self = this;
57
- if (this._isMounted) {
58
- this.setState({
59
- expanded: _self.props.expanded
60
- });
61
- }
62
- }
63
- componentWillUnmount() {
64
- this._isMounted = false;
65
- }
66
- render() {
67
- const {
68
- children,
69
- more,
70
- less,
71
- lines,
72
- anchorClass,
73
- className,
74
- width,
75
- keepNewLines,
76
- truncatedEndingComponent,
77
- onTruncate
78
- } = this.props;
79
- const {
80
- expanded,
81
- truncated
82
- } = this.state;
83
- return /*#__PURE__*/_react.default.createElement("div", {
84
- className: className
85
- }, /*#__PURE__*/_react.default.createElement(_Truncate.default, {
86
- width: width,
87
- lines: !expanded && lines,
88
- ellipsis: /*#__PURE__*/_react.default.createElement("span", null, truncatedEndingComponent, /*#__PURE__*/_react.default.createElement("span", {
89
- className: anchorClass,
90
- onClick: this.toggleLines
91
- }, more)),
92
- onTruncate: this.handleTruncate,
93
- ref: ref => this.truncateRef = ref
94
- }, keepNewLines ? children.split("\n").map((line, i, arr) => {
95
- line = /*#__PURE__*/_react.default.createElement("span", {
96
- key: i
97
- }, line);
98
- if (i === arr.length - 1) {
99
- return line;
100
- } else {
101
- return [line, /*#__PURE__*/_react.default.createElement("br", {
102
- key: i + "br"
103
- })];
104
- }
105
- }) : children, !truncated && expanded && /*#__PURE__*/_react.default.createElement("span", null, " ", /*#__PURE__*/_react.default.createElement("span", {
106
- className: anchorClass,
107
- onClick: this.toggleLines
108
- }, less))));
109
- }
110
- }
111
- _defineProperty(ShowMoreText, "defaultProps", {
112
- lines: 3,
113
- more: "Show more",
114
- less: "Show less",
115
- anchorClass: "show-more-less-clickable",
116
- onClick: undefined,
117
- expanded: false,
118
- width: 0,
119
- keepNewLines: false,
120
- truncatedEndingComponent: "... ",
121
- expandByClick: true,
122
- onTruncate: undefined
123
- });
124
- _defineProperty(ShowMoreText, "propTypes", {
125
- children: _propTypes.PropTypes.node,
126
- lines: _propTypes.PropTypes.number,
127
- more: _propTypes.PropTypes.node,
128
- less: _propTypes.PropTypes.node,
129
- anchorClass: _propTypes.PropTypes.string,
130
- className: _propTypes.PropTypes.string,
131
- onClick: _propTypes.PropTypes.func,
132
- expanded: _propTypes.PropTypes.bool,
133
- width: _propTypes.PropTypes.number,
134
- keepNewLines: _propTypes.PropTypes.bool,
135
- truncatedEndingComponent: _propTypes.PropTypes.node,
136
- expandByClick: _propTypes.PropTypes.bool,
137
- onTruncate: _propTypes.PropTypes.func
138
- });
139
- var _default = exports.default = ShowMoreText;
package/lib/Truncate.js DELETED
@@ -1,372 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
11
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
14
- * LICENSE
15
- * https://github.com/pablosichert/react-truncate/blob/master/LICENSE.md
16
- *
17
- * ISC License
18
- Copyright (c) 2016, One.com
19
-
20
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is
21
- hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
24
- INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
25
- FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
26
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
27
- CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28
- */ // Initial version of react-truncate module (v2.4.0)
29
- class Truncate extends _react.default.Component {
30
- constructor() {
31
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
- args[_key] = arguments[_key];
33
- }
34
- super(...args);
35
- _defineProperty(this, "state", {});
36
- _defineProperty(this, "extractReplaceLinksKeys", content => {
37
- var _self = this,
38
- i = 0;
39
- this.replacedLinks = [];
40
- content.replace(/(<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>)/g, function () {
41
- const item = Array.prototype.slice.call(arguments, 1, 4);
42
- item.key = "[" + "@".repeat(item[2].length - 1) + "=" + i++ + "]";
43
- _self.replacedLinks.push(item);
44
- content = content.replace(item[0], item.key);
45
- });
46
- return content;
47
- });
48
- _defineProperty(this, "restoreReplacedLinks", content => {
49
- this.replacedLinks.forEach(item => {
50
- content = content.replace(item.key, item[0]);
51
- });
52
- return this.createMarkup(content);
53
- });
54
- _defineProperty(this, "stripHtmlTags", str => {
55
- return str.replace(/<[^>]*>/g, " ");
56
- });
57
- // Shim innerText to consistently break lines at <br/> but not at \n
58
- _defineProperty(this, "innerText", node => {
59
- const div = document.createElement("div");
60
- const contentKey = "innerText" in window.HTMLElement.prototype ? "innerText" : "textContent";
61
- const content = node.innerHTML.replace(/\r\n|\r|\n/g, " ");
62
- div.innerHTML = this.extractReplaceLinksKeys(content);
63
- let text = div[contentKey];
64
- const test = document.createElement("div");
65
- test.innerHTML = "foo<br/>bar";
66
- if (test[contentKey].replace(/\r\n|\r/g, "\n") !== "foo\nbar") {
67
- div.innerHTML = div.innerHTML.replace(/<br.*?[\/]?>/gi, "\n");
68
- text = div[contentKey];
69
- }
70
- return text;
71
- });
72
- _defineProperty(this, "onResize", () => {
73
- this.calcTargetWidth();
74
- });
75
- _defineProperty(this, "onTruncate", didTruncate => {
76
- const {
77
- onTruncate
78
- } = this.props;
79
- if (typeof onTruncate === "function") {
80
- this.timeout = window.requestAnimationFrame(() => {
81
- onTruncate(didTruncate);
82
- });
83
- }
84
- });
85
- _defineProperty(this, "calcTargetWidth", callback => {
86
- const {
87
- elements: {
88
- target
89
- },
90
- calcTargetWidth,
91
- canvasContext,
92
- props: {
93
- width
94
- }
95
- } = this;
96
-
97
- // Calculation is no longer relevant, since node has been removed
98
- if (!target) {
99
- return;
100
- }
101
- const targetWidth = width ||
102
- // Floor the result to deal with browser subpixel precision
103
- Math.floor(target.parentNode.getBoundingClientRect().width);
104
-
105
- // Delay calculation until parent node is inserted to the document
106
- // Mounting order in React is ChildComponent, ParentComponent
107
- if (!targetWidth) {
108
- return window.requestAnimationFrame(() => calcTargetWidth(callback));
109
- }
110
- const style = window.getComputedStyle(target);
111
- const font = [style["font-weight"], style["font-style"], style["font-size"], style["font-family"]].join(" ");
112
- canvasContext.font = font;
113
- this.setState({
114
- targetWidth
115
- }, callback);
116
- });
117
- _defineProperty(this, "measureWidth", text => {
118
- return this.canvasContext.measureText(this.stripHtmlTags(text)).width;
119
- });
120
- _defineProperty(this, "ellipsisWidth", node => {
121
- return node.offsetWidth;
122
- });
123
- _defineProperty(this, "trimRight", text => {
124
- return text.replace(/\s+$/, "");
125
- });
126
- _defineProperty(this, "createMarkup", str => {
127
- return /*#__PURE__*/_react.default.createElement("span", {
128
- dangerouslySetInnerHTML: {
129
- __html: str
130
- }
131
- });
132
- });
133
- _defineProperty(this, "getLines", () => {
134
- const {
135
- elements,
136
- props: {
137
- lines: numLines,
138
- ellipsis,
139
- trimWhitespace
140
- },
141
- state: {
142
- targetWidth
143
- },
144
- innerText,
145
- measureWidth,
146
- onTruncate,
147
- trimRight,
148
- renderLine,
149
- restoreReplacedLinks
150
- } = this;
151
- const lines = [];
152
- const text = innerText(elements.text);
153
- const textLines = text.split("\n").map(line => line.split(" "));
154
- let didTruncate = true;
155
- const ellipsisWidth = this.ellipsisWidth(this.elements.ellipsis);
156
- for (let line = 1; line <= numLines; line++) {
157
- const textWords = textLines[0];
158
-
159
- // Handle newline
160
- if (textWords.length === 0) {
161
- lines.push();
162
- textLines.shift();
163
- line--;
164
- continue;
165
- }
166
- let resultLine = textWords.join(" ");
167
- if (measureWidth(resultLine) <= targetWidth) {
168
- if (textLines.length === 1) {
169
- // Line is end of text and fits without truncating
170
- didTruncate = false;
171
- resultLine = restoreReplacedLinks(resultLine);
172
- lines.push(resultLine);
173
- break;
174
- }
175
- }
176
- if (line === numLines) {
177
- // Binary search determining the longest possible line inluding truncate string
178
- const textRest = textWords.join(" ");
179
- let lower = 0;
180
- let upper = textRest.length - 1;
181
- while (lower <= upper) {
182
- const middle = Math.floor((lower + upper) / 2);
183
- const testLine = textRest.slice(0, middle + 1);
184
- if (measureWidth(testLine) + ellipsisWidth <= targetWidth) {
185
- lower = middle + 1;
186
- } else {
187
- upper = middle - 1;
188
- }
189
- }
190
- let lastLineText = textRest.slice(0, lower);
191
- if (trimWhitespace) {
192
- lastLineText = trimRight(lastLineText);
193
-
194
- // Remove blank lines from the end of text
195
- while (!lastLineText.length && lines.length) {
196
- const prevLine = lines.pop();
197
- lastLineText = trimRight(prevLine);
198
- }
199
- }
200
- if (lastLineText.substr(lastLineText.length - 2) === "][") {
201
- lastLineText = lastLineText.substring(0, lastLineText.length - 1);
202
- }
203
- lastLineText = lastLineText.replace(/\[@+$/, "");
204
- lastLineText = restoreReplacedLinks(lastLineText);
205
- resultLine = /*#__PURE__*/_react.default.createElement("span", null, lastLineText, ellipsis);
206
- } else {
207
- // Binary search determining when the line breaks
208
- let lower = 0;
209
- let upper = textWords.length - 1;
210
- while (lower <= upper) {
211
- const middle = Math.floor((lower + upper) / 2);
212
- const testLine = textWords.slice(0, middle + 1).join(" ");
213
- if (measureWidth(testLine) <= targetWidth) {
214
- lower = middle + 1;
215
- } else {
216
- upper = middle - 1;
217
- }
218
- }
219
-
220
- // The first word of this line is too long to fit it
221
- if (lower === 0) {
222
- // Jump to processing of last line
223
- line = numLines - 1;
224
- continue;
225
- }
226
- resultLine = textWords.slice(0, lower).join(" ");
227
- resultLine = restoreReplacedLinks(resultLine);
228
- textLines[0].splice(0, lower);
229
- }
230
- lines.push(resultLine);
231
- }
232
- onTruncate(didTruncate);
233
- return lines.map(renderLine);
234
- });
235
- _defineProperty(this, "renderLine", (line, i, arr) => {
236
- if (i === arr.length - 1) {
237
- return /*#__PURE__*/_react.default.createElement("span", {
238
- key: i
239
- }, line);
240
- } else {
241
- const br = /*#__PURE__*/_react.default.createElement("br", {
242
- key: i + "br"
243
- });
244
- if (line) {
245
- return [/*#__PURE__*/_react.default.createElement("span", {
246
- key: i
247
- }, line), br];
248
- } else {
249
- return br;
250
- }
251
- }
252
- });
253
- _defineProperty(this, "styles", {
254
- ellipsis: {
255
- position: "fixed",
256
- visibility: "hidden",
257
- top: 0,
258
- left: 0
259
- }
260
- });
261
- this.elements = {};
262
- this.replacedLinks = [];
263
- }
264
- componentDidMount() {
265
- const {
266
- elements: {
267
- text
268
- },
269
- calcTargetWidth,
270
- onResize
271
- } = this;
272
- const canvas = document.createElement("canvas");
273
- this.canvasContext = canvas.getContext("2d");
274
- calcTargetWidth(() => {
275
- // Node not needed in document tree to read its content
276
- if (text && text.parentNode) {
277
- text.parentNode.removeChild(text);
278
- }
279
- });
280
- window.addEventListener("resize", onResize);
281
- }
282
- componentDidUpdate(prevProps) {
283
- // Render was based on outdated refs and needs to be rerun
284
- if (this.props.children !== prevProps.children) {
285
- this.forceUpdate();
286
- }
287
-
288
- // If the width prop has changed, recalculate size of contents
289
- if (this.props.width !== prevProps.width) {
290
- this.calcTargetWidth();
291
- }
292
- }
293
- componentWillUnmount() {
294
- const {
295
- elements: {
296
- ellipsis
297
- },
298
- onResize,
299
- timeout
300
- } = this;
301
- if (ellipsis.parentNode) {
302
- ellipsis.parentNode.removeChild(ellipsis);
303
- }
304
- window.removeEventListener("resize", onResize);
305
- window.cancelAnimationFrame(timeout);
306
- }
307
- render() {
308
- const {
309
- elements: {
310
- target
311
- },
312
- props: {
313
- children,
314
- ellipsis,
315
- lines,
316
- ...spanProps
317
- },
318
- state: {
319
- targetWidth
320
- },
321
- getLines,
322
- onTruncate
323
- } = this;
324
- let text;
325
- const mounted = !!(target && targetWidth);
326
- if (typeof window !== "undefined" && mounted) {
327
- if (lines > 0) {
328
- text = getLines();
329
- } else {
330
- text = children;
331
- onTruncate(false);
332
- }
333
- }
334
- delete spanProps.onTruncate;
335
- delete spanProps.trimWhitespace;
336
- return /*#__PURE__*/_react.default.createElement("span", _extends({}, spanProps, {
337
- ref: targetEl => {
338
- this.elements.target = targetEl;
339
- }
340
- }), /*#__PURE__*/_react.default.createElement("span", {
341
- style: {
342
- display: "block",
343
- maxWidth: spanProps.width > 0 ? `${spanProps.width}px` : "unset"
344
- }
345
- }, text), /*#__PURE__*/_react.default.createElement("span", {
346
- ref: textEl => {
347
- this.elements.text = textEl;
348
- }
349
- }, children), /*#__PURE__*/_react.default.createElement("span", {
350
- ref: ellipsisEl => {
351
- this.elements.ellipsis = ellipsisEl;
352
- },
353
- style: this.styles.ellipsis
354
- }, ellipsis));
355
- }
356
- }
357
- exports.default = Truncate;
358
- _defineProperty(Truncate, "propTypes", {
359
- children: _propTypes.default.node,
360
- ellipsis: _propTypes.default.node,
361
- lines: _propTypes.default.oneOfType([_propTypes.default.oneOf([false]), _propTypes.default.number]),
362
- trimWhitespace: _propTypes.default.bool,
363
- width: _propTypes.default.number,
364
- onTruncate: _propTypes.default.func
365
- });
366
- _defineProperty(Truncate, "defaultProps", {
367
- children: "",
368
- ellipsis: "…",
369
- lines: 1,
370
- trimWhitespace: false,
371
- width: 0
372
- });