@kbss-cvut/s-forms 0.9.1 → 0.9.2-beta-bfb894d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/media/MediaAssetViewer.d.ts +2 -1
- package/dist/components/media/icons/fullscreenIcon.d.ts +2 -0
- package/dist/s-forms.cjs +1 -1
- package/dist/s-forms.cjs.map +1 -1
- package/dist/s-forms.css +1 -1
- package/dist/s-forms.css.map +1 -1
- package/dist/s-forms.js +1 -1
- package/dist/s-forms.js.map +1 -1
- package/dist/s-forms.modern.js +1 -1
- package/dist/s-forms.modern.js.map +1 -1
- package/dist/s-forms.umd.js +1 -1
- package/dist/s-forms.umd.js.map +1 -1
- package/dist/util/MediaAssetViewerUtils.d.ts +58 -0
- package/package.json +1 -1
- package/dist/components/answer/OptimizedMenuList.d.ts +0 -5
- package/dist/components/answer/SelectAnswer.d.ts +0 -29
- package/dist/components/answer/TypeaheadAnswer.d.ts +0 -14
- package/dist/stories/TypeaheadAnswer.stories.d.ts +0 -3
package/dist/s-forms.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useMemo as t,useState as n,useEffect as o,useContext as r,useRef as i,useCallback as a,forwardRef as s,useImperativeHandle as l}from"react";import*as u from"jsonld-utils";import{IntlProvider as c,useIntl as d}from"react-intl";import"core-js/modules/es.array.some.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/web.dom-collections.for-each.js";import*as m from"jsonld";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.array.is-array.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.string.repeat.js";import p from"@kbss-cvut/tsort";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import{Form as f,FormGroup as h,FormControl as v,Alert as E,Accordion as A,Card as g,Button as S,OverlayTrigger as _,Tooltip as T,Col as N,Row as O,Badge as I,Overlay as C,FormText as b,Popover as y,ListGroup as R,ListGroupItem as L,ButtonToolbar as w,Nav as H,NavItem as D,NavLink as V,Modal as M}from"react-bootstrap";import"core-js/modules/es.object.assign.js";import j from"prop-types";import"core-js/modules/es.number.constructor.js";import"core-js/modules/es.number.max-safe-integer.js";import U from"react-dom";import"core-js/modules/es.date.to-string.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.every.js";import"core-js/modules/es.array.find-index.js";import P from"react-datepicker";import{parse as x,format as q}from"date-fns";import k from"classnames";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.object.get-own-property-names.js";import F from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import"core-js/modules/web.timers.js";import z from"inputmask-core";import"core-js/modules/es.string.trim.js";import{IntelligentTreeSelect as Q}from"intelligent-tree-select/lib/components/IntelligentTreeSelect";import B from"intelligent-tree-select/lib/components/Option";import"intelligent-tree-select/lib/styles.css";import"core-js/modules/es.array.splice.js";import"core-js/modules/es.date.now.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import W from"javascript-time-ago";import Y from"javascript-time-ago/locale/en";import X from"javascript-time-ago/locale/cs";import{motion as G}from"framer-motion";import{Rings as K}from"react-loader-spinner";import"core-js/modules/es.parse-int.js";import"core-js/modules/es.number.is-integer.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.parse-float.js";import"core-js/modules/es.string.split.js";import"video.js/dist/video-js.css";import"core-js/modules/es.array.reduce.js";import J from"video.js";import"core-js/modules/es.array.fill.js";import"core-js/modules/es.object.entries.js";function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ee.apply(null,arguments)}function te(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oe(e,t)}function ne(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oe(e,t)}var re,ie=function(){};re=ie,ie.COLUMN_COUNT=12,ie.INPUT_LENGTH_THRESHOLD=50,ie.DATETIME_NUMBER_FORMAT="x",ie.EPOCH_MILLISECONDS="epoch-milliseconds",ie.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",ie.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",ie.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",ie.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",ie.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",ie.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",ie.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",ie.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",ie.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",ie.LAYOUT={FORM:"form",QUESTION_SECTION:"section",WIZARD_STEP:"wizard-step",DATE:"date",TIME:"time",DATETIME:"datetime",TEXT:"text",TEXTAREA:"textarea",CHECKBOX:"checkbox",QUESTION_TYPEAHEAD:"type-ahead",MASKED_INPUT:"masked-input",ANSWERABLE:"answerable",SPARQL:"sparql",TURTLE:"ttl",DISABLED:"disabled",HIDDEN:"hidden",COLLAPSED:"collapsed",EMPHASISED:"emphasised",EMPHASISE_ON_RELEVANT:"emphasise-on-relevant",CATEGORY:["category-1","category-2","category-3","category-4","category-5"]},ie.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",ie.VALUE_TYPE_CODE="code",ie.VALUE_TYPE_TEXT="text",ie.GENERATED_ROW_SIZE=1,ie.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",ie.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",ie.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",ie.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",ie.HELP_DESCRIPTION="http://purl.org/dc/terms/description",ie.SOURCE="http://purl.org/dc/terms/source",ie.XSD={MAX_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxExclusive",MAX_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxInclusive",MIN_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#minExclusive",MIN_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#minInclusive",INT:"http://www.w3.org/2001/XMLSchema#int",INTEGER:"http://www.w3.org/2001/XMLSchema#integer",NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#negativeInteger",NON_NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",NON_POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#positiveInteger",FLOAT:"http://www.w3.org/2001/XMLSchema#float",POSITIVE_FLOAT:"http://www.w3.org/2001/XMLSchema#positiveFloat",NEGATIVE_FLOAT:"http://www.w3.org/2001/XMLSchema#negativeFloat",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},ie.STEP="http://onto.fel.cvut.cz/ontologies/form/step",ie.PATTERN="http://onto.fel.cvut.cz/ontologies/form/pattern",ie.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",ie.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",ie.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",ie.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",ie.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",ie.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",ie.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",ie.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",ie.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",ie.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",ie.HAS_CORRECT_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-correct-answer-value",ie.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",ie.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",ie.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",ie.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",ie.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",ie.USED_ONLY_FOR_COMPLETENESS="http://onto.fel.cvut.cz/ontologies/form/used-only-for-completeness",ie.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",ie.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",ie.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",ie.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",ie.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",ie.ASSET="http://onto.fel.cvut.cz/ontologies/form/media/asset",ie.HAS_SOURCE="http://onto.fel.cvut.cz/ontologies/form/media/has-source",ie.HAS_ANNOTATION="http://onto.fel.cvut.cz/ontologies/form/media/has-annotation",ie.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",ie.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",ie.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",ie.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",ie.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",ie.PREFIX="http://www.w3.org/ns/shacl#prefix",ie.NAMESPACE="http://www.w3.org/ns/shacl#namespace",ie.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",ie.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",ie.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",ie.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",ie.TIME_FORMAT="http://onto.fel.cvut.cz/ontologies/form/time-format",ie.DATE_FORMAT="http://onto.fel.cvut.cz/ontologies/form/date-format",ie.DATETIME_FORMAT="http://onto.fel.cvut.cz/ontologies/form/datetime-format",ie.TIMESTAMP_FORMAT="http://onto.fel.cvut.cz/ontologies/form/timestamp-format",ie.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",ie.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",ie.HAS_VALIDATION_SEVERITY="http://onto.fel.cvut.cz/ontologies/form/has-validation-severity",ie.RDFS_LABEL=u.RDFS_LABEL,ie.RDFS_COMMENT=u.RDFS_COMMENT,ie.DEFAULT_HAS_CHILD=u.DEFAULT_HAS_CHILD,ie.BROADER="http://www.w3.org/2004/02/skos/core#broader",ie.HAS_NON_SELECTABLE_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-non-selectable-value",ie.PROVIDES_DEREFERENCEABLE_ANSWER_VALUES="http://onto.fel.cvut.cz/ontologies/form/provides-dereferenceable-answer-values",ie.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink",QUESTION_HINT:"questionHint"},ie.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},ie.DEFAULT_OPTIONS={icons:[{id:re.ICONS.QUESTION_HELP,behavior:re.ICON_BEHAVIOR.ENABLE},{id:re.ICONS.QUESTION_COMMENTS,behavior:re.ICON_BEHAVIOR.ON_HOVER},{id:re.ICONS.QUESTION_LINK,behavior:re.ICON_BEHAVIOR.ON_HOVER},{id:re.ICONS.QUESTION_HINT,behavior:re.ICON_BEHAVIOR.DISABLE}],enableOptionQuestionFeedback:!1},ie.ANNOTATION={HAS_ANNOTATION_TYPE:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-annotation-type",HAS_START_TIME:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-start-time",HAS_END_TIME:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-end-time",HAS_GEOMETRY_POINTS:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-geometry-points",HAS_OPACITY:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-opacity",HAS_COLOR:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-color"},ie.POLYLINE_ANNOTATION={IMPLICIT_TYPE_LABEL:"polyline",HAS_STROKE_WIDTH:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-stroke-width",HAS_FILL_COLOR:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-fill-color",DEFAULT_POLYLINE_ANNOTATION_STYLE:{color:"red",strokeWidth:2e-6,fillColor:"transparent",opacity:1}},ie.TEXT_ANNOTATION={IMPLICIT_TYPE_LABEL:"text",HAS_FONT_SIZE:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-font-size",HAS_FONT_WEIGHT:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-font-weight",HAS_TEXT:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-text",DEFAULT_TEXT_ANNOTATION_STYLE:{text:"Hello world",color:"red",fontSizeInNormalizedPx:.05,fontWeight:"300",fontFamily:"sans-serif",fontColor:"red",opacity:1}},ie.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}},ie.VALIDATION={SEVERITY:{ERROR:"error",WARNING:"warning"},DEFAULT_MESSAGE:{REQUIRED:"This field is required.",REQUIRED_ONLY_FOR_COMPLETENESS:"This field is required to complete the form.",INVALID:"This field is invalid.",CHECK:"This field must be checked.",LOWER_OR_EQUAL:"This field should be a number equal or lower to ",GREATER_OR_EQUAL:"This field must be greater or equal to "},CLASSNAME:{ERROR:"is-invalid",WARNING:"is-warning"}};var ae={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)","wizard.nav.tooltip":"Navigace na této kartě je zakázána, aby nedošlo k přehlédnutí důležitých otázek. K navigaci na tuto kartu použijte tlačítka související s formulářem.","wizard.next":"Další","wizard.previous":"Předchozí","section.expand":"Rozbalit","section.collapse":"Sbalit","validation.required":"Toto pole je povinné.","validation.required_only_for_completeness":"Toto pole je povinné pro vyplnění formuláře.","validation.invalid":"Toto pole je neplatné.","validation.check":"Toto pole musí být zkontrolováno.","validation.lower_or_equal":"Toto pole by mělo být číslo rovné nebo nižší než ","validation.greater_or_equal":"Toto pole musí být větší nebo rovno ","error.default_message":"Něco se pokazilo.","error.view_details":"Zobrazit podrobnosti o chybě","comment.unknownAuthor":"Neznámý autor"},se={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)","wizard.nav.tooltip":"Navigation to this tab is disabled to prevent overlooking important questions. Use form-related buttons to navigate to this tab instead.","wizard.next":"Next","wizard.previous":"Previous","section.expand":"Expand","section.collapse":"Collapse","validation.required":"This field is required.","validation.required_only_for_completeness":"This field is required to complete the form.","validation.invalid":"This field is invalid.","validation.check":"This field must be checked.","validation.lower_or_equal":"This field should be a number equal or lower to ","validation.greater_or_equal":"This field must be greater or equal to ","error.default_message":"Something went wrong.","error.view_details":"View Error Details","comment.unknownAuthor":"Unknown Author"},le=/*#__PURE__*/e.createContext({}),ue=function(t){var n=t.locale,o=void 0===n?navigator.language:n,r=se;return o===ie.LANG.cs.locale&&(r=ae),/*#__PURE__*/e.createElement(le.Provider,{value:{locale:o,lang:r}},/*#__PURE__*/e.createElement(c,{locale:o,messages:r},t.children))},ce={"@graph":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":"form","http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["wizard-step","section"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["textarea"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_answer":{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/answer","http://onto.fel.cvut.cz/ontologies/documentation/has_data_value":""}}]}]}]},de=/*#__PURE__*/function(){function e(){}return e.generateForm=function(){return JSON.parse(JSON.stringify(ce))},e}(),me=/*#__PURE__*/function(){function e(){}return e.getStringHash=function(e){var t=0,n=e?e.length:0;if(0===n)return t;for(var o=0;o<n;o++)t=(t<<5)-t+e.charCodeAt(o),t&=t;return t},e.asArray=function(e){return e?e.constructor===Array?e:[e]:[]},e.findQuestionById=function(t,n,o,r,i){if(o&&n["@id"]===t)return n;var a=e.asArray(n[ie.HAS_SUBQUESTION]);if(r)for(var s,l=$(a);!(s=l()).done;){var u=e.findQuestionById(t,s.value,!0,!1,!1);if(u)return u}if(i)for(var c,d=$(a);!(c=d()).done;){var m=e.findQuestionById(t,c.value,!1,!0,!0);if(m)return m}return null},e.findKeyInObjects=function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n].hasOwnProperty(t[o]))return t[o];return null},e.isOptionQuestionFeedbackEnabled=function(e){var t;return null!=(t=null==e?void 0:e.enableOptionQuestionFeedback)&&t},e}(),pe=/*#__PURE__*/function(){function e(){}return e.putObject=function(t,n){e.objectMap[t]=n},e.getObject=function(t){return e.objectMap[t]},e}();pe.objectMap={};var fe,he,ve=/*#__PURE__*/function(){function e(){}return e.getFirstObject=function(e,t){var n=m.getValues(e,t);return 0===n.length?null:n[0]},e.compareValues=function(e,t){return t="object"==typeof t?t:{"@value":t},!!((e="object"==typeof e?e:{"@value":e})&&e["@value"]&&t&&t["@value"]&&("string"==typeof e["@value"]?e["@value"]:JSON.stringify(e["@value"]))===("string"==typeof t["@value"]?t["@value"]:JSON.stringify(t["@value"])))||m.compareValues(e,t)},e.toplogicalSort=function(e,t){var n;do{n=!1;for(var o=0;o<e.length;o++)for(var r=o;r<e.length;r++)if(e[o][t]&&("object"==typeof e[o][t]?e[o][t]["@id"]:e[o][t])===e[r]["@id"]){var i=e[o];e[o]=e[r],e[r]=i,n=!0;break}}while(n);return e},e.orderPreservingToplogicalSort=function(e,t){for(var n=p(),o={},r=function(){var r=e[i]["@id"];n.add(r),o[r]=e[i],me.asArray(e[i][t]).map(function(e){return"object"==typeof e?e["@id"]:e}).map(function(e){return[e,r]}).forEach(function(e){return n.add(e)})},i=0;i<e.length;i++)r();for(var a=n.sort(),s=0;s<a.length;s++)e[s]=o[a[s]];return e},e.getCompareLocalizedLabelFunction=function(e){return function(t,n){var o=u.getLocalized(t[u.RDFS_LABEL],e),r=u.getLocalized(n[u.RDFS_LABEL],e);return o<r?-1:o>r?1:0}},e.orderByLocalizedLabels=function(t,n){return t.sort(e.getCompareLocalizedLabelFunction(n))},e.checkId=function(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(function(e){return e["@id"]===t}):e.constructor===Object?e["@id"]===t:void 0},e}(),Ee=/*#__PURE__*/function(){function e(){}return e.isForm=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.FORM)},e.isWizardStep=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.WIZARD_STEP)},e.isSection=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.QUESTION_SECTION)},e.isAnswerable=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.ANSWERABLE)},e.isTypeahead=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.QUESTION_TYPEAHEAD)},e.getPossibleValuesQuery=function(e){return u.getJsonAttValue(e,ie.HAS_OPTIONS_QUERY)},e.isDisabled=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DISABLED)},e.isHidden=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.HIDDEN)},e.isTextarea=function(t,n){return n&&n.length>ie.INPUT_LENGTH_THRESHOLD&&!e.isTypeahead(t)||u.hasValue(t,ie.LAYOUT_CLASS,ie.LAYOUT.TEXTAREA)},e.isText=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TEXT)},e.isCalendar=function(t){return e.isDate(t)||e.isTime(t)||e.isDateTime(t)},e.isDate=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DATE)},e.isTime=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TIME)},e.isDateTime=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DATETIME)},e.isTimestamp=function(e){return u.hasValue(e,ie.TIMESTAMP_FORMAT,ie.EPOCH_MILLISECONDS)},e.isCheckbox=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.CHECKBOX)},e.isMaskedInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.MASKED_INPUT)},e.isSparqlInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.SPARQL)},e.isTurtleInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TURTLE)},e.isCollapsed=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.COLLAPSED)},e.isEmphasised=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.EMPHASISED)},e.getCategory=function(e){return ie.LAYOUT.CATEGORY.find(function(t){return u.hasValue(e,ie.LAYOUT_CLASS,t)})},e.resolveValue=function(e){return e?e[ie.HAS_OBJECT_VALUE]?e[ie.HAS_OBJECT_VALUE]["@id"]:u.getJsonAttValue(e,ie.HAS_DATA_VALUE):null},e.resolveValueObject=function(e){return e?e[ie.HAS_OBJECT_VALUE]?me.asArray(e[ie.HAS_OBJECT_VALUE])[0]:e[ie.HAS_DATA_VALUE]?me.asArray(e[ie.HAS_DATA_VALUE])[0]:null:null},e.isRelevant=function(t){if(!t[ie.IS_RELEVANT_IF])return!0;for(var n,o=$(me.asArray(t[ie.IS_RELEVANT_IF]));!(n=o()).done;)if(!e.testCondition(n.value))return!1;return!0},e.hasValidationLogic=function(e){return!!(e[ie.REQUIRES_ANSWER]||e[ie.REQUIRES_ANSWER_IF]||e[ie.PATTERN]||this.containsXSDProperty(e))},e.isValid=function(e){if(!1===e[ie.HAS_VALID_ANSWER])return!1;for(var t,n=$(me.asArray(e[ie.HAS_SUBQUESTION]));!(t=n()).done;)if(!1===this.isValid(t.value))return!1;return!0},e.testOrCondition=function(e){var t=e[ie.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(var n,o=$(this._getMappedObjectsArray(t));!(n=o()).done;)if(this.testCondition(n.value))return!0;return!1},e.testCondition=function(t){var n,o=t[ie.ACCEPTS_VALIDATION_VALUE],r=t[ie.ACCEPTS_ANSWER_VALUE],i=t[ie.ACCEPTS],a=t[ie.HAS_TESTED_QUESTION];if(t[ie.HAS_SUB_CONDITION])return this.testOrCondition(t);if(o&&r&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),i&&a){var s=me.asArray(i);if(1!==s.length&&console.warn("Support for multiple accepts values is not implemented !"),s[0]["@id"]===ie.ANSWERED_QUESTION){(r||o)&&console.warn("Support for accepted answer/validations values is not implemented !");for(var l,u=$(this._getMappedObjectsArray(a));!(l=u()).done;)if(!this.hasAnswer(l.value))return!1;return!0}console.warn("No support to accept question of type "+s[0]["@id"]+" !")}if(o&&a){var c=me.asArray(o);(1!==c.length||!0!==c[0]&&"true"!==c[0])&&console.warn('Validation values other than "true" are not implemented !');for(var d,p=$(me.asArray(a));!(d=p()).done;){if(void 0===(n=pe.getObject(d.value["@id"])))return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(n))return!1}return!0}if(r&&a){n=pe.getObject(a["@id"]);for(var f,h=$(me.asArray(r));!(f=h()).done;){var v=f.value;if(!n)return console.warn("Question is not defined."),!0;if(!n.hasOwnProperty(ie.HAS_ANSWER))return!1;var E=m.getValues(n,ie.HAS_ANSWER);if(0===E.length)return!1;var A=e.resolveValueObject(E[0]);if(A&&v&&A.hasOwnProperty("@value")&&v.hasOwnProperty("@id")&&A["@value"]==v["@id"])return!0;if(ve.compareValues(A,v))return!0}}return!1},e._getMappedObjectsArray=function(e,t){return me.asArray(e).map(function(e){var n=pe.getObject(e["@id"]);return void 0===n?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):n}).filter(function(e){return null!==e})},e.hasAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(ie.HAS_ANSWER)){var n=m.getValues(t,ie.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return!0}}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasAnswer(r.value))return!0;return!1},e.hasCorrectAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(ie.HAS_CORRECT_ANSWER)){var n=m.getValues(t,ie.HAS_CORRECT_ANSWER);if(Array.isArray(n)&&0!==n.length){var o=e.resolveValueObject(n=n[0]);if(o&&(o["@value"]||o["@id"]))return!0}return!(!n["@value"]&&!n["@id"])}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasCorrectAnswer(r.value))return!0;return!1},e.getAnswerValue=function(t){if(!t)return null;if(t.hasOwnProperty(ie.HAS_ANSWER)){var n=m.getValues(t,ie.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return o["@value"]||o["@id"]}}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;){var a=e.getAnswerValue(r.value);if(a)return a}return null},e.getCorrectAnswerValue=function(t){if(!t)return null;if(t.hasOwnProperty(ie.HAS_CORRECT_ANSWER)){var n,o,r=m.getValues(t,ie.HAS_CORRECT_ANSWER);if(!r)return null;Array.isArray(r)&&(r=r[0]);var i=m.getValues(r,ie.HAS_DATA_VALUE)||m.getValues(r,ie.HAS_OBJECT_VALUE);if(i&&(!Array.isArray(i)||i.length>0)){var a;Array.isArray(i)&&(i=i[0]);var s,l=i[ie.RDFS_LABEL];return l?null!=(s=l["@value"])?s:l:null!=(a=i["@value"])?a:null}return null!=(n=null!=(o=r["@value"])?o:r[ie.RDFS_LABEL])?n:null}for(var u,c=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(u=c()).done;){var d=e.getCorrectAnswerValue(u.value);if(d)return d}return null},e.resolveDateTimeFormat=function(t,n,o){var r=e.isDate(t),i=e.isTime(t),a=e.isDateTime(t);switch(!0){case r:return t[ie.DATE_FORMAT]||o.dateFormat;case i:return t[ie.TIME_FORMAT]||o.timeFormat;case a:return t[ie.DATETIME_FORMAT]||o.dateTimeFormat;default:return null}},e.dfsTraverseQuestionTree=function(e,t,n){function o(e){t(e),me.asArray(e[ie.HAS_SUBQUESTION]).forEach(function(e){o(e)}),n(e)}void 0===n&&(n=function(){}),e.forEach(function(e){o(e)})},e.getFormSpecification=function(t){var n=-1,o="..",r="";return e.dfsTraverseQuestionTree(t,function(e){var t=" ".repeat(n+=1),i="";e[ie.REQUIRES_ANSWER]&&!e[ie.USED_ONLY_FOR_COMPLETENESS]?i=t+o+"required: "+e[ie.REQUIRES_ANSWER]+"\n":e[ie.USED_ONLY_FOR_COMPLETENESS]&&(i=t+o+"required only for completeness: "+e[ie.USED_ONLY_FOR_COMPLETENESS]+"\n"),r+=t+e["http://www.w3.org/2000/01/rdf-schema#label"]+"\n",r+=e[ie.HELP_DESCRIPTION]?t+o+"description: "+e[ie.HELP_DESCRIPTION]+"\n":"",r+=i,r+=e[ie.PATTERN]?t+o+"pattern: "+e[ie.PATTERN]+"\n":"",r+=e[ie.INPUT_MASK]?t+o+"mask: "+e[ie.INPUT_MASK]+"\n":"",r+=e[ie.XSD.MAX_INCLUSIVE]?t+o+"This field should be a number equal or lower to "+e[ie.XSD.MAX_INCLUSIVE]+"\n":"",r+=e[ie.XSD.MIN_INCLUSIVE]?t+o+"This field must be greater or equal to "+e[ie.XSD.MIN_INCLUSIVE]+"\n":"",r+=e[ie.HAS_VALIDATION_MESSAGE]?t+o+"validation-message: "+e[ie.HAS_VALIDATION_MESSAGE]+"\n":"",r+="\n"},function(){n-=1}),r},e.containsXSDProperty=function(e){for(var t=Object.keys(e),n=0,o=Object.values(ie.XSD);n<o.length;n++)if(t.includes(o[n]))return!0;return!1},e.getInputMask=function(e){if(e[ie.INPUT_MASK])return e[ie.INPUT_MASK]},e.hasMediaContentWithAnnotations=function(e){if(e[ie.HAS_MEDIA_CONTENT])for(var t,n=$(me.asArray(e[ie.HAS_MEDIA_CONTENT]));!(t=n()).done;){var o=t.value;if(o[ie.HAS_ANNOTATION]&&me.asArray(o[ie.HAS_ANNOTATION]).length>0)return!0}return!1},e.containsHints=function(t){if(t[ie.HAS_SUBQUESTION])for(var n,o=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(n=o()).done;)if(e.containsHints(n.value))return!0;return this.hasCorrectAnswer(t)||this.hasMediaContentWithAnnotations(t)},e}(),Ae=/*#__PURE__*/function(){function e(){}return e.log=function(e){console.log(e)},e.warn=function(e){console.warn?console.warn(e):console.log("WARNING: "+e)},e.error=function(e){console.error?console.error(e):console.log("ERROR: "+e)},e}(),ge={root:(fe={},fe[ie.HAS_LAYOUT_CLASS]=ie.FORM,fe),expandProperties:[ie.HAS_SUBQUESTION,ie.IS_RELEVANT_IF,ie.HAS_ANSWER,ie.HAS_DECLARED_PREFIX,ie.HAS_OPTION,ie.HAS_CORRECT_ANSWER,ie.HAS_COMMENT,ie.HAS_MEDIA_CONTENT,ie.HAS_ANNOTATION]},Se=/*#__PURE__*/function(){function e(){}return e.customFrame=function(e,t,n){if(arguments.length<2)return m.nextTick(function(){n(new TypeError("Could not frame, too few arguments."))});null===t&&(t=ge),m.flatten(e,null,null,function(e,t){})},e.expandStructure=function(e){var t,n={};e["@graph"].forEach(function(e){n[e["@id"]]=e,Ee.isForm(e)&&(t=e)});try{this._expandGraph(t,ge,n)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return n},e._expandGraph=function(e,t,n){var o,r,i,a=this;t.expandProperties.forEach(function(s){if(e.hasOwnProperty(s)){e[s]=me.asArray(e[s]),o=e[s];for(var l=0;l<o.length;l++)i=a._getId(o[l]),void 0!==(r=n[i])?(o[l]=r,a._expandGraph(r,t,n)):console.warn("object with @id "+i+" was not defined in input data.")}})},e._getId=function(e){return"string"==typeof e?e:e&&"object"==typeof e?e["@id"]:void 0},e}();he=Se,Se.compressStructure=function(e){var t=[],n=new Set;return(t=he._compressGraph(e,t,n)).sort(function(e,t){return e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0})},Se._compressGraph=function(e,t,n){return n.has(e["@id"])||(t.push(e),n.add(e["@id"])),ge.expandProperties.forEach(function(o){if(e.hasOwnProperty(o))for(var r=e[o],i=0;i<r.length;i++){var a=r[i];void 0!==a&&(r[i]=a,t=he._compressGraph(a,t,n),e[o][i]={"@id":a["@id"]})}}),t};var _e=/*#__PURE__*/function(){function e(){}return e.constructDefaultForm=function(t){var n=de.generateForm();return e._constructFormQuestions(n,t)},e.constructForm=function(t,n){try{var o,r;return Promise.resolve(m.flatten(t,{}).then(function(t){try{var i=e._constructFormQuestions(t,n);r=i[1],o={formQuestions:i[0]}}catch(e){console.error("Error while constructing form questions from the provided structure:",e)}if(!r){var a=e.constructDefaultForm(n);r=a[1],o={formQuestions:a[0]}}return[o,r]}).catch(function(e){return console.error("Failed to flatten the JSON-LD structure. Expected to transform a nested JSON-LD document into a flattened array of node objects:",e),[o,r]}))}catch(e){return Promise.reject(e)}},e._constructFormQuestions=function(e,t){var n,o,r,i=[];if(void 0!==e["@graph"][0]["@id"]?(r=Se.expandStructure(e),Object.keys(r).map(function(e){pe.putObject(e,r[e])})):console.warn("default form is constructed."),!(o=(n=e["@graph"].find(function(e){return Ee.isForm(e)}))[ie.HAS_SUBQUESTION]))throw Ae.error("Could not find any questions in the received data."),"No questions in the form";return(i=o.filter(function(e){return!(!Ee.isWizardStep(e)||Ee.isHidden(e))||(Ae.warn("Item is not a wizard step: "+e),!1)})).length||(Ae.log("Could not find any wizard steps in the received data. Building form without steps"),n[ie.HAS_SUBQUESTION].forEach(function(e){return i.push(e)})),i.sort(ve.getCompareLocalizedLabelFunction(t)),ve.orderPreservingToplogicalSort(i,ie.HAS_PRECEDING_QUESTION),[i,{root:n}]},e}(),Te=["validation","children","value"],Ne=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={cursorPosition:0},n}te(n,t);var o=n.prototype;return o.focus=function(){U.findDOMNode(this.input).focus()},o.getInputDOMNode=function(){return U.findDOMNode(this.input)},o.componentDidUpdate=function(e,t,n){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()},o.fieldDidExpand=function(e){return"textarea"===this.props.type&&"textarea"!==e.type},o.fieldDidShrink=function(e){return"text"===this.props.type&&"text"!==e.type},o.updateFieldCursorPosition=function(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)},o.saveCursorPosition=function(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})},o.render=function(){switch(this.props.type){case"radio":return this._renderRadio();case"checkbox":return this._renderCheckbox();case"select":return this._renderSelect();case"textarea":return this._renderTextArea();default:return this._renderInput()}},o._renderCheckbox=function(){var t=this;/*#__PURE__*/return e.createElement(f.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),className:"mb-3"},/*#__PURE__*/e.createElement(f.Check,ee({type:"checkbox",ref:function(e){return t.input=e}},this.props,{label:this.props.label,className:this.props.validation.classname})),this.props.validation.message)},o._renderRadio=function(){var t=this;/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Check,ee({type:"radio",ref:function(e){return t.input=e}},this.props,{label:this.props.label,className:this.props.validation.classname})),this.props.validation.message)},o._renderSelect=function(){var t=this,n=this.props,o=n.validation,r=n.children,i=n.value,a=ne(n,Te);/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(v,ee({as:"select",value:i,className:o.classname,ref:function(e){return t.input=e}},a),r),o.message)},o._renderLabel=function(){return this.props.label?/*#__PURE__*/e.createElement(f.Label,null,this.props.label):null},o._renderTextArea=function(){var t=this;/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(v,ee({ref:function(e){return t.input=e},as:"textarea"},this.props,{className:this.props.validation.classname,onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation.message)},o._renderInput=function(){var t=this;/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(v,ee({className:this.props.validation.classname,ref:function(e){return t.input=e},as:"input",placeholder:this.props.placeholder},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation.message)},n}(e.Component);Ne.propTypes={type:j.string,label:j.object,value:j.any,onChange:j.func,help:j.string,validation:j.object,placeholder:j.string},Ne.defaultProps={type:"text"};var Oe=["children"],Ie=/*#__PURE__*/e.createContext({}),Ce={components:{inputComponent:Ne},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableWizardStepSkip:!0,startingStep:0,enableOptionQuestionFeedback:!1}},be=function(n){var o=n.children,r=ne(n,Oe),i=t(function(){return{inputComponent:r.components&&r.components.inputComponent||Ce.components.inputComponent,componentsOptions:Object.assign({},Ce.componentsOptions,r.componentsOptions),options:Object.assign({},Ce.options,r.options),mapComponent:r.mapComponent}},[r]);/*#__PURE__*/return e.createElement(Ie.Provider,{value:i},o)};be.propTypes={children:j.element.isRequired,components:j.object,mapComponent:j.func,options:j.object};var ye=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={hasError:!1,errorLabel:null,errorDetails:null},n}te(n,t),n.getDerivedStateFromError=function(e){return{hasError:!0,error:e}};var o=n.prototype;return o.componentDidCatch=function(e,t){this.setState({errorLabel:e,errorDetails:t})},o.render=function(){if(this.state.hasError){var t=this.context.lang;/*#__PURE__*/return e.createElement("div",{style:{padding:"20px"}},/*#__PURE__*/e.createElement(E,{variant:"danger"},/*#__PURE__*/e.createElement(E.Heading,null,t["error.default_message"]||"Something went wrong."),/*#__PURE__*/e.createElement("p",null,this.state.errorLabel&&this.state.errorLabel.toString())),/*#__PURE__*/e.createElement(A,null,/*#__PURE__*/e.createElement(g,null,/*#__PURE__*/e.createElement(g.Header,null,/*#__PURE__*/e.createElement(A,{as:S,variant:"link",eventKey:"0"},t["error.view_details"]||"View Error Details")),/*#__PURE__*/e.createElement(A.Collapse,{eventKey:"0"},/*#__PURE__*/e.createElement(g.Body,null,/*#__PURE__*/e.createElement("pre",{style:{whiteSpace:"pre-wrap"}},this.state.errorDetails&&this.state.errorDetails.componentStack))))))}return this.props.children},n}(e.Component);ye.contextType=le;var Re=["children"],Le=/*#__PURE__*/e.createContext({}),we=function(n){var o=n.children,r=ne(n,Re),i=[],a=function(e,t){try{var n=i[e];return n&&n.length?Promise.resolve(n):Promise.resolve(r.fetchTypeAheadValues(t)).then(function(t){return t.length?m.frame(t,{},{}).then(function(t){var n,o=t["@graph"];return i.push(Object.assign({},o,((n={})[e]=o,n))),o}):(Ae.warn("No data received when loading options using id "+e),[])})}catch(e){return Promise.reject(e)}},s=function(e){return i[e]||[]},l=t(function(){return{loadFormOptions:a,getOptions:s}},[a,s]);/*#__PURE__*/return e.createElement(Le.Provider,ee({value:l},r),o)};we.propTypes={children:j.element.isRequired,fetchTypeAheadValues:j.func};var He={},De=[],Ve=/*#__PURE__*/e.createContext({}),Me=function(r){var i=n(r.data||He),a=i[0],s=i[1],l=n(r.formQuestions||De),u=l[0],c=l[1];o(function(){if(r.isFormValid){var e=Ee.isValid(a);r.isFormValid(e)}},[]),o(function(){s(r.data||He)},[u]);var d=function(e){e&&s(Object.assign({},a,e))},m=function(e,t){if(!(!t||e<0||e>=u.length)){if("object"==typeof t){var n=[].concat(u);n[e]=Object.assign({},n[e],t),c(n)}if(Array.isArray(t)&&c(t),r.isFormValid){var o=Ee.isValid(a);r.isFormValid(o)}}},p=function(){return a},f=function(e){return null==e?u:u[e]},h=t(function(){return{updateData:d,updateFormQuestionsData:m,getData:p,getFormQuestionsData:f}},[f,p]);/*#__PURE__*/return e.createElement(Ve.Provider,ee({value:h},r),r.children)};Me.propTypes={children:j.element.isRequired,data:j.object.isRequired,formQuestions:j.array.isRequired,isFormValid:j.func};var je=/*#__PURE__*/function(){function e(){}return e.buildQuestionAnswerModel=function(t,n){var o,r={subQuestions:[]};if(t&&(r.uri=t.root["@id"],r.origin=u.getJsonAttValue(t.root,ie.HAS_QUESTION_ORIGIN,"@id")),n)for(var i=0;i<n.length;i++)(o=e.processQuestionAnswerHierarchy(n[i]))&&r.subQuestions.push(o);return r},e.processQuestionAnswerHierarchy=function(t){return t?e._processQuestion(t):null},e._processQuestion=function(t){var n={};if(n.uri=t["@id"],n.origin=u.getJsonAttValue(t,ie.HAS_QUESTION_ORIGIN,"@id"),t[ie.HAS_SUBQUESTION]){n.subQuestions=[];for(var o=0;o<t[ie.HAS_SUBQUESTION].length;o++)n.subQuestions.push(e._processQuestion(t[ie.HAS_SUBQUESTION][o]))}if(t[ie.HAS_ANSWER]){n.answers=[],Array.isArray(t[ie.HAS_ANSWER])||(t[ie.HAS_ANSWER]=[t[ie.HAS_ANSWER]]);for(var r=0;r<t[ie.HAS_ANSWER].length;r++)n.answers.push(e.processAnswer(t[ie.HAS_ANSWER][r]))}if(t[ie.HAS_COMMENT]){n.comments=[],Array.isArray(t[ie.HAS_COMMENT])||(t[ie.HAS_COMMENT]=[t[ie.HAS_COMMENT]]);for(var i=0;i<t[ie.HAS_COMMENT].length;i++)n.comments.push(e.processComment(t[ie.HAS_COMMENT][i]))}return n},e.processComment=function(e){var t={};return t.author=u.getJsonAttValue(e,ie.HAS_AUTHOR,"@id"),t.value=u.getJsonAttValue(e,ie.HAS_COMMENT_VALUE),t.timestamp=u.getJsonAttValue(e,ie.HAS_TIMESTAMP,"@id"),t},e.processAnswer=function(e){var t={};return t.uri=e["@id"],t.origin=u.getJsonAttValue(e,ie.HAS_ANSWER_ORIGIN,"@id"),e[ie.HAS_OBJECT_VALUE]?t.codeValue=u.getJsonAttValue(e,ie.HAS_OBJECT_VALUE,"@id"):t.textValue=u.getJsonAttValue(e,ie.HAS_DATA_VALUE),t},e.generateAnswer=function(e){var t={};return t[ie.HAS_DATA_VALUE]="",t},e}(),Ue=function(t){var n=r(Ie);/*#__PURE__*/return e.createElement(n.inputComponent,{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,validation:t.validation,onChange:function(e){t.onChange(e.target.checked)},disabled:n.componentsOptions.readOnly||Ee.isDisabled(t.question)})};Ue.propTypes={question:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.oneOfType([j.string,j.bool]),onChange:j.func.isRequired,mouseHover:j.bool,validation:j.object};var Pe=function(t){var i=r(Ie).componentsOptions,a=n(null),s=a[0],l=a[1],u=n(""),c=u[0],d=u[1],m=Ee.resolveDateTimeFormat(t.question,t.value,i.dateTimeAnswer),p=Ee.isDate(t.question),v=Ee.isTime(t.question),E=Ee.isTimestamp(t.question);o(function(){var e=A(t.value);e?l(e):(l(null),d("Invalid date value "+t.value+" of question "+t.question["@id"]+"."),console.error(c))},[t.value,m]);var A=function(e){if(!e)return null;var t=E?new Date(e):x(e,m,new Date);return isNaN(t.getTime())?null:t};/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(P,{selected:s,placeholderText:m,onChange:function(e){l(e);var n=e?E?e.getTime():q(e,m):"";t.onChange(n)},showTimeSelect:!p,showTimeSelectOnly:v,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:m,className:k("form-control",t.validation.classname),disabled:i.readOnly||Ee.isDisabled(t.question)}),t.validation.message)};Pe.propTypes={question:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.oneOfType([j.string,j.number]),onChange:j.func.isRequired,validation:j.object};var xe=[ie.XSD.INT,ie.XSD.INTEGER,ie.XSD.NON_NEGATIVE_INTEGER,ie.XSD.NON_POSITIVE_INTEGER,ie.XSD.NEGATIVE_INTEGER,ie.XSD.POSITIVE_INTEGER,ie.XSD.FLOAT,ie.XSD.POSITIVE_FLOAT,ie.XSD.NEGATIVE_FLOAT],qe={};qe[ie.XSD.NON_NEGATIVE_INTEGER]={min:0},qe[ie.XSD.NON_POSITIVE_INTEGER]={max:0},qe[ie.XSD.NEGATIVE_INTEGER]={max:-1},qe[ie.XSD.POSITIVE_INTEGER]={min:1};var ke={"string-2":"prefixed",atom:"var"},Fe=/*#__PURE__*/function(){function e(){}return e._resolveInputType=function(t,n){return Ee.isSparqlInput(t)||Ee.isTurtleInput(t)||Ee.isTextarea(t,n)?"textarea":e._isNumeric(t)?"number":"text"},e._isNumeric=function(e){for(var t=0,n=xe.length;t<n;t++)if(u.hasValue(e,ie.HAS_DATATYPE,xe[t]))return!0;return!1},e.resolveInputProperties=function(t,n,o){var r={};switch(r.type=e._resolveInputType(t,n),r.type){case"textarea":r.rows=5;break;case"number":r=Object.assign({},r,e._resolveNumberRestrictions(t),this._resolveStepRestriction(t))}return r.disabled=o.readOnly||Ee.isDisabled(t),r},e._resolveStepRestriction=function(e){var t={};return void 0!==e[ie.STEP]&&(t.step=u.getJsonAttValue(e,ie.STEP)),t},e._resolveNumberRestrictions=function(e){var t={};return Object.getOwnPropertyNames(qe).forEach(function(n){u.hasValue(e,ie.HAS_DATATYPE,n)&&(t=Object.assign({},t,qe[n]))}),void 0!==e[ie.XSD.MIN_INCLUSIVE]&&(t.min=e[ie.XSD.MIN_INCLUSIVE]),void 0!==e[ie.XSD.MIN_EXCLUSIVE]&&(t.min=e[ie.XSD.MIN_EXCLUSIVE]+1),void 0!==e[ie.XSD.MAX_EXCLUSIVE]&&(t.max=e[ie.XSD.MAX_EXCLUSIVE]-1),void 0!==e[ie.XSD.MAX_INCLUSIVE]&&(t.max=e[ie.XSD.MAX_INCLUSIVE]),t},e._preventCharacterInput=function(t,n){"number"!==e._resolveInputType(n)||t.key>="0"&&t.key<="9"||["Backspace","Delete","ArrowLeft","ArrowRight","-","Minus","NumpadSubtract",".","Period"].includes(t.key)||t.preventDefault()},e}(),ze=function(t){var n=r(Ie),o=n.inputComponent,i=n.componentsOptions,a=t.question,s=t.answer,l=t.value;return s[ie.HAS_OBJECT_VALUE]&&s[ie.HAS_OBJECT_VALUE][u.RDFS_LABEL]&&(l=u.getJsonAttValue(s[ie.HAS_OBJECT_VALUE],u.RDFS_LABEL)),/*#__PURE__*/e.createElement(o,Object.assign({},Fe.resolveInputProperties(a,l,i),{validation:t.validation,label:t.label,title:t.title,value:null==l?"":l,placeholder:Ee.getInputMask(a),onKeyPress:function(e){return Fe._preventCharacterInput(e,a)},onChange:function(e){t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:function(e){if(t.sparql){var n=F.fromTextArea(e.target);n.setValue(l),n.on("change",function(){t.onChange(n.getValue())}),F.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,n){if(e.autocompleters.getTrie(n)&&e.options.autocompleters&&-1!==e.options.autocompleters.indexOf(n)){var o=e.getCursor(),r=e.getTokenAt(o);if("prefixed"===ke[r.type]){var i=r.string.indexOf(":");if(-1!==i){var a=e.getPreviousNonWsToken(o.line,r).string.toUpperCase(),s=e.getTokenAt({line:o.line,ch:r.start});if("PREFIX"!==a&&("ws"===s.type||null==s.type)){var l=r.string.substring(0,i+1);if(null==e.getPrefixesFromQuery()[l.slice(0,-1)])if(t.question[ie.HAS_DECLARED_PREFIX]&&t.question[ie.HAS_DECLARED_PREFIX].filter(function(e){return e[ie.PREFIX]===l.slice(0,-1)}).length){var u=t.question[ie.HAS_DECLARED_PREFIX].filter(function(e){return e[ie.PREFIX]===l.slice(0,-1)}),c={};c[u[0][ie.PREFIX]]=u[0][ie.NAMESPACE],e.addPrefixes(c)}else{var d=e.autocompleters.getTrie(n).autoComplete(l);d.length>0&&e.addPrefixes(d[0])}}}}}}}else if(t.turtle){console.log("TTL");var o=F.fromTextArea(e.target);o.setValue(l),o.on("change",function(){t.onChange(o.getValue())})}}}))};ze.propTypes={question:j.object.isRequired,answer:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.oneOfType([j.string,j.number]),onChange:j.func.isRequired,validation:j.object};var Qe={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"},Be=/*#__PURE__*/function(){function e(){}return e.mapMask=function(e){if(!e)return e;for(var t,n="",o=0,r=e.length;o<r;o++)t=e.charAt(o),n+=Qe[t]?Qe[t]:t;return n},e}(),We=["size","placeholder"];function Ye(e){var t,n,o,r;if(void 0!==e.selectionStart)t=e.selectionStart,n=e.selectionEnd;else try{e.focus(),r=(o=e.createTextRange()).duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),r.setEndPoint("EndToStart",o),n=(t=r.text.length)+o.text.length}catch(e){}return{start:t,end:n}}var Xe=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this)._updatePattern=function(e){n.mask.setPattern(Be.mapMask(e.mask),{value:n.mask.getRawValue(),selection:Ye(n.input)})},n._updateMaskSelection=function(){n.mask.selection=Ye(n.input)},n._updateInputSelection=function(){!function(e,t){var n;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),(n=e.createTextRange()).collapse(!0),n.moveStart("character",t.start),n.moveEnd("character",t.end-t.start),n.select())}catch(e){}}(n.input,n.mask.selection)},n._onChange=function(e){var t=n.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){var o=t.length-e.target.value.length;n._updateMaskSelection(),n.mask.selection.end=n.mask.selection.start+o,n.mask.backspace()}var r=n._getDisplayValue();e.target.value=r,r&&n._updateInputSelection()}n.props.onChange&&n.props.onChange(e)},n._onKeyDown=function(e){if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),n.mask.undo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),n.mask.redo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),n._updateMaskSelection(),n.mask.backspace())){var t=n._getDisplayValue();e.target.value=t,t&&n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)}},n._onKeyPress=function(e){e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),n._updateMaskSelection(),n.mask.input(e.key)&&(e.target.value=n.mask.getValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)))},n._onPaste=function(e){e.preventDefault(),n._updateMaskSelection(),n.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=n.mask.getValue(),setTimeout(n._updateInputSelection,0),n.props.onChange&&n.props.onChange(e))},n.mask=new z({pattern:Be.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"}),n}te(n,t);var o=n.prototype;return o.componentDidUpdate=function(e){e.mask!==this.props.mask&&this._updatePattern(this.props),e.mask!==this.props.mask&&e.value!==this.props.mask?this.mask.getValue()===this.mask.emptyValue?this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.value!==this.props.value&&this.mask.setValue(this.props.value),e.mask!==this.props.mask&&this.mask.selection.start&&this._updateInputSelection()},o._getDisplayValue=function(){var e=this.mask.getValue();return e===this.mask.emptyValue?"":e},o.focus=function(){this.input.focus()},o.blur=function(){this.input.blur()},o.render=function(){var t=this,n=this.props,o=n.size,r=n.placeholder,i=ne(n,We),a=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},i,{ref:function(e){e&&(t.input=e.input?U.findDOMNode(e.input):e)},maxLength:a,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.mask.emptyValue,size:o||a,value:this._getDisplayValue(),type:"text"}))},n}(e.Component);Xe.contextType=Ie,Xe.propTypes={mask:j.string.isRequired},Xe.defaultProps={value:""};var Ge=function(t){var n=r(Ie).componentsOptions,o=t.question,i=t.value,a=u.getJsonAttValue(o,ie.INPUT_MASK);return a?/*#__PURE__*/e.createElement(Xe,{mask:a,value:i,label:t.label,title:t.title,placeholder:a,onChange:function(e){return t.onChange(e.target.value)},disabled:n.readOnly||Ee.isDisabled(o),validation:t.validation}):(Ae.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(ze,t))};Ge.propTypes={question:j.object.isRequired,answer:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.oneOfType([j.string,j.number]),onChange:j.func.isRequired,validation:j.object};var Ke=function(t,n){void 0===n&&(n="-- Select --");var o=[].concat(t).sort(function(e,t){var n=u.getJsonAttValue(e,ie.RDFS_LABEL),o=u.getJsonAttValue(t,ie.RDFS_LABEL);return n<o?-1:n>o?1:0}).map(function(t,n){var o=u.getJsonAttValue(t,ie.RDFS_LABEL);/*#__PURE__*/return e.createElement("option",{value:o,key:"opt-"+n},o)});return[/*#__PURE__*/e.createElement("option",{value:"",key:"opt-placeholder",disabled:!0,hidden:!0},n)].concat(o)},Je=function(t){var n=t.question,o=t.label,i=t.title,a=t.value,s=t.validation,l=t.onChange,u=r(Ie);/*#__PURE__*/return e.createElement(u.inputComponent,{type:"select",label:o,value:a,title:i,validation:s,onChange:function(e){return l(e.target.value)},disabled:u.componentsOptions.readOnly||Ee.isDisabled(n)},Ke(n[ie.HAS_OPTION]))};function Ze(t){var n=t.size,o=void 0===n?17:n,r=t.className;/*#__PURE__*/return e.createElement("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",className:void 0===r?"":r,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},/*#__PURE__*/e.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"}))}function $e(t){var n=t.size,o=void 0===n?17:n,r=t.className;/*#__PURE__*/return e.createElement("svg",{width:o,height:o,viewBox:"0 0 50 50",className:void 0===r?"":r,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},/*#__PURE__*/e.createElement("path",{strokeWidth:3,stroke:"currentColor",d:"M 41.9375 8.625 C 41.273438 8.648438 40.664063 9 40.3125 9.5625 L 21.5 38.34375 L 9.3125 27.8125 C 8.789063 27.269531 8.003906 27.066406 7.28125 27.292969 C 6.5625 27.515625 6.027344 28.125 5.902344 28.867188 C 5.777344 29.613281 6.078125 30.363281 6.6875 30.8125 L 20.625 42.875 C 21.0625 43.246094 21.640625 43.410156 22.207031 43.328125 C 22.777344 43.242188 23.28125 42.917969 23.59375 42.4375 L 43.6875 11.75 C 44.117188 11.121094 44.152344 10.308594 43.78125 9.644531 C 43.410156 8.984375 42.695313 8.589844 41.9375 8.625 Z"}))}Je.propTypes={question:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.string,onChange:j.func.isRequired,validation:j.object},Ze.propTypes={size:j.number,className:j.string},$e.propTypes={size:j.number,className:j.string};var et=function(t){var n=t.status;return"correct"===n?/*#__PURE__*/e.createElement($e,{className:"select-feedback-badge correct visible"}):"incorrect"===n?/*#__PURE__*/e.createElement(Ze,{className:"select-feedback-badge incorrect visible"}):null};et.displayName="SelectFeedbackBadge",et.propTypes={status:j.oneOf(["correct","incorrect",null])};var tt="select-correct",nt="select-incorrect",ot=function(t){var a=t.question,s=t.label,l=t.title,c=t.value,d=t.validation,m=t.onChange,p=t.hintRevealed,f=r(Ie),h=f.inputComponent,v=f.componentsOptions,E=i(null),A=n(null),g=A[0],S=A[1],_=n(null!=c?c:""),T=_[0],N=_[1],O=function(e){var t,n,o,r,i=function(e,t){return t?e.trim()===t.trim()?"correct":"incorrect":null}(e,Ee.getCorrectAnswerValue(a));i&&(n="correct"===i,(t=null!=(o=null==(r=E.current)?void 0:r.querySelector("select"))?o:null)&&(t.classList.remove(tt,nt),t.classList.add(n?tt:nt)),S(i))};o(function(){var e;if(Ee.hasAnswer(a)&&c){var t=function(e,t){void 0===e&&(e=[]);var n=function(e,t){var n;return void 0===e&&(e=[]),null!=(n=e.find(function(e){return e["@id"]===t}))?n:null}(e,t);return n?u.getJsonAttValue(n,ie.RDFS_LABEL):t}(null!=(e=a[ie.HAS_OPTION])?e:[],c);N(t),O(t)}},[]);var I=function(){var e=Ee.getCorrectAnswerValue(a);e&&(N(e),m(e),O(e))};return o(function(){p&&I()},[p]),/*#__PURE__*/e.createElement("div",{ref:E,style:{position:"relative"}},/*#__PURE__*/e.createElement(h,{type:"select",label:s,value:T,title:l,validation:d,onChange:function(e){if(p)I();else{var t=e.target.value;N(t),m(t),O(t)}},disabled:v.readOnly||Ee.isDisabled(a)},Ke(a[ie.HAS_OPTION])),/*#__PURE__*/e.createElement(et,{status:g}))};ot.propTypes={question:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.string,onChange:j.func.isRequired,validation:j.object,hintRevealed:j.bool};var rt=function(t){var n=r(Ie),o=me.isOptionQuestionFeedbackEnabled(null==n?void 0:n.options);/*#__PURE__*/return e.createElement(o?ot:Je,t)};rt.propTypes={question:j.object.isRequired,label:j.object.isRequired,title:j.string,value:j.string,onChange:j.func.isRequired,validation:j.object,hintRevealed:j.bool,onRevealHint:j.func};var it=function(e,t){if(!e)return[];e=function(e,t){return void 0!==e&&e.length?(e.sort(ve.getCompareLocalizedLabelFunction(t)),ve.orderPreservingToplogicalSort(e,ie.HAS_PRECEDING_VALUE),e):[]}(e,t);for(var n,o={},r=[],i=$(e);!(n=i()).done;){var a=n.value,s=u.getLocalized(a[ie.RDFS_LABEL],t),l=u.getLocalized(a[ie.RDFS_COMMENT],t);o[a["@id"]]={id:a["@id"],value:a["@id"],label:s,description:l,children:[]};for(var c,d=$(me.asArray(a[ie.BROADER]));!(c=d()).done;)r.push({type:"parent-child",parent:c.value["@id"],child:a["@id"]})}for(var m=0,p=r;m<p.length;m++){var f,h=p[m];"parent-child"===h.type&&(null==(f=o[h.parent])||f.children.push(h.child))}return Object.values(o)},at=function(e,t){if(!e)return null;var n=Ee.getCorrectAnswerValue(t);return n?e.trim()===n.trim()?"correct":"incorrect":null},st={correct:"#d4edda",incorrect:"#f8d7da"},lt={"is-warning":{borderColor:"#dc9135",boxShadow:"0 0 0 0.2rem rgba(203,127,16,.25)"},"is-invalid":{borderColor:"#dc3545",boxShadow:"0 0 0 0.2rem rgba(220,53,69,.25)"}},ut={correct:{borderColor:"#28a745",boxShadow:"0 0 0 0.2rem rgba(40,167,69,.25)"},incorrect:{borderColor:"#dc3545",boxShadow:"0 0 0 0.2rem rgba(220,53,69,.25)"}},ct=function(e,t){var n,o,r,i,a,s,l=null!=(n=null!=(o=lt[null==e?void 0:e.classname])?o:ut[t])?n:{};return a=(i=void 0===(r=l)?{}:r).borderColor,s=i.boxShadow,{control:function(e){return Object.assign({},e,{border:a?"1px solid "+a:e.border,boxShadow:null!=s?s:e.boxShadow,"&:hover":{border:a?"1px solid "+a:e.border,boxShadow:null!=s?s:e.boxShadow}})}}},dt=function(t){var n=t.hintRevealed,o=t.correctValue,r=t.currentValue;return function(t){var i,a,s,l=(null==(i=t.label)?void 0:i.trim())===(null==o?void 0:o.trim()),u=(null==(a=t.label)?void 0:a.trim())===(null==r||null==(s=r.label)?void 0:s.trim()),c="transparent";return n&&l&&(c=st.correct),u&&(c=l?st.correct:st.incorrect),/*#__PURE__*/e.createElement("div",{style:{backgroundColor:c}},/*#__PURE__*/e.createElement(B,t))}},mt=function(t){var r,i=n(null),a=i[0],s=i[1],l=n(null),u=l[0],c=l[1],d=n(!1),m=d[0],p=d[1],v=Ee.getCorrectAnswerValue(t.question);return o(function(){if(t.optionsList.length){var e=t.optionsList.find(function(e){return e.id===t.value});e&&(s(e),c(at(e.label,t.question)))}},[t.optionsList]),/*#__PURE__*/e.createElement(h,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,null,t.label),/*#__PURE__*/e.createElement(Q,{styles:ct(t.validation,u),valueKey:t.valueKey,labelKey:t.labelKey,valueRenderer:function(t){return function(t,n){var o;/*#__PURE__*/return e.createElement("div",{style:{backgroundColor:null!=(o=st[t])?o:"transparent",padding:"2px 6px",borderRadius:"4px",display:"inline-block"}},n)}(u,t)},optionRenderer:dt({hintRevealed:t.hintRevealed,currentValue:a,correctValue:v}),value:a,options:t.optionsList,multi:!1,isSearchable:!0,isLoading:t.isLoading,isClearable:!0,renderAsTree:!0,optionLeftOffset:5,isMenuOpen:m,onChange:function(e){var n,o=null!=(n=null==e?void 0:e.id)?n:null;s(null!=e?e:null),t.onChange(o),p(!1),c(at(null==e?void 0:e.label,t.question))},titleKey:"description"}),null==(r=t.validation)?void 0:r.message)};mt.propTypes={question:j.object.isRequired,answer:j.object.isRequired,label:j.oneOfType([j.string,j.object]).isRequired,value:j.string,onChange:j.func.isRequired,validation:j.object,hintRevealed:j.bool.isRequired};var pt=function(t){/*#__PURE__*/return e.createElement(e.Fragment,null,t)},ft=function(t){var n;/*#__PURE__*/return e.createElement(h,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,null,t.label),/*#__PURE__*/e.createElement(Q,{valueKey:t.valueKey,labelKey:t.labelKey,styles:ct(),value:t.optionsList.find(function(e){return e.id===t.value})||null,options:t.optionsList,multi:!1,isSearchable:!0,isLoading:t.isLoading,isClearable:!0,renderAsTree:!0,optionLeftOffset:5,valueRenderer:!1===t.question[ie.PROVIDES_DEREFERENCEABLE_ANSWER_VALUES]?pt:null,isDisabled:t.isLoading||t.configurationContext.componentsOptions.readOnly||Ee.isDisabled(t.question),onChange:function(e){t.onChange(e?e.id:null)},titleKey:"description"}),null==(n=t.validation)?void 0:n.message)};mt.propTypes={question:j.object.isRequired,answer:j.object.isRequired,label:j.oneOfType([j.string,j.object]).isRequired,value:j.string,onChange:j.func.isRequired,validation:j.object};var ht=function(t){var i=d(),a=r(Le),s=r(Ie),l=me.getStringHash(Ee.getPossibleValuesQuery(t.question)),u=n(!0),c=u[0],m=u[1],p=n(function(){return it(t.options,i)}),f=p[0],h=p[1],v=me.isOptionQuestionFeedbackEnabled(null==s?void 0:s.options);o(function(){var e=!1;return!t.question[ie.HAS_OPTION]&&Ee.getPossibleValuesQuery(t.question)?function(){try{var n=function(n,o){try{var r=Promise.resolve(a.loadFormOptions(l,Ee.getPossibleValuesQuery(t.question))).then(function(t){e||(h(it(t,i)),m(!1))})}catch(e){return o()}return r&&r.then?r.then(void 0,o):r}(0,function(){Ae.error("Typeahead: options loading failed for query hash "+l)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():(h(it(t.question[ie.HAS_OPTION],i)),m(!1)),function(){e=!0}},[l,a,t.question,i]);var E=me.findKeyInObjects(f,["name","value"]),A=me.findKeyInObjects(f,["name","label"]),g=Object.assign({},t,{optionsList:f,valueKey:E,labelKey:A,isLoading:c,configurationContext:s});/*#__PURE__*/return e.createElement(v?mt:ft,g)};ht.propTypes={question:j.object.isRequired,answer:j.object.isRequired,label:j.oneOfType([j.string,j.object]).isRequired,value:j.string,onChange:j.func.isRequired,validation:j.object,hintRevealed:j.bool};var vt=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-up",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 17.453c-0.172 0.344-0.516 0.547-0.891 0.547h-10c-0.375 0-0.719-0.203-0.891-0.547-0.172-0.328-0.141-0.734 0.078-1.031l5-7c0.187-0.266 0.484-0.422 0.812-0.422s0.625 0.156 0.812 0.422l5 7c0.219 0.297 0.25 0.703 0.078 1.031zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},Et=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-down",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 10.547c0.172 0.328 0.141 0.734-0.078 1.031l-5 7c-0.187 0.266-0.484 0.422-0.812 0.422s-0.625-0.156-0.812-0.422l-5-7c-0.219-0.297-0.25-0.703-0.078-1.031 0.172-0.344 0.516-0.547 0.891-0.547h10c0.375 0 0.719 0.203 0.891 0.547zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},At=function(){/*#__PURE__*/return e.createElement("svg",{className:"info-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,"info-circle"),/*#__PURE__*/e.createElement("path",{d:"M16 21.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-1.5v-8c0-0.281-0.219-0.5-0.5-0.5h-5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h1.5v5h-1.5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h7c0.281 0 0.5-0.219 0.5-0.5zM14 7.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},gt=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("path",{d:"M14 21.5v-3c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v3c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM18 11c0-2.859-3-5-5.688-5-2.547 0-4.453 1.094-5.797 3.328-0.141 0.219-0.078 0.5 0.125 0.656l2.063 1.563c0.078 0.063 0.187 0.094 0.297 0.094 0.141 0 0.297-0.063 0.391-0.187 0.734-0.938 1.047-1.219 1.344-1.437 0.266-0.187 0.781-0.375 1.344-0.375 1 0 1.922 0.641 1.922 1.328 0 0.812-0.422 1.219-1.375 1.656-1.109 0.5-2.625 1.797-2.625 3.313v0.562c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5v0c0-0.359 0.453-1.125 1.188-1.547 1.188-0.672 2.812-1.578 2.812-3.953zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},St=function(t){var o=n("right"),r=o[0],i=o[1];/*#__PURE__*/return e.createElement("span",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?i("left"):i("right"))}(e)}},/*#__PURE__*/e.createElement(_,{overlay:t.show?/*#__PURE__*/e.createElement(T,{className:"tooltip-content",id:t.id},t.tooltipContent):/*#__PURE__*/e.createElement("span",null),placement:t.overlayPlacement||r},/*#__PURE__*/e.createElement("span",null,t.children)))};St.propTypes={tooltipContent:j.oneOfType([j.object.isRequired,j.string.isRequired]),id:j.string.isRequired,overlayPlacement:j.string,absolutePosition:j.bool,show:j.bool},St.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0,show:!0};var _t=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement(St,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(gt,{className:t.iconClass})))};_t.propTypes={text:j.string.isRequired,iconClassContainer:j.string,iconClass:j.string,overlayPlacement:j.string,absolutePosition:j.bool},_t.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var Tt=function(){/*#__PURE__*/return e.createElement("svg",{className:"external-link-icon",width:"24",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M5,2 C5.55228,2 6,2.44772 6,3 C6,3.55228 5.55228,4 5,4 L4,4 L4,12 L12,12 L12,11 C12,10.4477 12.4477,10 13,10 C13.5523,10 14,10.4477 14,11 L14,12 C14,13.1046 13.1046,14 12,14 L4,14 C2.89543,14 2,13.1046 2,12 L2,4 C2,2.89543 2.89543,2 4,2 L5,2 Z M15,1 L15,5.99814453 C15,6.55043453 14.5523,6.99814453 14,6.99814453 C13.4477,6.99814453 13,6.55043453 13,5.99814453 L13,4.41419 L8.71571,8.69846 C8.32519,9.08899 7.69202,9.08899 7.3015,8.69846 C6.91097,8.30794 6.91097,7.67477 7.3015,7.28425 L11.5858,3 L9.99619141,3 C9.44391141,3 8.99619141,2.55228 8.99619141,2 C8.99619141,1.44772 9.44391141,1 9.99619141,1 L15,1 Z"}))},Nt=function(t){/*#__PURE__*/return e.createElement(St,{tooltipContent:t.url["@id"]||t.url,id:"url-tooltip",overlayPlacement:t.overlayPlacement},/*#__PURE__*/e.createElement("a",{href:t.url["@id"]||t.url,target:"_blank",className:t.iconClassContainer},/*#__PURE__*/e.createElement(Tt,{className:t.iconClass})))};Nt.propTypes={url:j.oneOfType([j.string.isRequired,j.object.isRequired]),iconClassContainer:j.string,iconClass:j.string,overlayPlacement:j.string,absolutePosition:j.bool},Nt.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var Ot=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-comment",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",width:"24",height:"28"},/*#__PURE__*/e.createElement("path",{d:"M30,1.5c-16.542,0-30,12.112-30,27c0,5.204,1.646,10.245,4.768,14.604c-0.591,6.537-2.175,11.39-4.475,13.689 c-0.304,0.304-0.38,0.769-0.188,1.153C0.275,58.289,0.625,58.5,1,58.5c0.046,0,0.092-0.003,0.139-0.01 c0.405-0.057,9.813-1.411,16.618-5.339C21.621,54.71,25.737,55.5,30,55.5c16.542,0,30-12.112,30-27S46.542,1.5,30,1.5z M16,32.5 c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S18.206,32.5,16,32.5z M30,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4 S32.206,32.5,30,32.5z M44,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,32.5,44,32.5z"}))},It=function(){/*#__PURE__*/return e.createElement("svg",{className:"recycle-bin-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"15px",width:"15px",viewBox:"0 0 512 512"},/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("path",{d:"M331.636,69.818V0H180.364v69.818h-128v128h34.909V512h337.455V197.818h34.909v-128H331.636z M215.273,34.909h81.455\nv34.909h-81.455V34.909z M389.818,477.091H122.182V197.818h267.636V477.091z M424.727,162.909H87.273v-58.182h337.455V162.909z"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"168.727",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"308.364",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"238.545",y:"256",width:"34.909",height:"162.909"}))))},Ct=function(t){var o=r(Ie).options,i=n(!1),a=i[0],s=i[1],l=n(!1),u=l[0],c=l[1],m=d();W.addLocale(X),W.addLocale(Y),W.setDefaultLocale(ie.LANG.en.locale);var p,f,h=new W(m.locale),v=function(){if(o&&o.users&&t.author){var e=o.users.find(function(e){return e.id===t.author["@id"]});if(e&&e.label)return e.label}return m.formatMessage({id:"comment.unknownAuthor"})},E=function(){s(!a)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:function(){c(!0)},onMouseLeave:function(){c(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:E,onMouseLeave:E},/*#__PURE__*/e.createElement(e.Fragment,null,a?/*#__PURE__*/e.createElement(e.Fragment,null,v(),/*#__PURE__*/e.createElement(Nt,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():m.formatMessage({id:"comment.unknownAuthor"})})):v())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},(p=Number(t.timestamp),f=isNaN(p)?new Date(t.timestamp):new Date(p),/*#__PURE__*/e.createElement(St,{id:"exact-time-overlay",tooltipContent:new Intl.DateTimeFormat(m.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(f))},h.format(f)))),u?/*#__PURE__*/e.createElement(G.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:function(){t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(It,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};Ct.propTypes={author:j.object,timestamp:j.string.isRequired,commentValue:j.string.isRequired,onDeleteQuestionComment:j.func.isRequired,onDeleteViewComment:j.func,index:j.number.isRequired};var bt=function(t){var r=t.comments,a=t.onDeleteCommentClick,s=i(null),l=n(!1),c=l[0],d=l[1],m=function(){d(!0),setTimeout(function(){d(!1)},2e3)};return o(function(){null!==s.current&&(s.current.scrollTop=s.current.scrollHeight)},[JSON.stringify(r)]),/*#__PURE__*/e.createElement("span",null,c?/*#__PURE__*/e.createElement("div",{className:"comment-delete"},/*#__PURE__*/e.createElement(K,{color:"#00BFFF",height:80,width:80}),/*#__PURE__*/e.createElement("p",null,"Deleting comment...")):/*#__PURE__*/e.createElement("div",{className:"comment-list-items",ref:s},r.map(function(t,n){/*#__PURE__*/return e.createElement("div",{key:n,className:"comment-list-item"},/*#__PURE__*/e.createElement(Ct,{commentValue:u.getJsonAttValue(t,ie.HAS_COMMENT_VALUE),author:t[ie.HAS_AUTHOR]?t[ie.HAS_AUTHOR]:null,timestamp:u.getJsonAttValue(t,ie.HAS_TIMESTAMP),onDeleteQuestionComment:a,onDeleteViewComment:m,index:n}))})))},yt=function(){/*#__PURE__*/return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},/*#__PURE__*/e.createElement("path",{d:"M6.185 4.843l11.927 7.157-11.927 7.157 2.982-7.157-2.982-7.157zm-4.185-4.843l5 12-5 12 20-12-20-12z"}))},Rt="300px",Lt=function(t){var r=n(""),a=r[0],s=r[1],l=i(null),u=d();o(function(){l.current.focus()},[]);var c=function(e){e.preventDefault(),t.onChange(a),s("")},m=function(){var e=l.current;e.style.height="auto",p(e)},p=function(e){e.style.height=e.scrollHeight+"px",parseInt(e.style.height)>parseInt(Rt)&&(e.style.height=Rt)};/*#__PURE__*/return e.createElement(f,{onSubmit:c,onKeyUp:function(e){"Enter"===e.key&&e.ctrlKey&&a.trim()&&c(e)},onClick:function(e){e.stopPropagation()}},/*#__PURE__*/e.createElement(f.Group,{className:"m-2 position-relative",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(N,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(O,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(f.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:u.formatMessage({id:"comment.form.placeholder"}),required:!0,value:a,onChange:function(e){s(e.target.value)},ref:l,onKeyPress:m,onKeyDown:m}),/*#__PURE__*/e.createElement(S,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement(yt,null)))))))};Lt.propTypes={onChange:j.func.isRequired};var wt=function(){/*#__PURE__*/return e.createElement("svg",{className:"close-icon",width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"}))},Ht=function(t){var a=r(Ie),s=i(null),l=i(null),u=i(null),c=n(!1),d=c[0],m=c[1],p=n("right"),f=p[0],h=p[1];o(function(){O(u.current)});var v=function(){m(!1)},E=function(){var e=t.question;return e[ie.HAS_COMMENT]||(e[ie.HAS_COMMENT]=[]),Array.isArray(e[ie.HAS_COMMENT])||(e[ie.HAS_COMMENT]=[e[ie.HAS_COMMENT]]),e[ie.HAS_COMMENT]},A=function(e){var n={};g(n,e),t.onChange(N(),n)},g=function(e,t){a.options.currentUser&&(e[ie.HAS_AUTHOR]={"@id":a.options.currentUser}),e[ie.HAS_COMMENT_VALUE]=t,e[ie.HAS_TIMESTAMP]=Date.now().toString()},S=function(e){E().splice(e,1)},_=function(e){e.preventDefault(),e.stopPropagation()},N=function(){return E().length},O=function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?h("left"):h("right"))};/*#__PURE__*/return e.createElement("div",{ref:u,onClick:_},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:s,onClick:function(e){_(e),m(!d)}},/*#__PURE__*/e.createElement(Ot,null),N()>0?/*#__PURE__*/e.createElement(I,{className:"comment-badge",pill:!0,variant:"primary"},N()):null),/*#__PURE__*/e.createElement(G.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:s.current,show:d,placement:f,rootClose:!1,onHide:v,container:l},function(t){/*#__PURE__*/return e.createElement(T,ee({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:function(e){!function(e){"Escape"===e.key&&v()}(e)}},/*#__PURE__*/e.createElement(G.div,{className:"close-comment-icon",onClick:v,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(wt,null)),/*#__PURE__*/e.createElement(bt,{comments:E(),onDeleteCommentClick:S}),/*#__PURE__*/e.createElement(Lt,{onChange:A})))})))};Ht.propTypes={question:j.object.isRequired,onChange:j.func.isRequired};var Dt,Vt="M9 21h6v2H9zm3-21C7.03 0 3 4.03 3 9c0 3.04 1.53 5.73 3.86 7.36.74.52 1.14 1.35 1.14 2.24V19h8v-.4c0-.9.39-1.73 1.14-2.24C19.47 14.73 21 12.04 21 9c0-4.97-4.03-9-9-9z",Mt={x1:2,y1:2,x2:21,y2:19,stroke:"#f15050",strokeWidth:3,strokeLinecap:"round"},jt=function(){/*#__PURE__*/return e.createElement("path",{d:Vt})},Ut=function(){/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement("path",{d:Vt,opacity:.35}),/*#__PURE__*/e.createElement("line",Mt))},Pt=function(t){var n=t.title,o=t.enabled,r=t.className;/*#__PURE__*/return e.createElement("svg",{className:"hint-icon"+(r?" "+r:""),xmlns:"http://www.w3.org/2000/svg",width:24,height:28,viewBox:"0 0 24 28","aria-label":n},/*#__PURE__*/e.createElement("title",null,n),/*#__PURE__*/e.createElement(o?jt:Ut,null))},xt=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement("span",{onClick:function(){return t.onHintClick()}},/*#__PURE__*/e.createElement(St,{id:"hint-icon-tooltip",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text||t.revealed?"Hide a hint.":"Reveal a hint."},/*#__PURE__*/e.createElement(Pt,{className:t.iconClass,enabled:!t.revealed}))))};xt.propTypes={text:j.string,iconClassContainer:j.string,iconClass:j.string,overlayPlacement:j.string,absolutePosition:j.bool,onHintClick:j.func,revealed:j.bool},xt.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0,revealed:!1};var qt=/*#__PURE__*/function(){function t(){}return t.renderIcons=function(t,n,o,r,i,a,s){var l;l=n.icons?n.icons:ie.DEFAULT_OPTIONS.icons;for(var u=[],c=this.renderQuestionHelp(t,n,o,r,i),d=this.renderQuestionComments(t,n,o,r,i),m=this.renderQuestionLink(t,n,o,r,i),p=this.renderQuestionHint(t,n,o,r,i,a,s),f=0;f<l.length;f++)l[f].id===ie.ICONS.QUESTION_COMMENTS&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},d)),l[f].id===ie.ICONS.QUESTION_HELP&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},c)),l[f].id===ie.ICONS.QUESTION_LINK&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},m)),l[f].id===ie.ICONS.QUESTION_HINT&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},p));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},u)},t.renderQuestionHelp=function(e,t,n,o,r){return this.getIconComponentFromName(ie.ICONS.QUESTION_HELP,e,t,n,o,r)},t.renderQuestionLink=function(e,t,n,o,r){return this.getIconComponentFromName(ie.ICONS.QUESTION_LINK,e,t,n,o,r)},t.renderQuestionHint=function(e,t,n,o,r,i,a){return this.getIconComponentFromName(ie.ICONS.QUESTION_HINT,e,t,n,o,r,i,a)},t.getIconComponentFromName=function(e,t,n,o,r,i,a,s){var l=this.getIconFromIconList(n.icons?n.icons:ie.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(l,t,n,o,r,i,a,s)},t.getIconComponent=function(t,n,o,r,i,a,s,l){var c;if(t&&(t.behavior===ie.ICON_BEHAVIOR.ON_HOVER||t.behavior===ie.ICON_BEHAVIOR.ENABLE))return t.behavior===ie.ICON_BEHAVIOR.ENABLE?(i=!0,c=""):c="emphasise-on-relevant-icon",t.id===ie.ICONS.QUESTION_HELP&&n[ie.HELP_DESCRIPTION]?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(_t,{text:u.getLocalized(n[ie.HELP_DESCRIPTION],a),absolutePosition:!1})):null:t.id===ie.ICONS.QUESTION_LINK&&n[ie.SOURCE]?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(Nt,{url:n[ie.SOURCE]})):null:t.id===ie.ICONS.QUESTION_COMMENTS?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(Ht,{question:n,onChange:r})):null:t.id===ie.ICONS.QUESTION_HINT&&o.enableOptionQuestionFeedback?Ee.isSection(n)||!Ee.containsHints(n)?null:i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(xt,{absolutePosition:!1,onHintClick:l,revealed:s})):null:null},t}();Dt=qt,qt.renderQuestionComments=function(e,t,n,o,r){return Dt.getIconComponentFromName(ie.ICONS.QUESTION_COMMENTS,e,t,n,o,r)},qt.getIconFromIconList=function(e,t){return e?e.find(function(e){return e.id===t}):null};var kt=function(t){var r=e.useContext(Le),i=e.useContext(Ie).options,a=n({severity:"",classname:"",message:null}),s=a[0],l=a[1],c=d();o(function(){v()},[t.question]);var m,p,f=function(e){var n=Object.assign({},t.answer);h(n,e),t.onChange(t.index,n)},h=function(e,n){null===n?(e[ie.HAS_OBJECT_VALUE]=null,e[ie.HAS_DATA_VALUE]=null):t.answer[ie.HAS_OBJECT_VALUE]||Ee.isTypeahead(t.question)?e[ie.HAS_OBJECT_VALUE]={"@id":n}:e[ie.HAS_DATA_VALUE]={"@value":n}},v=function(){l({severity:"",classname:"",message:null}),!1===E[ie.HAS_VALID_ANSWER]&&l(E[ie.HAS_VALIDATION_SEVERITY]===ie.VALIDATION.SEVERITY.WARNING?{severity:ie.VALIDATION.SEVERITY.WARNING,classname:ie.VALIDATION.CLASSNAME.WARNING,message:/*#__PURE__*/e.createElement(b,{className:ie.VALIDATION.CLASSNAME.WARNING},E[ie.HAS_VALIDATION_MESSAGE])}:{severity:ie.VALIDATION.SEVERITY.ERROR,classname:ie.VALIDATION.CLASSNAME.ERROR,message:/*#__PURE__*/e.createElement(b,{className:ie.VALIDATION.CLASSNAME.ERROR},E[ie.HAS_VALIDATION_MESSAGE])})},E=t.question,A=Ee.resolveValue(t.answer),g=function(n){var o=u.getLocalized(n[ie.RDFS_LABEL],c);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,qt.renderIcons(t.question,i,t.onCommentChange,t.showIcon,c,t.hintRevealed,t.onHintReveal))}(E),S=u.getLocalized(E[ie.RDFS_COMMENT],c);return m=Ee.isTypeahead(E)?function(n,o,i){var a=me.getStringHash(Ee.getPossibleValuesQuery(t.question)),l=r.getOptions(a)||[];/*#__PURE__*/return e.createElement(ht,{question:t.question,answer:t.answer,label:o,title:i,value:n,onChange:f,options:l,validation:s,hintRevealed:t.hintRevealed,onHintReveal:t.onHintReveal})}(A,g,S):(p=E)[ie.HAS_OPTION]&&0!==p[ie.HAS_OPTION].length?function(n,o,r){/*#__PURE__*/return e.createElement(rt,{question:t.question,label:o,title:r,value:n,onChange:f,validation:s,hintRevealed:t.hintRevealed,onHintReveal:t.onHintReveal})}(A,g,S):Ee.isCalendar(E)?function(n,o,r){/*#__PURE__*/return e.createElement(Pe,{question:t.question,value:n,title:r,label:o,onChange:f,validation:s})}(A,g,S):Ee.isCheckbox(E)?function(n,o,r){/*#__PURE__*/return e.createElement(Ue,{label:o,title:r,value:n,onChange:f,question:t.question,validation:s})}(A,g,S):Ee.isMaskedInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(Ge,{label:o,title:r,value:n,onChange:f,question:t.question,answer:t.answer,validation:s})}(A,g,S):Ee.isSparqlInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,sparql:!0,validation:s})}(A,g,S):Ee.isTurtleInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,turtle:!0,validation:s})}(A,g,S):function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,validation:s})}(A,g,S),m};kt.propTypes={answer:j.object.isRequired,question:j.object.isRequired,onChange:j.func.isRequired,onCommentChange:j.func.isRequired,index:j.number,icons:j.object,hintRevealed:j.bool,onHintReveal:j.func};var Ft=function(e,t){var n=[Gt,Xt,Qt,Wt,Bt,Yt];return function(){if(Ee.hasValidationLogic(e,t)){var o=Ee.getAnswerValue(e);return zt(e,t,o,n)}}},zt=function(e,t,n,o){for(var r,i={},a=$(o);!(r=a()).done;){var s=(0,r.value)(e,t);if(!s.isValid)return i[ie.HAS_VALID_ANSWER]=!1,i[ie.HAS_VALIDATION_MESSAGE]=s.message,i[ie.HAS_VALIDATION_SEVERITY]=s.validationSeverity,i;if(!1===i[ie.HAS_VALID_ANSWER])break}return i[ie.HAS_VALID_ANSWER]=!0,i[ie.HAS_VALIDATION_MESSAGE]="",i[ie.HAS_VALIDATION_SEVERITY]="",i},Qt=function(e,t){var n=Ee.getAnswerValue(e);return n&&n.length>0&&e[ie.PATTERN]&&!new RegExp(e[ie.PATTERN]).test(n)&&Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.invalid"})}:{isValid:!0}},Bt=function(e,t){return!e[ie.REQUIRES_ANSWER]||e[ie.USED_ONLY_FOR_COMPLETENESS]||Ee.hasAnswer(e)?{isValid:!0}:{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.required"})}},Wt=function(e,t){return Ee.isCheckbox(e)&&e[ie.REQUIRES_ANSWER]&&!Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.check"})}:{isValid:!0}},Yt=function(e,t){return e[ie.REQUIRES_ANSWER]&&e[ie.USED_ONLY_FOR_COMPLETENESS]&&!Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.WARNING,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.required_only_for_completeness"})}:{isValid:!0}},Xt=function(e,t){if(e[ie.XSD.MIN_INCLUSIVE]){var n=Ee.getAnswerValue(e);if(n&&n.length>0){var o=e[ie.XSD.MIN_INCLUSIVE];if(!(Number.isInteger(parseInt(n))&&n>=o))return{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.greater_or_equal"})+o+"."}}}return{isValid:!0}},Gt=function(e,t){var n=Ee.getAnswerValue(e);if(e[ie.XSD.MAX_INCLUSIVE]&&n&&n.length>0){var o=e[ie.XSD.MAX_INCLUSIVE];if(!(Number.isInteger(parseInt(n))&&n<=o))return{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.lower_or_equal"})+o+"."}}return{isValid:!0}},Kt=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={prefixes:e.prefixes},n}return te(n,t),n.prototype.render=function(){var t=/*#__PURE__*/e.createElement(y,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(R,null,this.state.prefixes.sort(function(e,t){return e[ie.PREFIX]<t[ie.PREFIX]?-1:1}).map(function(t){/*#__PURE__*/return e.createElement(L,{key:t[ie.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[ie.PREFIX]),": ",t[ie.NAMESPACE])})));/*#__PURE__*/return e.createElement(_,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))},n}(e.Component);Kt.propTypes={prefixes:j.array.isRequired,children:j.element.isRequired,iconClass:j.string},Kt.defaultProps={iconClass:""};var Jt,Zt=/*#__PURE__*/function(){function e(){}return e.getMediaKindFromSource=function(e){if(e){var t=e.toLowerCase();return t.includes("m3u8")?{kind:"video",type:"application/x-mpegURL"}:t.includes("mp4")?{kind:"video",type:"video/mp4"}:t.includes("webm")?{kind:"video",type:"video/webm"}:t.includes("mov")?{kind:"video",type:"video/quicktime"}:/\b(png|jpg|jpeg|webp|gif|bmp)\b/.test(t)?{kind:"image",type:null}:{kind:"iframe",type:null}}},e.denormalizePointsFromStringToString=function(e,t,n){return e.trim().split(/\s+/).map(function(e){var o=e.split(",").map(Number);return o[0]*t+","+o[1]*n}).join(" ")},e.getArrayPointsFromString=function(e){return e.trim().split(/\s+/).map(function(e){return e.split(",").map(Number)})},e.stripExpandedLiterals=function(t){if(Array.isArray(t))return t.map(e.stripExpandedLiterals);if(t&&"object"==typeof t){if(Object.prototype.hasOwnProperty.call(t,"@value")&&Object.keys(t).length<=2)return e.castLiteral(t["@value"],t["@type"]);var n={};for(var o in t)n[o]=e.stripExpandedLiterals(t[o]);return n}return t},e.castLiteral=function(e,t){return t?t.includes("#decimal")?parseFloat(e):t.includes("#integer")?parseInt(e,10):t.includes("#boolean")?!0===e||"true"===e:e:e},e.normalizeMediaContents=function(e,t){return e?(Array.isArray(e)?e:[e]).map(function(e){var n;return"string"==typeof e?((n={})[t]=e,n):e}):[]},e}(),$t=function(e){var t=e.type,r=e.containerRef,i=function(e){var t=n(null),r=t[0],i=t[1];return o(function(){var t=null==e?void 0:e.current;if(t){var n=t.querySelector("img");if(n){var o=function(){return i(function(e){var t=null==e?void 0:e.current;if(!t)return null;var n=t.querySelector("img");if(!n)return null;var o=t.getBoundingClientRect();return{width:o.width,height:o.height,intrinsicWidth:n.naturalWidth||o.width,intrinsicHeight:n.naturalHeight||o.height,top:0,left:0}}(e))};return n.complete?o():n.addEventListener("load",o),window.addEventListener("resize",o),function(){n.removeEventListener("load",o),window.removeEventListener("resize",o)}}}},[e]),r}("image"===t?r:null),a=function(e){var t=n(null),r=t[0],i=t[1];return o(function(){var t=null==e?void 0:e.current;if(t){var n=function(){return i(function(e){var t=e.videoWidth(),n=e.videoHeight();if(!t||!n)return null;var o,r,i,a,s=e.el(),l=s.clientWidth,u=s.clientHeight,c=t/n;return l/u>c?(a=(l-(o=(r=u)*c))/2,i=0):(i=(u-(r=(o=l)/c))/2,a=0),{width:o,height:r,intrinsicWidth:t,intrinsicHeight:n,top:i,left:a}}(t))};return t.on("loadedmetadata",n),t.on("resize",n),t.on("fullscreenchange",n),window.addEventListener("resize",n),function(){t.off("loadedmetadata",n),t.off("resize",n),t.off("fullscreenchange",n),window.removeEventListener("resize",n)}}},[e]),r}("video"===t?r:null);return"image"===t?i:"video"===t?a:null},en=((Jt={})[ie.POLYLINE_ANNOTATION.IMPLICIT_TYPE_LABEL]=function(e,t,n,o){var r,i,a,s=ie.POLYLINE_ANNOTATION.DEFAULT_POLYLINE_ANNOTATION_STYLE;return Object.assign({},o,{geometry:{points:Zt.denormalizePointsFromStringToString(e[ie.ANNOTATION.HAS_GEOMETRY_POINTS],t,n)},style:{stroke:null!=(r=e[ie.ANNOTATION.HAS_COLOR])?r:s.color,strokeWidth:(null!=(i=e[ie.POLYLINE_ANNOTATION.HAS_STROKE_WIDTH])?i:s.strokeWidth)*t,fill:null!=(a=e[ie.POLYLINE_ANNOTATION.HAS_FILL_COLOR])?a:s.fillColor}})},Jt[ie.TEXT_ANNOTATION.IMPLICIT_TYPE_LABEL]=function(e,t,n,o){var r,i,a,s,l=ie.TEXT_ANNOTATION.DEFAULT_TEXT_ANNOTATION_STYLE,u=Zt.getArrayPointsFromString(e[ie.ANNOTATION.HAS_GEOMETRY_POINTS])[0];return Object.assign({},o,{geometry:{x:u[0]*t,y:u[1]*n},style:{fontSize:(null!=(r=e[ie.TEXT_ANNOTATION.HAS_FONT_SIZE])?r:l.fontSizeInNormalizedPx)*n,fontWeight:null!=(i=e[ie.TEXT_ANNOTATION.HAS_FONT_WEIGHT])?i:l.fontWeight,fontFamily:l.fontFamily,color:null!=(a=e[ie.ANNOTATION.HAS_COLOR])?a:l.color},payload:{text:null!=(s=e[ie.TEXT_ANNOTATION.HAS_TEXT])?s:l.text}})},Jt),tn={polyline:function(t){/*#__PURE__*/return e.createElement("polyline",{points:t.points,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,opacity:t.opacity})},text:function(t){var n=t.text,o=t.fontFamily,r=void 0===o?"Arial":o,i=t.fontWeight,a=void 0===i?400:i,s=t.opacity,l=void 0===s?1:s,u=t.fontSize,c=t.x,d=t.y,m=t.color,p=void 0===m?"#00ff00":m,f=t.lineHeight,h=void 0===f?1.15:f,v=(null!=n?n:"").split(/\r?\n/),E=u*h,A=d-.2*u;/*#__PURE__*/return e.createElement("text",{fill:p,fontSize:u+"px",fontFamily:r,fontWeight:a,textAnchor:"start",opacity:l},v.map(function(t,n){/*#__PURE__*/return e.createElement("tspan",{key:n,x:c,y:A+n*E,dominantBaseline:"hanging"},t||" ")}))}},nn=function(r){var i=r.annotations,a=void 0===i?[]:i,s=r.surface,l=r.currentTime,u=r.showAnnotations,c=null==s?void 0:s.intrinsicWidth,d=null==s?void 0:s.intrinsicHeight,m=n(""),p=m[0],f=m[1];o(function(){if(u){f("annotation-overlay-revealed");var e=setTimeout(function(){return f("")},700);return function(){return clearTimeout(e)}}},[u]);var h=function(e){var n=e.annotations,o=void 0===n?[]:n,r=e.width,i=e.height,a=e.currentTime;return t(function(){return r&&i&&o.length?o.filter(function(e){return function(e,t){if(null==t)return!0;var n=e[ie.ANNOTATION.HAS_START_TIME],o=e[ie.ANNOTATION.HAS_END_TIME];return!(null!=n&&t<n||null!=o&&t>o)}(e,a)}).map(function(e){return function(e,t,n){var o=en[e[ie.ANNOTATION.HAS_ANNOTATION_TYPE]];if(!o)return null;var r=function(e){var t,n=e[ie.ANNOTATION.HAS_ANNOTATION_TYPE],o=e[ie.ANNOTATION.HAS_OPACITY];return{id:null!=(t=e.id)?t:"uuid-"+Date.now()+"-"+Math.random().toString(16).slice(2),type:n,opacity:null!=o?o:1}}(e);return o(e,t,n,r)}(e,r,i)}).filter(Boolean):[]},[o,r,i,a])}({annotations:a,width:c,height:d,currentTime:l}),v=t(function(){return"0 0 "+c+" "+d},[c,d]);return c&&d&&h.length?u?/*#__PURE__*/e.createElement("svg",{viewBox:v,className:"annotation-overlay "+p},h.map(function(t){var n=tn[t.type];return n?/*#__PURE__*/e.createElement(n,ee({key:t.id},t.geometry,t.style,t.payload,{opacity:t.opacity})):null})):/*#__PURE__*/e.createElement(e.Fragment,null):null},on=/*#__PURE__*/s(function(t,n){var o=t.fullscreen;/*#__PURE__*/return e.createElement("div",{ref:n,className:"media-container "+(void 0!==o&&o?"fullscreen":"")},t.children)}),rn={video:function(r){var a=r.type,s=r.src,l=r.autoplay,u=void 0!==l&&l,c=r.muted,d=void 0===c||c,m=r.controls,p=void 0===m||m,f=r.responsive,h=void 0===f||f,v=r.aspectRatio,E=void 0===v?"16:9":v,A=r.annotations,g=void 0===A?[]:A,S=r.showAnnotations,_=r.onFullScreen,T=i(null),N=n(0),O=N[0],I=N[1],C=function(e){var t=e.videoRef,n=e.options,r=e.onReady,a=e.onFullScreen,s=e.onTimeUpdate,l=e.showAnnotations,u=e.annotations,c=void 0===u?[]:u,d=i(null);return o(function(){var e=d.current;if(e&&l){var t=c.reduce(function(e,t){var n=t[ie.ANNOTATION.HAS_START_TIME];return null!=n&&(null==e||n<e.startTime)?{annotation:t,startTime:n}:e},null);t&&(e.currentTime(t.startTime),e.pause())}},[l]),o(function(){if(t.current){var e=J(t.current,n,function(){!function(e,t){var n=t.onFullScreen;n&&function(e,t){var n,o=e.controlBar,r=null!=(n=o.getChild("remainingTimeDisplay"))?n:o.getChild("fullscreenToggle"),i=r?o.children().indexOf(r):o.children().length,a=o.addChild("button",{},i+1).el();a.innerHTML="⛶",a.style.fontSize="20px",a.onclick=function(){return t(e)}}(e,n)}(e,{onFullScreen:a}),null==r||r(e)});return d.current=e,s&&e.on("timeupdate",function(){return s(e.currentTime())}),function(){e&&!e.isDisposed()&&e.dispose()}}},[t,n,r,a,s]),d}({videoRef:T,options:t(function(){return{autoplay:u,muted:d,controls:p,responsive:h,aspectRatio:E,controlBar:{fullscreenToggle:!1,pictureInPictureToggle:!1},userActions:{doubleClick:!1},sources:[{src:s,type:a}]}},[u,d,p,h,E,s,a]),onFullScreen:_,onTimeUpdate:I,annotations:g,showAnnotations:S}),b=$t({type:"video",containerRef:C});/*#__PURE__*/return e.createElement("div",{className:"video-wrapper",style:{position:"relative"}},/*#__PURE__*/e.createElement("video",{ref:T,className:"video-js vjs-big-play-centered"}),b&&/*#__PURE__*/e.createElement(nn,{annotations:g,showAnnotations:S,surface:b,currentTime:O}))},image:function(t){var n=t.src,o=t.annotations,r=t.onFullScreen,a=t.showAnnotations,s=i(null),l=$t({type:"image",containerRef:s});/*#__PURE__*/return e.createElement("div",{className:"media-image-container"},/*#__PURE__*/e.createElement("div",{ref:s,className:"media-image-wrapper"},/*#__PURE__*/e.createElement("img",{src:n,alt:"Beautiful Image"}),/*#__PURE__*/e.createElement(nn,{annotations:o,showAnnotations:a,surface:l,currentTime:null})),/*#__PURE__*/e.createElement("button",{className:"media-fullscreen-button",onClick:r},"⛶"))}},an=function(t){/*#__PURE__*/return e.createElement("div",{className:"media-iframe-container"},/*#__PURE__*/e.createElement("div",{className:"media-iframe-wrapper"},/*#__PURE__*/e.createElement("iframe",{src:t.src,title:"Embedded content",allowFullScreen:t.allowFullScreen})))},sn=function(t){var r=t.src,s=t.annotations,l=void 0===s?[]:s,u=t.allowFullScreen,c=t.showAnnotations,d=void 0===c||c,m=i(null),p=function(e){var t=n(!1),r=t[0],i=t[1];return o(function(){var e=function(){return i(Boolean(document.fullscreenElement))};return document.addEventListener("fullscreenchange",e),function(){return document.removeEventListener("fullscreenchange",e)}},[]),{isFullscreen:r,toggle:a(function(){e.current&&(document.fullscreenElement?document.exitFullscreen():e.current.requestFullscreen())},[e])}}(m),f=p.isFullscreen,h=p.toggle;if(!r)return null;var v=Zt.getMediaKindFromSource(r);/*#__PURE__*/return e.createElement(on,{ref:m,fullscreen:f},/*#__PURE__*/e.createElement(rn[v.kind]||an,{src:r,annotations:l,allowFullScreen:u,onFullScreen:h,showAnnotations:d}))},ln=function(t){var n=t.displayAnnotations,o=Zt.stripExpandedLiterals(t.question),r=Zt.normalizeMediaContents(o[ie.HAS_MEDIA_CONTENT],ie.HAS_SOURCE);return r.length>0?/*#__PURE__*/e.createElement("div",{className:"col-6 "},r.map(function(t,o){var r;/*#__PURE__*/return e.createElement("div",{key:o,className:"embed-responsive-21by9 media-content-video-container mb-3"},/*#__PURE__*/e.createElement(sn,{src:t[ie.HAS_SOURCE],allowFullScreen:!0,annotations:null!=(r=t[ie.HAS_ANNOTATION])?r:[],showAnnotations:n}))})):/*#__PURE__*/e.createElement(e.Fragment,null)},un=/*#__PURE__*/function(t){function n(e){var o;return(o=t.call(this,e)||this).handleHintReveal=function(e){o.setState(e&&"boolean"==typeof e?{hintRevealed:e}:{hintRevealed:!o.state.hintRevealed})},o.handleAnswerChange=function(e,t){if(Ee.isSection(o.props.question)){var n=!!Ee.resolveValue(t);o.setState({expanded:n})}o._handleChange(ie.HAS_ANSWER,e,t)},o.handleSubQuestionChange=function(e,t){o._handleChange(ie.HAS_SUBQUESTION,e,t)},o.handleCommentChange=function(e,t){o._handleChange(ie.HAS_COMMENT,e,t)},o._toggleCollapse=function(){o.props.collapsible&&o.setState({expanded:!o.state.expanded})},o._onEnterHandler=function(){o.setState({showIcon:!0})},o._onLeaveHandler=function(){o.setState({showIcon:!1})},o._getHeaderClassName=function(){var e=o.props.question,t=o.props.collapsible,r=[];return r.push(n.getEmphasizedOnRelevantClass(e),"question-header"),Ee.isWizardStep(e)&&r.push("wizard-step bg-primary text-white"),Ee.isEmphasised(e)&&r.push(n.getEmphasizedClass(e)),Ee.isSection(e)&&r.push("section-background"),t&&r.push("cursor-pointer"),o.isDebugged(e)&&r.push("show-irrelevant"),r},pe.putObject(e.question["@id"],e.question),o.state={validator:{},expanded:!Ee.isCollapsed(e.question),showIcon:!1,hintRevealed:!1},o}te(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({validator:Ft(this.props.question,this.props.intl)})},o.componentDidUpdate=function(){var e=this.props.question,t=this.context.options.startingQuestionId,n=e[ie.HAS_SUBQUESTION].find(function(e){return e["@id"]===t});if(Ee.isSection(e)&&Ee.isAnswerable(e)){var o=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(n)return null;this.state.expanded&&!o&&this.setState({expanded:!1})}},o._handleChange=function(e,t,n){var o=Object.assign({},this.props.question);if(o[e][t]=n,e===ie.HAS_ANSWER){var r=this.state.validator(n);o=Object.assign({},o,r)}pe.putObject(o["@id"],o),this.props.onChange(this.props.index,o)},o.isDebugged=function(e){var t=this.context.options.startingQuestionId;return!Ee.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!me.findQuestionById(t,e,!0,!1,!1))},o.render=function(){var t=this.props.question,n=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},n):Ee.isHidden(t)?null:Ee.isRelevant(t)?n:null},o.renderQuestion=function(t){if(Ee.isAnswerable(t)&&!Ee.isSection(t))/*#__PURE__*/return e.createElement("div",{id:t["@id"]},/*#__PURE__*/e.createElement("div",{className:"panel-title answerable-question"},this.renderAnswers()),/*#__PURE__*/e.createElement("div",{className:"answerable-subquestions"},this.renderSubQuestions()));if(Ee.isAnswerable(t))return this.renderAnswerableSection();if(Ee.isSection(t)){var o=this.props,r=o.collapsible,i=o.withoutCard,a=n._getQuestionCategoryClass(t);if(i)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());var s=u.getLocalized(t[u.RDFS_LABEL],this.props.intl),l=/*#__PURE__*/e.createElement(g.Body,{className:k("p-3",a)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(A,{activeKey:this.state.expanded?s:void 0,className:"mb-3"},/*#__PURE__*/e.createElement(A.Item,{eventKey:s},/*#__PURE__*/e.createElement(g,{className:""},/*#__PURE__*/e.createElement(A.Button,{as:g.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onEnterHandler,onMouseLeave:this._onLeaveHandler,onFocus:this._onEnterHandler,onBlur:this._onLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"d-inline",id:t["@id"]},r&&!Ee.isWizardStep(t)&&this._renderCollapseToggle(),s),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(A.Body,{className:"p-0"},r?l:/*#__PURE__*/e.createElement(e.Fragment,null,l))))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())},o._renderQuestionContent=function(){var t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(ln,{key:this.props.question["@id"]+"-media",question:this.props.question,displayAnnotations:this.state.hintRevealed})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t},o.renderQuestionIcons=function(){return qt.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon,this.props.intl,this.state.hintRevealed,this.handleHintReveal)},o.renderAnswerableSection=function(){var t=this.props.question,o=this.props.collapsible,r=n._getQuestionCategoryClass(t),i=this.getShowIrrelevantClassname(t),a=/*#__PURE__*/e.createElement(g.Body,{className:k("p-3",r)},this.renderSubQuestions(i)),s=this._getHeaderClassName();return this.state.expanded&&s.push("text-primary"),/*#__PURE__*/e.createElement(A,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(g,{className:"mb-3"},/*#__PURE__*/e.createElement(g.Header,{onClick:this._toggleCollapse,className:s},this.renderAnswers()),o?/*#__PURE__*/e.createElement(A.Collapse,{className:i,eventKey:t["@id"]},a):{cardBody:a}))},o.getShowIrrelevantClassname=function(e){return!this.context.options.debugMode&&!ve.checkId(e[ie.HAS_SUBQUESTION],this.context.options.startingQuestionId)||Ee.hasAnswer(e)?"":"show-irrelevant"},o.renderAnswers=function(){for(var t,o=this.props.question,r=[],i=this._getAnswers(),a=0,s=i.length;a<s;a++)Ee.isTextarea(o,Ee.resolveValue(i[a]))||Ee.isSparqlInput(o)||Ee.isTurtleInput(o),t=k("answer",n._getQuestionCategoryClass(o),n.getEmphasizedOnRelevantClass(o)),r.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+a,className:t,id:o["@id"],onMouseEnter:this._onEnterHandler,onMouseLeave:this._onLeaveHandler,"data-question-origin":Se._getId(o[ie.HAS_QUESTION_ORIGIN]),onFocus:this._onEnterHandler,onBlur:this._onLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(kt,{index:a,answer:i[a],question:o,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon,hintRevealed:this.state.hintRevealed,onHintReveal:this.handleHintReveal})),this._renderUnits(),this._renderPrefixes()));return r},o._getAnswers=function(){var e=this.props.question;return e[ie.HAS_ANSWER]||(e[ie.HAS_ANSWER]=[]),Array.isArray(e[ie.HAS_ANSWER])||(e[ie.HAS_ANSWER]=[e[ie.HAS_ANSWER]]),0===e[ie.HAS_ANSWER].length&&(e[ie.HAS_ANSWER]=Ee.isSection(e)&&!Ee.isAnswerable(e)?[]:[je.generateAnswer(e)]),e[ie.HAS_ANSWER]},o._getAnswerWidthStyle=function(){var e=Number(this.props.question[ie.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:"calc("+e+"ch + 1.5rem + 2px)"}:{}},n._getAnswerClass=function(e,t){return t?"col-12":1===ie.GENERATED_ROW_SIZE?"col-6":"col-"+ie.COLUMN_COUNT/ie.GENERATED_ROW_SIZE},n._getQuestionCategoryClass=function(e){var t=Ee.getCategory(e);return t?"question-"+t:""},n.getEmphasizedClass=function(e){return Ee.isEmphasised(e)?"bg-warning":""},n.getEmphasizedOnRelevantClass=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""},o._renderCollapseToggle=function(){var t=this.props.intl.formatMessage(this.state.expanded?{id:"section.collapse"}:{id:"section.expand"});/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:t},/*#__PURE__*/e.createElement(this.state.expanded?vt:Et,{title:t}))},o._renderPrefixes=function(){var t=this.props.question;return t[ie.HAS_DECLARED_PREFIX]&&t[ie.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(Kt,{prefixes:t[ie.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(At,null)):null},o._renderUnits=function(){var t=this.props.question;return t[ie.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[ie.HAS_UNIT]):null},o.renderSubQuestions=function(t){for(var o=[],r=this._getSubQuestions(),i=this.context.options.debugMode,a=this.context.options.startingQuestionId,s=0;s<r.length;s++){var l=r[s],u=this.context.mapComponent(l,n),c=null;(i||"show-irrelevant"!==t||me.findQuestionById(a,l,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(u,{key:"sub-question-"+s,question:l,onChange:this.handleSubQuestionChange,index:s,intl:this.props.intl})),o.push(c)}return o},o._getSubQuestions=function(){var e=this.props.question;return e[ie.HAS_SUBQUESTION]||(e[ie.HAS_SUBQUESTION]=[]),Array.isArray(e[ie.HAS_SUBQUESTION])||(e[ie.HAS_SUBQUESTION]=[e[ie.HAS_SUBQUESTION]]),ve.orderByLocalizedLabels(e[ie.HAS_SUBQUESTION],this.props.intl),ve.orderPreservingToplogicalSort(e[ie.HAS_SUBQUESTION],ie.HAS_PRECEDING_QUESTION),e[ie.HAS_SUBQUESTION]},o._getFirstAnswerValue=function(){return Ee.resolveValue(this._getAnswers()[0])},n}(e.Component);un.contextType=Ie,un.propTypes={question:j.object.isRequired,onChange:j.func.isRequired,index:j.number,withoutCard:j.bool,collapsible:j.bool},un.defaultProps={withoutCard:!1,collapsible:!0};var cn=function(t){var n=r(Ve),o=n.updateFormQuestionsData,i=n.getFormQuestionsData,a=d(),s=i([t.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(un,{question:s,onChange:function(e,n){o(t.index||e,Object.assign({},t.question,n))},collapsible:Ee.isAnswerable(s),intl:a}),t.options.wizardStepButtons&&/*#__PURE__*/e.createElement(w,{className:"m-3 float-end"},!t.isFirstStep&&/*#__PURE__*/e.createElement(S,{className:"me-2",onClick:function(){t.onPreviousStep()},variant:"primary",size:"sm"},a.formatMessage({id:"wizard.previous"})),!t.isLastStep&&/*#__PURE__*/e.createElement(S,{onClick:function(){o(t.index,i()),t.onNextStep()},variant:"primary",size:"sm"},a.formatMessage({id:"wizard.next"}))))};cn.propTypes={options:j.object.isRequired,question:j.object.isRequired,index:j.number.isRequired,onNextStep:j.func,onPreviousStep:j.func,mapComponent:j.func,isFirstStep:j.bool,isLastStep:j.bool};var dn=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,a=r(Ie).options,s=d();/*#__PURE__*/return e.createElement(g.Header,null,/*#__PURE__*/e.createElement(H,{variant:"tabs",activeKey:i,onSelect:function(e){return o(parseInt(e))}},n.map(function(t,n){/*#__PURE__*/return e.createElement(St,{id:"step-disabled",tooltipContent:s.formatMessage({id:"wizard.nav.tooltip"}),show:!a.enableWizardStepSkip},/*#__PURE__*/e.createElement(D,{key:"nav"+n,id:"wizard-nav-"+n},/*#__PURE__*/e.createElement(V,{eventKey:n,active:n===i?"active":"",hidden:!a.debugMode&&!Ee.isRelevant(t),disabled:!a.enableWizardStepSkip,className:k([a.debugMode&&!Ee.isRelevant(t)?"show-irrelevant":un.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s))))})))};dn.propTypes={currentStep:j.number.isRequired,steps:j.array.isRequired,onNavigate:j.func.isRequired};var mn=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,a=r(Ie).options,s=d();/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(R,null,n.map(function(t,n){/*#__PURE__*/return e.createElement(St,{id:"step-disabled",tooltipContent:s.formatMessage({id:"wizard.nav.tooltip"}),show:!a.enableWizardStepSkip},/*#__PURE__*/e.createElement(L,{hidden:!a.debugMode&&!Ee.isRelevant(t),key:"nav"+n,onClick:function(){return o(n)},id:"wizard-nav-"+n,action:!0,active:n===i?"active":"",disabled:!a.enableWizardStepSkip,variant:"default",className:k([a.debugMode&&!Ee.isRelevant(t)?"show-irrelevant":un.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],d())))})))};function pn(e){var t=e.id,n=e.dataAttributes,r=void 0===n?[]:n,i=e.scrollOptions,a=void 0===i?{behavior:"smooth"}:i,s=e.highlightClass,l=void 0===s?"text-danger":s;o(function(){var e=null;if(t&&(e=document.getElementById(t)),!e&&Object.keys(r).length>0){var n=Object.entries(r).map(function(e){return"[data-"+e[0]+'="'+e[1]+'"]'}).join("");e=document.querySelector(n)}e&&(e.scrollIntoView(a),l&&e.classList.add(l))},[t,r,a,l])}mn.propTypes={currentStep:j.number.isRequired,steps:j.array.isRequired,onNavigate:j.func.isRequired};var fn,hn=function(e,t,n){console.log(n,e,t);var o=function n(o,r){return o?Se._getId(o[e])===t?r:me.asArray(o[ie.HAS_SUBQUESTION]).findIndex(function(e,t){return-1!==n(e,t)}):-1};return n.findIndex(function(e,t){return-1!==o(e,t)})},vn=function(){var t=e.useContext(Ve),n=e.useContext(Ie),o=n.options,r=n.mapComponent,i=0;o.startingQuestionId?-1===(i=hn("@id",o.startingQuestionId,t.getFormQuestionsData()))&&(console.warn("Question with id "+o.startingQuestionId+" not found!"),i=0):o.startingQuestionOrigin?-1===(i=hn(ie.HAS_QUESTION_ORIGIN,o.startingQuestionOrigin,t.getFormQuestionsData()))&&(console.warn("Question with question origin "+o.startingQuestionOrigin+" not found!"),i=0):o.startingStep&&(i=o.startingStep<t.getFormQuestionsData().length?o.startingStep:0);var a=e.useState(i),s=a[0],l=a[1];pn({id:o.startingQuestionId,dataAttributes:{"question-origin":[o.startingQuestionOrigin]}});var u,c=null;t.getFormQuestionsData().length>1&&(u=t.getFormQuestionsData(),c=/*#__PURE__*/e.createElement(o.horizontalWizardNav?dn:mn,{currentStep:s,steps:u,onNavigate:function(e){var n=t.getFormQuestionsData();e===s||e>=n.length||e>s&&!n[e].visited&&!o.enableWizardStepSkip||l(e)}}));var d,m,p=o.horizontalWizardNav;/*#__PURE__*/return e.createElement(g,{className:p?"":"flex-row p-3"},c,/*#__PURE__*/e.createElement("div",{className:p?"card-body p-3":c?"col-10 p-0 pl-3":"col-12 p-0"},(m=r(d=t.getFormQuestionsData()[s],cn),/*#__PURE__*/e.createElement(m,{options:o,key:"step"+s,question:d,onNextStep:function(){var e=t.getFormQuestionsData();s!==e.length-1&&(e[s+1].visited=!0,l(function(e){return e+1}))},onPreviousStep:function(){0!==s&&l(function(e){return e-1})},mapComponent:r,index:s,isFirstStep:0===s,isLastStep:s===t.getFormQuestionsData().length-1}))))},En=/*#__PURE__*/e.forwardRef(function(t,n){var o=e.useContext(Ie).options;/*#__PURE__*/return e.createElement(M,ee({size:"xl",animation:!0},o.modalProps),/*#__PURE__*/e.createElement(M.Header,{closeButton:!0},/*#__PURE__*/e.createElement(M.Title,null,o.modalProps.title)),/*#__PURE__*/e.createElement(M.Body,{className:"overflow-hidden p-0"},t.children))});En.propTypes={children:j.element.isRequired};var An=function(){};fn=An,An.updateQuestionValidation=function(e,t,n,o){var r=Ft(t,o)();r&&(e[n]=Object.assign({},t,r));for(var i,a=$(e);!(i=a()).done;)fn.updateSubQuestionsValidation(i.value,o)},An.updateSubQuestionsValidation=function(e,t){for(var n=me.asArray(e[ie.HAS_SUBQUESTION]),o=0;o<n.length;o++)fn.updateQuestionValidation(n,n[o],o,t)};var gn=function(){var t=d(),n=r(Ve),o=n.updateFormQuestionsData,i=n.getFormQuestionsData,a=e.useContext(Ie),s=a.options,l=a.mapComponent;pn({id:s.startingQuestionId,dataAttributes:{"question-origin":[s.startingQuestionOrigin]}});var u=i();/*#__PURE__*/return e.createElement(g,{className:"p-3"},u.map(function(n,r){return a=r,s=l(i=n,un),/*#__PURE__*/e.createElement(s,{key:i["@id"],question:i,onChange:function(e,t){return function(e,t,n){o(t,Object.assign({},e,n))}(i,e,t)},index:a,intl:t});var i,a,s}))},Sn=/*#__PURE__*/s(function(t,n){var o=r(Ve),i=o.getFormQuestionsData,a=o.updateFormQuestionsData,s=o.getData,u=d();l(n,function(){return{validateForm:m,getFormSpecification:p,getFormQuestionsData:i,getFormData:c}},[]);var c=function(){var e=s(),t=i();return je.buildQuestionAnswerModel(e,t)},m=function(){for(var e=i(),t=0;t<e.length;t++)An.updateQuestionValidation(e,e[t],t,u);a(null,e)},p=function(){var e=i();return Ee.getFormSpecification(e)},f=t.modalView,h=i();if(!h.length)/*#__PURE__*/return e.createElement(g,{className:"p-3 font-italic"},"There are no questions available...");var v=h.every(function(e){return!Ee.isWizardStep(e)}),E=/*#__PURE__*/e.createElement(v?gn:vn,null);return f?/*#__PURE__*/e.createElement(En,null,E):E}),_n=/*#__PURE__*/s(function(t,r){var i=n(!0),a=i[0],s=i[1],l=n(null),u=l[0],c=l[1],m=n(null),p=m[0],f=m[1],h=d();if(o(function(){!function(){try{return Promise.resolve(_e.constructForm(t.form,h)).then(function(e){var t=e[0],n=e[1];t.formQuestions.some(function(e){return Ee.isWizardStep(e)})&&(t.formQuestions[0].visited=!0),c(t),f(n),s(!1)})}catch(e){return Promise.reject(e)}}()},[t.form,h]),a)return t.loader||/*#__PURE__*/e.createElement(g,{className:"p-3 font-italic"},"Loading SForms...");var v=function(e,t){return function(n,o){if(!e)return o;for(var r,i=$(e);!(r=i()).done;){var a=r.value,s=a.component;if((0,a.mapRule)(n,t))return s}return o}}(t.componentMapRules,p);/*#__PURE__*/return e.createElement(be,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:v,options:t.options},/*#__PURE__*/e.createElement(ye,null,/*#__PURE__*/e.createElement(we,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(Me,{data:p,formQuestions:u.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(Sn,{ref:r,modalView:t.options&&t.options.modalView,mapComponent:v})))))});_n.propTypes={form:j.object.isRequired,options:j.object.isRequired,componentMapRules:j.array,components:j.object,componentsOptions:j.object,fetchTypeAheadValues:j.func,isFormValid:j.func,loader:j.element};var Tn=/*#__PURE__*/s(function(t,n){var o;/*#__PURE__*/return e.createElement(ue,{locale:null==(o=t.options)||null==(o=o.intl)?void 0:o.locale},/*#__PURE__*/e.createElement(_n,ee({ref:n},t)))});Tn.propTypes={form:j.object.isRequired,options:j.object.isRequired,componentMapRules:j.array,components:j.object,componentsOptions:j.object,fetchTypeAheadValues:j.func,isFormValid:j.func,loader:j.element,enableOptionQuestionFeedback:j.bool};export{kt as Answer,Ie as ConfigurationContext,ie as Constants,Ve as FormQuestionsContext,Ee as FormUtils,_t as HelpIcon,ue as IntlContextProvider,Se as JsonLdFramingUtils,pe as JsonLdObjectMap,ve as JsonLdObjectUtils,un as Question,qt as QuestionStatic,cn as WizardStep,Tn as default};
|
|
1
|
+
import e,{useMemo as t,useState as n,useEffect as o,useContext as r,useRef as i,useCallback as a,forwardRef as s,useImperativeHandle as l}from"react";import*as u from"jsonld-utils";import{IntlProvider as c,useIntl as d}from"react-intl";import"core-js/modules/es.array.some.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/web.dom-collections.for-each.js";import*as m from"jsonld";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.array.is-array.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.string.repeat.js";import p from"@kbss-cvut/tsort";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import{Form as f,FormGroup as v,FormControl as h,Alert as E,Accordion as g,Card as A,Button as S,OverlayTrigger as _,Tooltip as T,Col as N,Row as I,Badge as O,Overlay as C,FormText as y,Popover as b,ListGroup as R,ListGroupItem as w,ButtonToolbar as L,Nav as H,NavItem as D,NavLink as V,Modal as M}from"react-bootstrap";import"core-js/modules/es.object.assign.js";import P from"prop-types";import"core-js/modules/es.number.constructor.js";import"core-js/modules/es.number.max-safe-integer.js";import j from"react-dom";import"core-js/modules/es.date.to-string.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.every.js";import"core-js/modules/es.array.find-index.js";import U from"react-datepicker";import{parse as x,format as q}from"date-fns";import k from"classnames";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.object.get-own-property-names.js";import F from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import"core-js/modules/web.timers.js";import z from"inputmask-core";import"core-js/modules/es.string.trim.js";import{IntelligentTreeSelect as Q}from"intelligent-tree-select/lib/components/IntelligentTreeSelect";import B from"intelligent-tree-select/lib/components/Option";import"intelligent-tree-select/lib/styles.css";import"core-js/modules/es.array.splice.js";import"core-js/modules/es.date.now.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import W from"javascript-time-ago";import Y from"javascript-time-ago/locale/en";import X from"javascript-time-ago/locale/cs";import{motion as G}from"framer-motion";import{Rings as K}from"react-loader-spinner";import"core-js/modules/es.parse-int.js";import"core-js/modules/es.number.is-integer.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.parse-float.js";import"core-js/modules/es.string.split.js";import"core-js/modules/es.string.starts-with.js";import"video.js/dist/video-js.css";import"core-js/modules/es.array.reduce.js";import J from"video.js";import"core-js/modules/es.array.fill.js";import"core-js/modules/es.object.entries.js";function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ee.apply(null,arguments)}function te(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oe(e,t)}function ne(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oe(e,t)}var re,ie=function(){};re=ie,ie.COLUMN_COUNT=12,ie.INPUT_LENGTH_THRESHOLD=50,ie.DATETIME_NUMBER_FORMAT="x",ie.EPOCH_MILLISECONDS="epoch-milliseconds",ie.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",ie.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",ie.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",ie.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",ie.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",ie.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",ie.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",ie.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",ie.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",ie.LAYOUT={FORM:"form",QUESTION_SECTION:"section",WIZARD_STEP:"wizard-step",DATE:"date",TIME:"time",DATETIME:"datetime",TEXT:"text",TEXTAREA:"textarea",CHECKBOX:"checkbox",QUESTION_TYPEAHEAD:"type-ahead",MASKED_INPUT:"masked-input",ANSWERABLE:"answerable",SPARQL:"sparql",TURTLE:"ttl",DISABLED:"disabled",HIDDEN:"hidden",COLLAPSED:"collapsed",EMPHASISED:"emphasised",EMPHASISE_ON_RELEVANT:"emphasise-on-relevant",CATEGORY:["category-1","category-2","category-3","category-4","category-5"]},ie.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",ie.VALUE_TYPE_CODE="code",ie.VALUE_TYPE_TEXT="text",ie.GENERATED_ROW_SIZE=1,ie.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",ie.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",ie.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",ie.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",ie.HELP_DESCRIPTION="http://purl.org/dc/terms/description",ie.SOURCE="http://purl.org/dc/terms/source",ie.XSD={MAX_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxExclusive",MAX_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxInclusive",MIN_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#minExclusive",MIN_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#minInclusive",INT:"http://www.w3.org/2001/XMLSchema#int",INTEGER:"http://www.w3.org/2001/XMLSchema#integer",NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#negativeInteger",NON_NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",NON_POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#positiveInteger",FLOAT:"http://www.w3.org/2001/XMLSchema#float",POSITIVE_FLOAT:"http://www.w3.org/2001/XMLSchema#positiveFloat",NEGATIVE_FLOAT:"http://www.w3.org/2001/XMLSchema#negativeFloat",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},ie.STEP="http://onto.fel.cvut.cz/ontologies/form/step",ie.PATTERN="http://onto.fel.cvut.cz/ontologies/form/pattern",ie.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",ie.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",ie.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",ie.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",ie.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",ie.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",ie.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",ie.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",ie.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",ie.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",ie.HAS_CORRECT_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-correct-answer-value",ie.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",ie.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",ie.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",ie.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",ie.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",ie.USED_ONLY_FOR_COMPLETENESS="http://onto.fel.cvut.cz/ontologies/form/used-only-for-completeness",ie.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",ie.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",ie.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",ie.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",ie.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",ie.ASSET="http://onto.fel.cvut.cz/ontologies/form/media/asset",ie.HAS_SOURCE="http://onto.fel.cvut.cz/ontologies/form/media/has-source",ie.HAS_ANNOTATION="http://onto.fel.cvut.cz/ontologies/form/media/has-annotation",ie.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",ie.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",ie.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",ie.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",ie.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",ie.PREFIX="http://www.w3.org/ns/shacl#prefix",ie.NAMESPACE="http://www.w3.org/ns/shacl#namespace",ie.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",ie.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",ie.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",ie.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",ie.TIME_FORMAT="http://onto.fel.cvut.cz/ontologies/form/time-format",ie.DATE_FORMAT="http://onto.fel.cvut.cz/ontologies/form/date-format",ie.DATETIME_FORMAT="http://onto.fel.cvut.cz/ontologies/form/datetime-format",ie.TIMESTAMP_FORMAT="http://onto.fel.cvut.cz/ontologies/form/timestamp-format",ie.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",ie.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",ie.HAS_VALIDATION_SEVERITY="http://onto.fel.cvut.cz/ontologies/form/has-validation-severity",ie.RDFS_LABEL=u.RDFS_LABEL,ie.RDFS_COMMENT=u.RDFS_COMMENT,ie.DEFAULT_HAS_CHILD=u.DEFAULT_HAS_CHILD,ie.BROADER="http://www.w3.org/2004/02/skos/core#broader",ie.HAS_NON_SELECTABLE_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-non-selectable-value",ie.PROVIDES_DEREFERENCEABLE_ANSWER_VALUES="http://onto.fel.cvut.cz/ontologies/form/provides-dereferenceable-answer-values",ie.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink",QUESTION_HINT:"questionHint"},ie.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},ie.DEFAULT_OPTIONS={icons:[{id:re.ICONS.QUESTION_HELP,behavior:re.ICON_BEHAVIOR.ENABLE},{id:re.ICONS.QUESTION_COMMENTS,behavior:re.ICON_BEHAVIOR.ON_HOVER},{id:re.ICONS.QUESTION_LINK,behavior:re.ICON_BEHAVIOR.ON_HOVER},{id:re.ICONS.QUESTION_HINT,behavior:re.ICON_BEHAVIOR.DISABLE}],enableOptionQuestionFeedback:!1},ie.ANNOTATION={HAS_ANNOTATION_TYPE:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-annotation-type",HAS_START_TIME:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-start-time",HAS_END_TIME:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-end-time",HAS_GEOMETRY_POINTS:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-geometry-points",HAS_OPACITY:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-opacity",HAS_COLOR:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-color"},ie.POLYLINE_ANNOTATION={IMPLICIT_TYPE_LABEL:"polyline",HAS_STROKE_WIDTH:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-stroke-width",HAS_FILL_COLOR:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-fill-color",DEFAULT_POLYLINE_ANNOTATION_STYLE:{color:"red",strokeWidth:2e-6,fillColor:"transparent",opacity:1}},ie.TEXT_ANNOTATION={IMPLICIT_TYPE_LABEL:"text",HAS_FONT_SIZE:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-font-size",HAS_FONT_WEIGHT:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-font-weight",HAS_TEXT:"http://onto.fel.cvut.cz/ontologies/form/media/annotation/has-text",DEFAULT_TEXT_ANNOTATION_STYLE:{text:"Hello world",color:"red",fontSizeInNormalizedPx:.05,fontWeight:"300",fontFamily:"sans-serif",fontColor:"red",opacity:1}},ie.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}},ie.VALIDATION={SEVERITY:{ERROR:"error",WARNING:"warning"},DEFAULT_MESSAGE:{REQUIRED:"This field is required.",REQUIRED_ONLY_FOR_COMPLETENESS:"This field is required to complete the form.",INVALID:"This field is invalid.",CHECK:"This field must be checked.",LOWER_OR_EQUAL:"This field should be a number equal or lower to ",GREATER_OR_EQUAL:"This field must be greater or equal to "},CLASSNAME:{ERROR:"is-invalid",WARNING:"is-warning"}};var ae={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)","wizard.nav.tooltip":"Navigace na této kartě je zakázána, aby nedošlo k přehlédnutí důležitých otázek. K navigaci na tuto kartu použijte tlačítka související s formulářem.","wizard.next":"Další","wizard.previous":"Předchozí","section.expand":"Rozbalit","section.collapse":"Sbalit","validation.required":"Toto pole je povinné.","validation.required_only_for_completeness":"Toto pole je povinné pro vyplnění formuláře.","validation.invalid":"Toto pole je neplatné.","validation.check":"Toto pole musí být zkontrolováno.","validation.lower_or_equal":"Toto pole by mělo být číslo rovné nebo nižší než ","validation.greater_or_equal":"Toto pole musí být větší nebo rovno ","error.default_message":"Něco se pokazilo.","error.view_details":"Zobrazit podrobnosti o chybě","comment.unknownAuthor":"Neznámý autor"},se={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)","wizard.nav.tooltip":"Navigation to this tab is disabled to prevent overlooking important questions. Use form-related buttons to navigate to this tab instead.","wizard.next":"Next","wizard.previous":"Previous","section.expand":"Expand","section.collapse":"Collapse","validation.required":"This field is required.","validation.required_only_for_completeness":"This field is required to complete the form.","validation.invalid":"This field is invalid.","validation.check":"This field must be checked.","validation.lower_or_equal":"This field should be a number equal or lower to ","validation.greater_or_equal":"This field must be greater or equal to ","error.default_message":"Something went wrong.","error.view_details":"View Error Details","comment.unknownAuthor":"Unknown Author"},le=/*#__PURE__*/e.createContext({}),ue=function(t){var n=t.locale,o=void 0===n?navigator.language:n,r=se;return o===ie.LANG.cs.locale&&(r=ae),/*#__PURE__*/e.createElement(le.Provider,{value:{locale:o,lang:r}},/*#__PURE__*/e.createElement(c,{locale:o,messages:r},t.children))},ce={"@graph":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":"form","http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["wizard-step","section"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["textarea"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_answer":{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/answer","http://onto.fel.cvut.cz/ontologies/documentation/has_data_value":""}}]}]}]},de=/*#__PURE__*/function(){function e(){}return e.generateForm=function(){return JSON.parse(JSON.stringify(ce))},e}(),me=/*#__PURE__*/function(){function e(){}return e.getStringHash=function(e){var t=0,n=e?e.length:0;if(0===n)return t;for(var o=0;o<n;o++)t=(t<<5)-t+e.charCodeAt(o),t&=t;return t},e.asArray=function(e){return e?e.constructor===Array?e:[e]:[]},e.findQuestionById=function(t,n,o,r,i){if(o&&n["@id"]===t)return n;var a=e.asArray(n[ie.HAS_SUBQUESTION]);if(r)for(var s,l=$(a);!(s=l()).done;){var u=e.findQuestionById(t,s.value,!0,!1,!1);if(u)return u}if(i)for(var c,d=$(a);!(c=d()).done;){var m=e.findQuestionById(t,c.value,!1,!0,!0);if(m)return m}return null},e.findKeyInObjects=function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n].hasOwnProperty(t[o]))return t[o];return null},e.isOptionQuestionFeedbackEnabled=function(e){var t;return null!=(t=null==e?void 0:e.enableOptionQuestionFeedback)&&t},e}(),pe=/*#__PURE__*/function(){function e(){}return e.putObject=function(t,n){e.objectMap[t]=n},e.getObject=function(t){return e.objectMap[t]},e}();pe.objectMap={};var fe,ve,he=/*#__PURE__*/function(){function e(){}return e.getFirstObject=function(e,t){var n=m.getValues(e,t);return 0===n.length?null:n[0]},e.compareValues=function(e,t){return t="object"==typeof t?t:{"@value":t},!!((e="object"==typeof e?e:{"@value":e})&&e["@value"]&&t&&t["@value"]&&("string"==typeof e["@value"]?e["@value"]:JSON.stringify(e["@value"]))===("string"==typeof t["@value"]?t["@value"]:JSON.stringify(t["@value"])))||m.compareValues(e,t)},e.toplogicalSort=function(e,t){var n;do{n=!1;for(var o=0;o<e.length;o++)for(var r=o;r<e.length;r++)if(e[o][t]&&("object"==typeof e[o][t]?e[o][t]["@id"]:e[o][t])===e[r]["@id"]){var i=e[o];e[o]=e[r],e[r]=i,n=!0;break}}while(n);return e},e.orderPreservingToplogicalSort=function(e,t){for(var n=p(),o={},r=function(){var r=e[i]["@id"];n.add(r),o[r]=e[i],me.asArray(e[i][t]).map(function(e){return"object"==typeof e?e["@id"]:e}).map(function(e){return[e,r]}).forEach(function(e){return n.add(e)})},i=0;i<e.length;i++)r();for(var a=n.sort(),s=0;s<a.length;s++)e[s]=o[a[s]];return e},e.getCompareLocalizedLabelFunction=function(e){return function(t,n){var o=u.getLocalized(t[u.RDFS_LABEL],e),r=u.getLocalized(n[u.RDFS_LABEL],e);return o<r?-1:o>r?1:0}},e.orderByLocalizedLabels=function(t,n){return t.sort(e.getCompareLocalizedLabelFunction(n))},e.checkId=function(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(function(e){return e["@id"]===t}):e.constructor===Object?e["@id"]===t:void 0},e}(),Ee=/*#__PURE__*/function(){function e(){}return e.isForm=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.FORM)},e.isWizardStep=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.WIZARD_STEP)},e.isSection=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.QUESTION_SECTION)},e.isAnswerable=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.ANSWERABLE)},e.isTypeahead=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.QUESTION_TYPEAHEAD)},e.getPossibleValuesQuery=function(e){return u.getJsonAttValue(e,ie.HAS_OPTIONS_QUERY)},e.isDisabled=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DISABLED)},e.isHidden=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.HIDDEN)},e.isTextarea=function(t,n){return n&&n.length>ie.INPUT_LENGTH_THRESHOLD&&!e.isTypeahead(t)||u.hasValue(t,ie.LAYOUT_CLASS,ie.LAYOUT.TEXTAREA)},e.isText=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TEXT)},e.isCalendar=function(t){return e.isDate(t)||e.isTime(t)||e.isDateTime(t)},e.isDate=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DATE)},e.isTime=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TIME)},e.isDateTime=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.DATETIME)},e.isTimestamp=function(e){return u.hasValue(e,ie.TIMESTAMP_FORMAT,ie.EPOCH_MILLISECONDS)},e.isCheckbox=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.CHECKBOX)},e.isMaskedInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.MASKED_INPUT)},e.isSparqlInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.SPARQL)},e.isTurtleInput=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.TURTLE)},e.isCollapsed=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.COLLAPSED)},e.isEmphasised=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.EMPHASISED)},e.getCategory=function(e){return ie.LAYOUT.CATEGORY.find(function(t){return u.hasValue(e,ie.LAYOUT_CLASS,t)})},e.resolveValue=function(e){return e?e[ie.HAS_OBJECT_VALUE]?e[ie.HAS_OBJECT_VALUE]["@id"]:u.getJsonAttValue(e,ie.HAS_DATA_VALUE):null},e.resolveValueObject=function(e){return e?e[ie.HAS_OBJECT_VALUE]?me.asArray(e[ie.HAS_OBJECT_VALUE])[0]:e[ie.HAS_DATA_VALUE]?me.asArray(e[ie.HAS_DATA_VALUE])[0]:null:null},e.isRelevant=function(t){if(!t[ie.IS_RELEVANT_IF])return!0;for(var n,o=$(me.asArray(t[ie.IS_RELEVANT_IF]));!(n=o()).done;)if(!e.testCondition(n.value))return!1;return!0},e.hasValidationLogic=function(e){return!!(e[ie.REQUIRES_ANSWER]||e[ie.REQUIRES_ANSWER_IF]||e[ie.PATTERN]||this.containsXSDProperty(e))},e.isValid=function(e){if(!1===e[ie.HAS_VALID_ANSWER])return!1;for(var t,n=$(me.asArray(e[ie.HAS_SUBQUESTION]));!(t=n()).done;)if(!1===this.isValid(t.value))return!1;return!0},e.testOrCondition=function(e){var t=e[ie.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(var n,o=$(this._getMappedObjectsArray(t));!(n=o()).done;)if(this.testCondition(n.value))return!0;return!1},e.testCondition=function(t){var n,o=t[ie.ACCEPTS_VALIDATION_VALUE],r=t[ie.ACCEPTS_ANSWER_VALUE],i=t[ie.ACCEPTS],a=t[ie.HAS_TESTED_QUESTION];if(t[ie.HAS_SUB_CONDITION])return this.testOrCondition(t);if(o&&r&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),i&&a){var s=me.asArray(i);if(1!==s.length&&console.warn("Support for multiple accepts values is not implemented !"),s[0]["@id"]===ie.ANSWERED_QUESTION){(r||o)&&console.warn("Support for accepted answer/validations values is not implemented !");for(var l,u=$(this._getMappedObjectsArray(a));!(l=u()).done;)if(!this.hasAnswer(l.value))return!1;return!0}console.warn("No support to accept question of type "+s[0]["@id"]+" !")}if(o&&a){var c=me.asArray(o);(1!==c.length||!0!==c[0]&&"true"!==c[0])&&console.warn('Validation values other than "true" are not implemented !');for(var d,p=$(me.asArray(a));!(d=p()).done;){if(void 0===(n=pe.getObject(d.value["@id"])))return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(n))return!1}return!0}if(r&&a){n=pe.getObject(a["@id"]);for(var f,v=$(me.asArray(r));!(f=v()).done;){var h=f.value;if(!n)return console.warn("Question is not defined."),!0;if(!n.hasOwnProperty(ie.HAS_ANSWER))return!1;var E=m.getValues(n,ie.HAS_ANSWER);if(0===E.length)return!1;var g=e.resolveValueObject(E[0]);if(g&&h&&g.hasOwnProperty("@value")&&h.hasOwnProperty("@id")&&g["@value"]==h["@id"])return!0;if(he.compareValues(g,h))return!0}}return!1},e._getMappedObjectsArray=function(e,t){return me.asArray(e).map(function(e){var n=pe.getObject(e["@id"]);return void 0===n?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):n}).filter(function(e){return null!==e})},e.hasAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(ie.HAS_ANSWER)){var n=m.getValues(t,ie.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return!0}}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasAnswer(r.value))return!0;return!1},e.hasCorrectAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(ie.HAS_CORRECT_ANSWER)){var n=m.getValues(t,ie.HAS_CORRECT_ANSWER);if(Array.isArray(n)&&0!==n.length){var o=e.resolveValueObject(n=n[0]);if(o&&(o["@value"]||o["@id"]))return!0}return!(!n["@value"]&&!n["@id"])}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasCorrectAnswer(r.value))return!0;return!1},e.getAnswerValue=function(t){if(!t)return null;if(t.hasOwnProperty(ie.HAS_ANSWER)){var n=m.getValues(t,ie.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return o["@value"]||o["@id"]}}for(var r,i=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(r=i()).done;){var a=e.getAnswerValue(r.value);if(a)return a}return null},e.getCorrectAnswerValue=function(t){if(!t)return null;if(t.hasOwnProperty(ie.HAS_CORRECT_ANSWER)){var n,o,r=m.getValues(t,ie.HAS_CORRECT_ANSWER);if(!r)return null;Array.isArray(r)&&(r=r[0]);var i=m.getValues(r,ie.HAS_DATA_VALUE)||m.getValues(r,ie.HAS_OBJECT_VALUE);if(i&&(!Array.isArray(i)||i.length>0)){var a;Array.isArray(i)&&(i=i[0]);var s,l=i[ie.RDFS_LABEL];return l?null!=(s=l["@value"])?s:l:null!=(a=i["@value"])?a:null}return null!=(n=null!=(o=r["@value"])?o:r[ie.RDFS_LABEL])?n:null}for(var u,c=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(u=c()).done;){var d=e.getCorrectAnswerValue(u.value);if(d)return d}return null},e.resolveDateTimeFormat=function(t,n,o){var r=e.isDate(t),i=e.isTime(t),a=e.isDateTime(t);switch(!0){case r:return t[ie.DATE_FORMAT]||o.dateFormat;case i:return t[ie.TIME_FORMAT]||o.timeFormat;case a:return t[ie.DATETIME_FORMAT]||o.dateTimeFormat;default:return null}},e.dfsTraverseQuestionTree=function(e,t,n){function o(e){t(e),me.asArray(e[ie.HAS_SUBQUESTION]).forEach(function(e){o(e)}),n(e)}void 0===n&&(n=function(){}),e.forEach(function(e){o(e)})},e.getFormSpecification=function(t){var n=-1,o="..",r="";return e.dfsTraverseQuestionTree(t,function(e){var t=" ".repeat(n+=1),i="";e[ie.REQUIRES_ANSWER]&&!e[ie.USED_ONLY_FOR_COMPLETENESS]?i=t+o+"required: "+e[ie.REQUIRES_ANSWER]+"\n":e[ie.USED_ONLY_FOR_COMPLETENESS]&&(i=t+o+"required only for completeness: "+e[ie.USED_ONLY_FOR_COMPLETENESS]+"\n"),r+=t+e["http://www.w3.org/2000/01/rdf-schema#label"]+"\n",r+=e[ie.HELP_DESCRIPTION]?t+o+"description: "+e[ie.HELP_DESCRIPTION]+"\n":"",r+=i,r+=e[ie.PATTERN]?t+o+"pattern: "+e[ie.PATTERN]+"\n":"",r+=e[ie.INPUT_MASK]?t+o+"mask: "+e[ie.INPUT_MASK]+"\n":"",r+=e[ie.XSD.MAX_INCLUSIVE]?t+o+"This field should be a number equal or lower to "+e[ie.XSD.MAX_INCLUSIVE]+"\n":"",r+=e[ie.XSD.MIN_INCLUSIVE]?t+o+"This field must be greater or equal to "+e[ie.XSD.MIN_INCLUSIVE]+"\n":"",r+=e[ie.HAS_VALIDATION_MESSAGE]?t+o+"validation-message: "+e[ie.HAS_VALIDATION_MESSAGE]+"\n":"",r+="\n"},function(){n-=1}),r},e.containsXSDProperty=function(e){for(var t=Object.keys(e),n=0,o=Object.values(ie.XSD);n<o.length;n++)if(t.includes(o[n]))return!0;return!1},e.getInputMask=function(e){if(e[ie.INPUT_MASK])return e[ie.INPUT_MASK]},e.hasMediaContentWithAnnotations=function(e){if(e[ie.HAS_MEDIA_CONTENT])for(var t,n=$(me.asArray(e[ie.HAS_MEDIA_CONTENT]));!(t=n()).done;){var o=t.value;if(o[ie.HAS_ANNOTATION]&&me.asArray(o[ie.HAS_ANNOTATION]).length>0)return!0}return!1},e.containsHints=function(t){if(t[ie.HAS_SUBQUESTION])for(var n,o=$(me.asArray(t[ie.HAS_SUBQUESTION]));!(n=o()).done;)if(e.containsHints(n.value))return!0;return this.hasCorrectAnswer(t)||this.hasMediaContentWithAnnotations(t)},e}(),ge=/*#__PURE__*/function(){function e(){}return e.log=function(e){console.log(e)},e.warn=function(e){console.warn?console.warn(e):console.log("WARNING: "+e)},e.error=function(e){console.error?console.error(e):console.log("ERROR: "+e)},e}(),Ae={root:(fe={},fe[ie.HAS_LAYOUT_CLASS]=ie.FORM,fe),expandProperties:[ie.HAS_SUBQUESTION,ie.IS_RELEVANT_IF,ie.HAS_ANSWER,ie.HAS_DECLARED_PREFIX,ie.HAS_OPTION,ie.HAS_CORRECT_ANSWER,ie.HAS_COMMENT,ie.HAS_MEDIA_CONTENT,ie.HAS_ANNOTATION]},Se=/*#__PURE__*/function(){function e(){}return e.customFrame=function(e,t,n){if(arguments.length<2)return m.nextTick(function(){n(new TypeError("Could not frame, too few arguments."))});null===t&&(t=Ae),m.flatten(e,null,null,function(e,t){})},e.expandStructure=function(e){var t,n={};e["@graph"].forEach(function(e){n[e["@id"]]=e,Ee.isForm(e)&&(t=e)});try{this._expandGraph(t,Ae,n)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return n},e._expandGraph=function(e,t,n){var o,r,i,a=this;t.expandProperties.forEach(function(s){if(e.hasOwnProperty(s)){e[s]=me.asArray(e[s]),o=e[s];for(var l=0;l<o.length;l++)i=a._getId(o[l]),void 0!==(r=n[i])?(o[l]=r,a._expandGraph(r,t,n)):console.warn("object with @id "+i+" was not defined in input data.")}})},e._getId=function(e){return"string"==typeof e?e:e&&"object"==typeof e?e["@id"]:void 0},e}();ve=Se,Se.compressStructure=function(e){var t=[],n=new Set;return(t=ve._compressGraph(e,t,n)).sort(function(e,t){return e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0})},Se._compressGraph=function(e,t,n){return n.has(e["@id"])||(t.push(e),n.add(e["@id"])),Ae.expandProperties.forEach(function(o){if(e.hasOwnProperty(o))for(var r=e[o],i=0;i<r.length;i++){var a=r[i];void 0!==a&&(r[i]=a,t=ve._compressGraph(a,t,n),e[o][i]={"@id":a["@id"]})}}),t};var _e=/*#__PURE__*/function(){function e(){}return e.constructDefaultForm=function(t){var n=de.generateForm();return e._constructFormQuestions(n,t)},e.constructForm=function(t,n){try{var o,r;return Promise.resolve(m.flatten(t,{}).then(function(t){try{var i=e._constructFormQuestions(t,n);r=i[1],o={formQuestions:i[0]}}catch(e){console.error("Error while constructing form questions from the provided structure:",e)}if(!r){var a=e.constructDefaultForm(n);r=a[1],o={formQuestions:a[0]}}return[o,r]}).catch(function(e){return console.error("Failed to flatten the JSON-LD structure. Expected to transform a nested JSON-LD document into a flattened array of node objects:",e),[o,r]}))}catch(e){return Promise.reject(e)}},e._constructFormQuestions=function(e,t){var n,o,r,i=[];if(void 0!==e["@graph"][0]["@id"]?(r=Se.expandStructure(e),Object.keys(r).map(function(e){pe.putObject(e,r[e])})):console.warn("default form is constructed."),!(o=(n=e["@graph"].find(function(e){return Ee.isForm(e)}))[ie.HAS_SUBQUESTION]))throw ge.error("Could not find any questions in the received data."),"No questions in the form";return(i=o.filter(function(e){return!(!Ee.isWizardStep(e)||Ee.isHidden(e))||(ge.warn("Item is not a wizard step: "+e),!1)})).length||(ge.log("Could not find any wizard steps in the received data. Building form without steps"),n[ie.HAS_SUBQUESTION].forEach(function(e){return i.push(e)})),i.sort(he.getCompareLocalizedLabelFunction(t)),he.orderPreservingToplogicalSort(i,ie.HAS_PRECEDING_QUESTION),[i,{root:n}]},e}(),Te=["validation","children","value"],Ne=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={cursorPosition:0},n}te(n,t);var o=n.prototype;return o.focus=function(){j.findDOMNode(this.input).focus()},o.getInputDOMNode=function(){return j.findDOMNode(this.input)},o.componentDidUpdate=function(e,t,n){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()},o.fieldDidExpand=function(e){return"textarea"===this.props.type&&"textarea"!==e.type},o.fieldDidShrink=function(e){return"text"===this.props.type&&"text"!==e.type},o.updateFieldCursorPosition=function(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)},o.saveCursorPosition=function(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})},o.render=function(){switch(this.props.type){case"radio":return this._renderRadio();case"checkbox":return this._renderCheckbox();case"select":return this._renderSelect();case"textarea":return this._renderTextArea();default:return this._renderInput()}},o._renderCheckbox=function(){var t=this;/*#__PURE__*/return e.createElement(f.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),className:"mb-3"},/*#__PURE__*/e.createElement(f.Check,ee({type:"checkbox",ref:function(e){return t.input=e}},this.props,{label:this.props.label,className:this.props.validation.classname})),this.props.validation.message)},o._renderRadio=function(){var t=this;/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Check,ee({type:"radio",ref:function(e){return t.input=e}},this.props,{label:this.props.label,className:this.props.validation.classname})),this.props.validation.message)},o._renderSelect=function(){var t=this,n=this.props,o=n.validation,r=n.children,i=n.value,a=ne(n,Te);/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(h,ee({as:"select",value:i,className:o.classname,ref:function(e){return t.input=e}},a),r),o.message)},o._renderLabel=function(){return this.props.label?/*#__PURE__*/e.createElement(f.Label,null,this.props.label):null},o._renderTextArea=function(){var t=this;/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(h,ee({ref:function(e){return t.input=e},as:"textarea"},this.props,{className:this.props.validation.classname,onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation.message)},o._renderInput=function(){var t=this;/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},this._renderLabel(),/*#__PURE__*/e.createElement(h,ee({className:this.props.validation.classname,ref:function(e){return t.input=e},as:"input",placeholder:this.props.placeholder},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation.message)},n}(e.Component);Ne.propTypes={type:P.string,label:P.object,value:P.any,onChange:P.func,help:P.string,validation:P.object,placeholder:P.string},Ne.defaultProps={type:"text"};var Ie=["children"],Oe=/*#__PURE__*/e.createContext({}),Ce={components:{inputComponent:Ne},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableWizardStepSkip:!0,startingStep:0,enableOptionQuestionFeedback:!1}},ye=function(n){var o=n.children,r=ne(n,Ie),i=t(function(){return{inputComponent:r.components&&r.components.inputComponent||Ce.components.inputComponent,componentsOptions:Object.assign({},Ce.componentsOptions,r.componentsOptions),options:Object.assign({},Ce.options,r.options),mapComponent:r.mapComponent}},[r]);/*#__PURE__*/return e.createElement(Oe.Provider,{value:i},o)};ye.propTypes={children:P.element.isRequired,components:P.object,mapComponent:P.func,options:P.object};var be=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={hasError:!1,errorLabel:null,errorDetails:null},n}te(n,t),n.getDerivedStateFromError=function(e){return{hasError:!0,error:e}};var o=n.prototype;return o.componentDidCatch=function(e,t){this.setState({errorLabel:e,errorDetails:t})},o.render=function(){if(this.state.hasError){var t=this.context.lang;/*#__PURE__*/return e.createElement("div",{style:{padding:"20px"}},/*#__PURE__*/e.createElement(E,{variant:"danger"},/*#__PURE__*/e.createElement(E.Heading,null,t["error.default_message"]||"Something went wrong."),/*#__PURE__*/e.createElement("p",null,this.state.errorLabel&&this.state.errorLabel.toString())),/*#__PURE__*/e.createElement(g,null,/*#__PURE__*/e.createElement(A,null,/*#__PURE__*/e.createElement(A.Header,null,/*#__PURE__*/e.createElement(g,{as:S,variant:"link",eventKey:"0"},t["error.view_details"]||"View Error Details")),/*#__PURE__*/e.createElement(g.Collapse,{eventKey:"0"},/*#__PURE__*/e.createElement(A.Body,null,/*#__PURE__*/e.createElement("pre",{style:{whiteSpace:"pre-wrap"}},this.state.errorDetails&&this.state.errorDetails.componentStack))))))}return this.props.children},n}(e.Component);be.contextType=le;var Re=["children"],we=/*#__PURE__*/e.createContext({}),Le=function(n){var o=n.children,r=ne(n,Re),i=[],a=function(e,t){try{var n=i[e];return n&&n.length?Promise.resolve(n):Promise.resolve(r.fetchTypeAheadValues(t)).then(function(t){return t.length?m.frame(t,{},{}).then(function(t){var n,o=t["@graph"];return i.push(Object.assign({},o,((n={})[e]=o,n))),o}):(ge.warn("No data received when loading options using id "+e),[])})}catch(e){return Promise.reject(e)}},s=function(e){return i[e]||[]},l=t(function(){return{loadFormOptions:a,getOptions:s}},[a,s]);/*#__PURE__*/return e.createElement(we.Provider,ee({value:l},r),o)};Le.propTypes={children:P.element.isRequired,fetchTypeAheadValues:P.func};var He={},De=[],Ve=/*#__PURE__*/e.createContext({}),Me=function(r){var i=n(r.data||He),a=i[0],s=i[1],l=n(r.formQuestions||De),u=l[0],c=l[1];o(function(){if(r.isFormValid){var e=Ee.isValid(a);r.isFormValid(e)}},[]),o(function(){s(r.data||He)},[u]);var d=function(e){e&&s(Object.assign({},a,e))},m=function(e,t){if(!(!t||e<0||e>=u.length)){if("object"==typeof t){var n=[].concat(u);n[e]=Object.assign({},n[e],t),c(n)}if(Array.isArray(t)&&c(t),r.isFormValid){var o=Ee.isValid(a);r.isFormValid(o)}}},p=function(){return a},f=function(e){return null==e?u:u[e]},v=t(function(){return{updateData:d,updateFormQuestionsData:m,getData:p,getFormQuestionsData:f}},[f,p]);/*#__PURE__*/return e.createElement(Ve.Provider,ee({value:v},r),r.children)};Me.propTypes={children:P.element.isRequired,data:P.object.isRequired,formQuestions:P.array.isRequired,isFormValid:P.func};var Pe=/*#__PURE__*/function(){function e(){}return e.buildQuestionAnswerModel=function(t,n){var o,r={subQuestions:[]};if(t&&(r.uri=t.root["@id"],r.origin=u.getJsonAttValue(t.root,ie.HAS_QUESTION_ORIGIN,"@id")),n)for(var i=0;i<n.length;i++)(o=e.processQuestionAnswerHierarchy(n[i]))&&r.subQuestions.push(o);return r},e.processQuestionAnswerHierarchy=function(t){return t?e._processQuestion(t):null},e._processQuestion=function(t){var n={};if(n.uri=t["@id"],n.origin=u.getJsonAttValue(t,ie.HAS_QUESTION_ORIGIN,"@id"),t[ie.HAS_SUBQUESTION]){n.subQuestions=[];for(var o=0;o<t[ie.HAS_SUBQUESTION].length;o++)n.subQuestions.push(e._processQuestion(t[ie.HAS_SUBQUESTION][o]))}if(t[ie.HAS_ANSWER]){n.answers=[],Array.isArray(t[ie.HAS_ANSWER])||(t[ie.HAS_ANSWER]=[t[ie.HAS_ANSWER]]);for(var r=0;r<t[ie.HAS_ANSWER].length;r++)n.answers.push(e.processAnswer(t[ie.HAS_ANSWER][r]))}if(t[ie.HAS_COMMENT]){n.comments=[],Array.isArray(t[ie.HAS_COMMENT])||(t[ie.HAS_COMMENT]=[t[ie.HAS_COMMENT]]);for(var i=0;i<t[ie.HAS_COMMENT].length;i++)n.comments.push(e.processComment(t[ie.HAS_COMMENT][i]))}return n},e.processComment=function(e){var t={};return t.author=u.getJsonAttValue(e,ie.HAS_AUTHOR,"@id"),t.value=u.getJsonAttValue(e,ie.HAS_COMMENT_VALUE),t.timestamp=u.getJsonAttValue(e,ie.HAS_TIMESTAMP,"@id"),t},e.processAnswer=function(e){var t={};return t.uri=e["@id"],t.origin=u.getJsonAttValue(e,ie.HAS_ANSWER_ORIGIN,"@id"),e[ie.HAS_OBJECT_VALUE]?t.codeValue=u.getJsonAttValue(e,ie.HAS_OBJECT_VALUE,"@id"):t.textValue=u.getJsonAttValue(e,ie.HAS_DATA_VALUE),t},e.generateAnswer=function(e){var t={};return t[ie.HAS_DATA_VALUE]="",t},e}(),je=function(t){var n=r(Oe);/*#__PURE__*/return e.createElement(n.inputComponent,{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,validation:t.validation,onChange:function(e){t.onChange(e.target.checked)},disabled:n.componentsOptions.readOnly||Ee.isDisabled(t.question)})};je.propTypes={question:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.oneOfType([P.string,P.bool]),onChange:P.func.isRequired,mouseHover:P.bool,validation:P.object};var Ue=function(t){var i=r(Oe).componentsOptions,a=n(null),s=a[0],l=a[1],u=n(""),c=u[0],d=u[1],m=Ee.resolveDateTimeFormat(t.question,t.value,i.dateTimeAnswer),p=Ee.isDate(t.question),h=Ee.isTime(t.question),E=Ee.isTimestamp(t.question);o(function(){var e=g(t.value);e?l(e):(l(null),d("Invalid date value "+t.value+" of question "+t.question["@id"]+"."),console.error(c))},[t.value,m]);var g=function(e){if(!e)return null;var t=E?new Date(e):x(e,m,new Date);return isNaN(t.getTime())?null:t};/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(U,{selected:s,placeholderText:m,onChange:function(e){l(e);var n=e?E?e.getTime():q(e,m):"";t.onChange(n)},showTimeSelect:!p,showTimeSelectOnly:h,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:m,className:k("form-control",t.validation.classname),disabled:i.readOnly||Ee.isDisabled(t.question)}),t.validation.message)};Ue.propTypes={question:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.oneOfType([P.string,P.number]),onChange:P.func.isRequired,validation:P.object};var xe=[ie.XSD.INT,ie.XSD.INTEGER,ie.XSD.NON_NEGATIVE_INTEGER,ie.XSD.NON_POSITIVE_INTEGER,ie.XSD.NEGATIVE_INTEGER,ie.XSD.POSITIVE_INTEGER,ie.XSD.FLOAT,ie.XSD.POSITIVE_FLOAT,ie.XSD.NEGATIVE_FLOAT],qe={};qe[ie.XSD.NON_NEGATIVE_INTEGER]={min:0},qe[ie.XSD.NON_POSITIVE_INTEGER]={max:0},qe[ie.XSD.NEGATIVE_INTEGER]={max:-1},qe[ie.XSD.POSITIVE_INTEGER]={min:1};var ke={"string-2":"prefixed",atom:"var"},Fe=/*#__PURE__*/function(){function e(){}return e._resolveInputType=function(t,n){return Ee.isSparqlInput(t)||Ee.isTurtleInput(t)||Ee.isTextarea(t,n)?"textarea":e._isNumeric(t)?"number":"text"},e._isNumeric=function(e){for(var t=0,n=xe.length;t<n;t++)if(u.hasValue(e,ie.HAS_DATATYPE,xe[t]))return!0;return!1},e.resolveInputProperties=function(t,n,o){var r={};switch(r.type=e._resolveInputType(t,n),r.type){case"textarea":r.rows=5;break;case"number":r=Object.assign({},r,e._resolveNumberRestrictions(t),this._resolveStepRestriction(t))}return r.disabled=o.readOnly||Ee.isDisabled(t),r},e._resolveStepRestriction=function(e){var t={};return void 0!==e[ie.STEP]&&(t.step=u.getJsonAttValue(e,ie.STEP)),t},e._resolveNumberRestrictions=function(e){var t={};return Object.getOwnPropertyNames(qe).forEach(function(n){u.hasValue(e,ie.HAS_DATATYPE,n)&&(t=Object.assign({},t,qe[n]))}),void 0!==e[ie.XSD.MIN_INCLUSIVE]&&(t.min=e[ie.XSD.MIN_INCLUSIVE]),void 0!==e[ie.XSD.MIN_EXCLUSIVE]&&(t.min=e[ie.XSD.MIN_EXCLUSIVE]+1),void 0!==e[ie.XSD.MAX_EXCLUSIVE]&&(t.max=e[ie.XSD.MAX_EXCLUSIVE]-1),void 0!==e[ie.XSD.MAX_INCLUSIVE]&&(t.max=e[ie.XSD.MAX_INCLUSIVE]),t},e._preventCharacterInput=function(t,n){"number"!==e._resolveInputType(n)||t.key>="0"&&t.key<="9"||["Backspace","Delete","ArrowLeft","ArrowRight","-","Minus","NumpadSubtract",".","Period"].includes(t.key)||t.preventDefault()},e}(),ze=function(t){var n=r(Oe),o=n.inputComponent,i=n.componentsOptions,a=t.question,s=t.answer,l=t.value;return s[ie.HAS_OBJECT_VALUE]&&s[ie.HAS_OBJECT_VALUE][u.RDFS_LABEL]&&(l=u.getJsonAttValue(s[ie.HAS_OBJECT_VALUE],u.RDFS_LABEL)),/*#__PURE__*/e.createElement(o,Object.assign({},Fe.resolveInputProperties(a,l,i),{validation:t.validation,label:t.label,title:t.title,value:null==l?"":l,placeholder:Ee.getInputMask(a),onKeyPress:function(e){return Fe._preventCharacterInput(e,a)},onChange:function(e){t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:function(e){if(t.sparql){var n=F.fromTextArea(e.target);n.setValue(l),n.on("change",function(){t.onChange(n.getValue())}),F.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,n){if(e.autocompleters.getTrie(n)&&e.options.autocompleters&&-1!==e.options.autocompleters.indexOf(n)){var o=e.getCursor(),r=e.getTokenAt(o);if("prefixed"===ke[r.type]){var i=r.string.indexOf(":");if(-1!==i){var a=e.getPreviousNonWsToken(o.line,r).string.toUpperCase(),s=e.getTokenAt({line:o.line,ch:r.start});if("PREFIX"!==a&&("ws"===s.type||null==s.type)){var l=r.string.substring(0,i+1);if(null==e.getPrefixesFromQuery()[l.slice(0,-1)])if(t.question[ie.HAS_DECLARED_PREFIX]&&t.question[ie.HAS_DECLARED_PREFIX].filter(function(e){return e[ie.PREFIX]===l.slice(0,-1)}).length){var u=t.question[ie.HAS_DECLARED_PREFIX].filter(function(e){return e[ie.PREFIX]===l.slice(0,-1)}),c={};c[u[0][ie.PREFIX]]=u[0][ie.NAMESPACE],e.addPrefixes(c)}else{var d=e.autocompleters.getTrie(n).autoComplete(l);d.length>0&&e.addPrefixes(d[0])}}}}}}}else if(t.turtle){console.log("TTL");var o=F.fromTextArea(e.target);o.setValue(l),o.on("change",function(){t.onChange(o.getValue())})}}}))};ze.propTypes={question:P.object.isRequired,answer:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.oneOfType([P.string,P.number]),onChange:P.func.isRequired,validation:P.object};var Qe={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"},Be=/*#__PURE__*/function(){function e(){}return e.mapMask=function(e){if(!e)return e;for(var t,n="",o=0,r=e.length;o<r;o++)t=e.charAt(o),n+=Qe[t]?Qe[t]:t;return n},e}(),We=["size","placeholder"];function Ye(e){var t,n,o,r;if(void 0!==e.selectionStart)t=e.selectionStart,n=e.selectionEnd;else try{e.focus(),r=(o=e.createTextRange()).duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),r.setEndPoint("EndToStart",o),n=(t=r.text.length)+o.text.length}catch(e){}return{start:t,end:n}}var Xe=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this)._updatePattern=function(e){n.mask.setPattern(Be.mapMask(e.mask),{value:n.mask.getRawValue(),selection:Ye(n.input)})},n._updateMaskSelection=function(){n.mask.selection=Ye(n.input)},n._updateInputSelection=function(){!function(e,t){var n;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),(n=e.createTextRange()).collapse(!0),n.moveStart("character",t.start),n.moveEnd("character",t.end-t.start),n.select())}catch(e){}}(n.input,n.mask.selection)},n._onChange=function(e){var t=n.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){var o=t.length-e.target.value.length;n._updateMaskSelection(),n.mask.selection.end=n.mask.selection.start+o,n.mask.backspace()}var r=n._getDisplayValue();e.target.value=r,r&&n._updateInputSelection()}n.props.onChange&&n.props.onChange(e)},n._onKeyDown=function(e){if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),n.mask.undo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),n.mask.redo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),n._updateMaskSelection(),n.mask.backspace())){var t=n._getDisplayValue();e.target.value=t,t&&n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)}},n._onKeyPress=function(e){e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),n._updateMaskSelection(),n.mask.input(e.key)&&(e.target.value=n.mask.getValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)))},n._onPaste=function(e){e.preventDefault(),n._updateMaskSelection(),n.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=n.mask.getValue(),setTimeout(n._updateInputSelection,0),n.props.onChange&&n.props.onChange(e))},n.mask=new z({pattern:Be.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"}),n}te(n,t);var o=n.prototype;return o.componentDidUpdate=function(e){e.mask!==this.props.mask&&this._updatePattern(this.props),e.mask!==this.props.mask&&e.value!==this.props.mask?this.mask.getValue()===this.mask.emptyValue?this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(Be.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.value!==this.props.value&&this.mask.setValue(this.props.value),e.mask!==this.props.mask&&this.mask.selection.start&&this._updateInputSelection()},o._getDisplayValue=function(){var e=this.mask.getValue();return e===this.mask.emptyValue?"":e},o.focus=function(){this.input.focus()},o.blur=function(){this.input.blur()},o.render=function(){var t=this,n=this.props,o=n.size,r=n.placeholder,i=ne(n,We),a=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},i,{ref:function(e){e&&(t.input=e.input?j.findDOMNode(e.input):e)},maxLength:a,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.mask.emptyValue,size:o||a,value:this._getDisplayValue(),type:"text"}))},n}(e.Component);Xe.contextType=Oe,Xe.propTypes={mask:P.string.isRequired},Xe.defaultProps={value:""};var Ge=function(t){var n=r(Oe).componentsOptions,o=t.question,i=t.value,a=u.getJsonAttValue(o,ie.INPUT_MASK);return a?/*#__PURE__*/e.createElement(Xe,{mask:a,value:i,label:t.label,title:t.title,placeholder:a,onChange:function(e){return t.onChange(e.target.value)},disabled:n.readOnly||Ee.isDisabled(o),validation:t.validation}):(ge.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(ze,t))};Ge.propTypes={question:P.object.isRequired,answer:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.oneOfType([P.string,P.number]),onChange:P.func.isRequired,validation:P.object};var Ke=function(t,n){void 0===n&&(n="-- Select --");var o=[].concat(t).sort(function(e,t){var n=u.getJsonAttValue(e,ie.RDFS_LABEL),o=u.getJsonAttValue(t,ie.RDFS_LABEL);return n<o?-1:n>o?1:0}).map(function(t,n){var o=u.getJsonAttValue(t,ie.RDFS_LABEL);/*#__PURE__*/return e.createElement("option",{value:o,key:"opt-"+n},o)});return[/*#__PURE__*/e.createElement("option",{value:"",key:"opt-placeholder",disabled:!0,hidden:!0},n)].concat(o)},Je=function(t){var n=t.question,o=t.label,i=t.title,a=t.value,s=t.validation,l=t.onChange,u=r(Oe);/*#__PURE__*/return e.createElement(u.inputComponent,{type:"select",label:o,value:a,title:i,validation:s,onChange:function(e){return l(e.target.value)},disabled:u.componentsOptions.readOnly||Ee.isDisabled(n)},Ke(n[ie.HAS_OPTION]))};function Ze(t){var n=t.size,o=void 0===n?17:n,r=t.className;/*#__PURE__*/return e.createElement("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",className:void 0===r?"":r,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},/*#__PURE__*/e.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"}))}function $e(t){var n=t.size,o=void 0===n?17:n,r=t.className;/*#__PURE__*/return e.createElement("svg",{width:o,height:o,viewBox:"0 0 50 50",className:void 0===r?"":r,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},/*#__PURE__*/e.createElement("path",{strokeWidth:3,stroke:"currentColor",d:"M 41.9375 8.625 C 41.273438 8.648438 40.664063 9 40.3125 9.5625 L 21.5 38.34375 L 9.3125 27.8125 C 8.789063 27.269531 8.003906 27.066406 7.28125 27.292969 C 6.5625 27.515625 6.027344 28.125 5.902344 28.867188 C 5.777344 29.613281 6.078125 30.363281 6.6875 30.8125 L 20.625 42.875 C 21.0625 43.246094 21.640625 43.410156 22.207031 43.328125 C 22.777344 43.242188 23.28125 42.917969 23.59375 42.4375 L 43.6875 11.75 C 44.117188 11.121094 44.152344 10.308594 43.78125 9.644531 C 43.410156 8.984375 42.695313 8.589844 41.9375 8.625 Z"}))}Je.propTypes={question:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.string,onChange:P.func.isRequired,validation:P.object},Ze.propTypes={size:P.number,className:P.string},$e.propTypes={size:P.number,className:P.string};var et=function(t){var n=t.status;return"correct"===n?/*#__PURE__*/e.createElement($e,{className:"select-feedback-badge correct visible"}):"incorrect"===n?/*#__PURE__*/e.createElement(Ze,{className:"select-feedback-badge incorrect visible"}):null};et.displayName="SelectFeedbackBadge",et.propTypes={status:P.oneOf(["correct","incorrect",null])};var tt="select-correct",nt="select-incorrect",ot=function(t){var a=t.question,s=t.label,l=t.title,c=t.value,d=t.validation,m=t.onChange,p=t.hintRevealed,f=r(Oe),v=f.inputComponent,h=f.componentsOptions,E=i(null),g=n(null),A=g[0],S=g[1],_=n(null!=c?c:""),T=_[0],N=_[1],I=function(e){var t,n,o,r,i=function(e,t){return t?e.trim()===t.trim()?"correct":"incorrect":null}(e,Ee.getCorrectAnswerValue(a));i&&(n="correct"===i,(t=null!=(o=null==(r=E.current)?void 0:r.querySelector("select"))?o:null)&&(t.classList.remove(tt,nt),t.classList.add(n?tt:nt)),S(i))};o(function(){var e;if(Ee.hasAnswer(a)&&c){var t=function(e,t){void 0===e&&(e=[]);var n=function(e,t){var n;return void 0===e&&(e=[]),null!=(n=e.find(function(e){return e["@id"]===t}))?n:null}(e,t);return n?u.getJsonAttValue(n,ie.RDFS_LABEL):t}(null!=(e=a[ie.HAS_OPTION])?e:[],c);N(t),I(t)}},[]);var O=function(){var e=Ee.getCorrectAnswerValue(a);e&&(N(e),m(e),I(e))};return o(function(){p&&O()},[p]),/*#__PURE__*/e.createElement("div",{ref:E,style:{position:"relative"}},/*#__PURE__*/e.createElement(v,{type:"select",label:s,value:T,title:l,validation:d,onChange:function(e){if(p)O();else{var t=e.target.value;N(t),m(t),I(t)}},disabled:h.readOnly||Ee.isDisabled(a)},Ke(a[ie.HAS_OPTION])),/*#__PURE__*/e.createElement(et,{status:A}))};ot.propTypes={question:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.string,onChange:P.func.isRequired,validation:P.object,hintRevealed:P.bool};var rt=function(t){var n=r(Oe),o=me.isOptionQuestionFeedbackEnabled(null==n?void 0:n.options);/*#__PURE__*/return e.createElement(o?ot:Je,t)};rt.propTypes={question:P.object.isRequired,label:P.object.isRequired,title:P.string,value:P.string,onChange:P.func.isRequired,validation:P.object,hintRevealed:P.bool,onRevealHint:P.func};var it=function(e,t){if(!e)return[];e=function(e,t){return void 0!==e&&e.length?(e.sort(he.getCompareLocalizedLabelFunction(t)),he.orderPreservingToplogicalSort(e,ie.HAS_PRECEDING_VALUE),e):[]}(e,t);for(var n,o={},r=[],i=$(e);!(n=i()).done;){var a=n.value,s=u.getLocalized(a[ie.RDFS_LABEL],t),l=u.getLocalized(a[ie.RDFS_COMMENT],t);o[a["@id"]]={id:a["@id"],value:a["@id"],label:s,description:l,children:[]};for(var c,d=$(me.asArray(a[ie.BROADER]));!(c=d()).done;)r.push({type:"parent-child",parent:c.value["@id"],child:a["@id"]})}for(var m=0,p=r;m<p.length;m++){var f,v=p[m];"parent-child"===v.type&&(null==(f=o[v.parent])||f.children.push(v.child))}return Object.values(o)},at=function(e,t){if(!e)return null;var n=Ee.getCorrectAnswerValue(t);return n?e.trim()===n.trim()?"correct":"incorrect":null},st={correct:"#d4edda",incorrect:"#f8d7da"},lt={"is-warning":{borderColor:"#dc9135",boxShadow:"0 0 0 0.2rem rgba(203,127,16,.25)"},"is-invalid":{borderColor:"#dc3545",boxShadow:"0 0 0 0.2rem rgba(220,53,69,.25)"}},ut={correct:{borderColor:"#28a745",boxShadow:"0 0 0 0.2rem rgba(40,167,69,.25)"},incorrect:{borderColor:"#dc3545",boxShadow:"0 0 0 0.2rem rgba(220,53,69,.25)"}},ct=function(e,t){var n,o,r,i,a,s,l=null!=(n=null!=(o=lt[null==e?void 0:e.classname])?o:ut[t])?n:{};return a=(i=void 0===(r=l)?{}:r).borderColor,s=i.boxShadow,{control:function(e){return Object.assign({},e,{border:a?"1px solid "+a:e.border,boxShadow:null!=s?s:e.boxShadow,"&:hover":{border:a?"1px solid "+a:e.border,boxShadow:null!=s?s:e.boxShadow}})}}},dt=function(t){var n=t.hintRevealed,o=t.correctValue,r=t.currentValue;return function(t){var i,a,s,l=(null==(i=t.label)?void 0:i.trim())===(null==o?void 0:o.trim()),u=(null==(a=t.label)?void 0:a.trim())===(null==r||null==(s=r.label)?void 0:s.trim()),c="transparent";return n&&l&&(c=st.correct),u&&(c=l?st.correct:st.incorrect),/*#__PURE__*/e.createElement("div",{style:{backgroundColor:c}},/*#__PURE__*/e.createElement(B,t))}},mt=function(t){var r,i=n(null),a=i[0],s=i[1],l=n(null),u=l[0],c=l[1],d=n(!1),m=d[0],p=d[1],h=Ee.getCorrectAnswerValue(t.question);return o(function(){if(t.optionsList.length){var e=t.optionsList.find(function(e){return e.id===t.value});e&&(s(e),c(at(e.label,t.question)))}},[t.optionsList]),/*#__PURE__*/e.createElement(v,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,null,t.label),/*#__PURE__*/e.createElement(Q,{styles:ct(t.validation,u),valueKey:t.valueKey,labelKey:t.labelKey,valueRenderer:function(t){return function(t,n){var o;/*#__PURE__*/return e.createElement("div",{style:{backgroundColor:null!=(o=st[t])?o:"transparent",padding:"2px 6px",borderRadius:"4px",display:"inline-block"}},n)}(u,t)},optionRenderer:dt({hintRevealed:t.hintRevealed,currentValue:a,correctValue:h}),value:a,options:t.optionsList,multi:!1,isSearchable:!0,isLoading:t.isLoading,isClearable:!0,renderAsTree:!0,optionLeftOffset:5,isMenuOpen:m,onChange:function(e){var n,o=null!=(n=null==e?void 0:e.id)?n:null;s(null!=e?e:null),t.onChange(o),p(!1),c(at(null==e?void 0:e.label,t.question))},titleKey:"description"}),null==(r=t.validation)?void 0:r.message)};mt.propTypes={question:P.object.isRequired,answer:P.object.isRequired,label:P.oneOfType([P.string,P.object]).isRequired,value:P.string,onChange:P.func.isRequired,validation:P.object,hintRevealed:P.bool.isRequired};var pt=function(t){/*#__PURE__*/return e.createElement(e.Fragment,null,t)},ft=function(t){var n;/*#__PURE__*/return e.createElement(v,{size:"small",className:"mb-3"},/*#__PURE__*/e.createElement(f.Label,null,t.label),/*#__PURE__*/e.createElement(Q,{valueKey:t.valueKey,labelKey:t.labelKey,styles:ct(),value:t.optionsList.find(function(e){return e.id===t.value})||null,options:t.optionsList,multi:!1,isSearchable:!0,isLoading:t.isLoading,isClearable:!0,renderAsTree:!0,optionLeftOffset:5,valueRenderer:!1===t.question[ie.PROVIDES_DEREFERENCEABLE_ANSWER_VALUES]?pt:null,isDisabled:t.isLoading||t.configurationContext.componentsOptions.readOnly||Ee.isDisabled(t.question),onChange:function(e){t.onChange(e?e.id:null)},titleKey:"description"}),null==(n=t.validation)?void 0:n.message)};mt.propTypes={question:P.object.isRequired,answer:P.object.isRequired,label:P.oneOfType([P.string,P.object]).isRequired,value:P.string,onChange:P.func.isRequired,validation:P.object};var vt=function(t){var i=d(),a=r(we),s=r(Oe),l=me.getStringHash(Ee.getPossibleValuesQuery(t.question)),u=n(!0),c=u[0],m=u[1],p=n(function(){return it(t.options,i)}),f=p[0],v=p[1],h=me.isOptionQuestionFeedbackEnabled(null==s?void 0:s.options);o(function(){var e=!1;return!t.question[ie.HAS_OPTION]&&Ee.getPossibleValuesQuery(t.question)?function(){try{var n=function(n,o){try{var r=Promise.resolve(a.loadFormOptions(l,Ee.getPossibleValuesQuery(t.question))).then(function(t){e||(v(it(t,i)),m(!1))})}catch(e){return o()}return r&&r.then?r.then(void 0,o):r}(0,function(){ge.error("Typeahead: options loading failed for query hash "+l)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():(v(it(t.question[ie.HAS_OPTION],i)),m(!1)),function(){e=!0}},[l,a,t.question,i]);var E=me.findKeyInObjects(f,["name","value"]),g=me.findKeyInObjects(f,["name","label"]),A=Object.assign({},t,{optionsList:f,valueKey:E,labelKey:g,isLoading:c,configurationContext:s});/*#__PURE__*/return e.createElement(h?mt:ft,A)};vt.propTypes={question:P.object.isRequired,answer:P.object.isRequired,label:P.oneOfType([P.string,P.object]).isRequired,value:P.string,onChange:P.func.isRequired,validation:P.object,hintRevealed:P.bool};var ht=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-up",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 17.453c-0.172 0.344-0.516 0.547-0.891 0.547h-10c-0.375 0-0.719-0.203-0.891-0.547-0.172-0.328-0.141-0.734 0.078-1.031l5-7c0.187-0.266 0.484-0.422 0.812-0.422s0.625 0.156 0.812 0.422l5 7c0.219 0.297 0.25 0.703 0.078 1.031zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},Et=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-down",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 10.547c0.172 0.328 0.141 0.734-0.078 1.031l-5 7c-0.187 0.266-0.484 0.422-0.812 0.422s-0.625-0.156-0.812-0.422l-5-7c-0.219-0.297-0.25-0.703-0.078-1.031 0.172-0.344 0.516-0.547 0.891-0.547h10c0.375 0 0.719 0.203 0.891 0.547zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},gt=function(){/*#__PURE__*/return e.createElement("svg",{className:"info-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,"info-circle"),/*#__PURE__*/e.createElement("path",{d:"M16 21.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-1.5v-8c0-0.281-0.219-0.5-0.5-0.5h-5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h1.5v5h-1.5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h7c0.281 0 0.5-0.219 0.5-0.5zM14 7.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},At=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("path",{d:"M14 21.5v-3c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v3c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM18 11c0-2.859-3-5-5.688-5-2.547 0-4.453 1.094-5.797 3.328-0.141 0.219-0.078 0.5 0.125 0.656l2.063 1.563c0.078 0.063 0.187 0.094 0.297 0.094 0.141 0 0.297-0.063 0.391-0.187 0.734-0.938 1.047-1.219 1.344-1.437 0.266-0.187 0.781-0.375 1.344-0.375 1 0 1.922 0.641 1.922 1.328 0 0.812-0.422 1.219-1.375 1.656-1.109 0.5-2.625 1.797-2.625 3.313v0.562c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5v0c0-0.359 0.453-1.125 1.188-1.547 1.188-0.672 2.812-1.578 2.812-3.953zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},St=function(t){var o=n("right"),r=o[0],i=o[1];/*#__PURE__*/return e.createElement("span",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?i("left"):i("right"))}(e)}},/*#__PURE__*/e.createElement(_,{overlay:t.show?/*#__PURE__*/e.createElement(T,{className:"tooltip-content",id:t.id},t.tooltipContent):/*#__PURE__*/e.createElement("span",null),placement:t.overlayPlacement||r},/*#__PURE__*/e.createElement("span",null,t.children)))};St.propTypes={tooltipContent:P.oneOfType([P.object.isRequired,P.string.isRequired]),id:P.string.isRequired,overlayPlacement:P.string,absolutePosition:P.bool,show:P.bool},St.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0,show:!0};var _t=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement(St,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(At,{className:t.iconClass})))};_t.propTypes={text:P.string.isRequired,iconClassContainer:P.string,iconClass:P.string,overlayPlacement:P.string,absolutePosition:P.bool},_t.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var Tt=function(){/*#__PURE__*/return e.createElement("svg",{className:"external-link-icon",width:"24",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M5,2 C5.55228,2 6,2.44772 6,3 C6,3.55228 5.55228,4 5,4 L4,4 L4,12 L12,12 L12,11 C12,10.4477 12.4477,10 13,10 C13.5523,10 14,10.4477 14,11 L14,12 C14,13.1046 13.1046,14 12,14 L4,14 C2.89543,14 2,13.1046 2,12 L2,4 C2,2.89543 2.89543,2 4,2 L5,2 Z M15,1 L15,5.99814453 C15,6.55043453 14.5523,6.99814453 14,6.99814453 C13.4477,6.99814453 13,6.55043453 13,5.99814453 L13,4.41419 L8.71571,8.69846 C8.32519,9.08899 7.69202,9.08899 7.3015,8.69846 C6.91097,8.30794 6.91097,7.67477 7.3015,7.28425 L11.5858,3 L9.99619141,3 C9.44391141,3 8.99619141,2.55228 8.99619141,2 C8.99619141,1.44772 9.44391141,1 9.99619141,1 L15,1 Z"}))},Nt=function(t){/*#__PURE__*/return e.createElement(St,{tooltipContent:t.url["@id"]||t.url,id:"url-tooltip",overlayPlacement:t.overlayPlacement},/*#__PURE__*/e.createElement("a",{href:t.url["@id"]||t.url,target:"_blank",className:t.iconClassContainer},/*#__PURE__*/e.createElement(Tt,{className:t.iconClass})))};Nt.propTypes={url:P.oneOfType([P.string.isRequired,P.object.isRequired]),iconClassContainer:P.string,iconClass:P.string,overlayPlacement:P.string,absolutePosition:P.bool},Nt.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var It=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-comment",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",width:"24",height:"28"},/*#__PURE__*/e.createElement("path",{d:"M30,1.5c-16.542,0-30,12.112-30,27c0,5.204,1.646,10.245,4.768,14.604c-0.591,6.537-2.175,11.39-4.475,13.689 c-0.304,0.304-0.38,0.769-0.188,1.153C0.275,58.289,0.625,58.5,1,58.5c0.046,0,0.092-0.003,0.139-0.01 c0.405-0.057,9.813-1.411,16.618-5.339C21.621,54.71,25.737,55.5,30,55.5c16.542,0,30-12.112,30-27S46.542,1.5,30,1.5z M16,32.5 c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S18.206,32.5,16,32.5z M30,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4 S32.206,32.5,30,32.5z M44,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,32.5,44,32.5z"}))},Ot=function(){/*#__PURE__*/return e.createElement("svg",{className:"recycle-bin-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"15px",width:"15px",viewBox:"0 0 512 512"},/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("path",{d:"M331.636,69.818V0H180.364v69.818h-128v128h34.909V512h337.455V197.818h34.909v-128H331.636z M215.273,34.909h81.455\nv34.909h-81.455V34.909z M389.818,477.091H122.182V197.818h267.636V477.091z M424.727,162.909H87.273v-58.182h337.455V162.909z"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"168.727",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"308.364",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"238.545",y:"256",width:"34.909",height:"162.909"}))))},Ct=function(t){var o=r(Oe).options,i=n(!1),a=i[0],s=i[1],l=n(!1),u=l[0],c=l[1],m=d();W.addLocale(X),W.addLocale(Y),W.setDefaultLocale(ie.LANG.en.locale);var p,f,v=new W(m.locale),h=function(){if(o&&o.users&&t.author){var e=o.users.find(function(e){return e.id===t.author["@id"]});if(e&&e.label)return e.label}return m.formatMessage({id:"comment.unknownAuthor"})},E=function(){s(!a)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:function(){c(!0)},onMouseLeave:function(){c(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:E,onMouseLeave:E},/*#__PURE__*/e.createElement(e.Fragment,null,a?/*#__PURE__*/e.createElement(e.Fragment,null,h(),/*#__PURE__*/e.createElement(Nt,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():m.formatMessage({id:"comment.unknownAuthor"})})):h())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},(p=Number(t.timestamp),f=isNaN(p)?new Date(t.timestamp):new Date(p),/*#__PURE__*/e.createElement(St,{id:"exact-time-overlay",tooltipContent:new Intl.DateTimeFormat(m.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(f))},v.format(f)))),u?/*#__PURE__*/e.createElement(G.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:function(){t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(Ot,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};Ct.propTypes={author:P.object,timestamp:P.string.isRequired,commentValue:P.string.isRequired,onDeleteQuestionComment:P.func.isRequired,onDeleteViewComment:P.func,index:P.number.isRequired};var yt=function(t){var r=t.comments,a=t.onDeleteCommentClick,s=i(null),l=n(!1),c=l[0],d=l[1],m=function(){d(!0),setTimeout(function(){d(!1)},2e3)};return o(function(){null!==s.current&&(s.current.scrollTop=s.current.scrollHeight)},[JSON.stringify(r)]),/*#__PURE__*/e.createElement("span",null,c?/*#__PURE__*/e.createElement("div",{className:"comment-delete"},/*#__PURE__*/e.createElement(K,{color:"#00BFFF",height:80,width:80}),/*#__PURE__*/e.createElement("p",null,"Deleting comment...")):/*#__PURE__*/e.createElement("div",{className:"comment-list-items",ref:s},r.map(function(t,n){/*#__PURE__*/return e.createElement("div",{key:n,className:"comment-list-item"},/*#__PURE__*/e.createElement(Ct,{commentValue:u.getJsonAttValue(t,ie.HAS_COMMENT_VALUE),author:t[ie.HAS_AUTHOR]?t[ie.HAS_AUTHOR]:null,timestamp:u.getJsonAttValue(t,ie.HAS_TIMESTAMP),onDeleteQuestionComment:a,onDeleteViewComment:m,index:n}))})))},bt=function(){/*#__PURE__*/return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},/*#__PURE__*/e.createElement("path",{d:"M6.185 4.843l11.927 7.157-11.927 7.157 2.982-7.157-2.982-7.157zm-4.185-4.843l5 12-5 12 20-12-20-12z"}))},Rt="300px",wt=function(t){var r=n(""),a=r[0],s=r[1],l=i(null),u=d();o(function(){l.current.focus()},[]);var c=function(e){e.preventDefault(),t.onChange(a),s("")},m=function(){var e=l.current;e.style.height="auto",p(e)},p=function(e){e.style.height=e.scrollHeight+"px",parseInt(e.style.height)>parseInt(Rt)&&(e.style.height=Rt)};/*#__PURE__*/return e.createElement(f,{onSubmit:c,onKeyUp:function(e){"Enter"===e.key&&e.ctrlKey&&a.trim()&&c(e)},onClick:function(e){e.stopPropagation()}},/*#__PURE__*/e.createElement(f.Group,{className:"m-2 position-relative",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(N,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(I,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(f.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:u.formatMessage({id:"comment.form.placeholder"}),required:!0,value:a,onChange:function(e){s(e.target.value)},ref:l,onKeyPress:m,onKeyDown:m}),/*#__PURE__*/e.createElement(S,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement(bt,null)))))))};wt.propTypes={onChange:P.func.isRequired};var Lt=function(){/*#__PURE__*/return e.createElement("svg",{className:"close-icon",width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"}))},Ht=function(t){var a=r(Oe),s=i(null),l=i(null),u=i(null),c=n(!1),d=c[0],m=c[1],p=n("right"),f=p[0],v=p[1];o(function(){I(u.current)});var h=function(){m(!1)},E=function(){var e=t.question;return e[ie.HAS_COMMENT]||(e[ie.HAS_COMMENT]=[]),Array.isArray(e[ie.HAS_COMMENT])||(e[ie.HAS_COMMENT]=[e[ie.HAS_COMMENT]]),e[ie.HAS_COMMENT]},g=function(e){var n={};A(n,e),t.onChange(N(),n)},A=function(e,t){a.options.currentUser&&(e[ie.HAS_AUTHOR]={"@id":a.options.currentUser}),e[ie.HAS_COMMENT_VALUE]=t,e[ie.HAS_TIMESTAMP]=Date.now().toString()},S=function(e){E().splice(e,1)},_=function(e){e.preventDefault(),e.stopPropagation()},N=function(){return E().length},I=function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?v("left"):v("right"))};/*#__PURE__*/return e.createElement("div",{ref:u,onClick:_},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:s,onClick:function(e){_(e),m(!d)}},/*#__PURE__*/e.createElement(It,null),N()>0?/*#__PURE__*/e.createElement(O,{className:"comment-badge",pill:!0,variant:"primary"},N()):null),/*#__PURE__*/e.createElement(G.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:s.current,show:d,placement:f,rootClose:!1,onHide:h,container:l},function(t){/*#__PURE__*/return e.createElement(T,ee({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:function(e){!function(e){"Escape"===e.key&&h()}(e)}},/*#__PURE__*/e.createElement(G.div,{className:"close-comment-icon",onClick:h,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(Lt,null)),/*#__PURE__*/e.createElement(yt,{comments:E(),onDeleteCommentClick:S}),/*#__PURE__*/e.createElement(wt,{onChange:g})))})))};Ht.propTypes={question:P.object.isRequired,onChange:P.func.isRequired};var Dt,Vt="M9 21h6v2H9zm3-21C7.03 0 3 4.03 3 9c0 3.04 1.53 5.73 3.86 7.36.74.52 1.14 1.35 1.14 2.24V19h8v-.4c0-.9.39-1.73 1.14-2.24C19.47 14.73 21 12.04 21 9c0-4.97-4.03-9-9-9z",Mt={x1:2,y1:2,x2:21,y2:19,stroke:"#f15050",strokeWidth:3,strokeLinecap:"round"},Pt=function(){/*#__PURE__*/return e.createElement("path",{d:Vt})},jt=function(){/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement("path",{d:Vt,opacity:.35}),/*#__PURE__*/e.createElement("line",Mt))},Ut=function(t){var n=t.title,o=t.enabled,r=t.className;/*#__PURE__*/return e.createElement("svg",{className:"hint-icon"+(r?" "+r:""),xmlns:"http://www.w3.org/2000/svg",width:24,height:28,viewBox:"0 0 24 28","aria-label":n},/*#__PURE__*/e.createElement("title",null,n),/*#__PURE__*/e.createElement(o?Pt:jt,null))},xt=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement("span",{onClick:function(){return t.onHintClick()}},/*#__PURE__*/e.createElement(St,{id:"hint-icon-tooltip",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text||t.revealed?"Hide a hint.":"Reveal a hint."},/*#__PURE__*/e.createElement(Ut,{className:t.iconClass,enabled:!t.revealed}))))};xt.propTypes={text:P.string,iconClassContainer:P.string,iconClass:P.string,overlayPlacement:P.string,absolutePosition:P.bool,onHintClick:P.func,revealed:P.bool},xt.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0,revealed:!1};var qt=/*#__PURE__*/function(){function t(){}return t.renderIcons=function(t,n,o,r,i,a,s){var l;l=n.icons?n.icons:ie.DEFAULT_OPTIONS.icons;for(var u=[],c=this.renderQuestionHelp(t,n,o,r,i),d=this.renderQuestionComments(t,n,o,r,i),m=this.renderQuestionLink(t,n,o,r,i),p=this.renderQuestionHint(t,n,o,r,i,a,s),f=0;f<l.length;f++)l[f].id===ie.ICONS.QUESTION_COMMENTS&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},d)),l[f].id===ie.ICONS.QUESTION_HELP&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},c)),l[f].id===ie.ICONS.QUESTION_LINK&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},m)),l[f].id===ie.ICONS.QUESTION_HINT&&u.push(/*#__PURE__*/e.createElement("li",{key:f,className:"icon-list-item"},p));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},u)},t.renderQuestionHelp=function(e,t,n,o,r){return this.getIconComponentFromName(ie.ICONS.QUESTION_HELP,e,t,n,o,r)},t.renderQuestionLink=function(e,t,n,o,r){return this.getIconComponentFromName(ie.ICONS.QUESTION_LINK,e,t,n,o,r)},t.renderQuestionHint=function(e,t,n,o,r,i,a){return this.getIconComponentFromName(ie.ICONS.QUESTION_HINT,e,t,n,o,r,i,a)},t.getIconComponentFromName=function(e,t,n,o,r,i,a,s){var l=this.getIconFromIconList(n.icons?n.icons:ie.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(l,t,n,o,r,i,a,s)},t.getIconComponent=function(t,n,o,r,i,a,s,l){var c;if(t&&(t.behavior===ie.ICON_BEHAVIOR.ON_HOVER||t.behavior===ie.ICON_BEHAVIOR.ENABLE))return t.behavior===ie.ICON_BEHAVIOR.ENABLE?(i=!0,c=""):c="emphasise-on-relevant-icon",t.id===ie.ICONS.QUESTION_HELP&&n[ie.HELP_DESCRIPTION]?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(_t,{text:u.getLocalized(n[ie.HELP_DESCRIPTION],a),absolutePosition:!1})):null:t.id===ie.ICONS.QUESTION_LINK&&n[ie.SOURCE]?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(Nt,{url:n[ie.SOURCE]})):null:t.id===ie.ICONS.QUESTION_COMMENTS?i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(Ht,{question:n,onChange:r})):null:t.id===ie.ICONS.QUESTION_HINT&&o.enableOptionQuestionFeedback?Ee.isSection(n)||!Ee.containsHints(n)?null:i?/*#__PURE__*/e.createElement("div",{className:c},/*#__PURE__*/e.createElement(xt,{absolutePosition:!1,onHintClick:l,revealed:s})):null:null},t}();Dt=qt,qt.renderQuestionComments=function(e,t,n,o,r){return Dt.getIconComponentFromName(ie.ICONS.QUESTION_COMMENTS,e,t,n,o,r)},qt.getIconFromIconList=function(e,t){return e?e.find(function(e){return e.id===t}):null};var kt=function(t){var r=e.useContext(we),i=e.useContext(Oe).options,a=n({severity:"",classname:"",message:null}),s=a[0],l=a[1],c=d();o(function(){h()},[t.question]);var m,p,f=function(e){var n=Object.assign({},t.answer);v(n,e),t.onChange(t.index,n)},v=function(e,n){null===n?(e[ie.HAS_OBJECT_VALUE]=null,e[ie.HAS_DATA_VALUE]=null):t.answer[ie.HAS_OBJECT_VALUE]||Ee.isTypeahead(t.question)?e[ie.HAS_OBJECT_VALUE]={"@id":n}:e[ie.HAS_DATA_VALUE]={"@value":n}},h=function(){l({severity:"",classname:"",message:null}),!1===E[ie.HAS_VALID_ANSWER]&&l(E[ie.HAS_VALIDATION_SEVERITY]===ie.VALIDATION.SEVERITY.WARNING?{severity:ie.VALIDATION.SEVERITY.WARNING,classname:ie.VALIDATION.CLASSNAME.WARNING,message:/*#__PURE__*/e.createElement(y,{className:ie.VALIDATION.CLASSNAME.WARNING},E[ie.HAS_VALIDATION_MESSAGE])}:{severity:ie.VALIDATION.SEVERITY.ERROR,classname:ie.VALIDATION.CLASSNAME.ERROR,message:/*#__PURE__*/e.createElement(y,{className:ie.VALIDATION.CLASSNAME.ERROR},E[ie.HAS_VALIDATION_MESSAGE])})},E=t.question,g=Ee.resolveValue(t.answer),A=function(n){var o=u.getLocalized(n[ie.RDFS_LABEL],c);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,qt.renderIcons(t.question,i,t.onCommentChange,t.showIcon,c,t.hintRevealed,t.onHintReveal))}(E),S=u.getLocalized(E[ie.RDFS_COMMENT],c);return m=Ee.isTypeahead(E)?function(n,o,i){var a=me.getStringHash(Ee.getPossibleValuesQuery(t.question)),l=r.getOptions(a)||[];/*#__PURE__*/return e.createElement(vt,{question:t.question,answer:t.answer,label:o,title:i,value:n,onChange:f,options:l,validation:s,hintRevealed:t.hintRevealed,onHintReveal:t.onHintReveal})}(g,A,S):(p=E)[ie.HAS_OPTION]&&0!==p[ie.HAS_OPTION].length?function(n,o,r){/*#__PURE__*/return e.createElement(rt,{question:t.question,label:o,title:r,value:n,onChange:f,validation:s,hintRevealed:t.hintRevealed,onHintReveal:t.onHintReveal})}(g,A,S):Ee.isCalendar(E)?function(n,o,r){/*#__PURE__*/return e.createElement(Ue,{question:t.question,value:n,title:r,label:o,onChange:f,validation:s})}(g,A,S):Ee.isCheckbox(E)?function(n,o,r){/*#__PURE__*/return e.createElement(je,{label:o,title:r,value:n,onChange:f,question:t.question,validation:s})}(g,A,S):Ee.isMaskedInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(Ge,{label:o,title:r,value:n,onChange:f,question:t.question,answer:t.answer,validation:s})}(g,A,S):Ee.isSparqlInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,sparql:!0,validation:s})}(g,A,S):Ee.isTurtleInput(E)?function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,turtle:!0,validation:s})}(g,A,S):function(n,o,r){/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:f,validation:s})}(g,A,S),m};kt.propTypes={answer:P.object.isRequired,question:P.object.isRequired,onChange:P.func.isRequired,onCommentChange:P.func.isRequired,index:P.number,icons:P.object,hintRevealed:P.bool,onHintReveal:P.func};var Ft=function(e,t){var n=[Gt,Xt,Qt,Wt,Bt,Yt];return function(){if(Ee.hasValidationLogic(e,t)){var o=Ee.getAnswerValue(e);return zt(e,t,o,n)}}},zt=function(e,t,n,o){for(var r,i={},a=$(o);!(r=a()).done;){var s=(0,r.value)(e,t);if(!s.isValid)return i[ie.HAS_VALID_ANSWER]=!1,i[ie.HAS_VALIDATION_MESSAGE]=s.message,i[ie.HAS_VALIDATION_SEVERITY]=s.validationSeverity,i;if(!1===i[ie.HAS_VALID_ANSWER])break}return i[ie.HAS_VALID_ANSWER]=!0,i[ie.HAS_VALIDATION_MESSAGE]="",i[ie.HAS_VALIDATION_SEVERITY]="",i},Qt=function(e,t){var n=Ee.getAnswerValue(e);return n&&n.length>0&&e[ie.PATTERN]&&!new RegExp(e[ie.PATTERN]).test(n)&&Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.invalid"})}:{isValid:!0}},Bt=function(e,t){return!e[ie.REQUIRES_ANSWER]||e[ie.USED_ONLY_FOR_COMPLETENESS]||Ee.hasAnswer(e)?{isValid:!0}:{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.required"})}},Wt=function(e,t){return Ee.isCheckbox(e)&&e[ie.REQUIRES_ANSWER]&&!Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.check"})}:{isValid:!0}},Yt=function(e,t){return e[ie.REQUIRES_ANSWER]&&e[ie.USED_ONLY_FOR_COMPLETENESS]&&!Ee.hasAnswer(e)?{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.WARNING,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.required_only_for_completeness"})}:{isValid:!0}},Xt=function(e,t){if(e[ie.XSD.MIN_INCLUSIVE]){var n=Ee.getAnswerValue(e);if(n&&n.length>0){var o=e[ie.XSD.MIN_INCLUSIVE];if(!(Number.isInteger(parseInt(n))&&n>=o))return{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.greater_or_equal"})+o+"."}}}return{isValid:!0}},Gt=function(e,t){var n=Ee.getAnswerValue(e);if(e[ie.XSD.MAX_INCLUSIVE]&&n&&n.length>0){var o=e[ie.XSD.MAX_INCLUSIVE];if(!(Number.isInteger(parseInt(n))&&n<=o))return{isValid:!1,validationSeverity:ie.VALIDATION.SEVERITY.ERROR,message:e[ie.HAS_VALIDATION_MESSAGE]?e[ie.HAS_VALIDATION_MESSAGE]:t.formatMessage({id:"validation.lower_or_equal"})+o+"."}}return{isValid:!0}},Kt=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={prefixes:e.prefixes},n}return te(n,t),n.prototype.render=function(){var t=/*#__PURE__*/e.createElement(b,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(R,null,this.state.prefixes.sort(function(e,t){return e[ie.PREFIX]<t[ie.PREFIX]?-1:1}).map(function(t){/*#__PURE__*/return e.createElement(w,{key:t[ie.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[ie.PREFIX]),": ",t[ie.NAMESPACE])})));/*#__PURE__*/return e.createElement(_,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))},n}(e.Component);Kt.propTypes={prefixes:P.array.isRequired,children:P.element.isRequired,iconClass:P.string},Kt.defaultProps={iconClass:""};var Jt,Zt=/*#__PURE__*/function(){function e(){}return e.getMediaKindFromSource=function(e){if(e){var t=e.toLowerCase();return t.includes("m3u8")?{kind:"video",type:"application/x-mpegURL"}:t.includes("mp4")?{kind:"video",type:"video/mp4"}:t.includes("webm")?{kind:"video",type:"video/webm"}:t.includes("mov")?{kind:"video",type:"video/quicktime"}:/\b(png|jpg|jpeg|webp|gif|bmp)\b/.test(t)?{kind:"image",type:null}:{kind:"iframe",type:null}}},e.getMediaKindFromId=function(e){if(!e||"string"!=typeof e)return null;var t=e.toLowerCase();return/\/video\//.test(t)?{kind:"video",type:null}:/\/image\//.test(t)?{kind:"image",type:null}:null},e.getMediaKind=function(t,n){var o,r=e.getMediaKindFromSource(t);return r&&"iframe"!==r.kind?r:null!=(o=e.getMediaKindFromId(n))?o:r},e.getMediaKindFromContentType=function(e){if(!e)return null;var t=e.toLowerCase();return t.includes("mpegurl")?{kind:"video",type:"application/x-mpegURL"}:t.startsWith("image/")?{kind:"image",type:null}:t.startsWith("video/")?{kind:"video",type:t.split(";")[0].trim()}:null},e.probeContentType=function(e){return Promise.resolve(function(t,n){try{var o=Promise.resolve(fetch(e,{method:"HEAD",credentials:"include"})).then(function(e){return e.ok?e.headers.get("Content-Type"):null})}catch(e){return null}return o&&o.then?o.then(void 0,function(){return null}):o}())},e.probeIsImage=function(e){return new Promise(function(t){if("undefined"!=typeof Image){var n=new Image;n.onload=function(){return t(!0)},n.onerror=function(){return t(!1)},n.src=e}else t(!1)})},e.resolveMediaKind=function(t,n){try{var o,r=function(n){if(o)return n;if(i&&"iframe"!==i.kind)return i;var r=e.getMediaKindFromContentType;return Promise.resolve(e.probeContentType(t)).then(function(n){return r.call(e,n)||Promise.resolve(e.probeIsImage(t)).then(function(e){return e?{kind:"image",type:null}:i})})},i=e.getMediaKind(t,n),a=function(){if(i&&"video"===i.kind&&!i.type){var n=e.getMediaKindFromContentType;return Promise.resolve(e.probeContentType(t)).then(function(t){var r,i=n.call(e,t),a={kind:"video",type:null!=(r=null==i?void 0:i.type)?r:"video/mp4"};return o=1,a})}}();return Promise.resolve(a&&a.then?a.then(r):r(a))}catch(e){return Promise.reject(e)}},e.denormalizePointsFromStringToString=function(e,t,n){return e.trim().split(/\s+/).map(function(e){var o=e.split(",").map(Number);return o[0]*t+","+o[1]*n}).join(" ")},e.getArrayPointsFromString=function(e){return e.trim().split(/\s+/).map(function(e){return e.split(",").map(Number)})},e.stripExpandedLiterals=function(t){if(Array.isArray(t))return t.map(e.stripExpandedLiterals);if(t&&"object"==typeof t){if(Object.prototype.hasOwnProperty.call(t,"@value")&&Object.keys(t).length<=2)return e.castLiteral(t["@value"],t["@type"]);var n={};for(var o in t)n[o]=e.stripExpandedLiterals(t[o]);return n}return t},e.castLiteral=function(e,t){return t?t.includes("#decimal")?parseFloat(e):t.includes("#integer")?parseInt(e,10):t.includes("#boolean")?!0===e||"true"===e:e:e},e.normalizeMediaContents=function(e,t){return e?(Array.isArray(e)?e:[e]).map(function(e){var n;return"string"==typeof e?((n={})[t]=e,n):e}):[]},e}(),$t="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",en='<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="'+$t+'"/></svg>',tn=function(t){/*#__PURE__*/return e.createElement("svg",ee({viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true"},t),/*#__PURE__*/e.createElement("path",{d:$t}))},nn=function(e){var t=e.type,r=e.containerRef,i=function(e){var t=n(null),r=t[0],i=t[1];return o(function(){var t=null==e?void 0:e.current;if(t){var n=t.querySelector("img");if(n){var o=function(){return i(function(e){var t=null==e?void 0:e.current;if(!t)return null;var n=t.querySelector("img");if(!n)return null;var o=t.getBoundingClientRect();return{width:o.width,height:o.height,intrinsicWidth:n.naturalWidth||o.width,intrinsicHeight:n.naturalHeight||o.height,top:0,left:0}}(e))};return n.complete?o():n.addEventListener("load",o),window.addEventListener("resize",o),function(){n.removeEventListener("load",o),window.removeEventListener("resize",o)}}}},[e]),r}("image"===t?r:null),a=function(e){var t=n(null),r=t[0],i=t[1];return o(function(){var t=null==e?void 0:e.current;if(t){var n=function(){return i(function(e){var t=e.videoWidth(),n=e.videoHeight();if(!t||!n)return null;var o,r,i,a,s=e.el(),l=s.clientWidth,u=s.clientHeight,c=t/n;return l/u>c?(a=(l-(o=(r=u)*c))/2,i=0):(i=(u-(r=(o=l)/c))/2,a=0),{width:o,height:r,intrinsicWidth:t,intrinsicHeight:n,top:i,left:a}}(t))};return t.on("loadedmetadata",n),t.on("resize",n),t.on("fullscreenchange",n),window.addEventListener("resize",n),function(){t.off("loadedmetadata",n),t.off("resize",n),t.off("fullscreenchange",n),window.removeEventListener("resize",n)}}},[e]),r}("video"===t?r:null);return"image"===t?i:"video"===t?a:null},on=((Jt={})[ie.POLYLINE_ANNOTATION.IMPLICIT_TYPE_LABEL]=function(e,t,n,o){var r,i,a,s=ie.POLYLINE_ANNOTATION.DEFAULT_POLYLINE_ANNOTATION_STYLE;return Object.assign({},o,{geometry:{points:Zt.denormalizePointsFromStringToString(e[ie.ANNOTATION.HAS_GEOMETRY_POINTS],t,n)},style:{stroke:null!=(r=e[ie.ANNOTATION.HAS_COLOR])?r:s.color,strokeWidth:(null!=(i=e[ie.POLYLINE_ANNOTATION.HAS_STROKE_WIDTH])?i:s.strokeWidth)*t,fill:null!=(a=e[ie.POLYLINE_ANNOTATION.HAS_FILL_COLOR])?a:s.fillColor}})},Jt[ie.TEXT_ANNOTATION.IMPLICIT_TYPE_LABEL]=function(e,t,n,o){var r,i,a,s,l=ie.TEXT_ANNOTATION.DEFAULT_TEXT_ANNOTATION_STYLE,u=Zt.getArrayPointsFromString(e[ie.ANNOTATION.HAS_GEOMETRY_POINTS])[0];return Object.assign({},o,{geometry:{x:u[0]*t,y:u[1]*n},style:{fontSize:(null!=(r=e[ie.TEXT_ANNOTATION.HAS_FONT_SIZE])?r:l.fontSizeInNormalizedPx)*n,fontWeight:null!=(i=e[ie.TEXT_ANNOTATION.HAS_FONT_WEIGHT])?i:l.fontWeight,fontFamily:l.fontFamily,color:null!=(a=e[ie.ANNOTATION.HAS_COLOR])?a:l.color},payload:{text:null!=(s=e[ie.TEXT_ANNOTATION.HAS_TEXT])?s:l.text}})},Jt),rn={polyline:function(t){/*#__PURE__*/return e.createElement("polyline",{points:t.points,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,opacity:t.opacity})},text:function(t){var n=t.text,o=t.fontFamily,r=void 0===o?"Arial":o,i=t.fontWeight,a=void 0===i?400:i,s=t.opacity,l=void 0===s?1:s,u=t.fontSize,c=t.x,d=t.y,m=t.color,p=void 0===m?"#00ff00":m,f=t.lineHeight,v=void 0===f?1.15:f,h=(null!=n?n:"").split(/\r?\n/),E=u*v,g=d-.2*u;/*#__PURE__*/return e.createElement("text",{fill:p,fontSize:u+"px",fontFamily:r,fontWeight:a,textAnchor:"start",opacity:l},h.map(function(t,n){/*#__PURE__*/return e.createElement("tspan",{key:n,x:c,y:g+n*E,dominantBaseline:"hanging"},t||" ")}))}},an=function(r){var i=r.annotations,a=void 0===i?[]:i,s=r.surface,l=r.currentTime,u=r.showAnnotations,c=null==s?void 0:s.intrinsicWidth,d=null==s?void 0:s.intrinsicHeight,m=n(""),p=m[0],f=m[1];o(function(){if(u){f("annotation-overlay-revealed");var e=setTimeout(function(){return f("")},700);return function(){return clearTimeout(e)}}},[u]);var v=function(e){var n=e.annotations,o=void 0===n?[]:n,r=e.width,i=e.height,a=e.currentTime;return t(function(){return r&&i&&o.length?o.filter(function(e){return function(e,t){if(null==t)return!0;var n=e[ie.ANNOTATION.HAS_START_TIME],o=e[ie.ANNOTATION.HAS_END_TIME];return!(null!=n&&t<n||null!=o&&t>o)}(e,a)}).map(function(e){return function(e,t,n){var o=on[e[ie.ANNOTATION.HAS_ANNOTATION_TYPE]];if(!o)return null;var r=function(e){var t,n=e[ie.ANNOTATION.HAS_ANNOTATION_TYPE],o=e[ie.ANNOTATION.HAS_OPACITY];return{id:null!=(t=e.id)?t:"uuid-"+Date.now()+"-"+Math.random().toString(16).slice(2),type:n,opacity:null!=o?o:1}}(e);return o(e,t,n,r)}(e,r,i)}).filter(Boolean):[]},[o,r,i,a])}({annotations:a,width:c,height:d,currentTime:l}),h=t(function(){return"0 0 "+c+" "+d},[c,d]);return c&&d&&v.length?u?/*#__PURE__*/e.createElement("svg",{viewBox:h,className:"annotation-overlay "+p},v.map(function(t){var n=rn[t.type];return n?/*#__PURE__*/e.createElement(n,ee({key:t.id},t.geometry,t.style,t.payload,{opacity:t.opacity})):null})):/*#__PURE__*/e.createElement(e.Fragment,null):null},sn=/*#__PURE__*/s(function(t,n){var o=t.fullscreen;/*#__PURE__*/return e.createElement("div",{ref:n,className:"media-container "+(void 0!==o&&o?"fullscreen":"")},t.children)}),ln={video:function(r){var a=r.type,s=r.src,l=r.autoplay,u=void 0!==l&&l,c=r.muted,d=void 0===c||c,m=r.controls,p=void 0===m||m,f=r.responsive,v=void 0===f||f,h=r.aspectRatio,E=void 0===h?"16:9":h,g=r.annotations,A=void 0===g?[]:g,S=r.showAnnotations,_=r.onFullScreen,T=i(null),N=n(0),I=N[0],O=N[1],C=function(e){var t=e.videoRef,n=e.options,r=e.onReady,a=e.onFullScreen,s=e.onTimeUpdate,l=e.showAnnotations,u=e.annotations,c=void 0===u?[]:u,d=i(null);return o(function(){var e=d.current;if(e&&l){var t=c.reduce(function(e,t){var n=t[ie.ANNOTATION.HAS_START_TIME];return null!=n&&(null==e||n<e.startTime)?{annotation:t,startTime:n}:e},null);t&&(e.currentTime(t.startTime),e.pause())}},[l]),o(function(){if(t.current){var e=J(t.current,n,function(){(function(e,t){var n=t.onFullScreen;n&&function(e,t){var n,o=e.controlBar,r=null!=(n=o.getChild("remainingTimeDisplay"))?n:o.getChild("fullscreenToggle"),i=r?o.children().indexOf(r):o.children().length,a=o.addChild("button",{},i+1).el();a.innerHTML=en,a.setAttribute("aria-label","Fullscreen"),a.onclick=function(){return t(e)}}(e,n)})(e,{onFullScreen:a}),null==r||r(e)});return d.current=e,s&&e.on("timeupdate",function(){return s(e.currentTime())}),function(){e&&!e.isDisposed()&&e.dispose()}}},[t,n,r,a,s]),d}({videoRef:T,options:t(function(){return{autoplay:u,muted:d,controls:p,responsive:v,aspectRatio:E,controlBar:{fullscreenToggle:!1,pictureInPictureToggle:!1},userActions:{doubleClick:!1},sources:[{src:s,type:a}]}},[u,d,p,v,E,s,a]),onFullScreen:_,onTimeUpdate:O,annotations:A,showAnnotations:S}),y=nn({type:"video",containerRef:C});/*#__PURE__*/return e.createElement("div",{className:"video-wrapper",style:{position:"relative"}},/*#__PURE__*/e.createElement("video",{ref:T,className:"video-js vjs-big-play-centered"}),y&&/*#__PURE__*/e.createElement(an,{annotations:A,showAnnotations:S,surface:y,currentTime:I}))},image:function(t){var n=t.src,o=t.annotations,r=t.onFullScreen,a=t.showAnnotations,s=i(null),l=nn({type:"image",containerRef:s});/*#__PURE__*/return e.createElement("div",{className:"media-image-container"},/*#__PURE__*/e.createElement("div",{ref:s,className:"media-image-wrapper"},/*#__PURE__*/e.createElement("img",{src:n,alt:"Beautiful Image"}),/*#__PURE__*/e.createElement(an,{annotations:o,showAnnotations:a,surface:l,currentTime:null})),/*#__PURE__*/e.createElement("button",{className:"media-fullscreen-button",onClick:r,"aria-label":"Fullscreen"},/*#__PURE__*/e.createElement(tn,null)))}},un=function(e){return e&&"iframe"!==e.kind&&!("video"===e.kind&&!e.type)},cn=function(t){/*#__PURE__*/return e.createElement("div",{className:"media-iframe-container"},/*#__PURE__*/e.createElement("div",{className:"media-iframe-wrapper"},/*#__PURE__*/e.createElement("iframe",{src:t.src,title:"Embedded content",allowFullScreen:t.allowFullScreen})))},dn=function(t){var r=t.src,s=t.mediaId,l=t.annotations,u=void 0===l?[]:l,c=t.allowFullScreen,d=t.showAnnotations,m=void 0===d||d,p=i(null),f=function(e){var t=n(!1),r=t[0],i=t[1];return o(function(){var e=function(){return i(Boolean(document.fullscreenElement))};return document.addEventListener("fullscreenchange",e),function(){return document.removeEventListener("fullscreenchange",e)}},[]),{isFullscreen:r,toggle:a(function(){e.current&&(document.fullscreenElement?document.exitFullscreen():e.current.requestFullscreen())},[e])}}(p),v=f.isFullscreen,h=f.toggle,E=n(function(){var e=Zt.getMediaKind(r,s);return un(e)?e:null}),g=E[0],A=E[1];if(o(function(){var e=!1,t=Zt.getMediaKind(r,s);if(!un(t))return A(null),Zt.resolveMediaKind(r,s).then(function(t){e||A(null!=t?t:{kind:"iframe",type:null})}),function(){e=!0};A(t)},[r,s]),!r)return null;var S=g?ln[g.kind]||cn:null;/*#__PURE__*/return e.createElement(sn,{ref:p,fullscreen:v},S&&/*#__PURE__*/e.createElement(S,{src:r,type:g.type,annotations:u,allowFullScreen:c,onFullScreen:h,showAnnotations:m}))},mn=function(t){var n=t.displayAnnotations,o=Zt.stripExpandedLiterals(t.question),r=Zt.normalizeMediaContents(o[ie.HAS_MEDIA_CONTENT],ie.HAS_SOURCE);return r.length>0?/*#__PURE__*/e.createElement("div",{className:"col-6 "},r.map(function(t,o){var r;/*#__PURE__*/return e.createElement("div",{key:o,className:"embed-responsive-21by9 media-content-video-container mb-3"},/*#__PURE__*/e.createElement(dn,{src:t[ie.HAS_SOURCE],mediaId:t["@id"],allowFullScreen:!0,annotations:null!=(r=t[ie.HAS_ANNOTATION])?r:[],showAnnotations:n}))})):/*#__PURE__*/e.createElement(e.Fragment,null)},pn=/*#__PURE__*/function(t){function n(e){var o;return(o=t.call(this,e)||this).handleHintReveal=function(e){o.setState(e&&"boolean"==typeof e?{hintRevealed:e}:{hintRevealed:!o.state.hintRevealed})},o.handleAnswerChange=function(e,t){if(Ee.isSection(o.props.question)){var n=!!Ee.resolveValue(t);o.setState({expanded:n})}o._handleChange(ie.HAS_ANSWER,e,t)},o.handleSubQuestionChange=function(e,t){o._handleChange(ie.HAS_SUBQUESTION,e,t)},o.handleCommentChange=function(e,t){o._handleChange(ie.HAS_COMMENT,e,t)},o._toggleCollapse=function(){o.props.collapsible&&o.setState({expanded:!o.state.expanded})},o._onEnterHandler=function(){o.setState({showIcon:!0})},o._onLeaveHandler=function(){o.setState({showIcon:!1})},o._getHeaderClassName=function(){var e=o.props.question,t=o.props.collapsible,r=[];return r.push(n.getEmphasizedOnRelevantClass(e),"question-header"),Ee.isWizardStep(e)&&r.push("wizard-step bg-primary text-white"),Ee.isEmphasised(e)&&r.push(n.getEmphasizedClass(e)),Ee.isSection(e)&&r.push("section-background"),t&&r.push("cursor-pointer"),o.isDebugged(e)&&r.push("show-irrelevant"),r},pe.putObject(e.question["@id"],e.question),o.state={validator:{},expanded:!Ee.isCollapsed(e.question),showIcon:!1,hintRevealed:!1},o}te(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({validator:Ft(this.props.question,this.props.intl)})},o.componentDidUpdate=function(){var e=this.props.question,t=this.context.options.startingQuestionId,n=e[ie.HAS_SUBQUESTION].find(function(e){return e["@id"]===t});if(Ee.isSection(e)&&Ee.isAnswerable(e)){var o=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(n)return null;this.state.expanded&&!o&&this.setState({expanded:!1})}},o._handleChange=function(e,t,n){var o=Object.assign({},this.props.question);if(o[e][t]=n,e===ie.HAS_ANSWER){var r=this.state.validator(n);o=Object.assign({},o,r)}pe.putObject(o["@id"],o),this.props.onChange(this.props.index,o)},o.isDebugged=function(e){var t=this.context.options.startingQuestionId;return!Ee.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!me.findQuestionById(t,e,!0,!1,!1))},o.render=function(){var t=this.props.question,n=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},n):Ee.isHidden(t)?null:Ee.isRelevant(t)?n:null},o.renderQuestion=function(t){if(Ee.isAnswerable(t)&&!Ee.isSection(t))/*#__PURE__*/return e.createElement("div",{id:t["@id"]},/*#__PURE__*/e.createElement("div",{className:"panel-title answerable-question"},this.renderAnswers()),/*#__PURE__*/e.createElement("div",{className:"answerable-subquestions"},this.renderSubQuestions()));if(Ee.isAnswerable(t))return this.renderAnswerableSection();if(Ee.isSection(t)){var o=this.props,r=o.collapsible,i=o.withoutCard,a=n._getQuestionCategoryClass(t);if(i)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());var s=u.getLocalized(t[u.RDFS_LABEL],this.props.intl),l=/*#__PURE__*/e.createElement(A.Body,{className:k("p-3",a)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(g,{activeKey:this.state.expanded?s:void 0,className:"mb-3"},/*#__PURE__*/e.createElement(g.Item,{eventKey:s},/*#__PURE__*/e.createElement(A,{className:""},/*#__PURE__*/e.createElement(g.Button,{as:A.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onEnterHandler,onMouseLeave:this._onLeaveHandler,onFocus:this._onEnterHandler,onBlur:this._onLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"d-inline",id:t["@id"]},r&&!Ee.isWizardStep(t)&&this._renderCollapseToggle(),s),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(g.Body,{className:"p-0"},r?l:/*#__PURE__*/e.createElement(e.Fragment,null,l))))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())},o._renderQuestionContent=function(){var t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(mn,{key:this.props.question["@id"]+"-media",question:this.props.question,displayAnnotations:this.state.hintRevealed})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t},o.renderQuestionIcons=function(){return qt.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon,this.props.intl,this.state.hintRevealed,this.handleHintReveal)},o.renderAnswerableSection=function(){var t=this.props.question,o=this.props.collapsible,r=n._getQuestionCategoryClass(t),i=this.getShowIrrelevantClassname(t),a=/*#__PURE__*/e.createElement(A.Body,{className:k("p-3",r)},this.renderSubQuestions(i)),s=this._getHeaderClassName();return this.state.expanded&&s.push("text-primary"),/*#__PURE__*/e.createElement(g,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(A,{className:"mb-3"},/*#__PURE__*/e.createElement(A.Header,{onClick:this._toggleCollapse,className:s},this.renderAnswers()),o?/*#__PURE__*/e.createElement(g.Collapse,{className:i,eventKey:t["@id"]},a):{cardBody:a}))},o.getShowIrrelevantClassname=function(e){return!this.context.options.debugMode&&!he.checkId(e[ie.HAS_SUBQUESTION],this.context.options.startingQuestionId)||Ee.hasAnswer(e)?"":"show-irrelevant"},o.renderAnswers=function(){for(var t,o=this.props.question,r=[],i=this._getAnswers(),a=0,s=i.length;a<s;a++)Ee.isTextarea(o,Ee.resolveValue(i[a]))||Ee.isSparqlInput(o)||Ee.isTurtleInput(o),t=k("answer",n._getQuestionCategoryClass(o),n.getEmphasizedOnRelevantClass(o)),r.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+a,className:t,id:o["@id"],onMouseEnter:this._onEnterHandler,onMouseLeave:this._onLeaveHandler,"data-question-origin":Se._getId(o[ie.HAS_QUESTION_ORIGIN]),onFocus:this._onEnterHandler,onBlur:this._onLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(kt,{index:a,answer:i[a],question:o,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon,hintRevealed:this.state.hintRevealed,onHintReveal:this.handleHintReveal})),this._renderUnits(),this._renderPrefixes()));return r},o._getAnswers=function(){var e=this.props.question;return e[ie.HAS_ANSWER]||(e[ie.HAS_ANSWER]=[]),Array.isArray(e[ie.HAS_ANSWER])||(e[ie.HAS_ANSWER]=[e[ie.HAS_ANSWER]]),0===e[ie.HAS_ANSWER].length&&(e[ie.HAS_ANSWER]=Ee.isSection(e)&&!Ee.isAnswerable(e)?[]:[Pe.generateAnswer(e)]),e[ie.HAS_ANSWER]},o._getAnswerWidthStyle=function(){var e=Number(this.props.question[ie.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:"calc("+e+"ch + 1.5rem + 2px)"}:{}},n._getAnswerClass=function(e,t){return t?"col-12":1===ie.GENERATED_ROW_SIZE?"col-6":"col-"+ie.COLUMN_COUNT/ie.GENERATED_ROW_SIZE},n._getQuestionCategoryClass=function(e){var t=Ee.getCategory(e);return t?"question-"+t:""},n.getEmphasizedClass=function(e){return Ee.isEmphasised(e)?"bg-warning":""},n.getEmphasizedOnRelevantClass=function(e){return u.hasValue(e,ie.LAYOUT_CLASS,ie.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""},o._renderCollapseToggle=function(){var t=this.props.intl.formatMessage(this.state.expanded?{id:"section.collapse"}:{id:"section.expand"});/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:t},/*#__PURE__*/e.createElement(this.state.expanded?ht:Et,{title:t}))},o._renderPrefixes=function(){var t=this.props.question;return t[ie.HAS_DECLARED_PREFIX]&&t[ie.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(Kt,{prefixes:t[ie.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(gt,null)):null},o._renderUnits=function(){var t=this.props.question;return t[ie.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[ie.HAS_UNIT]):null},o.renderSubQuestions=function(t){for(var o=[],r=this._getSubQuestions(),i=this.context.options.debugMode,a=this.context.options.startingQuestionId,s=0;s<r.length;s++){var l=r[s],u=this.context.mapComponent(l,n),c=null;(i||"show-irrelevant"!==t||me.findQuestionById(a,l,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(u,{key:"sub-question-"+s,question:l,onChange:this.handleSubQuestionChange,index:s,intl:this.props.intl})),o.push(c)}return o},o._getSubQuestions=function(){var e=this.props.question;return e[ie.HAS_SUBQUESTION]||(e[ie.HAS_SUBQUESTION]=[]),Array.isArray(e[ie.HAS_SUBQUESTION])||(e[ie.HAS_SUBQUESTION]=[e[ie.HAS_SUBQUESTION]]),he.orderByLocalizedLabels(e[ie.HAS_SUBQUESTION],this.props.intl),he.orderPreservingToplogicalSort(e[ie.HAS_SUBQUESTION],ie.HAS_PRECEDING_QUESTION),e[ie.HAS_SUBQUESTION]},o._getFirstAnswerValue=function(){return Ee.resolveValue(this._getAnswers()[0])},n}(e.Component);pn.contextType=Oe,pn.propTypes={question:P.object.isRequired,onChange:P.func.isRequired,index:P.number,withoutCard:P.bool,collapsible:P.bool},pn.defaultProps={withoutCard:!1,collapsible:!0};var fn=function(t){var n=r(Ve),o=n.updateFormQuestionsData,i=n.getFormQuestionsData,a=d(),s=i([t.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(pn,{question:s,onChange:function(e,n){o(t.index||e,Object.assign({},t.question,n))},collapsible:Ee.isAnswerable(s),intl:a}),t.options.wizardStepButtons&&/*#__PURE__*/e.createElement(L,{className:"m-3 float-end"},!t.isFirstStep&&/*#__PURE__*/e.createElement(S,{className:"me-2",onClick:function(){t.onPreviousStep()},variant:"primary",size:"sm"},a.formatMessage({id:"wizard.previous"})),!t.isLastStep&&/*#__PURE__*/e.createElement(S,{onClick:function(){o(t.index,i()),t.onNextStep()},variant:"primary",size:"sm"},a.formatMessage({id:"wizard.next"}))))};fn.propTypes={options:P.object.isRequired,question:P.object.isRequired,index:P.number.isRequired,onNextStep:P.func,onPreviousStep:P.func,mapComponent:P.func,isFirstStep:P.bool,isLastStep:P.bool};var vn=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,a=r(Oe).options,s=d();/*#__PURE__*/return e.createElement(A.Header,null,/*#__PURE__*/e.createElement(H,{variant:"tabs",activeKey:i,onSelect:function(e){return o(parseInt(e))}},n.map(function(t,n){/*#__PURE__*/return e.createElement(St,{id:"step-disabled",tooltipContent:s.formatMessage({id:"wizard.nav.tooltip"}),show:!a.enableWizardStepSkip},/*#__PURE__*/e.createElement(D,{key:"nav"+n,id:"wizard-nav-"+n},/*#__PURE__*/e.createElement(V,{eventKey:n,active:n===i?"active":"",hidden:!a.debugMode&&!Ee.isRelevant(t),disabled:!a.enableWizardStepSkip,className:k([a.debugMode&&!Ee.isRelevant(t)?"show-irrelevant":pn.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s))))})))};vn.propTypes={currentStep:P.number.isRequired,steps:P.array.isRequired,onNavigate:P.func.isRequired};var hn=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,a=r(Oe).options,s=d();/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(R,null,n.map(function(t,n){/*#__PURE__*/return e.createElement(St,{id:"step-disabled",tooltipContent:s.formatMessage({id:"wizard.nav.tooltip"}),show:!a.enableWizardStepSkip},/*#__PURE__*/e.createElement(w,{hidden:!a.debugMode&&!Ee.isRelevant(t),key:"nav"+n,onClick:function(){return o(n)},id:"wizard-nav-"+n,action:!0,active:n===i?"active":"",disabled:!a.enableWizardStepSkip,variant:"default",className:k([a.debugMode&&!Ee.isRelevant(t)?"show-irrelevant":pn.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],d())))})))};function En(e){var t=e.id,n=e.dataAttributes,r=void 0===n?[]:n,i=e.scrollOptions,a=void 0===i?{behavior:"smooth"}:i,s=e.highlightClass,l=void 0===s?"text-danger":s;o(function(){var e=null;if(t&&(e=document.getElementById(t)),!e&&Object.keys(r).length>0){var n=Object.entries(r).map(function(e){return"[data-"+e[0]+'="'+e[1]+'"]'}).join("");e=document.querySelector(n)}e&&(e.scrollIntoView(a),l&&e.classList.add(l))},[t,r,a,l])}hn.propTypes={currentStep:P.number.isRequired,steps:P.array.isRequired,onNavigate:P.func.isRequired};var gn,An=function(e,t,n){console.log(n,e,t);var o=function n(o,r){return o?Se._getId(o[e])===t?r:me.asArray(o[ie.HAS_SUBQUESTION]).findIndex(function(e,t){return-1!==n(e,t)}):-1};return n.findIndex(function(e,t){return-1!==o(e,t)})},Sn=function(){var t=e.useContext(Ve),n=e.useContext(Oe),o=n.options,r=n.mapComponent,i=0;o.startingQuestionId?-1===(i=An("@id",o.startingQuestionId,t.getFormQuestionsData()))&&(console.warn("Question with id "+o.startingQuestionId+" not found!"),i=0):o.startingQuestionOrigin?-1===(i=An(ie.HAS_QUESTION_ORIGIN,o.startingQuestionOrigin,t.getFormQuestionsData()))&&(console.warn("Question with question origin "+o.startingQuestionOrigin+" not found!"),i=0):o.startingStep&&(i=o.startingStep<t.getFormQuestionsData().length?o.startingStep:0);var a=e.useState(i),s=a[0],l=a[1];En({id:o.startingQuestionId,dataAttributes:{"question-origin":[o.startingQuestionOrigin]}});var u,c=null;t.getFormQuestionsData().length>1&&(u=t.getFormQuestionsData(),c=/*#__PURE__*/e.createElement(o.horizontalWizardNav?vn:hn,{currentStep:s,steps:u,onNavigate:function(e){var n=t.getFormQuestionsData();e===s||e>=n.length||e>s&&!n[e].visited&&!o.enableWizardStepSkip||l(e)}}));var d,m,p=o.horizontalWizardNav;/*#__PURE__*/return e.createElement(A,{className:p?"":"flex-row p-3"},c,/*#__PURE__*/e.createElement("div",{className:p?"card-body p-3":c?"col-10 p-0 pl-3":"col-12 p-0"},(m=r(d=t.getFormQuestionsData()[s],fn),/*#__PURE__*/e.createElement(m,{options:o,key:"step"+s,question:d,onNextStep:function(){var e=t.getFormQuestionsData();s!==e.length-1&&(e[s+1].visited=!0,l(function(e){return e+1}))},onPreviousStep:function(){0!==s&&l(function(e){return e-1})},mapComponent:r,index:s,isFirstStep:0===s,isLastStep:s===t.getFormQuestionsData().length-1}))))},_n=/*#__PURE__*/e.forwardRef(function(t,n){var o=e.useContext(Oe).options;/*#__PURE__*/return e.createElement(M,ee({size:"xl",animation:!0},o.modalProps),/*#__PURE__*/e.createElement(M.Header,{closeButton:!0},/*#__PURE__*/e.createElement(M.Title,null,o.modalProps.title)),/*#__PURE__*/e.createElement(M.Body,{className:"overflow-hidden p-0"},t.children))});_n.propTypes={children:P.element.isRequired};var Tn=function(){};gn=Tn,Tn.updateQuestionValidation=function(e,t,n,o){var r=Ft(t,o)();r&&(e[n]=Object.assign({},t,r));for(var i,a=$(e);!(i=a()).done;)gn.updateSubQuestionsValidation(i.value,o)},Tn.updateSubQuestionsValidation=function(e,t){for(var n=me.asArray(e[ie.HAS_SUBQUESTION]),o=0;o<n.length;o++)gn.updateQuestionValidation(n,n[o],o,t)};var Nn=function(){var t=d(),n=r(Ve),o=n.updateFormQuestionsData,i=n.getFormQuestionsData,a=e.useContext(Oe),s=a.options,l=a.mapComponent;En({id:s.startingQuestionId,dataAttributes:{"question-origin":[s.startingQuestionOrigin]}});var u=i();/*#__PURE__*/return e.createElement(A,{className:"p-3"},u.map(function(n,r){return a=r,s=l(i=n,pn),/*#__PURE__*/e.createElement(s,{key:i["@id"],question:i,onChange:function(e,t){return function(e,t,n){o(t,Object.assign({},e,n))}(i,e,t)},index:a,intl:t});var i,a,s}))},In=/*#__PURE__*/s(function(t,n){var o=r(Ve),i=o.getFormQuestionsData,a=o.updateFormQuestionsData,s=o.getData,u=d();l(n,function(){return{validateForm:m,getFormSpecification:p,getFormQuestionsData:i,getFormData:c}},[]);var c=function(){var e=s(),t=i();return Pe.buildQuestionAnswerModel(e,t)},m=function(){for(var e=i(),t=0;t<e.length;t++)Tn.updateQuestionValidation(e,e[t],t,u);a(null,e)},p=function(){var e=i();return Ee.getFormSpecification(e)},f=t.modalView,v=i();if(!v.length)/*#__PURE__*/return e.createElement(A,{className:"p-3 font-italic"},"There are no questions available...");var h=v.every(function(e){return!Ee.isWizardStep(e)}),E=/*#__PURE__*/e.createElement(h?Nn:Sn,null);return f?/*#__PURE__*/e.createElement(_n,null,E):E}),On=/*#__PURE__*/s(function(t,r){var i=n(!0),a=i[0],s=i[1],l=n(null),u=l[0],c=l[1],m=n(null),p=m[0],f=m[1],v=d();if(o(function(){!function(){try{return Promise.resolve(_e.constructForm(t.form,v)).then(function(e){var t=e[0],n=e[1];t.formQuestions.some(function(e){return Ee.isWizardStep(e)})&&(t.formQuestions[0].visited=!0),c(t),f(n),s(!1)})}catch(e){return Promise.reject(e)}}()},[t.form,v]),a)return t.loader||/*#__PURE__*/e.createElement(A,{className:"p-3 font-italic"},"Loading SForms...");var h=function(e,t){return function(n,o){if(!e)return o;for(var r,i=$(e);!(r=i()).done;){var a=r.value,s=a.component;if((0,a.mapRule)(n,t))return s}return o}}(t.componentMapRules,p);/*#__PURE__*/return e.createElement(ye,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:h,options:t.options},/*#__PURE__*/e.createElement(be,null,/*#__PURE__*/e.createElement(Le,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(Me,{data:p,formQuestions:u.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(In,{ref:r,modalView:t.options&&t.options.modalView,mapComponent:h})))))});On.propTypes={form:P.object.isRequired,options:P.object.isRequired,componentMapRules:P.array,components:P.object,componentsOptions:P.object,fetchTypeAheadValues:P.func,isFormValid:P.func,loader:P.element};var Cn=/*#__PURE__*/s(function(t,n){var o;/*#__PURE__*/return e.createElement(ue,{locale:null==(o=t.options)||null==(o=o.intl)?void 0:o.locale},/*#__PURE__*/e.createElement(On,ee({ref:n},t)))});Cn.propTypes={form:P.object.isRequired,options:P.object.isRequired,componentMapRules:P.array,components:P.object,componentsOptions:P.object,fetchTypeAheadValues:P.func,isFormValid:P.func,loader:P.element,enableOptionQuestionFeedback:P.bool};export{kt as Answer,Oe as ConfigurationContext,ie as Constants,Ve as FormQuestionsContext,Ee as FormUtils,_t as HelpIcon,ue as IntlContextProvider,Se as JsonLdFramingUtils,pe as JsonLdObjectMap,he as JsonLdObjectUtils,pn as Question,qt as QuestionStatic,fn as WizardStep,Cn as default};
|
|
2
2
|
//# sourceMappingURL=s-forms.js.map
|