ywana-core8 0.0.3 → 0.0.7
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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -2
- package/src/domain/CollectionPage.js +9 -4
- package/src/index.js +1 -0
- package/src/site/index.js +1 -0
- package/src/upload/UploadArea.js +1 -3
- package/src/upload/UploadFile.js +1 -3
- package/src/upload/index.js +4 -1
- package/src/upload/uploader.js +0 -1
package/dist/index.modern.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import"material-design-icons-iconfont/dist/material-design-icons.css";var e=function(e,n,t,r){void 0===t&&(t=null);try{console.log("FETCH",e,n);var o={method:e,mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json","x-access-token":r},body:t};return Promise.resolve(function(e,t){try{var r=Promise.resolve(fetch(n,o)).then(function(e){var n;function t(t){if(n)return t;throw e}var r=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){return n=1,e})}();return r&&r.then?r.then(t):t(r)})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){if(e instanceof Error)throw{error:e};return Promise.resolve(e.json()).then(function(e){throw{success:!1,message:e.message}})}))}catch(e){return Promise.reject(e)}},n=function(n,t){return{GET:function(r){var o=t?t.token():null;return e("GET",n+r,void 0,o)},POST:function(r,o){var a=t?t.token():null;return e("POST",n+r,o,a)},PUT:function(r,o){var a=t?t.token():null;return e("PUT",n+r,o,a)},PATCH:function(r,o){var a=t?t.token():null;return e("PATCH",n+r,o,a)},DELETE:function(r){var o=t?t.token():null;return e("DELETE",n+r,void 0,o)}}},t=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",r={token:function(){return(sessionStorage.getItem(t)?JSON.parse(sessionStorage.getItem(t)):{}).token},me:function(){return(sessionStorage.getItem(t)?JSON.parse(sessionStorage.getItem(t)):{}).me},init:function(e,n){sessionStorage.setItem(t,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(t,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(t)}};function o(e){var n={exports:{}};return e(n,n.exports),n.exports}var a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var c=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,r,o=l(e),c=1;c<arguments.length;c++){for(var s in t=Object(arguments[c]))i.call(t,s)&&(o[s]=t[s]);if(a){r=a(t);for(var f=0;f<r.length;f++)u.call(t,r[f])&&(o[r[f]]=t[r[f]])}}return o},s=o(function(e,n){var t=60103,r=60106;n.Fragment=60107,n.StrictMode=60108,n.Profiler=60114;var o=60109,a=60110,i=60112;n.Suspense=60113;var u=60115,l=60116;if("function"==typeof Symbol&&Symbol.for){var s=Symbol.for;t=s("react.element"),r=s("react.portal"),n.Fragment=s("react.fragment"),n.StrictMode=s("react.strict_mode"),n.Profiler=s("react.profiler"),o=s("react.provider"),a=s("react.context"),i=s("react.forward_ref"),n.Suspense=s("react.suspense"),u=s("react.memo"),l=s("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function d(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function v(e,n,t){this.props=e,this.context=n,this.refs=h,this.updater=t||p}function m(){}function y(e,n,t){this.props=e,this.context=n,this.refs=h,this.updater=t||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,n,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=v.prototype;var g=y.prototype=new m;g.constructor=y,c(g,v.prototype),g.isPureReactComponent=!0;var b={current:null},C=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function _(e,n,r){var o,a={},i=null,u=null;if(null!=n)for(o in void 0!==n.ref&&(u=n.ref),void 0!==n.key&&(i=""+n.key),n)C.call(n,o)&&!k.hasOwnProperty(o)&&(a[o]=n[o]);var l=arguments.length-2;if(1===l)a.children=r;else if(1<l){for(var c=Array(l),s=0;s<l;s++)c[s]=arguments[s+2];a.children=c}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===a[o]&&(a[o]=l[o]);return{$$typeof:t,type:e,key:i,ref:u,props:a,_owner:b.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var w=/\/+/g;function N(e,n){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return n[e]})}(""+e.key):n.toString(36)}function O(e,n,o,a,i){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var l=!1;if(null===e)l=!0;else switch(u){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case t:case r:l=!0}}if(l)return i=i(l=e),e=""===a?"."+N(l,0):a,Array.isArray(i)?(o="",null!=e&&(o=e.replace(w,"$&/")+"/"),O(i,n,o,"",function(e){return e})):null!=i&&(S(i)&&(i=function(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}(i,o+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(w,"$&/")+"/")+e)),n.push(i)),1;if(l=0,a=""===a?".":a+":",Array.isArray(e))for(var c=0;c<e.length;c++){var s=a+N(u=e[c],c);l+=O(u,n,o,s,i)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),c=0;!(u=e.next()).done;)l+=O(u=u.value,n,o,s=a+N(u,c++),i);else if("object"===u)throw n=""+e,Error(d(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n));return l}function E(e,n,t){if(null==e)return e;var r=[],o=0;return O(e,r,"","",function(e){return n.call(t,e,o++)}),r}function j(e){if(-1===e._status){var n=e._result;n=n(),e._status=0,e._result=n,n.then(function(n){0===e._status&&(n=n.default,e._status=1,e._result=n)},function(n){0===e._status&&(e._status=2,e._result=n)})}if(1===e._status)return e._result;throw e._result}var R={current:null};function P(){var e=R.current;if(null===e)throw Error(d(321));return e}var x={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:b,IsSomeRendererActing:{current:!1},assign:c};n.Children={map:E,forEach:function(e,n,t){E(e,function(){n.apply(this,arguments)},t)},count:function(e){var n=0;return E(e,function(){n++}),n},toArray:function(e){return E(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error(d(143));return e}},n.Component=v,n.PureComponent=y,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x,n.cloneElement=function(e,n,r){if(null==e)throw Error(d(267,e));var o=c({},e.props),a=e.key,i=e.ref,u=e._owner;if(null!=n){if(void 0!==n.ref&&(i=n.ref,u=b.current),void 0!==n.key&&(a=""+n.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(s in n)C.call(n,s)&&!k.hasOwnProperty(s)&&(o[s]=void 0===n[s]&&void 0!==l?l[s]:n[s])}var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){l=Array(s);for(var f=0;f<s;f++)l[f]=arguments[f+2];o.children=l}return{$$typeof:t,type:e.type,key:a,ref:i,props:o,_owner:u}},n.createContext=function(e,n){return void 0===n&&(n=null),(e={$$typeof:a,_calculateChangedBits:n,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},n.createElement=_,n.createFactory=function(e){var n=_.bind(null,e);return n.type=e,n},n.createRef=function(){return{current:null}},n.forwardRef=function(e){return{$$typeof:i,render:e}},n.isValidElement=S,n.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:j}},n.memo=function(e,n){return{$$typeof:u,type:e,compare:void 0===n?null:n}},n.useCallback=function(e,n){return P().useCallback(e,n)},n.useContext=function(e,n){return P().useContext(e,n)},n.useDebugValue=function(){},n.useEffect=function(e,n){return P().useEffect(e,n)},n.useImperativeHandle=function(e,n,t){return P().useImperativeHandle(e,n,t)},n.useLayoutEffect=function(e,n){return P().useLayoutEffect(e,n)},n.useMemo=function(e,n){return P().useMemo(e,n)},n.useReducer=function(e,n,t){return P().useReducer(e,n,t)},n.useRef=function(e){return P().useRef(e)},n.useState=function(e){return P().useState(e)},n.version="17.0.2"}),f=o(function(e,n){"production"!==process.env.NODE_ENV&&function(){var e=c,t=60103,r=60106;n.Fragment=60107,n.StrictMode=60108,n.Profiler=60114;var o=60109,a=60110,i=60112;n.Suspense=60113;var u=60120,l=60115,s=60116,f=60121,d=60122,p=60117,h=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var m=Symbol.for;t=m("react.element"),r=m("react.portal"),n.Fragment=m("react.fragment"),n.StrictMode=m("react.strict_mode"),n.Profiler=m("react.profiler"),o=m("react.provider"),a=m("react.context"),i=m("react.forward_ref"),n.Suspense=m("react.suspense"),u=m("react.suspense_list"),l=m("react.memo"),s=m("react.lazy"),f=m("react.block"),d=m("react.server.block"),p=m("react.fundamental"),m("react.scope"),m("react.opaque.id"),h=m("react.debug_trace_mode"),m("react.offscreen"),v=m("react.legacy_hidden")}var y="function"==typeof Symbol&&Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var n=y&&e[y]||e["@@iterator"];return"function"==typeof n?n:null}var b={current:null},C={current:null},k={},_=null;function S(e){_=e}k.setExtraStackFrame=function(e){_=e},k.getCurrentStack=null,k.getStackAddendum=function(){var e="";_&&(e+=_);var n=k.getCurrentStack;return n&&(e+=n()||""),e};var w={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:C,IsSomeRendererActing:{current:!1},assign:e};function N(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];E("warn",e,t)}function O(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];E("error",e,t)}function E(e,n,t){var r=w.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(n+="%s",t=t.concat([r]));var o=t.map(function(e){return""+e});o.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,o)}w.ReactDebugCurrentFrame=k;var j={};function R(e,n){var t=e.constructor,r=t&&(t.displayName||t.name)||"ReactClass",o=r+"."+n;j[o]||(O("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,r),j[o]=!0)}var P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,t){R(e,"forceUpdate")},enqueueReplaceState:function(e,n,t,r){R(e,"replaceState")},enqueueSetState:function(e,n,t,r){R(e,"setState")}},x={};function A(e,n,t){this.props=e,this.context=n,this.refs=x,this.updater=t||P}Object.freeze(x),A.prototype.isReactComponent={},A.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},A.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var T={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},$=function(e,n){Object.defineProperty(A.prototype,e,{get:function(){N("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})};for(var I in T)T.hasOwnProperty(I)&&$(I,T[I]);function D(){}function F(e,n,t){this.props=e,this.context=n,this.refs=x,this.updater=t||P}D.prototype=A.prototype;var L=F.prototype=new D;function M(e){return e.displayName||"Context"}function z(e){if(null==e)return null;if("number"==typeof e.tag&&O("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case n.Fragment:return"Fragment";case r:return"Portal";case n.Profiler:return"Profiler";case n.StrictMode:return"StrictMode";case n.Suspense:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case a:return M(e)+".Consumer";case o:return M(e._context)+".Provider";case i:return p=(d=e.render).displayName||d.name||"",e.displayName||(""!==p?"ForwardRef("+p+")":"ForwardRef");case l:return z(e.type);case f:return z(e._render);case s:var t=e._payload,c=e._init;try{return z(c(t))}catch(e){return null}}var d,p;return null}L.constructor=F,e(L,A.prototype),L.isPureReactComponent=!0;var U,q,B,Y=Object.prototype.hasOwnProperty,V={key:!0,ref:!0,__self:!0,__source:!0};function K(e){if(Y.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return void 0!==e.ref}function H(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}function W(e,n){var t=function(){U||(U=!0,O("%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)",n))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(e,n){var t=function(){q||(q=!0,O("%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)",n))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}function J(e){if("string"==typeof e.ref&&C.current&&e.__self&&C.current.stateNode!==e.__self){var n=z(C.current.type);B[n]||(O('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',n,e.ref),B[n]=!0)}}B={};var X=function(e,n,r,o,a,i,u){var l={$$typeof:t,type:e,key:n,ref:r,props:u,_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:a}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Q(e,n,t){var r,o={},a=null,i=null,u=null,l=null;if(null!=n)for(r in K(n)&&(i=n.ref,J(n)),H(n)&&(a=""+n.key),u=void 0===n.__self?null:n.__self,l=void 0===n.__source?null:n.__source,n)Y.call(n,r)&&!V.hasOwnProperty(r)&&(o[r]=n[r]);var c=arguments.length-2;if(1===c)o.children=t;else if(c>1){for(var s=Array(c),f=0;f<c;f++)s[f]=arguments[f+2];Object.freeze&&Object.freeze(s),o.children=s}if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===o[r]&&(o[r]=d[r])}if(a||i){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&W(o,p),i&&G(o,p)}return X(e,a,i,u,l,C.current,o)}function Z(n,t,r){if(null==n)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var o,a,i=e({},n.props),u=n.key,l=n.ref,c=n._self,s=n._source,f=n._owner;if(null!=t)for(o in K(t)&&(l=t.ref,f=C.current),H(t)&&(u=""+t.key),n.type&&n.type.defaultProps&&(a=n.type.defaultProps),t)Y.call(t,o)&&!V.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==a?a[o]:t[o]);var d=arguments.length-2;if(1===d)i.children=r;else if(d>1){for(var p=Array(d),h=0;h<d;h++)p[h]=arguments[h+2];i.children=p}return X(n.type,u,l,c,s,f,i)}function ee(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var ne=!1,te=/\/+/g;function re(e){return e.replace(te,"$&/")}function oe(e,n){return"object"==typeof e&&null!==e&&null!=e.key?(t={"=":"=0",":":"=2"},"$"+(""+e.key).replace(/[=:]/g,function(e){return t[e]})):n.toString(36);var t}function ae(e,n,o,a,i){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var l,c,s,f=!1;if(null===e)f=!0;else switch(u){case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case t:case r:f=!0}}if(f){var d=e,p=i(d),h=""===a?"."+oe(d,0):a;if(Array.isArray(p)){var v="";null!=h&&(v=re(h)+"/"),ae(p,n,v,"",function(e){return e})}else null!=p&&(ee(p)&&(l=p,c=o+(!p.key||d&&d.key===p.key?"":re(""+p.key)+"/")+h,p=X(l.type,c,l.ref,l._self,l._source,l._owner,l.props)),n.push(p));return 1}var m=0,y=""===a?".":a+":";if(Array.isArray(e))for(var b=0;b<e.length;b++)m+=ae(s=e[b],n,o,y+oe(s,b),i);else{var C=g(e);if("function"==typeof C){var k=e;C===k.entries&&(ne||N("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ne=!0);for(var _,S=C.call(k),w=0;!(_=S.next()).done;)m+=ae(s=_.value,n,o,y+oe(s,w++),i)}else if("object"===u){var O=""+e;throw Error("Objects are not valid as a React child (found: "+("[object Object]"===O?"object with keys {"+Object.keys(e).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}}return m}function ie(e,n,t){if(null==e)return e;var r=[],o=0;return ae(e,r,"","",function(e){return n.call(t,e,o++)}),r}function ue(e){if(-1===e._status){var n=(0,e._result)(),t=e;t._status=0,t._result=n,n.then(function(n){if(0===e._status){var t=n.default;void 0===t&&O("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",n);var r=e;r._status=1,r._result=t}},function(n){if(0===e._status){var t=e;t._status=2,t._result=n}})}if(1===e._status)return e._result;throw e._result}function le(e){return"string"==typeof e||"function"==typeof e||e===n.Fragment||e===n.Profiler||e===h||e===n.StrictMode||e===n.Suspense||e===u||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===s||e.$$typeof===l||e.$$typeof===o||e.$$typeof===a||e.$$typeof===i||e.$$typeof===p||e.$$typeof===f||e[0]===d)}function ce(){var e=b.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");return e}var se,fe,de,pe,he,ve,me,ye=0;function ge(){}ge.__reactDisabledLog=!0;var be,Ce=w.ReactCurrentDispatcher;function ke(e,n,t){if(void 0===be)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||""}return"\n"+be+e}var _e,Se=!1,we="function"==typeof WeakMap?WeakMap:Map;function Ne(n,t){if(!n||Se)return"";var r,o=_e.get(n);if(void 0!==o)return o;Se=!0;var a,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,a=Ce.current,Ce.current=null,function(){if(0===ye){se=console.log,fe=console.info,de=console.warn,pe=console.error,he=console.group,ve=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ye++}();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(n,[],u)}else{try{u.call()}catch(e){r=e}n.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}n()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var l=e.stack.split("\n"),c=r.stack.split("\n"),s=l.length-1,f=c.length-1;s>=1&&f>=0&&l[s]!==c[f];)f--;for(;s>=1&&f>=0;s--,f--)if(l[s]!==c[f]){if(1!==s||1!==f)do{if(s--,--f<0||l[s]!==c[f]){var d="\n"+l[s].replace(" at new "," at ");return"function"==typeof n&&_e.set(n,d),d}}while(s>=1&&f>=0);break}}}finally{Se=!1,Ce.current=a,function(){if(0==--ye){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:e({},n,{value:se}),info:e({},n,{value:fe}),warn:e({},n,{value:de}),error:e({},n,{value:pe}),group:e({},n,{value:he}),groupCollapsed:e({},n,{value:ve}),groupEnd:e({},n,{value:me})})}ye<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var p=n?n.displayName||n.name:"",h=p?ke(p):"";return"function"==typeof n&&_e.set(n,h),h}function Oe(e,n,t){return Ne(e,!1)}function Ee(e,t,r){if(null==e)return"";if("function"==typeof e)return Ne(e,function(e){var n=e.prototype;return!(!n||!n.isReactComponent)}(e));if("string"==typeof e)return ke(e);switch(e){case n.Suspense:return ke("Suspense");case u:return ke("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case i:return Oe(e.render);case l:return Ee(e.type,t,r);case f:return Oe(e._render);case s:var o=e._payload,a=e._init;try{return Ee(a(o),t,r)}catch(e){}}return""}_e=new we;var je,Re={},Pe=w.ReactDebugCurrentFrame;function xe(e){if(e){var n=e._owner,t=Ee(e.type,e._source,n?n.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}function Ae(e){if(e){var n=e._owner;S(Ee(e.type,e._source,n?n.type:null))}else S(null)}function Te(){if(C.current){var e=z(C.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function $e(e){return null!=e&&void 0!==(n=e.__source)?"\n\nCheck your code at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+".":"";var n}je=!1;var Ie={};function De(e,n){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var n=Te();if(!n){var t="string"==typeof e?e:e.displayName||e.name;t&&(n="\n\nCheck the top-level render call using <"+t+">.")}return n}(n);if(!Ie[t]){Ie[t]=!0;var r="";e&&e._owner&&e._owner!==C.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),Ae(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,r),Ae(null)}}}function Fe(e,n){if("object"==typeof e)if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];ee(r)&&De(r,n)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var o=g(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)ee(a.value)&&De(a.value,n)}}function Le(e){var n,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)n=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==i&&t.$$typeof!==l)return;n=t.propTypes}if(n){var r=z(t);!function(e,n,t,r,o){var a=Function.call.bind(Object.prototype.hasOwnProperty);for(var i in e)if(a(e,i)){var u=void 0;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": prop 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}u=e[i](n,i,r,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){u=e}!u||u instanceof Error||(xe(o),O("%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",t,i,typeof u),xe(null)),u instanceof Error&&!(u.message in Re)&&(Re[u.message]=!0,xe(o),O("Failed %s type: %s",t,u.message),xe(null))}}(n,e.props,"prop",r,e)}else void 0===t.PropTypes||je||(je=!0,O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",z(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Me(e){for(var n=Object.keys(e.props),t=0;t<n.length;t++){var r=n[t];if("children"!==r&&"key"!==r){Ae(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),Ae(null);break}}null!==e.ref&&(Ae(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),Ae(null))}function ze(e,r,o){var a=le(e);if(!a){var i="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" 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 u,l=$e(r);i+=l||Te(),null===e?u="null":Array.isArray(e)?u="array":void 0!==e&&e.$$typeof===t?(u="<"+(z(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,O("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,i)}var c=Q.apply(this,arguments);if(null==c)return c;if(a)for(var s=2;s<arguments.length;s++)Fe(arguments[s],e);return e===n.Fragment?Me(c):Le(c),c}var Ue=!1;try{var qe=Object.freeze({});new Map([[qe,null]]),new Set([qe])}catch(e){}var Be=ze,Ye={map:ie,forEach:function(e,n,t){ie(e,function(){n.apply(this,arguments)},t)},count:function(e){var n=0;return ie(e,function(){n++}),n},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!ee(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};n.Children=Ye,n.Component=A,n.PureComponent=F,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w,n.cloneElement=function(e,n,t){for(var r=Z.apply(this,arguments),o=2;o<arguments.length;o++)Fe(arguments[o],r.type);return Le(r),r},n.createContext=function(e,n){void 0===n?n=null:null!==n&&"function"!=typeof n&&O("createContext: Expected the optional second argument to be a function. Instead received: %s",n);var t={$$typeof:a,_calculateChangedBits:n,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};t.Provider={$$typeof:o,_context:t};var r=!1,i=!1,u=!1,l={$$typeof:a,_context:t,_calculateChangedBits:t._calculateChangedBits};return Object.defineProperties(l,{Provider:{get:function(){return i||(i=!0,O("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return r||(r=!0,O("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){u||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),u=!0)}}}),t.Consumer=l,t._currentRenderer=null,t._currentRenderer2=null,t},n.createElement=Be,n.createFactory=function(e){var n=ze.bind(null,e);return n.type=e,Ue||(Ue=!0,N("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(n,"type",{enumerable:!1,get:function(){return N("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),n},n.createRef=function(){var e={current:null};return Object.seal(e),e},n.forwardRef=function(e){null!=e&&e.$$typeof===l?O("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?O("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&O("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||O("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var n,t={$$typeof:i,render:e};return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,null==e.displayName&&(e.displayName=t)}}),t},n.isValidElement=ee,n.lazy=function(e){var n,t,r={$$typeof:s,_payload:{_status:-1,_result:e},_init:ue};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){O("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return t},set:function(e){O("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},n.memo=function(e,n){le(e)||O("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var t,r={$$typeof:l,type:e,compare:void 0===n?null:n};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,null==e.displayName&&(e.displayName=n)}}),r},n.useCallback=function(e,n){return ce().useCallback(e,n)},n.useContext=function(e,n){var t=ce();if(void 0!==n&&O("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",n,"number"==typeof n&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?O("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&O("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e,n)},n.useDebugValue=function(e,n){return ce().useDebugValue(e,n)},n.useEffect=function(e,n){return ce().useEffect(e,n)},n.useImperativeHandle=function(e,n,t){return ce().useImperativeHandle(e,n,t)},n.useLayoutEffect=function(e,n){return ce().useLayoutEffect(e,n)},n.useMemo=function(e,n){return ce().useMemo(e,n)},n.useReducer=function(e,n,t){return ce().useReducer(e,n,t)},n.useRef=function(e){return ce().useRef(e)},n.useState=function(e){return ce().useState(e)},n.version="17.0.2"}()}),d=o(function(e){e.exports="production"===process.env.NODE_ENV?s:f}),p=function(e){var n=e.size,t=e.clickable,r=e.action;return h("i",{className:"icon "+(void 0===n?"normal":n)+" "+(void 0!==t&&t?"clickable":"")+" material-icons",onClick:function(e){e.stopPropagation(),e.preventDefault(),r&&r()}},e.icon)},v=function(e){var n=e.label,t=e.icon,r=e.action,o=e.disabled,a=void 0!==o&&o,i=e.raised?"raised":e.outlined?"outlined":"normal";return a&&(i+=" disabled"),h("button",{className:"btn "+i,onClick:function(e){a||(e.stopPropagation(),e.preventDefault(),r&&r())}},t?h(p,{icon:t,size:"small"}):null,h("span",null,n))},m=React.createContext({}),y=function(e){var n=e.children,t=d.useContext(m);if(t){var r=t.dictionary,o=(void 0===r?{}:r)[n],a=o?o[t.lang]:n;return a?h("span",null,a):""}return n?h("span",null,n):""},g=function(e){var n=e.id,t=e.label,r=e.placeholder,o=e.value,a=e.onChange;function i(e){a&&a(n,e.target.checked)}var u=h(y,null,t);return console.log(t,o),!0===o?h("div",{className:"checkbox",key:n+"1"},h("input",{id:n,type:"checkbox",placeholder:r,checked:!0,value:o,onChange:i}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},u)):h("div",{className:"checkbox",key:n+"0"},h("input",{id:n,type:"checkbox",placeholder:r,value:o,onChange:i}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},u))},b=function(e){var n=e.id,t=e.icon,r=e.label,o=e.action,a=e.onSelect,i=e.outlined?"outlined":"normal";return e.selected&&(i+=" selected"),h("div",{className:"chip "+i,onClick:function(e){e.stopPropagation(),e.preventDefault(),a&&a(n)}},t?h(p,{icon:t,size:"small"}):null,h("main",null,h(y,null,r)),o?h("span",{className:"meta"},o):null)},C=function(e){return h("div",{className:"chips"},e.children)},k=function(e){var n=e.title,t=e.columns,r=void 0===t?1:t,o=e.children,a=e.outlined,i=e.onChange,u=d.useState([]),l=u[0],c=u[1],s=function(e){return null==e||""===e};d.useEffect(function(){var e=d.Children.toArray(o).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props,t=n.id,r=n.value,o=n.required,a=void 0!==o&&o,i=n.validation,u=!a||(i?i(r):!s(r));return{id:t,value:r,required:a,validation:i,valid:u}}).filter(function(e){return void 0!==e.id});c(e)},[]),d.useEffect(function(){if(i){var e=l.every(function(e){return!0===e.valid}),n=l.reduce(function(e,n){var t=n.value;return(t||!1===t)&&(e[n.id]=t),e},{});i(n,e)}},[l]);var f=function(e,n){var t=l.find(function(n){return n.id===e});if(t){var r=!t.required||(t.validation?t.validation(n):!s(n));Object.assign(t,{value:n,valid:r}),c(l.slice())}},p=d.Children.toArray(o).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props.span,t=void 0===n?1:n,r=d.cloneElement(e,{onChange:f,outlined:!!a});return h(_,{style:{gridColumn:"span "+t}},r)}),v={gridTemplateColumns:"repeat("+r+", 1fr)"};return h(d.Fragment,null,n?h("header",{className:"form-header"},h(y,{use:"headline6"},n)):"",h("form",{className:"form-grid",style:v},p))},_=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},S=function(e){var n=e.caption?"caption":"",t=e.prominent?"prominent":"",r=e.dense?"dense":"",o=e.primary?"primary":"";o=e.secondary?"secondary":o;var a=e.icon?h(p,{icon:e.icon,clickable:e.clickable,action:e.action}):"";a=e.iconSrc?h("img",{className:"header-icon",src:e.iconSrc}):a;var i=e.img?{backgroundImage:"url("+e.img+")"}:{},u=h(y,null,e.title);return h("header",{className:"header "+n+" "+t+" "+r+" "+o+" "+e.className,style:i},a,e.title?h("label",null,u):null,h("span",{className:"actions"},e.children))};function w(){return w=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},w.apply(this,arguments)}var N=function(e){var n=e.items,t=void 0===n?[]:n,r=e.children,o=e.onSelect;function a(e){o&&o(e)}return e.groupBy?h(O,w({},e,{onSelect:a})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(E,{key:e.id,item:e,onSelect:a})})),r)},O=function(e){var n=e.items,t=e.children,r=e.onSelect,o=e.groupBy,a=(void 0===n?[]:n).reduce(function(e,n){var t=e.find(function(e){return e.name===n.content[o]});return t||e.push(t={name:n.content[o],items:[]}),t.items.push(n),e},[]);return h("div",{className:"list"},a.map(function(e){return h(d.Fragment,{key:e.name},h("header",{key:e.name+"-header"},h(y,null,e.name)),h("ul",{key:e.name+"-ul"},e.items.map(function(e){return h(E,{key:e.id,item:e,onSelect:r})})))}),t)},E=function(e){var n=e.item,t=e.onSelect,r=n.id,o=n.icon,a=n.line1,i=n.line2,u=n.meta;return h("li",{id:r,onClick:function(){t&&t(r)}},o?h(p,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(y,null,a)),i?h("div",{className:"secondary-line"},h(y,null,i)):null),u?h("div",{className:"meta"},u):null)},j=d.createContext({}),R=function(e){return h("ul",null,e.children)},P=function(e){var n=e.icon,t=void 0===n?"more_vert":n,r=e.children,o=e.align,a=d.useState(!1),i=a[0],u=a[1];function l(){u(!i)}return h(j.Provider,{value:[i,u]},h("div",{className:"menu-icon"},h(p,{icon:t,clickable:!0,action:l}),i?h("menu",{className:""+o},r):null,i?h("div",{className:"overlay",onClick:l}):null))},x=function(e){var n=e.icon,t=e.label,r=e.meta,o=e.onSelect,a=d.useContext(j)[1];return h("li",{className:"menu-item",onClick:function(){o&&o(),a(!1)}},n?h(p,{icon:n}):null,h("label",null,t),r?h("div",{className:"meta"},r):null)},A=function(e){return h("li",null,"menuSeparator")},T=function(e){return h("div",{className:"circular-progress"},h(p,{icon:"refresh",size:"small"}))},$=function(e){var n=e.progress,t=e.max;return h("div",{className:"linear-progress"},h("progress",{value:void 0===n?0:n,max:void 0===t?100:t}))},I=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},D=function(e){var n=e.id,t=e.name,r=e.placeholder,o=e.value,a=e.onChange,i=h(y,null,e.label);return h("div",{className:"radio"},h("input",{id:n,name:t,type:"radio",placeholder:r,value:o,onClick:function(e){a&&a(n,e.target.value)}}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},i))},F=function(e){var n=e.icon,t=e.title,r=void 0===t?"":t,o=e.canCollapse,a=void 0===o||o,i=e.open,u=void 0!==i&&i,l=e.actions,c=e.children,s=e.className,f=d.useState(u),v=f[0],m=f[1];return d.useEffect(function(){m(u)},[u]),h("section",{className:"section2 "+s},h(S,{icon:{icon:n},title:r},l,a?h(p,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){m(!u)}}):""),v?h("main",null,c):"")},L=function(e){var n=e.selected,t=e.onChange,r=d.Children.map(e.children,function(e,r){return d.cloneElement(e,{selected:r===n,onSelect:function(){t&&t(r)}})});return h("div",{class:"tabs"},r,h("div",{class:"tab-filler"}))},M=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},z=function(e){var n=e.selected,t=void 0===n?0:n,r=d.Children.toArray(e.children).filter(function(e,n){return n===t})[0];return h(d.Fragment,null,r)},U=function(e){var n=d.useContext(m),t=e.id,r=e.type,o=void 0===r?"text":r,a=e.label,i=e.placeholder,u=e.value,l=e.readOnly,c=void 0!==l&&l,s=e.onChange,f=e.onEnter,p=e.onClick,v=(a?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),g=h(y,null,a);return h("div",{className:""+v,onClick:p},h("input",{id:t,type:o,placeholder:i,value:u,required:!0,onChange:function(e){e.stopPropagation(),e.preventDefault(),s&&s(t,e.target.value)},onKeyDown:function(e){13==(e.charCode?e.charCode:e.keyCode?e.keyCode:0)&&f()},onFocus:function(){n&&n.changeFocus({lose:function(){}})},readOnly:c}),h("span",{className:"bar"}),a?h("label",null,g):null)},q=function(e){var n=d.useContext(m),t=e.id,r=e.options,o=void 0===r?[]:r,a=e.value,i=e.onChange,u=d.useState(!1),l=u[0],c=u[1],s=d.useState(),f=s[0],v=s[1];function y(){n&&n.changeFocus({lose:function(){c(!1)}}),c(!l)}return d.useEffect(function(){if(Array.isArray(o)){var e=o.find(function(e){return e.value===a});e&&v(e.label)}},[a]),h("div",{className:"dropdown"},h(U,w({},e,{onClick:y,value:f})),h(p,{icon:"expand_more",clickable:!0,size:"small",action:y}),1==l?h("menu",null,h("ul",{onClick:function(e){var n=e.target.getAttribute("value"),r=o.find(function(e){return e.value===n});i&&i(t,n),v(r.label),c(!1)}},Array.isArray(o)?o.map(function(e){return h("li",{key:e.value,value:e.value},e.label)}):null)):null)},B=function(e){var n=e.columns,t=void 0===n?[]:n,r=e.rows,o=void 0===r?[]:r,a=e.onRowSelection,i=e.onSort,u=e.editable,l=e.outlined,c=d.useState({})[0];function s(e,n){a&&a(e,n)}function f(e,n){i&&i(e,n)}return h("div",{className:"datatable8 "+(l?"outlined":"")},h("table",null,h("thead",null,h("tr",null,t.map(function(e){var n=e.sortable;return h("th",null,h(y,null,e.label),n?h(p,{icon:"arrow_up",size:"small",clickable:!0}):null)}))),h("tbody",null,function(e,n){void 0===n&&(n={});var t=Object.keys(n);if(!t.length)return e;var r=function(e,n,t){return t=null!==t?t:1,e===n?0:e>n?t:-1*t};return e.sort(function(e,o){for(var a=0,i=0;0===a&&i<t.length;){var u=t[i];u&&(a=r(e[u],o[u],n[u]),i++)}return a})}(o,c).map(function(e){return h(Y,{key:e.id,row:e,columns:t,onSelect:s,onDrop:f,editable:u})}))))},Y=function(e){var n,t=e.row,r=e.columns,o=void 0===r?[]:r,a=e.onSelect,i=e.editable,u=d.useState(!1),l=u[0],c=u[1],s=l?"expand_more":"expand_less";return h(d.Fragment,null,h("tr",{onClick:function(e){return a(t,e)}},o.map(function(e){return h(V,{row:t,column:e,cell:t[e.id],editable:i})}),t.info?h(p,{icon:s,clickable:!0,action:function(){return c(!l)}}):null),t.info&&l?h("tr",{className:"table-row-info"},(n=t.info)&&("[object Function]"===Object.prototype.toString.call(n)||"function"==typeof n||n instanceof Function)?t.info():t.info):null)},V=function(e){var n=e.row,t=e.column,r=e.cell,o=e.editable;return h("td",{className:t.id},function(e){var a=t.id,i=t.disabled,u=void 0!==i&&i,l=t.min,c=t.max,s=t.onChange,f=t.options;if(o&&s)switch(e){case"ICON":return h(p,{icon:r});case"BOOLEAN":case"Boolean":return h(g,{id:a,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:u});case"SELECTION":return h(q,{id:a,value:r,placeholder:"--Select--",options:f,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(g,{id:a,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return r&&r.value?h(g,{id:a,value:r.checked||!1,label:r.value,onChange:function(e,t){return s(n.id,e,r.value,t,r)}}):"";case"TEXTFIELD":return h(U,{id:a,value:r,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(W,{id:a,value:r,options:f,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(U,{id:a,type:"number",value:r,min:l,max:c,onChange:function(e,t){return s(n.id,e,t)}});default:return r}else switch(e){case"ICON":return h(p,{icon:r});case"Boolean":return h(K,{id:a,value:r});case"String":return h(H,{id:a,value:r,options:f});default:return r}}(t.type))},K=function(e){var n=e.value;return h(p,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},H=function(e){var n=e.value,t=e.options,r=t?t.find(function(e){return e.value===n}):null;return h("div",{className:"field-editor string-editor"},r?r.label:n)},W=function(e){var n=e.id,t=e.value,r=void 0===t?"":t,o=e.options,a=e.onChange;function i(e,n){a&&a(e,n)}return h("div",{className:"field-editor string-editor"},o?h(q,{outlined:!0,id:n,value:r,onChange:i,options:o}):h(U,{outlined:!0,id:n,value:r,onChange:i}))},G=function(e){var n=e.id,t=e.label,r=e.init,o=e.onChange,a=d.useRef(!1),i=d.useState(),u=i[0],l=i[1],c=d.useState(r),s=c[0],f=c[1];return d.useEffect(function(){a.current?o&&s&&o(n,s):a.current=!0},[s]),h("div",{className:"tokenField"},h("label",null,t),s.map(function(e,n){return h(J,{text:e,onDelete:function(){return function(e){var n=s.slice();n.splice(e,1),f(n)}(n)}})}),h("input",{type:"text",value:u,onChange:function(e){l(e.target.value)},onKeyDown:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var n=s.concat(e.target.value);f(n),l("")}if(""===u&&s.length>0&&"Backspace"===e.key){var t=s.slice(0,-1);f(t)}}}))},J=function(e){var n=e.onDelete;return h("div",{className:"token"},h(y,{use:"caption",tag:"div"},e.text),h(p,{icon:"close",clickable:!0,action:n,size:"small"}))},X=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},Q=function(e){var n=e.icon,t=void 0===n?"folder":n,r=e.label,o=e.open,a=e.children,i=e.actions;return h("details",{className:"tree-node",open:void 0!==o&&o},h("summary",{className:"tree-item"},t?h(p,{icon:t,size:"small",small:!0}):null,h("div",{className:"label"},r),h("div",{className:"actions"},i)),a)},Z=function(e){var n=e.id,t=e.icon,r=e.label,o=e.actions,a=e.onSelect;return h("div",{className:"tree-item final",onClick:function(){a&&a(n)}},h(p,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},r),h("div",{className:"actions"},o))},ee=function(e){var n=e.logo,t=e.title,r=e.userLabel,o=void 0===r?"User":r,a=e.passwordLabel,i=void 0===a?"Password":a,u=e.loginLabel,l=void 0===u?"Log In":u,c=e.onOK,s=e.forgotLabel,f=void 0===s?"Forgot Password ?":s,m=e.onForgot,g=e.message,b=e.loading,C=d.useState(""),k=C[0],_=C[1],S=d.useState(""),w=S[0],N=S[1];function O(){return k&&k.length>0&&w&&w.length>0}function E(e){c&&O()&&c(k,e||w)}function j(e){return h(y,null,e)}return h("div",{className:"login-box"},h("header",null,n?h("img",{src:n}):"",h("div",{className:"title"},h(y,null,t))),h("main",null,h(U,{label:j(o),value:k,onChange:function(e,n){_(n)},onEnter:E,outlined:!0}),h(U,{label:j(i),value:w,onChange:function(e,n){N(n)},onEnter:E,type:"password",outlined:!0})),h("footer",null,m?h(v,{label:j(f),action:function(){m&&m(k)},disabled:!(k&&k.length>0)}):null,b?h("div",{className:"load-box"},h(p,{icon:"refresh"})):h(v,{label:j(l),action:E,disabled:!O(),raised:!0}),g?h("div",{className:"message"},h(y,null,g)):null))},ne=function(e){var n=e.logo,t=e.title,r=e.children,o=e.onOK,a=e.onClose,i=d.useState({}),u=i[0],l=i[1],c=d.useState(),s=c[0],f=c[1];function p(){return u.password1&&u.password2}function m(e,n){var t,r=Object.assign({},u,((t={})[e]=n,t));l(r)}function g(){o&&p()&&(u.password1===u.password2?(f(null),o(u)):f("New Password and Confirm New Password do not match"))}return h("div",{className:"reset-password-box"},h("header",null,n?h("img",{src:n}):null,t?h("div",{className:"title"},h(y,null,t)):null,r),h("main",null,h(y,{use:"headline6"},"Change Password"),h(U,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:m,onEnter:g}),h(U,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:m,onEnter:g}),s?h("div",{className:"error"},s):null),h("footer",null,h(v,{label:"Close",action:function(){a&&a()}}),h(v,{label:"OK",raised:!0,disabled:!p(),action:g})))},te=function(e){var n=e.title,t=e.src,r=e.info,o=e.actions,a=void 0===o?[]:o,i=e.tools,u=void 0!==i&&i,l=e.onClose,c=d.useState(!1),s=c[0],f=c[1];function v(){f(!s)}var m=h(y,{use:"headline6"},n);return h("div",{className:"viewer"},h(S,{icon:{icon:"close",clickable:!0,action:l},title:m},s?"":h(p,{icon:"info",clickable:!0,action:v}),a),h("main",null,h("div",{className:"resizer"},h("picture",null,h("img",{src:t})))),h("aside",{className:s?"open":""},h(S,{title:"Detalles"},h(p,{icon:"close",clickable:!0,action:v})),h("main",null,r)),u?h("footer",null,h(p,{clickable:!0,icon:"zoom_out"}),h(p,{clickable:!0,icon:"zoom_out_map"}),h(p,{clickable:!0,icon:"zoom_in"})):null)},re=function(e){return h("div",{className:"kanban"},e.children)},oe=function(e){var n=e.id,t=e.icon,r=e.title,o=e.subtitle,a=e.badge,i=e.children,u=e.minified,l=e.disabled,c=void 0!==l&&l,s=d.useState(void 0!==u&&u),f=s[0],v=s[1];function m(){v(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,r),h("footer",null,h(p,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:m}))):h("div",{className:"kanban-column "+n+" "+(c?"disabled":"")},h("header",null,h(p,{icon:t}),h("div",{className:"title"},h(y,{use:"headline6"},r),h(y,{className:"secondary-text",use:"body2"},o)),h("div",{className:"badge"},a)),h("main",null,i),h("footer",null,h(p,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:m})))},ae=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},ie=d.createContext({}),ue=function(e){var n=e.context,t=e.children,r=d.useState(void 0===n?{}:n);return h(ie.Provider,{value:[r[0],r[1]]},t)},le=function(e){var n=e.layout,t=e.context;return h(ue,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},ce=function(e){var n=e.children,t=e.siteDictionary,r=d.useState(e.siteLang),o=r[0],a=r[1],i=d.useState(t),u=i[0],l=i[1],c=d.useState("max"),s=c[0],f=c[1],p=d.useState(!1),v=p[0],y=p[1],g=d.useState(null),b=g[0],C=g[1],k=d.useState(!1),_=k[0],S=k[1],w=d.useState(),N=w[0],O=w[1],E=d.useState(),j=E[0],R=E[1],P=d.useState(),x=P[0],A=P[1],T=d.useState(),$=T[0],I=T[1],D=d.useState(),F=D[0],L=D[1],M={lang:o,setLang:a,dictionary:u,setDictionary:l,focused:F,changeFocus:function(e){F&&F.lose(),L(e)},sideNav:s,setSideNav:f,showNav:v,setShowNav:y,info:b,openInfo:function(e){C(e)},closeInfo:function(){C(null)},console:_,toggleConsole:function(){S(!_)},breadcrumb:$,setBreadcrumb:I,page:N,goto:function(e){O(e)},dialog:j,openDialog:function(e){R(e)},closeDialog:function(){R(null)},preview:x,openPreview:function(e){A(e)},closePreview:function(){A(null)}};return h(m.Provider,{value:M},n)},se=function(e){var n=e.logo,t=e.title,r=e.toolbar,o=e.children,a=e.init,i=e.min;return h(ce,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(fe,{icon:e.icon}),h(de,null,r),h(he,{logo:n,title:t,min:i},o),h(ve,{init:a},o,h(le,{id:"EMPTY"},"EMPTY")),h(pe,null),h(ge,null),h(me,null),h(ye,null)))},fe=function(e){var n=e.icon;return h(S,{icon:void 0===n?"equalizer":n,title:e.title})},de=function(e){var n=e.children;return d.useContext(m),h("nav",null,n)},pe=function(){var e=d.useContext(m);return e.info?h("aside",null,e.info):""},he=function(e){var n=e.children,t=e.min,r=d.useContext(m),o=r.showNav;d.useEffect(function(){t&&r.setSideNav("min")},[]);var a=n?d.Children.toArray(n).reduce(function(e,n){var t=n.props?n.props.section:"...";e[t]||(e[t]=[]);var r=n.props,o=r.title;return o&&e[t].push({id:r.id,icon:r.icon,title:o}),e},{}):{};return h("menu",{className:"min "+(o?"show":"")},h("main",null,Object.keys(a).map(function(e){return h(d.Fragment,{key:e},a[e].map(function(e){var n=e.id,t=e.icon;return h(p,{key:n,icon:void 0===t?"info":t,clickable:!0,checked:n===r.page,action:function(){return function(e){r.setShowNav(!1),r.goto(e)}(n)}})}),h("div",{className:"section-divider"}))})))},ve=function(e){var n=e.children,t=e.init,r=d.useContext(m),o=r.page;return d.useEffect(function(){r.goto(t||"EMPTY")},[]),h("main",null,d.Children.toArray(n).filter(function(e){return!!e.props&&e.props.id===o}))},me=function(){var e=d.useContext(m);return e.dialog?e.dialog:""},ye=function(){var e=d.useContext(m);return e.preview?h("div",{className:"site-preview"},e.preview):""},ge=function(){return d.useContext(m).console?h("footer",{className:"site-console"},h(S,null,h(L,null,h(M,{label:"Console"}))),h("main",null)):""},be=function(e){var n=d.useContext(m),t=e.icon,r=e.title,o=void 0===r?"Dialog":r,a=e.children,i=e.actions;return h(d.Fragment,null,h("div",{className:"overlay"}),h("div",{className:"dialog",onClick:function(){n.closeDialog()}},h("div",{className:"dialog-panel",onClick:function(e){e.preventDefault(),e.stopPropagation()}},h("header",null,t?h(P,{icon:t}):null,h(y,null,o)),h("main",null,a),h("footer",null,i))))},Ce={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},ke=Object.values(Ce).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),_e=/*#__PURE__*/function(){function e(e){this._schema=e}var n=e.prototype;return n.checkType=function(n,t){var r=n.type,o=n.item,a=!0,i=!0;if(o){var u=new e(o);switch(r){case Ce.ARRAY:a=ke["is"+r](t),i=t.every(function(e){return u.validate(e)});break;case Ce.ENTITY:a=ke["is"+r](t),i=u.validate(t);break;case Ce.NUMBER:a=ke["is"+r](t.value),i=!0;break;default:a=!0,i=!0}}return a&&i},n.validate=function(e){var n=this;return Object.entries(this._schema).filter(function(e){return!0===e[1].required}).every(function(t){var r=t[0];return void 0!==e[r]&&n.checkType(t[1],e[r])})},n.form=function(e){return Object.entries(this._schema).reduce(function(n,t){var r=t[0];return n[r]=Object.assign({},t[1],{value:e[r]}),n},{})},n.sections=function(e){var n=this.form(e),t=Object.values(n).reduce(function(e,n){var t=n.section||"";return e.hasOwnProperty(t)||(e[t]={title:t,fields:[]}),e[t].fields.push(n),e},{});return Object.values(t)},n.value=function(n){return Object.entries(this._schema).reduce(function(t,r){var o=r[0],a=r[1],i=a.item,u=n?n[o]:null;switch(a.type){case Ce.STRING:case Ce.NUMBER:case Ce.BOOLEAN:t[o]=u||a.default;break;case Ce.ENTITY:var l=new e(i);t[o]=l.value(u);break;case Ce.ARRAY:if(i===Ce.STRING)t[o]=u||[];else{var c=new e(i);t[o]=u?u.map(function(e){return c.value(e)}):[]}break;default:t[o]=a}return t},{})},e}(),Se=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new _e(e),this._value=n}var n=e.prototype;return n.isValid=function(){return this._type.validate(this._value)},n.value=function(){return this._type.value(this._value)},n.form=function(){return this._type.form(this._value)},n.sections=function(){return this._type.sections(this._value)},n.update=function(e){this._value=e},e}(),we=function(e){var n=e.columns,t=void 0===n?1:n,r=e.filter,o=e.onChange,a=e.content.form();console.log(a);var i=Object.keys(a).map(function(e){return a[e]}).filter(function(e){return!r||r(e)});return console.log(i),h(k,{className:"content-form",columns:t,outlined:!0,onChange:o},i.map(function(e){return h(Ne,w({key:e.id},e))}))},Ne=function(e){switch(e.type){case Ce.BOOLEAN:return h(g,w({key:e.id},e));case Ce.NUMBER:return h(Ee,w({key:e.id},e));default:return h(Oe,w({key:e.id},e))}},Oe=function(e){var n,t=e.id,r=e.type,o=e.label,a=e.options,i=e.textarea,u=e.required,l=void 0!==u&&u,c=e.value,s=e.onChange,f=e.outlined,d=((n={})[Ce.NUMBER]="number",n[Ce.DATE]="date",n)[r]||"text";return a?h(q,{key:t,id:t,label:o,value:c,onChange:s,options:"function"==typeof a?a():a,outlined:f}):h(U,{key:t,id:t,type:d,label:o,value:c,onChange:s,required:l,outlined:f,textarea:i})},Ee=function(e){var n=e.id,t=e.label,r=e.options,o=e.required,a=void 0!==o&&o,i=e.value,u=e.onChange,l=e.outlined;function c(e,n){u&&u(e,+n?+n:n)}return r?h(q,{key:n,id:n,label:t,value:i,onChange:c,options:r,outlined:l}):h(U,{key:n,id:n,type:"number",label:t,value:i,onChange:c,required:a,outlined:l})},je=function(e){var n=e.content,t=e.filter,r=e.onChange;function o(e,t){var o,a=Object.assign({},n.value(),((o={})[e]=t,o));r&&r(a)}var a=n.sections();return h("div",{className:"content-editor"},a.map(function(e){var r=e.title,a=e.fields;return h("section",{key:r},h("header",null,r),h("main",null,a.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e,n)}).map(function(e){return h(xe,{key:e.id,field:e,onChange:o})})))}))},Re=function(e){var n=e.content,t=e.filter,r=e.grouped,o=void 0!==r&&r,a=e.onChange,i=d.useState(0),u=i[0],l=i[1];function c(e,t){var r,o=Object.assign({},n.value(),((r={})[e]=t,r));a&&a(o)}var s=n.sections();return h("div",{className:"content-editor tabbed"},h(L,{selected:u,onChange:function(e){l(e)}},s.map(function(e){return h(M,{label:e.title})})),h(z,{selected:u},s.map(function(e){var r=e.fields;return h("section",{key:e.title},h("nav",null," "),h("main",null,o?function(e){var n=e.fields,t=(void 0===n?[]:n).reduce(function(e,n){var t=n.group||"",r=e[t]||{name:t,fields:[]};return r.fields.push(n),e[t]=r,e},{});return Object.values(t)}(e).map(function(e){return h(d.Fragment,null,e.name.length>0?h("div",{className:"group-caption"},e.name):null,e.fields.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e)}).map(function(e){return h(xe,{key:e.id,field:e,onChange:c,content:n})}))}):r.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e)}).map(function(e){return h(xe,{key:e.id,field:e,onChange:c,content:n})})))})))},Pe=function(e){var n=e.content,t=e.onChange,r=n.value(),o=Object.values(n.type).filter(function(e){return e.type===Ce.ARRAY}),a=d.useState(),i=a[0],u=a[1];function l(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(y,{use:"caption"},"Tree Editor")),h(X,null,o.map(function(e,n){return h(Q,{icon:"folder",label:e.label,actions:[h(p,{small:!0,icon:"add",clickable:!0,action:l})]},r[e.id]?r[e.id].map(function(n,t){return h(Z,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var o=new Se(t.item,n);u({index:e,item:o,node:t,value:r[t.id]})}(t,n,e)}})}):null)}))),h("div",null,i?h(Re,{content:i.item,onChange:function(e){var n,o=i.value.slice();o[i.index]=e;var a=Object.assign({},r,((n={})[i.node.id]=o,n));t&&t(a)}}):"select"))},xe=function(e){var n=e.field,t=e.onChange,r=e.content,o=e.outlined,a=void 0!==o&&o,i=n.id,u=n.type,l=n.item,c=n.label,s=n.editable,f=n.options;function d(e,n){t&&t(e,n)}return function(){var e=n.value?n.value:n.default;switch(u){case Ce.ENTITY:return h(Ae,{field:n,value:e,onChange:d});case Ce.STRING:return h(Te,{outlined:a,field:n,value:e,onChange:d,content:r});case Ce.BOOLEAN:return h(g,{outlined:!0,id:i,label:c,value:e,onChange:d});case Ce.DATE:return h(U,{outlined:a,id:i,type:"date",label:c,value:e,onChange:d,disabled:s});case Ce.NUMBER:return h($e,{outlined:a,field:n,value:e,onChange:d});case Ce.ARRAY:return l===Ce.STRING?f?h(De,{content:r,field:n,value:e,onChange:d}):h(Ie,{field:n,value:e,onChange:d}):h(Fe,{field:n,value:e,onChange:d});default:return h("div",null,c)}}()},Ae=function(e){var n=e.field,t=e.value,r=e.onChange,o=n.id,a=n.label,i=new Se(n.item,void 0===t?{}:t);function u(e,n){var t,a=Object.assign({},i.value(),((t={})[e]=n,t));r&&r(o,a)}var l=i.form(),c=Object.keys(l).map(function(e){return l[e]});return h("div",{className:"entity-editor"},h("header",null,h(y,{use:"caption"},a)),h("main",null,c.map(function(e){return h(xe,{key:e.id,field:e,onChange:u})})))},Te=function(e){var n=e.field,t=e.value,r=void 0===t?"":t,o=e.onChange,a=e.outlined,i=n.id,u=n.label,l=n.options,c=n.editable;function s(e,n){o&&o(e,n)}return h("div",{className:"field-editor string-editor"},void 0===c||c?l?h(q,{outlined:a,id:i,label:u,value:r,onChange:s,options:"function"==typeof l?l(n,e.content):l}):h(U,{outlined:a,id:i,label:u,value:r,onChange:s}):h(U,{outlined:a,id:i,label:u,value:r,onChange:s,readOnly:!0}))},$e=function(e){var n=e.field,t=e.onChange,r=n.editable;return h("div",{className:"field-editor number-editor"},h(U,{outlined:!0,id:n.id,label:n.label,type:"NUMBER",value:e.value||n.default,max:n.max,min:n.min,onChange:function(e,n){t&&t(e,n)},disabled:!(void 0===r||r)}))},Ie=function(e){var n=e.field,t=e.value,r=e.onChange;return h("div",{className:"list-editor"},h(G,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){r&&r(e,n)}}))},De=function(e){var n=e.field,t=e.value,r=void 0===t?[]:t,o=e.content,a=e.onChange,i=n.id,u=n.options;return h("div",{className:"multiselection-editor"},h("label",null,n.label),("function"==typeof u?u(n,o):u).map(function(e){var n=r.includes(e.value);return h(g,{value:n,label:e.label,onChange:function(){return(t=r.indexOf(n=e.value))>=0?r.splice(t,1):r.push(n),void(a&&a(i,r));var n,t}})}))},Fe=function(e){var n=e.field,t=e.value,r=void 0===t?[]:t,o=e.onChange,a=n.id,i=n.item,u=n.label,l=n.Feeder,c=n.Renderer,s=n.Adder,f=void 0===s||s,d=n.editable,v=void 0===d||d;function m(e){if(o){var n=r.concat(e);o(a,n)}}function g(e){if(o){var n=r.filter(function(n,t){return t!==e});o(a,n)}}function b(e,n,t){if(o){var i=r.slice();i[e][n]=t,o(a,i)}}var C=Object.values(i).map(function(e){return w({},e,{onChange:b})});C.push({id:"actions",label:"Actions"});var k=r.map(function(e,n){return w({},e,{id:n,actions:[h(p,{icon:"delete",clickable:!0,action:function(){return g(n)},small:!0})]})}),_={columns:C,rows:k};return h("div",{className:"collection-editor"},h("header",null,h(y,{use:"caption"},u),h("div",{className:"actions"},l?h(l,{onAdd:m}):null)),c?h(c,{field:n,value:r,onRemove:g,onChange:o}):h(B,w({},_,{editable:v})),h("footer",null,f?h(Le,{item:i,onAdd:m}):null))},Le=function(e){var n=e.item,t=e.onAdd,r=d.useState(!1),o=r[0],a=r[1],i=d.useState({}),u=i[0],l=i[1];function c(){a(!o)}function s(e,n,r){if(t){var o,a=Object.assign({},u,((o={})[n]=r,o));l(a)}}var f=Object.values(n).map(function(e){return w({},e,{type:"String",onChange:s})});f.push({id:"actions",label:""});var m=[{actions:[h(p,{icon:"done",clickable:!0,action:function(){t&&t([u]),c()}}),h(p,{icon:"close",clickable:!0,action:c})]}];return m[0]=Object.assign({},u,m[0]),h("div",{className:"collection-adder"},o?h(B,w({},{columns:f,rows:m},{editable:!0})):h(v,{icon:"add",label:"Add",action:c}))},Me=function(e){var n=e.label,t=e.type,r=e.validator,o=e.onOK,a=e.onActionClose,i=void 0===a||a,u=d.useContext(m),l=d.useState({}),c=l[0],s=l[1],f=d.useState(!1),p=f[0],g=f[1],b=d.useState([]),C=b[0],k=b[1];function _(e){"OK"===e&&o&&o(c),"CLOSE"!==e&&!0!==i||u.closeDialog()}var S=h(d.Fragment,null,h(v,{label:"CLOSE",action:function(){return _("CLOSE")}}),h(v,{label:"OK",action:function(){return _("OK")},disabled:!p,raised:!0})),w=h(y,{use:"headline6"},n),N=new Se(t,c);return h(be,{title:w,open:!0,onAction:_,actions:S},h(we,{content:N,filter:function(e){return function(e){var n=e.required;return void 0!==n&&n}(e)||function(e){var n=e.creation;return void 0!==n&&n}(e)},onChange:function(e,n){if(s(e),r){var t=r(e),o=t.errors,a=void 0===o?[]:o;g(n&&t.validation),k(a)}else g(n)}}),C.map(function(e){return h(y,{use:"overline",tag:"div",className:"error"},e)}))},ze=function(e){var n=e.label,t=e.type,r=e.value,o=void 0===r?{}:r,a=e.filter,i=e.validator,u=e.onOK,l=d.useContext(m),c=d.useState(o),s=c[0],f=c[1],p=d.useState(!1),g=p[0],b=p[1],C=d.useState([]),k=C[0],_=C[1];function S(e){"OK"===e&&u&&u(Object.assign({},o,s)),l.closeDialog()}var w=h(d.Fragment,null,h(v,{label:"CLOSE",action:function(){return S("CLOSE")}}),h("div",{className:"expand"}),h(v,{label:"OK",action:function(){return S("OK")},disabled:!g,raised:!0})),N=h(y,{use:"headline6"},n),O=new Se(t,s);return h(be,{title:N,open:!0,onAction:S,actions:w},h(je,{content:O,onChange:function(e){if(f(e),i){var n=i(e),t=n.errors,r=void 0===t?[]:t;b(n.validation),_(r)}else b(!0)},filter:a}),k.map(function(e){return h(y,{use:"overline",tag:"div",className:"error"},e)}))},Ue=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)};export{v as Button,g as CheckBox,b as Chip,C as Chips,T as CircularProgress,Fe as CollectionEditor,Se as Content,je as ContentEditor,we as ContentForm,Me as CreateContentDialog,B as DataTable,be as Dialog,q as DropDown,ze as EditContentDialog,xe as FieldEditor,k as Form,n as HTTPClient,S as Header,p as Icon,re as Kanban,ae as KanbanCard,oe as KanbanColumn,$ as LinearProgress,N as List,Ie as ListEditor,ee as LoginBox,R as Menu,P as MenuIcon,x as MenuItem,A as MenuSeparator,le as Page,ie as PageContext,ue as PageProvider,I as Property,D as RadioButton,ne as ResetPasswordBox,F as Section,r as Session,se as Site,ce as SiteProvider,z as Stack,Ce as TYPES,M as Tab,Re as TabbedContentEditor,L as Tabs,y as Text,U as TextField,G as TokenField,X as Tree,Z as TreeItem,Q as TreeNode,Pe as TreededContentEditor,te as Viewer,Ue as isFunction};
|
1
|
+
import"material-design-icons-iconfont/dist/material-design-icons.css";import e,{useContext as n,useState as t,useEffect as i,Fragment as o,useRef as r,Children as l,useMemo as a}from"react";import c from"deep-equal";import u from"resumablejs";var s=function(e,n,t,i){void 0===t&&(t=null);try{console.log("FETCH",e,n);var o={method:e,mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json","x-access-token":i},body:t};return Promise.resolve(function(e,t){try{var i=Promise.resolve(fetch(n,o)).then(function(e){var n;function t(t){if(n)return t;throw e}var i=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){return n=1,e})}();return i&&i.then?i.then(t):t(i)})}catch(e){return t(e)}return i&&i.then?i.then(void 0,t):i}(0,function(e){if(e instanceof Error)throw{error:e};return Promise.resolve(e.json()).then(function(e){throw{success:!1,message:e.message}})}))}catch(e){return Promise.reject(e)}},d=function(e,n){return{GET:function(t){var i=n?n.token():null;return s("GET",e+t,void 0,i)},POST:function(t,i){var o=n?n.token():null;return s("POST",e+t,i,o)},PUT:function(t,i){var o=n?n.token():null;return s("PUT",e+t,i,o)},PATCH:function(t,i){var o=n?n.token():null;return s("PATCH",e+t,i,o)},DELETE:function(t){var i=n?n.token():null;return s("DELETE",e+t,void 0,i)}}},f=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",v={token:function(){return(sessionStorage.getItem(f)?JSON.parse(sessionStorage.getItem(f)):{}).token},me:function(){return(sessionStorage.getItem(f)?JSON.parse(sessionStorage.getItem(f)):{}).me},init:function(e,n){sessionStorage.setItem(f,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(f,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(f)}},m=function(e){var n=e.size,t=e.clickable,i=e.action;return h("i",{className:"icon "+(void 0===n?"normal":n)+" "+(void 0!==t&&t?"clickable":"")+" material-icons",onClick:function(e){e.stopPropagation(),e.preventDefault(),i&&i()}},e.icon)},p=function(e){var n=e.label,t=e.icon,i=e.action,o=e.disabled,r=void 0!==o&&o,l=e.raised?"raised":e.outlined?"outlined":"normal";return r&&(l+=" disabled"),h("button",{className:"btn "+l,onClick:function(e){r||(e.stopPropagation(),e.preventDefault(),i&&i())}},t?h(m,{icon:t,size:"small"}):null,h("span",null,n))},g=React.createContext({}),b=function(e){var t=e.children,i=n(g);if(i){var o=i.dictionary,r=(void 0===o?{}:o)[t],l=r?r[i.lang]:t;return l?h("span",null,l):""}return t?h("span",null,t):""},y=function(e){var n=e.id,t=e.label,i=e.placeholder,o=e.value,r=e.onChange;function l(e){r&&r(n,e.target.checked)}var a=h(b,null,t);return console.log(t,o),!0===o?h("div",{className:"checkbox",key:n+"1"},h("input",{id:n,type:"checkbox",placeholder:i,checked:!0,value:o,onChange:l}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},a)):h("div",{className:"checkbox",key:n+"0"},h("input",{id:n,type:"checkbox",placeholder:i,value:o,onChange:l}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},a))},N=function(e){var n=e.id,t=e.icon,i=e.label,o=e.action,r=e.onSelect,l=e.outlined?"outlined":"normal";return e.selected&&(l+=" selected"),h("div",{className:"chip "+l,onClick:function(e){e.stopPropagation(),e.preventDefault(),r&&r(n)}},t?h(m,{icon:t,size:"small"}):null,h("main",null,h(b,null,i)),o?h("span",{className:"meta"},o):null)},C=function(e){return h("div",{className:"chips"},e.children)},k=function(n){var r=n.title,l=n.columns,a=void 0===l?1:l,c=n.children,u=n.outlined,s=n.onChange,d=t([]),f=d[0],v=d[1],m=function(e){return null==e||""===e};i(function(){var n=e.Children.toArray(c).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props,t=n.id,i=n.value,o=n.required,r=void 0!==o&&o,l=n.validation,a=!r||(l?l(i):!m(i));return{id:t,value:i,required:r,validation:l,valid:a}}).filter(function(e){return void 0!==e.id});v(n)},[]),i(function(){if(s){var e=f.every(function(e){return!0===e.valid}),n=f.reduce(function(e,n){var t=n.value;return(t||!1===t)&&(e[n.id]=t),e},{});s(n,e)}},[f]);var p=function(e,n){var t=f.find(function(n){return n.id===e});if(t){var i=!t.required||(t.validation?t.validation(n):!m(n));Object.assign(t,{value:n,valid:i}),v(f.slice())}},g=e.Children.toArray(c).filter(function(e){return null!==e&&""!==e}).map(function(n){var t=n.props.span,i=void 0===t?1:t,o=e.cloneElement(n,{onChange:p,outlined:!!u});return h(O,{style:{gridColumn:"span "+i}},o)}),y={gridTemplateColumns:"repeat("+a+", 1fr)"};return h(o,null,r?h("header",{className:"form-header"},h(b,{use:"headline6"},r)):"",h("form",{className:"form-grid",style:y},g))},O=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},P=function(e){var n=e.caption?"caption":"",t=e.prominent?"prominent":"",i=e.dense?"dense":"",o=e.primary?"primary":"";o=e.secondary?"secondary":o;var r=e.icon?h(m,{icon:e.icon,clickable:e.clickable,action:e.action}):"";r=e.iconSrc?h("img",{className:"header-icon",src:e.iconSrc}):r;var l=e.img?{backgroundImage:"url("+e.img+")"}:{},a=h(b,null,e.title);return h("header",{className:"header "+n+" "+t+" "+i+" "+o+" "+e.className,style:l},r,e.title?h("label",null,a):null,h("span",{className:"actions"},e.children))};function S(){return S=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},S.apply(this,arguments)}var E=function(e){var n=e.items,t=void 0===n?[]:n,i=e.children,o=e.onSelect;function r(e){o&&o(e)}return e.groupBy?h(w,S({},e,{onSelect:r})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(j,{key:e.id,item:e,onSelect:r})})),i)},w=function(e){var n=e.items,t=e.children,i=e.onSelect,r=e.groupBy,l=(void 0===n?[]:n).reduce(function(e,n){var t=e.find(function(e){return e.name===n.content[r]});return t||e.push(t={name:n.content[r],items:[]}),t.items.push(n),e},[]);return h("div",{className:"list"},l.map(function(e){return h(o,{key:e.name},h("header",{key:e.name+"-header"},h(b,null,e.name)),h("ul",{key:e.name+"-ul"},e.items.map(function(e){return h(j,{key:e.id,item:e,onSelect:i})})))}),t)},j=function(e){var n=e.item,t=e.onSelect,i=n.id,o=n.icon,r=n.line1,l=n.line2,a=n.meta;return h("li",{id:i,onClick:function(){t&&t(i)}},o?h(m,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(b,null,r)),l?h("div",{className:"secondary-line"},h(b,null,l)):null),a?h("div",{className:"meta"},a):null)},A=e.createContext({}),T=function(e){return h("ul",null,e.children)},x=function(e){var n=e.icon,i=void 0===n?"more_vert":n,o=e.children,r=e.align,l=t(!1),a=l[0],c=l[1];function u(){c(!a)}return h(A.Provider,{value:[a,c]},h("div",{className:"menu-icon"},h(m,{icon:i,clickable:!0,action:u}),a?h("menu",{className:""+r},o):null,a?h("div",{className:"overlay",onClick:u}):null))},_=function(e){var t=e.icon,i=e.label,o=e.meta,r=e.onSelect,l=n(A)[1];return h("li",{className:"menu-item",onClick:function(){r&&r(),l(!1)}},t?h(m,{icon:t}):null,h("label",null,i),o?h("div",{className:"meta"},o):null)},D=function(e){return h("li",null,"menuSeparator")},I=function(e){return h("div",{className:"circular-progress"},h(m,{icon:"refresh",size:"small"}))},R=function(e){var n=e.progress,t=e.max;return h("div",{className:"linear-progress"},h("progress",{value:void 0===n?0:n,max:void 0===t?100:t}))},L=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},B=function(e){var n=e.id,t=e.name,i=e.placeholder,o=e.value,r=e.onChange,l=h(b,null,e.label);return h("div",{className:"radio"},h("input",{id:n,name:t,type:"radio",placeholder:i,value:o,onClick:function(e){r&&r(n,e.target.value)}}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},l))},F=function(e){var n=e.icon,o=e.title,r=void 0===o?"":o,l=e.canCollapse,a=void 0===l||l,c=e.open,u=void 0!==c&&c,s=e.actions,d=e.children,f=e.className,v=t(u),p=v[0],g=v[1];return i(function(){g(u)},[u]),h("section",{className:"section2 "+f},h(P,{icon:{icon:n},title:r},s,a?h(m,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){g(!u)}}):""),p?h("main",null,d):"")},z=function(n){var t=n.selected,i=n.onChange,o=e.Children.map(n.children,function(n,o){return e.cloneElement(n,{selected:o===t,onSelect:function(){i&&i(o)}})});return h("div",{class:"tabs"},o,h("div",{class:"tab-filler"}))},K=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},U=function(n){var t=n.selected,i=void 0===t?0:t,r=e.Children.toArray(n.children).filter(function(e,n){return n===i})[0];return h(o,null,r)},Y=function(e){var t=n(g),i=e.id,o=e.type,r=void 0===o?"text":o,l=e.label,a=e.placeholder,c=e.value,u=e.readOnly,s=void 0!==u&&u,d=e.onChange,f=e.onEnter,v=e.onClick,m=(l?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),p=h(b,null,l);return h("div",{className:""+m,onClick:v},h("input",{id:i,type:r,placeholder:a,value:c,required:!0,onChange:function(e){e.stopPropagation(),e.preventDefault(),d&&d(i,e.target.value)},onKeyDown:function(e){13==(e.charCode?e.charCode:e.keyCode?e.keyCode:0)&&f()},onFocus:function(){t&&t.changeFocus({lose:function(){}})},readOnly:s}),h("span",{className:"bar"}),l?h("label",null,p):null)},q=function(e){var o=n(g),r=e.id,l=e.options,a=void 0===l?[]:l,c=e.value,u=e.onChange,s=t(!1),d=s[0],f=s[1],v=t(),p=v[0],b=v[1];function y(){o&&o.changeFocus({lose:function(){f(!1)}}),f(!d)}return i(function(){if(Array.isArray(a)){var e=a.find(function(e){return e.value===c});e&&b(e.label)}},[c]),h("div",{className:"dropdown"},h(Y,S({},e,{onClick:y,value:p})),h(m,{icon:"expand_more",clickable:!0,size:"small",action:y}),1==d?h("menu",null,h("ul",{onClick:function(e){var n=e.target.getAttribute("value"),t=a.find(function(e){return e.value===n});u&&u(r,n),b(t.label),f(!1)}},Array.isArray(a)?a.map(function(e){return h("li",{key:e.value,value:e.value},e.label)}):null)):null)},M=function(e){var n=e.columns,i=void 0===n?[]:n,o=e.rows,r=void 0===o?[]:o,l=e.onRowSelection,a=e.onSort,c=e.editable,u=e.outlined,s=t({})[0];function d(e,n){l&&l(e,n)}function f(e,n){a&&a(e,n)}return h("div",{className:"datatable8 "+(u?"outlined":"")},h("table",null,h("thead",null,h("tr",null,i.map(function(e){var n=e.sortable;return h("th",null,h(b,null,e.label),n?h(m,{icon:"arrow_up",size:"small",clickable:!0}):null)}))),h("tbody",null,function(e,n){void 0===n&&(n={});var t=Object.keys(n);if(!t.length)return e;var i=function(e,n,t){return t=null!==t?t:1,e===n?0:e>n?t:-1*t};return e.sort(function(e,o){for(var r=0,l=0;0===r&&l<t.length;){var a=t[l];a&&(r=i(e[a],o[a],n[a]),l++)}return r})}(r,s).map(function(e){return h(G,{key:e.id,row:e,columns:i,onSelect:d,onDrop:f,editable:c})}))))},G=function(e){var n,i=e.row,r=e.columns,l=void 0===r?[]:r,a=e.onSelect,c=e.editable,u=t(!1),s=u[0],d=u[1],f=s?"expand_more":"expand_less";return h(o,null,h("tr",{onClick:function(e){return a(i,e)}},l.map(function(e){return h(J,{row:i,column:e,cell:i[e.id],editable:c})}),i.info?h(m,{icon:f,clickable:!0,action:function(){return d(!s)}}):null),i.info&&s?h("tr",{className:"table-row-info"},(n=i.info)&&("[object Function]"===Object.prototype.toString.call(n)||"function"==typeof n||n instanceof Function)?i.info():i.info):null)},J=function(e){var n=e.row,t=e.column,i=e.cell,o=e.editable;return h("td",{className:t.id},function(e){var r=t.id,l=t.disabled,a=void 0!==l&&l,c=t.min,u=t.max,s=t.onChange,d=t.options;if(o&&s)switch(e){case"ICON":return h(m,{icon:i});case"BOOLEAN":case"Boolean":return h(y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:a});case"SELECTION":return h(q,{id:r,value:i,placeholder:"--Select--",options:d,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return i&&i.value?h(y,{id:r,value:i.checked||!1,label:i.value,onChange:function(e,t){return s(n.id,e,i.value,t,i)}}):"";case"TEXTFIELD":return h(Y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(W,{id:r,value:i,options:d,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(Y,{id:r,type:"number",value:i,min:c,max:u,onChange:function(e,t){return s(n.id,e,t)}});default:return i}else switch(e){case"ICON":return h(m,{icon:i});case"Boolean":return h(H,{id:r,value:i});case"String":return h(V,{id:r,value:i,options:d});default:return i}}(t.type))},H=function(e){var n=e.value;return h(m,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},V=function(e){var n=e.value,t=e.options,i=t?t.find(function(e){return e.value===n}):null;return h("div",{className:"field-editor string-editor"},i?i.label:n)},W=function(e){var n=e.id,t=e.value,i=void 0===t?"":t,o=e.options,r=e.onChange;function l(e,n){r&&r(e,n)}return h("div",{className:"field-editor string-editor"},o?h(q,{outlined:!0,id:n,value:i,onChange:l,options:o}):h(Y,{outlined:!0,id:n,value:i,onChange:l}))},X=function(e){var n=e.id,o=e.label,l=e.init,a=e.onChange,c=r(!1),u=t(),s=u[0],d=u[1],f=t(l),v=f[0],m=f[1];return i(function(){c.current?a&&v&&a(n,v):c.current=!0},[v]),h("div",{className:"tokenField"},h("label",null,o),v.map(function(e,n){return h(Q,{text:e,onDelete:function(){return function(e){var n=v.slice();n.splice(e,1),m(n)}(n)}})}),h("input",{type:"text",value:s,onChange:function(e){d(e.target.value)},onKeyDown:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var n=v.concat(e.target.value);m(n),d("")}if(""===s&&v.length>0&&"Backspace"===e.key){var t=v.slice(0,-1);m(t)}}}))},Q=function(e){var n=e.onDelete;return h("div",{className:"token"},h(b,{use:"caption",tag:"div"},e.text),h(m,{icon:"close",clickable:!0,action:n,size:"small"}))},Z=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},$=function(e){var n=e.icon,t=void 0===n?"folder":n,i=e.label,o=e.open,r=e.children,l=e.actions;return h("details",{className:"tree-node",open:void 0!==o&&o},h("summary",{className:"tree-item"},t?h(m,{icon:t,size:"small",small:!0}):null,h("div",{className:"label"},i),h("div",{className:"actions"},l)),r)},ee=function(e){var n=e.id,t=e.icon,i=e.label,o=e.actions,r=e.onSelect;return h("div",{className:"tree-item final",onClick:function(){r&&r(n)}},h(m,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},i),h("div",{className:"actions"},o))},ne=function(e){var n=e.logo,i=e.title,o=e.userLabel,r=void 0===o?"User":o,l=e.passwordLabel,a=void 0===l?"Password":l,c=e.loginLabel,u=void 0===c?"Log In":c,s=e.onOK,d=e.forgotLabel,f=void 0===d?"Forgot Password ?":d,v=e.onForgot,g=e.message,y=e.loading,N=t(""),C=N[0],k=N[1],O=t(""),P=O[0],S=O[1];function E(){return C&&C.length>0&&P&&P.length>0}function w(e){s&&E()&&s(C,e||P)}function j(e){return h(b,null,e)}return h("div",{className:"login-box"},h("header",null,n?h("img",{src:n}):"",h("div",{className:"title"},h(b,null,i))),h("main",null,h(Y,{label:j(r),value:C,onChange:function(e,n){k(n)},onEnter:w,outlined:!0}),h(Y,{label:j(a),value:P,onChange:function(e,n){S(n)},onEnter:w,type:"password",outlined:!0})),h("footer",null,v?h(p,{label:j(f),action:function(){v&&v(C)},disabled:!(C&&C.length>0)}):null,y?h("div",{className:"load-box"},h(m,{icon:"refresh"})):h(p,{label:j(u),action:w,disabled:!E(),raised:!0}),g?h("div",{className:"message"},h(b,null,g)):null))},te=function(e){var n=e.logo,i=e.title,o=e.children,r=e.onOK,l=e.onClose,a=t({}),c=a[0],u=a[1],s=t(),d=s[0],f=s[1];function v(){return c.password1&&c.password2}function m(e,n){var t,i=Object.assign({},c,((t={})[e]=n,t));u(i)}function g(){r&&v()&&(c.password1===c.password2?(f(null),r(c)):f("New Password and Confirm New Password do not match"))}return h("div",{className:"reset-password-box"},h("header",null,n?h("img",{src:n}):null,i?h("div",{className:"title"},h(b,null,i)):null,o),h("main",null,h(b,{use:"headline6"},"Change Password"),h(Y,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:m,onEnter:g}),h(Y,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:m,onEnter:g}),d?h("div",{className:"error"},d):null),h("footer",null,h(p,{label:"Close",action:function(){l&&l()}}),h(p,{label:"OK",raised:!0,disabled:!v(),action:g})))},ie=function(e){var n=e.title,i=e.src,o=e.info,r=e.actions,l=void 0===r?[]:r,a=e.tools,c=void 0!==a&&a,u=e.onClose,s=t(!1),d=s[0],f=s[1];function v(){f(!d)}var p=h(b,{use:"headline6"},n);return h("div",{className:"viewer"},h(P,{icon:{icon:"close",clickable:!0,action:u},title:p},d?"":h(m,{icon:"info",clickable:!0,action:v}),l),h("main",null,h("div",{className:"resizer"},h("picture",null,h("img",{src:i})))),h("aside",{className:d?"open":""},h(P,{title:"Detalles"},h(m,{icon:"close",clickable:!0,action:v})),h("main",null,o)),c?h("footer",null,h(m,{clickable:!0,icon:"zoom_out"}),h(m,{clickable:!0,icon:"zoom_out_map"}),h(m,{clickable:!0,icon:"zoom_in"})):null)},oe=function(e){return h("div",{className:"kanban"},e.children)},re=function(e){var n=e.id,i=e.icon,o=e.title,r=e.subtitle,l=e.badge,a=e.children,c=e.minified,u=e.disabled,s=void 0!==u&&u,d=t(void 0!==c&&c),f=d[0],v=d[1];function p(){v(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,o),h("footer",null,h(m,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p}))):h("div",{className:"kanban-column "+n+" "+(s?"disabled":"")},h("header",null,h(m,{icon:i}),h("div",{className:"title"},h(b,{use:"headline6"},o),h(b,{className:"secondary-text",use:"body2"},r)),h("div",{className:"badge"},l)),h("main",null,a),h("footer",null,h(m,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p})))},le=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},ae=e.createContext({}),ce=function(e){var n=e.context,i=e.children,o=t(void 0===n?{}:n);return h(ae.Provider,{value:[o[0],o[1]]},i)},ue=function(e){var n=e.layout,t=e.context;return h(ce,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},se=function(e){var n=e.children,i=e.siteDictionary,o=t(e.siteLang),r=o[0],l=o[1],a=t(i),c=a[0],u=a[1],s=t("max"),d=s[0],f=s[1],v=t(!1),m=v[0],p=v[1],b=t(null),y=b[0],N=b[1],C=t(!1),k=C[0],O=C[1],P=t(),S=P[0],E=P[1],w=t(),j=w[0],A=w[1],T=t(),x=T[0],_=T[1],D=t(),I=D[0],R=D[1],L=t(),B=L[0],F=L[1],z={lang:r,setLang:l,dictionary:c,setDictionary:u,focused:B,changeFocus:function(e){B&&B.lose(),F(e)},sideNav:d,setSideNav:f,showNav:m,setShowNav:p,info:y,openInfo:function(e){N(e)},closeInfo:function(){N(null)},console:k,toggleConsole:function(){O(!k)},breadcrumb:I,setBreadcrumb:R,page:S,goto:function(e){E(e)},dialog:j,openDialog:function(e){A(e)},closeDialog:function(){A(null)},preview:x,openPreview:function(e){_(e)},closePreview:function(){_(null)}};return h(g.Provider,{value:z},n)},de=function(e){var n=e.logo,t=e.title,i=e.toolbar,o=e.children,r=e.init,l=e.min;return h(se,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(he,{icon:e.icon}),h(fe,null,i),h(me,{logo:n,title:t,min:l},o),h(pe,{init:r},o,h(ue,{id:"EMPTY"},"EMPTY")),h(ve,null),h(ye,null),h(ge,null),h(be,null)))},he=function(e){var n=e.icon;return h(P,{icon:void 0===n?"equalizer":n,title:e.title})},fe=function(e){var t=e.children;return n(g),h("nav",null,t)},ve=function(){var e=n(g);return e.info?h("aside",null,e.info):""},me=function(e){var t=e.children,r=e.min,a=n(g),c=a.showNav;i(function(){r&&a.setSideNav("min")},[]);var u=t?l.toArray(t).reduce(function(e,n){var t=n.props?n.props.section:"...";e[t]||(e[t]=[]);var i=n.props,o=i.title;return o&&e[t].push({id:i.id,icon:i.icon,title:o}),e},{}):{};return h("menu",{className:"min "+(c?"show":"")},h("main",null,Object.keys(u).map(function(e){return h(o,{key:e},u[e].map(function(e){var n=e.id,t=e.icon;return h(m,{key:n,icon:void 0===t?"info":t,clickable:!0,checked:n===a.page,action:function(){return function(e){a.setShowNav(!1),a.goto(e)}(n)}})}),h("div",{className:"section-divider"}))})))},pe=function(t){var o=t.children,r=t.init,l=n(g),a=l.page;return i(function(){l.goto(r||"EMPTY")},[]),h("main",null,e.Children.toArray(o).filter(function(e){return!!e.props&&e.props.id===a}))},ge=function(){var e=n(g);return e.dialog?e.dialog:""},be=function(){var e=n(g);return e.preview?h("div",{className:"site-preview"},e.preview):""},ye=function(){return n(g).console?h("footer",{className:"site-console"},h(P,null,h(z,null,h(K,{label:"Console"}))),h("main",null)):""},Ne=function(e){var t=n(g),i=e.icon,r=e.title,l=void 0===r?"Dialog":r,a=e.children,c=e.actions;return h(o,null,h("div",{className:"overlay"}),h("div",{className:"dialog",onClick:function(){t.closeDialog()}},h("div",{className:"dialog-panel",onClick:function(e){e.preventDefault(),e.stopPropagation()}},h("header",null,i?h(x,{icon:i}):null,h(b,null,l)),h("main",null,a),h("footer",null,c))))},Ce={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},ke=Object.values(Ce).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),Oe=/*#__PURE__*/function(){function e(e){this._schema=e}var n=e.prototype;return n.checkType=function(n,t){var i=n.type,o=n.item,r=!0,l=!0;if(o){var a=new e(o);switch(i){case Ce.ARRAY:r=ke["is"+i](t),l=t.every(function(e){return a.validate(e)});break;case Ce.ENTITY:r=ke["is"+i](t),l=a.validate(t);break;case Ce.NUMBER:r=ke["is"+i](t.value),l=!0;break;default:r=!0,l=!0}}return r&&l},n.validate=function(e){var n=this;return Object.entries(this._schema).filter(function(e){return!0===e[1].required}).every(function(t){var i=t[0];return void 0!==e[i]&&n.checkType(t[1],e[i])})},n.form=function(e){return Object.entries(this._schema).reduce(function(n,t){var i=t[0];return n[i]=Object.assign({},t[1],{value:e[i]}),n},{})},n.sections=function(e){var n=this.form(e),t=Object.values(n).reduce(function(e,n){var t=n.section||"";return e.hasOwnProperty(t)||(e[t]={title:t,fields:[]}),e[t].fields.push(n),e},{});return Object.values(t)},n.value=function(n){return Object.entries(this._schema).reduce(function(t,i){var o=i[0],r=i[1],l=r.item,a=n?n[o]:null;switch(r.type){case Ce.STRING:case Ce.NUMBER:case Ce.BOOLEAN:t[o]=a||r.default;break;case Ce.ENTITY:var c=new e(l);t[o]=c.value(a);break;case Ce.ARRAY:if(l===Ce.STRING)t[o]=a||[];else{var u=new e(l);t[o]=a?a.map(function(e){return u.value(e)}):[]}break;default:t[o]=r}return t},{})},e}(),Pe=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new Oe(e),this._value=n}var n=e.prototype;return n.isValid=function(){return this._type.validate(this._value)},n.value=function(){return this._type.value(this._value)},n.form=function(){return this._type.form(this._value)},n.sections=function(){return this._type.sections(this._value)},n.update=function(e){this._value=e},e}(),Se=function(e){var n=e.columns,t=void 0===n?1:n,i=e.filter,o=e.onChange,r=e.content.form();console.log(r);var l=Object.keys(r).map(function(e){return r[e]}).filter(function(e){return!i||i(e)});return console.log(l),h(k,{className:"content-form",columns:t,outlined:!0,onChange:o},l.map(function(e){return h(Ee,S({key:e.id},e))}))},Ee=function(e){switch(e.type){case Ce.BOOLEAN:return h(y,S({key:e.id},e));case Ce.NUMBER:return h(je,S({key:e.id},e));default:return h(we,S({key:e.id},e))}},we=function(e){var n,t=e.id,i=e.type,o=e.label,r=e.options,l=e.textarea,a=e.required,c=void 0!==a&&a,u=e.value,s=e.onChange,d=e.outlined,f=((n={})[Ce.NUMBER]="number",n[Ce.DATE]="date",n)[i]||"text";return r?h(q,{key:t,id:t,label:o,value:u,onChange:s,options:"function"==typeof r?r():r,outlined:d}):h(Y,{key:t,id:t,type:f,label:o,value:u,onChange:s,required:c,outlined:d,textarea:l})},je=function(e){var n=e.id,t=e.label,i=e.options,o=e.required,r=void 0!==o&&o,l=e.value,a=e.onChange,c=e.outlined;function u(e,n){a&&a(e,+n?+n:n)}return i?h(q,{key:n,id:n,label:t,value:l,onChange:u,options:i,outlined:c}):h(Y,{key:n,id:n,type:"number",label:t,value:l,onChange:u,required:r,outlined:c})},Ae=function(e){var n=e.content,t=e.filter,i=e.onChange;function o(e,t){var o,r=Object.assign({},n.value(),((o={})[e]=t,o));i&&i(r)}var r=n.sections();return h("div",{className:"content-editor"},r.map(function(e){var i=e.title,r=e.fields;return h("section",{key:i},h("header",null,i),h("main",null,r.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e,n)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:o})})))}))},Te=function(e){var n=e.content,i=e.filter,r=e.grouped,l=void 0!==r&&r,a=e.onChange,c=t(0),u=c[0],s=c[1];function d(e,t){var i,o=Object.assign({},n.value(),((i={})[e]=t,i));a&&a(o)}var f=n.sections();return h("div",{className:"content-editor tabbed"},h(z,{selected:u,onChange:function(e){s(e)}},f.map(function(e){return h(K,{label:e.title})})),h(U,{selected:u},f.map(function(e){var t=e.fields;return h("section",{key:e.title},h("nav",null," "),h("main",null,l?function(e){var n=e.fields,t=(void 0===n?[]:n).reduce(function(e,n){var t=n.group||"",i=e[t]||{name:t,fields:[]};return i.fields.push(n),e[t]=i,e},{});return Object.values(t)}(e).map(function(e){return h(o,null,e.name.length>0?h("div",{className:"group-caption"},e.name):null,e.fields.filter(function(e){return"id"!==e.id}).filter(function(e){return!i||i(e)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:d,content:n})}))}):t.filter(function(e){return"id"!==e.id}).filter(function(e){return!i||i(e)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:d,content:n})})))})))},xe=function(e){var n=e.content,i=e.onChange,o=n.value(),r=Object.values(n.type).filter(function(e){return e.type===Ce.ARRAY}),l=t(),a=l[0],c=l[1];function u(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(b,{use:"caption"},"Tree Editor")),h(Z,null,r.map(function(e,n){return h($,{icon:"folder",label:e.label,actions:[h(m,{small:!0,icon:"add",clickable:!0,action:u})]},o[e.id]?o[e.id].map(function(n,t){return h(ee,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var i=new Pe(t.item,n);c({index:e,item:i,node:t,value:o[t.id]})}(t,n,e)}})}):null)}))),h("div",null,a?h(Te,{content:a.item,onChange:function(e){var n,t=a.value.slice();t[a.index]=e;var r=Object.assign({},o,((n={})[a.node.id]=t,n));i&&i(r)}}):"select"))},_e=function(e){var n=e.field,t=e.onChange,i=e.content,o=e.outlined,r=void 0!==o&&o,l=n.id,a=n.type,c=n.item,u=n.label,s=n.editable,d=n.options;function f(e,n){t&&t(e,n)}return function(){var e=n.value?n.value:n.default;switch(a){case Ce.ENTITY:return h(De,{field:n,value:e,onChange:f});case Ce.STRING:return h(Ie,{outlined:r,field:n,value:e,onChange:f,content:i});case Ce.BOOLEAN:return h(y,{outlined:!0,id:l,label:u,value:e,onChange:f});case Ce.DATE:return h(Y,{outlined:r,id:l,type:"date",label:u,value:e,onChange:f,disabled:s});case Ce.NUMBER:return h(Re,{outlined:r,field:n,value:e,onChange:f});case Ce.ARRAY:return c===Ce.STRING?d?h(Be,{content:i,field:n,value:e,onChange:f}):h(Le,{field:n,value:e,onChange:f}):h(Fe,{field:n,value:e,onChange:f});default:return h("div",null,u)}}()},De=function(e){var n=e.field,t=e.value,i=e.onChange,o=n.id,r=n.label,l=new Pe(n.item,void 0===t?{}:t);function a(e,n){var t,r=Object.assign({},l.value(),((t={})[e]=n,t));i&&i(o,r)}var c=l.form(),u=Object.keys(c).map(function(e){return c[e]});return h("div",{className:"entity-editor"},h("header",null,h(b,{use:"caption"},r)),h("main",null,u.map(function(e){return h(_e,{key:e.id,field:e,onChange:a})})))},Ie=function(e){var n=e.field,t=e.value,i=void 0===t?"":t,o=e.onChange,r=e.outlined,l=n.id,a=n.label,c=n.options,u=n.editable;function s(e,n){o&&o(e,n)}return h("div",{className:"field-editor string-editor"},void 0===u||u?c?h(q,{outlined:r,id:l,label:a,value:i,onChange:s,options:"function"==typeof c?c(n,e.content):c}):h(Y,{outlined:r,id:l,label:a,value:i,onChange:s}):h(Y,{outlined:r,id:l,label:a,value:i,onChange:s,readOnly:!0}))},Re=function(e){var n=e.field,t=e.onChange,i=n.editable;return h("div",{className:"field-editor number-editor"},h(Y,{outlined:!0,id:n.id,label:n.label,type:"NUMBER",value:e.value||n.default,max:n.max,min:n.min,onChange:function(e,n){t&&t(e,n)},disabled:!(void 0===i||i)}))},Le=function(e){var n=e.field,t=e.value,i=e.onChange;return h("div",{className:"list-editor"},h(X,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){i&&i(e,n)}}))},Be=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.content,r=e.onChange,l=n.id,a=n.options;return h("div",{className:"multiselection-editor"},h("label",null,n.label),("function"==typeof a?a(n,o):a).map(function(e){var n=i.includes(e.value);return h(y,{value:n,label:e.label,onChange:function(){return(t=i.indexOf(n=e.value))>=0?i.splice(t,1):i.push(n),void(r&&r(l,i));var n,t}})}))},Fe=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.onChange,r=n.id,l=n.item,a=n.label,c=n.Feeder,u=n.Renderer,s=n.Adder,d=void 0===s||s,f=n.editable,v=void 0===f||f;function p(e){if(o){var n=i.concat(e);o(r,n)}}function g(e){if(o){var n=i.filter(function(n,t){return t!==e});o(r,n)}}function y(e,n,t){if(o){var l=i.slice();l[e][n]=t,o(r,l)}}var N=Object.values(l).map(function(e){return S({},e,{onChange:y})});N.push({id:"actions",label:"Actions"});var C=i.map(function(e,n){return S({},e,{id:n,actions:[h(m,{icon:"delete",clickable:!0,action:function(){return g(n)},small:!0})]})}),k={columns:N,rows:C};return h("div",{className:"collection-editor"},h("header",null,h(b,{use:"caption"},a),h("div",{className:"actions"},c?h(c,{onAdd:p}):null)),u?h(u,{field:n,value:i,onRemove:g,onChange:o}):h(M,S({},k,{editable:v})),h("footer",null,d?h(ze,{item:l,onAdd:p}):null))},ze=function(e){var n=e.item,i=e.onAdd,o=t(!1),r=o[0],l=o[1],a=t({}),c=a[0],u=a[1];function s(){l(!r)}function d(e,n,t){if(i){var o,r=Object.assign({},c,((o={})[n]=t,o));u(r)}}var f=Object.values(n).map(function(e){return S({},e,{type:"String",onChange:d})});f.push({id:"actions",label:""});var v=[{actions:[h(m,{icon:"done",clickable:!0,action:function(){i&&i([c]),s()}}),h(m,{icon:"close",clickable:!0,action:s})]}];return v[0]=Object.assign({},c,v[0]),h("div",{className:"collection-adder"},r?h(M,S({},{columns:f,rows:v},{editable:!0})):h(p,{icon:"add",label:"Add",action:s}))},Ke=function(e){var i=e.label,r=e.type,l=e.validator,a=e.onOK,c=e.onActionClose,u=void 0===c||c,s=n(g),d=t({}),f=d[0],v=d[1],m=t(!1),y=m[0],N=m[1],C=t([]),k=C[0],O=C[1];function P(e){"OK"===e&&a&&a(f),"CLOSE"!==e&&!0!==u||s.closeDialog()}var S=h(o,null,h(p,{label:"CLOSE",action:function(){return P("CLOSE")}}),h(p,{label:"OK",action:function(){return P("OK")},disabled:!y,raised:!0})),E=h(b,{use:"headline6"},i),w=new Pe(r,f);return h(Ne,{title:E,open:!0,onAction:P,actions:S},h(Se,{content:w,filter:function(e){return function(e){var n=e.required;return void 0!==n&&n}(e)||function(e){var n=e.creation;return void 0!==n&&n}(e)},onChange:function(e,n){if(v(e),l){var t=l(e),i=t.errors,o=void 0===i?[]:i;N(n&&t.validation),O(o)}else N(n)}}),k.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))},Ue=function(e){var i=e.label,r=e.type,l=e.value,a=void 0===l?{}:l,c=e.filter,u=e.validator,s=e.onOK,d=n(g),f=t(a),v=f[0],m=f[1],y=t(!1),N=y[0],C=y[1],k=t([]),O=k[0],P=k[1];function S(e){"OK"===e&&s&&s(Object.assign({},a,v)),d.closeDialog()}var E=h(o,null,h(p,{label:"CLOSE",action:function(){return S("CLOSE")}}),h("div",{className:"expand"}),h(p,{label:"OK",action:function(){return S("OK")},disabled:!N,raised:!0})),w=h(b,{use:"headline6"},i),j=new Pe(r,v);return h(Ne,{title:w,open:!0,onAction:S,actions:E},h(Ae,{content:j,onChange:function(e){if(m(e),u){var n=u(e),t=n.errors,i=void 0===t?[]:t;C(n.validation),P(i)}else C(!0)},filter:c}),O.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))};function Ye(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var qe=d(window.API||process.env.REACT_APP_API,v),Me=function(e){var t=n(g),r=e.id,l=void 0===r?"collection":r,a=e.icon,c=e.title,u=e.name,s=void 0===u?"Collection 1":u,d=e.schema,f=e.url,v=e.groupBy,m=e.editor,y=e.field,N=e.autosave,C=void 0!==N&&N,k=e.delay,O=void 0===k?1e3:k,S=e.actions,E=e.levels,w=n(ae),j=w[0],A=w[1],T=Ve(f,y);return i(function(){try{return Promise.resolve(T.load()).then(function(){A(T)})}catch(e){return Promise.reject(e)}},[]),h(o,null,h(P,{className:"collection-page",title:h(b,null,c)},h(p,{icon:"add",label:"Add",action:function(){t.openDialog(h(Ue,{label:"Crear "+s,type:d,onOK:function(e){try{return Promise.resolve(j.create(e)).then(function(){A(Object.assign({},j))})}catch(e){return Promise.reject(e)}}}))}}),h(p,{icon:"refresh",label:"Reload",action:function(){try{return Promise.resolve(j.load()).then(function(){A(Object.assign({},j))})}catch(e){return Promise.reject(e)}}}),S),h("menu",{className:"collection-page"},h(P,{title:h(b,null,"Lista de ",s)}),E?h(Je,{levels:E}):h(Ge,{groupBy:v})),h("main",{key:l,className:"collection-page"},h(He,{icon:a,schema:d,layout:m,autosave:C,delay:O})))},Ge=function(e){var t=e.groupBy,i=n(ae),o=i[0],r=i[1],l=o.all,a=void 0===l?[]:l,c=a?a.map(function(e){return{id:e.id,line1:e.name,line2:e.description,content:e}}):[];return h(E,{items:c,onSelect:function(e){try{return o.clear(),r(Object.assign({},o)),Promise.resolve(o.select(e)).then(function(){r(Object.assign({},o))})}catch(e){return Promise.reject(e)}},groupBy:t})},Je=function(e){var t=function(e){try{return r.clear(),l(Object.assign({},r)),Promise.resolve(r.select(e)).then(function(){l(Object.assign({},r))})}catch(e){return Promise.reject(e)}},i=e.levels,o=n(ae),r=o[0],l=o[1],a=r.all,c=function e(n,t){var i=function(e,n){return e.reduce(function(e,t){var i=e.find(function(e){return e.name===t[n]});return i||e.push(i={name:t[n],items:[],field:n}),i.items.push(t),e},[])}(t,n[0]);return n.length>1&&i.forEach(function(t){return t.nodes=e(n.slice(1),t.items)}),i}(i,void 0===a?[]:a);return h("main",null,h(Z,null,function e(n){return n.map(function(n){return h($,{key:n.name,icon:null,label:"boolean"==typeof n.name?n.field+" = "+n.name:n.name,open:!0},n.nodes?e(n.nodes):n.items.map(function(e){return h(ee,{key:e.id,id:e.id,label:e.name,onSelect:t},"item")}))})}(c)))},He=function(e){var l=function(){try{return console.log("saving....."),Promise.resolve(u.update(w)).then(function(){s(Object.assign({},u))})}catch(e){return Promise.reject(e)}},a=n(ae),u=a[0],s=a[1],d=u.selected,f=e.icon,v=e.schema,g=e.layout,y=e.autosave,N=void 0!==y&&y,C=e.delay,k=void 0===C?1e3:C,O=r(null),E=t(d),w=E[0],j=E[1];function A(e){j(e)}function D(){return!c(w,d)}return i(function(){j(d)},[d]),i(function(){N&&(clearTimeout(O.current),O.current=setTimeout(function(){D()&&l()},k))},[w]),d&&w?h(o,null,h(P,{icon:f,title:h(b,null,d.name)},h(m,{icon:"close",clickable:!0,action:function(){u.clear(),s(Object.assign({},u))}}),h(x,{align:"alignRight"},h(T,null,h(_,{label:"Eliminar",onSelect:function(){try{return Promise.resolve(u.remove(d.id)).then(function(){u.clear(),s(Object.assign({},u))})}catch(e){return Promise.reject(e)}}}))),!0===N?null:h(p,{icon:"save",label:"Guardar Cambios",raised:!0,disabled:!D(),action:l})),function(){var n=new Pe(v,w);switch(g){case"TABBED":return h(Te,S({},e,{content:n,onChange:A}));case"TREEDED":return h(xe,S({},e,{content:n,onChange:A}));default:return h(Ae,S({},e,{content:n,onChange:A}))}}()):null},Ve=function(e,n){var t=We(e);return{all:[],selected:null,load:function(){try{var e=this,i=Ye(function(){return Promise.resolve(t.all()).then(function(t){e.all=n?t[n]:t})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},select:function(e){var n=this.all.find(function(n){return n.id===e});this.selected=n},clear:function(){this.selected=null},create:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.create(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log("CREATE ERROR",e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},update:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.update(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},patch:function(e,n){try{var i=this,o=Ye(function(){return Promise.resolve(t.patch(e,n)).then(function(){return Promise.resolve(i.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},updateProperty:function(e,n,i){try{var o=this,r=Ye(function(){return Promise.resolve(t.updateProperty(e,n,i)).then(function(){return Promise.resolve(o.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},remove:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.remove(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}},We=function(e){return{all:function(){return qe.GET(e)},find:function(n){return qe.GET(e+"/"+n)},create:function(n){var t=JSON.stringify(n);return qe.POST(e,t)},update:function(n){var t=JSON.stringify(n);return qe.PUT(e+"/"+n.id,t)},patch:function(n,t){var i=JSON.stringify(t);return qe.PATCH(e+"/"+n,i)},updateProperty:function(n,t,i){var o=JSON.stringify(i);return qe.PUT(e+"/"+n+"/"+t,o)},remove:function(n){return qe.DELETE(e+"/"+n)}}},Xe=function(e){var n=r(),o=t(!1),l=o[0],a=o[1];i(function(){var t=e.resumable;t&&n&&t.assignDrop(n.current)},[]);var c=e.state,u=void 0===c?0:c,s=e.label,d=void 0===s?"Add file or drop file here...":s,f=e.error;return h("div",{className:"upload-area6 "+(!0===l?"drag-over":""),onDragOver:function(){a(!0)},onDragLeave:function(){a(!1)},ref:n},0===u?h(Qe,{resumable:e.resumable}):"",0===u?h("label",null,d):"",1===u?h(I,{size:"xlarge"}):"",2===u?h(m,{icon:"done_all"}):"",3===u?h(b,{use:"body1"},f):"",e.children)},Qe=function(e){var n=e.resumable,t=r();return i(function(){n&&t&&n.assignBrowse(t.current)},[]),h("div",{className:"upload-icon",ref:t},h(m,{icon:"folder_open",clickable:!0}))},Ze=function(e){var n=e.label,i=e.target,o=e.accept,r=e.className,l=e.onSuccess,c=e.onError,s=e.onComplete,d=a(function(){var e=new u({target:i,chunkSize:1048576,simultaneousUploads:1,testChunks:!1,throttleProgressCallbacks:1,fileType:o});return e.on("fileAdded",O),e.on("fileProgress",P),e.on("fileSuccess",S),e.on("fileError",E),e.on("complete",w),e},[]),f=t(0)[1],v=t(0),m=v[0],p=v[1],g=t(),b=g[0],y=g[1],N=t([]),C=N[0],k=N[1];function O(e){C.push(e),k(C),d.upload()}function P(e){var n=e.progress();f(n)}function S(e,n){p(2),l&&l(e,n)}function E(e,n){y(n),p(3),c&&c(e,n)}function w(){p(0),s&&s(C)}return h("div",{className:"uploader "+r},h(Xe,{resumable:d,state:m,label:n,error:b}))},$e=function(e){var n=e.file,t=e.state,i=e.progress,r=e.error,l=r?h(m,{icon:"image",className:"error"}):h(m,{icon:"image"});return 0!==t?h(o,null,h("div",{className:"upload-file"},l,h(b,{use:"body1",tag:"label"},n.fileName),1===t?h(R,{progress:i}):"",1===t?h(m,{icon:"close",clickable:!0}):"",2===t?h(m,{icon:"done"}):"",3===t?h(m,{icon:"error"}):""),r?h("div",{className:"error"},h(b,{use:"overline"},r)):""):""},en=function(e){var i=e.label,r=e.target,l=e.accept,a=e.onSuccess,c=e.onClose,u=e.onActionClose,s=void 0===u||u,d=n(g),f=t(),v=f[0],m=f[1],y=t([])[0];function N(e){"CLOSE"!==e&&!0!==s||(d.closeDialog(),c())}var C=h(o,null,h(p,{label:"CLOSE",action:function(){return N("CLOSE")}})),k=h(b,{use:"headline6"},i);return h(Ne,{title:k,open:!0,onAction:N,actions:C},v?h($e,{file:v}):h(Ze,{label:i,accept:l,target:r,onComplete:function(e){m(e[0]),a&&a(e[0])}}),y.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))},nn=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)};export{p as Button,y as CheckBox,N as Chip,C as Chips,I as CircularProgress,Ve as CollectionContext,Fe as CollectionEditor,Me as CollectionPage,Pe as Content,Ae as ContentEditor,Se as ContentForm,Ke as CreateContentDialog,M as DataTable,Ne as Dialog,q as DropDown,Ue as EditContentDialog,_e as FieldEditor,k as Form,d as HTTPClient,P as Header,m as Icon,oe as Kanban,le as KanbanCard,re as KanbanColumn,R as LinearProgress,E as List,Le as ListEditor,ne as LoginBox,T as Menu,x as MenuIcon,_ as MenuItem,D as MenuSeparator,ue as Page,ae as PageContext,ce as PageProvider,L as Property,B as RadioButton,te as ResetPasswordBox,F as Section,v as Session,de as Site,g as SiteContext,se as SiteProvider,U as Stack,Ce as TYPES,K as Tab,Te as TabbedContentEditor,z as Tabs,b as Text,Y as TextField,X as TokenField,Z as Tree,ee as TreeItem,$ as TreeNode,xe as TreededContentEditor,Xe as UploadArea,en as UploadDialog,$e as UploadFile,Ze as Uploader,ie as Viewer,nn as isFunction};
|
2
2
|
//# sourceMappingURL=index.modern.js.map
|