UNPKG

fine-import

Version:

A React component for importing files that's just about fine.

28 lines (24 loc) 13.9 kB
(function(b,E){typeof exports=="object"&&typeof module<"u"?module.exports=E(require("react")):typeof define=="function"&&define.amd?define(["react"],E):(b=typeof globalThis<"u"?globalThis:b||self,b["fine-import"]=E(b.React))})(this,function(b){"use strict";var E={exports:{}},w={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Z;function Se(){if(Z)return w;Z=1;var j=b,k=Symbol.for("react.element"),U=Symbol.for("react.fragment"),T=Object.prototype.hasOwnProperty,I=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,W={key:!0,ref:!0,__self:!0,__source:!0};function D(m,l,O){var v,h={},R=null,Y=null;O!==void 0&&(R=""+O),l.key!==void 0&&(R=""+l.key),l.ref!==void 0&&(Y=l.ref);for(v in l)T.call(l,v)&&!W.hasOwnProperty(v)&&(h[v]=l[v]);if(m&&m.defaultProps)for(v in l=m.defaultProps,l)h[v]===void 0&&(h[v]=l[v]);return{$$typeof:k,type:m,key:R,ref:Y,props:h,_owner:I.current}}return w.Fragment=U,w.jsx=D,w.jsxs=D,w}var x={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Q;function Ce(){return Q||(Q=1,process.env.NODE_ENV!=="production"&&function(){var j=b,k=Symbol.for("react.element"),U=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),m=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),ee=Symbol.iterator,xe="@@iterator";function je(e){if(e===null||typeof e!="object")return null;var r=ee&&e[ee]||e[xe];return typeof r=="function"?r:null}var S=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ke("error",e,t)}}function ke(e,r,t){{var n=S.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var De=!1,Fe=!1,Ae=!1,Ie=!1,We=!1,re;re=Symbol.for("react.module.reference");function Ye(e){return!!(typeof e=="string"||typeof e=="function"||e===T||e===W||We||e===I||e===O||e===v||Ie||e===Y||De||Fe||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===h||e.$$typeof===D||e.$$typeof===m||e.$$typeof===l||e.$$typeof===re||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function te(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case U:return"Portal";case W:return"Profiler";case I:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return te(r)+".Consumer";case D:var t=e;return te(t._context)+".Provider";case l:return $e(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:g(e.type)||"Memo";case R:{var o=e,u=o._payload,i=o._init;try{return g(i(u))}catch{return null}}}return null}var _=Object.assign,F=0,ne,ae,ie,oe,ue,se,fe;function le(){}le.__reactDisabledLog=!0;function Ne(){{if(F===0){ne=console.log,ae=console.info,ie=console.warn,oe=console.error,ue=console.group,se=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Le(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_({},e,{value:ne}),info:_({},e,{value:ae}),warn:_({},e,{value:ie}),error:_({},e,{value:oe}),group:_({},e,{value:ue}),groupCollapsed:_({},e,{value:se}),groupEnd:_({},e,{value:fe})})}F<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=S.ReactCurrentDispatcher,q;function $(e,r,t){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return` `+q+e}}var J=!1,N;{var Ve=typeof WeakMap=="function"?WeakMap:Map;N=new Ve}function ce(e,r){if(!e||J)return"";{var t=N.get(e);if(t!==void 0)return t}var n;J=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=B.current,B.current=null,Ne();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(y){n=y}Reflect.construct(e,[],i)}else{try{i.call()}catch(y){n=y}e.call(i.prototype)}}else{try{throw Error()}catch(y){n=y}e()}}catch(y){if(y&&n&&typeof y.stack=="string"){for(var a=y.stack.split(` `),d=n.stack.split(` `),s=a.length-1,f=d.length-1;s>=1&&f>=0&&a[s]!==d[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==d[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==d[f]){var p=` `+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&N.set(e,p),p}while(s>=1&&f>=0);break}}}finally{J=!1,B.current=u,Le(),Error.prepareStackTrace=o}var P=e?e.displayName||e.name:"",Oe=P?$(P):"";return typeof e=="function"&&N.set(e,Oe),Oe}function Me(e,r,t){return ce(e,!1)}function Ue(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function L(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Ue(e));if(typeof e=="string")return $(e);switch(e){case O:return $("Suspense");case v:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Me(e.render);case h:return L(e.type,r,t);case R:{var n=e,o=n._payload,u=n._init;try{return L(u(o),r,t)}catch{}}}return""}var V=Object.prototype.hasOwnProperty,de={},ve=S.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function Be(e,r,t,n,o){{var u=Function.call.bind(V);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" 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 d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(M(o),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),M(null)),a instanceof Error&&!(a.message in de)&&(de[a.message]=!0,M(o),c("Failed %s type: %s",t,a.message),M(null))}}}var qe=Array.isArray;function G(e){return qe(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function he(e){if(Ge(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),pe(e)}var A=S.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},ge,ye,H;H={};function ze(e){if(V.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ke(e){if(V.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Xe(e,r){if(typeof e.ref=="string"&&A.current&&r&&A.current.stateNode!==r){var t=g(A.current.type);H[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',g(A.current.type),e.ref),H[t]=!0)}}function Ze(e,r){{var t=function(){ge||(ge=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){ye||(ye=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var er=function(e,r,t,n,o,u,i){var a={$$typeof:k,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function rr(e,r,t,n,o){{var u,i={},a=null,d=null;t!==void 0&&(he(t),a=""+t),Ke(r)&&(he(r.key),a=""+r.key),ze(r)&&(d=r.ref,Xe(r,o));for(u in r)V.call(r,u)&&!He.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||d){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ze(i,f),d&&Qe(i,f)}return er(e,a,d,o,n,A.current,i)}}var z=S.ReactCurrentOwner,be=S.ReactDebugCurrentFrame;function C(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);be.setExtraStackFrame(t)}else be.setExtraStackFrame(null)}var K;K=!1;function X(e){return typeof e=="object"&&e!==null&&e.$$typeof===k}function Ee(){{if(z.current){var e=g(z.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return` Check your code at `+r+":"+t+"."}return""}}var me={};function nr(e){{var r=Ee();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=` Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==z.current&&(n=" It was passed a child from "+g(e._owner.type)+"."),C(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),C(null)}}function _e(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Re(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var o=je(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)X(i.value)&&Re(i.value,r)}}}function ar(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=g(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!K){K=!0;var o=g(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){C(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),C(null);break}}e.ref!==null&&(C(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}}function Te(e,r,t,n,o,u){{var i=Ye(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=tr(o);d?a+=d:a+=Ee();var s;e===null?s="null":G(e)?s="array":e!==void 0&&e.$$typeof===k?(s="<"+(g(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=rr(e,r,t,o,u);if(f==null)return f;if(i){var p=r.children;if(p!==void 0)if(n)if(G(p)){for(var P=0;P<p.length;P++)_e(p[P],e);Object.freeze&&Object.freeze(p)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _e(p,e)}return e===T?ir(f):ar(f),f}}function or(e,r,t){return Te(e,r,t,!0)}function ur(e,r,t){return Te(e,r,t,!1)}var sr=ur,fr=or;x.Fragment=T,x.jsx=sr,x.jsxs=fr}()),x}process.env.NODE_ENV==="production"?E.exports=Se():E.exports=Ce();var Pe=E.exports;const we=Pe.jsxs;return({name:j})=>we("div",{className:"bg-red-100",children:["Hey, ",j,"!"]})});