sdk/dist/lib.umd.js

37 lines
63 KiB
JavaScript
Raw Normal View History

(function(X,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],c):(X=typeof globalThis<"u"?globalThis:X||self,c(X["lume-sdk"]={},X.React))})(this,function(X,c){"use strict";function dr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const L=dr(c);var Ve={exports:{}},pe={};/**
* @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 lt;function fr(){if(lt)return pe;lt=1;var e=c,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(l,m,p){var f,u={},h=null,y=null;p!==void 0&&(h=""+p),m.key!==void 0&&(h=""+m.key),m.ref!==void 0&&(y=m.ref);for(f in m)n.call(m,f)&&!a.hasOwnProperty(f)&&(u[f]=m[f]);if(l&&l.defaultProps)for(f in m=l.defaultProps,m)u[f]===void 0&&(u[f]=m[f]);return{$$typeof:t,type:l,key:h,ref:y,props:u,_owner:i.current}}return pe.Fragment=r,pe.jsx=s,pe.jsxs=s,pe}var me={};/**
* @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.
2023-10-08 15:35:07 +00:00
*/var ut;function pr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){var e=c,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),E=Symbol.iterator,P="@@iterator";function _(o){if(o===null||typeof o!="object")return null;var d=E&&o[E]||o[P];return typeof d=="function"?d:null}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(o){{for(var d=arguments.length,g=new Array(d>1?d-1:0),b=1;b<d;b++)g[b-1]=arguments[b];A("error",o,g)}}function A(o,d,g){{var b=R.ReactDebugCurrentFrame,T=b.getStackAddendum();T!==""&&(d+="%s",g=g.concat([T]));var j=g.map(function(S){return String(S)});j.unshift("Warning: "+d),Function.prototype.apply.call(console[o],console,j)}}var D=!1,se=!1,B=!1,le=!1,ue=!1,Y;Y=Symbol.for("react.module.reference");function ve(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===a||ue||o===i||o===p||o===f||le||o===y||D||se||B||typeof o=="object"&&o!==null&&(o.$$typeof===h||o.$$typeof===u||o.$$typeof===s||o.$$typeof===l||o.$$typeof===m||o.$$typeof===Y||o.getModuleId!==void 0))}function be(o,d,g){var b=o.displayName;if(b)return b;var T=d.displayName||d.name||"";return T!==""?g+"("+T+")":g}function M(o){return o.displayName||"Context"}function F(o){if(o==null)return null;if(typeof o.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case p:return"Suspense";case f:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var d=o;return M(d)+".Consumer";case s:var g=o;return M(g._context)+".Provider";case m:return be(o,o.render,"ForwardRef");case u:var b=o.displayName||null;return b!==null?b:F(o.type)||"Memo";case h:{var T=o,j=T._payload,S=T._init;try{return F(S(j))}catch{return null}}}return null}var z=Object.assign,U=0,ne,ye,ce,Z,xe,K,oe;function $(){}$.__reactDisabledLog=!0;function bo(){{if(U===0){ne=console.log,ye=console.info,ce=console.warn,Z=console.error,xe=console.group,K=console.groupCollapsed,oe=console.groupEnd;var o={configurable:!0,enumerable:!0,value:$,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}U++}}function yo(){{if(U--,U===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},o,{value:ne}),info:z({},o,{value:ye}),warn:z({},o,{value:ce}),error:z({},o,{value:Z}),group:z({},o,{value:xe}),groupCollapsed:z({},o,{value:K}),groupEnd:z({},o,{value:oe})})}U<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var et=R.ReactCurrentDispatcher,tt;function Oe(o,d,g){{if(tt===void 0)try{throw Error()}catch(T){var b=T.stack.trim().match(/\n( *(at )?)/);tt=b&&b[1]||""}return`
`+tt+o}}var rt=!1,Ae;{var xo=typeof WeakMap=="function"?WeakMap:Map;Ae=new xo}function Xt(o,d){if(!o||rt)return"";{var g=Ae.get(o);if(g!==void 0)return g}var b;rt=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=et.current,et.current=null,bo();try{if(d){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[])}catch(q){b=q}Reflect.construct(o,[],S)}else{try{S.call()}catch(q){b=q}o.call(S.prototype)}}else{try{throw Error()}catch(q){b=q}o()}}catch(q){if(q&&b&&typeof q.stack=="string"){for(var C=q.stack.split(`
`),N=b.stack.split(`
`),I=C.length-1,V=N.length-1;I>=1&&V>=0&&C[I]!==N[V];)V--;for(;I>=1&&V>=0;I--,V--)if(C[I]!==N[V]){if(I!==1||V!==1)do if(I--,V--,V<0||C[I]!==N[V]){var W=`
`+C[I].replace(" at new "," at ");return o.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",o.displayName)),typeof o=="function"&&Ae.set(o,W),W}while(I>=1&&V>=0);break}}}finally{rt=!1,et.current=j,yo(),Error.prepareStackTrace=T}var fe=o?o.displayName||o.name:"",cr=fe?Oe(fe):"";return typeof o=="function"&&Ae.set(o,cr),cr}function wo(o,d,g){return Xt(o,!1)}function Co(o){var d=o.prototype;return!!(d&&d.isReactComponent)}function _e(o,d,g){if(o==null)return"";if(typeof o=="function")return Xt(o,Co(o));if(typeof o=="string")return Oe(o);switch(o){case p:return Oe("Suspense");case f:return Oe("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case m:return wo(o.render);case u:return _e(o.type,d,g);case h:{var b=o,T=b._payload,j=b._init;try{return _e(j(T),d,g)}catch{}}}return""}var Ie=Object.prototype.hasOwnProperty,Jt={},Qt=R.ReactDebugCurrentFrame;function Re(o){if(o){var d=o._owner,g=_e(o.type,o._source,d?d.type:null);Qt.setExtraStackFrame(g)}else Qt.setExtraStackFrame(null)}function Eo(o,d,g,b,T){{var j=Function.call.bind(Ie);for(var S in o)if(j(o,S)){var C=void 0;try{if(typeof o[S]!="function"){var N=Error((b||"React class")+": "+g+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}C=o[S](d,S,b,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(I){C=I}C&&!(C instanceof Error)&&(Re(T),v("%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).",b||"React class",g,S,typeof C),Re(null)),C instanceof Error&&!(C.message in Jt)&&(Jt[C.message]=!0,Re(T),v("Failed %s type: %s",g,C.message),Re(null))}}}var So=Array.isArray;function nt(o){return So(o)}function Po(o){{var d=typeof Symbol=="function"&&Symbol.toStringTag,g=d&&o[Symbol.toStringTag]||o.constructor.name||"Object";return g}}function ko(o){try{return er(o),!1}catch{return!0}}function er(o){return""+o}function tr(o){if(ko(o))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Po(o)),er(o)}var we=R.ReactCurrentOwner,To={key:!0,ref:!0,__self:!0,__source:!0},rr,nr,ot;ot={};function Mo(o){if(Ie.call(o,"ref")){var d=Object.getOwnPropertyDescriptor(o,"ref").get;if(d&&d.isReactWarning)return!1}return o.ref!==void 0}function jo(o){if(Ie.call(o,"key")){var d=Object.getOwnPropertyDescriptor(o,"key").get;if(d&&d.isReactWarning)return!1}return o.key!==void 0}function Oo(o,d){if(typeof o.ref=="string"&&we.current&&d&&we.current.stateNode!==d){var g=F(we.current.type);ot[g]||(v('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',F(we.current.type),o.ref),ot[g]=!0)}}function Ao(o,d){{var g=function(){rr||(rr=!0,v("%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)",d))};g.isReactWarning=!0,Object.defineProperty(o,"key",{get:g,configurable:!0})}}function _o(o,d){{var g=function(){nr||(nr=!0,v("%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)",d))};g.isReactWarning=!0,Object.defineProperty(o,"ref",{get:g,configurable:!0})}}var Io=function(o,d,g,b,T,j,S){var C={$$typeof:t,type:o,key:d,ref:g,props:S,_owner:j};return C.
Check the render method of \``+o+"`."}return""}}function Vo(o){{if(o!==void 0){var d=o.fileName.replace(/^.*[\\\/]/,""),g=o.lineNumber;return`
Check your code at `+d+":"+g+"."}return""}}var ar={};function Lo(o){{var d=ir();if(!d){var g=typeof o=="string"?o:o.displayName||o.name;g&&(d=`
2023-10-08 15:35:07 +00:00
Check the top-level render call using <`+g+">.")}return d}}function sr(o,d){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var g=Lo(d);if(ar[g])return;ar[g]=!0;var b="";o&&o._owner&&o._owner!==it.current&&(b=" It was passed a child from "+F(o._owner.type)+"."),de(o),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,b),de(null)}}function lr(o,d){{if(typeof o!="object")return;if(nt(o))for(var g=0;g<o.length;g++){var b=o[g];st(b)&&sr(b,d)}else if(st(o))o._store&&(o._store.validated=!0);else if(o){var T=_(o);if(typeof T=="function"&&T!==o.entries)for(var j=T.call(o),S;!(S=j.next()).done;)st(S.value)&&sr(S.value,d)}}}function $o(o){{var d=o.type;if(d==null||typeof d=="string")return;var g;if(typeof d=="function")g=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===m||d.$$typeof===u))g=d.propTypes;else return;if(g){var b=F(d);Eo(g,o.props,"prop",b,o)}else if(d.PropTypes!==void 0&&!at){at=!0;var T=F(d);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function No(o){{for(var d=Object.keys(o.props),g=0;g<d.length;g++){var b=d[g];if(b!=="children"&&b!=="key"){de(o),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),de(null);break}}o.ref!==null&&(de(o),v("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}}function ur(o,d,g,b,T,j){{var S=ve(o);if(!S){var C="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(C+=" 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 N=Vo(T);N?C+=N:C+=ir();var I;o===null?I="null":nt(o)?I="array":o!==void 0&&o.$$typeof===t?(I="<"+(F(o.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):I=typeof o,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",I,C)}var V=Ro(o,d,g,T,j);if(V==null)return V;if(S){var W=d.children;if(W!==void 0)if(b)if(nt(W)){for(var fe=0;fe<W.length;fe++)lr(W[fe],o);Object.freeze&&Object.freeze(W)}else v("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 lr(W,o)}return o===n?No(V):$o(V),V}}function Fo(o,d,g){return ur(o,d,g,!0)}function zo(o,d,g){return ur(o,d,g,!1)}var Wo=zo,Go=Fo;me.Fragment=n,me.jsx=Wo,me.jsxs=Go}()),me}process.env.NODE_ENV==="production"?Ve.exports=fr():Ve.exports=pr();var k=Ve.exports;const mr=c.createContext(void 0);function gr(){const e=c.useContext(mr);if(!e)throw new Error("useLume must be used within a LumeProvider");const{lume:t}=e;return t}function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ce.apply(this,arguments)}function hr(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vr(...e){return t=>e.forEach(r=>hr(r,t))}const ct=c.forwardRef((e,t)=>{const{children:r,...n}=e,i=c.Children.toArray(r),a=i.find(yr);if(a){const s=a.props.children,l=i.map(m=>m===a?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:m);return c.createElement(Le,Ce({},n,{ref:t}),c.isValidElement(s)?c.cloneElement(s,void 0,l):null)}return c.createElement(Le,Ce({},n,{ref:t}),r)});ct.displayName="Slot";const Le=c.forwardRef((e,t)=>{const{children:r,...n}=e;return c.isValidElement(r)?c.cloneElement(r,{...xr(n,r.props),ref:t?vr(t,r.ref):r.ref}):c.Children.count(r)>1?c.Children.only(null):null});Le.displayName="SlotClone";const br=({children:e})=>c.createElement(c.Fragment,null,e);function yr(e){return c
[data-motion-pop-id="${r}"] {
position: absolute !important;
width: ${a}px !important;
height: ${s}px !important;
top: ${l}px !important;
left: ${m}px !important;
}
2023-10-08 15:35:07 +00:00
`),()=>{document.head.removeChild(p)}},[t]),L.createElement(Xn,{isPresent:t,childRef:n,sizeRef:i},L.cloneElement(e,{ref:n}))}const Xe=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s})=>{const l=Bt(Qn),m=c.useId(),p=c.useMemo(()=>({id:m,initial:t,isPresent:r,custom:i,onExitComplete:f=>{l.set(f,!0);for(const u of l.values())if(!u)return;n&&n()},register:f=>(l.set(f,!1),()=>l.delete(f))}),a?void 0:[r]);return c.useMemo(()=>{l.forEach((f,u)=>l.set(u,!1))},[r]),L.useEffect(()=>{!r&&!l.size&&n&&n()},[r]),s==="popLayout"&&(e=L.createElement(Jn,{isPresent:r},e)),L.createElement(ze.Provider,{value:p},e)};function Qn(){return new Map}function eo(e){return c.useEffect(()=>()=>e(),[])}const ae=e=>e.key||"";function to(e,t){e.forEach(r=>{const n=ae(r);t.set(n,r)})}function ro(e){const t=[];return c.Children.forEach(e,r=>{c.isValidElement(r)&&t.push(r)}),t}const Je=({children:e,custom:t,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const l=c.useContext(Ot).forceRender||Kn()[0],m=Yt(),p=ro(e);let f=p;const u=c.useRef(new Map).current,h=c.useRef(f),y=c.useRef(new Map).current,E=c.useRef(!0);if(We(()=>{E.current=!1,to(p,y),h.current=f}),eo(()=>{E.current=!0,y.clear(),u.clear()}),E.current)return L.createElement(L.Fragment,null,f.map(v=>L.createElement(Xe,{key:ae(v),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:a,mode:s},v)));f=[...f];const P=h.current.map(ae),_=p.map(ae),R=P.length;for(let v=0;v<R;v++){const A=P[v];_.indexOf(A)===-1&&!u.has(A)&&u.set(A,void 0)}return s==="wait"&&u.size&&(f=[]),u.forEach((v,A)=>{if(_.indexOf(A)!==-1)return;const D=y.get(A);if(!D)return;const se=P.indexOf(A);let B=v;if(!B){const le=()=>{y.delete(A),u.delete(A);const ue=h.current.findIndex(Y=>Y.key===A);if(h.current.splice(ue,1),!u.size){if(h.current=p,m.current===!1)return;l(),n&&n()}};B=L.createElement(Xe,{key:ae(D),isPresent:!1,onExitComplete:le,custom:t,presenceAffectsLayout:a,mode:s},D),u.set(A,B)}f.splice(se,0,B)}),f=f.map(v=>{const A=v.key;return u.has(A)?v:L.createElement(Xe,{key:ae(v),isPresent:!0,presenceAffectsLayout:a,mode:s},v)}),process.env.NODE_ENV!=="production"&&s==="wait"&&f.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),L.createElement(L.Fragment,null,u.size?f:f.map(v=>c.cloneElement(v)))},no=c.createContext(void 0);function Ut(e){const t=c.useContext(no);if(t===void 0)throw new Error("useSwitchableComponent hook is being used outside of its context. Please ensure that it is wrapped within a <SwitchableComponentProvider>.");return c.useEffect(()=>{e&&t.visibleComponent&&t.setVisibleComponent(e)},[e]),t}Symbol("DEFAULT_COMPONENT").toString();function je(e,t){return{render(r){return k.jsx(e,{...r})},index:t||Symbol(e.name).toString()}}const Zt=L.forwardRef(({className:e,type:t,...r},n)=>k.jsx("input",{type:t,className:"d411x41bq1lnhm670n "+Et("flex h-9 w-full text-white rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 focus:border-white",e),ref:n,...r}));Zt.displayName="Input";function Qe(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var oo=["color"],io=c.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=Qe(e,oo);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),c.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78
//# sourceMappingURL=lib.umd.js.map