@kbss-cvut/s-forms 0.7.1-beta-b00a1cf.0 → 0.7.1-beta-c22f5eb.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/Answer.d.ts +13 -13
- package/dist/components/DefaultInput.d.ts +39 -39
- package/dist/components/FormManager.d.ts +23 -23
- package/dist/components/FormWindow.d.ts +3 -3
- package/dist/components/HelpIcon.d.ts +20 -20
- package/dist/components/IconOverlay.d.ts +17 -17
- package/dist/components/LinkIcon.d.ts +20 -20
- package/dist/components/MaskedInput.d.ts +41 -42
- package/dist/components/MediaContent.d.ts +5 -6
- package/dist/components/PrefixIcon.d.ts +21 -21
- package/dist/components/Question.d.ts +86 -86
- package/dist/components/QuestionStatic.d.ts +9 -9
- package/dist/components/SForms.d.ts +3 -3
- package/dist/components/answer/CheckboxAnswer.d.ts +23 -23
- package/dist/components/answer/DateTimeAnswer.d.ts +12 -12
- package/dist/components/answer/InputAnswer.d.ts +25 -25
- package/dist/components/answer/MaskedInputAnswer.d.ts +13 -13
- package/dist/components/answer/SelectAnswer.d.ts +27 -27
- package/dist/components/answer/TypeaheadAnswer.d.ts +13 -13
- package/dist/components/comment/CommentForm.d.ts +8 -8
- package/dist/components/comment/CommentList.d.ts +6 -7
- package/dist/components/comment/CommentView.d.ts +13 -13
- package/dist/components/comment/QuestionCommentIcon.d.ts +9 -9
- package/dist/components/wizard/HorizontalWizardNav.d.ts +14 -14
- package/dist/components/wizard/VerticalWizardNav.d.ts +14 -14
- package/dist/components/wizard/Wizard.d.ts +2 -2
- package/dist/components/wizard/WizardStep.d.ts +25 -25
- package/dist/constants/Constants.d.ts +127 -127
- package/dist/contexts/ConfigurationContext.d.ts +15 -15
- package/dist/contexts/FormGenContext.d.ts +13 -13
- package/dist/contexts/FormQuestionsContext.d.ts +12 -12
- package/dist/contexts/IntlContextProvider.d.ts +8 -8
- package/dist/model/DefaultFormGenerator.d.ts +8 -8
- package/dist/model/FormGenerator.d.ts +20 -20
- package/dist/model/QuestionAnswerProcessor.d.ts +44 -44
- package/dist/model/ValidatorFactory.d.ts +5 -5
- package/dist/s-forms.cjs +1 -1
- package/dist/s-forms.cjs.map +1 -1
- package/dist/s-forms.d.ts +16 -16
- 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/stories/Answer.stories.d.ts +12 -12
- package/dist/stories/CommentForm.stories.d.ts +3 -3
- package/dist/stories/HelpIcon.stories.d.ts +4 -4
- package/dist/stories/LinkIcon.stories.d.ts +3 -3
- package/dist/stories/PrefixIcon.stories.d.ts +3 -3
- package/dist/stories/Question.stories.d.ts +11 -11
- package/dist/stories/QuestionCommentIcon.stories.d.ts +4 -4
- package/dist/stories/SForms.stories.d.ts +8 -8
- package/dist/styles/icons/ArrowRight.d.ts +2 -2
- package/dist/styles/icons/CaretSquareDown.d.ts +4 -4
- package/dist/styles/icons/CaretSquareUp.d.ts +4 -4
- package/dist/styles/icons/Close.d.ts +2 -2
- package/dist/styles/icons/CommentBubble.d.ts +2 -2
- package/dist/styles/icons/ExternalLink.d.ts +2 -2
- package/dist/styles/icons/InfoCircle.d.ts +2 -2
- package/dist/styles/icons/QuestionCircle.d.ts +2 -2
- package/dist/styles/icons/RecycleBin.d.ts +2 -2
- package/dist/styles/icons/index.d.ts +4 -4
- package/dist/util/FormUtils.d.ts +40 -40
- package/dist/util/JsonLdFramingUtils.d.ts +16 -16
- package/dist/util/JsonLdObjectMap.d.ts +5 -5
- package/dist/util/JsonLdObjectUtils.d.ts +32 -32
- package/dist/util/Logger.d.ts +5 -5
- package/dist/util/MaskMapper.d.ts +12 -12
- package/dist/util/Utils.d.ts +15 -15
- package/package.json +5 -6
- package/dist/components/answer/OptimizedMenuList.d.ts +0 -5
package/dist/s-forms.modern.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"core-js/modules/es.array.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.promise.js";import e,{useMemo as t,useState as s,useEffect as n,useContext as o,useRef as r,forwardRef as i}from"react";import a from"prop-types";import"core-js/modules/es.object.assign.js";import l from"jsonld";import c from"jsonld-utils";import"core-js/modules/es.array.sort.js";import u from"tsort";import p from"react-dom";import{Form as m,FormGroup as d,FormControl as h,FormText as E,OverlayTrigger as g,Tooltip as S,Col as A,Row as _,Button as f,Badge as v,Overlay as C,Popover as T,ListGroup as N,ListGroupItem as I,Card as O,Accordion as w,ButtonToolbar as L,Nav as b,NavItem as y,NavLink as R,Modal as H}from"react-bootstrap";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 D from"react-datepicker";import{format as x}from"date-fns";import V from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import U from"inputmask-core";import"core-js/modules/es.symbol.description.js";import M,{components as P}from"react-select";import{FixedSizeList as q}from"react-window";import"core-js/modules/es.regexp.to-string.js";import{jsx as Q,jsxs as F}from"react/jsx-runtime";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.parse-int.js";import z from"javascript-time-ago";import j from"javascript-time-ago/locale/en";import k from"javascript-time-ago/locale/cs";import{motion as B}from"framer-motion";import{Rings as W}from"react-loader-spinner";import"core-js/modules/es.string.trim.js";import{useIntl as X,IntlProvider as G}from"react-intl";import Y from"classnames";import J from"react-bootstrap/Card";function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},K.apply(this,arguments)}function Z(e,t){if(null==e)return{};var s,n,o={},r=Object.keys(e);for(n=0;n<r.length;n++)t.indexOf(s=r[n])>=0||(o[s]=e[s]);return o}class ${static log(e){console.log(e)}static warn(e){console.warn?console.warn(e):console.log("WARNING: "+e)}static error(e){console.error?console.error(e):console.log("ERROR: "+e)}}const ee=["children"],te=/*#__PURE__*/e.createContext({}),se=s=>{let{children:n}=s,o=Z(s,ee),r=[];const i=async(e,t)=>{const s=r[e];if(s&&s.length)return s;const n=await o.fetchTypeAheadValues(t);return n.length?new Promise(t=>{l.frame(n,{},null,(s,n)=>{const o=n["@graph"];return r.push(Object.assign({},o,{[e]:o})),t(o)})}):($.warn(`No data received when loading options using id ${e}`),[])},a=e=>r[e]||[],c=t(()=>({loadFormOptions:i,getOptions:a}),[i,a]);/*#__PURE__*/return e.createElement(te.Provider,K({value:c},o),n)};var ne;se.propTypes={children:a.element.isRequired,fetchTypeAheadValues:a.func};class oe{}ne=oe,oe.COLUMN_COUNT=12,oe.INPUT_LENGTH_THRESHOLD=50,oe.DATETIME_NUMBER_FORMAT="x",oe.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",oe.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",oe.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",oe.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",oe.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",oe.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",oe.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",oe.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",oe.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",oe.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"]},oe.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",oe.VALUE_TYPE_CODE="code",oe.VALUE_TYPE_TEXT="text",oe.GENERATED_ROW_SIZE=1,oe.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",oe.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",oe.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",oe.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",oe.HELP_DESCRIPTION="http://purl.org/dc/elements/1.1/description",oe.SOURCE="http://purl.org/dc/elements/1.1/source",oe.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",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},oe.STEP="http://onto.fel.cvut.cz/ontologies/form/step",oe.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",oe.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",oe.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",oe.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",oe.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",oe.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",oe.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",oe.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",oe.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",oe.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",oe.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",oe.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",oe.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",oe.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",oe.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",oe.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",oe.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",oe.REQUIRES_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/requires-answer-value",oe.REQUIRES_DESCRIPTION="http://onto.fel.cvut.cz/ontologies/form/requires-description",oe.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",oe.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",oe.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",oe.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",oe.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",oe.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",oe.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",oe.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",oe.PREFIX="http://www.w3.org/ns/shacl#prefix",oe.NAMESPACE="http://www.w3.org/ns/shacl#namespace",oe.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",oe.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",oe.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",oe.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",oe.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",oe.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",oe.RDFS_LABEL=c.RDFS_LABEL,oe.RDFS_COMMENT=c.RDFS_COMMENT,oe.DEFAULT_HAS_CHILD=c.DEFAULT_HAS_CHILD,oe.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink"},oe.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},oe.DEFAULT_OPTIONS={icons:[{id:ne.ICONS.QUESTION_HELP,behavior:ne.ICON_BEHAVIOR.ENABLE},{id:ne.ICONS.QUESTION_COMMENTS,behavior:ne.ICON_BEHAVIOR.ON_HOVER},{id:ne.ICONS.QUESTION_LINK,behavior:ne.ICON_BEHAVIOR.ON_HOVER}]},oe.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}};class re{static getStringHash(e){let t=0;const s=e?e.length:0;if(0===s)return t;for(let n=0;n<s;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}static asArray(e){return e?e.constructor===Array?e:[e]:[]}static findQuestionById(e,t,s,n,o){if(s&&t["@id"]===e)return t;const r=re.asArray(t[oe.HAS_SUBQUESTION]);if(n)for(let t of r){let s=re.findQuestionById(e,t,!0,!1,!1);if(s)return s}if(o)for(let t of r){let s=re.findQuestionById(e,t,!1,!0,!0);if(s)return s}return null}}class ie{static putObject(e,t){ie.objectMap[e]=t}static getObject(e){return ie.objectMap[e]}}ie.objectMap={};class ae{static getFirstObject(e,t){const s=l.getValues(e,t);return 0===s.length?null:s[0]}static compareValues(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"])))||l.compareValues(e,t)}static toplogicalSort(e,t){let s;do{s=!1;for(let n=0;n<e.length;n++)for(let o=n;o<e.length;o++)if(e[n][t]&&("object"==typeof e[n][t]?e[n][t]["@id"]:e[n][t])===e[o]["@id"]){const t=e[n];e[n]=e[o],e[o]=t,s=!0;break}}while(s);return e}static orderPreservingToplogicalSort(e,t){const s=u(),n={};for(let o=0;o<e.length;o++){let r=e[o]["@id"];s.add(r),n[r]=e[o],re.asArray(e[o][t]).map(e=>"object"==typeof e?e["@id"]:e).map(e=>[e,r]).forEach(e=>s.add(e))}let o=s.sort();for(let t=0;t<o.length;t++)e[t]=n[o[t]];return e}static getCompareLocalizedLabelFunction(e){return(t,s)=>{const n=c.getLocalized(t[c.RDFS_LABEL],e),o=c.getLocalized(s[c.RDFS_LABEL],e);return n<o?-1:n>o?1:0}}static orderByLocalizedLabels(e,t){return e.sort(ae.getCompareLocalizedLabelFunction(t))}static checkId(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(e=>e["@id"]===t):e.constructor===Object?e["@id"]===t:void 0}}class le{static isForm(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.FORM)}static isWizardStep(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.WIZARD_STEP)}static isSection(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.QUESTION_SECTION)}static isAnswerable(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.ANSWERABLE)}static isTypeahead(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.QUESTION_TYPEAHEAD)}static getPossibleValuesQuery(e){return c.getJsonAttValue(e,oe.HAS_OPTIONS_QUERY)}static isDisabled(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.DISABLED)}static isHidden(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.HIDDEN)}static isTextarea(e,t){return t&&t.length>oe.INPUT_LENGTH_THRESHOLD&&!le.isTypeahead(e)||c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.TEXTAREA)}static isText(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.TEXT)}static isCalendar(e){return le.isDate(e)||le.isTime(e)||le.isDateTime(e)}static isDate(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.DATE)}static isTime(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.TIME)}static isDateTime(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.DATETIME)}static isCheckbox(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.CHECKBOX)}static isMaskedInput(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.MASKED_INPUT)}static isSparqlInput(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.SPARQL)}static isTurtleInput(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.TURTLE)}static isCollapsed(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.COLLAPSED)}static isEmphasised(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.EMPHASISED)}static getCategory(e){return oe.LAYOUT.CATEGORY.find(t=>c.hasValue(e,oe.LAYOUT_CLASS,t))}static resolveValue(e){return e?e[oe.HAS_OBJECT_VALUE]?e[oe.HAS_OBJECT_VALUE]["@id"]:c.getJsonAttValue(e,oe.HAS_DATA_VALUE):null}static resolveValueObject(e){return e?e[oe.HAS_OBJECT_VALUE]?re.asArray(e[oe.HAS_OBJECT_VALUE])[0]:e[oe.HAS_DATA_VALUE]?re.asArray(e[oe.HAS_DATA_VALUE])[0]:null:null}static isRelevant(e){if(!e[oe.IS_RELEVANT_IF])return!0;for(let t of re.asArray(e[oe.IS_RELEVANT_IF]))if(!le.testCondition(t))return!1;return!0}static hasValidationLogic(e){return!!e[oe.REQUIRES_ANSWER_VALUE]||!!e[oe.REQUIRES_ANSWER]||!!e[oe.REQUIRES_ANSWER_IF]}static isValid(e){if(!1===e[oe.HAS_VALID_ANSWER])return!1;for(const t of re.asArray(e[oe.HAS_SUBQUESTION]))if(!1===this.isValid(t))return!1;return!0}static testOrCondition(e){const t=e[oe.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(const e of this._getMappedObjectsArray(t))if(this.testCondition(e))return!0;return!1}static testCondition(e){const t=e[oe.ACCEPTS_VALIDATION_VALUE],s=e[oe.ACCEPTS_ANSWER_VALUE],n=e[oe.ACCEPTS],o=e[oe.HAS_TESTED_QUESTION];let r;if(e[oe.HAS_SUB_CONDITION])return this.testOrCondition(e);if(t&&s&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),n&&o){const e=re.asArray(n);if(1!==e.length&&console.warn("Support for multiple accepts values is not implemented !"),e[0]["@id"]===oe.ANSWERED_QUESTION){(s||t)&&console.warn("Support for accepted answer/validations values is not implemented !");for(const e of this._getMappedObjectsArray(o))if(!this.hasAnswer(e))return!1;return!0}console.warn("No support to accept question of type "+e[0]["@id"]+" !")}if(t&&o){const e=re.asArray(t);(1!==e.length||!0!==e[0]&&"true"!==e[0])&&console.warn('Validation values other than "true" are not implemented !');for(const e of re.asArray(o)){if(r=ie.getObject(e["@id"]),void 0===r)return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(r))return!1}return!0}if(s&&o){r=ie.getObject(o["@id"]);for(const e of re.asArray(s)){if(!r)return console.warn("Question is not defined."),!0;if(!r.hasOwnProperty(oe.HAS_ANSWER))return!1;const t=l.getValues(r,oe.HAS_ANSWER);if(0===t.length)return!1;const s=le.resolveValueObject(t[0]);if(s&&e&&s.hasOwnProperty("@value")&&e.hasOwnProperty("@id")&&s["@value"]==e["@id"])return!0;if(ae.compareValues(s,e))return!0}}return!1}static _getMappedObjectsArray(e,t){return re.asArray(e).map(e=>{const s=ie.getObject(e["@id"]);return void 0===s?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):s}).filter(function(e){return null!==e})}static hasAnswer(e){if(!e)return!1;if(e.hasOwnProperty(oe.HAS_ANSWER)){const t=l.getValues(e,oe.HAS_ANSWER);if(t.length){const e=le.resolveValueObject(t[0]);if(e&&(e["@value"]||e["@id"]))return!0}}for(const t of re.asArray(e[oe.HAS_SUBQUESTION]))if(le.hasAnswer(t))return!0;return!1}static resolveDateTimeFormat(e,t,s){return"number"==typeof t?oe.DATETIME_NUMBER_FORMAT:le.isDate(e)?s.dateFormat:le.isTime(e)?s.timeFormat:s.dateTimeFormat}}const ce={},ue=[],pe=/*#__PURE__*/e.createContext({}),me=o=>{const[r,i]=s(o.data||ce),[a,l]=s(o.formQuestions||ue);n(()=>{if(o.isFormValid){const e=le.isValid(r);o.isFormValid(e)}},[]),n(()=>{i(o.data||ce),l(o.formQuestions||ue)},[o.data,o.formQuestions]);const c=e=>{e&&i(Object.assign({},r,e))},u=(e,t)=>{if(!t||e<0||e>=a.length)return;const s=[...a];if(s[e]=Object.assign({},s[e],t),l(s),o.isFormValid){const e=le.isValid(r);o.isFormValid(e)}},p=()=>r,m=e=>null==e?a:a[e],d=t(()=>({updateData:c,updateFormQuestionsData:u,getData:p,getFormQuestionsData:m}),[m,p]);/*#__PURE__*/return e.createElement(pe.Provider,K({value:d},o),o.children)};me.propTypes={children:a.element.isRequired,data:a.object.isRequired,formQuestions:a.array.isRequired,isFormValid:a.func};class de extends e.Component{constructor(e){super(e),this.state={cursorPosition:0}}focus(){p.findDOMNode(this.input).focus()}getInputDOMNode(){return p.findDOMNode(this.input)}componentDidUpdate(e,t,s){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()}fieldDidExpand(e){return"textarea"===this.props.type&&"textarea"!==e.type}fieldDidShrink(e){return"text"===this.props.type&&"text"!==e.type}updateFieldCursorPosition(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)}saveCursorPosition(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})}render(){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()}}_renderCheckbox(){/*#__PURE__*/return e.createElement(m.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)},/*#__PURE__*/e.createElement(m.Check,K({type:"checkbox",ref:e=>this.input=e},this.props,{label:this.props.label})))}_renderRadio(){/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Check,K({type:"radio",ref:e=>this.input=e},this.props,{label:this.props.label})))}_renderSelect(){/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({as:"select",ref:e=>this.input=e},this.props),this.props.children),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())}_renderLabel(){return this.props.label?/*#__PURE__*/e.createElement(m.Label,null,this.props.label):null}_renderTextArea(){/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({ref:e=>this.input=e,as:"textarea"},this.props,{onChange:e=>this.saveCursorPosition(e)})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())}_renderHelp(){return this.props.help?/*#__PURE__*/e.createElement(E,null,this.props.help):null}_renderInput(){/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({ref:e=>this.input=e,as:"input"},this.props,{onChange:e=>this.saveCursorPosition(e)})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())}}de.propTypes={type:a.string,label:a.object,value:a.any,onChange:a.func,help:a.string,validation:a.oneOf(["success","warning","error"])},de.defaultProps={type:"text"};const he=["children"],Ee=/*#__PURE__*/e.createContext({}),ge={components:{inputComponent:de},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm:ss",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},i18n:{"wizard.next":"Next","wizard.previous":"Previous","section.collapse":"Collapse","section.expand":"Expand"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableForwardSkip:!1,startingStep:0}},Se=s=>{let{children:n}=s,o=Z(s,he);const r=t(()=>({inputComponent:o.components&&o.components.inputComponent||ge.components.inputComponent,componentsOptions:Object.assign({},ge.componentsOptions,o.componentsOptions),options:Object.assign({},ge.options,o.options),mapComponent:o.mapComponent}),[o]);/*#__PURE__*/return e.createElement(Ee.Provider,{value:r},n)};Se.propTypes={children:a.element.isRequired,components:a.object,mapComponent:a.func,options:a.object};var Ae,_e={"@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":""}}]}]}]};class fe{static generateForm(){return JSON.parse(JSON.stringify(_e))}}const ve={root:{[oe.HAS_LAYOUT_CLASS]:oe.FORM},expandProperties:[oe.HAS_SUBQUESTION,oe.IS_RELEVANT_IF,oe.HAS_ANSWER,oe.HAS_DECLARED_PREFIX,oe.HAS_OPTION,oe.HAS_COMMENT]};class Ce{static customFrame(e,t,s){if(arguments.length<2)return l.nextTick(function(){s(new TypeError("Could not frame, too few arguments."))});null===t&&(t=ve),l.flatten(e,null,null,(e,t)=>{})}static expandStructure(e){let t;const s={};e["@graph"].forEach(e=>{s[e["@id"]]=e,le.isForm(e)&&(t=e)});try{this._expandGraph(t,ve,s)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return s}static _expandGraph(e,t,s){let n,o,r;t.expandProperties.forEach(i=>{if(e.hasOwnProperty(i)){e[i]=re.asArray(e[i]),n=e[i];for(let e=0;e<n.length;e++)r=this._getId(n[e]),o=s[r],void 0!==o?(n[e]=o,this._expandGraph(o,t,s)):console.warn("object with @id "+r+" was not defined in input data.")}})}static _getId(e){return"string"==typeof e?e:e["@id"]}}Ae=Ce,Ce.compressStructure=e=>{let t=[],s=new Set;return t=Ae._compressGraph(e,t,s),t=t.sort((e,t)=>e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0),t},Ce._compressGraph=(e,t,s)=>(s.has(e["@id"])||(t.push(e),s.add(e["@id"])),ve.expandProperties.forEach(n=>{if(e.hasOwnProperty(n)){const o=e[n];for(let r=0;r<o.length;r++){const i=o[r];void 0!==i&&(o[r]=i,t=Ae._compressGraph(i,t,s),e[n][r]={"@id":i["@id"]})}}}),t);class Te{static constructDefaultForm(e){const t=fe.generateForm();return Te._constructFormQuestions(t,e)}static constructForm(e,t){return new Promise(s=>l.flatten(e,{},null,(e,n)=>{let o,r;e&&$.error(e);try{const[e,s]=Te._constructFormQuestions(n,t);r=s,o={formQuestions:e}}catch(e){const[s,n]=Te.constructDefaultForm(t);r=n,o={formQuestions:s}}return s([o,r])}))}static _constructFormQuestions(e,t){let s,n,o,r=[];if(void 0!==e["@graph"][0]["@id"]?(o=Ce.expandStructure(e),Object.keys(o).map(e=>{ie.putObject(e,o[e])})):console.warn("default form is constructed."),s=e["@graph"].find(e=>le.isForm(e)),n=s[oe.HAS_SUBQUESTION],!n)throw $.error("Could not find any questions in the received data."),"No questions in the form";return r=n.filter(e=>!(!le.isWizardStep(e)||le.isHidden(e))||($.warn("Item is not a wizard step: "+e),!1)),r.length||($.log("Could not find any wizard steps in the received data. Building form without steps"),s[oe.HAS_SUBQUESTION].forEach(e=>r.push(e))),r.sort(ae.getCompareLocalizedLabelFunction(t)),ae.orderPreservingToplogicalSort(r,oe.HAS_PRECEDING_QUESTION),[r,{root:s}]}}class Ne{static buildQuestionAnswerModel(e,t){const s={subQuestions:[]};let n;if(e&&(s.uri=e.root["@id"],s.origin=c.getJsonAttValue(e.root,oe.HAS_QUESTION_ORIGIN,"@id")),t)for(let e=0;e<t.length;e++)n=Ne.processQuestionAnswerHierarchy(t[e]),n&&s.subQuestions.push(n);return s}static processQuestionAnswerHierarchy(e){return e?Ne._processQuestion(e):null}static _processQuestion(e){const t={};if(t.uri=e["@id"],t.origin=c.getJsonAttValue(e,oe.HAS_QUESTION_ORIGIN,"@id"),e[oe.HAS_SUBQUESTION]){t.subQuestions=[];for(let s=0;s<e[oe.HAS_SUBQUESTION].length;s++)t.subQuestions.push(Ne._processQuestion(e[oe.HAS_SUBQUESTION][s]))}if(e[oe.HAS_ANSWER]){t.answers=[],Array.isArray(e[oe.HAS_ANSWER])||(e[oe.HAS_ANSWER]=[e[oe.HAS_ANSWER]]);for(let s=0;s<e[oe.HAS_ANSWER].length;s++)t.answers.push(Ne.processAnswer(e[oe.HAS_ANSWER][s]))}if(e[oe.HAS_COMMENT]){t.comments=[],Array.isArray(e[oe.HAS_COMMENT])||(e[oe.HAS_COMMENT]=[e[oe.HAS_COMMENT]]);for(let s=0;s<e[oe.HAS_COMMENT].length;s++)t.comments.push(Ne.processComment(e[oe.HAS_COMMENT][s]))}return t}static processComment(e){const t={};return t.author=c.getJsonAttValue(e,oe.HAS_AUTHOR,"@id"),t.value=c.getJsonAttValue(e,oe.HAS_COMMENT_VALUE),t.timestamp=c.getJsonAttValue(e,oe.HAS_TIMESTAMP,"@id"),t}static processAnswer(e){const t={};return t.uri=e["@id"],t.origin=c.getJsonAttValue(e,oe.HAS_ANSWER_ORIGIN,"@id"),e[oe.HAS_OBJECT_VALUE]?t.codeValue=c.getJsonAttValue(e,oe.HAS_OBJECT_VALUE,"@id"):t.textValue=c.getJsonAttValue(e,oe.HAS_DATA_VALUE),t}static generateAnswer(e){const t={};return t[oe.HAS_DATA_VALUE]="",t}}class Ie{static resolveValidationProperties(e){const t={};return!1===e[oe.HAS_VALID_ANSWER]&&(t.validation="error",t.help=e[oe.HAS_VALIDATION_MESSAGE]),t}}const Oe=t=>{const{inputComponent:s,componentsOptions:n}=o(Ee),r=t.question;/*#__PURE__*/return e.createElement(s,Object.assign({},Ie.resolveValidationProperties(r),{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,onChange:e=>{t.onChange(e.target.checked)},disabled:n.readOnly||le.isDisabled(r)}))};Oe.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.bool]),onChange:a.func.isRequired,mouseHover:a.bool};const we=t=>{const{componentsOptions:s}=o(Ee),n=le.resolveDateTimeFormat(t.question,t.value,s.dateTimeAnswer),r=le.isDate(t.question),i=le.isTime(t.question);let a;a=i&&t.value?new Date(`0 ${t.value}`):t.value?new Date(t.value):null;const l="x"===n?s.dateTimeAnswer.dateTimeFormat:n;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(D,{selected:a,placeholderText:l.toUpperCase(),onChange:e=>{t.onChange(n===oe.DATETIME_NUMBER_FORMAT?Number(e):x(e,n))},showTimeSelect:!r,showTimeSelectOnly:i,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:l,className:"form-control",disabled:s.readOnly||le.isDisabled(t.question)}))};we.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};const Le=[oe.XSD.INT,oe.XSD.INTEGER,oe.XSD.NON_NEGATIVE_INTEGER,oe.XSD.NON_POSITIVE_INTEGER,oe.XSD.NEGATIVE_INTEGER,oe.XSD.POSITIVE_INTEGER],be={};be[oe.XSD.NON_NEGATIVE_INTEGER]={min:0},be[oe.XSD.NON_POSITIVE_INTEGER]={max:0},be[oe.XSD.NEGATIVE_INTEGER]={max:-1},be[oe.XSD.POSITIVE_INTEGER]={min:1};const ye={"string-2":"prefixed",atom:"var"};class Re{static _resolveInputType(e,t){return le.isSparqlInput(e)||le.isTurtleInput(e)||le.isTextarea(e,t)?"textarea":Re._isNumeric(e)?"number":"text"}static _isNumeric(e){for(let t=0,s=Le.length;t<s;t++)if(c.hasValue(e,oe.HAS_DATATYPE,Le[t]))return!0;return!1}static resolveInputProperties(e,t,s){let n={};switch(n.type=Re._resolveInputType(e,t),n.type){case"textarea":n.rows=5;break;case"number":n=Object.assign({},n,Re._resolveNumberRestrictions(e),this._resolveStepRestriction(e))}return n.disabled=s.readOnly||le.isDisabled(e),!1===e[oe.HAS_VALID_ANSWER]&&(n.validation="error",n.help=e[oe.HAS_VALIDATION_MESSAGE]),n}static _resolveStepRestriction(e){let t={};return void 0!==e[oe.STEP]&&(t.step=c.getJsonAttValue(e,oe.STEP)),t}static _resolveNumberRestrictions(e){let t={};return Object.getOwnPropertyNames(be).forEach(s=>{c.hasValue(e,oe.HAS_DATATYPE,s)&&(t=Object.assign({},t,be[s]))}),void 0!==e[oe.XSD.MIN_INCLUSIVE]&&(t.min=e[oe.XSD.MIN_INCLUSIVE]),void 0!==e[oe.XSD.MIN_EXCLUSIVE]&&(t.min=e[oe.XSD.MIN_EXCLUSIVE]+1),void 0!==e[oe.XSD.MAX_EXCLUSIVE]&&(t.max=e[oe.XSD.MAX_EXCLUSIVE]-1),void 0!==e[oe.XSD.MAX_INCLUSIVE]&&(t.max=e[oe.XSD.MAX_INCLUSIVE]),t}}const He=t=>{const{inputComponent:s,componentsOptions:n}=o(Ee),r=t.question,i=t.answer;let a=t.value;return i[oe.HAS_OBJECT_VALUE]&&i[oe.HAS_OBJECT_VALUE][c.RDFS_LABEL]&&(a=c.getJsonAttValue(i[oe.HAS_OBJECT_VALUE],c.RDFS_LABEL)),/*#__PURE__*/e.createElement(s,Object.assign({},Re.resolveInputProperties(r,a,n),{label:t.label,title:t.title,value:null==a?"":a,onChange:e=>{t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:e=>{if(t.sparql){const s=V.fromTextArea(e.target);s.setValue(a),s.on("change",()=>{t.onChange(s.getValue())}),V.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,s){if(!e.autocompleters.getTrie(s))return;if(!e.options.autocompleters||-1===e.options.autocompleters.indexOf(s))return;const n=e.getCursor(),o=e.getTokenAt(n);if("prefixed"===ye[o.type]){const r=o.string.indexOf(":");if(-1!==r){const i=e.getPreviousNonWsToken(n.line,o).string.toUpperCase(),a=e.getTokenAt({line:n.line,ch:o.start});if("PREFIX"!==i&&("ws"===a.type||null==a.type)){const n=o.string.substring(0,r+1);if(null==e.getPrefixesFromQuery()[n.slice(0,-1)])if(t.question[oe.HAS_DECLARED_PREFIX]&&t.question[oe.HAS_DECLARED_PREFIX].filter(e=>e[oe.PREFIX]===n.slice(0,-1)).length){const s=t.question[oe.HAS_DECLARED_PREFIX].filter(e=>e[oe.PREFIX]===n.slice(0,-1)),o={};o[s[0][oe.PREFIX]]=s[0][oe.NAMESPACE],e.addPrefixes(o)}else{const t=e.autocompleters.getTrie(s).autoComplete(n);t.length>0&&e.addPrefixes(t[0])}}}}}}else if(t.turtle){console.log("TTL");const s=V.fromTextArea(e.target);s.setValue(a),s.on("change",()=>{t.onChange(s.getValue())})}}}))};He.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};const De={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"};class xe{static mapMask(e){if(!e)return e;let t,s="";for(let n=0,o=e.length;n<o;n++)t=e.charAt(n),s+=De[t]?De[t]:t;return s}}const Ve=["size","placeholder"];function Ue(e){let t,s,n,o;if(void 0!==e.selectionStart)t=e.selectionStart,s=e.selectionEnd;else try{e.focus(),n=e.createTextRange(),o=n.duplicate(),n.moveToBookmark(document.selection.createRange().getBookmark()),o.setEndPoint("EndToStart",n),t=o.text.length,s=t+n.text.length}catch(e){}return{start:t,end:s}}class Me extends e.Component{constructor(e){super(e),this._updatePattern=e=>{this.mask.setPattern(xe.mapMask(e.mask),{value:this.mask.getRawValue(),selection:Ue(this.input)})},this._updateMaskSelection=()=>{this.mask.selection=Ue(this.input)},this._updateInputSelection=()=>{!function(e,t){let s;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),s=e.createTextRange(),s.collapse(!0),s.moveStart("character",t.start),s.moveEnd("character",t.end-t.start),s.select())}catch(e){}}(this.input,this.mask.selection)},this._onChange=e=>{const t=this.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){const s=t.length-e.target.value.length;this._updateMaskSelection(),this.mask.selection.end=this.mask.selection.start+s,this.mask.backspace()}const s=this._getDisplayValue();e.target.value=s,s&&this._updateInputSelection()}this.props.onChange&&this.props.onChange(e)},this._onKeyDown=e=>{if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),this.mask.undo()&&(e.target.value=this._getDisplayValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),this.mask.redo()&&(e.target.value=this._getDisplayValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),this._updateMaskSelection(),this.mask.backspace())){const t=this._getDisplayValue();e.target.value=t,t&&this._updateInputSelection(),this.props.onChange&&this.props.onChange(e)}},this._onKeyPress=e=>{e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),this._updateMaskSelection(),this.mask.input(e.key)&&(e.target.value=this.mask.getValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e)))},this._onPaste=e=>{e.preventDefault(),this._updateMaskSelection(),this.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=this.mask.getValue(),setTimeout(this._updateInputSelection,0),this.props.onChange&&this.props.onChange(e))},this.mask=new U({pattern:xe.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"})}componentDidUpdate(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(xe.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(xe.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(xe.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()}_getDisplayValue(){const e=this.mask.getValue();return e===this.mask.emptyValue?"":e}focus(){this.input.focus()}blur(){this.input.blur()}render(){const t=this.props,{size:s,placeholder:n}=t,o=Z(t,Ve),r=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},o,{ref:e=>{e&&(this.input=e.input?p.findDOMNode(e.input):e)},maxLength:r,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:n||this.mask.emptyValue,size:s||r,value:this._getDisplayValue(),type:"text"}))}}Me.contextType=Ee,Me.propTypes={mask:a.string.isRequired},Me.defaultProps={value:""};const Pe=t=>{const{componentsOptions:s}=o(Ee),n=t.question,r=t.value,i=c.getJsonAttValue(n,oe.INPUT_MASK);return i?/*#__PURE__*/e.createElement(Me,{mask:i,value:r,label:t.label,title:t.title,placeholder:i,onChange:e=>t.onChange(e.target.value),disabled:s.readOnly||le.isDisabled(n)}):($.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(He,t))};Pe.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};class qe extends e.Component{_generateSelectOptions(t){const s=[];t.sort(function(e,t){const s=c.getJsonAttValue(e,oe.RDFS_LABEL),n=c.getJsonAttValue(t,oe.RDFS_LABEL);return s<n?-1:s>n?1:0});for(let n=0;n<t.length;n++)s.push(/*#__PURE__*/e.createElement("option",{value:c.getJsonAttValue(t[n],oe.RDFS_LABEL),key:"opt-"+n},c.getJsonAttValue(t[n],oe.RDFS_LABEL)));return s}render(){const t=this.props.question;/*#__PURE__*/return e.createElement(this.context.inputComponent,{type:"select",label:this.props.label,value:this.props.value,title:this.props.title,onChange:e=>{this.props.onChange(e.target.value)},disabled:this.context.componentsOptions.readOnly||le.isDisabled(t)},this._generateSelectOptions(t[oe.HAS_OPTION]))}}qe.contextType=Ee,qe.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};const Qe=t=>{const{options:s,children:n,maxHeight:o,getValue:r}=t,i=r(),a=i&&i[0]?40*s.indexOf(i[0]):0;/*#__PURE__*/return e.createElement(q,{height:o,itemCount:n.length,itemSize:40,initialScrollOffset:a,width:""},({index:t,style:s})=>/*#__PURE__*/e.createElement("div",{className:"option-wrapper",style:s},n[t]))},Fe=(e,t)=>e?(e.sort(ae.getCompareLocalizedLabelFunction(t)),ae.orderPreservingToplogicalSort(e,oe.HAS_PRECEDING_VALUE),c.processTypeaheadOptions(e,t)):[],ze=t=>{const r=re.getStringHash(le.getPossibleValuesQuery(t.question)),i=o(te),a=o(Ee),l=a.options.intl,[c,u]=s(!0),[p,h]=s(Fe(t.options,l));n(()=>{let e=!1;const s=t.question;return!s[oe.HAS_OPTION]&&le.getPossibleValuesQuery(s)?async function(){try{const t=await i.loadFormOptions(r,le.getPossibleValuesQuery(s));e||(u(!1),h(Fe(t,l)))}catch(e){$.error(`An error has occurred during loadFormOptions for query hash: ${r}`)}}():(u(!1),h(Fe(s[oe.HAS_OPTION],l))),()=>{e=!0}},[]),n(()=>{h(Fe(t.question[oe.HAS_OPTION],l))},[l]);const{Option:E}=P;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,null,t.label),/*#__PURE__*/e.createElement(M,{options:p,isSearchable:!0,isLoading:c,isClearable:!0,isDisabled:c||a.componentsOptions.readOnly||le.isDisabled(t.question),value:p.filter(e=>e.id===t.value),placeholder:"",getOptionLabel:e=>e.name,getOptionValue:e=>e.id,onChange:e=>{t.onChange(e?e.id:null)},components:{MenuList:Qe,Option:t=>{const s=Object.assign({},t.innerProps,{title:t.data.description});/*#__PURE__*/return e.createElement(E,K({},t,{title:t.data.description,innerProps:s}))}}}))};ze.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.oneOfType([a.string,a.object]).isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};const je=({title:t})=>/*#__PURE__*/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||""),/*#__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"})),ke=({title:t})=>/*#__PURE__*/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||""),/*#__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"})),Be=()=>/*#__PURE__*/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"})),We=()=>/*#__PURE__*/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"})),Xe=t=>{const[n,o]=s("right");/*#__PURE__*/return e.createElement("span",{ref:e=>(e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?o("left"):o("right"))})(e)},/*#__PURE__*/e.createElement(g,{overlay:/*#__PURE__*/e.createElement(S,{className:"tooltip-content",id:t.id},t.tooltipContent),placement:t.overlayPlacement||n},/*#__PURE__*/e.createElement("span",null,t.children)))};Xe.propTypes={tooltipContent:a.oneOfType([a.object.isRequired,a.string.isRequired]),id:a.string.isRequired,overlayPlacement:a.string,absolutePosition:a.bool},Xe.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const Ge=t=>{const[n,o]=s("right");/*#__PURE__*/return e.createElement("div",{ref:e=>(e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?o("left"):o("right"))})(e)},/*#__PURE__*/e.createElement(Xe,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||n,absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(We,{className:t.iconClass})))};Ge.propTypes={text:a.string.isRequired,iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Ge.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const Ye=()=>/*#__PURE__*/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"})),Je=t=>/*#__PURE__*/e.createElement(Xe,{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(Ye,{className:t.iconClass})));Je.propTypes={url:a.oneOfType([a.string.isRequired,a.object.isRequired]),iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Je.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const Ke=()=>/*#__PURE__*/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"})),Ze=()=>/*#__PURE__*/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"})))),$e="Unknown author",et=t=>{const{options:n}=o(Ee),[r,i]=s(!1),[a,l]=s(!1);z.addLocale(k),z.addLocale(j),z.setDefaultLocale(oe.LANG.en.locale);const c=new z(n.intl.locale),u=()=>{if(n&&n.users){const e=n.users.find(e=>e.id===n.currentUser);if(t.author)return e.label?e.label:p()}return $e},p=()=>t.author["@id"].replace(/.*[#\/]/,"... "),m=()=>{i(!r)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:m,onMouseLeave:m},/*#__PURE__*/e.createElement(e.Fragment,null,r?/*#__PURE__*/e.createElement(e.Fragment,null,u(),/*#__PURE__*/e.createElement(Je,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():$e})):u())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},/*#__PURE__*/e.createElement(Xe,{id:"exact-time-overlay",tooltipContent:(()=>{const e=new Date(parseInt(t.timestamp));return new Intl.DateTimeFormat(n.intl.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(e)})()},c.format(parseInt(t.timestamp)))),a?/*#__PURE__*/e.createElement(B.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:()=>{t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(Ze,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};et.propTypes={author:a.object,timestamp:a.string.isRequired,commentValue:a.string.isRequired,onDeleteQuestionComment:a.func.isRequired,onDeleteViewComment:a.func,index:a.number.isRequired};const tt=({comments:e,onDeleteCommentClick:t})=>{const o=r(null),[i,a]=s(!1),l=()=>{a(!0),setTimeout(()=>{a(!1)},2e3)};return n(()=>{null!==o.current&&(o.current.scrollTop=o.current.scrollHeight)},[JSON.stringify(e)]),Q("span",{children:i?F("div",{className:"comment-delete",children:[Q(W,{color:"#00BFFF",height:80,width:80}),Q("p",{children:"Deleting comment..."})]}):Q("div",{className:"comment-list-items",ref:o,children:e.map((e,s)=>Q("div",{className:"comment-list-item",children:Q(et,{commentValue:e[oe.HAS_COMMENT_VALUE],author:e[oe.HAS_AUTHOR]?e[oe.HAS_AUTHOR]:null,timestamp:e[oe.HAS_TIMESTAMP],onDeleteQuestionComment:t,onDeleteViewComment:l,index:s})},s))})})},st=()=>/*#__PURE__*/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"})),nt="300px",ot=t=>{const[o,i]=s(""),a=r(null),l=X();n(()=>{a.current.focus()},[]);const c=e=>{e.preventDefault(),t.onChange(o),i("")},u=()=>{const e=a.current;e.style.height="auto",p(e)},p=e=>{e.style.height=`${e.scrollHeight}px`,parseInt(e.style.height)>parseInt(nt)&&(e.style.height=nt)};/*#__PURE__*/return e.createElement(m,{onSubmit:c,onKeyUp:e=>{"Enter"===e.key&&e.ctrlKey&&o.trim()&&c(e)},onClick:e=>{e.stopPropagation()}},/*#__PURE__*/e.createElement(m.Group,{className:"m-2",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(A,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(_,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(m.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:l.formatMessage({id:"comment.form.placeholder"}),required:!0,value:o,onChange:e=>{i(e.target.value)},ref:a,onKeyPress:u,onKeyDown:u}),/*#__PURE__*/e.createElement(f,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement(st,null)))))))};ot.propTypes={onChange:a.func.isRequired};const rt=()=>/*#__PURE__*/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"})),it=t=>{const i=o(Ee),a=r(null),l=r(null),c=r(null),[u,p]=s(!1),[m,d]=s("right");n(()=>{N(c.current)});const h=()=>{p(!1)},E=()=>{const e=t.question;return e[oe.HAS_COMMENT]||(e[oe.HAS_COMMENT]=[]),Array.isArray(e[oe.HAS_COMMENT])||(e[oe.HAS_COMMENT]=[e[oe.HAS_COMMENT]]),e[oe.HAS_COMMENT]},g=e=>{const s={};A(s,e),t.onChange(T(),s)},A=(e,t)=>{i.options.currentUser&&(e[oe.HAS_AUTHOR]={"@id":i.options.currentUser}),e[oe.HAS_COMMENT_VALUE]=t,e[oe.HAS_TIMESTAMP]=Date.now().toString()},_=e=>{E().splice(e,1)},f=e=>{e.preventDefault(),e.stopPropagation()},T=()=>E().length,N=e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?d("left"):d("right"))};/*#__PURE__*/return e.createElement("div",{ref:c,onClick:f},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:a,onClick:e=>{f(e),p(!u)}},/*#__PURE__*/e.createElement(Ke,null),T()>0?/*#__PURE__*/e.createElement(v,{className:"comment-badge",pill:!0,variant:"primary"},T()):null),/*#__PURE__*/e.createElement(B.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:a.current,show:u,placement:m,rootClose:!1,onHide:h,container:l},t=>/*#__PURE__*/e.createElement(S,K({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:e=>{(e=>{"Escape"===e.key&&h()})(e)}},/*#__PURE__*/e.createElement(B.div,{className:"close-comment-icon",onClick:h,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(rt,null)),/*#__PURE__*/e.createElement(tt,{comments:E(),onDeleteCommentClick:_}),/*#__PURE__*/e.createElement(ot,{onChange:g}))))))};var at;it.propTypes={question:a.object.isRequired,onChange:a.func.isRequired};class lt{static renderIcons(t,s,n,o){let r;r=s.icons?s.icons:oe.DEFAULT_OPTIONS.icons;let i=[];const a=this.renderQuestionHelp(t,s,n,o),l=this.renderQuestionComments(t,s,n,o),c=this.renderQuestionLink(t,s,n,o);for(let t=0;t<r.length;t++)r[t].id===oe.ICONS.QUESTION_COMMENTS&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},l)),r[t].id===oe.ICONS.QUESTION_HELP&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},a)),r[t].id===oe.ICONS.QUESTION_LINK&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},c));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},i)}static renderQuestionHelp(e,t,s,n){return this.getIconComponentFromName(oe.ICONS.QUESTION_HELP,e,t,s,n)}static renderQuestionLink(e,t,s,n){return this.getIconComponentFromName(oe.ICONS.QUESTION_LINK,e,t,s,n)}static getIconComponentFromName(e,t,s,n,o){const r=this.getIconFromIconList(s.icons?s.icons:oe.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(r,t,s,n,o)}static getIconComponent(t,s,n,o,r){let i;if(t&&(t.behavior===oe.ICON_BEHAVIOR.ON_HOVER||t.behavior===oe.ICON_BEHAVIOR.ENABLE))return t.behavior===oe.ICON_BEHAVIOR.ENABLE?(r=!0,i=""):i="emphasise-on-relevant-icon",t.id===oe.ICONS.QUESTION_HELP&&s[oe.HELP_DESCRIPTION]?r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(Ge,{text:c.getLocalized(s[oe.HELP_DESCRIPTION],n.intl),absolutePosition:!1})):null:t.id===oe.ICONS.QUESTION_LINK&&s[oe.SOURCE]?r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(Je,{url:s[oe.SOURCE]})):null:t.id===oe.ICONS.QUESTION_COMMENTS&&r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(it,{question:s,onChange:o})):null}}at=lt,lt.renderQuestionComments=(e,t,s,n)=>at.getIconComponentFromName(oe.ICONS.QUESTION_COMMENTS,e,t,s,n),lt.getIconFromIconList=(e,t)=>e?e.find(e=>e.id===t):null;const ct=t=>{const s=e.useContext(te),{options:n}=e.useContext(Ee),o=e=>{const s=Object.assign({},t.answer);r(s,e),t.onChange(t.index,s)},r=(e,s)=>{null===s?(e[oe.HAS_OBJECT_VALUE]=null,e[oe.HAS_DATA_VALUE]=null):t.answer[oe.HAS_OBJECT_VALUE]||le.isTypeahead(t.question)?e[oe.HAS_OBJECT_VALUE]={"@id":s}:e[oe.HAS_DATA_VALUE]={"@value":s}},i=t.question,a=le.resolveValue(t.answer),l=(s=>{const o=c.getLocalized(s[oe.RDFS_LABEL],n.intl);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,lt.renderIcons(t.question,n,t.onCommentChange,t.showIcon))})(i),u=c.getLocalized(i[oe.RDFS_COMMENT],n.intl);let p;var m;return p=le.isTypeahead(i)?((n,r,i)=>{const a=re.getStringHash(le.getPossibleValuesQuery(t.question)),l=s.getOptions(a)||[];/*#__PURE__*/return e.createElement(ze,{question:t.question,answer:t.answer,label:r,title:i,value:n,onChange:o,options:l})})(a,l,u):(m=i)[oe.HAS_OPTION]&&0!==m[oe.HAS_OPTION].length?((s,n,r)=>/*#__PURE__*/e.createElement(qe,{question:t.question,label:n,title:r,value:s,onChange:o}))(a,l,u):le.isCalendar(i)?((s,n,r)=>/*#__PURE__*/e.createElement(we,{question:t.question,value:s,title:r,label:n,onChange:o}))(a,l,u):le.isCheckbox(i)?((s,n,r)=>/*#__PURE__*/e.createElement(Oe,{label:n,title:r,value:s,onChange:o,question:t.question}))(a,l,u):le.isMaskedInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(Pe,{label:n,title:r,value:s,onChange:o,question:t.question,answer:t.answer}))(a,l,u):le.isSparqlInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(He,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o,sparql:!0}))(a,l,u):le.isTurtleInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(He,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o,turtle:!0}))(a,l,u):((s,n,r)=>/*#__PURE__*/e.createElement(He,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o}))(a,l,u),p};ct.propTypes={answer:a.object.isRequired,question:a.object.isRequired,onChange:a.func.isRequired,onCommentChange:a.func.isRequired,index:a.number,icons:a.object};class ut{static createValidator(e,t){return e[oe.REQUIRES_ANSWER]?le.isCheckbox(e)?ut._generateRequiresAnswerCheckBoxValidator(e,t):ut._generateRequiresAnswerValidator(e,t):()=>{const e={};return e[oe.HAS_VALID_ANSWER]=!0,delete e[oe.HAS_VALIDATION_MESSAGE],e}}static _generateRequiresAnswerValidator(e,t){return s=>{let n=null;s[oe.HAS_DATA_VALUE]?n=c.getJsonAttValue(s,oe.HAS_DATA_VALUE):s[oe.HAS_OBJECT_VALUE]&&(n=c.getJsonAttValue(s,oe.HAS_OBJECT_VALUE,"@id"));const o=null!=n&&""!==n,r={};return r[oe.HAS_VALID_ANSWER]=o,r[oe.HAS_VALIDATION_MESSAGE]=o?null:c.getLocalized(e[c.RDFS_LABEL],t)+" is missing a value.",r}}static _generateRequiresAnswerCheckBoxValidator(e,t){return s=>{let n=null;s[oe.HAS_DATA_VALUE]?n=c.getJsonAttValue(s,oe.HAS_DATA_VALUE):s[oe.HAS_OBJECT_VALUE]&&(n=c.getJsonAttValue(s,oe.HAS_OBJECT_VALUE,"@id"));const o=null!=n&&""!==n&&!1!==n,r={};return r[oe.HAS_VALID_ANSWER]=o,r[oe.HAS_VALIDATION_MESSAGE]=o?null:c.getLocalized(e[c.RDFS_LABEL],t)+" must be checked.",r}}}class pt extends e.Component{constructor(e){super(e),this.state={prefixes:e.prefixes}}render(){const t=/*#__PURE__*/e.createElement(T,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(N,null,this.state.prefixes.sort((e,t)=>e[oe.PREFIX]<t[oe.PREFIX]?-1:1).map(t=>/*#__PURE__*/e.createElement(I,{key:t[oe.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[oe.PREFIX]),": ",t[oe.NAMESPACE]))));/*#__PURE__*/return e.createElement(g,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))}}pt.propTypes={prefixes:a.array.isRequired,children:a.element.isRequired,iconClass:a.string},pt.defaultProps={iconClass:""};const mt=({question:e})=>(()=>{const t=e[oe.HAS_MEDIA_CONTENT];return t?Array.isArray(t)?Q("div",{className:"col-6",children:t.map((e,s)=>Q("div",{className:"row embed-responsive-21by9 media-content-video-container mb-3",children:Q("iframe",{src:t[s],className:"embed-responsive-item",allowFullScreen:!0})},s))}):Q("div",{className:"col-6",children:Q("iframe",{src:t,className:"embed-responsive-item",allowFullScreen:!0})}):null})();class dt extends e.Component{constructor(e){super(e),this.handleAnswerChange=(e,t)=>{if(le.isSection(this.props.question)){let e=!!le.resolveValue(t);this.setState({expanded:e})}this._handleChange(oe.HAS_ANSWER,e,t)},this.handleSubQuestionChange=(e,t)=>{this._handleChange(oe.HAS_SUBQUESTION,e,t)},this.handleCommentChange=(e,t)=>{this._handleChange(oe.HAS_COMMENT,e,t)},this._toggleCollapse=()=>{this.props.collapsible&&this.setState({expanded:!this.state.expanded})},this._onMouseEnterHandler=()=>{this.setState({showIcon:!0})},this._onMouseLeaveHandler=()=>{this.setState({showIcon:!1})},this._getHeaderClassName=()=>{const e=this.props.question,t=this.props.collapsible;let s=[];return s.push(dt.getEmphasizedOnRelevantClass(e),"question-header"),le.isWizardStep(e)&&s.push("wizard-step bg-primary text-white"),le.isEmphasised(e)&&s.push(dt.getEmphasizedClass(e)),le.isSection(e)&&s.push("section-background"),t&&s.push("cursor-pointer"),this.isDebugged(e)&&s.push("show-irrelevant"),s},ie.putObject(e.question["@id"],e.question),this.state={validator:null,expanded:!le.isCollapsed(e.question),showIcon:!1}}componentDidMount(){this.setState({validator:ut.createValidator(this.props.question,this.context.options.intl)})}componentDidUpdate(){const e=this.props.question,t=this.context.options.startingQuestionId,s=e[oe.HAS_SUBQUESTION].find(e=>e["@id"]===t);if(le.isSection(e)&&le.isAnswerable(e)){const e=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(s)return null;this.state.expanded&&!e&&this.setState({expanded:!1})}}_handleChange(e,t,s){let n=Object.assign({},this.props.question);if(n[e][t]=s,e===oe.HAS_ANSWER){const e=this.state.validator(s);n=Object.assign({},n,e)}ie.putObject(n["@id"],n),this.props.onChange(this.props.index,n)}isDebugged(e){const t=this.context.options.startingQuestionId;return!le.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!re.findQuestionById(t,e,!0,!1,!1))}render(){const t=this.props.question,s=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},s):le.isHidden(t)?null:le.isRelevant(t)?s:null}renderQuestion(t){if(le.isAnswerable(t)&&!le.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(le.isAnswerable(t))return this.renderAnswerableSection();if(le.isSection(t)){const{collapsible:s,withoutCard:n}=this.props,o=dt._getQuestionCategoryClass(t);if(n)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());const r=c.getLocalized(t[c.RDFS_LABEL],this.context.options.intl),i=/*#__PURE__*/e.createElement(O.Body,{className:Y("p-3",o)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(w,{defaultActiveKey:this.state.expanded?void 0:r},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(w.Toggle,{as:O.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("h6",{className:"d-inline",id:t["@id"]},s&&!le.isWizardStep(t)&&this._renderCollapseToggle(),r),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(s?w.Collapse:e.Fragment,null,i))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())}_renderQuestionContent(){let t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(mt,{key:this.props.question["@id"]+"-media",question:this.props.question})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t}renderQuestionIcons(){return lt.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon)}renderAnswerableSection(){const t=this.props.question,s=this.props.collapsible,n=dt._getQuestionCategoryClass(t);let o=this.getShowIrrelevantClassname(t);const r=/*#__PURE__*/e.createElement(O.Body,{className:Y("p-3",n)},this.renderSubQuestions(o));/*#__PURE__*/return e.createElement(w,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(O.Header,{onClick:this._toggleCollapse,className:this._getHeaderClassName()},this.renderAnswers()),s?/*#__PURE__*/e.createElement(w.Collapse,{className:o,eventKey:t["@id"]},r):{cardBody:r}))}getShowIrrelevantClassname(e){return!this.context.options.debugMode&&!ae.checkId(e[oe.HAS_SUBQUESTION],this.context.options.startingQuestionId)||le.hasAnswer(e)?"":"show-irrelevant"}renderAnswers(){const t=this.props.question,s=[],n=this._getAnswers();let o;for(let r=0,i=n.length;r<i;r++)le.isTextarea(t,le.resolveValue(n[r]))||le.isSparqlInput(t)||le.isTurtleInput(t),o=Y("answer",dt._getQuestionCategoryClass(t),dt.getEmphasizedOnRelevantClass(t)),s.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+r,className:o,id:t["@id"],onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(ct,{index:r,answer:n[r],question:t,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon})),this._renderUnits(),this._renderPrefixes()));return s}_getAnswers(){const e=this.props.question;return e[oe.HAS_ANSWER]||(e[oe.HAS_ANSWER]=[]),Array.isArray(e[oe.HAS_ANSWER])||(e[oe.HAS_ANSWER]=[e[oe.HAS_ANSWER]]),0===e[oe.HAS_ANSWER].length&&(e[oe.HAS_ANSWER]=le.isSection(e)&&!le.isAnswerable(e)?[]:[Ne.generateAnswer(e)]),e[oe.HAS_ANSWER]}_getAnswerWidthStyle(){const e=Number(this.props.question[oe.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:`calc(${e}ch + 1.5rem + 2px)`}:{}}static _getAnswerClass(e,t){return t?"col-12":1===oe.GENERATED_ROW_SIZE?"col-6":"col-"+oe.COLUMN_COUNT/oe.GENERATED_ROW_SIZE}static _getQuestionCategoryClass(e){const t=le.getCategory(e);return t?"question-"+t:""}static getEmphasizedClass(e){return le.isEmphasised(e)?"bg-warning":""}static getEmphasizedOnRelevantClass(e){return c.hasValue(e,oe.LAYOUT_CLASS,oe.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""}_renderCollapseToggle(){const{options:t}=this.context,s=this.state.expanded?t.i18n["section.collapse"]:t.i18n["section.expand"];/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:s},/*#__PURE__*/e.createElement(this.state.expanded?je:ke,{title:s}))}_renderPrefixes(){const t=this.props.question;return t[oe.HAS_DECLARED_PREFIX]&&t[oe.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(pt,{prefixes:t[oe.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(Be,null)):null}_renderUnits(){const t=this.props.question;return t[oe.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[oe.HAS_UNIT]):null}renderSubQuestions(t){const s=[],n=this._getSubQuestions(),o=this.context.options.debugMode,r=this.context.options.startingQuestionId;for(let i=0;i<n.length;i++){let a=n[i],l=this.context.mapComponent(a,dt),c=null;(o||"show-irrelevant"!==t||re.findQuestionById(r,a,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(l,{key:"sub-question-"+i,question:a,onChange:this.handleSubQuestionChange,index:i})),s.push(c)}return s}_getSubQuestions(){const e=this.props.question;return e[oe.HAS_SUBQUESTION]||(e[oe.HAS_SUBQUESTION]=[]),Array.isArray(e[oe.HAS_SUBQUESTION])||(e[oe.HAS_SUBQUESTION]=[e[oe.HAS_SUBQUESTION]]),ae.orderByLocalizedLabels(e[oe.HAS_SUBQUESTION],this.context.options.intl),ae.orderPreservingToplogicalSort(e[oe.HAS_SUBQUESTION],oe.HAS_PRECEDING_QUESTION),e[oe.HAS_SUBQUESTION]}_getFirstAnswerValue(){return le.resolveValue(this._getAnswers()[0])}}dt.contextType=Ee,dt.propTypes={question:a.object.isRequired,onChange:a.func.isRequired,index:a.number,withoutCard:a.bool,collapsible:a.bool},dt.defaultProps={withoutCard:!1,collapsible:!0};class ht extends e.Component{constructor(t){super(t),this.onNextStep=()=>{this.context.updateFormQuestionsData(this.props.index,this.context.getFormQuestionsData()),this.props.onNextStep()},this.onPreviousStep=()=>{this.props.onPreviousStep()},this._renderWizardStepButtons=()=>/*#__PURE__*/e.createElement(L,{className:"m-3 float-right"},!this.props.isFirstStep&&/*#__PURE__*/e.createElement(f,{className:"mr-2",onClick:this.onPreviousStep,variant:"primary",size:"sm"},this.props.options.i18n["wizard.previous"]),!this.props.isLastStep&&/*#__PURE__*/e.createElement(f,{onClick:this.onNextStep,variant:"primary",size:"sm"},this.props.options.i18n["wizard.next"])),this.onChange=(e,t)=>{this.context.updateFormQuestionsData(this.props.index||e,Object.assign({},this.props.question,t))}}render(){const t=this.context.getFormQuestionsData([this.props.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(dt,{question:t,onChange:this.onChange,collapsible:le.isAnswerable(t)}),this.props.options.wizardStepButtons&&this._renderWizardStepButtons())}}ht.propTypes={options:a.object.isRequired,question:a.object.isRequired,index:a.number.isRequired,onNextStep:a.func,onPreviousStep:a.func,mapComponent:a.func,isFirstStep:a.bool,isLastStep:a.bool},ht.contextType=pe;const Et=({steps:t,onNavigate:s,currentStep:n})=>{const{options:r}=o(Ee);/*#__PURE__*/return e.createElement(O.Header,null,/*#__PURE__*/e.createElement(b,{variant:"tabs",activeKey:n,onSelect:e=>s(parseInt(e))},t.map((t,s)=>/*#__PURE__*/e.createElement(y,{key:"nav"+s,id:"wizard-nav-"+s},/*#__PURE__*/e.createElement(R,{eventKey:s,active:s===n?"active":"",hidden:!r.debugMode&&!le.isRelevant(t),className:Y([r.debugMode&&!le.isRelevant(t)?"show-irrelevant":dt.getEmphasizedClass(t),"wizard-nav"])},c.getLocalized(t[c.RDFS_LABEL],r.intl))))))};Et.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};const gt=({steps:t,onNavigate:s,currentStep:n})=>{const{options:r}=o(Ee);/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(N,null,t.map((t,o)=>/*#__PURE__*/e.createElement(I,{hidden:!r.debugMode&&!le.isRelevant(t),key:"nav"+o,onClick:()=>s(o),id:"wizard-nav-"+o,action:!0,active:o===n?"active":"",variant:"default",className:Y([r.debugMode&&!le.isRelevant(t)?"show-irrelevant":dt.getEmphasizedClass(t),"wizard-nav"])},c.getLocalized(t[c.RDFS_LABEL],r.intl)))))};gt.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};const St=()=>{const t=e.useContext(pe),{options:s,mapComponent:o}=e.useContext(Ee);let r=0;s.startingQuestionId?(r=((e,t)=>{const s=(e,n)=>e?e["@id"]===t?n:re.asArray(e[oe.HAS_SUBQUESTION]).findIndex((e,t)=>-1!==s(e,t)):-1;return e.findIndex((e,t)=>-1!==s(e,t))})(t.getFormQuestionsData(),s.startingQuestionId),-1===r&&(console.warn(`Question with id ${s.startingQuestionId} not found!`),r=0)):s.startingStep&&(r=s.startingStep<t.getFormQuestionsData().length?s.startingStep:0);const[i,a]=e.useState(r),[l,c]=e.useState(!1);n(()=>{if(s.startingQuestionId&&!l){const e=document.getElementById(s.startingQuestionId);e&&(e.scrollIntoView(),e.classList.add("text-danger"),c(!0))}});const u=()=>{const e=t.getFormQuestionsData();i!==e.length-1&&(e[i+1].visited=!0,a(e=>e+1))},p=()=>{0!==i&&a(e=>e-1)},m=e=>{const n=t.getFormQuestionsData();e===i||e>=n.length||e>i&&!n[e].visited&&!s.enableForwardSkip||a(e)};let d=null;t.getFormQuestionsData().length>1&&(d=(()=>{const n=t.getFormQuestionsData();/*#__PURE__*/return e.createElement(s.horizontalWizardNav?Et:gt,{currentStep:i,steps:n,onNavigate:m})})());const h=s.horizontalWizardNav;/*#__PURE__*/return e.createElement(O,{className:h?"":"flex-row p-3"},d,/*#__PURE__*/e.createElement("div",{className:h?"card-body p-3":d?"col-10 p-0 pl-3":"col-12 p-0"},(()=>{const n=t.getFormQuestionsData()[i];let r=o(n,ht);/*#__PURE__*/return e.createElement(r,{options:s,key:"step"+i,question:n,onNextStep:u,onPreviousStep:p,mapComponent:o,index:i,isFirstStep:0===i,isLastStep:i===t.getFormQuestionsData().length-1})})()))},At=/*#__PURE__*/e.forwardRef((t,s)=>{const{options:n}=e.useContext(Ee);/*#__PURE__*/return e.createElement(H,K({size:"xl",animation:!0},n.modalProps),/*#__PURE__*/e.createElement(H.Header,{closeButton:!0},/*#__PURE__*/e.createElement(H.Title,null,n.modalProps.title)),/*#__PURE__*/e.createElement(H.Body,{className:"overflow-hidden p-0"},t.children))});At.propTypes={children:a.element.isRequired};class _t extends e.Component{constructor(...t){super(...t),this.getFormData=()=>{const e=this.context.getData(),t=this.context.getFormQuestionsData();return Ne.buildQuestionAnswerModel(e,t)},this.getFormQuestionsData=()=>this.context.getFormQuestionsData(),this.handleStepChange=(e,t,s)=>{this.context.updateFormQuestionsData(t,Object.assign({},e,s))},this.renderWizardlessForm=()=>{const t=this.context.getFormQuestionsData();/*#__PURE__*/return e.createElement(J,{className:"p-3"},t.map((e,t)=>this._mapQuestion(e,t)))}}_mapQuestion(t,s){let n=this.props.mapComponent(t,dt);/*#__PURE__*/return e.createElement(n,{key:t["@id"],question:t,onChange:(e,s)=>this.handleStepChange(t,e,s),index:s})}render(){const{modalView:t}=this.props,s=this.context.getFormQuestionsData();if(!s.length)/*#__PURE__*/return e.createElement(J,{className:"p-3 font-italic"},"There are no questions available...");const n=s.every(e=>!le.isWizardStep(e));return t?/*#__PURE__*/e.createElement(At,null,n?this.renderWizardlessForm():/*#__PURE__*/e.createElement(St,null)):n?this.renderWizardlessForm():/*#__PURE__*/e.createElement(St,null)}}_t.contextType=pe;const ft=/*#__PURE__*/i((t,o)=>{const[r,i]=s(!0),[a,l]=s(null),[c,u]=s(null);if(n(()=>{(async()=>{const e=t.options.intl,[s,n]=await Te.constructForm(t.form,e);s.formQuestions.some(e=>le.isWizardStep(e))&&(s.formQuestions[0].visited=!0),l(s),u(n),i(!1)})()},[t.form]),r)return t.loader||/*#__PURE__*/e.createElement(O,{className:"p-3 font-italic"},"Loading SForms...");const p=((e,t)=>(s,n)=>{if(!e)return n;for(let{component:n,mapRule:o}of e)if(o(s,t))return n;return n})(t.componentMapRules,c);/*#__PURE__*/return e.createElement(Se,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:p,options:t.options},/*#__PURE__*/e.createElement(se,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(me,{data:c,formQuestions:a.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(_t,{ref:o,modalView:t.options&&t.options.modalView,mapComponent:p}))))});ft.propTypes={form:a.object.isRequired,options:a.object.isRequired,componentMapRules:a.array,components:a.object,componentsOptions:a.object,fetchTypeAheadValues:a.func,isFormValid:a.func,loader:a.element};var vt={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)"},Ct={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)"};const Tt=/*#__PURE__*/e.createContext({}),Nt=({children:e,locale:t=navigator.language})=>{let s=Ct;return t===oe.LANG.cs.locale&&(s=vt),Q(Tt.Provider,{value:{locale:t,lang:s},children:Q(G,{locale:t,messages:s,children:e})})};export{ct as Answer,Ee as ConfigurationContext,oe as Constants,pe as FormQuestionsContext,le as FormUtils,Ge as HelpIcon,Nt as IntlContextProvider,Ce as JsonLdFramingUtils,ie as JsonLdObjectMap,ae as JsonLdObjectUtils,dt as Question,lt as QuestionStatic,ht as WizardStep,ft as default};
|
|
1
|
+
import"core-js/modules/es.array.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.promise.js";import e,{useMemo as t,useState as s,useEffect as n,useContext as o,useRef as r,forwardRef as i}from"react";import a from"prop-types";import"core-js/modules/es.object.assign.js";import l from"jsonld";import c from"jsonld-utils";import"core-js/modules/es.array.sort.js";import u from"tsort";import p from"react-dom";import{Form as m,FormGroup as h,FormControl as d,FormText as E,OverlayTrigger as g,Tooltip as S,Col as A,Row as _,Button as f,Badge as v,Overlay as C,Popover as T,ListGroup as N,ListGroupItem as I,Card as O,Accordion as w,ButtonToolbar as L,Nav as b,NavItem as y,NavLink as R,Modal as H}from"react-bootstrap";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 D from"react-datepicker";import{format as x}from"date-fns";import U from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import V from"inputmask-core";import{IntelligentTreeSelect as M}from"intelligent-tree-select/lib/components/IntelligentTreeSelect.js";import"intelligent-tree-select/lib/styles.css";import"core-js/modules/es.regexp.to-string.js";import{jsx as P,jsxs as q}from"react/jsx-runtime";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.parse-int.js";import Q from"javascript-time-ago";import F from"javascript-time-ago/locale/en";import z from"javascript-time-ago/locale/cs";import{motion as k}from"framer-motion";import{Rings as j}from"react-loader-spinner";import"core-js/modules/es.string.trim.js";import{useIntl as B,IntlProvider as W}from"react-intl";import X from"classnames";import G from"react-bootstrap/Card";function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Y.apply(this,arguments)}function J(e,t){if(null==e)return{};var s,n,o={},r=Object.keys(e);for(n=0;n<r.length;n++)t.indexOf(s=r[n])>=0||(o[s]=e[s]);return o}class K{static log(e){console.log(e)}static warn(e){console.warn?console.warn(e):console.log("WARNING: "+e)}static error(e){console.error?console.error(e):console.log("ERROR: "+e)}}const Z=["children"],$=/*#__PURE__*/e.createContext({}),ee=s=>{let{children:n}=s,o=J(s,Z),r=[];const i=async(e,t)=>{const s=r[e];if(s&&s.length)return s;const n=await o.fetchTypeAheadValues(t);return n.length?new Promise(t=>{l.frame(n,{},null,(s,n)=>{const o=n["@graph"];return r.push(Object.assign({},o,{[e]:o})),t(o)})}):(K.warn(`No data received when loading options using id ${e}`),[])},a=e=>r[e]||[],c=t(()=>({loadFormOptions:i,getOptions:a}),[i,a]);/*#__PURE__*/return e.createElement($.Provider,Y({value:c},o),n)};var te;ee.propTypes={children:a.element.isRequired,fetchTypeAheadValues:a.func};class se{}te=se,se.COLUMN_COUNT=12,se.INPUT_LENGTH_THRESHOLD=50,se.DATETIME_NUMBER_FORMAT="x",se.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",se.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",se.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",se.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",se.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",se.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",se.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",se.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",se.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",se.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"]},se.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",se.VALUE_TYPE_CODE="code",se.VALUE_TYPE_TEXT="text",se.GENERATED_ROW_SIZE=1,se.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",se.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",se.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",se.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",se.HELP_DESCRIPTION="http://purl.org/dc/elements/1.1/description",se.SOURCE="http://purl.org/dc/elements/1.1/source",se.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",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},se.STEP="http://onto.fel.cvut.cz/ontologies/form/step",se.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",se.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",se.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",se.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",se.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",se.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",se.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",se.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",se.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",se.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",se.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",se.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",se.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",se.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",se.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",se.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",se.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",se.REQUIRES_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/requires-answer-value",se.REQUIRES_DESCRIPTION="http://onto.fel.cvut.cz/ontologies/form/requires-description",se.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",se.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",se.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",se.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",se.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",se.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",se.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",se.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",se.PREFIX="http://www.w3.org/ns/shacl#prefix",se.NAMESPACE="http://www.w3.org/ns/shacl#namespace",se.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",se.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",se.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",se.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",se.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",se.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",se.RDFS_LABEL=c.RDFS_LABEL,se.RDFS_COMMENT=c.RDFS_COMMENT,se.DEFAULT_HAS_CHILD=c.DEFAULT_HAS_CHILD,se.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink"},se.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},se.DEFAULT_OPTIONS={icons:[{id:te.ICONS.QUESTION_HELP,behavior:te.ICON_BEHAVIOR.ENABLE},{id:te.ICONS.QUESTION_COMMENTS,behavior:te.ICON_BEHAVIOR.ON_HOVER},{id:te.ICONS.QUESTION_LINK,behavior:te.ICON_BEHAVIOR.ON_HOVER}]},se.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}};class ne{static getStringHash(e){let t=0;const s=e?e.length:0;if(0===s)return t;for(let n=0;n<s;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}static asArray(e){return e?e.constructor===Array?e:[e]:[]}static findQuestionById(e,t,s,n,o){if(s&&t["@id"]===e)return t;const r=ne.asArray(t[se.HAS_SUBQUESTION]);if(n)for(let t of r){let s=ne.findQuestionById(e,t,!0,!1,!1);if(s)return s}if(o)for(let t of r){let s=ne.findQuestionById(e,t,!1,!0,!0);if(s)return s}return null}}class oe{static putObject(e,t){oe.objectMap[e]=t}static getObject(e){return oe.objectMap[e]}}oe.objectMap={};class re{static getFirstObject(e,t){const s=l.getValues(e,t);return 0===s.length?null:s[0]}static compareValues(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"])))||l.compareValues(e,t)}static toplogicalSort(e,t){let s;do{s=!1;for(let n=0;n<e.length;n++)for(let o=n;o<e.length;o++)if(e[n][t]&&("object"==typeof e[n][t]?e[n][t]["@id"]:e[n][t])===e[o]["@id"]){const t=e[n];e[n]=e[o],e[o]=t,s=!0;break}}while(s);return e}static orderPreservingToplogicalSort(e,t){const s=u(),n={};for(let o=0;o<e.length;o++){let r=e[o]["@id"];s.add(r),n[r]=e[o],ne.asArray(e[o][t]).map(e=>"object"==typeof e?e["@id"]:e).map(e=>[e,r]).forEach(e=>s.add(e))}let o=s.sort();for(let t=0;t<o.length;t++)e[t]=n[o[t]];return e}static getCompareLocalizedLabelFunction(e){return(t,s)=>{const n=c.getLocalized(t[c.RDFS_LABEL],e),o=c.getLocalized(s[c.RDFS_LABEL],e);return n<o?-1:n>o?1:0}}static orderByLocalizedLabels(e,t){return e.sort(re.getCompareLocalizedLabelFunction(t))}static checkId(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(e=>e["@id"]===t):e.constructor===Object?e["@id"]===t:void 0}}class ie{static isForm(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.FORM)}static isWizardStep(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.WIZARD_STEP)}static isSection(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.QUESTION_SECTION)}static isAnswerable(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.ANSWERABLE)}static isTypeahead(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.QUESTION_TYPEAHEAD)}static getPossibleValuesQuery(e){return c.getJsonAttValue(e,se.HAS_OPTIONS_QUERY)}static isDisabled(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DISABLED)}static isHidden(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.HIDDEN)}static isTextarea(e,t){return t&&t.length>se.INPUT_LENGTH_THRESHOLD&&!ie.isTypeahead(e)||c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TEXTAREA)}static isText(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TEXT)}static isCalendar(e){return ie.isDate(e)||ie.isTime(e)||ie.isDateTime(e)}static isDate(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DATE)}static isTime(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TIME)}static isDateTime(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DATETIME)}static isCheckbox(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.CHECKBOX)}static isMaskedInput(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.MASKED_INPUT)}static isSparqlInput(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.SPARQL)}static isTurtleInput(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TURTLE)}static isCollapsed(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.COLLAPSED)}static isEmphasised(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.EMPHASISED)}static getCategory(e){return se.LAYOUT.CATEGORY.find(t=>c.hasValue(e,se.LAYOUT_CLASS,t))}static resolveValue(e){return e?e[se.HAS_OBJECT_VALUE]?e[se.HAS_OBJECT_VALUE]["@id"]:c.getJsonAttValue(e,se.HAS_DATA_VALUE):null}static resolveValueObject(e){return e?e[se.HAS_OBJECT_VALUE]?ne.asArray(e[se.HAS_OBJECT_VALUE])[0]:e[se.HAS_DATA_VALUE]?ne.asArray(e[se.HAS_DATA_VALUE])[0]:null:null}static isRelevant(e){if(!e[se.IS_RELEVANT_IF])return!0;for(let t of ne.asArray(e[se.IS_RELEVANT_IF]))if(!ie.testCondition(t))return!1;return!0}static hasValidationLogic(e){return!!e[se.REQUIRES_ANSWER_VALUE]||!!e[se.REQUIRES_ANSWER]||!!e[se.REQUIRES_ANSWER_IF]}static isValid(e){if(!1===e[se.HAS_VALID_ANSWER])return!1;for(const t of ne.asArray(e[se.HAS_SUBQUESTION]))if(!1===this.isValid(t))return!1;return!0}static testOrCondition(e){const t=e[se.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(const e of this._getMappedObjectsArray(t))if(this.testCondition(e))return!0;return!1}static testCondition(e){const t=e[se.ACCEPTS_VALIDATION_VALUE],s=e[se.ACCEPTS_ANSWER_VALUE],n=e[se.ACCEPTS],o=e[se.HAS_TESTED_QUESTION];let r;if(e[se.HAS_SUB_CONDITION])return this.testOrCondition(e);if(t&&s&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),n&&o){const e=ne.asArray(n);if(1!==e.length&&console.warn("Support for multiple accepts values is not implemented !"),e[0]["@id"]===se.ANSWERED_QUESTION){(s||t)&&console.warn("Support for accepted answer/validations values is not implemented !");for(const e of this._getMappedObjectsArray(o))if(!this.hasAnswer(e))return!1;return!0}console.warn("No support to accept question of type "+e[0]["@id"]+" !")}if(t&&o){const e=ne.asArray(t);(1!==e.length||!0!==e[0]&&"true"!==e[0])&&console.warn('Validation values other than "true" are not implemented !');for(const e of ne.asArray(o)){if(r=oe.getObject(e["@id"]),void 0===r)return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(r))return!1}return!0}if(s&&o){r=oe.getObject(o["@id"]);for(const e of ne.asArray(s)){if(!r)return console.warn("Question is not defined."),!0;if(!r.hasOwnProperty(se.HAS_ANSWER))return!1;const t=l.getValues(r,se.HAS_ANSWER);if(0===t.length)return!1;const s=ie.resolveValueObject(t[0]);if(s&&e&&s.hasOwnProperty("@value")&&e.hasOwnProperty("@id")&&s["@value"]==e["@id"])return!0;if(re.compareValues(s,e))return!0}}return!1}static _getMappedObjectsArray(e,t){return ne.asArray(e).map(e=>{const s=oe.getObject(e["@id"]);return void 0===s?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):s}).filter(function(e){return null!==e})}static hasAnswer(e){if(!e)return!1;if(e.hasOwnProperty(se.HAS_ANSWER)){const t=l.getValues(e,se.HAS_ANSWER);if(t.length){const e=ie.resolveValueObject(t[0]);if(e&&(e["@value"]||e["@id"]))return!0}}for(const t of ne.asArray(e[se.HAS_SUBQUESTION]))if(ie.hasAnswer(t))return!0;return!1}static resolveDateTimeFormat(e,t,s){return"number"==typeof t?se.DATETIME_NUMBER_FORMAT:ie.isDate(e)?s.dateFormat:ie.isTime(e)?s.timeFormat:s.dateTimeFormat}}const ae={},le=[],ce=/*#__PURE__*/e.createContext({}),ue=o=>{const[r,i]=s(o.data||ae),[a,l]=s(o.formQuestions||le);n(()=>{if(o.isFormValid){const e=ie.isValid(r);o.isFormValid(e)}},[]),n(()=>{i(o.data||ae),l(o.formQuestions||le)},[o.data,o.formQuestions]);const c=e=>{e&&i(Object.assign({},r,e))},u=(e,t)=>{if(!t||e<0||e>=a.length)return;const s=[...a];if(s[e]=Object.assign({},s[e],t),l(s),o.isFormValid){const e=ie.isValid(r);o.isFormValid(e)}},p=()=>r,m=e=>null==e?a:a[e],h=t(()=>({updateData:c,updateFormQuestionsData:u,getData:p,getFormQuestionsData:m}),[m,p]);/*#__PURE__*/return e.createElement(ce.Provider,Y({value:h},o),o.children)};ue.propTypes={children:a.element.isRequired,data:a.object.isRequired,formQuestions:a.array.isRequired,isFormValid:a.func};class pe extends e.Component{constructor(e){super(e),this.state={cursorPosition:0}}focus(){p.findDOMNode(this.input).focus()}getInputDOMNode(){return p.findDOMNode(this.input)}componentDidUpdate(e,t,s){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()}fieldDidExpand(e){return"textarea"===this.props.type&&"textarea"!==e.type}fieldDidShrink(e){return"text"===this.props.type&&"text"!==e.type}updateFieldCursorPosition(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)}saveCursorPosition(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})}render(){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()}}_renderCheckbox(){/*#__PURE__*/return e.createElement(m.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)},/*#__PURE__*/e.createElement(m.Check,Y({type:"checkbox",ref:e=>this.input=e},this.props,{label:this.props.label})))}_renderRadio(){/*#__PURE__*/return e.createElement(h,{size:"small"},/*#__PURE__*/e.createElement(m.Check,Y({type:"radio",ref:e=>this.input=e},this.props,{label:this.props.label})))}_renderSelect(){/*#__PURE__*/return e.createElement(h,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(d,Y({as:"select",ref:e=>this.input=e},this.props),this.props.children),this.props.validation&&/*#__PURE__*/e.createElement(d.Feedback,null),this._renderHelp())}_renderLabel(){return this.props.label?/*#__PURE__*/e.createElement(m.Label,null,this.props.label):null}_renderTextArea(){/*#__PURE__*/return e.createElement(h,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(d,Y({ref:e=>this.input=e,as:"textarea"},this.props,{onChange:e=>this.saveCursorPosition(e)})),this.props.validation&&/*#__PURE__*/e.createElement(d.Feedback,null),this._renderHelp())}_renderHelp(){return this.props.help?/*#__PURE__*/e.createElement(E,null,this.props.help):null}_renderInput(){/*#__PURE__*/return e.createElement(h,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(d,Y({ref:e=>this.input=e,as:"input"},this.props,{onChange:e=>this.saveCursorPosition(e)})),this.props.validation&&/*#__PURE__*/e.createElement(d.Feedback,null),this._renderHelp())}}pe.propTypes={type:a.string,label:a.object,value:a.any,onChange:a.func,help:a.string,validation:a.oneOf(["success","warning","error"])},pe.defaultProps={type:"text"};const me=["children"],he=/*#__PURE__*/e.createContext({}),de={components:{inputComponent:pe},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm:ss",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},i18n:{"wizard.next":"Next","wizard.previous":"Previous","section.collapse":"Collapse","section.expand":"Expand"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableForwardSkip:!1,startingStep:0}},Ee=s=>{let{children:n}=s,o=J(s,me);const r=t(()=>({inputComponent:o.components&&o.components.inputComponent||de.components.inputComponent,componentsOptions:Object.assign({},de.componentsOptions,o.componentsOptions),options:Object.assign({},de.options,o.options),mapComponent:o.mapComponent}),[o]);/*#__PURE__*/return e.createElement(he.Provider,{value:r},n)};Ee.propTypes={children:a.element.isRequired,components:a.object,mapComponent:a.func,options:a.object};var ge,Se={"@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":""}}]}]}]};class Ae{static generateForm(){return JSON.parse(JSON.stringify(Se))}}const _e={root:{[se.HAS_LAYOUT_CLASS]:se.FORM},expandProperties:[se.HAS_SUBQUESTION,se.IS_RELEVANT_IF,se.HAS_ANSWER,se.HAS_DECLARED_PREFIX,se.HAS_OPTION,se.HAS_COMMENT]};class fe{static customFrame(e,t,s){if(arguments.length<2)return l.nextTick(function(){s(new TypeError("Could not frame, too few arguments."))});null===t&&(t=_e),l.flatten(e,null,null,(e,t)=>{})}static expandStructure(e){let t;const s={};e["@graph"].forEach(e=>{s[e["@id"]]=e,ie.isForm(e)&&(t=e)});try{this._expandGraph(t,_e,s)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return s}static _expandGraph(e,t,s){let n,o,r;t.expandProperties.forEach(i=>{if(e.hasOwnProperty(i)){e[i]=ne.asArray(e[i]),n=e[i];for(let e=0;e<n.length;e++)r=this._getId(n[e]),o=s[r],void 0!==o?(n[e]=o,this._expandGraph(o,t,s)):console.warn("object with @id "+r+" was not defined in input data.")}})}static _getId(e){return"string"==typeof e?e:e["@id"]}}ge=fe,fe.compressStructure=e=>{let t=[],s=new Set;return t=ge._compressGraph(e,t,s),t=t.sort((e,t)=>e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0),t},fe._compressGraph=(e,t,s)=>(s.has(e["@id"])||(t.push(e),s.add(e["@id"])),_e.expandProperties.forEach(n=>{if(e.hasOwnProperty(n)){const o=e[n];for(let r=0;r<o.length;r++){const i=o[r];void 0!==i&&(o[r]=i,t=ge._compressGraph(i,t,s),e[n][r]={"@id":i["@id"]})}}}),t);class ve{static constructDefaultForm(e){const t=Ae.generateForm();return ve._constructFormQuestions(t,e)}static constructForm(e,t){return new Promise(s=>l.flatten(e,{},null,(e,n)=>{let o,r;e&&K.error(e);try{const[e,s]=ve._constructFormQuestions(n,t);r=s,o={formQuestions:e}}catch(e){const[s,n]=ve.constructDefaultForm(t);r=n,o={formQuestions:s}}return s([o,r])}))}static _constructFormQuestions(e,t){let s,n,o,r=[];if(void 0!==e["@graph"][0]["@id"]?(o=fe.expandStructure(e),Object.keys(o).map(e=>{oe.putObject(e,o[e])})):console.warn("default form is constructed."),s=e["@graph"].find(e=>ie.isForm(e)),n=s[se.HAS_SUBQUESTION],!n)throw K.error("Could not find any questions in the received data."),"No questions in the form";return r=n.filter(e=>!(!ie.isWizardStep(e)||ie.isHidden(e))||(K.warn("Item is not a wizard step: "+e),!1)),r.length||(K.log("Could not find any wizard steps in the received data. Building form without steps"),s[se.HAS_SUBQUESTION].forEach(e=>r.push(e))),r.sort(re.getCompareLocalizedLabelFunction(t)),re.orderPreservingToplogicalSort(r,se.HAS_PRECEDING_QUESTION),[r,{root:s}]}}class Ce{static buildQuestionAnswerModel(e,t){const s={subQuestions:[]};let n;if(e&&(s.uri=e.root["@id"],s.origin=c.getJsonAttValue(e.root,se.HAS_QUESTION_ORIGIN,"@id")),t)for(let e=0;e<t.length;e++)n=Ce.processQuestionAnswerHierarchy(t[e]),n&&s.subQuestions.push(n);return s}static processQuestionAnswerHierarchy(e){return e?Ce._processQuestion(e):null}static _processQuestion(e){const t={};if(t.uri=e["@id"],t.origin=c.getJsonAttValue(e,se.HAS_QUESTION_ORIGIN,"@id"),e[se.HAS_SUBQUESTION]){t.subQuestions=[];for(let s=0;s<e[se.HAS_SUBQUESTION].length;s++)t.subQuestions.push(Ce._processQuestion(e[se.HAS_SUBQUESTION][s]))}if(e[se.HAS_ANSWER]){t.answers=[],Array.isArray(e[se.HAS_ANSWER])||(e[se.HAS_ANSWER]=[e[se.HAS_ANSWER]]);for(let s=0;s<e[se.HAS_ANSWER].length;s++)t.answers.push(Ce.processAnswer(e[se.HAS_ANSWER][s]))}if(e[se.HAS_COMMENT]){t.comments=[],Array.isArray(e[se.HAS_COMMENT])||(e[se.HAS_COMMENT]=[e[se.HAS_COMMENT]]);for(let s=0;s<e[se.HAS_COMMENT].length;s++)t.comments.push(Ce.processComment(e[se.HAS_COMMENT][s]))}return t}static processComment(e){const t={};return t.author=c.getJsonAttValue(e,se.HAS_AUTHOR,"@id"),t.value=c.getJsonAttValue(e,se.HAS_COMMENT_VALUE),t.timestamp=c.getJsonAttValue(e,se.HAS_TIMESTAMP,"@id"),t}static processAnswer(e){const t={};return t.uri=e["@id"],t.origin=c.getJsonAttValue(e,se.HAS_ANSWER_ORIGIN,"@id"),e[se.HAS_OBJECT_VALUE]?t.codeValue=c.getJsonAttValue(e,se.HAS_OBJECT_VALUE,"@id"):t.textValue=c.getJsonAttValue(e,se.HAS_DATA_VALUE),t}static generateAnswer(e){const t={};return t[se.HAS_DATA_VALUE]="",t}}class Te{static resolveValidationProperties(e){const t={};return!1===e[se.HAS_VALID_ANSWER]&&(t.validation="error",t.help=e[se.HAS_VALIDATION_MESSAGE]),t}}const Ne=t=>{const{inputComponent:s,componentsOptions:n}=o(he),r=t.question;/*#__PURE__*/return e.createElement(s,Object.assign({},Te.resolveValidationProperties(r),{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,onChange:e=>{t.onChange(e.target.checked)},disabled:n.readOnly||ie.isDisabled(r)}))};Ne.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.bool]),onChange:a.func.isRequired,mouseHover:a.bool};const Ie=t=>{const{componentsOptions:s}=o(he),n=ie.resolveDateTimeFormat(t.question,t.value,s.dateTimeAnswer),r=ie.isDate(t.question),i=ie.isTime(t.question);let a;a=i&&t.value?new Date(`0 ${t.value}`):t.value?new Date(t.value):null;const l="x"===n?s.dateTimeAnswer.dateTimeFormat:n;/*#__PURE__*/return e.createElement(h,{size:"small"},/*#__PURE__*/e.createElement(m.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(D,{selected:a,placeholderText:l.toUpperCase(),onChange:e=>{t.onChange(n===se.DATETIME_NUMBER_FORMAT?Number(e):x(e,n))},showTimeSelect:!r,showTimeSelectOnly:i,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:l,className:"form-control",disabled:s.readOnly||ie.isDisabled(t.question)}))};Ie.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};const Oe=[se.XSD.INT,se.XSD.INTEGER,se.XSD.NON_NEGATIVE_INTEGER,se.XSD.NON_POSITIVE_INTEGER,se.XSD.NEGATIVE_INTEGER,se.XSD.POSITIVE_INTEGER],we={};we[se.XSD.NON_NEGATIVE_INTEGER]={min:0},we[se.XSD.NON_POSITIVE_INTEGER]={max:0},we[se.XSD.NEGATIVE_INTEGER]={max:-1},we[se.XSD.POSITIVE_INTEGER]={min:1};const Le={"string-2":"prefixed",atom:"var"};class be{static _resolveInputType(e,t){return ie.isSparqlInput(e)||ie.isTurtleInput(e)||ie.isTextarea(e,t)?"textarea":be._isNumeric(e)?"number":"text"}static _isNumeric(e){for(let t=0,s=Oe.length;t<s;t++)if(c.hasValue(e,se.HAS_DATATYPE,Oe[t]))return!0;return!1}static resolveInputProperties(e,t,s){let n={};switch(n.type=be._resolveInputType(e,t),n.type){case"textarea":n.rows=5;break;case"number":n=Object.assign({},n,be._resolveNumberRestrictions(e),this._resolveStepRestriction(e))}return n.disabled=s.readOnly||ie.isDisabled(e),!1===e[se.HAS_VALID_ANSWER]&&(n.validation="error",n.help=e[se.HAS_VALIDATION_MESSAGE]),n}static _resolveStepRestriction(e){let t={};return void 0!==e[se.STEP]&&(t.step=c.getJsonAttValue(e,se.STEP)),t}static _resolveNumberRestrictions(e){let t={};return Object.getOwnPropertyNames(we).forEach(s=>{c.hasValue(e,se.HAS_DATATYPE,s)&&(t=Object.assign({},t,we[s]))}),void 0!==e[se.XSD.MIN_INCLUSIVE]&&(t.min=e[se.XSD.MIN_INCLUSIVE]),void 0!==e[se.XSD.MIN_EXCLUSIVE]&&(t.min=e[se.XSD.MIN_EXCLUSIVE]+1),void 0!==e[se.XSD.MAX_EXCLUSIVE]&&(t.max=e[se.XSD.MAX_EXCLUSIVE]-1),void 0!==e[se.XSD.MAX_INCLUSIVE]&&(t.max=e[se.XSD.MAX_INCLUSIVE]),t}}const ye=t=>{const{inputComponent:s,componentsOptions:n}=o(he),r=t.question,i=t.answer;let a=t.value;return i[se.HAS_OBJECT_VALUE]&&i[se.HAS_OBJECT_VALUE][c.RDFS_LABEL]&&(a=c.getJsonAttValue(i[se.HAS_OBJECT_VALUE],c.RDFS_LABEL)),/*#__PURE__*/e.createElement(s,Object.assign({},be.resolveInputProperties(r,a,n),{label:t.label,title:t.title,value:null==a?"":a,onChange:e=>{t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:e=>{if(t.sparql){const s=U.fromTextArea(e.target);s.setValue(a),s.on("change",()=>{t.onChange(s.getValue())}),U.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,s){if(!e.autocompleters.getTrie(s))return;if(!e.options.autocompleters||-1===e.options.autocompleters.indexOf(s))return;const n=e.getCursor(),o=e.getTokenAt(n);if("prefixed"===Le[o.type]){const r=o.string.indexOf(":");if(-1!==r){const i=e.getPreviousNonWsToken(n.line,o).string.toUpperCase(),a=e.getTokenAt({line:n.line,ch:o.start});if("PREFIX"!==i&&("ws"===a.type||null==a.type)){const n=o.string.substring(0,r+1);if(null==e.getPrefixesFromQuery()[n.slice(0,-1)])if(t.question[se.HAS_DECLARED_PREFIX]&&t.question[se.HAS_DECLARED_PREFIX].filter(e=>e[se.PREFIX]===n.slice(0,-1)).length){const s=t.question[se.HAS_DECLARED_PREFIX].filter(e=>e[se.PREFIX]===n.slice(0,-1)),o={};o[s[0][se.PREFIX]]=s[0][se.NAMESPACE],e.addPrefixes(o)}else{const t=e.autocompleters.getTrie(s).autoComplete(n);t.length>0&&e.addPrefixes(t[0])}}}}}}else if(t.turtle){console.log("TTL");const s=U.fromTextArea(e.target);s.setValue(a),s.on("change",()=>{t.onChange(s.getValue())})}}}))};ye.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};const Re={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"};class He{static mapMask(e){if(!e)return e;let t,s="";for(let n=0,o=e.length;n<o;n++)t=e.charAt(n),s+=Re[t]?Re[t]:t;return s}}const De=["size","placeholder"];function xe(e){let t,s,n,o;if(void 0!==e.selectionStart)t=e.selectionStart,s=e.selectionEnd;else try{e.focus(),n=e.createTextRange(),o=n.duplicate(),n.moveToBookmark(document.selection.createRange().getBookmark()),o.setEndPoint("EndToStart",n),t=o.text.length,s=t+n.text.length}catch(e){}return{start:t,end:s}}class Ue extends e.Component{constructor(e){super(e),this._updatePattern=e=>{this.mask.setPattern(He.mapMask(e.mask),{value:this.mask.getRawValue(),selection:xe(this.input)})},this._updateMaskSelection=()=>{this.mask.selection=xe(this.input)},this._updateInputSelection=()=>{!function(e,t){let s;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),s=e.createTextRange(),s.collapse(!0),s.moveStart("character",t.start),s.moveEnd("character",t.end-t.start),s.select())}catch(e){}}(this.input,this.mask.selection)},this._onChange=e=>{const t=this.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){const s=t.length-e.target.value.length;this._updateMaskSelection(),this.mask.selection.end=this.mask.selection.start+s,this.mask.backspace()}const s=this._getDisplayValue();e.target.value=s,s&&this._updateInputSelection()}this.props.onChange&&this.props.onChange(e)},this._onKeyDown=e=>{if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),this.mask.undo()&&(e.target.value=this._getDisplayValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),this.mask.redo()&&(e.target.value=this._getDisplayValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),this._updateMaskSelection(),this.mask.backspace())){const t=this._getDisplayValue();e.target.value=t,t&&this._updateInputSelection(),this.props.onChange&&this.props.onChange(e)}},this._onKeyPress=e=>{e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),this._updateMaskSelection(),this.mask.input(e.key)&&(e.target.value=this.mask.getValue(),this._updateInputSelection(),this.props.onChange&&this.props.onChange(e)))},this._onPaste=e=>{e.preventDefault(),this._updateMaskSelection(),this.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=this.mask.getValue(),setTimeout(this._updateInputSelection,0),this.props.onChange&&this.props.onChange(e))},this.mask=new V({pattern:He.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"})}componentDidUpdate(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(He.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(He.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(He.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()}_getDisplayValue(){const e=this.mask.getValue();return e===this.mask.emptyValue?"":e}focus(){this.input.focus()}blur(){this.input.blur()}render(){const t=this.props,{size:s,placeholder:n}=t,o=J(t,De),r=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},o,{ref:e=>{e&&(this.input=e.input?p.findDOMNode(e.input):e)},maxLength:r,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:n||this.mask.emptyValue,size:s||r,value:this._getDisplayValue(),type:"text"}))}}Ue.contextType=he,Ue.propTypes={mask:a.string.isRequired},Ue.defaultProps={value:""};const Ve=t=>{const{componentsOptions:s}=o(he),n=t.question,r=t.value,i=c.getJsonAttValue(n,se.INPUT_MASK);return i?/*#__PURE__*/e.createElement(Ue,{mask:i,value:r,label:t.label,title:t.title,placeholder:i,onChange:e=>t.onChange(e.target.value),disabled:s.readOnly||ie.isDisabled(n)}):(K.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(ye,t))};Ve.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};class Me extends e.Component{_generateSelectOptions(t){const s=[];t.sort(function(e,t){const s=c.getJsonAttValue(e,se.RDFS_LABEL),n=c.getJsonAttValue(t,se.RDFS_LABEL);return s<n?-1:s>n?1:0});for(let n=0;n<t.length;n++)s.push(/*#__PURE__*/e.createElement("option",{value:c.getJsonAttValue(t[n],se.RDFS_LABEL),key:"opt-"+n},c.getJsonAttValue(t[n],se.RDFS_LABEL)));return s}render(){const t=this.props.question;/*#__PURE__*/return e.createElement(this.context.inputComponent,{type:"select",label:this.props.label,value:this.props.value,title:this.props.title,onChange:e=>{this.props.onChange(e.target.value)},disabled:this.context.componentsOptions.readOnly||ie.isDisabled(t)},this._generateSelectOptions(t[se.HAS_OPTION]))}}Me.contextType=he,Me.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};const Pe=(e,t)=>e&&e.length?(e.sort(re.getCompareLocalizedLabelFunction(t)),re.orderPreservingToplogicalSort(e,se.HAS_PRECEDING_VALUE),c.processTypeaheadOptions(e,t)):[],qe=t=>{const r=ne.getStringHash(ie.getPossibleValuesQuery(t.question)),i=o($),a=o(he),l=a.options.intl,[c,u]=s(!0),[p,d]=s(Pe(t.options,l));return n(()=>{let e=!1;const s=t.question;return!s[se.HAS_OPTION]&&ie.getPossibleValuesQuery(s)?async function(){try{const t=await i.loadFormOptions(r,ie.getPossibleValuesQuery(s));e||(u(!1),d(Pe(t,l)))}catch(e){K.error(`An error has occurred during loadFormOptions for query hash: ${r}`)}}():(u(!1),d(Pe(s[se.HAS_OPTION],l))),()=>{e=!0}},[]),n(()=>{d(Pe(t.question[se.HAS_OPTION],l))},[l]),/*#__PURE__*/e.createElement(h,{size:"small"},/*#__PURE__*/e.createElement(m.Label,null,t.label),/*#__PURE__*/e.createElement(M,{valueKey:"name",labelKey:"name",valueIsControlled:!1,value:p.filter(e=>e.id===t.value),multi:!1,options:p,isSearchable:!0,isLoading:c,isClearable:!0,isDisabled:c||a.componentsOptions.readOnly||ie.isDisabled(t.question),onChange:e=>{t.onChange(e?e.id:null)}}))};qe.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.oneOfType([a.string,a.object]).isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};const Qe=({title:t})=>/*#__PURE__*/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||""),/*#__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"})),Fe=({title:t})=>/*#__PURE__*/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||""),/*#__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"})),ze=()=>/*#__PURE__*/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"})),ke=()=>/*#__PURE__*/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"})),je=t=>{const[n,o]=s("right");/*#__PURE__*/return e.createElement("span",{ref:e=>(e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?o("left"):o("right"))})(e)},/*#__PURE__*/e.createElement(g,{overlay:/*#__PURE__*/e.createElement(S,{className:"tooltip-content",id:t.id},t.tooltipContent),placement:t.overlayPlacement||n},/*#__PURE__*/e.createElement("span",null,t.children)))};je.propTypes={tooltipContent:a.oneOfType([a.object.isRequired,a.string.isRequired]),id:a.string.isRequired,overlayPlacement:a.string,absolutePosition:a.bool},je.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const Be=t=>{const[n,o]=s("right");/*#__PURE__*/return e.createElement("div",{ref:e=>(e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?o("left"):o("right"))})(e)},/*#__PURE__*/e.createElement(je,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||n,absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(ke,{className:t.iconClass})))};Be.propTypes={text:a.string.isRequired,iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Be.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const We=()=>/*#__PURE__*/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"})),Xe=t=>/*#__PURE__*/e.createElement(je,{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(We,{className:t.iconClass})));Xe.propTypes={url:a.oneOfType([a.string.isRequired,a.object.isRequired]),iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Xe.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};const Ge=()=>/*#__PURE__*/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"})),Ye=()=>/*#__PURE__*/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"})))),Je="Unknown author",Ke=t=>{const{options:n}=o(he),[r,i]=s(!1),[a,l]=s(!1);Q.addLocale(z),Q.addLocale(F),Q.setDefaultLocale(se.LANG.en.locale);const c=new Q(n.intl.locale),u=()=>{if(n&&n.users){const e=n.users.find(e=>e.id===n.currentUser);if(t.author)return e.label?e.label:p()}return Je},p=()=>t.author["@id"].replace(/.*[#\/]/,"... "),m=()=>{i(!r)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:m,onMouseLeave:m},/*#__PURE__*/e.createElement(e.Fragment,null,r?/*#__PURE__*/e.createElement(e.Fragment,null,u(),/*#__PURE__*/e.createElement(Xe,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():Je})):u())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},/*#__PURE__*/e.createElement(je,{id:"exact-time-overlay",tooltipContent:(()=>{const e=new Date(parseInt(t.timestamp));return new Intl.DateTimeFormat(n.intl.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(e)})()},c.format(parseInt(t.timestamp)))),a?/*#__PURE__*/e.createElement(k.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:()=>{t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(Ye,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};Ke.propTypes={author:a.object,timestamp:a.string.isRequired,commentValue:a.string.isRequired,onDeleteQuestionComment:a.func.isRequired,onDeleteViewComment:a.func,index:a.number.isRequired};const Ze=({comments:e,onDeleteCommentClick:t})=>{const o=r(null),[i,a]=s(!1),l=()=>{a(!0),setTimeout(()=>{a(!1)},2e3)};return n(()=>{null!==o.current&&(o.current.scrollTop=o.current.scrollHeight)},[JSON.stringify(e)]),P("span",{children:i?q("div",{className:"comment-delete",children:[P(j,{color:"#00BFFF",height:80,width:80}),P("p",{children:"Deleting comment..."})]}):P("div",{className:"comment-list-items",ref:o,children:e.map((e,s)=>P("div",{className:"comment-list-item",children:P(Ke,{commentValue:e[se.HAS_COMMENT_VALUE],author:e[se.HAS_AUTHOR]?e[se.HAS_AUTHOR]:null,timestamp:e[se.HAS_TIMESTAMP],onDeleteQuestionComment:t,onDeleteViewComment:l,index:s})},s))})})},$e=()=>/*#__PURE__*/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"})),et="300px",tt=t=>{const[o,i]=s(""),a=r(null),l=B();n(()=>{a.current.focus()},[]);const c=e=>{e.preventDefault(),t.onChange(o),i("")},u=()=>{const e=a.current;e.style.height="auto",p(e)},p=e=>{e.style.height=`${e.scrollHeight}px`,parseInt(e.style.height)>parseInt(et)&&(e.style.height=et)};/*#__PURE__*/return e.createElement(m,{onSubmit:c,onKeyUp:e=>{"Enter"===e.key&&e.ctrlKey&&o.trim()&&c(e)},onClick:e=>{e.stopPropagation()}},/*#__PURE__*/e.createElement(m.Group,{className:"m-2",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(A,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(_,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(m.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:l.formatMessage({id:"comment.form.placeholder"}),required:!0,value:o,onChange:e=>{i(e.target.value)},ref:a,onKeyPress:u,onKeyDown:u}),/*#__PURE__*/e.createElement(f,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement($e,null)))))))};tt.propTypes={onChange:a.func.isRequired};const st=()=>/*#__PURE__*/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"})),nt=t=>{const i=o(he),a=r(null),l=r(null),c=r(null),[u,p]=s(!1),[m,h]=s("right");n(()=>{N(c.current)});const d=()=>{p(!1)},E=()=>{const e=t.question;return e[se.HAS_COMMENT]||(e[se.HAS_COMMENT]=[]),Array.isArray(e[se.HAS_COMMENT])||(e[se.HAS_COMMENT]=[e[se.HAS_COMMENT]]),e[se.HAS_COMMENT]},g=e=>{const s={};A(s,e),t.onChange(T(),s)},A=(e,t)=>{i.options.currentUser&&(e[se.HAS_AUTHOR]={"@id":i.options.currentUser}),e[se.HAS_COMMENT_VALUE]=t,e[se.HAS_TIMESTAMP]=Date.now().toString()},_=e=>{E().splice(e,1)},f=e=>{e.preventDefault(),e.stopPropagation()},T=()=>E().length,N=e=>{e&&(e.getBoundingClientRect().x>window.innerWidth/2?h("left"):h("right"))};/*#__PURE__*/return e.createElement("div",{ref:c,onClick:f},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:a,onClick:e=>{f(e),p(!u)}},/*#__PURE__*/e.createElement(Ge,null),T()>0?/*#__PURE__*/e.createElement(v,{className:"comment-badge",pill:!0,variant:"primary"},T()):null),/*#__PURE__*/e.createElement(k.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:a.current,show:u,placement:m,rootClose:!1,onHide:d,container:l},t=>/*#__PURE__*/e.createElement(S,Y({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:e=>{(e=>{"Escape"===e.key&&d()})(e)}},/*#__PURE__*/e.createElement(k.div,{className:"close-comment-icon",onClick:d,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(st,null)),/*#__PURE__*/e.createElement(Ze,{comments:E(),onDeleteCommentClick:_}),/*#__PURE__*/e.createElement(tt,{onChange:g}))))))};var ot;nt.propTypes={question:a.object.isRequired,onChange:a.func.isRequired};class rt{static renderIcons(t,s,n,o){let r;r=s.icons?s.icons:se.DEFAULT_OPTIONS.icons;let i=[];const a=this.renderQuestionHelp(t,s,n,o),l=this.renderQuestionComments(t,s,n,o),c=this.renderQuestionLink(t,s,n,o);for(let t=0;t<r.length;t++)r[t].id===se.ICONS.QUESTION_COMMENTS&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},l)),r[t].id===se.ICONS.QUESTION_HELP&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},a)),r[t].id===se.ICONS.QUESTION_LINK&&i.push(/*#__PURE__*/e.createElement("li",{key:t,className:"icon-list-item"},c));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},i)}static renderQuestionHelp(e,t,s,n){return this.getIconComponentFromName(se.ICONS.QUESTION_HELP,e,t,s,n)}static renderQuestionLink(e,t,s,n){return this.getIconComponentFromName(se.ICONS.QUESTION_LINK,e,t,s,n)}static getIconComponentFromName(e,t,s,n,o){const r=this.getIconFromIconList(s.icons?s.icons:se.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(r,t,s,n,o)}static getIconComponent(t,s,n,o,r){let i;if(t&&(t.behavior===se.ICON_BEHAVIOR.ON_HOVER||t.behavior===se.ICON_BEHAVIOR.ENABLE))return t.behavior===se.ICON_BEHAVIOR.ENABLE?(r=!0,i=""):i="emphasise-on-relevant-icon",t.id===se.ICONS.QUESTION_HELP&&s[se.HELP_DESCRIPTION]?r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(Be,{text:c.getLocalized(s[se.HELP_DESCRIPTION],n.intl),absolutePosition:!1})):null:t.id===se.ICONS.QUESTION_LINK&&s[se.SOURCE]?r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(Xe,{url:s[se.SOURCE]})):null:t.id===se.ICONS.QUESTION_COMMENTS&&r?/*#__PURE__*/e.createElement("div",{className:i},/*#__PURE__*/e.createElement(nt,{question:s,onChange:o})):null}}ot=rt,rt.renderQuestionComments=(e,t,s,n)=>ot.getIconComponentFromName(se.ICONS.QUESTION_COMMENTS,e,t,s,n),rt.getIconFromIconList=(e,t)=>e?e.find(e=>e.id===t):null;const it=t=>{const s=e.useContext($),{options:n}=e.useContext(he),o=e=>{const s=Object.assign({},t.answer);r(s,e),t.onChange(t.index,s)},r=(e,s)=>{null===s?(e[se.HAS_OBJECT_VALUE]=null,e[se.HAS_DATA_VALUE]=null):t.answer[se.HAS_OBJECT_VALUE]||ie.isTypeahead(t.question)?e[se.HAS_OBJECT_VALUE]={"@id":s}:e[se.HAS_DATA_VALUE]={"@value":s}},i=t.question,a=ie.resolveValue(t.answer),l=(s=>{const o=c.getLocalized(s[se.RDFS_LABEL],n.intl);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,rt.renderIcons(t.question,n,t.onCommentChange,t.showIcon))})(i),u=c.getLocalized(i[se.RDFS_COMMENT],n.intl);let p;var m;return p=ie.isTypeahead(i)?((n,r,i)=>{const a=ne.getStringHash(ie.getPossibleValuesQuery(t.question)),l=s.getOptions(a)||[];/*#__PURE__*/return e.createElement(qe,{question:t.question,answer:t.answer,label:r,title:i,value:n,onChange:o,options:l})})(a,l,u):(m=i)[se.HAS_OPTION]&&0!==m[se.HAS_OPTION].length?((s,n,r)=>/*#__PURE__*/e.createElement(Me,{question:t.question,label:n,title:r,value:s,onChange:o}))(a,l,u):ie.isCalendar(i)?((s,n,r)=>/*#__PURE__*/e.createElement(Ie,{question:t.question,value:s,title:r,label:n,onChange:o}))(a,l,u):ie.isCheckbox(i)?((s,n,r)=>/*#__PURE__*/e.createElement(Ne,{label:n,title:r,value:s,onChange:o,question:t.question}))(a,l,u):ie.isMaskedInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(Ve,{label:n,title:r,value:s,onChange:o,question:t.question,answer:t.answer}))(a,l,u):ie.isSparqlInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(ye,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o,sparql:!0}))(a,l,u):ie.isTurtleInput(i)?((s,n,r)=>/*#__PURE__*/e.createElement(ye,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o,turtle:!0}))(a,l,u):((s,n,r)=>/*#__PURE__*/e.createElement(ye,{question:t.question,answer:t.answer,label:n,title:r,value:s,onChange:o}))(a,l,u),p};it.propTypes={answer:a.object.isRequired,question:a.object.isRequired,onChange:a.func.isRequired,onCommentChange:a.func.isRequired,index:a.number,icons:a.object};class at{static createValidator(e,t){return e[se.REQUIRES_ANSWER]?ie.isCheckbox(e)?at._generateRequiresAnswerCheckBoxValidator(e,t):at._generateRequiresAnswerValidator(e,t):()=>{const e={};return e[se.HAS_VALID_ANSWER]=!0,delete e[se.HAS_VALIDATION_MESSAGE],e}}static _generateRequiresAnswerValidator(e,t){return s=>{let n=null;s[se.HAS_DATA_VALUE]?n=c.getJsonAttValue(s,se.HAS_DATA_VALUE):s[se.HAS_OBJECT_VALUE]&&(n=c.getJsonAttValue(s,se.HAS_OBJECT_VALUE,"@id"));const o=null!=n&&""!==n,r={};return r[se.HAS_VALID_ANSWER]=o,r[se.HAS_VALIDATION_MESSAGE]=o?null:c.getLocalized(e[c.RDFS_LABEL],t)+" is missing a value.",r}}static _generateRequiresAnswerCheckBoxValidator(e,t){return s=>{let n=null;s[se.HAS_DATA_VALUE]?n=c.getJsonAttValue(s,se.HAS_DATA_VALUE):s[se.HAS_OBJECT_VALUE]&&(n=c.getJsonAttValue(s,se.HAS_OBJECT_VALUE,"@id"));const o=null!=n&&""!==n&&!1!==n,r={};return r[se.HAS_VALID_ANSWER]=o,r[se.HAS_VALIDATION_MESSAGE]=o?null:c.getLocalized(e[c.RDFS_LABEL],t)+" must be checked.",r}}}class lt extends e.Component{constructor(e){super(e),this.state={prefixes:e.prefixes}}render(){const t=/*#__PURE__*/e.createElement(T,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(N,null,this.state.prefixes.sort((e,t)=>e[se.PREFIX]<t[se.PREFIX]?-1:1).map(t=>/*#__PURE__*/e.createElement(I,{key:t[se.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[se.PREFIX]),": ",t[se.NAMESPACE]))));/*#__PURE__*/return e.createElement(g,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))}}lt.propTypes={prefixes:a.array.isRequired,children:a.element.isRequired,iconClass:a.string},lt.defaultProps={iconClass:""};const ct=({question:e})=>(()=>{const t=e[se.HAS_MEDIA_CONTENT];return t?Array.isArray(t)?P("div",{className:"col-6",children:t.map((e,s)=>P("div",{className:"row embed-responsive-21by9 media-content-video-container mb-3",children:P("iframe",{src:t[s],className:"embed-responsive-item",allowFullScreen:!0})},s))}):P("div",{className:"col-6",children:P("iframe",{src:t,className:"embed-responsive-item",allowFullScreen:!0})}):null})();class ut extends e.Component{constructor(e){super(e),this.handleAnswerChange=(e,t)=>{if(ie.isSection(this.props.question)){let e=!!ie.resolveValue(t);this.setState({expanded:e})}this._handleChange(se.HAS_ANSWER,e,t)},this.handleSubQuestionChange=(e,t)=>{this._handleChange(se.HAS_SUBQUESTION,e,t)},this.handleCommentChange=(e,t)=>{this._handleChange(se.HAS_COMMENT,e,t)},this._toggleCollapse=()=>{this.props.collapsible&&this.setState({expanded:!this.state.expanded})},this._onMouseEnterHandler=()=>{this.setState({showIcon:!0})},this._onMouseLeaveHandler=()=>{this.setState({showIcon:!1})},this._getHeaderClassName=()=>{const e=this.props.question,t=this.props.collapsible;let s=[];return s.push(ut.getEmphasizedOnRelevantClass(e),"question-header"),ie.isWizardStep(e)&&s.push("wizard-step bg-primary text-white"),ie.isEmphasised(e)&&s.push(ut.getEmphasizedClass(e)),ie.isSection(e)&&s.push("section-background"),t&&s.push("cursor-pointer"),this.isDebugged(e)&&s.push("show-irrelevant"),s},oe.putObject(e.question["@id"],e.question),this.state={validator:null,expanded:!ie.isCollapsed(e.question),showIcon:!1}}componentDidMount(){this.setState({validator:at.createValidator(this.props.question,this.context.options.intl)})}componentDidUpdate(){const e=this.props.question,t=this.context.options.startingQuestionId,s=e[se.HAS_SUBQUESTION].find(e=>e["@id"]===t);if(ie.isSection(e)&&ie.isAnswerable(e)){const e=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(s)return null;this.state.expanded&&!e&&this.setState({expanded:!1})}}_handleChange(e,t,s){let n=Object.assign({},this.props.question);if(n[e][t]=s,e===se.HAS_ANSWER){const e=this.state.validator(s);n=Object.assign({},n,e)}oe.putObject(n["@id"],n),this.props.onChange(this.props.index,n)}isDebugged(e){const t=this.context.options.startingQuestionId;return!ie.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!ne.findQuestionById(t,e,!0,!1,!1))}render(){const t=this.props.question,s=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},s):ie.isHidden(t)?null:ie.isRelevant(t)?s:null}renderQuestion(t){if(ie.isAnswerable(t)&&!ie.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(ie.isAnswerable(t))return this.renderAnswerableSection();if(ie.isSection(t)){const{collapsible:s,withoutCard:n}=this.props,o=ut._getQuestionCategoryClass(t);if(n)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());const r=c.getLocalized(t[c.RDFS_LABEL],this.context.options.intl),i=/*#__PURE__*/e.createElement(O.Body,{className:X("p-3",o)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(w,{defaultActiveKey:this.state.expanded?void 0:r},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(w.Toggle,{as:O.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("h6",{className:"d-inline",id:t["@id"]},s&&!ie.isWizardStep(t)&&this._renderCollapseToggle(),r),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(s?w.Collapse:e.Fragment,null,i))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())}_renderQuestionContent(){let t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(ct,{key:this.props.question["@id"]+"-media",question:this.props.question})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t}renderQuestionIcons(){return rt.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon)}renderAnswerableSection(){const t=this.props.question,s=this.props.collapsible,n=ut._getQuestionCategoryClass(t);let o=this.getShowIrrelevantClassname(t);const r=/*#__PURE__*/e.createElement(O.Body,{className:X("p-3",n)},this.renderSubQuestions(o));/*#__PURE__*/return e.createElement(w,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(O.Header,{onClick:this._toggleCollapse,className:this._getHeaderClassName()},this.renderAnswers()),s?/*#__PURE__*/e.createElement(w.Collapse,{className:o,eventKey:t["@id"]},r):{cardBody:r}))}getShowIrrelevantClassname(e){return!this.context.options.debugMode&&!re.checkId(e[se.HAS_SUBQUESTION],this.context.options.startingQuestionId)||ie.hasAnswer(e)?"":"show-irrelevant"}renderAnswers(){const t=this.props.question,s=[],n=this._getAnswers();let o;for(let r=0,i=n.length;r<i;r++)ie.isTextarea(t,ie.resolveValue(n[r]))||ie.isSparqlInput(t)||ie.isTurtleInput(t),o=X("answer",ut._getQuestionCategoryClass(t),ut.getEmphasizedOnRelevantClass(t)),s.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+r,className:o,id:t["@id"],onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(it,{index:r,answer:n[r],question:t,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon})),this._renderUnits(),this._renderPrefixes()));return s}_getAnswers(){const e=this.props.question;return e[se.HAS_ANSWER]||(e[se.HAS_ANSWER]=[]),Array.isArray(e[se.HAS_ANSWER])||(e[se.HAS_ANSWER]=[e[se.HAS_ANSWER]]),0===e[se.HAS_ANSWER].length&&(e[se.HAS_ANSWER]=ie.isSection(e)&&!ie.isAnswerable(e)?[]:[Ce.generateAnswer(e)]),e[se.HAS_ANSWER]}_getAnswerWidthStyle(){const e=Number(this.props.question[se.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:`calc(${e}ch + 1.5rem + 2px)`}:{}}static _getAnswerClass(e,t){return t?"col-12":1===se.GENERATED_ROW_SIZE?"col-6":"col-"+se.COLUMN_COUNT/se.GENERATED_ROW_SIZE}static _getQuestionCategoryClass(e){const t=ie.getCategory(e);return t?"question-"+t:""}static getEmphasizedClass(e){return ie.isEmphasised(e)?"bg-warning":""}static getEmphasizedOnRelevantClass(e){return c.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""}_renderCollapseToggle(){const{options:t}=this.context,s=this.state.expanded?t.i18n["section.collapse"]:t.i18n["section.expand"];/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:s},/*#__PURE__*/e.createElement(this.state.expanded?Qe:Fe,{title:s}))}_renderPrefixes(){const t=this.props.question;return t[se.HAS_DECLARED_PREFIX]&&t[se.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(lt,{prefixes:t[se.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(ze,null)):null}_renderUnits(){const t=this.props.question;return t[se.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[se.HAS_UNIT]):null}renderSubQuestions(t){const s=[],n=this._getSubQuestions(),o=this.context.options.debugMode,r=this.context.options.startingQuestionId;for(let i=0;i<n.length;i++){let a=n[i],l=this.context.mapComponent(a,ut),c=null;(o||"show-irrelevant"!==t||ne.findQuestionById(r,a,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(l,{key:"sub-question-"+i,question:a,onChange:this.handleSubQuestionChange,index:i})),s.push(c)}return s}_getSubQuestions(){const e=this.props.question;return e[se.HAS_SUBQUESTION]||(e[se.HAS_SUBQUESTION]=[]),Array.isArray(e[se.HAS_SUBQUESTION])||(e[se.HAS_SUBQUESTION]=[e[se.HAS_SUBQUESTION]]),re.orderByLocalizedLabels(e[se.HAS_SUBQUESTION],this.context.options.intl),re.orderPreservingToplogicalSort(e[se.HAS_SUBQUESTION],se.HAS_PRECEDING_QUESTION),e[se.HAS_SUBQUESTION]}_getFirstAnswerValue(){return ie.resolveValue(this._getAnswers()[0])}}ut.contextType=he,ut.propTypes={question:a.object.isRequired,onChange:a.func.isRequired,index:a.number,withoutCard:a.bool,collapsible:a.bool},ut.defaultProps={withoutCard:!1,collapsible:!0};class pt extends e.Component{constructor(t){super(t),this.onNextStep=()=>{this.context.updateFormQuestionsData(this.props.index,this.context.getFormQuestionsData()),this.props.onNextStep()},this.onPreviousStep=()=>{this.props.onPreviousStep()},this._renderWizardStepButtons=()=>/*#__PURE__*/e.createElement(L,{className:"m-3 float-right"},!this.props.isFirstStep&&/*#__PURE__*/e.createElement(f,{className:"mr-2",onClick:this.onPreviousStep,variant:"primary",size:"sm"},this.props.options.i18n["wizard.previous"]),!this.props.isLastStep&&/*#__PURE__*/e.createElement(f,{onClick:this.onNextStep,variant:"primary",size:"sm"},this.props.options.i18n["wizard.next"])),this.onChange=(e,t)=>{this.context.updateFormQuestionsData(this.props.index||e,Object.assign({},this.props.question,t))}}render(){const t=this.context.getFormQuestionsData([this.props.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(ut,{question:t,onChange:this.onChange,collapsible:ie.isAnswerable(t)}),this.props.options.wizardStepButtons&&this._renderWizardStepButtons())}}pt.propTypes={options:a.object.isRequired,question:a.object.isRequired,index:a.number.isRequired,onNextStep:a.func,onPreviousStep:a.func,mapComponent:a.func,isFirstStep:a.bool,isLastStep:a.bool},pt.contextType=ce;const mt=({steps:t,onNavigate:s,currentStep:n})=>{const{options:r}=o(he);/*#__PURE__*/return e.createElement(O.Header,null,/*#__PURE__*/e.createElement(b,{variant:"tabs",activeKey:n,onSelect:e=>s(parseInt(e))},t.map((t,s)=>/*#__PURE__*/e.createElement(y,{key:"nav"+s,id:"wizard-nav-"+s},/*#__PURE__*/e.createElement(R,{eventKey:s,active:s===n?"active":"",hidden:!r.debugMode&&!ie.isRelevant(t),className:X([r.debugMode&&!ie.isRelevant(t)?"show-irrelevant":ut.getEmphasizedClass(t),"wizard-nav"])},c.getLocalized(t[c.RDFS_LABEL],r.intl))))))};mt.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};const ht=({steps:t,onNavigate:s,currentStep:n})=>{const{options:r}=o(he);/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(N,null,t.map((t,o)=>/*#__PURE__*/e.createElement(I,{hidden:!r.debugMode&&!ie.isRelevant(t),key:"nav"+o,onClick:()=>s(o),id:"wizard-nav-"+o,action:!0,active:o===n?"active":"",variant:"default",className:X([r.debugMode&&!ie.isRelevant(t)?"show-irrelevant":ut.getEmphasizedClass(t),"wizard-nav"])},c.getLocalized(t[c.RDFS_LABEL],r.intl)))))};ht.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};const dt=()=>{const t=e.useContext(ce),{options:s,mapComponent:o}=e.useContext(he);let r=0;s.startingQuestionId?(r=((e,t)=>{const s=(e,n)=>e?e["@id"]===t?n:ne.asArray(e[se.HAS_SUBQUESTION]).findIndex((e,t)=>-1!==s(e,t)):-1;return e.findIndex((e,t)=>-1!==s(e,t))})(t.getFormQuestionsData(),s.startingQuestionId),-1===r&&(console.warn(`Question with id ${s.startingQuestionId} not found!`),r=0)):s.startingStep&&(r=s.startingStep<t.getFormQuestionsData().length?s.startingStep:0);const[i,a]=e.useState(r),[l,c]=e.useState(!1);n(()=>{if(s.startingQuestionId&&!l){const e=document.getElementById(s.startingQuestionId);e&&(e.scrollIntoView(),e.classList.add("text-danger"),c(!0))}});const u=()=>{const e=t.getFormQuestionsData();i!==e.length-1&&(e[i+1].visited=!0,a(e=>e+1))},p=()=>{0!==i&&a(e=>e-1)},m=e=>{const n=t.getFormQuestionsData();e===i||e>=n.length||e>i&&!n[e].visited&&!s.enableForwardSkip||a(e)};let h=null;t.getFormQuestionsData().length>1&&(h=(()=>{const n=t.getFormQuestionsData();/*#__PURE__*/return e.createElement(s.horizontalWizardNav?mt:ht,{currentStep:i,steps:n,onNavigate:m})})());const d=s.horizontalWizardNav;/*#__PURE__*/return e.createElement(O,{className:d?"":"flex-row p-3"},h,/*#__PURE__*/e.createElement("div",{className:d?"card-body p-3":h?"col-10 p-0 pl-3":"col-12 p-0"},(()=>{const n=t.getFormQuestionsData()[i];let r=o(n,pt);/*#__PURE__*/return e.createElement(r,{options:s,key:"step"+i,question:n,onNextStep:u,onPreviousStep:p,mapComponent:o,index:i,isFirstStep:0===i,isLastStep:i===t.getFormQuestionsData().length-1})})()))},Et=/*#__PURE__*/e.forwardRef((t,s)=>{const{options:n}=e.useContext(he);/*#__PURE__*/return e.createElement(H,Y({size:"xl",animation:!0},n.modalProps),/*#__PURE__*/e.createElement(H.Header,{closeButton:!0},/*#__PURE__*/e.createElement(H.Title,null,n.modalProps.title)),/*#__PURE__*/e.createElement(H.Body,{className:"overflow-hidden p-0"},t.children))});Et.propTypes={children:a.element.isRequired};class gt extends e.Component{constructor(...t){super(...t),this.getFormData=()=>{const e=this.context.getData(),t=this.context.getFormQuestionsData();return Ce.buildQuestionAnswerModel(e,t)},this.getFormQuestionsData=()=>this.context.getFormQuestionsData(),this.handleStepChange=(e,t,s)=>{this.context.updateFormQuestionsData(t,Object.assign({},e,s))},this.renderWizardlessForm=()=>{const t=this.context.getFormQuestionsData();/*#__PURE__*/return e.createElement(G,{className:"p-3"},t.map((e,t)=>this._mapQuestion(e,t)))}}_mapQuestion(t,s){let n=this.props.mapComponent(t,ut);/*#__PURE__*/return e.createElement(n,{key:t["@id"],question:t,onChange:(e,s)=>this.handleStepChange(t,e,s),index:s})}render(){const{modalView:t}=this.props,s=this.context.getFormQuestionsData();if(!s.length)/*#__PURE__*/return e.createElement(G,{className:"p-3 font-italic"},"There are no questions available...");const n=s.every(e=>!ie.isWizardStep(e));return t?/*#__PURE__*/e.createElement(Et,null,n?this.renderWizardlessForm():/*#__PURE__*/e.createElement(dt,null)):n?this.renderWizardlessForm():/*#__PURE__*/e.createElement(dt,null)}}gt.contextType=ce;const St=/*#__PURE__*/i((t,o)=>{const[r,i]=s(!0),[a,l]=s(null),[c,u]=s(null);if(n(()=>{(async()=>{const e=t.options.intl,[s,n]=await ve.constructForm(t.form,e);s.formQuestions.some(e=>ie.isWizardStep(e))&&(s.formQuestions[0].visited=!0),l(s),u(n),i(!1)})()},[t.form]),r)return t.loader||/*#__PURE__*/e.createElement(O,{className:"p-3 font-italic"},"Loading SForms...");const p=((e,t)=>(s,n)=>{if(!e)return n;for(let{component:n,mapRule:o}of e)if(o(s,t))return n;return n})(t.componentMapRules,c);/*#__PURE__*/return e.createElement(Ee,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:p,options:t.options},/*#__PURE__*/e.createElement(ee,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(ue,{data:c,formQuestions:a.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(gt,{ref:o,modalView:t.options&&t.options.modalView,mapComponent:p}))))});St.propTypes={form:a.object.isRequired,options:a.object.isRequired,componentMapRules:a.array,components:a.object,componentsOptions:a.object,fetchTypeAheadValues:a.func,isFormValid:a.func,loader:a.element};var At={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)"},_t={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)"};const ft=/*#__PURE__*/e.createContext({}),vt=({children:e,locale:t=navigator.language})=>{let s=_t;return t===se.LANG.cs.locale&&(s=At),P(ft.Provider,{value:{locale:t,lang:s},children:P(W,{locale:t,messages:s,children:e})})};export{it as Answer,he as ConfigurationContext,se as Constants,ce as FormQuestionsContext,ie as FormUtils,Be as HelpIcon,vt as IntlContextProvider,fe as JsonLdFramingUtils,oe as JsonLdObjectMap,re as JsonLdObjectUtils,ut as Question,rt as QuestionStatic,pt as WizardStep,St as default};
|
|
2
2
|
//# sourceMappingURL=s-forms.modern.js.map
|