diff --git a/src/frontend/packages/list-components/dist/index.cjs.js b/src/frontend/packages/list-components/dist/index.cjs.js index e465c1a0a..5b2b5fb8b 100644 --- a/src/frontend/packages/list-components/dist/index.cjs.js +++ b/src/frontend/packages/list-components/dist/index.cjs.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-admin"),r=require("@material-ui/core"),n=require("@material-ui/icons/AddCircle"),a=require("@material-ui/icons/Launch"),l=require("@semapps/semantic-data-provider"),o=require("react-masonry-css"),i=require("react-redux"),s=require("react-router");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var d=c(e),f=u(e),m=c(n),p=c(a),h=c(o);function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,l=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(l.push(n.value),!t||l.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return l}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,l=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(l.push(n.value),!t||l.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return l}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r ({\n root: {\n display: 'flex',\n flexWrap: 'wrap'\n },\n link: {\n textDecoration: 'none',\n maxWidth: '100%'\n },\n chipField: {\n maxWidth: '100%'\n },\n addIcon: {\n cursor: 'pointer',\n fontSize: 35,\n position: 'relative',\n top: -2,\n left: -2\n },\n launchIcon: {\n width: 16,\n paddingRight: 6,\n marginLeft: -10\n }\n}));\n\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst ChipList = props => {\n const {\n classes: classesOverride,\n className,\n children,\n linkType = 'edit',\n component = 'div',\n primaryText,\n appendLink,\n externalLinks = false,\n ...rest\n } = props;\n const { ids, data, loaded, basePath } = useListContext(props);\n const resource = useResourceContext(props);\n const getExternalLink = useGetExternalLink(externalLinks);\n\n const classes = useStyles(props);\n const Component = component;\n\n if (loaded === false) {\n return ;\n }\n\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n if (externalLink) {\n return (\n \n \n }\n // Workaround to force ChipField to be clickable\n onClick={handleClick}\n // Required to display the delete icon\n onDelete={handleClick}\n />\n \n \n );\n } else if (linkType) {\n return (\n \n \n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n })}\n {appendLink && }\n \n );\n};\n\nexport default ChipList;\n","import * as React from 'react';\nimport { useListContext, linkToRecord, Link, RecordContextProvider } from 'react-admin';\nimport { Grid } from '@material-ui/core';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\n// useful to prevent click bubbling in a datagrid with rowClick\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst GridList = ({ children, linkType, externalLinks, spacing, xs, sm, md, lg, xl }) => {\n const { ids, data, basePath } = useListContext();\n const getExternalLink = useGetExternalLink(externalLinks);\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n let child;\n\n if (externalLink) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n externalLink: true,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else if (linkType) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else {\n child = React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath\n });\n }\n\n return (\n \n \n {child}\n \n \n );\n })}\n \n );\n};\n\nGridList.defaultProps = {\n xs: 6,\n spacing: 3,\n linkType: 'edit',\n externalLinks: false\n};\n\nexport default GridList;\n","import React from 'react';\nimport { useListContext, Link, linkToRecord } from 'react-admin';\nimport { makeStyles, Card, CardActionArea, CardMedia, CardContent, CardActions } from '@material-ui/core';\nimport Masonry from 'react-masonry-css';\n\nconst useStyles = makeStyles(() => ({\n grid: {\n display: 'flex',\n marginLeft: -20,\n marginBottom: -20,\n width: 'auto'\n },\n column: {\n paddingLeft: 20,\n backgroundClip: 'padding-box'\n },\n card: {\n marginBottom: 20\n },\n media: {\n height: 0,\n paddingTop: '56.25%' // 16:9\n }\n}));\n\n/**\n * @example\n * \n * record.image}\n * content={record => (\n * <>\n * {record.title}\n * {record.description}\n * \n * )}\n * linkType=\"show\"\n * />\n * \n */\nconst MasonryList = ({ image, content, actions, breakpointCols, linkType }) => {\n const classes = useStyles();\n const { ids, data, basePath } = useListContext();\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const imageUrl = typeof image === 'function' ? image(data[id]) : image;\n return (\n \n \n \n {imageUrl && }\n {content && {content(data[id])}}\n \n \n {actions && (\n \n {actions.map(action => React.createElement(action, { record: data[id], basePath }))}\n \n )}\n \n );\n })}\n \n );\n};\n\nMasonryList.defaultProps = {\n breakpointCols: { default: 3, 1050: 2, 700: 1 },\n linkType: 'edit'\n};\n\nexport default MasonryList;\n","import React, { useEffect } from 'react';\nimport { FilterList, FilterListItem, useGetList, getResources, useResourceContext, useListContext } from 'react-admin';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { useContainers, useDataModel } from '@semapps/semantic-data-provider';\n\n/**\n * @example\n * const FilterAside = () => (\n * \n * \n * \n * \n * \n * \n * \n * );\n */\n\nconst ReferenceFilterCounter = ({ source, id }) => {\n const resourceContext = useResourceContext();\n const { data } = useGetList(resourceContext);\n return (\n <>\n  \n {'(' + Object.values(data).filter(d => ([].concat(d[source])).includes(id)).length + ')'}\n \n );\n};\n\nconst ReferenceFilter = ({ reference, source, inverseSource, limit, sort, filter, label, icon, showCounters }) => {\n const { data, ids } = useGetList(reference, { page: 1, perPage: limit }, sort, filter);\n const resources = useSelector(getResources, shallowEqual);\n const currentResource = resources.filter(r => r?.name === reference)[0];\n const resourceContext = useResourceContext();\n const resourceContextDataModel = useDataModel(resourceContext);\n const resourceContextContainers = useContainers(resourceContext);\n \n const {\n displayedFilters,\n filterValues,\n setFilters,\n hideFilter\n } = useListContext();\n useEffect(() => {\n // Needed when filter item is active and its last relation is removed\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n if (! params.filter) {\n setFilters({});\n }\n }, []);\n \n const itemIsUsed = (id) => {\n if (!inverseSource) {\n return true;\n }\n if (!resourceContextContainers || !data || !data[id][inverseSource]) {\n return false;\n }\n let itemIsUsed = false; \n Object.values(resourceContextContainers).forEach(value => {\n value.forEach(containerUrl => {\n [].concat(data[id][inverseSource]).forEach(inverseSourceData => {\n if (inverseSourceData.startsWith(containerUrl)) {\n itemIsUsed = true;\n }\n })\n })\n });\n return itemIsUsed;\n }\n \n return (\n \n {ids\n .filter(id => itemIsUsed(id))\n .map(id => (\n \n {data[id]['pair:label']}\n {showCounters && }\n \n }\n value={{ [source]: id }}\n />\n ))}\n \n );\n};\n\nReferenceFilter.defaultProps = {\n limit: 25,\n showCounters: true\n};\n\nexport default ReferenceFilter;\n","import React from 'react';\n\nconst ListViewContext = React.createContext({ views: null, currentView: null, setView: () => null });\n\nexport default ListViewContext;\n","import React from 'react';\nimport { Button, Link } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListViewContext from './ListViewContext';\n\nconst ViewsButtons = () => {\n const query = new URLSearchParams(useLocation().search);\n const { views, currentView, setView } = React.useContext(ListViewContext);\n return views\n ? Object.entries(views)\n .filter(([key]) => key !== currentView)\n .map(([key, view]) => {\n query.set('view', key);\n query.set('page', 1);\n query.set('perPage', view.perPage);\n if (view.sort) {\n query.set('sort', view.sort.field);\n query.set('order', view.sort.order);\n }\n return (\n \n \n \n );\n })\n : null;\n};\n\nexport default ViewsButtons;\n","import React from 'react';\nimport { CreateButton, ExportButton, useResourceDefinition, TopToolbar } from 'react-admin';\nimport { useMediaQuery } from '@material-ui/core';\nimport ViewsButtons from './ViewsButtons';\n\nconst ListActionsWithViews = ({\n bulkActions,\n basePath,\n currentSort,\n displayedFilters,\n exporter,\n filters,\n filterValues,\n onUnselectItems,\n resource,\n selectedIds,\n showFilter,\n total,\n ...rest\n}) => {\n const xs = useMediaQuery(theme => theme.breakpoints.down('xs'));\n const resourceDefinition = useResourceDefinition(rest);\n return (\n \n \n {filters &&\n React.cloneElement(filters, {\n resource,\n showFilter,\n displayedFilters,\n filterValues,\n context: 'button'\n })}\n {resourceDefinition.hasCreate && }\n {!xs && exporter !== false && (\n \n )}\n {bulkActions &&\n React.cloneElement(bulkActions, {\n basePath,\n filterValues,\n resource,\n selectedIds,\n onUnselectItems\n })}\n \n );\n};\n\nexport default ListActionsWithViews;\n","import React, { useState } from 'react';\nimport { List } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListActionsWithViews from './ListActionsWithViews';\nimport ListViewContext from './ListViewContext';\n\nconst MultiViewsList = ({ children, actions, views, ListComponent, ...otherProps }) => {\n const query = new URLSearchParams(useLocation().search);\n const initialView = query.has('view') ? query.get('view') : Object.keys(views)[0];\n const [currentView, setView] = useState(initialView);\n return (\n \n \n {views[currentView].list}\n \n \n );\n};\n\nMultiViewsList.defaultProps = {\n actions: ,\n ListComponent: List\n};\n\nexport default MultiViewsList;\n"],"names":["useStyles","makeStyles","theme","root","display","flexWrap","link","textDecoration","maxWidth","chipField","addIcon","cursor","fontSize","position","top","left","launchIcon","width","paddingRight","marginLeft","stopPropagation","e","handleClick","GridList","_ref","children","linkType","externalLinks","spacing","xs","sm","md","lg","xl","_useListContext","useListContext","ids","data","basePath","getExternalLink","useGetExternalLink","React","Grid","container","map","id","child","externalLink","createElement","href","target","rel","onClick","cloneElement","Children","only","record","props","Link","to","linkToRecord","item","key","RecordContextProvider","value","defaultProps","grid","marginBottom","column","paddingLeft","backgroundClip","card","media","height","paddingTop","MasonryList","image","content","actions","breakpointCols","classes","Masonry","className","columnClassName","imageUrl","Card","CardActionArea","CardMedia","CardContent","CardActions","action","default","1050","700","ReferenceFilterCounter","source","resourceContext","useResourceContext","useGetList","Fragment","Object","values","filter","d","concat","includes","length","ReferenceFilter","_ref2","reference","inverseSource","limit","sort","label","icon","showCounters","page","perPage","currentResource","useSelector","getResources","shallowEqual","r","name","useDataModel","resourceContextContainers","useContainers","displayedFilters","filterValues","setFilters","hideFilter","useEffect","urlSearchParams","URLSearchParams","window","location","search","fromEntries","entries","FilterList","options","itemIsUsed","forEach","containerUrl","inverseSourceData","startsWith","FilterListItem","ListViewContext","createContext","views","currentView","setView","ViewsButtons","query","useLocation","_React$useContext","useContext","_slicedToArray","_ref3","_ref4","view","set","field","order","toString","Button","ListActionsWithViews","bulkActions","currentSort","exporter","filters","onUnselectItems","resource","selectedIds","showFilter","total","rest","_objectWithoutProperties","_excluded","useMediaQuery","breakpoints","down","resourceDefinition","useResourceDefinition","TopToolbar","context","hasCreate","CreateButton","ExportButton","disabled","MultiViewsList","ListComponent","otherProps","initialView","has","get","keys","_useState2","useState","Provider","_extends","pagination","list","List","_props$linkType","component","_props$component","primaryText","appendLink","_props$externalLinks","loaded","Component","LinearProgress","sanitizeListRestProps","ChipField","color","deleteIcon","LaunchIcon","onDelete","AddCircleIcon"],"mappings":"m4EAeMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,KAAM,CACJC,QAAS,OACTC,SAAU,QAEZC,KAAM,CACJC,eAAgB,OAChBC,SAAU,QAEZC,UAAW,CACTD,SAAU,QAEZE,QAAS,CACPC,OAAQ,UACRC,SAA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AcvK,wBAACkL,EAAAA,QAAD,CAAeJ,MAAM,UAAUrI,UAAWF,EAAQtE,QAAS0C,QAAS4J"} \ No newline at end of file +{"version":3,"file":"index.cjs.js","sources":["../src/ChipList.js","../src/GridList.js","../src/MasonryList.js","../src/ReferenceFilter.js","../../../node_modules/clsx/dist/clsx.m.js","../src/ReferenceFilterTree.js","../src/MultiViewsList/ListViewContext.js","../src/MultiViewsList/ViewsButtons.js","../src/MultiViewsList/ListActionsWithViews.js","../src/MultiViewsList/MultiViewsList.js"],"sourcesContent":["import React from 'react';\nimport {\n ChipField,\n useResourceContext,\n useListContext,\n sanitizeListRestProps,\n linkToRecord,\n RecordContextProvider,\n Link\n} from 'react-admin';\nimport { makeStyles, LinearProgress } from '@material-ui/core';\nimport AddCircleIcon from '@material-ui/icons/AddCircle';\nimport LaunchIcon from '@material-ui/icons/Launch';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex',\n flexWrap: 'wrap'\n },\n link: {\n textDecoration: 'none',\n maxWidth: '100%'\n },\n chipField: {\n maxWidth: '100%'\n },\n addIcon: {\n cursor: 'pointer',\n fontSize: 35,\n position: 'relative',\n top: -2,\n left: -2\n },\n launchIcon: {\n width: 16,\n paddingRight: 6,\n marginLeft: -10\n }\n}));\n\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst ChipList = props => {\n const {\n classes: classesOverride,\n className,\n children,\n linkType = 'edit',\n component = 'div',\n primaryText,\n appendLink,\n externalLinks = false,\n ...rest\n } = props;\n const { ids, data, loaded, basePath } = useListContext(props);\n const resource = useResourceContext(props);\n const getExternalLink = useGetExternalLink(externalLinks);\n\n const classes = useStyles(props);\n const Component = component;\n\n if (loaded === false) {\n return ;\n }\n\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n if (externalLink) {\n return (\n \n \n }\n // Workaround to force ChipField to be clickable\n onClick={handleClick}\n // Required to display the delete icon\n onDelete={handleClick}\n />\n \n \n );\n } else if (linkType) {\n return (\n \n \n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n })}\n {appendLink && }\n \n );\n};\n\nexport default ChipList;\n","import * as React from 'react';\nimport { useListContext, linkToRecord, Link, RecordContextProvider } from 'react-admin';\nimport { Grid } from '@material-ui/core';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\n// useful to prevent click bubbling in a datagrid with rowClick\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst GridList = ({ children, linkType, externalLinks, spacing, xs, sm, md, lg, xl }) => {\n const { ids, data, basePath } = useListContext();\n const getExternalLink = useGetExternalLink(externalLinks);\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n let child;\n\n if (externalLink) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n externalLink: true,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else if (linkType) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else {\n child = React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath\n });\n }\n\n return (\n \n \n {child}\n \n \n );\n })}\n \n );\n};\n\nGridList.defaultProps = {\n xs: 6,\n spacing: 3,\n linkType: 'edit',\n externalLinks: false\n};\n\nexport default GridList;\n","import React from 'react';\nimport { useListContext, Link, linkToRecord } from 'react-admin';\nimport { makeStyles, Card, CardActionArea, CardMedia, CardContent, CardActions } from '@material-ui/core';\nimport Masonry from 'react-masonry-css';\n\nconst useStyles = makeStyles(() => ({\n grid: {\n display: 'flex',\n marginLeft: -20,\n marginBottom: -20,\n width: 'auto'\n },\n column: {\n paddingLeft: 20,\n backgroundClip: 'padding-box'\n },\n card: {\n marginBottom: 20\n },\n media: {\n height: 0,\n paddingTop: '56.25%' // 16:9\n }\n}));\n\n/**\n * @example\n * \n * record.image}\n * content={record => (\n * <>\n * {record.title}\n * {record.description}\n * \n * )}\n * linkType=\"show\"\n * />\n * \n */\nconst MasonryList = ({ image, content, actions, breakpointCols, linkType }) => {\n const classes = useStyles();\n const { ids, data, basePath } = useListContext();\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const imageUrl = typeof image === 'function' ? image(data[id]) : image;\n return (\n \n \n \n {imageUrl && }\n {content && {content(data[id])}}\n \n \n {actions && (\n \n {actions.map(action => React.createElement(action, { record: data[id], basePath }))}\n \n )}\n \n );\n })}\n \n );\n};\n\nMasonryList.defaultProps = {\n breakpointCols: { default: 3, 1050: 2, 700: 1 },\n linkType: 'edit'\n};\n\nexport default MasonryList;\n","import React, { useEffect } from 'react';\nimport { FilterList, FilterListItem, useGetList, getResources, useResourceContext, useListContext } from 'react-admin';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { useContainers, useDataModel } from '@semapps/semantic-data-provider';\n\n/**\n * @example\n * const FilterAside = () => (\n * \n * \n * \n * \n * \n * \n * \n * );\n */\n\nconst ReferenceFilterCounter = ({ source, id }) => {\n const resourceContext = useResourceContext();\n const { data } = useGetList(resourceContext);\n return (\n <>\n  \n {'(' + Object.values(data).filter(d => ([].concat(d[source])).includes(id)).length + ')'}\n \n );\n};\n\nconst ReferenceFilter = ({ reference, source, inverseSource, limit, sort, filter, label, icon, showCounters }) => {\n const { data, ids } = useGetList(reference, { page: 1, perPage: limit }, sort, filter);\n const resources = useSelector(getResources, shallowEqual);\n const currentResource = resources.filter(r => r?.name === reference)[0];\n const resourceContext = useResourceContext();\n const resourceContextDataModel = useDataModel(resourceContext);\n const resourceContextContainers = useContainers(resourceContext);\n \n const {\n displayedFilters,\n filterValues,\n setFilters,\n hideFilter\n } = useListContext();\n useEffect(() => {\n // Needed when filter item is active and its last relation is removed\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n if (! params.filter) {\n setFilters({});\n }\n }, []);\n \n const itemIsUsed = (id) => {\n if (!inverseSource) {\n return true;\n }\n if (!resourceContextContainers || !data || !data[id][inverseSource]) {\n return false;\n }\n let itemIsUsed = false; \n Object.values(resourceContextContainers).forEach(value => {\n value.forEach(containerUrl => {\n [].concat(data[id][inverseSource]).forEach(inverseSourceData => {\n if (inverseSourceData.startsWith(containerUrl)) {\n itemIsUsed = true;\n }\n })\n })\n });\n return itemIsUsed;\n }\n \n return (\n \n {ids\n .filter(id => itemIsUsed(id))\n .map(id => (\n \n {data[id]['pair:label']}\n {showCounters && }\n \n }\n value={{ [source]: id }}\n />\n ))}\n \n );\n};\n\nReferenceFilter.defaultProps = {\n limit: 25,\n showCounters: true\n};\n\nexport default ReferenceFilter;\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t (\n * \n * \n * \n * \n * \n * \n * );\n */\n\n\nfunction GenerateTreeItemFromNarrower( source, label, themeList, narrower) {\n let narrowerChild = {};\n let isLastNarrower = false;\n return (\n themeList.map(function(theme) { \n if (theme != undefined) {\n if (theme[source] == narrower[\"id\"]) {\n themeList.map(function(t) {\n if (t[source] != undefined && t[source] == theme[\"id\"]) {\n isLastNarrower = true;\n narrowerChild = t;\n }\n })\n return (\n \n {isLastNarrower ? GenerateTreeItemFromNarrower(source, label, themeList, theme) : null }\n \n )\n }\n }\n })\n )\n}\n\nconst CustomContent = React.forwardRef(function CustomContent(props, ref) {\n const {\n classes,\n className,\n label,\n nodeId,\n icon: iconProp,\n expansionIcon,\n displayIcon,\n } = props;\n\n const {\n disabled,\n expanded,\n selected,\n focused,\n handleExpansion,\n handleSelection,\n preventSelection,\n } = useTreeItem(nodeId);\n\n const icon = iconProp || expansionIcon || displayIcon;\n\n const handleMouseDown = (event) => {\n preventSelection(event);\n };\n\n const handleExpansionClick = (event) => {\n handleExpansion(event);\n };\n\n const handleSelectionClick = (event) => {\n handleSelection(event);\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n \n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n
\n {icon}\n
\n \n {label}\n \n \n );\n});\n\n\nfunction CustomTreeItem(props) {\n return ;\n}\n\nconst ReferenceFilterTree = ({ reference, source, label, limit, sort, filter }) => {\n const { data } = useGetList(reference, { page: 1, perPage: limit }, sort, filter);\n const { filterValues, setFilters } = useListFilterContext();\n let routeTree = [], listTheme = [], isThemeSelected = false;\n\n for (const theme in data) {\n if (data[theme]['pair:broader'] == undefined ) {\n routeTree.push(data[theme]);\n }\n listTheme = listTheme.concat(data[theme]);\n }\n\n function deleteFilterTheme() {\n const newFilterValues = Object.assign({}, filterValues);\n delete newFilterValues.sparqlWhere;\n setFilters(newFilterValues, null, false);\n isThemeSelected = false\n }\n\n const handleSelect = (event, nodes) => {\n const sparqlWhere = {\n \"type\": \"bgp\",\n \"triples\": nodes.map((node) => {\n return {\n subject: {\n termType: 'Variable',\n value: 's1',\n },\n predicate: {\n termType: 'NamedNode',\n value: \"http://virtual-assembly.org/ontologies/pair#hasTopic\",\n },\n object: {\n termType: 'NamedNode',\n value: node,\n },\n };\n }),\n }\n\n const query = JSON.stringify(sparqlWhere);\n const encodedQuery = encodeURIComponent(query);\n setFilters({...filterValues, \"sparqlWhere\": encodedQuery })\n\n }\n console.log(filterValues)\n if (filterValues.sparqlWhere != undefined)\n isThemeSelected = true\n\n return (\n
\n \n \n \n Thèmes\n {isThemeSelected ? \n \n : null}\n }\n defaultExpandIcon={}\n >\n {routeTree.map((route) =>\n \n {GenerateTreeItemFromNarrower(source, label, listTheme, route)}\n \n )}\n \n
\n )\n};\n\nReferenceFilterTree.defaultProps = {\n limit: 25,\n showCounters: true\n};\n\nexport default ReferenceFilterTree;\n\n","import React from 'react';\n\nconst ListViewContext = React.createContext({ views: null, currentView: null, setView: () => null });\n\nexport default ListViewContext;\n","import React from 'react';\nimport { Button, Link } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListViewContext from './ListViewContext';\n\nconst ViewsButtons = () => {\n const query = new URLSearchParams(useLocation().search);\n const { views, currentView, setView } = React.useContext(ListViewContext);\n return views\n ? Object.entries(views)\n .filter(([key]) => key !== currentView)\n .map(([key, view]) => {\n query.set('view', key);\n query.set('page', 1);\n query.set('perPage', view.perPage);\n if (view.sort) {\n query.set('sort', view.sort.field);\n query.set('order', view.sort.order);\n }\n return (\n \n \n \n );\n })\n : null;\n};\n\nexport default ViewsButtons;\n","import React from 'react';\nimport { CreateButton, ExportButton, useResourceDefinition, TopToolbar } from 'react-admin';\nimport { useMediaQuery } from '@material-ui/core';\nimport ViewsButtons from './ViewsButtons';\n\nconst ListActionsWithViews = ({\n bulkActions,\n basePath,\n currentSort,\n displayedFilters,\n exporter,\n filters,\n filterValues,\n onUnselectItems,\n resource,\n selectedIds,\n showFilter,\n total,\n ...rest\n}) => {\n const xs = useMediaQuery(theme => theme.breakpoints.down('xs'));\n const resourceDefinition = useResourceDefinition(rest);\n return (\n \n \n {filters &&\n React.cloneElement(filters, {\n resource,\n showFilter,\n displayedFilters,\n filterValues,\n context: 'button'\n })}\n {resourceDefinition.hasCreate && }\n {!xs && exporter !== false && (\n \n )}\n {bulkActions &&\n React.cloneElement(bulkActions, {\n basePath,\n filterValues,\n resource,\n selectedIds,\n onUnselectItems\n })}\n \n );\n};\n\nexport default ListActionsWithViews;\n","import React, { useState } from 'react';\nimport { List } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListActionsWithViews from './ListActionsWithViews';\nimport ListViewContext from './ListViewContext';\n\nconst MultiViewsList = ({ children, actions, views, ListComponent, ...otherProps }) => {\n const query = new URLSearchParams(useLocation().search);\n const initialView = query.has('view') ? query.get('view') : Object.keys(views)[0];\n const [currentView, setView] = useState(initialView);\n return (\n \n \n {views[currentView].list}\n \n \n );\n};\n\nMultiViewsList.defaultProps = {\n actions: ,\n ListComponent: List\n};\n\nexport default MultiViewsList;\n"],"names":["useStyles","makeStyles","theme","root","display","flexWrap","link","textDecoration","maxWidth","chipField","addIcon","cursor","fontSize","position","top","left","launchIcon","width","paddingRight","marginLeft","stopPropagation","e","handleClick","GridList","_ref","children","linkType","externalLinks","spacing","xs","sm","md","lg","xl","_useListContext","useListContext","ids","data","basePath","getExternalLink","useGetExternalLink","React","Grid","container","map","id","child","externalLink","createElement","href","target","rel","onClick","cloneElement","Children","only","record","props","Link","to","linkToRecord","item","key","RecordContextProvider","value","defaultProps","grid","marginBottom","column","paddingLeft","backgroundClip","card","media","height","paddingTop","MasonryList","image","content","actions","breakpointCols","classes","Masonry","className","columnClassName","imageUrl","Card","CardActionArea","CardMedia","CardContent","CardActions","action","default","1050","700","ReferenceFilterCounter","source","resourceContext","useResourceContext","useGetList","Fragment","Object","values","filter","d","concat","includes","length","ReferenceFilter","_ref2","reference","inverseSource","limit","sort","label","icon","showCounters","page","perPage","currentResource","useSelector","getResources","shallowEqual","r","name","useDataModel","resourceContextContainers","useContainers","displayedFilters","filterValues","setFilters","hideFilter","useEffect","urlSearchParams","URLSearchParams","window","location","search","fromEntries","entries","FilterList","options","itemIsUsed","forEach","containerUrl","inverseSourceData","startsWith","FilterListItem","_defineProperty","t","f","n","Array","isArray","clsx","arguments","CustomContent","forwardRef","ref","_clsx","nodeId","iconProp","expansionIcon","displayIcon","useTreeItem","disabled","expanded","selected","focused","handleExpansion","handleSelection","preventSelection","onMouseDown","event","iconContainer","Typography","component","CustomTreeItem","TreeItem","_extends","ContentComponent","ReferenceFilterTree","_useListFilterContext","useListFilterContext","routeTree","listTheme","isThemeSelected","undefined","push","console","log","sparqlWhere","IconButton","size","edge","LabelIcon","style","color","newFilterValues","assign","CancelIcon","TreeView","multiSelect","onNodeSelect","nodes","type","triples","node","subject","termType","predicate","object","query","JSON","stringify","encodedQuery","encodeURIComponent","aria-label","defaultCollapseIcon","ExpandMoreIcon","defaultExpandIcon","ChevronRightIcon","route","GenerateTreeItemFromNarrower","themeList","narrower","isLastNarrower","ListViewContext","createContext","views","currentView","setView","ViewsButtons","useLocation","_React$useContext","useContext","_slicedToArray","_ref3","_ref4","view","set","field","order","toString","Button","ListActionsWithViews","bulkActions","currentSort","exporter","filters","onUnselectItems","resource","selectedIds","showFilter","total","rest","_objectWithoutProperties","_excluded","useMediaQuery","breakpoints","down","resourceDefinition","useResourceDefinition","TopToolbar","context","hasCreate","CreateButton","ExportButton","MultiViewsList","ListComponent","otherProps","initialView","has","get","keys","_useState2","useState","Provider","pagination","list","List","_props$linkType","_props$component","primaryText","appendLink","_props$externalLinks","loaded","Component","LinearProgress","sanitizeListRestProps","ChipField","deleteIcon","LaunchIcon","onDelete","AddCircleIcon"],"mappings":"k3GAeMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,KAAM,CACJC,QAAS,OACTC,SAAU,QAEZC,KAAM,CACJC,eAAgB,OAChBC,SAAU,QAEZC,UAAW,CACTD,SAAU,QAEZE,QAAS,CACPC,OAAQ,UACRC,SAAU,GACVC,SAAU,WACVC,KAAM,EACNC,MAAO,GAETC,WAAY,CACVC,MAAO,GACPC,aAAc,EACdC,YAAa,QAIXC,EAAkB,SAAAC,GAAC,OAAIA,EAAED,mBAKzBE,EAAc,aCxCdF,EAAkB,SAAAC,GAAC,OAAIA,EAAED,mBAKzBE,EAAc,aAEdC,EAAW,SAAwEC,GAAA,IAArEC,IAAAA,SAAUC,IAAAA,SAAUC,IAAAA,cAAeC,IAAAA,QAASC,IAAAA,GAAIC,IAAAA,GAAIC,IAAAA,GAAIC,IAAAA,GAAIC,IA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KAAMF,EACNG,OAAO,SACPC,IAAI,sBACJ+B,UAAWF,EAAQ1E,KACnB8C,QAAShC,GAETqB,wBAACwP,YAAD,CACEzO,OAAQnB,EAAKQ,GACb6M,SAAUA,EACVpN,SAAUA,EACVyD,OAAQ2L,EACRxM,UAAWF,EAAQvE,UACnB2L,MAAM,YACN8F,WAAYzP,EAAAA,sBAAC0P,UAAD,CAAYjN,UAAWF,EAAQhE,aAE3CoC,QAAS9B,EAET8Q,SAAU9Q,MAKTI,EAEPe,wBAACsB,wBAAD,CAAuBC,MAAO3B,EAAKQ,GAAKiB,IAAKjB,GAC3CJ,wBAACiB,OAAD,CAAMwB,UAAWF,EAAQ1E,KAAMqD,GAAIC,EAAYA,aAACtB,EAAUO,EAAInB,GAAW0B,QAAShC,GAChFqB,wBAACwP,YAAD,CACEzO,OAAQnB,EAAKQ,GACb6M,SAAUA,EACVpN,SAAUA,EACVyD,OAAQ2L,EACRxM,UAAWF,EAAQvE,UACnB2L,MAAM,YAENhJ,QAAS9B,MAOfmB,wBAACsB,wBAAD,CAAuBC,MAAO3B,EAAKQ,GAAKiB,IAAKjB,GAC3CJ,wBAACwP,YAAD,CACEzO,OAAQnB,EAAKQ,GACb6M,SAAUA,EACVpN,SAAUA,EACVyD,OAAQ2L,EACRxM,UAAWF,EAAQvE,UACnB2L,MAAM,YAENhJ,QAAS9B,QAMlBqQ,GAAclP,wBAAC4P,EAAAA,QAAD,CAAejG,MAAM,UAAUlH,UAAWF,EAAQtE,QAAS0C,QAASuO"} \ No newline at end of file diff --git a/src/frontend/packages/list-components/dist/index.es.js b/src/frontend/packages/list-components/dist/index.es.js index 6aa10e396..8675ac47b 100644 --- a/src/frontend/packages/list-components/dist/index.es.js +++ b/src/frontend/packages/list-components/dist/index.es.js @@ -1,2 +1,2 @@ -import*as e from"react";import r,{useEffect as t,useState as n}from"react";import{useListContext as a,useResourceContext as l,sanitizeListRestProps as o,RecordContextProvider as i,ChipField as c,Link as s,linkToRecord as u,useGetList as m,getResources as f,FilterList as d,FilterListItem as p,Button as h,useResourceDefinition as b,TopToolbar as v,CreateButton as y,ExportButton as E,List as g}from"react-admin";import{makeStyles as k,LinearProgress as w,Grid as P,Card as x,CardActionArea as C,CardMedia as O,CardContent as L,CardActions as j,useMediaQuery as N}from"@material-ui/core";import I from"@material-ui/icons/AddCircle";import S from"@material-ui/icons/Launch";import{useGetExternalLink as F,useDataModel as V,useContainers as T}from"@semapps/semantic-data-provider";import A from"react-masonry-css";import{useSelector as U,shallowEqual as _}from"react-redux";import{useLocation as R}from"react-router";function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function D(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,l=[],o=!0,i=!1;try{for(t=t.call(e);!(o=(n=t.next()).done)&&(l.push(n.value),!r||l.length!==r);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(i)throw a}}return l}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return z(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return z(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r ({\n root: {\n display: 'flex',\n flexWrap: 'wrap'\n },\n link: {\n textDecoration: 'none',\n maxWidth: '100%'\n },\n chipField: {\n maxWidth: '100%'\n },\n addIcon: {\n cursor: 'pointer',\n fontSize: 35,\n position: 'relative',\n top: -2,\n left: -2\n },\n launchIcon: {\n width: 16,\n paddingRight: 6,\n marginLeft: -10\n }\n}));\n\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst ChipList = props => {\n const {\n classes: classesOverride,\n className,\n children,\n linkType = 'edit',\n component = 'div',\n primaryText,\n appendLink,\n externalLinks = false,\n ...rest\n } = props;\n const { ids, data, loaded, basePath } = useListContext(props);\n const resource = useResourceContext(props);\n const getExternalLink = useGetExternalLink(externalLinks);\n\n const classes = useStyles(props);\n const Component = component;\n\n if (loaded === false) {\n return ;\n }\n\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n if (externalLink) {\n return (\n \n \n }\n // Workaround to force ChipField to be clickable\n onClick={handleClick}\n // Required to display the delete icon\n onDelete={handleClick}\n />\n \n \n );\n } else if (linkType) {\n return (\n \n \n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n })}\n {appendLink && }\n \n );\n};\n\nexport default ChipList;\n","import * as React from 'react';\nimport { useListContext, linkToRecord, Link, RecordContextProvider } from 'react-admin';\nimport { Grid } from '@material-ui/core';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\n// useful to prevent click bubbling in a datagrid with rowClick\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst GridList = ({ children, linkType, externalLinks, spacing, xs, sm, md, lg, xl }) => {\n const { ids, data, basePath } = useListContext();\n const getExternalLink = useGetExternalLink(externalLinks);\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n let child;\n\n if (externalLink) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n externalLink: true,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else if (linkType) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else {\n child = React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath\n });\n }\n\n return (\n \n \n {child}\n \n \n );\n })}\n \n );\n};\n\nGridList.defaultProps = {\n xs: 6,\n spacing: 3,\n linkType: 'edit',\n externalLinks: false\n};\n\nexport default GridList;\n","import React from 'react';\nimport { useListContext, Link, linkToRecord } from 'react-admin';\nimport { makeStyles, Card, CardActionArea, CardMedia, CardContent, CardActions } from '@material-ui/core';\nimport Masonry from 'react-masonry-css';\n\nconst useStyles = makeStyles(() => ({\n grid: {\n display: 'flex',\n marginLeft: -20,\n marginBottom: -20,\n width: 'auto'\n },\n column: {\n paddingLeft: 20,\n backgroundClip: 'padding-box'\n },\n card: {\n marginBottom: 20\n },\n media: {\n height: 0,\n paddingTop: '56.25%' // 16:9\n }\n}));\n\n/**\n * @example\n * \n * record.image}\n * content={record => (\n * <>\n * {record.title}\n * {record.description}\n * \n * )}\n * linkType=\"show\"\n * />\n * \n */\nconst MasonryList = ({ image, content, actions, breakpointCols, linkType }) => {\n const classes = useStyles();\n const { ids, data, basePath } = useListContext();\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const imageUrl = typeof image === 'function' ? image(data[id]) : image;\n return (\n \n \n \n {imageUrl && }\n {content && {content(data[id])}}\n \n \n {actions && (\n \n {actions.map(action => React.createElement(action, { record: data[id], basePath }))}\n \n )}\n \n );\n })}\n \n );\n};\n\nMasonryList.defaultProps = {\n breakpointCols: { default: 3, 1050: 2, 700: 1 },\n linkType: 'edit'\n};\n\nexport default MasonryList;\n","import React, { useEffect } from 'react';\nimport { FilterList, FilterListItem, useGetList, getResources, useResourceContext, useListContext } from 'react-admin';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { useContainers, useDataModel } from '@semapps/semantic-data-provider';\n\n/**\n * @example\n * const FilterAside = () => (\n * \n * \n * \n * \n * \n * \n * \n * );\n */\n\nconst ReferenceFilterCounter = ({ source, id }) => {\n const resourceContext = useResourceContext();\n const { data } = useGetList(resourceContext);\n return (\n <>\n  \n {'(' + Object.values(data).filter(d => ([].concat(d[source])).includes(id)).length + ')'}\n \n );\n};\n\nconst ReferenceFilter = ({ reference, source, inverseSource, limit, sort, filter, label, icon, showCounters }) => {\n const { data, ids } = useGetList(reference, { page: 1, perPage: limit }, sort, filter);\n const resources = useSelector(getResources, shallowEqual);\n const currentResource = resources.filter(r => r?.name === reference)[0];\n const resourceContext = useResourceContext();\n const resourceContextDataModel = useDataModel(resourceContext);\n const resourceContextContainers = useContainers(resourceContext);\n \n const {\n displayedFilters,\n filterValues,\n setFilters,\n hideFilter\n } = useListContext();\n useEffect(() => {\n // Needed when filter item is active and its last relation is removed\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n if (! params.filter) {\n setFilters({});\n }\n }, []);\n \n const itemIsUsed = (id) => {\n if (!inverseSource) {\n return true;\n }\n if (!resourceContextContainers || !data || !data[id][inverseSource]) {\n return false;\n }\n let itemIsUsed = false; \n Object.values(resourceContextContainers).forEach(value => {\n value.forEach(containerUrl => {\n [].concat(data[id][inverseSource]).forEach(inverseSourceData => {\n if (inverseSourceData.startsWith(containerUrl)) {\n itemIsUsed = true;\n }\n })\n })\n });\n return itemIsUsed;\n }\n \n return (\n \n {ids\n .filter(id => itemIsUsed(id))\n .map(id => (\n \n {data[id]['pair:label']}\n {showCounters && }\n \n }\n value={{ [source]: id }}\n />\n ))}\n \n );\n};\n\nReferenceFilter.defaultProps = {\n limit: 25,\n showCounters: true\n};\n\nexport default ReferenceFilter;\n","import React from 'react';\n\nconst ListViewContext = React.createContext({ views: null, currentView: null, setView: () => null });\n\nexport default ListViewContext;\n","import React from 'react';\nimport { Button, Link } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListViewContext from './ListViewContext';\n\nconst ViewsButtons = () => {\n const query = new URLSearchParams(useLocation().search);\n const { views, currentView, setView } = React.useContext(ListViewContext);\n return views\n ? Object.entries(views)\n .filter(([key]) => key !== currentView)\n .map(([key, view]) => {\n query.set('view', key);\n query.set('page', 1);\n query.set('perPage', view.perPage);\n if (view.sort) {\n query.set('sort', view.sort.field);\n query.set('order', view.sort.order);\n }\n return (\n \n \n \n );\n })\n : null;\n};\n\nexport default ViewsButtons;\n","import React from 'react';\nimport { CreateButton, ExportButton, useResourceDefinition, TopToolbar } from 'react-admin';\nimport { useMediaQuery } from '@material-ui/core';\nimport ViewsButtons from './ViewsButtons';\n\nconst ListActionsWithViews = ({\n bulkActions,\n basePath,\n currentSort,\n displayedFilters,\n exporter,\n filters,\n filterValues,\n onUnselectItems,\n resource,\n selectedIds,\n showFilter,\n total,\n ...rest\n}) => {\n const xs = useMediaQuery(theme => theme.breakpoints.down('xs'));\n const resourceDefinition = useResourceDefinition(rest);\n return (\n \n \n {filters &&\n React.cloneElement(filters, {\n resource,\n showFilter,\n displayedFilters,\n filterValues,\n context: 'button'\n })}\n {resourceDefinition.hasCreate && }\n {!xs && exporter !== false && (\n \n )}\n {bulkActions &&\n React.cloneElement(bulkActions, {\n basePath,\n filterValues,\n resource,\n selectedIds,\n onUnselectItems\n })}\n \n );\n};\n\nexport default ListActionsWithViews;\n","import React, { useState } from 'react';\nimport { List } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListActionsWithViews from './ListActionsWithViews';\nimport ListViewContext from './ListViewContext';\n\nconst MultiViewsList = ({ children, actions, views, ListComponent, ...otherProps }) => {\n const query = new URLSearchParams(useLocation().search);\n const initialView = query.has('view') ? query.get('view') : Object.keys(views)[0];\n const [currentView, setView] = useState(initialView);\n return (\n \n \n {views[currentView].list}\n \n \n );\n};\n\nMultiViewsList.defaultProps = {\n actions: ,\n ListComponent: List\n};\n\nexport default MultiViewsList;\n"],"names":["useStyles","makeStyles","theme","root","display","flexWrap","link","textDecoration","maxWidth","chipField","addIcon","cursor","fontSize","position","top","left","launchIcon","width","paddingRight","marginLeft","stopPropagation","e","handleClick","ChipList","props","classes","className","children","linkType","_props$linkType","component","_props$component","primaryText","appendLink","externalLinks","_props$externalLinks","rest","_excluded","useListContext","ids","data","loaded","basePath","resource","useResourceContext","getExternalLink","useGetExternalLink","Component","React","createElement","LinearProgress","_extends","sanitizeListRestProps","map","id","externalLink","RecordContextProvider","value","key","href","target","rel","onClick","ChipField","record","source","color","deleteIcon","LaunchIcon","onDelete","Link","to","linkToRecord","AddCircleIcon","GridList","_ref","spacing","xs","sm","md","lg","xl","_useListContext","Grid","container","child","cloneElement","Children","only","item","defaultProps","grid","marginBottom","column","paddingLeft","backgroundClip","card","media","height","paddingTop","MasonryList","image","content","actions","breakpointCols","Masonry","columnClassName","imageUrl","Card","CardActionArea","CardMedia","CardContent","CardActions","action","default","1050","700","ReferenceFilterCounter","resourceContext","useGetList","Fragment","Object","values","filter","d","concat","includes","length","ReferenceFilter","_ref2","reference","inverseSource","limit","sort","label","icon","showCounters","page","perPage","currentResource","useSelector","getResources","shallowEqual","r","name","useDataModel","resourceContextContainers","useContainers","displayedFilters","filterValues","setFilters","hideFilter","useEffect","urlSearchParams","URLSearchParams","window","location","search","fromEntries","entries","FilterList","options","itemIsUsed","forEach","containerUrl","inverseSourceData","startsWith","FilterListItem","ListViewContext","createContext","views","currentView","setView","ViewsButtons","query","useLocation","_React$useContext","useContext","_slicedToArray","_ref3","_ref4","view","set","field","order","toString","Button","ListActionsWithViews","bulkActions","currentSort","exporter","filters","onUnselectItems","selectedIds","showFilter","total","_objectWithoutProperties","useMediaQuery","breakpoints","down","resourceDefinition","useResourceDefinition","TopToolbar","context","hasCreate","CreateButton","ExportButton","disabled","MultiViewsList","ListComponent","otherProps","initialView","has","get","keys","_useState2","useState","Provider","pagination","list","List"],"mappings":"oiFAeMA,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,KAAM,CACJC,QAAS,OACTC,SAAU,QAEZC,KAAM,CACJC,eAAgB,OAChBC,SAAU,QAEZC,UAAW,CACTD,SAAU,QAEZE,QAAS,CACPC,OAAQ,UACRC,SAAU,GACVC,SAAU,WACVC,KAAM,EACNC,MAAO,GAETC,WAAY,CACVC,MAAO,GACPC,aAAc,EACdC,YAAa,QAIXC,EAAkB,SAAAC,GAAC,OAAIA,EAAED,mBAKzBE,EAAc,aAEdC,EAAW,SAAAC,GAWXA,EATFC,QASED,EARFE,UAQEF,EAPFG,aAOEH,EAAAA,EANFI,SAAAA,aAAW,OAJbC,EAUIL,EAAAA,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,IAAAA,QAASmE,IAAAA,MAAOuC,IAAAA,cAAkBC,EAAiBd,EAAAzH,EAAAtC,IAC/EyI,EAAQ,IAAIpB,gBAAgBqB,IAAclB,QAC1CsD,EAAcrC,EAAMsC,IAAI,QAAUtC,EAAMuC,IAAI,QAAU5F,OAAO6F,KAAK5C,GAAO,GAC/E6C,EAAArC,EAA+BsC,EAASL,GAAxC,GAAOxC,EAAP4C,EAAA,GAAoB3C,EAApB2C,EAAA,GACA,OACEvK,EAAAC,cAACuH,GAAgBiD,SAAjB,CAA0BhK,MAAO,CAAEiH,MAAAA,EAAOC,YAAAA,EAAaC,QAAAA,IACrD5H,gBAACiK,EAAD9J,EAAA,CACEoD,QAASA,EACTmH,WAAYhD,EAAMC,GAAa+C,WAE/BhF,QAASgC,EAAMyC,GAAazE,QAC5BL,KAAMqC,EAAMyC,GAAa9E,MACrB6E,GAEHxC,EAAMC,GAAagD,QAM5BX,GAAetH,aAAe,CAC5Ba,QAASvD,EAACC,cAAA0I,GADkB,MAE5BsB,cAAeW"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":["../src/ChipList.js","../src/GridList.js","../src/MasonryList.js","../src/ReferenceFilter.js","../../../node_modules/clsx/dist/clsx.m.js","../src/ReferenceFilterTree.js","../src/MultiViewsList/ListViewContext.js","../src/MultiViewsList/ViewsButtons.js","../src/MultiViewsList/ListActionsWithViews.js","../src/MultiViewsList/MultiViewsList.js"],"sourcesContent":["import React from 'react';\nimport {\n ChipField,\n useResourceContext,\n useListContext,\n sanitizeListRestProps,\n linkToRecord,\n RecordContextProvider,\n Link\n} from 'react-admin';\nimport { makeStyles, LinearProgress } from '@material-ui/core';\nimport AddCircleIcon from '@material-ui/icons/AddCircle';\nimport LaunchIcon from '@material-ui/icons/Launch';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex',\n flexWrap: 'wrap'\n },\n link: {\n textDecoration: 'none',\n maxWidth: '100%'\n },\n chipField: {\n maxWidth: '100%'\n },\n addIcon: {\n cursor: 'pointer',\n fontSize: 35,\n position: 'relative',\n top: -2,\n left: -2\n },\n launchIcon: {\n width: 16,\n paddingRight: 6,\n marginLeft: -10\n }\n}));\n\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst ChipList = props => {\n const {\n classes: classesOverride,\n className,\n children,\n linkType = 'edit',\n component = 'div',\n primaryText,\n appendLink,\n externalLinks = false,\n ...rest\n } = props;\n const { ids, data, loaded, basePath } = useListContext(props);\n const resource = useResourceContext(props);\n const getExternalLink = useGetExternalLink(externalLinks);\n\n const classes = useStyles(props);\n const Component = component;\n\n if (loaded === false) {\n return ;\n }\n\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n if (externalLink) {\n return (\n \n \n }\n // Workaround to force ChipField to be clickable\n onClick={handleClick}\n // Required to display the delete icon\n onDelete={handleClick}\n />\n \n \n );\n } else if (linkType) {\n return (\n \n \n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n })}\n {appendLink && }\n \n );\n};\n\nexport default ChipList;\n","import * as React from 'react';\nimport { useListContext, linkToRecord, Link, RecordContextProvider } from 'react-admin';\nimport { Grid } from '@material-ui/core';\nimport { useGetExternalLink } from '@semapps/semantic-data-provider';\n\n// useful to prevent click bubbling in a datagrid with rowClick\nconst stopPropagation = e => e.stopPropagation();\n\n// Our handleClick does nothing as we wrap the children inside a Link but it is\n// required by ChipField, which uses a Chip from material-ui.\n// The material-ui Chip requires an onClick handler to behave like a clickable element.\nconst handleClick = () => {};\n\nconst GridList = ({ children, linkType, externalLinks, spacing, xs, sm, md, lg, xl }) => {\n const { ids, data, basePath } = useListContext();\n const getExternalLink = useGetExternalLink(externalLinks);\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const externalLink = getExternalLink(data[id]);\n let child;\n\n if (externalLink) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n externalLink: true,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else if (linkType) {\n child = (\n \n {React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath,\n // Workaround to force ChipField to be clickable\n onClick: handleClick\n })}\n \n );\n } else {\n child = React.cloneElement(React.Children.only(children), {\n record: data[id],\n basePath: children.props.basePath || basePath\n });\n }\n\n return (\n \n \n {child}\n \n \n );\n })}\n \n );\n};\n\nGridList.defaultProps = {\n xs: 6,\n spacing: 3,\n linkType: 'edit',\n externalLinks: false\n};\n\nexport default GridList;\n","import React from 'react';\nimport { useListContext, Link, linkToRecord } from 'react-admin';\nimport { makeStyles, Card, CardActionArea, CardMedia, CardContent, CardActions } from '@material-ui/core';\nimport Masonry from 'react-masonry-css';\n\nconst useStyles = makeStyles(() => ({\n grid: {\n display: 'flex',\n marginLeft: -20,\n marginBottom: -20,\n width: 'auto'\n },\n column: {\n paddingLeft: 20,\n backgroundClip: 'padding-box'\n },\n card: {\n marginBottom: 20\n },\n media: {\n height: 0,\n paddingTop: '56.25%' // 16:9\n }\n}));\n\n/**\n * @example\n * \n * record.image}\n * content={record => (\n * <>\n * {record.title}\n * {record.description}\n * \n * )}\n * linkType=\"show\"\n * />\n * \n */\nconst MasonryList = ({ image, content, actions, breakpointCols, linkType }) => {\n const classes = useStyles();\n const { ids, data, basePath } = useListContext();\n return (\n \n {ids.map(id => {\n if (!data[id] || data[id]['_error']) return null;\n const imageUrl = typeof image === 'function' ? image(data[id]) : image;\n return (\n \n \n \n {imageUrl && }\n {content && {content(data[id])}}\n \n \n {actions && (\n \n {actions.map(action => React.createElement(action, { record: data[id], basePath }))}\n \n )}\n \n );\n })}\n \n );\n};\n\nMasonryList.defaultProps = {\n breakpointCols: { default: 3, 1050: 2, 700: 1 },\n linkType: 'edit'\n};\n\nexport default MasonryList;\n","import React, { useEffect } from 'react';\nimport { FilterList, FilterListItem, useGetList, getResources, useResourceContext, useListContext } from 'react-admin';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { useContainers, useDataModel } from '@semapps/semantic-data-provider';\n\n/**\n * @example\n * const FilterAside = () => (\n * \n * \n * \n * \n * \n * \n * \n * );\n */\n\nconst ReferenceFilterCounter = ({ source, id }) => {\n const resourceContext = useResourceContext();\n const { data } = useGetList(resourceContext);\n return (\n <>\n  \n {'(' + Object.values(data).filter(d => ([].concat(d[source])).includes(id)).length + ')'}\n \n );\n};\n\nconst ReferenceFilter = ({ reference, source, inverseSource, limit, sort, filter, label, icon, showCounters }) => {\n const { data, ids } = useGetList(reference, { page: 1, perPage: limit }, sort, filter);\n const resources = useSelector(getResources, shallowEqual);\n const currentResource = resources.filter(r => r?.name === reference)[0];\n const resourceContext = useResourceContext();\n const resourceContextDataModel = useDataModel(resourceContext);\n const resourceContextContainers = useContainers(resourceContext);\n \n const {\n displayedFilters,\n filterValues,\n setFilters,\n hideFilter\n } = useListContext();\n useEffect(() => {\n // Needed when filter item is active and its last relation is removed\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n if (! params.filter) {\n setFilters({});\n }\n }, []);\n \n const itemIsUsed = (id) => {\n if (!inverseSource) {\n return true;\n }\n if (!resourceContextContainers || !data || !data[id][inverseSource]) {\n return false;\n }\n let itemIsUsed = false; \n Object.values(resourceContextContainers).forEach(value => {\n value.forEach(containerUrl => {\n [].concat(data[id][inverseSource]).forEach(inverseSourceData => {\n if (inverseSourceData.startsWith(containerUrl)) {\n itemIsUsed = true;\n }\n })\n })\n });\n return itemIsUsed;\n }\n \n return (\n \n {ids\n .filter(id => itemIsUsed(id))\n .map(id => (\n \n {data[id]['pair:label']}\n {showCounters && }\n \n }\n value={{ [source]: id }}\n />\n ))}\n \n );\n};\n\nReferenceFilter.defaultProps = {\n limit: 25,\n showCounters: true\n};\n\nexport default ReferenceFilter;\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t (\n * \n * \n * \n * \n * \n * \n * );\n */\n\n\nfunction GenerateTreeItemFromNarrower(source, label, themeList, narrower) {\n const themes = themeList.filter(({ [source]: themeSource }) => themeSource === narrower.id );\n return themes.map(({ id, [label]: themeLabel }) => (\n \n {GenerateTreeItemFromNarrower(source, label, themeList, { id })}\n \n ));\n}\n\nconst CustomContent = React.forwardRef(function CustomContent(props, ref) {\n const {\n classes,\n className,\n label,\n nodeId,\n icon: iconProp,\n expansionIcon,\n displayIcon,\n } = props;\n\n const {\n disabled,\n expanded,\n selected,\n focused,\n handleExpansion,\n handleSelection,\n preventSelection,\n } = useTreeItem(nodeId);\n\n const icon = iconProp || expansionIcon || displayIcon;\n\n const handleMouseDown = (event) => {\n preventSelection(event);\n };\n\n const handleExpansionClick = (event) => {\n handleExpansion(event);\n };\n\n const handleSelectionClick = (event) => {\n handleSelection(event);\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n \n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n
\n {icon}\n
\n \n {label}\n \n \n );\n});\n\n\nfunction CustomTreeItem(props) {\n return ;\n}\n\nconst ReferenceFilterTree = ({ reference, source, label, limit, sort, filter }) => {\n const { data } = useGetList(reference, { page: 1, perPage: Infinity }, sort, filter);\n const { filterValues, setFilters } = useListFilterContext();\n let routeTree = [], listTheme = [];\n console.log();\n for (const theme in data) {\n if (data[theme]['pair:broader'] == undefined ) {\n routeTree.push(data[theme]);\n }\n listTheme = listTheme.concat(data[theme]);\n }\n\n const handleSelect = (event, nodes) => {\n const sparqlWhere = {\n \"type\": \"bgp\",\n \"triples\": nodes.map((node) => {\n return {\n subject: {\n termType: 'Variable',\n value: 's1',\n },\n predicate: {\n termType: 'NamedNode',\n value: \"http://virtual-assembly.org/ontologies/pair#hasTopic\",\n },\n object: {\n termType: 'NamedNode',\n value: node,\n },\n };\n }),\n }\n\n const query = JSON.stringify(sparqlWhere);\n const encodedQuery = encodeURIComponent(query);\n setFilters({...filterValues, \"sparqlWhere\": encodedQuery })\n\n }\n\n return (\n
\n \n \n \n {reference}\n }\n defaultExpandIcon={}\n >\n {routeTree.map((route) =>\n \n {GenerateTreeItemFromNarrower(source, label, listTheme, route)}\n \n )}\n \n
\n )\n};\n\nexport default ReferenceFilterTree;\n\n","import React from 'react';\n\nconst ListViewContext = React.createContext({ views: null, currentView: null, setView: () => null });\n\nexport default ListViewContext;\n","import React from 'react';\nimport { Button, Link } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListViewContext from './ListViewContext';\n\nconst ViewsButtons = () => {\n const query = new URLSearchParams(useLocation().search);\n const { views, currentView, setView } = React.useContext(ListViewContext);\n return views\n ? Object.entries(views)\n .filter(([key]) => key !== currentView)\n .map(([key, view]) => {\n query.set('view', key);\n query.set('page', 1);\n query.set('perPage', view.perPage);\n if (view.sort) {\n query.set('sort', view.sort.field);\n query.set('order', view.sort.order);\n }\n return (\n \n \n \n );\n })\n : null;\n};\n\nexport default ViewsButtons;\n","import React from 'react';\nimport { CreateButton, ExportButton, useResourceDefinition, TopToolbar } from 'react-admin';\nimport { useMediaQuery } from '@material-ui/core';\nimport ViewsButtons from './ViewsButtons';\n\nconst ListActionsWithViews = ({\n bulkActions,\n basePath,\n currentSort,\n displayedFilters,\n exporter,\n filters,\n filterValues,\n onUnselectItems,\n resource,\n selectedIds,\n showFilter,\n total,\n ...rest\n}) => {\n const xs = useMediaQuery(theme => theme.breakpoints.down('xs'));\n const resourceDefinition = useResourceDefinition(rest);\n return (\n \n \n {filters &&\n React.cloneElement(filters, {\n resource,\n showFilter,\n displayedFilters,\n filterValues,\n context: 'button'\n })}\n {resourceDefinition.hasCreate && }\n {!xs && exporter !== false && (\n \n )}\n {bulkActions &&\n React.cloneElement(bulkActions, {\n basePath,\n filterValues,\n resource,\n selectedIds,\n onUnselectItems\n })}\n \n );\n};\n\nexport default ListActionsWithViews;\n","import React, { useState } from 'react';\nimport { List } from 'react-admin';\nimport { useLocation } from 'react-router';\nimport ListActionsWithViews from './ListActionsWithViews';\nimport ListViewContext from './ListViewContext';\n\nconst MultiViewsList = ({ children, actions, views, ListComponent, ...otherProps }) => {\n const query = new URLSearchParams(useLocation().search);\n const initialView = query.has('view') ? query.get('view') : Object.keys(views)[0];\n const [currentView, setView] = useState(initialView);\n return (\n \n \n {views[currentView].list}\n \n \n );\n};\n\nMultiViewsList.defaultProps = {\n actions: ,\n ListComponent: List\n};\n\nexport default MultiViewsList;\n"],"names":["useStyles","makeStyles","theme","root","display","flexWrap","link","textDecoration","maxWidth","chipField","addIcon","cursor","fontSize","position","top","left","launchIcon","width","paddingRight","marginLeft","stopPropagation","e","handleClick","ChipList","props","classes","className","children","linkType","_props$linkType","component","_props$component","primaryText","appendLink","externalLinks","_props$externalLinks","rest","_excluded","useListContext","ids","data","loaded","basePath","resource","useResourceContext","getExternalLink","useGetExternalLink","Component","React","createElement","LinearProgress","_extends","sanitizeListRestProps","map","id","externalLink","RecordContextProvider","value","key","href","target","rel","onClick","ChipField","record","source","color","deleteIcon","LaunchIcon","onDelete","Link","to","linkToRecord","AddCircleIcon","GridList","_ref","spacing","xs","sm","md","lg","xl","_useListContext","Grid","container","child","cloneElement","Children","only","item","defaultProps","grid","marginBottom","column","paddingLeft","backgroundClip","card","media","height","paddingTop","MasonryList","image","content","actions","breakpointCols","Masonry","columnClassName","imageUrl","Card","CardActionArea","CardMedia","CardContent","CardActions","action","default","1050","700","ReferenceFilterCounter","resourceContext","useGetList","Fragment","Object","values","filter","d","concat","includes","length","ReferenceFilter","_ref2","reference","inverseSource","limit","sort","label","icon","showCounters","page","perPage","currentResource","useSelector","getResources","shallowEqual","r","name","useDataModel","resourceContextContainers","useContainers","displayedFilters","filterValues","setFilters","hideFilter","useEffect","urlSearchParams","URLSearchParams","window","location","search","fromEntries","entries","FilterList","options","itemIsUsed","forEach","containerUrl","inverseSourceData","startsWith","FilterListItem","_defineProperty","t","f","n","Array","isArray","clsx","arguments","CustomContent","forwardRef","ref","_clsx","nodeId","iconProp","expansionIcon","displayIcon","useTreeItem","disabled","expanded","selected","focused","handleExpansion","handleSelection","preventSelection","onMouseDown","event","iconContainer","Typography","CustomTreeItem","TreeItem","ContentComponent","ReferenceFilterTree","_ref3","Infinity","_useListFilterContext","useListFilterContext","routeTree","listTheme","console","log","undefined","push","IconButton","size","edge","LabelIcon","style","TreeView","multiSelect","onNodeSelect","nodes","sparqlWhere","type","triples","node","subject","termType","predicate","object","query","JSON","stringify","encodedQuery","encodeURIComponent","aria-label","defaultCollapseIcon","ExpandMoreIcon","defaultExpandIcon","ChevronRightIcon","route","GenerateTreeItemFromNarrower","themeList","narrower","themeLabel","ListViewContext","createContext","views","currentView","setView","ViewsButtons","useLocation","_React$useContext","useContext","_slicedToArray","_ref4","view","set","field","order","toString","Button","ListActionsWithViews","bulkActions","currentSort","exporter","filters","onUnselectItems","selectedIds","showFilter","total","_objectWithoutProperties","useMediaQuery","breakpoints","down","resourceDefinition","useResourceDefinition","TopToolbar","context","hasCreate","CreateButton","ExportButton","MultiViewsList","ListComponent","otherProps","initialView","has","get","keys","_useState2","useState","Provider","pagination","list","List"],"mappings":"8kHAeMA,GAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,KAAM,CACJC,QAAS,OACTC,SAAU,QAEZC,KAAM,CACJC,eAAgB,OAChBC,SAAU,QAEZC,UAAW,CACTD,SAAU,QAEZE,QAAS,CACPC,OAAQ,UACRC,SAAU,GACVC,SAAU,WACVC,KAAM,EACNC,MAAO,GAETC,WAAY,CACVC,MAAO,GACPC,aAAc,EACdC,YAAa,QAIXC,GAAkB,SAAAC,GAAC,OAAIA,EAAED,mBAKzBE,GAAc,aAEdC,GAAW,SAAAC,GAWXA,EATFC,QASED,EARFE,UAQEF,E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KAAM+G,EAAMsC,GAAarJ,MACrBoJ,GAEHrC,EAAMC,GAAa6C,QAM5BX,GAAe7L,aAAe,CAC5Ba,QAASvD,EAACC,cAAAkN,GADkB,MAE5BqB,cAAeW"} \ No newline at end of file diff --git a/src/frontend/packages/list-components/src/ReferenceFilterTree.js b/src/frontend/packages/list-components/src/ReferenceFilterTree.js new file mode 100644 index 000000000..32ea2d40e --- /dev/null +++ b/src/frontend/packages/list-components/src/ReferenceFilterTree.js @@ -0,0 +1,164 @@ +import React from 'react'; +import { useGetList } from 'react-admin'; +import {TreeItem, TreeView, useTreeItem} from '@mui/lab'; +import { useListFilterContext } from 'ra-core'; +import LabelIcon from '@mui/icons-material/Label'; +import { IconButton } from '@mui/material'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import ChevronRightIcon from '@mui/icons-material/ChevronRight'; +import clsx from 'clsx'; +import Typography from '@mui/material/Typography'; + +/** + * @example + * const FilterAside = () => ( + * + * + * + * + * + * + * ); + */ + +function GenerateTreeItem(source, label, allItems, routeTree, parentId) { + // If !parentId it's a trunkItem + const isParentLevel = !parentId; + const listToUse = isParentLevel ? routeTree : allItems.filter(({ [source]: itemSource }) => itemSource === parentId); + return ( + listToUse.map((route) => + + {GenerateTreeItem(source, label, allItems, [], route["id"])} + + ) + ) +} + +const CustomContent = React.forwardRef(function CustomContent(props, ref) { + const { + classes, + className, + label, + nodeId, + icon: iconProp, + expansionIcon, + displayIcon, + } = props; + + const { + disabled, + expanded, + selected, + focused, + handleExpansion, + handleSelection, + preventSelection, + } = useTreeItem(nodeId); + + const icon = iconProp || expansionIcon || displayIcon; + + const handleMouseDown = (event) => { + preventSelection(event); + }; + + const handleExpansionClick = (event) => { + handleExpansion(event); + }; + + const handleSelectionClick = (event) => { + handleSelection(event); + }; + + return ( + // eslint-disable-next-line jsx-a11y/no-static-element-interactions +
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} +
+ {icon} +
+ + {label} + +
+ ); +}); + +function CustomTreeItem(props) { + return ; +} + +const ReferenceFilterTree = ({ reference, source, label, limit, sort, filter, icon, predicate }) => { + const { data } = useGetList(reference, { page: 1, perPage: Infinity }, sort, filter); + const { filterValues, setFilters } = useListFilterContext(); + + let routeTree = [], allItems = []; + for (const item in data) { + if (data[item][source] === undefined ) { + routeTree.push(data[item]); + } + allItems = allItems.concat(data[item]); + } + + const handleSelect = (event, nodes) => { + const sparqlWhere = { + "type": "bgp", + "triples": nodes.map((node) => { + return { + subject: { + termType: 'Variable', + value: 's1', + }, + predicate: { + termType: 'NamedNode', + value: predicate, + }, + object: { + termType: 'NamedNode', + value: node, + }, + }; + }), + } + + const encodedQuery = encodeURIComponent(JSON.stringify(sparqlWhere)); + setFilters({...filterValues, "sparqlWhere": encodedQuery }) + } + + return ( +
+ {!icon ? icon = : icon} + {reference} + } + defaultExpandIcon={} + > + {GenerateTreeItem(source, label, allItems, routeTree)} + +
+ ) +}; + +export default ReferenceFilterTree; + diff --git a/src/frontend/packages/list-components/src/index.js b/src/frontend/packages/list-components/src/index.js index a43ae1c70..f19397e3f 100644 --- a/src/frontend/packages/list-components/src/index.js +++ b/src/frontend/packages/list-components/src/index.js @@ -2,6 +2,7 @@ export { default as ChipList } from './ChipList'; export { default as GridList } from './GridList'; export { default as MasonryList } from './MasonryList'; export { default as ReferenceFilter } from './ReferenceFilter'; +export { default as ReferenceFilterTree } from './ReferenceFilterTree'; export { default as MultiViewsList } from './MultiViewsList/MultiViewsList'; export { default as ListActionsWithViews } from './MultiViewsList/ListActionsWithViews'; diff --git a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js index bbca7977c..75400afe7 100644 --- a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js +++ b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js @@ -1,4 +1,4 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("jsonld"),t=require("speakingurl"),r=require("@rdfjs/data-model"),n=require("crypto"),a=require("react-admin"),o=require("react"),i=require("@material-ui/core/styles");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),l=s(r),f=s(n),p=s(o);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t,r,n,a,o,i){try{var s=e[o](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){g(o,n,a,i,s,"next",e)}function s(e){g(o,n,a,i,s,"throw",e)}i(void 0)}))}}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(e,t)||j(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e,t){return e(t={exports:{}},t.exports),t.exports}var P=A((function(e){var t,r;t=C,r=function(){function e(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(a=a.replace(/^[\/]+/,"")),a=n0?"?":"")+i.join("&")}return function(){return e("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=r():t.urljoin=r()})),T=function(e,t){return Object.keys(t).find((function(r){return t[r][e]}))},_=function(e,t){return Object.keys(t).find((function(r){return e.startsWith(t[r].baseUrl)}))},L=function(){var e=b(v().mark((function e(t,r){var n,a,o,i,s,c,l,f,p;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.dataServers,i=r.httpClient,s=r.jsonContext,c=T("authServer",o),(l=_(t,o))===c||null===(n=o[c])||void 0===n||!n.proxyUrl||!0===(null===(a=o[l])||void 0===a?void 0:a.noProxy)){e.next=9;break}return e.next=6,i(o[c].proxyUrl,{method:"POST",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded"}),body:new URLSearchParams({id:t})});case 6:e.t0=e.sent,e.next=12;break;case 9:return e.next=11,i(t,{noToken:l!==c});case 11:e.t0=e.sent;case 12:if(f=e.t0,(p=f.json).id=p.id||p["@id"],p["@context"]===s){e.next=19;break}return e.next=18,u.default.compact(p,s);case 18:p=e.sent;case 19:return e.abrupt("return",p);case 20:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),N=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s,u,c,l,f;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.resources,i=o[r]){t.next=4;break}throw new Error("Resource ".concat(r," is not mapped in resources file"));case 4:return t.next=6,L(n.id,e);case 6:if(s=t.sent,null!==(a=i.list)&&void 0!==a&&a.forceArray){c=O(null===(u=i.list)||void 0===u?void 0:u.forceArray);try{for(c.s();!(l=c.n()).done;)f=l.value,s[f]&&!Array.isArray(s[f])&&(s[f]=[s[f]])}catch(e){c.e(e)}finally{c.f()}}return t.abrupt("return",{data:s});case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},q=function(e){return e&&e.rawFile&&e.rawFile instanceof File},I=function(e){var t=Object.keys(e.dataServers).find((function(t){return e.dataServers[t].uploadsContainer}));if(t)return P(e.dataServers[t].baseUrl,e.dataServers[t].uploadsContainer)},U=function(){var e=b(v().mark((function e(t,r){var n,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=I(r)){e.next=3;break}throw new Error("You must define an uploadsContainer in one of the server's configuration");case 3:return e.next=5,r.httpClient(n,{method:"POST",body:t,headers:new Headers({Slug:(o=t.name,i=void 0,s=void 0,i="",s=o.split("."),s.length>1&&(i=s.pop(),o=s.join(".")),c.default(o,{lang:"fr"})+"."+i),"Content-Type":t.type})});case 5:if(201!==(a=e.sent).status){e.next=8;break}return e.abrupt("return",a.headers.get("Location"));case 8:case"end":return e.stop()}var o,i,s}),e)})));return function(t,r){return e.apply(this,arguments)}}(),M=function(){var e=b(v().mark((function e(t,r){var n,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=v().keys(t);case 1:if((e.t1=e.t0()).done){e.next=22;break}if(n=e.t1.value,!t.hasOwnProperty(n)){e.next=20;break}if(!Array.isArray(t[n])){e.next=16;break}a=0;case 6:if(!(a1||y[g[0]].length>1)){t.next=18;break}throw new Error("More than one container detected with types ".concat(JSON.stringify(c.types)," on server ").concat(p));case 18:f=y[g[0]][0];case 19:if(!n.data){t.next=34;break}return null!==(b=c.fieldsMapping)&&void 0!==b&&b.title&&(Array.isArray(c.fieldsMapping.title)?l.set("Slug",c.fieldsMapping.title.map((function(e){return n.data[e]})).join(" ")):l.set("Slug",n.data[c.fieldsMapping.title])),t.next=23,M(n.data,e);case 23:return n.data=t.sent,t.next=26,s(f,{method:"POST",headers:l,body:JSON.stringify(h({"@context":u,"@type":c.types},n.data)),noToken:!0!==o[p].authServer});case 26:return m=t.sent,w=m.headers,x=w.get("Location"),t.next=31,N(e)(r,{id:x});case 31:return t.abrupt("return",t.sent);case 34:if(!n.id){t.next=41;break}return l.set("Content-Type","application/sparql-update"),t.next=38,s(f,{method:"PATCH",headers:l,body:"\n PREFIX ldp: \n INSERT DATA { <".concat(f,"> ldp:contains <").concat(n.id,">. };\n "),noToken:!0!==o[p].authServer});case 38:return t.next=40,N(e)(r,{id:n.id});case 40:return t.abrupt("return",t.sent);case 41:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},F=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.dataServers,o=e.httpClient,i=_(n.id,a),t.next=4,o(n.id,{method:"DELETE",noToken:!i||!0!==a[i].authServer});case 4:return t.abrupt("return",{data:{id:n.id}});case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},H=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s,u;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=e.httpClient,o=[],i=O(n.ids),t.prev=3,i.s();case 5:if((s=i.n()).done){t.next=17;break}return u=s.value,t.prev=7,t.next=10,a(u,{method:"DELETE"});case 10:o.push(u),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(7);case 15:t.next=5;break;case 17:t.next=22;break;case 19:t.prev=19,t.t1=t.catch(3),i.e(t.t1);case 22:return t.prev=22,i.f(),t.finish(22);case 25:return t.abrupt("return",{data:o});case 26:case"end":return t.stop()}}),t,null,[[3,19,22,25],[7,13]])})));return function(e,r){return t.apply(this,arguments)}}()},G=function(e){return function(){return e.dataServers}},W=function(e){return function(){return e.resources}};var z=function(){var e=b(v().mark((function e(t,r,n,a){var o,i,s,c,l,f,p,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.dataServers,i=a.httpClient,s=a.jsonContext,c=Object.keys(t).reduce((function(e,r){return h(h({},e),Object.fromEntries(t[r].map((function(e){return[e,r]}))))}),{}),l=Object.keys(c).map((function(e){return i(e,{noToken:!c[e]||!0!==o[c[e]].authServer}).then((function(e){var t=e.json;return t["@context"]!==s?u.default.compact(t,s):t})).then((function(t){if(r="ldp:Container",a=(n=t).type||n["@type"],Array.isArray(a)?a.includes(r):a===r)return t["ldp:contains"];throw new Error(e+" is not a LDP container");var r,n,a}))})),e.next=5,Promise.all(l);case 5:if(0!==(f=e.sent).length){e.next=10;break}return e.abrupt("return",{data:[],total:0});case 10:return f=(p=[].concat).apply.apply(p,S(f)),d=f.map((function(e){return e.id=e.id||e["@id"],e})),n.filter&&(n.filter.a&&(n.filter.type=n.filter.a,delete n.filter.a),Object.keys(n.filter).length>0&&(d=d.filter((function(e){return Object.entries(n.filter).some((function(t){var r=k(t,2),n=r[0],a=r[1];return"q"==n?Object.entries(e).some((function(e){var t=k(e,2);t[0];var r,n=t[1];return(null==(r=n)||"object"!=typeof r||!1!==Array.isArray(r))&&(Array.isArray(n)?n.some((function(e){return e.includes(a)})):n.includes(a))})):(Array.isArray(e[n]),e[n].includes(a))}))})))),n.sort&&(d=d.sort((function(e,t){return!e[n.sort.field]||!t[n.sort.field]||("ASC"===n.sort.order?e[n.sort.field].localeCompare(t[n.sort.field]):t[n.sort.field].localeCompare(e[n.sort.field]))}))),n.pagination&&(d=d.slice((n.pagination.page-1)*n.pagination.perPage,n.pagination.page*n.pagination.perPage)),e.abrupt("return",{data:d,total:f.length});case 16:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}(),$=function(e){var t,r={};if(e){var n,a=O(e);try{for(a.s();!(n=a.n()).done;){var o=n.value;t=o.includes("/")?o.split("/").reverse():[o],r=h(h({},r),t.reduce((function(e,t){return m({},t,h({"@embed":"@last"},e))}),{}))}}catch(e){a.e(e)}finally{a.f()}return r}},J=function(e,t){if(e.startsWith("http://")||e.startsWith("https://"))return e;if("a"===e)return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type";var r=k(e.split(":"),2),n=r[0],a=r[1];if(a){var o=t.find((function(e){return e.prefix===n}));if(o)return o.url+a;throw new Error("No ontology found with prefix "+n)}throw new Error('The value "'.concat(e,'" is not correct. It must include a prefix or be a full URI.'))},Y=r.triple(r.variable("s1"),r.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),r.variable("type")),Q=function(e,t){var n,a;return e?(n=(a=e,a?Array.isArray(a)?a:[a]:[]).map((function(e,n){return r.triple(r.variable("s1"),r.namedNode(J(e,t)),r.variable("o"+(n+1)))})),{construct:[Y].concat(S(n)),where:[Y].concat(S(n.map((function(e){return{type:"optional",patterns:[e]}}))))}):{construct:n=[r.triple(r.variable("s1"),r.variable("p1"),r.variable("o1"))],where:n}},V=A((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==C&&C.crypto&&(r=C.crypto),!r)try{r=f.default}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=i.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,a=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=i<<24-(n+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-a%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},p=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,a=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,l=e.min(4*c,o);if(c){for(var f=0;f>>24)|4278255360&(a<<24|a>>>8)}var o=this._hash.words,i=e[t+0],u=e[t+1],d=e[t+2],h=e[t+3],v=e[t+4],y=e[t+5],g=e[t+6],b=e[t+7],m=e[t+8],w=e[t+9],x=e[t+10],k=e[t+11],S=e[t+12],j=e[t+13],E=e[t+14],O=e[t+15],C=o[0],A=o[1],P=o[2],T=o[3];C=c(C,A,P,T,i,7,s[0]),T=c(T,C,A,P,u,12,s[1]),P=c(P,T,C,A,d,17,s[2]),A=c(A,P,T,C,h,22,s[3]),C=c(C,A,P,T,v,7,s[4]),T=c(T,C,A,P,y,12,s[5]),P=c(P,T,C,A,g,17,s[6]),A=c(A,P,T,C,b,22,s[7]),C=c(C,A,P,T,m,7,s[8]),T=c(T,C,A,P,w,12,s[9]),P=c(P,T,C,A,x,17,s[10]),A=c(A,P,T,C,k,22,s[11]),C=c(C,A,P,T,S,7,s[12]),T=c(T,C,A,P,j,12,s[13]),P=c(P,T,C,A,E,17,s[14]),C=l(C,A=c(A,P,T,C,O,22,s[15]),P,T,u,5,s[16]),T=l(T,C,A,P,g,9,s[17]),P=l(P,T,C,A,k,14,s[18]),A=l(A,P,T,C,i,20,s[19]),C=l(C,A,P,T,y,5,s[20]),T=l(T,C,A,P,x,9,s[21]),P=l(P,T,C,A,O,14,s[22]),A=l(A,P,T,C,v,20,s[23]),C=l(C,A,P,T,w,5,s[24]),T=l(T,C,A,P,E,9,s[25]),P=l(P,T,C,A,h,14,s[26]),A=l(A,P,T,C,m,20,s[27]),C=l(C,A,P,T,j,5,s[28]),T=l(T,C,A,P,d,9,s[29]),P=l(P,T,C,A,b,14,s[30]),C=f(C,A=l(A,P,T,C,S,20,s[31]),P,T,y,4,s[32]),T=f(T,C,A,P,m,11,s[33]),P=f(P,T,C,A,k,16,s[34]),A=f(A,P,T,C,E,23,s[35]),C=f(C,A,P,T,u,4,s[36]),T=f(T,C,A,P,v,11,s[37]),P=f(P,T,C,A,b,16,s[38]),A=f(A,P,T,C,x,23,s[39]),C=f(C,A,P,T,j,4,s[40]),T=f(T,C,A,P,i,11,s[41]),P=f(P,T,C,A,h,16,s[42]),A=f(A,P,T,C,g,23,s[43]),C=f(C,A,P,T,w,4,s[44]),T=f(T,C,A,P,S,11,s[45]),P=f(P,T,C,A,O,16,s[46]),C=p(C,A=f(A,P,T,C,d,23,s[47]),P,T,i,6,s[48]),T=p(T,C,A,P,b,10,s[49]),P=p(P,T,C,A,E,15,s[50]),A=p(A,P,T,C,y,21,s[51]),C=p(C,A,P,T,S,6,s[52]),T=p(T,C,A,P,h,10,s[53]),P=p(P,T,C,A,x,15,s[54]),A=p(A,P,T,C,u,21,s[55]),C=p(C,A,P,T,m,6,s[56]),T=p(T,C,A,P,O,10,s[57]),P=p(P,T,C,A,g,15,s[58]),A=p(A,P,T,C,j,21,s[59]),C=p(C,A,P,T,v,6,s[60]),T=p(T,C,A,P,k,10,s[61]),P=p(P,T,C,A,d,15,s[62]),A=p(A,P,T,C,w,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+A|0,o[2]=o[2]+P|0,o[3]=o[3]+T|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,a=8*t.sigBytes;r[a>>>5]|=128<<24-a%32;var o=e.floor(n/4294967296),i=n;r[15+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,a,o,i){var s=e+(t&r|~t&n)+a+i;return(s<>>32-o)+t}function l(e,t,r,n,a,o,i){var s=e+(t&n|r&~n)+a+i;return(s<>>32-o)+t}function f(e,t,r,n,a,o,i){var s=e+(t^r^n)+a+i;return(s<>>32-o)+t}function p(e,t,r,n,a,o,i){var s=e+(r^(t|~n))+a+i;return(s<>>32-o)+t}t.MD5=o._createHelper(u),t.HmacMD5=o._createHmacHelper(u)}(Math),r.MD5)})),K=function(e){return X(e)},Z=function(e){return e.includes("/")&&e.split("/")[0]},ee=function(e){return e.includes("/")?e.split("/")[1]:e},te=function(e){return e.map((function(t){var r=t.query,n=e.find((function(e){return t.parentNode===e.node}));return void 0!==n&&(r=r.concat(n.query[0])),{type:"bgp",triples:r}}))},re=function(e,t,n){var a=[],o=function(e){var t=[];if(e){var r,n=O(e);try{for(n.s();!(r=n.n()).done;){var a=r.value;if(a.includes("/"))for(var o=a.split("/"),i=1;i<=o.length;i++)t.push(o.slice(0,i).join("/"));else t.push(a)}}catch(e){n.e(e)}finally{n.f()}}return t}(e);if(o&&n&&n.length>0){var i,s=O(o);try{for(s.s();!(i=s.n()).done;){var u=i.value,c=Z(u),l=ee(u),f=K(u),p=c?K(c):"1",d=[r.triple(r.variable("s"+p),r.namedNode(J(l,n)),r.variable("s"+f)),r.triple(r.variable("s"+f),r.variable("p"+f),r.variable("o"+f))];a.push({node:u,parentNode:c,query:d,filter:""})}}catch(e){s.e(e)}finally{s.f()}return{construct:a.length>0?a.map((function(e){return e.query})).reduce((function(e,t){return e.concat(t)})):null,where:{type:"union",patterns:[t.where].concat(S(te(a)))}}}return{construct:"",where:""}},ne=l.default.literal,ae=l.default.namedNode,oe=l.default.triple,ie=l.default.variable,se=new(0,require("sparqljs").Generator)({}),ue=["q","sparqlWhere","blankNodes","_servers","_predicates"],ce=function(e){var t=e.containers,r=e.params.filter,n=e.blankNodes,a=e.predicates,o=e.ontologies,i=Q(a,o),s={queryType:"CONSTRUCT",template:i.construct,where:[],type:"query",prefixes:Object.fromEntries(o.map((function(e){return[e.prefix,e.url]})))},u=[{type:"values",values:t.map((function(e){return{"?containerUri":ae(e)}}))},oe(ie("containerUri"),ae("http://www.w3.org/ns/ldp#contains"),ie("s1")),{type:"filter",expression:{type:"operation",operator:"isiri",args:[ie("s1")]}}],c=[];if(r&&Object.keys(r).length>0){var l=r.sparqlWhere&&Object.keys(r.sparqlWhere).length>0,f=r.q&&r.q.length>0;l&&[].concat(r.sparqlWhere).forEach((function(e){c.push(e)})),f&&c.push({type:"group",patterns:[{queryType:"SELECT",variables:[ie("s1")],where:[oe(ie("s1"),ie("p1"),ie("o1")),{type:"filter",expression:{type:"operation",operator:"isliteral",args:[ie("o1")]}},{type:"filter",expression:{type:"operation",operator:"regex",args:[{type:"operation",operator:"lcase",args:[{type:"operation",operator:"str",args:[ie("o1")]}]},ne(r.q.toLowerCase(),"",ae("http://www.w3.org/2001/XMLSchema#string"))]}}],type:"query"}]}),Object.entries(r).forEach((function(e){var t=k(e,2),r=t[0],n=t[1];ue.includes(r)||c.unshift(oe(ie("s1"),ae(J(r,o)),ae(J(n,o))))}))}var p=re(n,i,o);return p&&p.construct?(c=c.concat(p.where),s.template=s.template.concat(p.construct)):c.push(i.where),s.where.push({type:"union",patterns:[u,{type:"graph",name:ae("http://semapps.org/mirror"),patterns:u}]},{type:"union",patterns:[c,{type:"graph",name:ae("http://semapps.org/mirror"),patterns:c}]}),se.stringify(s)},le=function(e,t){for(var r=[],n=0,a=Object.keys(t);n1&&void 0!==h[1]?h[1]:{},s=e.dataServers,u=e.resources,c=u[r]){t.next=5;break}throw new Error("Resource ".concat(r," is not mapped in resources file"));case 5:if(null!==(n=i.filter)&&void 0!==n&&n._servers||null===(a=c.list)||void 0===a||!a.containers){t.next=11;break}if(!Array.isArray(null===(f=c.list)||void 0===f?void 0:f.containers)){t.next=8;break}throw new Error("The list.containers property of ".concat(r," dataModel must be of type object ({ serverKey: [containerUri] })"));case 8:l=he(c.list.containers,s),t.next=12;break;case 11:l=B(c.types,(null===(p=i.filter)||void 0===p?void 0:p._servers)||(null===(d=c.list)||void 0===d?void 0:d.servers),s);case 12:if(null===(o=c.list)||void 0===o||!o.fetchContainer){t.next=16;break}return t.abrupt("return",z(l,r,i,e));case 16:return t.abrupt("return",de(l,r,i,e));case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},ye=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.returnFailedResources,t.next=3,Promise.all(n.ids.map((function(t){return N(e)(r,{id:"object"===y(t)?t["@id"]:t}).then((function(e){return e.data})).catch((function(){if(a)return{id:t,_error:!0}}))})));case 3:return o=(o=t.sent).filter((function(e){return e})),t.abrupt("return",{data:o});case 6:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},ge=function(e){return function(){var t=b(v().mark((function t(r,n){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.filter=h(h({},n.filter),{},m({},n.target,n.id)),delete n.target,t.next=4,ve(e)(r,n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},be=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.dataServers,o=e.httpClient,i=e.jsonContext,s=_(n.id,a),t.next=4,M(n.data,e);case 4:return n.data=t.sent,t.next=7,o(n.id,{method:"PUT",body:JSON.stringify(h({"@context":i},n.data)),noToken:!s||!0!==a[s].authServer});case 7:return t.abrupt("return",{data:n.data});case 8:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()};function me(e){this.message=e}me.prototype=new Error,me.prototype.name="InvalidCharacterError";var we="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new me("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,a=0,o=0,i="";n=t.charAt(o++);~n&&(r=a%4?64*r+n:n,a++%4)?i+=String.fromCharCode(255&r>>(-2*a&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i};function xe(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(we(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return we(t)}}function ke(e){this.message=e}function Se(e,t){if("string"!=typeof e)throw new ke("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(xe(e.split(".")[r]))}catch(e){throw new ke("Invalid token specified: "+e.message)}}ke.prototype=new Error,ke.prototype.name="InvalidTokenError";var je=function(){var e=b(v().mark((function e(t){var r,n,a,o,i,s,u,c,l,f,p,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataServers,n=t.httpClient,a=localStorage.getItem("token"),o=T("pod",r),i=T("authServer",r),!a){e.next=24;break}return s=Se(a),u=s.webId,e.prev=6,e.next=9,n(u);case 9:l=e.sent,f=l.json,c=f,e.next=20;break;case 14:return e.prev=14,e.t0=e.catch(6),console.error(e.t0),localStorage.removeItem("token"),window.location.reload(),e.abrupt("return");case 20:o&&(t.dataServers[o].name="My Pod",t.dataServers[o].baseUrl=P(u,"data"),t.dataServers[o].sparqlEndpoint=(null===(p=c.endpoints)||void 0===p?void 0:p["void:sparqlEndpoint"])||P(u,"sparql")),i&&(t.dataServers[i].proxyUrl=null===(d=c.endpoints)||void 0===d?void 0:d.proxyUrl),e.next=25;break;case 24:o&&delete t.dataServers[o];case 25:case"end":return e.stop()}}),e,null,[[6,14]])})));return function(t){return e.apply(this,arguments)}}(),Ee=function(e){return e?Array.isArray(e)?e:[e]:void 0},Oe=function(){var e=b(v().mark((function e(t){var r,n,a,o,i,s,u,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.entries(t.dataServers).filter((function(e){var t=k(e,2);return t[0],!0!==t[1].pod})).map((function(e){var r=k(e,2),n=r[0],a=r[1];return t.httpClient(new URL("/.well-known/void",a.baseUrl),{noToken:!a.authServer}).then((function(e){return{key:n,datasets:e.json["@graph"]}})).catch((function(e){if(404===e.status||401===e.status)return{key:n,error:e};throw e}))})),n=[],e.prev=2,e.next=5,Promise.all(r);case 5:n=e.sent,e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:a=O(n);try{for(a.s();!(o=a.n()).done;)if((i=o.value).datasets){t.dataServers[i.key].containers=t.dataServers[i.key].containers||{},t.dataServers[i.key].blankNodes=t.dataServers[i.key].blankNodes||{},s=O(i.datasets);try{for(c=function(){var e=u.value,r=Object.keys(t.dataServers).find((function(r){return e["void:uriSpace"]===t.dataServers[r].baseUrl}));if(r){r===i.key&&(t.dataServers[i.key].name=t.dataServers[i.key].name||e["dc:title"],t.dataServers[i.key].description=t.dataServers[i.key].description||e["dc:description"],t.dataServers[i.key].sparqlEndpoint=t.dataServers[i.key].sparqlEndpoint||e["void:sparqlEndpoint"]),t.dataServers[i.key].containers[r]=t.dataServers[i.key].containers[r]||{};var n,a=O(Ee(e["void:classPartition"]));try{for(a.s();!(n=a.n()).done;){var o,s=n.value,c=O(Ee(s["void:class"]));try{for(c.s();!(o=c.n()).done;){var l=o.value,f=s["void:uriSpace"].replace(e["void:uriSpace"],"/");t.dataServers[i.key].containers[r][l]?t.dataServers[i.key].containers[r][l].push(f):t.dataServers[i.key].containers[r][l]=[f],Ee(s["semapps:blankNodes"])&&(t.dataServers[i.key].blankNodes[s["void:uriSpace"]]=Ee(s["semapps:blankNodes"]))}}catch(e){c.e(e)}finally{c.f()}}}catch(e){a.e(e)}finally{a.f()}}},s.s();!(u=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}}}catch(e){a.e(e)}finally{a.f()}case 12:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),Ce=function(e,t){return"function"==typeof e?e(t):e},Ae=function(e){return"string"==typeof e&&e.startsWith("http")},Pe=function(e){var t=o.useContext(a.DataProviderContext),r=k(o.useState(),2),n=r[0],i=r[1];return o.useEffect((function(){t.getDataModels().then((function(t){return i(t[e])}))}),[t,e,i]),n},Te=function(){var e=o.useContext(a.DataProviderContext),t=k(o.useState(),2),r=t[0],n=t[1];return o.useEffect((function(){e.getDataServers().then((function(e){return n(e)}))}),[e,n]),r},_e=function(e,t,r){var n=[];if(Object.keys(r[t].containers[t]).length>0&&Object.keys(r[t].containers[t]).forEach((function(a){e.includes(a)&&r[t].containers[t][a].map((function(e){var a=P(r[t].baseUrl,e);n.includes(a)||n.push(a)}))})),0===n.length)throw new Error("No container found matching with types ".concat(JSON.stringify(e),". You can set explicitely the create.container property of the resource."));if(n.length>1)throw new Error("More than one container found matching with types ".concat(JSON.stringify(e),". You must set the create.server or create.container property for the resource."));return n[0]},Le=["children","record","filter","source"],Ne=function(e){var t=e.children,r=e.record,n=e.filter,a=e.source,i=x(e,Le),s=k(o.useState(),2),u=s[0],c=s[1];return o.useEffect((function(){if(r&&a&&Array.isArray(null==r?void 0:r[a])){var e=null==r?void 0:r[a].filter((function(e){var t=!0;for(var r in n){var a=e[r];Array.isArray(a)?a.includes(n[r])||(t=!1):a!==n[r]&&(t=!1)}return t})),t=h({},r);t[a]=e.length>0?e:void 0,c(t)}}),[r,a,n]),p.default.createElement(p.default.Fragment,null,p.default.Children.map(t,(function(e,t){return p.default.cloneElement(e,h(h({},i),{},{record:u,addLabel:!0,source:a}))})))},qe=["children","groupReference","groupLabel","groupHeader","filterProperty"],Ie=["reificationClass","children"],Ue=i.makeStyles({form:{display:"flex"},input:{paddingRight:"20px"}}),Me=i.makeStyles({root:{display:"none"}});exports.FilterHandler=Ne,exports.GroupedReferenceHandler=function(e){var t=e.children,r=e.groupReference,n=e.groupLabel,o=e.groupHeader,i=e.filterProperty,s=x(e,qe),u=a.useQueryWithStore({type:"getList",resource:r,payload:{}}).data;return p.default.createElement(p.default.Fragment,null,null==u?void 0:u.map((function(e,r){var a={};return a[i]=e.id,p.default.createElement(p.default.Fragment,null,o&&o(h(h({},s),{},{group:e})),p.default.createElement(Ne,w({},s,{filter:a,label:e[n]}),t))})))},exports.ReificationArrayInput=function(e){var t=e.reificationClass;e.children;var r=x(e,Ie),n=Ue(),o=Me();return p.default.createElement(a.ArrayInput,r,p.default.createElement(a.SimpleFormIterator,{classes:{form:n.form}},p.default.Children.map(e.children,(function(e,t){return p.default.cloneElement(e,{className:n.input})})),p.default.createElement(a.TextInput,{className:o.root,source:"type",initialValue:t})))},exports.buildBlankNodesQuery=re,exports.buildSparqlQuery=ce,exports.dataProvider=function(e){if(!T("default",e.dataServers))throw new Error("You must define a default server in your dataServers config");e.jsonContext||(e.jsonContext=Object.fromEntries(e.ontologies.map((function(e){return[e.prefix,e.url]})))),e.returnFailedResources||(e.returnFailedResources=!1);var t=je(e),r=Oe(e),n=function(e){return b(v().mark((function n(){var a=arguments;return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t;case 2:return n.next=4,r;case 4:return n.next=6,e.apply(void 0,a);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))};return{getList:n(ve(e)),getMany:n(ye(e)),getManyReference:n(ge(e)),getOne:n(N(e)),create:n(R(e)),update:n(be(e)),updateMany:function(){throw new Error("updateMany is not implemented yet")},delete:n(F(e)),deleteMany:n(H(e)),getDataModels:n(W(e)),getDataServers:n(G(e)),getLocalDataServers:G(e)}},exports.httpClient=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t.headers||(t.headers=new Headers),t.method){case"POST":case"PATCH":case"PUT":t.headers.has("Accept")||t.headers.set("Accept","application/ld+json"),t.headers.has("Content-Type")||t.headers.set("Content-Type","application/ld+json");break;case"DELETE":break;case"GET":default:t.headers.has("Accept")||t.headers.set("Accept","application/ld+json")}if(!t.noToken){var r=localStorage.getItem("token");r&&t.headers.set("Authorization","Bearer ".concat(r))}return a.fetchUtils.fetchJson(e,t)},exports.useContainers=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"@all",r=Pe(e),n=Te(),a=o.useState(),i=k(a,2),s=i[0],u=i[1];return o.useEffect((function(){r&&n&&u(B(r.types,t,n))}),[r,n,t]),s},exports.useCreateContainer=function(e){var t=Pe(e),r=Te(),n=k(o.useState(),2),a=n[0],i=n[1];return o.useEffect((function(){var n,a;if(t&&r)if(null!==(n=t.create)&&void 0!==n&&n.container){var o=k(Object.entries(t.create.container)[0],2),s=o[0],u=o[1];if(!s||!r[s])throw new Error("Wrong key for the dataModel.create.container config of resource "+e);i(P(r[s].baseUrl,u))}else if(null!==(a=t.create)&&void 0!==a&&a.server){var c;i(_e(t.types,null===(c=t.create)||void 0===c?void 0:c.server,r))}else{var l=T("default",r);i(_e(t.types,l,r))}}),[t,r,i]),a},exports.useDataModel=Pe,exports.useDataModels=function(){var e=o.useContext(a.DataProviderContext),t=k(o.useState(),2),r=t[0],n=t[1];return o.useEffect((function(){e.getDataModels().then((function(e){return n(e)}))}),[e,n]),r},exports.useDataServers=Te,exports.useGetExternalLink=function(e){var t=o.useContext(a.DataProviderContext).getLocalDataServers(),r=o.useMemo((function(){if(t)return Object.fromEntries(Object.values(t).map((function(e){var t=void 0!==e.externalLinks?e.externalLinks:!e.default;return[e.baseUrl,t]})))}),[t]);return o.useCallback((function(t){var n=Ce(e,t);if(!1===n)return!1;if(null==t||!t.id)return!1;var a=Object.keys(r).find((function(e){return null==t?void 0:t.id.startsWith(e)}));if(!a)return!1;var o=Ce(r[a],t);return!1!==o&&(Ae(n)?n:Ae(o)?o:t.id)}),[r,e])}; +v=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var a=t&&t.prototype instanceof f?t:f,o=Object.create(a.prototype),i=new j(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return E()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=x(i,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function p(){}function d(){}var h={};s(h,a,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==t&&r.call(g,a)&&(h=g);var b=d.prototype=f.prototype=Object.create(h);function m(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(a,o){function i(){return new t((function(n,i){!function n(a,o,i,s){var u=c(e[a],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(u.arg)}(a,o,n,i)}))}return n=n?n.then(i,i):i()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t,r,n,a,o,i){try{var s=e[o](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){g(o,n,a,i,s,"next",e)}function s(e){g(o,n,a,i,s,"throw",e)}i(void 0)}))}}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(e,t)||j(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(e){if("string"==typeof e)return O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(e,t):void 0}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e,t){return e(t={exports:{}},t.exports),t.exports}var P=A((function(e){var t,r;t=C,r=function(){function e(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(a=a.replace(/^[\/]+/,"")),a=n0?"?":"")+i.join("&")}return function(){return e("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=r():t.urljoin=r()})),T=function(e,t){return Object.keys(t).find((function(r){return t[r][e]}))},_=function(e,t){return Object.keys(t).find((function(r){return e.startsWith(t[r].baseUrl)}))},L=function(){var e=b(v().mark((function e(t,r){var n,a,o,i,s,c,l,f,p;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.dataServers,i=r.httpClient,s=r.jsonContext,c=T("authServer",o),(l=_(t,o))===c||null===(n=o[c])||void 0===n||!n.proxyUrl||!0===(null===(a=o[l])||void 0===a?void 0:a.noProxy)){e.next=9;break}return e.next=6,i(o[c].proxyUrl,{method:"POST",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded"}),body:new URLSearchParams({id:t})});case 6:e.t0=e.sent,e.next=12;break;case 9:return e.next=11,i(t,{noToken:l!==c});case 11:e.t0=e.sent;case 12:if(f=e.t0,(p=f.json).id=p.id||p["@id"],p["@context"]===s){e.next=19;break}return e.next=18,u.default.compact(p,s);case 18:p=e.sent;case 19:return e.abrupt("return",p);case 20:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),N=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s,u,c,l,f;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.resources,i=o[r]){t.next=4;break}throw new Error("Resource ".concat(r," is not mapped in resources file"));case 4:return t.next=6,L(n.id,e);case 6:if(s=t.sent,null!==(a=i.list)&&void 0!==a&&a.forceArray){c=E(null===(u=i.list)||void 0===u?void 0:u.forceArray);try{for(c.s();!(l=c.n()).done;)f=l.value,s[f]&&!Array.isArray(s[f])&&(s[f]=[s[f]])}catch(e){c.e(e)}finally{c.f()}}return t.abrupt("return",{data:s});case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},q=function(e){return e&&e.rawFile&&e.rawFile instanceof File},I=function(e){var t=Object.keys(e.dataServers).find((function(t){return e.dataServers[t].uploadsContainer}));if(t)return P(e.dataServers[t].baseUrl,e.dataServers[t].uploadsContainer)},U=function(){var e=b(v().mark((function e(t,r){var n,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=I(r)){e.next=3;break}throw new Error("You must define an uploadsContainer in one of the server's configuration");case 3:return e.next=5,r.httpClient(n,{method:"POST",body:t,headers:new Headers({Slug:(o=t.name,i=void 0,s=void 0,i="",s=o.split("."),s.length>1&&(i=s.pop(),o=s.join(".")),c.default(o,{lang:"fr"})+"."+i),"Content-Type":t.type})});case 5:if(201!==(a=e.sent).status){e.next=8;break}return e.abrupt("return",a.headers.get("Location"));case 8:case"end":return e.stop()}var o,i,s}),e)})));return function(t,r){return e.apply(this,arguments)}}(),M=function(){var e=b(v().mark((function e(t,r){var n,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=v().keys(t);case 1:if((e.t1=e.t0()).done){e.next=22;break}if(n=e.t1.value,!t.hasOwnProperty(n)){e.next=20;break}if(!Array.isArray(t[n])){e.next=16;break}a=0;case 6:if(!(a1||y[g[0]].length>1)){t.next=18;break}throw new Error("More than one container detected with types ".concat(JSON.stringify(c.types)," on server ").concat(p));case 18:f=y[g[0]][0];case 19:if(!n.data){t.next=34;break}return null!==(b=c.fieldsMapping)&&void 0!==b&&b.title&&(Array.isArray(c.fieldsMapping.title)?l.set("Slug",c.fieldsMapping.title.map((function(e){return n.data[e]})).join(" ")):l.set("Slug",n.data[c.fieldsMapping.title])),t.next=23,M(n.data,e);case 23:return n.data=t.sent,t.next=26,s(f,{method:"POST",headers:l,body:JSON.stringify(h({"@context":u,"@type":c.types},n.data)),noToken:!0!==o[p].authServer});case 26:return m=t.sent,w=m.headers,x=w.get("Location"),t.next=31,N(e)(r,{id:x});case 31:return t.abrupt("return",t.sent);case 34:if(!n.id){t.next=41;break}return l.set("Content-Type","application/sparql-update"),t.next=38,s(f,{method:"PATCH",headers:l,body:"\n PREFIX ldp: \n INSERT DATA { <".concat(f,"> ldp:contains <").concat(n.id,">. };\n "),noToken:!0!==o[p].authServer});case 38:return t.next=40,N(e)(r,{id:n.id});case 40:return t.abrupt("return",t.sent);case 41:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},F=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.dataServers,o=e.httpClient,i=_(n.id,a),t.next=4,o(n.id,{method:"DELETE",noToken:!i||!0!==a[i].authServer});case 4:return t.abrupt("return",{data:{id:n.id}});case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},H=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s,u;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=e.httpClient,o=[],i=E(n.ids),t.prev=3,i.s();case 5:if((s=i.n()).done){t.next=17;break}return u=s.value,t.prev=7,t.next=10,a(u,{method:"DELETE"});case 10:o.push(u),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(7);case 15:t.next=5;break;case 17:t.next=22;break;case 19:t.prev=19,t.t1=t.catch(3),i.e(t.t1);case 22:return t.prev=22,i.f(),t.finish(22);case 25:return t.abrupt("return",{data:o});case 26:case"end":return t.stop()}}),t,null,[[3,19,22,25],[7,13]])})));return function(e,r){return t.apply(this,arguments)}}()},W=function(e){return function(){return e.dataServers}},G=function(e){return function(){return e.resources}};var z=function(){var e=b(v().mark((function e(t,r,n,a){var o,i,s,c,l,f,p,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.dataServers,i=a.httpClient,s=a.jsonContext,c=Object.keys(t).reduce((function(e,r){return h(h({},e),Object.fromEntries(t[r].map((function(e){return[e,r]}))))}),{}),l=Object.keys(c).map((function(e){return i(e,{noToken:!c[e]||!0!==o[c[e]].authServer}).then((function(e){var t=e.json;return t["@context"]!==s?u.default.compact(t,s):t})).then((function(t){if(r="ldp:Container",a=(n=t).type||n["@type"],Array.isArray(a)?a.includes(r):a===r)return t["ldp:contains"];throw new Error(e+" is not a LDP container");var r,n,a}))})),e.next=5,Promise.all(l);case 5:if(0!==(f=e.sent).length){e.next=10;break}return e.abrupt("return",{data:[],total:0});case 10:return f=(p=[].concat).apply.apply(p,S(f)),d=f.map((function(e){return e.id=e.id||e["@id"],e})),n.filter&&(n.filter.a&&(n.filter.type=n.filter.a,delete n.filter.a),Object.keys(n.filter).length>0&&(d=d.filter((function(e){return Object.entries(n.filter).some((function(t){var r=k(t,2),n=r[0],a=r[1];return"q"==n?Object.entries(e).some((function(e){var t=k(e,2);t[0];var r,n=t[1];return(null==(r=n)||"object"!=typeof r||!1!==Array.isArray(r))&&(Array.isArray(n)?n.some((function(e){return e.includes(a)})):n.includes(a))})):(Array.isArray(e[n]),e[n].includes(a))}))})))),n.sort&&(d=d.sort((function(e,t){return!e[n.sort.field]||!t[n.sort.field]||("ASC"===n.sort.order?e[n.sort.field].localeCompare(t[n.sort.field]):t[n.sort.field].localeCompare(e[n.sort.field]))}))),n.pagination&&(d=d.slice((n.pagination.page-1)*n.pagination.perPage,n.pagination.page*n.pagination.perPage)),e.abrupt("return",{data:d,total:f.length});case 16:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}(),J=function(e){var t,r={};if(e){var n,a=E(e);try{for(a.s();!(n=a.n()).done;){var o=n.value;t=o.includes("/")?o.split("/").reverse():[o],r=h(h({},r),t.reduce((function(e,t){return m({},t,h({"@embed":"@last"},e))}),{}))}}catch(e){a.e(e)}finally{a.f()}return r}},$=function(e,t){if(e.startsWith("http://")||e.startsWith("https://"))return e;if("a"===e)return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type";var r=k(e.split(":"),2),n=r[0],a=r[1];if(a){var o=t.find((function(e){return e.prefix===n}));if(o)return o.url+a;throw new Error("No ontology found with prefix "+n)}throw new Error('The value "'.concat(e,'" is not correct. It must include a prefix or be a full URI.'))},Y=r.triple(r.variable("s1"),r.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),r.variable("type")),Q=function(e,t){var n,a;return e?(n=(a=e,a?Array.isArray(a)?a:[a]:[]).map((function(e,n){return r.triple(r.variable("s1"),r.namedNode($(e,t)),r.variable("o"+(n+1)))})),{construct:[Y].concat(S(n)),where:[Y].concat(S(n.map((function(e){return{type:"optional",patterns:[e]}}))))}):{construct:n=[r.triple(r.variable("s1"),r.variable("p1"),r.variable("o1"))],where:n}},V=A((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==C&&C.crypto&&(r=C.crypto),!r)try{r=f.default}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=i.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,a=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=i<<24-(n+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-a%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},p=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,a=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,l=e.min(4*c,o);if(c){for(var f=0;f>>24)|4278255360&(a<<24|a>>>8)}var o=this._hash.words,i=e[t+0],u=e[t+1],d=e[t+2],h=e[t+3],v=e[t+4],y=e[t+5],g=e[t+6],b=e[t+7],m=e[t+8],w=e[t+9],x=e[t+10],k=e[t+11],S=e[t+12],j=e[t+13],O=e[t+14],E=e[t+15],C=o[0],A=o[1],P=o[2],T=o[3];C=c(C,A,P,T,i,7,s[0]),T=c(T,C,A,P,u,12,s[1]),P=c(P,T,C,A,d,17,s[2]),A=c(A,P,T,C,h,22,s[3]),C=c(C,A,P,T,v,7,s[4]),T=c(T,C,A,P,y,12,s[5]),P=c(P,T,C,A,g,17,s[6]),A=c(A,P,T,C,b,22,s[7]),C=c(C,A,P,T,m,7,s[8]),T=c(T,C,A,P,w,12,s[9]),P=c(P,T,C,A,x,17,s[10]),A=c(A,P,T,C,k,22,s[11]),C=c(C,A,P,T,S,7,s[12]),T=c(T,C,A,P,j,12,s[13]),P=c(P,T,C,A,O,17,s[14]),C=l(C,A=c(A,P,T,C,E,22,s[15]),P,T,u,5,s[16]),T=l(T,C,A,P,g,9,s[17]),P=l(P,T,C,A,k,14,s[18]),A=l(A,P,T,C,i,20,s[19]),C=l(C,A,P,T,y,5,s[20]),T=l(T,C,A,P,x,9,s[21]),P=l(P,T,C,A,E,14,s[22]),A=l(A,P,T,C,v,20,s[23]),C=l(C,A,P,T,w,5,s[24]),T=l(T,C,A,P,O,9,s[25]),P=l(P,T,C,A,h,14,s[26]),A=l(A,P,T,C,m,20,s[27]),C=l(C,A,P,T,j,5,s[28]),T=l(T,C,A,P,d,9,s[29]),P=l(P,T,C,A,b,14,s[30]),C=f(C,A=l(A,P,T,C,S,20,s[31]),P,T,y,4,s[32]),T=f(T,C,A,P,m,11,s[33]),P=f(P,T,C,A,k,16,s[34]),A=f(A,P,T,C,O,23,s[35]),C=f(C,A,P,T,u,4,s[36]),T=f(T,C,A,P,v,11,s[37]),P=f(P,T,C,A,b,16,s[38]),A=f(A,P,T,C,x,23,s[39]),C=f(C,A,P,T,j,4,s[40]),T=f(T,C,A,P,i,11,s[41]),P=f(P,T,C,A,h,16,s[42]),A=f(A,P,T,C,g,23,s[43]),C=f(C,A,P,T,w,4,s[44]),T=f(T,C,A,P,S,11,s[45]),P=f(P,T,C,A,E,16,s[46]),C=p(C,A=f(A,P,T,C,d,23,s[47]),P,T,i,6,s[48]),T=p(T,C,A,P,b,10,s[49]),P=p(P,T,C,A,O,15,s[50]),A=p(A,P,T,C,y,21,s[51]),C=p(C,A,P,T,S,6,s[52]),T=p(T,C,A,P,h,10,s[53]),P=p(P,T,C,A,x,15,s[54]),A=p(A,P,T,C,u,21,s[55]),C=p(C,A,P,T,m,6,s[56]),T=p(T,C,A,P,E,10,s[57]),P=p(P,T,C,A,g,15,s[58]),A=p(A,P,T,C,j,21,s[59]),C=p(C,A,P,T,v,6,s[60]),T=p(T,C,A,P,k,10,s[61]),P=p(P,T,C,A,d,15,s[62]),A=p(A,P,T,C,w,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+A|0,o[2]=o[2]+P|0,o[3]=o[3]+T|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,a=8*t.sigBytes;r[a>>>5]|=128<<24-a%32;var o=e.floor(n/4294967296),i=n;r[15+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,a,o,i){var s=e+(t&r|~t&n)+a+i;return(s<>>32-o)+t}function l(e,t,r,n,a,o,i){var s=e+(t&n|r&~n)+a+i;return(s<>>32-o)+t}function f(e,t,r,n,a,o,i){var s=e+(t^r^n)+a+i;return(s<>>32-o)+t}function p(e,t,r,n,a,o,i){var s=e+(r^(t|~n))+a+i;return(s<>>32-o)+t}t.MD5=o._createHelper(u),t.HmacMD5=o._createHmacHelper(u)}(Math),r.MD5)})),K=function(e){return X(e)},Z=function(e){return e.includes("/")&&e.split("/")[0]},ee=function(e){return e.includes("/")?e.split("/")[1]:e},te=function(e){return e.map((function(t){var r=t.query,n=e.find((function(e){return t.parentNode===e.node}));return void 0!==n&&(r=r.concat(n.query[0])),{type:"bgp",triples:r}}))},re=function(e,t,n){var a=[],o=function(e){var t=[];if(e){var r,n=E(e);try{for(n.s();!(r=n.n()).done;){var a=r.value;if(a.includes("/"))for(var o=a.split("/"),i=1;i<=o.length;i++)t.push(o.slice(0,i).join("/"));else t.push(a)}}catch(e){n.e(e)}finally{n.f()}}return t}(e);if(o&&n&&n.length>0){var i,s=E(o);try{for(s.s();!(i=s.n()).done;){var u=i.value,c=Z(u),l=ee(u),f=K(u),p=c?K(c):"1",d=[r.triple(r.variable("s"+p),r.namedNode($(l,n)),r.variable("s"+f)),r.triple(r.variable("s"+f),r.variable("p"+f),r.variable("o"+f))];a.push({node:u,parentNode:c,query:d,filter:""})}}catch(e){s.e(e)}finally{s.f()}return{construct:a.length>0?a.map((function(e){return e.query})).reduce((function(e,t){return e.concat(t)})):null,where:{type:"union",patterns:[t.where].concat(S(te(a)))}}}return{construct:"",where:""}},ne=l.default.literal,ae=l.default.namedNode,oe=l.default.triple,ie=l.default.variable,se=new(0,require("sparqljs").Generator)({}),ue=["q","sparqlWhere","blankNodes","_servers","_predicates"],ce=function(e){var t=e.containers,r=e.params.filter,n=e.blankNodes,a=e.predicates,o=e.ontologies,i=Q(a,o),s={queryType:"CONSTRUCT",template:i.construct,where:[],type:"query",prefixes:Object.fromEntries(o.map((function(e){return[e.prefix,e.url]})))},u=[{type:"values",values:t.map((function(e){return{"?containerUri":ae(e)}}))},oe(ie("containerUri"),ae("http://www.w3.org/ns/ldp#contains"),ie("s1")),{type:"filter",expression:{type:"operation",operator:"isiri",args:[ie("s1")]}}],c=[];if(r&&Object.keys(r).length>0){var l=r.sparqlWhere&&Object.keys(r.sparqlWhere).length>0,f=r.q&&r.q.length>0;l&&[].concat(r.sparqlWhere).forEach((function(e){c.push(e)})),f&&c.push({type:"group",patterns:[{queryType:"SELECT",variables:[ie("s1")],where:[oe(ie("s1"),ie("p1"),ie("o1")),{type:"filter",expression:{type:"operation",operator:"isliteral",args:[ie("o1")]}},{type:"filter",expression:{type:"operation",operator:"regex",args:[{type:"operation",operator:"lcase",args:[{type:"operation",operator:"str",args:[ie("o1")]}]},ne(r.q.toLowerCase(),"",ae("http://www.w3.org/2001/XMLSchema#string"))]}}],type:"query"}]}),Object.entries(r).forEach((function(e){var t=k(e,2),r=t[0],n=t[1];ue.includes(r)||c.unshift(oe(ie("s1"),ae($(r,o)),ae($(n,o))))}))}var p=re(n,i,o);return p&&p.construct?(c=c.concat(p.where),s.template=s.template.concat(p.construct)):c.push(i.where),s.where.push({type:"union",patterns:[u,{type:"graph",name:ae("http://semapps.org/mirror"),patterns:u}]},{type:"union",patterns:[c,{type:"graph",name:ae("http://semapps.org/mirror"),patterns:c}]}),se.stringify(s)},le=function(e,t){for(var r=[],n=0,a=Object.keys(t);n1&&void 0!==h[1]?h[1]:{},s=e.dataServers,u=e.resources,c=u[r]){t.next=5;break}throw new Error("Resource ".concat(r," is not mapped in resources file"));case 5:if(null!==(n=i.filter)&&void 0!==n&&n._servers||null===(a=c.list)||void 0===a||!a.containers){t.next=11;break}if(!Array.isArray(null===(f=c.list)||void 0===f?void 0:f.containers)){t.next=8;break}throw new Error("The list.containers property of ".concat(r," dataModel must be of type object ({ serverKey: [containerUri] })"));case 8:l=he(c.list.containers,s),t.next=12;break;case 11:l=R(c.types,(null===(p=i.filter)||void 0===p?void 0:p._servers)||(null===(d=c.list)||void 0===d?void 0:d.servers),s);case 12:if(null===(o=c.list)||void 0===o||!o.fetchContainer){t.next=16;break}return t.abrupt("return",z(l,r,i,e));case 16:return t.abrupt("return",de(l,r,i,e));case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},ye=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.returnFailedResources,t.next=3,Promise.all(n.ids.map((function(t){return N(e)(r,{id:"object"===y(t)?t["@id"]:t}).then((function(e){return e.data})).catch((function(){if(a)return{id:t,_error:!0}}))})));case 3:return o=(o=t.sent).filter((function(e){return e})),t.abrupt("return",{data:o});case 6:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},ge=function(e){return function(){var t=b(v().mark((function t(r,n){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.filter=h(h({},n.filter),{},m({},n.target,n.id)),delete n.target,t.next=4,ve(e)(r,n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()},be=function(e){return function(){var t=b(v().mark((function t(r,n){var a,o,i,s;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.dataServers,o=e.httpClient,i=e.jsonContext,s=_(n.id,a),t.next=4,M(n.data,e);case 4:return n.data=t.sent,t.next=7,o(n.id,{method:"PUT",body:JSON.stringify(h({"@context":i},n.data)),noToken:!s||!0!==a[s].authServer});case 7:return t.abrupt("return",{data:n.data});case 8:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()};function me(e){this.message=e}me.prototype=new Error,me.prototype.name="InvalidCharacterError";var we="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new me("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,a=0,o=0,i="";n=t.charAt(o++);~n&&(r=a%4?64*r+n:n,a++%4)?i+=String.fromCharCode(255&r>>(-2*a&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i};function xe(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(we(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return we(t)}}function ke(e){this.message=e}function Se(e,t){if("string"!=typeof e)throw new ke("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(xe(e.split(".")[r]))}catch(e){throw new ke("Invalid token specified: "+e.message)}}ke.prototype=new Error,ke.prototype.name="InvalidTokenError";var je=function(){var e=b(v().mark((function e(t){var r,n,a,o,i,s,u,c,l,f,p,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataServers,n=t.httpClient,a=localStorage.getItem("token"),o=T("pod",r),i=T("authServer",r),!a){e.next=24;break}return s=Se(a),u=s.webId,e.prev=6,e.next=9,n(u);case 9:l=e.sent,f=l.json,c=f,e.next=20;break;case 14:return e.prev=14,e.t0=e.catch(6),console.error(e.t0),localStorage.removeItem("token"),window.location.reload(),e.abrupt("return");case 20:o&&(t.dataServers[o].name="My Pod",t.dataServers[o].baseUrl=P(u,"data"),t.dataServers[o].sparqlEndpoint=(null===(p=c.endpoints)||void 0===p?void 0:p["void:sparqlEndpoint"])||P(u,"sparql")),i&&(t.dataServers[i].proxyUrl=null===(d=c.endpoints)||void 0===d?void 0:d.proxyUrl),e.next=25;break;case 24:o&&delete t.dataServers[o];case 25:case"end":return e.stop()}}),e,null,[[6,14]])})));return function(t){return e.apply(this,arguments)}}(),Oe=function(e){return e?Array.isArray(e)?e:[e]:void 0},Ee=function(){var e=b(v().mark((function e(t){var r,n,a,o,i,s,u,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.entries(t.dataServers).filter((function(e){var t=k(e,2);return t[0],!0!==t[1].pod})).map((function(e){var r=k(e,2),n=r[0],a=r[1];return t.httpClient(new URL("/.well-known/void",a.baseUrl),{noToken:!a.authServer}).then((function(e){return{key:n,datasets:e.json["@graph"]}})).catch((function(e){if(404===e.status||401===e.status)return{key:n,error:e};throw e}))})),n=[],e.prev=2,e.next=5,Promise.all(r);case 5:n=e.sent,e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:a=E(n);try{for(a.s();!(o=a.n()).done;)if((i=o.value).datasets){t.dataServers[i.key].containers=t.dataServers[i.key].containers||{},t.dataServers[i.key].blankNodes=t.dataServers[i.key].blankNodes||{},s=E(i.datasets);try{for(c=function(){var e=u.value,r=Object.keys(t.dataServers).find((function(r){return e["void:uriSpace"]===t.dataServers[r].baseUrl}));if(r){r===i.key&&(t.dataServers[i.key].name=t.dataServers[i.key].name||e["dc:title"],t.dataServers[i.key].description=t.dataServers[i.key].description||e["dc:description"],t.dataServers[i.key].sparqlEndpoint=t.dataServers[i.key].sparqlEndpoint||e["void:sparqlEndpoint"]),t.dataServers[i.key].containers[r]=t.dataServers[i.key].containers[r]||{};var n,a=E(Oe(e["void:classPartition"]));try{for(a.s();!(n=a.n()).done;){var o,s=n.value,c=E(Oe(s["void:class"]));try{for(c.s();!(o=c.n()).done;){var l=o.value,f=s["void:uriSpace"].replace(e["void:uriSpace"],"/");t.dataServers[i.key].containers[r][l]?t.dataServers[i.key].containers[r][l].push(f):t.dataServers[i.key].containers[r][l]=[f],Oe(s["semapps:blankNodes"])&&(t.dataServers[i.key].blankNodes[s["void:uriSpace"]]=Oe(s["semapps:blankNodes"]))}}catch(e){c.e(e)}finally{c.f()}}}catch(e){a.e(e)}finally{a.f()}}},s.s();!(u=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}}}catch(e){a.e(e)}finally{a.f()}case 12:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),Ce=function(e,t){return"function"==typeof e?e(t):e},Ae=function(e){return"string"==typeof e&&e.startsWith("http")},Pe=function(e){var t=o.useContext(a.DataProviderContext),r=k(o.useState(),2),n=r[0],i=r[1];return o.useEffect((function(){t.getDataModels().then((function(t){return i(t[e])}))}),[t,e,i]),n},Te=function(){var e=o.useContext(a.DataProviderContext),t=k(o.useState(),2),r=t[0],n=t[1];return o.useEffect((function(){e.getDataServers().then((function(e){return n(e)}))}),[e,n]),r},_e=function(e,t,r){var n=[];if(Object.keys(r[t].containers[t]).length>0&&Object.keys(r[t].containers[t]).forEach((function(a){e.includes(a)&&r[t].containers[t][a].map((function(e){var a=P(r[t].baseUrl,e);n.includes(a)||n.push(a)}))})),0===n.length)throw new Error("No container found matching with types ".concat(JSON.stringify(e),". You can set explicitely the create.container property of the resource."));if(n.length>1)throw new Error("More than one container found matching with types ".concat(JSON.stringify(e),". You must set the create.server or create.container property for the resource."));return n[0]},Le=["children","record","filter","source"],Ne=function(e){var t=e.children,r=e.record,n=e.filter,a=e.source,i=x(e,Le),s=k(o.useState(),2),u=s[0],c=s[1];return o.useEffect((function(){if(r&&a&&Array.isArray(null==r?void 0:r[a])){var e=null==r?void 0:r[a].filter((function(e){var t=!0;for(var r in n){var a=e[r];Array.isArray(a)?a.includes(n[r])||(t=!1):a!==n[r]&&(t=!1)}return t})),t=h({},r);t[a]=e.length>0?e:void 0,c(t)}}),[r,a,n]),p.default.createElement(p.default.Fragment,null,p.default.Children.map(t,(function(e,t){return p.default.cloneElement(e,h(h({},i),{},{record:u,addLabel:!0,source:a}))})))},qe=["children","groupReference","groupLabel","groupHeader","filterProperty"],Ie=["reificationClass","children"],Ue=i.makeStyles({form:{display:"flex"},input:{paddingRight:"20px"}}),Me=i.makeStyles({root:{display:"none"}});exports.FilterHandler=Ne,exports.GroupedReferenceHandler=function(e){var t=e.children,r=e.groupReference,n=e.groupLabel,o=e.groupHeader,i=e.filterProperty,s=x(e,qe),u=a.useQueryWithStore({type:"getList",resource:r,payload:{}}).data;return p.default.createElement(p.default.Fragment,null,null==u?void 0:u.map((function(e,r){var a={};return a[i]=e.id,p.default.createElement(p.default.Fragment,null,o&&o(h(h({},s),{},{group:e})),p.default.createElement(Ne,w({},s,{filter:a,label:e[n]}),t))})))},exports.ReificationArrayInput=function(e){var t=e.reificationClass;e.children;var r=x(e,Ie),n=Ue(),o=Me();return p.default.createElement(a.ArrayInput,r,p.default.createElement(a.SimpleFormIterator,{classes:{form:n.form}},p.default.Children.map(e.children,(function(e,t){return p.default.cloneElement(e,{className:n.input})})),p.default.createElement(a.TextInput,{className:o.root,source:"type",initialValue:t})))},exports.buildBlankNodesQuery=re,exports.buildSparqlQuery=ce,exports.dataProvider=function(e){if(!T("default",e.dataServers))throw new Error("You must define a default server in your dataServers config");e.jsonContext||(e.jsonContext=Object.fromEntries(e.ontologies.map((function(e){return[e.prefix,e.url]})))),e.returnFailedResources||(e.returnFailedResources=!1);var t=je(e),r=Ee(e),n=function(e){return b(v().mark((function n(){var a=arguments;return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t;case 2:return n.next=4,r;case 4:return n.next=6,e.apply(void 0,a);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))};return{getList:n(ve(e)),getMany:n(ye(e)),getManyReference:n(ge(e)),getOne:n(N(e)),create:n(B(e)),update:n(be(e)),updateMany:function(){throw new Error("updateMany is not implemented yet")},delete:n(F(e)),deleteMany:n(H(e)),getDataModels:n(G(e)),getDataServers:n(W(e)),getLocalDataServers:W(e)}},exports.httpClient=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t.headers||(t.headers=new Headers),t.method){case"POST":case"PATCH":case"PUT":t.headers.has("Accept")||t.headers.set("Accept","application/ld+json"),t.headers.has("Content-Type")||t.headers.set("Content-Type","application/ld+json");break;case"DELETE":break;case"GET":default:t.headers.has("Accept")||t.headers.set("Accept","application/ld+json")}if(!t.noToken){var r=localStorage.getItem("token");r&&t.headers.set("Authorization","Bearer ".concat(r))}return a.fetchUtils.fetchJson(e,t)},exports.useContainers=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"@all",r=Pe(e),n=Te(),a=o.useState(),i=k(a,2),s=i[0],u=i[1];return o.useEffect((function(){r&&n&&u(R(r.types,t,n))}),[r,n,t]),s},exports.useCreateContainer=function(e){var t=Pe(e),r=Te(),n=k(o.useState(),2),a=n[0],i=n[1];return o.useEffect((function(){var n,a;if(t&&r)if(null!==(n=t.create)&&void 0!==n&&n.container){var o=k(Object.entries(t.create.container)[0],2),s=o[0],u=o[1];if(!s||!r[s])throw new Error("Wrong key for the dataModel.create.container config of resource "+e);i(P(r[s].baseUrl,u))}else if(null!==(a=t.create)&&void 0!==a&&a.server){var c;i(_e(t.types,null===(c=t.create)||void 0===c?void 0:c.server,r))}else{var l=T("default",r);i(_e(t.types,l,r))}}),[t,r,i]),a},exports.useDataModel=Pe,exports.useDataModels=function(){var e=o.useContext(a.DataProviderContext),t=k(o.useState(),2),r=t[0],n=t[1];return o.useEffect((function(){e.getDataModels().then((function(e){return n(e)}))}),[e,n]),r},exports.useDataServers=Te,exports.useGetExternalLink=function(e){var t=o.useContext(a.DataProviderContext).getLocalDataServers(),r=o.useMemo((function(){if(t)return Object.fromEntries(Object.values(t).map((function(e){var t=void 0!==e.externalLinks?e.externalLinks:!e.default;return[e.baseUrl,t]})))}),[t]);return o.useCallback((function(t){var n=Ce(e,t);if(!1===n)return!1;if(null==t||!t.id)return!1;var a=Object.keys(r).find((function(e){return null==t?void 0:t.id.startsWith(e)}));if(!a)return!1;var o=Ce(r[a],t);return!1!==o&&(Ae(n)?n:Ae(o)?o:t.id)}),[r,e])}; //# sourceMappingURL=index.cjs.js.map diff --git a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map index 0e163cdd8..0155cc40d 100644 --- a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map +++ b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"index.cjs.js","sources":["../../../node_modules/url-join/lib/url-join.js","../src/dataProvider/utils/getServerKeyFromType.js","../src/dataProvider/utils/getServerKeyFromUri.js","../src/dataProvider/utils/fetchResource.js","../src/dataProvider/methods/getOne.js","../src/dataProvider/utils/uploadAllFiles.js","../src/dataProvider/utils/parseServerKeys.js","../src/dataProvider/utils/findContainersWithTypes.js","../src/dataProvider/methods/create.js","../src/dataProvider/methods/delete.js","../src/dataProvider/methods/deleteMany.js","../src/dataProvider/methods/getDataServers.js","../src/dataProvider/methods/getDataModels.js","../src/dataProvider/utils/fetchContainers.js","../node_modules/isobject/index.js","../src/dataProvider/utils/getEmbedFrame.js","../src/dataProvider/utils/resolvePrefix.js","../src/dataProvider/utils/buildBaseQuery.js","../../../node_modules/crypto-js/core.js","../../../node_modules/crypto-js/md5.js","../src/dataProvider/utils/buildBlankNodesQuery.js","../src/dataProvider/utils/buildSparqlQuery.js","../src/dataProvider/utils/getBlankNodesFromDataServers.js","../src/dataProvider/utils/fetchSparqlEndpoints.js","../src/dataProvider/utils/findContainersWithPath.js","../src/dataProvider/methods/getList.js","../src/dataProvider/methods/getMany.js","../src/dataProvider/methods/getManyReference.js","../src/dataProvider/methods/update.js","../../../node_modules/jwt-decode/build/jwt-decode.esm.js","../src/dataProvider/utils/fetchUserConfig.js","../src/dataProvider/utils/fetchVoidEndpoints.js","../src/hooks/useGetExternalLink.js","../src/hooks/useDataModel.js","../src/hooks/useDataServers.js","../src/dataProvider/utils/findCreateContainerWithTypes.js","../src/reification/FilterHandler.js","../src/reification/ReificationArrayInput.js","../src/reification/GroupedReferenceHandler.js","../src/dataProvider/dataProvider.js","../src/httpClient.js","../src/hooks/useContainers.js","../src/hooks/useCreateContainer.js","../src/hooks/useDataModels.js"],"sourcesContent":["(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) module.exports = definition();\n else if (typeof define === 'function' && define.amd) define(definition);\n else context[name] = definition();\n})('urljoin', this, function () {\n\n function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n }\n\n return function () {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n };\n\n});\n","const getServerKeyFromType = (type, dataServers) => {\n return Object.keys(dataServers).find(key => {\n return dataServers[key][type];\n });\n};\n\nexport default getServerKeyFromType;\n","// Return the first server matching with the baseUrl\nconst getServerKeyFromUri = (uri, dataServers) => {\n return Object.keys(dataServers).find(key => {\n return uri.startsWith(dataServers[key].baseUrl);\n });\n};\n\nexport default getServerKeyFromUri;\n","import getServerKeyFromType from './getServerKeyFromType';\nimport getServerKeyFromUri from './getServerKeyFromUri';\nimport jsonld from 'jsonld';\n\nconst fetchResource = async (resourceUri, config) => {\n const { dataServers, httpClient, jsonContext } = config;\n\n const authServerKey = getServerKeyFromType('authServer', dataServers);\n const serverKey = getServerKeyFromUri(resourceUri, dataServers);\n\n // Fetch through proxy server if it is available\n let { json: data } =\n serverKey !== authServerKey && dataServers[authServerKey]?.proxyUrl && dataServers[serverKey]?.noProxy !== true\n ? await httpClient(dataServers[authServerKey].proxyUrl, {\n method: 'POST',\n headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }),\n body: new URLSearchParams({ id: resourceUri })\n })\n : await httpClient(resourceUri, {\n noToken: serverKey !== authServerKey\n });\n\n data.id = data.id || data['@id'];\n\n // We compact only if the context is different between the frontend and the middleware\n // TODO deep compare if the context is an object\n if (data['@context'] !== jsonContext) {\n data = await jsonld.compact(data, jsonContext);\n }\n\n return data;\n};\n\nexport default fetchResource;\n","import fetchResource from '../utils/fetchResource';\n\nconst getOneMethod = config => async (resourceId, params) => {\n const { resources } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) throw new Error(`Resource ${resourceId} is not mapped in resources file`);\n\n const data = await fetchResource(params.id, config);\n\n // Transform single value into array if forceArray is set\n if (dataModel.list?.forceArray) {\n for (const forceArrayItem of dataModel.list?.forceArray) {\n if (data[forceArrayItem] && !Array.isArray(data[forceArrayItem])) {\n data[forceArrayItem] = [data[forceArrayItem]];\n }\n }\n }\n\n // TODO activate defaultFetchPlan option\n // if (dataModel.list?.defaultFetchPlan) {\n // for (const node of dataModel.list?.defaultFetchPlan) {\n // if (\n // data[node] &&\n // typeof data[node] === 'string' &&\n // data[node].startsWith('http')\n // ) {\n // try {\n // const dataToEmbed = await fetchResource(data[node], config);\n // delete dataToEmbed['@context'];\n // data[node] = dataToEmbed;\n // } catch (e) {\n // // Ignore errors (this may happen if user does not have rights to see the resource)\n // }\n // }\n // }\n // }\n\n return { data };\n};\n\nexport default getOneMethod;\n","import createSlug from 'speakingurl';\nimport urlJoin from 'url-join';\n\nexport const getSlugWithExtension = fileName => {\n let fileExtension = '';\n let splitFileName = fileName.split('.');\n if (splitFileName.length > 1) {\n fileExtension = splitFileName.pop();\n fileName = splitFileName.join('.');\n }\n return createSlug(fileName, { lang: 'fr' }) + '.' + fileExtension;\n};\n\nexport const isFile = o => o && o.rawFile && o.rawFile instanceof File;\n\nconst getUploadsContainerUri = config => {\n const serverKey = Object.keys(config.dataServers).find(key => config.dataServers[key].uploadsContainer);\n if (serverKey) {\n return urlJoin(config.dataServers[serverKey].baseUrl, config.dataServers[serverKey].uploadsContainer);\n }\n};\n\nconst uploadFile = async (rawFile, config) => {\n const uploadsContainerUri = getUploadsContainerUri(config);\n if (!uploadsContainerUri) throw new Error(\"You must define an uploadsContainer in one of the server's configuration\");\n\n const response = await config.httpClient(uploadsContainerUri, {\n method: 'POST',\n body: rawFile,\n headers: new Headers({\n // We must sluggify the file name, because we can't use non-ASCII characters in the header\n // However we keep the extension apart (if it exists) so that it is not replaced with a -\n // TODO let the middleware guess the extension based on the content type\n Slug: getSlugWithExtension(rawFile.name),\n 'Content-Type': rawFile.type\n })\n });\n\n if (response.status === 201) {\n return response.headers.get('Location');\n }\n};\n\n/*\n * Look for raw files in the record data.\n * If there are any, upload them and replace the file by its URL.\n */\nconst uploadAllFiles = async (record, config) => {\n for (let property in record) {\n if (record.hasOwnProperty(property)) {\n if (Array.isArray(record[property])) {\n for (let i = 0; i < record[property].length; i++) {\n if (isFile(record[property][i])) {\n record[property][i] = await uploadFile(record[property][i].rawFile, config);\n }\n }\n } else {\n if (isFile(record[property])) {\n record[property] = await uploadFile(record[property].rawFile, config);\n }\n }\n }\n }\n return record;\n};\n\nexport default uploadAllFiles;\n","import getServerKeyFromType from './getServerKeyFromType';\n\nconst parseServerKey = (serverKey, dataServers) => {\n switch (serverKey) {\n case '@default':\n return getServerKeyFromType('default', dataServers);\n case '@pod':\n return getServerKeyFromType('pod', dataServers);\n case '@authServer':\n return getServerKeyFromType('authServer', dataServers);\n default:\n return serverKey;\n }\n};\n\n// Return the list of servers keys in an array\n// parsing keywords like @all, @default, @pod and @authServer\nconst parseServerKeys = (serverKeys, dataServers) => {\n if (Array.isArray(serverKeys)) {\n if (serverKeys.includes('@all')) {\n return Object.keys(dataServers);\n } else {\n return serverKeys.map(serverKey => parseServerKey(serverKey, dataServers));\n }\n } else if (typeof serverKeys === 'string') {\n if (serverKeys === '@all') {\n return Object.keys(dataServers);\n } else if (serverKeys === '@remote') {\n const defaultServerKey = getServerKeyFromType('default', dataServers);\n return Object.keys(dataServers).filter(serverKey => serverKey !== defaultServerKey);\n } else {\n return [parseServerKey(serverKeys, dataServers)];\n }\n } else {\n // If server key is empty\n return false;\n }\n};\n\nexport default parseServerKeys;\n","import urlJoin from 'url-join';\nimport parseServerKeys from './parseServerKeys';\n\nconst findContainersWithTypes = (types, serverKeys, dataServers) => {\n let containers = {};\n let existingContainers = [];\n\n serverKeys = parseServerKeys(serverKeys, dataServers);\n\n Object.keys(dataServers).forEach(key1 => {\n Object.keys(dataServers[key1].containers).forEach(key2 => {\n if (!serverKeys || serverKeys.includes(key2)) {\n Object.keys(dataServers[key1].containers[key2]).forEach(type => {\n if (types.includes(type)) {\n dataServers[key1].containers[key2][type].map(path => {\n const containerUri = urlJoin(dataServers[key2].baseUrl, path);\n\n // Avoid returning the same container several times\n if (!existingContainers.includes(containerUri)) {\n existingContainers.push(containerUri);\n\n if (!containers[key1]) containers[key1] = [];\n containers[key1].push(containerUri);\n }\n });\n }\n });\n }\n });\n });\n return containers;\n};\n\nexport default findContainersWithTypes;\n","import urlJoin from 'url-join';\nimport getOne from './getOne';\nimport uploadAllFiles from '../utils/uploadAllFiles';\nimport findContainersWithTypes from '../utils/findContainersWithTypes';\n\nconst createMethod = config => async (resourceId, params) => {\n const { dataServers, resources, httpClient, jsonContext } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) Error(`Resource ${resourceId} is not mapped in resources file`);\n\n const headers = new Headers();\n\n let containerUri, serverKey;\n if (dataModel.create?.container) {\n serverKey = Object.keys(dataModel.create.container)[0];\n containerUri = urlJoin(dataServers[serverKey].baseUrl, Object.values(dataModel.create.container)[0]);\n } else {\n serverKey = dataModel.create?.server || Object.keys(dataServers).find(key => dataServers[key].default === true);\n if (!serverKey) throw new Error('You must define a server for the creation, or a container, or a default server');\n\n const containers = findContainersWithTypes(dataModel.types, [serverKey], dataServers);\n // Extract the containerUri from the results (and ensure there is only one)\n const serverKeys = Object.keys(containers);\n\n if (!serverKeys || serverKeys.length === 0)\n throw new Error(`No container with types ${JSON.stringify(dataModel.types)} found on server ${serverKey}`);\n if (serverKeys.length > 1 || containers[serverKeys[0]].length > 1)\n throw new Error(\n `More than one container detected with types ${JSON.stringify(dataModel.types)} on server ${serverKey}`\n );\n containerUri = containers[serverKeys[0]][0];\n }\n\n if (params.data) {\n if (dataModel.fieldsMapping?.title) {\n if (Array.isArray(dataModel.fieldsMapping.title)) {\n headers.set('Slug', dataModel.fieldsMapping.title.map(f => params.data[f]).join(' '));\n } else {\n headers.set('Slug', params.data[dataModel.fieldsMapping.title]);\n }\n }\n\n // Upload files, if there are any\n params.data = await uploadAllFiles(params.data, config);\n\n const { headers: responseHeaders } = await httpClient(containerUri, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n '@context': jsonContext,\n '@type': dataModel.types,\n ...params.data\n }),\n noToken: dataServers[serverKey].authServer !== true\n });\n\n // Retrieve newly-created resource\n const resourceUri = responseHeaders.get('Location');\n return await getOne(config)(resourceId, { id: resourceUri });\n } else if (params.id) {\n headers.set('Content-Type', 'application/sparql-update');\n\n await httpClient(containerUri, {\n method: 'PATCH',\n headers,\n body: `\n PREFIX ldp: \n INSERT DATA { <${containerUri}> ldp:contains <${params.id}>. };\n `,\n noToken: dataServers[serverKey].authServer !== true\n });\n\n // Create must return the new data, so get them from the remote URI\n return await getOne(config)(resourceId, { id: params.id });\n }\n};\n\nexport default createMethod;\n","import getServerKeyFromUri from '../utils/getServerKeyFromUri';\n\nconst deleteMethod = config => async (resourceId, params) => {\n const { dataServers, httpClient } = config;\n const serverKey = getServerKeyFromUri(params.id, dataServers);\n\n await httpClient(params.id, {\n method: 'DELETE',\n noToken: !serverKey || dataServers[serverKey].authServer !== true\n });\n\n return { data: { id: params.id } };\n};\n\nexport default deleteMethod;\n","const deleteManyMethod = config => async (resourceId, params) => {\n const { httpClient } = config;\n let ids = [];\n\n for (let id of params.ids) {\n try {\n await httpClient(id, {\n method: 'DELETE'\n });\n ids.push(id);\n } catch (e) {\n // Do nothing if we fail to delete a resource\n }\n }\n\n return { data: ids };\n};\n\nexport default deleteManyMethod;\n","const getDataServers = config => () => {\n return config.dataServers;\n};\n\nexport default getDataServers;\n","const getDataModels = config => () => {\n return config.resources;\n};\n\nexport default getDataModels;\n","import jsonld from 'jsonld';\nimport isobject from 'isobject';\n\nexport const isType = (type, resource) => {\n const resourceType = resource.type || resource['@type'];\n return Array.isArray(resourceType) ? resourceType.includes(type) : resourceType === type;\n};\n\nconst fetchContainers = async (containers, resourceId, params, config) => {\n const { dataServers, httpClient, jsonContext } = config;\n\n // Transform in an containerUri:serverKey object\n const containersServers = Object.keys(containers).reduce(\n (acc, serverKey) => ({\n ...acc,\n ...Object.fromEntries(containers[serverKey].map(containerUri => [containerUri, serverKey]))\n }),\n {}\n );\n\n const fetchPromises = Object.keys(containersServers).map(containerUri =>\n httpClient(containerUri, {\n noToken: !containersServers[containerUri] || dataServers[containersServers[containerUri]].authServer !== true\n })\n .then(({ json }) => {\n // If container's context is different, compact it to have an uniform result\n // TODO deep compare if the context is an object\n if (json['@context'] !== jsonContext) {\n return jsonld.compact(json, jsonContext);\n } else {\n return json;\n }\n })\n .then(json => {\n if (isType('ldp:Container', json)) {\n return json['ldp:contains'];\n } else {\n throw new Error(containerUri + ' is not a LDP container');\n }\n })\n );\n\n // Fetch simultaneously all containers\n let results = await Promise.all(fetchPromises);\n\n if (results.length === 0) {\n return { data: [], total: 0 };\n } else {\n // Merge all results in one array\n results = [].concat.apply(...results);\n\n let returnData = results.map(item => {\n item.id = item.id || item['@id'];\n return item;\n });\n\n // Apply filter to results\n if (params.filter) {\n // For SPARQL queries, we use \"a\" to filter types, but in containers it must be \"type\"\n if (params.filter.a) {\n params.filter.type = params.filter.a;\n delete params.filter.a;\n }\n\n if (Object.keys(params.filter).length > 0) {\n returnData = returnData.filter(resource => {\n return Object.entries(params.filter).some(([k, v]) => {\n if (k == 'q') {\n // if fiter is q, all properties have to be checked\n return Object.entries(resource).some(([kr, vr]) => {\n if (!isobject(vr)) {\n return Array.isArray(vr) ? vr.some(va => va.includes(v)) : vr.includes(v);\n } else {\n return false;\n }\n });\n } else {\n return Array.isArray(resource[k]) ? resource[k].includes(v) : resource[k].includes(v);\n }\n });\n });\n }\n }\n\n if (params.sort) {\n returnData = returnData.sort((a, b) => {\n if (a[params.sort.field] && b[params.sort.field]) {\n if (params.sort.order === 'ASC') {\n return a[params.sort.field].localeCompare(b[params.sort.field]);\n } else {\n return b[params.sort.field].localeCompare(a[params.sort.field]);\n }\n } else {\n return true;\n }\n });\n }\n if (params.pagination) {\n returnData = returnData.slice(\n (params.pagination.page - 1) * params.pagination.perPage,\n params.pagination.page * params.pagination.perPage\n );\n }\n\n return { data: returnData, total: results.length };\n }\n};\n\nexport default fetchContainers;\n","/*!\n * isobject \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nexport default function isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n};\n","const getEmbedFrame = blankNodes => {\n let embedFrame = {},\n predicates;\n if (blankNodes) {\n for (let blankNode of blankNodes) {\n if (blankNode.includes('/')) {\n predicates = blankNode.split('/').reverse();\n } else {\n predicates = [blankNode];\n }\n embedFrame = {\n ...embedFrame,\n ...predicates.reduce(\n (accumulator, predicate) => ({\n [predicate]: {\n '@embed': '@last',\n ...accumulator\n }\n }),\n {}\n )\n };\n }\n return embedFrame;\n }\n};\n\nexport default getEmbedFrame;\n","const resolvePrefix = (item, ontologies) => {\n if (item.startsWith('http://') || item.startsWith('https://')) {\n // Already resolved, return the URI\n return item;\n } else if (item === 'a') {\n // Special case\n return 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';\n } else {\n const [prefix, value] = item.split(':');\n if (value) {\n const ontology = ontologies.find(ontology => ontology.prefix === prefix);\n if (ontology) {\n return ontology.url + value;\n } else {\n throw new Error('No ontology found with prefix ' + prefix);\n }\n } else {\n throw new Error(`The value \"${item}\" is not correct. It must include a prefix or be a full URI.`);\n }\n }\n};\n\nexport default resolvePrefix;\n","import { namedNode, triple, variable } from '@rdfjs/data-model';\nimport resolvePrefix from './resolvePrefix';\n\nconst defaultToArray = value => (!value ? [] : Array.isArray(value) ? value : [value]);\n\n// We need to always include the type or React-Admin will not work properly\nconst typeQuery = triple(\n variable('s1'),\n namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n variable('type')\n);\n\nconst buildBaseQuery = (predicates, ontologies) => {\n let baseTriples;\n if (predicates) {\n baseTriples = defaultToArray(predicates).map((predicate, i) =>\n triple(variable('s1'), namedNode(resolvePrefix(predicate, ontologies)), variable('o' + (i + 1)))\n );\n return {\n construct: [typeQuery, ...baseTriples],\n where: [typeQuery, ...baseTriples.map(triple => ({ type: 'optional', patterns: [triple] }))]\n };\n } else {\n baseTriples = [triple(variable('s1'), variable('p1'), variable('o1'))];\n return {\n construct: baseTriples,\n where: baseTriples\n };\n }\n};\n\nexport default buildBaseQuery;\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var T = [];\n\n\t // Compute constants\n\t (function () {\n\t for (var i = 0; i < 64; i++) {\n\t T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;\n\t }\n\t }());\n\n\t /**\n\t * MD5 hash algorithm.\n\t */\n\t var MD5 = C_algo.MD5 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var M_offset_0 = M[offset + 0];\n\t var M_offset_1 = M[offset + 1];\n\t var M_offset_2 = M[offset + 2];\n\t var M_offset_3 = M[offset + 3];\n\t var M_offset_4 = M[offset + 4];\n\t var M_offset_5 = M[offset + 5];\n\t var M_offset_6 = M[offset + 6];\n\t var M_offset_7 = M[offset + 7];\n\t var M_offset_8 = M[offset + 8];\n\t var M_offset_9 = M[offset + 9];\n\t var M_offset_10 = M[offset + 10];\n\t var M_offset_11 = M[offset + 11];\n\t var M_offset_12 = M[offset + 12];\n\t var M_offset_13 = M[offset + 13];\n\t var M_offset_14 = M[offset + 14];\n\t var M_offset_15 = M[offset + 15];\n\n\t // Working varialbes\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\n\t // Computation\n\t a = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t d = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t c = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t b = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t a = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t d = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t c = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t b = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t a = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t d = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t c = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t b = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t a = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t d = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t c = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t b = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t a = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t d = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t c = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t b = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t a = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t d = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t c = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t b = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t a = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t d = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t c = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t b = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t a = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t d = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t c = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t b = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t a = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t d = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t c = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t b = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t a = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t d = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t c = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t b = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t a = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t d = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t c = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t b = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t a = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t d = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t c = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t b = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t a = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t d = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t c = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t b = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t a = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t d = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t c = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t b = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t a = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t d = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t c = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t b = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t a = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t d = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t c = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t b = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\n\t var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t var nBitsTotalL = nBitsTotal;\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (\n\t (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)\n\t );\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)\n\t );\n\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t function FF(a, b, c, d, x, s, t) {\n\t var n = a + ((b & c) | (~b & d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function GG(a, b, c, d, x, s, t) {\n\t var n = a + ((b & d) | (c & ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function HH(a, b, c, d, x, s, t) {\n\t var n = a + (b ^ c ^ d) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function II(a, b, c, d, x, s, t) {\n\t var n = a + (c ^ (b | ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.MD5('message');\n\t * var hash = CryptoJS.MD5(wordArray);\n\t */\n\t C.MD5 = Hasher._createHelper(MD5);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacMD5(message, key);\n\t */\n\t C.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t}(Math));\n\n\n\treturn CryptoJS.MD5;\n\n}));","import md5 from 'crypto-js/md5';\nimport { namedNode, triple, variable } from '@rdfjs/data-model';\nimport resolvePrefix from './resolvePrefix';\n\n// Transform ['ont:predicate1/ont:predicate2'] to ['ont:predicate1', 'ont:predicate1/ont:predicate2']\nconst extractNodes = blankNodes => {\n let nodes = [];\n if (blankNodes) {\n for (let predicate of blankNodes) {\n if (predicate.includes('/')) {\n const nodeNames = predicate.split('/');\n for (let i = 1; i <= nodeNames.length; i++) {\n nodes.push(nodeNames.slice(0, i).join('/'));\n }\n } else {\n nodes.push(predicate);\n }\n }\n }\n return nodes;\n};\n\nconst generateSparqlVarName = node => md5(node);\n\nconst getParentNode = node => node.includes('/') && node.split('/')[0];\n\nconst getPredicate = node => (node.includes('/') ? node.split('/')[1] : node);\n\nconst buildUnionQuery = queries =>\n queries.map(q => {\n let triples = q.query;\n const firstTriple = queries.find(q2 => q.parentNode === q2.node);\n if (firstTriple !== undefined) {\n triples = triples.concat(firstTriple.query[0]);\n }\n return {\n type: 'bgp',\n triples\n };\n });\n\nconst buildBlankNodesQuery = (blankNodes, baseQuery, ontologies) => {\n let queries = [];\n const nodes = extractNodes(blankNodes);\n\n if (nodes && ontologies && ontologies.length > 0) {\n for (let node of nodes) {\n const parentNode = getParentNode(node);\n const predicate = getPredicate(node);\n const varName = generateSparqlVarName(node);\n const parentVarName = parentNode ? generateSparqlVarName(parentNode) : '1';\n\n const query = [\n triple(variable('s' + parentVarName), namedNode(resolvePrefix(predicate, ontologies)), variable('s' + varName)),\n triple(variable('s' + varName), variable('p' + varName), variable('o' + varName))\n ];\n\n queries.push({\n node,\n parentNode,\n query,\n filter: '' // `FILTER(isBLANK(?s${varName})) .`\n });\n }\n\n return {\n construct: queries.length > 0 ? queries.map(q => q.query).reduce((pre, cur) => pre.concat(cur)) : null,\n where: {\n type: 'union',\n patterns: [baseQuery.where, ...buildUnionQuery(queries)]\n }\n };\n } else {\n return {\n construct: '',\n where: ''\n };\n }\n};\n\nexport default buildBlankNodesQuery;\n","import DataFactory from '@rdfjs/data-model';\nimport buildBaseQuery from './buildBaseQuery';\nimport buildBlankNodesQuery from './buildBlankNodesQuery';\nimport resolvePrefix from './resolvePrefix';\nconst { literal, namedNode, triple, variable } = DataFactory;\n\nconst SparqlGenerator = require('sparqljs').Generator;\nconst generator = new SparqlGenerator({\n /* prefixes, baseIRI, factory, sparqlStar */\n});\n\nconst reservedFilterKeys = ['q', 'sparqlWhere', 'blankNodes', '_servers', '_predicates'];\n\nconst buildSparqlQuery = ({ containers, params: { filter }, blankNodes, predicates, ontologies }) => {\n const baseQuery = buildBaseQuery(predicates, ontologies);\n\n let sparqlJsParams = {\n queryType: 'CONSTRUCT',\n template: baseQuery.construct,\n where: [],\n type: 'query',\n prefixes: Object.fromEntries(ontologies.map(ontology => [ontology.prefix, ontology.url]))\n };\n\n let containerWhere = [\n {\n type: 'values',\n values: containers.map(containerUri => ({ '?containerUri': namedNode(containerUri) }))\n },\n triple(variable('containerUri'), namedNode('http://www.w3.org/ns/ldp#contains'), variable('s1')),\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'isiri',\n args: [variable('s1')]\n }\n }\n ];\n\n let resourceWhere = [];\n\n if (filter && Object.keys(filter).length > 0) {\n const hasSPARQLFilter = filter.sparqlWhere && Object.keys(filter.sparqlWhere).length > 0;\n const hasFullTextSearch = filter.q && filter.q.length > 0;\n\n if (hasSPARQLFilter) {\n /* \n Example of usage :\n {\n \"sparqlWhere\": {\n \"type\": \"bgp\",\n \"triples\": [{\n \"subject\": {\"termType\": \"Variable\", \"value\": \"s1\"},\n \"predicate\": {\"termType\": \"NameNode\", \"value\": \"http://virtual-assembly.org/ontologies/pair#label\"},\n \"object\": {\"termType\": \"Literal\", \"value\": \"My Organization\"}\n }]\n }\n }\n */\n // initialize array in case of single value :\n [].concat(filter.sparqlWhere).forEach(sw => {\n resourceWhere.push(sw);\n });\n }\n\n if (hasFullTextSearch) {\n resourceWhere.push({\n type: 'group',\n patterns: [\n {\n queryType: 'SELECT',\n variables: [variable('s1')],\n where: [\n triple(variable('s1'), variable('p1'), variable('o1')),\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'isliteral',\n args: [variable('o1')]\n }\n },\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'regex',\n args: [\n {\n type: 'operation',\n operator: 'lcase',\n args: [\n {\n type: 'operation',\n operator: 'str',\n args: [variable('o1')]\n }\n ]\n },\n literal(filter.q.toLowerCase(), '', namedNode('http://www.w3.org/2001/XMLSchema#string'))\n ]\n }\n }\n ],\n type: 'query'\n }\n ]\n });\n }\n\n // Other filters\n // SPARQL keyword a = filter based on the class of a resource (example => 'a': 'pair:OrganizationType')\n // Other filters are based on a value (example => 'petr:hasAudience': 'http://localhost:3000/audiences/tout-public')\n Object.entries(filter).forEach(([predicate, object]) => {\n if (!reservedFilterKeys.includes(predicate)) {\n resourceWhere.unshift(\n triple(\n variable('s1'),\n namedNode(resolvePrefix(predicate, ontologies)),\n namedNode(resolvePrefix(object, ontologies))\n )\n );\n }\n });\n }\n\n // Blank nodes\n const blankNodesQuery = buildBlankNodesQuery(blankNodes, baseQuery, ontologies);\n if (blankNodesQuery && blankNodesQuery.construct) {\n resourceWhere = resourceWhere.concat(blankNodesQuery.where);\n sparqlJsParams.template = sparqlJsParams.template.concat(blankNodesQuery.construct);\n } else {\n resourceWhere.push(baseQuery.where);\n }\n\n sparqlJsParams.where.push(\n {\n type: 'union',\n patterns: [\n containerWhere,\n {\n type: 'graph',\n name: namedNode('http://semapps.org/mirror'),\n patterns: containerWhere\n }\n ]\n },\n {\n type: 'union',\n patterns: [\n resourceWhere,\n {\n type: 'graph',\n name: namedNode('http://semapps.org/mirror'),\n patterns: resourceWhere\n }\n ]\n }\n );\n\n return generator.stringify(sparqlJsParams);\n};\n\nexport default buildSparqlQuery;\n","// Based on the dataServers config, returns the blank nodes for the given containers\nconst getBlankNodesFromDataServers = (containers, dataServers) => {\n const blankNodes = [];\n for (let serverKey of Object.keys(dataServers)) {\n if (dataServers[serverKey].blankNodes) {\n for (let containerUri of Object.keys(dataServers[serverKey].blankNodes)) {\n if (containers.includes(containerUri)) {\n blankNodes.push(...dataServers[serverKey].blankNodes[containerUri]);\n }\n }\n }\n }\n // Remove duplicates\n return [...new Set(blankNodes)];\n};\n\nexport default getBlankNodesFromDataServers;\n","import getEmbedFrame from './getEmbedFrame';\nimport buildSparqlQuery from './buildSparqlQuery';\nimport getBlankNodesFromDataServers from './getBlankNodesFromDataServers';\nimport jsonld from 'jsonld';\n\nconst compare = (a, b) => {\n switch (typeof a) {\n case 'string':\n return a.localeCompare(b);\n case 'number':\n case 'bigint':\n return a - b;\n default:\n return 0;\n }\n};\n\nconst fetchSparqlEndpoints = async (containers, resourceId, params, config) => {\n const { dataServers, resources, httpClient, jsonContext, ontologies } = config;\n const dataModel = resources[resourceId];\n\n const sparqlQueryPromises = Object.keys(containers).map(\n serverKey =>\n new Promise((resolve, reject) => {\n const blankNodes =\n params.filter?.blankNodes ||\n dataModel.list?.blankNodes ||\n getBlankNodesFromDataServers(containers[serverKey], dataServers);\n\n const predicates = params.filter?._predicates || dataModel.list?.predicates;\n\n const sparqlQuery = buildSparqlQuery({\n containers: containers[serverKey],\n params: { ...params, filter: { ...dataModel.list?.filter, ...params.filter } },\n blankNodes,\n predicates,\n ontologies\n });\n\n httpClient(dataServers[serverKey].sparqlEndpoint, {\n method: 'POST',\n body: sparqlQuery,\n noToken: dataServers[serverKey].authServer !== true\n })\n .then(({ json }) => {\n // By default, embed only the blank nodes we explicitly asked to dereference\n // Otherwise we may have same-type resources embedded in other resources\n // To increase performances, you can set explicitEmbedOnFraming to false (make sure the result is still OK)\n const frame =\n dataModel.list?.explicitEmbedOnFraming !== false\n ? {\n '@context': jsonContext,\n '@type': dataModel.types,\n '@embed': '@never',\n ...getEmbedFrame(blankNodes)\n }\n : {\n '@context': jsonContext,\n '@type': dataModel.types\n };\n\n // omitGraph option force results to be in a @graph, even if we have a single result\n return jsonld.frame(json, frame, { omitGraph: false });\n })\n .then(compactJson => {\n if (compactJson['@id']) {\n const { '@context': context, ...rest } = compactJson;\n compactJson = {\n '@context': context,\n '@graph': [rest]\n };\n }\n resolve(compactJson['@graph'] || []);\n })\n .catch(e => reject(e));\n })\n );\n\n // Run simultaneous SPARQL queries\n let results = await Promise.all(sparqlQueryPromises);\n\n if (results.length === 0) {\n return { data: [], total: 0 };\n } else {\n // Merge all results in one array\n results = [].concat(...results);\n\n // Add id in addition to @id, as this is what React-Admin expects\n let returnData = results.map(item => {\n item.id = item.id || item['@id'];\n return item;\n });\n\n // TODO sort and paginate the results in the SPARQL query to improve performances\n if (params.sort) {\n returnData = returnData.sort((a, b) => {\n if (a[params.sort.field] !== undefined && b[params.sort.field] !== undefined) {\n if (params.sort.order === 'ASC') {\n return compare(a[params.sort.field], b[params.sort.field]);\n } else {\n return compare(b[params.sort.field], a[params.sort.field]);\n }\n } else {\n return 0;\n }\n });\n }\n if (params.pagination) {\n returnData = returnData.slice(\n (params.pagination.page - 1) * params.pagination.perPage,\n params.pagination.page * params.pagination.perPage\n );\n }\n\n return { data: returnData, total: results.length };\n }\n};\n\nexport default fetchSparqlEndpoints;\n","import urlJoin from 'url-join';\n\nconst findContainersWithPaths = (paths, dataServers) => {\n let containers = {};\n Object.keys(paths).forEach(serverKey => {\n if (dataServers[serverKey]) {\n containers[serverKey] = [];\n paths[serverKey].forEach(path => {\n containers[serverKey].push(urlJoin(dataServers[serverKey].baseUrl, path));\n });\n } else {\n throw new Error('No server found with key ' + serverKey);\n }\n });\n return containers;\n};\n\nexport default findContainersWithPaths;\n","import findContainersWithTypes from '../utils/findContainersWithTypes';\nimport fetchContainers from '../utils/fetchContainers';\nimport fetchSparqlEndpoints from '../utils/fetchSparqlEndpoints';\nimport findContainersWithPaths from '../utils/findContainersWithPath';\n\nconst getListMethod = config => async (resourceId, params = {}) => {\n let { dataServers, resources } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) throw new Error(`Resource ${resourceId} is not mapped in resources file`);\n\n let containers;\n if (!params.filter?._servers && dataModel.list?.containers) {\n if (Array.isArray(dataModel.list?.containers))\n throw new Error(\n `The list.containers property of ${resourceId} dataModel must be of type object ({ serverKey: [containerUri] })`\n );\n // If containers are set explicitly, use them\n containers = findContainersWithPaths(dataModel.list.containers, dataServers);\n } else {\n // Otherwise find the container URIs on the given servers (either in the filter or the data model)\n containers = findContainersWithTypes(\n dataModel.types,\n params.filter?._servers || dataModel.list?.servers,\n dataServers\n );\n }\n\n if (dataModel.list?.fetchContainer) {\n return fetchContainers(containers, resourceId, params, config);\n } else {\n return fetchSparqlEndpoints(containers, resourceId, params, config);\n }\n};\n\nexport default getListMethod;\n","import getOne from './getOne';\n\nconst getManyMethod = config => async (resourceId, params) => {\n const { returnFailedResources } = config;\n\n let returnData = await Promise.all(\n params.ids.map(id =>\n getOne(config)(resourceId, { id: typeof id === 'object' ? id['@id'] : id })\n .then(({ data }) => data)\n .catch(() => {\n // Catch if one resource fails to load\n // Otherwise no references will be show if only one is missing\n // See https://github.com/marmelab/react-admin/issues/5190\n if (returnFailedResources) {\n return { id, _error: true };\n } else {\n // Returning nothing\n }\n })\n )\n );\n\n // We don't want undefined results to appear in the results as it will break with react-admin\n returnData = returnData.filter(e => e);\n\n return { data: returnData };\n};\n\nexport default getManyMethod;\n","import getList from './getList';\n\nconst getManyReferenceMethod = config => async (resourceId, params) => {\n params.filter = { ...params.filter, [params.target]: params.id };\n delete params.target;\n return await getList(config)(resourceId, params);\n};\n\nexport default getManyReferenceMethod;\n","import uploadAllFiles from '../utils/uploadAllFiles';\nimport getServerKeyFromUri from '../utils/getServerKeyFromUri';\n\nconst updateMethod = config => async (resourceId, params) => {\n const { dataServers, httpClient, jsonContext } = config;\n const serverKey = getServerKeyFromUri(params.id, dataServers);\n\n // Upload files, if there are any\n params.data = await uploadAllFiles(params.data, config);\n\n await httpClient(params.id, {\n method: 'PUT',\n body: JSON.stringify({\n '@context': jsonContext,\n ...params.data\n }),\n noToken: !serverKey || dataServers[serverKey].authServer !== true\n });\n\n return { data: params.data };\n};\n\nexport default updateMethod;\n","function e(e){this.message=e}e.prototype=new Error,e.prototype.name=\"InvalidCharacterError\";var r=\"undefined\"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,\"\");if(t.length%4==1)throw new e(\"'atob' failed: The string to be decoded is not correctly encoded.\");for(var n,o,a=0,i=0,c=\"\";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(o);return c};function t(e){var t=e.replace(/-/g,\"+\").replace(/_/g,\"/\");switch(t.length%4){case 0:break;case 2:t+=\"==\";break;case 3:t+=\"=\";break;default:throw\"Illegal base64url string!\"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t=\"0\"+t),\"%\"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if(\"string\"!=typeof e)throw new n(\"Invalid token specified\");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(\".\")[o]))}catch(e){throw new n(\"Invalid token specified: \"+e.message)}}n.prototype=new Error,n.prototype.name=\"InvalidTokenError\";export default o;export{n as InvalidTokenError};\n//# sourceMappingURL=jwt-decode.esm.js.map\n","import jwtDecode from 'jwt-decode';\nimport getServerKeyFromType from './getServerKeyFromType';\nimport urlJoin from 'url-join';\n\nconst fetchUserConfig = async config => {\n const { dataServers, httpClient } = config;\n const token = localStorage.getItem('token');\n const podKey = getServerKeyFromType('pod', dataServers);\n const authServerKey = getServerKeyFromType('authServer', dataServers);\n\n // If the user is logged in\n if (token) {\n const { webId } = jwtDecode(token);\n let userData;\n\n try {\n const { json } = await httpClient(webId);\n userData = json;\n } catch (e) {\n console.error(e);\n // If the webId cannot be fetched, assume an invalid token and disconnect the user\n localStorage.removeItem('token');\n window.location.reload();\n return;\n }\n\n // If we have a POD server\n if (podKey) {\n // Fill the config provided to the data provider\n // We must modify the config object directly\n config.dataServers[podKey].name = 'My Pod';\n config.dataServers[podKey].baseUrl = urlJoin(webId, 'data'); // TODO find POD URI from user profile\n config.dataServers[podKey].sparqlEndpoint =\n userData.endpoints?.['void:sparqlEndpoint'] || urlJoin(webId, 'sparql');\n }\n\n if (authServerKey) {\n // Fill the config provided to the data provider\n // We must modify the config object directly\n config.dataServers[authServerKey].proxyUrl = userData.endpoints?.proxyUrl;\n }\n } else {\n if (podKey) {\n // If the user is not logged in, ignore the POD server\n delete config.dataServers[podKey];\n }\n }\n};\n\nexport default fetchUserConfig;\n","const defaultToArray = value => (!value ? undefined : Array.isArray(value) ? value : [value]);\n\nconst fetchVoidEndpoints = async config => {\n const fetchPromises = Object.entries(config.dataServers)\n .filter(([key, server]) => server.pod !== true)\n .map(([key, server]) =>\n config\n .httpClient(new URL('/.well-known/void', server.baseUrl), { noToken: !server.authServer })\n .then(result => ({ key, datasets: result.json['@graph'] }))\n .catch(e => {\n if (e.status === 404 || e.status === 401) {\n return { key, error: e };\n } else {\n throw e;\n }\n })\n );\n\n let results = [];\n\n try {\n results = await Promise.all(fetchPromises);\n } catch (e) {\n // Do not throw error if no endpoint found\n }\n\n for (let result of results) {\n // Ignore unfetchable endpoints\n if (result.datasets) {\n config.dataServers[result.key].containers = config.dataServers[result.key].containers || {};\n config.dataServers[result.key].blankNodes = config.dataServers[result.key].blankNodes || {};\n\n for (let dataset of result.datasets) {\n const datasetServerKey = Object.keys(config.dataServers).find(\n key => dataset['void:uriSpace'] === config.dataServers[key].baseUrl\n );\n\n // If the dataset is not part of a server mapped in the dataServers, ignore it\n if (datasetServerKey) {\n // If this is the local dataset, add the base information\n if (datasetServerKey === result.key) {\n config.dataServers[result.key].name = config.dataServers[result.key].name || dataset['dc:title'];\n config.dataServers[result.key].description =\n config.dataServers[result.key].description || dataset['dc:description'];\n config.dataServers[result.key].sparqlEndpoint =\n config.dataServers[result.key].sparqlEndpoint || dataset['void:sparqlEndpoint'];\n }\n\n config.dataServers[result.key].containers[datasetServerKey] =\n config.dataServers[result.key].containers[datasetServerKey] || {};\n\n for (let partition of defaultToArray(dataset['void:classPartition'])) {\n for (let type of defaultToArray(partition['void:class'])) {\n // Set containers by type\n const path = partition['void:uriSpace'].replace(dataset['void:uriSpace'], '/');\n if (config.dataServers[result.key].containers[datasetServerKey][type]) {\n config.dataServers[result.key].containers[datasetServerKey][type].push(path);\n } else {\n config.dataServers[result.key].containers[datasetServerKey][type] = [path];\n }\n\n // Set blank nodes by containers\n const blankNodes = defaultToArray(partition['semapps:blankNodes']);\n if (blankNodes) {\n config.dataServers[result.key].blankNodes[partition['void:uriSpace']] = defaultToArray(\n partition['semapps:blankNodes']\n );\n }\n }\n }\n }\n }\n }\n }\n};\n\nexport default fetchVoidEndpoints;\n","import { useCallback, useMemo, useContext } from 'react';\nimport { DataProviderContext } from 'react-admin';\n\nconst compute = (externalLinks, record) =>\n typeof externalLinks === 'function' ? externalLinks(record) : externalLinks;\nconst isURL = url => typeof url === 'string' && url.startsWith('http');\n\nconst useGetExternalLink = componentExternalLinks => {\n // Since the externalLinks config is defined only locally, we don't need to wait for VOID endpoints fetching\n const dataProvider = useContext(DataProviderContext);\n const dataServers = dataProvider.getLocalDataServers();\n\n const serversExternalLinks = useMemo(() => {\n if (dataServers) {\n return Object.fromEntries(\n Object.values(dataServers).map(server => {\n // If externalLinks is not defined in the data server, use external links for non-default servers\n const externalLinks = server.externalLinks !== undefined ? server.externalLinks : !server.default;\n return [server.baseUrl, externalLinks];\n })\n );\n }\n }, [dataServers]);\n\n return useCallback(\n record => {\n const computedComponentExternalLinks = compute(componentExternalLinks, record);\n // If the component explicitly asks not to display as external links, use an internal link\n if (computedComponentExternalLinks === false) return false;\n\n if (!record?.id) return false;\n\n const serverBaseUrl = Object.keys(serversExternalLinks).find(baseUrl => record?.id.startsWith(baseUrl));\n // If no matching data servers could be found, assume we have an internal link\n if (!serverBaseUrl) return false;\n\n const computedServerExternalLinks = compute(serversExternalLinks[serverBaseUrl], record);\n // If the data server explicitly asks not to display as external links, use an internal link\n if (computedServerExternalLinks === false) return false;\n\n if (isURL(computedComponentExternalLinks)) {\n return computedComponentExternalLinks;\n } else if (isURL(computedServerExternalLinks)) {\n return computedServerExternalLinks;\n } else {\n return record.id;\n }\n },\n [serversExternalLinks, componentExternalLinks]\n );\n};\n\nexport default useGetExternalLink;\n","import { useContext, useState, useEffect } from 'react';\nimport { DataProviderContext } from 'react-admin';\n\nconst useDataModel = resourceId => {\n // Get the raw data provider, since useDataProvider returns a wrapper\n const dataProvider = useContext(DataProviderContext);\n const [dataModel, setDataModel] = useState();\n\n useEffect(() => {\n dataProvider.getDataModels().then(results => setDataModel(results[resourceId]));\n }, [dataProvider, resourceId, setDataModel]);\n\n return dataModel;\n};\n\nexport default useDataModel;\n","import { useContext, useState, useEffect } from 'react';\nimport { DataProviderContext } from 'react-admin';\n\nconst useDataServers = () => {\n // Get the raw data provider, since useDataProvider returns a wrapper\n const dataProvider = useContext(DataProviderContext);\n const [dataServers, setDataServers] = useState();\n\n useEffect(() => {\n dataProvider.getDataServers().then(results => setDataServers(results));\n }, [dataProvider, setDataServers]);\n\n return dataServers;\n};\n\nexport default useDataServers;\n","import urlJoin from 'url-join';\n\nconst findCreateContainerWithTypes = (types, createServerKey, dataServers) => {\n let containers = [];\n\n if (Object.keys(dataServers[createServerKey].containers[createServerKey]).length > 0) {\n Object.keys(dataServers[createServerKey].containers[createServerKey]).forEach(type => {\n if (types.includes(type)) {\n dataServers[createServerKey].containers[createServerKey][type].map(path => {\n const containerUri = urlJoin(dataServers[createServerKey].baseUrl, path);\n if (!containers.includes(containerUri)) {\n containers.push(containerUri);\n }\n });\n }\n });\n }\n\n if (containers.length === 0) {\n throw new Error(\n `No container found matching with types ${JSON.stringify(\n types\n )}. You can set explicitely the create.container property of the resource.`\n );\n } else if (containers.length > 1) {\n throw new Error(\n `More than one container found matching with types ${JSON.stringify(\n types\n )}. You must set the create.server or create.container property for the resource.`\n );\n }\n\n return containers[0];\n};\n\nexport default findCreateContainerWithTypes;\n","import React, { useState, useEffect } from 'react';\n\n/**\n * @example\n * \n * \n * \n * \n * \n * \n */\n\nconst FilterHandler = ({ children, record, filter, source, ...otherProps }) => {\n const [filtered, setFiltered] = useState();\n useEffect(() => {\n if (record && source && Array.isArray(record?.[source])) {\n const filteredData = record?.[source].filter(r => {\n let eq = true;\n for (const key in filter) {\n const value = r[key];\n if (Array.isArray(value)) {\n if (!value.includes(filter[key])) {\n eq = false;\n }\n } else {\n if (value !== filter[key]) {\n eq = false;\n }\n }\n }\n return eq;\n });\n let newRecord = {\n ...record\n };\n //undefined setted if no data to obtain no render in RightLabel or equivalent\n newRecord[source] = filteredData.length > 0 ? filteredData : undefined;\n setFiltered(newRecord);\n }\n }, [record, source, filter]);\n\n return (\n <>\n {React.Children.map(children, (child, i) => {\n return React.cloneElement(child, {\n ...otherProps,\n record: filtered,\n addLabel: true,\n source\n });\n })}\n \n );\n};\nexport default FilterHandler;\n","import React, { useEffect, useState } from 'react';\nimport { ArrayInput, SimpleFormIterator, TextInput } from 'react-admin';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useReferenceInputStyles = makeStyles({\n form: {\n display: 'flex'\n },\n input: {\n paddingRight: '20px'\n }\n});\n\nconst useHideInputStyles = makeStyles({\n root: {\n display: 'none'\n }\n});\n\nconst ReificationArrayInput = props => {\n const { reificationClass, children, ...otherProps } = props;\n const flexFormClasses = useReferenceInputStyles();\n const hideInputStyles = useHideInputStyles();\n\n return (\n \n \n {React.Children.map(props.children, (child, i) => {\n return React.cloneElement(child, {\n className: flexFormClasses.input\n });\n })}\n \n \n \n );\n};\n\nexport default ReificationArrayInput;\n","import React from 'react';\nimport { useQueryWithStore } from 'react-admin';\nimport { default as FilterHandler } from './FilterHandler';\n\n/*\n * @example Label used in examples\n * const Label = ({label, ...otherProps})=>{\n * return

{label}

\n * }\n *\n * @example show header for each group with group property thanks to groupHeader\n * }\n * filterProperty=\"property of source filtered by groupReference\"\n * addLabel={false}\n * >\n * // same props as GroupedArrayField source\n * \n * \n * \n * \n *\n * @example call chhildren with label thanks to groupLabel\n * \n *